Commit Graph

640 Commits

Author SHA1 Message Date
Philipp Fromme f047fefd89 fix(update-properties-handler): fix typo 2018-01-31 18:21:16 +01:00
Nico Rehwaldt cbb2f9f600 fix(modeling): correct DI updating
Don't assign <di> property to businessObject; will
be serialized as di="[Object...]" otherwise.

Closes #756
2018-01-31 12:22:31 +01:00
Nico Rehwaldt 3124f9ba96 chore(modeling): minor SetColorHandler cleanup 2018-01-31 12:16:08 +01:00
Nico Rehwaldt f1daf4841f fix(modeling): support newBounds
This fixes a bug where Modeling#updateLabel would not work on
text annotations, because these need to have labels pre-configured.

* Modeling#updateLabel now takes the (optional) newBounds
* newBounds must now explicitly be passed to trigger resize
  for text annotations
* newBounds is _only_ passed for text annotations via
  LabelEditingProvider (it was discarded before anyway)
* lib/features/label-editing did not depend on lib/features/modeling
  for historical reasons. It now uses the offical #updateLabel
  API provided by Modeling
* Localize test diagrams

Closes #753
2018-01-29 17:20:41 +01:00
Nico Rehwaldt d32da90013 chore(lint): bump eslint
...and fix lint errors
2018-01-28 20:35:04 +01:00
Nico Rehwaldt 49cc8dc7ea chore(lint): disallow trailing spaces
+ format lint rules
+ fix lint error
2018-01-24 11:41:57 +01:00
Nico Rehwaldt 729ddce821 fix(copy-paste): don't override descriptor <type> property
This is redundant anyway, as we take the type + additional
information from the to-be-copied business object.

Closes #751
2018-01-18 11:22:09 +01:00
Nico Rehwaldt 1f5c69a58b fix(modeling): create ConditionalEventDefinition with condition
This ensures we always create valid BPMN 2.0 XML when
creating conditional start and intermediate events.

Closes #747
2018-01-03 14:19:01 +01:00
Nico Rehwaldt f15407d95b chore(Viewer): inline logo as SVG
Make logo retina friendly and save 30 bytes.

Closes #119
2018-01-02 13:46:15 +01:00
Nico Rehwaldt 562674e74b chore(project): bump diagram-js dependency
Fixes text sometimes being selected during dragging.

* makes a ContextPad hack obsolete, too.
2017-12-22 15:49:00 +01:00
Nico Rehwaldt 367399d509 feat(rules): support attach from context-menu
* take target attach and parent hints on `connection.create`
  rule into account to implement create from context-menu

Related to bpmn-io/diagram-js#242

Closes #742
2017-12-22 10:32:54 +01:00
Nico Rehwaldt 22d2b97bbe feat(auto-place): handle boundary events
Add basic auto-placement of boundary events:

* handle top aligned events
* handle bottom aligned events
* take boundary events into account when placing
  host elements and vice versa

Related to #563
2017-12-22 10:32:54 +01:00
Nico Rehwaldt 718836f53e chore(auto-place): improve TextAnnotation and DataElement locations
Related to #563
2017-12-22 10:32:54 +01:00
Nico Rehwaldt a845560425 chore(auto-place): handle multiple source <-> target connections
Related to #563
2017-12-22 10:32:54 +01:00
Nico Rehwaldt 2e4cd7e0a9 chore(auto-place): factor out deconflict position into method 2017-12-22 10:32:54 +01:00
Nico Rehwaldt ae96f3714d feat(modeling): add auto placement from context menu
Elements will automatically be created at appropriate
positions when context menu create entries are being
clicked (rather than dragged).

This marks a major step forward for mobile modeling,
too as dragging, especially dragging out from very small
controls is very cumbersome to do.

Things we take into account:

* for bpmn:FlowNodes, we try to compute the current
  distance between elements on the flow based on
  connections going in and out of the flow nodes
  source element
* for bpmn:TextAnnotation we assume placement of the
  element top right of the source shape
* for bpmn:DataObject and friends we assume a
  placement bottom right of the source shape
