@digipair/engine 0.48.1 → 0.48.3
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 +6 -4
- package/index.esm.js +11 -9
- package/package.json +1 -1
- package/src/lib/engine.d.ts +3 -1
package/index.cjs.js
CHANGED
@@ -8281,7 +8281,9 @@ const executePinsList = async (pinsSettingsList, context)=>{
|
|
8281
8281
|
}
|
8282
8282
|
return previous;
|
8283
8283
|
};
|
8284
|
-
const generateElementFromPins = async (pinsSettings, parent, context
|
8284
|
+
const generateElementFromPins = async (pinsSettings, parent, context, document = typeof window !== 'undefined' ? window.document : global.document, options = {
|
8285
|
+
import: true
|
8286
|
+
})=>{
|
8285
8287
|
var _settings_conditions, _settings_conditions1;
|
8286
8288
|
let settings = await preparePinsSettings(pinsSettings, context);
|
8287
8289
|
const alias = _config.ALIAS.find((alias)=>settings.library.split(':')[0] === alias.name);
|
@@ -8305,7 +8307,7 @@ const generateElementFromPins = async (pinsSettings, parent, context)=>{
|
|
8305
8307
|
index: context.index,
|
8306
8308
|
parent: context.parent
|
8307
8309
|
}
|
8308
|
-
}));
|
8310
|
+
}), document, options);
|
8309
8311
|
}
|
8310
8312
|
return;
|
8311
8313
|
}
|
@@ -8315,7 +8317,7 @@ const generateElementFromPins = async (pinsSettings, parent, context)=>{
|
|
8315
8317
|
const element = document.createElement(pinsSettings.element);
|
8316
8318
|
element.setAttribute('data-digipair-pins', '');
|
8317
8319
|
const library = pinsSettings.library;
|
8318
|
-
if (library !== 'web' && !_config.LIBRARIES[library]) {
|
8320
|
+
if (options.import && library !== 'web' && !_config.LIBRARIES[library]) {
|
8319
8321
|
const config = context.config || {};
|
8320
8322
|
const version = (config.VERSIONS || {})[library] || 'latest';
|
8321
8323
|
(function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(isRemoteVersion.test(version) ? `${version}` : `${_config.BASE_URL}/${library}@${version}/index.esm.js`);
|
@@ -8342,7 +8344,7 @@ const generateElementFromPins = async (pinsSettings, parent, context)=>{
|
|
8342
8344
|
const pinsList = settings.pins || [];
|
8343
8345
|
for(let i = 0; i < pinsList.length; i++){
|
8344
8346
|
const item = pinsList[i];
|
8345
|
-
await generateElementFromPins(item, element, context);
|
8347
|
+
await generateElementFromPins(item, element, context, document, options);
|
8346
8348
|
}
|
8347
8349
|
parent == null ? void 0 : parent.appendChild(element);
|
8348
8350
|
return element;
|
package/index.esm.js
CHANGED
@@ -23899,14 +23899,14 @@ function indent(str, spaces) {
|
|
23899
23899
|
var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
|
23900
23900
|
// match is required
|
23901
23901
|
if (!match) {
|
23902
|
-
return
|
23902
|
+
return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
|
23903
23903
|
v: nextMatch1
|
23904
23904
|
};
|
23905
23905
|
}
|
23906
23906
|
var token = match.token, offset = match.offset;
|
23907
23907
|
i1 += offset;
|
23908
23908
|
if (token === " ") {
|
23909
|
-
return
|
23909
|
+
return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
|
23910
23910
|
}
|
23911
23911
|
tokens1 = _to_consumable_array$1(tokens1).concat([
|
23912
23912
|
token
|
@@ -23925,7 +23925,7 @@ function indent(str, spaces) {
|
|
23925
23925
|
if (contextKeys.some(function(el) {
|
23926
23926
|
return el.startsWith(name);
|
23927
23927
|
})) {
|
23928
|
-
return
|
23928
|
+
return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
|
23929
23929
|
}
|
23930
23930
|
if (dateTimeIdentifiers.some(function(el) {
|
23931
23931
|
return el === name;
|
@@ -23944,9 +23944,9 @@ function indent(str, spaces) {
|
|
23944
23944
|
if (dateTimeIdentifiers.some(function(el) {
|
23945
23945
|
return el.startsWith(name);
|
23946
23946
|
})) {
|
23947
|
-
return
|
23947
|
+
return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
|
23948
23948
|
}
|
23949
|
-
return
|
23949
|
+
return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
|
23950
23950
|
v: nextMatch1
|
23951
23951
|
};
|
23952
23952
|
};
|
@@ -27939,7 +27939,9 @@ const executePinsList = async (pinsSettingsList, context)=>{
|
|
27939
27939
|
}
|
27940
27940
|
return previous;
|
27941
27941
|
};
|
27942
|
-
const generateElementFromPins = async (pinsSettings, parent, context
|
27942
|
+
const generateElementFromPins = async (pinsSettings, parent, context, document = typeof window !== 'undefined' ? window.document : global.document, options = {
|
27943
|
+
import: true
|
27944
|
+
})=>{
|
27943
27945
|
var _settings_conditions, _settings_conditions1;
|
27944
27946
|
let settings = await preparePinsSettings(pinsSettings, context);
|
27945
27947
|
const alias = _config.ALIAS.find((alias)=>settings.library.split(':')[0] === alias.name);
|
@@ -27963,7 +27965,7 @@ const generateElementFromPins = async (pinsSettings, parent, context)=>{
|
|
27963
27965
|
index: context.index,
|
27964
27966
|
parent: context.parent
|
27965
27967
|
}
|
27966
|
-
}));
|
27968
|
+
}), document, options);
|
27967
27969
|
}
|
27968
27970
|
return;
|
27969
27971
|
}
|
@@ -27973,7 +27975,7 @@ const generateElementFromPins = async (pinsSettings, parent, context)=>{
|
|
27973
27975
|
const element = document.createElement(pinsSettings.element);
|
27974
27976
|
element.setAttribute('data-digipair-pins', '');
|
27975
27977
|
const library = pinsSettings.library;
|
27976
|
-
if (library !== 'web' && !_config.LIBRARIES[library]) {
|
27978
|
+
if (options.import && library !== 'web' && !_config.LIBRARIES[library]) {
|
27977
27979
|
const config = context.config || {};
|
27978
27980
|
const version = (config.VERSIONS || {})[library] || 'latest';
|
27979
27981
|
import(isRemoteVersion.test(version) ? `${version}` : `${_config.BASE_URL}/${library}@${version}/index.esm.js`);
|
@@ -28000,7 +28002,7 @@ const generateElementFromPins = async (pinsSettings, parent, context)=>{
|
|
28000
28002
|
const pinsList = settings.pins || [];
|
28001
28003
|
for(let i = 0; i < pinsList.length; i++){
|
28002
28004
|
const item = pinsList[i];
|
28003
|
-
await generateElementFromPins(item, element, context);
|
28005
|
+
await generateElementFromPins(item, element, context, document, options);
|
28004
28006
|
}
|
28005
28007
|
parent == null ? void 0 : parent.appendChild(element);
|
28006
28008
|
return element;
|
package/package.json
CHANGED
package/src/lib/engine.d.ts
CHANGED
@@ -5,6 +5,8 @@ export declare const config: {
|
|
5
5
|
};
|
6
6
|
export declare const applyTemplate: (value: any, context: any) => any;
|
7
7
|
export declare const executePinsList: (pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
8
|
-
export declare const generateElementFromPins: (pinsSettings: PinsSettings, parent: Element, context: any
|
8
|
+
export declare const generateElementFromPins: (pinsSettings: PinsSettings, parent: Element, context: any, document?: Document, options?: {
|
9
|
+
import: boolean;
|
10
|
+
}) => Promise<Element | void>;
|
9
11
|
export declare const preparePinsSettings: (settings: PinsSettings, context: any) => Promise<PinsSettings>;
|
10
12
|
export {};
|