camunda-bpmn-js 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/CHANGELOG.md +276 -270
  2. package/LICENSE +20 -20
  3. package/README.md +84 -84
  4. package/dist/assets/base-modeler.css +4 -4
  5. package/dist/assets/base-navigated-viewer.css +1 -1
  6. package/dist/assets/base-viewer.css +1 -1
  7. package/dist/assets/bpmn-js.css +33 -4
  8. package/dist/assets/camunda-cloud-modeler.css +1 -1
  9. package/dist/assets/camunda-platform-modeler.css +1 -1
  10. package/dist/assets/diagram-js.css +55 -51
  11. package/dist/assets/element-templates.css +4 -0
  12. package/dist/assets/properties-panel.css +929 -900
  13. package/dist/base-modeler.development.js +7372 -5941
  14. package/dist/base-modeler.production.min.js +4 -4
  15. package/dist/base-navigated-viewer.development.js +21592 -21248
  16. package/dist/base-navigated-viewer.production.min.js +3 -2
  17. package/dist/base-viewer.development.js +20793 -20449
  18. package/dist/base-viewer.production.min.js +3 -2
  19. package/dist/camunda-cloud-modeler.development.js +9568 -7851
  20. package/dist/camunda-cloud-modeler.production.min.js +4 -4
  21. package/dist/camunda-cloud-navigated-viewer.development.js +647 -273
  22. package/dist/camunda-cloud-navigated-viewer.production.min.js +2 -2
  23. package/dist/camunda-cloud-viewer.development.js +646 -272
  24. package/dist/camunda-cloud-viewer.production.min.js +2 -2
  25. package/dist/camunda-platform-modeler.development.js +7557 -6077
  26. package/dist/camunda-platform-modeler.production.min.js +4 -4
  27. package/dist/camunda-platform-navigated-viewer.development.js +631 -257
  28. package/dist/camunda-platform-navigated-viewer.production.min.js +2 -2
  29. package/dist/camunda-platform-viewer.development.js +630 -256
  30. package/dist/camunda-platform-viewer.production.min.js +2 -2
  31. package/lib/base/Modeler.js +46 -46
  32. package/lib/base/NavigatedViewer.js +2 -2
  33. package/lib/base/Viewer.js +2 -2
  34. package/lib/camunda-cloud/Modeler.js +68 -68
  35. package/lib/camunda-cloud/NavigatedViewer.js +34 -34
  36. package/lib/camunda-cloud/Viewer.js +34 -34
  37. package/lib/camunda-cloud/features/context-pad/ContextPadOptions.js +15 -15
  38. package/lib/camunda-cloud/features/context-pad/index.js +6 -6
  39. package/lib/camunda-cloud/features/drilldown/index.js +3 -3
  40. package/lib/camunda-cloud/features/palette/PaletteOptions.js +14 -14
  41. package/lib/camunda-cloud/features/palette/PaletteProvider.js +31 -31
  42. package/lib/camunda-cloud/features/palette/index.js +6 -6
  43. package/lib/camunda-cloud/features/popup-menu/ReplaceMenuProvider.js +71 -71
  44. package/lib/camunda-cloud/features/popup-menu/ReplaceOptions.js +46 -46
  45. package/lib/camunda-cloud/features/popup-menu/index.js +6 -6
  46. package/lib/camunda-cloud/features/rules/BpmnRules.js +137 -137
  47. package/lib/camunda-cloud/features/rules/index.js +5 -5
  48. package/lib/camunda-cloud/util/commonModules.js +13 -13
  49. package/lib/camunda-platform/Modeler.js +46 -46
  50. package/lib/camunda-platform/NavigatedViewer.js +25 -25
  51. package/lib/camunda-platform/Viewer.js +24 -24
  52. package/lib/camunda-platform/util/commonModules.js +6 -6
  53. package/lib/util/ExtensionElementsUtil.js +59 -59
  54. package/package.json +110 -110
  55. package/styles/base-modeler.css +4 -4
  56. package/styles/base-navigated-viewer.css +1 -1
  57. package/styles/base-viewer.css +1 -1
  58. package/styles/camunda-cloud-modeler.css +1 -1
  59. package/styles/camunda-platform-modeler.css +1 -1
  60. package/util/index.js +39 -39
@@ -41,6 +41,8 @@
41
41
  }
42
42
  });
43
43
 
