eligius 1.0.3 → 1.0.5
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 +3 -1
- package/dist/build/generate-importer-source-code.d.ts +15 -0
- package/dist/build/index.d.ts +1 -0
- package/dist/diagnostics/devtool-event-lister.d.ts +7 -0
- package/dist/diagnostics/diagnostics.d.ts +4 -0
- package/dist/diagnostics/index.d.ts +3 -0
- package/dist/diagnostics/types.d.ts +8 -0
- package/dist/eligius.cjs.development.js +454 -47
- package/dist/eligius.cjs.development.js.map +1 -1
- package/dist/eligius.cjs.production.min.js +1 -1
- package/dist/eligius.cjs.production.min.js.map +1 -1
- package/dist/eligius.esm.js +446 -47
- package/dist/eligius.esm.js.map +1 -1
- package/dist/engine-factory.d.ts +1 -0
- package/dist/importer/{webpack-resource-importer.d.ts → eligius-resource-importer.d.ts} +1 -1
- package/dist/importer/index.d.ts +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/operation/broadcast-event.d.ts +0 -1
- package/dist/operation/calc.d.ts +14 -0
- package/dist/operation/index.d.ts +2 -0
- package/dist/operation/math.d.ts +12 -0
- package/dist/operation/metadata/calc.d.ts +4 -0
- package/dist/operation/metadata/index.d.ts +2 -0
- package/dist/operation/metadata/math.d.ts +4 -0
- package/dist/operation/metadata/types.d.ts +9 -6
- package/dist/schema-tools/generate-operation-schemas.d.ts +1 -0
- package/dist/schema-tools/html-tag-names.d.ts +1 -0
- package/dist/types.d.ts +1 -1
- package/dist/util/camel-case-to-dash.d.ts +1 -0
- package/dist/util/dash-to-camel-case.d.ts +1 -0
- package/package.json +8 -6
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var tsIsPresent = require('ts-is-present');
|
|
6
|
+
var fs = require('fs');
|
|
7
|
+
var path = require('path');
|
|
6
8
|
var lottie = require('lottie-web');
|
|
7
9
|
var $ = require('jquery');
|
|
8
10
|
var Mousetrap = require('mousetrap');
|
|
@@ -10,6 +12,8 @@ var uuid = require('uuid');
|
|
|
10
12
|
|
|
11
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
14
|
|
|
15
|
+
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
|
16
|
+
var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
|
|
13
17
|
var lottie__default = /*#__PURE__*/_interopDefaultLegacy(lottie);
|
|
14
18
|
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
|
15
19
|
var Mousetrap__default = /*#__PURE__*/_interopDefaultLegacy(Mousetrap);
|
|
@@ -591,6 +595,207 @@ var TimelineAction = /*#__PURE__*/function (_EndableAction) {
|
|
|
591
595
|
return TimelineAction;
|
|
592
596
|
}(EndableAction);
|
|
593
597
|
|
|
598
|
+
function dashToCamelCase(input) {
|
|
599
|
+
return input.replace(/-([a-z])/g, function (g) {
|
|
600
|
+
return g[1].toUpperCase();
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* This function takes an Eligius engine configuration, a root path for the config and an arbitrary list of asset info.
|
|
606
|
+
* The asset info determines a number of subdirectories in the root path that contain the different assets used by the presentation.
|
|
607
|
+
* I.e. html, json, etc.
|
|
608
|
+
*
|
|
609
|
+
* @param config
|
|
610
|
+
* @param configPath
|
|
611
|
+
* @param assetInfo
|
|
612
|
+
*/
|
|
613
|
+
|
|
614
|
+
function generateImporterSourceCode(config, configPath, assetInfo) {
|
|
615
|
+
var importPaths = _gatherImportPaths(config, configPath, assetInfo);
|
|
616
|
+
|
|
617
|
+
var importerSourceCode = _generateSourceCode(importPaths);
|
|
618
|
+
|
|
619
|
+
return importerSourceCode;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
function _generateSourceCode(importPaths) {
|
|
623
|
+
var result = importPaths.filter(function (x) {
|
|
624
|
+
return x.defaultImport;
|
|
625
|
+
}).map(function (imp) {
|
|
626
|
+
return "import " + imp.systemName + " from '" + imp.path + "';";
|
|
627
|
+
}).concat(importPaths.filter(function (x) {
|
|
628
|
+
return !x.defaultImport;
|
|
629
|
+
}).map(function (imp) {
|
|
630
|
+
var _imp$path;
|
|
631
|
+
|
|
632
|
+
return "import {" + imp.systemName + "} from '" + ((_imp$path = imp.path) != null ? _imp$path : 'eligius') + "';";
|
|
633
|
+
}));
|
|
634
|
+
result.push("import { ISimpleResourceImporter } from 'eligius';");
|
|
635
|
+
result.push('');
|
|
636
|
+
result.push('const imports: Record<string, any> = {');
|
|
637
|
+
result.push.apply(result, importPaths.map(function (imp) {
|
|
638
|
+
return imp.systemName + ": { '" + imp.systemName + "': " + imp.systemName + " },";
|
|
639
|
+
}));
|
|
640
|
+
result.push('};');
|
|
641
|
+
result.push('');
|
|
642
|
+
result.push('class EligiusResourceImporter implements ISimpleResourceImporter {');
|
|
643
|
+
result.push('import(name: string): Record<string, any> {');
|
|
644
|
+
result.push('if (imports.hasOwnProperty(name)) { return imports[name]; }');
|
|
645
|
+
result.push('throw Error(`Unknown systemName: ${name}`);');
|
|
646
|
+
result.push('}}');
|
|
647
|
+
result.push('');
|
|
648
|
+
result.push('export default EligiusResourceImporter;');
|
|
649
|
+
return result.join('\n');
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
function _gatherImportPaths(config, configPath, assetInfo) {
|
|
653
|
+
return [].concat(_gatherOperations(config), assetInfo.flatMap(function (info) {
|
|
654
|
+
return _gatherAssets(configPath, info.path, info.extension);
|
|
655
|
+
}), _gatherControllers(config), _gatherProviders(config), _gatherEngines(config));
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
function _gatherAssets(assetPath, subdir, extension) {
|
|
659
|
+
var entries = fs__default["default"].readdirSync(path__default["default"].join(assetPath, subdir));
|
|
660
|
+
return entries.map(function (file) {
|
|
661
|
+
var importName = "" + dashToCamelCase(path__default["default"].basename(file, extension));
|
|
662
|
+
return {
|
|
663
|
+
systemName: importName,
|
|
664
|
+
path: "./" + subdir + "/" + file,
|
|
665
|
+
defaultImport: true
|
|
666
|
+
};
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
function _gatherControllers(config) {
|
|
671
|
+
var _importPaths, _importPaths2, _importPaths3, _importPaths4;
|
|
672
|
+
|
|
673
|
+
var importPaths = [];
|
|
674
|
+
|
|
675
|
+
(_importPaths = importPaths).push.apply(_importPaths, _gatherControllerImportPathsFromActions(config.initActions));
|
|
676
|
+
|
|
677
|
+
(_importPaths2 = importPaths).push.apply(_importPaths2, _gatherControllerImportPathsFromActions(config.actions));
|
|
678
|
+
|
|
679
|
+
(_importPaths3 = importPaths).push.apply(_importPaths3, _gatherControllerImportPathsFromActions(config.timelines.flatMap(function (x) {
|
|
680
|
+
return x.timelineActions;
|
|
681
|
+
})));
|
|
682
|
+
|
|
683
|
+
(_importPaths4 = importPaths).push.apply(_importPaths4, _gatherControllerImportPathsFromActions(config.eventActions));
|
|
684
|
+
|
|
685
|
+
importPaths = dedupe(importPaths);
|
|
686
|
+
return importPaths;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
function _gatherProviders(config) {
|
|
690
|
+
if (config.timelineProviderSettings) {
|
|
691
|
+
return Object.values(config.timelineProviderSettings).map(function (settings) {
|
|
692
|
+
return {
|
|
693
|
+
systemName: settings.systemName
|
|
694
|
+
};
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
return [];
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
function _gatherEngines(config) {
|
|
702
|
+
if (config.engine) {
|
|
703
|
+
var systemName = config.engine.systemName;
|
|
704
|
+
return [{
|
|
705
|
+
systemName: systemName
|
|
706
|
+
}];
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
return [];
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
function _gatherOperations(config) {
|
|
713
|
+
var _config$eventActions;
|
|
714
|
+
|
|
715
|
+
var importPaths = _gatherOperationImportPathsFromActions(config.initActions.concat(config.actions).concat((_config$eventActions = config.eventActions) != null ? _config$eventActions : []));
|
|
716
|
+
|
|
717
|
+
if (config.timelines) {
|
|
718
|
+
var timelineActions = config.timelines.flatMap(function (x) {
|
|
719
|
+
return x.timelineActions;
|
|
720
|
+
});
|
|
721
|
+
importPaths = importPaths.concat(_gatherOperationImportPathsFromActions(timelineActions));
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
return dedupe(importPaths);
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
function _gatherControllerImportPathsFromActions(actionsConfig) {
|
|
728
|
+
if (!actionsConfig) {
|
|
729
|
+
return [];
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
var operations = actionsConfig.flatMap(function (x) {
|
|
733
|
+
var _x$endOperations;
|
|
734
|
+
|
|
735
|
+
return [].concat(x.startOperations, (_x$endOperations = x.endOperations) != null ? _x$endOperations : []);
|
|
736
|
+
});
|
|
737
|
+
return _gatherControllerImportPaths(operations);
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
function _gatherOperationImportPathsFromActions(actionsConfig) {
|
|
741
|
+
if (!actionsConfig) {
|
|
742
|
+
return [];
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
var operations = actionsConfig.flatMap(function (x) {
|
|
746
|
+
var _x$endOperations2;
|
|
747
|
+
|
|
748
|
+
return [].concat(x.startOperations, (_x$endOperations2 = x.endOperations) != null ? _x$endOperations2 : []);
|
|
749
|
+
});
|
|
750
|
+
return _gatherOperationImportPaths(operations);
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
function _gatherControllerImportPaths(operationConfigs) {
|
|
754
|
+
if (!operationConfigs) {
|
|
755
|
+
return [];
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
return operationConfigs.filter(function (operationConfig) {
|
|
759
|
+
var _operationConfig$oper;
|
|
760
|
+
|
|
761
|
+
if ((_operationConfig$oper = operationConfig.operationData) != null && _operationConfig$oper.hasOwnProperty('systemName')) {
|
|
762
|
+
return operationConfig.operationData.systemName.endsWith('Controller');
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
return false;
|
|
766
|
+
}).map(function (operationConfig) {
|
|
767
|
+
var systemName = operationConfig.operationData.systemName;
|
|
768
|
+
return {
|
|
769
|
+
systemName: systemName
|
|
770
|
+
};
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
function _gatherOperationImportPaths(operationConfigs) {
|
|
775
|
+
if (!operationConfigs) {
|
|
776
|
+
return [];
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
return operationConfigs.map(function (operationConfig) {
|
|
780
|
+
var systemName = operationConfig.systemName;
|
|
781
|
+
return {
|
|
782
|
+
systemName: systemName
|
|
783
|
+
};
|
|
784
|
+
});
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
function dedupe(importPaths) {
|
|
788
|
+
var lookup = {};
|
|
789
|
+
return importPaths.filter(function (imp) {
|
|
790
|
+
if (lookup[imp.systemName]) {
|
|
791
|
+
return false;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
lookup[imp.systemName] = true;
|
|
795
|
+
return true;
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
|
|
594
799
|
function getNestedValue(properties, sourceObject) {
|
|
595
800
|
if (!properties) {
|
|
596
801
|
throw Error('properties arg cannot be null');
|
|
@@ -1759,6 +1964,34 @@ var ctrls = {
|
|
|
1759
1964
|
SubtitlesController: SubtitlesController
|
|
1760
1965
|
};
|
|
1761
1966
|
|
|
1967
|
+
var DevToolEventListener = /*#__PURE__*/function () {
|
|
1968
|
+
function DevToolEventListener(agent) {
|
|
1969
|
+
this.agent = void 0;
|
|
1970
|
+
this.agent = agent;
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1973
|
+
var _proto = DevToolEventListener.prototype;
|
|
1974
|
+
|
|
1975
|
+
_proto.handleEvent = function handleEvent(eventName, eventTopic, args) {
|
|
1976
|
+
this.agent.postMessage('eligius-diagnostics-event', {
|
|
1977
|
+
eventName: eventName,
|
|
1978
|
+
eventTopic: eventTopic
|
|
1979
|
+
});
|
|
1980
|
+
};
|
|
1981
|
+
|
|
1982
|
+
return DevToolEventListener;
|
|
1983
|
+
}();
|
|
1984
|
+
|
|
1985
|
+
var Diagnostics = /*#__PURE__*/function () {
|
|
1986
|
+
function Diagnostics() {}
|
|
1987
|
+
|
|
1988
|
+
Diagnostics.send = function send(_name, _data) {};
|
|
1989
|
+
|
|
1990
|
+
return Diagnostics;
|
|
1991
|
+
}();
|
|
1992
|
+
|
|
1993
|
+
var DEV_TOOLS_KEY = '__ELIGIUS_DEV_TOOLS__';
|
|
1994
|
+
|
|
1762
1995
|
/**
|
|
1763
1996
|
* EligiusEngine, this is where the magic happens. The engine is responsible for starting and stopping
|
|
1764
1997
|
* the given timeline provider and triggering the actions associated with it.
|
|
@@ -1820,6 +2053,7 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
1820
2053
|
|
|
1821
2054
|
_proto._initializeTimelineProvider = function _initializeTimelineProvider() {
|
|
1822
2055
|
var _this$configuration$t,
|
|
2056
|
+
_this$_activeTimeline,
|
|
1823
2057
|
_this = this;
|
|
1824
2058
|
|
|
1825
2059
|
if (!((_this$configuration$t = this.configuration.timelines) != null && _this$configuration$t.length)) {
|
|
@@ -1833,10 +2067,7 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
1833
2067
|
throw new Error("No timeline provider configured for type " + firstTimeline.type);
|
|
1834
2068
|
}
|
|
1835
2069
|
|
|
1836
|
-
|
|
1837
|
-
this._activeTimelineProvider.destroy();
|
|
1838
|
-
}
|
|
1839
|
-
|
|
2070
|
+
(_this$_activeTimeline = this._activeTimelineProvider) == null ? void 0 : _this$_activeTimeline.destroy();
|
|
1840
2071
|
this._activeTimelineProvider = providerSettings.provider;
|
|
1841
2072
|
return new Promise( /*#__PURE__*/function () {
|
|
1842
2073
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve) {
|
|
@@ -1908,6 +2139,7 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
1908
2139
|
|
|
1909
2140
|
_proto.destroy = /*#__PURE__*/function () {
|
|
1910
2141
|
var _destroy = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
2142
|
+
var containerSelector, container;
|
|
1911
2143
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
1912
2144
|
while (1) {
|
|
1913
2145
|
switch (_context3.prev = _context3.next) {
|
|
@@ -1923,12 +2155,16 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
1923
2155
|
});
|
|
1924
2156
|
|
|
1925
2157
|
if (this.timelineProviders) {
|
|
1926
|
-
Object.values(this.timelineProviders).forEach(function (
|
|
1927
|
-
return
|
|
2158
|
+
Object.values(this.timelineProviders).forEach(function (providerInfo) {
|
|
2159
|
+
return providerInfo.provider.destroy();
|
|
1928
2160
|
});
|
|
1929
2161
|
}
|
|
1930
2162
|
|
|
1931
|
-
|
|
2163
|
+
containerSelector = this.configuration.containerSelector;
|
|
2164
|
+
container = $__default["default"](containerSelector);
|
|
2165
|
+
container.empty();
|
|
2166
|
+
|
|
2167
|
+
case 8:
|
|
1932
2168
|
case "end":
|
|
1933
2169
|
return _context3.stop();
|
|
1934
2170
|
}
|
|
@@ -2197,9 +2433,9 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
2197
2433
|
};
|
|
2198
2434
|
|
|
2199
2435
|
_proto._handleRequestTimelinePosition = function _handleRequestTimelinePosition(floor, resultCallback) {
|
|
2200
|
-
var _this$
|
|
2436
|
+
var _this$_activeTimeline2;
|
|
2201
2437
|
|
|
2202
|
-
resultCallback(floor(((_this$
|
|
2438
|
+
resultCallback(floor(((_this$_activeTimeline2 = this._activeTimelineProvider) == null ? void 0 : _this$_activeTimeline2.getPosition()) || -1));
|
|
2203
2439
|
};
|
|
2204
2440
|
|
|
2205
2441
|
_proto._handleTimelineComplete = function _handleTimelineComplete() {
|
|
@@ -2245,19 +2481,19 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
2245
2481
|
|
|
2246
2482
|
_proto._onTimeHandler = function _onTimeHandler(floor, event) {
|
|
2247
2483
|
if (!isNaN(event.position)) {
|
|
2248
|
-
var _this$
|
|
2484
|
+
var _this$_activeTimeline4;
|
|
2249
2485
|
|
|
2250
2486
|
var pos = floor(event.position);
|
|
2251
2487
|
|
|
2252
2488
|
if (this._lastPosition !== pos) {
|
|
2253
|
-
var _this$
|
|
2489
|
+
var _this$_activeTimeline3;
|
|
2254
2490
|
|
|
2255
2491
|
this._executeActionsForPosition(pos);
|
|
2256
2492
|
|
|
2257
|
-
this.eventbus.broadcast(TimelineEventNames.POSITION_UPDATE, [pos, (_this$
|
|
2493
|
+
this.eventbus.broadcast(TimelineEventNames.POSITION_UPDATE, [pos, (_this$_activeTimeline3 = this._activeTimelineProvider) == null ? void 0 : _this$_activeTimeline3.getDuration()]);
|
|
2258
2494
|
}
|
|
2259
2495
|
|
|
2260
|
-
this.eventbus.broadcast(TimelineEventNames.TIME_UPDATE, [event.position, (_this$
|
|
2496
|
+
this.eventbus.broadcast(TimelineEventNames.TIME_UPDATE, [event.position, (_this$_activeTimeline4 = this._activeTimelineProvider) == null ? void 0 : _this$_activeTimeline4.getDuration()]);
|
|
2261
2497
|
}
|
|
2262
2498
|
};
|
|
2263
2499
|
|
|
@@ -2612,6 +2848,9 @@ var EngineFactory = /*#__PURE__*/function () {
|
|
|
2612
2848
|
this.eventbus = void 0;
|
|
2613
2849
|
this.importer = importer;
|
|
2614
2850
|
this.eventbus = eventbus || new Eventbus();
|
|
2851
|
+
|
|
2852
|
+
this._initializeDevtools(this.eventbus);
|
|
2853
|
+
|
|
2615
2854
|
this.eventbus.on(TimelineEventNames.REQUEST_INSTANCE, this._requestInstanceHandler.bind(this));
|
|
2616
2855
|
this.eventbus.on(TimelineEventNames.REQUEST_ACTION, this._requestActionHandler.bind(this));
|
|
2617
2856
|
this.eventbus.on(TimelineEventNames.REQUEST_FUNCTION, this._requestFunctionHandler.bind(this));
|
|
@@ -2620,6 +2859,20 @@ var EngineFactory = /*#__PURE__*/function () {
|
|
|
2620
2859
|
|
|
2621
2860
|
var _proto = EngineFactory.prototype;
|
|
2622
2861
|
|
|
2862
|
+
_proto._initializeDevtools = function _initializeDevtools(eventbus) {
|
|
2863
|
+
var diagnosticInfo = window[DEV_TOOLS_KEY];
|
|
2864
|
+
|
|
2865
|
+
if (diagnosticInfo) {
|
|
2866
|
+
var agent = diagnosticInfo.agent;
|
|
2867
|
+
var eventbusListener = new DevToolEventListener(agent);
|
|
2868
|
+
eventbus.registerEventlistener(eventbusListener);
|
|
2869
|
+
|
|
2870
|
+
Diagnostics.send = function (name, data) {
|
|
2871
|
+
agent.postMessage(name, data);
|
|
2872
|
+
};
|
|
2873
|
+
}
|
|
2874
|
+
};
|
|
2875
|
+
|
|
2623
2876
|
_proto.destroy = function destroy() {
|
|
2624
2877
|
this.eventbus.clear();
|
|
2625
2878
|
};
|
|
@@ -2894,7 +3147,6 @@ function resolveEventArguments(operationData, eventArgs) {
|
|
|
2894
3147
|
* event argumetns and optional event topic.
|
|
2895
3148
|
*
|
|
2896
3149
|
* @param operationData
|
|
2897
|
-
* @returns
|
|
2898
3150
|
*/
|
|
2899
3151
|
|
|
2900
3152
|
var broadcastEvent$1 = function broadcastEvent(operationData) {
|
|
@@ -2913,33 +3165,6 @@ var broadcastEvent$1 = function broadcastEvent(operationData) {
|
|
|
2913
3165
|
return operationData;
|
|
2914
3166
|
};
|
|
2915
3167
|
|
|
2916
|
-
/**
|
|
2917
|
-
* This operation removes all of the children from the specified selected element.
|
|
2918
|
-
*/
|
|
2919
|
-
var clearElement$1 = function clearElement(operationData) {
|
|
2920
|
-
var selectedElement = operationData.selectedElement;
|
|
2921
|
-
selectedElement.empty();
|
|
2922
|
-
return operationData;
|
|
2923
|
-
};
|
|
2924
|
-
|
|
2925
|
-
/**
|
|
2926
|
-
* This operation removes all of the properties on the current operation date.
|
|
2927
|
-
* Or, if the properties property is set only removes the properties defined by that list.
|
|
2928
|
-
*/
|
|
2929
|
-
var clearOperationData$1 = function clearOperationData(operationData) {
|
|
2930
|
-
var properties = operationData.properties;
|
|
2931
|
-
|
|
2932
|
-
if (properties) {
|
|
2933
|
-
properties.forEach(function (name) {
|
|
2934
|
-
delete operationData[name];
|
|
2935
|
-
});
|
|
2936
|
-
delete operationData.properties;
|
|
2937
|
-
return operationData;
|
|
2938
|
-
}
|
|
2939
|
-
|
|
2940
|
-
return {};
|
|
2941
|
-
};
|
|
2942
|
-
|
|
2943
3168
|
var cache = [];
|
|
2944
3169
|
function resolvePropertyValues(operationData, properties) {
|
|
2945
3170
|
var copy = properties !== operationData ? deepCopy(properties) : properties;
|
|
@@ -2984,6 +3209,71 @@ function resolveProperties(properties, copy, extract) {
|
|
|
2984
3209
|
}
|
|
2985
3210
|
}
|
|
2986
3211
|
|
|
3212
|
+
var calcFunctions = {
|
|
3213
|
+
'+': function _(left, right) {
|
|
3214
|
+
return left + right;
|
|
3215
|
+
},
|
|
3216
|
+
'-': function _(left, right) {
|
|
3217
|
+
return left - right;
|
|
3218
|
+
},
|
|
3219
|
+
'*': function _(left, right) {
|
|
3220
|
+
return left * right;
|
|
3221
|
+
},
|
|
3222
|
+
'/': function _(left, right) {
|
|
3223
|
+
return left / right;
|
|
3224
|
+
},
|
|
3225
|
+
'%': function _(left, right) {
|
|
3226
|
+
return left % right;
|
|
3227
|
+
},
|
|
3228
|
+
'**': function _(left, right) {
|
|
3229
|
+
return Math.pow(left, right);
|
|
3230
|
+
}
|
|
3231
|
+
};
|
|
3232
|
+
/**
|
|
3233
|
+
* This operation calculates the given left and right hand sides using the specified operator.
|
|
3234
|
+
*
|
|
3235
|
+
* @param operationData
|
|
3236
|
+
*/
|
|
3237
|
+
|
|
3238
|
+
var calc$1 = function calc(operationData) {
|
|
3239
|
+
operationData = resolvePropertyValues(operationData, operationData);
|
|
3240
|
+
var _operationData = operationData,
|
|
3241
|
+
left = _operationData.left,
|
|
3242
|
+
right = _operationData.right,
|
|
3243
|
+
operator = _operationData.operator,
|
|
3244
|
+
_operationData$proper = _operationData.propertyName,
|
|
3245
|
+
propertyName = _operationData$proper === void 0 ? 'calculationResult' : _operationData$proper;
|
|
3246
|
+
operationData[propertyName] = calcFunctions[operator](+left, +right);
|
|
3247
|
+
return operationData;
|
|
3248
|
+
};
|
|
3249
|
+
|
|
3250
|
+
/**
|
|
3251
|
+
* This operation removes all of the children from the specified selected element.
|
|
3252
|
+
*/
|
|
3253
|
+
var clearElement$1 = function clearElement(operationData) {
|
|
3254
|
+
var selectedElement = operationData.selectedElement;
|
|
3255
|
+
selectedElement.empty();
|
|
3256
|
+
return operationData;
|
|
3257
|
+
};
|
|
3258
|
+
|
|
3259
|
+
/**
|
|
3260
|
+
* This operation removes all of the properties on the current operation date.
|
|
3261
|
+
* Or, if the properties property is set only removes the properties defined by that list.
|
|
3262
|
+
*/
|
|
3263
|
+
var clearOperationData$1 = function clearOperationData(operationData) {
|
|
3264
|
+
var properties = operationData.properties;
|
|
3265
|
+
|
|
3266
|
+
if (properties) {
|
|
3267
|
+
properties.forEach(function (name) {
|
|
3268
|
+
delete operationData[name];
|
|
3269
|
+
});
|
|
3270
|
+
delete operationData.properties;
|
|
3271
|
+
return operationData;
|
|
3272
|
+
}
|
|
3273
|
+
|
|
3274
|
+
return {};
|
|
3275
|
+
};
|
|
3276
|
+
|
|
2987
3277
|
/**
|
|
2988
3278
|
* This operation creates the DOM element defined by the given properties and assigns
|
|
2989
3279
|
* the instance to the give property name on the current operation data.
|
|
@@ -3458,6 +3748,38 @@ var log$1 = function log(operationData) {
|
|
|
3458
3748
|
return operationData;
|
|
3459
3749
|
};
|
|
3460
3750
|
|
|
3751
|
+
/**
|
|
3752
|
+
* This operation performs the given math function of the specified arguments.
|
|
3753
|
+
*
|
|
3754
|
+
* @param operationData
|
|
3755
|
+
*/
|
|
3756
|
+
|
|
3757
|
+
var math$1 = function math(operationData) {
|
|
3758
|
+
operationData = resolvePropertyValues(operationData, operationData);
|
|
3759
|
+
operationData.args = resolveMathConstants(operationData.args);
|
|
3760
|
+
var _operationData = operationData,
|
|
3761
|
+
args = _operationData.args,
|
|
3762
|
+
functionName = _operationData.functionName,
|
|
3763
|
+
_operationData$proper = _operationData.propertyName,
|
|
3764
|
+
propertyName = _operationData$proper === void 0 ? 'mathResult' : _operationData$proper;
|
|
3765
|
+
operationData[propertyName] = Math[functionName].apply(null, args);
|
|
3766
|
+
return operationData;
|
|
3767
|
+
};
|
|
3768
|
+
|
|
3769
|
+
function resolveMathConstants(args) {
|
|
3770
|
+
return args.map(function (arg) {
|
|
3771
|
+
if (isMathProperty(arg)) {
|
|
3772
|
+
return Math[arg];
|
|
3773
|
+
}
|
|
3774
|
+
|
|
3775
|
+
return arg;
|
|
3776
|
+
});
|
|
3777
|
+
}
|
|
3778
|
+
|
|
3779
|
+
function isMathProperty(value) {
|
|
3780
|
+
return typeof value === 'string' && value in Math && typeof Math[value] !== 'function';
|
|
3781
|
+
}
|
|
3782
|
+
|
|
3461
3783
|
/**
|
|
3462
3784
|
* This operation removes the spcified class name from the specified selected element.
|
|
3463
3785
|
*
|
|
@@ -3835,6 +4157,7 @@ var ops = {
|
|
|
3835
4157
|
animate: animate$1,
|
|
3836
4158
|
animateWithClass: animateWithClass$1,
|
|
3837
4159
|
broadcastEvent: broadcastEvent$1,
|
|
4160
|
+
calc: calc$1,
|
|
3838
4161
|
clearElement: clearElement$1,
|
|
3839
4162
|
clearOperationData: clearOperationData$1,
|
|
3840
4163
|
createElement: createElement$1,
|
|
@@ -3848,6 +4171,7 @@ var ops = {
|
|
|
3848
4171
|
getImport: getImport$1,
|
|
3849
4172
|
loadJSON: loadJSON$1,
|
|
3850
4173
|
log: log$1,
|
|
4174
|
+
math: math$1,
|
|
3851
4175
|
removeClass: removeClass$1,
|
|
3852
4176
|
removeControllerFromElement: removeControllerFromElement$1,
|
|
3853
4177
|
removeElement: removeElement$1,
|
|
@@ -4374,13 +4698,13 @@ var operations = ops;
|
|
|
4374
4698
|
var controllers = ctrls;
|
|
4375
4699
|
var providers = prvdrs;
|
|
4376
4700
|
var eventbus = evtb;
|
|
4377
|
-
var
|
|
4378
|
-
function
|
|
4701
|
+
var EligiusResourceImporter = /*#__PURE__*/function () {
|
|
4702
|
+
function EligiusResourceImporter() {
|
|
4379
4703
|
this.engines = new Map();
|
|
4380
4704
|
this.engines.set('EligiusEngine', EligiusEngine);
|
|
4381
4705
|
}
|
|
4382
4706
|
|
|
4383
|
-
var _proto =
|
|
4707
|
+
var _proto = EligiusResourceImporter.prototype;
|
|
4384
4708
|
|
|
4385
4709
|
_proto.getOperationNames = function getOperationNames() {
|
|
4386
4710
|
return Object.keys(operations);
|
|
@@ -4401,7 +4725,7 @@ var WebpackResourceImporter = /*#__PURE__*/function () {
|
|
|
4401
4725
|
return _ref4 = {}, _ref4[name] = value, _ref4;
|
|
4402
4726
|
};
|
|
4403
4727
|
|
|
4404
|
-
return
|
|
4728
|
+
return EligiusResourceImporter;
|
|
4405
4729
|
}();
|
|
4406
4730
|
|
|
4407
4731
|
function addClass() {
|
|
@@ -4470,6 +4794,53 @@ function broadcastEvent() {
|
|
|
4470
4794
|
};
|
|
4471
4795
|
}
|
|
4472
4796
|
|
|
4797
|
+
function calc() {
|
|
4798
|
+
return {
|
|
4799
|
+
description: 'clears the given element',
|
|
4800
|
+
properties: {
|
|
4801
|
+
left: {
|
|
4802
|
+
type: 'ParameterType:integer',
|
|
4803
|
+
description: 'The left operand',
|
|
4804
|
+
required: true
|
|
4805
|
+
},
|
|
4806
|
+
right: {
|
|
4807
|
+
type: 'ParameterType:integer',
|
|
4808
|
+
description: 'The right operand',
|
|
4809
|
+
required: true
|
|
4810
|
+
},
|
|
4811
|
+
operator: [{
|
|
4812
|
+
value: '+',
|
|
4813
|
+
description: 'Adds the left and right operands'
|
|
4814
|
+
}, {
|
|
4815
|
+
value: '-',
|
|
4816
|
+
description: 'Subtracts the left and right operands'
|
|
4817
|
+
}, {
|
|
4818
|
+
value: '*',
|
|
4819
|
+
description: 'Multiplies the left and right operands'
|
|
4820
|
+
}, {
|
|
4821
|
+
value: '/',
|
|
4822
|
+
description: 'Divides the left and right operands'
|
|
4823
|
+
}, {
|
|
4824
|
+
value: '%',
|
|
4825
|
+
description: 'Returns the remainder left over after the left number is divided into a number of integer portions equal to the right number'
|
|
4826
|
+
}, {
|
|
4827
|
+
value: '**',
|
|
4828
|
+
description: 'Exponent: Raises a base number to the exponent power, that is, the base number multiplied by itself, exponent times.'
|
|
4829
|
+
}],
|
|
4830
|
+
propertyName: {
|
|
4831
|
+
type: 'ParameterType:string',
|
|
4832
|
+
defaultValue: 'calculationResult'
|
|
4833
|
+
}
|
|
4834
|
+
}
|
|
4835
|
+
/*outputProperties: {
|
|
4836
|
+
propertyName: {
|
|
4837
|
+
type: 'ParameterType:integer',
|
|
4838
|
+
},
|
|
4839
|
+
},*/
|
|
4840
|
+
|
|
4841
|
+
};
|
|
4842
|
+
}
|
|
4843
|
+
|
|
4473
4844
|
function clearElement() {
|
|
4474
4845
|
return {
|
|
4475
4846
|
description: 'clears the given element',
|
|
@@ -4630,6 +5001,33 @@ function log() {
|
|
|
4630
5001
|
};
|
|
4631
5002
|
}
|
|
4632
5003
|
|
|
5004
|
+
function math() {
|
|
5005
|
+
return {
|
|
5006
|
+
description: 'This operation performs the given math function of the specified arguments.',
|
|
5007
|
+
properties: {
|
|
5008
|
+
args: {
|
|
5009
|
+
type: 'ParameterType:array',
|
|
5010
|
+
required: true
|
|
5011
|
+
},
|
|
5012
|
+
functionName: createMathFunctionNames(),
|
|
5013
|
+
propertyName: {
|
|
5014
|
+
type: 'ParameterType:string',
|
|
5015
|
+
defaultValue: 'mathResult'
|
|
5016
|
+
}
|
|
5017
|
+
}
|
|
5018
|
+
};
|
|
5019
|
+
}
|
|
5020
|
+
|
|
5021
|
+
function createMathFunctionNames() {
|
|
5022
|
+
return Object.getOwnPropertyNames(Math).filter(function (x) {
|
|
5023
|
+
return typeof Math[x] === 'function';
|
|
5024
|
+
}).map(function (functionName) {
|
|
5025
|
+
return {
|
|
5026
|
+
value: functionName
|
|
5027
|
+
};
|
|
5028
|
+
});
|
|
5029
|
+
}
|
|
5030
|
+
|
|
4633
5031
|
function removeClass() {
|
|
4634
5032
|
return {
|
|
4635
5033
|
description: 'Removes the specified class from the selected element',
|
|
@@ -4690,7 +5088,8 @@ function requestAction() {
|
|
|
4690
5088
|
description: 'Retrieves an instance of the specified action',
|
|
4691
5089
|
properties: {
|
|
4692
5090
|
systemName: {
|
|
4693
|
-
type: 'ParameterType:actionName'
|
|
5091
|
+
type: 'ParameterType:actionName',
|
|
5092
|
+
required: true
|
|
4694
5093
|
}
|
|
4695
5094
|
},
|
|
4696
5095
|
outputProperties: {
|
|
@@ -4857,6 +5256,7 @@ var index = {
|
|
|
4857
5256
|
animate: animate,
|
|
4858
5257
|
animateWithClass: animateWithClass,
|
|
4859
5258
|
broadcastEvent: broadcastEvent,
|
|
5259
|
+
calc: calc,
|
|
4860
5260
|
clearElement: clearElement,
|
|
4861
5261
|
clearOperationData: clearOperationData,
|
|
4862
5262
|
createElement: createElement,
|
|
@@ -4870,6 +5270,7 @@ var index = {
|
|
|
4870
5270
|
getImport: getImport,
|
|
4871
5271
|
loadJSON: loadJSON,
|
|
4872
5272
|
log: log,
|
|
5273
|
+
math: math,
|
|
4873
5274
|
removeClass: removeClass,
|
|
4874
5275
|
removeControllerFromElement: removeControllerFromElement,
|
|
4875
5276
|
removeElement: removeElement,
|
|
@@ -4892,7 +5293,11 @@ var index = {
|
|
|
4892
5293
|
exports.Action = Action;
|
|
4893
5294
|
exports.ActionRegistryEventbusListener = ActionRegistryEventbusListener;
|
|
4894
5295
|
exports.ConfigurationResolver = ConfigurationResolver;
|
|
5296
|
+
exports.DEV_TOOLS_KEY = DEV_TOOLS_KEY;
|
|
5297
|
+
exports.DevToolEventListener = DevToolEventListener;
|
|
5298
|
+
exports.Diagnostics = Diagnostics;
|
|
4895
5299
|
exports.EligiusEngine = EligiusEngine;
|
|
5300
|
+
exports.EligiusResourceImporter = EligiusResourceImporter;
|
|
4896
5301
|
exports.EndableAction = EndableAction;
|
|
4897
5302
|
exports.EngineFactory = EngineFactory;
|
|
4898
5303
|
exports.EventListenerController = EventListenerController;
|
|
@@ -4909,12 +5314,12 @@ exports.RoutingController = RoutingController;
|
|
|
4909
5314
|
exports.SubtitlesController = SubtitlesController;
|
|
4910
5315
|
exports.TimelineAction = TimelineAction;
|
|
4911
5316
|
exports.TimelineEventNames = TimelineEventNames;
|
|
4912
|
-
exports.WebpackResourceImporter = WebpackResourceImporter;
|
|
4913
5317
|
exports.addClass = addClass$1;
|
|
4914
5318
|
exports.addControllerToElement = addControllerToElement$1;
|
|
4915
5319
|
exports.animate = animate$1;
|
|
4916
5320
|
exports.animateWithClass = animateWithClass$1;
|
|
4917
5321
|
exports.broadcastEvent = broadcastEvent$1;
|
|
5322
|
+
exports.calc = calc$1;
|
|
4918
5323
|
exports.clearElement = clearElement$1;
|
|
4919
5324
|
exports.clearOperationData = clearOperationData$1;
|
|
4920
5325
|
exports.createElement = createElement$1;
|
|
@@ -4922,12 +5327,14 @@ exports.customFunction = customFunction$1;
|
|
|
4922
5327
|
exports.endAction = endAction$1;
|
|
4923
5328
|
exports.endLoop = endLoop$1;
|
|
4924
5329
|
exports.extendController = extendController$1;
|
|
5330
|
+
exports.generateImporterSourceCode = generateImporterSourceCode;
|
|
4925
5331
|
exports.getControllerFromElement = getControllerFromElement$1;
|
|
4926
5332
|
exports.getControllerInstance = getControllerInstance$1;
|
|
4927
5333
|
exports.getElementDimensions = getElementDimensions$1;
|
|
4928
5334
|
exports.getImport = getImport$1;
|
|
4929
5335
|
exports.loadJSON = loadJSON$1;
|
|
4930
5336
|
exports.log = log$1;
|
|
5337
|
+
exports.math = math$1;
|
|
4931
5338
|
exports.metadata = index;
|
|
4932
5339
|
exports.removeClass = removeClass$1;
|
|
4933
5340
|
exports.removeControllerFromElement = removeControllerFromElement$1;
|