Commit Graph

1115 Commits

Author SHA1 Message Date
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 0dd5c9cb6c chore(tests): rename suite 2017-12-22 10:30:44 +01:00
Nico Rehwaldt cff0c4ef91 chore(tests): remove unused utility 2017-12-20 10:37:38 +01:00
Nico Rehwaldt a64cf9b7a1 chore(tests): rename description 2017-12-20 10:37:27 +01:00
Nico Rehwaldt ddd1dae25c chore(project): bump diagram-js version 2017-12-18 22:52:13 +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 2218b84af6 test(modeling): verify connection move behavior
Closes to #511
2017-12-14 23:42:02 +01:00
Nico Rehwaldt 8b4476a388 chore(wiredeps): rebuild 2017-12-14 23:11:56 +01:00
Nico Rehwaldt 36c6a7bf41 fix(package): make diagram-js* actual dependencies again 2017-12-14 22:55:18 +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 495ab7ee9d chore(project): bump diagram-js dependency
* update diagram-js to latest
* remove unused diagram-js-origin dependency
2017-12-14 11:55:48 +01:00
Nico Rehwaldt 76d44f33e7 chore(project): bump dependencies
+ diagram-js-direct-editing
+ min-dom
2017-12-13 23:00:01 +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 a708a1cd4e chore(tests): adapt bendpoint tests to new cropping
Related to #684
2017-12-13 14:20:40 +01:00
Nico Rehwaldt 61f3ac4cc2 chore(project): bump diagram-js dependency 2017-12-13 14:05:15 +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 26f26945b6 chore(project): bump diagram-js dependency
Adds ability to distinguish create via touch / no touch.
2017-12-13 13:30:51 +01:00
Nico Rehwaldt 869e484601 chore(tests): use have.waypoints helper 2017-12-13 13:25:51 +01:00
Nico Rehwaldt f24b21684d test(cropping): add stress test
Related to #684
2017-12-13 13:25:51 +01:00
Nico Rehwaldt 408dd5383a chore(tests): localize test file 2017-12-13 13:25:51 +01:00
Nico Rehwaldt 221b3279ac chore(project): add .npmignore
* keep test utilities, helper and matchers
2017-12-13 12:17:43 +01:00
Nico Rehwaldt 1bf07d7e85 chore(project): bump bpmn-moddle dependency 2017-12-13 12:17:21 +01:00
Nico Rehwaldt 51ec9b8676 chore(test): correct test helper styles 2017-12-11 21:26:37 +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 48490197a5 chore(tests): improve test container styling 2017-12-11 15:25:10 +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
Nico Rehwaldt 25d5fb2967 chore(project): bump build dependencies
+ browserify
+ uglify-es
2017-12-10 23:19:19 +01:00
Nico Rehwaldt e7da5af0a1 chore(tests): depend on move module, where used
Tests would otherwise break in the future.

Related to bpmn-io/diagram-js#152
2017-12-10 23:04:11 +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 357f3b3e96 chore(project): rebuild package-lock.json 2017-12-09 22:36:38 +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 105f326dad chore(project): bump bpmn-moddle dependency
* unused namespace does not get serialized anymore

Closes #469
2017-12-09 22:30:56 +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 db64aa1377 chore(project): bump bpmn-moddle
Closes #735
2017-12-08 00:18:51 +01:00
Philipp Fromme bc0fd114d0 chore(project): bump diagram-js dependency
Closes camunda/camunda-modeler#463
Closes #734
2017-12-07 16:35:09 +01:00
Nico Rehwaldt c14be5d258 chore(test/util): remove snap.svg remainders 2017-12-07 13:19:02 +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 e34ca2feb2 chore(project): remove grunt-release
We do <np **> to release things.
2017-11-29 12:23:14 +01:00
Nico Rehwaldt cbc3a7b3c5 chore(project): re-build package-lock 2017-11-29 12:19:05 +01:00