@digipair/skill-web-editor 0.71.6 → 0.72.1
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.cjs2.js +9 -13
- package/index.esm2.js +9 -13
- package/package.json +1 -1
- package/pins-to-blockly.cjs.js +2 -1
- package/pins-to-blockly.esm.js +2 -1
package/index.cjs2.js
CHANGED
@@ -2227,6 +2227,12 @@ function generateBlockFromPins(pinsSettings, workspace) {
|
|
2227
2227
|
const valueToLoad = pinsSettings.properties[parameter.name];
|
2228
2228
|
if (parameter.schema.type === 'array' && parameter.schema.items.$ref) {
|
2229
2229
|
const parameterType = getParameterType(parameter.schema.items);
|
2230
|
+
if (typeof valueToLoad === 'string') {
|
2231
|
+
const parameterBlock = generateParameterBlock(parameter.schema, valueToLoad, workspace, library);
|
2232
|
+
const inputConnection = pinsBlock.getInput(parameter.name + '__EVALUATE').connection;
|
2233
|
+
connectBlock(parameterBlock, inputConnection);
|
2234
|
+
continue;
|
2235
|
+
}
|
2230
2236
|
for (const propertyValue of valueToLoad.reverse()){
|
2231
2237
|
const parameterBlock = parameterType === 'component' ? generateBlockFromComponent(propertyValue, workspace, library, parameter.schema.items.$ref) : generateBlockFromPins(propertyValue, workspace);
|
2232
2238
|
const inputConnection = pinsBlock.getInput(parameter.name).connection;
|
@@ -2267,23 +2273,13 @@ function generateBlockFromPins(pinsSettings, workspace) {
|
|
2267
2273
|
}
|
2268
2274
|
];
|
2269
2275
|
for (const parameter of conditions){
|
2270
|
-
var _parameter_schema_items;
|
2271
2276
|
if (!pinsSettings.conditions || !Object.prototype.hasOwnProperty.call(pinsSettings.conditions, parameter.name)) {
|
2272
2277
|
continue;
|
2273
2278
|
}
|
2274
2279
|
const valueToLoad = pinsSettings.conditions[parameter.name];
|
2275
|
-
|
2276
|
-
|
2277
|
-
|
2278
|
-
const parameterBlock = parameterType === 'component' ? generateBlockFromComponent(propertyValue, workspace, library, parameter.schema.items.$ref) : generateBlockFromPins(propertyValue, workspace);
|
2279
|
-
const inputConnection = pinsBlock.getInput('__CONDITION__/' + parameter.name).connection;
|
2280
|
-
connectBlock(parameterBlock, inputConnection);
|
2281
|
-
}
|
2282
|
-
} else {
|
2283
|
-
const parameterBlock = generateParameterBlock(parameter.schema, valueToLoad, workspace, library);
|
2284
|
-
const inputConnection = pinsBlock.getInput('__CONDITION__/' + parameter.name).connection;
|
2285
|
-
connectBlock(parameterBlock, inputConnection);
|
2286
|
-
}
|
2280
|
+
const parameterBlock = generateParameterBlock(parameter.schema, valueToLoad, workspace, library);
|
2281
|
+
const inputConnection = pinsBlock.getInput('__CONDITION__/' + parameter.name).connection;
|
2282
|
+
connectBlock(parameterBlock, inputConnection);
|
2287
2283
|
}
|
2288
2284
|
return pinsBlock;
|
2289
2285
|
}
|
package/index.esm2.js
CHANGED
@@ -2225,6 +2225,12 @@ function generateBlockFromPins(pinsSettings, workspace) {
|
|
2225
2225
|
const valueToLoad = pinsSettings.properties[parameter.name];
|
2226
2226
|
if (parameter.schema.type === 'array' && parameter.schema.items.$ref) {
|
2227
2227
|
const parameterType = getParameterType(parameter.schema.items);
|
2228
|
+
if (typeof valueToLoad === 'string') {
|
2229
|
+
const parameterBlock = generateParameterBlock(parameter.schema, valueToLoad, workspace, library);
|
2230
|
+
const inputConnection = pinsBlock.getInput(parameter.name + '__EVALUATE').connection;
|
2231
|
+
connectBlock(parameterBlock, inputConnection);
|
2232
|
+
continue;
|
2233
|
+
}
|
2228
2234
|
for (const propertyValue of valueToLoad.reverse()){
|
2229
2235
|
const parameterBlock = parameterType === 'component' ? generateBlockFromComponent(propertyValue, workspace, library, parameter.schema.items.$ref) : generateBlockFromPins(propertyValue, workspace);
|
2230
2236
|
const inputConnection = pinsBlock.getInput(parameter.name).connection;
|
@@ -2265,23 +2271,13 @@ function generateBlockFromPins(pinsSettings, workspace) {
|
|
2265
2271
|
}
|
2266
2272
|
];
|
2267
2273
|
for (const parameter of conditions){
|
2268
|
-
var _parameter_schema_items;
|
2269
2274
|
if (!pinsSettings.conditions || !Object.prototype.hasOwnProperty.call(pinsSettings.conditions, parameter.name)) {
|
2270
2275
|
continue;
|
2271
2276
|
}
|
2272
2277
|
const valueToLoad = pinsSettings.conditions[parameter.name];
|
2273
|
-
|
2274
|
-
|
2275
|
-
|
2276
|
-
const parameterBlock = parameterType === 'component' ? generateBlockFromComponent(propertyValue, workspace, library, parameter.schema.items.$ref) : generateBlockFromPins(propertyValue, workspace);
|
2277
|
-
const inputConnection = pinsBlock.getInput('__CONDITION__/' + parameter.name).connection;
|
2278
|
-
connectBlock(parameterBlock, inputConnection);
|
2279
|
-
}
|
2280
|
-
} else {
|
2281
|
-
const parameterBlock = generateParameterBlock(parameter.schema, valueToLoad, workspace, library);
|
2282
|
-
const inputConnection = pinsBlock.getInput('__CONDITION__/' + parameter.name).connection;
|
2283
|
-
connectBlock(parameterBlock, inputConnection);
|
2284
|
-
}
|
2278
|
+
const parameterBlock = generateParameterBlock(parameter.schema, valueToLoad, workspace, library);
|
2279
|
+
const inputConnection = pinsBlock.getInput('__CONDITION__/' + parameter.name).connection;
|
2280
|
+
connectBlock(parameterBlock, inputConnection);
|
2285
2281
|
}
|
2286
2282
|
return pinsBlock;
|
2287
2283
|
}
|
package/package.json
CHANGED
package/pins-to-blockly.cjs.js
CHANGED
@@ -378,7 +378,7 @@ function generateMutator(mutatorName, toolboxItem, requiredFields, originParamet
|
|
378
378
|
if (requiredFields.includes(this.inputList[i].name) || /__INPUT$/g.test(this.inputList[i].name)) {
|
379
379
|
continue;
|
380
380
|
}
|
381
|
-
const inputBlock = workspace.newBlock(mutatorName + '/' + this.inputList[i].name);
|
381
|
+
const inputBlock = workspace.newBlock(mutatorName + '/' + this.inputList[i].name.replace(/__EVALUATE$/g, ''));
|
382
382
|
inputBlock.initSvg();
|
383
383
|
connection.connect(inputBlock.previousConnection);
|
384
384
|
connection = inputBlock.nextConnection;
|
@@ -426,6 +426,7 @@ function generateMutator(mutatorName, toolboxItem, requiredFields, originParamet
|
|
426
426
|
var _parameters_find;
|
427
427
|
const parameter = (_parameters_find = parameters.find((param)=>param.name === id)) != null ? _parameters_find : {};
|
428
428
|
if (((_parameter_schema = parameter.schema) == null ? void 0 : _parameter_schema.type) === 'array' && (((_parameter_schema1 = parameter.schema) == null ? void 0 : _parameter_schema1.items.$ref) === 'https://schemas.digipair.ai/pinsSettings' || ((_parameter_schema2 = parameter.schema) == null ? void 0 : (_parameter_schema_items_$ref = _parameter_schema2.items.$ref) == null ? void 0 : _parameter_schema_items_$ref.includes('#/components/schemas/')))) {
|
429
|
+
this.appendValueInput(input.id + '__EVALUATE').appendField(input.name + ' [EVALUATE]');
|
429
430
|
this.appendDummyInput(input.id + '__INPUT').appendField(input.name);
|
430
431
|
this.appendStatementInput(input.id);
|
431
432
|
} else if (input.id === 'pins') {
|
package/pins-to-blockly.esm.js
CHANGED
@@ -376,7 +376,7 @@ function generateMutator(mutatorName, toolboxItem, requiredFields, originParamet
|
|
376
376
|
if (requiredFields.includes(this.inputList[i].name) || /__INPUT$/g.test(this.inputList[i].name)) {
|
377
377
|
continue;
|
378
378
|
}
|
379
|
-
const inputBlock = workspace.newBlock(mutatorName + '/' + this.inputList[i].name);
|
379
|
+
const inputBlock = workspace.newBlock(mutatorName + '/' + this.inputList[i].name.replace(/__EVALUATE$/g, ''));
|
380
380
|
inputBlock.initSvg();
|
381
381
|
connection.connect(inputBlock.previousConnection);
|
382
382
|
connection = inputBlock.nextConnection;
|
@@ -424,6 +424,7 @@ function generateMutator(mutatorName, toolboxItem, requiredFields, originParamet
|
|
424
424
|
var _parameters_find;
|
425
425
|
const parameter = (_parameters_find = parameters.find((param)=>param.name === id)) != null ? _parameters_find : {};
|
426
426
|
if (((_parameter_schema = parameter.schema) == null ? void 0 : _parameter_schema.type) === 'array' && (((_parameter_schema1 = parameter.schema) == null ? void 0 : _parameter_schema1.items.$ref) === 'https://schemas.digipair.ai/pinsSettings' || ((_parameter_schema2 = parameter.schema) == null ? void 0 : (_parameter_schema_items_$ref = _parameter_schema2.items.$ref) == null ? void 0 : _parameter_schema_items_$ref.includes('#/components/schemas/')))) {
|
427
|
+
this.appendValueInput(input.id + '__EVALUATE').appendField(input.name + ' [EVALUATE]');
|
427
428
|
this.appendDummyInput(input.id + '__INPUT').appendField(input.name);
|
428
429
|
this.appendStatementInput(input.id);
|
429
430
|
} else if (input.id === 'pins') {
|