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
  *
@@ -3772,10 +3848,12 @@
3772
3848
  }
3773
3849
 
3774
3850
  function renderLaneLabel(parentGfx, text, element, attrs = {}) {
3851
+ var isHorizontalLane = isHorizontal(element);
3852
+
3775
3853
  var textBox = renderLabel(parentGfx, text, {
3776
3854
  box: {
3777
3855
  height: 30,
3778
- width: getHeight(element, attrs),
3856
+ width: isHorizontalLane ? getHeight(element, attrs) : getWidth(element, attrs),
3779
3857
  },
3780
3858
  align: 'center-middle',
3781
3859
  style: {
@@ -3783,9 +3861,10 @@
3783
3861
  }
3784
3862
  });
3785
3863
 
3786
- var top = -1 * getHeight(element, attrs);
3787
-
3788
- transform(textBox, 0, -top, 270);
3864
+ if (isHorizontalLane) {
3865
+ var top = -1 * getHeight(element, attrs);
3866
+ transform(textBox, 0, -top, 270);
3867
+ }
3789
3868
  }
3790
3869
 
3791
3870
  function renderActivity(parentGfx, element, attrs = {}) {
@@ -4503,12 +4582,13 @@
4503
4582
  var participant = renderLane(parentGfx, element, attrs);
4504
4583
 
4505
4584
  var expandedParticipant = isExpanded(element);
4585
+ var horizontalParticipant = isHorizontal(element);
4506
4586
 
4507
4587
  var semantic = getBusinessObject(element),
4508
4588
  name = semantic.get('name');
4509
4589
 
4510
4590
  if (expandedParticipant) {
4511
- drawLine(parentGfx, [
4591
+ var waypoints = horizontalParticipant ? [
4512
4592
  {
4513
4593
  x: 30,
4514
4594
  y: 0
@@ -4517,20 +4597,43 @@
4517
4597
  x: 30,
4518
4598
  y: getHeight(element, attrs)
4519
4599
  }
4520
- ], {
4600
+ ] : [
4601
+ {
4602
+ x: 0,
4603
+ y: 30
4604
+ },
4605
+ {
4606
+ x: getWidth(element, attrs),
4607
+ y: 30
4608
+ }
4609
+ ];
4610
+
4611
+ drawLine(parentGfx, waypoints, {
4521
4612
  stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
4522
4613
  strokeWidth: PARTICIPANT_STROKE_WIDTH
4523
4614
  });
4524
4615
 
4525
4616
  renderLaneLabel(parentGfx, name, element, attrs);
4526
4617
  } else {
4527
- renderLabel(parentGfx, name, {
4528
- box: getBounds(element, attrs),
4618
+ var bounds = getBounds(element, attrs);
4619
+
4620
+ if (!horizontalParticipant) {
4621
+ bounds.height = getWidth(element, attrs);
4622
+ bounds.width = getHeight(element, attrs);
4623
+ }
4624
+
4625
+ var textBox = renderLabel(parentGfx, name, {
4626
+ box: bounds,
4529
4627
  align: 'center-middle',
4530
4628
  style: {
4531
4629
  fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)
4532
4630
  }
4533
4631
  });
4632
+
4633
+ if (!horizontalParticipant) {
4634
+ var top = -1 * getHeight(element, attrs);
4635
+ transform(textBox, 0, -top, 270);
4636
+ }
4534
4637
  }
4535
4638
 
4536
4639
  if (semantic.get('participantMultiplicity')) {
@@ -6117,10 +6220,6 @@
6117
6220
  translate: [ 'value', translate ]
6118
6221
  };
6119
6222
 
6120
- function getDefaultExportFromCjs (x) {
6121
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
6122
- }
6123
-
6124
6223
  /**
6125
6224
  * @param {Point} point
6126
6225
  *
@@ -9826,7 +9925,7 @@
9826
9925
  }
9827
9926
 
9828
9927
  /**
9829
- * @typedef {import('./index').InjectAnnotated } InjectAnnotated
9928
+ * @typedef {import('./index.js').InjectAnnotated } InjectAnnotated
9830
9929
  */
9831
9930
 
9832
9931
  /**
@@ -9896,9 +9995,9 @@
9896
9995
  }
9897
9996
 
9898
9997
  /**
9899
- * @typedef { import('./index').ModuleDeclaration } ModuleDeclaration
9900
- * @typedef { import('./index').ModuleDefinition } ModuleDefinition
9901
- * @typedef { import('./index').InjectorContext } InjectorContext
9998
+ * @typedef { import('./index.js').ModuleDeclaration } ModuleDeclaration
9999
+ * @typedef { import('./index.js').ModuleDefinition } ModuleDefinition
10000
+ * @typedef { import('./index.js').InjectorContext } InjectorContext
9902
10001
  */
9903
10002
 
9904
10003
  /**
@@ -10001,11 +10100,20 @@
10001
10100
  };
10002
10101
  }
10003
10102
 
10004
- function instantiate(Type) {
10103
+ /**
10104
+ * Instantiate the given type, injecting dependencies.
10105
+ *
10106
+ * @template T
10107
+ *
10108
+ * @param { Function | [...string[], Function ]} type
10109
+ *
10110
+ * @return T
10111
+ */
10112
+ function instantiate(type) {
10005
10113
  const {
10006
10114
  fn,
10007
10115
  dependencies
10008
- } = fnDef(Type);
10116
+ } = fnDef(type);
10009
10117
 
10010
10118
  // instantiate var args constructor
10011
10119
  const Constructor = Function.prototype.bind.apply(fn, [ null ].concat(dependencies));
@@ -10013,6 +10121,17 @@
10013
10121
  return new Constructor();
10014
10122
  }
10015
10123
 
10124
+ /**
10125
+ * Invoke the given function, injecting dependencies. Return the result.
10126
+ *
10127
+ * @template T
10128
+ *
10129
+ * @param { Function | [...string[], Function ]} func
10130
+ * @param { Object } [context]
10131
+ * @param { Object } [locals]
10132
+ *
10133
+ * @return {T} invocation result
10134
+ */
10016
10135
  function invoke(func, context, locals) {
10017
10136
  const {
10018
10137
  fn,
@@ -12281,32 +12400,17 @@
12281
12400
  }
12282
12401
  };
12283
12402
 
12284
- var objectRefs = {exports: {}};
12285
-
12286
- var collection = {};
12287
-
12288
- /**
12289
- * An empty collection stub. Use {@link RefsCollection.extend} to extend a
12290
- * collection with ref semantics.
12291
- *
12292
- * @class RefsCollection
12293
- */
12294
-
12295
12403
  /**
12296
12404
  * Extends a collection with {@link Refs} aware methods
12297
12405
  *
12298
- * @memberof RefsCollection
12299
- * @static
12300
- *
12301
- * @param {Array<Object>} collection
12302
- * @param {Refs} refs instance
12303
- * @param {Object} property represented by the collection
12304
- * @param {Object} target object the collection is attached to
12406
+ * @param {Array<Object>} collection
12407
+ * @param {Refs} refs instance
12408
+ * @param {Object} property represented by the collection
12409
+ * @param {Object} target object the collection is attached to
12305
12410
  *
12306
12411
  * @return {RefsCollection<Object>} the extended array
12307
12412
  */
12308
12413
  function extend(collection, refs, property, target) {
12309
-
12310
12414
  var inverseProperty = property.inverse;
12311
12415
 
12312
12416
  /**
@@ -12317,7 +12421,7 @@
12317
12421
  * @param {Object} element the element to remove
12318
12422
  */
12319
12423
  Object.defineProperty(collection, 'remove', {
12320
- value: function(element) {
12424
+ value: function (element) {
12321
12425
  var idx = this.indexOf(element);
12322
12426
  if (idx !== -1) {
12323
12427
  this.splice(idx, 1);
@@ -12325,7 +12429,6 @@
12325
12429
  // unset inverse
12326
12430
  refs.unset(element, inverseProperty, target);
12327
12431
  }
12328
-
12329
12432
  return element;
12330
12433
  }
12331
12434
  });
@@ -12338,7 +12441,7 @@
12338
12441
  * @param {Object} element the element to check for
12339
12442
  */
12340
12443
  Object.defineProperty(collection, 'contains', {
12341
- value: function(element) {
12444
+ value: function (element) {
12342
12445
  return this.indexOf(element) !== -1;
12343
12446
  }
12344
12447
  });
@@ -12353,12 +12456,9 @@
12353
12456
  * (possibly moving other elements around)
12354
12457
  */
12355
12458
  Object.defineProperty(collection, 'add', {
12356
- value: function(element, idx) {
12357
-
12459
+ value: function (element, idx) {
12358
12460
  var currentIdx = this.indexOf(element);
12359
-
12360
12461
  if (typeof idx === 'undefined') {
12361
-
12362
12462
  if (currentIdx !== -1) {
12363
12463
  // element already in collection (!)
12364
12464
  return;
@@ -12370,14 +12470,12 @@
12370
12470
 
12371
12471
  // handle already in collection
12372
12472
  if (currentIdx !== -1) {
12373
-
12374
12473
  // remove element from currentIdx
12375
12474
  this.splice(currentIdx, 1);
12376
12475
  }
12377
12476
 
12378
12477
  // add element at idx
12379
12478
  this.splice(idx, 0, element);
12380
-
12381
12479
  if (currentIdx === -1) {
12382
12480
  // set inverse, unless element was
12383
12481
  // in collection already
@@ -12391,69 +12489,53 @@
12391
12489
  Object.defineProperty(collection, '__refs_collection', {
12392
12490
  value: true
12393
12491
  });
12394
-
12395
12492
  return collection;
12396
12493
  }
12397
12494
 
12398
-
12495
+ /**
12496
+ * Checks if a given collection is extended
12497
+ *
12498
+ * @param {Array<Object>} collection
12499
+ *
12500
+ * @return {boolean}
12501
+ */
12399
12502
  function isExtended(collection) {
12400
12503
  return collection.__refs_collection === true;
12401
12504
  }
12402
12505
 
12403
- collection.extend = extend;
12404
-
12405
- collection.isExtended = isExtended;
12406
-
12407
- var Collection = collection;
12408
-
12409
12506
  function hasOwnProperty$1(e, property) {
12410
12507
  return Object.prototype.hasOwnProperty.call(e, property.name || property);
12411
12508
  }
12412
-
12413
12509
  function defineCollectionProperty(ref, property, target) {
12414
-
12415
- var collection = Collection.extend(target[property.name] || [], ref, property, target);
12416
-
12510
+ var collection = extend(target[property.name] || [], ref, property, target);
12417
12511
  Object.defineProperty(target, property.name, {
12418
12512
  enumerable: property.enumerable,
12419
12513
  value: collection
12420
12514
  });
12421
-
12422
12515
  if (collection.length) {
12423
-
12424
- collection.forEach(function(o) {
12516
+ collection.forEach(function (o) {
12425
12517
  ref.set(o, property.inverse, target);
12426
12518
  });
12427
12519
  }
12428
12520
  }
12429
-
12430
-
12431
12521
  function defineProperty$1(ref, property, target) {
12432
-
12433
12522
  var inverseProperty = property.inverse;
12434
-
12435
12523
  var _value = target[property.name];
12436
-
12437
12524
  Object.defineProperty(target, property.name, {
12438
12525
  configurable: property.configurable,
12439
12526
  enumerable: property.enumerable,
12440
-
12441
- get: function() {
12527
+ get: function () {
12442
12528
  return _value;
12443
12529
  },
12444
-
12445
- set: function(value) {
12446
-
12530
+ set: function (value) {
12447
12531
  // return if we already performed all changes
12448
12532
  if (value === _value) {
12449
12533
  return;
12450
12534
  }
12451
-
12452
12535
  var old = _value;
12453
12536
 
12454
12537
  // temporary set null
12455
12538
  _value = null;
12456
-
12457
12539
  if (old) {
12458
12540
  ref.unset(old, inverseProperty, target);
12459
12541
  }
@@ -12465,7 +12547,6 @@
12465
12547
  ref.set(_value, inverseProperty, target);
12466
12548
  }
12467
12549
  });
12468
-
12469
12550
  }
12470
12551
 
12471
12552
  /**
@@ -12511,16 +12592,14 @@
12511
12592
  *
12512
12593
  * wheels[0].car // undefined
12513
12594
  */
12514
- function Refs$1(a, b) {
12515
-
12516
- if (!(this instanceof Refs$1)) {
12517
- return new Refs$1(a, b);
12595
+ function Refs(a, b) {
12596
+ if (!(this instanceof Refs)) {
12597
+ return new Refs(a, b);
12518
12598
  }
12519
12599
 
12520
12600
  // link
12521
12601
  a.inverse = b;
12522
12602
  b.inverse = a;
12523
-
12524
12603
  this.props = {};
12525
12604
  this.props[a.name] = a;
12526
12605
  this.props[b.name] = b;
@@ -12535,43 +12614,34 @@
12535
12614
  * @param {Object} target
12536
12615
  * @param {String} property
12537
12616
  */
12538
- Refs$1.prototype.bind = function(target, property) {
12617
+ Refs.prototype.bind = function (target, property) {
12539
12618
  if (typeof property === 'string') {
12540
12619
  if (!this.props[property]) {
12541
12620
  throw new Error('no property <' + property + '> in ref');
12542
12621
  }
12543
12622
  property = this.props[property];
12544
12623
  }
12545
-
12546
12624
  if (property.collection) {
12547
12625
  defineCollectionProperty(this, property, target);
12548
12626
  } else {
12549
12627
  defineProperty$1(this, property, target);
12550
12628
  }
12551
12629
  };
12552
-
12553
- Refs$1.prototype.ensureRefsCollection = function(target, property) {
12554
-
12630
+ Refs.prototype.ensureRefsCollection = function (target, property) {
12555
12631
  var collection = target[property.name];
12556
-
12557
- if (!Collection.isExtended(collection)) {
12632
+ if (!isExtended(collection)) {
12558
12633
  defineCollectionProperty(this, property, target);
12559
12634
  }
12560
-
12561
12635
  return collection;
12562
12636
  };
12563
-
12564
- Refs$1.prototype.ensureBound = function(target, property) {
12637
+ Refs.prototype.ensureBound = function (target, property) {
12565
12638
  if (!hasOwnProperty$1(target, property)) {
12566
12639
  this.bind(target, property);
12567
12640
  }
12568
12641
  };
12569
-
12570
- Refs$1.prototype.unset = function(target, property, value) {
12571
-
12642
+ Refs.prototype.unset = function (target, property, value) {
12572
12643
  if (target) {
12573
12644
  this.ensureBound(target, property);
12574
-
12575
12645
  if (property.collection) {
12576
12646
  this.ensureRefsCollection(target, property).remove(value);
12577
12647
  } else {
@@ -12579,12 +12649,9 @@
12579
12649
  }
12580
12650
  }
12581
12651
  };
12582
-
12583
- Refs$1.prototype.set = function(target, property, value) {
12584
-
12652
+ Refs.prototype.set = function (target, property, value) {
12585
12653
  if (target) {
12586
12654
  this.ensureBound(target, property);
12587
-
12588
12655
  if (property.collection) {
12589
12656
  this.ensureRefsCollection(target, property).add(value);
12590
12657
  } else {
@@ -12593,15 +12660,6 @@
12593
12660
  }
12594
12661
  };
12595
12662
 
12596
- var refs = Refs$1;
12597
-
12598
- objectRefs.exports = refs;
12599
-
12600
- objectRefs.exports.Collection = collection;
12601
-
12602
- var objectRefsExports = objectRefs.exports;
12603
- var Refs = /*@__PURE__*/getDefaultExportFromCjs(objectRefsExports);
12604
-
12605
12663
  var parentRefs = new Refs({ name: 'children', enumerable: true, collection: true }, { name: 'parent' }),
12606
12664
  labelRefs = new Refs({ name: 'labels', enumerable: true, collection: true }, { name: 'labelTarget' }),
12607
12665
  attacherRefs = new Refs({ name: 'attachers', collection: true }, { name: 'host' }),
@@ -14418,6 +14476,17 @@
14418
14476
  this.idProperty = p;
14419
14477
  };
14420
14478
 
14479
+ DescriptorBuilder.prototype.assertNotTrait = function(typeDescriptor) {
14480
+
14481
+ const _extends = typeDescriptor.extends || [];
14482
+
14483
+ if (_extends.length) {
14484
+ throw new Error(
14485
+ `cannot create <${ typeDescriptor.name }> extending <${ typeDescriptor.extends }>`
14486
+ );
14487
+ }
14488
+ };
14489
+
14421
14490
  DescriptorBuilder.prototype.assertNotDefined = function(p, name) {
14422
14491
  var propertyName = p.name,
14423
14492
  definedProperty = this.propertiesByName[propertyName];
@@ -14436,6 +14505,10 @@
14436
14505
 
14437
14506
  DescriptorBuilder.prototype.addTrait = function(t, inherited) {
14438
14507
 
14508
+ if (inherited) {
14509
+ this.assertNotTrait(t);
14510
+ }
14511
+
14439
14512
  var typesByName = this.allTypesByName,
14440
14513
  types = this.allTypes;
14441
14514
 
@@ -14569,7 +14642,9 @@
14569
14642
  });
14570
14643
 
14571
14644
  forEach$1(type.extends, bind$2(function(extendsName) {
14572
- var extended = this.typeMap[extendsName];
14645
+ var extendsNameNs = parseName(extendsName, ns.prefix);
14646
+
14647
+ var extended = this.typeMap[extendsNameNs.name];
14573
14648
 
14574
14649
  extended.traits = extended.traits || [];
14575
14650
  extended.traits.push(name);
@@ -14598,24 +14673,33 @@
14598
14673
 
14599
14674
  var self = this;
14600
14675
 
14676
+ /**
14677
+ * Traverse the selected super type or trait
14678
+ *
14679
+ * @param {String} cls
14680
+ * @param {Boolean} [trait=false]
14681
+ */
14682
+ function traverse(cls, trait) {
14683
+ var parentNs = parseName(cls, isBuiltIn(cls) ? '' : nsName.prefix);
14684
+ self.mapTypes(parentNs, iterator, trait);
14685
+ }
14686
+
14601
14687
  /**
14602
14688
  * Traverse the selected trait.
14603
14689
  *
14604
14690
  * @param {String} cls
14605
14691
  */
14606
14692
  function traverseTrait(cls) {
14607
- return traverseSuper(cls, true);
14693
+ return traverse(cls, true);
14608
14694
  }
14609
14695
 
14610
14696
  /**
14611
- * Traverse the selected super type or trait
14697
+ * Traverse the selected super type
14612
14698
  *
14613
14699
  * @param {String} cls
14614
- * @param {Boolean} [trait=false]
14615
14700
  */
14616
- function traverseSuper(cls, trait) {
14617
- var parentNs = parseName(cls, isBuiltIn(cls) ? '' : nsName.prefix);
14618
- self.mapTypes(parentNs, iterator, trait);
14701
+ function traverseSuper(cls) {
14702
+ return traverse(cls, false);
14619
14703
  }
14620
14704
 
14621
14705
  if (!type) {
@@ -14698,7 +14782,7 @@
14698
14782
  throw new TypeError('property name must be a non-empty string');
14699
14783
  }
14700
14784
 
14701
- var property = this.model.getPropertyDescriptor(target, name);
14785
+ var property = this.getProperty(target, name);
14702
14786
 
14703
14787
  var propertyName = property && property.name;
14704
14788
 
@@ -14709,7 +14793,7 @@
14709
14793
  if (property) {
14710
14794
  delete target[propertyName];
14711
14795
  } else {
14712
- delete target.$attrs[name];
14796
+ delete target.$attrs[stripGlobal(name)];
14713
14797
  }
14714
14798
  } else {
14715
14799
 
@@ -14722,7 +14806,7 @@
14722
14806
  defineProperty(target, property, value);
14723
14807
  }
14724
14808
  } else {
14725
- target.$attrs[name] = value;
14809
+ target.$attrs[stripGlobal(name)] = value;
14726
14810
  }
14727
14811
  }
14728
14812
  };
@@ -14737,10 +14821,10 @@
14737
14821
  */
14738
14822
  Properties.prototype.get = function(target, name) {
14739
14823
 
14740
- var property = this.model.getPropertyDescriptor(target, name);
14824
+ var property = this.getProperty(target, name);
14741
14825
 
14742
14826
  if (!property) {
14743
- return target.$attrs[name];
14827
+ return target.$attrs[stripGlobal(name)];
14744
14828
  }
14745
14829
 
14746
14830
  var propertyName = property.name;
@@ -14794,6 +14878,44 @@
14794
14878
  this.define(target, '$model', { value: model });
14795
14879
  };
14796
14880
 
14881
+ /**
14882
+ * Return property with the given name on the element.
14883
+ *
14884
+ * @param {any} target
14885
+ * @param {string} name
14886
+ *
14887
+ * @return {object | null} property
14888
+ */
14889
+ Properties.prototype.getProperty = function(target, name) {
14890
+
14891
+ var model = this.model;
14892
+
14893
+ var property = model.getPropertyDescriptor(target, name);
14894
+
14895
+ if (property) {
14896
+ return property;
14897
+ }
14898
+
14899
+ if (name.includes(':')) {
14900
+ return null;
14901
+ }
14902
+
14903
+ const strict = model.config.strict;
14904
+
14905
+ if (typeof strict !== 'undefined') {
14906
+ const error = new TypeError(`unknown property <${ name }> on <${ target.$type }>`);
14907
+
14908
+ if (strict) {
14909
+ throw error;
14910
+ } else {
14911
+
14912
+ // eslint-disable-next-line no-undef
14913
+ typeof console !== 'undefined' && console.warn(error);
14914
+ }
14915
+ }
14916
+
14917
+ return null;
14918
+ };
14797
14919
 
14798
14920
  function isUndefined(val) {
14799
14921
  return typeof val === 'undefined';
@@ -14808,6 +14930,10 @@
14808
14930
  });
14809
14931
  }
14810
14932
 
14933
+ function stripGlobal(name) {
14934
+ return name.replace(/^:/, '');
14935
+ }
14936
+
14811
14937
  // Moddle implementation /////////////////////////////////////////////////
14812
14938
 
14813
14939
  /**
@@ -14830,8 +14956,10 @@
14830
14956
  * var moddle = new Moddle([pkg]);
14831
14957
  *
14832
14958
  * @param {Array<Package>} packages the packages to contain
14959
+ *
14960
+ * @param { { strict?: boolean } } [config] moddle configuration
14833
14961
  */
14834
- function Moddle(packages) {
14962
+ function Moddle(packages, config = {}) {
14835
14963
 
14836
14964
  this.properties = new Properties(this);
14837
14965
 
@@ -14839,6 +14967,8 @@
14839
14967
  this.registry = new Registry(packages, this.properties);
14840
14968
 
14841
14969
  this.typeCache = {};
14970
+
14971
+ this.config = config;
14842
14972
  }
14843
14973
 
14844
14974
 
@@ -14932,6 +15062,12 @@
14932
15062
  $type: name,
14933
15063
  $instanceOf: function(type) {
14934
15064
  return type === this.$type;
15065
+ },
15066
+ get: function(key) {
15067
+ return this[key];
15068
+ },
15069
+ set: function(key, value) {
15070
+ set$2(this, [ key ], value);
14935
15071
  }
14936
15072
  };
14937
15073
 
@@ -14947,6 +15083,8 @@
14947
15083
 
14948
15084
  this.properties.defineDescriptor(element, descriptor);
14949
15085
  this.properties.defineModel(element, this);
15086
+ this.properties.define(element, 'get', { enumerable: false, writable: true });
15087
+ this.properties.define(element, 'set', { enumerable: false, writable: true });
14950
15088
  this.properties.define(element, '$parent', { enumerable: false, writable: true });
14951
15089
  this.properties.define(element, '$instanceOf', { enumerable: false, writable: true });
14952
15090