@digipair/skill-web-editor 0.4.13 → 0.4.15

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
@@ -2642,7 +2642,7 @@ function generateBlockFromPins(pinsSettings, workspace) {
2642
2642
  }
2643
2643
  pinsBlock.initSvg();
2644
2644
  pinsBlock.render();
2645
- if (library.paths['/' + pinsSettings.element].post.tags && library.paths['/' + pinsSettings.element].post.tags.includes('needPins')) {
2645
+ if (library.paths['/' + pinsSettings.element].post.tags && library.paths['/' + pinsSettings.element].post.tags.includes('needPins') && pinsSettings.pins && pinsSettings.pins.length > 0) {
2646
2646
  const pinsConnection = pinsBlock.getInput('pins').connection;
2647
2647
  const reversedPins = [
2648
2648
  ...pinsSettings.pins || []
@@ -2936,7 +2936,7 @@ function itemListFromPinsSettings(pinsSettings, pinsDefinition) {
2936
2936
  });
2937
2937
  }
2938
2938
  }
2939
- if (pinsDefinition.tags && pinsDefinition.tags.includes('needPins')) {
2939
+ if (pinsDefinition.tags && pinsDefinition.tags.includes('needPins') && pinsSettings.pins && pinsSettings.pins.length > 0) {
2940
2940
  inputArray.push({
2941
2941
  id: 'pins',
2942
2942
  name: 'pins'
@@ -2971,13 +2971,13 @@ function itemListFromPinsSettings(pinsSettings, pinsDefinition) {
2971
2971
  }
2972
2972
  function itemListFromComponentSettings(componentSettings, componentDefinition) {
2973
2973
  const inputArray = [];
2974
- for (const [propertyKey, _propertyValue] of Object.entries(componentDefinition.properties)){
2974
+ for (const [propertyKey, propertyValue] of Object.entries(componentDefinition.properties)){
2975
2975
  if (!Object.prototype.hasOwnProperty.call(componentSettings, propertyKey)) {
2976
2976
  continue;
2977
2977
  }
2978
2978
  inputArray.push({
2979
2979
  id: propertyKey,
2980
- name: propertyKey
2980
+ name: propertyValue.summary || propertyKey
2981
2981
  });
2982
2982
  }
2983
2983
  return inputArray;
@@ -2991,7 +2991,7 @@ function itemListFromSceneSettings(sceneSettings, sceneDefinition) {
2991
2991
  }
2992
2992
  inputArray.push({
2993
2993
  id: parameter.name,
2994
- name: parameter.name
2994
+ name: parameter.summary || parameter.name
2995
2995
  });
2996
2996
  }
2997
2997
  }
@@ -3050,6 +3050,20 @@ const schemas = {
3050
3050
  type: 'string'
3051
3051
  }
3052
3052
  }
3053
+ ],
3054
+ 'x-events': [
3055
+ {
3056
+ name: 'click',
3057
+ summary: "Clique sur l'élément",
3058
+ required: false,
3059
+ description: "Action déclenchée lors du click sur l'élément",
3060
+ schema: {
3061
+ type: 'array',
3062
+ items: {
3063
+ $ref: 'https://www.pinser.world/schemas/pinsSettings'
3064
+ }
3065
+ }
3066
+ }
3053
3067
  ]
3054
3068
  }
3055
3069
  },
@@ -3144,6 +3158,20 @@ const schemas = {
3144
3158
  type: 'string'
3145
3159
  }
3146
3160
  }
3161
+ ],
3162
+ 'x-events': [
3163
+ {
3164
+ name: 'click',
3165
+ summary: "Clique sur l'élément",
3166
+ required: false,
3167
+ description: "Action déclenchée lors du click sur l'élément",
3168
+ schema: {
3169
+ type: 'array',
3170
+ items: {
3171
+ $ref: 'https://www.pinser.world/schemas/pinsSettings'
3172
+ }
3173
+ }
3174
+ }
3147
3175
  ]
3148
3176
  }
3149
3177
  },
@@ -3210,6 +3238,28 @@ const schemas = {
3210
3238
  schema: {
3211
3239
  type: 'string'
3212
3240
  }
3241
+ },
3242
+ {
3243
+ name: 'textContent',
3244
+ in: 'query',
3245
+ description: '',
3246
+ schema: {
3247
+ type: 'string'
3248
+ }
3249
+ }
3250
+ ],
3251
+ 'x-events': [
3252
+ {
3253
+ name: 'click',
3254
+ summary: "Clique sur l'élément",
3255
+ required: false,
3256
+ description: "Action déclenchée lors du click sur l'élément",
3257
+ schema: {
3258
+ type: 'array',
3259
+ items: {
3260
+ $ref: 'https://www.pinser.world/schemas/pinsSettings'
3261
+ }
3262
+ }
3213
3263
  }
3214
3264
  ]
