eligius 1.0.10 → 1.0.12

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.
@@ -425,8 +425,9 @@ function prepareValueForSerialization(value) {
425
425
  } else if (value instanceof $) {
426
426
  return 'jQuery object';
427
427
  } else if (value !== null && typeof value === 'object') {
428
- if (value.constructor.toString().substring(0, 5) === 'class') {
429
- return 'Complex object';
428
+ if (value.constructor.toString().substring(0, 5) === 'class' || !value.constructor.toString().startsWith('function Object()')) {
429
+ var funcString = value.constructor.toString();
430
+ return funcString.substring(0, funcString.indexOf('{') + 1);
430
431
  }
431
432
 
432
433
  return Object.fromEntries(Object.entries(value).map(function (_ref) {
@@ -435,14 +436,15 @@ function prepareValueForSerialization(value) {
435
436
  return [propName, prepareValueForSerialization(propValue)];
436
437
  }));
437
438
  } else if (typeof value === 'function') {
438
- var funcString = value.toString();
439
- var paranIndex = funcString.indexOf('{');
439
+ var _funcString = value.toString();
440
+
441
+ var paranIndex = _funcString.indexOf('{');
440
442
 
441
443
  if (paranIndex > -1) {
442
- return funcString.substring(0, funcString.indexOf('{') + 1);
444
+ return _funcString.substring(0, _funcString.indexOf('{') + 1);
443
445
  }
444
446
 
445
- return funcString;
447
+ return _funcString;
446
448
  }
447
449
 
448
450
  return value;
@@ -3308,6 +3310,25 @@ function removeEventDataFromOperationData(operationData) {
3308
3310
  delete operationData.eventArgs;
3309
3311
  }
3310
3312
 
3313
+ var cache$1 = {};
3314
+
3315
+ function _getGlobals(cache, name) {
3316
+ var value = name ? cache[name] : cache;
3317
+ return value && value !== cache ? deepCopy(value) : value;
3318
+ }
3319
+
3320
+ function _setGlobals(cache, newValues) {
3321
+ Object.entries(newValues).forEach(function (_ref) {
3322
+ var name = _ref[0],
3323
+ value = _ref[1];
3324
+ return cache[name] = value;
3325
+ });
3326
+ console.log('cache', cache);
3327
+ }
3328
+
3329
+ var getGlobals = /*#__PURE__*/_getGlobals.bind(null, cache$1);
3330
+ var setGlobals = /*#__PURE__*/_setGlobals.bind(null, cache$1);
3331
+
3311
3332
  function extractOperationDataArgumentValues(sourceObject, argumentValue) {
3312
3333
  if (typeof argumentValue === 'string' && argumentValue.toLowerCase().startsWith('operationdata.')) {
3313
3334
  var propNames = argumentValue.split('.');
@@ -3315,6 +3336,14 @@ function extractOperationDataArgumentValues(sourceObject, argumentValue) {
3315
3336
  return getNestedValue(propNames, sourceObject);
3316
3337
  }
3317
3338
 
3339
+ if (typeof argumentValue === 'string' && argumentValue.toLowerCase().startsWith('globaldata.')) {
3340
+ var _propNames = argumentValue.split('.');
3341
+
3342
+ _propNames.shift();
3343
+
3344
+ return getNestedValue(_propNames, getGlobals());
3345
+ }
3346
+
3318
3347
  return argumentValue;
3319
3348
  }
3320
3349
 
@@ -4212,6 +4241,24 @@ var setElementContent$1 = function setElementContent(operationData) {
4212
4241
  return operationData;
4213
4242
  };
4214
4243
 
4244
+ /**
4245
+ * This operation copies the specified values from the operationData to the global data.
4246
+ *
4247
+ * @param operationData
4248
+ * @returns
4249
+ */
4250
+
4251
+ var setGlobalData$1 = function setGlobalData(operationData) {
4252
+ var properties = operationData.properties;
4253
+ var newGlobals = Object.fromEntries(Object.entries(operationData).filter(function (_ref) {
4254
+ var name = _ref[0];
4255
+ return properties.includes(name);
4256
+ }));
4257
+ setGlobals(newGlobals);
4258
+ delete operationData.properties;
4259
+ return operationData;
4260
+ };
4261
+
4215
4262
  /**
4216
4263
  * This operation assigns the specified properties to the current operation data.
4217
4264
  * When override is set to true the properties replace the current operation data entirely.
@@ -4388,6 +4435,7 @@ var ops = {
4388
4435
  selectElement: selectElement$1,
4389
4436
  setElementAttributes: setElementAttributes$1,
4390
4437
  setElementContent: setElementContent$1,
4438
+ setGlobalData: setGlobalData$1,
4391
4439
  setOperationData: setOperationData$1,
4392
4440
  setStyle: setStyle$1,
4393
4441
  startAction: startAction$1,
@@ -5406,6 +5454,18 @@ function setElementContent() {
5406
5454
  };
5407
5455
  }
5408
5456
 
5457
+ function setGlobalData() {
5458
+ return {
5459
+ description: 'Copies the specified values from the operationData to the global data',
5460
+ properties: {
5461
+ properties: {
5462
+ type: 'ParameterType:array',
5463
+ required: true
5464
+ }
5465
+ }
5466
+ };
5467
+ }
5468
+
5409
5469
  function setOperationData() {
5410
5470
  return {
5411
5471
  description: 'Sets the given properties on the current operation data',
@@ -5521,6 +5581,7 @@ var index = {
5521
5581
  selectElement: selectElement,
5522
5582
  setElementAttributes: setElementAttributes,
5523
5583
  setElementContent: setElementContent,
5584
+ setGlobalData: setGlobalData,
5524
5585
  setOperationData: setOperationData,
5525
5586
  setStyle: setStyle,
5526
5587
  startAction: startAction,
@@ -5530,5 +5591,5 @@ var index = {
5530
5591
  wait: wait
5531
5592
  };
5532
5593
 
5533
- export { Action, ActionRegistryEventbusListener, ConfigurationResolver, DEV_TOOLS_KEY, DevToolEventListener, Diagnostics, EligiusEngine, EligiusResourceImporter, EndableAction, EngineFactory, EventListenerController, Eventbus, JwPlayerTimelineProvider, LabelController, LanguageManager, LottieController, NavigationController, ProgressbarController, RequestAnimationFrameTimelineProvider, RequestVideoUriInterceptor, RoutingController, SubtitlesController, TimelineAction, TimelineEventNames, addClass$1 as addClass, addControllerToElement$1 as addControllerToElement, animate$1 as animate, animateWithClass$1 as animateWithClass, broadcastEvent$1 as broadcastEvent, calc$1 as calc, clearElement$1 as clearElement, clearOperationData$1 as clearOperationData, createElement$1 as createElement, customFunction$1 as customFunction, endAction$1 as endAction, endLoop$1 as endLoop, extendController$1 as extendController, generateImporterSourceCode, getControllerFromElement$1 as getControllerFromElement, getControllerInstance$1 as getControllerInstance, getElementDimensions$1 as getElementDimensions, getImport$1 as getImport, getQueryParams$1 as getQueryParams, invokeObjectMethod$1 as invokeObjectMethod, loadJSON$1 as loadJSON, log$1 as log, math$1 as math, index as metadata, removeClass$1 as removeClass, removeControllerFromElement$1 as removeControllerFromElement, removeElement$1 as removeElement, removePropertiesFromOperationData$1 as removePropertiesFromOperationData, reparentElement$1 as reparentElement, requestAction$1 as requestAction, resizeAction$1 as resizeAction, selectElement$1 as selectElement, setElementAttributes$1 as setElementAttributes, setElementContent$1 as setElementContent, setOperationData$1 as setOperationData, setStyle$1 as setStyle, startAction$1 as startAction, startLoop$1 as startLoop, toggleClass$1 as toggleClass, toggleElement$1 as toggleElement, wait$1 as wait };
5594
+ export { Action, ActionRegistryEventbusListener, ConfigurationResolver, DEV_TOOLS_KEY, DevToolEventListener, Diagnostics, EligiusEngine, EligiusResourceImporter, EndableAction, EngineFactory, EventListenerController, Eventbus, JwPlayerTimelineProvider, LabelController, LanguageManager, LottieController, NavigationController, ProgressbarController, RequestAnimationFrameTimelineProvider, RequestVideoUriInterceptor, RoutingController, SubtitlesController, TimelineAction, TimelineEventNames, addClass$1 as addClass, addControllerToElement$1 as addControllerToElement, animate$1 as animate, animateWithClass$1 as animateWithClass, broadcastEvent$1 as broadcastEvent, calc$1 as calc, clearElement$1 as clearElement, clearOperationData$1 as clearOperationData, createElement$1 as createElement, customFunction$1 as customFunction, endAction$1 as endAction, endLoop$1 as endLoop, extendController$1 as extendController, generateImporterSourceCode, getControllerFromElement$1 as getControllerFromElement, getControllerInstance$1 as getControllerInstance, getElementDimensions$1 as getElementDimensions, getImport$1 as getImport, getQueryParams$1 as getQueryParams, invokeObjectMethod$1 as invokeObjectMethod, loadJSON$1 as loadJSON, log$1 as log, math$1 as math, index as metadata, removeClass$1 as removeClass, removeControllerFromElement$1 as removeControllerFromElement, removeElement$1 as removeElement, removePropertiesFromOperationData$1 as removePropertiesFromOperationData, reparentElement$1 as reparentElement, requestAction$1 as requestAction, resizeAction$1 as resizeAction, selectElement$1 as selectElement, setElementAttributes$1 as setElementAttributes, setElementContent$1 as setElementContent, setGlobalData$1 as setGlobalData, setOperationData$1 as setOperationData, setStyle$1 as setStyle, startAction$1 as startAction, startLoop$1 as startLoop, toggleClass$1 as toggleClass, toggleElement$1 as toggleElement, wait$1 as wait };
5534
5595
  //# sourceMappingURL=eligius.esm.js.map