@digipair/skill-canvas 0.32.6 → 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 +14 -7
- package/index.esm.js +14 -7
- package/libs/engine/src/lib/alias.interface.d.ts +9 -0
- package/libs/engine/src/lib/engine.d.ts +1 -1
- package/package.json +1 -1
- package/schema.en.json +0 -334
package/index.cjs.js
CHANGED
@@ -23513,14 +23513,14 @@ function indent(str, spaces) {
|
|
23513
23513
|
var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
|
23514
23514
|
// match is required
|
23515
23515
|
if (!match) {
|
23516
|
-
return
|
23516
|
+
return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
|
23517
23517
|
v: nextMatch1
|
23518
23518
|
};
|
23519
23519
|
}
|
23520
23520
|
var token = match.token, offset = match.offset;
|
23521
23521
|
i1 += offset;
|
23522
23522
|
if (token === " ") {
|
23523
|
-
return
|
23523
|
+
return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
|
23524
23524
|
}
|
23525
23525
|
tokens1 = _to_consumable_array$1(tokens1).concat([
|
23526
23526
|
token
|
@@ -23539,7 +23539,7 @@ function indent(str, spaces) {
|
|
23539
23539
|
if (contextKeys.some(function(el) {
|
23540
23540
|
return el.startsWith(name);
|
23541
23541
|
})) {
|
23542
|
-
return
|
23542
|
+
return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
|
23543
23543
|
}
|
23544
23544
|
if (dateTimeIdentifiers.some(function(el) {
|
23545
23545
|
return el === name;
|
@@ -23558,9 +23558,9 @@ function indent(str, spaces) {
|
|
23558
23558
|
if (dateTimeIdentifiers.some(function(el) {
|
23559
23559
|
return el.startsWith(name);
|
23560
23560
|
})) {
|
23561
|
-
return
|
23561
|
+
return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
|
23562
23562
|
}
|
23563
|
-
return
|
23563
|
+
return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
|
23564
23564
|
v: nextMatch1
|
23565
23565
|
};
|
23566
23566
|
};
|
@@ -27350,7 +27350,8 @@ const globalInstance = typeof window === 'undefined' ? global : window;
|
|
27350
27350
|
var _globalInstance___DIGIPAIR_CONFIG__;
|
27351
27351
|
const _config = globalInstance.__DIGIPAIR_CONFIG__ = (_globalInstance___DIGIPAIR_CONFIG__ = globalInstance.__DIGIPAIR_CONFIG__) != null ? _globalInstance___DIGIPAIR_CONFIG__ : {
|
27352
27352
|
LIBRARIES: {},
|
27353
|
-
BASE_URL: 'https://cdn.jsdelivr.net/npm'
|
27353
|
+
BASE_URL: 'https://cdn.jsdelivr.net/npm',
|
27354
|
+
ALIAS: []
|
27354
27355
|
};
|
27355
27356
|
const isRemoteVersion = /^https?:\/\/[^\s/$.?#].[^\s]*$/;
|
27356
27357
|
const isPinsSettings = (value)=>{
|
@@ -27387,7 +27388,13 @@ const applyTemplate = (value, context)=>{
|
|
27387
27388
|
};
|
27388
27389
|
const executePins = async (settingsOrigin, context = {})=>{
|
27389
27390
|
var _settings_conditions, _settings_conditions1;
|
27390
|
-
|
27391
|
+
let settings = await preparePinsSettings(settingsOrigin, context);
|
27392
|
+
const alias = _config.ALIAS.find((alias)=>settings.library.split(':')[0] === alias.name);
|
27393
|
+
if (alias) {
|
27394
|
+
settings = await preparePinsSettings(_extends({}, settings, alias), {
|
27395
|
+
settings
|
27396
|
+
});
|
27397
|
+
}
|
27391
27398
|
if ((_settings_conditions = settings.conditions) == null ? void 0 : _settings_conditions.each) {
|
27392
27399
|
const results = [];
|
27393
27400
|
for(let index = 0; index < settings.conditions.each.length; index++){
|
package/index.esm.js
CHANGED
@@ -23491,14 +23491,14 @@ function indent(str, spaces) {
|
|
23491
23491
|
var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
|
23492
23492
|
// match is required
|
23493
23493
|
if (!match) {
|
23494
|
-
return
|
23494
|
+
return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
|
23495
23495
|
v: nextMatch1
|
23496
23496
|
};
|
23497
23497
|
}
|
23498
23498
|
var token = match.token, offset = match.offset;
|
23499
23499
|
i1 += offset;
|
23500
23500
|
if (token === " ") {
|
23501
|
-
return
|
23501
|
+
return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
|
23502
23502
|
}
|
23503
23503
|
tokens1 = _to_consumable_array$1(tokens1).concat([
|
23504
23504
|
token
|
@@ -23517,7 +23517,7 @@ function indent(str, spaces) {
|
|
23517
23517
|
if (contextKeys.some(function(el) {
|
23518
23518
|
return el.startsWith(name);
|
23519
23519
|
})) {
|
23520
|
-
return
|
23520
|
+
return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
|
23521
23521
|
}
|
23522
23522
|
if (dateTimeIdentifiers.some(function(el) {
|
23523
23523
|
return el === name;
|
@@ -23536,9 +23536,9 @@ function indent(str, spaces) {
|
|
23536
23536
|
if (dateTimeIdentifiers.some(function(el) {
|
23537
23537
|
return el.startsWith(name);
|
23538
23538
|
})) {
|
23539
|
-
return
|
23539
|
+
return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
|
23540
23540
|
}
|
23541
|
-
return
|
23541
|
+
return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
|
23542
23542
|
v: nextMatch1
|
23543
23543
|
};
|
23544
23544
|
};
|
@@ -27328,7 +27328,8 @@ const globalInstance = typeof window === 'undefined' ? global : window;
|
|
27328
27328
|
var _globalInstance___DIGIPAIR_CONFIG__;
|
27329
27329
|
const _config = globalInstance.__DIGIPAIR_CONFIG__ = (_globalInstance___DIGIPAIR_CONFIG__ = globalInstance.__DIGIPAIR_CONFIG__) != null ? _globalInstance___DIGIPAIR_CONFIG__ : {
|
27330
27330
|
LIBRARIES: {},
|
27331
|
-
BASE_URL: 'https://cdn.jsdelivr.net/npm'
|
27331
|
+
BASE_URL: 'https://cdn.jsdelivr.net/npm',
|
27332
|
+
ALIAS: []
|
27332
27333
|
};
|
27333
27334
|
const isRemoteVersion = /^https?:\/\/[^\s/$.?#].[^\s]*$/;
|
27334
27335
|
const isPinsSettings = (value)=>{
|
@@ -27365,7 +27366,13 @@ const applyTemplate = (value, context)=>{
|
|
27365
27366
|
};
|
27366
27367
|
const executePins = async (settingsOrigin, context = {})=>{
|
27367
27368
|
var _settings_conditions, _settings_conditions1;
|
27368
|
-
|
27369
|
+
let settings = await preparePinsSettings(settingsOrigin, context);
|
27370
|
+
const alias = _config.ALIAS.find((alias)=>settings.library.split(':')[0] === alias.name);
|
27371
|
+
if (alias) {
|
27372
|
+
settings = await preparePinsSettings(_extends({}, settings, alias), {
|
27373
|
+
settings
|
27374
|
+
});
|
27375
|
+
}
|
27369
27376
|
if ((_settings_conditions = settings.conditions) == null ? void 0 : _settings_conditions.each) {
|
27370
27377
|
const results = [];
|
27371
27378
|
for(let index = 0; index < settings.conditions.each.length; index++){
|
package/package.json
CHANGED
package/schema.en.json
DELETED
@@ -1,334 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"openapi": "3.0.0",
|
3
|
-
"info": {
|
4
|
-
"title": "@digipair/skill-canvas",
|
5
|
-
"summary": "Drawing manipulation",
|
6
|
-
"description": "This skill allows users to manipulate a canvas to draw graphic elements, load images, and perform various drawing operations.",
|
7
|
-
"version": "0.1.0",
|
8
|
-
"x-icon": "🎨"
|
9
|
-
},
|
10
|
-
"paths": {
|
11
|
-
"/canvas": {
|
12
|
-
"post": {
|
13
|
-
"tags": ["service"],
|
14
|
-
"summary": "Create a canvas",
|
15
|
-
"description": "Creates a canvas with specified dimensions and executes drawing actions.",
|
16
|
-
"parameters": [
|
17
|
-
{
|
18
|
-
"name": "width",
|
19
|
-
"summary": "Width",
|
20
|
-
"required": true,
|
21
|
-
"description": "Width of the canvas",
|
22
|
-
"schema": {
|
23
|
-
"type": "number"
|
24
|
-
}
|
25
|
-
},
|
26
|
-
{
|
27
|
-
"name": "height",
|
28
|
-
"summary": "Height",
|
29
|
-
"required": true,
|
30
|
-
"description": "Height of the canvas",
|
31
|
-
"schema": {
|
32
|
-
"type": "number"
|
33
|
-
}
|
34
|
-
},
|
35
|
-
{
|
36
|
-
"name": "execute",
|
37
|
-
"summary": "Execute",
|
38
|
-
"required": true,
|
39
|
-
"description": "List of actions to execute on the canvas",
|
40
|
-
"schema": {
|
41
|
-
"type": "array",
|
42
|
-
"items": {
|
43
|
-
"$ref": "https://schemas.digipair.ai/pinsSettings"
|
44
|
-
}
|
45
|
-
}
|
46
|
-
}
|
47
|
-
],
|
48
|
-
"x-events": []
|
49
|
-
}
|
50
|
-
},
|
51
|
-
"/loadImage": {
|
52
|
-
"post": {
|
53
|
-
"tags": ["service"],
|
54
|
-
"summary": "Load an image",
|
55
|
-
"description": "Loads an image from a base64 string and returns the loaded image.",
|
56
|
-
"parameters": [
|
57
|
-
{
|
58
|
-
"name": "image",
|
59
|
-
"summary": "Image",
|
60
|
-
"required": true,
|
61
|
-
"description": "Image in base64",
|
62
|
-
"schema": {
|
63
|
-
"type": "string"
|
64
|
-
}
|
65
|
-
}
|
66
|
-
],
|
67
|
-
"x-events": []
|
68
|
-
}
|
69
|
-
},
|
70
|
-
"/drawImage": {
|
71
|
-
"post": {
|
72
|
-
"tags": ["service"],
|
73
|
-
"summary": "Draw an image",
|
74
|
-
"description": "Draws an image on the canvas at the specified coordinates.",
|
75
|
-
"parameters": [
|
76
|
-
{
|
77
|
-
"name": "image",
|
78
|
-
"summary": "Image",
|
79
|
-
"required": true,
|
80
|
-
"description": "Image to draw",
|
81
|
-
"schema": {
|
82
|
-
"type": "string"
|
83
|
-
}
|
84
|
-
},
|
85
|
-
{
|
86
|
-
"name": "x",
|
87
|
-
"summary": "X coordinate",
|
88
|
-
"required": true,
|
89
|
-
"description": "X coordinate to draw the image",
|
90
|
-
"schema": {
|
91
|
-
"type": "number"
|
92
|
-
}
|
93
|
-
},
|
94
|
-
{
|
95
|
-
"name": "y",
|
96
|
-
"summary": "Y coordinate",
|
97
|
-
"required": true,
|
98
|
-
"description": "Y coordinate to draw the image",
|
99
|
-
"schema": {
|
100
|
-
"type": "number"
|
101
|
-
}
|
102
|
-
},
|
103
|
-
{
|
104
|
-
"name": "width",
|
105
|
-
"summary": "Width",
|
106
|
-
"required": true,
|
107
|
-
"description": "Width of the image to draw",
|
108
|
-
"schema": {
|
109
|
-
"type": "number"
|
110
|
-
}
|
111
|
-
},
|
112
|
-
{
|
113
|
-
"name": "height",
|
114
|
-
"summary": "Height",
|
115
|
-
"required": true,
|
116
|
-
"description": "Height of the image to draw",
|
117
|
-
"schema": {
|
118
|
-
"type": "number"
|
119
|
-
}
|
120
|
-
}
|
121
|
-
],
|
122
|
-
"x-events": []
|
123
|
-
}
|
124
|
-
},
|
125
|
-
"/strokeRect": {
|
126
|
-
"post": {
|
127
|
-
"tags": ["service"],
|
128
|
-
"summary": "Draw an empty rectangle",
|
129
|
-
"description": "Draws the outline of a rectangle at the specified coordinates.",
|
130
|
-
"parameters": [
|
131
|
-
{
|
132
|
-
"name": "x",
|
133
|
-
"summary": "X coordinate",
|
134
|
-
"required": true,
|
135
|
-
"description": "X coordinate of the rectangle",
|
136
|
-
"schema": {
|
137
|
-
"type": "number"
|
138
|
-
}
|
139
|
-
},
|
140
|
-
{
|
141
|
-
"name": "y",
|
142
|
-
"summary": "Y coordinate",
|
143
|
-
"required": true,
|
144
|
-
"description": "Y coordinate of the rectangle",
|
145
|
-
"schema": {
|
146
|
-
"type": "number"
|
147
|
-
}
|
148
|
-
},
|
149
|
-
{
|
150
|
-
"name": "width",
|
151
|
-
"summary": "Width",
|
152
|
-
"required": true,
|
153
|
-
"description": "Width of the rectangle",
|
154
|
-
"schema": {
|
155
|
-
"type": "number"
|
156
|
-
}
|
157
|
-
},
|
158
|
-
{
|
159
|
-
"name": "height",
|
160
|
-
"summary": "Height",
|
161
|
-
"required": true,
|
162
|
-
"description": "Height of the rectangle",
|
163
|
-
"schema": {
|
164
|
-
"type": "number"
|
165
|
-
}
|
166
|
-
}
|
167
|
-
],
|
168
|
-
"x-events": []
|
169
|
-
}
|
170
|
-
},
|
171
|
-
"/fillRect": {
|
172
|
-
"post": {
|
173
|
-
"tags": ["service"],
|
174
|
-
"summary": "Draw a filled rectangle",
|
175
|
-
"description": "Draws a filled rectangle at the specified coordinates.",
|
176
|
-
"parameters": [
|
177
|
-
{
|
178
|
-
"name": "x",
|
179
|
-
"summary": "X coordinate",
|
180
|
-
"required": true,
|
181
|
-
"description": "X coordinate of the rectangle",
|
182
|
-
"schema": {
|
183
|
-
"type": "number"
|
184
|
-
}
|
185
|
-
},
|
186
|
-
{
|
187
|
-
"name": "y",
|
188
|
-
"summary": "Y coordinate",
|
189
|
-
"required": true,
|
190
|
-
"description": "Y coordinate of the rectangle",
|
191
|
-
"schema": {
|
192
|
-
"type": "number"
|
193
|
-
}
|
194
|
-
},
|
195
|
-
{
|
196
|
-
"name": "width",
|
197
|
-
"summary": "Width",
|
198
|
-
"required": true,
|
199
|
-
"description": "Width of the rectangle",
|
200
|
-
"schema": {
|
201
|
-
"type": "number"
|
202
|
-
}
|
203
|
-
},
|
204
|
-
{
|
205
|
-
"name": "height",
|
206
|
-
"summary": "Height",
|
207
|
-
"required": true,
|
208
|
-
"description": "Height of the rectangle",
|
209
|
-
"schema": {
|
210
|
-
"type": "number"
|
211
|
-
}
|
212
|
-
}
|
213
|
-
],
|
214
|
-
"x-events": []
|
215
|
-
}
|
216
|
-
},
|
217
|
-
"/fillText": {
|
218
|
-
"post": {
|
219
|
-
"tags": ["service"],
|
220
|
-
"summary": "Write text",
|
221
|
-
"description": "Writes text at the specified coordinates.",
|
222
|
-
"parameters": [
|
223
|
-
{
|
224
|
-
"name": "text",
|
225
|
-
"summary": "Text",
|
226
|
-
"required": true,
|
227
|
-
"description": "Text to draw",
|
228
|
-
"schema": {
|
229
|
-
"type": "string"
|
230
|
-
}
|
231
|
-
},
|
232
|
-
{
|
233
|
-
"name": "x",
|
234
|
-
"summary": "X coordinate",
|
235
|
-
"required": true,
|
236
|
-
"description": "X coordinate of the text",
|
237
|
-
"schema": {
|
238
|
-
"type": "number"
|
239
|
-
}
|
240
|
-
},
|
241
|
-
{
|
242
|
-
"name": "y",
|
243
|
-
"summary": "Y coordinate",
|
244
|
-
"required": true,
|
245
|
-
"description": "Y coordinate of the text",
|
246
|
-
"schema": {
|
247
|
-
"type": "number"
|
248
|
-
}
|
249
|
-
}
|
250
|
-
],
|
251
|
-
"x-events": []
|
252
|
-
}
|
253
|
-
},
|
254
|
-
"/strokeStyle": {
|
255
|
-
"post": {
|
256
|
-
"tags": ["service"],
|
257
|
-
"summary": "Set stroke style",
|
258
|
-
"description": "Sets the stroke style used for drawings.",
|
259
|
-
"parameters": [
|
260
|
-
{
|
261
|
-
"name": "style",
|
262
|
-
"summary": "Style",
|
263
|
-
"required": true,
|
264
|
-
"description": "Stroke style",
|
265
|
-
"schema": {
|
266
|
-
"type": "string"
|
267
|
-
}
|
268
|
-
}
|
269
|
-
],
|
270
|
-
"x-events": []
|
271
|
-
}
|
272
|
-
},
|
273
|
-
"/fillStyle": {
|
274
|
-
"post": {
|
275
|
-
"tags": ["service"],
|
276
|
-
"summary": "Set fill style",
|
277
|
-
"description": "Sets the fill style used for drawings.",
|
278
|
-
"parameters": [
|
279
|
-
{
|
280
|
-
"name": "style",
|
281
|
-
"summary": "Style",
|
282
|
-
"required": true,
|
283
|
-
"description": "Fill style",
|
284
|
-
"schema": {
|
285
|
-
"type": "string"
|
286
|
-
}
|
287
|
-
}
|
288
|
-
],
|
289
|
-
"x-events": []
|
290
|
-
}
|
291
|
-
},
|
292
|
-
"/lineWidth": {
|
293
|
-
"post": {
|
294
|
-
"tags": ["service"],
|
295
|
-
"summary": "Set line width",
|
296
|
-
"description": "Sets the line width used for drawings.",
|
297
|
-
"parameters": [
|
298
|
-
{
|
299
|
-
"name": "style",
|
300
|
-
"summary": "Width",
|
301
|
-
"required": true,
|
302
|
-
"description": "Line width",
|
303
|
-
"schema": {
|
304
|
-
"type": "number"
|
305
|
-
}
|
306
|
-
}
|
307
|
-
],
|
308
|
-
"x-events": []
|
309
|
-
}
|
310
|
-
},
|
311
|
-
"/measureText": {
|
312
|
-
"post": {
|
313
|
-
"tags": ["service"],
|
314
|
-
"summary": "Measure text",
|
315
|
-
"description": "Measures the specified text and returns the metrics.",
|
316
|
-
"parameters": [
|
317
|
-
{
|
318
|
-
"name": "text",
|
319
|
-
"summary": "Text",
|
320
|
-
"required": true,
|
321
|
-
"description": "Text to measure",
|
322
|
-
"schema": {
|
323
|
-
"type": "string"
|
324
|
-
}
|
325
|
-
}
|
326
|
-
],
|
327
|
-
"x-events": []
|
328
|
-
}
|
329
|
-
}
|
330
|
-
},
|
331
|
-
"components": {
|
332
|
-
"schemas": {}
|
333
|
-
}
|
334
|
-
}
|