camunda-bpmn-js 0.13.0-alpha.5 → 0.13.0-alpha.6

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.
@@ -61535,31 +61535,130 @@
61535
61535
  }());
61536
61536
  });
61537
61537
 
61538
+ function C$1(n,t){for(var e in t)n[e]=t[e];return n}function S$1(n,t){for(var e in n)if("__source"!==e&&!(e in t))return !0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return !0;return !1}function E(n){this.props=n;}function g$2(n,t){function e(n){var e=this.props.ref,r=e==n.ref;return !r&&e&&(e.call?e(null):e.current=null),t?!t(this.props,n)||!r:S$1(this.props,n)}function r(t){return this.shouldComponentUpdate=e,a(n,t)}return r.displayName="Memo("+(n.displayName||n.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(E.prototype=new p).isPureReactComponent=!0,E.prototype.shouldComponentUpdate=function(n,t){return S$1(this.props,n)||S$1(this.state,t)};var w$2=n.__b;n.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),w$2&&w$2(n);};var R="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function x$2(n){function t(t,e){var r=C$1({},t);return delete r.ref,n(r,(e=t.ref||e)&&("object"!=typeof e||"current"in e)?e:null)}return t.$$typeof=R,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var N$1=function(n,t){return null==n?null:w(w(n).map(t))},k$2={map:N$1,forEach:N$1,count:function(n){return n?w(n).length:0},only:function(n){var t=w(n);if(1!==t.length)throw "Children.only";return t[0]},toArray:w},A$2=n.__e;n.__e=function(n,t,e){if(n.then)for(var r,u=t;u=u.__;)if((r=u.__c)&&r.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),r.__c(n,t);A$2(n,t,e);};var O$1=n.unmount;function L$1(){this.__u=0,this.t=null,this.__b=null;}function U(n){var t=n.__.__c;return t&&t.__e&&t.__e(n)}function D(n){var t,e,r;function u(u){if(t||(t=n()).then(function(n){e=n.default||n;},function(n){r=n;}),r)throw r;if(!e)throw t;return a(e,u)}return u.displayName="Lazy",u.__f=!0,u}function F$1(){this.u=null,this.o=null;}n.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),O$1&&O$1(n);},(L$1.prototype=new p).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=U(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__e){var n=r.state.__e;r.__v.__k[0]=function n(t,e,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)}),t.__c&&t.__c.__P===e&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate();}},f=!0===t.__h;r.__u++||f||r.setState({__e:r.__b=r.__v.__k[0]}),n.then(i,i);},L$1.prototype.componentWillUnmount=function(){this.t=[];},L$1.prototype.render=function(n,t){if(this.__b){if(this.__v.__k){var e=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function n(t,e,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),t.__c.__H=null),null!=(t=C$1({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)})),t}(this.__b,e,r.__O=r.__P);}this.__b=null;}var u=t.__e&&a(y,null,n.fallback);return u&&(u.__h=null),[a(y,null,t.__e?null:n.children),u]};var M$1=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2];}};function T$2(n){return this.getChildContext=function(){return n.context},n.children}function j$2(n){var t=this,e=n.i;t.componentWillUnmount=function(){N(null,t.l),t.l=null,t.i=null;},t.i&&t.i!==e&&t.componentWillUnmount(),n.__v?(t.l||(t.i=e,t.l={nodeType:1,parentNode:e,childNodes:[],appendChild:function(n){this.childNodes.push(n),t.i.appendChild(n);},insertBefore:function(n,e){this.childNodes.push(n),t.i.appendChild(n);},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),t.i.removeChild(n);}}),N(a(T$2,{context:t.context},n.__v),t.l)):t.l&&t.componentWillUnmount();}function I$1(n,t){return a(j$2,{__v:n,i:t})}(F$1.prototype=new p).__e=function(n){var t=this,e=U(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),M$1(t,n,r)):u();};e?e(o):o();}},F$1.prototype.render=function(n){this.u=null,this.o=new Map;var t=w(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},F$1.prototype.componentDidUpdate=F$1.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){M$1(n,e,t);});};var W="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,P$1=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,V=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(n)};function z$1(n,t,e){return null==t.__k&&(t.textContent=""),N(n,t),"function"==typeof e&&e(),n?n.__c:null}function B(n,t,e){return O(n,t),"function"==typeof e&&e(),n?n.__c:null}p.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(p.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t});}});});var H$1=n.event;function Z(){}function Y(){return this.cancelBubble}function $$1(){return this.defaultPrevented}n.event=function(n){return H$1&&(n=H$1(n)),n.persist=Z,n.isPropagationStopped=Y,n.isDefaultPrevented=$$1,n.nativeEvent=n};var q$1,G={configurable:!0,get:function(){return this.class}},J=n.vnode;n.vnode=function(n){var t=n.type,e=n.props,r=e;if("string"==typeof t){for(var u in r={},e){var o=e[u];"value"===u&&"defaultValue"in e&&null==o||("defaultValue"===u&&"value"in e&&null==e.value?u="value":"download"===u&&!0===o?o="":/ondoubleclick/i.test(u)?u="ondblclick":/^onchange(textarea|input)/i.test(u+t)&&!V(e.type)?u="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(u)?u=u.toLowerCase():P$1.test(u)?u=u.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===o&&(o=void 0),r[u]=o);}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=w(e.children).forEach(function(n){n.props.selected=-1!=r.value.indexOf(n.props.value);})),"select"==t&&null!=r.defaultValue&&(r.value=w(e.children).forEach(function(n){n.props.selected=r.multiple?-1!=r.defaultValue.indexOf(n.props.value):r.defaultValue==n.props.value;})),n.props=r;}t&&e.class!=e.className&&(G.enumerable="className"in e,null!=e.className&&(r.class=e.className),Object.defineProperty(r,"className",G)),n.$$typeof=W,J&&J(n);};var K=n.__r;n.__r=function(n){K&&K(n),q$1=n.__c;};var Q={ReactCurrentDispatcher:{current:{readContext:function(n){return q$1.__n[n.__c].props.value}}}};"object"==typeof performance&&"function"==typeof performance.now?performance.now.bind(performance):function(){return Date.now()};function fn(n){return a.bind(null,n)}function cn(n){return !!n&&n.$$typeof===W}function an(n){return cn(n)?S.apply(null,arguments):n}function sn(n){return !!n.__k&&(N(null,n),!0)}function hn(n){return n&&(n.base||1===n.nodeType&&n)||null}var pn=function(n,t){return n(t)};var React = {useState:l,useReducer:p$1,useEffect:y$1,useLayoutEffect:h$1,useRef:s$1,useImperativeHandle:_$1,useMemo:d$1,useCallback:A$1,useContext:F,useDebugValue:T$1,version:"16.8.0",Children:k$2,render:z$1,hydrate:B,unmountComponentAtNode:sn,createPortal:I$1,createElement:a,createContext:q,createFactory:fn,cloneElement:an,createRef:h,Fragment:y,isValidElement:cn,findDOMNode:hn,Component:p,PureComponent:E,memo:g$2,forwardRef:x$2,unstable_batchedUpdates:pn,StrictMode:y,Suspense:L$1,SuspenseList:F$1,lazy:D,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Q};
61539
+
61538
61540
  function o$2(_,o,e,n$1,t){var f={};for(var l in o)"ref"!=l&&(f[l]=o[l]);var s,u,a={type:_,props:f,key:e,ref:o&&o.ref,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:++n.__v,__source:n$1,__self:t};if("function"==typeof _&&(s=_.defaultProps))for(u in s)void 0===f[u]&&(f[u]=s[u]);return n.vnode&&n.vnode(a),a}
61539
61541
 
61540
- function C$1(n,t){for(var e in t)n[e]=t[e];return n}function S$1(n,t){for(var e in n)if("__source"!==e&&!(e in t))return !0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return !0;return !1}function E(n){this.props=n;}function g$2(n,t){function e(n){var e=this.props.ref,r=e==n.ref;return !r&&e&&(e.call?e(null):e.current=null),t?!t(this.props,n)||!r:S$1(this.props,n)}function r(t){return this.shouldComponentUpdate=e,a(n,t)}return r.displayName="Memo("+(n.displayName||n.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(E.prototype=new p).isPureReactComponent=!0,E.prototype.shouldComponentUpdate=function(n,t){return S$1(this.props,n)||S$1(this.state,t)};var w$2=n.__b;n.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),w$2&&w$2(n);};var R="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function x$2(n){function t(t,e){var r=C$1({},t);return delete r.ref,n(r,(e=t.ref||e)&&("object"!=typeof e||"current"in e)?e:null)}return t.$$typeof=R,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var N$1=function(n,t){return null==n?null:w(w(n).map(t))},k$2={map:N$1,forEach:N$1,count:function(n){return n?w(n).length:0},only:function(n){var t=w(n);if(1!==t.length)throw "Children.only";return t[0]},toArray:w},A$2=n.__e;n.__e=function(n,t,e){if(n.then)for(var r,u=t;u=u.__;)if((r=u.__c)&&r.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),r.__c(n,t);A$2(n,t,e);};var O$1=n.unmount;function L$1(){this.__u=0,this.t=null,this.__b=null;}function U(n){var t=n.__.__c;return t&&t.__e&&t.__e(n)}function D(n){var t,e,r;function u(u){if(t||(t=n()).then(function(n){e=n.default||n;},function(n){r=n;}),r)throw r;if(!e)throw t;return a(e,u)}return u.displayName="Lazy",u.__f=!0,u}function F$1(){this.u=null,this.o=null;}n.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),O$1&&O$1(n);},(L$1.prototype=new p).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=U(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__e){var n=r.state.__e;r.__v.__k[0]=function n(t,e,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)}),t.__c&&t.__c.__P===e&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate();}},f=!0===t.__h;r.__u++||f||r.setState({__e:r.__b=r.__v.__k[0]}),n.then(i,i);},L$1.prototype.componentWillUnmount=function(){this.t=[];},L$1.prototype.render=function(n,t){if(this.__b){if(this.__v.__k){var e=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function n(t,e,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),t.__c.__H=null),null!=(t=C$1({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)})),t}(this.__b,e,r.__O=r.__P);}this.__b=null;}var u=t.__e&&a(y,null,n.fallback);return u&&(u.__h=null),[a(y,null,t.__e?null:n.children),u]};var M$1=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2];}};function T$2(n){return this.getChildContext=function(){return n.context},n.children}function j$2(n){var t=this,e=n.i;t.componentWillUnmount=function(){N(null,t.l),t.l=null,t.i=null;},t.i&&t.i!==e&&t.componentWillUnmount(),n.__v?(t.l||(t.i=e,t.l={nodeType:1,parentNode:e,childNodes:[],appendChild:function(n){this.childNodes.push(n),t.i.appendChild(n);},insertBefore:function(n,e){this.childNodes.push(n),t.i.appendChild(n);},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),t.i.removeChild(n);}}),N(a(T$2,{context:t.context},n.__v),t.l)):t.l&&t.componentWillUnmount();}function I$1(n,t){return a(j$2,{__v:n,i:t})}(F$1.prototype=new p).__e=function(n){var t=this,e=U(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),M$1(t,n,r)):u();};e?e(o):o();}},F$1.prototype.render=function(n){this.u=null,this.o=new Map;var t=w(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},F$1.prototype.componentDidUpdate=F$1.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){M$1(n,e,t);});};var W="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,P$1=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,V=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(n)};function z$1(n,t,e){return null==t.__k&&(t.textContent=""),N(n,t),"function"==typeof e&&e(),n?n.__c:null}function B(n,t,e){return O(n,t),"function"==typeof e&&e(),n?n.__c:null}p.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(p.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t});}});});var H$1=n.event;function Z(){}function Y(){return this.cancelBubble}function $$1(){return this.defaultPrevented}n.event=function(n){return H$1&&(n=H$1(n)),n.persist=Z,n.isPropagationStopped=Y,n.isDefaultPrevented=$$1,n.nativeEvent=n};var q$1,G={configurable:!0,get:function(){return this.class}},J=n.vnode;n.vnode=function(n){var t=n.type,e=n.props,r=e;if("string"==typeof t){for(var u in r={},e){var o=e[u];"value"===u&&"defaultValue"in e&&null==o||("defaultValue"===u&&"value"in e&&null==e.value?u="value":"download"===u&&!0===o?o="":/ondoubleclick/i.test(u)?u="ondblclick":/^onchange(textarea|input)/i.test(u+t)&&!V(e.type)?u="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(u)?u=u.toLowerCase():P$1.test(u)?u=u.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===o&&(o=void 0),r[u]=o);}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=w(e.children).forEach(function(n){n.props.selected=-1!=r.value.indexOf(n.props.value);})),"select"==t&&null!=r.defaultValue&&(r.value=w(e.children).forEach(function(n){n.props.selected=r.multiple?-1!=r.defaultValue.indexOf(n.props.value):r.defaultValue==n.props.value;})),n.props=r;}t&&e.class!=e.className&&(G.enumerable="className"in e,null!=e.className&&(r.class=e.className),Object.defineProperty(r,"className",G)),n.$$typeof=W,J&&J(n);};var K=n.__r;n.__r=function(n){K&&K(n),q$1=n.__c;};var Q={ReactCurrentDispatcher:{current:{readContext:function(n){return q$1.__n[n.__c].props.value}}}};"object"==typeof performance&&"function"==typeof performance.now?performance.now.bind(performance):function(){return Date.now()};function fn(n){return a.bind(null,n)}function cn(n){return !!n&&n.$$typeof===W}function an(n){return cn(n)?S.apply(null,arguments):n}function sn(n){return !!n.__k&&(N(null,n),!0)}function hn(n){return n&&(n.base||1===n.nodeType&&n)||null}var pn=function(n,t){return n(t)};var React = {useState:l,useReducer:p$1,useEffect:y$1,useLayoutEffect:h$1,useRef:s$1,useImperativeHandle:_$1,useMemo:d$1,useCallback:A$1,useContext:F,useDebugValue:T$1,version:"16.8.0",Children:k$2,render:z$1,hydrate:B,unmountComponentAtNode:sn,createPortal:I$1,createElement:a,createContext:q,createFactory:fn,cloneElement:an,createRef:h,Fragment:y,isValidElement:cn,findDOMNode:hn,Component:p,PureComponent:E,memo:g$2,forwardRef:x$2,unstable_batchedUpdates:pn,StrictMode:y,Suspense:L$1,SuspenseList:F$1,lazy:D,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Q};
61542
+ var ArrowIcon = function ArrowIcon(props) {
61543
+ return o$2("svg", { ...props,
61544
+ children: o$2("path", {
61545
+ fillRule: "evenodd",
61546
+ d: "m11.657 8-4.95 4.95a1 1 0 0 1-1.414-1.414L8.828 8 5.293 4.464A1 1 0 1 1 6.707 3.05L11.657 8z"
61547
+ })
61548
+ });
61549
+ };
61541
61550
 
61542
- /**
61543
- * @typedef { { getElementLabel: Function, getTypeLabel: Function, getElementIcon: Function } } HeaderProvider
61544
- */
61551
+ ArrowIcon.defaultProps = {
61552
+ xmlns: "http://www.w3.org/2000/svg",
61553
+ width: "16",
61554
+ height: "16"
61555
+ };
61556
+
61557
+ var CreateIcon = function CreateIcon(props) {
61558
+ return o$2("svg", { ...props,
61559
+ children: o$2("path", {
61560
+ fillRule: "evenodd",
61561
+ d: "M9 13V9h4a1 1 0 0 0 0-2H9V3a1 1 0 1 0-2 0v4H3a1 1 0 1 0 0 2h4v4a1 1 0 0 0 2 0z"
61562
+ })
61563
+ });
61564
+ };
61565
+
61566
+ CreateIcon.defaultProps = {
61567
+ xmlns: "http://www.w3.org/2000/svg",
61568
+ width: "16",
61569
+ height: "16"
61570
+ };
61571
+
61572
+ var DeleteIcon = function DeleteIcon(props) {
61573
+ return o$2("svg", { ...props,
61574
+ children: o$2("path", {
61575
+ fillRule: "evenodd",
61576
+ d: "M12 6v7c0 1.1-.4 1.55-1.5 1.55h-5C4.4 14.55 4 14.1 4 13V6h8zm-1.5 1.5h-5v4.3c0 .66.5 1.2 1.111 1.2H9.39c.611 0 1.111-.54 1.111-1.2V7.5zM13 3h-2l-1-1H6L5 3H3v1.5h10V3z"
61577
+ })
61578
+ });
61579
+ };
61580
+
61581
+ DeleteIcon.defaultProps = {
61582
+ xmlns: "http://www.w3.org/2000/svg",
61583
+ width: "16",
61584
+ height: "16"
61585
+ };
61586
+
61587
+ var ExternalLinkIcon = function ExternalLinkIcon(props) {
61588
+ return o$2("svg", { ...props,
61589
+ children: o$2("path", {
61590
+ fillRule: "evenodd",
61591
+ clipRule: "evenodd",
61592
+ d: "M12.637 12.637v-4.72h1.362v4.721c0 .36-.137.676-.411.95-.275.275-.591.412-.95.412H3.362c-.38 0-.703-.132-.967-.396A1.315 1.315 0 0 1 2 12.638V3.362c0-.38.132-.703.396-.967S2.982 2 3.363 2h4.553v1.363H3.363v9.274h9.274zM14 2H9.28l-.001 1.362h2.408L5.065 9.984l.95.95 6.622-6.622v2.409H14V2z",
61593
+ fill: "#818798"
61594
+ })
61595
+ });
61596
+ };
61597
+
61598
+ ExternalLinkIcon.defaultProps = {
61599
+ width: "16",
61600
+ height: "16",
61601
+ fill: "none",
61602
+ xmlns: "http://www.w3.org/2000/svg"
61603
+ };
61604
+
61605
+ var FeelRequiredIcon = function FeelRequiredIcon(props) {
61606
+ return o$2("svg", { ...props,
61607
+ children: [o$2("path", {
61608
+ d: "M5.8 7.06V5.95h4.307v1.11H5.8zm0 3.071v-1.11h4.307v1.11H5.8z",
61609
+ fill: "#505562"
61610
+ }), o$2("path", {
61611
+ fillRule: "evenodd",
61612
+ clipRule: "evenodd",
61613
+ d: "M8 3.268A4.732 4.732 0 1 0 12.732 8H14a6 6 0 1 1-6-6v1.268z",
61614
+ fill: "#505562"
61615
+ }), o$2("path", {
61616
+ d: "m11.28 6.072-.832-.56 1.016-1.224L10 3.848l.312-.912 1.392.584L11.632 2h1.032l-.072 1.52 1.392-.584.312.912-1.464.44 1.008 1.224-.832.552-.864-1.296-.864 1.304z",
61617
+ fill: "#505562"
61618
+ })]
61619
+ });
61620
+ };
61621
+
61622
+ FeelRequiredIcon.defaultProps = {
61623
+ viewBox: "0 0 16 16",
61624
+ fill: "none",
61625
+ xmlns: "http://www.w3.org/2000/svg"
61626
+ };
61627
+
61628
+ var FeelOptionalIcon = function FeelOptionalIcon(props) {
61629
+ return o$2("svg", { ...props,
61630
+ children: [o$2("path", {
61631
+ d: "M5.845 7.04V5.93h4.307v1.11H5.845zm0 3.07V9h4.307v1.11H5.845z",
61632
+ fill: "#505562"
61633
+ }), o$2("path", {
61634
+ fillRule: "evenodd",
61635
+ clipRule: "evenodd",
61636
+ d: "M3.286 8a4.714 4.714 0 1 0 9.428 0 4.714 4.714 0 0 0-9.428 0zM8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2z",
61637
+ fill: "#505562"
61638
+ })]
61639
+ });
61640
+ };
61641
+
61642
+ FeelOptionalIcon.defaultProps = {
61643
+ viewBox: "0 0 16 16",
61644
+ fill: "none",
61645
+ xmlns: "http://www.w3.org/2000/svg"
61646
+ };
61545
61647
 
61546
- /**
61547
- * @param {Object} props
61548
- * @param {Object} props.element,
61549
- * @param {HeaderProvider} props.headerProvider
61550
- */
61551
61648
  function Header(props) {
61552
61649
  const {
61553
61650
  element,
61554
61651
  headerProvider
61555
61652
  } = props;
61556
61653
  const {
61654
+ getElementIcon,
61655
+ getDocumentationRef,
61557
61656
  getElementLabel,
61558
- getTypeLabel,
61559
- getElementIcon
61657
+ getTypeLabel
61560
61658
  } = headerProvider;
61561
61659
  const label = getElementLabel(element);
61562
61660
  const type = getTypeLabel(element);
61661
+ const documentationRef = getDocumentationRef && getDocumentationRef(element);
61563
61662
  const ElementIcon = getElementIcon(element);
61564
61663
  return o$2("div", {
61565
61664
  class: "bio-properties-panel-header",
@@ -61576,35 +61675,48 @@
61576
61675
  title: type,
61577
61676
  class: "bio-properties-panel-header-type",
61578
61677
  children: type
61579
- }), getElementLabel(element) ? o$2("div", {
61678
+ }), label ? o$2("div", {
61580
61679
  title: label,
61581
61680
  class: "bio-properties-panel-header-label",
61582
61681
  children: label
61583
61682
  }) : null]
61683
+ }), o$2("div", {
61684
+ class: "bio-properties-panel-header-actions",
61685
+ children: documentationRef ? o$2("a", {
61686
+ rel: "noopener",
61687
+ class: "bio-properties-panel-header-link",
61688
+ href: documentationRef,
61689
+ title: "Open documentation",
61690
+ target: "_blank",
61691
+ children: o$2(ExternalLinkIcon, {})
61692
+ }) : null
61584
61693
  })]
61585
61694
  });
