camunda-bpmn-js 0.14.0 → 0.15.2

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 +280 -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 +32 -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);
@@ -5294,13 +5394,98 @@
5294
5394
  *
5295
5395
  * @return {Point}
5296
5396
  */
5297
- function getMid(bounds) {
5397
+ function getBoundsMid(bounds) {
5298
5398
  return roundPoint({
5299
5399
  x: bounds.x + (bounds.width || 0) / 2,
5300
5400
  y: bounds.y + (bounds.height || 0) / 2
5301
5401
  });
5302
5402
  }
5303
5403
 
5404
+
5405
+ /**
5406
+ * Get the mid of the given Connection.
5407
+ *
5408
+ * @param {djs.Base.Connection} connection
5409
+ *
5410
+ * @return {Point}
5411
+ */
5412
+ function getConnectionMid(connection) {
5413
+ var waypoints = connection.waypoints;
5414
+
5415
+ // calculate total length and length of each segment
5416
+ var parts = waypoints.reduce(function(parts, point, index) {
5417
+
5418
+ var lastPoint = waypoints[index - 1];
5419
+
5420
+ if (lastPoint) {
5421
+ var lastPart = parts[parts.length - 1];
5422
+
5423
+ var startLength = lastPart && lastPart.endLength || 0;
5424
+ var length = distance(lastPoint, point);
5425
+
5426
+ parts.push({
5427
+ start: lastPoint,
5428
+ end: point,
5429
+ startLength: startLength,
5430
+ endLength: startLength + length,
5431
+ length: length
5432
+ });
5433
+ }
5434
+
5435
+ return parts;
5436
+ }, []);
5437
+
5438
+ var totalLength = parts.reduce(function(length, part) {
5439
+ return length + part.length;
5440
+ }, 0);
5441
+
5442
+ // find which segement contains middle point
5443
+ var midLength = totalLength / 2;
5444
+
5445
+ var i = 0;
5446
+ var midSegment = parts[i];
5447
+
5448
+ while (midSegment.endLength < midLength) {
5449
+ midSegment = parts[++i];
5450
+ }
5451
+
5452
+ // calculate relative position on mid segment
5453
+ var segmentProgress = (midLength - midSegment.startLength) / midSegment.length;
5454
+
5455
+ var midPoint = {
5456
+ x: midSegment.start.x + (midSegment.end.x - midSegment.start.x) * segmentProgress,
5457
+ y: midSegment.start.y + (midSegment.end.y - midSegment.start.y) * segmentProgress
5458
+ };
5459
+
5460
+ return midPoint;
5461
+ }
5462
+
5463
+
5464
+ /**
5465
+ * Get the mid of the given Element.
5466
+ *
5467
+ * @param {djs.Base.Connection} connection
5468
+ *
5469
+ * @return {Point}
5470
+ */
5471
+ function getMid(element) {
5472
+ if (isConnection(element)) {
5473
+ return getConnectionMid(element);
5474
+ }
5475
+
5476
+ return getBoundsMid(element);
5477
+ }
5478
+
5479
+ // helpers //////////////////////
5480
+
5481
+ function distance(a, b) {
5482
+ return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));
5483
+ }
5484
+
5485
+ function isConnection(element) {
5486
+ return !!element.waypoints;
5487
+ }
5488
+
5304
5489
  function elementToString(e) {
5305
5490
  if (!e) {
5306
5491
  return '<null>';
@@ -5943,10 +6128,13 @@
5943
6128
 
5944
6129
  var ALL_HIT_STYLE = createHitStyle('djs-hit djs-hit-all');
5945
6130
 
6131
+ var NO_MOVE_HIT_STYLE = createHitStyle('djs-hit djs-hit-no-move');
6132
+
5946
6133
  var HIT_TYPES = {
5947
6134
  'all': ALL_HIT_STYLE,
5948
6135
  'click-stroke': CLICK_STROKE_HIT_STYLE,
5949
- 'stroke': STROKE_HIT_STYLE
6136
+ 'stroke': STROKE_HIT_STYLE,
6137
+ 'no-move': NO_MOVE_HIT_STYLE
5950
6138
  };
5951
6139
 
5952
6140
  function createHitStyle(classNames, attrs) {
@@ -6199,7 +6387,9 @@
6199
6387
  * the array or the element primitive.
6200
6388
  *
6201
6389
  * @param {Array<djs.model.Shape>|djs.model.Shape} elements
6202
- * @param {boolean} stopRecursion
6390
+ * @param {boolean} [stopRecursion=false]
6391
+ *
6392
+ * @return {Bounds}
6203
6393
  */
6204
6394
  function getBBox(elements, stopRecursion) {
6205
6395
 
@@ -6295,6 +6485,7 @@
6295
6485
  attr(outline, assign({
6296
6486
  x: 10,
6297
6487
  y: 10,
6488
+ rx: 3,
6298
6489
  width: 100,
6299
6490
  height: 100
6300
6491
  }, OUTLINE_STYLE));
@@ -6486,6 +6677,8 @@
6486
6677
  var MARKER_HOVER = 'hover',
6487
6678
  MARKER_SELECTED = 'selected';
6488
6679
 
6680
+ var SELECTION_OUTLINE_PADDING = 6;
6681
+
6489
6682
 
6490
6683
  /**
6491
6684
  * A plugin that adds a visible selection UI to shapes and connections
@@ -6495,11 +6688,13 @@
6495
6688
  *
6496
6689
  * Makes elements selectable, too.
6497
6690
  *
6498
- * @param {EventBus} events
6499
- * @param {SelectionService} selection
6500
6691
  * @param {Canvas} canvas
6692
+ * @param {EventBus} eventBus
6501
6693
  */
6502
- function SelectionVisuals(events, canvas, selection, styles) {
6694
+ function SelectionVisuals(canvas, eventBus, selection) {
6695
+ this._canvas = canvas;
6696
+
6697
+ var self = this;
6503
6698
 
6504
6699
  this._multiSelectionBox = null;
6505
6700
 
@@ -6511,15 +6706,15 @@
6511
6706
  canvas.removeMarker(e, cls);
6512
6707
  }
6513
6708
 
6514
- events.on('element.hover', function(event) {
6709
+ eventBus.on('element.hover', function(event) {
6515
6710
  addMarker(event.element, MARKER_HOVER);
6516
6711
  });
6517
6712
 
6518
- events.on('element.out', function(event) {
6713
+ eventBus.on('element.out', function(event) {
6519
6714
  removeMarker(event.element, MARKER_HOVER);
6520
6715
  });
6521
6716
 
6522
- events.on('selection.changed', function(event) {
6717
+ eventBus.on('selection.changed', function(event) {
6523
6718
 
6524
6719
  function deselect(s) {
6525
6720
  removeMarker(s, MARKER_SELECTED);
@@ -6543,16 +6738,63 @@
6543
6738
  select(e);
6544
6739
  }
6545
6740
  });
6741
+
6742
+ self._updateSelectionOutline(newSelection);
6743
+ });
6744
+
6745
+
6746
+ eventBus.on('element.changed', function(event) {
6747
+ if (selection.isSelected(event.element)) {
6748
+ self._updateSelectionOutline(selection.get());
6749
+ }
6546
6750
  });
6547
6751
  }
6548
6752
 
6549
6753
  SelectionVisuals.$inject = [
6550
- 'eventBus',
6551
6754
  'canvas',
6552
- 'selection',
6553
- 'styles'
6755
+ 'eventBus',
6756
+ 'selection'
6554
6757
  ];
6555
6758
 
6759
+ SelectionVisuals.prototype._updateSelectionOutline = function(selection) {
6760
+ var layer = this._canvas.getLayer('selectionOutline');
6761
+
6762
+ clear(layer);
6763
+
6764
+ var enabled = selection.length > 1;
6765
+
6766
+ var container = this._canvas.getContainer();
6767
+
6768
+ classes(container)[enabled ? 'add' : 'remove']('djs-multi-select');
6769
+
6770
+ if (!enabled) {
6771
+ return;
6772
+ }
6773
+
6774
+ var bBox = addSelectionOutlinePadding(getBBox(selection));
6775
+
6776
+ var rect = create('rect');
6777
+
6778
+ attr(rect, assign({
6779
+ rx: 3
6780
+ }, bBox));
6781
+
6782
+ classes(rect).add('djs-selection-outline');
6783
+
6784
+ append(layer, rect);
6785
+ };
6786
+
6787
+ // helpers //////////
6788
+
6789
+ function addSelectionOutlinePadding(bBox) {
6790
+ return {
6791
+ x: bBox.x - SELECTION_OUTLINE_PADDING,
6792
+ y: bBox.y - SELECTION_OUTLINE_PADDING,
6793
+ width: bBox.width + SELECTION_OUTLINE_PADDING * 2,
6794
+ height: bBox.height + SELECTION_OUTLINE_PADDING * 2
6795
+ };
6796
+ }
6797
+
6556
6798
  function SelectionBehavior(eventBus, selection, canvas, elementRegistry) {
6557
6799
 
6558
6800
  // Select elements on create
@@ -6583,11 +6825,10 @@
6583
6825
  // Select connection targets on connect
6584
6826
  eventBus.on('connect.end', 500, function(event) {
6585
6827
  var context = event.context,
6586
- canExecute = context.canExecute,
6587
- hover = context.hover;
6828
+ connection = context.connection;
6588
6829
 
6589
- if (canExecute && hover) {
6590
- selection.select(hover);
6830
+ if (connection) {
6831
+ selection.select(connection);
6591
6832
  }
6592
6833
  });
6593
6834
 
@@ -7053,7 +7294,8 @@
7053
7294
 
7054
7295
 
7055
7296
  Overlays.prototype._createOverlayContainer = function(element) {
7056
- var html = domify('<div class="djs-overlays" style="position: absolute" />');
7297
+ var html = domify('<div class="djs-overlays" />');
7298
+ assign$1(html, { position: 'absolute' });
7057
7299
 
7058
7300
  this._overlayRoot.appendChild(html);
7059
7301
 
@@ -7124,7 +7366,8 @@
7124
7366
 
7125
7367
  overlayContainer = this._getOverlayContainer(element);
7126
7368
 
7127
- htmlContainer = domify('<div class="djs-overlay" data-overlay-id="' + id + '" style="position: absolute">');
7369
+ htmlContainer = domify('<div class="djs-overlay" data-overlay-id="' + id + '">');
7370
+ assign$1(htmlContainer, { position: 'absolute' });
7128
7371
 
7129
7372
  htmlContainer.appendChild(html);
7130
7373
 
@@ -7309,18 +7552,30 @@
7309
7552
 
7310
7553
  function createRoot(parentNode) {
7311
7554
  var root = domify(
7312
- '<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />'
7555
+ '<div class="djs-overlay-container" />'
7313
7556
  );
7314
7557
 
7558
+ assign$1(root, {
7559
+ position: 'absolute',
7560
+ width: 0,
7561
+ height: 0
7562
+ });
7563
+
7315
7564
  parentNode.insertBefore(root, parentNode.firstChild);
7316
7565
 
7317
7566
  return root;
7318
7567
  }
7319
7568
 
7320
7569
  function setPosition(el, x, y) {
7321
- assign(el.style, { left: x + 'px', top: y + 'px' });
7570
+ assign$1(el, { left: x + 'px', top: y + 'px' });
7322
7571
  }
7323
7572
 
7573
+ /**
7574
+ * Set element visible
7575
+ *
7576
+ * @param {DOMElement} el
7577
+ * @param {boolean} [visible=true]
7578
+ */
7324
7579
  function setVisible(el, visible) {
7325
7580
  el.style.display = visible === false ? 'none' : '';
7326
7581
  }
@@ -7418,7 +7673,7 @@
7418
7673
  *
7419
7674
  * @example
7420
7675
  *
7421
- * import inherits from 'inherits';
7676
+ * import inherits from 'inherits-browser';
7422
7677
  *
7423
7678
  * import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
7424
7679
  *
@@ -7574,7 +7829,7 @@
7574
7829
  });
7575
7830
  }
7576
7831
 
7577
- inherits_browser(RootElementsBehavior, CommandInterceptor);
7832
+ e(RootElementsBehavior, CommandInterceptor);
7578
7833
 
7579
7834
  RootElementsBehavior.$inject = [ 'canvas', 'injector' ];
7580
7835
 
@@ -8257,7 +8512,7 @@
8257
8512
 
8258
8513
  }
8259
8514
 
8260
- inherits_browser(DrilldownOverlayBehavior, CommandInterceptor);
8515
+ e(DrilldownOverlayBehavior, CommandInterceptor);
8261
8516
 
8262
8517
  DrilldownOverlayBehavior.prototype.updateDrilldownOverlay = function(shape) {
8263
8518
  var canvas = this._canvas;
@@ -8358,22 +8613,50 @@
8358
8613
 
8359
8614
  var CLASS_PATTERN = /^class /;
8360
8615
 
8616
+
8617
+ /**
8618
+ * @param {function} fn
8619
+ *
8620
+ * @return {boolean}
8621
+ */
8361
8622
  function isClass(fn) {
8362
8623
  return CLASS_PATTERN.test(fn.toString());
8363
8624
  }
8364
8625
 
8365
- function isArray$1(obj) {
8626
+ /**
8627
+ * @param {any} obj
8628
+ *
8629
+ * @return {boolean}
8630
+ */
8631
+ function isArray$2(obj) {
8366
8632
  return Object.prototype.toString.call(obj) === '[object Array]';
8367
8633
  }
8368
8634
 
8635
+ /**
8636
+ * @param {any} obj
8637
+ * @param {string} prop
8638
+ *
8639
+ * @return {boolean}
8640
+ */
8369
8641
  function hasOwnProp(obj, prop) {
8370
8642
  return Object.prototype.hasOwnProperty.call(obj, prop);
8371
8643
  }
8372
8644
 
8645
+ /**
8646
+ * @typedef {import('./index').InjectAnnotated } InjectAnnotated
8647
+ */
8648
+
8649
+ /**
8650
+ * @template T
8651
+ *
8652
+ * @params {[...string[], T] | ...string[], T} args
8653
+ *
8654
+ * @return {T & InjectAnnotated}
8655
+ */
8373
8656
  function annotate() {
8374
8657
  var args = Array.prototype.slice.call(arguments);
8375
8658
 
8376
- if (args.length === 1 && isArray$1(args[0])) {
8659
+ if (args.length === 1 && isArray$2(args[0])) {
8377
8660
  args = args[0];
8378
8661
  }
8379
8662
 
@@ -8399,9 +8682,14 @@
8399
8682
  // of a nested class, too.
8400
8683
 
8401
8684
  var CONSTRUCTOR_ARGS = /constructor\s*[^(]*\(\s*([^)]*)\)/m;
8402
- var FN_ARGS = /^(?:async )?(?:function\s*)?[^(]*\(\s*([^)]*)\)/m;
8685
+ var FN_ARGS = /^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m;
8403
8686
  var FN_ARG = /\/\*([^*]*)\*\//m;
8404
8687
 
8688
+ /**
8689
+ * @param {unknown} fn
8690
+ *
8691
+ * @return {string[]}
8692
+ */
8405
8693
  function parseAnnotations(fn) {
8406
8694
 
8407
8695
  if (typeof fn !== 'function') {
@@ -8415,36 +8703,26 @@
8415
8703
  return [];
8416
8704
  }
8417
8705
 
8418
- return match[1] && match[1].split(',').map(function(arg) {
8419
- match = arg.match(FN_ARG);
8420
- return match ? match[1].trim() : arg.trim();
8706
+ var args = match[1] || match[2];
8707
+
8708
+ return args && args.split(',').map(function(arg) {
8709
+ var argMatch = arg.match(FN_ARG);
8710
+ return (argMatch && argMatch[1] || arg).trim();
8421
8711
  }) || [];
8422
8712
  }
8423
8713
 
8424
- function Module() {
8425
- var providers = [];
8426
-
8427
- this.factory = function(name, factory) {
8428
- providers.push([name, 'factory', factory]);
8429
- return this;
8430
- };
8431
-
8432
- this.value = function(name, value) {
8433
- providers.push([name, 'value', value]);
8434
- return this;
8435
- };
8436
-
8437
- this.type = function(name, type) {
8438
- providers.push([name, 'type', type]);
8439
- return this;
8440
- };
8441
-
8442
- this.forEach = function(iterator) {
8443
- providers.forEach(iterator);
8444
- };
8445
-
8446
- }
8714
+ /**
8715
+ * @typedef { import('./index').ModuleDeclaration } ModuleDeclaration
8716
+ * @typedef { import('./index').ModuleDefinition } ModuleDefinition
8717
+ * @typedef { import('./index').InjectorContext } InjectorContext
8718
+ */
8447
8719
 
8720
+ /**
8721
+ * Create a new injector with the given modules.
8722
+ *
8723
+ * @param {ModuleDefinition[]} modules
8724
+ * @param {InjectorContext} [parent]
8725
+ */
8448
8726
  function Injector(modules, parent) {
8449
8727
  parent = parent || {
8450
8728
  get: function(name, strict) {
@@ -8473,12 +8751,12 @@
8473
8751
  /**
8474
8752
  * Return a named service.
8475
8753
  *
8476
- * @param {String} name
8477
- * @param {Boolean} [strict=true] if false, resolve missing services to null
8754
+ * @param {string} name
8755
+ * @param {boolean} [strict=true] if false, resolve missing services to null
8478
8756
  *
8479
- * @return {Object}
8757
+ * @return {any}
8480
8758
  */
8481
- var get = function(name, strict) {
8759
+ function get(name, strict) {
8482
8760
  if (!providers[name] && name.indexOf('.') !== -1) {
8483
8761
  var parts = name.split('.');
8484
8762
  var pivot = get(parts.shift());
@@ -8508,16 +8786,16 @@
8508
8786
  }
8509
8787
 
8510
8788
  return parent.get(name, strict);
8511
- };
8789
+ }
8512
8790
 
8513
- var fnDef = function(fn, locals) {
8791
+ function fnDef(fn, locals) {
8514
8792
 
8515
8793
  if (typeof locals === 'undefined') {
8516
8794
  locals = {};
8517
8795
  }
8518
8796
 
8519
8797
  if (typeof fn !== 'function') {
8520
- if (isArray$1(fn)) {
8798
+ if (isArray$2(fn)) {
8521
8799
  fn = annotate(fn.slice());
8522
8800
  } else {
8523
8801
  throw new Error('Cannot invoke "' + fn + '". Expected a function!');
@@ -8537,9 +8815,9 @@
8537
8815
  fn: fn,
8538
8816
  dependencies: dependencies
8539
8817
  };
8540
- };
8818
+ }
8541
8819
 
8542
- var instantiate = function(Type) {
8820
+ function instantiate(Type) {
8543
8821
  var def = fnDef(Type);
8544
8822
 
8545
8823
  var fn = def.fn,
@@ -8549,25 +8827,35 @@
8549
8827
  var Constructor = Function.prototype.bind.apply(fn, [ null ].concat(dependencies));
8550
8828
 
8551
8829
  return new Constructor();
8552
- };
8830
+ }
8553
8831
 
8554
- var invoke = function(func, context, locals) {
8832
+ function invoke(func, context, locals) {
8555
8833
  var def = fnDef(func, locals);
8556
8834
 
8557
8835
  var fn = def.fn,
8558
8836
  dependencies = def.dependencies;
8559
8837
 
8560
8838
  return fn.apply(context, dependencies);
8561
- };
8562
-
8839
+ }
8563
8840
 
8564
- var createPrivateInjectorFactory = function(privateChildInjector) {
8841
+ /**
8842
+ * @param {Injector} childInjector
8843
+ *
8844
+ * @return {Function}
8845
+ */
8846
+ function createPrivateInjectorFactory(childInjector) {
8565
8847
  return annotate(function(key) {
8566
- return privateChildInjector.get(key);
8848
+ return childInjector.get(key);
8567
8849
  });
8568
- };
8850
+ }
8569
8851
 
8570
- var createChild = function(modules, forceNewInstances) {
8852
+ /**
8853
+ * @param {ModuleDefinition[]} modules
8854
+ * @param {string[]} [forceNewInstances]
8855
+ *
8856
+ * @return {Injector}
8857
+ */
8858
+ function createChild(modules, forceNewInstances) {
8571
8859
  if (forceNewInstances && forceNewInstances.length) {
8572
8860
  var fromParentModule = Object.create(null);
8573
8861
  var matchedScopes = Object.create(null);
@@ -8592,12 +8880,12 @@
8592
8880
  privateInjectorsCache.push(provider[3]);
8593
8881
  privateChildInjectors.push(privateChildInjector);
8594
8882
  privateChildFactories.push(privateChildInjectorFactory);
8595
- fromParentModule[name] = [privateChildInjectorFactory, name, 'private', privateChildInjector];
8883
+ fromParentModule[name] = [ privateChildInjectorFactory, name, 'private', privateChildInjector ];
8596
8884
  } else {
8597
- fromParentModule[name] = [privateChildFactories[cacheIdx], name, 'private', privateChildInjectors[cacheIdx]];
8885
+ fromParentModule[name] = [ privateChildFactories[cacheIdx], name, 'private', privateChildInjectors[cacheIdx] ];
8598
8886
  }
8599
8887
  } else {
8600
- fromParentModule[name] = [provider[2], provider[1]];
8888
+ fromParentModule[name] = [ provider[2], provider[1] ];
8601
8889
  }
8602
8890
  matchedScopes[name] = true;
8603
8891
  }
@@ -8606,7 +8894,7 @@
8606
8894
  /* jshint -W083 */
8607
8895
  forceNewInstances.forEach(function(scope) {
8608
8896
  if (provider[1].$scope.indexOf(scope) !== -1) {
8609
- fromParentModule[name] = [provider[2], provider[1]];
8897
+ fromParentModule[name] = [ provider[2], provider[1] ];
8610
8898
  matchedScopes[scope] = true;
8611
8899
  }
8612
8900
  });
@@ -8623,7 +8911,7 @@
8623
8911
  }
8624
8912
 
8625
8913
  return new Injector(modules, self);
8626
- };
8914
+ }
8627
8915
 
8628
8916
  var factoryMap = {
8629
8917
  factory: invoke,
@@ -8633,62 +8921,169 @@
8633
8921
  }
8634
8922
  };
8635
8923
 
8636
- modules.forEach(function(module) {
8924
+ /**
8925
+ * @param {ModuleDefinition} moduleDefinition
8926
+ * @param {Injector} injector
8927
+ */
8928
+ function createInitializer(moduleDefinition, injector) {
8637
8929
 
8638
- function arrayUnwrap(type, value) {
8639
- if (type !== 'value' && isArray$1(value)) {
8640
- value = annotate(value.slice());
8641
- }
8930
+ var initializers = moduleDefinition.__init__ || [];
8642
8931
 
8643
- return value;
8644
- }
8932
+ return function() {
8933
+ initializers.forEach(function(initializer) {
8645
8934
 
8646
- // TODO(vojta): handle wrong inputs (modules)
8647
- if (module instanceof Module) {
8648
- module.forEach(function(provider) {
8649
- var name = provider[0];
8650
- var type = provider[1];
8651
- var value = provider[2];
8935
+ try {
8652
8936
 
8653
- providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];
8654
- });
8655
- } else if (typeof module === 'object') {
8656
- if (module.__exports__) {
8657
- var clonedModule = Object.keys(module).reduce(function(m, key) {
8658
- if (key.substring(0, 2) !== '__') {
8659
- m[key] = module[key];
8937
+ // eagerly resolve component (fn or string)
8938
+ if (typeof initializer === 'string') {
8939
+ injector.get(initializer);
8940
+ } else {
8941
+ injector.invoke(initializer);
8660
8942
  }
8661
- return m;
8662
- }, Object.create(null));
8663
-
8664
- var privateInjector = new Injector((module.__modules__ || []).concat([clonedModule]), self);
8665
- var getFromPrivateInjector = annotate(function(key) {
8666
- return privateInjector.get(key);
8667
- });
8668
- module.__exports__.forEach(function(key) {
8669
- providers[key] = [getFromPrivateInjector, key, 'private', privateInjector];
8670
- });
8671
- } else {
8672
- Object.keys(module).forEach(function(name) {
8673
- if (module[name][2] === 'private') {
8674
- providers[name] = module[name];
8675
- return;
8943
+ } catch (error) {
8944
+ if (typeof AggregateError !== 'undefined') {
8945
+ throw new AggregateError([ error ], 'Failed to initialize!');
8676
8946
  }
8677
8947
 
8678
- var type = module[name][0];
8679
- var value = module[name][1];
8948
+ throw new Error('Failed to initialize! ' + error.message);
8949
+ }
8950
+ });
8951
+ };
8952
+ }
8680
8953
 
8681
- providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];
8682
- });
8954
+ /**
8955
+ * @param {ModuleDefinition} moduleDefinition
8956
+ */
8957
+ function loadModule(moduleDefinition) {
8958
+
8959
+ var moduleExports = moduleDefinition.__exports__;
8960
+
8961
+ // private module
8962
+ if (moduleExports) {
8963
+ var nestedModules = moduleDefinition.__modules__;
8964
+
8965
+ var clonedModule = Object.keys(moduleDefinition).reduce(function(clonedModule, key) {
8966
+
8967
+ if (key !== '__exports__' && key !== '__modules__' && key !== '__init__' && key !== '__depends__') {
8968
+ clonedModule[key] = moduleDefinition[key];
8969
+ }
8970
+
8971
+ return clonedModule;
8972
+ }, Object.create(null));
8973
+
8974
+ var childModules = (nestedModules || []).concat(clonedModule);
8975
+
8976
+ var privateInjector = createChild(childModules);
8977
+ var getFromPrivateInjector = annotate(function(key) {
8978
+ return privateInjector.get(key);
8979
+ });
8980
+
8981
+ moduleExports.forEach(function(key) {
8982
+ providers[key] = [ getFromPrivateInjector, key, 'private', privateInjector ];
8983
+ });
8984
+
8985
+ // ensure child injector initializes
8986
+ var initializers = (moduleDefinition.__init__ || []).slice();
8987
+
8988
+ initializers.unshift(function() {
8989
+ privateInjector.init();
8990
+ });
8991
+
8992
+ moduleDefinition = Object.assign({}, moduleDefinition, {
8993
+ __init__: initializers
8994
+ });
8995
+
8996
+ return createInitializer(moduleDefinition, privateInjector);
8997
+ }
8998
+
8999
+ // normal module
9000
+ Object.keys(moduleDefinition).forEach(function(key) {
9001
+
9002
+ if (key === '__init__' || key === '__depends__') {
9003
+ return;
9004
+ }
9005
+
9006
+ if (moduleDefinition[key][2] === 'private') {
9007
+ providers[key] = moduleDefinition[key];
9008
+ return;
8683
9009
  }
9010
+
9011
+ var type = moduleDefinition[key][0];
9012
+ var value = moduleDefinition[key][1];
9013
+
9014
+ providers[key] = [ factoryMap[type], arrayUnwrap(type, value), type ];
9015
+ });
9016
+
9017
+ return createInitializer(moduleDefinition, self);
9018
+ }
9019
+
9020
+ /**
9021
+ * @param {ModuleDefinition[]} moduleDefinitions
9022
+ * @param {ModuleDefinition} moduleDefinition
9023
+ *
9024
+ * @return {ModuleDefinition[]}
9025
+ */
9026
+ function resolveDependencies(moduleDefinitions, moduleDefinition) {
9027
+
9028
+ if (moduleDefinitions.indexOf(moduleDefinition) !== -1) {
9029
+ return moduleDefinitions;
8684
9030
  }
8685
- });
9031
+
9032
+ moduleDefinitions = (moduleDefinition.__depends__ || []).reduce(resolveDependencies, moduleDefinitions);
9033
+
9034
+ if (moduleDefinitions.indexOf(moduleDefinition) !== -1) {
9035
+ return moduleDefinitions;
9036
+ }
9037
+
9038
+ return moduleDefinitions.concat(moduleDefinition);
9039
+ }
9040
+
9041
+ /**
9042
+ * @param {ModuleDefinition[]} moduleDefinitions
9043
+ *
9044
+ * @return { () => void } initializerFn
9045
+ */
9046
+ function bootstrap(moduleDefinitions) {
9047
+
9048
+ var initializers = moduleDefinitions
9049
+ .reduce(resolveDependencies, [])
9050
+ .map(loadModule);
9051
+
9052
+ var initialized = false;
9053
+
9054
+ return function() {
9055
+
9056
+ if (initialized) {
9057
+ return;
9058
+ }
9059
+
9060
+ initialized = true;
9061
+
9062
+ initializers.forEach(function(initializer) {
9063
+ return initializer();
9064
+ });
9065
+ };
9066
+ }
8686
9067
 
8687
9068
  // public API
8688
9069
  this.get = get;
8689
9070
  this.invoke = invoke;
8690
9071
  this.instantiate = instantiate;
8691
9072
  this.createChild = createChild;
9073
+
9074
+ // setup
9075
+ this.init = bootstrap(modules);
9076
+ }
9077
+
9078
+
9079
+ // helpers ///////////////
9080
+
9081
+ function arrayUnwrap(type, value) {
9082
+ if (type !== 'value' && isArray$2(value)) {
9083
+ value = annotate(value.slice());
9084
+ }
9085
+
9086
+ return value;
8692
9087
  }
8693
9088
 
8694
9089
  // apply default renderer with lowest possible priority
@@ -8711,7 +9106,7 @@
8711
9106
  this.FRAME_STYLE = styles.style([ 'no-fill' ], { stroke: 'fuchsia', strokeDasharray: 4, strokeWidth: 2 });
8712
9107
  }
8713
9108
 
8714
- inherits_browser(DefaultRenderer, BaseRenderer);
9109
+ e(DefaultRenderer, BaseRenderer);
8715
9110
 
8716
9111
 
8717
9112
  DefaultRenderer.prototype.canRender = function() {
@@ -8967,7 +9362,7 @@
8967
9362
  var parent = document.createElement('div');
8968
9363
  parent.setAttribute('class', 'djs-container');
8969
9364
 
8970
- assign(parent.style, {
9365
+ assign$1(parent, {
8971
9366
  position: 'relative',
8972
9367
  overflow: 'hidden',
8973
9368
  width: ensurePx(options.width),
@@ -11046,7 +11441,7 @@
11046
11441
  attacherRefs.bind(this, 'attachers');
11047
11442
  }
11048
11443
 
11049
- inherits_browser(Shape, Base);
11444
+ e(Shape, Base);
11050
11445
 
11051
11446
 
11052
11447
  /**
@@ -11061,7 +11456,7 @@
11061
11456
  Shape.call(this);
11062
11457
  }
11063
11458
 
11064
- inherits_browser(Root, Shape);
11459
+ e(Root, Shape);
11065
11460
 
11066
11461
 
11067
11462
  /**
@@ -11084,7 +11479,7 @@
11084
11479
  labelRefs.bind(this, 'labelTarget');
11085
11480
  }
11086
11481
 
11087
- inherits_browser(Label, Shape);
11482
+ e(Label, Shape);
11088
11483
 
11089
11484
 
11090
11485
  /**
@@ -11115,7 +11510,7 @@
11115
11510
  incomingRefs.bind(this, 'target');
11116
11511
  }
11117
11512
 
11118
- inherits_browser(Connection, Base);
11513
+ e(Connection, Base);
11119
11514
 
11120
11515
 
11121
11516
  var types = {
@@ -11966,62 +12361,21 @@
11966
12361
  graphicsFactory: [ 'type', GraphicsFactory ]
11967
12362
  };
11968
12363
 
12364
+ /**
12365
+ * @typedef { import('didi').ModuleDeclaration } Module
12366
+ */
12367
+
11969
12368
  /**
11970
12369
  * Bootstrap an injector from a list of modules, instantiating a number of default components
11971
12370
  *
11972
- * @ignore
11973
- * @param {Array<didi.Module>} bootstrapModules
12371
+ * @param {Array<Module>} modules
11974
12372
  *
11975
- * @return {didi.Injector} a injector to use to access the components
12373
+ * @return {Injector} a injector to use to access the components
11976
12374
  */
11977
- function bootstrap(bootstrapModules) {
11978
-
11979
- var modules = [],
11980
- components = [];
11981
-
11982
- function hasModule(m) {
11983
- return modules.indexOf(m) >= 0;
11984
- }
11985
-
11986
- function addModule(m) {
11987
- modules.push(m);
11988
- }
11989
-
11990
- function visit(m) {
11991
- if (hasModule(m)) {
11992
- return;
11993
- }
11994
-
11995
- (m.__depends__ || []).forEach(visit);
11996
-
11997
- if (hasModule(m)) {
11998
- return;
11999
- }
12000
-
12001
- addModule(m);
12002
-
12003
- (m.__init__ || []).forEach(function(c) {
12004
- components.push(c);
12005
- });
12006
- }
12007
-
12008
- bootstrapModules.forEach(visit);
12009
-
12375
+ function bootstrap(modules) {
12010
12376
  var injector = new Injector(modules);
12011
12377
 
12012
- components.forEach(function(c) {
12013
-
12014
- try {
12015
-
12016
- // eagerly resolve component (fn or string)
12017
- injector[typeof c === 'string' ? 'get' : 'invoke'](c);
12018
- } catch (e) {
12019
- console.error('Failed to instantiate component');
12020
- console.error(e.stack);
12021
-
12022
- throw e;
12023
- }
12024
- });
12378
+ injector.init();
12025
12379
 
12026
12380
  return injector;
12027
12381
  }
@@ -12029,9 +12383,8 @@
12029
12383
  /**
12030
12384
  * Creates an injector from passed options.
12031
12385
  *
12032
- * @ignore
12033
- * @param {Object} options
12034
- * @return {didi.Injector}
12386
+ * @param {Object} options
12387
+ * @return {Injector}
12035
12388
  */
12036
12389
  function createInjector(options) {
12037
12390
 
@@ -12051,7 +12404,7 @@
12051
12404
  * The main diagram-js entry point that bootstraps the diagram with the given
12052
12405
  * configuration.
12053
12406
  *
12054
- * To register extensions with the diagram, pass them as Array<didi.Module> to the constructor.
12407
+ * To register extensions with the diagram, pass them as Array<Module> to the constructor.
12055
12408
  *
12056
12409
  * @class djs.Diagram
12057
12410
  * @memberOf djs
@@ -12093,8 +12446,8 @@
12093
12446
  * // 'shape ... was added to the diagram' logged to console
12094
12447
  *
12095
12448
  * @param {Object} options
12096
- * @param {Array<didi.Module>} [options.modules] external modules to instantiate with the diagram
12097
- * @param {didi.Injector} [injector] an (optional) injector to bootstrap the diagram with
12449
+ * @param {Array<Module>} [options.modules] external modules to instantiate with the diagram
12450
+ * @param {Injector} [injector] an (optional) injector to bootstrap the diagram with
12098
12451
  */
12099
12452
  function Diagram(options, injector) {
12100
12453
 
@@ -12759,7 +13112,7 @@
12759
13112
 
12760
13113
  var propertyName = property && property.name;
12761
13114
 
12762
- if (isUndefined$1(value)) {
13115
+ if (isUndefined$2(value)) {
12763
13116
  // unset the property, if the specified value is undefined;
12764
13117
  // delete from $attrs (for extensions) or the target itself
12765
13118
  if (property) {
@@ -12850,7 +13203,7 @@
12850
13203
  };
12851
13204
 
12852
13205
 
12853
- function isUndefined$1(val) {
13206
+ function isUndefined$2(val) {
12854
13207
  return typeof val === 'undefined';
12855
13208
  }
12856
13209
 
@@ -20405,53 +20758,53 @@
20405
20758
 
20406
20759
 
20407
20760
  // inlined ../../resources/logo.svg
20408
- 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>';
20761
+ 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>';
20409
20762
 
20410
20763
  var BPMNIO_IMG = BPMNIO_LOGO_SVG;
20411
20764
 
20412
- function css(attrs) {
20413
- return attrs.join(';');
20414
- }
20415
-
20416
- var LINK_STYLES = css([
20417
- 'color: #404040'
20418
- ]);
20419
-
20420
- var LIGHTBOX_STYLES = css([
20421
- 'z-index: 1001',
20422
- 'position: fixed',
20423
- 'top: 0',
20424
- 'left: 0',
20425
- 'right: 0',
20426
- 'bottom: 0'
20427
- ]);
20428
-
20429
- var BACKDROP_STYLES = css([
20430
- 'width: 100%',
20431
- 'height: 100%',
20432
- 'background: rgba(40,40,40,0.2)'
20433
- ]);
20434
-
20435
- var NOTICE_STYLES = css([
20436
- 'position: absolute',
20437
- 'left: 50%',
20438
- 'top: 40%',
20439
- 'transform: translate(-50%)',
20440
- 'width: 260px',
20441
- 'padding: 10px',
20442
- 'background: white',
20443
- 'box-shadow: 0 1px 4px rgba(0,0,0,0.3)',
20444
- 'font-family: Helvetica, Arial, sans-serif',
20445
- 'font-size: 14px',
20446
- 'display: flex',
20447
- 'line-height: 1.3'
20448
- ]);
20765
+ var LOGO_STYLES = {
20766
+ verticalAlign: 'middle'
20767
+ };
20768
+
20769
+ var LINK_STYLES = {
20770
+ 'color': '#404040'
20771
+ };
20772
+
20773
+ var LIGHTBOX_STYLES = {
20774
+ 'zIndex': '1001',
20775
+ 'position': 'fixed',
20776
+ 'top': '0',
20777
+ 'left': '0',
20778
+ 'right': '0',
20779
+ 'bottom': '0'
20780
+ };
20781
+
20782
+ var BACKDROP_STYLES = {
20783
+ 'width': '100%',
20784
+ 'height': '100%',
20785
+ 'background': 'rgba(40,40,40,0.2)'
20786
+ };
20787
+
20788
+ var NOTICE_STYLES = {
20789
+ 'position': 'absolute',
20790
+ 'left': '50%',
20791
+ 'top': '40%',
20792
+ 'transform': 'translate(-50%)',
20793
+ 'width': '260px',
20794
+ 'padding': '10px',
20795
+ 'background': 'white',
20796
+ 'boxShadow': '0 1px 4px rgba(0,0,0,0.3)',
20797
+ 'fontFamily': 'Helvetica, Arial, sans-serif',
20798
+ 'fontSize': '14px',
20799
+ 'display': 'flex',
20800
+ 'lineHeight': '1.3'
20801
+ };
20449
20802
 
20450
20803
  var LIGHTBOX_MARKUP =
20451
- '<div class="bjs-powered-by-lightbox" style="' + LIGHTBOX_STYLES + '">' +
20452
- '<div class="backdrop" style="' + BACKDROP_STYLES + '"></div>' +
20453
- '<div class="notice" style="' + NOTICE_STYLES + '">' +
20454
- '<a href="https://bpmn.io" target="_blank" rel="noopener" style="margin: 15px 20px 15px 10px; align-self: center;' + LINK_STYLES + '">' +
20804
+ '<div class="bjs-powered-by-lightbox">' +
20805
+ '<div class="backdrop"></div>' +
20806
+ '<div class="notice">' +
20807
+ '<a href="https://bpmn.io" target="_blank" rel="noopener" class="link">' +
20455
20808
  BPMNIO_IMG +
20456
20809
  '</a>' +
20457
20810
  '<span>' +
@@ -20464,10 +20817,23 @@
20464
20817
 
20465
20818
  var lightbox;
20466
20819
 
20820
+ function createLightbox() {
20821
+ lightbox = domify(LIGHTBOX_MARKUP);
20822
+
20823
+ assign$1(lightbox, LIGHTBOX_STYLES);
20824
+ assign$1(query('svg', lightbox), LOGO_STYLES);
20825
+ assign$1(query('.backdrop', lightbox), BACKDROP_STYLES);
20826
+ assign$1(query('.notice', lightbox), NOTICE_STYLES);
20827
+ assign$1(query('.link', lightbox), LINK_STYLES, {
20828
+ 'margin': '15px 20px 15px 10px',
20829
+ 'alignSelf': 'center'
20830
+ });
20831
+ }
20832
+
20467
20833
  function open() {
20468
20834
 
20469
20835
  if (!lightbox) {
20470
- lightbox = domify(LIGHTBOX_MARKUP);
20836
+ createLightbox();
20471
20837
 
20472
20838
  delegate.bind(lightbox, '.backdrop', 'click', function(event) {
20473
20839
  document.body.removeChild(lightbox);
@@ -20515,7 +20881,7 @@
20515
20881
  this._init(this._container, this._moddle, options);
20516
20882
  }
20517
20883
 
20518
- inherits_browser(BaseViewer, Diagram);
20884
+ e(BaseViewer, Diagram);
20519
20885
 
20520
20886
  /**
20521
20887
  * The importXML result.
@@ -21103,7 +21469,7 @@
21103
21469
 
21104
21470
  var container = domify('<div class="bjs-container"></div>');
21105
21471
 
21106
- assign(container.style, {
21472
+ assign$1(container, {
21107
21473
  width: ensureUnit(options.width),
21108
21474
  height: ensureUnit(options.height),
21109
21475
  position: options.position
@@ -21193,12 +21559,20 @@
21193
21559
  'target="_blank" ' +
21194
21560
  'class="bjs-powered-by" ' +
21195
21561
  'title="Powered by bpmn.io" ' +
21196
- 'style="position: absolute; bottom: 15px; right: 15px; z-index: 100; ' + LINK_STYLES + '">' +
21562
+ '>' +
21197
21563
  img +
21198
21564
  '</a>';
21199
21565
 
21200
21566
  var linkElement = domify(linkMarkup);
21201
21567
 
21568
+ assign$1(query('svg', linkElement), LOGO_STYLES);
21569
+ assign$1(linkElement, LINK_STYLES, {
21570
+ position: 'absolute',
21571
+ bottom: '15px',
21572
+ right: '15px',
21573
+ zIndex: '100'
21574
+ });
21575
+
21202
21576
  container.appendChild(linkElement);
21203
21577
 
21204
21578
  componentEvent.bind(linkElement, 'click', function(event) {
@@ -21261,7 +21635,7 @@
21261
21635
  BaseViewer.call(this, options);
21262
21636
  }
21263
21637
 
21264
- inherits_browser(Viewer, BaseViewer);
21638
+ e(Viewer, BaseViewer);
21265
21639
 
21266
21640
  // modules the viewer is composed of
21267
21641
  Viewer.prototype._modules = [
@@ -22235,7 +22609,7 @@
22235
22609
  Viewer.call(this, options);
22236
22610
  }
22237
22611
 
22238
- inherits_browser(NavigatedViewer, Viewer);
22612
+ e(NavigatedViewer, Viewer);
22239
22613
 
22240
22614
 
22241
22615
  NavigatedViewer.prototype._navigationModules = [
@@ -22578,8 +22952,8 @@
22578
22952
  elementTemplatesIconsRenderer: [ 'type', IconsRenderer ]
22579
22953
  };
22580
22954
 
22581
- var drilldownModule = {
22582
- drilldownOverlayBehavior: [ 'value', null ],
22955
+ var drilldownModule = {
22956
+ drilldownOverlayBehavior: [ 'value', null ],
22583
22957
  };
22584
22958
 
22585
22959
  var name$6 = "zeebe";
@@ -22946,41 +23320,41 @@
22946
23320
  types: types$6
22947
23321
  };
22948
23322
 
22949
- const commonModules = [
22950
- drilldownModule,
22951
- iconRendererModule
22952
- ];
22953
-
22954
- const commonModdleExtensions = {
22955
- zeebe: zeebeModdle
23323
+ const commonModules = [
23324
+ drilldownModule,
23325
+ iconRendererModule
23326
+ ];
23327
+
23328
+ const commonModdleExtensions = {
23329
+ zeebe: zeebeModdle
22956
23330
  };
22957
23331
 
22958
- /**
22959
- *
22960
- * @param {Object} options
22961
- */
22962
- function NavigatedViewer$1(options = {}) {
22963
-
22964
- options = {
22965
- ...options,
22966
- moddleExtensions: {
22967
- ...commonModdleExtensions,
22968
- ...options.moddleExtensions
22969
- }
22970
- };
22971
-
22972
- NavigatedViewer.call(this, options);
22973
- }
22974
-
22975
- inherits_browser(NavigatedViewer$1, NavigatedViewer);
22976
-
22977
- NavigatedViewer$1.prototype._camundaCloudModules = [
22978
- ...commonModules
22979
- ];
22980
-
22981
- NavigatedViewer$1.prototype._modules = [].concat(
22982
- NavigatedViewer.prototype._modules,
22983
- NavigatedViewer$1.prototype._camundaCloudModules
23332
+ /**
23333
+ *
23334
+ * @param {Object} options
23335
+ */
23336
+ function NavigatedViewer$1(options = {}) {
23337
+
23338
+ options = {
23339
+ ...options,
23340
+ moddleExtensions: {
23341
+ ...commonModdleExtensions,
23342
+ ...options.moddleExtensions
23343
+ }
23344
+ };
23345
+
23346
+ NavigatedViewer.call(this, options);
23347
+ }
23348
+
23349
+ inherits_browser(NavigatedViewer$1, NavigatedViewer);
23350
+
23351
+ NavigatedViewer$1.prototype._camundaCloudModules = [
23352
+ ...commonModules
23353
+ ];
23354
+
23355
+ NavigatedViewer$1.prototype._modules = [].concat(
23356
+ NavigatedViewer.prototype._modules,
23357
+ NavigatedViewer$1.prototype._camundaCloudModules
22984
23358
  );
22985
23359
 
22986
23360
  return NavigatedViewer$1;