3215
3265
  }
@@ -3230,6 +3280,20 @@ const schemas = {
3230
3280
  type: 'string'
3231
3281
  }
3232
3282
  }
3283
+ ],
3284
+ 'x-events': [
3285
+ {
3286
+ name: 'click',
3287
+ summary: "Clique sur l'élément",
3288
+ required: false,
3289
+ description: "Action déclenchée lors du click sur l'élément",
3290
+ schema: {
3291
+ type: 'array',
3292
+ items: {
3293
+ $ref: 'https://www.pinser.world/schemas/pinsSettings'
3294
+ }
3295
+ }
3296
+ }
3233
3297
  ]
3234
3298
  }
3235
3299
  },
@@ -3265,6 +3329,20 @@ const schemas = {
3265
3329
  type: 'string'
3266
3330
  }
3267
3331
  }
3332
+ ],
3333
+ 'x-events': [
3334
+ {
3335
+ name: 'click',
3336
+ summary: "Clique sur l'élément",
3337
+ required: false,
3338
+ description: "Action déclenchée lors du click sur l'élément",
3339
+ schema: {
3340
+ type: 'array',
3341
+ items: {
3342
+ $ref: 'https://www.pinser.world/schemas/pinsSettings'
3343
+ }
3344
+ }
3345
+ }
3268
3346
  ]
3269
3347
  }
3270
3348
  },
@@ -3284,6 +3362,20 @@ const schemas = {
3284
3362
  type: 'string'
3285
3363
  }
3286
3364
  }
3365
+ ],
3366
+ 'x-events': [
3367
+ {
3368
+ name: 'click',
3369
+ summary: "Clique sur l'élément",
3370
+ required: false,
3371
+ description: "Action déclenchée lors du click sur l'élément",
3372
+ schema: {
3373
+ type: 'array',
3374
+ items: {
3375
+ $ref: 'https://www.pinser.world/schemas/pinsSettings'
3376
+ }
3377
+ }
3378
+ }
3287
3379
  ]
3288
3380
  }
3289
3381
  },
@@ -3303,6 +3395,20 @@ const schemas = {
3303
3395
  type: 'string'
3304
3396
  }
3305
3397
  }
3398
+ ],
3399
+ 'x-events': [
3400
+ {
3401
+ name: 'click',
3402
+ summary: "Clique sur l'élément",
3403
+ required: false,
3404
+ description: "Action déclenchée lors du click sur l'élément",
3405
+ schema: {
3406
+ type: 'array',
3407
+ items: {
3408
+ $ref: 'https://www.pinser.world/schemas/pinsSettings'
3409
+ }
3410
+ }
3411
+ }
3306
3412
  ]
3307
3413
  }
3308
3414
  }
package/index.esm2.js CHANGED
@@ -2640,7 +2640,7 @@ function generateBlockFromPins(pinsSettings, workspace) {
2640
2640
  }
2641
2641
  pinsBlock.initSvg();
2642
2642
  pinsBlock.render();
2643
- if (library.paths['/' + pinsSettings.element].post.tags && library.paths['/' + pinsSettings.element].post.tags.includes('needPins')) {
2643
+ if (library.paths['/' + pinsSettings.element].post.tags && library.paths['/' + pinsSettings.element].post.tags.includes('needPins') && pinsSettings.pins && pinsSettings.pins.length > 0) {
2644
2644
  const pinsConnection = pinsBlock.getInput('pins').connection;
2645
2645
  const reversedPins = [
2646
2646
  ...pinsSettings.pins || []
@@ -2934,7 +2934,7 @@ function itemListFromPinsSettings(pinsSettings, pinsDefinition) {
2934
2934
  });
2935
2935
  }
2936
2936
  }
