@digipair/skill-web-editor 0.72.0 → 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 CHANGED
@@ -2112,7 +2112,7 @@ function generateSceneBlock(pinsSettings, workspace) {
2112
2112
  var _foundLibrary_xsceneblocks_sceneBlockName_metadata;
2113
2113
  const parameter = (_foundLibrary_xsceneblocks_sceneBlockName_metadata = foundLibrary['x-scene-blocks'][sceneBlockName].metadata) == null ? void 0 : _foundLibrary_xsceneblocks_sceneBlockName_metadata.find((p)=>p.name === metadataKey);
2114
2114
  if (parameter) {
2115
- if (parameter.schema.type === 'array' && parameter.schema.items.$ref && typeof metadataValue !== 'string') {
2115
+ if (parameter.schema.type === 'array' && parameter.schema.items.$ref) {
2116
2116
  const parameterType = getParameterType(parameter.schema.items);
2117
2117
  for (const componentSettings of metadataValue.reverse()){
2118
2118
  const componentBlock = parameterType === 'component' ? generateBlockFromComponent(componentSettings, workspace, foundLibrary, parameter.schema.items.$ref) : generateBlockFromPins(componentSettings, workspace);
@@ -2139,7 +2139,7 @@ function generateSceneBlock(pinsSettings, workspace) {
2139
2139
  var _foundLibrary_xsceneblocks_sceneBlockName_parameters;
2140
2140
  const parameter = (_foundLibrary_xsceneblocks_sceneBlockName_parameters = foundLibrary['x-scene-blocks'][sceneBlockName].parameters) == null ? void 0 : _foundLibrary_xsceneblocks_sceneBlockName_parameters.find((p)=>p.name === inputName);
2141
2141
  if (parameter) {
2142
- if (parameter.schema.type === 'array' && parameter.schema.items.$ref && typeof value !== 'string') {
2142
+ if (parameter.schema.type === 'array' && parameter.schema.items.$ref) {
2143
2143
  const parameterType = getParameterType(parameter.schema.items);
2144
2144
  for (const componentSettings of value.reverse()){
2145
2145
  const componentBlock = parameterType === 'component' ? generateBlockFromComponent(componentSettings, workspace, foundLibrary, parameter.schema.items.$ref) : generateBlockFromPins(componentSettings, workspace);
@@ -2225,8 +2225,14 @@ function generateBlockFromPins(pinsSettings, workspace) {
2225
2225
  continue;
2226
2226
  }
2227
2227
  const valueToLoad = pinsSettings.properties[parameter.name];
2228
- if (parameter.schema.type === 'array' && parameter.schema.items.$ref && typeof valueToLoad !== 'string') {
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
- if (parameter.schema.type === 'array' && ((_parameter_schema_items = parameter.schema.items) == null ? void 0 : _parameter_schema_items.$ref) && typeof valueToLoad !== 'string') {
2276
- const parameterType = getParameterType(parameter.schema.items);
2277
- for (const propertyValue of valueToLoad.reverse()){
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
  }
@@ -2309,7 +2305,7 @@ function generateBlockFromComponent(componentSettings, workspace, library, compo
2309
2305
  continue;
2310
2306
  }
2311
2307
  const valueToLoad = componentSettings[propertyKey];
2312
- if (schema.type === 'array' && schema.items.$ref && typeof valueToLoad !== 'string') {
2308
+ if (schema.type === 'array' && schema.items.$ref) {
2313
2309
  const parameterType = getParameterType(schema.items);
2314
2310
  for (const propertyValue of valueToLoad.reverse()){
2315
2311
  const parameterBlock = parameterType === 'component' ? generateBlockFromComponent(propertyValue, workspace, library, schema.items.$ref) : generateBlockFromPins(propertyValue, workspace);
package/index.esm2.js CHANGED
@@ -2110,7 +2110,7 @@ function generateSceneBlock(pinsSettings, workspace) {
2110
2110
  var _foundLibrary_xsceneblocks_sceneBlockName_metadata;
2111
2111
  const parameter = (_foundLibrary_xsceneblocks_sceneBlockName_metadata = foundLibrary['x-scene-blocks'][sceneBlockName].metadata) == null ? void 0 : _foundLibrary_xsceneblocks_sceneBlockName_metadata.find((p)=>p.name === metadataKey);
2112
2112
  if (parameter) {
2113
- if (parameter.schema.type === 'array' && parameter.schema.items.$ref && typeof metadataValue !== 'string') {
2113
+ if (parameter.schema.type === 'array' && parameter.schema.items.$ref) {
2114
2114
  const parameterType = getParameterType(parameter.schema.items);
2115
2115
  for (const componentSettings of metadataValue.reverse()){
2116
2116
  const componentBlock = parameterType === 'component' ? generateBlockFromComponent(componentSettings, workspace, foundLibrary, parameter.schema.items.$ref) : generateBlockFromPins(componentSettings, workspace);
@@ -2137,7 +2137,7 @@ function generateSceneBlock(pinsSettings, workspace) {
2137
2137
  var _foundLibrary_xsceneblocks_sceneBlockName_parameters;
2138
2138
  const parameter = (_foundLibrary_xsceneblocks_sceneBlockName_parameters = foundLibrary['x-scene-blocks'][sceneBlockName].parameters) == null ? void 0 : _foundLibrary_xsceneblocks_sceneBlockName_parameters.find((p)=>p.name === inputName);
2139
2139
  if (parameter) {
2140
- if (parameter.schema.type === 'array' && parameter.schema.items.$ref && typeof value !== 'string') {
2140
+ if (parameter.schema.type === 'array' && parameter.schema.items.$ref) {
2141
2141
  const parameterType = getParameterType(parameter.schema.items);
2142
2142
  for (const componentSettings of value.reverse()){
2143
2143
  const componentBlock = parameterType === 'component' ? generateBlockFromComponent(componentSettings, workspace, foundLibrary, parameter.schema.items.$ref) : generateBlockFromPins(componentSettings, workspace);
@@ -2223,8 +2223,14 @@ function generateBlockFromPins(pinsSettings, workspace) {
2223
2223
  continue;
2224
2224
  }
2225
2225
  const valueToLoad = pinsSettings.properties[parameter.name];
2226
- if (parameter.schema.type === 'array' && parameter.schema.items.$ref && typeof valueToLoad !== 'string') {
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
- if (parameter.schema.type === 'array' && ((_parameter_schema_items = parameter.schema.items) == null ? void 0 : _parameter_schema_items.$ref) && typeof valueToLoad !== 'string') {
2274
- const parameterType = getParameterType(parameter.schema.items);
2275
- for (const propertyValue of valueToLoad.reverse()){
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
  }
@@ -2307,7 +2303,7 @@ function generateBlockFromComponent(componentSettings, workspace, library, compo
2307
2303
  continue;
2308
2304
  }
2309
2305
  const valueToLoad = componentSettings[propertyKey];
2310
- if (schema.type === 'array' && schema.items.$ref && typeof valueToLoad !== 'string') {
2306
+ if (schema.type === 'array' && schema.items.$ref) {
2311
2307
  const parameterType = getParameterType(schema.items);
2312
2308
  for (const propertyValue of valueToLoad.reverse()){
2313
2309
  const parameterBlock = parameterType === 'component' ? generateBlockFromComponent(propertyValue, workspace, library, schema.items.$ref) : generateBlockFromPins(propertyValue, workspace);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-web-editor",
3
- "version": "0.72.0",
3
+ "version": "0.72.1",
4
4
  "keywords": [
5
5
  "digipair",
6
6
  "web"
@@ -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') {
@@ -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') {