eligius 1.1.0 → 1.1.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.
@@ -738,7 +738,7 @@ var TimelineAction = /*#__PURE__*/function (_EndableAction) {
738
738
 
739
739
  _this = _EndableAction.call(this, name, startOperations, endOperations, eventBus) || this;
740
740
  _this.duration = void 0;
741
- _this.active = false;
741
+ _this._active = false;
742
742
  _this.duration = duration;
743
743
  return _this;
744
744
  }
@@ -747,7 +747,7 @@ var TimelineAction = /*#__PURE__*/function (_EndableAction) {
747
747
 
748
748
  _proto.start = function start(initOperationData) {
749
749
  if (!this.active || this.duration.end < 0) {
750
- this.active = this.duration.end > -1;
750
+ this._active = this.endOperations.length > 0;
751
751
  return _EndableAction.prototype.start.call(this, initOperationData);
752
752
  }
753
753
 
@@ -755,10 +755,17 @@ var TimelineAction = /*#__PURE__*/function (_EndableAction) {
755
755
  };
756
756
 
757
757
  _proto.end = function end(initOperationData) {
758
- this.active = false;
758
+ this._active = false;
759
759
  return _EndableAction.prototype.end.call(this, initOperationData);
760
760
  };
761
761
 
762
+ _createClass(TimelineAction, [{
763
+ key: "active",
764
+ get: function get() {
765
+ return this._active;
766
+ }
767
+ }]);
768
+
762
769
  return TimelineAction;
763
770
  }(EndableAction);
764
771
 
@@ -1136,6 +1143,10 @@ function getPropertyChainValue(propertyChain, sourceObject) {
1136
1143
  var currentInstance = sourceObject;
1137
1144
  var suffix = null;
1138
1145
  propertyChain.forEach(function (prop, index) {
1146
+ if (!currentInstance) {
1147
+ throw new Error("Property chain '" + propertyChain.join('.') + "' cannot be resolved.");
1148
+ }
1149
+
1139
1150
  if (index === propertyChain.length - 1) {
1140
1151
  var parts = prop.split('+');
1141
1152
 
@@ -1417,8 +1428,6 @@ TimelineEventNames.BEFORE_REQUEST_TIMELINE_URI = 'before-request-timeline-uri';
1417
1428
  TimelineEventNames.REQUEST_ENGINE_ROOT = 'request-engine-root';
1418
1429
  TimelineEventNames.REQUEST_CURRENT_TIMELINE_POSITION = 'request-current-timeline-position';
1419
1430
  TimelineEventNames.REQUEST_TIMELINE_CLEANUP = 'request-timeline-cleanup';
1420
- TimelineEventNames.EXECUTE_TIMELINEACTION = 'execute-timelineaction';
1421
- TimelineEventNames.RESIZE_TIMELINEACTION = 'resize-timelineaction';
1422
1431
  TimelineEventNames.REQUEST_LABEL_COLLECTION = 'request-label-collection';
1423
1432
  TimelineEventNames.REQUEST_LABEL_COLLECTIONS = 'request-label-collections';
1424
1433
  TimelineEventNames.REQUEST_CURRENT_LANGUAGE = 'request-current-language';
@@ -1514,6 +1523,24 @@ var extendController$1 = function extendController(operationData) {
1514
1523
  return operationData;
1515
1524
  };
1516
1525
 
1526
+ /**
1527
+ * This operation retrieves the values for the specified attribute names from the given selected element.
1528
+ */
1529
+ var getAttributesFromElement$1 = function getAttributesFromElement(operationData) {
1530
+ var selectedElement = operationData.selectedElement,
1531
+ attributeNames = operationData.attributeNames;
1532
+ operationData.attributeValues = attributeNames.reduce(function (acc, attrName) {
1533
+ if (attrName !== 'value') {
1534
+ acc[attrName] = selectedElement == null ? void 0 : selectedElement.attr(attrName);
1535
+ } else {
1536
+ acc[attrName] = selectedElement == null ? void 0 : selectedElement.val();
1537
+ }
1538
+
1539
+ return acc;
1540
+ }, {});
1541
+ return operationData;
1542
+ };
1543
+
1517
1544
  /**
1518
1545
  * This operation retrieves the controller instance with the specified name that is assigned to the given selected element.
1519
1546
  *
@@ -1891,20 +1918,18 @@ var loadJSON$1 = /*#__PURE__*/function () {
1891
1918
  }();
1892
1919
 
1893
1920
  /**
1894
- * This operation logs the current operation data and context to the console.
1921
+ * This operation logs the current operation data, global data and context to the console.
1895
1922
  *
1896
1923
  * @param operationData
1897
1924
  * @returns
1898
1925
  */
1899
1926
 
1900
1927
  var log$1 = function log(operationData) {
1928
+ var globalData = getGlobals();
1901
1929
  console.group('Operation info');
1902
- console.dir({
1903
- context: deepCopy(this)
1904
- });
1905
- console.dir({
1906
- operationData: deepCopy(operationData)
1907
- });
1930
+ console.log('context', this);
1931
+ console.log('operationData', operationData);
1932
+ console.log('globalData', globalData);
1908
1933
  console.groupEnd();
1909
1934
  return operationData;
1910
1935
  };
@@ -2156,6 +2181,7 @@ function findElementBySelector(root, selector) {
2156
2181
 
2157
2182
 
2158
2183
  var selectElement$1 = function selectElement(operationData) {
2184
+ operationData.selector = resolveExternalPropertyChain(operationData, this, operationData.selector);
2159
2185
  var selector = operationData.selector,
2160
2186
  _operationData$useSel = operationData.useSelectedElementAsRoot,
2161
2187
  useSelectedElementAsRoot = _operationData$useSel === void 0 ? false : _operationData$useSel;
@@ -2178,6 +2204,59 @@ var selectElement$1 = function selectElement(operationData) {
2178
2204
  return operationData;
2179
2205
  };
2180
2206
 
2207
+ /**
2208
+ * This operation assigns the specified properties to the specified data targets.
2209
+ *
2210
+ * @example The various ways of assigning data
2211
+ * ```ts
2212
+ * setData({
2213
+ * 'operationdata.foo': 'context.currentItem', // context.currentItem will be assigned to operationdata.foo
2214
+ * 'globaldata.foo': 'context.currentItem', // context.currentItem will be assigned to globaldata.foo
2215
+ * 'context.newIndex': 100, // The constant 100 will be assigned to context.newIndex
2216
+ * })
2217
+ * ```
2218
+ *
2219
+ * @param operationData
2220
+ * @returns
2221
+ */
2222
+
2223
+ var setData$1 = function setData(operationData) {
2224
+ var properties = operationData.properties;
2225
+ delete operationData.properties;
2226
+ resolveTargets(properties, operationData, this);
2227
+ return operationData;
2228
+ };
2229
+
2230
+ function resolveTargets(data, operationData, context) {
2231
+ var propertyChains = Object.keys(data);
2232
+ return propertyChains.forEach(function (item) {
2233
+ var _path$shift$toLowerCa, _path$shift, _path$pop;
2234
+
2235
+ var path = item.split('.');
2236
+ var rootTarget = (_path$shift$toLowerCa = (_path$shift = path.shift()) == null ? void 0 : _path$shift.toLowerCase()) != null ? _path$shift$toLowerCa : '';
2237
+
2238
+ if (!isDataTarget(rootTarget)) {
2239
+ throw new Error("Unrecognized target: " + rootTarget + ", known targets are: " + knownTargets.join(', '));
2240
+ }
2241
+
2242
+ var property = (_path$pop = path.pop()) != null ? _path$pop : '';
2243
+ var propertyValue = resolveExternalPropertyChain(operationData, context, data[item]);
2244
+ var targets = {
2245
+ context: context,
2246
+ operationdata: operationData,
2247
+ globaldata: getGlobals()
2248
+ };
2249
+ var propertyTarget = getPropertyChainValue(path, targets[rootTarget]);
2250
+ propertyTarget[property] = propertyValue;
2251
+ });
2252
+ }
2253
+
2254
+ var knownTargets = ['context', 'operationdata', 'globaldata'];
2255
+
2256
+ function isDataTarget(value) {
2257
+ return knownTargets.includes(value);
2258
+ }
2259
+
2181
2260
  /**
2182
2261
  * This operation sets the specified set of attributes on the given selected element.
2183
2262
  *
@@ -2506,6 +2585,7 @@ var ops = {
2506
2585
  endLoop: endLoop$1,
2507
2586
  endWhen: endWhen$1,
2508
2587
  extendController: extendController$1,
2588
+ getAttributesFromElement: getAttributesFromElement$1,
2509
2589
  getControllerFromElement: getControllerFromElement$1,
2510
2590
  getControllerInstance: getControllerInstance$1,
2511
2591
  getElementDimensions: getElementDimensions$1,
@@ -2524,6 +2604,7 @@ var ops = {
2524
2604
  requestAction: requestAction$1,
2525
2605
  resizeAction: resizeAction$1,
2526
2606
  selectElement: selectElement$1,
2607
+ setData: setData$1,
2527
2608
  setElementAttributes: setElementAttributes$1,
2528
2609
  setElementContent: setElementContent$1,
2529
2610
  setGlobalData: setGlobalData$1,
@@ -3051,6 +3132,53 @@ var OperationEditor = /*#__PURE__*/function () {
3051
3132
  return OperationEditor;
3052
3133
  }();
3053
3134
 
3135
+ var LabelEditor = /*#__PURE__*/function () {
3136
+ function LabelEditor(factory, languageLabel) {
3137
+ this.factory = void 0;
3138
+ this.languageLabel = void 0;
3139
+ this.factory = factory;
3140
+ this.languageLabel = languageLabel;
3141
+ }
3142
+
3143
+ var _proto = LabelEditor.prototype;
3144
+
3145
+ _proto._internalGetLabel = function _internalGetLabel(languageCode) {
3146
+ return this.languageLabel.labels.find(function (x) {
3147
+ return x.languageCode === languageCode;
3148
+ });
3149
+ };
3150
+
3151
+ _proto.setLabel = function setLabel(languageCode, translation) {
3152
+ var label = this._internalGetLabel(languageCode);
3153
+
3154
+ if (label) ; else {
3155
+ throw new Error("No label found for language code '" + languageCode + "'");
3156
+ }
3157
+
3158
+ return this;
3159
+ };
3160
+
3161
+ _proto.removeLabel = function removeLabel(languageCode) {
3162
+ var idx = this.languageLabel.labels.findIndex(function (x) {
3163
+ return x.languageCode === languageCode;
3164
+ });
3165
+
3166
+ if (idx > -1) {
3167
+ this.languageLabel.labels.splice(idx, 1);
3168
+ } else {
3169
+ throw new Error("No label found for language code '" + languageCode + "'");
3170
+ }
3171
+
3172
+ return this;
3173
+ };
3174
+
3175
+ _proto.end = function end() {
3176
+ return this.factory;
3177
+ };
3178
+
3179
+ return LabelEditor;
3180
+ }();
3181
+
3054
3182
  // https://gist.github.com/jakearchibald/cb03f15670817001b1157e62a076fe95
3055
3183
  function animationInterval(ms, signal, callback) {
3056
3184
  var _document$timeline$cu, _document, _document$timeline;
@@ -3523,10 +3651,7 @@ var ConfigurationFactory = /*#__PURE__*/function () {
3523
3651
 
3524
3652
  if (callBack) {
3525
3653
  var newConfig = callBack.call(this, copy);
3526
-
3527
- if (newConfig) {
3528
- this.configuration = newConfig;
3529
- }
3654
+ this.configuration = deepCopy(newConfig);
3530
3655
  }
3531
3656
 
3532
3657
  return copy;
@@ -3680,6 +3805,20 @@ var ConfigurationFactory = /*#__PURE__*/function () {
3680
3805
  return translation;
3681
3806
  };
3682
3807
 
3808
+ _proto.editLabel = function editLabel(id) {
3809
+ var _this$configuration$l;
3810
+
3811
+ var label = (_this$configuration$l = this.configuration.labels) == null ? void 0 : _this$configuration$l.find(function (x) {
3812
+ return x.id === id;
3813
+ });
3814
+
3815
+ if (label) {
3816
+ return new LabelEditor(this, label);
3817
+ } else {
3818
+ throw new Error("Language label with id '" + id + "' not found");
3819
+ }
3820
+ };
3821
+
3683
3822
  _proto.addLabel = function addLabel(id, code, translation) {
3684
3823
  var labels = this._initializeCollection(this.configuration, 'labels');
3685
3824
 
@@ -3691,6 +3830,17 @@ var ConfigurationFactory = /*#__PURE__*/function () {
3691
3830
  return this;
3692
3831
  };
3693
3832
 
3833
+ _proto.addLabels = function addLabels(id, translations) {
3834
+ var _this = this;
3835
+
3836
+ Object.entries(translations).forEach(function (_ref2) {
3837
+ var code = _ref2[0],
3838
+ translation = _ref2[1];
3839
+ return _this.addLabel(id, code, translation);
3840
+ });
3841
+ return this;
3842
+ };
3843
+
3694
3844
  _proto.removeLabel = function removeLabel(id) {
3695
3845
  var idx = this.configuration.labels.findIndex(function (x) {
3696
3846
  return x.id === id;
@@ -3845,7 +3995,7 @@ var EventListenerController = /*#__PURE__*/function () {
3845
3995
  var actionOperationData = this.operationData.actionOperationData ? deepCopy(this.operationData.actionOperationData) : {};
3846
3996
 
3847
3997
  if (event.target) {
3848
- actionOperationData.targetValue = event.target.value;
3998
+ actionOperationData.eventTarget = event.target;
3849
3999
  }
3850
4000
 
3851
4001
  this._executeAction(this.actionInstanceInfos, actionOperationData, 0);
@@ -3951,7 +4101,11 @@ var LabelController = /*#__PURE__*/function () {
3951
4101
  var _this2 = this;
3952
4102
 
3953
4103
  eventbus.broadcast(TimelineEventNames.REQUEST_LABEL_COLLECTION, [labelId, function (labelCollection) {
3954
- _this2._createTextDataLookup(labelCollection);
4104
+ if (labelCollection) {
4105
+ _this2._createTextDataLookup(labelCollection);
4106
+ } else {
4107
+ throw new Error("Label id '" + labelId + "' does not exist!");
4108
+ }
3955
4109
  }]);
3956
4110
  };
3957
4111
 
@@ -3959,7 +4113,17 @@ var LabelController = /*#__PURE__*/function () {
3959
4113
  if (this.currentLanguage) {
3960
4114
  var _this$operationData;
3961
4115
 
3962
- (_this$operationData = this.operationData) == null ? void 0 : _this$operationData.selectedElement.html(this.labelData[this.currentLanguage]);
4116
+ var text = this.labelData[this.currentLanguage];
4117
+
4118
+ if (!((_this$operationData = this.operationData) != null && _this$operationData.attributeName)) {
4119
+ var _this$operationData2;
4120
+
4121
+ (_this$operationData2 = this.operationData) == null ? void 0 : _this$operationData2.selectedElement.html(text);
4122
+ } else {
4123
+ var _this$operationData3, _this$operationData4;
4124
+
4125
+ (_this$operationData3 = this.operationData) == null ? void 0 : _this$operationData3.selectedElement.attr((_this$operationData4 = this.operationData) == null ? void 0 : _this$operationData4.attributeName, text);
4126
+ }
3963
4127
  }
3964
4128
  };
3965
4129
 
@@ -4947,6 +5111,23 @@ function extendController() {
4947
5111
  };
4948
5112
  }
4949
5113
 
5114
+ function getAttributesFromElement() {
5115
+ return {
5116
+ description: 'Retrieves the values for the specified attribute names from the given selected element.',
5117
+ dependentProperties: ['selectedElement'],
5118
+ properties: {
5119
+ attributeNames: {
5120
+ type: 'ParameterType:array',
5121
+ itemType: 'ParameterType:string',
5122
+ required: true
5123
+ }
5124
+ },
5125
+ outputProperties: {
5126
+ attributeValues: 'ParameterType:object'
5127
+ }
5128
+ };
5129
+ }
5130
+
4950
5131
  function getControllerFromElement() {
4951
5132
  return {
4952
5133
  description: 'Retrieves the specified controller from the current element',
@@ -5183,6 +5364,18 @@ function selectElement() {
5183
5364
  };
5184
5365
  }
5185
5366
 
5367
+ function setData() {
5368
+ return {
5369
+ description: 'Copies the specified values to the specified targets',
5370
+ properties: {
5371
+ properties: {
5372
+ type: 'ParameterType:object',
5373
+ required: true
5374
+ }
5375
+ }
5376
+ };
5377
+ }
5378
+
5186
5379
  function setElementAttributes() {
5187
5380
  return {
5188
5381
  description: 'Sets the given attributes on the selected element',
@@ -5336,6 +5529,7 @@ var operationMetadata = {
5336
5529
  endLoop: endLoop,
5337
5530
  endWhen: endWhen,
5338
5531
  extendController: extendController,
5532
+ getAttributesFromElement: getAttributesFromElement,
5339
5533
  getControllerFromElement: getControllerFromElement,
5340
5534
  getControllerInstance: getControllerInstance,
5341
5535
  getElementDimensions: getElementDimensions,
@@ -5354,6 +5548,7 @@ var operationMetadata = {
5354
5548
  requestAction: requestAction,
5355
5549
  resizeAction: resizeAction,
5356
5550
  selectElement: selectElement,
5551
+ setData: setData,
5357
5552
  setElementAttributes: setElementAttributes,
5358
5553
  setElementContent: setElementContent,
5359
5554
  setGlobalData: setGlobalData,
@@ -5866,10 +6061,6 @@ var EligiusEngine = /*#__PURE__*/function () {
5866
6061
 
5867
6062
  this._addEventListener(TimelineEventNames.REQUEST_TIMELINE_CLEANUP, this._handleTimelineComplete.bind(this));
5868
6063
 
5869
- this._addEventListener(TimelineEventNames.EXECUTE_TIMELINEACTION, this._handleExecuteTimelineAction.bind(this));
5870
-
5871
- this._addEventListener(TimelineEventNames.RESIZE_TIMELINEACTION, this._resizeTimelineAction.bind(this));
5872
-
5873
6064
  this._addEventListener(TimelineEventNames.REQUEST_CURRENT_TIMELINE, this._requestCurrentTimeline.bind(this));
5874
6065
 
5875
6066
  this._addEventListener(TimelineEventNames.PLAY_TOGGLE_REQUEST, this._toggleplay.bind(this));
@@ -6016,11 +6207,35 @@ var EligiusEngine = /*#__PURE__*/function () {
6016
6207
  // actions ends need to be in reversed order, otherwise, for example,
6017
6208
  // elements that were created before dependent actions will already have been
6018
6209
  // removed in the end phase.
6019
- var reversed = [].concat(timelineInfo.timelineActions).reverse();
6020
- reversed.forEach(_this._addTimelineActionEnd.bind(_this, timelineInfo.uri));
6210
+ timelineInfo.timelineActions.forEach(_this._addTimelineActionEnd.bind(_this, timelineInfo.uri));
6211
+ });
6212
+ EligiusEngine.sortTimelines(Object.values(this._timeLineActionsLookup));
6213
+ };
6214
+
6215
+ EligiusEngine.sortTimelines = function sortTimelines(timelines) {
6216
+ timelines.forEach(function (timelineActions) {
6217
+ Object.keys(timelineActions).forEach(function (key) {
6218
+ return timelineActions[key] = EligiusEngine.sortActionsPerPosition(timelineActions[key]);
6219
+ });
6021
6220
  });
6022
6221
  };
6023
6222
 
6223
+ EligiusEngine.sortActionsPerPosition = function sortActionsPerPosition(actions) {
6224
+ var _actions$reduce = actions.reduce(function (acc, item) {
6225
+ if (item.isStart) {
6226
+ acc[0].push(item);
6227
+ } else {
6228
+ acc[1].push(item);
6229
+ }
6230
+
6231
+ return acc;
6232
+ }, [[], []]),
6233
+ startMethods = _actions$reduce[0],
6234
+ endMethods = _actions$reduce[1];
6235
+
6236
+ return [].concat(endMethods.sort(sortActionMethodsHighestStartPositionFirst), startMethods);
6237
+ };
6238
+
6024
6239
  _proto._addTimelineActionStart = function _addTimelineActionStart(uri, timeLineAction) {
6025
6240
  var _timeLineAction$id;
6026
6241
 
@@ -6032,9 +6247,9 @@ var EligiusEngine = /*#__PURE__*/function () {
6032
6247
 
6033
6248
  if ((_timeLineAction$id = timeLineAction.id) != null && _timeLineAction$id.length) {
6034
6249
  startMethod.id = timeLineAction.id;
6035
- startMethod.isStart = true;
6036
6250
  }
6037
6251
 
6252
+ startMethod.isStart = true;
6038
6253
  timelineStartPositions.push(startMethod);
6039
6254
  };
6040
6255
 
@@ -6046,14 +6261,18 @@ var EligiusEngine = /*#__PURE__*/function () {
6046
6261
  }
6047
6262
 
6048
6263
  if (isFinite(end)) {
6264
+ var _timeLineAction$id2;
6265
+
6049
6266
  var timelineEndPositions = this._initializeTimelinePosition(this._timeLineActionsLookup[uri], end);
6050
6267
 
6051
6268
  var endMethod = timeLineAction.end.bind(timeLineAction);
6052
6269
 
6053
- if (!timeLineAction.id) {
6270
+ if ((_timeLineAction$id2 = timeLineAction.id) != null && _timeLineAction$id2.length) {
6054
6271
  endMethod.id = timeLineAction.id;
6272
+ endMethod.startPosition = timeLineAction.duration.start;
6055
6273
  }
6056
6274
 
6275
+ endMethod.isStart = false;
6057
6276
  timelineEndPositions.push(endMethod);
6058
6277
  }
6059
6278
  };
@@ -6253,11 +6472,11 @@ var EligiusEngine = /*#__PURE__*/function () {
6253
6472
  var actions = allActions.filter(function (action) {
6254
6473
  return action.active;
6255
6474
  });
6256
- return actions.sort(sortActions);
6475
+ return actions.sort(sortActionsHighestStartPositionFirst);
6257
6476
  };
6258
6477
 
6259
6478
  _proto._executeRelevantActions = function _executeRelevantActions(filter, executionType) {
6260
- var timelineActions = this._getRelevantTimelineActions();
6479
+ var timelineActions = this._getTimelineActionsForCurrentTimeline();
6261
6480
 
6262
6481
  var currentActions = filter.apply(this, [timelineActions]);
6263
6482
  return this._executeActions(currentActions, executionType, 0);
@@ -6273,27 +6492,7 @@ var EligiusEngine = /*#__PURE__*/function () {
6273
6492
  this._cleanUpTimeline();
6274
6493
  };
6275
6494
 
6276
- _proto._handleExecuteTimelineAction = function _handleExecuteTimelineAction(uri, index, start) {
6277
- var actions = this._getTimelineActionsForUri(uri);
6278
-
6279
- var action = actions == null ? void 0 : actions[index];
6280
-
6281
- if (action) {
6282
- if (start) {
6283
- action.start();
6284
- } else {
6285
- action.end();
6286
- }
6287
- }
6288
- };
6289
-
6290
- _proto._resizeTimelineAction = function
6291
- /*uri: string, index: number*/
6292
- _resizeTimelineAction() {
6293
- console.error('no resizing implemented');
6294
- };
6295
-
6296
- _proto._getRelevantTimelineActions = function _getRelevantTimelineActions() {
6495
+ _proto._getTimelineActionsForCurrentTimeline = function _getTimelineActionsForCurrentTimeline() {
6297
6496
  return this._getTimelineActionsForUri(this._currentTimelineUri);
6298
6497
  };
6299
6498
 
@@ -6329,19 +6528,19 @@ var EligiusEngine = /*#__PURE__*/function () {
6329
6528
  if (actions) {
6330
6529
  var executions = actions[position];
6331
6530
  executions == null ? void 0 : executions.forEach(function (exec) {
6332
- exec();
6531
+ return exec();
6333
6532
  });
6334
6533
  }
6335
6534
  };
6336
6535
 
6337
6536
  _proto._executeSeekActions = /*#__PURE__*/function () {
6338
- var _executeSeekActions2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(pos) {
6537
+ var _executeSeekActions2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(position) {
6339
6538
  var timelineActions, currentActions, newActions, currentActionsEnd;
6340
6539
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
6341
6540
  while (1) {
6342
6541
  switch (_context8.prev = _context8.next) {
6343
6542
  case 0:
6344
- timelineActions = this._getRelevantTimelineActions();
6543
+ timelineActions = this._getTimelineActionsForCurrentTimeline();
6345
6544
 
6346
6545
  if (timelineActions) {
6347
6546
  _context8.next = 3;
@@ -6351,8 +6550,10 @@ var EligiusEngine = /*#__PURE__*/function () {
6351
6550
  return _context8.abrupt("return", Promise.resolve());
6352
6551
 
6353
6552
  case 3:
6354
- currentActions = this._getActiveActions(timelineActions);
6355
- newActions = this._getActionsForPosition(pos, timelineActions);
6553
+ currentActions = this._getActiveActions(timelineActions).filter(function (action) {
6554
+ return !(action.duration.start <= position && action.duration.end >= position);
6555
+ });
6556
+ newActions = this._getActionsForPosition(position, timelineActions);
6356
6557
  currentActionsEnd = this._executeActions(currentActions, 'end', 0);
6357
6558
  _context8.next = 8;
6358
6559
  return currentActionsEnd;
@@ -6378,7 +6579,7 @@ var EligiusEngine = /*#__PURE__*/function () {
6378
6579
  return EligiusEngine;
6379
6580
  }();
6380
6581
 
6381
- var sortActions = function sortActions(a, b) {
6582
+ var sortActionsHighestStartPositionFirst = function sortActionsHighestStartPositionFirst(a, b) {
6382
6583
  if (b.duration.start < a.duration.start) {
6383
6584
  return -1;
6384
6585
  } else if (b.duration.start > a.duration.start) {
@@ -6388,6 +6589,20 @@ var sortActions = function sortActions(a, b) {
6388
6589
  }
6389
6590
  };
6390
6591
 
6592
+ var sortActionMethodsHighestStartPositionFirst = function sortActionMethodsHighestStartPositionFirst(a, b) {
6593
+ if (b.startPosition === undefined || a.startPosition === undefined) {
6594
+ return 0;
6595
+ }
6596
+
6597
+ if (b.startPosition < a.startPosition) {
6598
+ return -1;
6599
+ } else if (b.startPosition > a.startPosition) {
6600
+ return 1;
6601
+ } else {
6602
+ return 0;
6603
+ }
6604
+ };
6605
+
6391
6606
  /**
6392
6607
  * The `IEventbusListener` first registers a number of actions that are then
6393
6608
  * executed when the specified event is broadcast.
@@ -7029,6 +7244,7 @@ exports.endLoop = endLoop$1;
7029
7244
  exports.endWhen = endWhen$1;
7030
7245
  exports.extendController = extendController$1;
7031
7246
  exports.generateImporterSourceCode = generateImporterSourceCode;
7247
+ exports.getAttributesFromElement = getAttributesFromElement$1;
7032
7248
  exports.getControllerFromElement = getControllerFromElement$1;
7033
7249
  exports.getControllerInstance = getControllerInstance$1;
7034
7250
  exports.getElementDimensions = getElementDimensions$1;
@@ -7048,6 +7264,7 @@ exports.reparentElement = reparentElement$1;
7048
7264
  exports.requestAction = requestAction$1;
7049
7265
  exports.resizeAction = resizeAction$1;
7050
7266
  exports.selectElement = selectElement$1;
7267
+ exports.setData = setData$1;
7051
7268
  exports.setElementAttributes = setElementAttributes$1;
7052
7269
  exports.setElementContent = setElementContent$1;
7053
7270
  exports.setGlobalData = setGlobalData$1;