2937
- if (pinsDefinition.tags && pinsDefinition.tags.includes('needPins')) {
2937
+ if (pinsDefinition.tags && pinsDefinition.tags.includes('needPins') && pinsSettings.pins && pinsSettings.pins.length > 0) {
2938
2938
  inputArray.push({
2939
2939
  id: 'pins',
2940
2940
  name: 'pins'
@@ -2969,13 +2969,13 @@ function itemListFromPinsSettings(pinsSettings, pinsDefinition) {
2969
2969
  }
2970
2970
  function itemListFromComponentSettings(componentSettings, componentDefinition) {
2971
2971
  const inputArray = [];
2972
- for (const [propertyKey, _propertyValue] of Object.entries(componentDefinition.properties)){
2972
+ for (const [propertyKey, propertyValue] of Object.entries(componentDefinition.properties)){
2973
2973
  if (!Object.prototype.hasOwnProperty.call(componentSettings, propertyKey)) {
2974
2974
  continue;
2975
2975
  }
2976
2976
  inputArray.push({
2977
2977
  id: propertyKey,
2978
- name: propertyKey
2978
+ name: propertyValue.summary || propertyKey
2979
2979
  });
2980
2980
  }
2981
2981
  return inputArray;
@@ -2989,7 +2989,7 @@ function itemListFromSceneSettings(sceneSettings, sceneDefinition) {
2989
2989
  }
2990
2990
  inputArray.push({
2991
2991
  id: parameter.name,
2992
- name: parameter.name
2992
+ name: parameter.summary || parameter.name
2993
2993
  });
2994
2994
  }
2995
2995
  }
@@ -3048,6 +3048,20 @@ const schemas = {
3048
3048
  type: 'string'
3049
3049
  }
3050
3050
  }
3051
+ ],
3052
+ 'x-events': [
3053
+ {
3054
+ name: 'click',
3055
+ summary: "Clique sur l'élément",
3056
+ required: false,
3057
+ description: "Action déclenchée lors du click sur l'élément",
3058
+ schema: {
3059
+ type: 'array',
3060
+ items: {
3061
+ $ref: 'https://www.pinser.world/schemas/pinsSettings'
3062
+ }
3063
+ }
3064
+ }
3051
3065
  ]
3052
3066
  }
3053
3067
  },
@@ -3142,6 +3156,20 @@ const schemas = {
3142
3156
  type: 'string'
3143
3157
  }
3144
3158
  }
3159
+ ],
3160
+ 'x-events': [
3161
+ {
3162
+ name: 'click',
3163
+ summary: "Clique sur l'élément",
3164
+ required: false,
3165
+ description: "Action déclenchée lors du click sur l'élément",
3166
+ schema: {
3167
+ type: 'array',
3168
+ items: {
3169
+ $ref: 'https://www.pinser.world/schemas/pinsSettings'
3170
+ }
3171
+ }
3172
+ }
3145
3173
  ]
3146
3174
  }
3147
3175
  },
@@ -3208,6 +3236,28 @@ const schemas = {
3208
3236
  schema: {
3209
3237
  type: 'string'
3210
3238
  }
3239
+ },
3240
+ {
3241
+ name: 'textContent',
3242
+ in: 'query',
3243
+ description: '',
3244
+ schema: {
3245
+ type: 'string'
3246
+ }
3247
+ }
3248
+ ],
3249
+ 'x-events': [
3250
+ {
3251
+ name: 'click',
3252
+ summary: "Clique sur l'élément",
3253
+ required: false,
3254
+ description: "Action déclenchée lors du click sur l'élément",
3255
+ schema: {
3256
+ type: 'array',
3257
+ items: {
3258
+ $ref: 'https://www.pinser.world/schemas/pinsSettings'
3259
+ }
3260
+ }
3211
3261
  }
3212
3262
  ]
3213
3263
  }
@@ -3228,6 +3278,20 @@ const schemas = {
3228
3278
  type: 'string'
3229
3279
  }
3230
3280
  }
3281
+ ],
3282
+ 'x-events': [
3283
+ {
3284
+ name: 'click',
3285
+ summary: "Clique sur l'élément",
3286
+ required: false,
3287
+ description: "Action déclenchée lors du click sur l'élément",
3288
+ schema: {
3289
+ type: 'array',
3290
+ items: {
3291
+ $ref: 'https://www.pinser.world/schemas/pinsSettings'
3292
+ }
3293
+ }
3294
+ }
3231
3295
  ]
3232
3296
  }
3233
3297
  },
@@ -3263,6 +3327,20 @@ const schemas = {
3263
3327
  type: 'string'
3264
3328
  }
3265
3329
  }
3330
+ ],
3331
+ 'x-events': [
3332
+ {
3333
+ name: 'click',
3334
+ summary: "Clique sur l'élément",
3335
+ required: false,
3336
+ description: "Action déclenchée lors du click sur l'élément",
3337
+ schema: {
3338
+ type: 'array',
3339
+ items: {
3340
+ $ref: 'https://www.pinser.world/schemas/pinsSettings'
3341
+ }
3342
+ }
3343
+ }
3266
3344
  ]
3267
3345
  }
3268
3346
  },