* for all elements, we try not to place elements on
  top of each other; i.e. new elements will be pushed
  up or down accordingly, if an element at a chosen
  position does already exist

Integration into other services:

* context pad provider works with autoPlace, if
  available and defaults to drag start without
* auto placed elements are selected and direct editing
  may conditionally be activated based on element type
  (LabelEditingProvider knows the rules)

Users can out out of autoPlace by specifying the configuration
property `config.contextPad.autoPlace = false`.

Closes #563

BREAKING CHANGE:

* This breaks the default interaction from the context
  pad; if you rely on clicking to start the drag
  you can opt out of autoPlace:

  ```
  new BpmnJS({ contextPad: { autoPlace: false } });
  ```
2017-12-22 10:30:44 +01:00
Nico Rehwaldt 6b5277b936 chore(draw): render connections without source
This allows us to renders temporary connections,
i.e. during create / connect.
2017-12-22 10:30:44 +01:00
Nico Rehwaldt c220bfb612 fix(draw): no opacity for boundary events
Ensure boundary events have no opacity.

Fixed regression introduced with #727
2017-12-15 14:35:51 +01:00
Nico Rehwaldt 1e6186e3ce feat(draw): render sequence flows behind tasks
* ordering provider ensures sequence flows appear
  behind tasks
* importer makes sure we render elements in the order
  lanes > sequence flows > other flow elements
* consistent minimal opacity ensures elements in
  front of tasks don't look _connected_

Closes #727
2017-12-14 11:56:00 +01:00
Nico Rehwaldt 1333479815 fix(modeling/behavior): round label move adjustment
Ensure we don't return floating point numbers for conection label
adjustments calculated on connection changes.
2017-12-13 14:21:19 +01:00
Nico Rehwaldt 4a3c0378b9 fix(label-editing): fix isTouch not being processed
Actually use event.isTouch to check label editing activation on
create.end.

This makes 7e928ec709 work.
2017-12-13 13:30:51 +01:00
Nico Rehwaldt 058cfbb579 chore(label-editing): use isAny helper 2017-12-13 13:30:51 +01:00
Nico Rehwaldt 5761e01ffe feat(modeling): adjust label location based on free space
Reacts on connection create, layout, reconnect and waypoint
update to find a suitable place for the label and reposition it.

Closes #738
2017-12-11 15:40:40 +01:00
Nico Rehwaldt a830c1e1e0 chore(snapping): remove dead code
* we don't support moving of lanes;
  the removed code never made it into production.
2017-12-11 15:40:40 +01:00
Nico Rehwaldt ce361dabd7 fix(modeling/DropOnFlowBehavior): ensure label is created before executing 2017-12-11 15:40:40 +01:00
Nico Rehwaldt cd24b27768 fix(copy-paste): ignore data associations during cloning
* use bpmnFactory for cloning to ensure all relevant
  elements have actual IDs
* don't copy dataAssociations, as they are visual elements
  that will be created during element re-connection

NOTE: This fixes data input association not properly being
wired during target replace, too.

Closes #694, #693
2017-12-11 15:14:31 +01:00
felixlinker 36a12396fd chore(renderer): extract BpmnRenderer utilities into util
Closes #731
2017-12-10 19:10:12 +01:00
Nico Rehwaldt e9eb9e374a fix(snapping): correct bendpoint snapping on shape move
Don't blindly snap first waypoint; instead, snap only bendpoints
that are manhattan layout aligned with other bendpoints (excluding
start and end).
2017-12-10 13:48:46 +01:00
Nico Rehwaldt f05ad02198 feat(layout): filter redundant connection waypoints 2017-12-10 12:29:54 +01:00
Nico Rehwaldt 7ffb865023 chore(project): consistent async error handling
Async utilities properly propagate _all_ errors to the
specified _done_ callback. Failing in _done_ does not
re-invoke it.

Adjustments made in

* Viewer#importXML
* Viewer#saveSVG
* Importer#importBpmnDiagram

Tests cleaned up to remove un-necessary `if (err) { ...` snippets.
2017-12-09 22:31:15 +01:00
Nico Rehwaldt 7e928ec709 fix(label-editing): use new isTouch detection for conditional activation
Chrome and other modern desktop browsers
ship with touch features out of the box.