44
+ function e(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}));}
45
+
44
46
  /**
45
47
  * Flatten array, one level deep.
46
48
  *
@@ -1389,6 +1391,8 @@
1389
1391
  return gfx;
1390
1392
  }
1391
1393
 
1394
+ var black = 'hsl(225, 10%, 15%)';
1395
+
1392
1396
  // element utils //////////////////////
1393
1397
 
1394
1398
  /**
@@ -1439,7 +1443,7 @@
1439
1443
  function getStrokeColor(element, defaultColor) {
1440
1444
  var di = getDi(element);
1441
1445
 
1442
- return di.get('color:border-color') || di.get('bioc:stroke') || defaultColor || 'black';
1446
+ return di.get('color:border-color') || di.get('bioc:stroke') || defaultColor || black;
1443
1447
  }
1444
1448
 
1445
1449
  function getLabelColor(element, defaultColor, defaultStrokeColor) {
@@ -1529,6 +1533,101 @@
1529
1533
  return componentsToPath(rectPath);
1530
1534
  }
1531
1535
 
1536
+ /**
1537
+ * Flatten array, one level deep.
1538
+ *
1539
+ * @param {Array<?>} arr
1540
+ *
1541
+ * @return {Array<?>}
1542
+ */
1543
+
1544
+ var nativeToString$1 = Object.prototype.toString;
1545
+ var nativeHasOwnProperty$1 = Object.prototype.hasOwnProperty;
1546
+ function isUndefined$1(obj) {
1547
+ return obj === undefined;
1548
+ }
1549
+ function isArray$1(obj) {
1550
+ return nativeToString$1.call(obj) === '[object Array]';
1551
+ }
1552
+ /**
1553
+ * Return true, if target owns a property with the given key.
1554
+ *
1555
+ * @param {Object} target
1556
+ * @param {String} key
1557
+ *
1558
+ * @return {Boolean}
1559
+ */
1560
+
1561
+ function has$1(target, key) {
1562
+ return nativeHasOwnProperty$1.call(target, key);
1563
+ }
1564
+ /**
1565
+ * Iterate over collection; returning something
1566
+ * (non-undefined) will stop iteration.
1567
+ *
1568
+ * @param {Array|Object} collection
1569
+ * @param {Function} iterator
1570
+ *
1571
+ * @return {Object} return result that stopped the iteration
1572
+ */
1573
+
1574
+ function forEach$1(collection, iterator) {
1575
+ var val, result;
1576
+
1577
+ if (isUndefined$1(collection)) {
1578
+ return;
1579
+ }
1580
+
1581
+ var convertKey = isArray$1(collection) ? toNum$1 : identity$1;
1582
+
1583
+ for (var key in collection) {
1584
+ if (has$1(collection, key)) {
1585
+ val = collection[key];
1586
+ result = iterator(val, convertKey(key));
1587
+
1588
+ if (result === false) {
1589
+ return val;
1590
+ }
1591
+ }
1592
+ }
1593
+ }
1594
+
1595
+ function identity$1(arg) {
1596
+ return arg;
1597
+ }
1598
+
1599
+ function toNum$1(arg) {
1600
+ return Number(arg);
1601
+ }
1602
+
1603
+ /**
1604
+ * Assigns style attributes in a style-src compliant way.
1605
+ *
1606
+ * @param {Element} element
1607
+ * @param {...Object} styleSources
1608
+ *
1609
+ * @return {Element} the element
1610
+ */
1611
+ function assign$1(element) {
1612
+ var target = element.style;
1613
+
1614
+ for (var _len = arguments.length, styleSources = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1615
+ styleSources[_key - 1] = arguments[_key];
1616
+ }
1617
+
1618
+ forEach$1(styleSources, function (style) {
1619
+ if (!style) {
1620
+ return;
1621
+ }
1622
+
1623
+ forEach$1(style, function (value, key) {
1624
+ target[key] = value;
1625
+ });
1626
+ });
1627
+
1628
+ return element;
1629
+ }
1630
+
1532
1631
  /**
1533
1632
  * Set attribute `name` to `val`, or get attr `name`.
1534
1633
  *
@@ -1878,7 +1977,7 @@
1878
1977
  // when delegating.
1879
1978
  var forceCaptureEvents = ['focus', 'blur'];
1880
1979
 
1881
- function bind$1$1(el, selector, type, fn, capture) {
1980
+ function bind$2(el, selector, type, fn, capture) {
1882
1981
  if (forceCaptureEvents.indexOf(type) !== -1) {
1883
1982
  capture = true;
1884
1983
  }
@@ -1910,7 +2009,7 @@
1910
2009
  }
1911
2010
 
1912
2011
  var delegate = {
1913
- bind: bind$1$1,
2012
+ bind: bind$2,
1914
2013
  unbind: unbind$1
1915
2014
  };
1916
2015
 
@@ -2278,7 +2377,7 @@
2278
2377
 
2279
2378
  function addMarker(id, options) {
2280
2379
  var attrs = assign({
2281
- fill: 'black',
2380
+ fill: black,
2282
2381
  strokeWidth: 1,
2283
2382
  strokeLinecap: 'round',
2284
2383
  strokeDasharray: 'none'
@@ -2457,7 +2556,7 @@
2457
2556
  offset = offset || 0;
2458
2557
 
2459
2558
  attrs = computeStyle(attrs, {
2460
- stroke: 'black',
2559
+ stroke: black,
2461
2560
  strokeWidth: 2,
2462
2561
  fill: 'white'
2463
2562
  });
@@ -2492,7 +2591,7 @@
2492
2591
  offset = offset || 0;
2493
2592
 
2494
2593
  attrs = computeStyle(attrs, {
2495
- stroke: 'black',
2594
+ stroke: black,
2496
2595
  strokeWidth: 2,
2497
2596
  fill: 'white'
2498
2597
  });
@@ -2525,7 +2624,7 @@
2525
2624
  }).join(' ');
2526
2625
 
2527
2626
  attrs = computeStyle(attrs, {
2528
- stroke: 'black',
2627
+ stroke: black,
2529
2628
  strokeWidth: 2,
2530
2629
  fill: 'white'
2531
2630
  });
@@ -2543,7 +2642,7 @@
2543
2642
 
2544
2643
  function drawLine(parentGfx, waypoints, attrs) {
2545
2644
  attrs = computeStyle(attrs, [ 'no-fill' ], {
2546
- stroke: 'black',
2645
+ stroke: black,
2547
2646
  strokeWidth: 2,
2548
2647
  fill: 'none'
2549
2648
  });
@@ -2559,7 +2658,7 @@
2559
2658
 
2560
2659
  attrs = computeStyle(attrs, [ 'no-fill' ], {
2561
2660
  strokeWidth: 2,
2562
- stroke: 'black'
2661
+ stroke: black
2563
2662
  });
2564
2663
 
2565
2664
  var path = create('path');
@@ -3664,7 +3763,7 @@
3664
3763
 
3665
3764
  if (di.messageVisibleKind === 'initiating') {
3666
3765
  messageAttrs.fill = 'white';
3667
- messageAttrs.stroke = 'black';
3766
+ messageAttrs.stroke = black;
3668
3767
  } else {
3669
3768
  messageAttrs.fill = '#888';
3670
3769
  messageAttrs.stroke = 'white';
@@ -3739,7 +3838,7 @@
3739
3838
 
3740
3839
  /* output arrow path */ drawPath(parentGfx, arrowPathData, {
3741
3840
  strokeWidth: 1,
3742
- fill: 'black'
3841
+ fill: black
3743
3842
  });
3744
3843
 
3745
3844
  return elementObject;
@@ -4069,7 +4168,7 @@
4069
4168
  }
4070
4169
 
4071
4170
 
4072
- inherits_browser(BpmnRenderer, BaseRenderer);
4171
+ e(BpmnRenderer, BaseRenderer);
4073
4172
 
4074
4173
  BpmnRenderer.$inject = [
4075
4174
  'config.bpmnRenderer',
@@ -4303,7 +4402,8 @@
4303
4402
  id: 'helper-svg',
4304
4403
  width: 0,
4305
4404
  height: 0,
4306
- style: 'visibility: hidden; position: fixed'
4405
+ visibility: 'hidden',
4406
+ position: 'fixed'
4307
4407
  });
4308
4408
 
4309
4409
  document.body.appendChild(helperSvg);
@@ -5290,13 +5390,98 @@
5290
5390
  *
5291
5391
  * @return {Point}
5292
5392
  */