@@ -3282,6 +3360,20 @@ const schemas = {
3282
3360
  type: 'string'
3283
3361
  }
3284
3362
  }
3363
+ ],
3364
+ 'x-events': [
3365
+ {
3366
+ name: 'click',
3367
+ summary: "Clique sur l'élément",
3368
+ required: false,
3369
+ description: "Action déclenchée lors du click sur l'élément",
3370
+ schema: {
3371
+ type: 'array',
3372
+ items: {
3373
+ $ref: 'https://www.pinser.world/schemas/pinsSettings'
3374
+ }
3375
+ }
3376
+ }
3285
3377
  ]
3286
3378
  }
3287
3379
  },
@@ -3301,6 +3393,20 @@ const schemas = {
3301
3393
  type: 'string'
3302
3394
  }
3303
3395
  }
3396
+ ],
3397
+ 'x-events': [
3398
+ {
3399
+ name: 'click',
3400
+ summary: "Clique sur l'élément",
3401
+ required: false,
3402
+ description: "Action déclenchée lors du click sur l'élément",
3403
+ schema: {
3404
+ type: 'array',
3405
+ items: {
3406
+ $ref: 'https://www.pinser.world/schemas/pinsSettings'
3407
+ }
3408
+ }
3409
+ }
3304
3410
  ]
3305
3411
  }
3306
3412
  }
@@ -34,6 +34,18 @@ export declare const schemas: {
34
34
  type: string;
35
35
  };
36
36
  }[];
37
+ 'x-events': {
38
+ name: string;
39
+ summary: string;
40
+ required: boolean;
41
+ description: string;
42
+ schema: {
43
+ type: string;
44
+ items: {
45
+ $ref: string;
46
+ };
47
+ };
48
+ }[];
37
49
  };
38
50
  };
39
51
  '/nav': {
@@ -62,6 +74,18 @@ export declare const schemas: {
62
74
  type: string;
63
75
  };
64
76
  }[];
77
+ 'x-events': {
78
+ name: string;
79
+ summary: string;
80
+ required: boolean;
81
+ description: string;
82
+ schema: {
83
+ type: string;
84
+ items: {
85
+ $ref: string;
86
+ };
87
+ };
88
+ }[];
65
89
  };
66
90
  };
67
91
  '/button': {
@@ -76,6 +100,18 @@ export declare const schemas: {
76
100
  type: string;
77
101
  };
78
102
  }[];
103
+ 'x-events': {
104
+ name: string;
105
+ summary: string;
106
+ required: boolean;
107
+ description: string;
108
+ schema: {
109
+ type: string;
110
+ items: {
111
+ $ref: string;
112
+ };
113
+ };
114
+ }[];
79
115
  };
80
116
  };
81
117
  '/span': {
@@ -90,6 +126,18 @@ export declare const schemas: {
90
126
  type: string;
91
127
  };
92
128
  }[];
129
+ 'x-events': {
130
+ name: string;
131
+ summary: string;
132
+ required: boolean;
133
+ description: string;
134
+ schema: {
135
+ type: string;
136
+ items: {
137
+ $ref: string;
138
+ };
139
+ };
140
+ }[];
93
141
  };
94
142
  };
95
143
  '/div': {
@@ -104,6 +152,18 @@ export declare const schemas: {
104
152
  type: string;
105
153
  };
106
154
  }[];
155
+ 'x-events': {
156
+ name: string;
157
+ summary: string;
158
+ required: boolean;
159
+ description: string;
160
+ schema: {
161
+ type: string;
162
+ items: {
163
+ $ref: string;
164
+ };
165
+ };
166
+ }[];
107
167
  };
108
168
  };
109
169
  '/ul': {
@@ -118,6 +178,18 @@ export declare const schemas: {
118
178
  type: string;
119
179
  };
120
180
  }[];
181
+ 'x-events': {
182
+ name: string;
183
+ summary: string;
184
+ required: boolean;
185
+ description: string;
186
+ schema: {
187
+ type: string;
188
+ items: {
189
+ $ref: string;
190
+ };
191
+ };
192
+ }[];
121
193
  };
122
194
  };
123
195
  '/li': {
@@ -132,6 +204,18 @@ export declare const schemas: {
132
204
  type: string;
133
205
  };
134
206
  }[];
207
+ 'x-events': {
208
+ name: string;
209
+ summary: string;
210
+ required: boolean;
211
+ description: string;
212
+ schema: {
213
+ type: string;
214
+ items: {
215
+ $ref: string;
216
+ };
217
+ };
218
+ }[];
135
219
  };