61586
61695
  }
61587
61696
 
61588
- /**
61589
- * @pinussilvestrus: we need to introduce our own hook to persist the previous
61590
- * state on updates.
61591
- *
61592
- * cf. https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
61593
- */
61594
-
61595
- function usePrevious(value) {
61596
- const ref = s$1();
61597
- y$1(() => {
61598
- ref.current = value;
61599
- });
61600
- return ref.current;
61601
- }
61602
-
61603
61697
  const DescriptionContext = q({
61604
61698
  description: {},
61605
61699
  getDescriptionForId: () => {}
61606
61700
  });
61607
61701
 
61702
+ /**
61703
+ * @typedef {Function} <propertiesPanel.showEntry> callback
61704
+ *
61705
+ * @example
61706
+ *
61707
+ * useEvent('propertiesPanel.showEntry', ({ focus = false, ...rest }) => {
61708
+ * // ...
61709
+ * });
61710
+ *
61711
+ * @param {Object} context
61712
+ * @param {boolean} [context.focus]
61713
+ *
61714
+ * @returns void
61715
+ */
61716
+ const EventContext = q({
61717
+ eventBus: null
61718
+ });
61719
+
61608
61720
  const LayoutContext = q({
61609
61721
  layout: {},
61610
61722
  setLayout: () => {},
@@ -61612,6 +61724,107 @@
61612
61724
  setLayoutForKey: () => {}
61613
61725
  });
61614
61726
 
61727
+ /**
61728
+ * Accesses the global DescriptionContext and returns a description for a given id and element.
61729
+ *
61730
+ * @example
61731
+ * ```jsx
61732
+ * function TextField(props) {
61733
+ * const description = useDescriptionContext('input1', element);
61734
+ * }
61735
+ * ```
61736
+ *
61737
+ * @param {string} id
61738
+ * @param {djs.model.Base} element
61739
+ *
61740
+ * @returns {string}
61741
+ */
61742
+
61743
+ function useDescriptionContext(id, element) {
61744
+ const {
61745
+ getDescriptionForId
61746
+ } = F(DescriptionContext);
61747
+ return getDescriptionForId(id, element);
61748
+ }
61749
+
61750
+ const DEFAULT_PRIORITY$6 = 1000;
61751
+ /**
61752
+ * Subscribe to an event.
61753
+ *
61754
+ * @param {string} event
61755
+ * @param {Function} callback
61756
+ * @param {number} [priority]
61757
+ *
61758
+ * @returns {import('preact').Ref}
61759
+ */
61760
+
61761
+ function useEvent(event, callback, priority = DEFAULT_PRIORITY$6) {
61762
+ const {
61763
+ eventBus
61764
+ } = F(EventContext);
61765
+ y$1(() => {
61766
+ if (!eventBus) {
61767
+ return;
61768
+ }
61769
+
61770
+ eventBus.on(event, priority, callback);
61771
+ return () => eventBus.off(event, callback);
61772
+ }, [callback, event, eventBus, priority]);
61773
+ }
61774
+
61775
+ const HIGH_PRIORITY$l = 10000;
61776
+ /**
61777
+ * Buffer events and re-fire during passive effect phase.
61778
+ *
61779
+ * @param {string[]} bufferedEvents
61780
+ * @param {Object} [eventBus]
61781
+ */
61782
+
61783
+ function useEventBuffer(bufferedEvents, eventBus) {
61784
+ const buffer = s$1([]),
61785
+ buffering = s$1(true);
61786
+
61787
+ const createCallback = event => data => {
61788
+ if (buffering.current === true) {
61789
+ buffer.current.unshift([event, data]);
61790
+ }
61791
+ }; // (1) buffer events
61792
+
61793
+
61794
+ y$1(() => {
61795
+ if (!eventBus) {
61796
+ return;
61797
+ }
61798
+
61799
+ const listeners = bufferedEvents.map(event => {
61800
+ return [event, createCallback(event)];
61801
+ });
61802
+ listeners.forEach(([event, callback]) => {
61803
+ eventBus.on(event, HIGH_PRIORITY$l, callback);
61804
+ });
61805
+ return () => {
61806
+ listeners.forEach(([event, callback]) => {
61807
+ eventBus.off(event, callback);
61808
+ });
61809
+ };
61810
+ }, [bufferedEvents, eventBus]); // (2) re-fire events
61811
+
61812
+ y$1(() => {
61813
+ if (!eventBus) {
61814
+ return;
61815
+ }
61816
+
61817
+ buffering.current = false;
61818
+
61819
+ while (buffer.current.length) {
61820
+ const [event, data] = buffer.current.pop();
61821
+ eventBus.fire(event, data);
61822
+ }
61823
+
61824
+ buffering.current = true;
61825
+ });
61826
+ }
61827
+
61615
61828
  /**
61616
61829
  * Creates a state that persists in the global LayoutContext.
61617
61830
  *
@@ -61647,124 +61860,104 @@
61647
61860
  }
61648
61861
 
61649
61862
  /**
61650
- * Accesses the global DescriptionContext and returns a description for a given id and element.
61651
- *
61652
- * @example
61653
- * ```jsx
61654
- * function TextField(props) {
61655
- * const description = useDescriptionContext('input1', element);
61656
- * }
61657
- * ```
61658
- *
61659
- * @param {string} id
61660
- * @param {djs.model.Base} element
61863
+ * @pinussilvestrus: we need to introduce our own hook to persist the previous
61864
+ * state on updates.
61661
61865
  *
61662
- * @returns {string}
61866
+ * cf. https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
61663
61867
  */
