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.
@@ -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$2(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
- var top = -1 * getHeight(element, attrs);
3798
-
3799
- transform(textBox, 0, -top, 270);
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
- drawLine(parentGfx, [
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
- renderLabel(parentGfx, name, {
4539
- box: getBounds(element, attrs),
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
  *
@@ -9837,7 +9936,7 @@
9837
9936
  }
9838
9937
 
9839
9938
  /**
9840
- * @typedef {import('./index').InjectAnnotated } InjectAnnotated
9939
+ * @typedef {import('./index.js').InjectAnnotated } InjectAnnotated
9841
9940
  */
9842
9941
 
9843
9942
  /**
@@ -9907,9 +10006,9 @@
9907
10006
  }
9908
10007
 
9909
10008
  /**
9910
- * @typedef { import('./index').ModuleDeclaration } ModuleDeclaration
9911
- * @typedef { import('./index').ModuleDefinition } ModuleDefinition
9912
- * @typedef { import('./index').InjectorContext } InjectorContext
10009
+ * @typedef { import('./index.js').ModuleDeclaration } ModuleDeclaration
10010
+ * @typedef { import('./index.js').ModuleDefinition } ModuleDefinition
10011
+ * @typedef { import('./index.js').InjectorContext } InjectorContext
9913
10012
  */
9914
10013
 
9915
10014
  /**
@@ -10012,11 +10111,20 @@
10012
10111
  };
10013
10112
  }
10014
10113
 
10015
- function instantiate(Type) {
10114
+ /**
10115
+ * Instantiate the given type, injecting dependencies.
10116
+ *
10117
+ * @template T
10118
+ *
10119
+ * @param { Function | [...string[], Function ]} type
10120
+ *
10121
+ * @return T
10122
+ */
10123
+ function instantiate(type) {
10016
10124
  const {
10017
10125
  fn,
10018
10126
  dependencies
10019
- } = fnDef(Type);
10127
+ } = fnDef(type);
10020
10128
 
10021
10129
  // instantiate var args constructor
10022
10130
  const Constructor = Function.prototype.bind.apply(fn, [ null ].concat(dependencies));
@@ -10024,6 +10132,17 @@
10024
10132
  return new Constructor();
10025
10133
  }
10026
10134
 
10135
+ /**
10136
+ * Invoke the given function, injecting dependencies. Return the result.
10137
+ *
10138
+ * @template T
10139
+ *
10140
+ * @param { Function | [...string[], Function ]} func
10141
+ * @param { Object } [context]
10142
+ * @param { Object } [locals]
10143
+ *
10144
+ * @return {T} invocation result
10145
+ */
10027
10146
  function invoke(func, context, locals) {
10028
10147
  const {
10029
10148
  fn,
@@ -12292,32 +12411,17 @@
12292
12411
  }
12293
12412
  };
12294
12413
 
12295
- var objectRefs = {exports: {}};
12296
-
12297
- var collection = {};
12298
-
12299
- /**
12300
- * An empty collection stub. Use {@link RefsCollection.extend} to extend a
12301
- * collection with ref semantics.
12302
- *
12303
- * @class RefsCollection
12304
- */
12305
-
12306
12414
  /**
12307
12415
  * Extends a collection with {@link Refs} aware methods
12308
12416
  *
12309
- * @memberof RefsCollection
12310
- * @static
12311
- *
12312
- * @param {Array<Object>} collection
12313
- * @param {Refs} refs instance
12314
- * @param {Object} property represented by the collection
12315
- * @param {Object} target object the collection is attached to
12417
+ * @param {Array<Object>} collection
12418
+ * @param {Refs} refs instance
12419
+ * @param {Object} property represented by the collection
12420
+ * @param {Object} target object the collection is attached to
12316
12421
  *
12317
12422
  * @return {RefsCollection<Object>} the extended array
12318
12423
  */
12319
12424
  function extend(collection, refs, property, target) {
12320
-
12321
12425
  var inverseProperty = property.inverse;
12322
12426
 
12323
12427
  /**
@@ -12328,7 +12432,7 @@
12328
12432
  * @param {Object} element the element to remove
12329
12433
  */
12330
12434
  Object.defineProperty(collection, 'remove', {
12331
- value: function(element) {
12435
+ value: function (element) {
12332
12436
  var idx = this.indexOf(element);
12333
12437
  if (idx !== -1) {
12334
12438
  this.splice(idx, 1);
@@ -12336,7 +12440,6 @@
12336
12440
  // unset inverse
12337
12441
  refs.unset(element, inverseProperty, target);
12338
12442
  }
12339
-
12340
12443
  return element;
12341
12444
  }
12342
12445
  });
@@ -12349,7 +12452,7 @@
12349
12452
  * @param {Object} element the element to check for
12350
12453
  */
12351
12454
  Object.defineProperty(collection, 'contains', {
12352
- value: function(element) {
12455
+ value: function (element) {
12353
12456
  return this.indexOf(element) !== -1;
12354
12457
  }
12355
12458
  });
@@ -12364,12 +12467,9 @@
12364
12467
  * (possibly moving other elements around)
12365
12468
  */
12366
12469
  Object.defineProperty(collection, 'add', {
12367
- value: function(element, idx) {
12368
-
12470
+ value: function (element, idx) {
12369
12471
  var currentIdx = this.indexOf(element);
12370
-
12371
12472
  if (typeof idx === 'undefined') {
12372
-
12373
12473
  if (currentIdx !== -1) {
12374
12474
  // element already in collection (!)
12375
12475
  return;
@@ -12381,14 +12481,12 @@
12381
12481
 
12382
12482
  // handle already in collection
12383
12483
  if (currentIdx !== -1) {
12384
-
12385
12484
  // remove element from currentIdx
12386
12485
  this.splice(currentIdx, 1);
12387
12486
  }
12388
12487
 
12389
12488
  // add element at idx
12390
12489
  this.splice(idx, 0, element);
12391
-
12392
12490
  if (currentIdx === -1) {
12393
12491
  // set inverse, unless element was
12394
12492
  // in collection already
@@ -12402,69 +12500,53 @@
12402
12500
  Object.defineProperty(collection, '__refs_collection', {
12403
12501
  value: true
12404
12502
  });
12405
-
12406
12503
  return collection;
12407
12504
  }
12408
12505
 
12409
-
12506
+ /**
12507
+ * Checks if a given collection is extended
12508
+ *
12509
+ * @param {Array<Object>} collection
12510
+ *
12511
+ * @return {boolean}
12512
+ */
12410
12513
  function isExtended(collection) {
12411
12514
  return collection.__refs_collection === true;
12412
12515
  }
12413
12516
 
12414
- collection.extend = extend;
12415
-
12416
- collection.isExtended = isExtended;
12417
-
12418
- var Collection = collection;
12419
-
12420
12517
  function hasOwnProperty$1(e, property) {
12421
12518
  return Object.prototype.hasOwnProperty.call(e, property.name || property);
12422
12519
  }
12423
-
12424
12520
  function defineCollectionProperty(ref, property, target) {
12425
-
12426
- var collection = Collection.extend(target[property.name] || [], ref, property, target);
12427
-
12521
+ var collection = extend(target[property.name] || [], ref, property, target);
12428
12522
  Object.defineProperty(target, property.name, {
12429
12523
  enumerable: property.enumerable,
12430
12524
  value: collection
12431
12525
  });
12432
-
12433
12526
  if (collection.length) {
12434
-
12435
- collection.forEach(function(o) {
12527
+ collection.forEach(function (o) {
12436
12528
  ref.set(o, property.inverse, target);
12437
12529
  });
12438
12530
  }
12439
12531
  }
12440
-
12441
-
12442
12532
  function defineProperty$1(ref, property, target) {
12443
-
12444
12533
  var inverseProperty = property.inverse;
12445
-
12446
12534
  var _value = target[property.name];
12447
-
12448
12535
  Object.defineProperty(target, property.name, {
12449
12536
  configurable: property.configurable,
12450
12537
  enumerable: property.enumerable,
12451
-
12452
- get: function() {
12538
+ get: function () {
12453
12539
  return _value;
12454
12540
  },
12455
-
12456
- set: function(value) {
12457
-
12541
+ set: function (value) {
12458
12542
  // return if we already performed all changes
12459
12543
  if (value === _value) {
12460
12544
  return;
12461
12545
  }
12462
-
12463
12546
  var old = _value;
12464
12547
 
12465
12548
  // temporary set null
12466
12549
  _value = null;
12467
-
12468
12550
  if (old) {
12469
12551
  ref.unset(old, inverseProperty, target);
12470
12552
  }
@@ -12476,7 +12558,6 @@
12476
12558
  ref.set(_value, inverseProperty, target);
12477
12559
  }
12478
12560
  });
12479
-
12480
12561
  }
12481
12562
 
12482
12563
  /**
@@ -12522,16 +12603,14 @@
12522
12603
  *
12523
12604
  * wheels[0].car // undefined
12524
12605
  */
12525
- function Refs$1(a, b) {
12526
-
12527
- if (!(this instanceof Refs$1)) {
12528
- return new Refs$1(a, b);
12606
+ function Refs(a, b) {
12607
+ if (!(this instanceof Refs)) {
12608
+ return new Refs(a, b);
12529
12609
  }
12530
12610
 
12531
12611
  // link
12532
12612
  a.inverse = b;
12533
12613
  b.inverse = a;
12534
-
12535
12614
  this.props = {};
12536
12615
  this.props[a.name] = a;
12537
12616
  this.props[b.name] = b;
@@ -12546,43 +12625,34 @@
12546
12625
  * @param {Object} target
12547
12626
  * @param {String} property
12548
12627
  */
12549
- Refs$1.prototype.bind = function(target, property) {
12628
+ Refs.prototype.bind = function (target, property) {
12550
12629
  if (typeof property === 'string') {
12551
12630
  if (!this.props[property]) {
12552
12631
  throw new Error('no property <' + property + '> in ref');
12553
12632
  }
12554
12633
  property = this.props[property];
12555
12634
  }
12556
-
12557
12635
  if (property.collection) {
12558
12636
  defineCollectionProperty(this, property, target);
12559
12637
  } else {
12560
12638
  defineProperty$1(this, property, target);
12561
12639
  }
12562
12640
  };
12563
-
12564
- Refs$1.prototype.ensureRefsCollection = function(target, property) {
12565
-
12641
+ Refs.prototype.ensureRefsCollection = function (target, property) {
12566
12642
  var collection = target[property.name];
12567
-
12568
- if (!Collection.isExtended(collection)) {
12643
+ if (!isExtended(collection)) {
12569
12644
  defineCollectionProperty(this, property, target);
12570
12645
  }
12571
-
12572
12646
  return collection;
12573
12647
  };
12574
-
12575
- Refs$1.prototype.ensureBound = function(target, property) {
12648
+ Refs.prototype.ensureBound = function (target, property) {
12576
12649
  if (!hasOwnProperty$1(target, property)) {
12577
12650
  this.bind(target, property);
12578
12651
  }
12579
12652
  };
12580
-
12581
- Refs$1.prototype.unset = function(target, property, value) {
12582
-
12653
+ Refs.prototype.unset = function (target, property, value) {
12583
12654
  if (target) {
12584
12655
  this.ensureBound(target, property);
12585
-
12586
12656
  if (property.collection) {
12587
12657
  this.ensureRefsCollection(target, property).remove(value);
12588
12658
  } else {
@@ -12590,12 +12660,9 @@
12590
12660
  }
12591
12661
  }
12592
12662
  };
12593
-
12594
- Refs$1.prototype.set = function(target, property, value) {
12595
-
12663
+ Refs.prototype.set = function (target, property, value) {
12596
12664
  if (target) {
12597
12665
  this.ensureBound(target, property);
12598
-
12599
12666
  if (property.collection) {
12600
12667
  this.ensureRefsCollection(target, property).add(value);
12601
12668
  } else {
@@ -12604,15 +12671,6 @@
12604
12671
  }
12605
12672
  };
12606
12673
 
12607
- var refs = Refs$1;
12608
-
12609
- objectRefs.exports = refs;
12610
-
12611
- objectRefs.exports.Collection = collection;
12612
-
12613
- var objectRefsExports = objectRefs.exports;
12614
- var Refs = /*@__PURE__*/getDefaultExportFromCjs(objectRefsExports);
12615
-
12616
12674
  var parentRefs = new Refs({ name: 'children', enumerable: true, collection: true }, { name: 'parent' }),
12617
12675
  labelRefs = new Refs({ name: 'labels', enumerable: true, collection: true }, { name: 'labelTarget' }),
12618
12676
  attacherRefs = new Refs({ name: 'attachers', collection: true }, { name: 'host' }),
@@ -14429,6 +14487,17 @@
14429
14487
  this.idProperty = p;
14430
14488
  };
14431
14489
 
14490
+ DescriptorBuilder.prototype.assertNotTrait = function(typeDescriptor) {
14491
+
14492
+ const _extends = typeDescriptor.extends || [];
14493
+
14494
+ if (_extends.length) {
14495
+ throw new Error(
14496
+ `cannot create <${ typeDescriptor.name }> extending <${ typeDescriptor.extends }>`
14497
+ );
14498
+ }
14499
+ };
14500
+
14432
14501
  DescriptorBuilder.prototype.assertNotDefined = function(p, name) {
14433
14502
  var propertyName = p.name,
14434
14503
  definedProperty = this.propertiesByName[propertyName];
@@ -14447,6 +14516,10 @@
14447
14516
 
14448
14517
  DescriptorBuilder.prototype.addTrait = function(t, inherited) {
14449
14518
 
14519
+ if (inherited) {
14520
+ this.assertNotTrait(t);
14521
+ }
14522
+
14450
14523
  var typesByName = this.allTypesByName,
14451
14524
  types = this.allTypes;
14452
14525
 
@@ -14580,7 +14653,9 @@
14580
14653
  });
14581
14654
 
14582
14655
  forEach$1(type.extends, bind$2(function(extendsName) {
14583
- var extended = this.typeMap[extendsName];
14656
+ var extendsNameNs = parseName(extendsName, ns.prefix);
14657
+
14658
+ var extended = this.typeMap[extendsNameNs.name];
14584
14659
 
14585
14660
  extended.traits = extended.traits || [];
14586
14661
  extended.traits.push(name);
@@ -14609,24 +14684,33 @@
14609
14684
 
14610
14685
  var self = this;
14611
14686
 
14687
+ /**
14688
+ * Traverse the selected super type or trait
14689
+ *
14690
+ * @param {String} cls
14691
+ * @param {Boolean} [trait=false]
14692
+ */
14693
+ function traverse(cls, trait) {
14694
+ var parentNs = parseName(cls, isBuiltIn(cls) ? '' : nsName.prefix);
14695
+ self.mapTypes(parentNs, iterator, trait);
14696
+ }
14697
+
14612
14698
  /**
14613
14699
  * Traverse the selected trait.
14614
14700
  *
14615
14701
  * @param {String} cls
14616
14702
  */
14617
14703
  function traverseTrait(cls) {
14618
- return traverseSuper(cls, true);
14704
+ return traverse(cls, true);
14619
14705
  }
14620
14706
 
14621
14707
  /**
14622
- * Traverse the selected super type or trait
14708
+ * Traverse the selected super type
14623
14709
  *
14624
14710
  * @param {String} cls
14625
- * @param {Boolean} [trait=false]
14626
14711
  */
14627
- function traverseSuper(cls, trait) {
14628
- var parentNs = parseName(cls, isBuiltIn(cls) ? '' : nsName.prefix);
14629
- self.mapTypes(parentNs, iterator, trait);
14712
+ function traverseSuper(cls) {
14713
+ return traverse(cls, false);
14630
14714
  }
14631
14715
 
14632
14716
  if (!type) {
@@ -14709,7 +14793,7 @@
14709
14793
  throw new TypeError('property name must be a non-empty string');
14710
14794
  }
14711
14795
 
14712
- var property = this.model.getPropertyDescriptor(target, name);
14796
+ var property = this.getProperty(target, name);
14713
14797
 
14714
14798
  var propertyName = property && property.name;
14715
14799
 
@@ -14720,7 +14804,7 @@
14720
14804
  if (property) {
14721
14805
  delete target[propertyName];
14722
14806
  } else {
14723
- delete target.$attrs[name];
14807
+ delete target.$attrs[stripGlobal(name)];
14724
14808
  }
14725
14809
  } else {
14726
14810
 
@@ -14733,7 +14817,7 @@
14733
14817
  defineProperty(target, property, value);
14734
14818
  }
14735
14819
  } else {
14736
- target.$attrs[name] = value;
14820
+ target.$attrs[stripGlobal(name)] = value;
14737
14821
  }
14738
14822
  }
14739
14823
  };
@@ -14748,10 +14832,10 @@
14748
14832
  */
14749
14833
  Properties.prototype.get = function(target, name) {
14750
14834
 
14751
- var property = this.model.getPropertyDescriptor(target, name);
14835
+ var property = this.getProperty(target, name);
14752
14836
 
14753
14837
  if (!property) {
14754
- return target.$attrs[name];
14838
+ return target.$attrs[stripGlobal(name)];
14755
14839
  }
14756
14840
 
14757
14841
  var propertyName = property.name;
@@ -14805,6 +14889,44 @@
14805
14889
  this.define(target, '$model', { value: model });
14806
14890
  };
14807
14891
 
14892
+ /**
14893
+ * Return property with the given name on the element.
14894
+ *
14895
+ * @param {any} target
14896
+ * @param {string} name
14897
+ *
14898
+ * @return {object | null} property
14899
+ */
14900
+ Properties.prototype.getProperty = function(target, name) {
14901
+
14902
+ var model = this.model;
14903
+
14904
+ var property = model.getPropertyDescriptor(target, name);
14905
+
14906
+ if (property) {
14907
+ return property;
14908
+ }
14909
+
14910
+ if (name.includes(':')) {
14911
+ return null;
14912
+ }
14913
+
14914
+ const strict = model.config.strict;
14915
+
14916
+ if (typeof strict !== 'undefined') {
14917
+ const error = new TypeError(`unknown property <${ name }> on <${ target.$type }>`);
14918
+
14919
+ if (strict) {
14920
+ throw error;
14921
+ } else {
14922
+
14923
+ // eslint-disable-next-line no-undef
14924
+ typeof console !== 'undefined' && console.warn(error);
14925
+ }
14926
+ }
14927
+
14928
+ return null;
14929
+ };
14808
14930
 
14809
14931
  function isUndefined(val) {
14810
14932
  return typeof val === 'undefined';
@@ -14819,6 +14941,10 @@
14819
14941
  });
14820
14942
  }
14821
14943
 
14944
+ function stripGlobal(name) {
14945
+ return name.replace(/^:/, '');
14946
+ }
14947
+
14822
14948
  // Moddle implementation /////////////////////////////////////////////////
14823
14949
 
14824
14950
  /**
@@ -14841,8 +14967,10 @@
14841
14967
  * var moddle = new Moddle([pkg]);
14842
14968
  *
14843
14969
  * @param {Array<Package>} packages the packages to contain
14970
+ *
14971
+ * @param { { strict?: boolean } } [config] moddle configuration
14844
14972
  */
14845
- function Moddle(packages) {
14973
+ function Moddle(packages, config = {}) {
14846
14974
 
14847
14975
  this.properties = new Properties(this);
14848
14976
 
@@ -14850,6 +14978,8 @@
14850
14978
  this.registry = new Registry(packages, this.properties);
14851
14979
 
14852
14980
  this.typeCache = {};
14981
+
14982
+ this.config = config;
14853
14983
  }
14854
14984
 
14855
14985
 
@@ -14943,6 +15073,12 @@
14943
15073
  $type: name,
14944
15074
  $instanceOf: function(type) {
14945
15075
  return type === this.$type;
15076
+ },
15077
+ get: function(key) {
15078
+ return this[key];
15079
+ },
15080
+ set: function(key, value) {
15081
+ set$2(this, [ key ], value);
14946
15082
  }
14947
15083
  };
14948
15084
 
@@ -14958,6 +15094,8 @@
14958
15094
 
14959
15095
  this.properties.defineDescriptor(element, descriptor);
14960
15096
  this.properties.defineModel(element, this);
15097
+ this.properties.define(element, 'get', { enumerable: false, writable: true });
15098
+ this.properties.define(element, 'set', { enumerable: false, writable: true });
14961
15099
  this.properties.define(element, '$parent', { enumerable: false, writable: true });
14962
15100
  this.properties.define(element, '$instanceOf', { enumerable: false, writable: true });
14963
15101