eligius 1.0.11 → 1.0.13

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.
@@ -3322,6 +3322,24 @@ function removeEventDataFromOperationData(operationData) {
3322
3322
  delete operationData.eventArgs;
3323
3323
  }
3324
3324
 
3325
+ var cache$1 = {};
3326
+
3327
+ function _getGlobals(cache, name) {
3328
+ var value = name ? cache[name] : cache;
3329
+ return value && value !== cache ? deepCopy(value) : value;
3330
+ }
3331
+
3332
+ function _setGlobals(cache, newValues) {
3333
+ Object.entries(newValues).forEach(function (_ref) {
3334
+ var name = _ref[0],
3335
+ value = _ref[1];
3336
+ return cache[name] = value;
3337
+ });
3338
+ }
3339
+
3340
+ var getGlobals = /*#__PURE__*/_getGlobals.bind(null, cache$1);
3341
+ var setGlobals = /*#__PURE__*/_setGlobals.bind(null, cache$1);
3342
+
3325
3343
  function extractOperationDataArgumentValues(sourceObject, argumentValue) {
3326
3344
  if (typeof argumentValue === 'string' && argumentValue.toLowerCase().startsWith('operationdata.')) {
3327
3345
  var propNames = argumentValue.split('.');
@@ -3329,6 +3347,14 @@ function extractOperationDataArgumentValues(sourceObject, argumentValue) {
3329
3347
  return getNestedValue(propNames, sourceObject);
3330
3348
  }
3331
3349
 
3350
+ if (typeof argumentValue === 'string' && argumentValue.toLowerCase().startsWith('globaldata.')) {
3351
+ var _propNames = argumentValue.split('.');
3352
+
3353
+ _propNames.shift();
3354
+
3355
+ return getNestedValue(_propNames, getGlobals());
3356
+ }
3357
+
3332
3358
  return argumentValue;
3333
3359
  }
3334
3360
 
@@ -3528,6 +3554,10 @@ var customFunction$1 = function customFunction(operationData) {
3528
3554
  /**
3529
3555
  * This operation invokes the end() method on the specified action instance.
3530
3556
  *
3557
+ * The action operation data is first merged with the current operation data before it is
3558
+ * passed on to the action. After the action has completed the action operation data properties
3559
+ * are removed from the current operation data.
3560
+ *
3531
3561
  * @param operationData
3532
3562
  * @returns
3533
3563
  */
@@ -3870,22 +3900,10 @@ var getImport$1 = function getImport(operationData) {
3870
3900
  var getQueryParams$1 = function getQueryParams(operationData) {
3871
3901
  var searchParams = new URLSearchParams(window.location.search);
3872
3902
  var queryParams = Object.fromEntries(searchParams.entries());
3873
- var defaultValues = operationData.defaultValues;
3874
-
3875
- if (defaultValues) {
3876
- var defaultEntries = Object.entries(defaultValues).filter(function (_ref) {
3877
- var name = _ref[0];
3878
- return !(name in queryParams);
3879
- });
3880
- defaultEntries.forEach(function (_ref2) {
3881
- var name = _ref2[0],
3882
- value = _ref2[1];
3883
- return queryParams[name] = value;
3884
- });
3885
- delete operationData.defaultValues;
3886
- }
3887
-
3888
- operationData.queryParams = queryParams;
3903
+ var _operationData$defaul = operationData.defaultValues,
3904
+ defaultValues = _operationData$defaul === void 0 ? {} : _operationData$defaul;
3905
+ delete operationData.defaultValues;
3906
+ operationData.queryParams = _extends({}, defaultValues, queryParams);
3889
3907
  return operationData;
3890
3908
  };
3891
3909
 
@@ -4226,6 +4244,24 @@ var setElementContent$1 = function setElementContent(operationData) {
4226
4244
  return operationData;
4227
4245
  };
4228
4246
 
4247
+ /**
4248
+ * This operation copies the specified values from the operationData to the global data.
4249
+ *
4250
+ * @param operationData
4251
+ * @returns
4252
+ */
4253
+
4254
+ var setGlobalData$1 = function setGlobalData(operationData) {
4255
+ var properties = operationData.properties;
4256
+ var newGlobals = Object.fromEntries(Object.entries(operationData).filter(function (_ref) {
4257
+ var name = _ref[0];
4258
+ return properties.includes(name);
4259
+ }));
4260
+ setGlobals(newGlobals);
4261
+ delete operationData.properties;
4262
+ return operationData;
4263
+ };
4264
+
4229
4265
  /**
4230
4266
  * This operation assigns the specified properties to the current operation data.
4231
4267
  * When override is set to true the properties replace the current operation data entirely.
@@ -4402,6 +4438,7 @@ var ops = {
4402
4438
  selectElement: selectElement$1,
4403
4439
  setElementAttributes: setElementAttributes$1,
4404
4440
  setElementContent: setElementContent$1,
4441
+ setGlobalData: setGlobalData$1,
4405
4442
  setOperationData: setOperationData$1,
4406
4443
  setStyle: setStyle$1,
4407
4444
  startAction: startAction$1,
@@ -4798,6 +4835,8 @@ var RequestAnimationFrameTimelineProvider = /*#__PURE__*/function () {
4798
4835
  this._resetToStartPosition();
4799
4836
 
4800
4837
  this.eventbus.broadcast(TimelineEventNames.RESTART);
4838
+
4839
+ this._broadCastPosition();
4801
4840
  } else {
4802
4841
  this.stop();
4803
4842
  this.eventbus.broadcast(TimelineEventNames.COMPLETE);
@@ -4805,6 +4844,10 @@ var RequestAnimationFrameTimelineProvider = /*#__PURE__*/function () {
4805
4844
  }
4806
4845
  }
4807
4846
 
4847
+ this._broadCastPosition();
4848
+ };
4849
+
4850
+ _proto._broadCastPosition = function _broadCastPosition() {
4808
4851
  this.eventbus.broadcast(TimelineEventNames.TIME, [{
4809
4852
  position: this._currentPosition
4810
4853
  }]);
@@ -4824,6 +4867,11 @@ var RequestAnimationFrameTimelineProvider = /*#__PURE__*/function () {
4824
4867
  this.playState = 'running';
4825
4868
  (_this$_abortControlle = this._abortController) == null ? void 0 : _this$_abortControlle.abort();
4826
4869
  this._abortController = new AbortController();
4870
+
4871
+ if (this._currentPosition == 0) {
4872
+ this._broadCastPosition();
4873
+ }
4874
+
4827
4875
  animationInterval(this._tickInterval, this._abortController.signal, this._updateBound);
4828
4876
  };
4829
4877
 
@@ -5420,6 +5468,18 @@ function setElementContent() {
5420
5468
  };
5421
5469
  }
5422
5470
 
5471
+ function setGlobalData() {
5472
+ return {
5473
+ description: 'Copies the specified values from the operationData to the global data',
5474
+ properties: {
5475
+ properties: {
5476
+ type: 'ParameterType:array',
5477
+ required: true
5478
+ }
5479
+ }
5480
+ };
5481
+ }
5482
+
5423
5483
  function setOperationData() {
5424
5484
  return {
5425
5485
  description: 'Sets the given properties on the current operation data',
@@ -5535,6 +5595,7 @@ var index = {
5535
5595
  selectElement: selectElement,
5536
5596
  setElementAttributes: setElementAttributes,
5537
5597
  setElementContent: setElementContent,
5598
+ setGlobalData: setGlobalData,
5538
5599
  setOperationData: setOperationData,
5539
5600
  setStyle: setStyle,
5540
5601
  startAction: startAction,
@@ -5602,6 +5663,7 @@ exports.resizeAction = resizeAction$1;
5602
5663
  exports.selectElement = selectElement$1;
5603
5664
  exports.setElementAttributes = setElementAttributes$1;
5604
5665
  exports.setElementContent = setElementContent$1;
5666
+ exports.setGlobalData = setGlobalData$1;
5605
5667
  exports.setOperationData = setOperationData$1;
5606
5668
  exports.setStyle = setStyle$1;
5607
5669
  exports.startAction = startAction$1;