camunda-bpmn-js 3.10.2 → 3.12.0
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/dist/assets/properties-panel.css +0 -4
- package/dist/base-modeler.development.js +1781 -1244
- package/dist/base-modeler.production.min.js +33 -33
- package/dist/base-navigated-viewer.development.js +257 -119
- package/dist/base-navigated-viewer.production.min.js +1 -1
- package/dist/base-viewer.development.js +257 -119
- package/dist/base-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-modeler.development.js +9233 -8479
- package/dist/camunda-cloud-modeler.production.min.js +34 -34
- package/dist/camunda-cloud-navigated-viewer.development.js +257 -119
- package/dist/camunda-cloud-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-viewer.development.js +257 -119
- package/dist/camunda-cloud-viewer.production.min.js +1 -1
- package/dist/camunda-platform-modeler.development.js +2234 -1606
- package/dist/camunda-platform-modeler.production.min.js +36 -36
- package/dist/camunda-platform-navigated-viewer.development.js +257 -119
- package/dist/camunda-platform-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-platform-viewer.development.js +257 -119
- package/dist/camunda-platform-viewer.production.min.js +1 -1
- package/package.json +20 -20
|
@@ -27,6 +27,10 @@
|
|
|
27
27
|
return obj !== undefined;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
function isNil(obj) {
|
|
31
|
+
return obj == null;
|
|
32
|
+
}
|
|
33
|
+
|
|
30
34
|
function isArray$2(obj) {
|
|
31
35
|
return nativeToString$1.call(obj) === '[object Array]';
|
|
32
36
|
}
|
|
@@ -475,6 +479,58 @@
|
|
|
475
479
|
return Object.assign(target, ...others);
|
|
476
480
|
}
|
|
477
481
|
|
|
482
|
+
/**
|
|
483
|
+
* Sets a nested property of a given object to the specified value.
|
|
484
|
+
*
|
|
485
|
+
* This mutates the object and returns it.
|
|
486
|
+
*
|
|
487
|
+
* @template T
|
|
488
|
+
*
|
|
489
|
+
* @param {T} target The target of the set operation.
|
|
490
|
+
* @param {(string|number)[]} path The path to the nested value.
|
|
491
|
+
* @param {any} value The value to set.
|
|
492
|
+
*
|
|
493
|
+
* @return {T}
|
|
494
|
+
*/
|
|
495
|
+
function set$1(target, path, value) {
|
|
496
|
+
|
|
497
|
+
let currentTarget = target;
|
|
498
|
+
|
|
499
|
+
forEach$1(path, function(key, idx) {
|
|
500
|
+
|
|
501
|
+
if (typeof key !== 'number' && typeof key !== 'string') {
|
|
502
|
+
throw new Error('illegal key type: ' + typeof key + '. Key should be of type number or string.');
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
if (key === 'constructor') {
|
|
506
|
+
throw new Error('illegal key: constructor');
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
if (key === '__proto__') {
|
|
510
|
+
throw new Error('illegal key: __proto__');
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
let nextKey = path[idx + 1];
|
|
514
|
+
let nextTarget = currentTarget[key];
|
|
515
|
+
|
|
516
|
+
if (isDefined(nextKey) && isNil(nextTarget)) {
|
|
517
|
+
nextTarget = currentTarget[key] = isNaN(+nextKey) ? {} : [];
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
if (isUndefined$2(nextKey)) {
|
|
521
|
+
if (isUndefined$2(value)) {
|
|
522
|
+
delete currentTarget[key];
|
|
523
|
+
} else {
|
|
524
|
+
currentTarget[key] = value;
|
|
525
|
+
}
|
|
526
|
+
} else {
|
|
527
|
+
currentTarget = nextTarget;
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
|
|
531
|
+
return target;
|
|
532
|
+
}
|
|
533
|
+
|
|
478
534
|
/**
|
|
479
535
|
* Pick properties from the given target.
|
|
480
536
|
*
|
|
@@ -713,6 +769,26 @@
|
|
|
713
769
|
return true;
|
|
714
770
|
}
|
|
715
771
|
|
|
772
|
+
/**
|
|
773
|
+
* @param {Element} element
|
|
774
|
+
*
|
|
775
|
+
* @return {boolean}
|
|
776
|
+
*/
|
|
777
|
+
function isHorizontal(element) {
|
|
778
|
+
|
|
779
|
+
if (!is$1(element, 'bpmn:Participant') && !is$1(element, 'bpmn:Lane')) {
|
|
780
|
+
return undefined;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
var isHorizontal = getDi(element).isHorizontal;
|
|
784
|
+
|
|
785
|
+
if (isHorizontal === undefined) {
|
|
786
|
+
return true;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
return isHorizontal;
|
|
790
|
+
}
|
|
791
|
+
|
|
716
792
|
/**
|
|
717
793
|
* @param {Element} element
|
|
718
794
|
*
|
|
@@ -3783,10 +3859,12 @@
|
|
|
3783
3859
|
}
|
|
3784
3860
|
|
|
3785
3861
|
function renderLaneLabel(parentGfx, text, element, attrs = {}) {
|
|
3862
|
+
var isHorizontalLane = isHorizontal(element);
|
|
3863
|
+
|
|
3786
3864
|
var textBox = renderLabel(parentGfx, text, {
|
|
3787
3865
|
box: {
|
|
3788
3866
|
height: 30,
|
|
3789
|
-
width: getHeight(element, attrs),
|
|
3867
|
+
width: isHorizontalLane ? getHeight(element, attrs) : getWidth(element, attrs),
|
|
3790
3868
|
},
|
|
3791
3869
|
align: 'center-middle',
|
|
3792
3870
|
style: {
|
|
@@ -3794,9 +3872,10 @@
|
|
|
3794
3872
|
}
|
|
3795
3873
|
});
|
|
3796
3874
|
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3875
|
+
if (isHorizontalLane) {
|
|
3876
|
+
var top = -1 * getHeight(element, attrs);
|
|
3877
|
+
transform(textBox, 0, -top, 270);
|
|
3878
|
+
}
|
|
3800
3879
|
}
|
|
3801
3880
|
|
|
3802
3881
|
function renderActivity(parentGfx, element, attrs = {}) {
|
|
@@ -4514,12 +4593,13 @@
|
|
|
4514
4593
|
var participant = renderLane(parentGfx, element, attrs);
|
|
4515
4594
|
|
|
4516
4595
|
var expandedParticipant = isExpanded(element);
|
|
4596
|
+
var horizontalParticipant = isHorizontal(element);
|
|
4517
4597
|
|
|
4518
4598
|
var semantic = getBusinessObject(element),
|
|
4519
4599
|
name = semantic.get('name');
|
|
4520
4600
|
|
|
4521
4601
|
if (expandedParticipant) {
|
|
4522
|
-
|
|
4602
|
+
var waypoints = horizontalParticipant ? [
|
|
4523
4603
|
{
|
|
4524
4604
|
x: 30,
|
|
4525
4605
|
y: 0
|
|
@@ -4528,20 +4608,43 @@
|
|
|
4528
4608
|
x: 30,
|
|
4529
4609
|
y: getHeight(element, attrs)
|
|
4530
4610
|
}
|
|
4531
|
-
]
|
|
4611
|
+
] : [
|
|
4612
|
+
{
|
|
4613
|
+
x: 0,
|
|
4614
|
+
y: 30
|
|
4615
|
+
},
|
|
4616
|
+
{
|
|
4617
|
+
x: getWidth(element, attrs),
|
|
4618
|
+
y: 30
|
|
4619
|
+
}
|
|
4620
|
+
];
|
|
4621
|
+
|
|
4622
|
+
drawLine(parentGfx, waypoints, {
|
|
4532
4623
|
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4533
4624
|
strokeWidth: PARTICIPANT_STROKE_WIDTH
|
|
4534
4625
|
});
|
|
4535
4626
|
|
|
4536
4627
|
renderLaneLabel(parentGfx, name, element, attrs);
|
|
4537
4628
|
} else {
|
|
4538
|
-
|
|
4539
|
-
|
|
4629
|
+
var bounds = getBounds(element, attrs);
|
|
4630
|
+
|
|
4631
|
+
if (!horizontalParticipant) {
|
|
4632
|
+
bounds.height = getWidth(element, attrs);
|
|
4633
|
+
bounds.width = getHeight(element, attrs);
|
|
4634
|
+
}
|
|
4635
|
+
|
|
4636
|
+
var textBox = renderLabel(parentGfx, name, {
|
|
4637
|
+
box: bounds,
|
|
4540
4638
|
align: 'center-middle',
|
|
4541
4639
|
style: {
|
|
4542
4640
|
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)
|
|
4543
4641
|
}
|
|
4544
4642
|
});
|
|
4643
|
+
|
|
4644
|
+
if (!horizontalParticipant) {
|
|
4645
|
+
var top = -1 * getHeight(element, attrs);
|
|
4646
|
+
transform(textBox, 0, -top, 270);
|
|
4647
|
+
}
|
|
4545
4648
|
}
|
|
4546
4649
|
|
|
4547
4650
|
if (semantic.get('participantMultiplicity')) {
|
|
@@ -6128,10 +6231,6 @@
|
|
|
6128
6231
|
translate: [ 'value', translate ]
|
|
6129
6232
|
};
|
|
6130
6233
|
|
|
6131
|
-
function getDefaultExportFromCjs (x) {
|
|
6132
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
6133
|
-
}
|
|
6134
|
-
|
|
6135
6234
|
/**
|
|
6136
6235
|
* @param {Point} point
|
|
6137
6236
|
*
|
|
@@ -9816,7 +9915,7 @@
|
|
|
9816
9915
|
}
|
|
9817
9916
|
|
|
9818
9917
|
/**
|
|
9819
|
-
* @typedef {import('./index').InjectAnnotated } InjectAnnotated
|
|
9918
|
+
* @typedef {import('./index.js').InjectAnnotated } InjectAnnotated
|
|
9820
9919
|
*/
|
|
9821
9920
|
|
|
9822
9921
|
/**
|
|
@@ -9886,9 +9985,9 @@
|
|
|
9886
9985
|
}
|
|
9887
9986
|
|
|
9888
9987
|
/**
|
|
9889
|
-
* @typedef { import('./index').ModuleDeclaration } ModuleDeclaration
|
|
9890
|
-
* @typedef { import('./index').ModuleDefinition } ModuleDefinition
|
|
9891
|
-
* @typedef { import('./index').InjectorContext } InjectorContext
|
|
9988
|
+
* @typedef { import('./index.js').ModuleDeclaration } ModuleDeclaration
|
|
9989
|
+
* @typedef { import('./index.js').ModuleDefinition } ModuleDefinition
|
|
9990
|
+
* @typedef { import('./index.js').InjectorContext } InjectorContext
|
|
9892
9991
|
*/
|
|
9893
9992
|
|
|
9894
9993
|
/**
|
|
@@ -9991,11 +10090,20 @@
|
|
|
9991
10090
|
};
|
|
9992
10091
|
}
|
|
9993
10092
|
|
|
9994
|
-
|
|
10093
|
+
/**
|
|
10094
|
+
* Instantiate the given type, injecting dependencies.
|
|
10095
|
+
*
|
|
10096
|
+
* @template T
|
|
10097
|
+
*
|
|
10098
|
+
* @param { Function | [...string[], Function ]} type
|
|
10099
|
+
*
|
|
10100
|
+
* @return T
|
|
10101
|
+
*/
|
|
10102
|
+
function instantiate(type) {
|
|
9995
10103
|
const {
|
|
9996
10104
|
fn,
|
|
9997
10105
|
dependencies
|
|
9998
|
-
} = fnDef(
|
|
10106
|
+
} = fnDef(type);
|
|
9999
10107
|
|
|
10000
10108
|
// instantiate var args constructor
|
|
10001
10109
|
const Constructor = Function.prototype.bind.apply(fn, [ null ].concat(dependencies));
|
|
@@ -10003,6 +10111,17 @@
|
|
|
10003
10111
|
return new Constructor();
|
|
10004
10112
|
}
|
|
10005
10113
|
|
|
10114
|
+
/**
|
|
10115
|
+
* Invoke the given function, injecting dependencies. Return the result.
|
|
10116
|
+
*
|
|
10117
|
+
* @template T
|
|
10118
|
+
*
|
|
10119
|
+
* @param { Function | [...string[], Function ]} func
|
|
10120
|
+
* @param { Object } [context]
|
|
10121
|
+
* @param { Object } [locals]
|
|
10122
|
+
*
|
|
10123
|
+
* @return {T} invocation result
|
|
10124
|
+
*/
|
|
10006
10125
|
function invoke(func, context, locals) {
|
|
10007
10126
|
const {
|
|
10008
10127
|
fn,
|
|
@@ -12271,32 +12390,17 @@
|
|
|
12271
12390
|
}
|
|
12272
12391
|
};
|
|
12273
12392
|
|
|
12274
|
-
var objectRefs = {exports: {}};
|
|
12275
|
-
|
|
12276
|
-
var collection = {};
|
|
12277
|
-
|
|
12278
|
-
/**
|
|
12279
|
-
* An empty collection stub. Use {@link RefsCollection.extend} to extend a
|
|
12280
|
-
* collection with ref semantics.
|
|
12281
|
-
*
|
|
12282
|
-
* @class RefsCollection
|
|
12283
|
-
*/
|
|
12284
|
-
|
|
12285
12393
|
/**
|
|
12286
12394
|
* Extends a collection with {@link Refs} aware methods
|
|
12287
12395
|
*
|
|
12288
|
-
* @
|
|
12289
|
-
* @
|
|
12290
|
-
*
|
|
12291
|
-
* @param
|
|
12292
|
-
* @param {Refs} refs instance
|
|
12293
|
-
* @param {Object} property represented by the collection
|
|
12294
|
-
* @param {Object} target object the collection is attached to
|
|
12396
|
+
* @param {Array<Object>} collection
|
|
12397
|
+
* @param {Refs} refs instance
|
|
12398
|
+
* @param {Object} property represented by the collection
|
|
12399
|
+
* @param {Object} target object the collection is attached to
|
|
12295
12400
|
*
|
|
12296
12401
|
* @return {RefsCollection<Object>} the extended array
|
|
12297
12402
|
*/
|
|
12298
12403
|
function extend(collection, refs, property, target) {
|
|
12299
|
-
|
|
12300
12404
|
var inverseProperty = property.inverse;
|
|
12301
12405
|
|
|
12302
12406
|
/**
|
|
@@ -12307,7 +12411,7 @@
|
|
|
12307
12411
|
* @param {Object} element the element to remove
|
|
12308
12412
|
*/
|
|
12309
12413
|
Object.defineProperty(collection, 'remove', {
|
|
12310
|
-
value: function(element) {
|
|
12414
|
+
value: function (element) {
|
|
12311
12415
|
var idx = this.indexOf(element);
|
|
12312
12416
|
if (idx !== -1) {
|
|
12313
12417
|
this.splice(idx, 1);
|
|
@@ -12315,7 +12419,6 @@
|
|
|
12315
12419
|
// unset inverse
|
|
12316
12420
|
refs.unset(element, inverseProperty, target);
|
|
12317
12421
|
}
|
|
12318
|
-
|
|
12319
12422
|
return element;
|
|
12320
12423
|
}
|
|
12321
12424
|
});
|
|
@@ -12328,7 +12431,7 @@
|
|
|
12328
12431
|
* @param {Object} element the element to check for
|
|
12329
12432
|
*/
|
|
12330
12433
|
Object.defineProperty(collection, 'contains', {
|
|
12331
|
-
value: function(element) {
|
|
12434
|
+
value: function (element) {
|
|
12332
12435
|
return this.indexOf(element) !== -1;
|
|
12333
12436
|
}
|
|
12334
12437
|
});
|
|
@@ -12343,12 +12446,9 @@
|
|
|
12343
12446
|
* (possibly moving other elements around)
|
|
12344
12447
|
*/
|
|
12345
12448
|
Object.defineProperty(collection, 'add', {
|
|
12346
|
-
value: function(element, idx) {
|
|
12347
|
-
|
|
12449
|
+
value: function (element, idx) {
|
|
12348
12450
|
var currentIdx = this.indexOf(element);
|
|
12349
|
-
|
|
12350
12451
|
if (typeof idx === 'undefined') {
|
|
12351
|
-
|
|
12352
12452
|
if (currentIdx !== -1) {
|
|
12353
12453
|
// element already in collection (!)
|
|
12354
12454
|
return;
|
|
@@ -12360,14 +12460,12 @@
|
|
|
12360
12460
|
|
|
12361
12461
|
// handle already in collection
|
|
12362
12462
|
if (currentIdx !== -1) {
|
|
12363
|
-
|
|
12364
12463
|
// remove element from currentIdx
|
|
12365
12464
|
this.splice(currentIdx, 1);
|
|
12366
12465
|
}
|
|
12367
12466
|
|
|
12368
12467
|
// add element at idx
|
|
12369
12468
|
this.splice(idx, 0, element);
|
|
12370
|
-
|
|
12371
12469
|
if (currentIdx === -1) {
|
|
12372
12470
|
// set inverse, unless element was
|
|
12373
12471
|
// in collection already
|
|
@@ -12381,69 +12479,53 @@
|
|
|
12381
12479
|
Object.defineProperty(collection, '__refs_collection', {
|
|
12382
12480
|
value: true
|
|
12383
12481
|
});
|
|
12384
|
-
|
|
12385
12482
|
return collection;
|
|
12386
12483
|
}
|
|
12387
12484
|
|
|
12388
|
-
|
|
12485
|
+
/**
|
|
12486
|
+
* Checks if a given collection is extended
|
|
12487
|
+
*
|
|
12488
|
+
* @param {Array<Object>} collection
|
|
12489
|
+
*
|
|
12490
|
+
* @return {boolean}
|
|
12491
|
+
*/
|
|
12389
12492
|
function isExtended(collection) {
|
|
12390
12493
|
return collection.__refs_collection === true;
|
|
12391
12494
|
}
|
|
12392
12495
|
|
|
12393
|
-
collection.extend = extend;
|
|
12394
|
-
|
|
12395
|
-
collection.isExtended = isExtended;
|
|
12396
|
-
|
|
12397
|
-
var Collection = collection;
|
|
12398
|
-
|
|
12399
12496
|
function hasOwnProperty$1(e, property) {
|
|
12400
12497
|
return Object.prototype.hasOwnProperty.call(e, property.name || property);
|
|
12401
12498
|
}
|
|
12402
|
-
|
|
12403
12499
|
function defineCollectionProperty(ref, property, target) {
|
|
12404
|
-
|
|
12405
|
-
var collection = Collection.extend(target[property.name] || [], ref, property, target);
|
|
12406
|
-
|
|
12500
|
+
var collection = extend(target[property.name] || [], ref, property, target);
|
|
12407
12501
|
Object.defineProperty(target, property.name, {
|
|
12408
12502
|
enumerable: property.enumerable,
|
|
12409
12503
|
value: collection
|
|
12410
12504
|
});
|
|
12411
|
-
|
|
12412
12505
|
if (collection.length) {
|
|
12413
|
-
|
|
12414
|
-
collection.forEach(function(o) {
|
|
12506
|
+
collection.forEach(function (o) {
|
|
12415
12507
|
ref.set(o, property.inverse, target);
|
|
12416
12508
|
});
|
|
12417
12509
|
}
|
|
12418
12510
|
}
|
|
12419
|
-
|
|
12420
|
-
|
|
12421
12511
|
function defineProperty$1(ref, property, target) {
|
|
12422
|
-
|
|
12423
12512
|
var inverseProperty = property.inverse;
|
|
12424
|
-
|
|
12425
12513
|
var _value = target[property.name];
|
|
12426
|
-
|
|
12427
12514
|
Object.defineProperty(target, property.name, {
|
|
12428
12515
|
configurable: property.configurable,
|
|
12429
12516
|
enumerable: property.enumerable,
|
|
12430
|
-
|
|
12431
|
-
get: function() {
|
|
12517
|
+
get: function () {
|
|
12432
12518
|
return _value;
|
|
12433
12519
|
},
|
|
12434
|
-
|
|
12435
|
-
set: function(value) {
|
|
12436
|
-
|
|
12520
|
+
set: function (value) {
|
|
12437
12521
|
// return if we already performed all changes
|
|
12438
12522
|
if (value === _value) {
|
|
12439
12523
|
return;
|
|
12440
12524
|
}
|
|
12441
|
-
|
|
12442
12525
|
var old = _value;
|
|
12443
12526
|
|
|
12444
12527
|
// temporary set null
|
|
12445
12528
|
_value = null;
|
|
12446
|
-
|
|
12447
12529
|
if (old) {
|
|
12448
12530
|
ref.unset(old, inverseProperty, target);
|
|
12449
12531
|
}
|
|
@@ -12455,7 +12537,6 @@
|
|
|
12455
12537
|
ref.set(_value, inverseProperty, target);
|
|
12456
12538
|
}
|
|
12457
12539
|
});
|
|
12458
|
-
|
|
12459
12540
|
}
|
|
12460
12541
|
|
|
12461
12542
|
/**
|
|
@@ -12501,16 +12582,14 @@
|
|
|
12501
12582
|
*
|
|
12502
12583
|
* wheels[0].car // undefined
|
|
12503
12584
|
*/
|
|
12504
|
-
function Refs
|
|
12505
|
-
|
|
12506
|
-
|
|
12507
|
-
return new Refs$1(a, b);
|
|
12585
|
+
function Refs(a, b) {
|
|
12586
|
+
if (!(this instanceof Refs)) {
|
|
12587
|
+
return new Refs(a, b);
|
|
12508
12588
|
}
|
|
12509
12589
|
|
|
12510
12590
|
// link
|
|
12511
12591
|
a.inverse = b;
|
|
12512
12592
|
b.inverse = a;
|
|
12513
|
-
|
|
12514
12593
|
this.props = {};
|
|
12515
12594
|
this.props[a.name] = a;
|
|
12516
12595
|
this.props[b.name] = b;
|
|
@@ -12525,43 +12604,34 @@
|
|
|
12525
12604
|
* @param {Object} target
|
|
12526
12605
|
* @param {String} property
|
|
12527
12606
|
*/
|
|
12528
|
-
Refs
|
|
12607
|
+
Refs.prototype.bind = function (target, property) {
|
|
12529
12608
|
if (typeof property === 'string') {
|
|
12530
12609
|
if (!this.props[property]) {
|
|
12531
12610
|
throw new Error('no property <' + property + '> in ref');
|
|
12532
12611
|
}
|
|
12533
12612
|
property = this.props[property];
|
|
12534
12613
|
}
|
|
12535
|
-
|
|
12536
12614
|
if (property.collection) {
|
|
12537
12615
|
defineCollectionProperty(this, property, target);
|
|
12538
12616
|
} else {
|
|
12539
12617
|
defineProperty$1(this, property, target);
|
|
12540
12618
|
}
|
|
12541
12619
|
};
|
|
12542
|
-
|
|
12543
|
-
Refs$1.prototype.ensureRefsCollection = function(target, property) {
|
|
12544
|
-
|
|
12620
|
+
Refs.prototype.ensureRefsCollection = function (target, property) {
|
|
12545
12621
|
var collection = target[property.name];
|
|
12546
|
-
|
|
12547
|
-
if (!Collection.isExtended(collection)) {
|
|
12622
|
+
if (!isExtended(collection)) {
|
|
12548
12623
|
defineCollectionProperty(this, property, target);
|
|
12549
12624
|
}
|
|
12550
|
-
|
|
12551
12625
|
return collection;
|
|
12552
12626
|
};
|
|
12553
|
-
|
|
12554
|
-
Refs$1.prototype.ensureBound = function(target, property) {
|
|
12627
|
+
Refs.prototype.ensureBound = function (target, property) {
|
|
12555
12628
|
if (!hasOwnProperty$1(target, property)) {
|
|
12556
12629
|
this.bind(target, property);
|
|
12557
12630
|
}
|
|
12558
12631
|
};
|
|
12559
|
-
|
|
12560
|
-
Refs$1.prototype.unset = function(target, property, value) {
|
|
12561
|
-
|
|
12632
|
+
Refs.prototype.unset = function (target, property, value) {
|
|
12562
12633
|
if (target) {
|
|
12563
12634
|
this.ensureBound(target, property);
|
|
12564
|
-
|
|
12565
12635
|
if (property.collection) {
|
|
12566
12636
|
this.ensureRefsCollection(target, property).remove(value);
|
|
12567
12637
|
} else {
|
|
@@ -12569,12 +12639,9 @@
|
|
|
12569
12639
|
}
|
|
12570
12640
|
}
|
|
12571
12641
|
};
|
|
12572
|
-
|
|
12573
|
-
Refs$1.prototype.set = function(target, property, value) {
|
|
12574
|
-
|
|
12642
|
+
Refs.prototype.set = function (target, property, value) {
|
|
12575
12643
|
if (target) {
|
|
12576
12644
|
this.ensureBound(target, property);
|
|
12577
|
-
|
|
12578
12645
|
if (property.collection) {
|
|
12579
12646
|
this.ensureRefsCollection(target, property).add(value);
|
|
12580
12647
|
} else {
|
|
@@ -12583,15 +12650,6 @@
|
|
|
12583
12650
|
}
|
|
12584
12651
|
};
|
|
12585
12652
|
|
|
12586
|
-
var refs = Refs$1;
|
|
12587
|
-
|
|
12588
|
-
objectRefs.exports = refs;
|
|
12589
|
-
|
|
12590
|
-
objectRefs.exports.Collection = collection;
|
|
12591
|
-
|
|
12592
|
-
var objectRefsExports = objectRefs.exports;
|
|
12593
|
-
var Refs = /*@__PURE__*/getDefaultExportFromCjs(objectRefsExports);
|
|
12594
|
-
|
|
12595
12653
|
var parentRefs = new Refs({ name: 'children', enumerable: true, collection: true }, { name: 'parent' }),
|
|
12596
12654
|
labelRefs = new Refs({ name: 'labels', enumerable: true, collection: true }, { name: 'labelTarget' }),
|
|
12597
12655
|
attacherRefs = new Refs({ name: 'attachers', collection: true }, { name: 'host' }),
|
|
@@ -14408,6 +14466,17 @@
|
|
|
14408
14466
|
this.idProperty = p;
|
|
14409
14467
|
};
|
|
14410
14468
|
|
|
14469
|
+
DescriptorBuilder.prototype.assertNotTrait = function(typeDescriptor) {
|
|
14470
|
+
|
|
14471
|
+
const _extends = typeDescriptor.extends || [];
|
|
14472
|
+
|
|
14473
|
+
if (_extends.length) {
|
|
14474
|
+
throw new Error(
|
|
14475
|
+
`cannot create <${ typeDescriptor.name }> extending <${ typeDescriptor.extends }>`
|
|
14476
|
+
);
|
|
14477
|
+
}
|
|
14478
|
+
};
|
|
14479
|
+
|
|
14411
14480
|
DescriptorBuilder.prototype.assertNotDefined = function(p, name) {
|
|
14412
14481
|
var propertyName = p.name,
|
|
14413
14482
|
definedProperty = this.propertiesByName[propertyName];
|
|
@@ -14426,6 +14495,10 @@
|
|
|
14426
14495
|
|
|
14427
14496
|
DescriptorBuilder.prototype.addTrait = function(t, inherited) {
|
|
14428
14497
|
|
|
14498
|
+
if (inherited) {
|
|
14499
|
+
this.assertNotTrait(t);
|
|
14500
|
+
}
|
|
14501
|
+
|
|
14429
14502
|
var typesByName = this.allTypesByName,
|
|
14430
14503
|
types = this.allTypes;
|
|
14431
14504
|
|
|
@@ -14559,7 +14632,9 @@
|
|
|
14559
14632
|
});
|
|
14560
14633
|
|
|
14561
14634
|
forEach$1(type.extends, bind$2(function(extendsName) {
|
|
14562
|
-
var
|
|
14635
|
+
var extendsNameNs = parseName(extendsName, ns.prefix);
|
|
14636
|
+
|
|
14637
|
+
var extended = this.typeMap[extendsNameNs.name];
|
|
14563
14638
|
|
|
14564
14639
|
extended.traits = extended.traits || [];
|
|
14565
14640
|
extended.traits.push(name);
|
|
@@ -14588,24 +14663,33 @@
|
|
|
14588
14663
|
|
|
14589
14664
|
var self = this;
|
|
14590
14665
|
|
|
14666
|
+
/**
|
|
14667
|
+
* Traverse the selected super type or trait
|
|
14668
|
+
*
|
|
14669
|
+
* @param {String} cls
|
|
14670
|
+
* @param {Boolean} [trait=false]
|
|
14671
|
+
*/
|
|
14672
|
+
function traverse(cls, trait) {
|
|
14673
|
+
var parentNs = parseName(cls, isBuiltIn(cls) ? '' : nsName.prefix);
|
|
14674
|
+
self.mapTypes(parentNs, iterator, trait);
|
|
14675
|
+
}
|
|
14676
|
+
|
|
14591
14677
|
/**
|
|
14592
14678
|
* Traverse the selected trait.
|
|
14593
14679
|
*
|
|
14594
14680
|
* @param {String} cls
|
|
14595
14681
|
*/
|
|
14596
14682
|
function traverseTrait(cls) {
|
|
14597
|
-
return
|
|
14683
|
+
return traverse(cls, true);
|
|
14598
14684
|
}
|
|
14599
14685
|
|
|
14600
14686
|
/**
|
|
14601
|
-
* Traverse the selected super type
|
|
14687
|
+
* Traverse the selected super type
|
|
14602
14688
|
*
|
|
14603
14689
|
* @param {String} cls
|
|
14604
|
-
* @param {Boolean} [trait=false]
|
|
14605
14690
|
*/
|
|
14606
|
-
function traverseSuper(cls
|
|
14607
|
-
|
|
14608
|
-
self.mapTypes(parentNs, iterator, trait);
|
|
14691
|
+
function traverseSuper(cls) {
|
|
14692
|
+
return traverse(cls, false);
|
|
14609
14693
|
}
|
|
14610
14694
|
|
|
14611
14695
|
if (!type) {
|
|
@@ -14688,7 +14772,7 @@
|
|
|
14688
14772
|
throw new TypeError('property name must be a non-empty string');
|
|
14689
14773
|
}
|
|
14690
14774
|
|
|
14691
|
-
var property = this.
|
|
14775
|
+
var property = this.getProperty(target, name);
|
|
14692
14776
|
|
|
14693
14777
|
var propertyName = property && property.name;
|
|
14694
14778
|
|
|
@@ -14699,7 +14783,7 @@
|
|
|
14699
14783
|
if (property) {
|
|
14700
14784
|
delete target[propertyName];
|
|
14701
14785
|
} else {
|
|
14702
|
-
delete target.$attrs[name];
|
|
14786
|
+
delete target.$attrs[stripGlobal(name)];
|
|
14703
14787
|
}
|
|
14704
14788
|
} else {
|
|
14705
14789
|
|
|
@@ -14712,7 +14796,7 @@
|
|
|
14712
14796
|
defineProperty(target, property, value);
|
|
14713
14797
|
}
|
|
14714
14798
|
} else {
|
|
14715
|
-
target.$attrs[name] = value;
|
|
14799
|
+
target.$attrs[stripGlobal(name)] = value;
|
|
14716
14800
|
}
|
|
14717
14801
|
}
|
|
14718
14802
|
};
|
|
@@ -14727,10 +14811,10 @@
|
|
|
14727
14811
|
*/
|
|
14728
14812
|
Properties.prototype.get = function(target, name) {
|
|
14729
14813
|
|
|
14730
|
-
var property = this.
|
|
14814
|
+
var property = this.getProperty(target, name);
|
|
14731
14815
|
|
|
14732
14816
|
if (!property) {
|
|
14733
|
-
return target.$attrs[name];
|
|
14817
|
+
return target.$attrs[stripGlobal(name)];
|
|
14734
14818
|
}
|
|
14735
14819
|
|
|
14736
14820
|
var propertyName = property.name;
|
|
@@ -14784,6 +14868,44 @@
|
|
|
14784
14868
|
this.define(target, '$model', { value: model });
|
|
14785
14869
|
};
|
|
14786
14870
|
|
|
14871
|
+
/**
|
|
14872
|
+
* Return property with the given name on the element.
|
|
14873
|
+
*
|
|
14874
|
+
* @param {any} target
|
|
14875
|
+
* @param {string} name
|
|
14876
|
+
*
|
|
14877
|
+
* @return {object | null} property
|
|
14878
|
+
*/
|
|
14879
|
+
Properties.prototype.getProperty = function(target, name) {
|
|
14880
|
+
|
|
14881
|
+
var model = this.model;
|
|
14882
|
+
|
|
14883
|
+
var property = model.getPropertyDescriptor(target, name);
|
|
14884
|
+
|
|
14885
|
+
if (property) {
|
|
14886
|
+
return property;
|
|
14887
|
+
}
|
|
14888
|
+
|
|
14889
|
+
if (name.includes(':')) {
|
|
14890
|
+
return null;
|
|
14891
|
+
}
|
|
14892
|
+
|
|
14893
|
+
const strict = model.config.strict;
|
|
14894
|
+
|
|
14895
|
+
if (typeof strict !== 'undefined') {
|
|
14896
|
+
const error = new TypeError(`unknown property <${ name }> on <${ target.$type }>`);
|
|
14897
|
+
|
|
14898
|
+
if (strict) {
|
|
14899
|
+
throw error;
|
|
14900
|
+
} else {
|
|
14901
|
+
|
|
14902
|
+
// eslint-disable-next-line no-undef
|
|
14903
|
+
typeof console !== 'undefined' && console.warn(error);
|
|
14904
|
+
}
|
|
14905
|
+
}
|
|
14906
|
+
|
|
14907
|
+
return null;
|
|
14908
|
+
};
|
|
14787
14909
|
|
|
14788
14910
|
function isUndefined(val) {
|
|
14789
14911
|
return typeof val === 'undefined';
|
|
@@ -14798,6 +14920,10 @@
|
|
|
14798
14920
|
});
|
|
14799
14921
|
}
|
|
14800
14922
|
|
|
14923
|
+
function stripGlobal(name) {
|
|
14924
|
+
return name.replace(/^:/, '');
|
|
14925
|
+
}
|
|
14926
|
+
|
|
14801
14927
|
// Moddle implementation /////////////////////////////////////////////////
|
|
14802
14928
|
|
|
14803
14929
|
/**
|
|
@@ -14820,8 +14946,10 @@
|
|
|
14820
14946
|
* var moddle = new Moddle([pkg]);
|
|
14821
14947
|
*
|
|
14822
14948
|
* @param {Array<Package>} packages the packages to contain
|
|
14949
|
+
*
|
|
14950
|
+
* @param { { strict?: boolean } } [config] moddle configuration
|
|
14823
14951
|
*/
|
|
14824
|
-
function Moddle(packages) {
|
|
14952
|
+
function Moddle(packages, config = {}) {
|
|
14825
14953
|
|
|
14826
14954
|
this.properties = new Properties(this);
|
|
14827
14955
|
|
|
@@ -14829,6 +14957,8 @@
|
|
|
14829
14957
|
this.registry = new Registry(packages, this.properties);
|
|
14830
14958
|
|
|
14831
14959
|
this.typeCache = {};
|
|
14960
|
+
|
|
14961
|
+
this.config = config;
|
|
14832
14962
|
}
|
|
14833
14963
|
|
|
14834
14964
|
|
|
@@ -14922,6 +15052,12 @@
|
|
|
14922
15052
|
$type: name,
|
|
14923
15053
|
$instanceOf: function(type) {
|
|
14924
15054
|
return type === this.$type;
|
|
15055
|
+
},
|
|
15056
|
+
get: function(key) {
|
|
15057
|
+
return this[key];
|
|
15058
|
+
},
|
|
15059
|
+
set: function(key, value) {
|
|
15060
|
+
set$1(this, [ key ], value);
|
|
14925
15061
|
}
|
|
14926
15062
|
};
|
|
14927
15063
|
|
|
@@ -14937,6 +15073,8 @@
|
|
|
14937
15073
|
|
|
14938
15074
|
this.properties.defineDescriptor(element, descriptor);
|
|
14939
15075
|
this.properties.defineModel(element, this);
|
|
15076
|
+
this.properties.define(element, 'get', { enumerable: false, writable: true });
|
|
15077
|
+
this.properties.define(element, 'set', { enumerable: false, writable: true });
|
|
14940
15078
|
this.properties.define(element, '$parent', { enumerable: false, writable: true });
|
|
14941
15079
|
this.properties.define(element, '$instanceOf', { enumerable: false, writable: true });
|
|
14942
15080
|
|