bpmn-js 10.3.0 → 11.0.1

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * bpmn-js - bpmn-modeler v10.3.0
2
+ * bpmn-js - bpmn-modeler v11.0.1
3
3
  *
4
4
  * Copyright (c) 2014-present, camunda Services GmbH
5
5
  *
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * Source Code: https://github.com/bpmn-io/bpmn-js
10
10
  *
11
- * Date: 2022-11-11
11
+ * Date: 2022-11-25
12
12
  */
13
13
  (function (global, factory) {
14
14
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -16,7 +16,7 @@
16
16
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.BpmnJS = factory());
17
17
  })(this, (function () { 'use strict';
18
18
 
19
- function e(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}));}
19
+ function e$3(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}));}
20
20
 
21
21
  function createCommonjsModule(fn, module) {
22
22
  return module = { exports: {} }, fn(module, module.exports), module.exports;
@@ -2961,7 +2961,7 @@
2961
2961
  this.FRAME_STYLE = styles.style([ 'no-fill' ], { stroke: 'fuchsia', strokeDasharray: 4, strokeWidth: 2 });
2962
2962
  }
2963
2963
 
2964
- e(DefaultRenderer, BaseRenderer);
2964
+ e$3(DefaultRenderer, BaseRenderer);
2965
2965
 
2966
2966
 