5293
- function getMid(bounds) {
5393
+ function getBoundsMid(bounds) {
5294
5394
  return roundPoint({
5295
5395
  x: bounds.x + (bounds.width || 0) / 2,
5296
5396
  y: bounds.y + (bounds.height || 0) / 2
5297
5397
  });
5298
5398
  }
5299
5399
 
5400
+
5401
+ /**
5402
+ * Get the mid of the given Connection.
5403
+ *
5404
+ * @param {djs.Base.Connection} connection
5405
+ *
5406
+ * @return {Point}
5407
+ */
5408
+ function getConnectionMid(connection) {
5409
+ var waypoints = connection.waypoints;
5410
+
5411
+ // calculate total length and length of each segment
5412
+ var parts = waypoints.reduce(function(parts, point, index) {
5413
+
5414
+ var lastPoint = waypoints[index - 1];
5415
+
5416
+ if (lastPoint) {
5417
+ var lastPart = parts[parts.length - 1];
5418
+
5419
+ var startLength = lastPart && lastPart.endLength || 0;
5420
+ var length = distance(lastPoint, point);
5421
+
5422
+ parts.push({
5423
+ start: lastPoint,
5424
+ end: point,
5425
+ startLength: startLength,
5426
+ endLength: startLength + length,
5427
+ length: length
5428
+ });
5429
+ }
5430
+
5431
+ return parts;
5432
+ }, []);
5433
+
5434
+ var totalLength = parts.reduce(function(length, part) {
5435
+ return length + part.length;
5436
+ }, 0);
5437
+
5438
+ // find which segement contains middle point
5439
+ var midLength = totalLength / 2;
5440
+
5441
+ var i = 0;
5442
+ var midSegment = parts[i];
5443
+
5444
+ while (midSegment.endLength < midLength) {
5445
+ midSegment = parts[++i];
5446
+ }
5447
+
5448
+ // calculate relative position on mid segment
5449
+ var segmentProgress = (midLength - midSegment.startLength) / midSegment.length;
5450
+
5451
+ var midPoint = {
5452
+ x: midSegment.start.x + (midSegment.end.x - midSegment.start.x) * segmentProgress,
5453
+ y: midSegment.start.y + (midSegment.end.y - midSegment.start.y) * segmentProgress
5454
+ };
5455
+
5456
+ return midPoint;
5457
+ }
5458
+
5459
+
5460
+ /**
5461
+ * Get the mid of the given Element.
5462
+ *
5463
+ * @param {djs.Base.Connection} connection
5464
+ *
5465
+ * @return {Point}
5466
+ */
5467
+ function getMid(element) {
5468
+ if (isConnection(element)) {
5469
+ return getConnectionMid(element);
5470
+ }
5471
+
5472
+ return getBoundsMid(element);
5473
+ }
5474
+
5475
+ // helpers //////////////////////
5476
+
5477
+ function distance(a, b) {
5478
+ return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));
5479
+ }
5480
+
5481
+ function isConnection(element) {
5482
+ return !!element.waypoints;
5483
+ }
5484
+
5300
5485
  function elementToString(e) {
5301
5486
  if (!e) {
5302
5487
  return '<null>';
@@ -5939,10 +6124,13 @@
5939
6124
 
5940
6125
  var ALL_HIT_STYLE = createHitStyle('djs-hit djs-hit-all');
5941
6126
 
6127
+ var NO_MOVE_HIT_STYLE = createHitStyle('djs-hit djs-hit-no-move');
6128
+
5942
6129
  var HIT_TYPES = {
5943
6130
  'all': ALL_HIT_STYLE,
5944
6131
  'click-stroke': CLICK_STROKE_HIT_STYLE,
5945
- 'stroke': STROKE_HIT_STYLE
6132
+ 'stroke': STROKE_HIT_STYLE,
6133
+ 'no-move': NO_MOVE_HIT_STYLE
5946
6134
  };
5947
6135
 
5948
6136
  function createHitStyle(classNames, attrs) {
@@ -6195,7 +6383,9 @@
6195
6383
  * the array or the element primitive.
6196
6384
  *
6197
6385
  * @param {Array<djs.model.Shape>|djs.model.Shape} elements
6198
- * @param {boolean} stopRecursion
6386
+ * @param {boolean} [stopRecursion=false]
6387
+ *
6388
+ * @return {Bounds}
6199
6389
  */
6200
6390
  function getBBox(elements, stopRecursion) {
6201
6391
 
@@ -6291,6 +6481,7 @@
6291
6481
  attr(outline, assign({
6292
6482
  x: 10,
6293
6483
  y: 10,
6484
+ rx: 3,
6294
6485
  width: 100,
6295
6486
  height: 100
6296
6487
  }, OUTLINE_STYLE));
@@ -6482,6 +6673,8 @@
6482
6673
  var MARKER_HOVER = 'hover',
6483
6674
  MARKER_SELECTED = 'selected';
6484
6675
 
6676
+ var SELECTION_OUTLINE_PADDING = 6;
6677
+
6485
6678
 
6486
6679
  /**
6487
6680
  * A plugin that adds a visible selection UI to shapes and connections
@@ -6491,11 +6684,13 @@
6491
6684
  *
6492
6685
  * Makes elements selectable, too.
6493
6686
  *
6494
- * @param {EventBus} events
6495
- * @param {SelectionService} selection
6496
6687
  * @param {Canvas} canvas
6688
+ * @param {EventBus} eventBus
6497
6689
  */
6498
- function SelectionVisuals(events, canvas, selection, styles) {
6690
+ function SelectionVisuals(canvas, eventBus, selection) {
6691
+ this._canvas = canvas;
6692
+
6693
+ var self = this;
6499
6694
 
6500
6695
  this._multiSelectionBox = null;
6501
6696
 
@@ -6507,15 +6702,15 @@
6507
6702
  canvas.removeMarker(e, cls);
6508
6703
  }
6509
6704
 
6510
- events.on('element.hover', function(event) {
6705
+ eventBus.on('element.hover', function(event) {
6511
6706
  addMarker(event.element, MARKER_HOVER);
6512
6707
  });
6513
6708
 
6514
- events.on('element.out', function(event) {
6709
+ eventBus.on('element.out', function(event) {
6515
6710
  removeMarker(event.element, MARKER_HOVER);
6516
6711
  });
6517
6712
 
6518
- events.on('selection.changed', function(event) {
6713
+ eventBus.on('selection.changed', function(event) {
6519
6714
 
6520
6715
  function deselect(s) {
6521
6716
  removeMarker(s, MARKER_SELECTED);
@@ -6539,16 +6734,63 @@
6539
6734
  select(e);
6540
6735
  }
6541
6736
  });
6737
+
6738
+ self._updateSelectionOutline(newSelection);
6739
+ });
6740
+
6741
+
6742
+ eventBus.on('element.changed', function(event) {
6743
+ if (selection.isSelected(event.element)) {
6744
+ self._updateSelectionOutline(selection.get());
6745
+ }
6542
6746
  });
6543
6747
  }
6544
6748
 
6545
6749
  SelectionVisuals.$inject = [
6546
- 'eventBus',
6547
6750
  'canvas',
6548
- 'selection',
6549
- 'styles'
6751
+ 'eventBus',
6752
+ 'selection'
6550
6753
  ];
6551
6754
 
6755
+ SelectionVisuals.prototype._updateSelectionOutline = function(selection) {
6756
+ var layer = this._canvas.getLayer('selectionOutline');
6757
+
6758
+ clear(layer);
6759
+
6760
+ var enabled = selection.length > 1;
6761
+
6762
+ var container = this._canvas.getContainer();
6763
+
6764
+ classes(container)[enabled ? 'add' : 'remove']('djs-multi-select');
6765
+
6766
+ if (!enabled) {
6767
+ return;
6768
+ }
6769
+
6770
+ var bBox = addSelectionOutlinePadding(getBBox(selection));
6771
+
6772
+ var rect = create('rect');
6773
+
6774
+ attr(rect, assign({
6775
+ rx: 3
6776
+ }, bBox));
6777
+
6778
+ classes(rect).add('djs-selection-outline');
6779
+
6780
+ append(layer, rect);
6781
+ };
6782
+
6783
+ // helpers //////////
6784
+
6785
+ function addSelectionOutlinePadding(bBox) {
6786
+ return {
6787
+ x: bBox.x - SELECTION_OUTLINE_PADDING,
6788
+ y: bBox.y - SELECTION_OUTLINE_PADDING,
6789
+ width: bBox.width + SELECTION_OUTLINE_PADDING * 2,
6790
+ height: bBox.height + SELECTION_OUTLINE_PADDING * 2
6791
+ };
6792
+ }
6793
+
6552
6794
  function SelectionBehavior(eventBus, selection, canvas, elementRegistry) {
6553
6795
 
6554
6796
  // Select elements on create
@@ -6579,11 +6821,10 @@
6579
6821
  // Select connection targets on connect
6580
6822
  eventBus.on('connect.end', 500, function(event) {
6581
6823
  var context = event.context,
6582
- canExecute = context.canExecute,
6583
- hover = context.hover;
6824
+ connection = context.connection;
6584
6825
 
6585
- if (canExecute && hover) {
6586
- selection.select(hover);
6826
+ if (connection) {
6827
+ selection.select(connection);
6587
6828
  }
6588
6829
  });
6589
6830
 
@@ -7049,7 +7290,8 @@
7049
7290
 
7050
7291
 
7051
7292
  Overlays.prototype._createOverlayContainer = function(element) {
7052
- var html = domify('<div class="djs-overlays" style="position: absolute" />');
7293
+ var html = domify('<div class="djs-overlays" />');
7294
+ assign$1(html, { position: 'absolute' });
7053
7295
 
7054
7296
  this._overlayRoot.appendChild(html);
7055
7297
 
@@ -7120,7 +7362,8 @@
7120
7362
 
7121
7363
  overlayContainer = this._getOverlayContainer(element);
7122
7364
 
7123
- htmlContainer = domify('<div class="djs-overlay" data-overlay-id="' + id + '" style="position: absolute">');
7365
+ htmlContainer = domify('<div class="djs-overlay" data-overlay-id="' + id + '">');
7366
+ assign$1(htmlContainer, { position: 'absolute' });
7124
7367
 
7125
7368
  htmlContainer.appendChild(html);
7126
7369
 
@@ -7305,18 +7548,30 @@
7305
7548
 
7306
7549
  function createRoot(parentNode) {
7307
7550
  var root = domify(
7308
- '<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />'
7551
+ '<div class="djs-overlay-container" />'
7309
7552
  );
7310
7553
 
7554
+ assign$1(root, {
7555
+ position: 'absolute',
7556
+ width: 0,
7557
+ height: 0
7558
+ });
7559
+
7311
7560
  parentNode.insertBefore(root, parentNode.firstChild);
7312
7561
 
7313
7562
  return root;
7314
7563
  }
7315
7564
 
7316
7565
  function setPosition(el, x, y) {
7317
- assign(el.style, { left: x + 'px', top: y + 'px' });
7566
+ assign$1(el, { left: x + 'px', top: y + 'px' });
7318
7567
  }
7319
7568
 
7569
+ /**
7570
+ * Set element visible
7571
+ *
7572
+ * @param {DOMElement} el
7573
+ * @param {boolean} [visible=true]
7574
+ */
7320
7575
  function setVisible(el, visible) {
7321
7576
  el.style.display = visible === false ? 'none' : '';
7322
7577
  }
@@ -7414,7 +7669,7 @@
7414
7669
  *
7415
7670
  * @example
7416
7671
  *
7417
- * import inherits from 'inherits';
7672
+ * import inherits from 'inherits-browser';
7418
7673
  *
7419
7674
  * import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
7420
7675
  *
@@ -7570,7 +7825,7 @@
7570
7825
  });
7571
7826
  }
7572
7827
 
7573
- inherits_browser(RootElementsBehavior, CommandInterceptor);
7828
+ e(RootElementsBehavior, CommandInterceptor);
7574
7829
 
7575
7830
  RootElementsBehavior.$inject = [ 'canvas', 'injector' ];
7576
7831
 
@@ -8253,7 +8508,7 @@
8253
8508
 
8254
8509
  }
8255
8510
 
8256
- inherits_browser(DrilldownOverlayBehavior, CommandInterceptor);
8511
+ e(DrilldownOverlayBehavior, CommandInterceptor);
8257
8512
 
8258
8513
  DrilldownOverlayBehavior.prototype.updateDrilldownOverlay = function(shape) {
8259
8514
  var canvas = this._canvas;
@@ -8354,22 +8609,50 @@
8354
8609
 
8355
8610
  var CLASS_PATTERN = /^class /;
8356
8611
 
8612
+
8613
+ /**
8614
+ * @param {function} fn
8615
+ *
8616
+ * @return {boolean}
8617
+ */
8357
8618
  function isClass(fn) {
8358
8619
  return CLASS_PATTERN.test(fn.toString());
8359
8620
  }
8360
8621
 
8361
- function isArray$1(obj) {
8622
+ /**
8623
+ * @param {any} obj
8624
+ *
8625
+ * @return {boolean}
8626
+ */
8627
+ function isArray$2(obj) {
8362
8628
  return Object.prototype.toString.call(obj) === '[object Array]';
8363
8629
  }
8364
8630
 
8631
+ /**
8632
+ * @param {any} obj
8633
+ * @param {string} prop
8634
+ *
8635
+ * @return {boolean}
8636
+ */
8365
8637
  function hasOwnProp(obj, prop) {
8366
8638
  return Object.prototype.hasOwnProperty.call(obj, prop);
8367
8639
  }
8368
8640
 
8641
+ /**
8642
+ * @typedef {import('./index').InjectAnnotated } InjectAnnotated
8643
+ */
8644
+
8645
+ /**
8646
+ * @template T
8647
+ *
8648
+ * @params {[...string[], T] | ...string[], T} args
8649
+ *
8650
+ * @return {T & InjectAnnotated}
8651
+ */
8369
8652
  function annotate() {
8370
8653
  var args = Array.prototype.slice.call(arguments);
8371
8654
 
8372
- if (args.length === 1 && isArray$1(args[0])) {
8655
+ if (args.length === 1 && isArray$2(args[0])) {
8373
8656
  args = args[0];
8374
8657
  }
8375
8658
 
@@ -8395,9 +8678,14 @@
8395
8678
  // of a nested class, too.
8396
8679
 
8397
8680
  var CONSTRUCTOR_ARGS = /constructor\s*[^(]*\(\s*([^)]*)\)/m;
8398
- var FN_ARGS = /^(?:async )?(?:function\s*)?[^(]*\(\s*([^)]*)\)/m;
8681
+ var FN_ARGS = /^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m;
8399
8682
  var FN_ARG = /\/\*([^*]*)\*\//m;
8400
8683
 
8684
+ /**
8685
+ * @param {unknown} fn
8686
+ *
8687
+ * @return {string[]}
8688
+ */
8401
8689
  function parseAnnotations(fn) {
8402
8690
 
8403
8691
  if (typeof fn !== 'function') {
@@ -8411,36 +8699,26 @@
8411
8699
  return [];
8412
8700
  }
8413
8701
 
8414
- return match[1] && match[1].split(',').map(function(arg) {
8415
- match = arg.match(FN_ARG);
8416
- return match ? match[1].trim() : arg.trim();
8702
+ var args = match[1] || match[2];
8703
+
8704
+ return args && args.split(',').map(function(arg) {
8705
+ var argMatch = arg.match(FN_ARG);
8706
+ return (argMatch && argMatch[1] || arg).trim();
8417
8707
  }) || [];
8418
8708
  }
8419
8709
 
8420
- function Module() {
8421
- var providers = [];
8422
-
8423
- this.factory = function(name, factory) {
8424
- providers.push([name, 'factory', factory]);
8425
- return this;
8426
- };
8427
-
8428
- this.value = function(name, value) {
8429
- providers.push([name, 'value', value]);
8430
- return this;
8431
- };
8432
-
8433
- this.type = function(name, type) {
8434
- providers.push([name, 'type', type]);
8435
- return this;
8436
- };
8437
-
8438
- this.forEach = function(iterator) {
8439
- providers.forEach(iterator);
8440
- };
8441
-
8442
- }
8710
+ /**
8711
+ * @typedef { import('./index').ModuleDeclaration } ModuleDeclaration
8712
+ * @typedef { import('./index').ModuleDefinition } ModuleDefinition
8713
+ * @typedef { import('./index').InjectorContext } InjectorContext
8714
+ */
8443
8715
 
8716
+ /**
8717
+ * Create a new injector with the given modules.
8718
+ *
8719
+ * @param {ModuleDefinition[]} modules
8720
+ * @param {InjectorContext} [parent]
8721
+ */
8444
8722
  function Injector(modules, parent) {
8445
8723
  parent = parent || {
8446
8724
  get: function(name, strict) {
@@ -8469,12 +8747,12 @@
8469
8747
  /**
8470
8748
  * Return a named service.
8471
8749
  *
8472
- * @param {String} name
8473
- * @param {Boolean} [strict=true] if false, resolve missing services to null
8750
+ * @param {string} name
8751
+ * @param {boolean} [strict=true] if false, resolve missing services to null
8474
8752
  *
8475
- * @return {Object}
8753
+ * @return {any}
8476
8754
  */
8477
- var get = function(name, strict) {
8755
+ function get(name, strict) {
8478
8756
  if (!providers[name] && name.indexOf('.') !== -1) {
8479
8757
  var parts = name.split('.');
8480
8758
  var pivot = get(parts.shift());
@@ -8504,16 +8782,16 @@
8504
8782
  }
8505
8783
 
8506
8784
  return parent.get(name, strict);
8507
- };
8785
+ }
8508
8786
 
8509
- var fnDef = function(fn, locals) {
8787
+ function fnDef(fn, locals) {
8510
8788
 
8511
8789
  if (typeof locals === 'undefined') {
8512
8790
  locals = {};
8513
8791
  }
8514
8792
 
8515
8793
  if (typeof fn !== 'function') {
8516
- if (isArray$1(fn)) {
8794
+ if (isArray$2(fn)) {
8517
8795
  fn = annotate(fn.slice());
8518
8796
  } else {
8519
8797
  throw new Error('Cannot invoke "' + fn + '". Expected a function!');
@@ -8533,9 +8811,9 @@
8533
8811
  fn: fn,
8534
8812
  dependencies: dependencies
8535
8813
  };
8536
- };
8814
+ }
8537
8815
 
8538
- var instantiate = function(Type) {
8816
+ function instantiate(Type) {
8539
8817
  var def = fnDef(Type);
8540
8818
 
8541
8819
  var fn = def.fn,
@@ -8545,25 +8823,35 @@
8545
8823
  var Constructor = Function.prototype.bind.apply(fn, [ null ].concat(dependencies));
8546
8824
 
8547
8825
  return new Constructor();
8548
- };
8826
+ }
8549
8827
 
8550
- var invoke = function(func, context, locals) {
8828
+ function invoke(func, context, locals) {
8551
8829
  var def = fnDef(func, locals);
8552
8830
 
8553
8831
  var fn = def.fn,
8554
8832
  dependencies = def.dependencies;
8555
8833
 
8556
8834
  return fn.apply(context, dependencies);
8557
- };
8558
-
8835
+ }
8559
8836
 
8560
- var createPrivateInjectorFactory = function(privateChildInjector) {
8837
+ /**
8838
+ * @param {Injector} childInjector
8839
+ *
8840
+ * @return {Function}
8841
+ */
8842
+ function createPrivateInjectorFactory(childInjector) {
8561
8843
  return annotate(function(key) {
8562
- return privateChildInjector.get(key);
8844
+ return childInjector.get(key);
8563
8845
  });
8564
- };
8846
+ }
8565
8847
 
8566
- var createChild = function(modules, forceNewInstances) {
8848
+ /**
8849
+ * @param {ModuleDefinition[]} modules
8850
+ * @param {string[]} [forceNewInstances]
8851
+ *
8852
+ * @return {Injector}
8853
+ */
8854
+ function createChild(modules, forceNewInstances) {
8567
8855
  if (forceNewInstances && forceNewInstances.length) {
8568
8856
  var fromParentModule = Object.create(null);
8569
8857
  var matchedScopes = Object.create(null);
@@ -8588,12 +8876,12 @@
8588
8876
  privateInjectorsCache.push(provider[3]);
8589
8877
  privateChildInjectors.push(privateChildInjector);
8590
8878
  privateChildFactories.push(privateChildInjectorFactory);
8591
- fromParentModule[name] = [privateChildInjectorFactory, name, 'private', privateChildInjector];
8879
+ fromParentModule[name] = [ privateChildInjectorFactory, name, 'private', privateChildInjector ];
8592
8880
  } else {
8593
- fromParentModule[name] = [privateChildFactories[cacheIdx], name, 'private', privateChildInjectors[cacheIdx]];
8881
+ fromParentModule[name] = [ privateChildFactories[cacheIdx], name, 'private', privateChildInjectors[cacheIdx] ];
8594
8882
  }
8595
8883
  } else {
8596
- fromParentModule[name] = [provider[2], provider[1]];
8884
+ fromParentModule[name] = [ provider[2], provider[1] ];
8597
8885
  }
8598
8886
  matchedScopes[name] = true;
8599
8887
  }
@@ -8602,7 +8890,7 @@
8602
8890
  /* jshint -W083 */
8603
8891
  forceNewInstances.forEach(function(scope) {
8604
8892
  if (provider[1].$scope.indexOf(scope) !== -1) {
8605
- fromParentModule[name] = [provider[2], provider[1]];
8893
+ fromParentModule[name] = [ provider[2], provider[1] ];
8606
8894
  matchedScopes[scope] = true;
8607
8895
  }
8608
8896
  });
@@ -8619,7 +8907,7 @@
8619
8907
  }
8620
8908
 
8621
8909
  return new Injector(modules, self);
8622
- };
8910
+ }
8623
8911
 
8624
8912
  var factoryMap = {
8625
8913
  factory: invoke,
@@ -8629,62 +8917,169 @@
8629
8917
  }
8630
8918
  };
8631
8919
 
8632
- modules.forEach(function(module) {
8920
+ /**
8921
+ * @param {ModuleDefinition} moduleDefinition
8922
+ * @param {Injector} injector
8923
+ */
8924
+ function createInitializer(moduleDefinition, injector) {
8633
8925
 
8634
- function arrayUnwrap(type, value) {
8635
- if (type !== 'value' && isArray$1(value)) {
8636
- value = annotate(value.slice());
8637
- }
8926
+ var initializers = moduleDefinition.__init__ || [];
8638
8927
 
8639
- return value;
8640
- }
8928
+ return function() {
8929
+ initializers.forEach(function(initializer) {
8641
8930
 
8642
- // TODO(vojta): handle wrong inputs (modules)
8643
- if (module instanceof Module) {
8644
- module.forEach(function(provider) {
8645
- var name = provider[0];
8646
- var type = provider[1];
8647
- var value = provider[2];
8931
+ try {
8648
8932
 
8649
- providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];
8650
- });
8651
- } else if (typeof module === 'object') {
8652
- if (module.__exports__) {
8653
- var clonedModule = Object.keys(module).reduce(function(m, key) {
8654
- if (key.substring(0, 2) !== '__') {
8655
- m[key] = module[key];
8933
+ // eagerly resolve component (fn or string)
8934
+ if (typeof initializer === 'string') {
8935
+ injector.get(initializer);
8936
+ } else {
8937
+ injector.invoke(initializer);
8656
8938
  }
8657
- return m;
8658
- }, Object.create(null));
8659
-
8660
- var privateInjector = new Injector((module.__modules__ || []).concat([clonedModule]), self);
8661
- var getFromPrivateInjector = annotate(function(key) {
8662
- return privateInjector.get(key);
8663
- });
8664
- module.__exports__.forEach(function(key) {
8665
- providers[key] = [getFromPrivateInjector, key, 'private', privateInjector];
8666
- });
8667
- } else {
8668
- Object.keys(module).forEach(function(name) {
8669
- if (module[name][2] === 'private') {
8670
- providers[name] = module[name];
8671
- return;
8939
+ } catch (error) {
8940
+ if (typeof AggregateError !== 'undefined') {
8941
+ throw new AggregateError([ error ], 'Failed to initialize!');
8672
8942
  }
8673
8943
 
8674
- var type = module[name][0];
8675
- var value = module[name][1];
8944
+ throw new Error('Failed to initialize! ' + error.message);
8945
+ }
8946
+ });
8947
+ };
8948
+ }
8676
8949
 
8677
- providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];
8678
- });
8950
+ /**
8951
+ * @param {ModuleDefinition} moduleDefinition
8952
+ */
8953
+ function loadModule(moduleDefinition) {
8954
+
8955
+ var moduleExports = moduleDefinition.__exports__;
8956
+
8957
+ // private module
8958
+ if (moduleExports) {
8959
+ var nestedModules = moduleDefinition.__modules__;
8960
+
8961
+ var clonedModule = Object.keys(moduleDefinition).reduce(function(clonedModule, key) {
8962
+
8963
+ if (key !== '__exports__' && key !== '__modules__' && key !== '__init__' && key !== '__depends__') {
8964
+ clonedModule[key] = moduleDefinition[key];
8965
+ }
8966
+
8967
+ return clonedModule;
8968
+ }, Object.create(null));
8969
+
8970
+ var childModules = (nestedModules || []).concat(clonedModule);
8971
+
8972
+ var privateInjector = createChild(childModules);
8973
+ var getFromPrivateInjector = annotate(function(key) {
8974
+ return privateInjector.get(key);
8975
+ });
8976
+
8977
+ moduleExports.forEach(function(key) {
8978
+ providers[key] = [ getFromPrivateInjector, key, 'private', privateInjector ];
8979
+ });
8980
+
8981
+ // ensure child injector initializes
8982
+ var initializers = (moduleDefinition.__init__ || []).slice();
8983
+
8984
+ initializers.unshift(function() {
8985
+ privateInjector.init();
8986
+ });
8987
+
8988
+ moduleDefinition = Object.assign({}, moduleDefinition, {
8989
+ __init__: initializers
8990
+ });
8991
+
8992
+ return createInitializer(moduleDefinition, privateInjector);
8993
+ }
8994
+
8995
+ // normal module
8996
+ Object.keys(moduleDefinition).forEach(function(key) {
8997
+
8998
+ if (key === '__init__' || key === '__depends__') {
8999
+ return;
8679
9000
  }
9001
+
9002
+ if (moduleDefinition[key][2] === 'private') {
9003
+ providers[key] = moduleDefinition[key];
9004
+ return;
9005
+ }
9006
+
9007
+ var type = moduleDefinition[key][0];
9008
+ var value = moduleDefinition[key][1];
9009
+
9010
+ providers[key] = [ factoryMap[type], arrayUnwrap(type, value), type ];
9011
+ });
9012
+
9013
+ return createInitializer(moduleDefinition, self);
9014
+ }
9015
+
9016
+ /**
9017
+ * @param {ModuleDefinition[]} moduleDefinitions
9018
+ * @param {ModuleDefinition} moduleDefinition
9019
+ *
9020
+ * @return {ModuleDefinition[]}
9021
+ */
9022
+ function resolveDependencies(moduleDefinitions, moduleDefinition) {
9023
+
9024
+ if (moduleDefinitions.indexOf(moduleDefinition) !== -1) {
9025
+ return moduleDefinitions;
8680
9026
  }
8681
- });
9027
+
9028
+ moduleDefinitions = (moduleDefinition.__depends__ || []).reduce(resolveDependencies, moduleDefinitions);
9029
+
9030
+ if (moduleDefinitions.indexOf(moduleDefinition) !== -1) {
9031
+ return moduleDefinitions;
9032
+ }
9033
+
9034
+ return moduleDefinitions.concat(moduleDefinition);
9035
+ }
9036
+
9037
+ /**
9038
+ * @param {ModuleDefinition[]} moduleDefinitions
9039
+ *
9040
+ * @return { () => void } initializerFn
9041
+ */
9042
+ function bootstrap(moduleDefinitions) {
9043
+
9044
+ var initializers = moduleDefinitions
9045
+ .reduce(resolveDependencies, [])
9046
+ .map(loadModule);
9047
+
9048
+ var initialized = false;
9049
+
9050
+ return function() {
9051
+
9052
+ if (initialized) {
9053
+ return;
9054
+ }
9055
+
9056
+ initialized = true;
9057
+
9058
+ initializers.forEach(function(initializer) {
9059
+ return initializer();
9060
+ });
9061
+ };
9062
+ }
8682
9063
 
8683
9064
  // public API
8684
9065
  this.get = get;
8685
9066
  this.invoke = invoke;
8686
9067
  this.instantiate = instantiate;
8687
9068
  this.createChild = createChild;
9069
+
9070
+ // setup
9071
+ this.init = bootstrap(modules);
9072
+ }
9073
+
9074
+
9075
+ // helpers ///////////////
9076
+
9077
+ function arrayUnwrap(type, value) {
9078
+ if (type !== 'value' && isArray$2(value)) {
9079
+ value = annotate(value.slice());
9080
+ }
9081
+
9082
+ return value;
8688
9083
  }
8689
9084
 
8690
9085
  // apply default renderer with lowest possible priority
@@ -8707,7 +9102,7 @@
8707
9102
  this.FRAME_STYLE = styles.style([ 'no-fill' ], { stroke: 'fuchsia', strokeDasharray: 4, strokeWidth: 2 });
8708
9103
  }
8709
9104
 
8710
- inherits_browser(DefaultRenderer, BaseRenderer);
9105
+ e(DefaultRenderer, BaseRenderer);
8711
9106
 
8712
9107
 
8713
9108
  DefaultRenderer.prototype.canRender = function() {
@@ -8963,7 +9358,7 @@
8963
9358
  var parent = document.createElement('div');
8964
9359
  parent.setAttribute('class', 'djs-container');
8965
9360
 
8966
- assign(parent.style, {
9361
+ assign$1(parent, {
8967
9362
  position: 'relative',
8968
9363
  overflow: 'hidden',
8969
9364
  width: ensurePx(options.width),
@@ -11042,7 +11437,7 @@
11042
11437
  attacherRefs.bind(this, 'attachers');
11043
11438
  }
11044
11439
 
11045
- inherits_browser(Shape, Base);
11440
+ e(Shape, Base);
11046
11441
 
11047
11442
 
11048
11443
  /**
@@ -11057,7 +11452,7 @@
11057
11452
  Shape.call(this);
11058
11453
  }
11059
11454
 
11060
- inherits_browser(Root, Shape);
11455
+ e(Root, Shape);
11061
11456
 
11062
11457
 
11063
11458
  /**
@@ -11080,7 +11475,7 @@
11080
11475
  labelRefs.bind(this, 'labelTarget');
11081
11476
  }
11082
11477
 
11083
- inherits_browser(Label, Shape);
11478
+ e(Label, Shape);
11084
11479
 
11085
11480
 
11086
11481
  /**
@@ -11111,7 +11506,7 @@
11111
11506
  incomingRefs.bind(this, 'target');
11112
11507
  }
11113
11508
 
11114
- inherits_browser(Connection, Base);
11509
+ e(Connection, Base);
11115
11510
 
11116
11511
 
11117
11512
  var types = {
@@ -11962,62 +12357,21 @@
11962
12357
  graphicsFactory: [ 'type', GraphicsFactory ]
11963
12358
  };
11964
12359
 
12360
+ /**
12361
+ * @typedef { import('didi').ModuleDeclaration } Module
12362
+ */
12363
+
11965
12364
  /**
11966
12365
  * Bootstrap an injector from a list of modules, instantiating a number of default components
11967
12366
  *
11968
- * @ignore
11969
- * @param {Array<didi.Module>} bootstrapModules
12367
+ * @param {Array<Module>} modules
11970
12368
  *
11971
- * @return {didi.Injector} a injector to use to access the components
12369
+ * @return {Injector} a injector to use to access the components
11972
12370
  */
11973
- function bootstrap(bootstrapModules) {
11974
-
11975
- var modules = [],
11976
- components = [];
11977
-
11978
- function hasModule(m) {
11979
- return modules.indexOf(m) >= 0;
11980
- }
11981
-
11982
- function addModule(m) {
11983
- modules.push(m);
11984
- }
11985
-
11986
- function visit(m) {
11987
- if (hasModule(m)) {
11988
- return;
11989
- }
11990
-
11991
- (m.__depends__ || []).forEach(visit);
11992
-
11993
- if (hasModule(m)) {
11994
- return;
11995
- }
11996
-
11997
- addModule(m);
11998
-
11999
- (m.__init__ || []).forEach(function(c) {
12000
- components.push(c);
12001
- });
12002
- }
12003
-
12004
- bootstrapModules.forEach(visit);
12005
-
12371
+ function bootstrap(modules) {
12006
12372
  var injector = new Injector(modules);
12007
12373
 
12008
- components.forEach(function(c) {
12009
-
12010
- try {
12011
-
12012
- // eagerly resolve component (fn or string)
12013
- injector[typeof c === 'string' ? 'get' : 'invoke'](c);
12014
- } catch (e) {
12015
- console.error('Failed to instantiate component');
12016
- console.error(e.stack);
12017
-
12018
- throw e;
12019
- }
12020
- });
12374
+ injector.init();
12021
12375
 
12022
12376
  return injector;
12023
12377
  }
@@ -12025,9 +12379,8 @@
12025
12379
  /**
12026
12380
  * Creates an injector from passed options.
12027
12381
  *
12028
- * @ignore
12029
- * @param {Object} options
12030
- * @return {didi.Injector}
12382
+ * @param {Object} options
12383
+ * @return {Injector}
12031
12384
  */
12032
12385
  function createInjector(options) {
12033
12386
 
@@ -12047,7 +12400,7 @@
12047
12400
  * The main diagram-js entry point that bootstraps the diagram with the given
12048
12401
  * configuration.
12049
12402
  *
12050
- * To register extensions with the diagram, pass them as Array<didi.Module> to the constructor.
12403
+ * To register extensions with the diagram, pass them as Array<Module> to the constructor.
12051
12404
  *
12052
12405
  * @class djs.Diagram
12053
12406
  * @memberOf djs
@@ -12089,8 +12442,8 @@
12089
12442
  * // 'shape ... was added to the diagram' logged to console
12090
12443
  *
12091
12444
  * @param {Object} options
12092
- * @param {Array<didi.Module>} [options.modules] external modules to instantiate with the diagram
12093
- * @param {didi.Injector} [injector] an (optional) injector to bootstrap the diagram with
12445
+ * @param {Array<Module>} [options.modules] external modules to instantiate with the diagram
12446
+ * @param {Injector} [injector] an (optional) injector to bootstrap the diagram with
12094
12447
  */
12095
12448
  function Diagram(options, injector) {
12096
12449
 
@@ -12755,7 +13108,7 @@
12755
13108
 
12756
13109
  var propertyName = property && property.name;
12757
13110
 
12758
- if (isUndefined$1(value)) {
13111
+ if (isUndefined$2(value)) {
12759
13112
  // unset the property, if the specified value is undefined;
12760
13113
  // delete from $attrs (for extensions) or the target itself
12761
13114
  if (property) {
@@ -12846,7 +13199,7 @@
12846
13199
  };
12847
13200
 
12848
13201
 
12849
- function isUndefined$1(val) {
13202
+ function isUndefined$2(val) {
12850
13203
  return typeof val === 'undefined';
12851
13204
  }
12852
13205
 
@@ -20401,53 +20754,53 @@
20401
20754
 
20402
20755
 
20403
20756
  // inlined ../../resources/logo.svg
20404
- var BPMNIO_LOGO_SVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21" style="vertical-align:middle"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>';
20757
+ var BPMNIO_LOGO_SVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>';
20405
20758
 
20406
20759
  var BPMNIO_IMG = BPMNIO_LOGO_SVG;
20407
20760
 
20408
- function css(attrs) {
20409
- return attrs.join(';');
20410
- }
20411
-
20412
- var LINK_STYLES = css([
20413
- 'color: #404040'
20414
- ]);
20415
-
20416
- var LIGHTBOX_STYLES = css([
20417
- 'z-index: 1001',
20418
- 'position: fixed',
20419
- 'top: 0',
20420
- 'left: 0',
20421
- 'right: 0',
20422
- 'bottom: 0'
20423
- ]);
20424
-
20425
- var BACKDROP_STYLES = css([
20426
- 'width: 100%',
20427
- 'height: 100%',
20428
- 'background: rgba(40,40,40,0.2)'
20429
- ]);
20430
-
20431
- var NOTICE_STYLES = css([
20432
- 'position: absolute',
20433
- 'left: 50%',
20434
- 'top: 40%',
20435
- 'transform: translate(-50%)',
20436
- 'width: 260px',
20437
- 'padding: 10px',
20438
- 'background: white',
20439
- 'box-shadow: 0 1px 4px rgba(0,0,0,0.3)',
20440
- 'font-family: Helvetica, Arial, sans-serif',
20441
- 'font-size: 14px',
20442
- 'display: flex',
20443
- 'line-height: 1.3'
20444
- ]);
20761
+ var LOGO_STYLES = {
20762
+ verticalAlign: 'middle'
20763
+ };
20764
+
20765
+ var LINK_STYLES = {
20766
+ 'color': '#404040'
20767
+ };
20768
+
20769
+ var LIGHTBOX_STYLES = {
20770
+ 'zIndex': '1001',
20771
+ 'position': 'fixed',
20772
+ 'top': '0',
20773
+ 'left': '0',
20774
+ 'right': '0',
20775
+ 'bottom': '0'
20776
+ };
20777
+
20778
+ var BACKDROP_STYLES = {
20779
+ 'width': '100%',
20780
+ 'height': '100%',
20781
+ 'background': 'rgba(40,40,40,0.2)'
20782
+ };
20783
+
20784
+ var NOTICE_STYLES = {
20785
+ 'position': 'absolute',
20786
+ 'left': '50%',
20787
+ 'top': '40%',
20788
+ 'transform': 'translate(-50%)',
20789
+ 'width': '260px',
20790
+ 'padding': '10px',
20791
+ 'background': 'white',
20792
+ 'boxShadow': '0 1px 4px rgba(0,0,0,0.3)',
20793
+ 'fontFamily': 'Helvetica, Arial, sans-serif',
20794
+ 'fontSize': '14px',
20795
+ 'display': 'flex',
20796
+ 'lineHeight': '1.3'
20797
+ };
20445
20798
 
20446
20799
  var LIGHTBOX_MARKUP =
20447
- '<div class="bjs-powered-by-lightbox" style="' + LIGHTBOX_STYLES + '">' +
20448
- '<div class="backdrop" style="' + BACKDROP_STYLES + '"></div>' +
20449
- '<div class="notice" style="' + NOTICE_STYLES + '">' +
20450
- '<a href="https://bpmn.io" target="_blank" rel="noopener" style="margin: 15px 20px 15px 10px; align-self: center;' + LINK_STYLES + '">' +
20800
+ '<div class="bjs-powered-by-lightbox">' +
20801
+ '<div class="backdrop"></div>' +
20802
+ '<div class="notice">' +
20803
+ '<a href="https://bpmn.io" target="_blank" rel="noopener" class="link">' +
20451
20804
  BPMNIO_IMG +
20452
20805
  '</a>' +
20453
20806
  '<span>' +
@@ -20460,10 +20813,23 @@
20460
20813
 
20461
20814
  var lightbox;
20462
20815
 
20816
+ function createLightbox() {
20817
+ lightbox = domify(LIGHTBOX_MARKUP);
20818
+
20819
+ assign$1(lightbox, LIGHTBOX_STYLES);
20820
+ assign$1(query('svg', lightbox), LOGO_STYLES);
20821
+ assign$1(query('.backdrop', lightbox), BACKDROP_STYLES);
20822
+ assign$1(query('.notice', lightbox), NOTICE_STYLES);
20823
+ assign$1(query('.link', lightbox), LINK_STYLES, {
20824
+ 'margin': '15px 20px 15px 10px',
20825
+ 'alignSelf': 'center'
20826
+ });
20827
+ }
20828
+
20463
20829
  function open() {
20464
20830
 
20465
20831
  if (!lightbox) {
20466
- lightbox = domify(LIGHTBOX_MARKUP);
20832
+ createLightbox();
20467
20833
 
20468
20834
  delegate.bind(lightbox, '.backdrop', 'click', function(event) {
20469
20835
  document.body.removeChild(lightbox);
@@ -20511,7 +20877,7 @@
20511
20877
  this._init(this._container, this._moddle, options);
20512
20878
  }
20513
20879
 
20514
- inherits_browser(BaseViewer, Diagram);
20880
+ e(BaseViewer, Diagram);
20515
20881
 
20516
20882
  /**
20517
20883
  * The importXML result.
@@ -21099,7 +21465,7 @@
21099
21465
 
21100
21466
  var container = domify('<div class="bjs-container"></div>');
21101
21467
 
21102
- assign(container.style, {
21468
+ assign$1(container, {
21103
21469
  width: ensureUnit(options.width),
21104
21470
  height: ensureUnit(options.height),
21105
21471
  position: options.position
@@ -21189,12 +21555,20 @@
21189
21555
  'target="_blank" ' +
21190
21556
  'class="bjs-powered-by" ' +
21191
21557
  'title="Powered by bpmn.io" ' +
21192
- 'style="position: absolute; bottom: 15px; right: 15px; z-index: 100; ' + LINK_STYLES + '">' +
21558
+ '>' +
21193
21559
  img +
21194
21560
  '</a>';
21195
21561
 
21196
21562
  var linkElement = domify(linkMarkup);
21197
21563
 
21564
+ assign$1(query('svg', linkElement), LOGO_STYLES);
21565
+ assign$1(linkElement, LINK_STYLES, {
21566
+ position: 'absolute',
21567
+ bottom: '15px',
21568
+ right: '15px',
21569
+ zIndex: '100'
21570
+ });
21571
+
21198
21572
  container.appendChild(linkElement);
21199
21573
 
21200
21574
  componentEvent.bind(linkElement, 'click', function(event) {
@@ -21257,7 +21631,7 @@
21257
21631
  BaseViewer.call(this, options);
21258
21632
  }
21259
21633
 
21260
- inherits_browser(Viewer, BaseViewer);
21634
+ e(Viewer, BaseViewer);
21261
21635
 
21262
21636
  // modules the viewer is composed of
21263
21637
  Viewer.prototype._modules = [
@@ -22231,7 +22605,7 @@
22231
22605
  Viewer.call(this, options);
22232
22606
  }
22233
22607
 
22234
- inherits_browser(NavigatedViewer, Viewer);
22608
+ e(NavigatedViewer, Viewer);
22235
22609
 
22236
22610
 
22237
22611
  NavigatedViewer.prototype._navigationModules = [
@@ -23417,27 +23791,27 @@
23417
23791
  emumerations: emumerations
23418
23792
  };
23419
23793
 
23420
- const commonModdleExtensions = {
23421
- camunda: camundaModdle
23794
+ const commonModdleExtensions = {
23795
+ camunda: camundaModdle
23422
23796
  };
23423
23797
 
23424
- /**
23425
- *
23426
- * @param {Object} options
23427
- */
23428
- function NavigatedViewer$1(options = {}) {
23429
-
23430
- options = {
23431
- ...options,
23432
- moddleExtensions: {
23433
- ...commonModdleExtensions,
23434
- ...options.moddleExtensions
23435
- }
23436
- };
23437
-
23438
- NavigatedViewer.call(this, options);
23439
- }
23440
-
23798
+ /**
23799
+ *
23800
+ * @param {Object} options
23801
+ */
23802
+ function NavigatedViewer$1(options = {}) {
23803
+
23804
+ options = {
23805
+ ...options,
23806
+ moddleExtensions: {
23807
+ ...commonModdleExtensions,
23808
+ ...options.moddleExtensions
23809
+ }
23810
+ };
23811
+
23812
+ NavigatedViewer.call(this, options);
23813
+ }
23814
+
23441
23815
  inherits_browser(NavigatedViewer$1, NavigatedViewer);
23442
23816
 
23443
23817
  return NavigatedViewer$1;