@digipair/skill-web-notification 0.32.7 → 0.33.0

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 tokens = tokens1, nextMatch = nextMatch1, i = i1, {
23514
+ return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
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 tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
23521
+ return i = i1, nextMatch = nextMatch1, tokens = tokens1, "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 tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
23540
+ return i = i1, nextMatch = nextMatch1, tokens = tokens1, "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 tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
23559
+ return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23560
23560
  }
23561
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
23561
+ return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
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)=>{
@@ -27385,7 +27386,13 @@ const applyTemplate = (value, context)=>{
27385
27386
  };
27386
27387
  const executePins = async (settingsOrigin, context = {})=>{
27387
27388
  var _settings_conditions, _settings_conditions1;
27388
- const settings = await preparePinsSettings(settingsOrigin, context);
27389
+ let settings = await preparePinsSettings(settingsOrigin, context);
27390
+ const alias = _config.ALIAS.find((alias)=>settings.library.split(':')[0] === alias.name);
27391
+ if (alias) {
27392
+ settings = await preparePinsSettings(_extends({}, settings, alias), {
27393
+ settings
27394
+ });
27395
+ }
27389
27396
  if ((_settings_conditions = settings.conditions) == null ? void 0 : _settings_conditions.each) {
27390
27397
  const results = [];
27391
27398
  for(let index = 0; index < settings.conditions.each.length; index++){
package/index.esm.js CHANGED
@@ -23489,14 +23489,14 @@ function indent(str, spaces) {
23489
23489
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23490
23490
  // match is required
23491
23491
  if (!match) {
23492
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
23492
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
23493
23493
  v: nextMatch1
23494
23494
  };
23495
23495
  }
23496
23496
  var token = match.token, offset = match.offset;
23497
23497
  i1 += offset;
23498
23498
  if (token === " ") {
23499
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23499
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23500
23500
  }
23501
23501
  tokens1 = _to_consumable_array$1(tokens1).concat([
23502
23502
  token
@@ -23515,7 +23515,7 @@ function indent(str, spaces) {
23515
23515
  if (contextKeys.some(function(el) {
23516
23516
  return el.startsWith(name);
23517
23517
  })) {
23518
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23518
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23519
23519
  }
23520
23520
  if (dateTimeIdentifiers.some(function(el) {
23521
23521
  return el === name;
@@ -23534,9 +23534,9 @@ function indent(str, spaces) {
23534
23534
  if (dateTimeIdentifiers.some(function(el) {
23535
23535
  return el.startsWith(name);
23536
23536
  })) {
23537
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23537
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23538
23538
  }
23539
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
23539
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
23540
23540
  v: nextMatch1
23541
23541
  };
23542
23542
  };
@@ -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)=>{
@@ -27363,7 +27364,13 @@ const applyTemplate = (value, context)=>{
27363
27364
  };
27364
27365
  const executePins = async (settingsOrigin, context = {})=>{
27365
27366
  var _settings_conditions, _settings_conditions1;
27366
- const settings = await preparePinsSettings(settingsOrigin, context);
27367
+ let settings = await preparePinsSettings(settingsOrigin, context);
27368
+ const alias = _config.ALIAS.find((alias)=>settings.library.split(':')[0] === alias.name);
27369
+ if (alias) {
27370
+ settings = await preparePinsSettings(_extends({}, settings, alias), {
27371
+ settings
27372
+ });
27373
+ }
27367
27374
  if ((_settings_conditions = settings.conditions) == null ? void 0 : _settings_conditions.each) {
27368
27375
  const results = [];
27369
27376
  for(let index = 0; index < settings.conditions.each.length; 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/skill-web-notification",
3
- "version": "0.32.7",
3
+ "version": "0.33.0",
4
4
  "dependencies": {},
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js"
package/schema.en.json DELETED
@@ -1,115 +0,0 @@
1
- {
2
- "openapi": "3.0.0",
3
- "info": {
4
- "title": "@digipair/skill-web-notification",
5
- "summary": "Display of notifications",
6
- "description": "Display of notifications on a web page",
7
- "version": "0.1.0",
8
- "x-icon": "🔔"
9
- },
10
- "paths": {
11
- "/information": {
12
- "post": {
13
- "tags": ["web"],
14
- "summary": "Displays an information",
15
- "description": "Displays an information notification",
16
- "parameters": [
17
- {
18
- "name": "message",
19
- "summary": "Message",
20
- "required": true,
21
- "description": "Message to display",
22
- "schema": {
23
- "type": "string"
24
- }
25
- }
26
- ],
27
- "x-events": []
28
- }
29
- },
30
- "/error": {
31
- "post": {
32
- "tags": ["web"],
33
- "summary": "Displays an error",
34
- "description": "Displays an error notification",
35
- "parameters": [
36
- {
37
- "name": "message",
38
- "summary": "Message",
39
- "required": true,
40
- "description": "Message to display",
41
- "schema": {
42
- "type": "string"
43
- }
44
- }
45
- ],
46
- "x-events": []
47
- }
48
- },
49
- "/confirm": {
50
- "post": {
51
- "tags": ["web"],
52
- "summary": "Displays a confirmation",
53
- "description": "Displays a confirmation notification",
54
- "parameters": [
55
- {
56
- "name": "message",
57
- "summary": "Message",
58
- "required": true,
59
- "description": "Message to display",
60
- "schema": {
61
- "type": "string"
62
- }
63
- },
64
- {
65
- "name": "ok",
66
- "summary": "If confirmed",
67
- "required": false,
68
- "description": "Actions to perform if confirmed",
69
- "schema": {
70
- "type": "array",
71
- "items": {
72
- "$ref": "https://schemas.digipair.ai/pinsSettings"
73
- }
74
- }
75
- },
76
- {
77
- "name": "ko",
78
- "summary": "Otherwise",
79
- "required": false,
80
- "description": "Actions to perform if not confirmed",
81
- "schema": {
82
- "type": "array",
83
- "items": {
84
- "$ref": "https://schemas.digipair.ai/pinsSettings"
85
- }
86
- }
87
- }
88
- ],
89
- "x-events": []
90
- }
91
- },
92
- "/alert": {
93
- "post": {
94
- "tags": ["web"],
95
- "summary": "Displays an alert",
96
- "description": "Displays an alert notification",
97
- "parameters": [
98
- {
99
- "name": "message",
100
- "summary": "Message",
101
- "required": true,
102
- "description": "Message to display",
103
- "schema": {
104
- "type": "string"
105
- }
106
- }
107
- ],
108
- "x-events": []
109
- }
110
- }
111
- },
112
- "components": {
113
- "schemas": {}
114
- }
115
- }