61664
61868
 
61665
- function useDescriptionContext(id, element) {
61666
- const {
61667
- getDescriptionForId
61668
- } = F(DescriptionContext);
61669
- return getDescriptionForId(id, element);
61670
- }
61671
-
61672
- var ArrowIcon = function ArrowIcon(props) {
61673
- return o$2("svg", { ...props,
61674
- children: o$2("path", {
61675
- fillRule: "evenodd",
61676
- d: "m11.657 8-4.95 4.95a1 1 0 0 1-1.414-1.414L8.828 8 5.293 4.464A1 1 0 1 1 6.707 3.05L11.657 8z"
61677
- })
61869
+ function usePrevious(value) {
61870
+ const ref = s$1();
61871
+ y$1(() => {
61872
+ ref.current = value;
61678
61873
  });
61679
- };
61680
-
61681
- ArrowIcon.defaultProps = {
61682
- xmlns: "http://www.w3.org/2000/svg",
61683
- width: "16",
61684
- height: "16"
61685
- };
61874
+ return ref.current;
61875
+ }
61686
61876
 
61687
- var CreateIcon = function CreateIcon(props) {
61688
- return o$2("svg", { ...props,
61689
- children: o$2("path", {
61690
- fillRule: "evenodd",
61691
- d: "M9 13V9h4a1 1 0 0 0 0-2H9V3a1 1 0 1 0-2 0v4H3a1 1 0 1 0 0 2h4v4a1 1 0 0 0 2 0z"
61692
- })
61693
- });
61694
- };
61877
+ /**
61878
+ * Subscribe to `propertiesPanel.showEntry`.
61879
+ *
61880
+ * @param {Function} show
61881
+ *
61882
+ * @returns {import('preact').Ref}
61883
+ */
61695
61884
 
61696
- CreateIcon.defaultProps = {
61697
- xmlns: "http://www.w3.org/2000/svg",
61698
- width: "16",
61699
- height: "16"
61700
- };
61885
+ function useShowEntryEvent(show) {
61886
+ const {
61887
+ onShow
61888
+ } = F(LayoutContext);
61889
+ const ref = s$1();
61890
+ const [focus, setFocus] = l(false);
61891
+ const onShowEntry = A$1(event => {
61892
+ if (show(event)) {
61893
+ if (isFunction(onShow)) {
61894
+ onShow();
61895
+ }
61701
61896
 
61702
- var DeleteIcon = function DeleteIcon(props) {
61703
- return o$2("svg", { ...props,
61704
- children: o$2("path", {
61705
- fillRule: "evenodd",
61706
- d: "M12 6v7c0 1.1-.4 1.55-1.5 1.55h-5C4.4 14.55 4 14.1 4 13V6h8zm-1.5 1.5h-5v4.3c0 .66.5 1.2 1.111 1.2H9.39c.611 0 1.111-.54 1.111-1.2V7.5zM13 3h-2l-1-1H6L5 3H3v1.5h10V3z"
61707
- })
61708
- });
61709
- };
61897
+ if (event.focus && !focus) {
61898
+ setFocus(true);
61899
+ }
61900
+ }
61901
+ }, [show]);
61902
+ y$1(() => {
61903
+ if (focus && ref.current) {
61904
+ if (isFunction(ref.current.focus)) {
61905
+ ref.current.focus();
61906
+ }
61710
61907
 
61711
- DeleteIcon.defaultProps = {
61712
- xmlns: "http://www.w3.org/2000/svg",
61713
- width: "16",
61714
- height: "16"
61715
- };
61908
+ if (isFunction(ref.current.select)) {
61909
+ ref.current.select();
61910
+ }
61716
61911
 
61717
- var FeelRequiredIcon = function FeelRequiredIcon(props) {
61718
- return o$2("svg", { ...props,
61719
- children: [o$2("path", {
61720
- d: "M5.8 7.06V5.95h4.307v1.11H5.8zm0 3.071v-1.11h4.307v1.11H5.8z",
61721
- fill: "#505562"
61722
- }), o$2("path", {
61723
- fillRule: "evenodd",
61724
- clipRule: "evenodd",
61725
- d: "M8 3.268A4.732 4.732 0 1 0 12.732 8H14a6 6 0 1 1-6-6v1.268z",
61726
- fill: "#505562"
61727
- }), o$2("path", {
61728
- d: "m11.28 6.072-.832-.56 1.016-1.224L10 3.848l.312-.912 1.392.584L11.632 2h1.032l-.072 1.52 1.392-.584.312.912-1.464.44 1.008 1.224-.832.552-.864-1.296-.864 1.304z",
61729
- fill: "#505562"
61730
- })]
61731
- });
61732
- };
61912
+ setFocus(false);
61913
+ }
61914
+ }, [focus]);
61915
+ useEvent('propertiesPanel.showEntry', onShowEntry);
61916
+ return ref;
61917
+ }
61733
61918
 
61734
- FeelRequiredIcon.defaultProps = {
61735
- viewBox: "0 0 16 16",
61736
- fill: "none",
61737
- xmlns: "http://www.w3.org/2000/svg"
61738
- };
61919
+ /**
61920
+ * Subscribe to `propertiesPanel.showError`. On `propertiesPanel.showError` set
61921
+ * temporary error. Fire `propertiesPanel.showEntry` for temporary error to be
61922
+ * visible. Unset error on `propertiesPanel.updated`.
61923
+ *
61924
+ * @param {Function} show
61925
+ *
61926
+ * @returns {import('preact').Ref}
61927
+ */
61739
61928
 
61740
- var FeelOptionalIcon = function FeelOptionalIcon(props) {
61741
- return o$2("svg", { ...props,
61742
- children: [o$2("path", {
61743
- d: "M5.845 7.04V5.93h4.307v1.11H5.845zm0 3.07V9h4.307v1.11H5.845z",
61744
- fill: "#505562"
61745
- }), o$2("path", {
61746
- fillRule: "evenodd",
61747
- clipRule: "evenodd",
61748
- d: "M3.286 8a4.714 4.714 0 1 0 9.428 0 4.714 4.714 0 0 0-9.428 0zM8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2z",
61749
- fill: "#505562"
61750
- })]
61751
- });
61752
- };
61929
+ function useShowErrorEvent(show) {
61930
+ const {
61931
+ eventBus
61932
+ } = F(EventContext);
61933
+ const [temporaryError, setTemporaryError] = l(null);
61934
+ const onPropertiesPanelUpdated = A$1(() => setTemporaryError(null), []);
61935
+ useEvent('propertiesPanel.updated', onPropertiesPanelUpdated);
61936
+ const onShowError = A$1(event => {
61937
+ setTemporaryError(null);
61938
+
61939
+ if (show(event)) {
61940
+ if (eventBus) {
61941
+ eventBus.fire('propertiesPanel.showEntry', event);
61942
+ }
61753
61943
 
61754
- FeelOptionalIcon.defaultProps = {
61755
- viewBox: "0 0 16 16",
61756
- fill: "none",
61757
- xmlns: "http://www.w3.org/2000/svg"
61758
- };
61944
+ setTemporaryError(event.message);
61945
+ }
61946
+ }, [show]);
61947
+ useEvent('propertiesPanel.showError', onShowError);
61948
+ return temporaryError;
61949
+ }
61759
61950
 
61760
61951
  function Group(props) {
61761
61952
  const {
61762
61953
  element,
61763
61954
  entries = [],
61764
61955
  id,
61765
- label
61956
+ label,
61957
+ shouldOpen = false
61766
61958
  } = props;
61767
- const [open, setOpen] = useLayoutState(['groups', id, 'open'], false);
61959
+ const [open, setOpen] = useLayoutState(['groups', id, 'open'], shouldOpen);
61960
+ const onShow = A$1(() => setOpen(true), [setOpen]);
61768
61961
 
61769
61962
  const toggleOpen = () => setOpen(!open);
61770
61963
 
@@ -61787,6 +61980,9 @@
61787
61980
  });
61788
61981
  setEdited(hasOneEditedEntry);
61789
61982
  }, [entries]);
61983
+ const propertiesPanelContext = { ...F(LayoutContext),
61984
+ onShow
61985
+ };
61790
61986
  return o$2("div", {
61791
61987
  class: "bio-properties-panel-group",
61792
61988
  "data-group-id": 'group-' + id,
@@ -61809,15 +62005,18 @@
61809
62005
  })]
61810
62006
  }), o$2("div", {
61811
62007
  class: classnames('bio-properties-panel-group-entries', open ? 'open' : ''),
61812
- children: entries.map(entry => {
61813
- const {
61814
- component: Component,
61815
- id
61816
- } = entry;
61817
- return a(Component, { ...entry,
61818
- key: id,
61819
- element: element
61820
- });
62008
+ children: o$2(LayoutContext.Provider, {
62009
+ value: propertiesPanelContext,
62010
+ children: entries.map(entry => {
62011
+ const {
62012
+ component: Component,
62013
+ id
62014
+ } = entry;
62015
+ return a(Component, { ...entry,
62016
+ element: element,
62017
+ key: id
62018
+ });
62019
+ })
61821
62020
  })
61822
62021
  })]
61823
62022
  });
@@ -61834,6 +62033,7 @@
61834
62033
  open: true
61835
62034
  };
61836
62035
  const DEFAULT_DESCRIPTION = {};
62036
+ const bufferedEvents = ['propertiesPanel.showEntry', 'propertiesPanel.showError'];
61837
62037
  /**
61838
62038
  * @typedef { {
61839
62039
  * component: import('preact').Component,
@@ -61865,7 +62065,8 @@
61865
62065
  * component?: import('preact').Component,
61866
62066
  * entries: Array<EntryDefinition>,
61867
62067
  * id: String,
61868
- * label: String
62068
+ * label: String,
62069
+ * shouldOpen?: Boolean
61869
62070
  * } } GroupDefinition
61870
62071
  *
61871
62072
  * @typedef { {
@@ -61892,6 +62093,7 @@
61892
62093
  * @param {Function} [props.layoutChanged]
61893
62094
  * @param {DescriptionConfig} [props.descriptionConfig]
61894
62095
  * @param {Function} [props.descriptionLoaded]
62096
+ * @param {Object} [props.eventBus]
61895
62097
  */
61896
62098
 
61897
62099
  function PropertiesPanel(props) {
@@ -61902,7 +62104,8 @@
61902
62104
  layoutConfig = {},
61903
62105
  layoutChanged,
61904
62106
  descriptionConfig = {},
61905
- descriptionLoaded
62107
+ descriptionLoaded,
62108
+ eventBus
61906
62109
  } = props; // set-up layout context
61907
62110
 
61908
62111
  const [layout, setLayout] = l(createLayout(layoutConfig));
@@ -61943,6 +62146,13 @@
61943
62146
  description,
61944
62147
  getDescriptionForId
61945
62148
  };
62149
+ useEventBuffer(bufferedEvents, eventBus);
62150
+ const eventContext = {
62151
+ eventBus
62152
+ };
62153
+ const propertiesPanelContext = {
62154
+ element
62155
+ };
61946
62156
 
61947
62157
  if (!element) {
61948
62158
  return o$2("div", {
@@ -61951,28 +62161,34 @@
61951
62161
  });
61952
62162
  }
61953
62163
 
61954
- return o$2(DescriptionContext.Provider, {
61955
- value: descriptionContext,
61956
- children: o$2(LayoutContext.Provider, {
61957
- value: layoutContext,
61958
- children: o$2("div", {
61959
- class: classnames('bio-properties-panel', layout.open ? 'open' : ''),
61960
- children: [o$2(Header, {
61961
- element: element,
61962
- headerProvider: headerProvider
61963
- }), o$2("div", {
61964
- class: "bio-properties-panel-scroll-container",
61965
- children: groups.map(group => {
61966
- const {
61967
- component: Component = Group,
61968
- id
61969
- } = group;
61970
- return a(Component, { ...group,
61971
- key: id,
61972
- element: element
61973
- });
62164
+ return o$2(LayoutContext.Provider, {
62165
+ value: propertiesPanelContext,
62166
+ children: o$2(DescriptionContext.Provider, {
62167
+ value: descriptionContext,
62168
+ children: o$2(LayoutContext.Provider, {
62169
+ value: layoutContext,
62170
+ children: o$2(EventContext.Provider, {
62171
+ value: eventContext,
62172
+ children: o$2("div", {
62173
+ class: classnames('bio-properties-panel', layout.open ? 'open' : ''),
62174
+ children: [o$2(Header, {
62175
+ element: element,
62176
+ headerProvider: headerProvider
62177
+ }), o$2("div", {
62178
+ class: "bio-properties-panel-scroll-container",
62179
+ children: groups.map(group => {
62180
+ const {
62181
+ component: Component = Group,
62182
+ id
62183
+ } = group;
62184
+ return a(Component, { ...group,
62185
+ key: id,
62186
+ element: element
62187
+ });
62188
+ })
62189
+ })]
61974
62190
  })
61975
- })]
62191
+ })
61976
62192
  })
61977
62193
  })
61978
62194
  });
@@ -62112,8 +62328,20 @@
62112
62328
  } = props;
62113
62329
  const [open, setOpen] = l(shouldOpen);
62114
62330
 
62115
- const toggleOpen = () => setOpen(!open); // todo(pinussilvestrus): translate once we have a translate mechanism for the core
62331
+ const toggleOpen = () => setOpen(!open);
62116
62332
 
62333
+ const {
62334
+ onShow
62335
+ } = F(LayoutContext);
62336
+ const propertiesPanelContext = { ...F(LayoutContext),
62337
+ onShow: A$1(() => {
62338
+ setOpen(true);
62339
+
62340
+ if (isFunction(onShow)) {
62341
+ onShow();
62342
+ }
62343
+ }, [onShow, setOpen])
62344
+ }; // todo(pinussilvestrus): translate once we have a translate mechanism for the core
62117
62345
 
62118
62346
  const placeholderLabel = '<empty>';
62119
62347
  return o$2("div", {
@@ -62140,15 +62368,18 @@
62140
62368
  }) : null]
62141
62369
  }), o$2("div", {
62142
62370
  class: classnames('bio-properties-panel-collapsible-entry-entries', open ? 'open' : ''),
62143
- children: entries.map(entry => {
62144
- const {
62145
- component: Component,
62146
- id
62147
- } = entry;
62148
- return a(Component, { ...entry,
62149
- key: id,
62150
- element: element
62151
- });
62371
+ children: o$2(LayoutContext.Provider, {
62372
+ value: propertiesPanelContext,
62373
+ children: entries.map(entry => {
62374
+ const {
62375
+ component: Component,
62376
+ id
62377
+ } = entry;
62378
+ return a(Component, { ...entry,
62379
+ element: element,
62380
+ key: id
62381
+ });
62382
+ })
62152
62383
  })
62153
62384
  })]
62154
62385
  });
@@ -62182,7 +62413,7 @@
62182
62413
  });
62183
62414
  }