136
220
  };
137
221
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-web-editor",
3
- "version": "0.4.13",
3
+ "version": "0.4.15",
4
4
  "dependencies": {},
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js"
@@ -374,7 +374,7 @@ function generateMutator(mutatorName, toolboxItem, requiredFields, originParamet
374
374
  containerBlock.initSvg();
375
375
  let connection = containerBlock.getInput('STACK').connection;
376
376
  for(let i = 0; i < this.inputList.length; i++){
377
- if (requiredFields.includes(this.inputList[i].name)) {
377
+ if (requiredFields.includes(this.inputList[i].name) || /__INPUT$/g.test(this.inputList[i].name)) {
378
378
  continue;
379
379
  }
380
380
  const inputBlock = workspace.newBlock(mutatorName + '/' + this.inputList[i].name);
@@ -411,7 +411,7 @@ function generateMutator(mutatorName, toolboxItem, requiredFields, originParamet
411
411
  const inputToEnableIds = inputToEnable.map((input)=>input.id);
412
412
  for (const input of inputLoaded){
413
413
  if (requiredFields.includes(input)) continue;
414
- if (!inputToEnableIds.includes(input)) {
414
+ if (!inputToEnableIds.includes(input.replace(/__INPUT$/g, ''))) {
415
415
  this.removeInput(input);
416
416
  }
417
417
  }
@@ -425,7 +425,10 @@ function generateMutator(mutatorName, toolboxItem, requiredFields, originParamet
425
425
  var _parameters_find;
426
426
  const parameter = (_parameters_find = parameters.find((param)=>param.name === id)) != null ? _parameters_find : {};
427
427
  if (((_parameter_schema = parameter.schema) == null ? void 0 : _parameter_schema.type) === 'array' && (((_parameter_schema1 = parameter.schema) == null ? void 0 : _parameter_schema1.items.$ref) === 'https://www.pinser.world/schemas/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/')))) {
428
- this.appendDummyInput().appendField(input.name);
428
+ this.appendDummyInput(input.id + '__INPUT').appendField(input.name);
429
+ this.appendStatementInput(input.id);
430
+ } else if (input.id === 'pins') {
431
+ this.appendDummyInput(input.id + '__INPUT').appendField(input.name);
429
432
  this.appendStatementInput(input.id);
430
433
  } else {
431
434
  this.appendValueInput(input.id).appendField(input.name);
@@ -372,7 +372,7 @@ function generateMutator(mutatorName, toolboxItem, requiredFields, originParamet
372
372
  containerBlock.initSvg();
373
373
  let connection = containerBlock.getInput('STACK').connection;
374
374
  for(let i = 0; i < this.inputList.length; i++){
375
- if (requiredFields.includes(this.inputList[i].name)) {
375
+ if (requiredFields.includes(this.inputList[i].name) || /__INPUT$/g.test(this.inputList[i].name)) {
376
376
  continue;
377
377
  }
378
378
  const inputBlock = workspace.newBlock(mutatorName + '/' + this.inputList[i].name);
@@ -409,7 +409,7 @@ function generateMutator(mutatorName, toolboxItem, requiredFields, originParamet
409
409
  const inputToEnableIds = inputToEnable.map((input)=>input.id);
410
410
  for (const input of inputLoaded){
411
411
  if (requiredFields.includes(input)) continue;
412
- if (!inputToEnableIds.includes(input)) {
412
+ if (!inputToEnableIds.includes(input.replace(/__INPUT$/g, ''))) {
413
413
  this.removeInput(input);
414
414
  }
415
415
  }
@@ -423,7 +423,10 @@ function generateMutator(mutatorName, toolboxItem, requiredFields, originParamet
423
423
  var _parameters_find;
424
424
  const parameter = (_parameters_find = parameters.find((param)=>param.name === id)) != null ? _parameters_find : {};
425
425
  if (((_parameter_schema = parameter.schema) == null ? void 0 : _parameter_schema.type) === 'array' && (((_parameter_schema1 = parameter.schema) == null ? void 0 : _parameter_schema1.items.$ref) === 'https://www.pinser.world/schemas/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/')))) {
426
- this.appendDummyInput().appendField(input.name);
426
+ this.appendDummyInput(input.id + '__INPUT').appendField(input.name);
427
+ this.appendStatementInput(input.id);
428
+ } else if (input.id === 'pins') {
429
+ this.appendDummyInput(input.id + '__INPUT').appendField(input.name);
427
430
  this.appendStatementInput(input.id);
428
431
  } else {
429
432
  this.appendValueInput(input.id).appendField(input.name);