eligius 1.4.1 → 1.5.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.
- package/README.md +2 -2
- package/dist/{index.d.ts → index.d.mts} +2510 -1104
- package/dist/{index.js → index.mjs} +2278 -253
- package/dist/index.mjs.map +1 -0
- package/jsonschema/operation-templates/get-controller-from-element.json +1 -0
- package/jsonschema/operation-templates/remove-controller-from-element.json +1 -0
- package/jsonschema/operations/get-controller-from-element.json +1 -0
- package/jsonschema/operations/remove-controller-from-element.json +1 -0
- package/package.json +15 -15
- package/dist/index.js.map +0 -1
- /package/dist/{chunk-Bp6m_JJh.js → chunk-z5eko27R.mjs} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __export } from "./chunk-
|
|
1
|
+
import { t as __export } from "./chunk-z5eko27R.mjs";
|
|
2
2
|
import $ from "jquery";
|
|
3
3
|
import { isDefined } from "ts-is-present";
|
|
4
4
|
import fs from "node:fs";
|
|
@@ -785,6 +785,33 @@ const animateWithClass = (operationData) => {
|
|
|
785
785
|
return promise;
|
|
786
786
|
};
|
|
787
787
|
|
|
788
|
+
//#endregion
|
|
789
|
+
//#region src/operation/announce-to-screen-reader.ts
|
|
790
|
+
/**
|
|
791
|
+
* Announces a message to screen readers using an ARIA live region.
|
|
792
|
+
*
|
|
793
|
+
* @category Accessibility
|
|
794
|
+
*/
|
|
795
|
+
const announceToScreenReader = (operationData) => {
|
|
796
|
+
const { message, priority = "polite" } = operationData;
|
|
797
|
+
if (!message || message.trim() === "") throw new Error("announceToScreenReader: message is required");
|
|
798
|
+
let liveRegion = document.getElementById("aria-live-region");
|
|
799
|
+
if (!liveRegion) {
|
|
800
|
+
liveRegion = document.createElement("div");
|
|
801
|
+
liveRegion.id = "aria-live-region";
|
|
802
|
+
liveRegion.setAttribute("aria-live", priority);
|
|
803
|
+
liveRegion.style.position = "absolute";
|
|
804
|
+
liveRegion.style.left = "-10000px";
|
|
805
|
+
liveRegion.style.width = "1px";
|
|
806
|
+
liveRegion.style.height = "1px";
|
|
807
|
+
liveRegion.style.overflow = "hidden";
|
|
808
|
+
document.body.appendChild(liveRegion);
|
|
809
|
+
} else liveRegion.setAttribute("aria-live", priority);
|
|
810
|
+
liveRegion.textContent = message;
|
|
811
|
+
removeProperties(operationData, "message", "priority");
|
|
812
|
+
return operationData;
|
|
813
|
+
};
|
|
814
|
+
|
|
788
815
|
//#endregion
|
|
789
816
|
//#region src/operation/break-for-each.ts
|
|
790
817
|
/**
|
|
@@ -819,7 +846,7 @@ function resolveEventArguments(operationData, operationScope, eventArgs) {
|
|
|
819
846
|
/**
|
|
820
847
|
* This operation broadcasts the given event through the eventbus, along with the
|
|
821
848
|
* event arguments and optional event topic.
|
|
822
|
-
*
|
|
849
|
+
*
|
|
823
850
|
* @category Utility
|
|
824
851
|
*/
|
|
825
852
|
const broadcastEvent = function(operationData) {
|
|
@@ -877,7 +904,7 @@ const calcFunctions = {
|
|
|
877
904
|
* This operation calculates the given left and right hand operands using the specified operator.
|
|
878
905
|
*
|
|
879
906
|
* @param operationData
|
|
880
|
-
*
|
|
907
|
+
*
|
|
881
908
|
* @category Utility
|
|
882
909
|
*/
|
|
883
910
|
const calc = function(operationData) {
|
|
@@ -921,6 +948,93 @@ const clearOperationData = (operationData) => {
|
|
|
921
948
|
return {};
|
|
922
949
|
};
|
|
923
950
|
|
|
951
|
+
//#endregion
|
|
952
|
+
//#region src/operation/clear-storage.ts
|
|
953
|
+
/**
|
|
954
|
+
* Clears data from browser storage (localStorage or sessionStorage).
|
|
955
|
+
*
|
|
956
|
+
* If `key` is provided, removes only that key. If `key` is omitted, clears all storage.
|
|
957
|
+
*
|
|
958
|
+
* @returns Operation data with storage properties erased
|
|
959
|
+
*
|
|
960
|
+
* @example
|
|
961
|
+
* ```typescript
|
|
962
|
+
* // Clear specific key
|
|
963
|
+
* const result = clearStorage({
|
|
964
|
+
* key: 'user-settings',
|
|
965
|
+
* storageType: 'local'
|
|
966
|
+
* });
|
|
967
|
+
* ```
|
|
968
|
+
*
|
|
969
|
+
* @example
|
|
970
|
+
* ```typescript
|
|
971
|
+
* // Clear all localStorage
|
|
972
|
+
* const result = clearStorage({
|
|
973
|
+
* storageType: 'local'
|
|
974
|
+
* });
|
|
975
|
+
* ```
|
|
976
|
+
*
|
|
977
|
+
* @category Data
|
|
978
|
+
*/
|
|
979
|
+
const clearStorage = (operationData) => {
|
|
980
|
+
const { key, storageType } = operationData;
|
|
981
|
+
const storage = storageType === "session" ? sessionStorage : localStorage;
|
|
982
|
+
if (key && key.trim() !== "") storage.removeItem(key);
|
|
983
|
+
else storage.clear();
|
|
984
|
+
removeProperties(operationData, "key", "storageType");
|
|
985
|
+
return operationData;
|
|
986
|
+
};
|
|
987
|
+
|
|
988
|
+
//#endregion
|
|
989
|
+
//#region src/operation/compare-date.ts
|
|
990
|
+
/**
|
|
991
|
+
* Compares two dates.
|
|
992
|
+
* comparison: -1 (before), 0 (equal), 1 (after)
|
|
993
|
+
*
|
|
994
|
+
* @category Date
|
|
995
|
+
*/
|
|
996
|
+
const compareDate = (operationData) => {
|
|
997
|
+
const { date1, date2 } = operationData;
|
|
998
|
+
if (!date1 || !date2) throw new Error("compareDate: both dates are required");
|
|
999
|
+
const dateObj1 = date1 instanceof Date ? date1 : new Date(date1);
|
|
1000
|
+
const dateObj2 = date2 instanceof Date ? date2 : new Date(date2);
|
|
1001
|
+
if (Number.isNaN(dateObj1.getTime()) || Number.isNaN(dateObj2.getTime())) throw new Error("compareDate: invalid date");
|
|
1002
|
+
const time1 = dateObj1.getTime();
|
|
1003
|
+
const time2 = dateObj2.getTime();
|
|
1004
|
+
operationData.comparison = time1 < time2 ? -1 : time1 > time2 ? 1 : 0;
|
|
1005
|
+
operationData.isEqual = time1 === time2;
|
|
1006
|
+
operationData.isBefore = time1 < time2;
|
|
1007
|
+
operationData.isAfter = time1 > time2;
|
|
1008
|
+
removeProperties(operationData, "date1", "date2");
|
|
1009
|
+
return operationData;
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
//#endregion
|
|
1013
|
+
//#region src/operation/concatenate-strings.ts
|
|
1014
|
+
/**
|
|
1015
|
+
* Concatenates multiple strings with an optional separator.
|
|
1016
|
+
*
|
|
1017
|
+
* @returns Operation data with `result` containing the concatenated string
|
|
1018
|
+
*
|
|
1019
|
+
* @example
|
|
1020
|
+
* ```typescript
|
|
1021
|
+
* const result = concatenateStrings({
|
|
1022
|
+
* strings: ['Hello', 'World'],
|
|
1023
|
+
* separator: ' '
|
|
1024
|
+
* });
|
|
1025
|
+
* // result.result = "Hello World"
|
|
1026
|
+
* ```
|
|
1027
|
+
*
|
|
1028
|
+
* @category String
|
|
1029
|
+
*/
|
|
1030
|
+
const concatenateStrings = (operationData) => {
|
|
1031
|
+
const { strings, separator = "" } = operationData;
|
|
1032
|
+
if (!Array.isArray(strings)) throw new Error("concatenateStrings: strings must be an array");
|
|
1033
|
+
operationData.result = strings.join(separator);
|
|
1034
|
+
removeProperties(operationData, "strings", "separator");
|
|
1035
|
+
return operationData;
|
|
1036
|
+
};
|
|
1037
|
+
|
|
924
1038
|
//#endregion
|
|
925
1039
|
//#region src/operation/continue-for-each.ts
|
|
926
1040
|
/**
|
|
@@ -958,90 +1072,6 @@ const createElement = function(operationData) {
|
|
|
958
1072
|
return operationData;
|
|
959
1073
|
};
|
|
960
1074
|
|
|
961
|
-
//#endregion
|
|
962
|
-
//#region src/timeline-event-names.ts
|
|
963
|
-
/**
|
|
964
|
-
* These are the event names that are being broadcast and/or handled by Eligius.
|
|
965
|
-
*/
|
|
966
|
-
var TimelineEventNames = class {
|
|
967
|
-
/**
|
|
968
|
-
* Broadcasting this event will start the current timeline when it is currently paused, or pauses when it is playing.
|
|
969
|
-
*/
|
|
970
|
-
static PLAY_TOGGLE_REQUEST = "timeline-play-toggle-request";
|
|
971
|
-
/**
|
|
972
|
-
* Broadcasting this event will start the current timeline.
|
|
973
|
-
*/
|
|
974
|
-
static PLAY_REQUEST = "timeline-play-request";
|
|
975
|
-
/**
|
|
976
|
-
* Broadcasting this event will stop the current timeline.
|
|
977
|
-
*/
|
|
978
|
-
static STOP_REQUEST = "timeline-stop-request";
|
|
979
|
-
/**
|
|
980
|
-
* Broadcasting this event will pause the current timeline.
|
|
981
|
-
*/
|
|
982
|
-
static PAUSE_REQUEST = "timeline-pause-request";
|
|
983
|
-
/**
|
|
984
|
-
* Broadcasting this event will seek the specified position in the current timeline.
|
|
985
|
-
* This event takes one argument: A numeric value that represents the new position.
|
|
986
|
-
*/
|
|
987
|
-
static SEEK_REQUEST = "timeline-seek-request";
|
|
988
|
-
/**
|
|
989
|
-
* Broadcasting this event will tell the current {@link ITimelineProvider} to resize.
|
|
990
|
-
*/
|
|
991
|
-
static RESIZE_REQUEST = "timeline-resize-request";
|
|
992
|
-
/**
|
|
993
|
-
* Broadcasting this event will return the element in which the current timeline is being rendered.
|
|
994
|
-
* This event takes one argument: The callback function that will return the specified element.
|
|
995
|
-
*/
|
|
996
|
-
static CONTAINER_REQUEST = "timeline-container-request";
|
|
997
|
-
/**
|
|
998
|
-
* Broadcasting this event will return the duration of the current timeline.
|
|
999
|
-
* This event takes one argument: The callback function that will return the duration.
|
|
1000
|
-
*/
|
|
1001
|
-
static DURATION_REQUEST = "timeline-duration-request";
|
|
1002
|
-
/**
|
|
1003
|
-
* Broadcasting this event will return the uri of the current timeline.
|
|
1004
|
-
* This event takes one argument: The callback function that will return the uri.
|
|
1005
|
-
*/
|
|
1006
|
-
static REQUEST_CURRENT_TIMELINE = "timeline-request-current-timeline";
|
|
1007
|
-
/**
|
|
1008
|
-
* This event is broadcast by {@link ITimelineProvider} instances to announce their duration.
|
|
1009
|
-
*/
|
|
1010
|
-
static DURATION = "timeline-duration";
|
|
1011
|
-
/**
|
|
1012
|
-
* This event is broadcast by {@link ITimelineProvider} instances to announce the current play position whenever it changes.
|
|
1013
|
-
*/
|
|
1014
|
-
static TIME = "timeline-time";
|
|
1015
|
-
/**
|
|
1016
|
-
* This event is broadcast by {@link ITimelineProvider} instances to announce the new play position and duration after a seek was executed.
|
|
1017
|
-
*/
|
|
1018
|
-
static SEEKED = "timeline-seeked";
|
|
1019
|
-
/**
|
|
1020
|
-
*
|
|
1021
|
-
*/
|
|
1022
|
-
static COMPLETE = "timeline-complete";
|
|
1023
|
-
static RESTART = "timeline-restart";
|
|
1024
|
-
static PLAY = "timeline-play";
|
|
1025
|
-
static STOP = "timeline-stop";
|
|
1026
|
-
static PAUSE = "timeline-pause";
|
|
1027
|
-
static SEEK = "timeline-seek";
|
|
1028
|
-
static RESIZE = "timeline-resize";
|
|
1029
|
-
static CURRENT_TIMELINE_CHANGE = "timeline-current-timeline-change";
|
|
1030
|
-
static FIRST_FRAME = "timeline-firstframe";
|
|
1031
|
-
static REQUEST_INSTANCE = "request-instance";
|
|
1032
|
-
static REQUEST_ACTION = "request-action";
|
|
1033
|
-
static REQUEST_FUNCTION = "request-function";
|
|
1034
|
-
static REQUEST_TIMELINE_URI = "request-timeline-uri";
|
|
1035
|
-
static BEFORE_REQUEST_TIMELINE_URI = "before-request-timeline-uri";
|
|
1036
|
-
static REQUEST_ENGINE_ROOT = "request-engine-root";
|
|
1037
|
-
static REQUEST_CURRENT_TIMELINE_POSITION = "request-current-timeline-position";
|
|
1038
|
-
static REQUEST_TIMELINE_CLEANUP = "request-timeline-cleanup";
|
|
1039
|
-
static REQUEST_LABEL_COLLECTION = "request-label-collection";
|
|
1040
|
-
static REQUEST_LABEL_COLLECTIONS = "request-label-collections";
|
|
1041
|
-
static REQUEST_CURRENT_LANGUAGE = "request-current-language";
|
|
1042
|
-
static LANGUAGE_CHANGE = "language-change";
|
|
1043
|
-
};
|
|
1044
|
-
|
|
1045
1075
|
//#endregion
|
|
1046
1076
|
//#region src/operation/custom-function.ts
|
|
1047
1077
|
/**
|
|
@@ -1049,7 +1079,7 @@ var TimelineEventNames = class {
|
|
|
1049
1079
|
* and invokes it with the current operation data and eventbus.
|
|
1050
1080
|
*
|
|
1051
1081
|
* @param operationData
|
|
1052
|
-
*
|
|
1082
|
+
*
|
|
1053
1083
|
* @category Utility
|
|
1054
1084
|
*/
|
|
1055
1085
|
const customFunction = function(operationData) {
|
|
@@ -1063,7 +1093,7 @@ const customFunction = function(operationData) {
|
|
|
1063
1093
|
}, reject);
|
|
1064
1094
|
else internalResolve(resolve, {}, operationData);
|
|
1065
1095
|
};
|
|
1066
|
-
this.eventbus.broadcast(
|
|
1096
|
+
this.eventbus.broadcast("request-function", [systemName, resultCallback]);
|
|
1067
1097
|
});
|
|
1068
1098
|
};
|
|
1069
1099
|
|
|
@@ -1075,7 +1105,7 @@ const customFunction = function(operationData) {
|
|
|
1075
1105
|
* The action operation data is first merged with the current operation data before it is
|
|
1076
1106
|
* passed on to the action. After the action has completed the action operation data properties
|
|
1077
1107
|
* are removed from the current operation data.
|
|
1078
|
-
*
|
|
1108
|
+
*
|
|
1079
1109
|
* @category Action
|
|
1080
1110
|
*/
|
|
1081
1111
|
const endAction = (operationData) => {
|
|
@@ -1133,6 +1163,212 @@ const extendController = (operationData) => {
|
|
|
1133
1163
|
return operationData;
|
|
1134
1164
|
};
|
|
1135
1165
|
|
|
1166
|
+
//#endregion
|
|
1167
|
+
//#region src/operation/filter-array.ts
|
|
1168
|
+
/**
|
|
1169
|
+
* Filters an array based on property equality or custom predicate function.
|
|
1170
|
+
*
|
|
1171
|
+
* Operates on arrayData passed from previous operations.
|
|
1172
|
+
* Supports two filtering modes:
|
|
1173
|
+
* 1. Property equality: `filterProperty` and `filterValue` to filter by property match
|
|
1174
|
+
* 2. Custom predicate: `filterPredicate` function for complex filtering logic
|
|
1175
|
+
*
|
|
1176
|
+
* @returns Operation data with `filteredArray` containing filtered results
|
|
1177
|
+
*
|
|
1178
|
+
* @example
|
|
1179
|
+
* ```typescript
|
|
1180
|
+
* // Filter by property equality
|
|
1181
|
+
* const result = filterArray({
|
|
1182
|
+
* arrayData: [{name: 'Alice', age: 25}, {name: 'Bob', age: 30}],
|
|
1183
|
+
* filterProperty: 'age',
|
|
1184
|
+
* filterValue: 25
|
|
1185
|
+
* });
|
|
1186
|
+
* // result.filteredArray = [{name: 'Alice', age: 25}]
|
|
1187
|
+
* ```
|
|
1188
|
+
*
|
|
1189
|
+
* @example
|
|
1190
|
+
* ```typescript
|
|
1191
|
+
* // Filter with custom predicate
|
|
1192
|
+
* const result = filterArray({
|
|
1193
|
+
* arrayData: [1, 2, 3, 4, 5],
|
|
1194
|
+
* filterPredicate: (item) => item % 2 === 0
|
|
1195
|
+
* });
|
|
1196
|
+
* // result.filteredArray = [2, 4]
|
|
1197
|
+
* ```
|
|
1198
|
+
*
|
|
1199
|
+
* @category Array
|
|
1200
|
+
*/
|
|
1201
|
+
const filterArray = (operationData) => {
|
|
1202
|
+
const { arrayData, filterProperty, filterValue, filterPredicate } = operationData;
|
|
1203
|
+
if (!Array.isArray(arrayData)) throw new Error("filterArray: arrayData is required and must be an array");
|
|
1204
|
+
if (!filterPredicate && (!filterProperty || filterValue === void 0)) throw new Error("filterArray: filterProperty/filterValue or filterPredicate is required");
|
|
1205
|
+
let filtered;
|
|
1206
|
+
if (filterPredicate) filtered = arrayData.filter(filterPredicate);
|
|
1207
|
+
else filtered = arrayData.filter((item) => {
|
|
1208
|
+
if (typeof item === "object" && item !== null) return item[filterProperty] === filterValue;
|
|
1209
|
+
return false;
|
|
1210
|
+
});
|
|
1211
|
+
operationData.filteredArray = filtered;
|
|
1212
|
+
removeProperties(operationData, "filterProperty", "filterValue", "filterPredicate");
|
|
1213
|
+
return operationData;
|
|
1214
|
+
};
|
|
1215
|
+
|
|
1216
|
+
//#endregion
|
|
1217
|
+
//#region src/operation/find-in-array.ts
|
|
1218
|
+
/**
|
|
1219
|
+
* Finds the first element in an array matching criteria.
|
|
1220
|
+
*
|
|
1221
|
+
* Operates on arrayData passed from previous operations.
|
|
1222
|
+
* Supports two search modes:
|
|
1223
|
+
* 1. Property equality: `findProperty` and `findValue` to find by property match
|
|
1224
|
+
* 2. Custom predicate: `findPredicate` function for complex search logic
|
|
1225
|
+
*
|
|
1226
|
+
* Returns `undefined` for `foundItem` and `-1` for `foundIndex` if no match found.
|
|
1227
|
+
*
|
|
1228
|
+
* @returns Operation data with `foundItem` (the matching element) and `foundIndex` (its position)
|
|
1229
|
+
*
|
|
1230
|
+
* @example
|
|
1231
|
+
* ```typescript
|
|
1232
|
+
* // Find by property equality
|
|
1233
|
+
* const result = findInArray({
|
|
1234
|
+
* arrayData: [{id: 1, name: 'Alice'}, {id: 2, name: 'Bob'}],
|
|
1235
|
+
* findProperty: 'id',
|
|
1236
|
+
* findValue: 2
|
|
1237
|
+
* });
|
|
1238
|
+
* // result.foundItem = {id: 2, name: 'Bob'}
|
|
1239
|
+
* // result.foundIndex = 1
|
|
1240
|
+
* ```
|
|
1241
|
+
*
|
|
1242
|
+
* @example
|
|
1243
|
+
* ```typescript
|
|
1244
|
+
* // Find with custom predicate
|
|
1245
|
+
* const result = findInArray({
|
|
1246
|
+
* arrayData: [10, 25, 30, 45],
|
|
1247
|
+
* findPredicate: (item) => item > 30
|
|
1248
|
+
* });
|
|
1249
|
+
* // result.foundItem = 45
|
|
1250
|
+
* // result.foundIndex = 3
|
|
1251
|
+
* ```
|
|
1252
|
+
*
|
|
1253
|
+
* @category Array
|
|
1254
|
+
*/
|
|
1255
|
+
const findInArray = (operationData) => {
|
|
1256
|
+
const { arrayData, findProperty, findValue, findPredicate } = operationData;
|
|
1257
|
+
if (!Array.isArray(arrayData)) throw new Error("findInArray: arrayData is required and must be an array");
|
|
1258
|
+
if (!findPredicate && (!findProperty || findValue === void 0)) throw new Error("findInArray: findProperty/findValue or findPredicate is required");
|
|
1259
|
+
let foundItem;
|
|
1260
|
+
let foundIndex = -1;
|
|
1261
|
+
if (findPredicate) {
|
|
1262
|
+
foundIndex = arrayData.findIndex(findPredicate);
|
|
1263
|
+
foundItem = foundIndex !== -1 ? arrayData[foundIndex] : void 0;
|
|
1264
|
+
} else {
|
|
1265
|
+
foundIndex = arrayData.findIndex((item) => {
|
|
1266
|
+
if (typeof item === "object" && item !== null) return item[findProperty] === findValue;
|
|
1267
|
+
return item === findValue;
|
|
1268
|
+
});
|
|
1269
|
+
foundItem = foundIndex !== -1 ? arrayData[foundIndex] : void 0;
|
|
1270
|
+
}
|
|
1271
|
+
operationData.foundItem = foundItem;
|
|
1272
|
+
operationData.foundIndex = foundIndex;
|
|
1273
|
+
removeProperties(operationData, "findProperty", "findValue", "findPredicate");
|
|
1274
|
+
return operationData;
|
|
1275
|
+
};
|
|
1276
|
+
|
|
1277
|
+
//#endregion
|
|
1278
|
+
//#region src/operation/format-date.ts
|
|
1279
|
+
/**
|
|
1280
|
+
* Formats a date using Intl.DateTimeFormat or simple patterns.
|
|
1281
|
+
*
|
|
1282
|
+
* @category Date
|
|
1283
|
+
*/
|
|
1284
|
+
const formatDate = (operationData) => {
|
|
1285
|
+
const { date, format } = operationData;
|
|
1286
|
+
if (!date) throw new Error("formatDate: date is required");
|
|
1287
|
+
const dateObj = date instanceof Date ? date : new Date(date);
|
|
1288
|
+
if (Number.isNaN(dateObj.getTime())) throw new Error("formatDate: invalid date");
|
|
1289
|
+
const year = dateObj.getFullYear();
|
|
1290
|
+
const month = String(dateObj.getMonth() + 1).padStart(2, "0");
|
|
1291
|
+
const day = String(dateObj.getDate()).padStart(2, "0");
|
|
1292
|
+
const hours = String(dateObj.getHours()).padStart(2, "0");
|
|
1293
|
+
const minutes = String(dateObj.getMinutes()).padStart(2, "0");
|
|
1294
|
+
const seconds = String(dateObj.getSeconds()).padStart(2, "0");
|
|
1295
|
+
let formatted = format;
|
|
1296
|
+
formatted = formatted.replace("YYYY", String(year));
|
|
1297
|
+
formatted = formatted.replace("MM", month);
|
|
1298
|
+
formatted = formatted.replace("DD", day);
|
|
1299
|
+
formatted = formatted.replace("HH", hours);
|
|
1300
|
+
formatted = formatted.replace("mm", minutes);
|
|
1301
|
+
formatted = formatted.replace("ss", seconds);
|
|
1302
|
+
operationData.formattedDate = formatted;
|
|
1303
|
+
removeProperties(operationData, "format");
|
|
1304
|
+
return operationData;
|
|
1305
|
+
};
|
|
1306
|
+
|
|
1307
|
+
//#endregion
|
|
1308
|
+
//#region src/operation/format-text.ts
|
|
1309
|
+
/**
|
|
1310
|
+
* Transforms text using format operations: uppercase, lowercase, capitalize, titlecase, or trim.
|
|
1311
|
+
*
|
|
1312
|
+
* Operates on textContent passed from previous operations (e.g., getTextContent).
|
|
1313
|
+
*
|
|
1314
|
+
* Transformations:
|
|
1315
|
+
* - `uppercase`: Convert all characters to uppercase
|
|
1316
|
+
* - `lowercase`: Convert all characters to lowercase
|
|
1317
|
+
* - `capitalize`: Capitalize only the first letter
|
|
1318
|
+
* - `titlecase`: Capitalize first letter of each word
|
|
1319
|
+
* - `trim`: Remove leading and trailing whitespace
|
|
1320
|
+
*
|
|
1321
|
+
* @returns Operation data with `formattedText` containing the transformed text
|
|
1322
|
+
*
|
|
1323
|
+
* @example
|
|
1324
|
+
* ```typescript
|
|
1325
|
+
* // Convert to uppercase
|
|
1326
|
+
* const result = formatText({
|
|
1327
|
+
* textContent: 'hello',
|
|
1328
|
+
* transformation: 'uppercase'
|
|
1329
|
+
* });
|
|
1330
|
+
* // result.formattedText = "HELLO"
|
|
1331
|
+
* ```
|
|
1332
|
+
*
|
|
1333
|
+
* @example
|
|
1334
|
+
* ```typescript
|
|
1335
|
+
* // Title case
|
|
1336
|
+
* const result = formatText({
|
|
1337
|
+
* textContent: 'hello world',
|
|
1338
|
+
* transformation: 'titlecase'
|
|
1339
|
+
* });
|
|
1340
|
+
* // result.formattedText = "Hello World"
|
|
1341
|
+
* ```
|
|
1342
|
+
*
|
|
1343
|
+
* @category Text
|
|
1344
|
+
*/
|
|
1345
|
+
const formatText = (operationData) => {
|
|
1346
|
+
const { textContent, transformation } = operationData;
|
|
1347
|
+
if (textContent === void 0 || textContent === null) throw new Error("formatText: textContent is required");
|
|
1348
|
+
let text = textContent;
|
|
1349
|
+
switch (transformation) {
|
|
1350
|
+
case "uppercase":
|
|
1351
|
+
text = text.toUpperCase();
|
|
1352
|
+
break;
|
|
1353
|
+
case "lowercase":
|
|
1354
|
+
text = text.toLowerCase();
|
|
1355
|
+
break;
|
|
1356
|
+
case "capitalize":
|
|
1357
|
+
text = text.charAt(0).toUpperCase() + text.slice(1);
|
|
1358
|
+
break;
|
|
1359
|
+
case "titlecase":
|
|
1360
|
+
text = text.replace(/\b\w/g, (char) => char.toUpperCase());
|
|
1361
|
+
break;
|
|
1362
|
+
case "trim":
|
|
1363
|
+
text = text.trim();
|
|
1364
|
+
break;
|
|
1365
|
+
default: throw new Error(`formatText: unknown transformation type "${transformation}"`);
|
|
1366
|
+
}
|
|
1367
|
+
operationData.formattedText = text;
|
|
1368
|
+
removeProperties(operationData, "transformation");
|
|
1369
|
+
return operationData;
|
|
1370
|
+
};
|
|
1371
|
+
|
|
1136
1372
|
//#endregion
|
|
1137
1373
|
//#region src/operation/get-attributes-from-element.ts
|
|
1138
1374
|
/**
|
|
@@ -1185,7 +1421,21 @@ const getControllerInstance = function(operationData) {
|
|
|
1185
1421
|
const resultCallback = (instance) => {
|
|
1186
1422
|
operationData.controllerInstance = instance;
|
|
1187
1423
|
};
|
|
1188
|
-
this.eventbus.broadcast(
|
|
1424
|
+
this.eventbus.broadcast("request-instance", [systemName, resultCallback]);
|
|
1425
|
+
return operationData;
|
|
1426
|
+
};
|
|
1427
|
+
|
|
1428
|
+
//#endregion
|
|
1429
|
+
//#region src/operation/get-current-time.ts
|
|
1430
|
+
/**
|
|
1431
|
+
* Gets the current time as timestamp and Date object.
|
|
1432
|
+
*
|
|
1433
|
+
* @category Date
|
|
1434
|
+
*/
|
|
1435
|
+
const getCurrentTime = (operationData) => {
|
|
1436
|
+
const now = /* @__PURE__ */ new Date();
|
|
1437
|
+
operationData.timestamp = now.getTime();
|
|
1438
|
+
operationData.date = now;
|
|
1189
1439
|
return operationData;
|
|
1190
1440
|
};
|
|
1191
1441
|
|
|
@@ -1340,6 +1590,52 @@ const getElementDimensions = (operationData) => {
|
|
|
1340
1590
|
return operationData;
|
|
1341
1591
|
};
|
|
1342
1592
|
|
|
1593
|
+
//#endregion
|
|
1594
|
+
//#region src/operation/get-focused-element.ts
|
|
1595
|
+
/**
|
|
1596
|
+
* Gets the currently focused element.
|
|
1597
|
+
*
|
|
1598
|
+
* @category Focus
|
|
1599
|
+
*/
|
|
1600
|
+
const getFocusedElement = (operationData) => {
|
|
1601
|
+
operationData.focusedElement = document.activeElement ? $(document.activeElement) : $();
|
|
1602
|
+
return operationData;
|
|
1603
|
+
};
|
|
1604
|
+
|
|
1605
|
+
//#endregion
|
|
1606
|
+
//#region src/operation/get-form-data.ts
|
|
1607
|
+
/**
|
|
1608
|
+
* Extracts all input, select, and textarea values from form element into operation data.
|
|
1609
|
+
*
|
|
1610
|
+
* This operation reads form field values and returns them as an object with field names as keys.
|
|
1611
|
+
* Only processes form elements that are enabled and not hidden. Handles checkboxes, radio buttons,
|
|
1612
|
+
* select elements, textareas, and text inputs.
|
|
1613
|
+
*
|
|
1614
|
+
* @returns Operation data with `formData` object containing field values
|
|
1615
|
+
*
|
|
1616
|
+
* @example
|
|
1617
|
+
* ```typescript
|
|
1618
|
+
* // Given a form with fields: name="John", email="john@example.com"
|
|
1619
|
+
* const result = getFormData({selectedElement: $form});
|
|
1620
|
+
* // Returns: {selectedElement: $form, formData: {name: "John", email: "john@example.com"}}
|
|
1621
|
+
* ```
|
|
1622
|
+
*
|
|
1623
|
+
* @category Form
|
|
1624
|
+
*/
|
|
1625
|
+
const getFormData = (operationData) => {
|
|
1626
|
+
const { selectedElement } = operationData;
|
|
1627
|
+
if (!selectedElement || selectedElement.length === 0) throw new Error("getFormData: selectedElement is required");
|
|
1628
|
+
if (!selectedElement.is("form")) throw new Error("getFormData: selectedElement must be a form element");
|
|
1629
|
+
const formArray = selectedElement.serializeArray();
|
|
1630
|
+
const formData = {};
|
|
1631
|
+
for (const field of formArray) if (formData[field.name] !== void 0) {
|
|
1632
|
+
if (!Array.isArray(formData[field.name])) formData[field.name] = [formData[field.name]];
|
|
1633
|
+
formData[field.name].push(field.value);
|
|
1634
|
+
} else formData[field.name] = field.value;
|
|
1635
|
+
operationData.formData = formData;
|
|
1636
|
+
return operationData;
|
|
1637
|
+
};
|
|
1638
|
+
|
|
1343
1639
|
//#endregion
|
|
1344
1640
|
//#region src/operation/get-import.ts
|
|
1345
1641
|
/**
|
|
@@ -1347,7 +1643,7 @@ const getElementDimensions = (operationData) => {
|
|
|
1347
1643
|
* assigns it to the `importedInstance` property on the current operaton date.
|
|
1348
1644
|
*
|
|
1349
1645
|
* @param operationData
|
|
1350
|
-
*
|
|
1646
|
+
*
|
|
1351
1647
|
* @category Utility
|
|
1352
1648
|
*/
|
|
1353
1649
|
const getImport = function(operationData) {
|
|
@@ -1356,7 +1652,7 @@ const getImport = function(operationData) {
|
|
|
1356
1652
|
const callBack = (instance) => {
|
|
1357
1653
|
operationData.importedInstance = instance;
|
|
1358
1654
|
};
|
|
1359
|
-
this.eventbus.broadcast(
|
|
1655
|
+
this.eventbus.broadcast("request-function", [systemName, callBack]);
|
|
1360
1656
|
delete operationData.systemName;
|
|
1361
1657
|
return operationData;
|
|
1362
1658
|
};
|
|
@@ -1366,7 +1662,7 @@ const getImport = function(operationData) {
|
|
|
1366
1662
|
/**
|
|
1367
1663
|
* This operation retrieves the current query parameters from the browser's address bar and places
|
|
1368
1664
|
* them on the returned operation data.
|
|
1369
|
-
*
|
|
1665
|
+
*
|
|
1370
1666
|
* @category Utility
|
|
1371
1667
|
*/
|
|
1372
1668
|
const getQueryParams = (operationData) => {
|
|
@@ -1381,6 +1677,183 @@ const getQueryParams = (operationData) => {
|
|
|
1381
1677
|
return operationData;
|
|
1382
1678
|
};
|
|
1383
1679
|
|
|
1680
|
+
//#endregion
|
|
1681
|
+
//#region src/operation/get-scroll-position.ts
|
|
1682
|
+
/**
|
|
1683
|
+
* Gets the current scroll position of the viewport.
|
|
1684
|
+
*
|
|
1685
|
+
* Returns x (horizontal) and y (vertical) scroll positions in pixels.
|
|
1686
|
+
* Uses cross-browser compatible methods to retrieve scroll position.
|
|
1687
|
+
*
|
|
1688
|
+
* @returns Operation data with `scrollX` and `scrollY` values
|
|
1689
|
+
*
|
|
1690
|
+
* @example
|
|
1691
|
+
* ```typescript
|
|
1692
|
+
* // Get current scroll position
|
|
1693
|
+
* const result = getScrollPosition({});
|
|
1694
|
+
* // result.scrollX = 150
|
|
1695
|
+
* // result.scrollY = 400
|
|
1696
|
+
* ```
|
|
1697
|
+
*
|
|
1698
|
+
* @category Scroll
|
|
1699
|
+
*/
|
|
1700
|
+
const getScrollPosition = (operationData) => {
|
|
1701
|
+
const scrollX = window.pageXOffset !== void 0 ? window.pageXOffset : window.scrollX !== void 0 ? window.scrollX : document.documentElement?.scrollLeft || 0;
|
|
1702
|
+
const scrollY = window.pageYOffset !== void 0 ? window.pageYOffset : window.scrollY !== void 0 ? window.scrollY : document.documentElement?.scrollTop || 0;
|
|
1703
|
+
operationData.scrollX = scrollX;
|
|
1704
|
+
operationData.scrollY = scrollY;
|
|
1705
|
+
return operationData;
|
|
1706
|
+
};
|
|
1707
|
+
|
|
1708
|
+
//#endregion
|
|
1709
|
+
//#region src/operation/get-text-content.ts
|
|
1710
|
+
/**
|
|
1711
|
+
* Extracts text content from element, stripping all HTML markup.
|
|
1712
|
+
*
|
|
1713
|
+
* Uses jQuery's `.text()` method which is XSS-safe and returns only the text content
|
|
1714
|
+
* without any HTML tags. Preserves whitespace and text from nested elements.
|
|
1715
|
+
*
|
|
1716
|
+
* @returns Operation data with `textContent` containing the extracted plain text
|
|
1717
|
+
*
|
|
1718
|
+
* @example
|
|
1719
|
+
* ```typescript
|
|
1720
|
+
* // Extract text from element with HTML
|
|
1721
|
+
* const result = getTextContent({selectedElement: $div});
|
|
1722
|
+
* // Given: <div>Hello <strong>World</strong>!</div>
|
|
1723
|
+
* // Returns: {textContent: "Hello World!"}
|
|
1724
|
+
* ```
|
|
1725
|
+
*
|
|
1726
|
+
* @category Text
|
|
1727
|
+
*/
|
|
1728
|
+
const getTextContent = (operationData) => {
|
|
1729
|
+
const { selectedElement } = operationData;
|
|
1730
|
+
if (!selectedElement || selectedElement.length === 0) throw new Error("getTextContent: selectedElement is required");
|
|
1731
|
+
operationData.textContent = selectedElement.text();
|
|
1732
|
+
return operationData;
|
|
1733
|
+
};
|
|
1734
|
+
|
|
1735
|
+
//#endregion
|
|
1736
|
+
//#region src/operation/http-delete.ts
|
|
1737
|
+
/**
|
|
1738
|
+
* Performs an HTTP DELETE request to the specified URL.
|
|
1739
|
+
*
|
|
1740
|
+
* @returns Operation data with `response` (parsed JSON or empty) and `status` (HTTP status code)
|
|
1741
|
+
*
|
|
1742
|
+
* @example
|
|
1743
|
+
* ```typescript
|
|
1744
|
+
* const result = await httpDelete({
|
|
1745
|
+
* url: 'https://api.example.com/users/123',
|
|
1746
|
+
* headers: { 'Authorization': 'Bearer token' }
|
|
1747
|
+
* });
|
|
1748
|
+
* // result.response = {} or null
|
|
1749
|
+
* // result.status = 204
|
|
1750
|
+
* ```
|
|
1751
|
+
*
|
|
1752
|
+
* @category HTTP
|
|
1753
|
+
*/
|
|
1754
|
+
const httpDelete = async (operationData) => {
|
|
1755
|
+
const { url, headers = {} } = operationData;
|
|
1756
|
+
if (!url || url.trim() === "") throw new Error("httpDelete: url is required");
|
|
1757
|
+
try {
|
|
1758
|
+
const response = await fetch(url, {
|
|
1759
|
+
method: "DELETE",
|
|
1760
|
+
headers
|
|
1761
|
+
});
|
|
1762
|
+
operationData.status = response.status;
|
|
1763
|
+
if (!response.ok) throw new Error(`httpDelete: HTTP error ${response.status} ${response.statusText}`);
|
|
1764
|
+
if (response.headers.get("content-type")?.includes("application/json")) operationData.response = await response.json();
|
|
1765
|
+
else operationData.response = null;
|
|
1766
|
+
removeProperties(operationData, "url", "headers");
|
|
1767
|
+
return operationData;
|
|
1768
|
+
} catch (error) {
|
|
1769
|
+
throw new Error(`httpDelete: ${error.message}`);
|
|
1770
|
+
}
|
|
1771
|
+
};
|
|
1772
|
+
|
|
1773
|
+
//#endregion
|
|
1774
|
+
//#region src/operation/http-post.ts
|
|
1775
|
+
/**
|
|
1776
|
+
* Performs an HTTP POST request to the specified URL.
|
|
1777
|
+
*
|
|
1778
|
+
* @returns Operation data with `response` (parsed JSON) and `status` (HTTP status code)
|
|
1779
|
+
*
|
|
1780
|
+
* @example
|
|
1781
|
+
* ```typescript
|
|
1782
|
+
* const result = await httpPost({
|
|
1783
|
+
* url: 'https://api.example.com/users',
|
|
1784
|
+
* body: { name: 'John', email: 'john@example.com' },
|
|
1785
|
+
* headers: { 'Content-Type': 'application/json' }
|
|
1786
|
+
* });
|
|
1787
|
+
* // result.response = { id: 123, name: 'John', ... }
|
|
1788
|
+
* // result.status = 201
|
|
1789
|
+
* ```
|
|
1790
|
+
*
|
|
1791
|
+
* @category HTTP
|
|
1792
|
+
*/
|
|
1793
|
+
const httpPost = async (operationData) => {
|
|
1794
|
+
const { url, body, headers = {} } = operationData;
|
|
1795
|
+
if (!url || url.trim() === "") throw new Error("httpPost: url is required");
|
|
1796
|
+
try {
|
|
1797
|
+
const response = await fetch(url, {
|
|
1798
|
+
method: "POST",
|
|
1799
|
+
headers: {
|
|
1800
|
+
"Content-Type": "application/json",
|
|
1801
|
+
...headers
|
|
1802
|
+
},
|
|
1803
|
+
body: JSON.stringify(body)
|
|
1804
|
+
});
|
|
1805
|
+
operationData.status = response.status;
|
|
1806
|
+
if (!response.ok) throw new Error(`httpPost: HTTP error ${response.status} ${response.statusText}`);
|
|
1807
|
+
operationData.response = await response.json();
|
|
1808
|
+
removeProperties(operationData, "url", "body", "headers");
|
|
1809
|
+
return operationData;
|
|
1810
|
+
} catch (error) {
|
|
1811
|
+
throw new Error(`httpPost: ${error.message}`);
|
|
1812
|
+
}
|
|
1813
|
+
};
|
|
1814
|
+
|
|
1815
|
+
//#endregion
|
|
1816
|
+
//#region src/operation/http-put.ts
|
|
1817
|
+
/**
|
|
1818
|
+
* Performs an HTTP PUT request to the specified URL.
|
|
1819
|
+
*
|
|
1820
|
+
* @returns Operation data with `response` (parsed JSON) and `status` (HTTP status code)
|
|
1821
|
+
*
|
|
1822
|
+
* @example
|
|
1823
|
+
* ```typescript
|
|
1824
|
+
* const result = await httpPut({
|
|
1825
|
+
* url: 'https://api.example.com/users/123',
|
|
1826
|
+
* body: { name: 'John Updated', email: 'john.new@example.com' },
|
|
1827
|
+
* headers: { 'Content-Type': 'application/json' }
|
|
1828
|
+
* });
|
|
1829
|
+
* // result.response = { id: 123, name: 'John Updated', ... }
|
|
1830
|
+
* // result.status = 200
|
|
1831
|
+
* ```
|
|
1832
|
+
*
|
|
1833
|
+
* @category HTTP
|
|
1834
|
+
*/
|
|
1835
|
+
const httpPut = async (operationData) => {
|
|
1836
|
+
const { url, body, headers = {} } = operationData;
|
|
1837
|
+
if (!url || url.trim() === "") throw new Error("httpPut: url is required");
|
|
1838
|
+
try {
|
|
1839
|
+
const response = await fetch(url, {
|
|
1840
|
+
method: "PUT",
|
|
1841
|
+
headers: {
|
|
1842
|
+
"Content-Type": "application/json",
|
|
1843
|
+
...headers
|
|
1844
|
+
},
|
|
1845
|
+
body: JSON.stringify(body)
|
|
1846
|
+
});
|
|
1847
|
+
operationData.status = response.status;
|
|
1848
|
+
if (!response.ok) throw new Error(`httpPut: HTTP error ${response.status} ${response.statusText}`);
|
|
1849
|
+
operationData.response = await response.json();
|
|
1850
|
+
removeProperties(operationData, "url", "body", "headers");
|
|
1851
|
+
return operationData;
|
|
1852
|
+
} catch (error) {
|
|
1853
|
+
throw new Error(`httpPut: ${error.message}`);
|
|
1854
|
+
}
|
|
1855
|
+
};
|
|
1856
|
+
|
|
1384
1857
|
//#endregion
|
|
1385
1858
|
//#region src/operation/invoke-object-method.ts
|
|
1386
1859
|
/**
|
|
@@ -1388,7 +1861,7 @@ const getQueryParams = (operationData) => {
|
|
|
1388
1861
|
* and assigns the result to the `methodResult` operationdata property.
|
|
1389
1862
|
*
|
|
1390
1863
|
* @param operationData
|
|
1391
|
-
*
|
|
1864
|
+
*
|
|
1392
1865
|
* @category Utility
|
|
1393
1866
|
*/
|
|
1394
1867
|
const invokeObjectMethod = (operationData) => {
|
|
@@ -1401,6 +1874,79 @@ const invokeObjectMethod = (operationData) => {
|
|
|
1401
1874
|
return newOperationData;
|
|
1402
1875
|
};
|
|
1403
1876
|
|
|
1877
|
+
//#endregion
|
|
1878
|
+
//#region src/operation/is-element-in-viewport.ts
|
|
1879
|
+
/**
|
|
1880
|
+
* Checks if an element is currently visible within the viewport.
|
|
1881
|
+
*
|
|
1882
|
+
* Uses `getBoundingClientRect()` to determine if the element is within the viewport boundaries.
|
|
1883
|
+
*
|
|
1884
|
+
* @returns Operation data with `isInViewport` boolean indicating visibility
|
|
1885
|
+
*
|
|
1886
|
+
* @example
|
|
1887
|
+
* ```typescript
|
|
1888
|
+
* // Check if element is in view
|
|
1889
|
+
* const result = isElementInViewport({
|
|
1890
|
+
* selectedElement: $targetElement
|
|
1891
|
+
* });
|
|
1892
|
+
* // result.isInViewport = true or false
|
|
1893
|
+
* ```
|
|
1894
|
+
*
|
|
1895
|
+
* @category DOM
|
|
1896
|
+
*/
|
|
1897
|
+
const isElementInViewport = (operationData) => {
|
|
1898
|
+
const { selectedElement } = operationData;
|
|
1899
|
+
if (!selectedElement || selectedElement.length === 0) throw new Error("isElementInViewport: selectedElement is required");
|
|
1900
|
+
const rect = selectedElement[0].getBoundingClientRect();
|
|
1901
|
+
operationData.isInViewport = rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
1902
|
+
return operationData;
|
|
1903
|
+
};
|
|
1904
|
+
|
|
1905
|
+
//#endregion
|
|
1906
|
+
//#region src/operation/load-from-storage.ts
|
|
1907
|
+
/**
|
|
1908
|
+
* Loads data from browser storage (localStorage or sessionStorage).
|
|
1909
|
+
*
|
|
1910
|
+
* Deserializes the stored JSON value. Returns `null` if key doesn't exist.
|
|
1911
|
+
*
|
|
1912
|
+
* @returns Operation data with `loadedValue` containing the deserialized data
|
|
1913
|
+
*
|
|
1914
|
+
* @example
|
|
1915
|
+
* ```typescript
|
|
1916
|
+
* // Load user settings from localStorage
|
|
1917
|
+
* const result = loadFromStorage({
|
|
1918
|
+
* key: 'user-settings',
|
|
1919
|
+
* storageType: 'local'
|
|
1920
|
+
* });
|
|
1921
|
+
* // result.loadedValue = { theme: 'dark', language: 'en' }
|
|
1922
|
+
* ```
|
|
1923
|
+
*
|
|
1924
|
+
* @example
|
|
1925
|
+
* ```typescript
|
|
1926
|
+
* // Load session data
|
|
1927
|
+
* const result = loadFromStorage({
|
|
1928
|
+
* key: 'session-id',
|
|
1929
|
+
* storageType: 'session'
|
|
1930
|
+
* });
|
|
1931
|
+
* // result.loadedValue = 'abc123' or null if not found
|
|
1932
|
+
* ```
|
|
1933
|
+
*
|
|
1934
|
+
* @category Data
|
|
1935
|
+
*/
|
|
1936
|
+
const loadFromStorage = (operationData) => {
|
|
1937
|
+
const { key, storageType } = operationData;
|
|
1938
|
+
if (!key || key.trim() === "") throw new Error("loadFromStorage: key is required");
|
|
1939
|
+
const stored = (storageType === "session" ? sessionStorage : localStorage).getItem(key);
|
|
1940
|
+
if (stored === null) operationData.loadedValue = null;
|
|
1941
|
+
else try {
|
|
1942
|
+
operationData.loadedValue = JSON.parse(stored);
|
|
1943
|
+
} catch {
|
|
1944
|
+
throw new Error(`loadFromStorage: failed to parse stored value for key "${key}"`);
|
|
1945
|
+
}
|
|
1946
|
+
removeProperties(operationData, "storageType");
|
|
1947
|
+
return operationData;
|
|
1948
|
+
};
|
|
1949
|
+
|
|
1404
1950
|
//#endregion
|
|
1405
1951
|
//#region src/operation/load-json.ts
|
|
1406
1952
|
const jsonCache = {};
|
|
@@ -1413,7 +1959,7 @@ const addToCache = (key, value) => {
|
|
|
1413
1959
|
*
|
|
1414
1960
|
* If the cache property is set to true and a cached value already exists, this is assigned
|
|
1415
1961
|
* instead of re-retrieving it from the url.
|
|
1416
|
-
*
|
|
1962
|
+
*
|
|
1417
1963
|
* @category Utility
|
|
1418
1964
|
*/
|
|
1419
1965
|
const loadJson = async (operationData) => {
|
|
@@ -1433,7 +1979,7 @@ const loadJson = async (operationData) => {
|
|
|
1433
1979
|
/**
|
|
1434
1980
|
* This operation logs the specified value, or, when no logValue property has been assigned
|
|
1435
1981
|
* it will log the current operation data, global data and scope to the console
|
|
1436
|
-
*
|
|
1982
|
+
*
|
|
1437
1983
|
* @category Utility
|
|
1438
1984
|
*/
|
|
1439
1985
|
const log = function(operationData) {
|
|
@@ -1451,6 +1997,57 @@ const log = function(operationData) {
|
|
|
1451
1997
|
return operationData;
|
|
1452
1998
|
};
|
|
1453
1999
|
|
|
2000
|
+
//#endregion
|
|
2001
|
+
//#region src/operation/map-array.ts
|
|
2002
|
+
/**
|
|
2003
|
+
* Transforms each element of an array using a mapping function.
|
|
2004
|
+
*
|
|
2005
|
+
* Operates on arrayData passed from previous operations.
|
|
2006
|
+
* The mapFunction receives each item and optionally its index.
|
|
2007
|
+
*
|
|
2008
|
+
* @returns Operation data with `mappedArray` containing transformed elements
|
|
2009
|
+
*
|
|
2010
|
+
* @example
|
|
2011
|
+
* ```typescript
|
|
2012
|
+
* // Double each number
|
|
2013
|
+
* const result = mapArray({
|
|
2014
|
+
* arrayData: [1, 2, 3, 4],
|
|
2015
|
+
* mapFunction: (item) => item * 2
|
|
2016
|
+
* });
|
|
2017
|
+
* // result.mappedArray = [2, 4, 6, 8]
|
|
2018
|
+
* ```
|
|
2019
|
+
*
|
|
2020
|
+
* @example
|
|
2021
|
+
* ```typescript
|
|
2022
|
+
* // Extract property from objects
|
|
2023
|
+
* const result = mapArray({
|
|
2024
|
+
* arrayData: [{name: 'Alice', age: 25}, {name: 'Bob', age: 30}],
|
|
2025
|
+
* mapFunction: (item) => item.name
|
|
2026
|
+
* });
|
|
2027
|
+
* // result.mappedArray = ['Alice', 'Bob']
|
|
2028
|
+
* ```
|
|
2029
|
+
*
|
|
2030
|
+
* @example
|
|
2031
|
+
* ```typescript
|
|
2032
|
+
* // Use index in transformation
|
|
2033
|
+
* const result = mapArray({
|
|
2034
|
+
* arrayData: ['a', 'b', 'c'],
|
|
2035
|
+
* mapFunction: (item, index) => `${index}-${item}`
|
|
2036
|
+
* });
|
|
2037
|
+
* // result.mappedArray = ['0-a', '1-b', '2-c']
|
|
2038
|
+
* ```
|
|
2039
|
+
*
|
|
2040
|
+
* @category Array
|
|
2041
|
+
*/
|
|
2042
|
+
const mapArray = (operationData) => {
|
|
2043
|
+
const { arrayData, mapFunction } = operationData;
|
|
2044
|
+
if (!Array.isArray(arrayData)) throw new Error("mapArray: arrayData is required and must be an array");
|
|
2045
|
+
if (typeof mapFunction !== "function") throw new Error("mapArray: mapFunction is required and must be a function");
|
|
2046
|
+
operationData.mappedArray = arrayData.map(mapFunction);
|
|
2047
|
+
removeProperties(operationData, "mapFunction");
|
|
2048
|
+
return operationData;
|
|
2049
|
+
};
|
|
2050
|
+
|
|
1454
2051
|
//#endregion
|
|
1455
2052
|
//#region src/util/guards/is-string.ts
|
|
1456
2053
|
function isString(value) {
|
|
@@ -1461,7 +2058,7 @@ function isString(value) {
|
|
|
1461
2058
|
//#region src/operation/math.ts
|
|
1462
2059
|
/**
|
|
1463
2060
|
* This operation performs the given math function with the specified arguments.
|
|
1464
|
-
*
|
|
2061
|
+
*
|
|
1465
2062
|
* @category Utility
|
|
1466
2063
|
*/
|
|
1467
2064
|
const math = function(operationData) {
|
|
@@ -1587,12 +2184,96 @@ const reparentElement = (operationData) => {
|
|
|
1587
2184
|
return operationData;
|
|
1588
2185
|
};
|
|
1589
2186
|
|
|
2187
|
+
//#endregion
|
|
2188
|
+
//#region src/operation/replace-string.ts
|
|
2189
|
+
/**
|
|
2190
|
+
* Replaces occurrences of a pattern in a string (alias for replaceText for string context).
|
|
2191
|
+
*
|
|
2192
|
+
* @returns Operation data with `result` containing the replaced string
|
|
2193
|
+
*
|
|
2194
|
+
* @example
|
|
2195
|
+
* ```typescript
|
|
2196
|
+
* const result = replaceString({
|
|
2197
|
+
* textContent: 'Hello World',
|
|
2198
|
+
* pattern: 'World',
|
|
2199
|
+
* replacement: 'Universe'
|
|
2200
|
+
* });
|
|
2201
|
+
* // result.result = "Hello Universe"
|
|
2202
|
+
* ```
|
|
2203
|
+
*
|
|
2204
|
+
* @category String
|
|
2205
|
+
*/
|
|
2206
|
+
const replaceString = (operationData) => {
|
|
2207
|
+
const { textContent, pattern, replacement } = operationData;
|
|
2208
|
+
if (textContent === void 0 || textContent === null) throw new Error("replaceString: textContent is required");
|
|
2209
|
+
operationData.result = textContent.replace(pattern, replacement);
|
|
2210
|
+
removeProperties(operationData, "pattern", "replacement");
|
|
2211
|
+
return operationData;
|
|
2212
|
+
};
|
|
2213
|
+
|
|
2214
|
+
//#endregion
|
|
2215
|
+
//#region src/operation/replace-text.ts
|
|
2216
|
+
/**
|
|
2217
|
+
* Finds and replaces text using literal string or regex pattern.
|
|
2218
|
+
*
|
|
2219
|
+
* Operates on textContent passed from previous operations (e.g., getTextContent).
|
|
2220
|
+
* Supports regex patterns with global flag for multiple replacements.
|
|
2221
|
+
* Updates textContent with replaced text and sets replacementCount.
|
|
2222
|
+
*
|
|
2223
|
+
* @returns Operation data with updated `textContent` and `replacementCount` indicating number of replacements made
|
|
2224
|
+
*
|
|
2225
|
+
* @example
|
|
2226
|
+
* ```typescript
|
|
2227
|
+
* // Replace placeholder with value
|
|
2228
|
+
* const result = replaceText({
|
|
2229
|
+
* textContent: 'Hello {{name}}',
|
|
2230
|
+
* searchPattern: '{{name}}',
|
|
2231
|
+
* replacement: 'John'
|
|
2232
|
+
* });
|
|
2233
|
+
* // result.textContent = "Hello John"
|
|
2234
|
+
* // result.replacementCount = 1
|
|
2235
|
+
* ```
|
|
2236
|
+
*
|
|
2237
|
+
* @example
|
|
2238
|
+
* ```typescript
|
|
2239
|
+
* // Replace with regex pattern
|
|
2240
|
+
* const result = replaceText({
|
|
2241
|
+
* textContent: 'Test 123 and 456',
|
|
2242
|
+
* searchPattern: /\d+/g,
|
|
2243
|
+
* replacement: 'NUM'
|
|
2244
|
+
* });
|
|
2245
|
+
* // result.textContent = "Test NUM and NUM"
|
|
2246
|
+
* // result.replacementCount = 2
|
|
2247
|
+
* ```
|
|
2248
|
+
*
|
|
2249
|
+
* @category Text
|
|
2250
|
+
*/
|
|
2251
|
+
const replaceText = (operationData) => {
|
|
2252
|
+
const { textContent, searchPattern, replacement } = operationData;
|
|
2253
|
+
if (textContent === void 0 || textContent === null) throw new Error("replaceText: textContent is required");
|
|
2254
|
+
let newText;
|
|
2255
|
+
let count = 0;
|
|
2256
|
+
if (searchPattern instanceof RegExp) {
|
|
2257
|
+
const matches = textContent.match(searchPattern);
|
|
2258
|
+
count = matches ? matches.length : 0;
|
|
2259
|
+
newText = textContent.replace(searchPattern, replacement);
|
|
2260
|
+
} else {
|
|
2261
|
+
const parts = textContent.split(searchPattern);
|
|
2262
|
+
count = parts.length - 1;
|
|
2263
|
+
newText = parts.join(replacement);
|
|
2264
|
+
}
|
|
2265
|
+
operationData.textContent = newText;
|
|
2266
|
+
operationData.replacementCount = count;
|
|
2267
|
+
removeProperties(operationData, "searchPattern", "replacement");
|
|
2268
|
+
return operationData;
|
|
2269
|
+
};
|
|
2270
|
+
|
|
1590
2271
|
//#endregion
|
|
1591
2272
|
//#region src/operation/request-action.ts
|
|
1592
2273
|
/**
|
|
1593
2274
|
* This operation requests an action instance with the specified name and assigns it
|
|
1594
2275
|
* to the `actionInstance` property on the current operation data.
|
|
1595
|
-
*
|
|
2276
|
+
*
|
|
1596
2277
|
* @category Action
|
|
1597
2278
|
*/
|
|
1598
2279
|
const requestAction = function(operationData) {
|
|
@@ -1601,7 +2282,133 @@ const requestAction = function(operationData) {
|
|
|
1601
2282
|
const resultCallback = (action) => {
|
|
1602
2283
|
operationData.actionInstance = action;
|
|
1603
2284
|
};
|
|
1604
|
-
this.eventbus.broadcast(
|
|
2285
|
+
this.eventbus.broadcast("request-action", [systemName, resultCallback]);
|
|
2286
|
+
return operationData;
|
|
2287
|
+
};
|
|
2288
|
+
|
|
2289
|
+
//#endregion
|
|
2290
|
+
//#region src/operation/save-to-storage.ts
|
|
2291
|
+
/**
|
|
2292
|
+
* Saves data to browser storage (localStorage or sessionStorage).
|
|
2293
|
+
*
|
|
2294
|
+
* Serializes the value as JSON before storing. Supports any JSON-serializable data type.
|
|
2295
|
+
*
|
|
2296
|
+
* @returns Operation data with storage properties erased
|
|
2297
|
+
*
|
|
2298
|
+
* @example
|
|
2299
|
+
* ```typescript
|
|
2300
|
+
* // Save user settings to localStorage
|
|
2301
|
+
* const result = saveToStorage({
|
|
2302
|
+
* key: 'user-settings',
|
|
2303
|
+
* value: { theme: 'dark', language: 'en' },
|
|
2304
|
+
* storageType: 'local'
|
|
2305
|
+
* });
|
|
2306
|
+
* ```
|
|
2307
|
+
*
|
|
2308
|
+
* @example
|
|
2309
|
+
* ```typescript
|
|
2310
|
+
* // Save session data
|
|
2311
|
+
* const result = saveToStorage({
|
|
2312
|
+
* key: 'session-id',
|
|
2313
|
+
* value: 'abc123',
|
|
2314
|
+
* storageType: 'session'
|
|
2315
|
+
* });
|
|
2316
|
+
* ```
|
|
2317
|
+
*
|
|
2318
|
+
* @category Data
|
|
2319
|
+
*/
|
|
2320
|
+
const saveToStorage = (operationData) => {
|
|
2321
|
+
const { key, value, storageType } = operationData;
|
|
2322
|
+
if (!key || key.trim() === "") throw new Error("saveToStorage: key is required");
|
|
2323
|
+
const storage = storageType === "session" ? sessionStorage : localStorage;
|
|
2324
|
+
const serialized = JSON.stringify(value);
|
|
2325
|
+
storage.setItem(key, serialized);
|
|
2326
|
+
removeProperties(operationData, "value", "storageType");
|
|
2327
|
+
return operationData;
|
|
2328
|
+
};
|
|
2329
|
+
|
|
2330
|
+
//#endregion
|
|
2331
|
+
//#region src/operation/scroll-to-element.ts
|
|
2332
|
+
/**
|
|
2333
|
+
* Scrolls the viewport to bring the selected element into view.
|
|
2334
|
+
*
|
|
2335
|
+
* Uses the browser's `scrollIntoView` API with configurable behavior.
|
|
2336
|
+
*
|
|
2337
|
+
* @returns Operation data with scroll properties erased
|
|
2338
|
+
*
|
|
2339
|
+
* @example
|
|
2340
|
+
* ```typescript
|
|
2341
|
+
* // Smooth scroll to element at top of viewport
|
|
2342
|
+
* const result = scrollToElement({
|
|
2343
|
+
* selectedElement: $targetElement,
|
|
2344
|
+
* behavior: 'smooth',
|
|
2345
|
+
* block: 'start'
|
|
2346
|
+
* });
|
|
2347
|
+
* ```
|
|
2348
|
+
*
|
|
2349
|
+
* @example
|
|
2350
|
+
* ```typescript
|
|
2351
|
+
* // Center element in viewport
|
|
2352
|
+
* const result = scrollToElement({
|
|
2353
|
+
* selectedElement: $targetElement,
|
|
2354
|
+
* behavior: 'smooth',
|
|
2355
|
+
* block: 'center'
|
|
2356
|
+
* });
|
|
2357
|
+
* ```
|
|
2358
|
+
*
|
|
2359
|
+
* @category Scroll
|
|
2360
|
+
*/
|
|
2361
|
+
const scrollToElement = (operationData) => {
|
|
2362
|
+
const { selectedElement, behavior = "auto", block = "start", inline = "nearest" } = operationData;
|
|
2363
|
+
if (!selectedElement || selectedElement.length === 0) throw new Error("scrollToElement: selectedElement is required");
|
|
2364
|
+
selectedElement[0].scrollIntoView({
|
|
2365
|
+
behavior,
|
|
2366
|
+
block,
|
|
2367
|
+
inline
|
|
2368
|
+
});
|
|
2369
|
+
removeProperties(operationData, "behavior", "block", "inline");
|
|
2370
|
+
return operationData;
|
|
2371
|
+
};
|
|
2372
|
+
|
|
2373
|
+
//#endregion
|
|
2374
|
+
//#region src/operation/scroll-to-position.ts
|
|
2375
|
+
/**
|
|
2376
|
+
* Scrolls the viewport to a specific x,y coordinate position.
|
|
2377
|
+
*
|
|
2378
|
+
* Uses the browser's `window.scrollTo` API with configurable behavior.
|
|
2379
|
+
*
|
|
2380
|
+
* @returns Operation data with scroll properties erased
|
|
2381
|
+
*
|
|
2382
|
+
* @example
|
|
2383
|
+
* ```typescript
|
|
2384
|
+
* // Smooth scroll to position
|
|
2385
|
+
* const result = scrollToPosition({
|
|
2386
|
+
* x: 0,
|
|
2387
|
+
* y: 500,
|
|
2388
|
+
* behavior: 'smooth'
|
|
2389
|
+
* });
|
|
2390
|
+
* ```
|
|
2391
|
+
*
|
|
2392
|
+
* @example
|
|
2393
|
+
* ```typescript
|
|
2394
|
+
* // Instant scroll to top
|
|
2395
|
+
* const result = scrollToPosition({
|
|
2396
|
+
* x: 0,
|
|
2397
|
+
* y: 0
|
|
2398
|
+
* });
|
|
2399
|
+
* ```
|
|
2400
|
+
*
|
|
2401
|
+
* @category Scroll
|
|
2402
|
+
*/
|
|
2403
|
+
const scrollToPosition = (operationData) => {
|
|
2404
|
+
const { x, y, behavior = "auto" } = operationData;
|
|
2405
|
+
if (typeof x !== "number" || typeof y !== "number") throw new Error("scrollToPosition: x and y coordinates are required");
|
|
2406
|
+
window.scrollTo({
|
|
2407
|
+
left: x,
|
|
2408
|
+
top: y,
|
|
2409
|
+
behavior
|
|
2410
|
+
});
|
|
2411
|
+
removeProperties(operationData, "x", "y", "behavior");
|
|
1605
2412
|
return operationData;
|
|
1606
2413
|
};
|
|
1607
2414
|
|
|
@@ -1634,7 +2441,7 @@ const selectElement = function(operationData) {
|
|
|
1634
2441
|
const rootCallback = (root) => {
|
|
1635
2442
|
operationData.selectedElement = findElementBySelector(root, selector);
|
|
1636
2443
|
};
|
|
1637
|
-
this.eventbus.broadcast(
|
|
2444
|
+
this.eventbus.broadcast("request-engine-root", [rootCallback]);
|
|
1638
2445
|
return operationData;
|
|
1639
2446
|
};
|
|
1640
2447
|
|
|
@@ -1728,6 +2535,56 @@ const setElementContent = (operationData) => {
|
|
|
1728
2535
|
return operationData;
|
|
1729
2536
|
};
|
|
1730
2537
|
|
|
2538
|
+
//#endregion
|
|
2539
|
+
//#region src/operation/set-focus.ts
|
|
2540
|
+
/**
|
|
2541
|
+
* Sets focus to the selected element.
|
|
2542
|
+
*
|
|
2543
|
+
* @category Focus
|
|
2544
|
+
*/
|
|
2545
|
+
const setFocus = (operationData) => {
|
|
2546
|
+
const { selectedElement } = operationData;
|
|
2547
|
+
if (!selectedElement || selectedElement.length === 0) throw new Error("setFocus: selectedElement is required");
|
|
2548
|
+
selectedElement[0].focus();
|
|
2549
|
+
return operationData;
|
|
2550
|
+
};
|
|
2551
|
+
|
|
2552
|
+
//#endregion
|
|
2553
|
+
//#region src/operation/set-form-value.ts
|
|
2554
|
+
/**
|
|
2555
|
+
* Sets the value of an input, select, or textarea element.
|
|
2556
|
+
*
|
|
2557
|
+
* Handles different input types appropriately:
|
|
2558
|
+
* - Text inputs, textareas, selects: sets value directly
|
|
2559
|
+
* - Checkboxes: sets checked property for boolean values
|
|
2560
|
+
* - Radio buttons: sets checked property for boolean values
|
|
2561
|
+
* - Number inputs: converts to string
|
|
2562
|
+
*
|
|
2563
|
+
* @example
|
|
2564
|
+
* ```typescript
|
|
2565
|
+
* // Set text input value
|
|
2566
|
+
* const result = setFormValue({selectedElement: $input, value: 'test@example.com'});
|
|
2567
|
+
* // Element value is now 'test@example.com'
|
|
2568
|
+
* ```
|
|
2569
|
+
*
|
|
2570
|
+
* @example
|
|
2571
|
+
* ```typescript
|
|
2572
|
+
* // Set checkbox checked state
|
|
2573
|
+
* const result = setFormValue({selectedElement: $checkbox, value: true});
|
|
2574
|
+
* // Checkbox is now checked
|
|
2575
|
+
* ```
|
|
2576
|
+
*
|
|
2577
|
+
* @category Form
|
|
2578
|
+
*/
|
|
2579
|
+
const setFormValue = (operationData) => {
|
|
2580
|
+
const { selectedElement, value } = operationData;
|
|
2581
|
+
if (!selectedElement || selectedElement.length === 0) throw new Error("setFormValue: selectedElement is required");
|
|
2582
|
+
if (typeof value === "boolean" && (selectedElement.is(":checkbox") || selectedElement.is(":radio"))) selectedElement.prop("checked", value);
|
|
2583
|
+
else selectedElement.val(value);
|
|
2584
|
+
removeProperties(operationData, "value");
|
|
2585
|
+
return operationData;
|
|
2586
|
+
};
|
|
2587
|
+
|
|
1731
2588
|
//#endregion
|
|
1732
2589
|
//#region src/operation/set-global-data.ts
|
|
1733
2590
|
/**
|
|
@@ -1779,13 +2636,106 @@ const setStyle = function(operationData) {
|
|
|
1779
2636
|
/**
|
|
1780
2637
|
* This operation sets a variable with the specified name on the scope with the specified value.
|
|
1781
2638
|
*
|
|
1782
|
-
* @category Data
|
|
2639
|
+
* @category Data
|
|
2640
|
+
*/
|
|
2641
|
+
const setVariable = function(operationData) {
|
|
2642
|
+
const { name, value } = operationData;
|
|
2643
|
+
if (!this.variables) this.variables = {};
|
|
2644
|
+
this.variables[name] = value;
|
|
2645
|
+
removeProperties(operationData, "name", "value");
|
|
2646
|
+
return operationData;
|
|
2647
|
+
};
|
|
2648
|
+
|
|
2649
|
+
//#endregion
|
|
2650
|
+
//#region src/operation/sort-array.ts
|
|
2651
|
+
/**
|
|
2652
|
+
* Sorts an array by property, natural order, or custom comparator function.
|
|
2653
|
+
*
|
|
2654
|
+
* Operates on arrayData passed from previous operations.
|
|
2655
|
+
* Supports three sorting modes:
|
|
2656
|
+
* 1. Property sort: `sortProperty` and `sortOrder` to sort objects by property
|
|
2657
|
+
* 2. Natural sort: `sortOrder` alone for primitive arrays
|
|
2658
|
+
* 3. Custom comparator: `sortComparator` function for complex sorting logic
|
|
2659
|
+
*
|
|
2660
|
+
* @returns Operation data with `sortedArray` containing sorted results
|
|
2661
|
+
*
|
|
2662
|
+
* @example
|
|
2663
|
+
* ```typescript
|
|
2664
|
+
* // Sort objects by property
|
|
2665
|
+
* const result = sortArray({
|
|
2666
|
+
* arrayData: [{name: 'Bob', age: 30}, {name: 'Alice', age: 25}],
|
|
2667
|
+
* sortProperty: 'age',
|
|
2668
|
+
* sortOrder: 'asc'
|
|
2669
|
+
* });
|
|
2670
|
+
* // result.sortedArray = [{name: 'Alice', age: 25}, {name: 'Bob', age: 30}]
|
|
2671
|
+
* ```
|
|
2672
|
+
*
|
|
2673
|
+
* @example
|
|
2674
|
+
* ```typescript
|
|
2675
|
+
* // Sort primitives
|
|
2676
|
+
* const result = sortArray({
|
|
2677
|
+
* arrayData: [5, 2, 8, 1],
|
|
2678
|
+
* sortOrder: 'desc'
|
|
2679
|
+
* });
|
|
2680
|
+
* // result.sortedArray = [8, 5, 2, 1]
|
|
2681
|
+
* ```
|
|
2682
|
+
*
|
|
2683
|
+
* @example
|
|
2684
|
+
* ```typescript
|
|
2685
|
+
* // Custom comparator
|
|
2686
|
+
* const result = sortArray({
|
|
2687
|
+
* arrayData: ['apple', 'Banana', 'cherry'],
|
|
2688
|
+
* sortComparator: (a, b) => a.toLowerCase().localeCompare(b.toLowerCase())
|
|
2689
|
+
* });
|
|
2690
|
+
* ```
|
|
2691
|
+
*
|
|
2692
|
+
* @category Array
|
|
2693
|
+
*/
|
|
2694
|
+
const sortArray = (operationData) => {
|
|
2695
|
+
const { arrayData, sortProperty, sortOrder, sortComparator } = operationData;
|
|
2696
|
+
if (!Array.isArray(arrayData)) throw new Error("sortArray: arrayData is required and must be an array");
|
|
2697
|
+
const sorted = [...arrayData];
|
|
2698
|
+
if (sortComparator) sorted.sort(sortComparator);
|
|
2699
|
+
else if (sortProperty) sorted.sort((a, b) => {
|
|
2700
|
+
const aVal = a[sortProperty];
|
|
2701
|
+
const bVal = b[sortProperty];
|
|
2702
|
+
if (aVal < bVal) return sortOrder === "desc" ? 1 : -1;
|
|
2703
|
+
if (aVal > bVal) return sortOrder === "desc" ? -1 : 1;
|
|
2704
|
+
return 0;
|
|
2705
|
+
});
|
|
2706
|
+
else sorted.sort((a, b) => {
|
|
2707
|
+
if (a < b) return sortOrder === "desc" ? 1 : -1;
|
|
2708
|
+
if (a > b) return sortOrder === "desc" ? -1 : 1;
|
|
2709
|
+
return 0;
|
|
2710
|
+
});
|
|
2711
|
+
operationData.sortedArray = sorted;
|
|
2712
|
+
removeProperties(operationData, "sortProperty", "sortOrder", "sortComparator");
|
|
2713
|
+
return operationData;
|
|
2714
|
+
};
|
|
2715
|
+
|
|
2716
|
+
//#endregion
|
|
2717
|
+
//#region src/operation/split-string.ts
|
|
2718
|
+
/**
|
|
2719
|
+
* Splits a string into an array by delimiter (string or regex).
|
|
2720
|
+
*
|
|
2721
|
+
* @returns Operation data with `resultArray` containing the split strings
|
|
2722
|
+
*
|
|
2723
|
+
* @example
|
|
2724
|
+
* ```typescript
|
|
2725
|
+
* const result = splitString({
|
|
2726
|
+
* textContent: 'apple,banana,cherry',
|
|
2727
|
+
* delimiter: ','
|
|
2728
|
+
* });
|
|
2729
|
+
* // result.resultArray = ['apple', 'banana', 'cherry']
|
|
2730
|
+
* ```
|
|
2731
|
+
*
|
|
2732
|
+
* @category String
|
|
1783
2733
|
*/
|
|
1784
|
-
const
|
|
1785
|
-
const {
|
|
1786
|
-
if (
|
|
1787
|
-
|
|
1788
|
-
removeProperties(operationData, "
|
|
2734
|
+
const splitString = (operationData) => {
|
|
2735
|
+
const { textContent, delimiter, limit } = operationData;
|
|
2736
|
+
if (textContent === void 0 || textContent === null) throw new Error("splitString: textContent is required");
|
|
2737
|
+
operationData.resultArray = textContent.split(delimiter, limit);
|
|
2738
|
+
removeProperties(operationData, "delimiter", "limit");
|
|
1789
2739
|
return operationData;
|
|
1790
2740
|
};
|
|
1791
2741
|
|
|
@@ -1797,7 +2747,7 @@ const setVariable = function(operationData) {
|
|
|
1797
2747
|
* The action operation data is first merged with the current operation data before it is
|
|
1798
2748
|
* passed on to the action. After the action has completed the action operation data properties
|
|
1799
2749
|
* are removed from the current operation data.
|
|
1800
|
-
*
|
|
2750
|
+
*
|
|
1801
2751
|
* @category Action
|
|
1802
2752
|
*/
|
|
1803
2753
|
const startAction = (operationData) => {
|
|
@@ -1816,6 +2766,34 @@ const startAction = (operationData) => {
|
|
|
1816
2766
|
});
|
|
1817
2767
|
};
|
|
1818
2768
|
|
|
2769
|
+
//#endregion
|
|
2770
|
+
//#region src/operation/substring-text.ts
|
|
2771
|
+
/**
|
|
2772
|
+
* Extracts a substring from text between start and end indices.
|
|
2773
|
+
*
|
|
2774
|
+
* @returns Operation data with `substring` containing the extracted text
|
|
2775
|
+
*
|
|
2776
|
+
* @example
|
|
2777
|
+
* ```typescript
|
|
2778
|
+
* const result = substringText({
|
|
2779
|
+
* textContent: 'Hello World',
|
|
2780
|
+
* start: 0,
|
|
2781
|
+
* end: 5
|
|
2782
|
+
* });
|
|
2783
|
+
* // result.substring = "Hello"
|
|
2784
|
+
* ```
|
|
2785
|
+
*
|
|
2786
|
+
* @category Text
|
|
2787
|
+
*/
|
|
2788
|
+
const substringText = (operationData) => {
|
|
2789
|
+
const { textContent, start, end } = operationData;
|
|
2790
|
+
if (textContent === void 0 || textContent === null) throw new Error("substringText: textContent is required");
|
|
2791
|
+
if (typeof start !== "number") throw new Error("substringText: start must be a number");
|
|
2792
|
+
operationData.substring = textContent.substring(start, end);
|
|
2793
|
+
removeProperties(operationData, "start", "end");
|
|
2794
|
+
return operationData;
|
|
2795
|
+
};
|
|
2796
|
+
|
|
1819
2797
|
//#endregion
|
|
1820
2798
|
//#region src/operation/toggle-class.ts
|
|
1821
2799
|
/**
|
|
@@ -1848,11 +2826,123 @@ const toggleElement = function toggleElement$2(operationData) {
|
|
|
1848
2826
|
return operationData;
|
|
1849
2827
|
};
|
|
1850
2828
|
|
|
2829
|
+
//#endregion
|
|
2830
|
+
//#region src/operation/toggle-form-element.ts
|
|
2831
|
+
/**
|
|
2832
|
+
* Enables or disables form input elements (inputs, selects, textareas, buttons).
|
|
2833
|
+
*
|
|
2834
|
+
* Sets the `disabled` property on the element. When `enabled` is true, removes the disabled
|
|
2835
|
+
* attribute; when false, adds the disabled attribute.
|
|
2836
|
+
*
|
|
2837
|
+
* @example
|
|
2838
|
+
* ```typescript
|
|
2839
|
+
* // Disable an input field
|
|
2840
|
+
* toggleFormElement({selectedElement: $input, enabled: false});
|
|
2841
|
+
* // Input is now disabled
|
|
2842
|
+
* ```
|
|
2843
|
+
*
|
|
2844
|
+
* @example
|
|
2845
|
+
* ```typescript
|
|
2846
|
+
* // Enable a previously disabled button
|
|
2847
|
+
* toggleFormElement({selectedElement: $button, enabled: true});
|
|
2848
|
+
* // Button is now enabled
|
|
2849
|
+
* ```
|
|
2850
|
+
*
|
|
2851
|
+
* @category Form
|
|
2852
|
+
*/
|
|
2853
|
+
const toggleFormElement = (operationData) => {
|
|
2854
|
+
const { selectedElement, enabled } = operationData;
|
|
2855
|
+
if (!selectedElement || selectedElement.length === 0) throw new Error("toggleFormElement: selectedElement is required");
|
|
2856
|
+
selectedElement.prop("disabled", !enabled);
|
|
2857
|
+
removeProperties(operationData, "enabled");
|
|
2858
|
+
return operationData;
|
|
2859
|
+
};
|
|
2860
|
+
|
|
2861
|
+
//#endregion
|
|
2862
|
+
//#region src/operation/validate-form.ts
|
|
2863
|
+
/**
|
|
2864
|
+
* Validates form fields against HTML5 validation and custom rules.
|
|
2865
|
+
*
|
|
2866
|
+
* Uses HTML5 validation API (checkValidity()) for native validation, and supports
|
|
2867
|
+
* custom validation rules for: required, minLength, maxLength, pattern (regex), and email format.
|
|
2868
|
+
*
|
|
2869
|
+
* @returns Operation data with `validationErrors` object (field names → error messages) and `isValid` boolean
|
|
2870
|
+
*
|
|
2871
|
+
* @example
|
|
2872
|
+
* ```typescript
|
|
2873
|
+
* // Validate with HTML5 validation
|
|
2874
|
+
* const result = validateForm({selectedElement: $form});
|
|
2875
|
+
* // Returns: {isValid: true, validationErrors: {}}
|
|
2876
|
+
* ```
|
|
2877
|
+
*
|
|
2878
|
+
* @example
|
|
2879
|
+
* ```typescript
|
|
2880
|
+
* // Validate with custom rules
|
|
2881
|
+
* const result = validateForm({
|
|
2882
|
+
* selectedElement: $form,
|
|
2883
|
+
* validationRules: {
|
|
2884
|
+
* password: { required: true, minLength: 8 },
|
|
2885
|
+
* email: { email: true }
|
|
2886
|
+
* }
|
|
2887
|
+
* });
|
|
2888
|
+
* // Returns: {isValid: false, validationErrors: {password: "Must be at least 8 characters"}}
|
|
2889
|
+
* ```
|
|
2890
|
+
*
|
|
2891
|
+
* @category Form
|
|
2892
|
+
*/
|
|
2893
|
+
const validateForm = (operationData) => {
|
|
2894
|
+
const { selectedElement, validationRules } = operationData;
|
|
2895
|
+
if (!selectedElement || selectedElement.length === 0) throw new Error("validateForm: selectedElement is required");
|
|
2896
|
+
if (!selectedElement.is("form")) throw new Error("validateForm: selectedElement must be a form element");
|
|
2897
|
+
const validationErrors = {};
|
|
2898
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
2899
|
+
selectedElement.find("input, select, textarea").each((_, element) => {
|
|
2900
|
+
const $input = $(element);
|
|
2901
|
+
const name = $input.attr("name");
|
|
2902
|
+
if (!name) return;
|
|
2903
|
+
const value = $input.val();
|
|
2904
|
+
const rules = validationRules?.[name];
|
|
2905
|
+
const inputElement = element;
|
|
2906
|
+
if (inputElement.checkValidity && !inputElement.checkValidity()) {
|
|
2907
|
+
validationErrors[name] = inputElement.validationMessage || "Invalid value";
|
|
2908
|
+
return;
|
|
2909
|
+
}
|
|
2910
|
+
if (rules) {
|
|
2911
|
+
if (rules.required && (!value || value.trim() === "")) {
|
|
2912
|
+
validationErrors[name] = "This field is required";
|
|
2913
|
+
return;
|
|
2914
|
+
}
|
|
2915
|
+
if (rules.minLength && value.length < rules.minLength) {
|
|
2916
|
+
validationErrors[name] = `Must be at least ${rules.minLength} characters`;
|
|
2917
|
+
return;
|
|
2918
|
+
}
|
|
2919
|
+
if (rules.maxLength && value.length > rules.maxLength) {
|
|
2920
|
+
validationErrors[name] = `Must be no more than ${rules.maxLength} characters`;
|
|
2921
|
+
return;
|
|
2922
|
+
}
|
|
2923
|
+
if (rules.pattern) {
|
|
2924
|
+
if (!(typeof rules.pattern === "string" ? new RegExp(rules.pattern) : rules.pattern).test(value)) {
|
|
2925
|
+
validationErrors[name] = "Invalid format";
|
|
2926
|
+
return;
|
|
2927
|
+
}
|
|
2928
|
+
}
|
|
2929
|
+
if (rules.email && !emailRegex.test(value)) {
|
|
2930
|
+
validationErrors[name] = "Must be a valid email address";
|
|
2931
|
+
return;
|
|
2932
|
+
}
|
|
2933
|
+
}
|
|
2934
|
+
});
|
|
2935
|
+
operationData.validationErrors = validationErrors;
|
|
2936
|
+
operationData.isValid = Object.keys(validationErrors).length === 0;
|
|
2937
|
+
removeProperties(operationData, "validationRules");
|
|
2938
|
+
return operationData;
|
|
2939
|
+
};
|
|
2940
|
+
|
|
1851
2941
|
//#endregion
|
|
1852
2942
|
//#region src/operation/wait.ts
|
|
1853
2943
|
/**
|
|
1854
2944
|
* This operation waits for the specified amount of milliseconds.
|
|
1855
|
-
*
|
|
2945
|
+
*
|
|
1856
2946
|
* @category Utility
|
|
1857
2947
|
*/
|
|
1858
2948
|
const wait = (operationData) => {
|
|
@@ -1872,11 +2962,15 @@ var operation_exports = /* @__PURE__ */ __export({
|
|
|
1872
2962
|
addGlobalsToOperation: () => addGlobalsToOperation,
|
|
1873
2963
|
animate: () => animate,
|
|
1874
2964
|
animateWithClass: () => animateWithClass,
|
|
2965
|
+
announceToScreenReader: () => announceToScreenReader,
|
|
1875
2966
|
breakForEach: () => breakForEach,
|
|
1876
2967
|
broadcastEvent: () => broadcastEvent,
|
|
1877
2968
|
calc: () => calc,
|
|
1878
2969
|
clearElement: () => clearElement,
|
|
1879
2970
|
clearOperationData: () => clearOperationData,
|
|
2971
|
+
clearStorage: () => clearStorage,
|
|
2972
|
+
compareDate: () => compareDate,
|
|
2973
|
+
concatenateStrings: () => concatenateStrings,
|
|
1880
2974
|
continueForEach: () => continueForEach,
|
|
1881
2975
|
createElement: () => createElement,
|
|
1882
2976
|
customFunction: () => customFunction,
|
|
@@ -1884,16 +2978,31 @@ var operation_exports = /* @__PURE__ */ __export({
|
|
|
1884
2978
|
endForEach: () => endForEach,
|
|
1885
2979
|
endWhen: () => endWhen,
|
|
1886
2980
|
extendController: () => extendController,
|
|
2981
|
+
filterArray: () => filterArray,
|
|
2982
|
+
findInArray: () => findInArray,
|
|
1887
2983
|
forEach: () => forEach,
|
|
2984
|
+
formatDate: () => formatDate,
|
|
2985
|
+
formatText: () => formatText,
|
|
1888
2986
|
getAttributesFromElement: () => getAttributesFromElement,
|
|
1889
2987
|
getControllerFromElement: () => getControllerFromElement,
|
|
1890
2988
|
getControllerInstance: () => getControllerInstance,
|
|
2989
|
+
getCurrentTime: () => getCurrentTime,
|
|
1891
2990
|
getElementDimensions: () => getElementDimensions,
|
|
2991
|
+
getFocusedElement: () => getFocusedElement,
|
|
2992
|
+
getFormData: () => getFormData,
|
|
1892
2993
|
getImport: () => getImport,
|
|
1893
2994
|
getQueryParams: () => getQueryParams,
|
|
2995
|
+
getScrollPosition: () => getScrollPosition,
|
|
2996
|
+
getTextContent: () => getTextContent,
|
|
2997
|
+
httpDelete: () => httpDelete,
|
|
2998
|
+
httpPost: () => httpPost,
|
|
2999
|
+
httpPut: () => httpPut,
|
|
1894
3000
|
invokeObjectMethod: () => invokeObjectMethod,
|
|
3001
|
+
isElementInViewport: () => isElementInViewport,
|
|
3002
|
+
loadFromStorage: () => loadFromStorage,
|
|
1895
3003
|
loadJson: () => loadJson,
|
|
1896
3004
|
log: () => log,
|
|
3005
|
+
mapArray: () => mapArray,
|
|
1897
3006
|
math: () => math,
|
|
1898
3007
|
otherwise: () => otherwise,
|
|
1899
3008
|
removeClass: () => removeClass,
|
|
@@ -1901,18 +3010,30 @@ var operation_exports = /* @__PURE__ */ __export({
|
|
|
1901
3010
|
removeElement: () => removeElement,
|
|
1902
3011
|
removePropertiesFromOperationData: () => removePropertiesFromOperationData,
|
|
1903
3012
|
reparentElement: () => reparentElement,
|
|
3013
|
+
replaceString: () => replaceString,
|
|
3014
|
+
replaceText: () => replaceText,
|
|
1904
3015
|
requestAction: () => requestAction,
|
|
3016
|
+
saveToStorage: () => saveToStorage,
|
|
3017
|
+
scrollToElement: () => scrollToElement,
|
|
3018
|
+
scrollToPosition: () => scrollToPosition,
|
|
1905
3019
|
selectElement: () => selectElement,
|
|
1906
3020
|
setData: () => setData,
|
|
1907
3021
|
setElementAttributes: () => setElementAttributes,
|
|
1908
3022
|
setElementContent: () => setElementContent,
|
|
3023
|
+
setFocus: () => setFocus,
|
|
3024
|
+
setFormValue: () => setFormValue,
|
|
1909
3025
|
setGlobalData: () => setGlobalData,
|
|
1910
3026
|
setOperationData: () => setOperationData,
|
|
1911
3027
|
setStyle: () => setStyle,
|
|
1912
3028
|
setVariable: () => setVariable,
|
|
3029
|
+
sortArray: () => sortArray,
|
|
3030
|
+
splitString: () => splitString,
|
|
1913
3031
|
startAction: () => startAction,
|
|
3032
|
+
substringText: () => substringText,
|
|
1914
3033
|
toggleClass: () => toggleClass,
|
|
1915
3034
|
toggleElement: () => toggleElement,
|
|
3035
|
+
toggleFormElement: () => toggleFormElement,
|
|
3036
|
+
validateForm: () => validateForm,
|
|
1916
3037
|
wait: () => wait,
|
|
1917
3038
|
when: () => when
|
|
1918
3039
|
});
|
|
@@ -3461,7 +4582,7 @@ var DOMEventListenerController = class {
|
|
|
3461
4582
|
};
|
|
3462
4583
|
actions.forEach((actionName) => {
|
|
3463
4584
|
const [isStart, name] = this._isStartAction(actionName);
|
|
3464
|
-
eventbus$1.broadcast(
|
|
4585
|
+
eventbus$1.broadcast("request-action", [name, resultCallback(isStart)]);
|
|
3465
4586
|
});
|
|
3466
4587
|
selectedElement.on(eventName, this._eventHandler.bind(this));
|
|
3467
4588
|
}
|
|
@@ -3582,16 +4703,16 @@ var LabelController = class extends BaseController {
|
|
|
3582
4703
|
}
|
|
3583
4704
|
attach(eventbus$1) {
|
|
3584
4705
|
if (!this.operationData) return;
|
|
3585
|
-
eventbus$1.broadcast(
|
|
4706
|
+
eventbus$1.broadcast("request-current-language", [(language) => {
|
|
3586
4707
|
this.currentLanguage = language;
|
|
3587
4708
|
}]);
|
|
3588
4709
|
this.requestLabelDataBound = this._requestLabelData.bind(this, eventbus$1);
|
|
3589
4710
|
this.requestLabelDataBound(this.operationData.labelId);
|
|
3590
4711
|
this._setLabel();
|
|
3591
|
-
this.addListener(eventbus$1,
|
|
4712
|
+
this.addListener(eventbus$1, "language-change", this._handleLanguageChange);
|
|
3592
4713
|
}
|
|
3593
4714
|
_requestLabelData(eventbus$1, labelId) {
|
|
3594
|
-
eventbus$1.broadcast(
|
|
4715
|
+
eventbus$1.broadcast("request-label-collection", [labelId, (labelCollection) => {
|
|
3595
4716
|
if (labelCollection) this._createTextDataLookup(labelCollection);
|
|
3596
4717
|
else throw new Error(`Label id '${labelId}' does not exist!`);
|
|
3597
4718
|
}]);
|
|
@@ -3655,14 +4776,20 @@ var LottieController = class extends BaseController {
|
|
|
3655
4776
|
if (!this.operationData) return;
|
|
3656
4777
|
const { labelIds } = this.operationData;
|
|
3657
4778
|
if (labelIds?.length) {
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
this.
|
|
4779
|
+
let currentLanguage = "en-US";
|
|
4780
|
+
let labelCollections = [];
|
|
4781
|
+
eventbus$1.broadcast("request-current-language", [(language) => {
|
|
4782
|
+
currentLanguage = language;
|
|
4783
|
+
}]);
|
|
4784
|
+
this.currentLanguage = currentLanguage;
|
|
4785
|
+
this.addListener(eventbus$1, "language-change", this._handleLanguageChange);
|
|
4786
|
+
eventbus$1.broadcast("request-label-collections", [this.operationData.labelIds, (collections) => {
|
|
4787
|
+
labelCollections = collections;
|
|
4788
|
+
}]);
|
|
4789
|
+
this._createTextDataLookup(labelCollections);
|
|
3664
4790
|
}
|
|
3665
4791
|
this._createAnimation();
|
|
4792
|
+
this._createAnimation();
|
|
3666
4793
|
}
|
|
3667
4794
|
detach(eventbus$1) {
|
|
3668
4795
|
super.detach(eventbus$1);
|
|
@@ -3715,6 +4842,116 @@ var LottieController = class extends BaseController {
|
|
|
3715
4842
|
}
|
|
3716
4843
|
};
|
|
3717
4844
|
|
|
4845
|
+
//#endregion
|
|
4846
|
+
//#region src/controllers/mutation-observer-controller.ts
|
|
4847
|
+
/**
|
|
4848
|
+
* Controller that observes DOM mutations on a selected element and broadcasts events.
|
|
4849
|
+
*
|
|
4850
|
+
* This controller creates a MutationObserver to monitor DOM changes (attributes, child nodes,
|
|
4851
|
+
* text content) on a specified element. All detected mutations are broadcasted through the
|
|
4852
|
+
* Eligius eventbus, enabling reactive behavior in response to DOM changes.
|
|
4853
|
+
*
|
|
4854
|
+
* The controller follows the standard Eligius lifecycle:
|
|
4855
|
+
* - init(): Store configuration metadata
|
|
4856
|
+
* - attach(): Create and start the MutationObserver
|
|
4857
|
+
* - detach(): Disconnect the observer and clean up resources
|
|
4858
|
+
*
|
|
4859
|
+
* @example
|
|
4860
|
+
* ```typescript
|
|
4861
|
+
* // JSON configuration
|
|
4862
|
+
* {
|
|
4863
|
+
* "systemName": "addControllerToElement",
|
|
4864
|
+
* "operationData": {
|
|
4865
|
+
* "controllerName": "MutationObserverController",
|
|
4866
|
+
* "observeAttributes": true,
|
|
4867
|
+
* "observeChildList": true,
|
|
4868
|
+
* "observeCharacterData": false
|
|
4869
|
+
* }
|
|
4870
|
+
* }
|
|
4871
|
+
*
|
|
4872
|
+
* // Listen for mutations
|
|
4873
|
+
* eventbus.on('dom-mutation', (payload: IMutationEventPayload) => {
|
|
4874
|
+
* console.log('Mutations detected:', payload.mutations);
|
|
4875
|
+
* });
|
|
4876
|
+
* ```
|
|
4877
|
+
*/
|
|
4878
|
+
var MutationObserverController = class extends BaseController {
|
|
4879
|
+
name = "MutationObserverController";
|
|
4880
|
+
observer = null;
|
|
4881
|
+
/**
|
|
4882
|
+
* Initialize the controller with configuration metadata.
|
|
4883
|
+
*
|
|
4884
|
+
* @param operationData - Configuration for observation behavior
|
|
4885
|
+
*/
|
|
4886
|
+
init(operationData) {
|
|
4887
|
+
this.operationData = Object.assign({}, operationData);
|
|
4888
|
+
}
|
|
4889
|
+
/**
|
|
4890
|
+
* Attach the controller and start observing mutations.
|
|
4891
|
+
* Creates MutationObserver instance and begins monitoring the target element.
|
|
4892
|
+
*
|
|
4893
|
+
* @param eventbus - Eligius eventbus for broadcasting mutation events
|
|
4894
|
+
*/
|
|
4895
|
+
attach(eventbus$1) {
|
|
4896
|
+
if (!this.operationData) return;
|
|
4897
|
+
const nativeElement = this.operationData.selectedElement.get(0);
|
|
4898
|
+
if (!nativeElement) return;
|
|
4899
|
+
const options = this._buildObserverOptions();
|
|
4900
|
+
this.observer = new MutationObserver(this._handleMutations.bind(this, eventbus$1, nativeElement));
|
|
4901
|
+
this.observer.observe(nativeElement, options);
|
|
4902
|
+
}
|
|
4903
|
+
/**
|
|
4904
|
+
* Detach the controller and stop observing mutations.
|
|
4905
|
+
* Disconnects MutationObserver and cleans up resources.
|
|
4906
|
+
*
|
|
4907
|
+
* @param eventbus - Eligius eventbus (used by BaseController for cleanup)
|
|
4908
|
+
*/
|
|
4909
|
+
detach(eventbus$1) {
|
|
4910
|
+
if (this.observer) {
|
|
4911
|
+
this.observer.disconnect();
|
|
4912
|
+
this.observer = null;
|
|
4913
|
+
}
|
|
4914
|
+
super.detach(eventbus$1);
|
|
4915
|
+
}
|
|
4916
|
+
/**
|
|
4917
|
+
* Build MutationObserverInit options from controller metadata.
|
|
4918
|
+
* Applies default values for optional configuration properties.
|
|
4919
|
+
*
|
|
4920
|
+
* @returns MutationObserverInit options object
|
|
4921
|
+
* @private
|
|
4922
|
+
*/
|
|
4923
|
+
_buildObserverOptions() {
|
|
4924
|
+
if (!this.operationData) return {};
|
|
4925
|
+
const { observeAttributes = true, observeChildList = true, observeCharacterData = true, observeSubtree = false, attributeOldValue = false, characterDataOldValue = false, attributeFilter } = this.operationData;
|
|
4926
|
+
return {
|
|
4927
|
+
attributes: observeAttributes,
|
|
4928
|
+
childList: observeChildList,
|
|
4929
|
+
characterData: observeCharacterData,
|
|
4930
|
+
subtree: observeSubtree,
|
|
4931
|
+
attributeOldValue,
|
|
4932
|
+
characterDataOldValue,
|
|
4933
|
+
attributeFilter
|
|
4934
|
+
};
|
|
4935
|
+
}
|
|
4936
|
+
/**
|
|
4937
|
+
* Handle mutations detected by the MutationObserver.
|
|
4938
|
+
* Broadcasts mutation events through the eventbus with mutation details.
|
|
4939
|
+
*
|
|
4940
|
+
* @param eventbus - Eligius eventbus for broadcasting
|
|
4941
|
+
* @param target - The observed element
|
|
4942
|
+
* @param mutations - Array of mutation records from observer callback
|
|
4943
|
+
* @private
|
|
4944
|
+
*/
|
|
4945
|
+
_handleMutations(eventbus$1, target, mutations) {
|
|
4946
|
+
const payload = {
|
|
4947
|
+
mutations,
|
|
4948
|
+
target,
|
|
4949
|
+
timestamp: Date.now()
|
|
4950
|
+
};
|
|
4951
|
+
eventbus$1.broadcast("dom-mutation", [payload]);
|
|
4952
|
+
}
|
|
4953
|
+
};
|
|
4954
|
+
|
|
3718
4955
|
//#endregion
|
|
3719
4956
|
//#region src/controllers/navigation-controller.ts
|
|
3720
4957
|
var NavigationController = class extends BaseController {
|
|
@@ -3834,7 +5071,7 @@ var NavigationController = class extends BaseController {
|
|
|
3834
5071
|
_handleVideoComplete(index) {
|
|
3835
5072
|
const navData = this.navVidIdLookup[index];
|
|
3836
5073
|
if (navData.autoNext) this.eventbus?.broadcast("request-video-url", [navData.next.videoUrlIndex]);
|
|
3837
|
-
else this.eventbus?.broadcast("request-video-cleanup");
|
|
5074
|
+
else this.eventbus?.broadcast("request-video-cleanup", []);
|
|
3838
5075
|
}
|
|
3839
5076
|
_addLabel(parentElm, labelId) {
|
|
3840
5077
|
const data = {
|
|
@@ -3890,8 +5127,8 @@ var ProgressbarController = class extends BaseController {
|
|
|
3890
5127
|
this.textElement = operationData.textElement;
|
|
3891
5128
|
}
|
|
3892
5129
|
attach(eventbus$1) {
|
|
3893
|
-
this.addListener(eventbus$1,
|
|
3894
|
-
eventbus$1.broadcast(
|
|
5130
|
+
this.addListener(eventbus$1, "timeline-time", this._positionUpdateHandler);
|
|
5131
|
+
eventbus$1.broadcast("timeline-duration-request", [(duration) => this.duration = duration]);
|
|
3895
5132
|
this.selectedElement?.css({ "pointer-events": "none" });
|
|
3896
5133
|
const container = this.selectedElement?.parent();
|
|
3897
5134
|
if (container) {
|
|
@@ -3912,7 +5149,7 @@ var ProgressbarController = class extends BaseController {
|
|
|
3912
5149
|
const rect = event.target.getBoundingClientRect();
|
|
3913
5150
|
const x = event.clientX - rect.left;
|
|
3914
5151
|
const percentage = 100 / rect.width * x;
|
|
3915
|
-
eventbus$1.broadcast(
|
|
5152
|
+
eventbus$1.broadcast("timeline-seek-request", [Math.round(this.duration / 100 * percentage)]);
|
|
3916
5153
|
}
|
|
3917
5154
|
};
|
|
3918
5155
|
|
|
@@ -4041,9 +5278,9 @@ var SubtitlesController = class extends BaseController {
|
|
|
4041
5278
|
name = "SubtitlesController";
|
|
4042
5279
|
subtitleDurations = null;
|
|
4043
5280
|
attach(eventbus$1) {
|
|
4044
|
-
this.addListener(eventbus$1,
|
|
4045
|
-
this.addListener(eventbus$1,
|
|
4046
|
-
this.addListener(eventbus$1,
|
|
5281
|
+
this.addListener(eventbus$1, "timeline-time", this.onTimeHandler);
|
|
5282
|
+
this.addListener(eventbus$1, "timeline-seeked", this.onSeekedHandler);
|
|
5283
|
+
this.addListener(eventbus$1, "language-change", this.languageChangeHandler);
|
|
4047
5284
|
}
|
|
4048
5285
|
detach(eventbus$1) {
|
|
4049
5286
|
super.detach(eventbus$1);
|
|
@@ -4063,10 +5300,9 @@ var SubtitlesController = class extends BaseController {
|
|
|
4063
5300
|
func();
|
|
4064
5301
|
}
|
|
4065
5302
|
}
|
|
4066
|
-
onSeekedHandler(
|
|
4067
|
-
const
|
|
4068
|
-
const
|
|
4069
|
-
const func = duration ? this.actionLookup[duration.start ?? -1] : void 0;
|
|
5303
|
+
onSeekedHandler(position, _duration) {
|
|
5304
|
+
const subtitleDuration = this.subtitleDurations?.find((x) => x.start <= position && x.end >= position);
|
|
5305
|
+
const func = subtitleDuration ? this.actionLookup[subtitleDuration.start ?? -1] : void 0;
|
|
4070
5306
|
if (func && this.lastFunc !== func) {
|
|
4071
5307
|
this.lastFunc = func;
|
|
4072
5308
|
func();
|
|
@@ -4105,6 +5341,7 @@ var controllers_exports = /* @__PURE__ */ __export({
|
|
|
4105
5341
|
DOMEventListenerController: () => DOMEventListenerController,
|
|
4106
5342
|
LabelController: () => LabelController,
|
|
4107
5343
|
LottieController: () => LottieController,
|
|
5344
|
+
MutationObserverController: () => MutationObserverController,
|
|
4108
5345
|
NavigationController: () => NavigationController,
|
|
4109
5346
|
ProgressbarController: () => ProgressbarController,
|
|
4110
5347
|
RoutingController: () => RoutingController,
|
|
@@ -4200,7 +5437,7 @@ It resolves after the animation completes.`,
|
|
|
4200
5437
|
|
|
4201
5438
|
//#endregion
|
|
4202
5439
|
//#region src/operation/metadata/announce-to-screen-reader.ts
|
|
4203
|
-
function announceToScreenReader() {
|
|
5440
|
+
function announceToScreenReader$1() {
|
|
4204
5441
|
return {
|
|
4205
5442
|
description: `Announces a message to screen readers using an ARIA live region.`,
|
|
4206
5443
|
category: `Accessibility`,
|
|
@@ -4316,7 +5553,7 @@ Or, if the \`properties\` property is set only removes the properties defined by
|
|
|
4316
5553
|
|
|
4317
5554
|
//#endregion
|
|
4318
5555
|
//#region src/operation/metadata/clear-storage.ts
|
|
4319
|
-
function clearStorage() {
|
|
5556
|
+
function clearStorage$1() {
|
|
4320
5557
|
return {
|
|
4321
5558
|
description: `Clears data from browser storage (localStorage or sessionStorage).
|
|
4322
5559
|
|
|
@@ -4338,7 +5575,7 @@ If \`key\` is provided, removes only that key. If \`key\` is omitted, clears all
|
|
|
4338
5575
|
|
|
4339
5576
|
//#endregion
|
|
4340
5577
|
//#region src/operation/metadata/compare-date.ts
|
|
4341
|
-
function compareDate() {
|
|
5578
|
+
function compareDate$1() {
|
|
4342
5579
|
return {
|
|
4343
5580
|
description: `Compares two dates.
|
|
4344
5581
|
comparison: -1 (before), 0 (equal), 1 (after)`,
|
|
@@ -4374,7 +5611,7 @@ comparison: -1 (before), 0 (equal), 1 (after)`,
|
|
|
4374
5611
|
|
|
4375
5612
|
//#endregion
|
|
4376
5613
|
//#region src/operation/metadata/concatenate-strings.ts
|
|
4377
|
-
function concatenateStrings() {
|
|
5614
|
+
function concatenateStrings$1() {
|
|
4378
5615
|
return {
|
|
4379
5616
|
description: `Concatenates multiple strings with an optional separator.`,
|
|
4380
5617
|
category: `String`,
|
|
@@ -4501,7 +5738,7 @@ function extendController$1() {
|
|
|
4501
5738
|
|
|
4502
5739
|
//#endregion
|
|
4503
5740
|
//#region src/operation/metadata/filter-array.ts
|
|
4504
|
-
function filterArray() {
|
|
5741
|
+
function filterArray$1() {
|
|
4505
5742
|
return {
|
|
4506
5743
|
description: `Filters an array based on property equality or custom predicate function.
|
|
4507
5744
|
|
|
@@ -4531,7 +5768,7 @@ Supports two filtering modes:
|
|
|
4531
5768
|
|
|
4532
5769
|
//#endregion
|
|
4533
5770
|
//#region src/operation/metadata/find-in-array.ts
|
|
4534
|
-
function findInArray() {
|
|
5771
|
+
function findInArray$1() {
|
|
4535
5772
|
return {
|
|
4536
5773
|
description: `Finds the first element in an array matching criteria.
|
|
4537
5774
|
|
|
@@ -4588,7 +5825,7 @@ loop iterations.`,
|
|
|
4588
5825
|
|
|
4589
5826
|
//#endregion
|
|
4590
5827
|
//#region src/operation/metadata/format-date.ts
|
|
4591
|
-
function formatDate() {
|
|
5828
|
+
function formatDate$1() {
|
|
4592
5829
|
return {
|
|
4593
5830
|
description: `Formats a date using Intl.DateTimeFormat or simple patterns.`,
|
|
4594
5831
|
category: `Date`,
|
|
@@ -4604,7 +5841,7 @@ function formatDate() {
|
|
|
4604
5841
|
|
|
4605
5842
|
//#endregion
|
|
4606
5843
|
//#region src/operation/metadata/format-text.ts
|
|
4607
|
-
function formatText() {
|
|
5844
|
+
function formatText$1() {
|
|
4608
5845
|
return {
|
|
4609
5846
|
description: `Transforms text using format operations: uppercase, lowercase, capitalize, titlecase, or trim.
|
|
4610
5847
|
|
|
@@ -4678,6 +5915,7 @@ It assigns this instance to the \`controllerInstance\` property on the current o
|
|
|
4678
5915
|
{ value: "DOMEventListenerController" },
|
|
4679
5916
|
{ value: "LabelController" },
|
|
4680
5917
|
{ value: "LottieController" },
|
|
5918
|
+
{ value: "MutationObserverController" },
|
|
4681
5919
|
{ value: "NavigationController" },
|
|
4682
5920
|
{ value: "ProgressbarController" },
|
|
4683
5921
|
{ value: "RoutingController" },
|
|
@@ -4692,7 +5930,7 @@ It assigns this instance to the \`controllerInstance\` property on the current o
|
|
|
4692
5930
|
|
|
4693
5931
|
//#endregion
|
|
4694
5932
|
//#region src/operation/metadata/get-current-time.ts
|
|
4695
|
-
function getCurrentTime() {
|
|
5933
|
+
function getCurrentTime$1() {
|
|
4696
5934
|
return {
|
|
4697
5935
|
description: `Gets the current time as timestamp and Date object.`,
|
|
4698
5936
|
category: `Date`,
|
|
@@ -4732,7 +5970,7 @@ it will add a value of 100 to the height and modify the width by a ratio of 8 to
|
|
|
4732
5970
|
|
|
4733
5971
|
//#endregion
|
|
4734
5972
|
//#region src/operation/metadata/get-focused-element.ts
|
|
4735
|
-
function getFocusedElement() {
|
|
5973
|
+
function getFocusedElement$1() {
|
|
4736
5974
|
return {
|
|
4737
5975
|
description: `Gets the currently focused element.`,
|
|
4738
5976
|
category: `Focus`,
|
|
@@ -4742,7 +5980,7 @@ function getFocusedElement() {
|
|
|
4742
5980
|
|
|
4743
5981
|
//#endregion
|
|
4744
5982
|
//#region src/operation/metadata/get-form-data.ts
|
|
4745
|
-
function getFormData() {
|
|
5983
|
+
function getFormData$1() {
|
|
4746
5984
|
return {
|
|
4747
5985
|
description: `Extracts all input, select, and textarea values from form element into operation data.
|
|
4748
5986
|
|
|
@@ -4788,7 +6026,7 @@ them on the returned operation data.`,
|
|
|
4788
6026
|
|
|
4789
6027
|
//#endregion
|
|
4790
6028
|
//#region src/operation/metadata/get-scroll-position.ts
|
|
4791
|
-
function getScrollPosition() {
|
|
6029
|
+
function getScrollPosition$1() {
|
|
4792
6030
|
return {
|
|
4793
6031
|
description: `Gets the current scroll position of the viewport.
|
|
4794
6032
|
|
|
@@ -4804,7 +6042,7 @@ Uses cross-browser compatible methods to retrieve scroll position.`,
|
|
|
4804
6042
|
|
|
4805
6043
|
//#endregion
|
|
4806
6044
|
//#region src/operation/metadata/get-text-content.ts
|
|
4807
|
-
function getTextContent() {
|
|
6045
|
+
function getTextContent$1() {
|
|
4808
6046
|
return {
|
|
4809
6047
|
description: `Extracts text content from element, stripping all HTML markup.
|
|
4810
6048
|
|
|
@@ -4818,7 +6056,7 @@ without any HTML tags. Preserves whitespace and text from nested elements.`,
|
|
|
4818
6056
|
|
|
4819
6057
|
//#endregion
|
|
4820
6058
|
//#region src/operation/metadata/http-delete.ts
|
|
4821
|
-
function httpDelete() {
|
|
6059
|
+
function httpDelete$1() {
|
|
4822
6060
|
return {
|
|
4823
6061
|
description: `Performs an HTTP DELETE request to the specified URL.`,
|
|
4824
6062
|
category: `HTTP`,
|
|
@@ -4842,7 +6080,7 @@ function httpDelete() {
|
|
|
4842
6080
|
|
|
4843
6081
|
//#endregion
|
|
4844
6082
|
//#region src/operation/metadata/http-post.ts
|
|
4845
|
-
function httpPost() {
|
|
6083
|
+
function httpPost$1() {
|
|
4846
6084
|
return {
|
|
4847
6085
|
description: `Performs an HTTP POST request to the specified URL.`,
|
|
4848
6086
|
category: `HTTP`,
|
|
@@ -4870,7 +6108,7 @@ function httpPost() {
|
|
|
4870
6108
|
|
|
4871
6109
|
//#endregion
|
|
4872
6110
|
//#region src/operation/metadata/http-put.ts
|
|
4873
|
-
function httpPut() {
|
|
6111
|
+
function httpPut$1() {
|
|
4874
6112
|
return {
|
|
4875
6113
|
description: `Performs an HTTP PUT request to the specified URL.`,
|
|
4876
6114
|
category: `HTTP`,
|
|
@@ -4921,7 +6159,7 @@ and assigns the result to the \`methodResult\` operationdata property.`,
|
|
|
4921
6159
|
|
|
4922
6160
|
//#endregion
|
|
4923
6161
|
//#region src/operation/metadata/is-element-in-viewport.ts
|
|
4924
|
-
function isElementInViewport() {
|
|
6162
|
+
function isElementInViewport$1() {
|
|
4925
6163
|
return {
|
|
4926
6164
|
description: `Checks if an element is currently visible within the viewport.
|
|
4927
6165
|
|
|
@@ -4934,7 +6172,7 @@ Uses \`getBoundingClientRect()\` to determine if the element is within the viewp
|
|
|
4934
6172
|
|
|
4935
6173
|
//#endregion
|
|
4936
6174
|
//#region src/operation/metadata/load-from-storage.ts
|
|
4937
|
-
function loadFromStorage() {
|
|
6175
|
+
function loadFromStorage$1() {
|
|
4938
6176
|
return {
|
|
4939
6177
|
description: `Loads data from browser storage (localStorage or sessionStorage).
|
|
4940
6178
|
|
|
@@ -5003,7 +6241,7 @@ it will log the current operation data, global data and scope to the console`,
|
|
|
5003
6241
|
|
|
5004
6242
|
//#endregion
|
|
5005
6243
|
//#region src/operation/metadata/map-array.ts
|
|
5006
|
-
function mapArray() {
|
|
6244
|
+
function mapArray$1() {
|
|
5007
6245
|
return {
|
|
5008
6246
|
description: `Transforms each element of an array using a mapping function.
|
|
5009
6247
|
|
|
@@ -5126,7 +6364,7 @@ by the specified \`newParentSelector\`.`,
|
|
|
5126
6364
|
|
|
5127
6365
|
//#endregion
|
|
5128
6366
|
//#region src/operation/metadata/replace-string.ts
|
|
5129
|
-
function replaceString() {
|
|
6367
|
+
function replaceString$1() {
|
|
5130
6368
|
return {
|
|
5131
6369
|
description: `Replaces occurrences of a pattern in a string (alias for replaceText for string context).`,
|
|
5132
6370
|
category: `String`,
|
|
@@ -5149,7 +6387,7 @@ function replaceString() {
|
|
|
5149
6387
|
|
|
5150
6388
|
//#endregion
|
|
5151
6389
|
//#region src/operation/metadata/replace-text.ts
|
|
5152
|
-
function replaceText() {
|
|
6390
|
+
function replaceText$1() {
|
|
5153
6391
|
return {
|
|
5154
6392
|
description: `Finds and replaces text using literal string or regex pattern.
|
|
5155
6393
|
|
|
@@ -5176,7 +6414,7 @@ Updates textContent with replaced text and sets replacementCount.`,
|
|
|
5176
6414
|
|
|
5177
6415
|
//#endregion
|
|
5178
6416
|
//#region src/operation/metadata/request-action.ts
|
|
5179
|
-
function requestAction$
|
|
6417
|
+
function requestAction$2() {
|
|
5180
6418
|
return {
|
|
5181
6419
|
description: `This operation requests an action instance with the specified name and assigns it
|
|
5182
6420
|
to the \`actionInstance\` property on the current operation data.`,
|
|
@@ -5192,7 +6430,7 @@ to the \`actionInstance\` property on the current operation data.`,
|
|
|
5192
6430
|
|
|
5193
6431
|
//#endregion
|
|
5194
6432
|
//#region src/operation/metadata/save-to-storage.ts
|
|
5195
|
-
function saveToStorage() {
|
|
6433
|
+
function saveToStorage$1() {
|
|
5196
6434
|
return {
|
|
5197
6435
|
description: `Saves data to browser storage (localStorage or sessionStorage).
|
|
5198
6436
|
|
|
@@ -5220,7 +6458,7 @@ Serializes the value as JSON before storing. Supports any JSON-serializable data
|
|
|
5220
6458
|
|
|
5221
6459
|
//#endregion
|
|
5222
6460
|
//#region src/operation/metadata/scroll-to-element.ts
|
|
5223
|
-
function scrollToElement() {
|
|
6461
|
+
function scrollToElement$1() {
|
|
5224
6462
|
return {
|
|
5225
6463
|
description: `Scrolls the viewport to bring the selected element into view.
|
|
5226
6464
|
|
|
@@ -5256,7 +6494,7 @@ Uses the browser's \`scrollIntoView\` API with configurable behavior.`,
|
|
|
5256
6494
|
|
|
5257
6495
|
//#endregion
|
|
5258
6496
|
//#region src/operation/metadata/scroll-to-position.ts
|
|
5259
|
-
function scrollToPosition() {
|
|
6497
|
+
function scrollToPosition$1() {
|
|
5260
6498
|
return {
|
|
5261
6499
|
description: `Scrolls the viewport to a specific x,y coordinate position.
|
|
5262
6500
|
|
|
@@ -5374,7 +6612,7 @@ When set to \`prepend\` the new content will be inserted before the current cont
|
|
|
5374
6612
|
|
|
5375
6613
|
//#endregion
|
|
5376
6614
|
//#region src/operation/metadata/set-focus.ts
|
|
5377
|
-
function setFocus() {
|
|
6615
|
+
function setFocus$1() {
|
|
5378
6616
|
return {
|
|
5379
6617
|
description: `Sets focus to the selected element.`,
|
|
5380
6618
|
category: `Focus`,
|
|
@@ -5384,7 +6622,7 @@ function setFocus() {
|
|
|
5384
6622
|
|
|
5385
6623
|
//#endregion
|
|
5386
6624
|
//#region src/operation/metadata/set-form-value.ts
|
|
5387
|
-
function setFormValue() {
|
|
6625
|
+
function setFormValue$1() {
|
|
5388
6626
|
return {
|
|
5389
6627
|
description: `Sets the value of an input, select, or textarea element.
|
|
5390
6628
|
|
|
@@ -5483,7 +6721,7 @@ function setVariable$1() {
|
|
|
5483
6721
|
|
|
5484
6722
|
//#endregion
|
|
5485
6723
|
//#region src/operation/metadata/sort-array.ts
|
|
5486
|
-
function sortArray() {
|
|
6724
|
+
function sortArray$1() {
|
|
5487
6725
|
return {
|
|
5488
6726
|
description: `Sorts an array by property, natural order, or custom comparator function.
|
|
5489
6727
|
|
|
@@ -5514,7 +6752,7 @@ Supports three sorting modes:
|
|
|
5514
6752
|
|
|
5515
6753
|
//#endregion
|
|
5516
6754
|
//#region src/operation/metadata/split-string.ts
|
|
5517
|
-
function splitString() {
|
|
6755
|
+
function splitString$1() {
|
|
5518
6756
|
return {
|
|
5519
6757
|
description: `Splits a string into an array by delimiter (string or regex).`,
|
|
5520
6758
|
category: `String`,
|
|
@@ -5557,7 +6795,7 @@ are removed from the current operation data.`,
|
|
|
5557
6795
|
|
|
5558
6796
|
//#endregion
|
|
5559
6797
|
//#region src/operation/metadata/substring-text.ts
|
|
5560
|
-
function substringText() {
|
|
6798
|
+
function substringText$1() {
|
|
5561
6799
|
return {
|
|
5562
6800
|
description: `Extracts a substring from text between start and end indices.`,
|
|
5563
6801
|
category: `Text`,
|
|
@@ -5610,7 +6848,7 @@ it will be hidden.`,
|
|
|
5610
6848
|
|
|
5611
6849
|
//#endregion
|
|
5612
6850
|
//#region src/operation/metadata/toggle-form-element.ts
|
|
5613
|
-
function toggleFormElement() {
|
|
6851
|
+
function toggleFormElement$1() {
|
|
5614
6852
|
return {
|
|
5615
6853
|
description: `Enables or disables form input elements (inputs, selects, textareas, buttons).
|
|
5616
6854
|
|
|
@@ -5628,7 +6866,7 @@ attribute; when false, adds the disabled attribute.`,
|
|
|
5628
6866
|
|
|
5629
6867
|
//#endregion
|
|
5630
6868
|
//#region src/operation/metadata/validate-form.ts
|
|
5631
|
-
function validateForm() {
|
|
6869
|
+
function validateForm$1() {
|
|
5632
6870
|
return {
|
|
5633
6871
|
description: `Validates form fields against HTML5 validation and custom rules.
|
|
5634
6872
|
|
|
@@ -5689,21 +6927,21 @@ $scope.loopIndex: for a scope value`,
|
|
|
5689
6927
|
|
|
5690
6928
|
//#endregion
|
|
5691
6929
|
//#region src/operation/metadata/index.ts
|
|
5692
|
-
var metadata_exports = /* @__PURE__ */ __export({
|
|
6930
|
+
var metadata_exports$2 = /* @__PURE__ */ __export({
|
|
5693
6931
|
addClass: () => addClass$1,
|
|
5694
6932
|
addControllerToElement: () => addControllerToElement$1,
|
|
5695
6933
|
addGlobalsToOperation: () => addGlobalsToOperation$1,
|
|
5696
6934
|
animate: () => animate$1,
|
|
5697
6935
|
animateWithClass: () => animateWithClass$1,
|
|
5698
|
-
announceToScreenReader: () => announceToScreenReader,
|
|
6936
|
+
announceToScreenReader: () => announceToScreenReader$1,
|
|
5699
6937
|
breakForEach: () => breakForEach$1,
|
|
5700
6938
|
broadcastEvent: () => broadcastEvent$1,
|
|
5701
6939
|
calc: () => calc$1,
|
|
5702
6940
|
clearElement: () => clearElement$1,
|
|
5703
6941
|
clearOperationData: () => clearOperationData$1,
|
|
5704
|
-
clearStorage: () => clearStorage,
|
|
5705
|
-
compareDate: () => compareDate,
|
|
5706
|
-
concatenateStrings: () => concatenateStrings,
|
|
6942
|
+
clearStorage: () => clearStorage$1,
|
|
6943
|
+
compareDate: () => compareDate$1,
|
|
6944
|
+
concatenateStrings: () => concatenateStrings$1,
|
|
5707
6945
|
continueForEach: () => continueForEach$1,
|
|
5708
6946
|
createElement: () => createElement$1,
|
|
5709
6947
|
customFunction: () => customFunction$1,
|
|
@@ -5711,31 +6949,31 @@ var metadata_exports = /* @__PURE__ */ __export({
|
|
|
5711
6949
|
endForEach: () => endForEach$1,
|
|
5712
6950
|
endWhen: () => endWhen$1,
|
|
5713
6951
|
extendController: () => extendController$1,
|
|
5714
|
-
filterArray: () => filterArray,
|
|
5715
|
-
findInArray: () => findInArray,
|
|
6952
|
+
filterArray: () => filterArray$1,
|
|
6953
|
+
findInArray: () => findInArray$1,
|
|
5716
6954
|
forEach: () => forEach$1,
|
|
5717
|
-
formatDate: () => formatDate,
|
|
5718
|
-
formatText: () => formatText,
|
|
6955
|
+
formatDate: () => formatDate$1,
|
|
6956
|
+
formatText: () => formatText$1,
|
|
5719
6957
|
getAttributesFromElement: () => getAttributesFromElement$1,
|
|
5720
6958
|
getControllerFromElement: () => getControllerFromElement$1,
|
|
5721
6959
|
getControllerInstance: () => getControllerInstance$1,
|
|
5722
|
-
getCurrentTime: () => getCurrentTime,
|
|
6960
|
+
getCurrentTime: () => getCurrentTime$1,
|
|
5723
6961
|
getElementDimensions: () => getElementDimensions$1,
|
|
5724
|
-
getFocusedElement: () => getFocusedElement,
|
|
5725
|
-
getFormData: () => getFormData,
|
|
6962
|
+
getFocusedElement: () => getFocusedElement$1,
|
|
6963
|
+
getFormData: () => getFormData$1,
|
|
5726
6964
|
getImport: () => getImport$1,
|
|
5727
6965
|
getQueryParams: () => getQueryParams$1,
|
|
5728
|
-
getScrollPosition: () => getScrollPosition,
|
|
5729
|
-
getTextContent: () => getTextContent,
|
|
5730
|
-
httpDelete: () => httpDelete,
|
|
5731
|
-
httpPost: () => httpPost,
|
|
5732
|
-
httpPut: () => httpPut,
|
|
6966
|
+
getScrollPosition: () => getScrollPosition$1,
|
|
6967
|
+
getTextContent: () => getTextContent$1,
|
|
6968
|
+
httpDelete: () => httpDelete$1,
|
|
6969
|
+
httpPost: () => httpPost$1,
|
|
6970
|
+
httpPut: () => httpPut$1,
|
|
5733
6971
|
invokeObjectMethod: () => invokeObjectMethod$1,
|
|
5734
|
-
isElementInViewport: () => isElementInViewport,
|
|
5735
|
-
loadFromStorage: () => loadFromStorage,
|
|
6972
|
+
isElementInViewport: () => isElementInViewport$1,
|
|
6973
|
+
loadFromStorage: () => loadFromStorage$1,
|
|
5736
6974
|
loadJson: () => loadJson$1,
|
|
5737
6975
|
log: () => log$1,
|
|
5738
|
-
mapArray: () => mapArray,
|
|
6976
|
+
mapArray: () => mapArray$1,
|
|
5739
6977
|
math: () => math$1,
|
|
5740
6978
|
otherwise: () => otherwise$1,
|
|
5741
6979
|
removeClass: () => removeClass$1,
|
|
@@ -5743,30 +6981,30 @@ var metadata_exports = /* @__PURE__ */ __export({
|
|
|
5743
6981
|
removeElement: () => removeElement$1,
|
|
5744
6982
|
removePropertiesFromOperationData: () => removePropertiesFromOperationData$1,
|
|
5745
6983
|
reparentElement: () => reparentElement$1,
|
|
5746
|
-
replaceString: () => replaceString,
|
|
5747
|
-
replaceText: () => replaceText,
|
|
5748
|
-
requestAction: () => requestAction$
|
|
5749
|
-
saveToStorage: () => saveToStorage,
|
|
5750
|
-
scrollToElement: () => scrollToElement,
|
|
5751
|
-
scrollToPosition: () => scrollToPosition,
|
|
6984
|
+
replaceString: () => replaceString$1,
|
|
6985
|
+
replaceText: () => replaceText$1,
|
|
6986
|
+
requestAction: () => requestAction$2,
|
|
6987
|
+
saveToStorage: () => saveToStorage$1,
|
|
6988
|
+
scrollToElement: () => scrollToElement$1,
|
|
6989
|
+
scrollToPosition: () => scrollToPosition$1,
|
|
5752
6990
|
selectElement: () => selectElement$1,
|
|
5753
6991
|
setData: () => setData$1,
|
|
5754
6992
|
setElementAttributes: () => setElementAttributes$1,
|
|
5755
6993
|
setElementContent: () => setElementContent$1,
|
|
5756
|
-
setFocus: () => setFocus,
|
|
5757
|
-
setFormValue: () => setFormValue,
|
|
6994
|
+
setFocus: () => setFocus$1,
|
|
6995
|
+
setFormValue: () => setFormValue$1,
|
|
5758
6996
|
setGlobalData: () => setGlobalData$1,
|
|
5759
6997
|
setOperationData: () => setOperationData$1,
|
|
5760
6998
|
setStyle: () => setStyle$1,
|
|
5761
6999
|
setVariable: () => setVariable$1,
|
|
5762
|
-
sortArray: () => sortArray,
|
|
5763
|
-
splitString: () => splitString,
|
|
7000
|
+
sortArray: () => sortArray$1,
|
|
7001
|
+
splitString: () => splitString$1,
|
|
5764
7002
|
startAction: () => startAction$1,
|
|
5765
|
-
substringText: () => substringText,
|
|
7003
|
+
substringText: () => substringText$1,
|
|
5766
7004
|
toggleClass: () => toggleClass$1,
|
|
5767
7005
|
toggleElement: () => toggleElement$1,
|
|
5768
|
-
toggleFormElement: () => toggleFormElement,
|
|
5769
|
-
validateForm: () => validateForm,
|
|
7006
|
+
toggleFormElement: () => toggleFormElement$1,
|
|
7007
|
+
validateForm: () => validateForm$1,
|
|
5770
7008
|
wait: () => wait$1,
|
|
5771
7009
|
when: () => when$1
|
|
5772
7010
|
});
|
|
@@ -5800,7 +7038,7 @@ var ControllerNamesProvider = class {
|
|
|
5800
7038
|
*/
|
|
5801
7039
|
var OperationMetadataProvider = class {
|
|
5802
7040
|
getOperationMetadata(operationName) {
|
|
5803
|
-
const getMetadata = metadata_exports[operationName];
|
|
7041
|
+
const getMetadata = metadata_exports$2[operationName];
|
|
5804
7042
|
if (!getMetadata) throw new Error(`Could not find metadata for operation called ${operationName}`);
|
|
5805
7043
|
return getMetadata();
|
|
5806
7044
|
}
|
|
@@ -5812,7 +7050,42 @@ var OperationMetadataProvider = class {
|
|
|
5812
7050
|
*/
|
|
5813
7051
|
var TimeLineEventNamesProvider = class {
|
|
5814
7052
|
getEventNames() {
|
|
5815
|
-
return
|
|
7053
|
+
return [
|
|
7054
|
+
"timeline-play-toggle-request",
|
|
7055
|
+
"timeline-play-request",
|
|
7056
|
+
"timeline-stop-request",
|
|
7057
|
+
"timeline-pause-request",
|
|
7058
|
+
"timeline-seek-request",
|
|
7059
|
+
"timeline-resize-request",
|
|
7060
|
+
"timeline-container-request",
|
|
7061
|
+
"timeline-duration-request",
|
|
7062
|
+
"timeline-request-current-timeline",
|
|
7063
|
+
"timeline-duration",
|
|
7064
|
+
"timeline-time",
|
|
7065
|
+
"timeline-seeked",
|
|
7066
|
+
"timeline-complete",
|
|
7067
|
+
"timeline-restart",
|
|
7068
|
+
"timeline-play",
|
|
7069
|
+
"timeline-stop",
|
|
7070
|
+
"timeline-pause",
|
|
7071
|
+
"timeline-seek",
|
|
7072
|
+
"timeline-resize",
|
|
7073
|
+
"timeline-current-timeline-change",
|
|
7074
|
+
"timeline-firstframe",
|
|
7075
|
+
"request-instance",
|
|
7076
|
+
"request-action",
|
|
7077
|
+
"request-function",
|
|
7078
|
+
"request-timeline-uri",
|
|
7079
|
+
"before-request-timeline-uri",
|
|
7080
|
+
"request-engine-root",
|
|
7081
|
+
"request-current-timeline-position",
|
|
7082
|
+
"request-timeline-cleanup",
|
|
7083
|
+
"request-label-collection",
|
|
7084
|
+
"request-label-collections",
|
|
7085
|
+
"request-current-language",
|
|
7086
|
+
"language-change",
|
|
7087
|
+
"dom-mutation"
|
|
7088
|
+
];
|
|
5816
7089
|
}
|
|
5817
7090
|
};
|
|
5818
7091
|
|
|
@@ -6072,20 +7345,168 @@ function resolvePlaceholders(configFragment, rootConfig, importer) {
|
|
|
6072
7345
|
resolvePlaceholder(key, configFragment, rootConfig, importer);
|
|
6073
7346
|
});
|
|
6074
7347
|
}
|
|
6075
|
-
function resolvePlaceholder(key, configFragment, rootConfig, importer) {
|
|
6076
|
-
const configValue = configFragment[key];
|
|
6077
|
-
if (isString(configValue)) {
|
|
6078
|
-
if (configValue.startsWith("config:")) configFragment[key] = resolvePropertyChain(configValue.substring(7, configValue.length), rootConfig);
|
|
6079
|
-
else if (configValue.startsWith("template:")) {
|
|
6080
|
-
const templateKey = configValue.substring(9, configValue.length);
|
|
6081
|
-
configFragment[key] = importer.import(templateKey)[templateKey];
|
|
6082
|
-
} else if (configValue.startsWith("json:")) {
|
|
6083
|
-
const jsonKey = configValue.substring(5, configValue.length);
|
|
6084
|
-
configFragment[key] = importer.import(jsonKey)[jsonKey];
|
|
7348
|
+
function resolvePlaceholder(key, configFragment, rootConfig, importer) {
|
|
7349
|
+
const configValue = configFragment[key];
|
|
7350
|
+
if (isString(configValue)) {
|
|
7351
|
+
if (configValue.startsWith("config:")) configFragment[key] = resolvePropertyChain(configValue.substring(7, configValue.length), rootConfig);
|
|
7352
|
+
else if (configValue.startsWith("template:")) {
|
|
7353
|
+
const templateKey = configValue.substring(9, configValue.length);
|
|
7354
|
+
configFragment[key] = importer.import(templateKey)[templateKey];
|
|
7355
|
+
} else if (configValue.startsWith("json:")) {
|
|
7356
|
+
const jsonKey = configValue.substring(5, configValue.length);
|
|
7357
|
+
configFragment[key] = importer.import(jsonKey)[jsonKey];
|
|
7358
|
+
}
|
|
7359
|
+
} else if (isObject(configValue) || Array.isArray(configValue)) resolvePlaceholders(configValue, rootConfig, importer);
|
|
7360
|
+
}
|
|
7361
|
+
|
|
7362
|
+
//#endregion
|
|
7363
|
+
//#region src/controllers/metadata/dom-event-listener-controller.ts
|
|
7364
|
+
function DOMEventListenerController$1() {
|
|
7365
|
+
return {
|
|
7366
|
+
description: `This controller attaches to the given selected element and adds a DOM event listener for the specified event name that
|
|
7367
|
+
executes the given actions with the given operation data.
|
|
7368
|
+
|
|
7369
|
+
By default the \`start\` operations of the specified actions are executed. To execute the \`end\` operations instead,
|
|
7370
|
+
prefix the action name with \`end:\`.`,
|
|
7371
|
+
dependentProperties: ["selectedElement"],
|
|
7372
|
+
properties: {
|
|
7373
|
+
eventName: {
|
|
7374
|
+
type: "ParameterType:eventName",
|
|
7375
|
+
required: true
|
|
7376
|
+
},
|
|
7377
|
+
actions: {
|
|
7378
|
+
type: "ParameterType:array",
|
|
7379
|
+
itemType: "ParameterType:string"
|
|
7380
|
+
},
|
|
7381
|
+
actionOperationData: { type: "ParameterType:object" }
|
|
7382
|
+
}
|
|
7383
|
+
};
|
|
7384
|
+
}
|
|
7385
|
+
|
|
7386
|
+
//#endregion
|
|
7387
|
+
//#region src/controllers/metadata/label-controller.ts
|
|
7388
|
+
function LabelController$1() {
|
|
7389
|
+
return {
|
|
7390
|
+
description: `This controller attaches to the given selected element and renders the text associated with the given label id in it.
|
|
7391
|
+
|
|
7392
|
+
The controller also listen for the \`LANGUAGE_CHANGE\` event and re-renders the text with the new language after such an event.`,
|
|
7393
|
+
dependentProperties: ["selectedElement"],
|
|
7394
|
+
properties: {
|
|
7395
|
+
labelId: {
|
|
7396
|
+
type: "ParameterType:labelId",
|
|
7397
|
+
required: true
|
|
7398
|
+
},
|
|
7399
|
+
attributeName: { type: "ParameterType:string" }
|
|
7400
|
+
}
|
|
7401
|
+
};
|
|
7402
|
+
}
|
|
7403
|
+
|
|
7404
|
+
//#endregion
|
|
7405
|
+
//#region src/controllers/metadata/lottie-controller.ts
|
|
7406
|
+
function LottieController$1() {
|
|
7407
|
+
return {
|
|
7408
|
+
description: `This controller renders a [lottie-web](https://github.com/airbnb/lottie-web) animation inside the given selected element.
|
|
7409
|
+
|
|
7410
|
+
The url may encode freeze and end positions like this: my-url/filename[freeze=10,end=21].json`,
|
|
7411
|
+
properties: { url: {
|
|
7412
|
+
type: "ParameterType:url",
|
|
7413
|
+
required: true
|
|
7414
|
+
} }
|
|
7415
|
+
};
|
|
7416
|
+
}
|
|
7417
|
+
|
|
7418
|
+
//#endregion
|
|
7419
|
+
//#region src/controllers/metadata/mutation-observer-controller.ts
|
|
7420
|
+
function MutationObserverController$1() {
|
|
7421
|
+
return {
|
|
7422
|
+
description: `Controller that observes DOM mutations on a selected element and broadcasts events.
|
|
7423
|
+
|
|
7424
|
+
This controller creates a MutationObserver to monitor DOM changes (attributes, child nodes,
|
|
7425
|
+
text content) on a specified element. All detected mutations are broadcasted through the
|
|
7426
|
+
Eligius eventbus, enabling reactive behavior in response to DOM changes.
|
|
7427
|
+
|
|
7428
|
+
The controller follows the standard Eligius lifecycle:
|
|
7429
|
+
- init(): Store configuration metadata
|
|
7430
|
+
- attach(): Create and start the MutationObserver
|
|
7431
|
+
- detach(): Disconnect the observer and clean up resources`,
|
|
7432
|
+
dependentProperties: ["selectedElement"],
|
|
7433
|
+
properties: {
|
|
7434
|
+
observeAttributes: { type: "ParameterType:boolean" },
|
|
7435
|
+
observeChildList: { type: "ParameterType:boolean" },
|
|
7436
|
+
observeCharacterData: { type: "ParameterType:boolean" },
|
|
7437
|
+
observeSubtree: { type: "ParameterType:boolean" },
|
|
7438
|
+
attributeOldValue: { type: "ParameterType:boolean" },
|
|
7439
|
+
characterDataOldValue: { type: "ParameterType:boolean" },
|
|
7440
|
+
attributeFilter: {
|
|
7441
|
+
type: "ParameterType:array",
|
|
7442
|
+
itemType: "ParameterType:string"
|
|
7443
|
+
}
|
|
7444
|
+
}
|
|
7445
|
+
};
|
|
7446
|
+
}
|
|
7447
|
+
|
|
7448
|
+
//#endregion
|
|
7449
|
+
//#region src/controllers/metadata/navigation-controller.ts
|
|
7450
|
+
function NavigationController$1() {
|
|
7451
|
+
return {
|
|
7452
|
+
description: ``,
|
|
7453
|
+
dependentProperties: ["selectedElement"],
|
|
7454
|
+
properties: { json: {
|
|
7455
|
+
type: "ParameterType:object",
|
|
7456
|
+
required: true
|
|
7457
|
+
} }
|
|
7458
|
+
};
|
|
7459
|
+
}
|
|
7460
|
+
|
|
7461
|
+
//#endregion
|
|
7462
|
+
//#region src/controllers/metadata/progressbar-controller.ts
|
|
7463
|
+
function ProgressbarController$1() {
|
|
7464
|
+
return {
|
|
7465
|
+
description: `This controller renders a progressbar that displays the progress of the current timeline in the given selected element.
|
|
7466
|
+
|
|
7467
|
+
The current progress as a percentage is rendered in the given text element.`,
|
|
7468
|
+
dependentProperties: ["selectedElement", "textElement"]
|
|
7469
|
+
};
|
|
7470
|
+
}
|
|
7471
|
+
|
|
7472
|
+
//#endregion
|
|
7473
|
+
//#region src/controllers/metadata/routing-controller.ts
|
|
7474
|
+
function RoutingController$1() {
|
|
7475
|
+
return {
|
|
7476
|
+
description: `This is a work in progress, do not use this yet please....`,
|
|
7477
|
+
properties: { json: {
|
|
7478
|
+
type: "ParameterType:object",
|
|
7479
|
+
required: true
|
|
7480
|
+
} }
|
|
7481
|
+
};
|
|
7482
|
+
}
|
|
7483
|
+
|
|
7484
|
+
//#endregion
|
|
7485
|
+
//#region src/controllers/metadata/subtitles-controller.ts
|
|
7486
|
+
function SubtitlesController$1() {
|
|
7487
|
+
return {
|
|
7488
|
+
description: ``,
|
|
7489
|
+
dependentProperties: ["selectedElement"],
|
|
7490
|
+
properties: {
|
|
7491
|
+
language: { type: "ParameterType:`${Lowercase<string>}-${Uppercase<string>}`" },
|
|
7492
|
+
subtitleData: { type: "ParameterType:array" }
|
|
6085
7493
|
}
|
|
6086
|
-
}
|
|
7494
|
+
};
|
|
6087
7495
|
}
|
|
6088
7496
|
|
|
7497
|
+
//#endregion
|
|
7498
|
+
//#region src/controllers/metadata/index.ts
|
|
7499
|
+
var metadata_exports = /* @__PURE__ */ __export({
|
|
7500
|
+
DOMEventListenerController: () => DOMEventListenerController$1,
|
|
7501
|
+
LabelController: () => LabelController$1,
|
|
7502
|
+
LottieController: () => LottieController$1,
|
|
7503
|
+
MutationObserverController: () => MutationObserverController$1,
|
|
7504
|
+
NavigationController: () => NavigationController$1,
|
|
7505
|
+
ProgressbarController: () => ProgressbarController$1,
|
|
7506
|
+
RoutingController: () => RoutingController$1,
|
|
7507
|
+
SubtitlesController: () => SubtitlesController$1
|
|
7508
|
+
});
|
|
7509
|
+
|
|
6089
7510
|
//#endregion
|
|
6090
7511
|
//#region src/eligius-engine.ts
|
|
6091
7512
|
/**
|
|
@@ -6142,14 +7563,14 @@ var EligiusEngine = class EligiusEngine {
|
|
|
6142
7563
|
return this._activeTimelineProvider;
|
|
6143
7564
|
}
|
|
6144
7565
|
_onCompleteCallback() {
|
|
6145
|
-
this.eventbus.broadcast(
|
|
7566
|
+
this.eventbus.broadcast("timeline-complete", []);
|
|
6146
7567
|
}
|
|
6147
7568
|
_onFirstFrameCallback() {
|
|
6148
|
-
this.eventbus.broadcast(
|
|
6149
|
-
this.eventbus.broadcast(
|
|
7569
|
+
this.eventbus.broadcast("timeline-firstframe", []);
|
|
7570
|
+
this.eventbus.broadcast("timeline-duration", [this._activeTimelineProvider?.getDuration]);
|
|
6150
7571
|
}
|
|
6151
7572
|
_onRestartCallback() {
|
|
6152
|
-
this.eventbus.broadcast(
|
|
7573
|
+
this.eventbus.broadcast("timeline-restart", []);
|
|
6153
7574
|
}
|
|
6154
7575
|
async _cleanUp() {
|
|
6155
7576
|
await this._cleanUpTimeline();
|
|
@@ -6176,18 +7597,18 @@ var EligiusEngine = class EligiusEngine {
|
|
|
6176
7597
|
this._eventbusRemovers.push(this.eventbus.on(eventName, eventHandler, eventTopic));
|
|
6177
7598
|
}
|
|
6178
7599
|
_addEventbusListeners() {
|
|
6179
|
-
this._addEventListener(
|
|
6180
|
-
this._addEventListener(
|
|
6181
|
-
this._addEventListener(
|
|
6182
|
-
this._addEventListener(
|
|
6183
|
-
this._addEventListener(
|
|
6184
|
-
this._addEventListener(
|
|
6185
|
-
this._addEventListener(
|
|
6186
|
-
this._addEventListener(
|
|
6187
|
-
this._addEventListener(
|
|
6188
|
-
this._addEventListener(
|
|
6189
|
-
this._addEventListener(
|
|
6190
|
-
this._addEventListener(
|
|
7600
|
+
this._addEventListener("request-engine-root", this._handleRequestEngineRoot.bind(this, this.configuration.containerSelector));
|
|
7601
|
+
this._addEventListener("request-timeline-uri", this._handleRequestTimelineUri.bind(this));
|
|
7602
|
+
this._addEventListener("request-current-timeline-position", this._handleRequestTimelinePosition.bind(this, Math.floor));
|
|
7603
|
+
this._addEventListener("request-timeline-cleanup", this._handleTimelineComplete.bind(this));
|
|
7604
|
+
this._addEventListener("timeline-request-current-timeline", this._requestCurrentTimeline.bind(this));
|
|
7605
|
+
this._addEventListener("timeline-play-toggle-request", this._toggleplay.bind(this));
|
|
7606
|
+
this._addEventListener("timeline-play-request", this._playRequest.bind(this));
|
|
7607
|
+
this._addEventListener("timeline-stop-request", this._stopRequest.bind(this));
|
|
7608
|
+
this._addEventListener("timeline-pause-request", this._pauseRequest.bind(this));
|
|
7609
|
+
this._addEventListener("timeline-container-request", this.containerRequest.bind(this));
|
|
7610
|
+
this._addEventListener("timeline-duration-request", this.durationRequest.bind(this));
|
|
7611
|
+
this._addEventListener("timeline-seek-request", this.seekRequest.bind(this));
|
|
6191
7612
|
}
|
|
6192
7613
|
async seekRequest(position) {
|
|
6193
7614
|
if (!this._activeTimelineProvider) return;
|
|
@@ -6195,15 +7616,15 @@ var EligiusEngine = class EligiusEngine {
|
|
|
6195
7616
|
const duration = this._activeTimelineProvider.getDuration();
|
|
6196
7617
|
const currentPosition = this._activeTimelineProvider.getPosition();
|
|
6197
7618
|
if (seekPosition < 0 || seekPosition > duration) return;
|
|
6198
|
-
this.eventbus.broadcast(
|
|
7619
|
+
this.eventbus.broadcast("timeline-seek", [
|
|
6199
7620
|
seekPosition,
|
|
6200
7621
|
currentPosition,
|
|
6201
7622
|
duration
|
|
6202
7623
|
]);
|
|
6203
7624
|
await this._activeTimelineProvider.seek(seekPosition);
|
|
6204
7625
|
await this._executeSeekActions(seekPosition);
|
|
6205
|
-
this.eventbus.broadcast(
|
|
6206
|
-
this.eventbus.broadcast(
|
|
7626
|
+
this.eventbus.broadcast("timeline-seeked", [this._activeTimelineProvider.getPosition(), duration]);
|
|
7627
|
+
this.eventbus.broadcast("timeline-time", [this._activeTimelineProvider.getPosition()]);
|
|
6207
7628
|
if (this._activeTimelineProvider?.playState === "running") this._activeTimelineProvider?.start();
|
|
6208
7629
|
}
|
|
6209
7630
|
durationRequest(callBack) {
|
|
@@ -6215,17 +7636,17 @@ var EligiusEngine = class EligiusEngine {
|
|
|
6215
7636
|
_pauseRequest() {
|
|
6216
7637
|
if (!this._activeTimelineProvider) return;
|
|
6217
7638
|
this._activeTimelineProvider.pause();
|
|
6218
|
-
this.eventbus.broadcast(
|
|
7639
|
+
this.eventbus.broadcast("timeline-pause", []);
|
|
6219
7640
|
}
|
|
6220
7641
|
_stopRequest() {
|
|
6221
7642
|
if (!this._activeTimelineProvider) return;
|
|
6222
7643
|
this._activeTimelineProvider.stop();
|
|
6223
|
-
this.eventbus.broadcast(
|
|
7644
|
+
this.eventbus.broadcast("timeline-stop", []);
|
|
6224
7645
|
}
|
|
6225
7646
|
_playRequest() {
|
|
6226
7647
|
if (!this._activeTimelineProvider) return;
|
|
6227
7648
|
this._activeTimelineProvider.start();
|
|
6228
|
-
this.eventbus.broadcast(
|
|
7649
|
+
this.eventbus.broadcast("timeline-play", []);
|
|
6229
7650
|
}
|
|
6230
7651
|
_toggleplay() {
|
|
6231
7652
|
if (!this._activeTimelineProvider) return;
|
|
@@ -6303,17 +7724,17 @@ var EligiusEngine = class EligiusEngine {
|
|
|
6303
7724
|
const timelineConfig = this._timelineLookupCache.get(uri);
|
|
6304
7725
|
if (!timelineConfig || !this._activeTimelineProvider || this._currentTimelineUri === timelineConfig.uri) return;
|
|
6305
7726
|
this._currentTimelineUri = timelineConfig.uri;
|
|
6306
|
-
this.eventbus.broadcast(
|
|
7727
|
+
this.eventbus.broadcast("timeline-current-timeline-change", [this._currentTimelineUri]);
|
|
6307
7728
|
const newProviderSettings = this.timelineProviders[timelineConfig.type];
|
|
6308
7729
|
if (this._activeTimelineProvider !== newProviderSettings.provider) {
|
|
6309
7730
|
this._activeTimelineProvider.destroy();
|
|
6310
7731
|
this._activeTimelineProvider = newProviderSettings.provider;
|
|
6311
7732
|
}
|
|
6312
7733
|
this._activeTimelineProvider.loop = timelineConfig.loop;
|
|
6313
|
-
if (!this._activeTimelineProvider.loop && position > 0) this.eventbus.once(
|
|
7734
|
+
if (!this._activeTimelineProvider.loop && position > 0) this.eventbus.once("timeline-firstframe", async () => {
|
|
6314
7735
|
if (!this._activeTimelineProvider) return;
|
|
6315
7736
|
this._activeTimelineProvider.pause();
|
|
6316
|
-
this.eventbus.broadcast(
|
|
7737
|
+
this.eventbus.broadcast("timeline-duration", [this._activeTimelineProvider.getDuration]);
|
|
6317
7738
|
await this._executeStartActions();
|
|
6318
7739
|
const seekPosition = await this._activeTimelineProvider.seek(position);
|
|
6319
7740
|
this.seekRequest(seekPosition);
|
|
@@ -6364,7 +7785,7 @@ var EligiusEngine = class EligiusEngine {
|
|
|
6364
7785
|
const pos = floor(position);
|
|
6365
7786
|
if (this._lastPosition !== pos) {
|
|
6366
7787
|
this._executeActionsForPosition(pos);
|
|
6367
|
-
this.eventbus.broadcast(
|
|
7788
|
+
this.eventbus.broadcast("timeline-time", [pos]);
|
|
6368
7789
|
}
|
|
6369
7790
|
}
|
|
6370
7791
|
}
|
|
@@ -6509,7 +7930,7 @@ var RequestVideoUriInterceptor = class {
|
|
|
6509
7930
|
this.eventbus = eventbus$1;
|
|
6510
7931
|
}
|
|
6511
7932
|
intercept(args) {
|
|
6512
|
-
this.eventbus.broadcast(
|
|
7933
|
+
this.eventbus.broadcast("before-request-timeline-uri", args.slice());
|
|
6513
7934
|
return args;
|
|
6514
7935
|
}
|
|
6515
7936
|
};
|
|
@@ -6534,7 +7955,7 @@ function setGlobal(name, value) {
|
|
|
6534
7955
|
/**
|
|
6535
7956
|
* This class manages the labels for an {@link IEligiusEngine} instance.
|
|
6536
7957
|
*
|
|
6537
|
-
* It handles the
|
|
7958
|
+
* It handles the request-label-collection, request-label-collections, request-current-language and language-change events.
|
|
6538
7959
|
*
|
|
6539
7960
|
*/
|
|
6540
7961
|
var LanguageManager = class {
|
|
@@ -6553,10 +7974,10 @@ var LanguageManager = class {
|
|
|
6553
7974
|
this._eventbusRemovers.forEach((x) => x());
|
|
6554
7975
|
}
|
|
6555
7976
|
_addEventbusListeners(eventbus$1) {
|
|
6556
|
-
this._eventbusRemovers.push(eventbus$1.on(
|
|
6557
|
-
this._eventbusRemovers.push(eventbus$1.on(
|
|
6558
|
-
this._eventbusRemovers.push(eventbus$1.on(
|
|
6559
|
-
this._eventbusRemovers.push(eventbus$1.on(
|
|
7977
|
+
this._eventbusRemovers.push(eventbus$1.on("request-label-collection", this._handleRequestLabelCollection.bind(this)));
|
|
7978
|
+
this._eventbusRemovers.push(eventbus$1.on("request-label-collections", this._handleRequestLabelCollections.bind(this)));
|
|
7979
|
+
this._eventbusRemovers.push(eventbus$1.on("request-current-language", this._handleRequestCurrentLanguage.bind(this)));
|
|
7980
|
+
this._eventbusRemovers.push(eventbus$1.on("language-change", this._handleLanguageChange.bind(this)));
|
|
6560
7981
|
}
|
|
6561
7982
|
_handleRequestCurrentLanguage(resultCallback) {
|
|
6562
7983
|
resultCallback(this._currentLanguage);
|
|
@@ -6578,7 +7999,7 @@ var LanguageManager = class {
|
|
|
6578
7999
|
const lang = this._extractPrimaryLanguage(language);
|
|
6579
8000
|
$(rootSelector).attr("lang", lang);
|
|
6580
8001
|
};
|
|
6581
|
-
this._eventbus.broadcast(
|
|
8002
|
+
this._eventbus.broadcast("request-engine-root", [callBack]);
|
|
6582
8003
|
}
|
|
6583
8004
|
_extractPrimaryLanguage(culture) {
|
|
6584
8005
|
return culture.split("-").shift();
|
|
@@ -6622,9 +8043,9 @@ var EngineFactory = class {
|
|
|
6622
8043
|
this._eventbus = options?.eventbus ?? new Eventbus();
|
|
6623
8044
|
Diagnostics.active = options?.devtools ?? false;
|
|
6624
8045
|
if (Diagnostics.active) this._initializeDevtools(this._eventbus);
|
|
6625
|
-
this._eventRemovers.push(this._eventbus.on(
|
|
6626
|
-
this._eventRemovers.push(this._eventbus.on(
|
|
6627
|
-
this._eventRemovers.push(this._eventbus.on(
|
|
8046
|
+
this._eventRemovers.push(this._eventbus.on("request-instance", this._requestInstanceHandler.bind(this)));
|
|
8047
|
+
this._eventRemovers.push(this._eventbus.on("request-action", this._requestActionHandler.bind(this)));
|
|
8048
|
+
this._eventRemovers.push(this._eventbus.on("request-function", this._requestFunctionHandler.bind(this)));
|
|
6628
8049
|
const handleSpaceBound = this._handleSpacePress.bind(this);
|
|
6629
8050
|
hotkeys("space", handleSpaceBound);
|
|
6630
8051
|
this._eventRemovers.push(() => hotkeys.unbind("space", handleSpaceBound));
|
|
@@ -6635,7 +8056,7 @@ var EngineFactory = class {
|
|
|
6635
8056
|
}
|
|
6636
8057
|
_handleSpacePress(keyboardEvent, _hotkeysEvent) {
|
|
6637
8058
|
keyboardEvent.preventDefault();
|
|
6638
|
-
this._eventbus.broadcast(
|
|
8059
|
+
this._eventbus.broadcast("timeline-play-toggle-request", []);
|
|
6639
8060
|
return false;
|
|
6640
8061
|
}
|
|
6641
8062
|
_initializeDevtools(eventbus$1) {
|
|
@@ -6646,16 +8067,16 @@ var EngineFactory = class {
|
|
|
6646
8067
|
this._eventRemovers.push(agent.subscribe((message) => {
|
|
6647
8068
|
if (message.type === "playcontrol") switch (message.data.kind) {
|
|
6648
8069
|
case "play":
|
|
6649
|
-
this._eventbus.broadcast(
|
|
8070
|
+
this._eventbus.broadcast("timeline-play-request", []);
|
|
6650
8071
|
break;
|
|
6651
8072
|
case "stop":
|
|
6652
|
-
this._eventbus.broadcast(
|
|
8073
|
+
this._eventbus.broadcast("timeline-stop-request", []);
|
|
6653
8074
|
break;
|
|
6654
8075
|
case "pause":
|
|
6655
|
-
this._eventbus.broadcast(
|
|
8076
|
+
this._eventbus.broadcast("timeline-pause-request", []);
|
|
6656
8077
|
break;
|
|
6657
8078
|
case "seek":
|
|
6658
|
-
this._eventbus.broadcast(
|
|
8079
|
+
this._eventbus.broadcast("timeline-seek-request", [message.data.args ?? 0]);
|
|
6659
8080
|
break;
|
|
6660
8081
|
}
|
|
6661
8082
|
}));
|
|
@@ -6681,7 +8102,7 @@ var EngineFactory = class {
|
|
|
6681
8102
|
this._resizeTimeout = -1;
|
|
6682
8103
|
}
|
|
6683
8104
|
this._resizeTimeout = setTimeout(() => {
|
|
6684
|
-
this._eventbus.broadcast(
|
|
8105
|
+
this._eventbus.broadcast("timeline-resize", []);
|
|
6685
8106
|
}, 200);
|
|
6686
8107
|
}
|
|
6687
8108
|
_importSystemEntryWithEventbusDependency(systemName) {
|
|
@@ -6712,7 +8133,7 @@ var EngineFactory = class {
|
|
|
6712
8133
|
actionRegistryListener = new ActionRegistryEventbusListener();
|
|
6713
8134
|
this._eventRemovers.push(this._eventbus.registerEventlistener(actionRegistryListener));
|
|
6714
8135
|
}
|
|
6715
|
-
this._eventRemovers.push(this._eventbus.registerInterceptor(
|
|
8136
|
+
this._eventRemovers.push(this._eventbus.registerInterceptor("request-timeline-uri", new RequestVideoUriInterceptor(this._eventbus)));
|
|
6716
8137
|
resolver = resolver || new ConfigurationResolver(this._importer, this._eventbus);
|
|
6717
8138
|
const [actionLookup, resolvedConfiguration] = resolver.process(configuration, actionRegistryListener);
|
|
6718
8139
|
this._actionsLookup = actionLookup;
|
|
@@ -6736,6 +8157,610 @@ var EngineFactory = class {
|
|
|
6736
8157
|
}
|
|
6737
8158
|
};
|
|
6738
8159
|
|
|
8160
|
+
//#endregion
|
|
8161
|
+
//#region src/eventbus/events/metadata/before-request-timeline-uri.ts
|
|
8162
|
+
function beforeRequestTimelineUri() {
|
|
8163
|
+
return {
|
|
8164
|
+
description: `Event: before-request-timeline-uri`,
|
|
8165
|
+
category: `Timeline`,
|
|
8166
|
+
args: []
|
|
8167
|
+
};
|
|
8168
|
+
}
|
|
8169
|
+
|
|
8170
|
+
//#endregion
|
|
8171
|
+
//#region src/eventbus/events/metadata/before-request-video-url.ts
|
|
8172
|
+
function beforeRequestVideoUrl() {
|
|
8173
|
+
return {
|
|
8174
|
+
description: `Event: before-request-video-url`,
|
|
8175
|
+
category: `Navigation`,
|
|
8176
|
+
args: [
|
|
8177
|
+
{
|
|
8178
|
+
name: "index",
|
|
8179
|
+
type: "number"
|
|
8180
|
+
},
|
|
8181
|
+
{
|
|
8182
|
+
name: "requestedVideoPosition",
|
|
8183
|
+
type: "number"
|
|
8184
|
+
},
|
|
8185
|
+
{
|
|
8186
|
+
name: "isHistoryRequest",
|
|
8187
|
+
type: "boolean"
|
|
8188
|
+
}
|
|
8189
|
+
]
|
|
8190
|
+
};
|
|
8191
|
+
}
|
|
8192
|
+
|
|
8193
|
+
//#endregion
|
|
8194
|
+
//#region src/eventbus/events/metadata/dom-mutation.ts
|
|
8195
|
+
function domMutation() {
|
|
8196
|
+
return {
|
|
8197
|
+
description: `Event: dom-mutation`,
|
|
8198
|
+
category: `Controller`,
|
|
8199
|
+
args: [{
|
|
8200
|
+
name: "payload",
|
|
8201
|
+
type: "any"
|
|
8202
|
+
}]
|
|
8203
|
+
};
|
|
8204
|
+
}
|
|
8205
|
+
|
|
8206
|
+
//#endregion
|
|
8207
|
+
//#region src/eventbus/events/metadata/highlight-navigation.ts
|
|
8208
|
+
function highlightNavigation() {
|
|
8209
|
+
return {
|
|
8210
|
+
description: `Event: highlight-navigation`,
|
|
8211
|
+
category: `Navigation`,
|
|
8212
|
+
args: [{
|
|
8213
|
+
name: "videoUrlIndex",
|
|
8214
|
+
type: "number"
|
|
8215
|
+
}]
|
|
8216
|
+
};
|
|
8217
|
+
}
|
|
8218
|
+
|
|
8219
|
+
//#endregion
|
|
8220
|
+
//#region src/eventbus/events/metadata/language-change.ts
|
|
8221
|
+
function languageChange() {
|
|
8222
|
+
return {
|
|
8223
|
+
description: `Event: language-change`,
|
|
8224
|
+
category: `Language Manager`,
|
|
8225
|
+
args: [{
|
|
8226
|
+
name: "language",
|
|
8227
|
+
type: "TLanguageCode"
|
|
8228
|
+
}]
|
|
8229
|
+
};
|
|
8230
|
+
}
|
|
8231
|
+
|
|
8232
|
+
//#endregion
|
|
8233
|
+
//#region src/eventbus/events/metadata/navigate-to-video-url.ts
|
|
8234
|
+
function navigateToVideoUrl() {
|
|
8235
|
+
return {
|
|
8236
|
+
description: `Event: navigate-to-video-url`,
|
|
8237
|
+
category: `Navigation`,
|
|
8238
|
+
args: [{
|
|
8239
|
+
name: "index",
|
|
8240
|
+
type: "number"
|
|
8241
|
+
}, {
|
|
8242
|
+
name: "requestedVideoPosition",
|
|
8243
|
+
type: "number"
|
|
8244
|
+
}]
|
|
8245
|
+
};
|
|
8246
|
+
}
|
|
8247
|
+
|
|
8248
|
+
//#endregion
|
|
8249
|
+
//#region src/eventbus/events/metadata/push-history-state.ts
|
|
8250
|
+
function pushHistoryState() {
|
|
8251
|
+
return {
|
|
8252
|
+
description: `Event: push-history-state`,
|
|
8253
|
+
category: `Navigation`,
|
|
8254
|
+
args: [{
|
|
8255
|
+
name: "state",
|
|
8256
|
+
type: "any"
|
|
8257
|
+
}]
|
|
8258
|
+
};
|
|
8259
|
+
}
|
|
8260
|
+
|
|
8261
|
+
//#endregion
|
|
8262
|
+
//#region src/eventbus/events/metadata/request-action.ts
|
|
8263
|
+
function requestAction$1() {
|
|
8264
|
+
return {
|
|
8265
|
+
description: `Event: request-action`,
|
|
8266
|
+
category: `Engine Request`,
|
|
8267
|
+
args: [{
|
|
8268
|
+
name: "actionName",
|
|
8269
|
+
type: "string"
|
|
8270
|
+
}, {
|
|
8271
|
+
name: "callback",
|
|
8272
|
+
type: "(actionInstance: any) => void"
|
|
8273
|
+
}]
|
|
8274
|
+
};
|
|
8275
|
+
}
|
|
8276
|
+
|
|
8277
|
+
//#endregion
|
|
8278
|
+
//#region src/eventbus/events/metadata/request-current-language.ts
|
|
8279
|
+
function requestCurrentLanguage() {
|
|
8280
|
+
return {
|
|
8281
|
+
description: `Event: request-current-language`,
|
|
8282
|
+
category: `Engine Request`,
|
|
8283
|
+
args: [{
|
|
8284
|
+
name: "callback",
|
|
8285
|
+
type: "(language: TLanguageCode) => void"
|
|
8286
|
+
}]
|
|
8287
|
+
};
|
|
8288
|
+
}
|
|
8289
|
+
|
|
8290
|
+
//#endregion
|
|
8291
|
+
//#region src/eventbus/events/metadata/request-current-navigation.ts
|
|
8292
|
+
function requestCurrentNavigation() {
|
|
8293
|
+
return {
|
|
8294
|
+
description: `Event: request-current-navigation`,
|
|
8295
|
+
category: `Navigation`,
|
|
8296
|
+
args: [{
|
|
8297
|
+
name: "callback",
|
|
8298
|
+
type: "(navigation: any) => void"
|
|
8299
|
+
}]
|
|
8300
|
+
};
|
|
8301
|
+
}
|
|
8302
|
+
|
|
8303
|
+
//#endregion
|
|
8304
|
+
//#region src/eventbus/events/metadata/request-current-timeline-position.ts
|
|
8305
|
+
function requestCurrentTimelinePosition() {
|
|
8306
|
+
return {
|
|
8307
|
+
description: `Event: request-current-timeline-position`,
|
|
8308
|
+
category: `Engine Request`,
|
|
8309
|
+
args: []
|
|
8310
|
+
};
|
|
8311
|
+
}
|
|
8312
|
+
|
|
8313
|
+
//#endregion
|
|
8314
|
+
//#region src/eventbus/events/metadata/request-current-video-position.ts
|
|
8315
|
+
function requestCurrentVideoPosition() {
|
|
8316
|
+
return {
|
|
8317
|
+
description: `Event: request-current-video-position`,
|
|
8318
|
+
category: `Navigation`,
|
|
8319
|
+
args: [{
|
|
8320
|
+
name: "callback",
|
|
8321
|
+
type: "(position: number) => void"
|
|
8322
|
+
}]
|
|
8323
|
+
};
|
|
8324
|
+
}
|
|
8325
|
+
|
|
8326
|
+
//#endregion
|
|
8327
|
+
//#region src/eventbus/events/metadata/request-engine-root.ts
|
|
8328
|
+
function requestEngineRoot() {
|
|
8329
|
+
return {
|
|
8330
|
+
description: `Event: request-engine-root`,
|
|
8331
|
+
category: `Engine Request`,
|
|
8332
|
+
args: [{
|
|
8333
|
+
name: "callback",
|
|
8334
|
+
type: "(root: any) => void"
|
|
8335
|
+
}]
|
|
8336
|
+
};
|
|
8337
|
+
}
|
|
8338
|
+
|
|
8339
|
+
//#endregion
|
|
8340
|
+
//#region src/eventbus/events/metadata/request-function.ts
|
|
8341
|
+
function requestFunction() {
|
|
8342
|
+
return {
|
|
8343
|
+
description: `Event: request-function`,
|
|
8344
|
+
category: `Engine Request`,
|
|
8345
|
+
args: [{
|
|
8346
|
+
name: "systemName",
|
|
8347
|
+
type: "string"
|
|
8348
|
+
}, {
|
|
8349
|
+
name: "callback",
|
|
8350
|
+
type: "(fn: any) => void"
|
|
8351
|
+
}]
|
|
8352
|
+
};
|
|
8353
|
+
}
|
|
8354
|
+
|
|
8355
|
+
//#endregion
|
|
8356
|
+
//#region src/eventbus/events/metadata/request-instance.ts
|
|
8357
|
+
function requestInstance() {
|
|
8358
|
+
return {
|
|
8359
|
+
description: `Event: request-instance`,
|
|
8360
|
+
category: `Engine Request`,
|
|
8361
|
+
args: [{
|
|
8362
|
+
name: "instanceName",
|
|
8363
|
+
type: "string"
|
|
8364
|
+
}, {
|
|
8365
|
+
name: "callback",
|
|
8366
|
+
type: "(instance: any) => void"
|
|
8367
|
+
}]
|
|
8368
|
+
};
|
|
8369
|
+
}
|
|
8370
|
+
|
|
8371
|
+
//#endregion
|
|
8372
|
+
//#region src/eventbus/events/metadata/request-label-collection.ts
|
|
8373
|
+
function requestLabelCollection() {
|
|
8374
|
+
return {
|
|
8375
|
+
description: `Event: request-label-collection`,
|
|
8376
|
+
category: `Engine Request`,
|
|
8377
|
+
args: [{
|
|
8378
|
+
name: "language",
|
|
8379
|
+
type: "string"
|
|
8380
|
+
}, {
|
|
8381
|
+
name: "callback",
|
|
8382
|
+
type: "(collection: any) => void"
|
|
8383
|
+
}]
|
|
8384
|
+
};
|
|
8385
|
+
}
|
|
8386
|
+
|
|
8387
|
+
//#endregion
|
|
8388
|
+
//#region src/eventbus/events/metadata/request-label-collections.ts
|
|
8389
|
+
function requestLabelCollections() {
|
|
8390
|
+
return {
|
|
8391
|
+
description: `Event: request-label-collections`,
|
|
8392
|
+
category: `Engine Request`,
|
|
8393
|
+
args: [{
|
|
8394
|
+
name: "labelIds",
|
|
8395
|
+
type: "string[]"
|
|
8396
|
+
}, {
|
|
8397
|
+
name: "callback",
|
|
8398
|
+
type: "(collections: any) => void"
|
|
8399
|
+
}]
|
|
8400
|
+
};
|
|
8401
|
+
}
|
|
8402
|
+
|
|
8403
|
+
//#endregion
|
|
8404
|
+
//#region src/eventbus/events/metadata/request-timeline-cleanup.ts
|
|
8405
|
+
function requestTimelineCleanup() {
|
|
8406
|
+
return {
|
|
8407
|
+
description: `Event: request-timeline-cleanup`,
|
|
8408
|
+
category: `Engine Request`,
|
|
8409
|
+
args: []
|
|
8410
|
+
};
|
|
8411
|
+
}
|
|
8412
|
+
|
|
8413
|
+
//#endregion
|
|
8414
|
+
//#region src/eventbus/events/metadata/request-timeline-uri.ts
|
|
8415
|
+
function requestTimelineUri() {
|
|
8416
|
+
return {
|
|
8417
|
+
description: `Event: request-timeline-uri`,
|
|
8418
|
+
category: `Engine Request`,
|
|
8419
|
+
args: []
|
|
8420
|
+
};
|
|
8421
|
+
}
|
|
8422
|
+
|
|
8423
|
+
//#endregion
|
|
8424
|
+
//#region src/eventbus/events/metadata/request-video-cleanup.ts
|
|
8425
|
+
function requestVideoCleanup() {
|
|
8426
|
+
return {
|
|
8427
|
+
description: `Event: request-video-cleanup`,
|
|
8428
|
+
category: `Navigation`,
|
|
8429
|
+
args: []
|
|
8430
|
+
};
|
|
8431
|
+
}
|
|
8432
|
+
|
|
8433
|
+
//#endregion
|
|
8434
|
+
//#region src/eventbus/events/metadata/request-video-url.ts
|
|
8435
|
+
function requestVideoUrl() {
|
|
8436
|
+
return {
|
|
8437
|
+
description: `Event: request-video-url`,
|
|
8438
|
+
category: `Navigation`,
|
|
8439
|
+
args: [
|
|
8440
|
+
{
|
|
8441
|
+
name: "videoUrlIndex",
|
|
8442
|
+
type: "number"
|
|
8443
|
+
},
|
|
8444
|
+
{
|
|
8445
|
+
name: "requestedVideoPosition",
|
|
8446
|
+
type: "number"
|
|
8447
|
+
},
|
|
8448
|
+
{
|
|
8449
|
+
name: "fromRouting",
|
|
8450
|
+
type: "boolean"
|
|
8451
|
+
}
|
|
8452
|
+
]
|
|
8453
|
+
};
|
|
8454
|
+
}
|
|
8455
|
+
|
|
8456
|
+
//#endregion
|
|
8457
|
+
//#region src/eventbus/events/metadata/timeline-complete.ts
|
|
8458
|
+
function timelineComplete() {
|
|
8459
|
+
return {
|
|
8460
|
+
description: `Event: timeline-complete`,
|
|
8461
|
+
category: `Timeline`,
|
|
8462
|
+
args: []
|
|
8463
|
+
};
|
|
8464
|
+
}
|
|
8465
|
+
|
|
8466
|
+
//#endregion
|
|
8467
|
+
//#region src/eventbus/events/metadata/timeline-container-request.ts
|
|
8468
|
+
function timelineContainerRequest() {
|
|
8469
|
+
return {
|
|
8470
|
+
description: `Event: timeline-container-request`,
|
|
8471
|
+
category: `Timeline`,
|
|
8472
|
+
args: [{
|
|
8473
|
+
name: "callback",
|
|
8474
|
+
type: "(element: HTMLElement) => void"
|
|
8475
|
+
}]
|
|
8476
|
+
};
|
|
8477
|
+
}
|
|
8478
|
+
|
|
8479
|
+
//#endregion
|
|
8480
|
+
//#region src/eventbus/events/metadata/timeline-current-timeline-change.ts
|
|
8481
|
+
function timelineCurrentTimelineChange() {
|
|
8482
|
+
return {
|
|
8483
|
+
description: `Event: timeline-current-timeline-change`,
|
|
8484
|
+
category: `Timeline`,
|
|
8485
|
+
args: [{
|
|
8486
|
+
name: "timelineUri",
|
|
8487
|
+
type: "string"
|
|
8488
|
+
}]
|
|
8489
|
+
};
|
|
8490
|
+
}
|
|
8491
|
+
|
|
8492
|
+
//#endregion
|
|
8493
|
+
//#region src/eventbus/events/metadata/timeline-duration-request.ts
|
|
8494
|
+
function timelineDurationRequest() {
|
|
8495
|
+
return {
|
|
8496
|
+
description: `Event: timeline-duration-request`,
|
|
8497
|
+
category: `Timeline`,
|
|
8498
|
+
args: [{
|
|
8499
|
+
name: "callback",
|
|
8500
|
+
type: "(duration: number) => void"
|
|
8501
|
+
}]
|
|
8502
|
+
};
|
|
8503
|
+
}
|
|
8504
|
+
|
|
8505
|
+
//#endregion
|
|
8506
|
+
//#region src/eventbus/events/metadata/timeline-duration.ts
|
|
8507
|
+
function timelineDuration() {
|
|
8508
|
+
return {
|
|
8509
|
+
description: `Event: timeline-duration`,
|
|
8510
|
+
category: `Timeline`,
|
|
8511
|
+
args: [{
|
|
8512
|
+
name: "getDuration",
|
|
8513
|
+
type: "(() => number) | undefined"
|
|
8514
|
+
}]
|
|
8515
|
+
};
|
|
8516
|
+
}
|
|
8517
|
+
|
|
8518
|
+
//#endregion
|
|
8519
|
+
//#region src/eventbus/events/metadata/timeline-firstframe.ts
|
|
8520
|
+
function timelineFirstframe() {
|
|
8521
|
+
return {
|
|
8522
|
+
description: `Event: timeline-firstframe`,
|
|
8523
|
+
category: `Timeline`,
|
|
8524
|
+
args: []
|
|
8525
|
+
};
|
|
8526
|
+
}
|
|
8527
|
+
|
|
8528
|
+
//#endregion
|
|
8529
|
+
//#region src/eventbus/events/metadata/timeline-pause-request.ts
|
|
8530
|
+
function timelinePauseRequest() {
|
|
8531
|
+
return {
|
|
8532
|
+
description: `Event: timeline-pause-request`,
|
|
8533
|
+
category: `Timeline`,
|
|
8534
|
+
args: []
|
|
8535
|
+
};
|
|
8536
|
+
}
|
|
8537
|
+
|
|
8538
|
+
//#endregion
|
|
8539
|
+
//#region src/eventbus/events/metadata/timeline-pause.ts
|
|
8540
|
+
function timelinePause() {
|
|
8541
|
+
return {
|
|
8542
|
+
description: `Event: timeline-pause`,
|
|
8543
|
+
category: `Timeline`,
|
|
8544
|
+
args: []
|
|
8545
|
+
};
|
|
8546
|
+
}
|
|
8547
|
+
|
|
8548
|
+
//#endregion
|
|
8549
|
+
//#region src/eventbus/events/metadata/timeline-play-request.ts
|
|
8550
|
+
function timelinePlayRequest() {
|
|
8551
|
+
return {
|
|
8552
|
+
description: `Event: timeline-play-request`,
|
|
8553
|
+
category: `Timeline`,
|
|
8554
|
+
args: []
|
|
8555
|
+
};
|
|
8556
|
+
}
|
|
8557
|
+
|
|
8558
|
+
//#endregion
|
|
8559
|
+
//#region src/eventbus/events/metadata/timeline-play-toggle-request.ts
|
|
8560
|
+
function timelinePlayToggleRequest() {
|
|
8561
|
+
return {
|
|
8562
|
+
description: `Event: timeline-play-toggle-request`,
|
|
8563
|
+
category: `Timeline`,
|
|
8564
|
+
args: []
|
|
8565
|
+
};
|
|
8566
|
+
}
|
|
8567
|
+
|
|
8568
|
+
//#endregion
|
|
8569
|
+
//#region src/eventbus/events/metadata/timeline-play.ts
|
|
8570
|
+
function timelinePlay() {
|
|
8571
|
+
return {
|
|
8572
|
+
description: `Event: timeline-play`,
|
|
8573
|
+
category: `Timeline`,
|
|
8574
|
+
args: []
|
|
8575
|
+
};
|
|
8576
|
+
}
|
|
8577
|
+
|
|
8578
|
+
//#endregion
|
|
8579
|
+
//#region src/eventbus/events/metadata/timeline-request-current-timeline.ts
|
|
8580
|
+
function timelineRequestCurrentTimeline() {
|
|
8581
|
+
return {
|
|
8582
|
+
description: `Event: timeline-request-current-timeline`,
|
|
8583
|
+
category: `Engine Request`,
|
|
8584
|
+
args: []
|
|
8585
|
+
};
|
|
8586
|
+
}
|
|
8587
|
+
|
|
8588
|
+
//#endregion
|
|
8589
|
+
//#region src/eventbus/events/metadata/timeline-resize-request.ts
|
|
8590
|
+
function timelineResizeRequest() {
|
|
8591
|
+
return {
|
|
8592
|
+
description: `Event: timeline-resize-request`,
|
|
8593
|
+
category: `Timeline`,
|
|
8594
|
+
args: []
|
|
8595
|
+
};
|
|
8596
|
+
}
|
|
8597
|
+
|
|
8598
|
+
//#endregion
|
|
8599
|
+
//#region src/eventbus/events/metadata/timeline-resize.ts
|
|
8600
|
+
function timelineResize() {
|
|
8601
|
+
return {
|
|
8602
|
+
description: `Event: timeline-resize`,
|
|
8603
|
+
category: `Timeline`,
|
|
8604
|
+
args: []
|
|
8605
|
+
};
|
|
8606
|
+
}
|
|
8607
|
+
|
|
8608
|
+
//#endregion
|
|
8609
|
+
//#region src/eventbus/events/metadata/timeline-restart.ts
|
|
8610
|
+
function timelineRestart() {
|
|
8611
|
+
return {
|
|
8612
|
+
description: `Event: timeline-restart`,
|
|
8613
|
+
category: `Timeline`,
|
|
8614
|
+
args: []
|
|
8615
|
+
};
|
|
8616
|
+
}
|
|
8617
|
+
|
|
8618
|
+
//#endregion
|
|
8619
|
+
//#region src/eventbus/events/metadata/timeline-seek-request.ts
|
|
8620
|
+
function timelineSeekRequest() {
|
|
8621
|
+
return {
|
|
8622
|
+
description: `Event: timeline-seek-request`,
|
|
8623
|
+
category: `Timeline`,
|
|
8624
|
+
args: [{
|
|
8625
|
+
name: "position",
|
|
8626
|
+
type: "number"
|
|
8627
|
+
}]
|
|
8628
|
+
};
|
|
8629
|
+
}
|
|
8630
|
+
|
|
8631
|
+
//#endregion
|
|
8632
|
+
//#region src/eventbus/events/metadata/timeline-seek.ts
|
|
8633
|
+
function timelineSeek() {
|
|
8634
|
+
return {
|
|
8635
|
+
description: `Event: timeline-seek`,
|
|
8636
|
+
category: `Timeline`,
|
|
8637
|
+
args: [
|
|
8638
|
+
{
|
|
8639
|
+
name: "seekPosition",
|
|
8640
|
+
type: "number"
|
|
8641
|
+
},
|
|
8642
|
+
{
|
|
8643
|
+
name: "currentPosition",
|
|
8644
|
+
type: "number"
|
|
8645
|
+
},
|
|
8646
|
+
{
|
|
8647
|
+
name: "duration",
|
|
8648
|
+
type: "number"
|
|
8649
|
+
}
|
|
8650
|
+
]
|
|
8651
|
+
};
|
|
8652
|
+
}
|
|
8653
|
+
|
|
8654
|
+
//#endregion
|
|
8655
|
+
//#region src/eventbus/events/metadata/timeline-seeked.ts
|
|
8656
|
+
function timelineSeeked() {
|
|
8657
|
+
return {
|
|
8658
|
+
description: `Event: timeline-seeked`,
|
|
8659
|
+
category: `Timeline`,
|
|
8660
|
+
args: [{
|
|
8661
|
+
name: "position",
|
|
8662
|
+
type: "number"
|
|
8663
|
+
}, {
|
|
8664
|
+
name: "duration",
|
|
8665
|
+
type: "number"
|
|
8666
|
+
}]
|
|
8667
|
+
};
|
|
8668
|
+
}
|
|
8669
|
+
|
|
8670
|
+
//#endregion
|
|
8671
|
+
//#region src/eventbus/events/metadata/timeline-stop-request.ts
|
|
8672
|
+
function timelineStopRequest() {
|
|
8673
|
+
return {
|
|
8674
|
+
description: `Event: timeline-stop-request`,
|
|
8675
|
+
category: `Timeline`,
|
|
8676
|
+
args: []
|
|
8677
|
+
};
|
|
8678
|
+
}
|
|
8679
|
+
|
|
8680
|
+
//#endregion
|
|
8681
|
+
//#region src/eventbus/events/metadata/timeline-stop.ts
|
|
8682
|
+
function timelineStop() {
|
|
8683
|
+
return {
|
|
8684
|
+
description: `Event: timeline-stop`,
|
|
8685
|
+
category: `Timeline`,
|
|
8686
|
+
args: []
|
|
8687
|
+
};
|
|
8688
|
+
}
|
|
8689
|
+
|
|
8690
|
+
//#endregion
|
|
8691
|
+
//#region src/eventbus/events/metadata/timeline-time.ts
|
|
8692
|
+
function timelineTime() {
|
|
8693
|
+
return {
|
|
8694
|
+
description: `Event: timeline-time`,
|
|
8695
|
+
category: `Timeline`,
|
|
8696
|
+
args: [{
|
|
8697
|
+
name: "position",
|
|
8698
|
+
type: "number"
|
|
8699
|
+
}]
|
|
8700
|
+
};
|
|
8701
|
+
}
|
|
8702
|
+
|
|
8703
|
+
//#endregion
|
|
8704
|
+
//#region src/eventbus/events/metadata/video-complete.ts
|
|
8705
|
+
function videoComplete() {
|
|
8706
|
+
return {
|
|
8707
|
+
description: `Event: video-complete`,
|
|
8708
|
+
category: `Navigation`,
|
|
8709
|
+
args: [{
|
|
8710
|
+
name: "index",
|
|
8711
|
+
type: "number"
|
|
8712
|
+
}]
|
|
8713
|
+
};
|
|
8714
|
+
}
|
|
8715
|
+
|
|
8716
|
+
//#endregion
|
|
8717
|
+
//#region src/eventbus/events/metadata/index.ts
|
|
8718
|
+
var metadata_exports$1 = /* @__PURE__ */ __export({
|
|
8719
|
+
beforeRequestTimelineUri: () => beforeRequestTimelineUri,
|
|
8720
|
+
beforeRequestVideoUrl: () => beforeRequestVideoUrl,
|
|
8721
|
+
domMutation: () => domMutation,
|
|
8722
|
+
highlightNavigation: () => highlightNavigation,
|
|
8723
|
+
languageChange: () => languageChange,
|
|
8724
|
+
navigateToVideoUrl: () => navigateToVideoUrl,
|
|
8725
|
+
pushHistoryState: () => pushHistoryState,
|
|
8726
|
+
requestAction: () => requestAction$1,
|
|
8727
|
+
requestCurrentLanguage: () => requestCurrentLanguage,
|
|
8728
|
+
requestCurrentNavigation: () => requestCurrentNavigation,
|
|
8729
|
+
requestCurrentTimelinePosition: () => requestCurrentTimelinePosition,
|
|
8730
|
+
requestCurrentVideoPosition: () => requestCurrentVideoPosition,
|
|
8731
|
+
requestEngineRoot: () => requestEngineRoot,
|
|
8732
|
+
requestFunction: () => requestFunction,
|
|
8733
|
+
requestInstance: () => requestInstance,
|
|
8734
|
+
requestLabelCollection: () => requestLabelCollection,
|
|
8735
|
+
requestLabelCollections: () => requestLabelCollections,
|
|
8736
|
+
requestTimelineCleanup: () => requestTimelineCleanup,
|
|
8737
|
+
requestTimelineUri: () => requestTimelineUri,
|
|
8738
|
+
requestVideoCleanup: () => requestVideoCleanup,
|
|
8739
|
+
requestVideoUrl: () => requestVideoUrl,
|
|
8740
|
+
timelineComplete: () => timelineComplete,
|
|
8741
|
+
timelineContainerRequest: () => timelineContainerRequest,
|
|
8742
|
+
timelineCurrentTimelineChange: () => timelineCurrentTimelineChange,
|
|
8743
|
+
timelineDuration: () => timelineDuration,
|
|
8744
|
+
timelineDurationRequest: () => timelineDurationRequest,
|
|
8745
|
+
timelineFirstframe: () => timelineFirstframe,
|
|
8746
|
+
timelinePause: () => timelinePause,
|
|
8747
|
+
timelinePauseRequest: () => timelinePauseRequest,
|
|
8748
|
+
timelinePlay: () => timelinePlay,
|
|
8749
|
+
timelinePlayRequest: () => timelinePlayRequest,
|
|
8750
|
+
timelinePlayToggleRequest: () => timelinePlayToggleRequest,
|
|
8751
|
+
timelineRequestCurrentTimeline: () => timelineRequestCurrentTimeline,
|
|
8752
|
+
timelineResize: () => timelineResize,
|
|
8753
|
+
timelineResizeRequest: () => timelineResizeRequest,
|
|
8754
|
+
timelineRestart: () => timelineRestart,
|
|
8755
|
+
timelineSeek: () => timelineSeek,
|
|
8756
|
+
timelineSeekRequest: () => timelineSeekRequest,
|
|
8757
|
+
timelineSeeked: () => timelineSeeked,
|
|
8758
|
+
timelineStop: () => timelineStop,
|
|
8759
|
+
timelineStopRequest: () => timelineStopRequest,
|
|
8760
|
+
timelineTime: () => timelineTime,
|
|
8761
|
+
videoComplete: () => videoComplete
|
|
8762
|
+
});
|
|
8763
|
+
|
|
6739
8764
|
//#endregion
|
|
6740
8765
|
//#region src/importer/eligius-resource-importer.ts
|
|
6741
8766
|
const operations = operation_exports;
|
|
@@ -6763,5 +8788,5 @@ var EligiusResourceImporter = class {
|
|
|
6763
8788
|
};
|
|
6764
8789
|
|
|
6765
8790
|
//#endregion
|
|
6766
|
-
export { Action, ActionCreator, ActionCreatorFactory, ActionEditor, ActionRegistryEventbusListener, ConfigurationFactory, ConfigurationResolver, ControllerNamesProvider, DEV_TOOLS_KEY, DOMEventListenerController, DevToolEventListener, Diagnostics, EligiusEngine, EligiusResourceImporter, EndableAction, EndableActionCreator, EndableActionEditor, EngineFactory, Eventbus, LabelController, LanguageManager, LottieController, NavigationController, OperationEditor, OperationMetadataProvider, OperationNamesProvider, ProgressbarController, RequestAnimationFrameTimelineProvider, RequestVideoUriInterceptor, RoutingController, SubtitleEditor, SubtitleImporter, SubtitlesController, TimeLineEventNamesProvider, TimelineAction, TimelineActionCreator, TimelineActionEditor,
|
|
6767
|
-
//# sourceMappingURL=index.
|
|
8791
|
+
export { Action, ActionCreator, ActionCreatorFactory, ActionEditor, ActionRegistryEventbusListener, ConfigurationFactory, ConfigurationResolver, ControllerNamesProvider, DEV_TOOLS_KEY, DOMEventListenerController, DevToolEventListener, Diagnostics, EligiusEngine, EligiusResourceImporter, EndableAction, EndableActionCreator, EndableActionEditor, EngineFactory, Eventbus, LabelController, LanguageManager, LottieController, MutationObserverController, NavigationController, OperationEditor, OperationMetadataProvider, OperationNamesProvider, ProgressbarController, RequestAnimationFrameTimelineProvider, RequestVideoUriInterceptor, RoutingController, SubtitleEditor, SubtitleImporter, SubtitlesController, TimeLineEventNamesProvider, TimelineAction, TimelineActionCreator, TimelineActionEditor, TimelineProviderSettingsEditor, TimelineProvidersSettingsEditor, VideoJsTimelineProvider, addClass, addControllerToElement, addGlobalsToOperation, animate, animateWithClass, announceToScreenReader, breakForEach, broadcastEvent, calc, clearElement, clearOperationData, clearStorage, compareDate, concatenateStrings, continueForEach, createElement, metadata_exports as ctrlmetadata, customFunction, endAction, endForEach, endWhen, metadata_exports$1 as eventmetadata, extendController, filterArray, findInArray, forEach, formatDate, formatText, generateImporterSourceCode, getAttributesFromElement, getControllerFromElement, getControllerInstance, getCurrentTime, getElementDimensions, getFocusedElement, getFormData, getImport, getQueryParams, getScrollPosition, getTextContent, httpDelete, httpPost, httpPut, invokeObjectMethod, isActive, isElementInViewport, loadFromStorage, loadJson, log, mapArray, math, metadata_exports$2 as metadata, otherwise, removeClass, removeControllerFromElement, removeElement, removePropertiesFromOperationData, reparentElement, replaceString, replaceText, requestAction, saveToStorage, scrollToElement, scrollToPosition, selectElement, send, setActive, setData, setElementAttributes, setElementContent, setFocus, setFormValue, setGlobalData, setOperationData, setStyle, setVariable, sortArray, splitString, startAction, substringText, toggleClass, toggleElement, toggleFormElement, validateForm, wait, when };
|
|
8792
|
+
//# sourceMappingURL=index.mjs.map
|