@digipair/engine 0.0.1 → 0.0.2

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.esm.js CHANGED
@@ -21047,6 +21047,7 @@ var lib = instance;
21047
21047
 
21048
21048
  var jsonpath = lib;
21049
21049
 
21050
+ // import { Experience } from './experience.interface';
21050
21051
  lib$1.registerHelper('JSONstringify', function(value) {
21051
21052
  return JSON.stringify(value);
21052
21053
  });
@@ -21084,7 +21085,7 @@ const applyTemplate = (value, context)=>{
21084
21085
  }
21085
21086
  return result;
21086
21087
  };
21087
- const executePins = async (settingsOrigin, context)=>{
21088
+ const executePins = async (settingsOrigin, context = {})=>{
21088
21089
  const settings = await preparePinsSettings(settingsOrigin, context);
21089
21090
  const version = 'latest'; // this.experience.libraries[library] || 'latest';
21090
21091
  var _config_PINS_settings_library;
@@ -21095,13 +21096,14 @@ const executePins = async (settingsOrigin, context)=>{
21095
21096
  message: `[CommandService:executePins] pins "${settings.library}:${settings.element}" not found`
21096
21097
  };
21097
21098
  };
21098
- const generateElementFromPins = async (experience, pinsSettings, context)=>{
21099
+ const generateElementFromPins = async (// experience: Experience,
21100
+ pinsSettings, context)=>{
21099
21101
  const element = document.createElement(pinsSettings.element);
21100
21102
  element.setAttribute('data-digipair-pins', '');
21101
21103
  const library = pinsSettings.library;
21102
21104
  if (library !== 'web') {
21103
- const version = experience.libraries[library] || 'latest';
21104
- import(`https://cdn.jsdelivr.net/npm/${library}@${version}`);
21105
+ const version = 'latest'; // experience.libraries[library] || 'latest';
21106
+ import(`${_config['BASE_URL']}${library}@${version}`);
21105
21107
  }
21106
21108
  const settings = await preparePinsSettings(pinsSettings, context);
21107
21109
  Object.entries(settings.properties || {}).forEach(([key, value])=>{
@@ -21125,7 +21127,7 @@ const generateElementFromPins = async (experience, pinsSettings, context)=>{
21125
21127
  const pinsList = settings.pins || [];
21126
21128
  for(let i = 0; i < pinsList.length; i++){
21127
21129
  const item = pinsList[i];
21128
- const child = await generateElementFromPins(experience, item, settings.context);
21130
+ const child = await generateElementFromPins(/*experience, */ item, settings.context);
21129
21131
  element.appendChild(child);
21130
21132
  }
21131
21133
  return element;
@@ -1,10 +1,9 @@
1
1
  import { PinsSettings } from './pins-settings.interface';
2
- import { Experience } from './experience.interface';
3
2
  export declare const config: {
4
3
  set: (key: string, value: any) => void;
5
4
  };
6
5
  export declare const applyTemplate: (value: any, context: any) => any;
7
- export declare const executePins: (settingsOrigin: PinsSettings, context: any) => Promise<any>;
8
- export declare const generateElementFromPins: (experience: Experience, pinsSettings: PinsSettings, context: any) => Promise<Element>;
6
+ export declare const executePins: (settingsOrigin: PinsSettings, context?: any) => Promise<any>;
7
+ export declare const generateElementFromPins: (pinsSettings: PinsSettings, context: any) => Promise<Element>;
9
8
  export declare const executePinsList: (pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
10
9
  export declare const preparePinsSettings: (settings: PinsSettings, context: any) => Promise<PinsSettings>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/engine",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "dependencies": {},
5
5
  "type": "module",
6
6
  "main": "./index.esm.js",
File without changes