@digipair/engine 0.32.7 → 0.33.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/index.cjs.js CHANGED
@@ -23511,14 +23511,14 @@ function indent(str, spaces) {
23511
23511
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23512
23512
  // match is required
23513
23513
  if (!match) {
23514
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
23514
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
23515
23515
  v: nextMatch1
23516
23516
  };
23517
23517
  }
23518
23518
  var token = match.token, offset = match.offset;
23519
23519
  i1 += offset;
23520
23520
  if (token === " ") {
23521
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23521
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23522
23522
  }
23523
23523
  tokens1 = _to_consumable_array$1(tokens1).concat([
23524
23524
  token
@@ -23537,7 +23537,7 @@ function indent(str, spaces) {
23537
23537
  if (contextKeys.some(function(el) {
23538
23538
  return el.startsWith(name);
23539
23539
  })) {
23540
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23540
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23541
23541
  }
23542
23542
  if (dateTimeIdentifiers.some(function(el) {
23543
23543
  return el === name;
@@ -23556,9 +23556,9 @@ function indent(str, spaces) {
23556
23556
  if (dateTimeIdentifiers.some(function(el) {
23557
23557
  return el.startsWith(name);
23558
23558
  })) {
23559
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23559
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23560
23560
  }
23561
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
23561
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
23562
23562
  v: nextMatch1
23563
23563
  };
23564
23564
  };
@@ -27348,7 +27348,8 @@ const globalInstance = typeof window === 'undefined' ? global : window;
27348
27348
  var _globalInstance___DIGIPAIR_CONFIG__;
27349
27349
  const _config = globalInstance.__DIGIPAIR_CONFIG__ = (_globalInstance___DIGIPAIR_CONFIG__ = globalInstance.__DIGIPAIR_CONFIG__) != null ? _globalInstance___DIGIPAIR_CONFIG__ : {
27350
27350
  LIBRARIES: {},
27351
- BASE_URL: 'https://cdn.jsdelivr.net/npm'
27351
+ BASE_URL: 'https://cdn.jsdelivr.net/npm',
27352
+ ALIAS: []
27352
27353
  };
27353
27354
  const isRemoteVersion = /^https?:\/\/[^\s/$.?#].[^\s]*$/;
27354
27355
  const isPinsSettings = (value)=>{
@@ -27390,7 +27391,15 @@ const applyTemplate = (value, context)=>{
27390
27391
  };
27391
27392
  const executePins = async (settingsOrigin, context = {})=>{
27392
27393
  var _settings_conditions, _settings_conditions1;
27393
- const settings = await preparePinsSettings(settingsOrigin, context);
27394
+ let settings = await preparePinsSettings(settingsOrigin, context);
27395
+ const alias = _config.ALIAS.find((alias)=>settings.library.split(':')[0] === alias.name);
27396
+ if (alias) {
27397
+ settings = await preparePinsSettings(_extends({}, settings, alias), {
27398
+ settings: _extends({}, settings, {
27399
+ library: settings.library.substring(alias.name.length + 1)
27400
+ })
27401
+ });
27402
+ }
27394
27403
  if ((_settings_conditions = settings.conditions) == null ? void 0 : _settings_conditions.each) {
27395
27404
  const results = [];
27396
27405
  for(let index = 0; index < settings.conditions.each.length; index++){
@@ -27463,7 +27472,13 @@ const executePinsList = async (pinsSettingsList, context)=>{
27463
27472
  };
27464
27473
  const generateElementFromPins = async (pinsSettings, parent, context)=>{
27465
27474
  var _settings_conditions, _settings_conditions1;
27466
- const settings = await preparePinsSettings(pinsSettings, context);
27475
+ let settings = await preparePinsSettings(pinsSettings, context);
27476
+ const alias = _config.ALIAS.find((alias)=>settings.library.split(':')[0] === alias.name);
27477
+ if (alias) {
27478
+ settings = await preparePinsSettings(_extends({}, settings, alias), {
27479
+ settings
27480
+ });
27481
+ }
27467
27482
  if ((_settings_conditions = settings.conditions) == null ? void 0 : _settings_conditions.each) {
27468
27483
  for(let index = 0; index < settings.conditions.each.length; index++){
27469
27484
  const item = settings.conditions.each[index];
package/index.esm.js CHANGED
@@ -27326,7 +27326,8 @@ const globalInstance = typeof window === 'undefined' ? global : window;
27326
27326
  var _globalInstance___DIGIPAIR_CONFIG__;
27327
27327
  const _config = globalInstance.__DIGIPAIR_CONFIG__ = (_globalInstance___DIGIPAIR_CONFIG__ = globalInstance.__DIGIPAIR_CONFIG__) != null ? _globalInstance___DIGIPAIR_CONFIG__ : {
27328
27328
  LIBRARIES: {},
27329
- BASE_URL: 'https://cdn.jsdelivr.net/npm'
27329
+ BASE_URL: 'https://cdn.jsdelivr.net/npm',
27330
+ ALIAS: []
27330
27331
  };
27331
27332
  const isRemoteVersion = /^https?:\/\/[^\s/$.?#].[^\s]*$/;
27332
27333
  const isPinsSettings = (value)=>{
@@ -27368,7 +27369,15 @@ const applyTemplate = (value, context)=>{
27368
27369
  };
27369
27370
  const executePins = async (settingsOrigin, context = {})=>{
27370
27371
  var _settings_conditions, _settings_conditions1;
27371
- const settings = await preparePinsSettings(settingsOrigin, context);
27372
+ let settings = await preparePinsSettings(settingsOrigin, context);
27373
+ const alias = _config.ALIAS.find((alias)=>settings.library.split(':')[0] === alias.name);
27374
+ if (alias) {
27375
+ settings = await preparePinsSettings(_extends({}, settings, alias), {
27376
+ settings: _extends({}, settings, {
27377
+ library: settings.library.substring(alias.name.length + 1)
27378
+ })
27379
+ });
27380
+ }
27372
27381
  if ((_settings_conditions = settings.conditions) == null ? void 0 : _settings_conditions.each) {
27373
27382
  const results = [];
27374
27383
  for(let index = 0; index < settings.conditions.each.length; index++){
@@ -27441,7 +27450,13 @@ const executePinsList = async (pinsSettingsList, context)=>{
27441
27450
  };
27442
27451
  const generateElementFromPins = async (pinsSettings, parent, context)=>{
27443
27452
  var _settings_conditions, _settings_conditions1;
27444
- const settings = await preparePinsSettings(pinsSettings, context);
27453
+ let settings = await preparePinsSettings(pinsSettings, context);
27454
+ const alias = _config.ALIAS.find((alias)=>settings.library.split(':')[0] === alias.name);
27455
+ if (alias) {
27456
+ settings = await preparePinsSettings(_extends({}, settings, alias), {
27457
+ settings
27458
+ });
27459
+ }
27445
27460
  if ((_settings_conditions = settings.conditions) == null ? void 0 : _settings_conditions.each) {
27446
27461
  for(let index = 0; index < settings.conditions.each.length; index++){
27447
27462
  const item = settings.conditions.each[index];
@@ -0,0 +1,9 @@
1
+ export interface Alias {
2
+ name: string;
3
+ library: string;
4
+ element: string;
5
+ properties: {
6
+ library: string;
7
+ element: string;
8
+ };
9
+ }
@@ -1,5 +1,5 @@
1
1
  import { PinsSettings } from './pins-settings.interface';
2
- type CONFIG_KEY = 'BASE_URL' | 'LIBRARIES';
2
+ type CONFIG_KEY = 'BASE_URL' | 'LIBRARIES' | 'ALIAS';
3
3
  export declare const config: {
4
4
  set: (key: CONFIG_KEY, value: any) => void;
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/engine",
3
- "version": "0.32.7",
3
+ "version": "0.33.1",
4
4
  "dependencies": {},
5
5
  "typings": "./index.d.ts",
6
6
  "main": "./index.cjs.js",
package/schema.en.json DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "openapi": "3.0.0",
3
- "info": {
4
- "title": "@digipair/engine",
5
- "summary": "Pin Management",
6
- "description": "Digipair's Pin Engine.",
7
- "version": "0.1.0",
8
- "x-icon": "🚀"
9
- },
10
- "paths": {},
11
- "components": {
12
- "schemas": {}
13
- }
14
- }