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.
@@ -726,7 +726,7 @@ var TimelineAction = /*#__PURE__*/function (_EndableAction) {
726
726
 
727
727
  _this = _EndableAction.call(this, name, startOperations, endOperations, eventBus) || this;
728
728
  _this.duration = void 0;
729
- _this.active = false;
729
+ _this._active = false;
730
730
  _this.duration = duration;
731
731
  return _this;
732
732
  }
@@ -735,7 +735,7 @@ var TimelineAction = /*#__PURE__*/function (_EndableAction) {
735
735
 
736
736
  _proto.start = function start(initOperationData) {
737
737
  if (!this.active || this.duration.end < 0) {
738
- this.active = this.duration.end > -1;
738
+ this._active = this.endOperations.length > 0;
739
739
  return _EndableAction.prototype.start.call(this, initOperationData);
740
740
  }
741
741
 
@@ -743,10 +743,17 @@ var TimelineAction = /*#__PURE__*/function (_EndableAction) {
743
743
  };
744
744
 
745
745
  _proto.end = function end(initOperationData) {
746
- this.active = false;
746
+ this._active = false;
747
747
  return _EndableAction.prototype.end.call(this, initOperationData);
748
748
  };
749
749
 
750
+ _createClass(TimelineAction, [{
751
+ key: "active",
752
+ get: function get() {
753
+ return this._active;
754
+ }
755
+ }]);
756
+
750
757
  return TimelineAction;
751
758
  }(EndableAction);
752
759
 
@@ -1124,6 +1131,10 @@ function getPropertyChainValue(propertyChain, sourceObject) {
1124
1131
  var currentInstance = sourceObject;
1125
1132
  var suffix = null;
1126
1133
  propertyChain.forEach(function (prop, index) {
1134
+ if (!currentInstance) {
1135
+ throw new Error("Property chain '" + propertyChain.join('.') + "' cannot be resolved.");
1136
+ }
1137
+
1127
1138
  if (index === propertyChain.length - 1) {
1128
1139
  var parts = prop.split('+');
1129
1140
 
@@ -1405,8 +1416,6 @@ TimelineEventNames.BEFORE_REQUEST_TIMELINE_URI = 'before-request-timeline-uri';
1405
1416
  TimelineEventNames.REQUEST_ENGINE_ROOT = 'request-engine-root';
1406
1417
  TimelineEventNames.REQUEST_CURRENT_TIMELINE_POSITION = 'request-current-timeline-position';
1407
1418
  TimelineEventNames.REQUEST_TIMELINE_CLEANUP = 'request-timeline-cleanup';
1408
- TimelineEventNames.EXECUTE_TIMELINEACTION = 'execute-timelineaction';
1409
- TimelineEventNames.RESIZE_TIMELINEACTION = 'resize-timelineaction';
1410
1419
  TimelineEventNames.REQUEST_LABEL_COLLECTION = 'request-label-collection';
1411
1420
  TimelineEventNames.REQUEST_LABEL_COLLECTIONS = 'request-label-collections';
1412
1421
  TimelineEventNames.REQUEST_CURRENT_LANGUAGE = 'request-current-language';
@@ -1502,6 +1511,24 @@ var extendController$1 = function extendController(operationData) {
1502
1511
  return operationData;
1503
1512
  };
1504
1513
 
1514
+ /**
1515
+ * This operation retrieves the values for the specified attribute names from the given selected element.
1516
+ */
1517
+ var getAttributesFromElement$1 = function getAttributesFromElement(operationData) {
1518
+ var selectedElement = operationData.selectedElement,
1519
+ attributeNames = operationData.attributeNames;
1520
+ operationData.attributeValues = attributeNames.reduce(function (acc, attrName) {
1521
+ if (attrName !== 'value') {
1522
+ acc[attrName] = selectedElement == null ? void 0 : selectedElement.attr(attrName);
1523
+ } else {
1524
+ acc[attrName] = selectedElement == null ? void 0 : selectedElement.val();
1525
+ }
1526
+
1527
+ return acc;
1528
+ }, {});
1529
+ return operationData;
1530
+ };
1531
+
1505
1532
  /**
1506
1533
  * This operation retrieves the controller instance with the specified name that is assigned to the given selected element.
1507
1534
  *
@@ -1879,20 +1906,18 @@ var loadJSON$1 = /*#__PURE__*/function () {
1879
1906
  }();
1880
1907
 
1881
1908
  /**
1882
- * This operation logs the current operation data and context to the console.
1909
+ * This operation logs the current operation data, global data and context to the console.
1883
1910
  *
1884
1911
  * @param operationData
1885
1912
  * @returns
1886
1913
  */
1887
1914
 
1888
1915
  var log$1 = function log(operationData) {
1916
+ var globalData = getGlobals();
1889
1917
  console.group('Operation info');
1890
- console.dir({
1891
- context: deepCopy(this)
1892
- });
1893
- console.dir({
1894
- operationData: deepCopy(operationData)
1895
- });
1918
+ console.log('context', this);
1919
+ console.log('operationData', operationData);
1920
+ console.log('globalData', globalData);
1896
1921
  console.groupEnd();
1897
1922
  return operationData;
1898
1923
  };
@@ -2144,6 +2169,7 @@ function findElementBySelector(root, selector) {
2144
2169
 
2145
2170
 
2146
2171
  var selectElement$1 = function selectElement(operationData) {
2172
+ operationData.selector = resolveExternalPropertyChain(operationData, this, operationData.selector);
2147
2173
  var selector = operationData.selector,
2148
2174
  _operationData$useSel = operationData.useSelectedElementAsRoot,
2149
2175
  useSelectedElementAsRoot = _operationData$useSel === void 0 ? false : _operationData$useSel;
@@ -2166,6 +2192,59 @@ var selectElement$1 = function selectElement(operationData) {
2166
2192
  return operationData;
2167
2193
  };
2168
2194
 
2195
+ /**
2196
+ * This operation assigns the specified properties to the specified data targets.
2197
+ *
2198
+ * @example The various ways of assigning data
2199
+ * ```ts
2200
+ * setData({
2201
+ * 'operationdata.foo': 'context.currentItem', // context.currentItem will be assigned to operationdata.foo
2202
+ * 'globaldata.foo': 'context.currentItem', // context.currentItem will be assigned to globaldata.foo
2203
+ * 'context.newIndex': 100, // The constant 100 will be assigned to context.newIndex
2204
+ * })
2205
+ * ```
2206
+ *
2207
+ * @param operationData
2208
+ * @returns
2209
+ */
2210
+
2211
+ var setData$1 = function setData(operationData) {
2212
+ var properties = operationData.properties;
2213
+ delete operationData.properties;
2214
+ resolveTargets(properties, operationData, this);
2215
+ return operationData;
2216
+ };
2217
+
2218
+ function resolveTargets(data, operationData, context) {
2219
+ var propertyChains = Object.keys(data);
2220
+ return propertyChains.forEach(function (item) {
2221
+ var _path$shift$toLowerCa, _path$shift, _path$pop;
2222
+
2223
+ var path = item.split('.');
2224
+ var rootTarget = (_path$shift$toLowerCa = (_path$shift = path.shift()) == null ? void 0 : _path$shift.toLowerCase()) != null ? _path$shift$toLowerCa : '';
2225
+
2226
+ if (!isDataTarget(rootTarget)) {
2227
+ throw new Error("Unrecognized target: " + rootTarget + ", known targets are: " + knownTargets.join(', '));
2228
+ }
2229
+
2230
+ var property = (_path$pop = path.pop()) != null ? _path$pop : '';
2231
+ var propertyValue = resolveExternalPropertyChain(operationData, context, data[item]);
2232
+ var targets = {
2233
+ context: context,
2234
+ operationdata: operationData,
2235
+ globaldata: getGlobals()
2236
+ };
2237
+ var propertyTarget = getPropertyChainValue(path, targets[rootTarget]);
2238
+ propertyTarget[property] = propertyValue;
2239
+ });
2240
+ }
2241
+
2242
+ var knownTargets = ['context', 'operationdata', 'globaldata'];
2243
+
2244
+ function isDataTarget(value) {
2245
+ return knownTargets.includes(value);
2246
+ }
2247
+
2169
2248
  /**
2170
2249
  * This operation sets the specified set of attributes on the given selected element.
2171
2250
  *
@@ -2494,6 +2573,7 @@ var ops = {
2494
2573
  endLoop: endLoop$1,
2495
2574
  endWhen: endWhen$1,
2496
2575
  extendController: extendController$1,
2576
+ getAttributesFromElement: getAttributesFromElement$1,
2497
2577
  getControllerFromElement: getControllerFromElement$1,
2498
2578
  getControllerInstance: getControllerInstance$1,
2499
2579
  getElementDimensions: getElementDimensions$1,
@@ -2512,6 +2592,7 @@ var ops = {
2512
2592
  requestAction: requestAction$1,
2513
2593
  resizeAction: resizeAction$1,
2514
2594
  selectElement: selectElement$1,
2595
+ setData: setData$1,
2515
2596
  setElementAttributes: setElementAttributes$1,
2516
2597
  setElementContent: setElementContent$1,
2517
2598
  setGlobalData: setGlobalData$1,
@@ -3039,6 +3120,53 @@ var OperationEditor = /*#__PURE__*/function () {
3039
3120
  return OperationEditor;
3040
3121
  }();
3041
3122
 
3123
+ var LabelEditor = /*#__PURE__*/function () {
3124
+ function LabelEditor(factory, languageLabel) {
3125
+ this.factory = void 0;
3126
+ this.languageLabel = void 0;
3127
+ this.factory = factory;
3128
+ this.languageLabel = languageLabel;
3129
+ }
3130
+
3131
+ var _proto = LabelEditor.prototype;
3132
+
3133
+ _proto._internalGetLabel = function _internalGetLabel(languageCode) {
3134
+ return this.languageLabel.labels.find(function (x) {
3135
+ return x.languageCode === languageCode;
3136
+ });
3137
+ };
3138
+
3139
+ _proto.setLabel = function setLabel(languageCode, translation) {
3140
+ var label = this._internalGetLabel(languageCode);
3141
+
3142
+ if (label) ; else {
3143
+ throw new Error("No label found for language code '" + languageCode + "'");
3144
+ }
3145
+
3146
+ return this;
3147
+ };
3148
+
3149
+ _proto.removeLabel = function removeLabel(languageCode) {
3150
+ var idx = this.languageLabel.labels.findIndex(function (x) {
3151
+ return x.languageCode === languageCode;
3152
+ });
3153
+
3154
+ if (idx > -1) {
3155
+ this.languageLabel.labels.splice(idx, 1);
3156
+ } else {
3157
+ throw new Error("No label found for language code '" + languageCode + "'");
3158
+ }
3159
+
3160
+ return this;
3161
+ };
3162
+
3163
+ _proto.end = function end() {
3164
+ return this.factory;
3165
+ };
3166
+
3167
+ return LabelEditor;
3168
+ }();
3169
+
3042
3170
  // https://gist.github.com/jakearchibald/cb03f15670817001b1157e62a076fe95
3043
3171
  function animationInterval(ms, signal, callback) {
3044
3172
  var _document$timeline$cu, _document, _document$timeline;
@@ -3511,10 +3639,7 @@ var ConfigurationFactory = /*#__PURE__*/function () {
3511
3639
 
3512
3640
  if (callBack) {
3513
3641
  var newConfig = callBack.call(this, copy);
3514
-
3515
- if (newConfig) {
3516
- this.configuration = newConfig;
3517
- }
3642
+ this.configuration = deepCopy(newConfig);
3518
3643
  }
3519
3644
 
3520
3645
  return copy;
@@ -3668,6 +3793,20 @@ var ConfigurationFactory = /*#__PURE__*/function () {
3668
3793
  return translation;
3669
3794
  };
3670
3795
 
3796
+ _proto.editLabel = function editLabel(id) {
3797
+ var _this$configuration$l;
3798
+
3799
+ var label = (_this$configuration$l = this.configuration.labels) == null ? void 0 : _this$configuration$l.find(function (x) {
3800
+ return x.id === id;
3801
+ });
3802
+
3803
+ if (label) {
3804
+ return new LabelEditor(this, label);
3805
+ } else {
3806
+ throw new Error("Language label with id '" + id + "' not found");
3807
+ }
3808
+ };
3809
+
3671
3810
  _proto.addLabel = function addLabel(id, code, translation) {
3672
3811
  var labels = this._initializeCollection(this.configuration, 'labels');
3673
3812
 
@@ -3679,6 +3818,17 @@ var ConfigurationFactory = /*#__PURE__*/function () {
3679
3818
  return this;
3680
3819
  };
3681
3820
 
3821
+ _proto.addLabels = function addLabels(id, translations) {
3822
+ var _this = this;
3823
+
3824
+ Object.entries(translations).forEach(function (_ref2) {
3825
+ var code = _ref2[0],
3826
+ translation = _ref2[1];
3827
+ return _this.addLabel(id, code, translation);
3828
+ });
3829
+ return this;
3830
+ };
3831
+
3682
3832
  _proto.removeLabel = function removeLabel(id) {
3683
3833
  var idx = this.configuration.labels.findIndex(function (x) {
3684
3834
  return x.id === id;
@@ -3833,7 +3983,7 @@ var EventListenerController = /*#__PURE__*/function () {
3833
3983
  var actionOperationData = this.operationData.actionOperationData ? deepCopy(this.operationData.actionOperationData) : {};
3834
3984
 
3835
3985
  if (event.target) {
3836
- actionOperationData.targetValue = event.target.value;
3986
+ actionOperationData.eventTarget = event.target;
3837
3987
  }
3838
3988
 
3839
3989
  this._executeAction(this.actionInstanceInfos, actionOperationData, 0);
@@ -3939,7 +4089,11 @@ var LabelController = /*#__PURE__*/function () {
3939
4089
  var _this2 = this;
3940
4090
 
3941
4091
  eventbus.broadcast(TimelineEventNames.REQUEST_LABEL_COLLECTION, [labelId, function (labelCollection) {
3942
- _this2._createTextDataLookup(labelCollection);
4092
+ if (labelCollection) {
4093
+ _this2._createTextDataLookup(labelCollection);
4094
+ } else {
4095
+ throw new Error("Label id '" + labelId + "' does not exist!");
4096
+ }
3943
4097
  }]);
3944
4098
  };
3945
4099
 
@@ -3947,7 +4101,17 @@ var LabelController = /*#__PURE__*/function () {
3947
4101
  if (this.currentLanguage) {
3948
4102
  var _this$operationData;
3949
4103
 
3950
- (_this$operationData = this.operationData) == null ? void 0 : _this$operationData.selectedElement.html(this.labelData[this.currentLanguage]);
4104
+ var text = this.labelData[this.currentLanguage];
4105
+
4106
+ if (!((_this$operationData = this.operationData) != null && _this$operationData.attributeName)) {
4107
+ var _this$operationData2;
4108
+
4109
+ (_this$operationData2 = this.operationData) == null ? void 0 : _this$operationData2.selectedElement.html(text);
4110
+ } else {
4111
+ var _this$operationData3, _this$operationData4;
4112
+
4113
+ (_this$operationData3 = this.operationData) == null ? void 0 : _this$operationData3.selectedElement.attr((_this$operationData4 = this.operationData) == null ? void 0 : _this$operationData4.attributeName, text);
4114
+ }
3951
4115
  }
3952
4116
  };
3953
4117
 
@@ -4935,6 +5099,23 @@ function extendController() {
4935
5099
  };
4936
5100
  }
4937
5101
 
5102
+ function getAttributesFromElement() {
5103
+ return {
5104
+ description: 'Retrieves the values for the specified attribute names from the given selected element.',
5105
+ dependentProperties: ['selectedElement'],
5106
+ properties: {
5107
+ attributeNames: {
5108
+ type: 'ParameterType:array',
5109
+ itemType: 'ParameterType:string',
5110
+ required: true
5111
+ }
5112
+ },
5113
+ outputProperties: {
5114
+ attributeValues: 'ParameterType:object'
5115
+ }
5116
+ };
5117
+ }
5118
+
4938
5119
  function getControllerFromElement() {
4939
5120
  return {
4940
5121
  description: 'Retrieves the specified controller from the current element',
@@ -5171,6 +5352,18 @@ function selectElement() {
5171
5352
  };
5172
5353
  }
5173
5354
 
5355
+ function setData() {
5356
+ return {
5357
+ description: 'Copies the specified values to the specified targets',
5358
+ properties: {
5359
+ properties: {
5360
+ type: 'ParameterType:object',
5361
+ required: true
5362
+ }
5363
+ }
5364
+ };
5365
+ }
5366
+
5174
5367
  function setElementAttributes() {
5175
5368
  return {
5176
5369
  description: 'Sets the given attributes on the selected element',
@@ -5324,6 +5517,7 @@ var operationMetadata = {
5324
5517
  endLoop: endLoop,
5325
5518
  endWhen: endWhen,
5326
5519
  extendController: extendController,
5520
+ getAttributesFromElement: getAttributesFromElement,
5327
5521
  getControllerFromElement: getControllerFromElement,
5328
5522
  getControllerInstance: getControllerInstance,
5329
5523
  getElementDimensions: getElementDimensions,
@@ -5342,6 +5536,7 @@ var operationMetadata = {
5342
5536
  requestAction: requestAction,
5343
5537
  resizeAction: resizeAction,
5344
5538
  selectElement: selectElement,
5539
+ setData: setData,
5345
5540
  setElementAttributes: setElementAttributes,
5346
5541
  setElementContent: setElementContent,
5347
5542
  setGlobalData: setGlobalData,
@@ -5854,10 +6049,6 @@ var EligiusEngine = /*#__PURE__*/function () {
5854
6049
 
5855
6050
  this._addEventListener(TimelineEventNames.REQUEST_TIMELINE_CLEANUP, this._handleTimelineComplete.bind(this));
5856
6051
 
5857
- this._addEventListener(TimelineEventNames.EXECUTE_TIMELINEACTION, this._handleExecuteTimelineAction.bind(this));
5858
-
5859
- this._addEventListener(TimelineEventNames.RESIZE_TIMELINEACTION, this._resizeTimelineAction.bind(this));
5860
-
5861
6052
  this._addEventListener(TimelineEventNames.REQUEST_CURRENT_TIMELINE, this._requestCurrentTimeline.bind(this));
5862
6053
 
5863
6054
  this._addEventListener(TimelineEventNames.PLAY_TOGGLE_REQUEST, this._toggleplay.bind(this));
@@ -6004,11 +6195,35 @@ var EligiusEngine = /*#__PURE__*/function () {
6004
6195
  // actions ends need to be in reversed order, otherwise, for example,
6005
6196
  // elements that were created before dependent actions will already have been
6006
6197
  // removed in the end phase.
6007
- var reversed = [].concat(timelineInfo.timelineActions).reverse();
6008
- reversed.forEach(_this._addTimelineActionEnd.bind(_this, timelineInfo.uri));
6198
+ timelineInfo.timelineActions.forEach(_this._addTimelineActionEnd.bind(_this, timelineInfo.uri));
6199
+ });
6200
+ EligiusEngine.sortTimelines(Object.values(this._timeLineActionsLookup));
6201
+ };
6202
+
6203
+ EligiusEngine.sortTimelines = function sortTimelines(timelines) {
6204
+ timelines.forEach(function (timelineActions) {
6205
+ Object.keys(timelineActions).forEach(function (key) {
6206
+ return timelineActions[key] = EligiusEngine.sortActionsPerPosition(timelineActions[key]);
6207
+ });
6009
6208
  });
6010
6209
  };
6011
6210
 
6211
+ EligiusEngine.sortActionsPerPosition = function sortActionsPerPosition(actions) {
6212
+ var _actions$reduce = actions.reduce(function (acc, item) {
6213
+ if (item.isStart) {
6214
+ acc[0].push(item);
6215
+ } else {
6216
+ acc[1].push(item);
6217
+ }
6218
+
6219
+ return acc;
6220
+ }, [[], []]),
6221
+ startMethods = _actions$reduce[0],
6222
+ endMethods = _actions$reduce[1];
6223
+
6224
+ return [].concat(endMethods.sort(sortActionMethodsHighestStartPositionFirst), startMethods);
6225
+ };
6226
+
6012
6227
  _proto._addTimelineActionStart = function _addTimelineActionStart(uri, timeLineAction) {
6013
6228
  var _timeLineAction$id;
6014
6229
 
@@ -6020,9 +6235,9 @@ var EligiusEngine = /*#__PURE__*/function () {
6020
6235
 
6021
6236
  if ((_timeLineAction$id = timeLineAction.id) != null && _timeLineAction$id.length) {
6022
6237
  startMethod.id = timeLineAction.id;
6023
- startMethod.isStart = true;
6024
6238
  }
6025
6239
 
6240
+ startMethod.isStart = true;
6026
6241
  timelineStartPositions.push(startMethod);
6027
6242
  };
6028
6243
 
@@ -6034,14 +6249,18 @@ var EligiusEngine = /*#__PURE__*/function () {
6034
6249
  }
6035
6250
 
6036
6251
  if (isFinite(end)) {
6252
+ var _timeLineAction$id2;
6253
+
6037
6254
  var timelineEndPositions = this._initializeTimelinePosition(this._timeLineActionsLookup[uri], end);
6038
6255
 
6039
6256
  var endMethod = timeLineAction.end.bind(timeLineAction);
6040
6257
 
6041
- if (!timeLineAction.id) {
6258
+ if ((_timeLineAction$id2 = timeLineAction.id) != null && _timeLineAction$id2.length) {
6042
6259
  endMethod.id = timeLineAction.id;
6260
+ endMethod.startPosition = timeLineAction.duration.start;
6043
6261
  }
6044
6262
 
6263
+ endMethod.isStart = false;
6045
6264
  timelineEndPositions.push(endMethod);
6046
6265
  }
6047
6266
  };
@@ -6241,11 +6460,11 @@ var EligiusEngine = /*#__PURE__*/function () {
6241
6460
  var actions = allActions.filter(function (action) {
6242
6461
  return action.active;
6243
6462
  });
6244
- return actions.sort(sortActions);
6463
+ return actions.sort(sortActionsHighestStartPositionFirst);
6245
6464
  };
6246
6465
 
6247
6466
  _proto._executeRelevantActions = function _executeRelevantActions(filter, executionType) {
6248
- var timelineActions = this._getRelevantTimelineActions();
6467
+ var timelineActions = this._getTimelineActionsForCurrentTimeline();
6249
6468
 
6250
6469
  var currentActions = filter.apply(this, [timelineActions]);
6251
6470
  return this._executeActions(currentActions, executionType, 0);
@@ -6261,27 +6480,7 @@ var EligiusEngine = /*#__PURE__*/function () {
6261
6480
  this._cleanUpTimeline();
6262
6481
  };
6263
6482
 
6264
- _proto._handleExecuteTimelineAction = function _handleExecuteTimelineAction(uri, index, start) {
6265
- var actions = this._getTimelineActionsForUri(uri);
6266
-
6267
- var action = actions == null ? void 0 : actions[index];
6268
-
6269
- if (action) {
6270
- if (start) {
6271
- action.start();
6272
- } else {
6273
- action.end();
6274
- }
6275
- }
6276
- };
6277
-
6278
- _proto._resizeTimelineAction = function
6279
- /*uri: string, index: number*/
6280
- _resizeTimelineAction() {
6281
- console.error('no resizing implemented');
6282
- };
6283
-
6284
- _proto._getRelevantTimelineActions = function _getRelevantTimelineActions() {
6483
+ _proto._getTimelineActionsForCurrentTimeline = function _getTimelineActionsForCurrentTimeline() {
6285
6484
  return this._getTimelineActionsForUri(this._currentTimelineUri);
6286
6485
  };
6287
6486
 
@@ -6317,19 +6516,19 @@ var EligiusEngine = /*#__PURE__*/function () {
6317
6516
  if (actions) {
6318
6517
  var executions = actions[position];
6319
6518
  executions == null ? void 0 : executions.forEach(function (exec) {
6320
- exec();
6519
+ return exec();
6321
6520
  });
6322
6521
  }
6323
6522
  };
6324
6523
 
6325
6524
  _proto._executeSeekActions = /*#__PURE__*/function () {
6326
- var _executeSeekActions2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(pos) {
6525
+ var _executeSeekActions2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(position) {
6327
6526
  var timelineActions, currentActions, newActions, currentActionsEnd;
6328
6527
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
6329
6528
  while (1) {
6330
6529
  switch (_context8.prev = _context8.next) {
6331
6530
  case 0:
6332
- timelineActions = this._getRelevantTimelineActions();
6531
+ timelineActions = this._getTimelineActionsForCurrentTimeline();
6333
6532
 
6334
6533
  if (timelineActions) {
6335
6534
  _context8.next = 3;
@@ -6339,8 +6538,10 @@ var EligiusEngine = /*#__PURE__*/function () {
6339
6538
  return _context8.abrupt("return", Promise.resolve());
6340
6539
 
6341
6540
  case 3:
6342
- currentActions = this._getActiveActions(timelineActions);
6343
- newActions = this._getActionsForPosition(pos, timelineActions);
6541
+ currentActions = this._getActiveActions(timelineActions).filter(function (action) {
6542
+ return !(action.duration.start <= position && action.duration.end >= position);
6543
+ });
6544
+ newActions = this._getActionsForPosition(position, timelineActions);
6344
6545
  currentActionsEnd = this._executeActions(currentActions, 'end', 0);
6345
6546
  _context8.next = 8;
6346
6547
  return currentActionsEnd;
@@ -6366,7 +6567,7 @@ var EligiusEngine = /*#__PURE__*/function () {
6366
6567
  return EligiusEngine;
6367
6568
  }();
6368
6569
 
6369
- var sortActions = function sortActions(a, b) {
6570
+ var sortActionsHighestStartPositionFirst = function sortActionsHighestStartPositionFirst(a, b) {
6370
6571
  if (b.duration.start < a.duration.start) {
6371
6572
  return -1;
6372
6573
  } else if (b.duration.start > a.duration.start) {
@@ -6376,6 +6577,20 @@ var sortActions = function sortActions(a, b) {
6376
6577
  }
6377
6578
  };
6378
6579
 
6580
+ var sortActionMethodsHighestStartPositionFirst = function sortActionMethodsHighestStartPositionFirst(a, b) {
6581
+ if (b.startPosition === undefined || a.startPosition === undefined) {
6582
+ return 0;
6583
+ }
6584
+
6585
+ if (b.startPosition < a.startPosition) {
6586
+ return -1;
6587
+ } else if (b.startPosition > a.startPosition) {
6588
+ return 1;
6589
+ } else {
6590
+ return 0;
6591
+ }
6592
+ };
6593
+
6379
6594
  /**
6380
6595
  * The `IEventbusListener` first registers a number of actions that are then
6381
6596
  * executed when the specified event is broadcast.
@@ -6964,5 +7179,5 @@ var EligiusResourceImporter = /*#__PURE__*/function () {
6964
7179
  return EligiusResourceImporter;
6965
7180
  }();
6966
7181
 
6967
- export { Action, ActionCreator, ActionCreatorFactory, ActionEditor, ActionRegistryEventbusListener, ConfigurationFactory, ConfigurationResolver, ControllerNamesProvider, DEV_TOOLS_KEY, DevToolEventListener, Diagnostics, EligiusEngine, EligiusResourceImporter, EndableAction, EndableActionCreator, EndableActionEditor, EngineFactory, EventListenerController, Eventbus, LabelController, LanguageManager, LottieController, NavigationController, OperationEditor, OperationMetadataProvider, OperationNamesProvider, ProgressbarController, RequestAnimationFrameTimelineProvider, RequestVideoUriInterceptor, RoutingController, SubtitlesController, TimeLineEventNamesProvider, TimelineAction, TimelineActionCreator, TimelineActionEditor, TimelineEventNames, TimelineProviderSettingsEditor, TimelineProvidersSettingsEditor, addClass$1 as addClass, addControllerToElement$1 as addControllerToElement, animate$1 as animate, animateWithClass$1 as animateWithClass, broadcastEvent$1 as broadcastEvent, calc$1 as calc, clearElement$1 as clearElement, clearOperationData$1 as clearOperationData, createElement$1 as createElement, customFunction$1 as customFunction, endAction$1 as endAction, endLoop$1 as endLoop, endWhen$1 as endWhen, extendController$1 as extendController, generateImporterSourceCode, getControllerFromElement$1 as getControllerFromElement, getControllerInstance$1 as getControllerInstance, getElementDimensions$1 as getElementDimensions, getImport$1 as getImport, getQueryParams$1 as getQueryParams, invokeObjectMethod$1 as invokeObjectMethod, loadJSON$1 as loadJSON, log$1 as log, math$1 as math, operationMetadata as metadata, otherwise$1 as otherwise, removeClass$1 as removeClass, removeControllerFromElement$1 as removeControllerFromElement, removeElement$1 as removeElement, removePropertiesFromOperationData$1 as removePropertiesFromOperationData, reparentElement$1 as reparentElement, requestAction$1 as requestAction, resizeAction$1 as resizeAction, selectElement$1 as selectElement, setElementAttributes$1 as setElementAttributes, setElementContent$1 as setElementContent, setGlobalData$1 as setGlobalData, setOperationData$1 as setOperationData, setStyle$1 as setStyle, startAction$1 as startAction, startLoop$1 as startLoop, toggleClass$1 as toggleClass, toggleElement$1 as toggleElement, wait$2 as wait, when };
7182
+ export { Action, ActionCreator, ActionCreatorFactory, ActionEditor, ActionRegistryEventbusListener, ConfigurationFactory, ConfigurationResolver, ControllerNamesProvider, DEV_TOOLS_KEY, DevToolEventListener, Diagnostics, EligiusEngine, EligiusResourceImporter, EndableAction, EndableActionCreator, EndableActionEditor, EngineFactory, EventListenerController, Eventbus, LabelController, LanguageManager, LottieController, NavigationController, OperationEditor, OperationMetadataProvider, OperationNamesProvider, ProgressbarController, RequestAnimationFrameTimelineProvider, RequestVideoUriInterceptor, RoutingController, SubtitlesController, TimeLineEventNamesProvider, TimelineAction, TimelineActionCreator, TimelineActionEditor, TimelineEventNames, TimelineProviderSettingsEditor, TimelineProvidersSettingsEditor, addClass$1 as addClass, addControllerToElement$1 as addControllerToElement, animate$1 as animate, animateWithClass$1 as animateWithClass, broadcastEvent$1 as broadcastEvent, calc$1 as calc, clearElement$1 as clearElement, clearOperationData$1 as clearOperationData, createElement$1 as createElement, customFunction$1 as customFunction, endAction$1 as endAction, endLoop$1 as endLoop, endWhen$1 as endWhen, extendController$1 as extendController, generateImporterSourceCode, getAttributesFromElement$1 as getAttributesFromElement, getControllerFromElement$1 as getControllerFromElement, getControllerInstance$1 as getControllerInstance, getElementDimensions$1 as getElementDimensions, getImport$1 as getImport, getQueryParams$1 as getQueryParams, invokeObjectMethod$1 as invokeObjectMethod, loadJSON$1 as loadJSON, log$1 as log, math$1 as math, operationMetadata as metadata, otherwise$1 as otherwise, removeClass$1 as removeClass, removeControllerFromElement$1 as removeControllerFromElement, removeElement$1 as removeElement, removePropertiesFromOperationData$1 as removePropertiesFromOperationData, reparentElement$1 as reparentElement, requestAction$1 as requestAction, resizeAction$1 as resizeAction, selectElement$1 as selectElement, setData$1 as setData, setElementAttributes$1 as setElementAttributes, setElementContent$1 as setElementContent, setGlobalData$1 as setGlobalData, setOperationData$1 as setOperationData, setStyle$1 as setStyle, startAction$1 as startAction, startLoop$1 as startLoop, toggleClass$1 as toggleClass, toggleElement$1 as toggleElement, wait$2 as wait, when };
6968
7183
  //# sourceMappingURL=eligius.esm.js.map