Because of that, it is not possible to use
the check

```
'ontouchstart' in document.documentElement
```
2017-12-08 19:32:13 +01:00
Nico Rehwaldt 2b37cebeb6 chore(context-pad): remove unused argument 2017-12-08 11:40:55 +01:00
Nico Rehwaldt 50da47e1e1 fix(Viewer): trigger resized on attach
Ensure components get notified on `canvas.resized`, whenever
the Viewer instance gets attached.
2017-12-07 11:59:25 +01:00
Nico Rehwaldt 029c3d76aa chore(context-pad): minor connect / remove tweek
* remove does not activate on dragstart
* connect does not trigger default drag behavior
2017-12-06 23:30:43 +01:00
Nico Rehwaldt e0104e3589 chore(Viewer): handle import error outside try/catch 2017-11-28 13:24:36 +01:00
Nico Rehwaldt 2ef82970fd chore(Viewer): re-expose loaded definitions
The previous release kinda removed access to the currently
loaded definitions.

This restores access by exposing it by `Viewer#getDefinitions()`.
2017-11-23 09:49:54 +01:00
Nico Rehwaldt 642d7b88af chore(Viewer+Modeler): consistently name private instance variables
BREAKING CHANGE:

* definitions, container and moddle have been prefixed with
  an underscore (_) to denote they are private use.
2017-11-20 15:28:29 +01:00
Nico Rehwaldt ce45e9081b chore(project): bump bpmn-moddle dep
This improves the import and export of BPMN 2.0 XML documents

+ improves di prefix collision handling
+ proper deconflicting of prefixes during export
+ validate and detect non-BPMN root elements
+ replace underlying XML parser for higher speed and smaller
  bundle size
+ pass parse warnings with errors

NOTE:

* some error messages on broken XML may have changed
  due to changes in the underlying XML parser
2017-11-15 19:55:34 +01:00
felixlinker 0cb46183eb chore(draw/BpmnRenderer): exposed _drawPath helper
This allows extensions to reuse the internal drawPath utility.

Cf. #722 for context.
2017-11-13 09:56:02 +01:00
Philipp Fromme 28871bcdaf chore(draw/BpmnRenderer): make instance of ids global
Closes #716
2017-10-04 11:17:43 +02:00
Nico Rehwaldt 4c01a5dab1 fix(Viewer): correctly export <defs> node on IE
Closes #710
2017-09-29 11:42:34 +02:00
Philipp Fromme 9033094473 fix(renderer): prevent duplicate marker IDs
* when having more than one instance of bpmn-js on a page marker IDs got duplicated
2017-09-29 11:08:37 +02:00
pedesen 58207e7db2 feat(DropOnFlowBehavior): drop existing elements on flows
Closes #695
2017-07-27 15:15:08 +02:00
pedesen b1a544b84f fix(dropOnFlowBehavior): ignore drop point if bendpoint is inside shape
Closes #696
2017-07-27 13:41:50 +02:00
pedesen b234f17244 feat(snapping) snap on sequence flows
Closes #398
2017-07-27 13:41:45 +02:00
Philipp Fromme e797d9c142 feat(label-editing): improve text annotation editing
Related to camunda/camunda-modeler#564
2017-07-25 15:05:35 +02:00
Philipp Fromme 114da17403 fix(copy-paste): create new business object on paste
* fixes pasted elements having same business object
* removes temporary fix that prevents pasting twice

Closes #686
Closes camunda/camunda-modeler#561
2017-06-20 16:24:11 +02:00
Nico Rehwaldt 8015b21b15 fix(rules): allow TextAnnotation <-> Data(Store|Object) connection
Closes #687
2017-05-22 12:55:43 +02:00
Nico Rehwaldt 8e55edd80f chore(copy-paste): temporarily prevent consecutive paste
This prevents users from creating invalid
models due to IDs not properly being
generated on consecutive paste (#686).

Closes #688.
2017-05-19 13:01:57 +02:00
Nico Rehwaldt ff140d1a50 style(lib): correct indention 2017-05-19 12:56:59 +02:00