@digipair/engine 0.10.5 → 0.10.6

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/index.cjs.js CHANGED
@@ -23510,14 +23510,14 @@ function indent(str, spaces) {
23510
23510
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23511
23511
  // match is required
23512
23512
  if (!match) {
23513
- return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
23513
+ return nextMatch = nextMatch1, tokens = tokens1, i = i1, {
23514
23514
  v: nextMatch1
23515
23515
  };
23516
23516
  }
23517
23517
  var token = match.token, offset = match.offset;
23518
23518
  i1 += offset;
23519
23519
  if (token === " ") {
23520
- return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23520
+ return nextMatch = nextMatch1, tokens = tokens1, i = i1, "continue";
23521
23521
  }
23522
23522
  tokens1 = _to_consumable_array$1(tokens1).concat([
23523
23523
  token
@@ -23536,7 +23536,7 @@ function indent(str, spaces) {
23536
23536
  if (contextKeys.some(function(el) {
23537
23537
  return el.startsWith(name);
23538
23538
  })) {
23539
- return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23539
+ return nextMatch = nextMatch1, tokens = tokens1, i = i1, "continue";
23540
23540
  }
23541
23541
  if (dateTimeIdentifiers.some(function(el) {
23542
23542
  return el === name;
@@ -23555,9 +23555,9 @@ function indent(str, spaces) {
23555
23555
  if (dateTimeIdentifiers.some(function(el) {
23556
23556
  return el.startsWith(name);
23557
23557
  })) {
23558
- return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23558
+ return nextMatch = nextMatch1, tokens = tokens1, i = i1, "continue";
23559
23559
  }
23560
- return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
23560
+ return nextMatch = nextMatch1, tokens = tokens1, i = i1, {
23561
23561
  v: nextMatch1
23562
23562
  };
23563
23563
  };
@@ -27374,9 +27374,7 @@ const applyTemplate = (value, context)=>{
27374
27374
  }
27375
27375
  return result;
27376
27376
  };
27377
- const executePins = async (settingsOrigin, context = {}, options = {
27378
- libraries: {}
27379
- })=>{
27377
+ const executePins = async (settingsOrigin, context = {})=>{
27380
27378
  var _settings_conditions;
27381
27379
  const settings = await preparePinsSettings(settingsOrigin, context);
27382
27380
  if ((_settings_conditions = settings.conditions) == null ? void 0 : _settings_conditions.each) {
@@ -27402,12 +27400,12 @@ const executePins = async (settingsOrigin, context = {}, options = {
27402
27400
  if (typeof ((_itemSettings_conditions = itemSettings.conditions) == null ? void 0 : _itemSettings_conditions.if) !== 'undefined' && !itemSettings.conditions.if) {
27403
27401
  continue;
27404
27402
  }
27405
- const itemResult = await executePins(itemSettingsOrigin, itemContext, options);
27403
+ const itemResult = await executePins(itemSettingsOrigin, itemContext);
27406
27404
  results.push(itemResult);
27407
27405
  }
27408
27406
  return results;
27409
27407
  }
27410
- const version = options.libraries[settings.library] || 'latest';
27408
+ const version = context.config.VERSIONS[settings.library] || 'latest';
27411
27409
  const library = _config.LIBRARIES[settings.library] || (typeof window === 'undefined' ? require(settings.library) : await (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(`${_config.BASE_URL}/${settings.library}@${version}/index.esm.js`));
27412
27410
  const pins = library == null ? void 0 : library[settings.element];
27413
27411
  if (!pins) {
@@ -27415,9 +27413,7 @@ const executePins = async (settingsOrigin, context = {}, options = {
27415
27413
  }
27416
27414
  return await pins(settings.properties, settings.pins, context);
27417
27415
  };
27418
- const executePinsList = async (pinsSettingsList, context, options = {
27419
- libraries: {}
27420
- })=>{
27416
+ const executePinsList = async (pinsSettingsList, context)=>{
27421
27417
  let previous = {};
27422
27418
  const steps = [];
27423
27419
  // parcourir tous les pins
@@ -27438,7 +27434,7 @@ const executePinsList = async (pinsSettingsList, context, options = {
27438
27434
  steps: context.steps,
27439
27435
  parent: context.parent
27440
27436
  }
27441
- }), options);
27437
+ }));
27442
27438
  steps[i] = {
27443
27439
  name: settings.name,
27444
27440
  result: previous
@@ -27446,9 +27442,7 @@ const executePinsList = async (pinsSettingsList, context, options = {
27446
27442
  }
27447
27443
  return previous;
27448
27444
  };
27449
- const generateElementFromPins = async (pinsSettings, parent, context, options = {
27450
- libraries: {}
27451
- })=>{
27445
+ const generateElementFromPins = async (pinsSettings, parent, context)=>{
27452
27446
  var _settings_conditions, _settings_conditions1;
27453
27447
  const settings = await preparePinsSettings(pinsSettings, context);
27454
27448
  if ((_settings_conditions = settings.conditions) == null ? void 0 : _settings_conditions.each) {
@@ -27466,7 +27460,7 @@ const generateElementFromPins = async (pinsSettings, parent, context, options =
27466
27460
  index: item.index,
27467
27461
  parent: context.parent
27468
27462
  }
27469
- }), options);
27463
+ }));
27470
27464
  }
27471
27465
  return;
27472
27466
  }
@@ -27477,7 +27471,7 @@ const generateElementFromPins = async (pinsSettings, parent, context, options =
27477
27471
  element.setAttribute('data-digipair-pins', '');
27478
27472
  const library = pinsSettings.library;
27479
27473
  if (library !== 'web' && !_config.LIBRARIES[library]) {
27480
- const version = options.libraries[library] || 'latest';
27474
+ const version = context.config.VERSIONS[library] || 'latest';
27481
27475
  (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(`${_config.BASE_URL}/${library}@${version}/index.esm.js`);
27482
27476
  }
27483
27477
  Object.entries(settings.properties || {}).forEach(([key, value])=>{
@@ -27495,13 +27489,13 @@ const generateElementFromPins = async (pinsSettings, parent, context, options =
27495
27489
  const event = _event;
27496
27490
  executePinsList(pinsList, _extends({}, context, {
27497
27491
  event: event.detail
27498
- }), options);
27492
+ }));
27499
27493
  });
27500
27494
  });
27501
27495
  const pinsList = settings.pins || [];
27502
27496
  for(let i = 0; i < pinsList.length; i++){
27503
27497
  const item = pinsList[i];
27504
- await generateElementFromPins(item, element, context, options);
27498
+ await generateElementFromPins(item, element, context);
27505
27499
  }
27506
27500
  parent == null ? void 0 : parent.appendChild(element);
27507
27501
  return element;
package/index.esm.js CHANGED
@@ -23488,14 +23488,14 @@ function indent(str, spaces) {
23488
23488
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23489
23489
  // match is required
23490
23490
  if (!match) {
23491
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
23491
+ return nextMatch = nextMatch1, tokens = tokens1, i = i1, {
23492
23492
  v: nextMatch1
23493
23493
  };
23494
23494
  }
23495
23495
  var token = match.token, offset = match.offset;
23496
23496
  i1 += offset;
23497
23497
  if (token === " ") {
23498
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23498
+ return nextMatch = nextMatch1, tokens = tokens1, i = i1, "continue";
23499
23499
  }
23500
23500
  tokens1 = _to_consumable_array$1(tokens1).concat([
23501
23501
  token
@@ -23514,7 +23514,7 @@ function indent(str, spaces) {
23514
23514
  if (contextKeys.some(function(el) {
23515
23515
  return el.startsWith(name);
23516
23516
  })) {
23517
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23517
+ return nextMatch = nextMatch1, tokens = tokens1, i = i1, "continue";
23518
23518
  }
23519
23519
  if (dateTimeIdentifiers.some(function(el) {
23520
23520
  return el === name;
@@ -23533,9 +23533,9 @@ function indent(str, spaces) {
23533
23533
  if (dateTimeIdentifiers.some(function(el) {
23534
23534
  return el.startsWith(name);
23535
23535
  })) {
23536
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23536
+ return nextMatch = nextMatch1, tokens = tokens1, i = i1, "continue";
23537
23537
  }
23538
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
23538
+ return nextMatch = nextMatch1, tokens = tokens1, i = i1, {
23539
23539
  v: nextMatch1
23540
23540
  };
23541
23541
  };
@@ -27352,9 +27352,7 @@ const applyTemplate = (value, context)=>{
27352
27352
  }
27353
27353
  return result;
27354
27354
  };
27355
- const executePins = async (settingsOrigin, context = {}, options = {
27356
- libraries: {}
27357
- })=>{
27355
+ const executePins = async (settingsOrigin, context = {})=>{
27358
27356
  var _settings_conditions;
27359
27357
  const settings = await preparePinsSettings(settingsOrigin, context);
27360
27358
  if ((_settings_conditions = settings.conditions) == null ? void 0 : _settings_conditions.each) {
@@ -27380,12 +27378,12 @@ const executePins = async (settingsOrigin, context = {}, options = {
27380
27378
  if (typeof ((_itemSettings_conditions = itemSettings.conditions) == null ? void 0 : _itemSettings_conditions.if) !== 'undefined' && !itemSettings.conditions.if) {
27381
27379
  continue;
27382
27380
  }
27383
- const itemResult = await executePins(itemSettingsOrigin, itemContext, options);
27381
+ const itemResult = await executePins(itemSettingsOrigin, itemContext);
27384
27382
  results.push(itemResult);
27385
27383
  }
27386
27384
  return results;
27387
27385
  }
27388
- const version = options.libraries[settings.library] || 'latest';
27386
+ const version = context.config.VERSIONS[settings.library] || 'latest';
27389
27387
  const library = _config.LIBRARIES[settings.library] || (typeof window === 'undefined' ? require(settings.library) : await import(`${_config.BASE_URL}/${settings.library}@${version}/index.esm.js`));
27390
27388
  const pins = library == null ? void 0 : library[settings.element];
27391
27389
  if (!pins) {
@@ -27393,9 +27391,7 @@ const executePins = async (settingsOrigin, context = {}, options = {
27393
27391
  }
27394
27392
  return await pins(settings.properties, settings.pins, context);
27395
27393
  };
27396
- const executePinsList = async (pinsSettingsList, context, options = {
27397
- libraries: {}
27398
- })=>{
27394
+ const executePinsList = async (pinsSettingsList, context)=>{
27399
27395
  let previous = {};
27400
27396
  const steps = [];
27401
27397
  // parcourir tous les pins
@@ -27416,7 +27412,7 @@ const executePinsList = async (pinsSettingsList, context, options = {
27416
27412
  steps: context.steps,
27417
27413
  parent: context.parent
27418
27414
  }
27419
- }), options);
27415
+ }));
27420
27416
  steps[i] = {
27421
27417
  name: settings.name,
27422
27418
  result: previous
@@ -27424,9 +27420,7 @@ const executePinsList = async (pinsSettingsList, context, options = {
27424
27420
  }
27425
27421
  return previous;
27426
27422
  };
27427
- const generateElementFromPins = async (pinsSettings, parent, context, options = {
27428
- libraries: {}
27429
- })=>{
27423
+ const generateElementFromPins = async (pinsSettings, parent, context)=>{
27430
27424
  var _settings_conditions, _settings_conditions1;
27431
27425
  const settings = await preparePinsSettings(pinsSettings, context);
27432
27426
  if ((_settings_conditions = settings.conditions) == null ? void 0 : _settings_conditions.each) {
@@ -27444,7 +27438,7 @@ const generateElementFromPins = async (pinsSettings, parent, context, options =
27444
27438
  index: item.index,
27445
27439
  parent: context.parent
27446
27440
  }
27447
- }), options);
27441
+ }));
27448
27442
  }
27449
27443
  return;
27450
27444
  }
@@ -27455,7 +27449,7 @@ const generateElementFromPins = async (pinsSettings, parent, context, options =
27455
27449
  element.setAttribute('data-digipair-pins', '');
27456
27450
  const library = pinsSettings.library;
27457
27451
  if (library !== 'web' && !_config.LIBRARIES[library]) {
27458
- const version = options.libraries[library] || 'latest';
27452
+ const version = context.config.VERSIONS[library] || 'latest';
27459
27453
  import(`${_config.BASE_URL}/${library}@${version}/index.esm.js`);
27460
27454
  }
27461
27455
  Object.entries(settings.properties || {}).forEach(([key, value])=>{
@@ -27473,13 +27467,13 @@ const generateElementFromPins = async (pinsSettings, parent, context, options =
27473
27467
  const event = _event;
27474
27468
  executePinsList(pinsList, _extends({}, context, {
27475
27469
  event: event.detail
27476
- }), options);
27470
+ }));
27477
27471
  });
27478
27472
  });
27479
27473
  const pinsList = settings.pins || [];
27480
27474
  for(let i = 0; i < pinsList.length; i++){
27481
27475
  const item = pinsList[i];
27482
- await generateElementFromPins(item, element, context, options);
27476
+ await generateElementFromPins(item, element, context);
27483
27477
  }
27484
27478
  parent == null ? void 0 : parent.appendChild(element);
27485
27479
  return element;
@@ -4,15 +4,7 @@ export declare const config: {
4
4
  set: (key: CONFIG_KEY, value: any) => void;
5
5
  };
6
6
  export declare const applyTemplate: (value: any, context: any) => any;
7
- export declare const executePinsList: (pinsSettingsList: PinsSettings[], context: any, options?: {
8
- libraries: {
9
- [key: string]: string;
10
- };
11
- }) => Promise<any>;
12
- export declare const generateElementFromPins: (pinsSettings: PinsSettings, parent: Element, context: any, options?: {
13
- libraries: {
14
- [key: string]: string;
15
- };
16
- }) => Promise<Element | void>;
7
+ export declare const executePinsList: (pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
8
+ export declare const generateElementFromPins: (pinsSettings: PinsSettings, parent: Element, context: any) => Promise<Element | void>;
17
9
  export declare const preparePinsSettings: (settings: PinsSettings, context: any) => Promise<PinsSettings>;
18
10
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/engine",
3
- "version": "0.10.5",
3
+ "version": "0.10.6",
4
4
  "dependencies": {},
5
5
  "typings": "./index.d.ts",
6
6
  "main": "./index.cjs.js",