2967
2967
  DefaultRenderer.prototype.canRender = function() {
@@ -4592,7 +4592,7 @@
4592
4592
  // this way we can always get the correct container size
4593
4593
  // (this is impossible for <svg> elements at the moment)
4594
4594
  const parent = document.createElement('div');
4595
- parent.setAttribute('class', 'djs-container');
4595
+ parent.setAttribute('class', 'djs-container djs-parent');
4596
4596
 
4597
4597
  assign(parent, {
4598
4598
  position: 'relative',
@@ -6013,7 +6013,7 @@
6013
6013
  /**
6014
6014
  * Removes an element from the registry.
6015
6015
  *
6016
- * @param {djs.model.Base} element
6016
+ * @param {string|djs.model.Base} element
6017
6017
  */
6018
6018
  ElementRegistry.prototype.remove = function(element) {
6019
6019
  var elements = this._elements,
@@ -6036,7 +6036,7 @@
6036
6036
  /**
6037
6037
  * Update the id of an element
6038
6038
  *
6039
- * @param {djs.model.Base} element
6039
+ * @param {string|djs.model.Base} element
6040
6040
  * @param {string} newId
6041
6041
  */
6042
6042
  ElementRegistry.prototype.updateId = function(element, newId) {
@@ -6065,7 +6065,7 @@
6065
6065
  /**
6066
6066
  * Update the graphics of an element
6067
6067
  *
6068
- * @param {djs.model.Base} element
6068
+ * @param {string|djs.model.Base} element
6069
6069
  * @param {SVGElement} gfx
6070
6070
  * @param {boolean} [secondary=false] whether to update the secondary connected element
6071
6071
  */
@@ -6675,7 +6675,7 @@
6675
6675
  attacherRefs.bind(this, 'attachers');
6676
6676
  }
6677
6677
 
6678
- e(Shape, Base$1);
6678
+ e$3(Shape, Base$1);
6679
6679
 
6680
6680
 
6681
6681
  /**
@@ -6690,7 +6690,7 @@
6690
6690
  Shape.call(this);
6691
6691
  }
6692
6692
 
6693
- e(Root, Shape);
6693
+ e$3(Root, Shape);
6694
6694
 
6695
6695
 
6696
6696
  /**
@@ -6713,7 +6713,7 @@
6713
6713
  labelRefs.bind(this, 'labelTarget');
6714
6714
  }
6715
6715
 
6716
- e(Label, Shape);
6716
+ e$3(Label, Shape);
6717
6717
 
6718
6718
 
6719
6719
  /**
@@ -6744,7 +6744,7 @@
6744
6744
  incomingRefs.bind(this, 'target');
6745
6745
  }
6746
6746
 
6747
- e(Connection, Base$1);
6747
+ e$3(Connection, Base$1);
6748
6748
 
6749
6749
 
6750
6750
  var types$6 = {
@@ -16245,7 +16245,7 @@
16245
16245
  this._init(this._container, this._moddle, options);
16246
16246
  }
16247
16247
 
16248
- e(BaseViewer, Diagram);
16248
+ e$3(BaseViewer, Diagram);
16249
16249
 
16250
16250
  /**
16251
16251
  * The importXML result.
@@ -16944,7 +16944,7 @@
16944
16944
  }, this);
16945
16945
  }
16946
16946
 
16947
- e(BaseModeler, BaseViewer);
16947
+ e$3(BaseModeler, BaseViewer);
16948
16948
 
16949
16949
 
16950
16950
  /**
@@ -19069,7 +19069,7 @@
19069
19069
  }
19070
19070
 
19071
19071
 
19072
- e(BpmnRenderer, BaseRenderer);
19072
+ e$3(BpmnRenderer, BaseRenderer);
19073
19073
 
19074
19074
  BpmnRenderer.$inject = [
19075
19075
  'config.bpmnRenderer',
@@ -22025,7 +22025,7 @@
22025
22025
  ].join(',') +
22026
22026
  ')';
22027
22027
 
22028
- setTransform$1(this._overlayRoot, matrix);
22028
+ setTransform(this._overlayRoot, matrix);
22029
22029
  };
22030
22030
 
22031
22031
 
@@ -22147,7 +22147,7 @@
22147
22147
  transform = 'scale(' + scale + ',' + scale + ')';
22148
22148
  }
22149
22149
 
22150
- setTransform$1(htmlContainer, transform);
22150
+ setTransform(htmlContainer, transform);
22151
22151
  };
22152
22152
 
22153
22153
 
@@ -22278,7 +22278,7 @@
22278
22278
  el.style.display = visible === false ? 'none' : '';
22279
22279
  }
22280
22280
 
22281
- function setTransform$1(el, transform) {
22281
+ function setTransform(el, transform) {
22282
22282
 
22283
22283
  el.style['transform-origin'] = 'top left';
22284
22284
 
@@ -22527,7 +22527,7 @@
22527
22527
  });
22528
22528
  }
22529
22529
 
22530
- e(RootElementsBehavior, CommandInterceptor);
22530
+ e$3(RootElementsBehavior, CommandInterceptor);
22531
22531
 
22532
22532
  RootElementsBehavior.$inject = [ 'canvas', 'injector' ];
22533
22533
 
@@ -22849,7 +22849,7 @@
22849
22849
  function DrilldownCentering(eventBus, canvas) {
22850
22850
 
22851
22851
  var currentRoot = null;
22852
- var positionMap = new Map();
22852
+ var positionMap = new Map$1();
22853
22853
 
22854
22854
  eventBus.on('root.set', function(event) {
22855
22855
  var newRoot = event.element;
@@ -22899,7 +22899,7 @@
22899
22899
  /**
22900
22900
  * ES5 Map implementation. Works.
22901
22901
  */
22902
- function Map() {
22902
+ function Map$1() {
22903
22903
 
22904
22904
  this._entries = [];
22905
22905
 
@@ -23255,7 +23255,7 @@
23255
23255
 
23256
23256
  }
23257
23257
 
23258
- e(DrilldownOverlayBehavior, CommandInterceptor);
23258
+ e$3(DrilldownOverlayBehavior, CommandInterceptor);
23259
23259
 
23260
23260
  DrilldownOverlayBehavior.prototype.updateDrilldownOverlay = function(shape) {
23261
23261
  var canvas = this._canvas;
@@ -23405,7 +23405,7 @@
23405
23405
  BaseViewer.call(this, options);
23406
23406
  }
23407
23407
 
23408
- e(Viewer, BaseViewer);
23408
+ e$3(Viewer, BaseViewer);
23409
23409
 
23410
23410
  // modules the viewer is composed of
23411
23411
  Viewer.prototype._modules = [
@@ -23419,15 +23419,10 @@
23419
23419
  // default moddle extensions the viewer is composed of
23420
23420
  Viewer.prototype._moddleExtensions = {};
23421
23421
 
23422
- var KEYCODE_C = 67;
23423
- var KEYCODE_V = 86;
23424
- var KEYCODE_Y = 89;
23425
- var KEYCODE_Z = 90;
23426
-
23427
- var KEYS_COPY = [ 'c', 'C', KEYCODE_C ];
23428
- var KEYS_PASTE = [ 'v', 'V', KEYCODE_V ];
23429
- var KEYS_REDO = [ 'y', 'Y', KEYCODE_Y ];
23430
- var KEYS_UNDO = [ 'z', 'Z', KEYCODE_Z ];
23422
+ var KEYS_COPY = [ 'c', 'C', 'KeyC' ];
23423
+ var KEYS_PASTE = [ 'v', 'V', 'KeyV' ];
23424
+ var KEYS_REDO = [ 'y', 'Y', 'KeyY' ];
23425
+ var KEYS_UNDO = [ 'z', 'Z', 'KeyZ' ];
23431
23426
 
23432
23427
  /**
23433
23428
  * Returns true if event was triggered with any modifier
@@ -23460,7 +23455,7 @@
23460
23455
  function isKey(keys, event) {
23461
23456
  keys = isArray$3(keys) ? keys : [ keys ];
23462
23457
 
23463
- return keys.indexOf(event.key) !== -1 || keys.indexOf(event.keyCode) !== -1;
23458
+ return keys.indexOf(event.key) !== -1 || keys.indexOf(event.code) !== -1;
23464
23459
  }
23465
23460
 
23466
23461
  /**
@@ -23499,7 +23494,7 @@
23499
23494
 
23500
23495
  /**
23501
23496
  * A keyboard abstraction that may be activated and
23502
- * deactivated by users at will, consuming key events
23497
+ * deactivated by users at will, consuming global key events
23503
23498
  * and triggering diagram actions.
23504
23499
  *
23505
23500
  * For keys pressed down, keyboard fires `keyboard.keydown` event.
@@ -23584,6 +23579,10 @@
23584
23579
  };
23585
23580
 
23586
23581
  Keyboard.prototype._isEventIgnored = function(event) {
23582
+ if (event.defaultPrevented) {
23583
+ return true;
23584
+ }
23585
+
23587
23586
  return isInput(event.target) && this._isModifiedKeyIgnored(event);
23588
23587
  };
23589
23588
 
@@ -23614,8 +23613,8 @@
23614
23613
  this._node = node;
23615
23614
 
23616
23615
  // bind key events
23617
- event.bind(node, 'keydown', this._keydownHandler, true);
23618
- event.bind(node, 'keyup', this._keyupHandler, true);
23616
+ event.bind(node, 'keydown', this._keydownHandler);
23617
+ event.bind(node, 'keyup', this._keyupHandler);
23619
23618
 
23620
23619
  this._fire('bind');
23621
23620
  };
@@ -23631,8 +23630,8 @@
23631
23630
  this._fire('unbind');
23632
23631
 
23633
23632
  // unbind key events
23634
- event.unbind(node, 'keydown', this._keydownHandler, true);
23635
- event.unbind(node, 'keyup', this._keyupHandler, true);
23633
+ event.unbind(node, 'keydown', this._keydownHandler);
23634
+ event.unbind(node, 'keyup', this._keyupHandler);
23636
23635
  }
23637
23636
 
23638
23637
  this._node = null;
@@ -24407,7 +24406,7 @@
24407
24406
  Viewer.call(this, options);
24408
24407
  }
24409
24408
 
24410
- e(NavigatedViewer, Viewer);
24409
+ e$3(NavigatedViewer, Viewer);
24411
24410
 
24412
24411
 
24413
24412
  NavigatedViewer.prototype._navigationModules = [
@@ -28096,6 +28095,480 @@
28096
28095
  contextPad: [ 'type', ContextPad ]
28097
28096
  };
28098
28097
 
28098
+ var n$1,l$1,u$1,t$2,o$1,f$1={},e$2=[],c$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function s$1(n,l){for(var u in l)n[u]=l[u];return n}function a$1(n){var l=n.parentNode;l&&l.removeChild(n);}function h$1(l,u,i){var t,o,r,f={};for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n$1.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return v$1(l,f,t,o,null)}function v$1(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u$1:r};return null==r&&null!=l$1.vnode&&l$1.vnode(f),f}function p$1(n){return n.children}function d$1(n,l){this.props=n,this.context=l;}function _$1(n,l){if(null==l)return n.__?_$1(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?_$1(n):null}function k$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return k$1(n)}}function b$1(n){(!n.__d&&(n.__d=!0)&&t$2.push(n)&&!g$1.__r++||o$1!==l$1.debounceRendering)&&((o$1=l$1.debounceRendering)||setTimeout)(g$1);}function g$1(){for(var n;g$1.__r=t$2.length;)n=t$2.sort(function(n,l){return n.__v.__b-l.__v.__b}),t$2=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=s$1({},t)).__v=t.__v+1,j$1(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?_$1(t):o,t.__h),z$1(u,t),t.__e!=o&&k$1(t)));});}function w$1(n,l,u,i,t,o,r,c,s,a){var h,y,d,k,b,g,w,x=i&&i.__k||e$2,C=x.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(k=u.__k[h]=null==(k=l[h])||"boolean"==typeof k?null:"string"==typeof k||"number"==typeof k||"bigint"==typeof k?v$1(null,k,null,null,k):Array.isArray(k)?v$1(p$1,{children:k},null,null,null):k.__b>0?v$1(k.type,k.props,k.key,k.ref?k.ref:null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(d=x[h])||d&&k.key==d.key&&k.type===d.type)x[h]=void 0;else for(y=0;y<C;y++){if((d=x[y])&&k.key==d.key&&k.type===d.type){x[y]=void 0;break}d=null;}j$1(n,k,d=d||f$1,t,o,r,c,s,a),b=k.__e,(y=k.ref)&&d.ref!=y&&(w||(w=[]),d.ref&&w.push(d.ref,null,k),w.push(y,k.__c||b,k)),null!=b?(null==g&&(g=b),"function"==typeof k.type&&k.__k===d.__k?k.__d=s=m$2(k,s,n):s=A(n,k,d,x,b,s),"function"==typeof u.type&&(u.__d=s)):s&&d.__e==s&&s.parentNode!=n&&(s=_$1(d));}for(u.__e=g,h=C;h--;)null!=x[h]&&N(x[h],x[h]);if(w)for(h=0;h<w.length;h++)M(w[h],w[++h],w[++h]);}function m$2(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l="function"==typeof i.type?m$2(i,l,u):A(u,i,i,t,i.__e,l));return l}function A(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else {for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=1)if(f==t)break n;n.insertBefore(t,o),r=o;}return void 0!==r?r:t.nextSibling}function C(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||H(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||H(n,o,l[o],u[o],i);}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||c$1.test(l)?u:u+"px";}function H(n,l,u,i,t){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?T$1:I,o):n.removeEventListener(l,o?T$1:I,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&-1==l.indexOf("-")?n.removeAttribute(l):n.setAttribute(l,u));}}function I(n){this.l[n.type+!1](l$1.event?l$1.event(n):n);}function T$1(n){this.l[n.type+!0](l$1.event?l$1.event(n):n);}function j$1(n,u,i,t,o,r,f,e,c){var a,h,v,y,_,k,b,g,m,x,A,C,$,H,I,T=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(a=l$1.__b)&&a(u);try{n:if("function"==typeof T){if(g=u.props,m=(a=T.contextType)&&t[a.__c],x=a?m?m.props.value:a.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in T&&T.prototype.render?u.__c=h=new T(g,x):(u.__c=h=new d$1(g,x),h.constructor=T,h.render=O),m&&m.sub(h),h.props=g,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=T.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=s$1({},h.__s)),s$1(h.__s,T.getDerivedStateFromProps(g,h.__s))),y=h.props,_=h.state,v)null==T.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(null==T.getDerivedStateFromProps&&g!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(g,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(g,h.__s,x)||u.__v===i.__v){for(h.props=g,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),A=0;A<h._sb.length;A++)h.__h.push(h._sb[A]);h._sb=[],h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(g,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,_,k);});}if(h.context=x,h.props=g,h.__v=u,h.__P=n,C=l$1.__r,$=0,"prototype"in T&&T.prototype.render){for(h.state=h.__s,h.__d=!1,C&&C(u),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[];}else do{h.__d=!1,C&&C(u),a=h.render(h.props,h.state,h.context),h.state=h.__s;}while(h.__d&&++$<25);h.state=h.__s,null!=h.getChildContext&&(t=s$1(s$1({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,_)),I=null!=a&&a.type===p$1&&null==a.key?a.props.children:a,w$1(n,Array.isArray(I)?I:[I],u,i,t,o,r,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1;}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,o,r,f,c);(a=l$1.diffed)&&a(u);}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l$1.__e(n,u,i);}}function z$1(n,u){l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function L(l,u,i,t,o,r,e,c){var s,h,v,y=i.props,p=u.props,d=u.type,k=0;if("svg"===d&&(o=!0),null!=r)for(;k<r.length;k++)if((s=r[k])&&"setAttribute"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,r[k]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=o?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),r=null,c=!1;}if(null===d)y===p||c&&l.data===p||(l.data=p);else {if(r=r&&n$1.call(l.childNodes),h=(y=i.props||f$1).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=r)for(y={},k=0;k<l.attributes.length;k++)y[l.attributes[k].name]=l.attributes[k].value;(v||h)&&(v&&(h&&v.__html==h.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""));}if(C(l,p,y,o,c),v)u.__k=[];else if(k=u.props.children,w$1(l,Array.isArray(k)?k:[k],u,i,t,o&&"foreignObject"!==d,r,e,r?r[0]:i.__k&&_$1(i,0),c),null!=r)for(k=r.length;k--;)null!=r[k]&&a$1(r[k]);c||("value"in p&&void 0!==(k=p.value)&&(k!==l.value||"progress"===d&&!k||"option"===d&&k!==y.value)&&H(l,"value",k,y.value,!1),"checked"in p&&void 0!==(k=p.checked)&&k!==l.checked&&H(l,"checked",k,y.checked,!1));}return l}function M(n,u,i){try{"function"==typeof n?n(u):n.current=u;}catch(n){l$1.__e(n,i);}}function N(n,u,i){var t,o;if(l$1.unmount&&l$1.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(n){l$1.__e(n,u);}t.base=t.__P=null,n.__c=void 0;}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&N(t[o],u,i||"function"!=typeof n.type);i||null==n.__e||a$1(n.__e),n.__=n.__e=n.__d=void 0;}function O(n,l,u){return this.constructor(n,u)}function P(u,i,t){var o,r,e;l$1.__&&l$1.__(u,i),r=(o="function"==typeof t)?null:t&&t.__k||i.__k,e=[],j$1(i,u=(!o&&t||i).__k=h$1(p$1,null,[u]),r||f$1,f$1,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n$1.call(i.childNodes):null,e,!o&&t?t:r?r.__e:i.firstChild,o),z$1(e,u);}n$1=e$2.slice,l$1={__e:function(n,l,u,i){for(var t,o,r;l=l.__;)if((t=l.__c)&&!t.__)try{if((o=t.constructor)&&null!=o.getDerivedStateFromError&&(t.setState(o.getDerivedStateFromError(n)),r=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),r=t.__d),r)return t.__E=t}catch(l){n=l;}throw n}},u$1=0,d$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=s$1({},this.state),"function"==typeof n&&(n=n(s$1({},u),this.props)),n&&s$1(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),b$1(this));},d$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),b$1(this));},d$1.prototype.render=p$1,t$2=[],g$1.__r=0;
28099
+
28100
+ var t$1,r$1,u,i,o=0,f=[],c=[],e$1=l$1.__b,a=l$1.__r,v=l$1.diffed,l=l$1.__c,m$1=l$1.unmount;function d(t,u){l$1.__h&&l$1.__h(r$1,t,o||u),o=0;var i=r$1.__H||(r$1.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:c}),i.__[t]}function p(n){return o=1,y(B,n)}function y(n,u,i){var o=d(t$1++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):B(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r$1,!r$1.u)){r$1.u=!0;var f=r$1.shouldComponentUpdate;r$1.shouldComponentUpdate=function(n,t,r){if(!o.__c.__H)return !0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return !n.__N}))return !f||f.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0);}}),!(!i&&o.__c.props===n)&&(!f||f.call(this,n,t,r))};}return o.__N||o.__}function h(u,i){var o=d(t$1++,3);!l$1.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r$1.__H.__h.push(o));}function s(u,i){var o=d(t$1++,4);!l$1.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r$1.__h.push(o));}function _(n){return o=5,F(function(){return {current:n}},[])}function F(n,r){var u=d(t$1++,7);return z(u.__H,r)?(u.__V=n(),u.i=r,u.__h=n,u.__V):u.__}function T(n,t){return o=8,F(function(){return n},t)}function b(){for(var t;t=f.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k),t.__H.__h.forEach(w),t.__H.__h=[];}catch(r){t.__H.__h=[],l$1.__e(r,t.__v);}}l$1.__b=function(n){r$1=null,e$1&&e$1(n);},l$1.__r=function(n){a&&a(n),t$1=0;var i=(r$1=n.__c).__H;i&&(u===r$1?(i.__h=[],r$1.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c,n.__N=n.i=void 0;})):(i.__h.forEach(k),i.__h.forEach(w),i.__h=[])),u=r$1;},l$1.diffed=function(t){v&&v(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f.push(o)&&i===l$1.requestAnimationFrame||((i=l$1.requestAnimationFrame)||j)(b)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c&&(n.__=n.__V),n.i=void 0,n.__V=c;})),u=r$1=null;},l$1.__c=function(t,r){r.some(function(t){try{t.__h.forEach(k),t.__h=t.__h.filter(function(n){return !n.__||w(n)});}catch(u){r.some(function(n){n.__h&&(n.__h=[]);}),r=[],l$1.__e(u,t.__v);}}),l&&l(t,r);},l$1.unmount=function(t){m$1&&m$1(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{k(n);}catch(n){r=n;}}),u.__H=void 0,r&&l$1.__e(r,u.__v));};var g="function"==typeof requestAnimationFrame;function j(n){var t,r=function(){clearTimeout(u),g&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);g&&(t=requestAnimationFrame(r));}function k(n){var t=r$1,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r$1=t;}function w(n){var t=r$1;n.__c=n.__(),r$1=t;}function z(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function B(n,t){return "function"==typeof t?t(n):t}
28101
+
28102
+ var n=function(t,s,r,e){var u;s[0]=0;for(var h=1;h<s.length;h++){var p=s[h++],a=s[h]?(s[0]|=p?1:2,r[s[h++]]):s[++h];3===p?e[0]=a:4===p?e[1]=Object.assign(e[1]||{},a):5===p?(e[1]=e[1]||{})[s[++h]]=a:6===p?e[1][s[++h]]+=a+"":p?(u=t.apply(a,n(t,a,r,["",null])),e.push(u),a[0]?s[0]|=2:(s[h-2]=0,s[h]=u)):e.push(a);}return e},t=new Map;function e(s){var r=t.get(this);return r||(r=new Map,t.set(this,r)),(r=n(this,r.get(s)||(r.set(s,r=function(n){for(var t,s,r=1,e="",u="",h=[0],p=function(n){1===r&&(n||(e=e.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?h.push(0,n,e):3===r&&(n||e)?(h.push(3,n,e),r=2):2===r&&"..."===e&&n?h.push(4,n,0):2===r&&e&&!n?h.push(5,0,!0,e):r>=5&&((e||!n&&5===r)&&(h.push(r,0,e,s),r=6),n&&(h.push(r,n,0,s),r=6)),e="";},a=0;a<n.length;a++){a&&(1===r&&p(),p(a));for(var l=0;l<n[a].length;l++)t=n[a][l],1===r?"<"===t?(p(),h=[h],r=3):e+=t:4===r?"--"===e&&">"===t?(r=1,e=""):e=t+e[0]:u?t===u?u="":e+=t:'"'===t||"'"===t?u=t:">"===t?(p(),r=1):r&&("="===t?(r=5,s=e,e=""):"/"===t&&(r<5||">"===n[a][l+1])?(p(),3===r&&(h=h[0]),r=h,(h=h[0]).push(2,0,r),r=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(p(),r=2):e+=t),3===r&&"!--"===e&&(r=4,h=h[0]);}return p(),h}(s)),r),arguments,[])).length>1?r:r[0]}
28103
+
28104
+ var m=e.bind(h$1);
28105
+
28106
+ function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
28107
+
28108
+ /**
28109
+ * Component that renders a popup menu entry.
28110
+ *
28111
+ * @param {string} key
28112
+ * @param {Object} entry
28113
+ * @param {boolean} selected
28114
+ * @param {function} onMouseEnter
28115
+ * @param {function} onMouseLeave
28116
+ * @param {function} onClick
28117
+ */
28118
+ function PopupMenuItem(props) {
28119
+ const {
28120
+ entry,
28121
+ selected,
28122
+ onMouseEnter,
28123
+ onMouseLeave,
28124
+ onClick
28125
+ } = props;
28126
+
28127
+ const createImage = imageUrl => {
28128
+ return m`<img src=${ imageUrl } class="djs-popup-entry-icon" />`;
28129
+ };
28130
+
28131
+ return m`
28132
+ <li
28133
+ class=${ clsx('entry', { selected }) }
28134
+ data-id=${ entry.id }
28135
+ onClick=${ onClick }
28136
+ onMouseEnter=${ onMouseEnter }
28137
+ onMouseLeave=${ onMouseLeave }
28138
+ >
28139
+ <div class="djs-popup-entry-content">
28140
+ <span
28141
+ class=${ clsx('djs-popup-entry-name', entry.className) }
28142
+ title=${ entry.label || entry.name }
28143
+ >
28144
+ ${ entry.imageUrl ? createImage(entry.imageUrl) : null }
28145
+ ${ entry.label || entry.name }
28146
+ </span>
28147
+ ${ entry.description && m`
28148
+ <span
28149
+ class="djs-popup-entry-description"
28150
+ title=${ entry.description }
28151
+ >
28152
+ ${ entry.description }
28153
+ </span>
28154
+ ` }
28155
+ </div>
28156
+ ${ entry.documentationRef && m`
28157
+ <div class="djs-popup-entry-docs">
28158
+ <a
28159
+ href="${ entry.documentationRef }"
28160
+ onClick=${ (event) => event.stopPropagation() }
28161
+ title="Open element documentation"
28162
+ target="_blank"
28163
+ rel="noopener"
28164
+ >
28165
+ <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
28166
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M10.6368 10.6375V5.91761H11.9995V10.6382C11.9995 10.9973 11.8623 11.3141 11.5878 11.5885C11.3134 11.863 10.9966 12.0002 10.6375 12.0002H1.36266C0.982345 12.0002 0.660159 11.8681 0.396102 11.6041C0.132044 11.34 1.52588e-05 11.0178 1.52588e-05 10.6375V1.36267C1.52588e-05 0.98236 0.132044 0.660173 0.396102 0.396116C0.660159 0.132058 0.982345 2.95639e-05 1.36266 2.95639e-05H5.91624V1.36267H1.36266V10.6375H10.6368ZM12 0H7.2794L7.27873 1.36197H9.68701L3.06507 7.98391L4.01541 8.93425L10.6373 2.31231V4.72059H12V0Z" fill="#818798"/>
28167
+ </svg>
28168
+ </a>
28169
+ </div>
28170
+ ` }
28171
+ </li>
28172
+ `;
28173
+ }
28174
+
28175
+ /**
28176
+ * Component that renders a popup menu entry list.
28177
+ *
28178
+ * @param {Array} entries
28179
+ * @param {Object} selectedEntry
28180
+ * @param {function} setSelectedEntry
28181
+ * @param {function} onClick
28182
+ * @param {Object} resultsRef
28183
+ */
28184
+
28185
+ function PopupMenuList(props) {
28186
+ const {
28187
+ selectedEntry,
28188
+ setSelectedEntry,
28189
+ onClick,
28190
+ entries
28191
+ } = props;
28192
+
28193
+ const resultsRef = _();
28194
+
28195
+ const groups = F(() => groupEntries(entries), [ entries ]);
28196
+
28197
+ // scroll to selected result
28198
+ s(() => {
28199
+ const containerEl = resultsRef.current;
28200
+
28201
+ if (!containerEl)
28202
+ return;
28203
+
28204
+ const selectedEl = containerEl.querySelector('.selected');
28205
+
28206
+ if (selectedEl) {
28207
+ scrollIntoView(selectedEl);
28208
+ }
28209
+ }, [ selectedEntry ]);
28210
+
28211
+ return m`
28212
+ <div class="djs-popup-results" ref=${ resultsRef }>
28213
+ ${ groups.map(group => m`
28214
+ ${ group.name && m`
28215
+ <div key=${ group.id } class="entry-header">
28216
+ ${ group.name }
28217
+ </div>
28218
+ ` }
28219
+ <ul class="djs-popup-group" data-group=${ group.id }>
28220
+ ${ group.entries.map(entry => m`
28221
+ <${PopupMenuItem}
28222
+ key=${ entry.id }
28223
+ entry=${ entry }
28224
+ selected=${ entry === selectedEntry }
28225
+ onMouseEnter=${ () => setSelectedEntry(entry) }
28226
+ onMouseLeave=${ () => setSelectedEntry(null) }
28227
+ onClick=${ onClick }
28228
+ />
28229
+ `) }
28230
+ </ul>
28231
+ `) }
28232
+ </div>
28233
+ `;
28234
+ }
28235
+
28236
+
28237
+ // helpers
28238
+ function groupEntries(entries) {
28239
+ const groups = [];
28240
+
28241
+ const getGroup = group => groups.find(elem => group.id === elem.id);
28242
+
28243
+ const containsGroup = group => !!getGroup(group);
28244
+
28245
+ // legacy support for provider built for the old popUp menu
28246
+ const formatGroup = group =>
28247
+ typeof group === 'string' ? { id: group } : group;
28248
+
28249
+ entries.forEach(entry => {
28250
+
28251
+ // assume a default group when none is provided
28252
+ const group = entry.group ? formatGroup(entry.group) : { id: 'default' };
28253
+
28254
+ if (!containsGroup(group)) {
28255
+ groups.push({ ...group, entries: [ entry ] });
28256
+ } else {
28257
+ getGroup(group).entries.push(entry);
28258
+ }
28259
+ });
28260
+
28261
+ return groups;
28262
+ }
28263
+
28264
+ // helpers ////////////////
28265
+
28266
+ function scrollIntoView(el) {
28267
+ if (typeof el.scrollIntoViewIfNeeded === 'function') {
28268
+ el.scrollIntoViewIfNeeded();
28269
+ } else {
28270
+ el.scrollIntoView({
28271
+ scrollMode: 'if-needed',
28272
+ block: 'nearest'
28273
+ });
28274
+ }
28275
+ }
28276
+
28277
+ /**
28278
+ * A component that renders the popup menus.
28279
+ *
28280
+ * @param {function} onClose
28281
+ * @param {function} position
28282
+ * @param {string} className
28283
+ * @param {Array} entries
28284
+ * @param {Array} headerEntries
28285
+ * @param {number} scale
28286
+ * @param {string} [title]
28287
+ * @param {boolean} [search]
28288
+ * @param {number} [width]
28289
+ */
28290
+ function PopupMenuComponent(props) {
28291
+ const {
28292
+ onClose,
28293
+ onSelect,
28294
+ className,
28295
+ headerEntries,
28296
+ position,
28297
+ title,
28298
+ width,
28299
+ scale,
28300
+ search,
28301
+ entries: originalEntries
28302
+ } = props;
28303
+
28304
+ const searchable = F(() => {
28305
+ if (!isDefined(search)) {
28306
+ return false;
28307
+ }
28308
+
28309
+ return originalEntries.length > 5;
28310
+ }, [ search, originalEntries ]);
28311
+
28312
+ const inputRef = _();
28313
+
28314
+ const [ value, setValue ] = p('');
28315
+
28316
+ const [ entries, setEntries ] = p(originalEntries);
28317
+ const [ selectedEntry, setSelectedEntry ] = p(entries[0]);
28318
+
28319
+ const updateEntries = T((newEntries) => {
28320
+
28321
+ // select first entry if non is selected
28322
+ if (!selectedEntry || !newEntries.includes(selectedEntry)) {
28323
+ setSelectedEntry(newEntries[0]);
28324
+ }
28325
+
28326
+ setEntries(newEntries);
28327
+ }, [ selectedEntry, setEntries, setSelectedEntry ]);
28328
+
28329
+ // filter entries on value change
28330
+ h(() => {
28331
+ if (!searchable) {
28332
+ return;
28333
+ }
28334
+
28335
+ const filter = entry => {
28336
+ if (!value) {
28337
+ return true;
28338
+ }
28339
+
28340
+ const search = [
28341
+ entry.name,
28342
+ entry.description || '',
28343
+ entry.label || '',
28344
+ entry.id || ''
28345
+ ]
28346
+ .join('---')
28347
+ .toLowerCase();
28348
+
28349
+ return value
28350
+ .toLowerCase()
28351
+ .split(/\s/g)
28352
+ .every(term => search.includes(term));
28353
+ };
28354
+
28355
+ const entries = originalEntries.filter(filter);
28356
+
28357
+ updateEntries(entries);
28358
+ }, [ value, originalEntries, searchable ]);
28359
+
28360
+ // register global <Escape> handler
28361
+ h(() => {
28362
+ const handleKeyDown = event => {
28363
+ if (event.key === 'Escape') {
28364
+ event.preventDefault();
28365
+
28366
+ return onClose();
28367
+ }
28368
+ };
28369
+
28370
+ document.documentElement.addEventListener('keydown', handleKeyDown);
28371
+
28372
+ return () => {
28373
+ document.documentElement.removeEventListener('keydown', handleKeyDown);
28374
+ };
28375
+ }, []);
28376
+
28377
+ // focus input on initial mount
28378
+ s(() => {
28379
+ inputRef.current && inputRef.current.focus();
28380
+ }, []);
28381
+
28382
+ // handle keyboard seleciton
28383
+ const keyboardSelect = T(direction => {
28384
+ const idx = entries.indexOf(selectedEntry);
28385
+
28386
+ let nextIdx = idx + direction;
28387
+
28388
+ if (nextIdx < 0) {
28389
+ nextIdx = entries.length - 1;
28390
+ }
28391
+
28392
+ if (nextIdx >= entries.length) {
28393
+ nextIdx = 0;
28394
+ }
28395
+
28396
+ setSelectedEntry(entries[nextIdx]);
28397
+ }, [ entries, selectedEntry, setSelectedEntry ]);
28398
+
28399
+ const handleKeyDown = T(event => {
28400
+ if (event.key === 'Enter' && selectedEntry) {
28401
+ return onSelect(event, selectedEntry);
28402
+ }
28403
+
28404
+ if (event.key === 'Escape') {
28405
+ return onClose();
28406
+ }
28407
+
28408
+ // ARROW_UP or SHIFT + TAB navigation
28409
+ if (event.key === 'ArrowUp' || (event.key === 'Tab' && event.shiftKey)) {
28410
+ keyboardSelect(-1);
28411
+
28412
+ return event.preventDefault();
28413
+ }
28414
+
28415
+ // ARROW_DOWN or TAB navigation
28416
+ if (event.key === 'ArrowDown' || event.key === 'Tab') {
28417
+ keyboardSelect(1);
28418
+
28419
+ return event.preventDefault();
28420
+ }
28421
+ }, [ onSelect, onClose, selectedEntry, keyboardSelect ]);
28422
+
28423
+ const handleKey = T(event => {
28424
+ if (matches(event.target, 'input')) {
28425
+ setValue(() => event.target.value);
28426
+ }
28427
+ }, [ setValue ]);
28428
+
28429
+ const displayHeader = F(() => title || headerEntries.length > 0, [ title, headerEntries ]);
28430
+
28431
+ return m`
28432
+ <${PopupMenuWrapper}
28433
+ onClose=${ onClose }
28434
+ onKeyup=${ handleKey }
28435
+ onKeydown=${ handleKeyDown }
28436
+ className=${ className }
28437
+ position=${position}
28438
+ width=${ width }
28439
+ scale=${ scale }
28440
+ >
28441
+ ${ displayHeader && m`
28442
+ <div class="djs-popup-header">
28443
+ <h3 class="djs-popup-title">${ title }</h3>
28444
+ ${ headerEntries.map(entry => m`
28445
+ <span
28446
+ class=${ getHeaderClasses(entry, entry === selectedEntry) }
28447
+ onClick=${ event => onSelect(event, entry) }
28448
+ title=${ entry.title }
28449
+ data-id=${ entry.id }
28450
+ onMouseEnter=${ () => setSelectedEntry(entry) }
28451
+ onMouseLeave=${ () => setSelectedEntry(null) }
28452
+ >
28453
+ ${ entry.imageUrl ? m`<img src=${ entry.imageUrl } />` : null }
28454
+ ${ entry.label ? entry.label : null }
28455
+ </span>
28456
+ `) }
28457
+ </div>
28458
+ ` }
28459
+ ${ originalEntries.length > 0 && m`
28460
+ <div class="djs-popup-body">
28461
+
28462
+ ${ searchable && m`
28463
+ <div class="djs-popup-search">
28464
+ <svg class="djs-popup-search-icon" width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
28465
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M9.0325 8.5H9.625L13.3675 12.25L12.25 13.3675L8.5 9.625V9.0325L8.2975 8.8225C7.4425 9.5575 6.3325 10 5.125 10C2.4325 10 0.25 7.8175 0.25 5.125C0.25 2.4325 2.4325 0.25 5.125 0.25C7.8175 0.25 10 2.4325 10 5.125C10 6.3325 9.5575 7.4425 8.8225 8.2975L9.0325 8.5ZM1.75 5.125C1.75 6.9925 3.2575 8.5 5.125 8.5C6.9925 8.5 8.5 6.9925 8.5 5.125C8.5 3.2575 6.9925 1.75 5.125 1.75C3.2575 1.75 1.75 3.2575 1.75 5.125Z" fill="#22242A"/>
28466
+ </svg>
28467
+ <input
28468
+ ref=${ inputRef }
28469
+ type="text"
28470
+ />
28471
+ </div>
28472
+ ` }
28473
+
28474
+ <${PopupMenuList}
28475
+ entries=${ entries }
28476
+ selectedEntry=${ selectedEntry }
28477
+ setSelectedEntry=${ setSelectedEntry }
28478
+ onClick=${ onSelect }
28479
+ />
28480
+ </div>
28481
+ ${ entries.length === 0 && m`
28482
+ <div class="djs-popup-no-results">No matching entries found.</div>
28483
+ ` }
28484
+ ` }
28485
+ </${PopupMenuWrapper}>
28486
+ `;
28487
+ }
28488
+
28489
+ /**
28490
+ * A component that wraps the popup menu.
28491
+ *
28492
+ * @param {any} props
28493
+ */
28494
+ function PopupMenuWrapper(props) {
28495
+ const {
28496
+ onClose,
28497
+ onKeydown,
28498
+ onKeyup,
28499
+ className,
28500
+ children,
28501
+ position: positionGetter
28502
+ } = props;
28503
+
28504
+ const popupRef = _();
28505
+
28506
+ const checkClose = T((event) => {
28507
+
28508
+ const popup = closest(event.target, '.djs-popup', true);
28509
+
28510
+ if (popup) {
28511
+ return;
28512
+ }
28513
+
28514
+ onClose();
28515
+ }, [ onClose ]);
28516
+
28517
+ s(() => {
28518
+ if (typeof positionGetter !== 'function') {
28519
+ return;
28520
+ }
28521
+
28522
+ const popupEl = popupRef.current;
28523
+ const position = positionGetter(popupEl);
28524
+
28525
+ popupEl.style.left = `${position.x}px`;
28526
+ popupEl.style.top = `${position.y}px`;
28527
+ }, [ popupRef.current, positionGetter ]);
28528
+
28529
+ // focus popup initially, on mount
28530
+ s(() => {
28531
+ popupRef.current && popupRef.current.focus();
28532
+ }, []);
28533
+
28534
+ return m`
28535
+ <div
28536
+ class="djs-popup-backdrop"
28537
+ onClick=${ checkClose }
28538
+ >
28539
+ <div
28540
+ class=${ clsx('djs-popup', className) }
28541
+ style=${ getPopupStyle(props) }
28542
+ onKeydown=${ onKeydown }
28543
+ onKeyup=${ onKeyup }
28544
+ ref=${ popupRef }
28545
+ tabIndex="-1"
28546
+ >
28547
+ ${children}
28548
+ </div>
28549
+ </div>
28550
+ `;
28551
+ }
28552
+
28553
+ // helpers //////////////////////
28554
+
28555
+ function getPopupStyle(props) {
28556
+ return {
28557
+ transform: `scale(${props.scale})`,
28558
+ width: `${props.width}px`
28559
+ };
28560
+ }
28561
+
28562
+ function getHeaderClasses(entry, selected) {
28563
+ return clsx(
28564
+ 'entry',
28565
+ entry.className,
28566
+ entry.active ? 'active' : '',
28567
+ entry.disabled ? 'disabled' : '',
28568
+ selected ? 'selected' : ''
28569
+ );
28570
+ }
28571
+
28099
28572
  var DATA_REF = 'data-id';
28100
28573
 
28101
28574
  var CLOSE_EVENTS = [
@@ -28121,6 +28594,10 @@
28121
28594
  * @constructor
28122
28595
  */
28123
28596
  function PopupMenu(config, eventBus, canvas) {
28597
+ this._eventBus = eventBus;
28598
+ this._canvas = canvas;
28599
+
28600
+ this._current = null;
28124
28601
 
28125
28602
  var scale = isDefined(config && config.scale) ? config.scale : {
28126
28603
  min: 1,
@@ -28131,10 +28608,20 @@
28131
28608
  scale: scale
28132
28609
  };
28133
28610
 
28134
- this._eventBus = eventBus;
28135
- this._canvas = canvas;
28136
- this._providers = {};
28137
- this._current = {};
28611
+
28612
+ eventBus.on('diagram.destroy', () => {
28613
+ this.close();
28614
+ });
28615
+
28616
+ eventBus.on('element.changed', event => {
28617
+
28618
+ const element = this.isOpen() && this._current.element;
28619
+
28620
+ if (event.element === element) {
28621
+ this._render();
28622
+ }
28623
+ });
28624
+
28138
28625
  }
28139
28626
 
28140
28627
  PopupMenu.$inject = [
@@ -28143,65 +28630,52 @@
28143
28630
  'canvas'
28144
28631
  ];
28145
28632
 
28146
- /**
28147
- * Registers a popup menu provider
28148
- *
28149
- * @param {string} id
28150
- * @param {number} [priority=1000]
28151
- * @param {Object} provider
28152
- *
28153
- * @example
28154
- * const popupMenuProvider = {
28155
- * getPopupMenuEntries: function(element) {
28156
- * return {
28157
- * 'entry-1': {
28158
- * label: 'My Entry',
28159
- * action: function() { alert("I have been clicked!"); }
28160
- * }
28161
- * }
28162
- * }
28163
- * };
28164
- *
28165
- * popupMenu.registerProvider('myMenuID', popupMenuProvider);
28166
- */
28167
- PopupMenu.prototype.registerProvider = function(id, priority, provider) {
28168
- if (!provider) {
28169
- provider = priority;
28170
- priority = DEFAULT_PRIORITY$1;
28171
- }
28172
-
28173
- this._eventBus.on('popupMenu.getProviders.' + id, priority, function(event) {
28174
- event.providers.push(provider);
28175
- });
28176
- };
28177
-
28178
- /**
28179
- * Determine if the popup menu has entries.
28180
- *
28181
- * @return {boolean} true if empty
28182
- */
28183
- PopupMenu.prototype.isEmpty = function(element, providerId) {
28184
- if (!element) {
28185
- throw new Error('element parameter is missing');
28186
- }
28187
-
28188
- if (!providerId) {
28189
- throw new Error('providerId parameter is missing');
28190
- }
28633
+ PopupMenu.prototype._render = function() {
28191
28634
 
28192
- var providers = this._getProviders(providerId);
28635
+ const {
28636
+ position: _position,
28637
+ className,
28638
+ entries,
28639
+ headerEntries,
28640
+ options
28641
+ } = this._current;
28193
28642
 
28194
- if (!providers) {
28195
- return true;
28196
- }
28643
+ const entriesArray = [
28644
+ ...Object.entries(entries).map(
28645
+ ([ key, value ]) => ({ id: key, ...value })
28646
+ )
28647
+ ];
28197
28648
 
28198
- var entries = this._getEntries(element, providers),
28199
- headerEntries = this._getHeaderEntries(element, providers);
28649
+ const headerEntriesArray = [
28650
+ ...Object.entries(headerEntries).map(
28651
+ ([ key, value ]) => ({ id: key, ...value })
28652
+ )
28653
+ ];
28200
28654
 
28201
- var hasEntries = size(entries) > 0,
28202
- hasHeaderEntries = headerEntries && size(headerEntries) > 0;
28655
+ const position = _position && (
28656
+ (container) => this._ensureVisible(container, _position)
28657
+ );
28203
28658
 
28204
- return !hasEntries && !hasHeaderEntries;
28659
+ const scale = this._updateScale(this._current.container);
28660
+
28661
+ const onClose = result => this.close(result);
28662
+ const onSelect = (event, entry) => this.trigger(event, entry);
28663
+
28664
+ P(
28665
+ m`
28666
+ <${PopupMenuComponent}
28667
+ onClose=${ onClose }
28668
+ onSelect=${ onSelect }
28669
+ position=${ position }
28670
+ className=${ className }
28671
+ entries=${ entriesArray }
28672
+ headerEntries=${ headerEntriesArray }
28673
+ scale=${ scale }
28674
+ ...${{ ...options }}
28675
+ />
28676
+ `,
28677
+ this._current.container
28678
+ );
28205
28679
  };
28206
28680
 
28207
28681
 
@@ -28214,16 +28688,13 @@
28214
28688
  *
28215
28689
  * @return {Object} popup menu instance
28216
28690
  */
28217
- PopupMenu.prototype.open = function(element, id, position) {
28218
-
28219
- var providers = this._getProviders(id);
28220
-
28691
+ PopupMenu.prototype.open = function(element, providerId, position, options) {
28221
28692
  if (!element) {
28222
28693
  throw new Error('Element is missing');
28223
28694
  }
28224
28695
 
28225
- if (!providers || !providers.length) {
28226
- throw new Error('No registered providers for: ' + id);
28696
+ if (!providerId) {
28697
+ throw new Error('No registered providers for: ' + providerId);
28227
28698
  }
28228
28699
 
28229
28700
  if (!position) {
@@ -28234,44 +28705,50 @@
28234
28705
  this.close();
28235
28706
  }
28236
28707
 
28237
- this._emit('open');
28708
+ const {
28709
+ entries,
28710
+ headerEntries
28711
+ } = this._getContext(element, providerId);
28238
28712
 
28239
- var current = this._current = {
28240
- className: id,
28241
- element: element,
28242
- position: position
28713
+ this._current = {
28714
+ position,
28715
+ className: providerId,
28716
+ element,
28717
+ entries,
28718
+ headerEntries,
28719
+ container: this._createContainer({ provider: providerId }),
28720
+ options
28243
28721
  };
28244
28722
 
28245
- var entries = this._getEntries(element, providers),
28246
- headerEntries = this._getHeaderEntries(element, providers);
28723
+ this._emit('open');
28247
28724
 
28248
- current.entries = assign$1({}, entries, headerEntries);
28725
+ this._bindAutoClose();
28249
28726
 
28250
- current.container = this._createContainer(id);
28727
+ this._render();
28728
+ };
28251
28729
 
28252
- if (size(headerEntries)) {
28253
- current.container.appendChild(
28254
- this._createEntries(headerEntries, 'djs-popup-header')
28255
- );
28256
- }
28257
28730
 
28258
- if (size(entries)) {
28259
- current.container.appendChild(
28260
- this._createEntries(entries, 'djs-popup-body')
28261
- );
28731
+ PopupMenu.prototype._getContext = function(element, provider) {
28732
+
28733
+ const providers = this._getProviders(provider);
28734
+
28735
+ if (!providers || !providers.length) {
28736
+ throw new Error('No registered providers for: ' + provider);
28262
28737
  }
28263
28738
 
28264
- var canvas = this._canvas,
28265
- parent = canvas.getContainer();
28739
+ const entries = this._getEntries(element, providers);
28740
+ const headerEntries = this._getHeaderEntries(element, providers);
28266
28741
 
28267
- this._attachContainer(current.container, parent, position.cursor);
28268
- this._bindAutoClose();
28742
+ return {
28743
+ entries,
28744
+ headerEntries,
28745
+ empty: !(
28746
+ Object.keys(entries).length ||
28747
+ Object.keys(headerEntries).length
28748
+ )
28749
+ };
28269
28750
  };
28270
28751
 
28271
-
28272
- /**
28273
- * Removes the popup menu and unbinds the event handlers.
28274
- */
28275
28752
  PopupMenu.prototype.close = function() {
28276
28753
 
28277
28754
  if (!this.isOpen()) {
@@ -28280,44 +28757,178 @@
28280
28757
 
28281
28758
  this._emit('close');
28282
28759
 
28283
- this._unbindAutoClose();
28284
- remove$2(this._current.container);
28285
- this._current.container = null;
28760
+ this.reset();
28761
+
28762
+ this._current = null;
28763
+ };
28764
+
28765
+ PopupMenu.prototype.reset = function() {
28766
+ const container = this._current.container;
28767
+
28768
+ P(null, container);
28769
+
28770
+ remove$2(container);
28771
+ };
28772
+
28773
+ PopupMenu.prototype._emit = function(event, payload) {
28774
+ this._eventBus.fire(`popupMenu.${ event }`, payload);
28286
28775
  };
28287
28776
 
28777
+ PopupMenu.prototype._createContainer = function(config) {
28778
+
28779
+ let parent = config && config.parent || 'body';
28780
+
28781
+ if (typeof parent === 'string') {
28782
+ parent = document.querySelector(parent);
28783
+ }
28784
+
28785
+ const container = domify$1(`<div class="djs-popup-parent djs-parent" data-popup=${config.provider}></div>`);
28786
+
28787
+ parent.appendChild(container);
28788
+
28789
+ return container;
28790
+ };
28288
28791
 
28289
28792
  /**
28290
- * Determine if an open popup menu exist.
28291
- *
28292
- * @return {boolean} true if open
28793
+ * Set up listener to close popup automatically on certain events.
28293
28794
  */
28294
- PopupMenu.prototype.isOpen = function() {
28295
- return !!this._current.container;
28795
+ PopupMenu.prototype._bindAutoClose = function() {
28796
+ this._eventBus.once(CLOSE_EVENTS, this.close, this);
28296
28797
  };
28297
28798
 
28298
28799
 
28299
28800
  /**
28300
- * Trigger an action associated with an entry.
28301
- *
28302
- * @param {Object} event
28801
+ * Remove the auto-closing listener.
28802
+ */
28803
+ PopupMenu.prototype._unbindAutoClose = function() {
28804
+ this._eventBus.off(CLOSE_EVENTS, this.close, this);
28805
+ };
28806
+
28807
+
28808
+ /**
28809
+ * Updates popup style.transform with respect to the config and zoom level.
28303
28810
  *
28304
- * @return the result of the action callback, if any
28811
+ * @param {Object} container
28305
28812
  */
28306
- PopupMenu.prototype.trigger = function(event) {
28813
+ PopupMenu.prototype._updateScale = function(container) {
28814
+ var zoom = this._canvas.zoom();
28307
28815
 
28308
- // silence other actions
28309
- event.preventDefault();
28816
+ var scaleConfig = this._config.scale,
28817
+ minScale,
28818
+ maxScale,
28819
+ scale = zoom;
28820
+
28821
+ if (scaleConfig !== true) {
28310
28822
 
28311
- var element = event.delegateTarget || event.target,
28312
- entryId = attr$1(element, DATA_REF);
28823
+ if (scaleConfig === false) {
28824
+ minScale = 1;
28825
+ maxScale = 1;
28826
+ } else {
28827
+ minScale = scaleConfig.min;
28828
+ maxScale = scaleConfig.max;
28829
+ }
28313
28830
 
28314
- var entry = this._getEntry(entryId);
28831
+ if (isDefined(minScale) && zoom < minScale) {
28832
+ scale = minScale;
28833
+ }
28315
28834
 
28316
- if (entry.action) {
28317
- return entry.action.call(null, event, entry);
28835
+ if (isDefined(maxScale) && zoom > maxScale) {
28836
+ scale = maxScale;
28837
+ }
28838
+
28839
+ }
28840
+
28841
+ return scale;
28842
+
28843
+ };
28844
+
28845
+ PopupMenu.prototype._ensureVisible = function(container, position) {
28846
+ var documentBounds = document.documentElement.getBoundingClientRect();
28847
+ var containerBounds = container.getBoundingClientRect();
28848
+
28849
+ var overAxis = {},
28850
+ left = position.x,
28851
+ top = position.y;
28852
+
28853
+ if (position.x + containerBounds.width > documentBounds.width) {
28854
+ overAxis.x = true;
28855
+ }
28856
+
28857
+ if (position.y + containerBounds.height > documentBounds.height) {
28858
+ overAxis.y = true;
28859
+ }
28860
+
28861
+ if (overAxis.x && overAxis.y) {
28862
+ left = position.x - containerBounds.width;
28863
+ top = position.y - containerBounds.height;
28864
+ } else if (overAxis.x) {
28865
+ left = position.x - containerBounds.width;
28866
+ top = position.y;
28867
+ } else if (overAxis.y && position.y < containerBounds.height) {
28868
+ left = position.x;
28869
+ top = 10;
28870
+ } else if (overAxis.y) {
28871
+ left = position.x;
28872
+ top = position.y - containerBounds.height;
28873
+ }
28874
+
28875
+ return {
28876
+ x: left,
28877
+ y: top
28878
+ };
28879
+ };
28880
+
28881
+ PopupMenu.prototype.isEmpty = function(element, providerId) {
28882
+ if (!element) {
28883
+ throw new Error('element parameter is missing');
28884
+ }
28885
+
28886
+ if (!providerId) {
28887
+ throw new Error('providerId parameter is missing');
28888
+ }
28889
+
28890
+ const providers = this._getProviders(providerId);
28891
+
28892
+ if (!providers || !providers.length) {
28893
+ return true;
28894
+ }
28895
+
28896
+ return this._getContext(element, providerId).empty;
28897
+ };
28898
+
28899
+ /**
28900
+ * Registers a popup menu provider
28901
+ *
28902
+ * @param {string} id
28903
+ * @param {number} [priority=1000]
28904
+ * @param {Object} provider
28905
+ *
28906
+ * @example
28907
+ * const popupMenuProvider = {
28908
+ * getPopupMenuEntries: function(element) {
28909
+ * return {
28910
+ * 'entry-1': {
28911
+ * label: 'My Entry',
28912
+ * action: function() { alert("I have been clicked!"); }
28913
+ * }
28914
+ * }
28915
+ * }
28916
+ * };
28917
+ *
28918
+ * popupMenu.registerProvider('myMenuID', popupMenuProvider);
28919
+ */
28920
+ PopupMenu.prototype.registerProvider = function(id, priority, provider) {
28921
+ if (!provider) {
28922
+ provider = priority;
28923
+ priority = DEFAULT_PRIORITY$1;
28318
28924
  }
28925
+
28926
+ this._eventBus.on('popupMenu.getProviders.' + id, priority, function(event) {
28927
+ event.providers.push(provider);
28928
+ });
28319
28929
  };
28320
28930
 
28931
+
28321
28932
  PopupMenu.prototype._getProviders = function(id) {
28322
28933
 
28323
28934
  var event = this._eventBus.createEvent({
@@ -28406,282 +29017,61 @@
28406
29017
 
28407
29018
  };
28408
29019
 
28409
- /**
28410
- * Gets an entry instance (either entry or headerEntry) by id.
28411
- *
28412
- * @param {string} entryId
28413
- *
28414
- * @return {Object} entry instance
28415
- */
28416
- PopupMenu.prototype._getEntry = function(entryId) {
28417
-
28418
- var entry = this._current.entries[entryId];
28419
-
28420
- if (!entry) {
28421
- throw new Error('entry not found');
28422
- }
28423
-
28424
- return entry;
28425
- };
28426
-
28427
- PopupMenu.prototype._emit = function(eventName) {
28428
- this._eventBus.fire('popupMenu.' + eventName);
28429
- };
28430
-
28431
- /**
28432
- * Creates the popup menu container.
28433
- *
28434
- * @return {Object} a DOM container
28435
- */
28436
- PopupMenu.prototype._createContainer = function(id) {
28437
- var container = domify$1('<div class="djs-popup">'),
28438
- position = this._current.position,
28439
- className = this._current.className;
28440
-
28441
- assign(container, {
28442
- position: 'absolute',
28443
- left: position.x + 'px',
28444
- top: position.y + 'px',
28445
- visibility: 'hidden'
28446
- });
28447
-
28448
- classes$1(container).add(className);
28449
-
28450
- attr$1(container, 'data-popup', id);
28451
-
28452
- return container;
28453
- };
28454
-
28455
-
28456
- /**
28457
- * Attaches the container to the DOM.
28458
- *
28459
- * @param {Object} container
28460
- * @param {Object} parent
28461
- */
28462
- PopupMenu.prototype._attachContainer = function(container, parent, cursor) {
28463
- var self = this;
28464
-
28465
- // Event handler
28466
- delegate.bind(container, '.entry' ,'click', function(event) {
28467
- self.trigger(event);
28468
- });
28469
-
28470
- this._updateScale(container);
28471
-
28472
- // Attach to DOM
28473
- parent.appendChild(container);
28474
-
28475
- if (cursor) {
28476
- this._assureIsInbounds(container, cursor);
28477
- }
28478
-
28479
- // display after position adjustment to avoid flickering
28480
- assign(container, { visibility: 'visible' });
28481
- };
28482
-
28483
29020
 
28484
29021
  /**
28485
- * Updates popup style.transform with respect to the config and zoom level.
28486
- *
28487
- * @method _updateScale
29022
+ * Determine if an open popup menu exist.
28488
29023
  *
28489
- * @param {Object} container
29024
+ * @return {boolean} true if open
28490
29025
  */
28491
- PopupMenu.prototype._updateScale = function(container) {
28492
- var zoom = this._canvas.zoom();
28493
-
28494
- var scaleConfig = this._config.scale,
28495
- minScale,
28496
- maxScale,
28497
- scale = zoom;
28498
-
28499
- if (scaleConfig !== true) {
28500
-
28501
- if (scaleConfig === false) {
28502
- minScale = 1;
28503
- maxScale = 1;
28504
- } else {
28505
- minScale = scaleConfig.min;
28506
- maxScale = scaleConfig.max;
28507
- }
28508
-
28509
- if (isDefined(minScale) && zoom < minScale) {
28510
- scale = minScale;
28511
- }
28512
-
28513
- if (isDefined(maxScale) && zoom > maxScale) {
28514
- scale = maxScale;
28515
- }
28516
-
28517
- }
28518
-
28519
- setTransform(container, 'scale(' + scale + ')');
29026
+ PopupMenu.prototype.isOpen = function() {
29027
+ return !!this._current;
28520
29028
  };
28521
29029
 
28522
29030
 
28523
29031
  /**
28524
- * Make sure that the menu is always fully shown
29032
+ * Trigger an action associated with an entry.
28525
29033
  *
28526
- * @method function
29034
+ * @param {Object} event
29035
+ * @param {Object} entry
28527
29036
  *
28528
- * @param {Object} container
28529
- * @param {Position} cursor {x, y}
29037
+ * @return the result of the action callback, if any
28530
29038
  */
28531
- PopupMenu.prototype._assureIsInbounds = function(container, cursor) {
28532
- var canvas = this._canvas,
28533
- clientRect = canvas._container.getBoundingClientRect();
29039
+ PopupMenu.prototype.trigger = function(event, entry) {
28534
29040
 
28535
- var containerX = container.offsetLeft,
28536
- containerY = container.offsetTop,
28537
- containerWidth = container.scrollWidth,
28538
- containerHeight = container.scrollHeight,
28539
- overAxis = {},
28540
- left, top;
28541
-
28542
- var cursorPosition = {
28543
- x: cursor.x - clientRect.left,
28544
- y: cursor.y - clientRect.top
28545
- };
29041
+ // silence other actions
29042
+ event.preventDefault();
28546
29043
 
28547
- if (containerX + containerWidth > clientRect.width) {
28548
- overAxis.x = true;
28549
- }
29044
+ if (!entry) {
29045
+ let element = closest(event.delegateTarget || event.target, '.entry', true);
29046
+ let entryId = attr$1(element, DATA_REF);
28550
29047
 
28551
- if (containerY + containerHeight > clientRect.height) {
28552
- overAxis.y = true;
29048
+ entry = this._getEntry(entryId);
28553
29049
  }
28554
29050
 
28555
- if (overAxis.x && overAxis.y) {
28556
- left = cursorPosition.x - containerWidth + 'px';
28557
- top = cursorPosition.y - containerHeight + 'px';
28558
- } else if (overAxis.x) {
28559
- left = cursorPosition.x - containerWidth + 'px';
28560
- top = cursorPosition.y + 'px';
28561
- } else if (overAxis.y && cursorPosition.y < containerHeight) {
28562
- left = cursorPosition.x + 'px';
28563
- top = 10 + 'px';
28564
- } else if (overAxis.y) {
28565
- left = cursorPosition.x + 'px';
28566
- top = cursorPosition.y - containerHeight + 'px';
29051
+ if (entry.action) {
29052
+ return entry.action.call(null, event, entry);
28567
29053
  }
28568
-
28569
- assign(container, { left: left, top: top }, { 'zIndex': 1000 });
28570
- };
28571
-
28572
-
28573
- /**
28574
- * Creates a list of entries and returns them as a DOM container.
28575
- *
28576
- * @param {Array<Object>} entries an array of entry objects
28577
- * @param {string} className the class name of the entry container
28578
- *
28579
- * @return {Object} a DOM container
28580
- */
28581
- PopupMenu.prototype._createEntries = function(entries, className) {
28582
-
28583
- var entriesContainer = domify$1('<div>'),
28584
- self = this;
28585
-
28586
- classes$1(entriesContainer).add(className);
28587
-
28588
- forEach$1(entries, function(entry, id) {
28589
- var entryContainer = self._createEntry(entry, id),
28590
- grouping = entry.group || 'default',
28591
- groupContainer = query('[data-group=' + cssEscape(grouping) + ']', entriesContainer);
28592
-
28593
- if (!groupContainer) {
28594
- groupContainer = domify$1('<div class="group"></div>');
28595
- attr$1(groupContainer, 'data-group', grouping);
28596
-
28597
- entriesContainer.appendChild(groupContainer);
28598
- }
28599
-
28600
- groupContainer.appendChild(entryContainer);
28601
- });
28602
-
28603
- return entriesContainer;
28604
29054
  };
28605
29055
 
28606
-
28607
29056
  /**
28608
- * Creates a single entry and returns it as a DOM container.
29057
+ * Gets an entry instance (either entry or headerEntry) by id.
28609
29058
  *
28610
- * @param {Object} entry
29059
+ * @param {string} entryId
28611
29060
  *
28612
- * @return {Object} a DOM container
29061
+ * @return {Object} entry instance
28613
29062
  */
28614
- PopupMenu.prototype._createEntry = function(entry, id) {
28615
-
28616
- var entryContainer = domify$1('<div>'),
28617
- entryClasses = classes$1(entryContainer);
28618
-
28619
- entryClasses.add('entry');
28620
-
28621
- if (entry.className) {
28622
- entry.className.split(' ').forEach(function(className) {
28623
- entryClasses.add(className);
28624
- });
28625
- }
28626
-
28627
- attr$1(entryContainer, DATA_REF, id);
28628
-
28629
- if (entry.label) {
28630
- var label = domify$1('<span>');
28631
- label.textContent = entry.label;
28632
- entryContainer.appendChild(label);
28633
- }
28634
-
28635
- if (entry.imageUrl) {
28636
- var image = domify$1('<img>');
28637
- attr$1(image, 'src', entry.imageUrl);
28638
-
28639
- entryContainer.appendChild(image);
28640
- }
29063
+ PopupMenu.prototype._getEntry = function(entryId) {
28641
29064
 
28642
- if (entry.active === true) {
28643
- entryClasses.add('active');
28644
- }
29065
+ var entry = this._current.entries[entryId] || this._current.headerEntries[entryId];
28645
29066
 
28646
- if (entry.disabled === true) {
28647
- entryClasses.add('disabled');
28648
- }
28649
29067
 
28650
- if (entry.title) {
28651
- entryContainer.title = entry.title;
29068
+ if (!entry) {
29069
+ throw new Error('entry not found');
28652
29070
  }
28653
29071
 
28654
- return entryContainer;
28655
- };
28656
-
28657
-
28658
- /**
28659
- * Set up listener to close popup automatically on certain events.
28660
- */
28661
- PopupMenu.prototype._bindAutoClose = function() {
28662
- this._eventBus.once(CLOSE_EVENTS, this.close, this);
28663
- };
28664
-
28665
-
28666
- /**
28667
- * Remove the auto-closing listener.
28668
- */
28669
- PopupMenu.prototype._unbindAutoClose = function() {
28670
- this._eventBus.off(CLOSE_EVENTS, this.close, this);
29072
+ return entry;
28671
29073
  };
28672
29074
 
28673
-
28674
-
28675
- // helpers /////////////////////////////
28676
-
28677
- function setTransform(element, transform) {
28678
- element.style['transform-origin'] = 'top left';
28679
-
28680
- [ '', '-ms-', '-webkit-' ].forEach(function(prefix) {
28681
- element.style[prefix + 'transform'] = transform;
28682
- });
28683
- }
28684
-
28685
29075
  var PopupMenuModule$1 = {
28686
29076
  __init__: [ 'popupMenu' ],
28687
29077
  popupMenu: [ 'type', PopupMenu ]
@@ -28768,18 +29158,13 @@
28768
29158
  AlignElementsContextPadProvider.prototype._getMenuPosition = function(elements) {
28769
29159
  var Y_OFFSET = 5;
28770
29160
 
28771
- var diagramContainer = this._canvas.getContainer(),
28772
- pad = this._contextPad.getPad(elements).html;
29161
+ var pad = this._contextPad.getPad(elements).html;
28773
29162
 
28774
- var diagramRect = diagramContainer.getBoundingClientRect(),
28775
- padRect = pad.getBoundingClientRect();
28776
-
28777
- var top = padRect.top - diagramRect.top;
28778
- var left = padRect.left - diagramRect.left;
29163
+ var padRect = pad.getBoundingClientRect();
28779
29164
 
28780
29165
  var pos = {
28781
- x: left,
28782
- y: top + padRect.height + Y_OFFSET
29166
+ x: padRect.left,
29167
+ y: padRect.bottom + Y_OFFSET
28783
29168
  };
28784
29169
 
28785
29170
  return pos;
@@ -28867,7 +29252,7 @@
28867
29252
 
28868
29253
  RuleProvider.$inject = [ 'eventBus' ];
28869
29254
 
28870
- e(RuleProvider, CommandInterceptor);
29255
+ e$3(RuleProvider, CommandInterceptor);
28871
29256
 
28872
29257
 
28873
29258
  /**
@@ -28944,7 +29329,7 @@
28944
29329
 
28945
29330
  BpmnAlignElements.$inject = [ 'eventBus' ];
28946
29331
 
28947
- e(BpmnAlignElements, RuleProvider);
29332
+ e$3(BpmnAlignElements, RuleProvider);
28948
29333
 
28949
29334
  BpmnAlignElements.prototype.init = function() {
28950
29335
  this.addRule('elements.align', function(context) {
@@ -29664,7 +30049,7 @@
29664
30049
  'rules'
29665
30050
  ];
29666
30051
 
29667
- e(AutoResize, CommandInterceptor);
30052
+ e$3(AutoResize, CommandInterceptor);
29668
30053
 
29669
30054
 
29670
30055
  /**
@@ -29844,7 +30229,7 @@
29844
30229
  'injector'
29845
30230
  ];
29846
30231
 
29847
- e(BpmnAutoResize, AutoResize);
30232
+ e$3(BpmnAutoResize, AutoResize);
29848
30233
 
29849
30234
 
29850
30235
  /**
@@ -29879,7 +30264,7 @@
29879
30264
 
29880
30265
  AutoResizeProvider.$inject = [ 'eventBus' ];
29881
30266
 
29882
- e(AutoResizeProvider, RuleProvider);
30267
+ e$3(AutoResizeProvider, RuleProvider);
29883
30268
 
29884
30269
  /**
29885
30270
  * Needs to be implemented by sub classes to allow actual auto resize
@@ -29902,7 +30287,7 @@
29902
30287
  this._modeling = modeling;
29903
30288
  }
29904
30289
 
29905
- e(BpmnAutoResizeProvider, AutoResizeProvider);
30290
+ e$3(BpmnAutoResizeProvider, AutoResizeProvider);
29906
30291
 
29907
30292
  BpmnAutoResizeProvider.$inject = [
29908
30293
  'eventBus',
@@ -30370,7 +30755,7 @@
30370
30755
 
30371
30756
  function checkCancel(event) {
30372
30757
 
30373
- if (event.which === 27) {
30758
+ if (isKey('Escape', event)) {
30374
30759
  preventDefault$1(event);
30375
30760
 
30376
30761
  cancel();
@@ -38214,7 +38599,6 @@
38214
38599
  connect = this._connect,
38215
38600
  create = this._create,
38216
38601
  popupMenu = this._popupMenu,
38217
- canvas = this._canvas,
38218
38602
  rules = this._rules,
38219
38603
  autoPlace = this._autoPlace,
38220
38604
  translate = this._translate;
@@ -38239,18 +38623,13 @@
38239
38623
 
38240
38624
  var Y_OFFSET = 5;
38241
38625
 
38242
- var diagramContainer = canvas.getContainer(),
38243
- pad = contextPad.getPad(element).html;
38626
+ var pad = contextPad.getPad(element).html;
38244
38627
 
38245
- var diagramRect = diagramContainer.getBoundingClientRect(),
38246
- padRect = pad.getBoundingClientRect();
38247
-
38248
- var top = padRect.top - diagramRect.top;
38249
- var left = padRect.left - diagramRect.left;
38628
+ var padRect = pad.getBoundingClientRect();
38250
38629
 
38251
38630
  var pos = {
38252
- x: left,
38253
- y: top + padRect.height + Y_OFFSET
38631
+ x: padRect.left,
38632
+ y: padRect.bottom + Y_OFFSET
38254
38633
  };
38255
38634
 
38256
38635
  return pos;
@@ -38473,7 +38852,11 @@
38473
38852
  cursor: { x: event.x, y: event.y }
38474
38853
  });
38475
38854
 
38476
- popupMenu.open(element, 'bpmn-replace', position);
38855
+ popupMenu.open(element, 'bpmn-replace', position, {
38856
+ title: translate('Change element'),
38857
+ width: 300,
38858
+ search: true
38859
+ });
38477
38860
  }
38478
38861
  }
38479
38862
  }
@@ -38828,7 +39211,7 @@
38828
39211
 
38829
39212
  BpmnDistributeElements.$inject = [ 'distributeElements', 'eventBus', 'rules' ];
38830
39213
 
38831
- e(BpmnDistributeElements, RuleProvider);
39214
+ e$3(BpmnDistributeElements, RuleProvider);
38832
39215
 
38833
39216
  BpmnDistributeElements.prototype.init = function() {
38834
39217
  this.addRule('elements.distribute', function(context) {
@@ -39220,7 +39603,7 @@
39220
39603
  injector.invoke(EditorActions, this);
39221
39604
  }
39222
39605
 
39223
- e(BpmnEditorActions, EditorActions);
39606
+ e$3(BpmnEditorActions, EditorActions);
39224
39607
 
39225
39608
  BpmnEditorActions.$inject = [
39226
39609
  'injector'
@@ -39782,7 +40165,7 @@
39782
40165
  'modeling'
39783
40166
  ];
39784
40167
 
39785
- e(ResizeBehavior$1, CommandInterceptor);
40168
+ e$3(ResizeBehavior$1, CommandInterceptor);
39786
40169
 
39787
40170
  /**
39788
40171
  * Snap width and height in relation to center.
@@ -40105,7 +40488,7 @@
40105
40488
  'modeling'
40106
40489
  ];
40107
40490
 
40108
- e(GridSnappingLayoutConnectionBehavior, CommandInterceptor);
40491
+ e$3(GridSnappingLayoutConnectionBehavior, CommandInterceptor);
40109
40492
 
40110
40493
  /**
40111
40494
  * Snap middle segments of a given connection.
@@ -40349,7 +40732,7 @@
40349
40732
  injector.invoke(KeyboardBindings, this);
40350
40733
  }
40351
40734
 
40352
- e(BpmnKeyboardBindings, KeyboardBindings);
40735
+ e$3(BpmnKeyboardBindings, KeyboardBindings);
40353
40736
 
40354
40737
  BpmnKeyboardBindings.$inject = [
40355
40738
  'injector'
@@ -41881,7 +42264,7 @@
41881
42264
 
41882
42265
  }
41883
42266
 
41884
- e(AdaptiveLabelPositioningBehavior, CommandInterceptor);
42267
+ e$3(AdaptiveLabelPositioningBehavior, CommandInterceptor);
41885
42268
 
41886
42269
  AdaptiveLabelPositioningBehavior.$inject = [
41887
42270
  'eventBus',
@@ -42024,7 +42407,7 @@
42024
42407
  }, true);
42025
42408
  }
42026
42409
 
42027
- e(AppendBehavior, CommandInterceptor);
42410
+ e$3(AppendBehavior, CommandInterceptor);
42028
42411
 
42029
42412
  AppendBehavior.$inject = [
42030
42413
  'eventBus',
@@ -42049,7 +42432,7 @@
42049
42432
  }, true);
42050
42433
  }
42051
42434
 
42052
- e(AssociationBehavior, CommandInterceptor);
42435
+ e$3(AssociationBehavior, CommandInterceptor);
42053
42436
 
42054
42437
  AssociationBehavior.$inject = [
42055
42438
  'injector',
@@ -42113,7 +42496,7 @@
42113
42496
  'injector'
42114
42497
  ];
42115
42498
 
42116
- e(AttachEventBehavior, CommandInterceptor);
42499
+ e$3(AttachEventBehavior, CommandInterceptor);
42117
42500
 
42118
42501
  AttachEventBehavior.prototype.replaceShape = function(shape, host) {
42119
42502
  var eventDefinition = getEventDefinition$1(shape);
@@ -42200,7 +42583,7 @@
42200
42583
  'modeling'
42201
42584
  ];
42202
42585
 
42203
- e(BoundaryEventBehavior, CommandInterceptor);
42586
+ e$3(BoundaryEventBehavior, CommandInterceptor);
42204
42587
 
42205
42588
  function CreateBehavior(injector) {
42206
42589
  injector.invoke(CommandInterceptor, this);
@@ -42220,7 +42603,7 @@
42220
42603
 
42221
42604
  CreateBehavior.$inject = [ 'injector' ];
42222
42605
 
42223
- e(CreateBehavior, CommandInterceptor);
42606
+ e$3(CreateBehavior, CommandInterceptor);
42224
42607
 
42225
42608
  /**
42226
42609
  * BPMN specific create data object behavior
@@ -42252,7 +42635,7 @@
42252
42635
  'moddle'
42253
42636
  ];
42254
42637
 
42255
- e(CreateDataObjectBehavior, CommandInterceptor);
42638
+ e$3(CreateDataObjectBehavior, CommandInterceptor);
42256
42639
 
42257
42640
  var HORIZONTAL_PARTICIPANT_PADDING = 20,
42258
42641
  VERTICAL_PARTICIPANT_PADDING = 20;
@@ -42426,7 +42809,7 @@
42426
42809
  'modeling'
42427
42810
  ];
42428
42811
 
42429
- e(CreateParticipantBehavior, CommandInterceptor);
42812
+ e$3(CreateParticipantBehavior, CommandInterceptor);
42430
42813
 
42431
42814
  // helpers //////////
42432
42815
 
@@ -42588,7 +42971,7 @@
42588
42971
  'bpmnFactory'
42589
42972
  ];
42590
42973
 
42591
- e(DataInputAssociationBehavior, CommandInterceptor);
42974
+ e$3(DataInputAssociationBehavior, CommandInterceptor);
42592
42975
 
42593
42976
 
42594
42977
  /**
@@ -42813,7 +43196,7 @@
42813
43196
  'eventBus',
42814
43197
  ];
42815
43198
 
42816
- e(DataStoreBehavior, CommandInterceptor);
43199
+ e$3(DataStoreBehavior, CommandInterceptor);
42817
43200
 
42818
43201
 
42819
43202
  // helpers //////////
@@ -42940,7 +43323,7 @@
42940
43323
  'spaceTool'
42941
43324
  ];
42942
43325
 
42943
- e(DeleteLaneBehavior, CommandInterceptor);
43326
+ e$3(DeleteLaneBehavior, CommandInterceptor);
42944
43327
 
42945
43328
  var LOW_PRIORITY$b = 500;
42946
43329
 
@@ -42988,7 +43371,7 @@
42988
43371
  'injector'
42989
43372
  ];
42990
43373
 
42991
- e(DetachEventBehavior, CommandInterceptor);
43374
+ e$3(DetachEventBehavior, CommandInterceptor);
42992
43375
 
42993
43376
  DetachEventBehavior.prototype.replaceShape = function(shape) {
42994
43377
  var eventDefinition = getEventDefinition(shape),
@@ -43194,7 +43577,7 @@
43194
43577
  }, true);
43195
43578
  }
43196
43579
 
43197
- e(DropOnFlowBehavior, CommandInterceptor);
43580
+ e$3(DropOnFlowBehavior, CommandInterceptor);
43198
43581
 
43199
43582
  DropOnFlowBehavior.$inject = [
43200
43583
  'eventBus',
@@ -43302,7 +43685,7 @@
43302
43685
  'modeling'
43303
43686
  ];
43304
43687
 
43305
- e(EventBasedGatewayBehavior, CommandInterceptor);
43688
+ e$3(EventBasedGatewayBehavior, CommandInterceptor);
43306
43689
 
43307
43690
  // helpers //////////
43308
43691
 
@@ -43792,7 +44175,7 @@
43792
44175
  'moddleCopy'
43793
44176
  ];
43794
44177
 
43795
- e(GroupBehavior, CommandInterceptor);
44178
+ e$3(GroupBehavior, CommandInterceptor);
43796
44179
 
43797
44180
  /**
43798
44181
  * Returns the intersection between two line segments a and b.
@@ -43937,7 +44320,7 @@
43937
44320
 
43938
44321
  IsHorizontalFix.$inject = [ 'eventBus' ];
43939
44322
 
43940
- e(IsHorizontalFix, CommandInterceptor);
44323
+ e$3(IsHorizontalFix, CommandInterceptor);
43941
44324
 
43942
44325
  var sqrt = Math.sqrt,
43943
44326
  min$1 = Math.min,
@@ -44775,7 +45158,7 @@
44775
45158
 
44776
45159
  }
44777
45160
 
44778
- e(LabelBehavior, CommandInterceptor);
45161
+ e$3(LabelBehavior, CommandInterceptor);
44779
45162
 
44780
45163
  LabelBehavior.$inject = [
44781
45164
  'eventBus',
@@ -45011,7 +45394,7 @@
45011
45394
 
45012
45395
  }
45013
45396
 
45014
- e(LayoutConnectionBehavior, CommandInterceptor);
45397
+ e$3(LayoutConnectionBehavior, CommandInterceptor);
45015
45398
 
45016
45399
  LayoutConnectionBehavior.$inject = [
45017
45400
  'eventBus',
@@ -45154,7 +45537,7 @@
45154
45537
 
45155
45538
  MessageFlowBehavior.$inject = [ 'eventBus', 'modeling' ];
45156
45539
 
45157
- e(MessageFlowBehavior, CommandInterceptor);
45540
+ e$3(MessageFlowBehavior, CommandInterceptor);
45158
45541
 
45159
45542
  // helpers //////////
45160
45543
 
@@ -45251,7 +45634,7 @@
45251
45634
  }, true);
45252
45635
  }
45253
45636
 
45254
- e(RemoveEmbeddedLabelBoundsBehavior, CommandInterceptor);
45637
+ e$3(RemoveEmbeddedLabelBoundsBehavior, CommandInterceptor);
45255
45638
 
45256
45639
  RemoveEmbeddedLabelBoundsBehavior.$inject = [
45257
45640
  'eventBus',
@@ -45295,7 +45678,7 @@
45295
45678
 
45296
45679
  }
45297
45680
 
45298
- e(RemoveElementBehavior, CommandInterceptor);
45681
+ e$3(RemoveElementBehavior, CommandInterceptor);
45299
45682
 
45300
45683
  RemoveElementBehavior.$inject = [
45301
45684
  'eventBus',
@@ -45372,7 +45755,7 @@
45372
45755
 
45373
45756
  RemoveParticipantBehavior.$inject = [ 'eventBus', 'modeling' ];
45374
45757
 
45375
- e(RemoveParticipantBehavior, CommandInterceptor);
45758
+ e$3(RemoveParticipantBehavior, CommandInterceptor);
45376
45759
 
45377
45760
  function ReplaceConnectionBehavior(eventBus, modeling, bpmnRules, injector) {
45378
45761
 
@@ -45537,7 +45920,7 @@
45537
45920
  });
45538
45921
  }
45539
45922
 
45540
- e(ReplaceConnectionBehavior, CommandInterceptor);
45923
+ e$3(ReplaceConnectionBehavior, CommandInterceptor);
45541
45924
 
45542
45925
  ReplaceConnectionBehavior.$inject = [
45543
45926
  'eventBus',
@@ -45634,7 +46017,7 @@
45634
46017
  });
45635
46018
  }
45636
46019
 
45637
- e(ReplaceElementBehaviour, CommandInterceptor);
46020
+ e$3(ReplaceElementBehaviour, CommandInterceptor);
45638
46021
 
45639
46022
  ReplaceElementBehaviour.prototype.replaceElements = function(elements, newElements) {
45640
46023
  var elementRegistry = this._elementRegistry,
@@ -46031,7 +46414,7 @@
46031
46414
  'bpmnFactory'
46032
46415
  ];
46033
46416
 
46034
- e(RootElementReferenceBehavior, CommandInterceptor);
46417
+ e$3(RootElementReferenceBehavior, CommandInterceptor);
46035
46418
 
46036
46419
  // helpers //////////
46037
46420
 
@@ -46534,7 +46917,7 @@
46534
46917
 
46535
46918
  }
46536
46919
 
46537
- e(SubProcessPlaneBehavior, CommandInterceptor);
46920
+ e$3(SubProcessPlaneBehavior, CommandInterceptor);
46538
46921
 
46539
46922
  /**
46540
46923
  * Moves the child elements from source to target.
@@ -46741,7 +47124,7 @@
46741
47124
  'modeling'
46742
47125
  ];
46743
47126
 
46744
- e(SubProcessStartEventBehavior, CommandInterceptor);
47127
+ e$3(SubProcessStartEventBehavior, CommandInterceptor);
46745
47128
 
46746
47129
  // helpers //////////
46747
47130
 
@@ -46803,7 +47186,7 @@
46803
47186
 
46804
47187
  }
46805
47188
 
46806
- e(ToggleCollapseConnectionBehaviour, CommandInterceptor);
47189
+ e$3(ToggleCollapseConnectionBehaviour, CommandInterceptor);
46807
47190
 
46808
47191
  ToggleCollapseConnectionBehaviour.$inject = [
46809
47192
  'eventBus',
@@ -46929,7 +47312,7 @@
46929
47312
  }
46930
47313
 
46931
47314
 
46932
- e(ToggleElementCollapseBehaviour, CommandInterceptor);
47315
+ e$3(ToggleElementCollapseBehaviour, CommandInterceptor);
46933
47316
 
46934
47317
  ToggleElementCollapseBehaviour.$inject = [
46935
47318
  'eventBus',
@@ -46992,7 +47375,7 @@
46992
47375
  });
46993
47376
  }
46994
47377
 
46995
- e(UnclaimIdBehavior, CommandInterceptor);
47378
+ e$3(UnclaimIdBehavior, CommandInterceptor);
46996
47379
 
46997
47380
  UnclaimIdBehavior.$inject = [ 'canvas', 'injector', 'moddle', 'modeling' ];
46998
47381
 
@@ -47022,7 +47405,7 @@
47022
47405
  });
47023
47406
  }
47024
47407
 
47025
- e(DeleteSequenceFlowBehavior, CommandInterceptor);
47408
+ e$3(DeleteSequenceFlowBehavior, CommandInterceptor);
47026
47409
 
47027
47410
  DeleteSequenceFlowBehavior.$inject = [
47028
47411
  'eventBus',
@@ -47166,7 +47549,7 @@
47166
47549
  'translate'
47167
47550
  ];
47168
47551
 
47169
- e(UpdateFlowNodeRefsBehavior, CommandInterceptor);
47552
+ e$3(UpdateFlowNodeRefsBehavior, CommandInterceptor);
47170
47553
 
47171
47554
 
47172
47555
  function UpdateContext() {
@@ -47294,7 +47677,7 @@
47294
47677
  RuleProvider.call(this, eventBus);
47295
47678
  }
47296
47679
 
47297
- e(BpmnRules, RuleProvider);
47680
+ e$3(BpmnRules, RuleProvider);
47298
47681
 
47299
47682
  BpmnRules.$inject = [ 'eventBus' ];
47300
47683
 
@@ -48314,7 +48697,7 @@
48314
48697
  return null;
48315
48698
  };
48316
48699
 
48317
- e(OrderingProvider, CommandInterceptor);
48700
+ e$3(OrderingProvider, CommandInterceptor);
48318
48701
 
48319
48702
  /**
48320
48703
  * a simple ordering provider that makes sure:
@@ -48482,7 +48865,7 @@
48482
48865
 
48483
48866
  BpmnOrderingProvider.$inject = [ 'eventBus', 'canvas', 'translate' ];
48484
48867
 
48485
- e(BpmnOrderingProvider, OrderingProvider);
48868
+ e$3(BpmnOrderingProvider, OrderingProvider);
48486
48869
 
48487
48870
  var OrderingModule = {
48488
48871
  __depends__: [
@@ -49645,7 +50028,7 @@
49645
50028
  'injector'
49646
50029
  ];
49647
50030
 
49648
- e(BpmnSpaceTool, SpaceTool);
50031
+ e$3(BpmnSpaceTool, SpaceTool);
49649
50032
 
49650
50033
  BpmnSpaceTool.prototype.calculateAdjustments = function(elements, axis, delta, start) {
49651
50034
  var adjustments = SpaceTool.prototype.calculateAdjustments.call(this, elements, axis, delta, start);
@@ -50703,7 +51086,7 @@
50703
51086
 
50704
51087
  }
50705
51088
 
50706
- e(LabelSupport, CommandInterceptor);
51089
+ e$3(LabelSupport, CommandInterceptor);
50707
51090
 
50708
51091
  LabelSupport.$inject = [
50709
51092
  'injector',
@@ -50980,7 +51363,7 @@
50980
51363
  });
50981
51364
  }
50982
51365
 
50983
- e(AttachSupport, CommandInterceptor);
51366
+ e$3(AttachSupport, CommandInterceptor);
50984
51367
 
50985
51368
  AttachSupport.$inject = [
50986
51369
  'injector',
@@ -51417,7 +51800,7 @@
51417
51800
  this.reverted([ 'element.updateAttachment' ], ifBpmn(updateAttachment));
51418
51801
  }
51419
51802
 
51420
- e(BpmnUpdater, CommandInterceptor);
51803
+ e$3(BpmnUpdater, CommandInterceptor);
51421
51804
 
51422
51805
  BpmnUpdater.$inject = [
51423
51806
  'eventBus',
@@ -51915,7 +52298,7 @@
51915
52298
  this._translate = translate;
51916
52299
  }
51917
52300
 
51918
- e(ElementFactory, ElementFactory$1);
52301
+ e$3(ElementFactory, ElementFactory$1);
51919
52302
 
51920
52303
  ElementFactory.$inject = [
51921
52304
  'bpmnFactory',
@@ -52533,7 +52916,7 @@
52533
52916
  CreateShapeHandler.call(this, canvas);
52534
52917
  }
52535
52918
 
52536
- e(CreateLabelHandler, CreateShapeHandler);
52919
+ e$3(CreateLabelHandler, CreateShapeHandler);
52537
52920
 
52538
52921
  CreateLabelHandler.$inject = [ 'canvas' ];
52539
52922
 
@@ -55699,7 +56082,7 @@
55699
56082
  this._bpmnRules = bpmnRules;
55700
56083
  }
55701
56084
 
55702
- e(Modeling, Modeling$1);
56085
+ e$3(Modeling, Modeling$1);
55703
56086
 
55704
56087
  Modeling.$inject = [
55705
56088
  'eventBus',
@@ -56654,7 +57037,7 @@
56654
57037
 
56655
57038
  function BpmnLayouter() {}
56656
57039
 
56657
- e(BpmnLayouter, BaseLayouter);
57040
+ e$3(BpmnLayouter, BaseLayouter);
56658
57041
 
56659
57042
 
56660
57043
  BpmnLayouter.prototype.layoutConnection = function(connection, hints) {
@@ -58484,7 +58867,7 @@
58484
58867
  // helpers //////////
58485
58868
 
58486
58869
  function isSpace(keyEvent) {
58487
- return isKey(' ', keyEvent);
58870
+ return isKey('Space', keyEvent);
58488
58871
  }
58489
58872
 
58490
58873
  var HandToolModule = {
@@ -58956,7 +59339,7 @@
58956
59339
  'previewSupport'
58957
59340
  ];
58958
59341
 
58959
- e(BpmnReplacePreview, CommandInterceptor);
59342
+ e$3(BpmnReplacePreview, CommandInterceptor);
58960
59343
 
58961
59344
  var ReplacePreviewModule = {
58962
59345
  __depends__: [
@@ -59551,7 +59934,7 @@
59551
59934
  });
59552
59935
  }
59553
59936
 
59554
- e(BpmnCreateMoveSnapping, CreateMoveSnapping);
59937
+ e$3(BpmnCreateMoveSnapping, CreateMoveSnapping);
59555
59938
 
59556
59939
  BpmnCreateMoveSnapping.$inject = [
59557
59940
  'eventBus',
@@ -60135,13 +60518,11 @@
60135
60518
  // navigate results
60136
60519
  listen(this._container, SearchPad.INPUT_SELECTOR, 'keydown', function(e) {
60137
60520
 
60138
- // up
60139
- if (e.keyCode === 38) {
60521
+ if (isKey('ArrowUp', e)) {
60140
60522
  e.preventDefault();
60141
60523
  }
60142
60524
 
60143
- // down
60144
- if (e.keyCode === 40) {
60525
+ if (isKey('ArrowDown', e)) {
60145
60526
  e.preventDefault();
60146
60527
  }
60147
60528
  });
@@ -60149,31 +60530,26 @@
60149
60530
  // handle keyboard input
60150
60531
  listen(this._container, SearchPad.INPUT_SELECTOR, 'keyup', function(e) {
60151
60532
 
60152
- // escape
60153
- if (e.keyCode === 27) {
60533
+ if (isKey('Escape', e)) {
60154
60534
  return self.close();
60155
60535
  }
60156
60536
 
60157
- // enter
60158
- if (e.keyCode === 13) {
60537
+ if (isKey('Enter', e)) {
60159
60538
  var selected = self._getCurrentResult();
60160
60539
 
60161
60540
  return selected ? self._select(selected) : self.close();
60162
60541
  }
60163
60542
 
60164
- // up
60165
- if (e.keyCode === 38) {
60543
+ if (isKey('ArrowUp', e)) {
60166
60544
  return self._scrollToDirection(true);
60167
60545
  }
60168
60546
 
60169
- // down
60170
- if (e.keyCode === 40) {
60547
+ if (isKey('ArrowDown', e)) {
60171
60548
  return self._scrollToDirection();
60172
60549
  }
60173
60550
 
60174
- // left && right
60175
60551
  // do not search while navigating text input
60176
- if (e.keyCode === 37 || e.keyCode === 39) {
60552
+ if (isKey([ 'ArrowLeft', 'ArrowRight' ], e)) {
60177
60553
  return;
60178
60554
  }
60179
60555
 
@@ -60808,7 +61184,7 @@
60808
61184
  BaseModeler.call(this, options);
60809
61185
  }
60810
61186
 
60811
- e(Modeler, BaseModeler);
61187
+ e$3(Modeler, BaseModeler);
60812
61188
 
60813
61189
 
60814
61190
  Modeler.Viewer = Viewer;