62184
62415
 
62185
- const noop = () => {};
62416
+ const noop$3 = () => {};
62186
62417
  /**
62187
62418
  * @param {import('../PropertiesPanel').ListGroupDefinition} props
62188
62419
  */
@@ -62199,6 +62430,7 @@
62199
62430
  shouldSort = true
62200
62431
  } = props;
62201
62432
  const [open, setOpen] = useLayoutState(['groups', id, 'open'], false);
62433
+ const onShow = A$1(() => setOpen(true), [setOpen]);
62202
62434
  const [ordering, setOrdering] = l([]);
62203
62435
  const [newItemAdded, setNewItemAdded] = l(false);
62204
62436
  const prevItems = usePrevious(items);
@@ -62273,12 +62505,15 @@
62273
62505
  const toggleOpen = () => setOpen(!open);
62274
62506
 
62275
62507
  const hasItems = !!items.length;
62508
+ const propertiesPanelContext = { ...F(LayoutContext),
62509
+ onShow
62510
+ };
62276
62511
  return o$2("div", {
62277
62512
  class: "bio-properties-panel-group",
62278
62513
  "data-group-id": 'group-' + id,
62279
62514
  children: [o$2("div", {
62280
62515
  class: classnames('bio-properties-panel-group-header', hasItems ? '' : 'empty', hasItems && open ? 'open' : ''),
62281
- onClick: hasItems ? toggleOpen : noop,
62516
+ onClick: hasItems ? toggleOpen : noop$3,
62282
62517
  children: [o$2("div", {
62283
62518
  title: label,
62284
62519
  class: "bio-properties-panel-group-header-title",
@@ -62307,23 +62542,27 @@
62307
62542
  })]
62308
62543
  }), o$2("div", {
62309
62544
  class: classnames('bio-properties-panel-list', open && hasItems ? 'open' : ''),
62310
- children: ordering.map((o, index) => {
62311
- const item = getItem(items, o);
62545
+ children: o$2(LayoutContext.Provider, {
62546
+ value: propertiesPanelContext,
62547
+ children: ordering.map((o, index) => {
62548
+ const item = getItem(items, o);
62312
62549
 
62313
- if (!item) {
62314
- return;
62315
- }
62550
+ if (!item) {
62551
+ return;
62552
+ }
62316
62553
 
62317
- const {
62318
- id
62319
- } = item;
62320
- return a(ListItem, { ...item,
62321
- element: element,
62322
- index: index,
62323
- key: id // if item was added, open first or last item based on ordering
62324
- ,
62325
- autoOpen: newItemAdded && (shouldSort ? index === 0 : index === ordering.length - 1)
62326
- });
62554
+ const {
62555
+ id
62556
+ } = item; // if item was added, open first or last item based on ordering
62557
+
62558
+ const autoOpen = newItemAdded && (shouldSort ? index === 0 : index === ordering.length - 1);
62559
+ return a(ListItem, { ...item,
62560
+ autoOpen: autoOpen,
62561
+ element: element,
62562
+ index: index,
62563
+ key: id
62564
+ });
62565
+ })
62327
62566
  })
62328
62567
  })]
62329
62568
  });
@@ -62362,13 +62601,16 @@
62362
62601
  }
62363
62602
  }
62364
62603
 
