@digipair/skill-web-editor 0.72.3 → 0.72.4
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/package.json +1 -1
- package/pins-to-blockly.cjs.js +11 -8
- package/pins-to-blockly.esm.js +11 -8
package/package.json
CHANGED
package/pins-to-blockly.cjs.js
CHANGED
@@ -255,11 +255,13 @@ function generateToolboxFromLibraries(libraries, tags) {
|
|
255
255
|
return toolbox;
|
256
256
|
}
|
257
257
|
function convertPinsLibrariesToBlocklyLibraries(pinsLibraries) {
|
258
|
-
return pinsLibraries.map((schema)=>
|
259
|
-
|
258
|
+
return pinsLibraries.map((schema)=>{
|
259
|
+
var _schema_paths;
|
260
|
+
return index._extends({}, schema, {
|
261
|
+
paths: index._extends({}, Object.entries((_schema_paths = schema.paths) != null ? _schema_paths : {}).reduce((acc, [key, path])=>index._extends({}, acc, {
|
260
262
|
[key]: index._extends({}, path, {
|
261
263
|
post: index._extends({}, path.post, {
|
262
|
-
parameters: [
|
264
|
+
parameters: !path.post.parameters ? [] : [
|
263
265
|
...path.post.parameters,
|
264
266
|
...path.post.parameters.filter((item)=>{
|
265
267
|
var _item_schema, _item_schema_items, _item_schema_items_$ref, _item_schema_items1;
|
@@ -276,10 +278,10 @@ function convertPinsLibrariesToBlocklyLibraries(pinsLibraries) {
|
|
276
278
|
})
|
277
279
|
})
|
278
280
|
}), {})),
|
279
|
-
components: index._extends({}, schema.components, {
|
281
|
+
components: !schema.components ? {} : index._extends({}, schema.components, {
|
280
282
|
schemas: index._extends({}, Object.entries(schema.components.schemas).reduce((acc, [key, component])=>index._extends({}, acc, {
|
281
283
|
[key]: index._extends({}, component, {
|
282
|
-
properties: index._extends({}, component.properties, Object.entries(component.properties).filter(([_propertyKey, propertyValue])=>{
|
284
|
+
properties: !component.properties ? {} : index._extends({}, component.properties, Object.entries(component.properties).filter(([_propertyKey, propertyValue])=>{
|
283
285
|
var _propertyValue_items, _propertyValue_items_$ref, _propertyValue_items1;
|
284
286
|
return propertyValue.type === 'array' && (((_propertyValue_items = propertyValue.items) == null ? void 0 : _propertyValue_items.$ref) === 'https://schemas.digipair.ai/pinsSettings' || ((_propertyValue_items1 = propertyValue.items) == null ? void 0 : (_propertyValue_items_$ref = _propertyValue_items1.$ref) == null ? void 0 : _propertyValue_items_$ref.includes('#/components/schemas/')));
|
285
287
|
}).reduce((acc, [propertyKey, property])=>index._extends({}, acc, {
|
@@ -292,7 +294,7 @@ function convertPinsLibrariesToBlocklyLibraries(pinsLibraries) {
|
|
292
294
|
}),
|
293
295
|
'x-scene-blocks': index._extends({}, Object.entries(schema.paths).reduce((acc, [key, path])=>index._extends({}, acc, {
|
294
296
|
[key]: index._extends({}, path, {
|
295
|
-
metadata: [
|
297
|
+
metadata: !path.metadata ? [] : [
|
296
298
|
...path.metadata,
|
297
299
|
...path.metadata.filter((item)=>{
|
298
300
|
var _item_schema, _item_schema_items, _item_schema_items_$ref, _item_schema_items1;
|
@@ -306,7 +308,7 @@ function convertPinsLibrariesToBlocklyLibraries(pinsLibraries) {
|
|
306
308
|
}
|
307
309
|
}))
|
308
310
|
],
|
309
|
-
parameters: [
|
311
|
+
parameters: !path.parameters ? [] : [
|
310
312
|
...path.parameters,
|
311
313
|
...path.parameters.filter((item)=>{
|
312
314
|
var _item_schema, _item_schema_items, _item_schema_items_$ref, _item_schema_items1;
|
@@ -322,7 +324,8 @@ function convertPinsLibrariesToBlocklyLibraries(pinsLibraries) {
|
|
322
324
|
]
|
323
325
|
})
|
324
326
|
}), {}))
|
325
|
-
})
|
327
|
+
});
|
328
|
+
});
|
326
329
|
}
|
327
330
|
function generateBlocklyBlockFromLibraries(pinsLibraries, blocksLegacy) {
|
328
331
|
const blocksLibrary = [
|
package/pins-to-blockly.esm.js
CHANGED
@@ -253,11 +253,13 @@ function generateToolboxFromLibraries(libraries, tags) {
|
|
253
253
|
return toolbox;
|
254
254
|
}
|
255
255
|
function convertPinsLibrariesToBlocklyLibraries(pinsLibraries) {
|
256
|
-
return pinsLibraries.map((schema)=>
|
257
|
-
|
256
|
+
return pinsLibraries.map((schema)=>{
|
257
|
+
var _schema_paths;
|
258
|
+
return _extends({}, schema, {
|
259
|
+
paths: _extends({}, Object.entries((_schema_paths = schema.paths) != null ? _schema_paths : {}).reduce((acc, [key, path])=>_extends({}, acc, {
|
258
260
|
[key]: _extends({}, path, {
|
259
261
|
post: _extends({}, path.post, {
|
260
|
-
parameters: [
|
262
|
+
parameters: !path.post.parameters ? [] : [
|
261
263
|
...path.post.parameters,
|
262
264
|
...path.post.parameters.filter((item)=>{
|
263
265
|
var _item_schema, _item_schema_items, _item_schema_items_$ref, _item_schema_items1;
|
@@ -274,10 +276,10 @@ function convertPinsLibrariesToBlocklyLibraries(pinsLibraries) {
|
|
274
276
|
})
|
275
277
|
})
|
276
278
|
}), {})),
|
277
|
-
components: _extends({}, schema.components, {
|
279
|
+
components: !schema.components ? {} : _extends({}, schema.components, {
|
278
280
|
schemas: _extends({}, Object.entries(schema.components.schemas).reduce((acc, [key, component])=>_extends({}, acc, {
|
279
281
|
[key]: _extends({}, component, {
|
280
|
-
properties: _extends({}, component.properties, Object.entries(component.properties).filter(([_propertyKey, propertyValue])=>{
|
282
|
+
properties: !component.properties ? {} : _extends({}, component.properties, Object.entries(component.properties).filter(([_propertyKey, propertyValue])=>{
|
281
283
|
var _propertyValue_items, _propertyValue_items_$ref, _propertyValue_items1;
|
282
284
|
return propertyValue.type === 'array' && (((_propertyValue_items = propertyValue.items) == null ? void 0 : _propertyValue_items.$ref) === 'https://schemas.digipair.ai/pinsSettings' || ((_propertyValue_items1 = propertyValue.items) == null ? void 0 : (_propertyValue_items_$ref = _propertyValue_items1.$ref) == null ? void 0 : _propertyValue_items_$ref.includes('#/components/schemas/')));
|
283
285
|
}).reduce((acc, [propertyKey, property])=>_extends({}, acc, {
|
@@ -290,7 +292,7 @@ function convertPinsLibrariesToBlocklyLibraries(pinsLibraries) {
|
|
290
292
|
}),
|
291
293
|
'x-scene-blocks': _extends({}, Object.entries(schema.paths).reduce((acc, [key, path])=>_extends({}, acc, {
|
292
294
|
[key]: _extends({}, path, {
|
293
|
-
metadata: [
|
295
|
+
metadata: !path.metadata ? [] : [
|
294
296
|
...path.metadata,
|
295
297
|
...path.metadata.filter((item)=>{
|
296
298
|
var _item_schema, _item_schema_items, _item_schema_items_$ref, _item_schema_items1;
|
@@ -304,7 +306,7 @@ function convertPinsLibrariesToBlocklyLibraries(pinsLibraries) {
|
|
304
306
|
}
|
305
307
|
}))
|
306
308
|
],
|
307
|
-
parameters: [
|
309
|
+
parameters: !path.parameters ? [] : [
|
308
310
|
...path.parameters,
|
309
311
|
...path.parameters.filter((item)=>{
|
310
312
|
var _item_schema, _item_schema_items, _item_schema_items_$ref, _item_schema_items1;
|
@@ -320,7 +322,8 @@ function convertPinsLibrariesToBlocklyLibraries(pinsLibraries) {
|
|
320
322
|
]
|
321
323
|
})
|
322
324
|
}), {}))
|
323
|
-
})
|
325
|
+
});
|
326
|
+
});
|
324
327
|
}
|
325
328
|
function generateBlocklyBlockFromLibraries(pinsLibraries, blocksLegacy) {
|
326
329
|
const blocksLibrary = [
|