camunda-bpmn-js 0.13.0-alpha.0 → 0.13.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/assets/diagram-js.css +80 -78
- package/dist/assets/element-templates.css +3 -3
- package/dist/assets/properties-panel.css +5 -17
- package/dist/base-modeler.development.js +299 -120
- package/dist/base-modeler.production.min.js +4 -4
- package/dist/camunda-cloud-modeler.development.js +820 -157
- package/dist/camunda-cloud-modeler.production.min.js +4 -4
- package/dist/camunda-platform-modeler.development.js +456 -132
- package/dist/camunda-platform-modeler.production.min.js +4 -4
- package/lib/camunda-cloud/Modeler.js +6 -1
- package/lib/camunda-cloud/helper/Utils.js +1 -1
- package/package.json +8 -8
|
@@ -8280,6 +8280,20 @@
|
|
|
8280
8280
|
* @param {Object} options
|
|
8281
8281
|
*/
|
|
8282
8282
|
Properties.prototype.define = function(target, name, options) {
|
|
8283
|
+
|
|
8284
|
+
if (!options.writable) {
|
|
8285
|
+
|
|
8286
|
+
var value = options.value;
|
|
8287
|
+
|
|
8288
|
+
// use getters for read-only variables to support ES6 proxies
|
|
8289
|
+
// cf. https://github.com/bpmn-io/internal-docs/issues/386
|
|
8290
|
+
options = assign({}, options, {
|
|
8291
|
+
get: function() { return value; }
|
|
8292
|
+
});
|
|
8293
|
+
|
|
8294
|
+
delete options.value;
|
|
8295
|
+
}
|
|
8296
|
+
|
|
8283
8297
|
Object.defineProperty(target, name, options);
|
|
8284
8298
|
};
|
|
8285
8299
|
|
|
@@ -25688,14 +25702,23 @@
|
|
|
25688
25702
|
// the touch recognizer
|
|
25689
25703
|
var recognizer;
|
|
25690
25704
|
|
|
25691
|
-
function handler(type) {
|
|
25705
|
+
function handler(type, buttonType) {
|
|
25692
25706
|
|
|
25693
25707
|
return function(event) {
|
|
25694
25708
|
|
|
25695
|
-
|
|
25709
|
+
var gfx = getGfx(event.target),
|
|
25710
|
+
element = gfx && elementRegistry.get(gfx);
|
|
25711
|
+
|
|
25712
|
+
// translate into an actual mouse click event
|
|
25713
|
+
if (buttonType) {
|
|
25714
|
+
event.srcEvent.button = buttonType;
|
|
25715
|
+
}
|
|
25716
|
+
|
|
25717
|
+
return interactionEvents.fire(type, event, element);
|
|
25696
25718
|
};
|
|
25697
25719
|
}
|
|
25698
25720
|
|
|
25721
|
+
|
|
25699
25722
|
function getGfx(target) {
|
|
25700
25723
|
var node = closest(target, 'svg, .djs-element', true);
|
|
25701
25724
|
return node;
|
|
@@ -25706,10 +25729,6 @@
|
|
|
25706
25729
|
// touch recognizer
|
|
25707
25730
|
recognizer = createTouchRecognizer(svg);
|
|
25708
25731
|
|
|
25709
|
-
recognizer.on('doubletap', handler('element.dblclick'));
|
|
25710
|
-
|
|
25711
|
-
recognizer.on('tap', handler('element.click'));
|
|
25712
|
-
|
|
25713
25732
|
function startGrabCanvas(event) {
|
|
25714
25733
|
|
|
25715
25734
|
var lx = 0, ly = 0;
|
|
@@ -25777,6 +25796,9 @@
|
|
|
25777
25796
|
recognizer.on('pinchcancel', end);
|
|
25778
25797
|
}
|
|
25779
25798
|
|
|
25799
|
+
recognizer.on('tap', handler('element.click'));
|
|
25800
|
+
recognizer.on('doubletap', handler('element.dblclick', 1));
|
|
25801
|
+
|
|
25780
25802
|
recognizer.on('panstart', startGrab);
|
|
25781
25803
|
recognizer.on('press', startGrab);
|
|
25782
25804
|
|
|
@@ -35900,7 +35922,7 @@
|
|
|
35900
35922
|
return this._createEntries(element, DATA_OBJECT_REFERENCE);
|
|
35901
35923
|
}
|
|
35902
35924
|
|
|
35903
|
-
if (is$1(businessObject, 'bpmn:DataStoreReference')) {
|
|
35925
|
+
if (is$1(businessObject, 'bpmn:DataStoreReference') && !is$1(element.parent, 'bpmn:Collaboration')) {
|
|
35904
35926
|
return this._createEntries(element, DATA_STORE_REFERENCE);
|
|
35905
35927
|
}
|
|
35906
35928
|
|
|
@@ -39901,7 +39923,7 @@
|
|
|
39901
39923
|
|
|
39902
39924
|
function activateDirectEdit(element, force) {
|
|
39903
39925
|
if (force ||
|
|
39904
|
-
isAny(element, [ 'bpmn:Task', 'bpmn:TextAnnotation'
|
|
39926
|
+
isAny(element, [ 'bpmn:Task', 'bpmn:TextAnnotation' ]) ||
|
|
39905
39927
|
isCollapsedSubProcess(element)) {
|
|
39906
39928
|
|
|
39907
39929
|
directEditing.activate(element);
|
|
@@ -41243,122 +41265,97 @@
|
|
|
41243
41265
|
}
|
|
41244
41266
|
});
|
|
41245
41267
|
|
|
41246
|
-
|
|
41247
|
-
|
|
41248
|
-
collaboration;
|
|
41249
|
-
|
|
41268
|
+
// turn process into collaboration when creating first participant
|
|
41269
|
+
function getOrCreateCollaboration() {
|
|
41250
41270
|
var rootElement = canvas.getRootElement();
|
|
41251
41271
|
|
|
41252
41272
|
if (is$1(rootElement, 'bpmn:Collaboration')) {
|
|
41253
|
-
|
|
41254
|
-
} else {
|
|
41255
|
-
|
|
41256
|
-
// update root element by making collaboration
|
|
41257
|
-
collaboration = modeling.makeCollaboration();
|
|
41258
|
-
|
|
41259
|
-
// re-use process when creating first participant
|
|
41260
|
-
context.process = parent;
|
|
41273
|
+
return rootElement;
|
|
41261
41274
|
}
|
|
41262
41275
|
|
|
41263
|
-
|
|
41276
|
+
return modeling.makeCollaboration();
|
|
41264
41277
|
}
|
|
41265
41278
|
|
|
41266
|
-
//
|
|
41267
|
-
|
|
41268
|
-
|
|
41269
|
-
|
|
41270
|
-
|
|
41271
|
-
|
|
41272
|
-
|
|
41273
|
-
}
|
|
41274
|
-
}, true);
|
|
41275
|
-
|
|
41276
|
-
this.execute('shape.create', function(context) {
|
|
41277
|
-
var process = context.process,
|
|
41278
|
-
shape = context.shape;
|
|
41279
|
-
|
|
41280
|
-
if (process) {
|
|
41281
|
-
context.oldProcessRef = shape.businessObject.processRef;
|
|
41282
|
-
|
|
41283
|
-
// re-use process when creating first participant
|
|
41284
|
-
shape.businessObject.processRef = process.businessObject;
|
|
41285
|
-
}
|
|
41286
|
-
}, true);
|
|
41279
|
+
// when creating mutliple elements through `elements.create` parent must be set to collaboration
|
|
41280
|
+
// and passed to `shape.create` as hint
|
|
41281
|
+
this.preExecute('elements.create', HIGH_PRIORITY$9, function(context) {
|
|
41282
|
+
var elements = context.elements,
|
|
41283
|
+
parent = context.parent,
|
|
41284
|
+
participant = findParticipant(elements),
|
|
41285
|
+
hints;
|
|
41287
41286
|
|
|
41288
|
-
|
|
41289
|
-
|
|
41290
|
-
shape = context.shape;
|
|
41287
|
+
if (participant && is$1(parent, 'bpmn:Process')) {
|
|
41288
|
+
context.parent = getOrCreateCollaboration();
|
|
41291
41289
|
|
|
41292
|
-
|
|
41290
|
+
hints = context.hints = context.hints || {};
|
|
41293
41291
|
|
|
41294
|
-
|
|
41295
|
-
|
|
41292
|
+
hints.participant = participant;
|
|
41293
|
+
hints.process = parent;
|
|
41294
|
+
hints.processRef = getBusinessObject(participant).get('processRef');
|
|
41296
41295
|
}
|
|
41297
41296
|
}, true);
|
|
41298
41297
|
|
|
41299
|
-
|
|
41300
|
-
|
|
41298
|
+
// when creating single shape through `shape.create` parent must be set to collaboration
|
|
41299
|
+
// unless it was already set through `elements.create`
|
|
41300
|
+
this.preExecute('shape.create', function(context) {
|
|
41301
|
+
var parent = context.parent,
|
|
41301
41302
|
shape = context.shape;
|
|
41302
41303
|
|
|
41303
|
-
if (
|
|
41304
|
-
|
|
41305
|
-
// move children from process to participant
|
|
41306
|
-
var processChildren = process.children.slice();
|
|
41304
|
+
if (is$1(shape, 'bpmn:Participant') && is$1(parent, 'bpmn:Process')) {
|
|
41305
|
+
context.parent = getOrCreateCollaboration();
|
|
41307
41306
|
|
|
41308
|
-
|
|
41307
|
+
context.process = parent;
|
|
41308
|
+
context.processRef = getBusinessObject(shape).get('processRef');
|
|
41309
41309
|
}
|
|
41310
|
-
|
|
41311
41310
|
}, true);
|
|
41312
41311
|
|
|
41313
|
-
//
|
|
41314
|
-
this.
|
|
41315
|
-
var
|
|
41316
|
-
|
|
41317
|
-
|
|
41318
|
-
|
|
41319
|
-
var hasParticipants = findParticipant(elements);
|
|
41320
|
-
|
|
41321
|
-
if (hasParticipants && is$1(parent, 'bpmn:Process')) {
|
|
41322
|
-
ensureCollaboration(context);
|
|
41323
|
-
|
|
41324
|
-
participant = findParticipant(elements);
|
|
41312
|
+
// #execute necessary because #preExecute not called on CommandStack#redo
|
|
41313
|
+
this.execute('shape.create', function(context) {
|
|
41314
|
+
var hints = context.hints || {},
|
|
41315
|
+
process = context.process || hints.process,
|
|
41316
|
+
shape = context.shape,
|
|
41317
|
+
participant = hints.participant;
|
|
41325
41318
|
|
|
41326
|
-
|
|
41319
|
+
// both shape.create and elements.create must be handled
|
|
41320
|
+
if (process && (!participant || shape === participant)) {
|
|
41327
41321
|
|
|
41328
|
-
//
|
|
41329
|
-
|
|
41322
|
+
// monkey-patch process ref
|
|
41323
|
+
getBusinessObject(shape).set('processRef', getBusinessObject(process));
|
|
41330
41324
|
}
|
|
41331
41325
|
}, true);
|
|
41332
41326
|
|
|
41333
|
-
this.revert('
|
|
41334
|
-
var
|
|
41335
|
-
process = context.process,
|
|
41336
|
-
|
|
41327
|
+
this.revert('shape.create', function(context) {
|
|
41328
|
+
var hints = context.hints || {},
|
|
41329
|
+
process = context.process || hints.process,
|
|
41330
|
+
processRef = context.processRef || hints.processRef,
|
|
41331
|
+
shape = context.shape,
|
|
41332
|
+
participant = hints.participant;
|
|
41337
41333
|
|
|
41338
|
-
|
|
41339
|
-
|
|
41334
|
+
// both shape.create and elements.create must be handled
|
|
41335
|
+
if (process && (!participant || shape === participant)) {
|
|
41340
41336
|
|
|
41341
|
-
//
|
|
41342
|
-
|
|
41337
|
+
// monkey-patch process ref
|
|
41338
|
+
getBusinessObject(shape).set('processRef', processRef);
|
|
41343
41339
|
}
|
|
41344
41340
|
}, true);
|
|
41345
41341
|
|
|
41346
|
-
this.postExecute('
|
|
41347
|
-
var
|
|
41348
|
-
process = context.process,
|
|
41349
|
-
|
|
41342
|
+
this.postExecute('shape.create', function(context) {
|
|
41343
|
+
var hints = context.hints || {},
|
|
41344
|
+
process = context.process || context.hints.process,
|
|
41345
|
+
shape = context.shape,
|
|
41346
|
+
participant = hints.participant;
|
|
41350
41347
|
|
|
41351
41348
|
if (process) {
|
|
41352
|
-
|
|
41353
|
-
|
|
41354
|
-
// move children from process to first participant
|
|
41355
|
-
var processChildren = process.children.slice();
|
|
41349
|
+
var children = process.children.slice();
|
|
41356
41350
|
|
|
41357
|
-
|
|
41351
|
+
// both shape.create and elements.create must be handled
|
|
41352
|
+
if (!participant) {
|
|
41353
|
+
modeling.moveElements(children, { x: 0, y: 0 }, shape);
|
|
41354
|
+
} else if (shape === participant) {
|
|
41355
|
+
modeling.moveElements(children, { x: 0, y: 0 }, participant);
|
|
41356
|
+
}
|
|
41358
41357
|
}
|
|
41359
|
-
|
|
41360
41358
|
}, true);
|
|
41361
|
-
|
|
41362
41359
|
}
|
|
41363
41360
|
|
|
41364
41361
|
CreateParticipantBehavior$1.$inject = [
|
|
@@ -44779,7 +44776,9 @@
|
|
|
44779
44776
|
var rootElement = canvas.getRootElement(),
|
|
44780
44777
|
rootElementBo = rootElement.businessObject;
|
|
44781
44778
|
|
|
44782
|
-
|
|
44779
|
+
if (is$1(rootElement, 'bpmn:Collaboration')) {
|
|
44780
|
+
moddle.ids.unclaim(rootElementBo.id);
|
|
44781
|
+
}
|
|
44783
44782
|
});
|
|
44784
44783
|
}
|
|
44785
44784
|
|
|
@@ -48727,6 +48726,10 @@
|
|
|
48727
48726
|
};
|
|
48728
48727
|
|
|
48729
48728
|
BpmnFactory.prototype._ensureId = function(element) {
|
|
48729
|
+
if (element.id) {
|
|
48730
|
+
this._model.ids.claim(element.id, element);
|
|
48731
|
+
return;
|
|
48732
|
+
}
|
|
48730
48733
|
|
|
48731
48734
|
// generate semantic ids for elements
|
|
48732
48735
|
// bpmn:SequenceFlow -> SequenceFlow_ID
|
|
@@ -48797,7 +48800,8 @@
|
|
|
48797
48800
|
|
|
48798
48801
|
BpmnFactory.prototype.createDiEdge = function(semantic, waypoints, attrs) {
|
|
48799
48802
|
return this.create('bpmndi:BPMNEdge', assign({
|
|
48800
|
-
bpmnElement: semantic
|
|
48803
|
+
bpmnElement: semantic,
|
|
48804
|
+
waypoint: this.createDiWaypoints(waypoints)
|
|
48801
48805
|
}, attrs));
|
|
48802
48806
|
};
|
|
48803
48807
|
|
|
@@ -52982,12 +52986,26 @@
|
|
|
52982
52986
|
// TODO @barmac: remove once we drop bpmn.io properties
|
|
52983
52987
|
ensureLegacySupport(assignedDi);
|
|
52984
52988
|
|
|
52985
|
-
|
|
52986
|
-
|
|
52987
|
-
|
|
52988
|
-
|
|
52989
|
-
|
|
52990
|
-
|
|
52989
|
+
if (element.labelTarget) {
|
|
52990
|
+
|
|
52991
|
+
// set label colors as bpmndi:BPMNLabel#color
|
|
52992
|
+
self._commandStack.execute('element.updateModdleProperties', {
|
|
52993
|
+
element: element,
|
|
52994
|
+
moddleElement: element.businessObject.di.label,
|
|
52995
|
+
properties: {
|
|
52996
|
+
color: di['background-color']
|
|
52997
|
+
}
|
|
52998
|
+
});
|
|
52999
|
+
} else {
|
|
53000
|
+
|
|
53001
|
+
// set colors bpmndi:BPMNEdge or bpmndi:BPMNShape
|
|
53002
|
+
self._commandStack.execute('element.updateProperties', {
|
|
53003
|
+
element: element,
|
|
53004
|
+
properties: {
|
|
53005
|
+
di: assignedDi
|
|
53006
|
+
}
|
|
53007
|
+
});
|
|
53008
|
+
}
|
|
52991
53009
|
});
|
|
52992
53010
|
|
|
52993
53011
|
};
|
|
@@ -56197,7 +56215,7 @@
|
|
|
56197
56215
|
|
|
56198
56216
|
create.start(event, [ subProcess, startEvent ], {
|
|
56199
56217
|
hints: {
|
|
56200
|
-
autoSelect: [
|
|
56218
|
+
autoSelect: [ subProcess ]
|
|
56201
56219
|
}
|
|
56202
56220
|
});
|
|
56203
56221
|
}
|
|
@@ -61460,7 +61478,7 @@
|
|
|
61460
61478
|
descriptionLoaded
|
|
61461
61479
|
} = props; // set-up layout context
|
|
61462
61480
|
|
|
61463
|
-
const [layout, setLayout] = l(
|
|
61481
|
+
const [layout, setLayout] = l(createLayout(layoutConfig));
|
|
61464
61482
|
y$1(() => {
|
|
61465
61483
|
if (typeof layoutChanged === 'function') {
|
|
61466
61484
|
layoutChanged(layout);
|
|
@@ -61472,7 +61490,9 @@
|
|
|
61472
61490
|
};
|
|
61473
61491
|
|
|
61474
61492
|
const setLayoutForKey = (key, config) => {
|
|
61475
|
-
|
|
61493
|
+
const newLayout = assign({}, layout);
|
|
61494
|
+
set(newLayout, key, config);
|
|
61495
|
+
setLayout(newLayout);
|
|
61476
61496
|
};
|
|
61477
61497
|
|
|
61478
61498
|
const layoutContext = {
|
|
@@ -61531,7 +61551,7 @@
|
|
|
61531
61551
|
});
|
|
61532
61552
|
} // helpers //////////////////
|
|
61533
61553
|
|
|
61534
|
-
function
|
|
61554
|
+
function createLayout(overrides) {
|
|
61535
61555
|
return { ...DEFAULT_LAYOUT,
|
|
61536
61556
|
...overrides
|
|
61537
61557
|
};
|
|
@@ -62275,6 +62295,7 @@
|
|
|
62275
62295
|
disabled: disabled,
|
|
62276
62296
|
class: "bio-properties-panel-input",
|
|
62277
62297
|
onInput: handleInput,
|
|
62298
|
+
"aria-label": value || '<empty>',
|
|
62278
62299
|
onFocus: onFocus,
|
|
62279
62300
|
onBlur: onBlur,
|
|
62280
62301
|
value: value || ''
|
|
@@ -68067,7 +68088,20 @@
|
|
|
68067
68088
|
return () => {
|
|
68068
68089
|
eventBus.off('elements.changed', onElementsChanged);
|
|
68069
68090
|
};
|
|
68070
|
-
}, [selectedElement]); // (2c)
|
|
68091
|
+
}, [selectedElement]); // (2c) root element changed
|
|
68092
|
+
|
|
68093
|
+
y$1(() => {
|
|
68094
|
+
const onRootAdded = e => {
|
|
68095
|
+
const element = e.element;
|
|
68096
|
+
|
|
68097
|
+
_update(element);
|
|
68098
|
+
};
|
|
68099
|
+
|
|
68100
|
+
eventBus.on('root.added', onRootAdded);
|
|
68101
|
+
return () => {
|
|
68102
|
+
eventBus.off('root.added', onRootAdded);
|
|
68103
|
+
};
|
|
68104
|
+
}, [selectedElement]); // (2d) provided entries changed
|
|
68071
68105
|
|
|
68072
68106
|
y$1(() => {
|
|
68073
68107
|
const onProvidersChanged = () => {
|
|
@@ -68078,7 +68112,7 @@
|
|
|
68078
68112
|
return () => {
|
|
68079
68113
|
eventBus.off('propertiesPanel.providersChanged', onProvidersChanged);
|
|
68080
68114
|
};
|
|
68081
|
-
}, [selectedElement]); // (
|
|
68115
|
+
}, [selectedElement]); // (2e) element templates changed
|
|
68082
68116
|
|
|
68083
68117
|
y$1(() => {
|
|
68084
68118
|
const onTemplatesChanged = () => {
|
|
@@ -68168,23 +68202,20 @@
|
|
|
68168
68202
|
this._layoutConfig = layoutConfig;
|
|
68169
68203
|
this._descriptionConfig = descriptionConfig;
|
|
68170
68204
|
this._container = domify('<div style="height: 100%" class="bio-properties-panel-container" input-handle-modified-keys="y,z"></div>');
|
|
68171
|
-
|
|
68172
|
-
this._eventBus.on('root.added', event => {
|
|
68173
|
-
const {
|
|
68174
|
-
element
|
|
68175
|
-
} = event;
|
|
68176
|
-
|
|
68177
|
-
this._render(element);
|
|
68178
|
-
|
|
68205
|
+
eventBus.on('diagram.init', () => {
|
|
68179
68206
|
if (parent) {
|
|
68180
68207
|
this.attachTo(parent);
|
|
68181
68208
|
}
|
|
68182
|
-
|
|
68183
|
-
return;
|
|
68184
68209
|
});
|
|
68210
|
+
eventBus.on('diagram.destroy', () => {
|
|
68211
|
+
this.detach();
|
|
68212
|
+
});
|
|
68213
|
+
eventBus.on('root.added', event => {
|
|
68214
|
+
const {
|
|
68215
|
+
element
|
|
68216
|
+
} = event;
|
|
68185
68217
|
|
|
68186
|
-
|
|
68187
|
-
this._destroy();
|
|
68218
|
+
this._render(element);
|
|
68188
68219
|
});
|
|
68189
68220
|
}
|
|
68190
68221
|
/**
|
|
@@ -69914,7 +69945,7 @@
|
|
|
69914
69945
|
isEdited: isEdited$1
|
|
69915
69946
|
}, {
|
|
69916
69947
|
id: 'completionCondition',
|
|
69917
|
-
component: o$2(CompletionCondition, {
|
|
69948
|
+
component: o$2(CompletionCondition$1, {
|
|
69918
69949
|
element: element
|
|
69919
69950
|
}),
|
|
69920
69951
|
isEdited: isEdited$1
|
|
@@ -69949,7 +69980,7 @@
|
|
|
69949
69980
|
});
|
|
69950
69981
|
}
|
|
69951
69982
|
|
|
69952
|
-
function CompletionCondition(props) {
|
|
69983
|
+
function CompletionCondition$1(props) {
|
|
69953
69984
|
const {
|
|
69954
69985
|
element
|
|
69955
69986
|
} = props;
|
|
@@ -70123,7 +70154,7 @@
|
|
|
70123
70154
|
*/
|
|
70124
70155
|
|
|
70125
70156
|
|
|
70126
|
-
function getCompletionCondition(element) {
|
|
70157
|
+
function getCompletionCondition$1(element) {
|
|
70127
70158
|
return getProperty$2(element, 'completionCondition');
|
|
70128
70159
|
}
|
|
70129
70160
|
/**
|
|
@@ -70136,7 +70167,7 @@
|
|
|
70136
70167
|
|
|
70137
70168
|
|
|
70138
70169
|
function getCompletionConditionValue(element) {
|
|
70139
|
-
const completionCondition = getCompletionCondition(element);
|
|
70170
|
+
const completionCondition = getCompletionCondition$1(element);
|
|
70140
70171
|
return getBody(completionCondition);
|
|
70141
70172
|
}
|
|
70142
70173
|
|
|
@@ -82949,12 +82980,12 @@
|
|
|
82949
82980
|
const translate = useService('translate'),
|
|
82950
82981
|
injector = useService('injector');
|
|
82951
82982
|
const menuItems = [{
|
|
82952
|
-
entry: translate('Unlink'),
|
|
82953
|
-
action: () => unlinkTemplate(element, injector)
|
|
82954
|
-
}, {
|
|
82955
82983
|
entry: o$2(NotFoundText, {})
|
|
82956
82984
|
}, {
|
|
82957
82985
|
separator: true
|
|
82986
|
+
}, {
|
|
82987
|
+
entry: translate('Unlink'),
|
|
82988
|
+
action: () => unlinkTemplate(element, injector)
|
|
82958
82989
|
}, {
|
|
82959
82990
|
entry: o$2(RemoveTemplate, {}),
|
|
82960
82991
|
action: () => removeTemplate(element, injector)
|
|
@@ -82997,14 +83028,14 @@
|
|
|
82997
83028
|
const translate = useService('translate'),
|
|
82998
83029
|
injector = useService('injector');
|
|
82999
83030
|
const menuItems = [{
|
|
83000
|
-
entry: translate('Update'),
|
|
83001
|
-
action: () => updateTemplate(element, newerTemplate, injector)
|
|
83002
|
-
}, {
|
|
83003
83031
|
entry: o$2(UpdateAvailableText, {
|
|
83004
83032
|
newerTemplate: newerTemplate
|
|
83005
83033
|
})
|
|
83006
83034
|
}, {
|
|
83007
83035
|
separator: true
|
|
83036
|
+
}, {
|
|
83037
|
+
entry: translate('Update'),
|
|
83038
|
+
action: () => updateTemplate(element, newerTemplate, injector)
|
|
83008
83039
|
}, {
|
|
83009
83040
|
entry: translate('Unlink'),
|
|
83010
83041
|
action: () => unlinkTemplate(element, injector)
|
|
@@ -83189,6 +83220,287 @@
|
|
|
83189
83220
|
});
|
|
83190
83221
|
}
|
|
83191
83222
|
|
|
83223
|
+
var e$2,
|
|
83224
|
+
o$3 = {};
|
|
83225
|
+
|
|
83226
|
+
function n$1(r, t, e) {
|
|
83227
|
+
if (3 === r.nodeType) {
|
|
83228
|
+
var o = "textContent" in r ? r.textContent : r.nodeValue || "";
|
|
83229
|
+
|
|
83230
|
+
if (!1 !== n$1.options.trim) {
|
|
83231
|
+
var a = 0 === t || t === e.length - 1;
|
|
83232
|
+
if ((!(o = o.match(/^[\s\n]+$/g) && "all" !== n$1.options.trim ? " " : o.replace(/(^[\s\n]+|[\s\n]+$)/g, "all" === n$1.options.trim || a ? "" : " ")) || " " === o) && e.length > 1 && a) return null;
|
|
83233
|
+
}
|
|
83234
|
+
|
|
83235
|
+
return o;
|
|
83236
|
+
}
|
|
83237
|
+
|
|
83238
|
+
if (1 !== r.nodeType) return null;
|
|
83239
|
+
var p = String(r.nodeName).toLowerCase();
|
|
83240
|
+
if ("script" === p && !n$1.options.allowScripts) return null;
|
|
83241
|
+
var l,
|
|
83242
|
+
s,
|
|
83243
|
+
u = n$1.h(p, function (r) {
|
|
83244
|
+
var t = r && r.length;
|
|
83245
|
+
if (!t) return null;
|
|
83246
|
+
|
|
83247
|
+
for (var e = {}, o = 0; o < t; o++) {
|
|
83248
|
+
var a = r[o],
|
|
83249
|
+
i = a.name,
|
|
83250
|
+
p = a.value;
|
|
83251
|
+
"on" === i.substring(0, 2) && n$1.options.allowEvents && (p = new Function(p)), e[i] = p;
|
|
83252
|
+
}
|
|
83253
|
+
|
|
83254
|
+
return e;
|
|
83255
|
+
}(r.attributes), (s = (l = r.childNodes) && Array.prototype.map.call(l, n$1).filter(i$2)) && s.length ? s : null);
|
|
83256
|
+
return n$1.visitor && n$1.visitor(u), u;
|
|
83257
|
+
}
|
|
83258
|
+
|
|
83259
|
+
var a$2,
|
|
83260
|
+
i$2 = function (r) {
|
|
83261
|
+
return r;
|
|
83262
|
+
},
|
|
83263
|
+
p$2 = {};
|
|
83264
|
+
|
|
83265
|
+
function l$1(r) {
|
|
83266
|
+
var t = (r.type || "").toLowerCase(),
|
|
83267
|
+
e = l$1.map;
|
|
83268
|
+
e && e.hasOwnProperty(t) ? (r.type = e[t], r.props = Object.keys(r.props || {}).reduce(function (t, e) {
|
|
83269
|
+
var o;
|
|
83270
|
+
return t[(o = e, o.replace(/-(.)/g, function (r, t) {
|
|
83271
|
+
return t.toUpperCase();
|
|
83272
|
+
}))] = r.props[e], t;
|
|
83273
|
+
}, {})) : r.type = t.replace(/[^a-z0-9-]/i, "");
|
|
83274
|
+
}
|
|
83275
|
+
|
|
83276
|
+
var Markup = (function (t) {
|
|
83277
|
+
function i() {
|
|
83278
|
+
t.apply(this, arguments);
|
|
83279
|
+
}
|
|
83280
|
+
|
|
83281
|
+
return t && (i.__proto__ = t), (i.prototype = Object.create(t && t.prototype)).constructor = i, i.setReviver = function (r) {
|
|
83282
|
+
a$2 = r;
|
|
83283
|
+
}, i.prototype.shouldComponentUpdate = function (r) {
|
|
83284
|
+
var t = this.props;
|
|
83285
|
+
return r.wrap !== t.wrap || r.type !== t.type || r.markup !== t.markup;
|
|
83286
|
+
}, i.prototype.setComponents = function (r) {
|
|
83287
|
+
if (this.map = {}, r) for (var t in r) if (r.hasOwnProperty(t)) {
|
|
83288
|
+
var e = t.replace(/([A-Z]+)([A-Z][a-z0-9])|([a-z0-9]+)([A-Z])/g, "$1$3-$2$4").toLowerCase();
|
|
83289
|
+
this.map[e] = r[t];
|
|
83290
|
+
}
|
|
83291
|
+
}, i.prototype.render = function (t) {
|
|
83292
|
+
var i = t.wrap;
|
|
83293
|
+
void 0 === i && (i = !0);
|
|
83294
|
+
|
|
83295
|
+
var s,
|
|
83296
|
+
u = t.type,
|
|
83297
|
+
c = t.markup,
|
|
83298
|
+
m = t.components,
|
|
83299
|
+
v = t.reviver,
|
|
83300
|
+
f = t.onError,
|
|
83301
|
+
d = t["allow-scripts"],
|
|
83302
|
+
h$1 = t["allow-events"],
|
|
83303
|
+
y = t.trim,
|
|
83304
|
+
w = function (r, t) {
|
|
83305
|
+
var e = {};
|
|
83306
|
+
|
|
83307
|
+
for (var o in r) Object.prototype.hasOwnProperty.call(r, o) && -1 === t.indexOf(o) && (e[o] = r[o]);
|
|
83308
|
+
|
|
83309
|
+
return e;
|
|
83310
|
+
}(t, ["wrap", "type", "markup", "components", "reviver", "onError", "allow-scripts", "allow-events", "trim"]),
|
|
83311
|
+
C = v || this.reviver || this.constructor.prototype.reviver || a$2 || a;
|
|
83312
|
+
|
|
83313
|
+
this.setComponents(m);
|
|
83314
|
+
var g = {
|
|
83315
|
+
allowScripts: d,
|
|
83316
|
+
allowEvents: h$1,
|
|
83317
|
+
trim: y
|
|
83318
|
+
};
|
|
83319
|
+
|
|
83320
|
+
try {
|
|
83321
|
+
s = function (r, t, a, i, s) {
|
|
83322
|
+
var u = function (r, t) {
|
|
83323
|
+
var o,
|
|
83324
|
+
n,
|
|
83325
|
+
a,
|
|
83326
|
+
i,
|
|
83327
|
+
p = "html" === t ? "text/html" : "application/xml";
|
|
83328
|
+
"html" === t ? (i = "body", a = "<!DOCTYPE html>\n<html><body>" + r + "</body></html>") : (i = "xml", a = '<?xml version="1.0" encoding="UTF-8"?>\n<xml>' + r + "</xml>");
|
|
83329
|
+
|
|
83330
|
+
try {
|
|
83331
|
+
o = new DOMParser().parseFromString(a, p);
|
|
83332
|
+
} catch (r) {
|
|
83333
|
+
n = r;
|
|
83334
|
+
}
|
|
83335
|
+
|
|
83336
|
+
if (o || "html" !== t || ((o = e$2 || (e$2 = function () {
|
|
83337
|
+
if (document.implementation && document.implementation.createHTMLDocument) return document.implementation.createHTMLDocument("");
|
|
83338
|
+
var r = document.createElement("iframe");
|
|
83339
|
+
return r.style.cssText = "position:absolute; left:0; top:-999em; width:1px; height:1px; overflow:hidden;", r.setAttribute("sandbox", "allow-forms"), document.body.appendChild(r), r.contentWindow.document;
|
|
83340
|
+
}())).open(), o.write(a), o.close()), o) {
|
|
83341
|
+
var l = o.getElementsByTagName(i)[0],
|
|
83342
|
+
s = l.firstChild;
|
|
83343
|
+
return r && !s && (l.error = "Document parse failed."), s && "parsererror" === String(s.nodeName).toLowerCase() && (s.removeChild(s.firstChild), s.removeChild(s.lastChild), l.error = s.textContent || s.nodeValue || n || "Unknown error", l.removeChild(s)), l;
|
|
83344
|
+
}
|
|
83345
|
+
}(r, t);
|
|
83346
|
+
|
|
83347
|
+
if (u && u.error) throw new Error(u.error);
|
|
83348
|
+
var c = u && u.body || u;
|
|
83349
|
+
l$1.map = i || p$2;
|
|
83350
|
+
|
|
83351
|
+
var m = c && function (r, t, e, a) {
|
|
83352
|
+
return n$1.visitor = t, n$1.h = e, n$1.options = a || o$3, n$1(r);
|
|
83353
|
+
}(c, l$1, a, s);
|
|
83354
|
+
|
|
83355
|
+
return l$1.map = null, m && m.props && m.props.children || null;
|
|
83356
|
+
}(c, u, C, this.map, g);
|
|
83357
|
+
} catch (r) {
|
|
83358
|
+
f ? f({
|
|
83359
|
+
error: r
|
|
83360
|
+
}) : "undefined" != typeof console && console.error && console.error("preact-markup: " + r);
|
|
83361
|
+
}
|
|
83362
|
+
|
|
83363
|
+
if (!1 === i) return s || null;
|
|
83364
|
+
var x = w.hasOwnProperty("className") ? "className" : "class",
|
|
83365
|
+
b = w[x];
|
|
83366
|
+
return b ? b.splice ? b.splice(0, 0, "markup") : "string" == typeof b ? w[x] += " markup" : "object" == typeof b && (b.markup = !0) : w[x] = "markup", C("div", w, s || null);
|
|
83367
|
+
}, i;
|
|
83368
|
+
})(p);
|
|
83369
|
+
|
|
83370
|
+
/**
|
|
83371
|
+
* Copied from existing form-js#Sanitizer
|
|
83372
|
+
* cf. https://github.com/bpmn-io/form-js/blob/master/packages/form-js-viewer/src/render/components/Sanitizer.js
|
|
83373
|
+
*/
|
|
83374
|
+
const NODE_TYPE_TEXT = 3,
|
|
83375
|
+
NODE_TYPE_ELEMENT = 1;
|
|
83376
|
+
const ALLOWED_NODES = ['h1', 'h2', 'h3', 'h4', 'h5', 'span', 'em', 'a', 'p', 'div', 'ul', 'ol', 'li', 'hr', 'blockquote', 'img', 'pre', 'code', 'br', 'strong'];
|
|
83377
|
+
const ALLOWED_ATTRIBUTES = ['align', 'alt', 'class', 'href', 'id', 'name', 'rel', 'target', 'src'];
|
|
83378
|
+
const ALLOWED_URI_PATTERN = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i; // eslint-disable-line no-useless-escape
|
|
83379
|
+
|
|
83380
|
+
const ATTR_WHITESPACE_PATTERN = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g; // eslint-disable-line no-control-regex
|
|
83381
|
+
|
|
83382
|
+
const FORM_ELEMENT = document.createElement('form');
|
|
83383
|
+
/**
|
|
83384
|
+
* Sanitize a HTML string and return the cleaned, safe version.
|
|
83385
|
+
*
|
|
83386
|
+
* @param {string} html
|
|
83387
|
+
* @return {string}
|
|
83388
|
+
*/
|
|
83389
|
+
|
|
83390
|
+
function sanitizeHTML(html) {
|
|
83391
|
+
const doc = new DOMParser().parseFromString(`<!DOCTYPE html>\n<html><body><div>${html}`, 'text/html');
|
|
83392
|
+
doc.normalize();
|
|
83393
|
+
const element = doc.body.firstChild;
|
|
83394
|
+
|
|
83395
|
+
if (element) {
|
|
83396
|
+
sanitizeNode(
|
|
83397
|
+
/** @type Element */
|
|
83398
|
+
element);
|
|
83399
|
+
return new XMLSerializer().serializeToString(element);
|
|
83400
|
+
} else {
|
|
83401
|
+
// handle the case that document parsing
|
|
83402
|
+
// does not work at all, due to HTML gibberish
|
|
83403
|
+
return '';
|
|
83404
|
+
}
|
|
83405
|
+
}
|
|
83406
|
+
/**
|
|
83407
|
+
* Recursively sanitize a HTML node, potentially
|
|
83408
|
+
* removing it, its children or attributes.
|
|
83409
|
+
*
|
|
83410
|
+
* Inspired by https://github.com/developit/snarkdown/issues/70
|
|
83411
|
+
* and https://github.com/cure53/DOMPurify. Simplified
|
|
83412
|
+
* for our use-case.
|
|
83413
|
+
*
|
|
83414
|
+
* @param {Element} node
|
|
83415
|
+
*/
|
|
83416
|
+
|
|
83417
|
+
function sanitizeNode(node) {
|
|
83418
|
+
// allow text nodes
|
|
83419
|
+
if (node.nodeType === NODE_TYPE_TEXT) {
|
|
83420
|
+
return;
|
|
83421
|
+
} // disallow all other nodes but Element
|
|
83422
|
+
|
|
83423
|
+
|
|
83424
|
+
if (node.nodeType !== NODE_TYPE_ELEMENT) {
|
|
83425
|
+
return node.remove();
|
|
83426
|
+
}
|
|
83427
|
+
|
|
83428
|
+
const lcTag = node.tagName.toLowerCase(); // disallow non-whitelisted tags
|
|
83429
|
+
|
|
83430
|
+
if (!ALLOWED_NODES.includes(lcTag)) {
|
|
83431
|
+
return node.remove();
|
|
83432
|
+
}
|
|
83433
|
+
|
|
83434
|
+
const attributes = node.attributes; // clean attributes
|
|
83435
|
+
|
|
83436
|
+
for (let i = attributes.length; i--;) {
|
|
83437
|
+
const attribute = attributes[i];
|
|
83438
|
+
const name = attribute.name;
|
|
83439
|
+
const lcName = name.toLowerCase(); // normalize node value
|
|
83440
|
+
|
|
83441
|
+
const value = attribute.value.trim();
|
|
83442
|
+
node.removeAttribute(name);
|
|
83443
|
+
const valid = isValidAttribute(lcTag, lcName, value);
|
|
83444
|
+
|
|
83445
|
+
if (valid) {
|
|
83446
|
+
node.setAttribute(name, value);
|
|
83447
|
+
}
|
|
83448
|
+
} // force noopener on target="_blank" links
|
|
83449
|
+
|
|
83450
|
+
|
|
83451
|
+
if (lcTag === 'a' && node.getAttribute('target') === '_blank' && node.getAttribute('rel') !== 'noopener') {
|
|
83452
|
+
node.setAttribute('rel', 'noopener');
|
|
83453
|
+
}
|
|
83454
|
+
|
|
83455
|
+
for (let i = node.childNodes.length; i--;) {
|
|
83456
|
+
sanitizeNode(
|
|
83457
|
+
/** @type Element */
|
|
83458
|
+
node.childNodes[i]);
|
|
83459
|
+
}
|
|
83460
|
+
}
|
|
83461
|
+
/**
|
|
83462
|
+
* Validates attributes for validity.
|
|
83463
|
+
*
|
|
83464
|
+
* @param {string} lcTag
|
|
83465
|
+
* @param {string} lcName
|
|
83466
|
+
* @param {string} value
|
|
83467
|
+
* @return {boolean}
|
|
83468
|
+
*/
|
|
83469
|
+
|
|
83470
|
+
|
|
83471
|
+
function isValidAttribute(lcTag, lcName, value) {
|
|
83472
|
+
// disallow most attributes based on whitelist
|
|
83473
|
+
if (!ALLOWED_ATTRIBUTES.includes(lcName)) {
|
|
83474
|
+
return false;
|
|
83475
|
+
} // disallow "DOM clobbering" / polution of document and wrapping form elements
|
|
83476
|
+
|
|
83477
|
+
|
|
83478
|
+
if ((lcName === 'id' || lcName === 'name') && (value in document || value in FORM_ELEMENT)) {
|
|
83479
|
+
return false;
|
|
83480
|
+
}
|
|
83481
|
+
|
|
83482
|
+
if (lcName === 'target' && value !== '_blank') {
|
|
83483
|
+
return false;
|
|
83484
|
+
} // allow valid url links only
|
|
83485
|
+
|
|
83486
|
+
|
|
83487
|
+
if (lcName === 'href' && !ALLOWED_URI_PATTERN.test(value.replace(ATTR_WHITESPACE_PATTERN, ''))) {
|
|
83488
|
+
return false;
|
|
83489
|
+
}
|
|
83490
|
+
|
|
83491
|
+
return true;
|
|
83492
|
+
}
|
|
83493
|
+
|
|
83494
|
+
function PropertyDescription(props) {
|
|
83495
|
+
const {
|
|
83496
|
+
description
|
|
83497
|
+
} = props;
|
|
83498
|
+
return description && o$2(Markup, {
|
|
83499
|
+
markup: sanitizeHTML(description),
|
|
83500
|
+
trim: false
|
|
83501
|
+
});
|
|
83502
|
+
}
|
|
83503
|
+
|
|
83192
83504
|
const CAMUNDA_ERROR_EVENT_DEFINITION_TYPE$1 = 'camunda:errorEventDefinition',
|
|
83193
83505
|
CAMUNDA_EXECUTION_LISTENER_TYPE = 'camunda:executionListener',
|
|
83194
83506
|
CAMUNDA_FIELD_TYPE = 'camunda:field',
|
|
@@ -83358,7 +83670,9 @@
|
|
|
83358
83670
|
getValue: propertyGetter(element, property, scope),
|
|
83359
83671
|
id,
|
|
83360
83672
|
label,
|
|
83361
|
-
description
|
|
83673
|
+
description: PropertyDescription({
|
|
83674
|
+
description
|
|
83675
|
+
}),
|
|
83362
83676
|
setValue: propertySetter(bpmnFactory, commandStack, element, property, scope),
|
|
83363
83677
|
disabled: editable === false
|
|
83364
83678
|
});
|
|
@@ -83399,7 +83713,9 @@
|
|
|
83399
83713
|
id,
|
|
83400
83714
|
label,
|
|
83401
83715
|
getOptions,
|
|
83402
|
-
description
|
|
83716
|
+
description: PropertyDescription({
|
|
83717
|
+
description
|
|
83718
|
+
}),
|
|
83403
83719
|
getValue: propertyGetter(element, property, scope),
|
|
83404
83720
|
setValue: propertySetter(bpmnFactory, commandStack, element, property, scope),
|
|
83405
83721
|
disabled: editable === false
|
|
@@ -83428,7 +83744,9 @@
|
|
|
83428
83744
|
getValue: propertyGetter(element, property, scope),
|
|
83429
83745
|
id,
|
|
83430
83746
|
label,
|
|
83431
|
-
description
|
|
83747
|
+
description: PropertyDescription({
|
|
83748
|
+
description
|
|
83749
|
+
}),
|
|
83432
83750
|
setValue: propertySetter(bpmnFactory, commandStack, element, property, scope),
|
|
83433
83751
|
validate: propertyValidator(translate, property),
|
|
83434
83752
|
disabled: editable === false
|
|
@@ -83455,7 +83773,9 @@
|
|
|
83455
83773
|
element,
|
|
83456
83774
|
id,
|
|
83457
83775
|
label,
|
|
83458
|
-
description
|
|
83776
|
+
description: PropertyDescription({
|
|
83777
|
+
description
|
|
83778
|
+
}),
|
|
83459
83779
|
getValue: propertyGetter(element, property, scope),
|
|
83460
83780
|
setValue: propertySetter(bpmnFactory, commandStack, element, property, scope),
|
|
83461
83781
|
disabled: editable === false
|
|
@@ -84218,7 +84538,9 @@
|
|
|
84218
84538
|
"data-entry-id": id,
|
|
84219
84539
|
children: o$2("div", {
|
|
84220
84540
|
class: "bio-properties-panel-description",
|
|
84221
|
-
children:
|
|
84541
|
+
children: o$2(PropertyDescription, {
|
|
84542
|
+
description: text
|
|
84543
|
+
})
|
|
84222
84544
|
})
|
|
84223
84545
|
});
|
|
84224
84546
|
}
|
|
@@ -84401,7 +84723,9 @@
|
|
|
84401
84723
|
"data-entry-id": id,
|
|
84402
84724
|
children: o$2("div", {
|
|
84403
84725
|
class: "bio-properties-panel-description",
|
|
84404
|
-
children:
|
|
84726
|
+
children: o$2(PropertyDescription, {
|
|
84727
|
+
description: text
|
|
84728
|
+
})
|
|
84405
84729
|
})
|
|
84406
84730
|
});
|
|
84407
84731
|
}
|