62604
+ const noop$2 = () => {};
62605
+
62365
62606
  function Checkbox(props) {
62366
62607
  const {
62367
62608
  id,
62368
62609
  label,
62369
62610
  onChange,
62370
62611
  disabled,
62371
- value = false
62612
+ value = false,
62613
+ show = noop$2
62372
62614
  } = props;
62373
62615
 
62374
62616
  const handleChange = ({
@@ -62377,9 +62619,11 @@
62377
62619
  onChange(target.checked);
62378
62620
  };
62379
62621
 
62622
+ const ref = useShowEntryEvent(show);
62380
62623
  return o$2("div", {
62381
62624
  class: "bio-properties-panel-checkbox",
62382
62625
  children: [o$2("input", {
62626
+ ref: ref,
62383
62627
  id: prefixId$6(id),
62384
62628
  name: id,
62385
62629
  type: "checkbox",
@@ -62414,18 +62658,24 @@
62414
62658
  label,
62415
62659
  getValue,
62416
62660
  setValue,
62417
- disabled
62661
+ disabled,
62662
+ show = noop$2
62418
62663
  } = props;
62419
62664
  const value = getValue(element);
62665
+ const error = useShowErrorEvent(show);
62420
62666
  return o$2("div", {
62421
62667
  class: "bio-properties-panel-entry bio-properties-panel-checkbox-entry",
62422
62668
  "data-entry-id": id,
62423
62669
  children: [o$2(Checkbox, {
62670
+ disabled: disabled,
62424
62671
  id: id,
62425
62672
  label: label,
62426
62673
  onChange: setValue,
62427
- value: value,
62428
- disabled: disabled
62674
+ show: show,
62675
+ value: value
62676
+ }), error && o$2("div", {
62677
+ class: "bio-properties-panel-error",
62678
+ children: error
62429
62679
  }), o$2(Description, {
62430
62680
  forId: id,
62431
62681
  element: element,
@@ -62441,6 +62691,25 @@
62441
62691
  return `bio-properties-panel-${id}`;
62442
62692
  }
62443
62693
 
62694
+ const noop$1 = () => {};
62695
+ /**
62696
+ * @typedef { { value: string, label: string, disabled: boolean } } Option
62697
+ */
62698
+
62699
+ /**
62700
+ * Provides basic select input.
62701
+ *
62702
+ * @param {object} props
62703
+ * @param {string} props.id
62704
+ * @param {string[]} props.path
62705
+ * @param {string} props.label
62706
+ * @param {Function} props.onChange
62707
+ * @param {Array<Option>} [props.options]
62708
+ * @param {string} props.value
62709
+ * @param {boolean} [props.disabled]
62710
+ */
62711
+
62712
+
62444
62713
  function Select(props) {
62445
62714
  const {
62446
62715
  id,
@@ -62448,8 +62717,10 @@
62448
62717
  onChange,
62449
62718
  options = [],
62450
62719
  value,
62451
- disabled
62720
+ disabled,
62721
+ show = noop$1
62452
62722
  } = props;
62723
+ const ref = useShowEntryEvent(show);
62453
62724
 
62454
62725
  const handleChange = ({
62455
62726
  target
@@ -62464,6 +62735,7 @@
62464
62735
  class: "bio-properties-panel-label",
62465
62736
  children: label
62466
62737
  }), o$2("select", {
62738
+ ref: ref,
62467
62739
  id: prefixId$4(id),
62468
62740
  name: id,
62469
62741
  class: "bio-properties-panel-input",
@@ -62502,12 +62774,14 @@
62502
62774
  getValue,
62503
62775
  setValue,
62504
62776
  getOptions,
62505
- disabled
62777
+ disabled,
62778
+ show = noop$1
62506
62779
  } = props;
62507
62780
  const value = getValue(element);
62508
62781
  const options = getOptions(element);
62782
+ const error = useShowErrorEvent(show);
62509
62783
  return o$2("div", {
62510
- class: "bio-properties-panel-entry",
62784
+ class: classnames('bio-properties-panel-entry', error ? 'has-error' : ''),
62511
62785
  "data-entry-id": id,
62512
62786
  children: [o$2(Select, {
62513
62787
  id: id,
@@ -62515,7 +62789,11 @@
62515
62789
  value: value,
62516
62790
  onChange: setValue,
62517
62791
  options: options,
62518
- disabled: disabled
62792
+ disabled: disabled,
62793
+ show: show
62794
+ }), error && o$2("div", {
62795
+ class: "bio-properties-panel-error",
62796
+ children: error
62519
62797
  }), o$2(Description, {
62520
62798
  forId: id,
62521
62799
  element: element,
@@ -62643,6 +62921,8 @@
62643
62921
  return `bio-properties-panel-${id}`;
62644
62922
  }
62645
62923
 
62924
+ const noop = () => {};
62925
+
62646
62926
  function Textfield(props) {
62647
62927
  const {
62648
62928
  debounce,
@@ -62651,8 +62931,10 @@
62651
62931
  label,
62652
62932
  onInput,
62653
62933
  feel = false,
62654
- value = ''
62934
+ value = '',
62935
+ show = noop
62655
62936
  } = props;
62937
+ const ref = useShowEntryEvent(show);
62656
62938
  const handleInput = d$1(() => {
62657
62939
  return debounce(({
62658
62940
  target
@@ -62668,6 +62950,7 @@
62668
62950
  label: label
62669
62951
  })]
62670
62952
  }), o$2("input", {
62953
+ ref: ref,
62671
62954
  id: prefixId$1(id),
62672
62955
  type: "text",
62673
62956
  name: id,
@@ -62707,53 +62990,61 @@
62707
62990
  label,
62708
62991
  getValue,
62709
62992
  setValue,
62710
- validate
62993
+ validate,
62994
+ show = noop
62711
62995
  } = props;
62712
- const [error, setError] = l(null);
62713
- const [invalidValueCache, setInvalidValueCache] = l(null);
62996
+ const [cachedInvalidValue, setCachedInvalidValue] = l(null);
62997
+ const [validationError, setValidationError] = l(null);
62714
62998
  let value = getValue(element);
62715
- const prevValue = usePrevious(value); // validate again when value prop changed
62716
-
62999
+ const previousValue = usePrevious(value);
62717
63000
  y$1(() => {
62718
- const err = validate ? validate(value) : null;
62719
- setError(err);
62720
- }, [value]); // validate on change
63001
+ if (isFunction(validate)) {
63002
+ const newValidationError = validate(value) || null;
63003
+ setValidationError(newValidationError);
63004
+ }
63005
+ }, [value]);
62721
63006
 
62722
- const handleChange = newValue => {
62723
- const err = validate ? validate(newValue) : null;
63007
+ const onInput = newValue => {
63008
+ let newValidationError = null;
62724
63009
 
62725
- if (err) {
62726
- setInvalidValueCache(newValue);
63010
+ if (isFunction(validate)) {
63011
+ newValidationError = validate(newValue) || null;
63012
+ }
63013
+
63014
+ if (newValidationError) {
63015
+ setCachedInvalidValue(newValue);
62727
63016
  } else {
62728
63017
  setValue(newValue);
62729
63018
  }
62730
63019
 
62731
- setError(err);
62732
- }; // keep showing invalid value on errors, although it was not set
62733
-
63020
+ setValidationError(newValidationError);
63021
+ };
62734
63022
 
62735
- if (prevValue === value && error) {
62736
- value = invalidValueCache;
63023
+ if (previousValue === value && validationError) {
63024
+ value = cachedInvalidValue;
62737
63025
  }
62738
63026
 
63027
+ const temporaryError = useShowErrorEvent(show);
63028
+ const error = temporaryError || validationError;
62739
63029
  return o$2("div", {
62740
63030
  class: classnames('bio-properties-panel-entry', error ? 'has-error' : ''),
62741
63031
  "data-entry-id": id,
62742
63032
  children: [o$2(Textfield, {
62743
- id: id,
62744
- label: label,
62745
- value: value,
62746
- onInput: handleChange,
62747
63033
  debounce: debounce,
62748
63034
  disabled: disabled,
62749
- feel: feel
63035
+ feel: feel,
63036
+ id: id,
63037
+ label: label,
63038
+ onInput: onInput,
63039
+ show: show,
63040
+ value: value
63041
+ }), error && o$2("div", {
63042
+ class: "bio-properties-panel-error",
63043
+ children: error
62750
63044
  }), o$2(Description, {
62751
63045
  forId: id,
62752
63046
  element: element,
62753
63047
  value: description
62754
- }), error && o$2("div", {
62755
- class: "bio-properties-panel-error",
62756
- children: error
62757
63048
  })]
62758
63049
  });
62759
63050
  }
@@ -62869,6 +63160,145 @@
62869
63160
  debounceInput: ['factory', debounceInput]
62870
63161
  };
62871
63162
 
63163
+ var require$$0 = /*@__PURE__*/getAugmentedNamespace(index_esm);
63164
+
63165
+ const {
63166
+ isNil: isNil$1,
63167
+ isString: isString$1,
63168
+ isUndefined: isUndefined$2
63169
+ } = require$$0;
63170
+
63171
+ /**
63172
+ * Get path from model element and optional parent model element. Falls back to
63173
+ * returning null.
63174
+ *
63175
+ * @param {ModdleElement} moddleElement
63176
+ * @param {ModdleElement} [parentModdleElement]
63177
+ *
63178
+ * @returns {string[]|null}
63179
+ */
63180
+ var getPath = function(moddleElement, parentModdleElement) {
63181
+ if (!moddleElement) {
63182
+ return null;
63183
+ }
63184
+
63185
+ if (moddleElement === parentModdleElement) {
63186
+ return [];
63187
+ }
63188
+
63189
+ let path = [],
63190
+ parent;
63191
+
63192
+ do {
63193
+ parent = moddleElement.$parent;
63194
+
63195
+ if (!parent) {
63196
+ if (moddleElement.$instanceOf('bpmn:Definitions')) {
63197
+ break;
63198
+ } else {
63199
+ return null;
63200
+ }
63201
+ }
63202
+
63203
+ path = [ ...getPropertyName(moddleElement, parent), ...path ];
63204
+
63205
+ moddleElement = parent;
63206
+
63207
+ if (parentModdleElement && moddleElement === parentModdleElement) {
63208
+ break;
63209
+ }
63210
+ } while (parent);
63211
+
63212
+ return path;
63213
+ };
63214
+
63215
+ /**
63216
+ * Get property name from model element and parent model element.
63217
+ *
63218
+ * @param {ModdleElement} moddleElement
63219
+ * @param {ModdleElement} parentModdleElement
63220
+ *
63221
+ * @returns {string[]}
63222
+ */
63223
+ function getPropertyName(moddleElement, parentModdleElement) {
63224
+ for (let property of Object.values(parentModdleElement.$descriptor.propertiesByName)) {
63225
+ if (property.isMany) {
63226
+ if (parentModdleElement.get(property.name).includes(moddleElement)) {
63227
+ return [
63228
+ property.name,
63229
+ parentModdleElement.get(property.name).indexOf(moddleElement)
63230
+ ];
63231
+ }
63232
+ } else {
63233
+ if (parentModdleElement.get(property.name) === moddleElement) {
63234
+ return [ property.name ];
63235
+ }
63236
+ }
63237
+ }
63238
+
63239
+ return [];
63240
+ }
63241
+
63242
+ /**
63243
+ * @param {(string|(number|string)[])[]} paths
63244
+ *
63245
+ * @returns {(number|string)[]}
63246
+ */
63247
+ var pathConcat = function(...paths) {
63248
+ let concatenatedPaths = [];
63249
+
63250
+ for (let path of paths) {
63251
+ if (isNil$1(path) || isUndefined$2(path)) {
63252
+ return null;
63253
+ }
63254
+
63255
+ if (isString$1(path)) {
63256
+ path = [ path ];
63257
+ }
63258
+
63259
+ concatenatedPaths = concatenatedPaths.concat(path);
63260
+ }
63261
+
63262
+ return concatenatedPaths;
63263
+ };
63264
+
63265
+ /**
63266
+ * @param {string|(number|string)[]} a
63267
+ * @param {string|(number|string)[]} b
63268
+ * @param {string} [separator]
63269
+ *
63270
+ * @returns {boolean}
63271
+ */
63272
+ var pathEquals = function(a, b, separator = '.') {
63273
+ if (isNil$1(a) || isUndefined$2(a) || isNil$1(b) || isUndefined$2(b)) {
63274
+ return false;
63275
+ }
63276
+
63277
+ if (!isString$1(a)) {
63278
+ a = pathStringify(a, separator);
63279
+ }
63280
+
63281
+ if (!isString$1(b)) {
63282
+ b = pathStringify(b, separator);
63283
+ }
63284
+
63285
+ return a === b;
63286
+ };
63287
+
63288
+ /**
63289
+ * @param {(number|string)[]} path
63290
+ * @param {string} [separator]
63291
+ *
63292
+ * @returns {string}
63293
+ */
63294
+ function pathStringify(path, separator = '.') {
63295
+ if (isNil$1(path) || isUndefined$2(path)) {
63296
+ return null;
63297
+ }
63298
+
63299
+ return path.join(separator);
63300
+ }
63301
+
62872
63302
  /**
62873
63303
  * Failsafe remove an element from a collection
62874
63304
  *
@@ -63624,6 +64054,142 @@
63624
64054
  return _validate(object, standaloneZeebeValidator);
63625
64055
  }
63626
64056
 
64057
+ var DEFAULT_PRIORITY$7 = 1000;
64058
+
64059
+ /**
64060
+ * A utility that can be used to plug-in into the command execution for
64061
+ * extension and/or validation.
64062
+ *
64063
+ * @param {EventBus} eventBus
64064
+ *
64065
+ * @example
64066
+ *
64067
+ * import inherits from 'inherits';
64068
+ *
64069
+ * import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
64070
+ *
64071
+ * function CommandLogger(eventBus) {
64072
+ * CommandInterceptor.call(this, eventBus);
64073
+ *
64074
+ * this.preExecute(function(event) {
64075
+ * console.log('command pre-execute', event);
64076
+ * });
64077
+ * }
64078
+ *
64079
+ * inherits(CommandLogger, CommandInterceptor);
64080
+ *
64081
+ */
64082
+ function CommandInterceptor$1(eventBus) {
64083
+ this._eventBus = eventBus;
64084
+ }
64085
+
64086
+ CommandInterceptor$1.$inject = [ 'eventBus' ];
64087
+
64088
+ function unwrapEvent$1(fn, that) {
64089
+ return function(event) {
64090
+ return fn.call(that || null, event.context, event.command, event);
64091
+ };
64092
+ }
64093
+
64094
+ /**
64095
+ * Register an interceptor for a command execution
64096
+ *
64097
+ * @param {string|Array<string>} [events] list of commands to register on
64098
+ * @param {string} [hook] command hook, i.e. preExecute, executed to listen on
64099
+ * @param {number} [priority] the priority on which to hook into the execution
64100
+ * @param {Function} handlerFn interceptor to be invoked with (event)
64101
+ * @param {boolean} unwrap if true, unwrap the event and pass (context, command, event) to the
64102
+ * listener instead
64103
+ * @param {Object} [that] Pass context (`this`) to the handler function
64104
+ */
64105
+ CommandInterceptor$1.prototype.on = function(events, hook, priority, handlerFn, unwrap, that) {
64106
+
64107
+ if (isFunction(hook) || isNumber(hook)) {
64108
+ that = unwrap;
64109
+ unwrap = handlerFn;
64110
+ handlerFn = priority;
64111
+ priority = hook;
64112
+ hook = null;
64113
+ }
64114
+
64115
+ if (isFunction(priority)) {
64116
+ that = unwrap;
64117
+ unwrap = handlerFn;
64118
+ handlerFn = priority;
64119
+ priority = DEFAULT_PRIORITY$7;
64120
+ }
64121
+
64122
+ if (isObject(unwrap)) {
64123
+ that = unwrap;
64124
+ unwrap = false;
64125
+ }
64126
+
64127
+ if (!isFunction(handlerFn)) {
64128
+ throw new Error('handlerFn must be a function');
64129
+ }
64130
+
64131
+ if (!isArray(events)) {
64132
+ events = [ events ];
64133
+ }
64134
+
64135
+ var eventBus = this._eventBus;
64136
+
64137
+ forEach(events, function(event) {
64138
+
64139
+ // concat commandStack(.event)?(.hook)?
64140
+ var fullEvent = [ 'commandStack', event, hook ].filter(function(e) { return e; }).join('.');
64141
+
64142
+ eventBus.on(fullEvent, priority, unwrap ? unwrapEvent$1(handlerFn, that) : handlerFn, that);
64143
+ });
64144
+ };
64145
+
64146
+
64147
+ var hooks$1 = [
64148
+ 'canExecute',
64149
+ 'preExecute',
64150
+ 'preExecuted',
64151
+ 'execute',
64152
+ 'executed',
64153
+ 'postExecute',
64154
+ 'postExecuted',
64155
+ 'revert',
64156
+ 'reverted'
64157
+ ];
64158
+
64159
+ /*
64160
+ * Install hook shortcuts
64161
+ *
64162
+ * This will generate the CommandInterceptor#(preExecute|...|reverted) methods
64163
+ * which will in term forward to CommandInterceptor#on.
64164
+ */
64165
+ forEach(hooks$1, function(hook) {
64166
+
64167
+ /**
64168
+ * {canExecute|preExecute|preExecuted|execute|executed|postExecute|postExecuted|revert|reverted}
64169
+ *
64170
+ * A named hook for plugging into the command execution
64171
+ *
64172
+ * @param {string|Array<string>} [events] list of commands to register on
64173
+ * @param {number} [priority] the priority on which to hook into the execution
64174
+ * @param {Function} handlerFn interceptor to be invoked with (event)
64175
+ * @param {boolean} [unwrap=false] if true, unwrap the event and pass (context, command, event) to the
64176
+ * listener instead
64177
+ * @param {Object} [that] Pass context (`this`) to the handler function
64178
+ */
64179
+ CommandInterceptor$1.prototype[hook] = function(events, priority, handlerFn, unwrap, that) {
64180
+
64181
+ if (isFunction(events) || isNumber(events)) {
64182
+ that = unwrap;
64183
+ unwrap = handlerFn;
64184
+ handlerFn = priority;
64185
+ priority = events;
64186
+ events = null;
64187
+ }
64188
+
64189
+ this.on(events, hook, priority, handlerFn, unwrap, that);
64190
+ };
64191
+ });
64192
+
63627
64193
  const BpmnPropertiesPanelContext = q({
63628
64194
  selectedElement: null,
63629
64195
  injector: null,
@@ -63634,6 +64200,56 @@
63634
64200
 
63635
64201
  });
63636
64202
 
64203
+ function useService(type, strict) {
64204
+ const {
64205
+ getService
64206
+ } = F(BpmnPropertiesPanelContext);
64207
+ return getService(type, strict);
64208
+ }
64209
+
64210
+ /**
64211
+ * Returns a memoized callback to be passed as `show` prop. Callback returns
64212
+ * true if (1) ID and path match or (2) ID matches and matcher returns true.
64213
+ *
64214
+ * @example
64215
+ *
64216
+ * // using path
64217
+ * const show = useShowCallback(businessObject, [ 'foo' ]);
64218
+ *
64219
+ * @example
64220
+ *
64221
+ * // using matcher
64222
+ * const show = useShowCallback(businessObject, (event) => event.foo === 'bar');
64223
+ *
64224
+ * @param {Object} businessObject
64225
+ * @param {string[]|Function} matcher
64226
+ *
64227
+ * @returns {Function}
64228
+ */
64229
+
64230
+ function useShowCallback(businessObject, matcher) {
64231
+ return A$1(event => {
64232
+ const {
64233
+ id,
64234
+ path
64235
+ } = event;
64236
+
64237
+ if (id !== businessObject.get('id')) {
64238
+ return false;
64239
+ }
64240
+
64241
+ if (isArray(matcher)) {
64242
+ return path && pathEquals(path, matcher);
64243
+ }
64244
+
64245
+ if (isFunction(matcher)) {
64246
+ return !!matcher(event);
64247
+ }
64248
+
64249
+ return false;
64250
+ }, [businessObject, matcher]);
64251
+ }
64252
+
63637
64253
  function _extends$1m() { _extends$1m = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1m.apply(this, arguments); }
63638
64254
  var AssociationIcon = (({
63639
64255
  styles = {},
@@ -64853,6 +65469,14 @@
64853
65469
  return type;
64854
65470
  }
64855
65471
  const PanelHeaderProvider = {
65472
+ getDocumentationRef: element => {
65473
+ // eslint-disable-next-line react-hooks/rules-of-hooks
65474
+ const elementTemplates = useService('elementTemplates', false);
65475
+
65476
+ if (elementTemplates) {
65477
+ return getTemplateDocumentation(element, elementTemplates);
65478
+ }
65479
+ },
64856
65480
  getElementLabel: element => {
64857
65481
  if (is$1(element, 'bpmn:Process')) {
64858
65482
  return getBusinessObject(element).name;
@@ -64865,6 +65489,17 @@
64865
65489
  return iconsByType[concreteType];
64866
65490
  },
64867
65491
  getTypeLabel: element => {
65492
+ // eslint-disable-next-line react-hooks/rules-of-hooks
65493
+ const elementTemplates = useService('elementTemplates', false);
65494
+
65495
+ if (elementTemplates) {
65496
+ const template = getTemplate(element, elementTemplates);
65497
+
65498
+ if (template && template.name) {
65499
+ return template.name;
65500
+ }
65501
+ }
65502
+
64868
65503
  const concreteType = getConcreteType(element);
64869
65504
  return concreteType.replace(/(\B[A-Z])/g, ' $1').replace(/(\bNon Interrupting)/g, '($1)');
64870
65505
  }
@@ -64910,8 +65545,7 @@
64910
65545
  }
64911
65546
 
64912
65547
  return businessObject.conditionExpression && is$1(sourceBusinessObject, 'bpmn:Activity');
64913
- } // helpers //////////
64914
-
65548
+ }
64915
65549
 
64916
65550
  function isPlane$1(element) {
64917
65551
  // Backwards compatibility for bpmn-js<8
@@ -64919,6 +65553,17 @@
64919
65553
  return is$1(di, 'bpmndi:BPMNPlane');
64920
65554
  }
64921
65555
 
65556
+ function getTemplate(element, elementTemplates) {
65557
+ const templateId = elementTemplates._getTemplateId(element);
65558
+
65559
+ return templateId && elementTemplates.get(templateId);
65560
+ }
65561
+
65562
+ function getTemplateDocumentation(element, elementTemplates) {
65563
+ const template = getTemplate(element, elementTemplates);
65564
+ return template && template.documentationRef;
65565
+ }
65566
+
64922
65567
  function BpmnPropertiesPanel(props) {
64923
65568
  const {
64924
65569
  element,
@@ -65066,7 +65711,8 @@
65066
65711
  layoutConfig: layoutConfig,
65067
65712
  layoutChanged: onLayoutChanged,
65068
65713
  descriptionConfig: descriptionConfig,
65069
- descriptionLoaded: onDescriptionLoaded
65714
+ descriptionLoaded: onDescriptionLoaded,
65715
+ eventBus: eventBus
65070
65716
  })
65071
65717
  });
65072
65718
  } // helpers //////////////////////////
@@ -65084,7 +65730,7 @@
65084
65730
  return element && elementRegistry.get(element.id);
65085
65731
  }
65086
65732
 
65087
- const DEFAULT_PRIORITY$6 = 1000;
65733
+ const DEFAULT_PRIORITY$8 = 1000;
65088
65734
  /**
65089
65735
  * @typedef { import('@bpmn-io/properties-panel').GroupDefinition } GroupDefinition
65090
65736
  * @typedef { import('@bpmn-io/properties-panel').ListGroupDefinition } ListGroupDefinition
@@ -65167,7 +65813,7 @@
65167
65813
  registerProvider(priority, provider) {
65168
65814
  if (!provider) {
65169
65815
  provider = priority;
65170
- priority = DEFAULT_PRIORITY$6;
65816
+ priority = DEFAULT_PRIORITY$8;
65171
65817
  }
65172
65818
 
65173
65819
  if (typeof provider.getGroups !== 'function') {
@@ -65279,13 +65925,6 @@
65279
65925
  propertiesPanel: ['type', BpmnPropertiesPanelRenderer]
65280
65926
  };
65281
65927
 
65282
- function useService (type, strict) {
65283
- const {
65284
- getService
65285
- } = F(BpmnPropertiesPanelContext);
65286
- return getService(type, strict);
65287
- }
65288
-
65289
65928
  function ReferenceSelectEntry(props) {
65290
65929
  const {
65291
65930
  autoFocusEntry,
@@ -65941,6 +66580,9 @@
65941
66580
  return options;
65942
66581
  };
65943
66582
 
66583
+ const businessObject = getBusinessObject(element),
66584
+ path = pathConcat(getPath(errorEventDefinition, businessObject), 'errorRef');
66585
+ const show = useShowCallback(businessObject, path);
65944
66586
  return ReferenceSelectEntry({
65945
66587
  element,
65946
66588
  id: 'errorRef',
@@ -65948,7 +66590,8 @@
65948
66590
  autoFocusEntry: 'errorName',
65949
66591
  getValue,
65950
66592
  setValue,
65951
- getOptions
66593
+ getOptions,
66594
+ show
65952
66595
  });
65953
66596
  }
65954
66597
 
@@ -66560,6 +67203,9 @@
66560
67203
  return options;
66561
67204
  };
66562
67205
 
67206
+ const businessObject = getBusinessObject(element),
67207
+ path = pathConcat(getPath(messageEventDefinition, businessObject), 'messageRef');
67208
+ const show = useShowCallback(businessObject, path);
66563
67209
  return ReferenceSelectEntry({
66564
67210
  element,
66565
67211
  id: 'messageRef',
@@ -66567,7 +67213,8 @@
66567
67213
  autoFocusEntry: 'messageName',
66568
67214
  getValue,
66569
67215
  setValue,
66570
- getOptions
67216
+ getOptions,
67217
+ show
66571
67218
  });
66572
67219
  }
66573
67220
 
@@ -67920,7 +68567,8 @@
67920
68567
 
67921
68568
  function BusinessRuleImplementation(props) {
67922
68569
  const {
67923
- element
68570
+ element,
68571
+ id
67924
68572
  } = props;
67925
68573
  const commandStack = useService('commandStack');
67926
68574
  const bpmnFactory = useService('bpmnFactory');
@@ -67977,13 +68625,30 @@
67977
68625
  return options;
67978
68626
  };
67979
68627
 
68628
+ const businessObject = getBusinessObject(element);
68629
+ const show = useShowCallback(businessObject, event => {
68630
+ const {
68631
+ error
68632
+ } = event;
68633
+
68634
+ if (!error) {
68635
+ return false;
68636
+ }
68637
+
68638
+ const {
68639
+ requiredExtensionElement,
68640
+ type
68641
+ } = error;
68642
+ return type === 'extensionElementRequired' && ['zeebe:CalledDecision', 'zeebe:TaskDefinition'].includes(requiredExtensionElement);
68643
+ });
67980
68644
  return SelectEntry({
67981
68645
  element,
67982
- id: 'businessRuleImplementation',
68646
+ id,
67983
68647
  label: translate('Implementation'),
67984
68648
  getValue,
67985
68649
  setValue,
67986
- getOptions
68650
+ getOptions,
68651
+ show
67987
68652
  });
67988
68653
  } // helper ///////////////////////
67989
68654
 
@@ -68082,7 +68747,8 @@
68082
68747
 
68083
68748
  function DecisionID(props) {
68084
68749
  const {
68085
- element
68750
+ element,
68751
+ id
68086
68752
  } = props;
68087
68753
  const commandStack = useService('commandStack');
68088
68754
  const bpmnFactory = useService('bpmnFactory');
@@ -68146,19 +68812,26 @@
68146
68812
  commandStack.execute('properties-panel.multi-command-executor', commands);
68147
68813
  };
68148
68814
 
68815
+ const businessObject = getBusinessObject(element),
68816
+ calledDecision = getCalledDecision(element);
68817
+ const path = pathConcat(getPath(calledDecision, businessObject), 'decisionId');
68818
+ const show = useShowCallback(businessObject, path);
68149
68819
  return TextfieldEntry({
68150
68820
  element,
68151
- id: 'decisionId',
68821
+ id,
68152
68822
  label: translate('ID'),
68823
+ feel: 'optional',
68153
68824
  getValue,
68154
68825
  setValue,
68155
- debounce
68826
+ debounce,
68827
+ show
68156
68828
  });
68157
68829
  }
68158
68830
 
68159
68831
  function ResultVariable$3(props) {
68160
68832
  const {
68161
- element
68833
+ element,
68834
+ id
68162
68835
  } = props;
68163
68836
  const commandStack = useService('commandStack');
68164
68837
  const bpmnFactory = useService('bpmnFactory');
@@ -68222,13 +68895,18 @@
68222
68895
  commandStack.execute('properties-panel.multi-command-executor', commands);
68223
68896
  };
68224
68897
 
68898
+ const businessObject = getBusinessObject(element),
68899
+ calledDecision = getCalledDecision(element);
68900
+ const path = pathConcat(getPath(calledDecision, businessObject), 'resultVariable');
68901
+ const show = useShowCallback(businessObject, path);
68225
68902
  return TextfieldEntry({
68226
68903
  element,
68227
- id: 'resultVariable',
68904
+ id,
68228
68905
  label: translate('Result variable'),
68229
68906
  getValue,
68230
68907
  setValue,
68231
- debounce
68908
+ debounce,
68909
+ show
68232
68910
  });
68233
68911
  } // helper ///////////////////////
68234
68912
 
@@ -69310,21 +69988,24 @@
69310
69988
  element
69311
69989
  } = props;
69312
69990
  const message = getMessage(element);
69313
- const entries = [{
69314
- id: 'messageName',
69315
- component: MessageName,
69316
- isEdited: isEdited$1
69317
- }];
69991
+ const entries = [];
69318
69992
 
69319
- if (!message || !canHaveSubscriptionCorrelationKey(element)) {
69320
- return entries;
69993
+ if (message) {
69994
+ entries.push({
69995
+ id: 'messageName',
69996
+ component: MessageName,
69997
+ isEdited: isEdited$1
69998
+ });
69999
+ }
70000
+
70001
+ if (message && canHaveSubscriptionCorrelationKey(element)) {
70002
+ entries.push({
70003
+ id: 'messageSubscriptionCorrelationKey',
70004
+ component: SubscriptionCorrelationKey,
70005
+ isEdited: isEdited$1
70006
+ });
69321
70007
  }
69322
70008
 
69323
- entries.push({
69324
- id: 'messageSubscriptionCorrelationKey',
69325
- component: SubscriptionCorrelationKey,
69326
- isEdited: isEdited$1
69327
- });
69328
70009
  return entries;
69329
70010
  }
69330
70011
 
@@ -69428,6 +70109,15 @@
69428
70109
  commandStack.execute('properties-panel.multi-command-executor', commands);
69429
70110
  };
69430
70111
 
70112
+ const businessObject = getBusinessObject(element),
70113
+ subscription = getSubscription(businessObject),
70114
+ path = pathConcat(getPath(subscription, businessObject), 'correlationKey');
70115
+ const show = useShowCallback(businessObject, event => {
70116
+ const {
70117
+ error = {}
70118
+ } = event;
70119
+ return pathEquals(event.path, path) || error.type === 'extensionElementRequired' && error.requiredExtensionElement === 'zeebe:Subscription';
70120
+ });
69431
70121
  return TextfieldEntry({
69432
70122
  element,
69433
70123
  id: 'messageSubscriptionCorrelationKey',
@@ -69435,7 +70125,8 @@
69435
70125
  feel: 'required',
69436
70126
  getValue,
69437
70127
  setValue,
69438
- debounce
70128
+ debounce,
70129
+ show
69439
70130
  });
69440
70131
  } // helper ///////////////////////
69441
70132
 
@@ -69524,6 +70215,20 @@
69524
70215
  return setProperty(element, 'inputCollection', value, commandStack, bpmnFactory);
69525
70216
  };
69526
70217
 
70218
+ const businessObject = getBusinessObject(element);
70219
+ const loopCharacteristics = getLoopCharacteristics$1(element),
70220
+ zeebeLoopCharacteristics = getZeebeLoopCharacteristics(loopCharacteristics),
70221
+ path = pathConcat(getPath(zeebeLoopCharacteristics, businessObject), 'inputCollection');
70222
+ const show = useShowCallback(businessObject, event => {
70223
+ const {
70224
+ error = {}
70225
+ } = event;
70226
+ const {
70227
+ requiredExtensionElement,
70228
+ type
70229
+ } = error;
70230
+ return pathEquals(event.path, path) || type === 'extensionElementRequired' && requiredExtensionElement === 'zeebe:LoopCharacteristics';
70231
+ });
69527
70232
  return TextfieldEntry({
69528
70233
  element,
69529
70234
  id: 'multiInstance-inputCollection',
@@ -69531,7 +70236,8 @@
69531
70236
  feel: 'required',
69532
70237
  getValue,
69533
70238
  setValue,
69534
- debounce
70239
+ debounce,
70240
+ show
69535
70241
  });
69536
70242
  }
69537
70243
 
@@ -69579,13 +70285,19 @@
69579
70285
  return setProperty(element, 'outputCollection', value, commandStack, bpmnFactory);
69580
70286
  };
69581
70287
 
70288
+ const businessObject = getBusinessObject(element);
70289
+ const loopCharacteristics = getLoopCharacteristics$1(element),
70290
+ zeebeLoopCharacteristics = getZeebeLoopCharacteristics(loopCharacteristics),
70291
+ path = pathConcat(getPath(zeebeLoopCharacteristics, businessObject), 'outputCollection');
70292
+ const show = useShowCallback(businessObject, path);
69582
70293
  return TextfieldEntry({
69583
70294
  element,
69584
70295
  id: 'multiInstance-outputCollection',
69585
70296
  label: translate('Output collection'),
69586
70297
  getValue,
69587
70298
  setValue,
69588
- debounce
70299
+ debounce,
70300
+ show
69589
70301
  });
69590
70302
  }
69591
70303
 
@@ -69606,6 +70318,11 @@
69606
70318
  return setProperty(element, 'outputElement', value, commandStack, bpmnFactory);
69607
70319
  };
69608
70320
 
70321
+ const businessObject = getBusinessObject(element);
70322
+ const loopCharacteristics = getLoopCharacteristics$1(element),
70323
+ zeebeLoopCharacteristics = getZeebeLoopCharacteristics(loopCharacteristics),
70324
+ path = pathConcat(getPath(zeebeLoopCharacteristics, businessObject), 'outputElement');
70325
+ const show = useShowCallback(businessObject, path);
69609
70326
  return TextfieldEntry({
69610
70327
  element,
69611
70328
  id: 'multiInstance-outputElement',
@@ -69613,7 +70330,8 @@
69613
70330
  feel: 'required',
69614
70331
  getValue,
69615
70332
  setValue,
69616
- debounce
70333
+ debounce,
70334
+ show
69617
70335
  });
69618
70336
  }
69619
70337
 
@@ -70056,7 +70774,8 @@
70056
70774
 
70057
70775
  function TargetProcessId(props) {
70058
70776
  const {
70059
- element
70777
+ element,
70778
+ id
70060
70779
  } = props;
70061
70780
  const commandStack = useService('commandStack'),
70062
70781
  bpmnFactory = useService('bpmnFactory'),
@@ -70121,14 +70840,28 @@
70121
70840
  commandStack.execute('properties-panel.multi-command-executor', commands);
70122
70841
  };
70123
70842
 
70843
+ const businessObject = getBusinessObject(element),
70844
+ calledElement = getCalledElement(element);
70845
+ const path = pathConcat(getPath(calledElement, businessObject), 'processId');
70846
+ const show = useShowCallback(businessObject, event => {
70847
+ const {
70848
+ error = {}
70849
+ } = event;
70850
+ const {
70851
+ type,
70852
+ requiredExtensionElement
70853
+ } = error;
70854
+ return pathEquals(event.path, path) || type === 'extensionElementRequired' && requiredExtensionElement === 'zeebe:CalledElement';
70855
+ });
70124
70856
  return TextfieldEntry({
70125
70857
  element,
70126
- id: 'targetProcessId',
70858
+ id,
70127
70859
  label: translate('Process ID'),
70128
70860
  feel: 'optional',
70129
70861
  getValue,
70130
70862
  setValue,
70131
- debounce
70863
+ debounce,
70864
+ show
70132
70865
  });
70133
70866
  }
70134
70867
 
@@ -70154,7 +70887,8 @@
70154
70887
 
70155
70888
  function TaskDefinitionType(props) {
70156
70889
  const {
70157
- element
70890
+ element,
70891
+ id
70158
70892
  } = props;
70159
70893
  const commandStack = useService('commandStack');
70160
70894
  const bpmnFactory = useService('bpmnFactory');
@@ -70218,20 +70952,35 @@
70218
70952
  commandStack.execute('properties-panel.multi-command-executor', commands);
70219
70953
  };
70220
70954
 
70955
+ const businessObject = getBusinessObject(element),
70956
+ taskDefinition = getTaskDefinition(businessObject);
70957
+ const path = pathConcat(getPath(taskDefinition, businessObject), 'type');
70958
+ const show = useShowCallback(businessObject, event => {
70959
+ const {
70960
+ error = {}
70961
+ } = event;
70962
+ const {
70963
+ type,
70964
+ requiredExtensionElement
70965
+ } = error;
70966
+ return pathEquals(event.path, path) || type === 'extensionElementRequired' && requiredExtensionElement === 'zeebe:TaskDefinition';
70967
+ });
70221
70968
  return TextfieldEntry({
70222
70969
  element,
70223
- id: 'taskDefinitionType',
70970
+ id,
70224
70971
  label: translate('Type'),
70225
70972
  feel: 'optional',
70226
70973
  getValue,
70227
70974
  setValue,
70228
- debounce
70975
+ debounce,
70976
+ show
70229
70977
  });
70230
70978
  }
70231
70979
 
70232
70980
  function TaskDefinitionRetries(props) {
70233
70981
  const {
70234
- element
70982
+ element,
70983
+ id
70235
70984
  } = props;
70236
70985
  const commandStack = useService('commandStack');
70237
70986
  const bpmnFactory = useService('bpmnFactory');
@@ -70294,14 +71043,19 @@
70294
71043
  commandStack.execute('properties-panel.multi-command-executor', commands);
70295
71044
  };
70296
71045
 
71046
+ const businessObject = getBusinessObject(element),
71047
+ taskDefinition = getTaskDefinition(businessObject);
71048
+ const path = pathConcat(getPath(taskDefinition, businessObject), 'retries');
71049
+ const show = useShowCallback(businessObject, path);
70297
71050
  return TextfieldEntry({
70298
71051
  element,
70299
- id: 'taskDefinitionRetries',
71052
+ id,
70300
71053
  label: translate('Retries'),
70301
71054
  feel: 'optional',
70302
71055
  getValue,
70303
71056
  setValue,
70304
- debounce
71057
+ debounce,
71058
+ show
70305
71059
  });
70306
71060
  } // helper ///////////////////////
70307
71061
 
@@ -71610,44 +72364,134 @@
71610
72364
  }
71611
72365
  ElementTemplatesLoader.$inject = ['config.elementTemplates', 'eventBus', 'elementTemplates'];
71612
72366
 
72367
+ function unlinkTemplate$1(element, injector) {
72368
+ const modeling = injector.get('modeling');
72369
+ modeling.updateProperties(element, {
72370
+ 'camunda:modelerTemplate': null,
72371
+ 'camunda:modelerTemplateVersion': null
72372
+ });
72373
+ }
72374
+ function removeTemplate(element, injector) {
72375
+ const replace = injector.get('replace'),
72376
+ selection = injector.get('selection');
72377
+ const businessObject = getBusinessObject(element);
72378
+ const type = businessObject.$type,
72379
+ eventDefinitionType = getEventDefinitionType(businessObject);
72380
+ const newElement = replace.replaceElement(element, {
72381
+ type: type,
72382
+ eventDefinitionType: eventDefinitionType
72383
+ });
72384
+ selection.select(newElement);
72385
+ }
72386
+ function updateTemplate$1(element, newTemplate, injector) {
72387
+ const elementTemplates = injector.get('elementTemplates');
72388
+ return elementTemplates.applyTemplate(element, newTemplate);
72389
+ }
72390
+ function getVersionOrDateFromTemplate(template) {
72391
+ var metadata = template.metadata,
72392
+ version = template.version;
72393
+
72394
+ if (metadata) {
72395
+ if (!isUndefined(metadata.created)) {
72396
+ return toDateString(metadata.created);
72397
+ } else if (!isUndefined(metadata.updated)) {
72398
+ return toDateString(metadata.updated);
72399
+ }
72400
+ }
72401
+
72402
+ if (isUndefined(version)) {
72403
+ return null;
72404
+ }
72405
+
72406
+ return version;
72407
+ } // helper //////
72408
+
72409
+ function getEventDefinitionType(businessObject) {
72410
+ if (!businessObject.eventDefinitions) {
72411
+ return null;
72412
+ }
72413
+
72414
+ var eventDefinition = businessObject.eventDefinitions[0];
72415
+
72416
+ if (!eventDefinition) {
72417
+ return null;
72418
+ }
72419
+
72420
+ return eventDefinition.$type;
72421
+ }
72422
+
72423
+ function toDateString(timestamp) {
72424
+ var date = new Date(timestamp);
72425
+ var year = date.getFullYear();
72426
+ var month = leftPad(String(date.getMonth() + 1), 2, '0');
72427
+ var day = leftPad(String(date.getDate()), 2, '0');
72428
+ return day + '.' + month + '.' + year;
72429
+ }
72430
+
72431
+ function leftPad(string, length, character) {
72432
+ while (string.length < length) {
72433
+ string = character + string;
72434
+ }
72435
+
72436
+ return string;
72437
+ }
72438
+
72439
+ function unlinkTemplate(element, injector) {
72440
+ const modeling = injector.get('modeling');
72441
+ modeling.updateProperties(element, {
72442
+ 'zeebe:modelerTemplate': null,
72443
+ 'zeebe:modelerTemplateVersion': null
72444
+ });
72445
+ }
72446
+ function updateTemplate(element, newTemplate, injector) {
72447
+ const elementTemplates = injector.get('elementTemplates');
72448
+ return elementTemplates.applyTemplate(element, newTemplate);
72449
+ }
72450
+
71613
72451
  /**
71614
- * This function catches the <moddleCopy.canCopyProperty> event
71615
- * and only allows the copy of the modelerTemplate property
71616
- * if the element's type or its parent's is in
71617
- * the list of elements the template applies to.
72452
+ * This Behavior checks if the new element's type is in
72453
+ * the list of elements the template applies to and unlinks
72454
+ * it if not.
71618
72455
  */
71619
72456
 
71620
- function ReplaceBehavior(elementTemplates, eventBus) {
71621
- eventBus.on('moddleCopy.canCopyProperty', function (context) {
71622
- const {
71623
- parent,
71624
- property,
71625
- propertyName
71626
- } = context;
71627
-
71628
- if (propertyName !== 'modelerTemplate') {
71629
- return;
71630
- }
72457
+ class ReplaceBehavior$1 extends CommandInterceptor$1 {
72458
+ constructor(elementTemplates, injector) {
72459
+ super(injector.get('eventBus'));
72460
+ this.postExecuted('shape.replace', function (e) {
72461
+ var context = e.context,
72462
+ oldShape = context.oldShape,
72463
+ oldBo = getBusinessObject(oldShape),
72464
+ newShape = context.newShape,
72465
+ newBo = getBusinessObject(newShape);
71631
72466
 
71632
- const elementTemplate = elementTemplates.get(property);
72467
+ if (!oldBo.modelerTemplate) {
72468
+ return;
72469
+ }
71633
72470
 
71634
- if (!elementTemplate) {
71635
- return false;
71636
- }
72471
+ const template = newBo.modelerTemplate;
72472
+ const version = newBo.modelerTemplateVersion;
72473
+ const elementTemplate = elementTemplates.get(template, version);
71637
72474
 
71638
- const {
71639
- appliesTo
71640
- } = elementTemplate;
71641
- const allowed = appliesTo.reduce((allowed, type) => {
71642
- return allowed || is$1(parent, type);
71643
- }, false);
72475
+ if (!elementTemplate) {
72476
+ unlinkTemplate(newShape, injector);
72477
+ return;
72478
+ }
72479
+
72480
+ const {
72481
+ appliesTo
72482
+ } = elementTemplate;
72483
+ const allowed = appliesTo.reduce((allowed, type) => {
72484
+ return allowed || is$1(newBo, type);
72485
+ }, false);
72486
+
72487
+ if (!allowed) {
72488
+ unlinkTemplate(newShape, injector);
72489
+ }
72490
+ });
72491
+ }
71644
72492
 
71645
- if (!allowed) {
71646
- return false;
71647
- }
71648
- });
71649
72493
  }
71650
- ReplaceBehavior.$inject = ['elementTemplates', 'eventBus'];
72494
+ ReplaceBehavior$1.$inject = ['elementTemplates', 'injector'];
71651
72495
 
71652
72496
  /**
71653
72497
  * Create an input parameter representing the given
@@ -72579,78 +73423,6 @@
72579
73423
  templateElementFactory: ['type', TemplateElementFactory]
72580
73424
  };
72581
73425
 
72582
- function unlinkTemplate$1(element, injector) {
72583
- const modeling = injector.get('modeling');
72584
- modeling.updateProperties(element, {
72585
- 'camunda:modelerTemplate': null,
72586
- 'camunda:modelerTemplateVersion': null
72587
- });
72588
- }
72589
- function removeTemplate(element, injector) {
72590
- const replace = injector.get('replace'),
72591
- selection = injector.get('selection');
72592
- const businessObject = getBusinessObject(element);
72593
- const type = businessObject.$type,
72594
- eventDefinitionType = getEventDefinitionType(businessObject);
72595
- const newElement = replace.replaceElement(element, {
72596
- type: type,
72597
- eventDefinitionType: eventDefinitionType
72598
- });
72599
- selection.select(newElement);
72600
- }
72601
- function updateTemplate$1(element, newTemplate, injector) {
72602
- const elementTemplates = injector.get('elementTemplates');
72603
- return elementTemplates.applyTemplate(element, newTemplate);
72604
- }
72605
- function getVersionOrDateFromTemplate(template) {
72606
- var metadata = template.metadata,
72607
- version = template.version;
72608
-
72609
- if (metadata) {
72610
- if (!isUndefined(metadata.created)) {
72611
- return toDateString(metadata.created);
72612
- } else if (!isUndefined(metadata.updated)) {
72613
- return toDateString(metadata.updated);
72614
- }
72615
- }
72616
-
72617
- if (isUndefined(version)) {
72618
- return null;
72619
- }
72620
-
72621
- return version;
72622
- } // helper //////
72623
-
72624
- function getEventDefinitionType(businessObject) {
72625
- if (!businessObject.eventDefinitions) {
72626
- return null;
72627
- }
72628
-
72629
- var eventDefinition = businessObject.eventDefinitions[0];
72630
-
72631
- if (!eventDefinition) {
72632
- return null;
72633
- }
72634
-
72635
- return eventDefinition.$type;
72636
- }
72637
-
72638
- function toDateString(timestamp) {
72639
- var date = new Date(timestamp);
72640
- var year = date.getFullYear();
72641
- var month = leftPad(String(date.getMonth() + 1), 2, '0');
72642
- var day = leftPad(String(date.getDate()), 2, '0');
72643
- return day + '.' + month + '.' + year;
72644
- }
72645
-
72646
- function leftPad(string, length, character) {
72647
- while (string.length < length) {
72648
- string = character + string;
72649
- }
72650
-
72651
- return string;
72652
- }
72653
-
72654
73426
  function createElementTemplatesGroup(props = {}) {
72655
73427
  const {
72656
73428
  getTemplateId: getTemplateId$1 = getTemplateId,
@@ -73405,7 +74177,8 @@
73405
74177
  id,
73406
74178
  label,
73407
74179
  component: Group,
73408
- entries: []
74180
+ entries: [],
74181
+ shouldOpen: true
73409
74182
  };
73410
74183
  properties.forEach((property, index) => {
73411
74184
  const entry = createCustomEntry$1(`custom-entry-${templateId}-${index}`, element, property);
@@ -73976,18 +74749,6 @@
73976
74749
  return find(groups, g => g.id === id);
73977
74750
  }
73978
74751
 
73979
- function unlinkTemplate(element, injector) {
73980
- const modeling = injector.get('modeling');
73981
- modeling.updateProperties(element, {
73982
- 'zeebe:modelerTemplate': null,
73983
- 'zeebe:modelerTemplateVersion': null
73984
- });
73985
- }
73986
- function updateTemplate(element, newTemplate, injector) {
73987
- const elementTemplates = injector.get('elementTemplates');
73988
- return elementTemplates.applyTemplate(element, newTemplate);
73989
- }
73990
-
73991
74752
  const LOWER_PRIORITY$1 = 300;
73992
74753
  class ElementTemplatesPropertiesProvider$1 {
73993
74754
  constructor(elementTemplates, propertiesPanel, injector) {
@@ -74083,7 +74844,7 @@
74083
74844
  __init__: ['elementTemplatesLoader', 'replaceBehavior', 'elementTemplatesPropertiesProvider'],
74084
74845
  elementTemplates: ['type', ElementTemplates],
74085
74846
  elementTemplatesLoader: ['type', ElementTemplatesLoader],
74086
- replaceBehavior: ['type', ReplaceBehavior],
74847
+ replaceBehavior: ['type', ReplaceBehavior$1],
74087
74848
  elementTemplatesPropertiesProvider: ['type', ElementTemplatesPropertiesProvider$1]
74088
74849
  };
74089
74850
 
@@ -74379,142 +75140,6 @@
74379
75140
  disabledCollapsedSubprocessPopupProvider: [ 'type', DisabledCollapsedSubprocessPopupProvider ]
74380
75141
  };
74381
75142
 
74382
- var DEFAULT_PRIORITY$7 = 1000;
74383
-
74384
- /**
74385
- * A utility that can be used to plug-in into the command execution for
74386
- * extension and/or validation.
74387
- *
74388
- * @param {EventBus} eventBus
74389
- *
74390
- * @example
74391
- *
74392
- * import inherits from 'inherits';
74393
- *
74394
- * import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
74395
- *
74396
- * function CommandLogger(eventBus) {
74397
- * CommandInterceptor.call(this, eventBus);
74398
- *
74399
- * this.preExecute(function(event) {
74400
- * console.log('command pre-execute', event);
74401
- * });
74402
- * }
74403
- *
74404
- * inherits(CommandLogger, CommandInterceptor);
74405
- *
74406
- */
74407
- function CommandInterceptor$1(eventBus) {
74408
- this._eventBus = eventBus;
74409
- }
74410
-
74411
- CommandInterceptor$1.$inject = [ 'eventBus' ];
74412
-
74413
- function unwrapEvent$1(fn, that) {
74414
- return function(event) {
74415
- return fn.call(that || null, event.context, event.command, event);
74416
- };
74417
- }
74418
-
74419
- /**
74420
- * Register an interceptor for a command execution
74421
- *
74422
- * @param {string|Array<string>} [events] list of commands to register on
74423
- * @param {string} [hook] command hook, i.e. preExecute, executed to listen on
74424
- * @param {number} [priority] the priority on which to hook into the execution
74425
- * @param {Function} handlerFn interceptor to be invoked with (event)
74426
- * @param {boolean} unwrap if true, unwrap the event and pass (context, command, event) to the
74427
- * listener instead
74428
- * @param {Object} [that] Pass context (`this`) to the handler function
74429
- */
74430
- CommandInterceptor$1.prototype.on = function(events, hook, priority, handlerFn, unwrap, that) {
74431
-
74432
- if (isFunction(hook) || isNumber(hook)) {
74433
- that = unwrap;
74434
- unwrap = handlerFn;
74435
- handlerFn = priority;
74436
- priority = hook;
74437
- hook = null;
74438
- }
74439
-
74440
- if (isFunction(priority)) {
74441
- that = unwrap;
74442
- unwrap = handlerFn;
74443
- handlerFn = priority;
74444
- priority = DEFAULT_PRIORITY$7;
74445
- }
74446
-
74447
- if (isObject(unwrap)) {
74448
- that = unwrap;
74449
- unwrap = false;
74450
- }
74451
-
74452
- if (!isFunction(handlerFn)) {
74453
- throw new Error('handlerFn must be a function');
74454
- }
74455
-
74456
- if (!isArray(events)) {
74457
- events = [ events ];
74458
- }
74459
-
74460
- var eventBus = this._eventBus;
74461
-
74462
- forEach(events, function(event) {
74463
-
74464
- // concat commandStack(.event)?(.hook)?
74465
- var fullEvent = [ 'commandStack', event, hook ].filter(function(e) { return e; }).join('.');
74466
-
74467
- eventBus.on(fullEvent, priority, unwrap ? unwrapEvent$1(handlerFn, that) : handlerFn, that);
74468
- });
74469
- };
74470
-
74471
-
74472
- var hooks$1 = [
74473
- 'canExecute',
74474
- 'preExecute',
74475
- 'preExecuted',
74476
- 'execute',
74477
- 'executed',
74478
- 'postExecute',
74479
- 'postExecuted',
74480
- 'revert',
74481
- 'reverted'
74482
- ];
74483
-
74484
- /*
74485
- * Install hook shortcuts
74486
- *
74487
- * This will generate the CommandInterceptor#(preExecute|...|reverted) methods
74488
- * which will in term forward to CommandInterceptor#on.
74489
- */
74490
- forEach(hooks$1, function(hook) {
74491
-
74492
- /**
74493
- * {canExecute|preExecute|preExecuted|execute|executed|postExecute|postExecuted|revert|reverted}
74494
- *
74495
- * A named hook for plugging into the command execution
74496
- *
74497
- * @param {string|Array<string>} [events] list of commands to register on
74498
- * @param {number} [priority] the priority on which to hook into the execution
74499
- * @param {Function} handlerFn interceptor to be invoked with (event)
74500
- * @param {boolean} [unwrap=false] if true, unwrap the event and pass (context, command, event) to the
74501
- * listener instead
74502
- * @param {Object} [that] Pass context (`this`) to the handler function
74503
- */
74504
- CommandInterceptor$1.prototype[hook] = function(events, priority, handlerFn, unwrap, that) {
74505
-
74506
- if (isFunction(events) || isNumber(events)) {
74507
- that = unwrap;
74508
- unwrap = handlerFn;
74509
- handlerFn = priority;
74510
- priority = events;
74511
- events = null;
74512
- }
74513
-
74514
- this.on(events, hook, priority, handlerFn, unwrap, that);
74515
- };
74516
- });
74517
-
74518
75143
  /**
74519
75144
  * Get extension elements of business object. Optionally filter by type.
74520
75145
  *
@@ -74568,7 +75193,7 @@
74568
75193
  });
74569
75194
  }
74570
75195
 
74571
- const HIGH_PRIORITY$l = 5000;
75196
+ const HIGH_PRIORITY$m = 5000;
74572
75197
 
74573
75198
 
74574
75199
  /**
@@ -74584,7 +75209,7 @@
74584
75209
  /**
74585
75210
  * Remove zeebe:CalledDecision if zeebe:TaskDefinition is about to be added.
74586
75211
  */
74587
- this.preExecute('element.updateModdleProperties' , HIGH_PRIORITY$l, function(context) {
75212
+ this.preExecute('element.updateModdleProperties' , HIGH_PRIORITY$m, function(context) {
74588
75213
  const {
74589
75214
  element,
74590
75215
  moddleElement,
@@ -74615,7 +75240,7 @@
74615
75240
  /**
74616
75241
  * Remove zeebe:TaskDefinition and zeebe:TaskHeaders if zeebe:CalledDecision is about to be added.
74617
75242
  */
74618
- this.preExecute('element.updateModdleProperties', HIGH_PRIORITY$l, function(context) {
75243
+ this.preExecute('element.updateModdleProperties', HIGH_PRIORITY$m, function(context) {
74619
75244
  const {
74620
75245
  element,
74621
75246
  moddleElement,
@@ -74673,7 +75298,7 @@
74673
75298
  return getExtensionElementsList$1(businessObject, 'zeebe:TaskHeaders')[ 0 ];
74674
75299
  }
74675
75300
 
74676
- const HIGH_PRIORITY$m = 5000;
75301
+ const HIGH_PRIORITY$n = 5000;
74677
75302
 
74678
75303
 
74679
75304
  /**
@@ -74686,7 +75311,7 @@
74686
75311
  /**
74687
75312
  * Replace intermediate catch event with boundary event when attaching it to a shape.
74688
75313
  */
74689
- this.preExecute('shape.create', HIGH_PRIORITY$m, function(context) {
75314
+ this.preExecute('shape.create', HIGH_PRIORITY$n, function(context) {
74690
75315
  const {
74691
75316
  shape,
74692
75317
  host
@@ -74878,7 +75503,7 @@
74878
75503
  }
74879
75504
  }
74880
75505
 
74881
- const HIGH_PRIORITY$n = 5000;
75506
+ const HIGH_PRIORITY$o = 5000;
74882
75507
 
74883
75508
 
74884
75509
  /**
@@ -74892,7 +75517,7 @@
74892
75517
  * Add zeebe:CalledElement extension element with zeebe:propagateAllChildVariables attribute = false
74893
75518
  * when creating bpmn:CallActivity.
74894
75519
  */
74895
- this.postExecuted('shape.create', HIGH_PRIORITY$n, function(context) {
75520
+ this.postExecuted('shape.create', HIGH_PRIORITY$o, function(context) {
74896
75521
  const { shape } = context;
74897
75522
 
74898
75523
  if (!is$1(shape, 'bpmn:CallActivity')) {
@@ -74904,18 +75529,30 @@
74904
75529
  let calledElement = getCalledElement$1(businessObject);
74905
75530
 
74906
75531
  if (!calledElement) {
74907
- calledElement = bpmnFactory.create('zeebe:CalledElement', {
74908
- propagateAllChildVariables: false
74909
- });
74910
-
74911
75532
  let extensionElements = businessObject.get('extensionElements');
74912
75533
 
74913
75534
  if (!extensionElements) {
74914
- extensionElements = createElement$1('bpmn:ExtensionElements', { values: [] }, businessObject, bpmnFactory);
75535
+ extensionElements = createElement$1(
75536
+ 'bpmn:ExtensionElements',
75537
+ {
75538
+ values: []
75539
+ },
75540
+ businessObject,
75541
+ bpmnFactory
75542
+ );
74915
75543
 
74916
75544
  modeling.updateProperties(shape, { extensionElements });
74917
75545
  }
74918
75546
 
75547
+ calledElement = createElement$1(
75548
+ 'zeebe:CalledElement',
75549
+ {
75550
+ propagateAllChildVariables: false
75551
+ },
75552
+ extensionElements,
75553
+ bpmnFactory
75554
+ );
75555
+
74919
75556
  modeling.updateModdleProperties(shape, extensionElements, {
74920
75557
  values: [
74921
75558
  ...(extensionElements.values || []),
@@ -75140,7 +75777,7 @@
75140
75777
  return parent;
75141
75778
  }
75142
75779
 
75143
- const HIGH_PRIORITY$o = 5000;
75780
+ const HIGH_PRIORITY$p = 5000;
75144
75781
 
75145
75782
 
75146
75783
  /**
@@ -75151,7 +75788,7 @@
75151
75788
  constructor(commandStack, eventBus) {
75152
75789
  super(eventBus);
75153
75790
 
75154
- this.postExecuted('element.updateModdleProperties' , HIGH_PRIORITY$o, function(context) {
75791
+ this.postExecuted('element.updateModdleProperties' , HIGH_PRIORITY$p, function(context) {
75155
75792
  const {
75156
75793
  element,
75157
75794
  moddleElement
@@ -75182,7 +75819,7 @@
75182
75819
  'eventBus'
75183
75820
  ];
75184
75821
 
75185
- const HIGH_PRIORITY$p = 5000;
75822
+ const HIGH_PRIORITY$q = 5000;
75186
75823
 
75187
75824
 
75188
75825
  /**
@@ -75200,7 +75837,7 @@
75200
75837
  * Remove zeebe:Output elements if zeebe:propagateAllChildVariables is set to true.
75201
75838
  * Remove zeebe:IoMapping extension element if empty.
75202
75839
  */
75203
- this.postExecute('element.updateModdleProperties' , HIGH_PRIORITY$p, function(context) {
75840
+ this.postExecute('element.updateModdleProperties' , HIGH_PRIORITY$q, function(context) {
75204
75841
  const {
75205
75842
  element,
75206
75843
  moddleElement,
@@ -75240,7 +75877,7 @@
75240
75877
  * Set zeebe:propagateAllChildVariables of zeebe:CalledElement to false if
75241
75878
  * zeebe:Output or zeebe:IoMapping with zeebe:Output is added.
75242
75879
  */
75243
- this.preExecute('element.updateModdleProperties' , HIGH_PRIORITY$p, function(context) {
75880
+ this.preExecute('element.updateModdleProperties' , HIGH_PRIORITY$q, function(context) {
75244
75881
  const {
75245
75882
  element,
75246
75883
  moddleElement,
@@ -75540,7 +76177,7 @@
75540
76177
  zeebeReplaceMenuProvider: [ 'type', ReplaceMenuProvider$1 ]
75541
76178
  };
75542
76179
 
75543
- const HIGH_PRIORITY$q = 5000;
76180
+ const HIGH_PRIORITY$r = 5000;
75544
76181
 
75545
76182
  /**
75546
76183
  * Zeebe rule provider that allows to create boundary events with catch events
@@ -75558,7 +76195,7 @@
75558
76195
 
75559
76196
  init() {
75560
76197
  super.init();
75561
- this.addRule('shape.attach', HIGH_PRIORITY$q,(context) => {
76198
+ this.addRule('shape.attach', HIGH_PRIORITY$r,(context) => {
75562
76199
  return this.canAttach(
75563
76200
  context.shape,
75564
76201
  context.target,
@@ -76019,8 +76656,6 @@
76019
76656
  types: types$6
76020
76657
  };
76021
76658
 
76022
- var require$$0 = /*@__PURE__*/getAugmentedNamespace(index_esm);
76023
-
76024
76659
  var isFunction$1 = require$$0.isFunction,
76025
76660
  isObject$1 = require$$0.isObject,
76026
76661
  some$1 = require$$0.some;