eligius 1.0.8 → 1.0.10
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.
- package/README.md +10 -6
- package/dist/controllers/label-controller.d.ts +3 -0
- package/dist/controllers/progressbar-controller.d.ts +2 -1
- package/dist/eligius-engine.d.ts +15 -4
- package/dist/eligius.cjs.development.js +225 -156
- package/dist/eligius.cjs.development.js.map +1 -1
- package/dist/eligius.cjs.production.min.js +1 -1
- package/dist/eligius.cjs.production.min.js.map +1 -1
- package/dist/eligius.esm.js +224 -157
- package/dist/eligius.esm.js.map +1 -1
- package/dist/operation/calc.d.ts +1 -1
- package/dist/operation/create-element.d.ts +0 -1
- package/dist/operation/get-controller-instance.d.ts +1 -3
- package/dist/operation/get-query-params.d.ts +28 -0
- package/dist/operation/index.d.ts +2 -0
- package/dist/operation/invoke-object-method.d.ts +15 -0
- package/dist/operation/load-json.d.ts +2 -3
- package/dist/operation/math.d.ts +1 -1
- package/dist/operation/metadata/get-query-params.d.ts +4 -0
- package/dist/operation/metadata/index.d.ts +2 -0
- package/dist/operation/metadata/invoke-object-method.d.ts +4 -0
- package/dist/operation/metadata/types.d.ts +1 -1
- package/dist/operation/remove-properties-from-operation-data.d.ts +1 -0
- package/dist/operation/select-element.d.ts +2 -3
- package/dist/operation/set-style.d.ts +4 -4
- package/dist/operation/start-loop.d.ts +2 -3
- package/dist/types.d.ts +42 -3
- package/package.json +2 -2
package/dist/eligius.esm.js
CHANGED
|
@@ -424,7 +424,11 @@ function prepareValueForSerialization(value) {
|
|
|
424
424
|
return value.map(prepareValueForSerialization);
|
|
425
425
|
} else if (value instanceof $) {
|
|
426
426
|
return 'jQuery object';
|
|
427
|
-
} else if (typeof value === 'object') {
|
|
427
|
+
} else if (value !== null && typeof value === 'object') {
|
|
428
|
+
if (value.constructor.toString().substring(0, 5) === 'class') {
|
|
429
|
+
return 'Complex object';
|
|
430
|
+
}
|
|
431
|
+
|
|
428
432
|
return Object.fromEntries(Object.entries(value).map(function (_ref) {
|
|
429
433
|
var propName = _ref[0],
|
|
430
434
|
propValue = _ref[1];
|
|
@@ -1240,6 +1244,7 @@ var LabelController = /*#__PURE__*/function () {
|
|
|
1240
1244
|
this.operationData = null;
|
|
1241
1245
|
this.labelData = {};
|
|
1242
1246
|
this.name = 'LabelController';
|
|
1247
|
+
this.requestLabelDataBound = void 0;
|
|
1243
1248
|
}
|
|
1244
1249
|
|
|
1245
1250
|
var _proto = LabelController.prototype;
|
|
@@ -1248,6 +1253,13 @@ var LabelController = /*#__PURE__*/function () {
|
|
|
1248
1253
|
this.operationData = Object.assign({}, operationData);
|
|
1249
1254
|
};
|
|
1250
1255
|
|
|
1256
|
+
_proto.setLabelId = function setLabelId(newLabelId) {
|
|
1257
|
+
if (this.requestLabelDataBound) {
|
|
1258
|
+
this.requestLabelDataBound(newLabelId);
|
|
1259
|
+
this.setLabel();
|
|
1260
|
+
}
|
|
1261
|
+
};
|
|
1262
|
+
|
|
1251
1263
|
_proto.attach = function attach(eventbus) {
|
|
1252
1264
|
var _this = this;
|
|
1253
1265
|
|
|
@@ -1258,13 +1270,20 @@ var LabelController = /*#__PURE__*/function () {
|
|
|
1258
1270
|
eventbus.broadcast(TimelineEventNames.REQUEST_CURRENT_LANGUAGE, [function (language) {
|
|
1259
1271
|
_this.currentLanguage = language;
|
|
1260
1272
|
}]);
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
}]);
|
|
1273
|
+
this.requestLabelDataBound = this.requestLabelData.bind(this, eventbus);
|
|
1274
|
+
this.requestLabelDataBound(this.operationData.labelId);
|
|
1264
1275
|
this.setLabel();
|
|
1265
1276
|
this.listeners.push(eventbus.on(TimelineEventNames.LANGUAGE_CHANGE, this.handleLanguageChange.bind(this)));
|
|
1266
1277
|
};
|
|
1267
1278
|
|
|
1279
|
+
_proto.requestLabelData = function requestLabelData(eventbus, labelId) {
|
|
1280
|
+
var _this2 = this;
|
|
1281
|
+
|
|
1282
|
+
eventbus.broadcast(TimelineEventNames.REQUEST_LABEL_COLLECTION, [labelId, function (labelCollection) {
|
|
1283
|
+
_this2.createTextDataLookup(labelCollection);
|
|
1284
|
+
}]);
|
|
1285
|
+
};
|
|
1286
|
+
|
|
1268
1287
|
_proto.setLabel = function setLabel() {
|
|
1269
1288
|
if (this.currentLanguage) {
|
|
1270
1289
|
var _this$operationData;
|
|
@@ -1275,8 +1294,9 @@ var LabelController = /*#__PURE__*/function () {
|
|
|
1275
1294
|
|
|
1276
1295
|
_proto.detach = function detach(_eventbus) {
|
|
1277
1296
|
this.listeners.forEach(function (func) {
|
|
1278
|
-
func();
|
|
1297
|
+
return func();
|
|
1279
1298
|
});
|
|
1299
|
+
this.requestLabelDataBound = undefined;
|
|
1280
1300
|
};
|
|
1281
1301
|
|
|
1282
1302
|
_proto.handleLanguageChange = function handleLanguageChange(code) {
|
|
@@ -1285,10 +1305,10 @@ var LabelController = /*#__PURE__*/function () {
|
|
|
1285
1305
|
};
|
|
1286
1306
|
|
|
1287
1307
|
_proto.createTextDataLookup = function createTextDataLookup(data) {
|
|
1288
|
-
var
|
|
1308
|
+
var _this3 = this;
|
|
1289
1309
|
|
|
1290
1310
|
data.forEach(function (d) {
|
|
1291
|
-
|
|
1311
|
+
_this3.labelData[d.languageCode] = d.label;
|
|
1292
1312
|
});
|
|
1293
1313
|
};
|
|
1294
1314
|
|
|
@@ -1717,6 +1737,7 @@ var ProgressbarController = /*#__PURE__*/function () {
|
|
|
1717
1737
|
this.selectedElement = null;
|
|
1718
1738
|
this.textElement = null;
|
|
1719
1739
|
this.detachers = [];
|
|
1740
|
+
this.duration = 0;
|
|
1720
1741
|
}
|
|
1721
1742
|
|
|
1722
1743
|
var _proto = ProgressbarController.prototype;
|
|
@@ -1727,17 +1748,20 @@ var ProgressbarController = /*#__PURE__*/function () {
|
|
|
1727
1748
|
};
|
|
1728
1749
|
|
|
1729
1750
|
_proto.attach = function attach(eventbus) {
|
|
1730
|
-
var _this
|
|
1731
|
-
_this
|
|
1751
|
+
var _this = this,
|
|
1752
|
+
_this$selectedElement;
|
|
1732
1753
|
|
|
1733
1754
|
this.detachers.push(eventbus.on(TimelineEventNames.POSITION_UPDATE, this.positionUpdateHandler.bind(this)));
|
|
1734
|
-
|
|
1755
|
+
eventbus.broadcast(TimelineEventNames.DURATION_REQUEST, [function (duration) {
|
|
1756
|
+
return _this.duration = duration;
|
|
1757
|
+
}]);
|
|
1758
|
+
var clickHandler = this.clickHandler.bind(this, eventbus);
|
|
1735
1759
|
(_this$selectedElement = this.selectedElement) == null ? void 0 : _this$selectedElement.on('click', clickHandler);
|
|
1736
1760
|
this.detachers.push(function () {
|
|
1737
1761
|
var _this$selectedElement2;
|
|
1738
1762
|
|
|
1739
|
-
return (_this$selectedElement2 = _this.selectedElement) == null ? void 0 : _this$selectedElement2.off('click');
|
|
1740
|
-
}
|
|
1763
|
+
return (_this$selectedElement2 = _this.selectedElement) == null ? void 0 : _this$selectedElement2.off('click', clickHandler);
|
|
1764
|
+
});
|
|
1741
1765
|
};
|
|
1742
1766
|
|
|
1743
1767
|
_proto.detach = function detach(_eventbus) {
|
|
@@ -1756,7 +1780,14 @@ var ProgressbarController = /*#__PURE__*/function () {
|
|
|
1756
1780
|
(_this$textElement = this.textElement) == null ? void 0 : _this$textElement.text(Math.floor(percentage) + "%");
|
|
1757
1781
|
};
|
|
1758
1782
|
|
|
1759
|
-
_proto.clickHandler = function clickHandler() {
|
|
1783
|
+
_proto.clickHandler = function clickHandler(eventbus, event) {
|
|
1784
|
+
var element = event.target;
|
|
1785
|
+
var rect = element.getBoundingClientRect();
|
|
1786
|
+
var x = event.clientX - rect.left; //x position within the element.
|
|
1787
|
+
|
|
1788
|
+
var percentage = 100 / rect.width * x;
|
|
1789
|
+
eventbus.broadcast(TimelineEventNames.SEEK_REQUEST, [Math.floor(this.duration / 100 * percentage)]);
|
|
1790
|
+
};
|
|
1760
1791
|
|
|
1761
1792
|
return ProgressbarController;
|
|
1762
1793
|
}();
|
|
@@ -2042,9 +2073,8 @@ var ctrls = {
|
|
|
2042
2073
|
};
|
|
2043
2074
|
|
|
2044
2075
|
/**
|
|
2045
|
-
*
|
|
2046
|
-
* the given timeline provider and triggering the actions associated with
|
|
2047
|
-
* ...
|
|
2076
|
+
* This is where the magic happens. The engine is responsible for starting and stopping
|
|
2077
|
+
* the given timeline provider and triggering the actions associated with the positions along the timeline.
|
|
2048
2078
|
*/
|
|
2049
2079
|
|
|
2050
2080
|
var EligiusEngine = /*#__PURE__*/function () {
|
|
@@ -2063,6 +2093,11 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
2063
2093
|
this.timelineProviders = timelineProviders;
|
|
2064
2094
|
this.languageManager = languageManager;
|
|
2065
2095
|
}
|
|
2096
|
+
/**
|
|
2097
|
+
* Initializes the engine by creating the HTML layout and the first time line
|
|
2098
|
+
* by executing its initActions.
|
|
2099
|
+
*/
|
|
2100
|
+
|
|
2066
2101
|
|
|
2067
2102
|
var _proto = EligiusEngine.prototype;
|
|
2068
2103
|
|
|
@@ -2182,9 +2217,20 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
2182
2217
|
}
|
|
2183
2218
|
|
|
2184
2219
|
return _cleanUp;
|
|
2185
|
-
}()
|
|
2186
|
-
|
|
2187
|
-
|
|
2220
|
+
}()
|
|
2221
|
+
/**
|
|
2222
|
+
* Cleans up all the necessary parts that the engine initialized.
|
|
2223
|
+
* - It ends the currently active operations and the init actions.
|
|
2224
|
+
* - It removes all its eventbus listeners, handlers and interceptors.
|
|
2225
|
+
* - It destroys all of its timeline providers
|
|
2226
|
+
* - It empties the HTML element indicated by the containerSelector configuration property.
|
|
2227
|
+
*
|
|
2228
|
+
*/
|
|
2229
|
+
;
|
|
2230
|
+
|
|
2231
|
+
_proto.destroy =
|
|
2232
|
+
/*#__PURE__*/
|
|
2233
|
+
function () {
|
|
2188
2234
|
var _destroy = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
2189
2235
|
var containerSelector, container;
|
|
2190
2236
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
@@ -2285,13 +2331,11 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
2285
2331
|
}
|
|
2286
2332
|
|
|
2287
2333
|
if (isFinite(end)) {
|
|
2288
|
-
var _timeLineAction$id2;
|
|
2289
|
-
|
|
2290
2334
|
var timelineEndPositions = this._initializeTimelinePosition(this._timeLineActionsLookup[uri], end);
|
|
2291
2335
|
|
|
2292
2336
|
var endMethod = timeLineAction.end.bind(timeLineAction);
|
|
2293
2337
|
|
|
2294
|
-
if (
|
|
2338
|
+
if (!timeLineAction.id) {
|
|
2295
2339
|
endMethod.id = timeLineAction.id;
|
|
2296
2340
|
}
|
|
2297
2341
|
|
|
@@ -3381,10 +3425,8 @@ var calc$1 = function calc(operationData) {
|
|
|
3381
3425
|
var _operationData = operationData,
|
|
3382
3426
|
left = _operationData.left,
|
|
3383
3427
|
right = _operationData.right,
|
|
3384
|
-
operator = _operationData.operator
|
|
3385
|
-
|
|
3386
|
-
propertyName = _operationData$proper === void 0 ? 'calculationResult' : _operationData$proper;
|
|
3387
|
-
operationData[propertyName] = calcFunctions[operator](+left, +right);
|
|
3428
|
+
operator = _operationData.operator;
|
|
3429
|
+
operationData.calculationResult = calcFunctions[operator](+left, +right);
|
|
3388
3430
|
return operationData;
|
|
3389
3431
|
};
|
|
3390
3432
|
|
|
@@ -3429,17 +3471,14 @@ var createElement$1 = function createElement(operationData) {
|
|
|
3429
3471
|
var _operationData = operationData,
|
|
3430
3472
|
elementName = _operationData.elementName,
|
|
3431
3473
|
attributes = _operationData.attributes,
|
|
3432
|
-
text = _operationData.text
|
|
3433
|
-
_operationData$proper = _operationData.propertyName,
|
|
3434
|
-
propertyName = _operationData$proper === void 0 ? 'template' : _operationData$proper;
|
|
3474
|
+
text = _operationData.text;
|
|
3435
3475
|
var serializedAttrs = attributes ? ' ' + Object.entries(attributes).map(function (_ref) {
|
|
3436
3476
|
var key = _ref[0],
|
|
3437
3477
|
value = _ref[1];
|
|
3438
3478
|
return key + "=\"" + value + "\"";
|
|
3439
3479
|
}).join(' ') : '';
|
|
3440
3480
|
var template = text ? $("<" + elementName + serializedAttrs + ">" + text + "</" + elementName + ">") : $("<" + elementName + serializedAttrs + "/>");
|
|
3441
|
-
operationData
|
|
3442
|
-
delete operationData.propertyName;
|
|
3481
|
+
operationData.template = template;
|
|
3443
3482
|
return operationData;
|
|
3444
3483
|
};
|
|
3445
3484
|
|
|
@@ -3553,25 +3592,21 @@ var getControllerFromElement$1 = function getControllerFromElement(operationData
|
|
|
3553
3592
|
|
|
3554
3593
|
/**
|
|
3555
3594
|
* This operation retrieves an instance of the given controller name.
|
|
3556
|
-
* It assigns this instance to the property on the current operation data
|
|
3557
|
-
* defined by the propertyName property which defaults to 'controllerInstance'.
|
|
3595
|
+
* It assigns this instance to the `controllerInstance` property on the current operation data
|
|
3558
3596
|
*
|
|
3559
3597
|
* @param operationData
|
|
3560
3598
|
* @returns
|
|
3561
3599
|
*/
|
|
3562
3600
|
|
|
3563
3601
|
var getControllerInstance$1 = function getControllerInstance(operationData) {
|
|
3564
|
-
var systemName = operationData.systemName
|
|
3565
|
-
|
|
3566
|
-
propertyName = _operationData$proper === void 0 ? 'controllerInstance' : _operationData$proper;
|
|
3567
|
-
operationData[propertyName] = null;
|
|
3602
|
+
var systemName = operationData.systemName;
|
|
3603
|
+
operationData.controllerInstance = undefined;
|
|
3568
3604
|
|
|
3569
3605
|
var resultCallback = function resultCallback(instance) {
|
|
3570
|
-
operationData
|
|
3606
|
+
operationData.controllerInstance = instance;
|
|
3571
3607
|
};
|
|
3572
3608
|
|
|
3573
3609
|
this.eventbus.broadcast(TimelineEventNames.REQUEST_INSTANCE, [systemName, resultCallback]);
|
|
3574
|
-
delete operationData.propertyName;
|
|
3575
3610
|
return operationData;
|
|
3576
3611
|
};
|
|
3577
3612
|
|
|
@@ -3811,13 +3846,58 @@ var getImport$1 = function getImport(operationData) {
|
|
|
3811
3846
|
return operationData;
|
|
3812
3847
|
};
|
|
3813
3848
|
|
|
3849
|
+
/**
|
|
3850
|
+
* This operation retrieves the current query parameters from the browser's address bar and places
|
|
3851
|
+
* them on the returned operation data.
|
|
3852
|
+
*
|
|
3853
|
+
* @param operationData
|
|
3854
|
+
* @returns
|
|
3855
|
+
*/
|
|
3856
|
+
var getQueryParams$1 = function getQueryParams(operationData) {
|
|
3857
|
+
var searchParams = new URLSearchParams(window.location.search);
|
|
3858
|
+
var queryParams = Object.fromEntries(searchParams.entries());
|
|
3859
|
+
var defaultValues = operationData.defaultValues;
|
|
3860
|
+
|
|
3861
|
+
if (defaultValues) {
|
|
3862
|
+
var defaultEntries = Object.entries(defaultValues).filter(function (_ref) {
|
|
3863
|
+
var name = _ref[0];
|
|
3864
|
+
return !(name in queryParams);
|
|
3865
|
+
});
|
|
3866
|
+
defaultEntries.forEach(function (_ref2) {
|
|
3867
|
+
var name = _ref2[0],
|
|
3868
|
+
value = _ref2[1];
|
|
3869
|
+
return queryParams[name] = value;
|
|
3870
|
+
});
|
|
3871
|
+
delete operationData.defaultValues;
|
|
3872
|
+
}
|
|
3873
|
+
|
|
3874
|
+
operationData.queryParams = queryParams;
|
|
3875
|
+
return operationData;
|
|
3876
|
+
};
|
|
3877
|
+
|
|
3878
|
+
/**
|
|
3879
|
+
* This operation invokes the specified method on the given object with the optional specified arguments
|
|
3880
|
+
* and assigns the result to the `methodResult` property.
|
|
3881
|
+
*
|
|
3882
|
+
* @param operationData
|
|
3883
|
+
* @returns
|
|
3884
|
+
*/
|
|
3885
|
+
var invokeObjectMethod$1 = function invokeObjectMethod(operationData) {
|
|
3886
|
+
var methodName = operationData.methodName,
|
|
3887
|
+
methodArguments = operationData.methodArguments;
|
|
3888
|
+
delete operationData.methodName;
|
|
3889
|
+
delete operationData.methodArguments;
|
|
3890
|
+
operationData.methodResult = operationData.instance[methodName].apply(operationData.instance, methodArguments != null ? methodArguments : []);
|
|
3891
|
+
return operationData;
|
|
3892
|
+
};
|
|
3893
|
+
|
|
3814
3894
|
var jsonCache = {};
|
|
3815
3895
|
var addToCache = function addToCache(key, value) {
|
|
3816
3896
|
jsonCache[key] = value;
|
|
3817
3897
|
};
|
|
3818
3898
|
/**
|
|
3819
|
-
* This operation loads a JSON file from the specified url and assigns it to the
|
|
3820
|
-
* property
|
|
3899
|
+
* This operation loads a JSON file from the specified url and assigns it to the json
|
|
3900
|
+
* property on the current operation data.
|
|
3821
3901
|
*
|
|
3822
3902
|
* If the cache property is set to true and a cached value already exists, this is assigned
|
|
3823
3903
|
* instead of re-retrieving it from the url.
|
|
@@ -3828,47 +3908,41 @@ var addToCache = function addToCache(key, value) {
|
|
|
3828
3908
|
|
|
3829
3909
|
var loadJSON$1 = function loadJSON(operationData) {
|
|
3830
3910
|
var url = operationData.url,
|
|
3831
|
-
cache = operationData.cache
|
|
3832
|
-
_operationData$proper = operationData.propertyName,
|
|
3833
|
-
propertyName = _operationData$proper === void 0 ? 'json' : _operationData$proper;
|
|
3911
|
+
cache = operationData.cache;
|
|
3834
3912
|
|
|
3835
3913
|
if (cache && jsonCache[url]) {
|
|
3836
|
-
operationData
|
|
3837
|
-
delete operationData.propertyName;
|
|
3914
|
+
operationData.json = jsonCache[url];
|
|
3838
3915
|
return operationData;
|
|
3839
3916
|
}
|
|
3840
3917
|
|
|
3841
|
-
return
|
|
3842
|
-
|
|
3843
|
-
var
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
return response.json();
|
|
3918
|
+
return fetch(url).then( /*#__PURE__*/function () {
|
|
3919
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(response) {
|
|
3920
|
+
var json, cacheValue;
|
|
3921
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3922
|
+
while (1) {
|
|
3923
|
+
switch (_context.prev = _context.next) {
|
|
3924
|
+
case 0:
|
|
3925
|
+
_context.next = 2;
|
|
3926
|
+
return response.json();
|
|
3851
3927
|
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
resolve(operationData);
|
|
3928
|
+
case 2:
|
|
3929
|
+
json = _context.sent;
|
|
3930
|
+
cacheValue = operationData.json = json;
|
|
3931
|
+
addToCache(url, cacheValue);
|
|
3932
|
+
return _context.abrupt("return", operationData);
|
|
3858
3933
|
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
}
|
|
3934
|
+
case 6:
|
|
3935
|
+
case "end":
|
|
3936
|
+
return _context.stop();
|
|
3863
3937
|
}
|
|
3864
|
-
}
|
|
3865
|
-
})
|
|
3938
|
+
}
|
|
3939
|
+
}, _callee);
|
|
3940
|
+
}));
|
|
3866
3941
|
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
});
|
|
3942
|
+
return function (_x) {
|
|
3943
|
+
return _ref.apply(this, arguments);
|
|
3944
|
+
};
|
|
3945
|
+
}());
|
|
3872
3946
|
};
|
|
3873
3947
|
|
|
3874
3948
|
/**
|
|
@@ -3900,10 +3974,8 @@ var math$1 = function math(operationData) {
|
|
|
3900
3974
|
operationData.args = resolveMathConstants(operationData.args);
|
|
3901
3975
|
var _operationData = operationData,
|
|
3902
3976
|
args = _operationData.args,
|
|
3903
|
-
functionName = _operationData.functionName
|
|
3904
|
-
|
|
3905
|
-
propertyName = _operationData$proper === void 0 ? 'mathResult' : _operationData$proper;
|
|
3906
|
-
operationData[propertyName] = Math[functionName].apply(null, args);
|
|
3977
|
+
functionName = _operationData.functionName;
|
|
3978
|
+
operationData.mathResult = Math[functionName].apply(null, args);
|
|
3907
3979
|
return operationData;
|
|
3908
3980
|
};
|
|
3909
3981
|
|
|
@@ -3972,17 +4044,22 @@ var removeElement$1 = function removeElement(operationData) {
|
|
|
3972
4044
|
|
|
3973
4045
|
/**
|
|
3974
4046
|
* This operation removes the given list of properties from the current operation data.
|
|
4047
|
+
* It will also omit the property 'propertyNames' from the result.
|
|
3975
4048
|
*
|
|
3976
4049
|
* @param operationData
|
|
3977
4050
|
* @returns
|
|
3978
4051
|
*/
|
|
3979
4052
|
var removePropertiesFromOperationData$1 = function removePropertiesFromOperationData(operationData) {
|
|
3980
4053
|
var propertyNames = operationData.propertyNames;
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
4054
|
+
|
|
4055
|
+
if (propertyNames.indexOf('propertyNames') < 0) {
|
|
4056
|
+
propertyNames.push('propertyNames');
|
|
4057
|
+
}
|
|
4058
|
+
|
|
4059
|
+
return Object.fromEntries(Object.entries(operationData).filter(function (_ref) {
|
|
4060
|
+
var name = _ref[0];
|
|
4061
|
+
return !propertyNames.includes(name);
|
|
4062
|
+
}));
|
|
3986
4063
|
};
|
|
3987
4064
|
|
|
3988
4065
|
/**
|
|
@@ -4038,25 +4115,21 @@ var resizeAction$1 = function resizeAction(operationData) {
|
|
|
4038
4115
|
return operationData;
|
|
4039
4116
|
};
|
|
4040
4117
|
|
|
4041
|
-
function findElementBySelector(root, selector
|
|
4118
|
+
function findElementBySelector(root, selector) {
|
|
4042
4119
|
var element = root.find(selector);
|
|
4043
4120
|
|
|
4044
4121
|
if (!element.length) {
|
|
4045
4122
|
console.warn("selector '" + selector + "' wasn't found!");
|
|
4046
4123
|
}
|
|
4047
4124
|
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
if (operationData.hasOwnProperty('propertyName')) {
|
|
4051
|
-
delete operationData.propertyName;
|
|
4052
|
-
}
|
|
4125
|
+
return element;
|
|
4053
4126
|
}
|
|
4054
4127
|
/**
|
|
4055
4128
|
* This operation selects one or more elements using the specified selector.
|
|
4056
4129
|
*
|
|
4057
4130
|
* If useSelectedElementAsRoot is set to true and a valid DOM element is assigned
|
|
4058
|
-
* to the current operation data
|
|
4059
|
-
* then the element will be looked for only in the
|
|
4131
|
+
* to the current operation data's `selectedElement` property
|
|
4132
|
+
* then the element will be looked for only in the descendant elements of this DOM element.
|
|
4060
4133
|
*
|
|
4061
4134
|
* @param operationData
|
|
4062
4135
|
* @returns
|
|
@@ -4065,23 +4138,21 @@ function findElementBySelector(root, selector, operationData, propertyName) {
|
|
|
4065
4138
|
|
|
4066
4139
|
var selectElement$1 = function selectElement(operationData) {
|
|
4067
4140
|
var selector = operationData.selector,
|
|
4068
|
-
_operationData$proper = operationData.propertyName,
|
|
4069
|
-
propertyName = _operationData$proper === void 0 ? 'selectedElement' : _operationData$proper,
|
|
4070
4141
|
_operationData$useSel = operationData.useSelectedElementAsRoot,
|
|
4071
4142
|
useSelectedElementAsRoot = _operationData$useSel === void 0 ? false : _operationData$useSel;
|
|
4072
4143
|
|
|
4073
4144
|
if (!selector) {
|
|
4074
|
-
throw new Error('selector is
|
|
4145
|
+
throw new Error('selectElement: selector is either empty or not defined.');
|
|
4075
4146
|
}
|
|
4076
4147
|
|
|
4077
|
-
if (useSelectedElementAsRoot && operationData
|
|
4078
|
-
var currentRoot = operationData
|
|
4079
|
-
findElementBySelector(currentRoot, selector
|
|
4148
|
+
if (useSelectedElementAsRoot && operationData.selectedElement) {
|
|
4149
|
+
var currentRoot = operationData.selectedElement;
|
|
4150
|
+
operationData.selectedElement = findElementBySelector(currentRoot, selector);
|
|
4080
4151
|
return operationData;
|
|
4081
4152
|
}
|
|
4082
4153
|
|
|
4083
4154
|
var rootCallback = function rootCallback(root) {
|
|
4084
|
-
findElementBySelector(root, selector
|
|
4155
|
+
operationData.selectedElement = findElementBySelector(root, selector);
|
|
4085
4156
|
};
|
|
4086
4157
|
|
|
4087
4158
|
this.eventbus.broadcast(TimelineEventNames.REQUEST_ENGINE_ROOT, [rootCallback]);
|
|
@@ -4170,19 +4241,15 @@ var setOperationData$1 = function setOperationData(operationData) {
|
|
|
4170
4241
|
/**
|
|
4171
4242
|
* This operation assigns the specified CSS style properties to the
|
|
4172
4243
|
* specified selected element. The selected element is assigned to
|
|
4173
|
-
* the
|
|
4174
|
-
* to 'selectedElement'.
|
|
4244
|
+
* the `selectedElement` property.
|
|
4175
4245
|
*
|
|
4176
4246
|
* @param operationData
|
|
4177
4247
|
* @returns
|
|
4178
4248
|
*/
|
|
4179
4249
|
|
|
4180
4250
|
var setStyle$1 = function setStyle(operationData) {
|
|
4181
|
-
var _operationData$proper = operationData.propertyName,
|
|
4182
|
-
propertyName = _operationData$proper === void 0 ? 'selectedElement' : _operationData$proper;
|
|
4183
4251
|
var properties = resolvePropertyValues(operationData, operationData.properties);
|
|
4184
|
-
operationData
|
|
4185
|
-
delete operationData.propertyName;
|
|
4252
|
+
operationData.selectedElement.css(properties);
|
|
4186
4253
|
return operationData;
|
|
4187
4254
|
};
|
|
4188
4255
|
|
|
@@ -4217,19 +4284,16 @@ var startAction$1 = function startAction(operationData) {
|
|
|
4217
4284
|
* This operation starts a loop using the given collection.
|
|
4218
4285
|
*
|
|
4219
4286
|
* Each iteration the current item from the specified collection is
|
|
4220
|
-
* assigned to the property on the current operation data
|
|
4221
|
-
* by the propertyName property which defaults to 'currentItem'.
|
|
4287
|
+
* assigned to the `currentItem` property on the current operation data.
|
|
4222
4288
|
*
|
|
4223
4289
|
* @param operationData
|
|
4224
4290
|
* @returns
|
|
4225
4291
|
*/
|
|
4226
4292
|
var startLoop$1 = function startLoop(operationData) {
|
|
4227
4293
|
var context = this;
|
|
4228
|
-
var collection = operationData.collection
|
|
4229
|
-
_operationData$proper = operationData.propertyName,
|
|
4230
|
-
propertyName = _operationData$proper === void 0 ? 'currentItem' : _operationData$proper;
|
|
4294
|
+
var collection = operationData.collection;
|
|
4231
4295
|
|
|
4232
|
-
if (
|
|
4296
|
+
if (collection !== null && !Array.isArray(collection)) {
|
|
4233
4297
|
throw new Error('Expected collection to be array type, string value was probably not resolved correctly');
|
|
4234
4298
|
}
|
|
4235
4299
|
|
|
@@ -4244,10 +4308,9 @@ var startLoop$1 = function startLoop(operationData) {
|
|
|
4244
4308
|
}
|
|
4245
4309
|
|
|
4246
4310
|
if (collection != null && collection.length && context.loopIndex !== undefined) {
|
|
4247
|
-
operationData
|
|
4311
|
+
operationData.currentItem = collection[context.loopIndex];
|
|
4248
4312
|
}
|
|
4249
4313
|
|
|
4250
|
-
delete operationData.propertyName;
|
|
4251
4314
|
return operationData;
|
|
4252
4315
|
};
|
|
4253
4316
|
|
|
@@ -4310,6 +4373,8 @@ var ops = {
|
|
|
4310
4373
|
getControllerInstance: getControllerInstance$1,
|
|
4311
4374
|
getElementDimensions: getElementDimensions$1,
|
|
4312
4375
|
getImport: getImport$1,
|
|
4376
|
+
getQueryParams: getQueryParams$1,
|
|
4377
|
+
invokeObjectMethod: invokeObjectMethod$1,
|
|
4313
4378
|
loadJSON: loadJSON$1,
|
|
4314
4379
|
log: log$1,
|
|
4315
4380
|
math: math$1,
|
|
@@ -4932,7 +4997,7 @@ function animate() {
|
|
|
4932
4997
|
required: true
|
|
4933
4998
|
},
|
|
4934
4999
|
animationDuration: {
|
|
4935
|
-
type: 'ParameterType:
|
|
5000
|
+
type: 'ParameterType:number',
|
|
4936
5001
|
required: true
|
|
4937
5002
|
}
|
|
4938
5003
|
}
|
|
@@ -4969,15 +5034,15 @@ function broadcastEvent() {
|
|
|
4969
5034
|
|
|
4970
5035
|
function calc() {
|
|
4971
5036
|
return {
|
|
4972
|
-
description: '
|
|
5037
|
+
description: 'Calculates the given left and right hand sides using the specified operator',
|
|
4973
5038
|
properties: {
|
|
4974
5039
|
left: {
|
|
4975
|
-
type: 'ParameterType:
|
|
5040
|
+
type: 'ParameterType:number',
|
|
4976
5041
|
description: 'The left operand',
|
|
4977
5042
|
required: true
|
|
4978
5043
|
},
|
|
4979
5044
|
right: {
|
|
4980
|
-
type: 'ParameterType:
|
|
5045
|
+
type: 'ParameterType:number',
|
|
4981
5046
|
description: 'The right operand',
|
|
4982
5047
|
required: true
|
|
4983
5048
|
},
|
|
@@ -4999,18 +5064,11 @@ function calc() {
|
|
|
4999
5064
|
}, {
|
|
5000
5065
|
value: '**',
|
|
5001
5066
|
description: 'Exponent: Raises a base number to the exponent power, that is, the base number multiplied by itself, exponent times.'
|
|
5002
|
-
}]
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
}
|
|
5067
|
+
}]
|
|
5068
|
+
},
|
|
5069
|
+
outputProperties: {
|
|
5070
|
+
calculationResult: 'ParameterType:number'
|
|
5007
5071
|
}
|
|
5008
|
-
/*outputProperties: {
|
|
5009
|
-
propertyName: {
|
|
5010
|
-
type: 'ParameterType:integer',
|
|
5011
|
-
},
|
|
5012
|
-
},*/
|
|
5013
|
-
|
|
5014
5072
|
};
|
|
5015
5073
|
}
|
|
5016
5074
|
|
|
@@ -5108,10 +5166,6 @@ function getControllerInstance() {
|
|
|
5108
5166
|
systemName: {
|
|
5109
5167
|
type: 'ParameterType:controllerName',
|
|
5110
5168
|
required: true
|
|
5111
|
-
},
|
|
5112
|
-
propertyName: {
|
|
5113
|
-
type: 'ParameterType:string',
|
|
5114
|
-
defaultValue: 'controllerInstance'
|
|
5115
5169
|
}
|
|
5116
5170
|
},
|
|
5117
5171
|
outputProperties: {
|
|
@@ -5148,6 +5202,35 @@ function getImport() {
|
|
|
5148
5202
|
};
|
|
5149
5203
|
}
|
|
5150
5204
|
|
|
5205
|
+
function getQueryParams() {
|
|
5206
|
+
return {
|
|
5207
|
+
description: "Retrieves the current query parameters from the browser's address bar",
|
|
5208
|
+
outputProperties: {
|
|
5209
|
+
queryParams: 'ParameterType:object'
|
|
5210
|
+
}
|
|
5211
|
+
};
|
|
5212
|
+
}
|
|
5213
|
+
|
|
5214
|
+
function invokeObjectMethod() {
|
|
5215
|
+
return {
|
|
5216
|
+
description: 'Invokes the specified method on the given object with the optional specified arguments',
|
|
5217
|
+
properties: {
|
|
5218
|
+
instance: {
|
|
5219
|
+
type: 'ParameterType:object',
|
|
5220
|
+
required: true
|
|
5221
|
+
},
|
|
5222
|
+
methodName: {
|
|
5223
|
+
type: 'ParameterType:string',
|
|
5224
|
+
required: true
|
|
5225
|
+
},
|
|
5226
|
+
methodArguments: 'ParameterType:array'
|
|
5227
|
+
},
|
|
5228
|
+
outputProperties: {
|
|
5229
|
+
methodResult: 'ParameterType:object'
|
|
5230
|
+
}
|
|
5231
|
+
};
|
|
5232
|
+
}
|
|
5233
|
+
|
|
5151
5234
|
function loadJSON() {
|
|
5152
5235
|
return {
|
|
5153
5236
|
description: 'Load JSON from the given url',
|
|
@@ -5156,11 +5239,7 @@ function loadJSON() {
|
|
|
5156
5239
|
type: 'ParameterType:url',
|
|
5157
5240
|
required: true
|
|
5158
5241
|
},
|
|
5159
|
-
cache: 'ParameterType:boolean'
|
|
5160
|
-
propertyName: {
|
|
5161
|
-
type: 'ParameterType:string',
|
|
5162
|
-
defaultValue: 'json'
|
|
5163
|
-
}
|
|
5242
|
+
cache: 'ParameterType:boolean'
|
|
5164
5243
|
},
|
|
5165
5244
|
outputProperties: {
|
|
5166
5245
|
json: 'ParameterType:object'
|
|
@@ -5183,10 +5262,7 @@ function math() {
|
|
|
5183
5262
|
required: true
|
|
5184
5263
|
},
|
|
5185
5264
|
functionName: createMathFunctionNames(),
|
|
5186
|
-
|
|
5187
|
-
type: 'ParameterType:string',
|
|
5188
|
-
defaultValue: 'mathResult'
|
|
5189
|
-
}
|
|
5265
|
+
mathResult: 'ParameterType:number'
|
|
5190
5266
|
}
|
|
5191
5267
|
};
|
|
5192
5268
|
}
|
|
@@ -5289,11 +5365,10 @@ function selectElement() {
|
|
|
5289
5365
|
type: 'ParameterType:selector',
|
|
5290
5366
|
required: true
|
|
5291
5367
|
},
|
|
5292
|
-
propertyName: 'ParameterType:string',
|
|
5293
5368
|
useSelectedElementAsRoot: 'ParameterType:boolean'
|
|
5294
5369
|
},
|
|
5295
5370
|
outputProperties: {
|
|
5296
|
-
selectedElement: 'ParameterType:
|
|
5371
|
+
selectedElement: 'ParameterType:jQuery'
|
|
5297
5372
|
}
|
|
5298
5373
|
};
|
|
5299
5374
|
}
|
|
@@ -5314,7 +5389,7 @@ function setElementAttributes() {
|
|
|
5314
5389
|
function setElementContent() {
|
|
5315
5390
|
return {
|
|
5316
5391
|
description: 'Sets the given HTML content in the selected element',
|
|
5317
|
-
dependentProperties: ['selectedElement'],
|
|
5392
|
+
dependentProperties: ['selectedElement', 'template'],
|
|
5318
5393
|
properties: {
|
|
5319
5394
|
insertionType: [{
|
|
5320
5395
|
value: 'overwrite',
|
|
@@ -5326,11 +5401,7 @@ function setElementContent() {
|
|
|
5326
5401
|
}, {
|
|
5327
5402
|
value: 'prepend',
|
|
5328
5403
|
description: 'the new content will be inserted before the current content'
|
|
5329
|
-
}]
|
|
5330
|
-
template: {
|
|
5331
|
-
type: 'ParameterType:htmlContent',
|
|
5332
|
-
required: true
|
|
5333
|
-
}
|
|
5404
|
+
}]
|
|
5334
5405
|
}
|
|
5335
5406
|
};
|
|
5336
5407
|
}
|
|
@@ -5356,10 +5427,7 @@ function setStyle() {
|
|
|
5356
5427
|
type: 'ParameterType:object',
|
|
5357
5428
|
required: true
|
|
5358
5429
|
},
|
|
5359
|
-
|
|
5360
|
-
type: 'ParameterType:string',
|
|
5361
|
-
required: false
|
|
5362
|
-
}
|
|
5430
|
+
selectedElement: 'ParameterType:jQuery'
|
|
5363
5431
|
}
|
|
5364
5432
|
};
|
|
5365
5433
|
}
|
|
@@ -5382,10 +5450,7 @@ function startLoop() {
|
|
|
5382
5450
|
type: 'ParameterType:array',
|
|
5383
5451
|
required: true
|
|
5384
5452
|
},
|
|
5385
|
-
|
|
5386
|
-
type: 'ParameterType:string',
|
|
5387
|
-
defaultValue: 'currentItem'
|
|
5388
|
-
}
|
|
5453
|
+
currentItem: 'ParameterType:object'
|
|
5389
5454
|
}
|
|
5390
5455
|
};
|
|
5391
5456
|
}
|
|
@@ -5415,7 +5480,7 @@ function wait() {
|
|
|
5415
5480
|
description: 'Waits the given amount of milliseconds before the action continues',
|
|
5416
5481
|
properties: {
|
|
5417
5482
|
milliseconds: {
|
|
5418
|
-
type: 'ParameterType:
|
|
5483
|
+
type: 'ParameterType:number',
|
|
5419
5484
|
required: true
|
|
5420
5485
|
}
|
|
5421
5486
|
}
|
|
@@ -5441,6 +5506,8 @@ var index = {
|
|
|
5441
5506
|
getControllerInstance: getControllerInstance,
|
|
5442
5507
|
getElementDimensions: getElementDimensions,
|
|
5443
5508
|
getImport: getImport,
|
|
5509
|
+
getQueryParams: getQueryParams,
|
|
5510
|
+
invokeObjectMethod: invokeObjectMethod,
|
|
5444
5511
|
loadJSON: loadJSON,
|
|
5445
5512
|
log: log,
|
|
5446
5513
|
math: math,
|
|
@@ -5463,5 +5530,5 @@ var index = {
|
|
|
5463
5530
|
wait: wait
|
|
5464
5531
|
};
|
|
5465
5532
|
|
|
5466
|
-
export { Action, ActionRegistryEventbusListener, ConfigurationResolver, DEV_TOOLS_KEY, DevToolEventListener, Diagnostics, EligiusEngine, EligiusResourceImporter, EndableAction, EngineFactory, EventListenerController, Eventbus, JwPlayerTimelineProvider, LabelController, LanguageManager, LottieController, NavigationController, ProgressbarController, RequestAnimationFrameTimelineProvider, RequestVideoUriInterceptor, RoutingController, SubtitlesController, TimelineAction, TimelineEventNames, 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, extendController$1 as extendController, generateImporterSourceCode, getControllerFromElement$1 as getControllerFromElement, getControllerInstance$1 as getControllerInstance, getElementDimensions$1 as getElementDimensions, getImport$1 as getImport, loadJSON$1 as loadJSON, log$1 as log, math$1 as math, index as metadata, 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, 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$1 as wait };
|
|
5533
|
+
export { Action, ActionRegistryEventbusListener, ConfigurationResolver, DEV_TOOLS_KEY, DevToolEventListener, Diagnostics, EligiusEngine, EligiusResourceImporter, EndableAction, EngineFactory, EventListenerController, Eventbus, JwPlayerTimelineProvider, LabelController, LanguageManager, LottieController, NavigationController, ProgressbarController, RequestAnimationFrameTimelineProvider, RequestVideoUriInterceptor, RoutingController, SubtitlesController, TimelineAction, TimelineEventNames, 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, 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, index as metadata, 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, 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$1 as wait };
|
|
5467
5534
|
//# sourceMappingURL=eligius.esm.js.map
|