eligius 1.0.8 → 1.0.9
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 +2 -2
- package/dist/controllers/label-controller.d.ts +3 -0
- package/dist/eligius-engine.d.ts +15 -4
- package/dist/eligius.cjs.development.js +202 -144
- 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 +201 -145
- 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,7 @@ 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
428
|
return Object.fromEntries(Object.entries(value).map(function (_ref) {
|
|
429
429
|
var propName = _ref[0],
|
|
430
430
|
propValue = _ref[1];
|
|
@@ -1240,6 +1240,7 @@ var LabelController = /*#__PURE__*/function () {
|
|
|
1240
1240
|
this.operationData = null;
|
|
1241
1241
|
this.labelData = {};
|
|
1242
1242
|
this.name = 'LabelController';
|
|
1243
|
+
this.requestLabelDataBound = void 0;
|
|
1243
1244
|
}
|
|
1244
1245
|
|
|
1245
1246
|
var _proto = LabelController.prototype;
|
|
@@ -1248,6 +1249,13 @@ var LabelController = /*#__PURE__*/function () {
|
|
|
1248
1249
|
this.operationData = Object.assign({}, operationData);
|
|
1249
1250
|
};
|
|
1250
1251
|
|
|
1252
|
+
_proto.setLabelId = function setLabelId(newLabelId) {
|
|
1253
|
+
if (this.requestLabelDataBound) {
|
|
1254
|
+
this.requestLabelDataBound(newLabelId);
|
|
1255
|
+
this.setLabel();
|
|
1256
|
+
}
|
|
1257
|
+
};
|
|
1258
|
+
|
|
1251
1259
|
_proto.attach = function attach(eventbus) {
|
|
1252
1260
|
var _this = this;
|
|
1253
1261
|
|
|
@@ -1258,13 +1266,20 @@ var LabelController = /*#__PURE__*/function () {
|
|
|
1258
1266
|
eventbus.broadcast(TimelineEventNames.REQUEST_CURRENT_LANGUAGE, [function (language) {
|
|
1259
1267
|
_this.currentLanguage = language;
|
|
1260
1268
|
}]);
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
}]);
|
|
1269
|
+
this.requestLabelDataBound = this.requestLabelData.bind(this, eventbus);
|
|
1270
|
+
this.requestLabelDataBound(this.operationData.labelId);
|
|
1264
1271
|
this.setLabel();
|
|
1265
1272
|
this.listeners.push(eventbus.on(TimelineEventNames.LANGUAGE_CHANGE, this.handleLanguageChange.bind(this)));
|
|
1266
1273
|
};
|
|
1267
1274
|
|
|
1275
|
+
_proto.requestLabelData = function requestLabelData(eventbus, labelId) {
|
|
1276
|
+
var _this2 = this;
|
|
1277
|
+
|
|
1278
|
+
eventbus.broadcast(TimelineEventNames.REQUEST_LABEL_COLLECTION, [labelId, function (labelCollection) {
|
|
1279
|
+
_this2.createTextDataLookup(labelCollection);
|
|
1280
|
+
}]);
|
|
1281
|
+
};
|
|
1282
|
+
|
|
1268
1283
|
_proto.setLabel = function setLabel() {
|
|
1269
1284
|
if (this.currentLanguage) {
|
|
1270
1285
|
var _this$operationData;
|
|
@@ -1275,8 +1290,9 @@ var LabelController = /*#__PURE__*/function () {
|
|
|
1275
1290
|
|
|
1276
1291
|
_proto.detach = function detach(_eventbus) {
|
|
1277
1292
|
this.listeners.forEach(function (func) {
|
|
1278
|
-
func();
|
|
1293
|
+
return func();
|
|
1279
1294
|
});
|
|
1295
|
+
this.requestLabelDataBound = undefined;
|
|
1280
1296
|
};
|
|
1281
1297
|
|
|
1282
1298
|
_proto.handleLanguageChange = function handleLanguageChange(code) {
|
|
@@ -1285,10 +1301,10 @@ var LabelController = /*#__PURE__*/function () {
|
|
|
1285
1301
|
};
|
|
1286
1302
|
|
|
1287
1303
|
_proto.createTextDataLookup = function createTextDataLookup(data) {
|
|
1288
|
-
var
|
|
1304
|
+
var _this3 = this;
|
|
1289
1305
|
|
|
1290
1306
|
data.forEach(function (d) {
|
|
1291
|
-
|
|
1307
|
+
_this3.labelData[d.languageCode] = d.label;
|
|
1292
1308
|
});
|
|
1293
1309
|
};
|
|
1294
1310
|
|
|
@@ -2042,9 +2058,8 @@ var ctrls = {
|
|
|
2042
2058
|
};
|
|
2043
2059
|
|
|
2044
2060
|
/**
|
|
2045
|
-
*
|
|
2046
|
-
* the given timeline provider and triggering the actions associated with
|
|
2047
|
-
* ...
|
|
2061
|
+
* This is where the magic happens. The engine is responsible for starting and stopping
|
|
2062
|
+
* the given timeline provider and triggering the actions associated with the positions along the timeline.
|
|
2048
2063
|
*/
|
|
2049
2064
|
|
|
2050
2065
|
var EligiusEngine = /*#__PURE__*/function () {
|
|
@@ -2063,6 +2078,11 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
2063
2078
|
this.timelineProviders = timelineProviders;
|
|
2064
2079
|
this.languageManager = languageManager;
|
|
2065
2080
|
}
|
|
2081
|
+
/**
|
|
2082
|
+
* Initializes the engine by creating the HTML layout and the first time line
|
|
2083
|
+
* by executing its initActions.
|
|
2084
|
+
*/
|
|
2085
|
+
|
|
2066
2086
|
|
|
2067
2087
|
var _proto = EligiusEngine.prototype;
|
|
2068
2088
|
|
|
@@ -2182,9 +2202,20 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
2182
2202
|
}
|
|
2183
2203
|
|
|
2184
2204
|
return _cleanUp;
|
|
2185
|
-
}()
|
|
2186
|
-
|
|
2187
|
-
|
|
2205
|
+
}()
|
|
2206
|
+
/**
|
|
2207
|
+
* Cleans up all the necessary parts that the engine initialized.
|
|
2208
|
+
* - It ends the currently active operations and the init actions.
|
|
2209
|
+
* - It removes all its eventbus listeners, handlers and interceptors.
|
|
2210
|
+
* - It destroys all of its timeline providers
|
|
2211
|
+
* - It empties the HTML element indicated by the containerSelector configuration property.
|
|
2212
|
+
*
|
|
2213
|
+
*/
|
|
2214
|
+
;
|
|
2215
|
+
|
|
2216
|
+
_proto.destroy =
|
|
2217
|
+
/*#__PURE__*/
|
|
2218
|
+
function () {
|
|
2188
2219
|
var _destroy = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
2189
2220
|
var containerSelector, container;
|
|
2190
2221
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
@@ -2285,13 +2316,11 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
2285
2316
|
}
|
|
2286
2317
|
|
|
2287
2318
|
if (isFinite(end)) {
|
|
2288
|
-
var _timeLineAction$id2;
|
|
2289
|
-
|
|
2290
2319
|
var timelineEndPositions = this._initializeTimelinePosition(this._timeLineActionsLookup[uri], end);
|
|
2291
2320
|
|
|
2292
2321
|
var endMethod = timeLineAction.end.bind(timeLineAction);
|
|
2293
2322
|
|
|
2294
|
-
if (
|
|
2323
|
+
if (!timeLineAction.id) {
|
|
2295
2324
|
endMethod.id = timeLineAction.id;
|
|
2296
2325
|
}
|
|
2297
2326
|
|
|
@@ -3381,10 +3410,8 @@ var calc$1 = function calc(operationData) {
|
|
|
3381
3410
|
var _operationData = operationData,
|
|
3382
3411
|
left = _operationData.left,
|
|
3383
3412
|
right = _operationData.right,
|
|
3384
|
-
operator = _operationData.operator
|
|
3385
|
-
|
|
3386
|
-
propertyName = _operationData$proper === void 0 ? 'calculationResult' : _operationData$proper;
|
|
3387
|
-
operationData[propertyName] = calcFunctions[operator](+left, +right);
|
|
3413
|
+
operator = _operationData.operator;
|
|
3414
|
+
operationData.calculationResult = calcFunctions[operator](+left, +right);
|
|
3388
3415
|
return operationData;
|
|
3389
3416
|
};
|
|
3390
3417
|
|
|
@@ -3429,17 +3456,14 @@ var createElement$1 = function createElement(operationData) {
|
|
|
3429
3456
|
var _operationData = operationData,
|
|
3430
3457
|
elementName = _operationData.elementName,
|
|
3431
3458
|
attributes = _operationData.attributes,
|
|
3432
|
-
text = _operationData.text
|
|
3433
|
-
_operationData$proper = _operationData.propertyName,
|
|
3434
|
-
propertyName = _operationData$proper === void 0 ? 'template' : _operationData$proper;
|
|
3459
|
+
text = _operationData.text;
|
|
3435
3460
|
var serializedAttrs = attributes ? ' ' + Object.entries(attributes).map(function (_ref) {
|
|
3436
3461
|
var key = _ref[0],
|
|
3437
3462
|
value = _ref[1];
|
|
3438
3463
|
return key + "=\"" + value + "\"";
|
|
3439
3464
|
}).join(' ') : '';
|
|
3440
3465
|
var template = text ? $("<" + elementName + serializedAttrs + ">" + text + "</" + elementName + ">") : $("<" + elementName + serializedAttrs + "/>");
|
|
3441
|
-
operationData
|
|
3442
|
-
delete operationData.propertyName;
|
|
3466
|
+
operationData.template = template;
|
|
3443
3467
|
return operationData;
|
|
3444
3468
|
};
|
|
3445
3469
|
|
|
@@ -3553,25 +3577,21 @@ var getControllerFromElement$1 = function getControllerFromElement(operationData
|
|
|
3553
3577
|
|
|
3554
3578
|
/**
|
|
3555
3579
|
* 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'.
|
|
3580
|
+
* It assigns this instance to the `controllerInstance` property on the current operation data
|
|
3558
3581
|
*
|
|
3559
3582
|
* @param operationData
|
|
3560
3583
|
* @returns
|
|
3561
3584
|
*/
|
|
3562
3585
|
|
|
3563
3586
|
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;
|
|
3587
|
+
var systemName = operationData.systemName;
|
|
3588
|
+
operationData.controllerInstance = undefined;
|
|
3568
3589
|
|
|
3569
3590
|
var resultCallback = function resultCallback(instance) {
|
|
3570
|
-
operationData
|
|
3591
|
+
operationData.controllerInstance = instance;
|
|
3571
3592
|
};
|
|
3572
3593
|
|
|
3573
3594
|
this.eventbus.broadcast(TimelineEventNames.REQUEST_INSTANCE, [systemName, resultCallback]);
|
|
3574
|
-
delete operationData.propertyName;
|
|
3575
3595
|
return operationData;
|
|
3576
3596
|
};
|
|
3577
3597
|
|
|
@@ -3811,13 +3831,58 @@ var getImport$1 = function getImport(operationData) {
|
|
|
3811
3831
|
return operationData;
|
|
3812
3832
|
};
|
|
3813
3833
|
|
|
3834
|
+
/**
|
|
3835
|
+
* This operation retrieves the current query parameters from the browser's address bar and places
|
|
3836
|
+
* them on the returned operation data.
|
|
3837
|
+
*
|
|
3838
|
+
* @param operationData
|
|
3839
|
+
* @returns
|
|
3840
|
+
*/
|
|
3841
|
+
var getQueryParams$1 = function getQueryParams(operationData) {
|
|
3842
|
+
var searchParams = new URLSearchParams(window.location.search);
|
|
3843
|
+
var queryParams = Object.fromEntries(searchParams.entries());
|
|
3844
|
+
var defaultValues = operationData.defaultValues;
|
|
3845
|
+
|
|
3846
|
+
if (defaultValues) {
|
|
3847
|
+
var defaultEntries = Object.entries(defaultValues).filter(function (_ref) {
|
|
3848
|
+
var name = _ref[0];
|
|
3849
|
+
return !(name in queryParams);
|
|
3850
|
+
});
|
|
3851
|
+
defaultEntries.forEach(function (_ref2) {
|
|
3852
|
+
var name = _ref2[0],
|
|
3853
|
+
value = _ref2[1];
|
|
3854
|
+
return queryParams[name] = value;
|
|
3855
|
+
});
|
|
3856
|
+
delete operationData.defaultValues;
|
|
3857
|
+
}
|
|
3858
|
+
|
|
3859
|
+
operationData.queryParams = queryParams;
|
|
3860
|
+
return operationData;
|
|
3861
|
+
};
|
|
3862
|
+
|
|
3863
|
+
/**
|
|
3864
|
+
* This operation invokes the specified method on the given object with the optional specified arguments
|
|
3865
|
+
* and assigns the result to the `methodResult` property.
|
|
3866
|
+
*
|
|
3867
|
+
* @param operationData
|
|
3868
|
+
* @returns
|
|
3869
|
+
*/
|
|
3870
|
+
var invokeObjectMethod$1 = function invokeObjectMethod(operationData) {
|
|
3871
|
+
var methodName = operationData.methodName,
|
|
3872
|
+
methodArguments = operationData.methodArguments;
|
|
3873
|
+
delete operationData.methodName;
|
|
3874
|
+
delete operationData.methodArguments;
|
|
3875
|
+
operationData.methodResult = operationData.instance[methodName].apply(operationData.instance, methodArguments != null ? methodArguments : []);
|
|
3876
|
+
return operationData;
|
|
3877
|
+
};
|
|
3878
|
+
|
|
3814
3879
|
var jsonCache = {};
|
|
3815
3880
|
var addToCache = function addToCache(key, value) {
|
|
3816
3881
|
jsonCache[key] = value;
|
|
3817
3882
|
};
|
|
3818
3883
|
/**
|
|
3819
|
-
* This operation loads a JSON file from the specified url and assigns it to the
|
|
3820
|
-
* property
|
|
3884
|
+
* This operation loads a JSON file from the specified url and assigns it to the json
|
|
3885
|
+
* property on the current operation data.
|
|
3821
3886
|
*
|
|
3822
3887
|
* If the cache property is set to true and a cached value already exists, this is assigned
|
|
3823
3888
|
* instead of re-retrieving it from the url.
|
|
@@ -3828,47 +3893,41 @@ var addToCache = function addToCache(key, value) {
|
|
|
3828
3893
|
|
|
3829
3894
|
var loadJSON$1 = function loadJSON(operationData) {
|
|
3830
3895
|
var url = operationData.url,
|
|
3831
|
-
cache = operationData.cache
|
|
3832
|
-
_operationData$proper = operationData.propertyName,
|
|
3833
|
-
propertyName = _operationData$proper === void 0 ? 'json' : _operationData$proper;
|
|
3896
|
+
cache = operationData.cache;
|
|
3834
3897
|
|
|
3835
3898
|
if (cache && jsonCache[url]) {
|
|
3836
|
-
operationData
|
|
3837
|
-
delete operationData.propertyName;
|
|
3899
|
+
operationData.json = jsonCache[url];
|
|
3838
3900
|
return operationData;
|
|
3839
3901
|
}
|
|
3840
3902
|
|
|
3841
|
-
return
|
|
3842
|
-
|
|
3843
|
-
var
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
return response.json();
|
|
3903
|
+
return fetch(url).then( /*#__PURE__*/function () {
|
|
3904
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(response) {
|
|
3905
|
+
var json, cacheValue;
|
|
3906
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3907
|
+
while (1) {
|
|
3908
|
+
switch (_context.prev = _context.next) {
|
|
3909
|
+
case 0:
|
|
3910
|
+
_context.next = 2;
|
|
3911
|
+
return response.json();
|
|
3851
3912
|
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
resolve(operationData);
|
|
3913
|
+
case 2:
|
|
3914
|
+
json = _context.sent;
|
|
3915
|
+
cacheValue = operationData.json = json;
|
|
3916
|
+
addToCache(url, cacheValue);
|
|
3917
|
+
return _context.abrupt("return", operationData);
|
|
3858
3918
|
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
}
|
|
3919
|
+
case 6:
|
|
3920
|
+
case "end":
|
|
3921
|
+
return _context.stop();
|
|
3863
3922
|
}
|
|
3864
|
-
}
|
|
3865
|
-
})
|
|
3923
|
+
}
|
|
3924
|
+
}, _callee);
|
|
3925
|
+
}));
|
|
3866
3926
|
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
});
|
|
3927
|
+
return function (_x) {
|
|
3928
|
+
return _ref.apply(this, arguments);
|
|
3929
|
+
};
|
|
3930
|
+
}());
|
|
3872
3931
|
};
|
|
3873
3932
|
|
|
3874
3933
|
/**
|
|
@@ -3900,10 +3959,8 @@ var math$1 = function math(operationData) {
|
|
|
3900
3959
|
operationData.args = resolveMathConstants(operationData.args);
|
|
3901
3960
|
var _operationData = operationData,
|
|
3902
3961
|
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);
|
|
3962
|
+
functionName = _operationData.functionName;
|
|
3963
|
+
operationData.mathResult = Math[functionName].apply(null, args);
|
|
3907
3964
|
return operationData;
|
|
3908
3965
|
};
|
|
3909
3966
|
|
|
@@ -3972,17 +4029,22 @@ var removeElement$1 = function removeElement(operationData) {
|
|
|
3972
4029
|
|
|
3973
4030
|
/**
|
|
3974
4031
|
* This operation removes the given list of properties from the current operation data.
|
|
4032
|
+
* It will also omit the property 'propertyNames' from the result.
|
|
3975
4033
|
*
|
|
3976
4034
|
* @param operationData
|
|
3977
4035
|
* @returns
|
|
3978
4036
|
*/
|
|
3979
4037
|
var removePropertiesFromOperationData$1 = function removePropertiesFromOperationData(operationData) {
|
|
3980
4038
|
var propertyNames = operationData.propertyNames;
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
4039
|
+
|
|
4040
|
+
if (propertyNames.indexOf('propertyNames') < 0) {
|
|
4041
|
+
propertyNames.push('propertyNames');
|
|
4042
|
+
}
|
|
4043
|
+
|
|
4044
|
+
return Object.fromEntries(Object.entries(operationData).filter(function (_ref) {
|
|
4045
|
+
var name = _ref[0];
|
|
4046
|
+
return !propertyNames.includes(name);
|
|
4047
|
+
}));
|
|
3986
4048
|
};
|
|
3987
4049
|
|
|
3988
4050
|
/**
|
|
@@ -4038,25 +4100,21 @@ var resizeAction$1 = function resizeAction(operationData) {
|
|
|
4038
4100
|
return operationData;
|
|
4039
4101
|
};
|
|
4040
4102
|
|
|
4041
|
-
function findElementBySelector(root, selector
|
|
4103
|
+
function findElementBySelector(root, selector) {
|
|
4042
4104
|
var element = root.find(selector);
|
|
4043
4105
|
|
|
4044
4106
|
if (!element.length) {
|
|
4045
4107
|
console.warn("selector '" + selector + "' wasn't found!");
|
|
4046
4108
|
}
|
|
4047
4109
|
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
if (operationData.hasOwnProperty('propertyName')) {
|
|
4051
|
-
delete operationData.propertyName;
|
|
4052
|
-
}
|
|
4110
|
+
return element;
|
|
4053
4111
|
}
|
|
4054
4112
|
/**
|
|
4055
4113
|
* This operation selects one or more elements using the specified selector.
|
|
4056
4114
|
*
|
|
4057
4115
|
* 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
|
|
4116
|
+
* to the current operation data's `selectedElement` property
|
|
4117
|
+
* then the element will be looked for only in the descendant elements of this DOM element.
|
|
4060
4118
|
*
|
|
4061
4119
|
* @param operationData
|
|
4062
4120
|
* @returns
|
|
@@ -4065,23 +4123,21 @@ function findElementBySelector(root, selector, operationData, propertyName) {
|
|
|
4065
4123
|
|
|
4066
4124
|
var selectElement$1 = function selectElement(operationData) {
|
|
4067
4125
|
var selector = operationData.selector,
|
|
4068
|
-
_operationData$proper = operationData.propertyName,
|
|
4069
|
-
propertyName = _operationData$proper === void 0 ? 'selectedElement' : _operationData$proper,
|
|
4070
4126
|
_operationData$useSel = operationData.useSelectedElementAsRoot,
|
|
4071
4127
|
useSelectedElementAsRoot = _operationData$useSel === void 0 ? false : _operationData$useSel;
|
|
4072
4128
|
|
|
4073
4129
|
if (!selector) {
|
|
4074
|
-
throw new Error('selector is
|
|
4130
|
+
throw new Error('selectElement: selector is either empty or not defined.');
|
|
4075
4131
|
}
|
|
4076
4132
|
|
|
4077
|
-
if (useSelectedElementAsRoot && operationData
|
|
4078
|
-
var currentRoot = operationData
|
|
4079
|
-
findElementBySelector(currentRoot, selector
|
|
4133
|
+
if (useSelectedElementAsRoot && operationData.selectedElement) {
|
|
4134
|
+
var currentRoot = operationData.selectedElement;
|
|
4135
|
+
operationData.selectedElement = findElementBySelector(currentRoot, selector);
|
|
4080
4136
|
return operationData;
|
|
4081
4137
|
}
|
|
4082
4138
|
|
|
4083
4139
|
var rootCallback = function rootCallback(root) {
|
|
4084
|
-
findElementBySelector(root, selector
|
|
4140
|
+
operationData.selectedElement = findElementBySelector(root, selector);
|
|
4085
4141
|
};
|
|
4086
4142
|
|
|
4087
4143
|
this.eventbus.broadcast(TimelineEventNames.REQUEST_ENGINE_ROOT, [rootCallback]);
|
|
@@ -4170,19 +4226,15 @@ var setOperationData$1 = function setOperationData(operationData) {
|
|
|
4170
4226
|
/**
|
|
4171
4227
|
* This operation assigns the specified CSS style properties to the
|
|
4172
4228
|
* specified selected element. The selected element is assigned to
|
|
4173
|
-
* the
|
|
4174
|
-
* to 'selectedElement'.
|
|
4229
|
+
* the `selectedElement` property.
|
|
4175
4230
|
*
|
|
4176
4231
|
* @param operationData
|
|
4177
4232
|
* @returns
|
|
4178
4233
|
*/
|
|
4179
4234
|
|
|
4180
4235
|
var setStyle$1 = function setStyle(operationData) {
|
|
4181
|
-
var _operationData$proper = operationData.propertyName,
|
|
4182
|
-
propertyName = _operationData$proper === void 0 ? 'selectedElement' : _operationData$proper;
|
|
4183
4236
|
var properties = resolvePropertyValues(operationData, operationData.properties);
|
|
4184
|
-
operationData
|
|
4185
|
-
delete operationData.propertyName;
|
|
4237
|
+
operationData.selectedElement.css(properties);
|
|
4186
4238
|
return operationData;
|
|
4187
4239
|
};
|
|
4188
4240
|
|
|
@@ -4217,19 +4269,16 @@ var startAction$1 = function startAction(operationData) {
|
|
|
4217
4269
|
* This operation starts a loop using the given collection.
|
|
4218
4270
|
*
|
|
4219
4271
|
* 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'.
|
|
4272
|
+
* assigned to the `currentItem` property on the current operation data.
|
|
4222
4273
|
*
|
|
4223
4274
|
* @param operationData
|
|
4224
4275
|
* @returns
|
|
4225
4276
|
*/
|
|
4226
4277
|
var startLoop$1 = function startLoop(operationData) {
|
|
4227
4278
|
var context = this;
|
|
4228
|
-
var collection = operationData.collection
|
|
4229
|
-
_operationData$proper = operationData.propertyName,
|
|
4230
|
-
propertyName = _operationData$proper === void 0 ? 'currentItem' : _operationData$proper;
|
|
4279
|
+
var collection = operationData.collection;
|
|
4231
4280
|
|
|
4232
|
-
if (
|
|
4281
|
+
if (collection !== null && !Array.isArray(collection)) {
|
|
4233
4282
|
throw new Error('Expected collection to be array type, string value was probably not resolved correctly');
|
|
4234
4283
|
}
|
|
4235
4284
|
|
|
@@ -4244,10 +4293,9 @@ var startLoop$1 = function startLoop(operationData) {
|
|
|
4244
4293
|
}
|
|
4245
4294
|
|
|
4246
4295
|
if (collection != null && collection.length && context.loopIndex !== undefined) {
|
|
4247
|
-
operationData
|
|
4296
|
+
operationData.currentItem = collection[context.loopIndex];
|
|
4248
4297
|
}
|
|
4249
4298
|
|
|
4250
|
-
delete operationData.propertyName;
|
|
4251
4299
|
return operationData;
|
|
4252
4300
|
};
|
|
4253
4301
|
|
|
@@ -4310,6 +4358,8 @@ var ops = {
|
|
|
4310
4358
|
getControllerInstance: getControllerInstance$1,
|
|
4311
4359
|
getElementDimensions: getElementDimensions$1,
|
|
4312
4360
|
getImport: getImport$1,
|
|
4361
|
+
getQueryParams: getQueryParams$1,
|
|
4362
|
+
invokeObjectMethod: invokeObjectMethod$1,
|
|
4313
4363
|
loadJSON: loadJSON$1,
|
|
4314
4364
|
log: log$1,
|
|
4315
4365
|
math: math$1,
|
|
@@ -4932,7 +4982,7 @@ function animate() {
|
|
|
4932
4982
|
required: true
|
|
4933
4983
|
},
|
|
4934
4984
|
animationDuration: {
|
|
4935
|
-
type: 'ParameterType:
|
|
4985
|
+
type: 'ParameterType:number',
|
|
4936
4986
|
required: true
|
|
4937
4987
|
}
|
|
4938
4988
|
}
|
|
@@ -4969,15 +5019,15 @@ function broadcastEvent() {
|
|
|
4969
5019
|
|
|
4970
5020
|
function calc() {
|
|
4971
5021
|
return {
|
|
4972
|
-
description: '
|
|
5022
|
+
description: 'Calculates the given left and right hand sides using the specified operator',
|
|
4973
5023
|
properties: {
|
|
4974
5024
|
left: {
|
|
4975
|
-
type: 'ParameterType:
|
|
5025
|
+
type: 'ParameterType:number',
|
|
4976
5026
|
description: 'The left operand',
|
|
4977
5027
|
required: true
|
|
4978
5028
|
},
|
|
4979
5029
|
right: {
|
|
4980
|
-
type: 'ParameterType:
|
|
5030
|
+
type: 'ParameterType:number',
|
|
4981
5031
|
description: 'The right operand',
|
|
4982
5032
|
required: true
|
|
4983
5033
|
},
|
|
@@ -4999,18 +5049,11 @@ function calc() {
|
|
|
4999
5049
|
}, {
|
|
5000
5050
|
value: '**',
|
|
5001
5051
|
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
|
-
}
|
|
5052
|
+
}]
|
|
5053
|
+
},
|
|
5054
|
+
outputProperties: {
|
|
5055
|
+
calculationResult: 'ParameterType:number'
|
|
5007
5056
|
}
|
|
5008
|
-
/*outputProperties: {
|
|
5009
|
-
propertyName: {
|
|
5010
|
-
type: 'ParameterType:integer',
|
|
5011
|
-
},
|
|
5012
|
-
},*/
|
|
5013
|
-
|
|
5014
5057
|
};
|
|
5015
5058
|
}
|
|
5016
5059
|
|
|
@@ -5108,10 +5151,6 @@ function getControllerInstance() {
|
|
|
5108
5151
|
systemName: {
|
|
5109
5152
|
type: 'ParameterType:controllerName',
|
|
5110
5153
|
required: true
|
|
5111
|
-
},
|
|
5112
|
-
propertyName: {
|
|
5113
|
-
type: 'ParameterType:string',
|
|
5114
|
-
defaultValue: 'controllerInstance'
|
|
5115
5154
|
}
|
|
5116
5155
|
},
|
|
5117
5156
|
outputProperties: {
|
|
@@ -5148,6 +5187,35 @@ function getImport() {
|
|
|
5148
5187
|
};
|
|
5149
5188
|
}
|
|
5150
5189
|
|
|
5190
|
+
function getQueryParams() {
|
|
5191
|
+
return {
|
|
5192
|
+
description: "Retrieves the current query parameters from the browser's address bar",
|
|
5193
|
+
outputProperties: {
|
|
5194
|
+
queryParams: 'ParameterType:object'
|
|
5195
|
+
}
|
|
5196
|
+
};
|
|
5197
|
+
}
|
|
5198
|
+
|
|
5199
|
+
function invokeObjectMethod() {
|
|
5200
|
+
return {
|
|
5201
|
+
description: 'Invokes the specified method on the given object with the optional specified arguments',
|
|
5202
|
+
properties: {
|
|
5203
|
+
instance: {
|
|
5204
|
+
type: 'ParameterType:object',
|
|
5205
|
+
required: true
|
|
5206
|
+
},
|
|
5207
|
+
methodName: {
|
|
5208
|
+
type: 'ParameterType:string',
|
|
5209
|
+
required: true
|
|
5210
|
+
},
|
|
5211
|
+
methodArguments: 'ParameterType:array'
|
|
5212
|
+
},
|
|
5213
|
+
outputProperties: {
|
|
5214
|
+
methodResult: 'ParameterType:object'
|
|
5215
|
+
}
|
|
5216
|
+
};
|
|
5217
|
+
}
|
|
5218
|
+
|
|
5151
5219
|
function loadJSON() {
|
|
5152
5220
|
return {
|
|
5153
5221
|
description: 'Load JSON from the given url',
|
|
@@ -5156,11 +5224,7 @@ function loadJSON() {
|
|
|
5156
5224
|
type: 'ParameterType:url',
|
|
5157
5225
|
required: true
|
|
5158
5226
|
},
|
|
5159
|
-
cache: 'ParameterType:boolean'
|
|
5160
|
-
propertyName: {
|
|
5161
|
-
type: 'ParameterType:string',
|
|
5162
|
-
defaultValue: 'json'
|
|
5163
|
-
}
|
|
5227
|
+
cache: 'ParameterType:boolean'
|
|
5164
5228
|
},
|
|
5165
5229
|
outputProperties: {
|
|
5166
5230
|
json: 'ParameterType:object'
|
|
@@ -5183,10 +5247,7 @@ function math() {
|
|
|
5183
5247
|
required: true
|
|
5184
5248
|
},
|
|
5185
5249
|
functionName: createMathFunctionNames(),
|
|
5186
|
-
|
|
5187
|
-
type: 'ParameterType:string',
|
|
5188
|
-
defaultValue: 'mathResult'
|
|
5189
|
-
}
|
|
5250
|
+
mathResult: 'ParameterType:number'
|
|
5190
5251
|
}
|
|
5191
5252
|
};
|
|
5192
5253
|
}
|
|
@@ -5289,11 +5350,10 @@ function selectElement() {
|
|
|
5289
5350
|
type: 'ParameterType:selector',
|
|
5290
5351
|
required: true
|
|
5291
5352
|
},
|
|
5292
|
-
propertyName: 'ParameterType:string',
|
|
5293
5353
|
useSelectedElementAsRoot: 'ParameterType:boolean'
|
|
5294
5354
|
},
|
|
5295
5355
|
outputProperties: {
|
|
5296
|
-
selectedElement: 'ParameterType:
|
|
5356
|
+
selectedElement: 'ParameterType:jQuery'
|
|
5297
5357
|
}
|
|
5298
5358
|
};
|
|
5299
5359
|
}
|
|
@@ -5356,10 +5416,7 @@ function setStyle() {
|
|
|
5356
5416
|
type: 'ParameterType:object',
|
|
5357
5417
|
required: true
|
|
5358
5418
|
},
|
|
5359
|
-
|
|
5360
|
-
type: 'ParameterType:string',
|
|
5361
|
-
required: false
|
|
5362
|
-
}
|
|
5419
|
+
selectedElement: 'ParameterType:jQuery'
|
|
5363
5420
|
}
|
|
5364
5421
|
};
|
|
5365
5422
|
}
|
|
@@ -5382,10 +5439,7 @@ function startLoop() {
|
|
|
5382
5439
|
type: 'ParameterType:array',
|
|
5383
5440
|
required: true
|
|
5384
5441
|
},
|
|
5385
|
-
|
|
5386
|
-
type: 'ParameterType:string',
|
|
5387
|
-
defaultValue: 'currentItem'
|
|
5388
|
-
}
|
|
5442
|
+
currentItem: 'ParameterType:object'
|
|
5389
5443
|
}
|
|
5390
5444
|
};
|
|
5391
5445
|
}
|
|
@@ -5415,7 +5469,7 @@ function wait() {
|
|
|
5415
5469
|
description: 'Waits the given amount of milliseconds before the action continues',
|
|
5416
5470
|
properties: {
|
|
5417
5471
|
milliseconds: {
|
|
5418
|
-
type: 'ParameterType:
|
|
5472
|
+
type: 'ParameterType:number',
|
|
5419
5473
|
required: true
|
|
5420
5474
|
}
|
|
5421
5475
|
}
|
|
@@ -5441,6 +5495,8 @@ var index = {
|
|
|
5441
5495
|
getControllerInstance: getControllerInstance,
|
|
5442
5496
|
getElementDimensions: getElementDimensions,
|
|
5443
5497
|
getImport: getImport,
|
|
5498
|
+
getQueryParams: getQueryParams,
|
|
5499
|
+
invokeObjectMethod: invokeObjectMethod,
|
|
5444
5500
|
loadJSON: loadJSON,
|
|
5445
5501
|
log: log,
|
|
5446
5502
|
math: math,
|
|
@@ -5463,5 +5519,5 @@ var index = {
|
|
|
5463
5519
|
wait: wait
|
|
5464
5520
|
};
|
|
5465
5521
|
|
|
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 };
|
|
5522
|
+
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
5523
|
//# sourceMappingURL=eligius.esm.js.map
|