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.
- package/CHANGELOG.md +19 -2
- package/dist/assets/properties-panel copy.css +877 -0
- package/dist/assets/properties-panel.css +0 -20
- package/dist/base-modeler.development.js +791 -176
- package/dist/base-modeler.production.min.js +4 -4
- package/dist/camunda-cloud-modeler.development.js +1175 -540
- package/dist/camunda-cloud-modeler.production.min.js +2 -2
- package/dist/camunda-platform-modeler.development.js +960 -444
- package/dist/camunda-platform-modeler.production.min.js +2 -2
- package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeCallActivityBehavior.js +17 -5
- package/package.json +3 -3
- package/dist/assets/bpmn-font/bpmn-codes.css +0 -108
- package/dist/assets/bpmn-font/bpmn-embedded.css +0 -161
- package/dist/assets/bpmn-font/bpmn.css +0 -164
- package/dist/assets/bpmn-font/bpmn.eot +0 -0
- package/dist/assets/bpmn-font/bpmn.svg +0 -224
- package/dist/assets/bpmn-font/bpmn.ttf +0 -0
- package/dist/assets/bpmn-font/bpmn.woff +0 -0
- package/dist/assets/bpmn-font/bpmn.woff2 +0 -0
|
@@ -61543,31 +61543,130 @@
|
|
|
61543
61543
|
}());
|
|
61544
61544
|
});
|
|
61545
61545
|
|
|
61546
|
+
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};
|
|
61547
|
+
|
|
61546
61548
|
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}
|
|
61547
61549
|
|
|
61548
|
-
|
|
61550
|
+
var ArrowIcon = function ArrowIcon(props) {
|
|
61551
|
+
return o$2("svg", { ...props,
|
|
61552
|
+
children: o$2("path", {
|
|
61553
|
+
fillRule: "evenodd",
|
|
61554
|
+
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"
|
|
61555
|
+
})
|
|
61556
|
+
});
|
|
61557
|
+
};
|
|
61549
61558
|
|
|
61550
|
-
|
|
61551
|
-
|
|
61552
|
-
|
|
61559
|
+
ArrowIcon.defaultProps = {
|
|
61560
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
61561
|
+
width: "16",
|
|
61562
|
+
height: "16"
|
|
61563
|
+
};
|
|
61564
|
+
|
|
61565
|
+
var CreateIcon = function CreateIcon(props) {
|
|
61566
|
+
return o$2("svg", { ...props,
|
|
61567
|
+
children: o$2("path", {
|
|
61568
|
+
fillRule: "evenodd",
|
|
61569
|
+
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"
|
|
61570
|
+
})
|
|
61571
|
+
});
|
|
61572
|
+
};
|
|
61573
|
+
|
|
61574
|
+
CreateIcon.defaultProps = {
|
|
61575
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
61576
|
+
width: "16",
|
|
61577
|
+
height: "16"
|
|
61578
|
+
};
|
|
61579
|
+
|
|
61580
|
+
var DeleteIcon = function DeleteIcon(props) {
|
|
61581
|
+
return o$2("svg", { ...props,
|
|
61582
|
+
children: o$2("path", {
|
|
61583
|
+
fillRule: "evenodd",
|
|
61584
|
+
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"
|
|
61585
|
+
})
|
|
61586
|
+
});
|
|
61587
|
+
};
|
|
61588
|
+
|
|
61589
|
+
DeleteIcon.defaultProps = {
|
|
61590
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
61591
|
+
width: "16",
|
|
61592
|
+
height: "16"
|
|
61593
|
+
};
|
|
61594
|
+
|
|
61595
|
+
var ExternalLinkIcon = function ExternalLinkIcon(props) {
|
|
61596
|
+
return o$2("svg", { ...props,
|
|
61597
|
+
children: o$2("path", {
|
|
61598
|
+
fillRule: "evenodd",
|
|
61599
|
+
clipRule: "evenodd",
|
|
61600
|
+
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",
|
|
61601
|
+
fill: "#818798"
|
|
61602
|
+
})
|
|
61603
|
+
});
|
|
61604
|
+
};
|
|
61605
|
+
|
|
61606
|
+
ExternalLinkIcon.defaultProps = {
|
|
61607
|
+
width: "16",
|
|
61608
|
+
height: "16",
|
|
61609
|
+
fill: "none",
|
|
61610
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
61611
|
+
};
|
|
61612
|
+
|
|
61613
|
+
var FeelRequiredIcon = function FeelRequiredIcon(props) {
|
|
61614
|
+
return o$2("svg", { ...props,
|
|
61615
|
+
children: [o$2("path", {
|
|
61616
|
+
d: "M5.8 7.06V5.95h4.307v1.11H5.8zm0 3.071v-1.11h4.307v1.11H5.8z",
|
|
61617
|
+
fill: "#505562"
|
|
61618
|
+
}), o$2("path", {
|
|
61619
|
+
fillRule: "evenodd",
|
|
61620
|
+
clipRule: "evenodd",
|
|
61621
|
+
d: "M8 3.268A4.732 4.732 0 1 0 12.732 8H14a6 6 0 1 1-6-6v1.268z",
|
|
61622
|
+
fill: "#505562"
|
|
61623
|
+
}), o$2("path", {
|
|
61624
|
+
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",
|
|
61625
|
+
fill: "#505562"
|
|
61626
|
+
})]
|
|
61627
|
+
});
|
|
61628
|
+
};
|
|
61629
|
+
|
|
61630
|
+
FeelRequiredIcon.defaultProps = {
|
|
61631
|
+
viewBox: "0 0 16 16",
|
|
61632
|
+
fill: "none",
|
|
61633
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
61634
|
+
};
|
|
61635
|
+
|
|
61636
|
+
var FeelOptionalIcon = function FeelOptionalIcon(props) {
|
|
61637
|
+
return o$2("svg", { ...props,
|
|
61638
|
+
children: [o$2("path", {
|
|
61639
|
+
d: "M5.845 7.04V5.93h4.307v1.11H5.845zm0 3.07V9h4.307v1.11H5.845z",
|
|
61640
|
+
fill: "#505562"
|
|
61641
|
+
}), o$2("path", {
|
|
61642
|
+
fillRule: "evenodd",
|
|
61643
|
+
clipRule: "evenodd",
|
|
61644
|
+
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",
|
|
61645
|
+
fill: "#505562"
|
|
61646
|
+
})]
|
|
61647
|
+
});
|
|
61648
|
+
};
|
|
61649
|
+
|
|
61650
|
+
FeelOptionalIcon.defaultProps = {
|
|
61651
|
+
viewBox: "0 0 16 16",
|
|
61652
|
+
fill: "none",
|
|
61653
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
61654
|
+
};
|
|
61553
61655
|
|
|
61554
|
-
/**
|
|
61555
|
-
* @param {Object} props
|
|
61556
|
-
* @param {Object} props.element,
|
|
61557
|
-
* @param {HeaderProvider} props.headerProvider
|
|
61558
|
-
*/
|
|
61559
61656
|
function Header(props) {
|
|
61560
61657
|
const {
|
|
61561
61658
|
element,
|
|
61562
61659
|
headerProvider
|
|
61563
61660
|
} = props;
|
|
61564
61661
|
const {
|
|
61662
|
+
getElementIcon,
|
|
61663
|
+
getDocumentationRef,
|
|
61565
61664
|
getElementLabel,
|
|
61566
|
-
getTypeLabel
|
|
61567
|
-
getElementIcon
|
|
61665
|
+
getTypeLabel
|
|
61568
61666
|
} = headerProvider;
|
|
61569
61667
|
const label = getElementLabel(element);
|
|
61570
61668
|
const type = getTypeLabel(element);
|
|
61669
|
+
const documentationRef = getDocumentationRef && getDocumentationRef(element);
|
|
61571
61670
|
const ElementIcon = getElementIcon(element);
|
|
61572
61671
|
return o$2("div", {
|
|
61573
61672
|
class: "bio-properties-panel-header",
|
|
@@ -61584,28 +61683,154 @@
|
|
|
61584
61683
|
title: type,
|
|
61585
61684
|
class: "bio-properties-panel-header-type",
|
|
61586
61685
|
children: type
|
|
61587
|
-
}),
|
|
61686
|
+
}), label ? o$2("div", {
|
|
61588
61687
|
title: label,
|
|
61589
61688
|
class: "bio-properties-panel-header-label",
|
|
61590
61689
|
children: label
|
|
61591
61690
|
}) : null]
|
|
61691
|
+
}), o$2("div", {
|
|
61692
|
+
class: "bio-properties-panel-header-actions",
|
|
61693
|
+
children: documentationRef ? o$2("a", {
|
|
61694
|
+
rel: "noopener",
|
|
61695
|
+
class: "bio-properties-panel-header-link",
|
|
61696
|
+
href: documentationRef,
|
|
61697
|
+
title: "Open documentation",
|
|
61698
|
+
target: "_blank",
|
|
61699
|
+
children: o$2(ExternalLinkIcon, {})
|
|
61700
|
+
}) : null
|
|
61592
61701
|
})]
|
|
61593
61702
|
});
|
|
61594
61703
|
}
|
|
61595
61704
|
|
|
61705
|
+
const DescriptionContext = q({
|
|
61706
|
+
description: {},
|
|
61707
|
+
getDescriptionForId: () => {}
|
|
61708
|
+
});
|
|
61709
|
+
|
|
61710
|
+
/**
|
|
61711
|
+
* @typedef {Function} <propertiesPanel.showEntry> callback
|
|
61712
|
+
*
|
|
61713
|
+
* @example
|
|
61714
|
+
*
|
|
61715
|
+
* useEvent('propertiesPanel.showEntry', ({ focus = false, ...rest }) => {
|
|
61716
|
+
* // ...
|
|
61717
|
+
* });
|
|
61718
|
+
*
|
|
61719
|
+
* @param {Object} context
|
|
61720
|
+
* @param {boolean} [context.focus]
|
|
61721
|
+
*
|
|
61722
|
+
* @returns void
|
|
61723
|
+
*/
|
|
61724
|
+
const EventContext = q({
|
|
61725
|
+
eventBus: null
|
|
61726
|
+
});
|
|
61727
|
+
|
|
61728
|
+
const LayoutContext = q({
|
|
61729
|
+
layout: {},
|
|
61730
|
+
setLayout: () => {},
|
|
61731
|
+
getLayoutForKey: () => {},
|
|
61732
|
+
setLayoutForKey: () => {}
|
|
61733
|
+
});
|
|
61734
|
+
|
|
61735
|
+
/**
|
|
61736
|
+
* Accesses the global DescriptionContext and returns a description for a given id and element.
|
|
61737
|
+
*
|
|
61738
|
+
* @example
|
|
61739
|
+
* ```jsx
|
|
61740
|
+
* function TextField(props) {
|
|
61741
|
+
* const description = useDescriptionContext('input1', element);
|
|
61742
|
+
* }
|
|
61743
|
+
* ```
|
|
61744
|
+
*
|
|
61745
|
+
* @param {string} id
|
|
61746
|
+
* @param {djs.model.Base} element
|
|
61747
|
+
*
|
|
61748
|
+
* @returns {string}
|
|
61749
|
+
*/
|
|
61750
|
+
|
|
61751
|
+
function useDescriptionContext(id, element) {
|
|
61752
|
+
const {
|
|
61753
|
+
getDescriptionForId
|
|
61754
|
+
} = F(DescriptionContext);
|
|
61755
|
+
return getDescriptionForId(id, element);
|
|
61756
|
+
}
|
|
61757
|
+
|
|
61758
|
+
const DEFAULT_PRIORITY$6 = 1000;
|
|
61596
61759
|
/**
|
|
61597
|
-
*
|
|
61598
|
-
* state on updates.
|
|
61760
|
+
* Subscribe to an event.
|
|
61599
61761
|
*
|
|
61600
|
-
*
|
|
61762
|
+
* @param {string} event
|
|
61763
|
+
* @param {Function} callback
|
|
61764
|
+
* @param {number} [priority]
|
|
61765
|
+
*
|
|
61766
|
+
* @returns {import('preact').Ref}
|
|
61601
61767
|
*/
|
|
61602
61768
|
|
|
61603
|
-
function
|
|
61604
|
-
const
|
|
61769
|
+
function useEvent(event, callback, priority = DEFAULT_PRIORITY$6) {
|
|
61770
|
+
const {
|
|
61771
|
+
eventBus
|
|
61772
|
+
} = F(EventContext);
|
|
61605
61773
|
y$1(() => {
|
|
61606
|
-
|
|
61774
|
+
if (!eventBus) {
|
|
61775
|
+
return;
|
|
61776
|
+
}
|
|
61777
|
+
|
|
61778
|
+
eventBus.on(event, priority, callback);
|
|
61779
|
+
return () => eventBus.off(event, callback);
|
|
61780
|
+
}, [callback, event, eventBus, priority]);
|
|
61781
|
+
}
|
|
61782
|
+
|
|
61783
|
+
const HIGH_PRIORITY$l = 10000;
|
|
61784
|
+
/**
|
|
61785
|
+
* Buffer events and re-fire during passive effect phase.
|
|
61786
|
+
*
|
|
61787
|
+
* @param {string[]} bufferedEvents
|
|
61788
|
+
* @param {Object} [eventBus]
|
|
61789
|
+
*/
|
|
61790
|
+
|
|
61791
|
+
function useEventBuffer(bufferedEvents, eventBus) {
|
|
61792
|
+
const buffer = s$1([]),
|
|
61793
|
+
buffering = s$1(true);
|
|
61794
|
+
|
|
61795
|
+
const createCallback = event => data => {
|
|
61796
|
+
if (buffering.current === true) {
|
|
61797
|
+
buffer.current.unshift([event, data]);
|
|
61798
|
+
}
|
|
61799
|
+
}; // (1) buffer events
|
|
61800
|
+
|
|
61801
|
+
|
|
61802
|
+
y$1(() => {
|
|
61803
|
+
if (!eventBus) {
|
|
61804
|
+
return;
|
|
61805
|
+
}
|
|
61806
|
+
|
|
61807
|
+
const listeners = bufferedEvents.map(event => {
|
|
61808
|
+
return [event, createCallback(event)];
|
|
61809
|
+
});
|
|
61810
|
+
listeners.forEach(([event, callback]) => {
|
|
61811
|
+
eventBus.on(event, HIGH_PRIORITY$l, callback);
|
|
61812
|
+
});
|
|
61813
|
+
return () => {
|
|
61814
|
+
listeners.forEach(([event, callback]) => {
|
|
61815
|
+
eventBus.off(event, callback);
|
|
61816
|
+
});
|
|
61817
|
+
};
|
|
61818
|
+
}, [bufferedEvents, eventBus]); // (2) re-fire events
|
|
61819
|
+
|
|
61820
|
+
y$1(() => {
|
|
61821
|
+
if (!eventBus) {
|
|
61822
|
+
return;
|
|
61823
|
+
}
|
|
61824
|
+
|
|
61825
|
+
buffering.current = false;
|
|
61826
|
+
|
|
61827
|
+
while (buffer.current.length) {
|
|
61828
|
+
const [event, data] = buffer.current.pop();
|
|
61829
|
+
eventBus.fire(event, data);
|
|
61830
|
+
}
|
|
61831
|
+
|
|
61832
|
+
buffering.current = true;
|
|
61607
61833
|
});
|
|
61608
|
-
return ref.current;
|
|
61609
61834
|
}
|
|
61610
61835
|
|
|
61611
61836
|
const KEY_LENGTH = 6;
|
|
@@ -61646,18 +61871,6 @@
|
|
|
61646
61871
|
return getKey;
|
|
61647
61872
|
}
|
|
61648
61873
|
|
|
61649
|
-
const DescriptionContext = q({
|
|
61650
|
-
description: {},
|
|
61651
|
-
getDescriptionForId: () => {}
|
|
61652
|
-
});
|
|
61653
|
-
|
|
61654
|
-
const LayoutContext = q({
|
|
61655
|
-
layout: {},
|
|
61656
|
-
setLayout: () => {},
|
|
61657
|
-
getLayoutForKey: () => {},
|
|
61658
|
-
setLayoutForKey: () => {}
|
|
61659
|
-
});
|
|
61660
|
-
|
|
61661
61874
|
/**
|
|
61662
61875
|
* Creates a state that persists in the global LayoutContext.
|
|
61663
61876
|
*
|
|
@@ -61693,124 +61906,104 @@
|
|
|
61693
61906
|
}
|
|
61694
61907
|
|
|
61695
61908
|
/**
|
|
61696
|
-
*
|
|
61697
|
-
*
|
|
61698
|
-
* @example
|
|
61699
|
-
* ```jsx
|
|
61700
|
-
* function TextField(props) {
|
|
61701
|
-
* const description = useDescriptionContext('input1', element);
|
|
61702
|
-
* }
|
|
61703
|
-
* ```
|
|
61704
|
-
*
|
|
61705
|
-
* @param {string} id
|
|
61706
|
-
* @param {djs.model.Base} element
|
|
61909
|
+
* @pinussilvestrus: we need to introduce our own hook to persist the previous
|
|
61910
|
+
* state on updates.
|
|
61707
61911
|
*
|
|
61708
|
-
*
|
|
61912
|
+
* cf. https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
|
|
61709
61913
|
*/
|
|
61710
61914
|
|
|
61711
|
-
function
|
|
61712
|
-
const
|
|
61713
|
-
|
|
61714
|
-
|
|
61715
|
-
return getDescriptionForId(id, element);
|
|
61716
|
-
}
|
|
61717
|
-
|
|
61718
|
-
var ArrowIcon = function ArrowIcon(props) {
|
|
61719
|
-
return o$2("svg", { ...props,
|
|
61720
|
-
children: o$2("path", {
|
|
61721
|
-
fillRule: "evenodd",
|
|
61722
|
-
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"
|
|
61723
|
-
})
|
|
61915
|
+
function usePrevious(value) {
|
|
61916
|
+
const ref = s$1();
|
|
61917
|
+
y$1(() => {
|
|
61918
|
+
ref.current = value;
|
|
61724
61919
|
});
|
|
61725
|
-
|
|
61920
|
+
return ref.current;
|
|
61921
|
+
}
|
|
61726
61922
|
|
|
61727
|
-
|
|
61728
|
-
|
|
61729
|
-
|
|
61730
|
-
|
|
61731
|
-
|
|
61923
|
+
/**
|
|
61924
|
+
* Subscribe to `propertiesPanel.showEntry`.
|
|
61925
|
+
*
|
|
61926
|
+
* @param {Function} show
|
|
61927
|
+
*
|
|
61928
|
+
* @returns {import('preact').Ref}
|
|
61929
|
+
*/
|
|
61732
61930
|
|
|
61733
|
-
|
|
61734
|
-
|
|
61735
|
-
|
|
61736
|
-
|
|
61737
|
-
|
|
61738
|
-
|
|
61739
|
-
|
|
61740
|
-
|
|
61931
|
+
function useShowEntryEvent(show) {
|
|
61932
|
+
const {
|
|
61933
|
+
onShow
|
|
61934
|
+
} = F(LayoutContext);
|
|
61935
|
+
const ref = s$1();
|
|
61936
|
+
const [focus, setFocus] = l(false);
|
|
61937
|
+
const onShowEntry = A$1(event => {
|
|
61938
|
+
if (show(event)) {
|
|
61939
|
+
if (isFunction(onShow)) {
|
|
61940
|
+
onShow();
|
|
61941
|
+
}
|
|
61741
61942
|
|
|
61742
|
-
|
|
61743
|
-
|
|
61744
|
-
|
|
61745
|
-
|
|
61746
|
-
|
|
61943
|
+
if (event.focus && !focus) {
|
|
61944
|
+
setFocus(true);
|
|
61945
|
+
}
|
|
61946
|
+
}
|
|
61947
|
+
}, [show]);
|
|
61948
|
+
y$1(() => {
|
|
61949
|
+
if (focus && ref.current) {
|
|
61950
|
+
if (isFunction(ref.current.focus)) {
|
|
61951
|
+
ref.current.focus();
|
|
61952
|
+
}
|
|
61747
61953
|
|
|
61748
|
-
|
|
61749
|
-
|
|
61750
|
-
|
|
61751
|
-
fillRule: "evenodd",
|
|
61752
|
-
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"
|
|
61753
|
-
})
|
|
61754
|
-
});
|
|
61755
|
-
};
|
|
61954
|
+
if (isFunction(ref.current.select)) {
|
|
61955
|
+
ref.current.select();
|
|
61956
|
+
}
|
|
61756
61957
|
|
|
61757
|
-
|
|
61758
|
-
|
|
61759
|
-
|
|
61760
|
-
|
|
61761
|
-
|
|
61958
|
+
setFocus(false);
|
|
61959
|
+
}
|
|
61960
|
+
}, [focus]);
|
|
61961
|
+
useEvent('propertiesPanel.showEntry', onShowEntry);
|
|
61962
|
+
return ref;
|
|
61963
|
+
}
|
|
61762
61964
|
|
|
61763
|
-
|
|
61764
|
-
|
|
61765
|
-
|
|
61766
|
-
|
|
61767
|
-
|
|
61768
|
-
|
|
61769
|
-
|
|
61770
|
-
|
|
61771
|
-
|
|
61772
|
-
fill: "#505562"
|
|
61773
|
-
}), o$2("path", {
|
|
61774
|
-
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",
|
|
61775
|
-
fill: "#505562"
|
|
61776
|
-
})]
|
|
61777
|
-
});
|
|
61778
|
-
};
|
|
61965
|
+
/**
|
|
61966
|
+
* Subscribe to `propertiesPanel.showError`. On `propertiesPanel.showError` set
|
|
61967
|
+
* temporary error. Fire `propertiesPanel.showEntry` for temporary error to be
|
|
61968
|
+
* visible. Unset error on `propertiesPanel.updated`.
|
|
61969
|
+
*
|
|
61970
|
+
* @param {Function} show
|
|
61971
|
+
*
|
|
61972
|
+
* @returns {import('preact').Ref}
|
|
61973
|
+
*/
|
|
61779
61974
|
|
|
61780
|
-
|
|
61781
|
-
|
|
61782
|
-
|
|
61783
|
-
|
|
61784
|
-
|
|
61975
|
+
function useShowErrorEvent(show) {
|
|
61976
|
+
const {
|
|
61977
|
+
eventBus
|
|
61978
|
+
} = F(EventContext);
|
|
61979
|
+
const [temporaryError, setTemporaryError] = l(null);
|
|
61980
|
+
const onPropertiesPanelUpdated = A$1(() => setTemporaryError(null), []);
|
|
61981
|
+
useEvent('propertiesPanel.updated', onPropertiesPanelUpdated);
|
|
61982
|
+
const onShowError = A$1(event => {
|
|
61983
|
+
setTemporaryError(null);
|
|
61785
61984
|
|
|
61786
|
-
|
|
61787
|
-
|
|
61788
|
-
|
|
61789
|
-
|
|
61790
|
-
fill: "#505562"
|
|
61791
|
-
}), o$2("path", {
|
|
61792
|
-
fillRule: "evenodd",
|
|
61793
|
-
clipRule: "evenodd",
|
|
61794
|
-
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",
|
|
61795
|
-
fill: "#505562"
|
|
61796
|
-
})]
|
|
61797
|
-
});
|
|
61798
|
-
};
|
|
61985
|
+
if (show(event)) {
|
|
61986
|
+
if (eventBus) {
|
|
61987
|
+
eventBus.fire('propertiesPanel.showEntry', event);
|
|
61988
|
+
}
|
|
61799
61989
|
|
|
61800
|
-
|
|
61801
|
-
|
|
61802
|
-
|
|
61803
|
-
|
|
61804
|
-
|
|
61990
|
+
setTemporaryError(event.message);
|
|
61991
|
+
}
|
|
61992
|
+
}, [show]);
|
|
61993
|
+
useEvent('propertiesPanel.showError', onShowError);
|
|
61994
|
+
return temporaryError;
|
|
61995
|
+
}
|
|
61805
61996
|
|
|
61806
61997
|
function Group(props) {
|
|
61807
61998
|
const {
|
|
61808
61999
|
element,
|
|
61809
62000
|
entries = [],
|
|
61810
62001
|
id,
|
|
61811
|
-
label
|
|
62002
|
+
label,
|
|
62003
|
+
shouldOpen = false
|
|
61812
62004
|
} = props;
|
|
61813
|
-
const [open, setOpen] = useLayoutState(['groups', id, 'open'],
|
|
62005
|
+
const [open, setOpen] = useLayoutState(['groups', id, 'open'], shouldOpen);
|
|
62006
|
+
const onShow = A$1(() => setOpen(true), [setOpen]);
|
|
61814
62007
|
|
|
61815
62008
|
const toggleOpen = () => setOpen(!open);
|
|
61816
62009
|
|
|
@@ -61833,6 +62026,9 @@
|
|
|
61833
62026
|
});
|
|
61834
62027
|
setEdited(hasOneEditedEntry);
|
|
61835
62028
|
}, [entries]);
|
|
62029
|
+
const propertiesPanelContext = { ...F(LayoutContext),
|
|
62030
|
+
onShow
|
|
62031
|
+
};
|
|
61836
62032
|
return o$2("div", {
|
|
61837
62033
|
class: "bio-properties-panel-group",
|
|
61838
62034
|
"data-group-id": 'group-' + id,
|
|
@@ -61855,15 +62051,18 @@
|
|
|
61855
62051
|
})]
|
|
61856
62052
|
}), o$2("div", {
|
|
61857
62053
|
class: classnames('bio-properties-panel-group-entries', open ? 'open' : ''),
|
|
61858
|
-
children:
|
|
61859
|
-
|
|
61860
|
-
|
|
61861
|
-
|
|
61862
|
-
|
|
61863
|
-
|
|
61864
|
-
|
|
61865
|
-
|
|
61866
|
-
|
|
62054
|
+
children: o$2(LayoutContext.Provider, {
|
|
62055
|
+
value: propertiesPanelContext,
|
|
62056
|
+
children: entries.map(entry => {
|
|
62057
|
+
const {
|
|
62058
|
+
component: Component,
|
|
62059
|
+
id
|
|
62060
|
+
} = entry;
|
|
62061
|
+
return a(Component, { ...entry,
|
|
62062
|
+
element: element,
|
|
62063
|
+
key: id
|
|
62064
|
+
});
|
|
62065
|
+
})
|
|
61867
62066
|
})
|
|
61868
62067
|
})]
|
|
61869
62068
|
});
|
|
@@ -61880,6 +62079,7 @@
|
|
|
61880
62079
|
open: true
|
|
61881
62080
|
};
|
|
61882
62081
|
const DEFAULT_DESCRIPTION = {};
|
|
62082
|
+
const bufferedEvents = ['propertiesPanel.showEntry', 'propertiesPanel.showError'];
|
|
61883
62083
|
/**
|
|
61884
62084
|
* @typedef { {
|
|
61885
62085
|
* component: import('preact').Component,
|
|
@@ -61911,7 +62111,8 @@
|
|
|
61911
62111
|
* component?: import('preact').Component,
|
|
61912
62112
|
* entries: Array<EntryDefinition>,
|
|
61913
62113
|
* id: String,
|
|
61914
|
-
* label: String
|
|
62114
|
+
* label: String,
|
|
62115
|
+
* shouldOpen?: Boolean
|
|
61915
62116
|
* } } GroupDefinition
|
|
61916
62117
|
*
|
|
61917
62118
|
* @typedef { {
|
|
@@ -61938,6 +62139,7 @@
|
|
|
61938
62139
|
* @param {Function} [props.layoutChanged]
|
|
61939
62140
|
* @param {DescriptionConfig} [props.descriptionConfig]
|
|
61940
62141
|
* @param {Function} [props.descriptionLoaded]
|
|
62142
|
+
* @param {Object} [props.eventBus]
|
|
61941
62143
|
*/
|
|
61942
62144
|
|
|
61943
62145
|
function PropertiesPanel(props) {
|
|
@@ -61948,7 +62150,8 @@
|
|
|
61948
62150
|
layoutConfig = {},
|
|
61949
62151
|
layoutChanged,
|
|
61950
62152
|
descriptionConfig = {},
|
|
61951
|
-
descriptionLoaded
|
|
62153
|
+
descriptionLoaded,
|
|
62154
|
+
eventBus
|
|
61952
62155
|
} = props; // set-up layout context
|
|
61953
62156
|
|
|
61954
62157
|
const [layout, setLayout] = l(createLayout(layoutConfig));
|
|
@@ -61989,6 +62192,13 @@
|
|
|
61989
62192
|
description,
|
|
61990
62193
|
getDescriptionForId
|
|
61991
62194
|
};
|
|
62195
|
+
useEventBuffer(bufferedEvents, eventBus);
|
|
62196
|
+
const eventContext = {
|
|
62197
|
+
eventBus
|
|
62198
|
+
};
|
|
62199
|
+
const propertiesPanelContext = {
|
|
62200
|
+
element
|
|
62201
|
+
};
|
|
61992
62202
|
|
|
61993
62203
|
if (!element) {
|
|
61994
62204
|
return o$2("div", {
|
|
@@ -61997,28 +62207,34 @@
|
|
|
61997
62207
|
});
|
|
61998
62208
|
}
|
|
61999
62209
|
|
|
62000
|
-
return o$2(
|
|
62001
|
-
value:
|
|
62002
|
-
children: o$2(
|
|
62003
|
-
value:
|
|
62004
|
-
children: o$2(
|
|
62005
|
-
|
|
62006
|
-
children:
|
|
62007
|
-
|
|
62008
|
-
|
|
62009
|
-
|
|
62010
|
-
|
|
62011
|
-
|
|
62012
|
-
|
|
62013
|
-
|
|
62014
|
-
|
|
62015
|
-
|
|
62016
|
-
|
|
62017
|
-
|
|
62018
|
-
|
|
62019
|
-
|
|
62210
|
+
return o$2(LayoutContext.Provider, {
|
|
62211
|
+
value: propertiesPanelContext,
|
|
62212
|
+
children: o$2(DescriptionContext.Provider, {
|
|
62213
|
+
value: descriptionContext,
|
|
62214
|
+
children: o$2(LayoutContext.Provider, {
|
|
62215
|
+
value: layoutContext,
|
|
62216
|
+
children: o$2(EventContext.Provider, {
|
|
62217
|
+
value: eventContext,
|
|
62218
|
+
children: o$2("div", {
|
|
62219
|
+
class: classnames('bio-properties-panel', layout.open ? 'open' : ''),
|
|
62220
|
+
children: [o$2(Header, {
|
|
62221
|
+
element: element,
|
|
62222
|
+
headerProvider: headerProvider
|
|
62223
|
+
}), o$2("div", {
|
|
62224
|
+
class: "bio-properties-panel-scroll-container",
|
|
62225
|
+
children: groups.map(group => {
|
|
62226
|
+
const {
|
|
62227
|
+
component: Component = Group,
|
|
62228
|
+
id
|
|
62229
|
+
} = group;
|
|
62230
|
+
return a(Component, { ...group,
|
|
62231
|
+
key: id,
|
|
62232
|
+
element: element
|
|
62233
|
+
});
|
|
62234
|
+
})
|
|
62235
|
+
})]
|
|
62020
62236
|
})
|
|
62021
|
-
})
|
|
62237
|
+
})
|
|
62022
62238
|
})
|
|
62023
62239
|
})
|
|
62024
62240
|
});
|
|
@@ -62158,8 +62374,20 @@
|
|
|
62158
62374
|
} = props;
|
|
62159
62375
|
const [open, setOpen] = l(shouldOpen);
|
|
62160
62376
|
|
|
62161
|
-
const toggleOpen = () => setOpen(!open);
|
|
62377
|
+
const toggleOpen = () => setOpen(!open);
|
|
62378
|
+
|
|
62379
|
+
const {
|
|
62380
|
+
onShow
|
|
62381
|
+
} = F(LayoutContext);
|
|
62382
|
+
const propertiesPanelContext = { ...F(LayoutContext),
|
|
62383
|
+
onShow: A$1(() => {
|
|
62384
|
+
setOpen(true);
|
|
62162
62385
|
|
|
62386
|
+
if (isFunction(onShow)) {
|
|
62387
|
+
onShow();
|
|
62388
|
+
}
|
|
62389
|
+
}, [onShow, setOpen])
|
|
62390
|
+
}; // todo(pinussilvestrus): translate once we have a translate mechanism for the core
|
|
62163
62391
|
|
|
62164
62392
|
const placeholderLabel = '<empty>';
|
|
62165
62393
|
return o$2("div", {
|
|
@@ -62186,15 +62414,18 @@
|
|
|
62186
62414
|
}) : null]
|
|
62187
62415
|
}), o$2("div", {
|
|
62188
62416
|
class: classnames('bio-properties-panel-collapsible-entry-entries', open ? 'open' : ''),
|
|
62189
|
-
children:
|
|
62190
|
-
|
|
62191
|
-
|
|
62192
|
-
|
|
62193
|
-
|
|
62194
|
-
|
|
62195
|
-
|
|
62196
|
-
|
|
62197
|
-
|
|
62417
|
+
children: o$2(LayoutContext.Provider, {
|
|
62418
|
+
value: propertiesPanelContext,
|
|
62419
|
+
children: entries.map(entry => {
|
|
62420
|
+
const {
|
|
62421
|
+
component: Component,
|
|
62422
|
+
id
|
|
62423
|
+
} = entry;
|
|
62424
|
+
return a(Component, { ...entry,
|
|
62425
|
+
element: element,
|
|
62426
|
+
key: id
|
|
62427
|
+
});
|
|
62428
|
+
})
|
|
62198
62429
|
})
|
|
62199
62430
|
})]
|
|
62200
62431
|
});
|
|
@@ -62228,7 +62459,7 @@
|
|
|
62228
62459
|
});
|
|
62229
62460
|
}
|
|
62230
62461
|
|
|
62231
|
-
const noop = () => {};
|
|
62462
|
+
const noop$3 = () => {};
|
|
62232
62463
|
/**
|
|
62233
62464
|
* @param {import('../PropertiesPanel').ListGroupDefinition} props
|
|
62234
62465
|
*/
|
|
@@ -62245,6 +62476,7 @@
|
|
|
62245
62476
|
shouldSort = true
|
|
62246
62477
|
} = props;
|
|
62247
62478
|
const [open, setOpen] = useLayoutState(['groups', id, 'open'], false);
|
|
62479
|
+
const onShow = A$1(() => setOpen(true), [setOpen]);
|
|
62248
62480
|
const [ordering, setOrdering] = l([]);
|
|
62249
62481
|
const [newItemAdded, setNewItemAdded] = l(false);
|
|
62250
62482
|
const prevItems = usePrevious(items);
|
|
@@ -62319,12 +62551,15 @@
|
|
|
62319
62551
|
const toggleOpen = () => setOpen(!open);
|
|
62320
62552
|
|
|
62321
62553
|
const hasItems = !!items.length;
|
|
62554
|
+
const propertiesPanelContext = { ...F(LayoutContext),
|
|
62555
|
+
onShow
|
|
62556
|
+
};
|
|
62322
62557
|
return o$2("div", {
|
|
62323
62558
|
class: "bio-properties-panel-group",
|
|
62324
62559
|
"data-group-id": 'group-' + id,
|
|
62325
62560
|
children: [o$2("div", {
|
|
62326
62561
|
class: classnames('bio-properties-panel-group-header', hasItems ? '' : 'empty', hasItems && open ? 'open' : ''),
|
|
62327
|
-
onClick: hasItems ? toggleOpen : noop,
|
|
62562
|
+
onClick: hasItems ? toggleOpen : noop$3,
|
|
62328
62563
|
children: [o$2("div", {
|
|
62329
62564
|
title: label,
|
|
62330
62565
|
class: "bio-properties-panel-group-header-title",
|
|
@@ -62353,23 +62588,27 @@
|
|
|
62353
62588
|
})]
|
|
62354
62589
|
}), o$2("div", {
|
|
62355
62590
|
class: classnames('bio-properties-panel-list', open && hasItems ? 'open' : ''),
|
|
62356
|
-
children:
|
|
62357
|
-
|
|
62591
|
+
children: o$2(LayoutContext.Provider, {
|
|
62592
|
+
value: propertiesPanelContext,
|
|
62593
|
+
children: ordering.map((o, index) => {
|
|
62594
|
+
const item = getItem(items, o);
|
|
62358
62595
|
|
|
62359
|
-
|
|
62360
|
-
|
|
62361
|
-
|
|
62596
|
+
if (!item) {
|
|
62597
|
+
return;
|
|
62598
|
+
}
|
|
62362
62599
|
|
|
62363
|
-
|
|
62364
|
-
|
|
62365
|
-
|
|
62366
|
-
|
|
62367
|
-
|
|
62368
|
-
|
|
62369
|
-
|
|
62370
|
-
|
|
62371
|
-
|
|
62372
|
-
|
|
62600
|
+
const {
|
|
62601
|
+
id
|
|
62602
|
+
} = item; // if item was added, open first or last item based on ordering
|
|
62603
|
+
|
|
62604
|
+
const autoOpen = newItemAdded && (shouldSort ? index === 0 : index === ordering.length - 1);
|
|
62605
|
+
return a(ListItem, { ...item,
|
|
62606
|
+
autoOpen: autoOpen,
|
|
62607
|
+
element: element,
|
|
62608
|
+
index: index,
|
|
62609
|
+
key: id
|
|
62610
|
+
});
|
|
62611
|
+
})
|
|
62373
62612
|
})
|
|
62374
62613
|
})]
|
|
62375
62614
|
});
|
|
@@ -62408,13 +62647,16 @@
|
|
|
62408
62647
|
}
|
|
62409
62648
|
}
|
|
62410
62649
|
|
|
62650
|
+
const noop$2 = () => {};
|
|
62651
|
+
|
|
62411
62652
|
function Checkbox(props) {
|
|
62412
62653
|
const {
|
|
62413
62654
|
id,
|
|
62414
62655
|
label,
|
|
62415
62656
|
onChange,
|
|
62416
62657
|
disabled,
|
|
62417
|
-
value = false
|
|
62658
|
+
value = false,
|
|
62659
|
+
show = noop$2
|
|
62418
62660
|
} = props;
|
|
62419
62661
|
|
|
62420
62662
|
const handleChange = ({
|
|
@@ -62423,9 +62665,11 @@
|
|
|
62423
62665
|
onChange(target.checked);
|
|
62424
62666
|
};
|
|
62425
62667
|
|
|
62668
|
+
const ref = useShowEntryEvent(show);
|
|
62426
62669
|
return o$2("div", {
|
|
62427
62670
|
class: "bio-properties-panel-checkbox",
|
|
62428
62671
|
children: [o$2("input", {
|
|
62672
|
+
ref: ref,
|
|
62429
62673
|
id: prefixId$6(id),
|
|
62430
62674
|
name: id,
|
|
62431
62675
|
type: "checkbox",
|
|
@@ -62460,18 +62704,24 @@
|
|
|
62460
62704
|
label,
|
|
62461
62705
|
getValue,
|
|
62462
62706
|
setValue,
|
|
62463
|
-
disabled
|
|
62707
|
+
disabled,
|
|
62708
|
+
show = noop$2
|
|
62464
62709
|
} = props;
|
|
62465
62710
|
const value = getValue(element);
|
|
62711
|
+
const error = useShowErrorEvent(show);
|
|
62466
62712
|
return o$2("div", {
|
|
62467
62713
|
class: "bio-properties-panel-entry bio-properties-panel-checkbox-entry",
|
|
62468
62714
|
"data-entry-id": id,
|
|
62469
62715
|
children: [o$2(Checkbox, {
|
|
62716
|
+
disabled: disabled,
|
|
62470
62717
|
id: id,
|
|
62471
62718
|
label: label,
|
|
62472
62719
|
onChange: setValue,
|
|
62473
|
-
|
|
62474
|
-
|
|
62720
|
+
show: show,
|
|
62721
|
+
value: value
|
|
62722
|
+
}), error && o$2("div", {
|
|
62723
|
+
class: "bio-properties-panel-error",
|
|
62724
|
+
children: error
|
|
62475
62725
|
}), o$2(Description, {
|
|
62476
62726
|
forId: id,
|
|
62477
62727
|
element: element,
|
|
@@ -62673,6 +62923,25 @@
|
|
|
62673
62923
|
return previousItems ? items.filter(item => !previousItems.includes(item)) : [];
|
|
62674
62924
|
}
|
|
62675
62925
|
|
|
62926
|
+
const noop$1 = () => {};
|
|
62927
|
+
/**
|
|
62928
|
+
* @typedef { { value: string, label: string, disabled: boolean } } Option
|
|
62929
|
+
*/
|
|
62930
|
+
|
|
62931
|
+
/**
|
|
62932
|
+
* Provides basic select input.
|
|
62933
|
+
*
|
|
62934
|
+
* @param {object} props
|
|
62935
|
+
* @param {string} props.id
|
|
62936
|
+
* @param {string[]} props.path
|
|
62937
|
+
* @param {string} props.label
|
|
62938
|
+
* @param {Function} props.onChange
|
|
62939
|
+
* @param {Array<Option>} [props.options]
|
|
62940
|
+
* @param {string} props.value
|
|
62941
|
+
* @param {boolean} [props.disabled]
|
|
62942
|
+
*/
|
|
62943
|
+
|
|
62944
|
+
|
|
62676
62945
|
function Select(props) {
|
|
62677
62946
|
const {
|
|
62678
62947
|
id,
|
|
@@ -62680,8 +62949,10 @@
|
|
|
62680
62949
|
onChange,
|
|
62681
62950
|
options = [],
|
|
62682
62951
|
value,
|
|
62683
|
-
disabled
|
|
62952
|
+
disabled,
|
|
62953
|
+
show = noop$1
|
|
62684
62954
|
} = props;
|
|
62955
|
+
const ref = useShowEntryEvent(show);
|
|
62685
62956
|
|
|
62686
62957
|
const handleChange = ({
|
|
62687
62958
|
target
|
|
@@ -62696,6 +62967,7 @@
|
|
|
62696
62967
|
class: "bio-properties-panel-label",
|
|
62697
62968
|
children: label
|
|
62698
62969
|
}), o$2("select", {
|
|
62970
|
+
ref: ref,
|
|
62699
62971
|
id: prefixId$4(id),
|
|
62700
62972
|
name: id,
|
|
62701
62973
|
class: "bio-properties-panel-input",
|
|
@@ -62734,12 +63006,14 @@
|
|
|
62734
63006
|
getValue,
|
|
62735
63007
|
setValue,
|
|
62736
63008
|
getOptions,
|
|
62737
|
-
disabled
|
|
63009
|
+
disabled,
|
|
63010
|
+
show = noop$1
|
|
62738
63011
|
} = props;
|
|
62739
63012
|
const value = getValue(element);
|
|
62740
63013
|
const options = getOptions(element);
|
|
63014
|
+
const error = useShowErrorEvent(show);
|
|
62741
63015
|
return o$2("div", {
|
|
62742
|
-
class:
|
|
63016
|
+
class: classnames('bio-properties-panel-entry', error ? 'has-error' : ''),
|
|
62743
63017
|
"data-entry-id": id,
|
|
62744
63018
|
children: [o$2(Select, {
|
|
62745
63019
|
id: id,
|
|
@@ -62747,7 +63021,11 @@
|
|
|
62747
63021
|
value: value,
|
|
62748
63022
|
onChange: setValue,
|
|
62749
63023
|
options: options,
|
|
62750
|
-
disabled: disabled
|
|
63024
|
+
disabled: disabled,
|
|
63025
|
+
show: show
|
|
63026
|
+
}), error && o$2("div", {
|
|
63027
|
+
class: "bio-properties-panel-error",
|
|
63028
|
+
children: error
|
|
62751
63029
|
}), o$2(Description, {
|
|
62752
63030
|
forId: id,
|
|
62753
63031
|
element: element,
|
|
@@ -62915,6 +63193,8 @@
|
|
|
62915
63193
|
return `bio-properties-panel-${id}`;
|
|
62916
63194
|
}
|
|
62917
63195
|
|
|
63196
|
+
const noop = () => {};
|
|
63197
|
+
|
|
62918
63198
|
function Textfield(props) {
|
|
62919
63199
|
const {
|
|
62920
63200
|
debounce,
|
|
@@ -62923,8 +63203,10 @@
|
|
|
62923
63203
|
label,
|
|
62924
63204
|
onInput,
|
|
62925
63205
|
feel = false,
|
|
62926
|
-
value = ''
|
|
63206
|
+
value = '',
|
|
63207
|
+
show = noop
|
|
62927
63208
|
} = props;
|
|
63209
|
+
const ref = useShowEntryEvent(show);
|
|
62928
63210
|
const handleInput = d$1(() => {
|
|
62929
63211
|
return debounce(({
|
|
62930
63212
|
target
|
|
@@ -62940,6 +63222,7 @@
|
|
|
62940
63222
|
label: label
|
|
62941
63223
|
})]
|
|
62942
63224
|
}), o$2("input", {
|
|
63225
|
+
ref: ref,
|
|
62943
63226
|
id: prefixId$1(id),
|
|
62944
63227
|
type: "text",
|
|
62945
63228
|
name: id,
|
|
@@ -62979,53 +63262,61 @@
|
|
|
62979
63262
|
label,
|
|
62980
63263
|
getValue,
|
|
62981
63264
|
setValue,
|
|
62982
|
-
validate
|
|
63265
|
+
validate,
|
|
63266
|
+
show = noop
|
|
62983
63267
|
} = props;
|
|
62984
|
-
const [
|
|
62985
|
-
const [
|
|
63268
|
+
const [cachedInvalidValue, setCachedInvalidValue] = l(null);
|
|
63269
|
+
const [validationError, setValidationError] = l(null);
|
|
62986
63270
|
let value = getValue(element);
|
|
62987
|
-
const
|
|
62988
|
-
|
|
63271
|
+
const previousValue = usePrevious(value);
|
|
62989
63272
|
y$1(() => {
|
|
62990
|
-
|
|
62991
|
-
|
|
62992
|
-
|
|
63273
|
+
if (isFunction(validate)) {
|
|
63274
|
+
const newValidationError = validate(value) || null;
|
|
63275
|
+
setValidationError(newValidationError);
|
|
63276
|
+
}
|
|
63277
|
+
}, [value]);
|
|
62993
63278
|
|
|
62994
|
-
const
|
|
62995
|
-
|
|
63279
|
+
const onInput = newValue => {
|
|
63280
|
+
let newValidationError = null;
|
|
62996
63281
|
|
|
62997
|
-
if (
|
|
62998
|
-
|
|
63282
|
+
if (isFunction(validate)) {
|
|
63283
|
+
newValidationError = validate(newValue) || null;
|
|
63284
|
+
}
|
|
63285
|
+
|
|
63286
|
+
if (newValidationError) {
|
|
63287
|
+
setCachedInvalidValue(newValue);
|
|
62999
63288
|
} else {
|
|
63000
63289
|
setValue(newValue);
|
|
63001
63290
|
}
|
|
63002
63291
|
|
|
63003
|
-
|
|
63004
|
-
};
|
|
63005
|
-
|
|
63292
|
+
setValidationError(newValidationError);
|
|
63293
|
+
};
|
|
63006
63294
|
|
|
63007
|
-
if (
|
|
63008
|
-
value =
|
|
63295
|
+
if (previousValue === value && validationError) {
|
|
63296
|
+
value = cachedInvalidValue;
|
|
63009
63297
|
}
|
|
63010
63298
|
|
|
63299
|
+
const temporaryError = useShowErrorEvent(show);
|
|
63300
|
+
const error = temporaryError || validationError;
|
|
63011
63301
|
return o$2("div", {
|
|
63012
63302
|
class: classnames('bio-properties-panel-entry', error ? 'has-error' : ''),
|
|
63013
63303
|
"data-entry-id": id,
|
|
63014
63304
|
children: [o$2(Textfield, {
|
|
63015
|
-
id: id,
|
|
63016
|
-
label: label,
|
|
63017
|
-
value: value,
|
|
63018
|
-
onInput: handleChange,
|
|
63019
63305
|
debounce: debounce,
|
|
63020
63306
|
disabled: disabled,
|
|
63021
|
-
feel: feel
|
|
63307
|
+
feel: feel,
|
|
63308
|
+
id: id,
|
|
63309
|
+
label: label,
|
|
63310
|
+
onInput: onInput,
|
|
63311
|
+
show: show,
|
|
63312
|
+
value: value
|
|
63313
|
+
}), error && o$2("div", {
|
|
63314
|
+
class: "bio-properties-panel-error",
|
|
63315
|
+
children: error
|
|
63022
63316
|
}), o$2(Description, {
|
|
63023
63317
|
forId: id,
|
|
63024
63318
|
element: element,
|
|
63025
63319
|
value: description
|
|
63026
|
-
}), error && o$2("div", {
|
|
63027
|
-
class: "bio-properties-panel-error",
|
|
63028
|
-
children: error
|
|
63029
63320
|
})]
|
|
63030
63321
|
});
|
|
63031
63322
|
}
|
|
@@ -63138,6 +63429,145 @@
|
|
|
63138
63429
|
debounceInput: ['factory', debounceInput]
|
|
63139
63430
|
};
|
|
63140
63431
|
|
|
63432
|
+
var require$$0 = /*@__PURE__*/getAugmentedNamespace(index_esm);
|
|
63433
|
+
|
|
63434
|
+
const {
|
|
63435
|
+
isNil: isNil$1,
|
|
63436
|
+
isString: isString$1,
|
|
63437
|
+
isUndefined: isUndefined$2
|
|
63438
|
+
} = require$$0;
|
|
63439
|
+
|
|
63440
|
+
/**
|
|
63441
|
+
* Get path from model element and optional parent model element. Falls back to
|
|
63442
|
+
* returning null.
|
|
63443
|
+
*
|
|
63444
|
+
* @param {ModdleElement} moddleElement
|
|
63445
|
+
* @param {ModdleElement} [parentModdleElement]
|
|
63446
|
+
*
|
|
63447
|
+
* @returns {string[]|null}
|
|
63448
|
+
*/
|
|
63449
|
+
var getPath = function(moddleElement, parentModdleElement) {
|
|
63450
|
+
if (!moddleElement) {
|
|
63451
|
+
return null;
|
|
63452
|
+
}
|
|
63453
|
+
|
|
63454
|
+
if (moddleElement === parentModdleElement) {
|
|
63455
|
+
return [];
|
|
63456
|
+
}
|
|
63457
|
+
|
|
63458
|
+
let path = [],
|
|
63459
|
+
parent;
|
|
63460
|
+
|
|
63461
|
+
do {
|
|
63462
|
+
parent = moddleElement.$parent;
|
|
63463
|
+
|
|
63464
|
+
if (!parent) {
|
|
63465
|
+
if (moddleElement.$instanceOf('bpmn:Definitions')) {
|
|
63466
|
+
break;
|
|
63467
|
+
} else {
|
|
63468
|
+
return null;
|
|
63469
|
+
}
|
|
63470
|
+
}
|
|
63471
|
+
|
|
63472
|
+
path = [ ...getPropertyName(moddleElement, parent), ...path ];
|
|
63473
|
+
|
|
63474
|
+
moddleElement = parent;
|
|
63475
|
+
|
|
63476
|
+
if (parentModdleElement && moddleElement === parentModdleElement) {
|
|
63477
|
+
break;
|
|
63478
|
+
}
|
|
63479
|
+
} while (parent);
|
|
63480
|
+
|
|
63481
|
+
return path;
|
|
63482
|
+
};
|
|
63483
|
+
|
|
63484
|
+
/**
|
|
63485
|
+
* Get property name from model element and parent model element.
|
|
63486
|
+
*
|
|
63487
|
+
* @param {ModdleElement} moddleElement
|
|
63488
|
+
* @param {ModdleElement} parentModdleElement
|
|
63489
|
+
*
|
|
63490
|
+
* @returns {string[]}
|
|
63491
|
+
*/
|
|
63492
|
+
function getPropertyName(moddleElement, parentModdleElement) {
|
|
63493
|
+
for (let property of Object.values(parentModdleElement.$descriptor.propertiesByName)) {
|
|
63494
|
+
if (property.isMany) {
|
|
63495
|
+
if (parentModdleElement.get(property.name).includes(moddleElement)) {
|
|
63496
|
+
return [
|
|
63497
|
+
property.name,
|
|
63498
|
+
parentModdleElement.get(property.name).indexOf(moddleElement)
|
|
63499
|
+
];
|
|
63500
|
+
}
|
|
63501
|
+
} else {
|
|
63502
|
+
if (parentModdleElement.get(property.name) === moddleElement) {
|
|
63503
|
+
return [ property.name ];
|
|
63504
|
+
}
|
|
63505
|
+
}
|
|
63506
|
+
}
|
|
63507
|
+
|
|
63508
|
+
return [];
|
|
63509
|
+
}
|
|
63510
|
+
|
|
63511
|
+
/**
|
|
63512
|
+
* @param {(string|(number|string)[])[]} paths
|
|
63513
|
+
*
|
|
63514
|
+
* @returns {(number|string)[]}
|
|
63515
|
+
*/
|
|
63516
|
+
var pathConcat = function(...paths) {
|
|
63517
|
+
let concatenatedPaths = [];
|
|
63518
|
+
|
|
63519
|
+
for (let path of paths) {
|
|
63520
|
+
if (isNil$1(path) || isUndefined$2(path)) {
|
|
63521
|
+
return null;
|
|
63522
|
+
}
|
|
63523
|
+
|
|
63524
|
+
if (isString$1(path)) {
|
|
63525
|
+
path = [ path ];
|
|
63526
|
+
}
|
|
63527
|
+
|
|
63528
|
+
concatenatedPaths = concatenatedPaths.concat(path);
|
|
63529
|
+
}
|
|
63530
|
+
|
|
63531
|
+
return concatenatedPaths;
|
|
63532
|
+
};
|
|
63533
|
+
|
|
63534
|
+
/**
|
|
63535
|
+
* @param {string|(number|string)[]} a
|
|
63536
|
+
* @param {string|(number|string)[]} b
|
|
63537
|
+
* @param {string} [separator]
|
|
63538
|
+
*
|
|
63539
|
+
* @returns {boolean}
|
|
63540
|
+
*/
|
|
63541
|
+
var pathEquals = function(a, b, separator = '.') {
|
|
63542
|
+
if (isNil$1(a) || isUndefined$2(a) || isNil$1(b) || isUndefined$2(b)) {
|
|
63543
|
+
return false;
|
|
63544
|
+
}
|
|
63545
|
+
|
|
63546
|
+
if (!isString$1(a)) {
|
|
63547
|
+
a = pathStringify(a, separator);
|
|
63548
|
+
}
|
|
63549
|
+
|
|
63550
|
+
if (!isString$1(b)) {
|
|
63551
|
+
b = pathStringify(b, separator);
|
|
63552
|
+
}
|
|
63553
|
+
|
|
63554
|
+
return a === b;
|
|
63555
|
+
};
|
|
63556
|
+
|
|
63557
|
+
/**
|
|
63558
|
+
* @param {(number|string)[]} path
|
|
63559
|
+
* @param {string} [separator]
|
|
63560
|
+
*
|
|
63561
|
+
* @returns {string}
|
|
63562
|
+
*/
|
|
63563
|
+
function pathStringify(path, separator = '.') {
|
|
63564
|
+
if (isNil$1(path) || isUndefined$2(path)) {
|
|
63565
|
+
return null;
|
|
63566
|
+
}
|
|
63567
|
+
|
|
63568
|
+
return path.join(separator);
|
|
63569
|
+
}
|
|
63570
|
+
|
|
63141
63571
|
/**
|
|
63142
63572
|
* Failsafe remove an element from a collection
|
|
63143
63573
|
*
|
|
@@ -64602,22 +65032,213 @@
|
|
|
64602
65032
|
/**
|
|
64603
65033
|
* Validate a single object.
|
|
64604
65034
|
*
|
|
64605
|
-
* @param {Object} object
|
|
64606
|
-
* @return {Object} single object validation result
|
|
65035
|
+
* @param {Object} object
|
|
65036
|
+
* @return {Object} single object validation result
|
|
65037
|
+
*/
|
|
65038
|
+
function validate(object) {
|
|
65039
|
+
return _validate(object, standaloneValidator);
|
|
65040
|
+
}
|
|
65041
|
+
|
|
65042
|
+
var DEFAULT_PRIORITY$7 = 1000;
|
|
65043
|
+
|
|
65044
|
+
/**
|
|
65045
|
+
* A utility that can be used to plug-in into the command execution for
|
|
65046
|
+
* extension and/or validation.
|
|
65047
|
+
*
|
|
65048
|
+
* @param {EventBus} eventBus
|
|
65049
|
+
*
|
|
65050
|
+
* @example
|
|
65051
|
+
*
|
|
65052
|
+
* import inherits from 'inherits';
|
|
65053
|
+
*
|
|
65054
|
+
* import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
65055
|
+
*
|
|
65056
|
+
* function CommandLogger(eventBus) {
|
|
65057
|
+
* CommandInterceptor.call(this, eventBus);
|
|
65058
|
+
*
|
|
65059
|
+
* this.preExecute(function(event) {
|
|
65060
|
+
* console.log('command pre-execute', event);
|
|
65061
|
+
* });
|
|
65062
|
+
* }
|
|
65063
|
+
*
|
|
65064
|
+
* inherits(CommandLogger, CommandInterceptor);
|
|
65065
|
+
*
|
|
65066
|
+
*/
|
|
65067
|
+
function CommandInterceptor$1(eventBus) {
|
|
65068
|
+
this._eventBus = eventBus;
|
|
65069
|
+
}
|
|
65070
|
+
|
|
65071
|
+
CommandInterceptor$1.$inject = [ 'eventBus' ];
|
|
65072
|
+
|
|
65073
|
+
function unwrapEvent$1(fn, that) {
|
|
65074
|
+
return function(event) {
|
|
65075
|
+
return fn.call(that || null, event.context, event.command, event);
|
|
65076
|
+
};
|
|
65077
|
+
}
|
|
65078
|
+
|
|
65079
|
+
/**
|
|
65080
|
+
* Register an interceptor for a command execution
|
|
65081
|
+
*
|
|
65082
|
+
* @param {string|Array<string>} [events] list of commands to register on
|
|
65083
|
+
* @param {string} [hook] command hook, i.e. preExecute, executed to listen on
|
|
65084
|
+
* @param {number} [priority] the priority on which to hook into the execution
|
|
65085
|
+
* @param {Function} handlerFn interceptor to be invoked with (event)
|
|
65086
|
+
* @param {boolean} unwrap if true, unwrap the event and pass (context, command, event) to the
|
|
65087
|
+
* listener instead
|
|
65088
|
+
* @param {Object} [that] Pass context (`this`) to the handler function
|
|
65089
|
+
*/
|
|
65090
|
+
CommandInterceptor$1.prototype.on = function(events, hook, priority, handlerFn, unwrap, that) {
|
|
65091
|
+
|
|
65092
|
+
if (isFunction(hook) || isNumber(hook)) {
|
|
65093
|
+
that = unwrap;
|
|
65094
|
+
unwrap = handlerFn;
|
|
65095
|
+
handlerFn = priority;
|
|
65096
|
+
priority = hook;
|
|
65097
|
+
hook = null;
|
|
65098
|
+
}
|
|
65099
|
+
|
|
65100
|
+
if (isFunction(priority)) {
|
|
65101
|
+
that = unwrap;
|
|
65102
|
+
unwrap = handlerFn;
|
|
65103
|
+
handlerFn = priority;
|
|
65104
|
+
priority = DEFAULT_PRIORITY$7;
|
|
65105
|
+
}
|
|
65106
|
+
|
|
65107
|
+
if (isObject(unwrap)) {
|
|
65108
|
+
that = unwrap;
|
|
65109
|
+
unwrap = false;
|
|
65110
|
+
}
|
|
65111
|
+
|
|
65112
|
+
if (!isFunction(handlerFn)) {
|
|
65113
|
+
throw new Error('handlerFn must be a function');
|
|
65114
|
+
}
|
|
65115
|
+
|
|
65116
|
+
if (!isArray(events)) {
|
|
65117
|
+
events = [ events ];
|
|
65118
|
+
}
|
|
65119
|
+
|
|
65120
|
+
var eventBus = this._eventBus;
|
|
65121
|
+
|
|
65122
|
+
forEach(events, function(event) {
|
|
65123
|
+
|
|
65124
|
+
// concat commandStack(.event)?(.hook)?
|
|
65125
|
+
var fullEvent = [ 'commandStack', event, hook ].filter(function(e) { return e; }).join('.');
|
|
65126
|
+
|
|
65127
|
+
eventBus.on(fullEvent, priority, unwrap ? unwrapEvent$1(handlerFn, that) : handlerFn, that);
|
|
65128
|
+
});
|
|
65129
|
+
};
|
|
65130
|
+
|
|
65131
|
+
|
|
65132
|
+
var hooks$1 = [
|
|
65133
|
+
'canExecute',
|
|
65134
|
+
'preExecute',
|
|
65135
|
+
'preExecuted',
|
|
65136
|
+
'execute',
|
|
65137
|
+
'executed',
|
|
65138
|
+
'postExecute',
|
|
65139
|
+
'postExecuted',
|
|
65140
|
+
'revert',
|
|
65141
|
+
'reverted'
|
|
65142
|
+
];
|
|
65143
|
+
|
|
65144
|
+
/*
|
|
65145
|
+
* Install hook shortcuts
|
|
65146
|
+
*
|
|
65147
|
+
* This will generate the CommandInterceptor#(preExecute|...|reverted) methods
|
|
65148
|
+
* which will in term forward to CommandInterceptor#on.
|
|
65149
|
+
*/
|
|
65150
|
+
forEach(hooks$1, function(hook) {
|
|
65151
|
+
|
|
65152
|
+
/**
|
|
65153
|
+
* {canExecute|preExecute|preExecuted|execute|executed|postExecute|postExecuted|revert|reverted}
|
|
65154
|
+
*
|
|
65155
|
+
* A named hook for plugging into the command execution
|
|
65156
|
+
*
|
|
65157
|
+
* @param {string|Array<string>} [events] list of commands to register on
|
|
65158
|
+
* @param {number} [priority] the priority on which to hook into the execution
|
|
65159
|
+
* @param {Function} handlerFn interceptor to be invoked with (event)
|
|
65160
|
+
* @param {boolean} [unwrap=false] if true, unwrap the event and pass (context, command, event) to the
|
|
65161
|
+
* listener instead
|
|
65162
|
+
* @param {Object} [that] Pass context (`this`) to the handler function
|
|
65163
|
+
*/
|
|
65164
|
+
CommandInterceptor$1.prototype[hook] = function(events, priority, handlerFn, unwrap, that) {
|
|
65165
|
+
|
|
65166
|
+
if (isFunction(events) || isNumber(events)) {
|
|
65167
|
+
that = unwrap;
|
|
65168
|
+
unwrap = handlerFn;
|
|
65169
|
+
handlerFn = priority;
|
|
65170
|
+
priority = events;
|
|
65171
|
+
events = null;
|
|
65172
|
+
}
|
|
65173
|
+
|
|
65174
|
+
this.on(events, hook, priority, handlerFn, unwrap, that);
|
|
65175
|
+
};
|
|
65176
|
+
});
|
|
65177
|
+
|
|
65178
|
+
var CommandInterceptor$2 = /*#__PURE__*/Object.freeze({
|
|
65179
|
+
__proto__: null,
|
|
65180
|
+
'default': CommandInterceptor$1
|
|
65181
|
+
});
|
|
65182
|
+
|
|
65183
|
+
const BpmnPropertiesPanelContext = q({
|
|
65184
|
+
selectedElement: null,
|
|
65185
|
+
injector: null,
|
|
65186
|
+
|
|
65187
|
+
getService() {
|
|
65188
|
+
return null;
|
|
65189
|
+
}
|
|
65190
|
+
|
|
65191
|
+
});
|
|
65192
|
+
|
|
65193
|
+
function useService(type, strict) {
|
|
65194
|
+
const {
|
|
65195
|
+
getService
|
|
65196
|
+
} = F(BpmnPropertiesPanelContext);
|
|
65197
|
+
return getService(type, strict);
|
|
65198
|
+
}
|
|
65199
|
+
|
|
65200
|
+
/**
|
|
65201
|
+
* Returns a memoized callback to be passed as `show` prop. Callback returns
|
|
65202
|
+
* true if (1) ID and path match or (2) ID matches and matcher returns true.
|
|
65203
|
+
*
|
|
65204
|
+
* @example
|
|
65205
|
+
*
|
|
65206
|
+
* // using path
|
|
65207
|
+
* const show = useShowCallback(businessObject, [ 'foo' ]);
|
|
65208
|
+
*
|
|
65209
|
+
* @example
|
|
65210
|
+
*
|
|
65211
|
+
* // using matcher
|
|
65212
|
+
* const show = useShowCallback(businessObject, (event) => event.foo === 'bar');
|
|
65213
|
+
*
|
|
65214
|
+
* @param {Object} businessObject
|
|
65215
|
+
* @param {string[]|Function} matcher
|
|
65216
|
+
*
|
|
65217
|
+
* @returns {Function}
|
|
64607
65218
|
*/
|
|
64608
|
-
function validate(object) {
|
|
64609
|
-
return _validate(object, standaloneValidator);
|
|
64610
|
-
}
|
|
64611
65219
|
|
|
64612
|
-
|
|
64613
|
-
|
|
64614
|
-
|
|
65220
|
+
function useShowCallback(businessObject, matcher) {
|
|
65221
|
+
return A$1(event => {
|
|
65222
|
+
const {
|
|
65223
|
+
id,
|
|
65224
|
+
path
|
|
65225
|
+
} = event;
|
|
64615
65226
|
|
|
64616
|
-
|
|
64617
|
-
|
|
64618
|
-
|
|
65227
|
+
if (id !== businessObject.get('id')) {
|
|
65228
|
+
return false;
|
|
65229
|
+
}
|
|
64619
65230
|
|
|
64620
|
-
|
|
65231
|
+
if (isArray(matcher)) {
|
|
65232
|
+
return path && pathEquals(path, matcher);
|
|
65233
|
+
}
|
|
65234
|
+
|
|
65235
|
+
if (isFunction(matcher)) {
|
|
65236
|
+
return !!matcher(event);
|
|
65237
|
+
}
|
|
65238
|
+
|
|
65239
|
+
return false;
|
|
65240
|
+
}, [businessObject, matcher]);
|
|
65241
|
+
}
|
|
64621
65242
|
|
|
64622
65243
|
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); }
|
|
64623
65244
|
var AssociationIcon = (({
|
|
@@ -65838,6 +66459,14 @@
|
|
|
65838
66459
|
return type;
|
|
65839
66460
|
}
|
|
65840
66461
|
const PanelHeaderProvider = {
|
|
66462
|
+
getDocumentationRef: element => {
|
|
66463
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
66464
|
+
const elementTemplates = useService('elementTemplates', false);
|
|
66465
|
+
|
|
66466
|
+
if (elementTemplates) {
|
|
66467
|
+
return getTemplateDocumentation(element, elementTemplates);
|
|
66468
|
+
}
|
|
66469
|
+
},
|
|
65841
66470
|
getElementLabel: element => {
|
|
65842
66471
|
if (is$1(element, 'bpmn:Process')) {
|
|
65843
66472
|
return getBusinessObject(element).name;
|
|
@@ -65850,6 +66479,17 @@
|
|
|
65850
66479
|
return iconsByType[concreteType];
|
|
65851
66480
|
},
|
|
65852
66481
|
getTypeLabel: element => {
|
|
66482
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
66483
|
+
const elementTemplates = useService('elementTemplates', false);
|
|
66484
|
+
|
|
66485
|
+
if (elementTemplates) {
|
|
66486
|
+
const template = getTemplate(element, elementTemplates);
|
|
66487
|
+
|
|
66488
|
+
if (template && template.name) {
|
|
66489
|
+
return template.name;
|
|
66490
|
+
}
|
|
66491
|
+
}
|
|
66492
|
+
|
|
65853
66493
|
const concreteType = getConcreteType(element);
|
|
65854
66494
|
return concreteType.replace(/(\B[A-Z])/g, ' $1').replace(/(\bNon Interrupting)/g, '($1)');
|
|
65855
66495
|
}
|
|
@@ -65895,8 +66535,7 @@
|
|
|
65895
66535
|
}
|
|
65896
66536
|
|
|
65897
66537
|
return businessObject.conditionExpression && is$1(sourceBusinessObject, 'bpmn:Activity');
|
|
65898
|
-
}
|
|
65899
|
-
|
|
66538
|
+
}
|
|
65900
66539
|
|
|
65901
66540
|
function isPlane$1(element) {
|
|
65902
66541
|
// Backwards compatibility for bpmn-js<8
|
|
@@ -65904,6 +66543,17 @@
|
|
|
65904
66543
|
return is$1(di, 'bpmndi:BPMNPlane');
|
|
65905
66544
|
}
|
|
65906
66545
|
|
|
66546
|
+
function getTemplate(element, elementTemplates) {
|
|
66547
|
+
const templateId = elementTemplates._getTemplateId(element);
|
|
66548
|
+
|
|
66549
|
+
return templateId && elementTemplates.get(templateId);
|
|
66550
|
+
}
|
|
66551
|
+
|
|
66552
|
+
function getTemplateDocumentation(element, elementTemplates) {
|
|
66553
|
+
const template = getTemplate(element, elementTemplates);
|
|
66554
|
+
return template && template.documentationRef;
|
|
66555
|
+
}
|
|
66556
|
+
|
|
65907
66557
|
function BpmnPropertiesPanel(props) {
|
|
65908
66558
|
const {
|
|
65909
66559
|
element,
|
|
@@ -66051,7 +66701,8 @@
|
|
|
66051
66701
|
layoutConfig: layoutConfig,
|
|
66052
66702
|
layoutChanged: onLayoutChanged,
|
|
66053
66703
|
descriptionConfig: descriptionConfig,
|
|
66054
|
-
descriptionLoaded: onDescriptionLoaded
|
|
66704
|
+
descriptionLoaded: onDescriptionLoaded,
|
|
66705
|
+
eventBus: eventBus
|
|
66055
66706
|
})
|
|
66056
66707
|
});
|
|
66057
66708
|
} // helpers //////////////////////////
|
|
@@ -66069,7 +66720,7 @@
|
|
|
66069
66720
|
return element && elementRegistry.get(element.id);
|
|
66070
66721
|
}
|
|
66071
66722
|
|
|
66072
|
-
const DEFAULT_PRIORITY$
|
|
66723
|
+
const DEFAULT_PRIORITY$8 = 1000;
|
|
66073
66724
|
/**
|
|
66074
66725
|
* @typedef { import('@bpmn-io/properties-panel').GroupDefinition } GroupDefinition
|
|
66075
66726
|
* @typedef { import('@bpmn-io/properties-panel').ListGroupDefinition } ListGroupDefinition
|
|
@@ -66152,7 +66803,7 @@
|
|
|
66152
66803
|
registerProvider(priority, provider) {
|
|
66153
66804
|
if (!provider) {
|
|
66154
66805
|
provider = priority;
|
|
66155
|
-
priority = DEFAULT_PRIORITY$
|
|
66806
|
+
priority = DEFAULT_PRIORITY$8;
|
|
66156
66807
|
}
|
|
66157
66808
|
|
|
66158
66809
|
if (typeof provider.getGroups !== 'function') {
|
|
@@ -66264,13 +66915,6 @@
|
|
|
66264
66915
|
propertiesPanel: ['type', BpmnPropertiesPanelRenderer]
|
|
66265
66916
|
};
|
|
66266
66917
|
|
|
66267
|
-
function useService (type, strict) {
|
|
66268
|
-
const {
|
|
66269
|
-
getService
|
|
66270
|
-
} = F(BpmnPropertiesPanelContext);
|
|
66271
|
-
return getService(type, strict);
|
|
66272
|
-
}
|
|
66273
|
-
|
|
66274
66918
|
function ReferenceSelectEntry(props) {
|
|
66275
66919
|
const {
|
|
66276
66920
|
autoFocusEntry,
|
|
@@ -66926,6 +67570,9 @@
|
|
|
66926
67570
|
return options;
|
|
66927
67571
|
};
|
|
66928
67572
|
|
|
67573
|
+
const businessObject = getBusinessObject(element),
|
|
67574
|
+
path = pathConcat(getPath(errorEventDefinition, businessObject), 'errorRef');
|
|
67575
|
+
const show = useShowCallback(businessObject, path);
|
|
66929
67576
|
return ReferenceSelectEntry({
|
|
66930
67577
|
element,
|
|
66931
67578
|
id: 'errorRef',
|
|
@@ -66933,7 +67580,8 @@
|
|
|
66933
67580
|
autoFocusEntry: 'errorName',
|
|
66934
67581
|
getValue,
|
|
66935
67582
|
setValue,
|
|
66936
|
-
getOptions
|
|
67583
|
+
getOptions,
|
|
67584
|
+
show
|
|
66937
67585
|
});
|
|
66938
67586
|
}
|
|
66939
67587
|
|
|
@@ -67545,6 +68193,9 @@
|
|
|
67545
68193
|
return options;
|
|
67546
68194
|
};
|
|
67547
68195
|
|
|
68196
|
+
const businessObject = getBusinessObject(element),
|
|
68197
|
+
path = pathConcat(getPath(messageEventDefinition, businessObject), 'messageRef');
|
|
68198
|
+
const show = useShowCallback(businessObject, path);
|
|
67548
68199
|
return ReferenceSelectEntry({
|
|
67549
68200
|
element,
|
|
67550
68201
|
id: 'messageRef',
|
|
@@ -67552,7 +68203,8 @@
|
|
|
67552
68203
|
autoFocusEntry: 'messageName',
|
|
67553
68204
|
getValue,
|
|
67554
68205
|
setValue,
|
|
67555
|
-
getOptions
|
|
68206
|
+
getOptions,
|
|
68207
|
+
show
|
|
67556
68208
|
});
|
|
67557
68209
|
}
|
|
67558
68210
|
|
|
@@ -74558,7 +75210,7 @@
|
|
|
74558
75210
|
function JavaClass(props) {
|
|
74559
75211
|
const {
|
|
74560
75212
|
element,
|
|
74561
|
-
businessObject =
|
|
75213
|
+
businessObject = getServiceTaskLikeBusinessObject(element),
|
|
74562
75214
|
id = 'javaClass'
|
|
74563
75215
|
} = props;
|
|
74564
75216
|
const commandStack = useService('commandStack');
|
|
@@ -74591,7 +75243,7 @@
|
|
|
74591
75243
|
function Expression$1(props) {
|
|
74592
75244
|
const {
|
|
74593
75245
|
element,
|
|
74594
|
-
businessObject =
|
|
75246
|
+
businessObject = getServiceTaskLikeBusinessObject(element),
|
|
74595
75247
|
id = 'expression'
|
|
74596
75248
|
} = props;
|
|
74597
75249
|
const commandStack = useService('commandStack');
|
|
@@ -74629,7 +75281,7 @@
|
|
|
74629
75281
|
const commandStack = useService('commandStack');
|
|
74630
75282
|
const translate = useService('translate');
|
|
74631
75283
|
const debounce = useService('debounceInput');
|
|
74632
|
-
const businessObject =
|
|
75284
|
+
const businessObject = getServiceTaskLikeBusinessObject(element);
|
|
74633
75285
|
|
|
74634
75286
|
const getValue = () => {
|
|
74635
75287
|
return businessObject.get('camunda:resultVariable');
|
|
@@ -74658,7 +75310,7 @@
|
|
|
74658
75310
|
function DelegateExpression(props) {
|
|
74659
75311
|
const {
|
|
74660
75312
|
element,
|
|
74661
|
-
businessObject =
|
|
75313
|
+
businessObject = getServiceTaskLikeBusinessObject(element),
|
|
74662
75314
|
id = 'delegateExpression'
|
|
74663
75315
|
} = props;
|
|
74664
75316
|
const commandStack = useService('commandStack');
|
|
@@ -74696,7 +75348,7 @@
|
|
|
74696
75348
|
const commandStack = useService('commandStack');
|
|
74697
75349
|
const translate = useService('translate');
|
|
74698
75350
|
const debounce = useService('debounceInput');
|
|
74699
|
-
const businessObject =
|
|
75351
|
+
const businessObject = getServiceTaskLikeBusinessObject(element);
|
|
74700
75352
|
|
|
74701
75353
|
const getValue = () => {
|
|
74702
75354
|
return businessObject.get('camunda:topic');
|
|
@@ -78650,45 +79302,6 @@
|
|
|
78650
79302
|
}
|
|
78651
79303
|
ElementTemplatesLoader$1.$inject = ['config.elementTemplates', 'eventBus', 'elementTemplates'];
|
|
78652
79304
|
|
|
78653
|
-
/**
|
|
78654
|
-
* This function catches the <moddleCopy.canCopyProperty> event
|
|
78655
|
-
* and only allows the copy of the modelerTemplate property
|
|
78656
|
-
* if the element's type or its parent's is in
|
|
78657
|
-
* the list of elements the template applies to.
|
|
78658
|
-
*/
|
|
78659
|
-
|
|
78660
|
-
function ReplaceBehavior(elementTemplates, eventBus) {
|
|
78661
|
-
eventBus.on('moddleCopy.canCopyProperty', function (context) {
|
|
78662
|
-
const {
|
|
78663
|
-
parent,
|
|
78664
|
-
property,
|
|
78665
|
-
propertyName
|
|
78666
|
-
} = context;
|
|
78667
|
-
|
|
78668
|
-
if (propertyName !== 'modelerTemplate') {
|
|
78669
|
-
return;
|
|
78670
|
-
}
|
|
78671
|
-
|
|
78672
|
-
const elementTemplate = elementTemplates.get(property);
|
|
78673
|
-
|
|
78674
|
-
if (!elementTemplate) {
|
|
78675
|
-
return false;
|
|
78676
|
-
}
|
|
78677
|
-
|
|
78678
|
-
const {
|
|
78679
|
-
appliesTo
|
|
78680
|
-
} = elementTemplate;
|
|
78681
|
-
const allowed = appliesTo.reduce((allowed, type) => {
|
|
78682
|
-
return allowed || is$1(parent, type);
|
|
78683
|
-
}, false);
|
|
78684
|
-
|
|
78685
|
-
if (!allowed) {
|
|
78686
|
-
return false;
|
|
78687
|
-
}
|
|
78688
|
-
});
|
|
78689
|
-
}
|
|
78690
|
-
ReplaceBehavior.$inject = ['elementTemplates', 'eventBus'];
|
|
78691
|
-
|
|
78692
79305
|
function unlinkTemplate$1(element, injector) {
|
|
78693
79306
|
const modeling = injector.get('modeling');
|
|
78694
79307
|
modeling.updateProperties(element, {
|
|
@@ -79457,6 +80070,51 @@
|
|
|
79457
80070
|
});
|
|
79458
80071
|
}
|
|
79459
80072
|
|
|
80073
|
+
/**
|
|
80074
|
+
* This Behavior checks if the new element's type is in
|
|
80075
|
+
* the list of elements the template applies to and unlinks
|
|
80076
|
+
* it if not.
|
|
80077
|
+
*/
|
|
80078
|
+
|
|
80079
|
+
class ReplaceBehavior extends CommandInterceptor$1 {
|
|
80080
|
+
constructor(elementTemplates, injector) {
|
|
80081
|
+
super(injector.get('eventBus'));
|
|
80082
|
+
this.postExecuted('shape.replace', function (e) {
|
|
80083
|
+
var context = e.context,
|
|
80084
|
+
oldShape = context.oldShape,
|
|
80085
|
+
oldBo = getBusinessObject(oldShape),
|
|
80086
|
+
newShape = context.newShape,
|
|
80087
|
+
newBo = getBusinessObject(newShape);
|
|
80088
|
+
|
|
80089
|
+
if (!oldBo.modelerTemplate) {
|
|
80090
|
+
return;
|
|
80091
|
+
}
|
|
80092
|
+
|
|
80093
|
+
const template = newBo.modelerTemplate;
|
|
80094
|
+
const version = newBo.modelerTemplateVersion;
|
|
80095
|
+
const elementTemplate = elementTemplates.get(template, version);
|
|
80096
|
+
|
|
80097
|
+
if (!elementTemplate) {
|
|
80098
|
+
unlinkTemplate$1(newShape, injector);
|
|
80099
|
+
return;
|
|
80100
|
+
}
|
|
80101
|
+
|
|
80102
|
+
const {
|
|
80103
|
+
appliesTo
|
|
80104
|
+
} = elementTemplate;
|
|
80105
|
+
const allowed = appliesTo.reduce((allowed, type) => {
|
|
80106
|
+
return allowed || is$1(newBo, type);
|
|
80107
|
+
}, false);
|
|
80108
|
+
|
|
80109
|
+
if (!allowed) {
|
|
80110
|
+
unlinkTemplate$1(newShape, injector);
|
|
80111
|
+
}
|
|
80112
|
+
});
|
|
80113
|
+
}
|
|
80114
|
+
|
|
80115
|
+
}
|
|
80116
|
+
ReplaceBehavior.$inject = ['elementTemplates', 'injector'];
|
|
80117
|
+
|
|
79460
80118
|
/**
|
|
79461
80119
|
* Converts legacy scopes descriptor to newer supported array structure.
|
|
79462
80120
|
*
|
|
@@ -81025,7 +81683,8 @@
|
|
|
81025
81683
|
id,
|
|
81026
81684
|
label,
|
|
81027
81685
|
component: Group,
|
|
81028
|
-
entries: []
|
|
81686
|
+
entries: [],
|
|
81687
|
+
shouldOpen: true
|
|
81029
81688
|
};
|
|
81030
81689
|
properties.forEach((property, index) => {
|
|
81031
81690
|
const entry = createCustomEntry(`custom-entry-${templateId}-${index}`, element, property, scope);
|
|
@@ -82557,147 +83216,6 @@
|
|
|
82557
83216
|
Modeler$1.prototype._extensionModules
|
|
82558
83217
|
);
|
|
82559
83218
|
|
|
82560
|
-
var DEFAULT_PRIORITY$7 = 1000;
|
|
82561
|
-
|
|
82562
|
-
/**
|
|
82563
|
-
* A utility that can be used to plug-in into the command execution for
|
|
82564
|
-
* extension and/or validation.
|
|
82565
|
-
*
|
|
82566
|
-
* @param {EventBus} eventBus
|
|
82567
|
-
*
|
|
82568
|
-
* @example
|
|
82569
|
-
*
|
|
82570
|
-
* import inherits from 'inherits';
|
|
82571
|
-
*
|
|
82572
|
-
* import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
82573
|
-
*
|
|
82574
|
-
* function CommandLogger(eventBus) {
|
|
82575
|
-
* CommandInterceptor.call(this, eventBus);
|
|
82576
|
-
*
|
|
82577
|
-
* this.preExecute(function(event) {
|
|
82578
|
-
* console.log('command pre-execute', event);
|
|
82579
|
-
* });
|
|
82580
|
-
* }
|
|
82581
|
-
*
|
|
82582
|
-
* inherits(CommandLogger, CommandInterceptor);
|
|
82583
|
-
*
|
|
82584
|
-
*/
|
|
82585
|
-
function CommandInterceptor$1(eventBus) {
|
|
82586
|
-
this._eventBus = eventBus;
|
|
82587
|
-
}
|
|
82588
|
-
|
|
82589
|
-
CommandInterceptor$1.$inject = [ 'eventBus' ];
|
|
82590
|
-
|
|
82591
|
-
function unwrapEvent$1(fn, that) {
|
|
82592
|
-
return function(event) {
|
|
82593
|
-
return fn.call(that || null, event.context, event.command, event);
|
|
82594
|
-
};
|
|
82595
|
-
}
|
|
82596
|
-
|
|
82597
|
-
/**
|
|
82598
|
-
* Register an interceptor for a command execution
|
|
82599
|
-
*
|
|
82600
|
-
* @param {string|Array<string>} [events] list of commands to register on
|
|
82601
|
-
* @param {string} [hook] command hook, i.e. preExecute, executed to listen on
|
|
82602
|
-
* @param {number} [priority] the priority on which to hook into the execution
|
|
82603
|
-
* @param {Function} handlerFn interceptor to be invoked with (event)
|
|
82604
|
-
* @param {boolean} unwrap if true, unwrap the event and pass (context, command, event) to the
|
|
82605
|
-
* listener instead
|
|
82606
|
-
* @param {Object} [that] Pass context (`this`) to the handler function
|
|
82607
|
-
*/
|
|
82608
|
-
CommandInterceptor$1.prototype.on = function(events, hook, priority, handlerFn, unwrap, that) {
|
|
82609
|
-
|
|
82610
|
-
if (isFunction(hook) || isNumber(hook)) {
|
|
82611
|
-
that = unwrap;
|
|
82612
|
-
unwrap = handlerFn;
|
|
82613
|
-
handlerFn = priority;
|
|
82614
|
-
priority = hook;
|
|
82615
|
-
hook = null;
|
|
82616
|
-
}
|
|
82617
|
-
|
|
82618
|
-
if (isFunction(priority)) {
|
|
82619
|
-
that = unwrap;
|
|
82620
|
-
unwrap = handlerFn;
|
|
82621
|
-
handlerFn = priority;
|
|
82622
|
-
priority = DEFAULT_PRIORITY$7;
|
|
82623
|
-
}
|
|
82624
|
-
|
|
82625
|
-
if (isObject(unwrap)) {
|
|
82626
|
-
that = unwrap;
|
|
82627
|
-
unwrap = false;
|
|
82628
|
-
}
|
|
82629
|
-
|
|
82630
|
-
if (!isFunction(handlerFn)) {
|
|
82631
|
-
throw new Error('handlerFn must be a function');
|
|
82632
|
-
}
|
|
82633
|
-
|
|
82634
|
-
if (!isArray(events)) {
|
|
82635
|
-
events = [ events ];
|
|
82636
|
-
}
|
|
82637
|
-
|
|
82638
|
-
var eventBus = this._eventBus;
|
|
82639
|
-
|
|
82640
|
-
forEach(events, function(event) {
|
|
82641
|
-
|
|
82642
|
-
// concat commandStack(.event)?(.hook)?
|
|
82643
|
-
var fullEvent = [ 'commandStack', event, hook ].filter(function(e) { return e; }).join('.');
|
|
82644
|
-
|
|
82645
|
-
eventBus.on(fullEvent, priority, unwrap ? unwrapEvent$1(handlerFn, that) : handlerFn, that);
|
|
82646
|
-
});
|
|
82647
|
-
};
|
|
82648
|
-
|
|
82649
|
-
|
|
82650
|
-
var hooks$1 = [
|
|
82651
|
-
'canExecute',
|
|
82652
|
-
'preExecute',
|
|
82653
|
-
'preExecuted',
|
|
82654
|
-
'execute',
|
|
82655
|
-
'executed',
|
|
82656
|
-
'postExecute',
|
|
82657
|
-
'postExecuted',
|
|
82658
|
-
'revert',
|
|
82659
|
-
'reverted'
|
|
82660
|
-
];
|
|
82661
|
-
|
|
82662
|
-
/*
|
|
82663
|
-
* Install hook shortcuts
|
|
82664
|
-
*
|
|
82665
|
-
* This will generate the CommandInterceptor#(preExecute|...|reverted) methods
|
|
82666
|
-
* which will in term forward to CommandInterceptor#on.
|
|
82667
|
-
*/
|
|
82668
|
-
forEach(hooks$1, function(hook) {
|
|
82669
|
-
|
|
82670
|
-
/**
|
|
82671
|
-
* {canExecute|preExecute|preExecuted|execute|executed|postExecute|postExecuted|revert|reverted}
|
|
82672
|
-
*
|
|
82673
|
-
* A named hook for plugging into the command execution
|
|
82674
|
-
*
|
|
82675
|
-
* @param {string|Array<string>} [events] list of commands to register on
|
|
82676
|
-
* @param {number} [priority] the priority on which to hook into the execution
|
|
82677
|
-
* @param {Function} handlerFn interceptor to be invoked with (event)
|
|
82678
|
-
* @param {boolean} [unwrap=false] if true, unwrap the event and pass (context, command, event) to the
|
|
82679
|
-
* listener instead
|
|
82680
|
-
* @param {Object} [that] Pass context (`this`) to the handler function
|
|
82681
|
-
*/
|
|
82682
|
-
CommandInterceptor$1.prototype[hook] = function(events, priority, handlerFn, unwrap, that) {
|
|
82683
|
-
|
|
82684
|
-
if (isFunction(events) || isNumber(events)) {
|
|
82685
|
-
that = unwrap;
|
|
82686
|
-
unwrap = handlerFn;
|
|
82687
|
-
handlerFn = priority;
|
|
82688
|
-
priority = events;
|
|
82689
|
-
events = null;
|
|
82690
|
-
}
|
|
82691
|
-
|
|
82692
|
-
this.on(events, hook, priority, handlerFn, unwrap, that);
|
|
82693
|
-
};
|
|
82694
|
-
});
|
|
82695
|
-
|
|
82696
|
-
var CommandInterceptor$2 = /*#__PURE__*/Object.freeze({
|
|
82697
|
-
__proto__: null,
|
|
82698
|
-
'default': CommandInterceptor$1
|
|
82699
|
-
});
|
|
82700
|
-
|
|
82701
83219
|
/**
|
|
82702
83220
|
* Get extension elements of business object. Optionally filter by type.
|
|
82703
83221
|
*
|
|
@@ -82751,7 +83269,7 @@
|
|
|
82751
83269
|
});
|
|
82752
83270
|
}
|
|
82753
83271
|
|
|
82754
|
-
const HIGH_PRIORITY$
|
|
83272
|
+
const HIGH_PRIORITY$m = 5000;
|
|
82755
83273
|
|
|
82756
83274
|
|
|
82757
83275
|
/**
|
|
@@ -82765,7 +83283,7 @@
|
|
|
82765
83283
|
this.postExecute([
|
|
82766
83284
|
'element.updateProperties',
|
|
82767
83285
|
'element.updateModdleProperties'
|
|
82768
|
-
], HIGH_PRIORITY$
|
|
83286
|
+
], HIGH_PRIORITY$m, function(context) {
|
|
82769
83287
|
const {
|
|
82770
83288
|
element,
|
|
82771
83289
|
moddleElement,
|
|
@@ -82794,7 +83312,7 @@
|
|
|
82794
83312
|
'eventBus'
|
|
82795
83313
|
];
|
|
82796
83314
|
|
|
82797
|
-
const HIGH_PRIORITY$
|
|
83315
|
+
const HIGH_PRIORITY$n = 5000;
|
|
82798
83316
|
|
|
82799
83317
|
|
|
82800
83318
|
/**
|
|
@@ -82809,7 +83327,7 @@
|
|
|
82809
83327
|
this.postExecute([
|
|
82810
83328
|
'element.updateProperties',
|
|
82811
83329
|
'element.updateModdleProperties'
|
|
82812
|
-
], HIGH_PRIORITY$
|
|
83330
|
+
], HIGH_PRIORITY$n, function(context) {
|
|
82813
83331
|
const {
|
|
82814
83332
|
element,
|
|
82815
83333
|
moddleElement,
|
|
@@ -82879,7 +83397,7 @@
|
|
|
82879
83397
|
});
|
|
82880
83398
|
}
|
|
82881
83399
|
|
|
82882
|
-
const HIGH_PRIORITY$
|
|
83400
|
+
const HIGH_PRIORITY$o = 5000;
|
|
82883
83401
|
|
|
82884
83402
|
|
|
82885
83403
|
/**
|
|
@@ -82893,7 +83411,7 @@
|
|
|
82893
83411
|
this.preExecute([
|
|
82894
83412
|
'element.updateProperties',
|
|
82895
83413
|
'element.updateModdleProperties',
|
|
82896
|
-
], HIGH_PRIORITY$
|
|
83414
|
+
], HIGH_PRIORITY$o, function(context) {
|
|
82897
83415
|
const {
|
|
82898
83416
|
element,
|
|
82899
83417
|
moddleElement,
|
|
@@ -82988,7 +83506,7 @@
|
|
|
82988
83506
|
'eventBus'
|
|
82989
83507
|
];
|
|
82990
83508
|
|
|
82991
|
-
const HIGH_PRIORITY$
|
|
83509
|
+
const HIGH_PRIORITY$p = 5000;
|
|
82992
83510
|
|
|
82993
83511
|
|
|
82994
83512
|
/**
|
|
@@ -83002,7 +83520,7 @@
|
|
|
83002
83520
|
this.preExecute([
|
|
83003
83521
|
'element.updateProperties',
|
|
83004
83522
|
'element.updateModdleProperties'
|
|
83005
|
-
], HIGH_PRIORITY$
|
|
83523
|
+
], HIGH_PRIORITY$p, function(context) {
|
|
83006
83524
|
const {
|
|
83007
83525
|
element,
|
|
83008
83526
|
moddleElement,
|
|
@@ -84403,8 +84921,6 @@
|
|
|
84403
84921
|
emumerations: emumerations
|
|
84404
84922
|
};
|
|
84405
84923
|
|
|
84406
|
-
var require$$0 = /*@__PURE__*/getAugmentedNamespace(index_esm);
|
|
84407
|
-
|
|
84408
84924
|
var isFunction$1 = require$$0.isFunction,
|
|
84409
84925
|
isObject$1 = require$$0.isObject,
|
|
84410
84926
|
some$1 = require$$0.some;
|