@digipair/engine 0.15.4 → 0.16.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 +8 -7
- package/index.esm.js +8 -7
- package/package.json +1 -1
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
|
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
|
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
|
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
|
23558
|
+
return nextMatch = nextMatch1, tokens = tokens1, i = i1, "continue";
|
23559
23559
|
}
|
23560
|
-
return
|
23560
|
+
return nextMatch = nextMatch1, tokens = tokens1, i = i1, {
|
23561
23561
|
v: nextMatch1
|
23562
23562
|
};
|
23563
23563
|
};
|
@@ -27348,6 +27348,7 @@ const _config = globalInstance.__DIGIPAIR_CONFIG__ = (_globalInstance___DIGIPAIR
|
|
27348
27348
|
LIBRARIES: {},
|
27349
27349
|
BASE_URL: 'https://cdn.jsdelivr.net/npm'
|
27350
27350
|
};
|
27351
|
+
const isRemoteVersion = /^https?:\/\/[^\s/$.?#].[^\s]*$/;
|
27351
27352
|
const isPinsSettings = (value)=>{
|
27352
27353
|
return typeof value === 'object' && value !== null && typeof value.element === 'string' && typeof value.library === 'string';
|
27353
27354
|
};
|
@@ -27409,7 +27410,7 @@ const executePins = async (settingsOrigin, context = {})=>{
|
|
27409
27410
|
return results;
|
27410
27411
|
}
|
27411
27412
|
const version = context.config.VERSIONS[settings.library] || 'latest';
|
27412
|
-
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`));
|
27413
|
+
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)); }); })(isRemoteVersion.test(version) ? `${version}` : `${_config.BASE_URL}/${settings.library}@${version}/index.esm.js`));
|
27413
27414
|
const pins = library == null ? void 0 : library[settings.element];
|
27414
27415
|
if (!pins) {
|
27415
27416
|
throw new Error(`Element ${settings.element} not found in library ${settings.library}`);
|
@@ -27475,7 +27476,7 @@ const generateElementFromPins = async (pinsSettings, parent, context)=>{
|
|
27475
27476
|
const library = pinsSettings.library;
|
27476
27477
|
if (library !== 'web' && !_config.LIBRARIES[library]) {
|
27477
27478
|
const version = context.config.VERSIONS[library] || 'latest';
|
27478
|
-
(function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(`${_config.BASE_URL}/${library}@${version}/index.esm.js`);
|
27479
|
+
(function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(isRemoteVersion.test(version) ? `${version}` : `${_config.BASE_URL}/${library}@${version}/index.esm.js`);
|
27479
27480
|
}
|
27480
27481
|
Object.entries(settings.properties || {}).forEach(([key, value])=>{
|
27481
27482
|
if (key === 'textContent') {
|
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 nextMatch = nextMatch1,
|
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 nextMatch = nextMatch1,
|
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 nextMatch = nextMatch1,
|
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 nextMatch = nextMatch1,
|
23536
|
+
return nextMatch = nextMatch1, tokens = tokens1, i = i1, "continue";
|
23537
23537
|
}
|
23538
|
-
return nextMatch = nextMatch1,
|
23538
|
+
return nextMatch = nextMatch1, tokens = tokens1, i = i1, {
|
23539
23539
|
v: nextMatch1
|
23540
23540
|
};
|
23541
23541
|
};
|
@@ -27326,6 +27326,7 @@ const _config = globalInstance.__DIGIPAIR_CONFIG__ = (_globalInstance___DIGIPAIR
|
|
27326
27326
|
LIBRARIES: {},
|
27327
27327
|
BASE_URL: 'https://cdn.jsdelivr.net/npm'
|
27328
27328
|
};
|
27329
|
+
const isRemoteVersion = /^https?:\/\/[^\s/$.?#].[^\s]*$/;
|
27329
27330
|
const isPinsSettings = (value)=>{
|
27330
27331
|
return typeof value === 'object' && value !== null && typeof value.element === 'string' && typeof value.library === 'string';
|
27331
27332
|
};
|
@@ -27387,7 +27388,7 @@ const executePins = async (settingsOrigin, context = {})=>{
|
|
27387
27388
|
return results;
|
27388
27389
|
}
|
27389
27390
|
const version = context.config.VERSIONS[settings.library] || 'latest';
|
27390
|
-
const library = _config.LIBRARIES[settings.library] || (typeof window === 'undefined' ? require(settings.library) : await import(`${_config.BASE_URL}/${settings.library}@${version}/index.esm.js`));
|
27391
|
+
const library = _config.LIBRARIES[settings.library] || (typeof window === 'undefined' ? require(settings.library) : await import(isRemoteVersion.test(version) ? `${version}` : `${_config.BASE_URL}/${settings.library}@${version}/index.esm.js`));
|
27391
27392
|
const pins = library == null ? void 0 : library[settings.element];
|
27392
27393
|
if (!pins) {
|
27393
27394
|
throw new Error(`Element ${settings.element} not found in library ${settings.library}`);
|
@@ -27453,7 +27454,7 @@ const generateElementFromPins = async (pinsSettings, parent, context)=>{
|
|
27453
27454
|
const library = pinsSettings.library;
|
27454
27455
|
if (library !== 'web' && !_config.LIBRARIES[library]) {
|
27455
27456
|
const version = context.config.VERSIONS[library] || 'latest';
|
27456
|
-
import(`${_config.BASE_URL}/${library}@${version}/index.esm.js`);
|
27457
|
+
import(isRemoteVersion.test(version) ? `${version}` : `${_config.BASE_URL}/${library}@${version}/index.esm.js`);
|
27457
27458
|
}
|
27458
27459
|
Object.entries(settings.properties || {}).forEach(([key, value])=>{
|
27459
27460
|
if (key === 'textContent') {
|