iobroker.javascript 9.0.6 → 9.0.8

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.
Files changed (79) hide show
  1. package/README.md +7 -12
  2. package/admin/assets/OpenAiDialog-BRyhknmu.js +36 -0
  3. package/admin/assets/{Save-BKC3BS3x.js → Save-BCszXKYf.js} +1 -1
  4. package/admin/assets/{ScriptEditor-CzFTsfG9.js → ScriptEditor-DscINeWJ.js} +1 -1
  5. package/admin/assets/{ScriptEditorVanillaMonaco-DEgxOslR.js → ScriptEditorVanillaMonaco-nhdc7Upt.js} +1 -1
  6. package/admin/assets/createSvgIcon-DgblCazZ.js +30 -0
  7. package/admin/assets/{index-Cek-i92T.js → index-BzksVH7W.js} +4 -4
  8. package/admin/assets/{index-BHQhuPkd.js → index-Caw9eA1u.js} +1 -1
  9. package/admin/assets/{index-CpeX0MWe.js → index-CifxADFB.js} +1 -1
  10. package/admin/assets/{index-DnqHzUyv.js → index-CuLNesUT.js} +1 -1
  11. package/admin/assets/index-DOCky4vY.js +193 -0
  12. package/admin/assets/index-jqxhK8Zt.js +930 -0
  13. package/admin/assets/inheritsLoose-DSwHLF2T.js +36 -0
  14. package/admin/assets/useTheme-DV2tO1lV.js +1 -0
  15. package/admin/custom/assets/Components-C8Q_PdJG.js +1 -0
  16. package/admin/custom/assets/DefaultPropsProvider-Bezj9IPf.js +7 -0
  17. package/admin/custom/assets/DefaultPropsProvider-DQ6dtKrZ.js +1 -0
  18. package/admin/custom/assets/FilledInput-CEIlqlD1.js +2 -0
  19. package/admin/custom/assets/Tabs-Cx9dSOCY.js +138 -0
  20. package/admin/custom/assets/ThemeProvider-7gnV17Cm.js +29 -0
  21. package/admin/custom/assets/{createSvgIcon-BQThUM-f.js → createSvgIcon-DGttgCVR.js} +1 -1
  22. package/admin/custom/assets/createTheme-CW8V6Vvd.js +16 -0
  23. package/admin/custom/assets/defaultTheme-CIHkAzHF.js +1 -0
  24. package/admin/custom/assets/hostInit-CrAs5YZS.js +1 -1
  25. package/admin/custom/assets/index-B2rBO0oC.js +1 -0
  26. package/admin/custom/assets/index-Bngg13Gl.js +1 -0
  27. package/admin/custom/assets/index-BoDMpfDV.js +904 -0
  28. package/admin/custom/assets/index-Bw7Lp5Yt.js +7 -0
  29. package/admin/custom/assets/{index-DIWNdd4a.js → index-D8pO3qKc.js} +1 -1
  30. package/admin/custom/assets/index-DWD_PiWG.js +1399 -0
  31. package/admin/custom/assets/index-MyQg7vyV.js +55 -0
  32. package/admin/custom/assets/index-Rlkl7Md0.js +1 -0
  33. package/admin/custom/assets/{index-B8sZ2j0S.js → index-muQ3vq1J.js} +1 -1
  34. package/admin/custom/assets/useEnhancedEffect-CWsY2xDC.js +8 -0
  35. package/admin/custom/assets/useTheme-BYiWCERm.js +1 -0
  36. package/admin/custom/assets/useTheme-BnmV2Fqf.js +1 -0
  37. package/admin/custom/assets/{virtualExposes-BMKIjWrE.js → virtualExposes-fWevrC15.js} +2 -2
  38. package/admin/custom/customComponents.js +2 -2
  39. package/admin/google-blockly/own/blocks_action.js +12 -2
  40. package/admin/google-blockly/own/blocks_convert.js +17 -3
  41. package/admin/google-blockly/own/blocks_logic.js +48 -15
  42. package/admin/google-blockly/own/blocks_object.js +20 -7
  43. package/admin/google-blockly/own/blocks_procedures.js +15 -9
  44. package/admin/google-blockly/own/blocks_sendto.js +48 -11
  45. package/admin/google-blockly/own/blocks_switch.js +18 -8
  46. package/admin/google-blockly/own/blocks_system.js +33 -6
  47. package/admin/google-blockly/own/blocks_text.js +43 -0
  48. package/admin/google-blockly/own/blocks_time.js +53 -12
  49. package/admin/google-blockly/own/blocks_trigger.js +49 -18
  50. package/admin/google-blockly/own/blocks_words.js +4 -0
  51. package/admin/mf-manifest.json +1 -1
  52. package/admin/remoteEntry.js +2 -2
  53. package/admin/tab.html +17 -4
  54. package/io-package.json +27 -27
  55. package/package.json +2 -2
  56. package/admin/assets/OpenAiDialog-9N4LihWY.js +0 -34
  57. package/admin/assets/createSvgIcon-BQT-7-GS.js +0 -30
  58. package/admin/assets/index-JSzqpJXf.js +0 -930
  59. package/admin/assets/index-glyB1sbj.js +0 -193
  60. package/admin/assets/inheritsLoose--KnFDOw1.js +0 -36
  61. package/admin/assets/useTheme-DF6qfrtI.js +0 -1
  62. package/admin/custom/assets/Components-D9kRsHNY.js +0 -1
  63. package/admin/custom/assets/DefaultPropsProvider-9qubdy-V.js +0 -7
  64. package/admin/custom/assets/DefaultPropsProvider-DbEA5uR6.js +0 -1
  65. package/admin/custom/assets/FilledInput-BpuM_GyB.js +0 -2
  66. package/admin/custom/assets/Tabs-CvEv0KOT.js +0 -138
  67. package/admin/custom/assets/ThemeProvider-DZTpMR8n.js +0 -29
  68. package/admin/custom/assets/createTheme-BwMO3rTt.js +0 -16
  69. package/admin/custom/assets/defaultTheme-avbtL0lf.js +0 -1
  70. package/admin/custom/assets/index-B7G6Jpdl.js +0 -1
  71. package/admin/custom/assets/index-BzS6q3oS.js +0 -55
  72. package/admin/custom/assets/index-Coei6-WB.js +0 -1399
  73. package/admin/custom/assets/index-CttBOMyq.js +0 -1
  74. package/admin/custom/assets/index-Dbe-II7_.js +0 -7
  75. package/admin/custom/assets/index-DxyyYdTq.js +0 -904
  76. package/admin/custom/assets/useEnhancedEffect-CdLBzwyA.js +0 -8
  77. package/admin/custom/assets/useTheme-CDtRWagv.js +0 -1
  78. package/admin/custom/assets/useTheme-MELayQMj.js +0 -1
  79. package/admin/custom/assets/useThemeWithoutDefault-C-hl_s0Z.js +0 -1
@@ -228,9 +228,14 @@ Blockly.Blocks['sendto_custom'] = {
228
228
  let itemBlock = containerBlock.getInputTargetBlock('STACK');
229
229
  let i = 0;
230
230
  while (itemBlock) {
231
- const input = this.getInput('ARG' + i);
232
- itemBlock.valueConnection_ = input && input.connection.targetConnection;
233
- itemBlock = itemBlock.nextConnection && itemBlock.nextConnection.targetBlock();
231
+ let input;
232
+ try {
233
+ input = this.getInput('ARG' + i);
234
+ } catch (e) {
235
+ // if the input does not exist, it means that the block was deleted
236
+ }
237
+ itemBlock.valueConnection_ = input?.connection.targetConnection;
238
+ itemBlock = itemBlock.nextConnection?.targetBlock();
234
239
  i++;
235
240
  }
236
241
  },
@@ -244,7 +249,12 @@ Blockly.Blocks['sendto_custom'] = {
244
249
 
245
250
  // Add new inputs.
246
251
  for (let i = 0; i < this.itemCount_; i++) {
247
- let input = this.getInput('ARG' + i);
252
+ let input;
253
+ try {
254
+ input = this.getInput('ARG' + i);
255
+ } catch (e) {
256
+ input = null;
257
+ }
248
258
 
249
259
  if (!input) {
250
260
  input = this.appendValueInput('ARG' + i).setAlign(Blockly.ALIGN_RIGHT);
@@ -264,16 +274,27 @@ Blockly.Blocks['sendto_custom'] = {
264
274
  }, 100, input);
265
275
  }
266
276
  // Remove deleted inputs.
267
- for (let i = this.itemCount_; this.getInput('ARG' + i); i++) {
268
- this.removeInput('ARG' + i);
277
+ try {
278
+ for (let i = this.itemCount_; this.getInput('ARG' + i); i++) {
279
+ this.removeInput('ARG' + i);
280
+ }
281
+ } catch (e) {
282
+ // if the input does not exist, it means that the block was deleted
269
283
  }
270
284
 
285
+
271
286
  if (withStatement === undefined) {
272
287
  withStatement = this.getFieldValue('WITH_STATEMENT');
273
288
  withStatement = withStatement === true || withStatement === 'true' || withStatement === 'TRUE';
274
289
  }
275
290
 
276
- this.getInput('STATEMENT') && this.removeInput('STATEMENT');
291
+ try {
292
+ if (this.getInput('STATEMENT')) {
293
+ this.removeInput('STATEMENT');
294
+ }
295
+ } catch (e) {
296
+ // if the input does not exist, it means that the block was deleted
297
+ }
277
298
 
278
299
  // Add or remove a statement Input.
279
300
  if (withStatement) {
@@ -429,7 +450,12 @@ Blockly.Blocks['sendto_otherscript'] = {
429
450
 
430
451
  // Add new inputs.
431
452
  for (let i = 0; i < this.itemCount_; i++) {
432
- let input = this.getInput('ARG' + i);
453
+ let input;
454
+ try {
455
+ input = this.getInput('ARG' + i);
456
+ } catch (e) {
457
+ input = null;
458
+ }
433
459
 
434
460
  if (!input) {
435
461
  input = this.appendValueInput('ARG' + i).setAlign(Blockly.ALIGN_RIGHT);
@@ -449,16 +475,27 @@ Blockly.Blocks['sendto_otherscript'] = {
449
475
  }, 100, input);
450
476
  }
451
477
  // Remove deleted inputs.
452
- for (let i = this.itemCount_; this.getInput('ARG' + i); i++) {
453
- this.removeInput('ARG' + i);
478
+ try {
479
+ for (let i = this.itemCount_; this.getInput('ARG' + i); i++) {
480
+ this.removeInput('ARG' + i);
481
+ }
482
+ } catch (e) {
483
+ // if the input does not exist, it means that the block was deleted
454
484
  }
455
485
 
486
+
456
487
  if (withStatement === undefined) {
457
488
  withStatement = this.getFieldValue('WITH_STATEMENT');
458
489
  withStatement = withStatement === true || withStatement === 'true' || withStatement === 'TRUE';
459
490
  }
460
491
 
461
- this.getInput('STATEMENT') && this.removeInput('STATEMENT');
492
+ try {
493
+ if (this.getInput('STATEMENT')) {
494
+ this.removeInput('STATEMENT');
495
+ }
496
+ } catch (e) {
497
+ // if the input does not exist, it means that the block was deleted
498
+ }
462
499
 
463
500
  // Add or remove a statement Input.
464
501
  if (withStatement) {
@@ -142,21 +142,31 @@ Blockly.Blocks['logic_switch_case'] = {
142
142
  while (caseBlock) {
143
143
  switch (caseBlock.type) {
144
144
  case'case_incaseof':
145
- const caseconditionInput = this.getInput('CASECONDITION' + x);
146
- const caseInput = this.getInput('CASE' + x);
147
- caseBlock.valueConnection_ = caseconditionInput && caseconditionInput.connection.targetConnection;
148
- caseBlock.statementConnection_ = caseInput && caseInput.connection.targetConnection;
145
+ let caseconditionInput;
146
+ let caseInput;
147
+ try {
148
+ caseconditionInput = this.getInput('CASECONDITION' + x);
149
+ caseInput = this.getInput('CASE' + x);
150
+ } catch (e) {
151
+ // ignore
152
+ }
153
+ caseBlock.valueConnection_ = caseconditionInput?.connection.targetConnection;
154
+ caseBlock.statementConnection_ = caseInput?.connection.targetConnection;
149
155
  x++;
150
156
  break;
151
157
  case'case_default':
152
- const defaultInput = this.getInput('ONDEFAULT');
153
- caseBlock.satementConnection_ = defaultInput && defaultInput.connection.targetConnection;
158
+ let defaultInput;
159
+ try {
160
+ defaultInput = this.getInput('ONDEFAULT');
161
+ } catch (e) {
162
+ // ignore
163
+ }
164
+ caseBlock.statementConnection_ = defaultInput?.connection.targetConnection;
154
165
  break;
155
166
  default:
156
167
  throw 'Unknown block type';
157
168
  }
158
- caseBlock = caseBlock.nextConnection &&
159
- caseBlock.nextConnection.targetBlock();
169
+ caseBlock = caseBlock.nextConnection?.targetBlock();
160
170
  }
161
171
  },
162
172
  };
@@ -167,7 +167,12 @@ Blockly.Blocks['control'] = {
167
167
  },
168
168
  updateShape_: function (delayInput) {
169
169
  // Add or remove a delay Input.
170
- let inputExists = this.getInput('DELAY');
170
+ let inputExists;
171
+ try {
172
+ inputExists = this.getInput('DELAY');
173
+ } catch (e) {
174
+ // ignore
175
+ }
171
176
 
172
177
  if (delayInput) {
173
178
  if (!inputExists) {
@@ -184,7 +189,11 @@ Blockly.Blocks['control'] = {
184
189
  this.removeInput('DELAY');
185
190
  }
186
191
 
187
- inputExists = this.getInput('CLEAR_RUNNING_INPUT');
192
+ try {
193
+ inputExists = this.getInput('CLEAR_RUNNING_INPUT');
194
+ } catch (e) {
195
+ inputExists = null;
196
+ }
188
197
 
189
198
  if (delayInput) {
190
199
  if (!inputExists) {
@@ -277,7 +286,12 @@ Blockly.Blocks['toggle'] = {
277
286
  },
278
287
  updateShape_: function (delayInput) {
279
288
  // Add or remove a delay Input.
280
- let inputExists = this.getInput('DELAY');
289
+ let inputExists;
290
+ try {
291
+ inputExists = this.getInput('DELAY');
292
+ } catch (e) {
293
+ inputExists = null;
294
+ }
281
295
 
282
296
  if (delayInput) {
283
297
  if (!inputExists) {
@@ -295,7 +309,11 @@ Blockly.Blocks['toggle'] = {
295
309
  this.removeInput('DELAY');
296
310
  }
297
311
 
298
- inputExists = this.getInput('CLEAR_RUNNING_INPUT');
312
+ try {
313
+ inputExists = this.getInput('CLEAR_RUNNING_INPUT');
314
+ } catch (e) {
315
+ inputExists = null;
316
+ }
299
317
 
300
318
  if (delayInput) {
301
319
  if (!inputExists) {
@@ -413,7 +431,12 @@ Blockly.Blocks['update'] = {
413
431
  },
414
432
  updateShape_: function (delayInput) {
415
433
  // Add or remove a delay Input.
416
- let inputExists = this.getInput('DELAY');
434
+ let inputExists;
435
+ try {
436
+ inputExists = this.getInput('DELAY');
437
+ } catch (e){
438
+ inputExists = null;
439
+ }
417
440
 
418
441
  if (delayInput) {
419
442
  if (!inputExists) {
@@ -431,7 +454,11 @@ Blockly.Blocks['update'] = {
431
454
  this.removeInput('DELAY');
432
455
  }
433
456
 
434
- inputExists = this.getInput('CLEAR_RUNNING_INPUT');
457
+ try {
458
+ inputExists = this.getInput('CLEAR_RUNNING_INPUT');
459
+ } catch (e) {
460
+ inputExists = null;
461
+ }
435
462
 
436
463
  if (delayInput) {
437
464
  if (!inputExists) {
@@ -59,3 +59,46 @@ Blockly.JavaScript.forBlock['text_contains'] = function (block) {
59
59
 
60
60
  return [`String(${vValue}).includes(${vFind})`, Blockly.JavaScript.ORDER_ATOMIC];
61
61
  };
62
+
63
+ // --- Text formatValue --------------------------------------------------
64
+
65
+ Blockly.Blocks['text_format_value'] = {
66
+ // Checkbox.
67
+ init: function () {
68
+ this.appendValueInput('VALUE')
69
+ .appendField(Blockly.Translate('text_format_value'))
70
+ .setCheck(null);
71
+
72
+ this.appendDummyInput()
73
+ .appendField(Blockly.Translate('text_format_value_format'))
74
+ .appendField(new Blockly.FieldDropdown([
75
+ ['System', 'system'],
76
+ ['.,', '.,'],
77
+ [',.', ',.'],
78
+ [' .', ' .'],
79
+ ]), 'FORMAT');
80
+
81
+ this.appendValueInput('DECIMALS')
82
+ .appendField(Blockly.Translate('text_format_value_decimals'));
83
+
84
+
85
+ this.setInputsInline(true);
86
+ this.setOutput(true, 'String');
87
+
88
+ this.setColour('%{BKY_TEXTS_HUE}');
89
+
90
+ //this.setTooltip(Blockly.Translate('text_format_value_tooltip'));
91
+ },
92
+ };
93
+
94
+ Blockly.JavaScript.forBlock['text_format_value'] = function (block) {
95
+ const vValue = Blockly.JavaScript.valueToCode(block, 'VALUE', Blockly.JavaScript.ORDER_ATOMIC);
96
+ const vDecimals = Blockly.JavaScript.valueToCode(block, 'DECIMALS', Blockly.JavaScript.ORDER_ATOMIC);
97
+ const fFormat = block.getFieldValue('FORMAT');
98
+
99
+ if (fFormat !== 'system') {
100
+ return [`formatValue(parseFloat(${vValue}), ${vDecimals}, '${fFormat}')`, Blockly.JavaScript.ORDER_ATOMIC];
101
+ }
102
+
103
+ return [`formatValue(parseFloat(${vValue}), ${vDecimals})`, Blockly.JavaScript.ORDER_ATOMIC];
104
+ };
@@ -85,11 +85,20 @@ Blockly.Blocks['time_compare_ex'] = {
85
85
  isBetween = this.getFieldValue('OPTION') === 'between' || this.getFieldValue('OPTION') === 'not between';
86
86
  }
87
87
  // Add or remove a delay Input.
88
- let inputExists = this.getInput('END_TIME');
88
+ let inputExists;
89
+ try {
90
+ inputExists = this.getInput('END_TIME');
91
+ } catch (e) {
92
+ inputExists = null;
93
+ }
89
94
 
90
95
  if (isBetween) {
91
96
  if (!inputExists) {
92
- inputExists = this.getInput('CUSTOM_TIME');
97
+ try {
98
+ inputExists = this.getInput('CUSTOM_TIME');
99
+ } catch (e) {
100
+ inputExists = null;
101
+ }
93
102
 
94
103
  if (inputExists) {
95
104
  this.removeInput('CUSTOM_TIME');
@@ -130,7 +139,11 @@ Blockly.Blocks['time_compare_ex'] = {
130
139
  }
131
140
 
132
141
  useActualTime = useActualTime === 'true' || useActualTime === 'TRUE' || useActualTime === true;
133
- inputExists = this.getInput('CUSTOM_TIME');
142
+ try {
143
+ inputExists = this.getInput('CUSTOM_TIME');
144
+ } catch (e) {
145
+ inputExists = null;
146
+ }
134
147
 
135
148
  if (!useActualTime) {
136
149
  this.getInput('TIME_TEXT').fieldRow[0].setValue(Blockly.Translate('time_compare_custom_ex'));
@@ -152,11 +165,20 @@ Blockly.Blocks['time_compare_ex'] = {
152
165
  Blockly.JavaScript.forBlock['time_compare_ex'] = function (block) {
153
166
  const fOption = block.getFieldValue('OPTION');
154
167
  const vStartTime = Blockly.JavaScript.valueToCode(block, 'START_TIME', Blockly.JavaScript.ORDER_ATOMIC);
155
- let vEndTime = Blockly.JavaScript.valueToCode(block, 'END_TIME', Blockly.JavaScript.ORDER_ATOMIC);
156
- vEndTime = vEndTime || null;
157
-
158
- let vCustomTime = Blockly.JavaScript.valueToCode(block, 'CUSTOM_TIME', Blockly.JavaScript.ORDER_ATOMIC);
159
- vCustomTime = vCustomTime || null;
168
+ let vEndTime = null;
169
+ try {
170
+ vEndTime = Blockly.JavaScript.valueToCode(block, 'END_TIME', Blockly.JavaScript.ORDER_ATOMIC);
171
+ vEndTime = vEndTime || null;
172
+ } catch (e) {
173
+ // Ignore
174
+ }
175
+ let vCustomTime = null;
176
+ try {
177
+ vCustomTime = Blockly.JavaScript.valueToCode(block, 'CUSTOM_TIME', Blockly.JavaScript.ORDER_ATOMIC);
178
+ vCustomTime = vCustomTime || null;
179
+ } catch (e) {
180
+ // Ignore
181
+ }
160
182
 
161
183
  return [`compareTime(${vStartTime}, ${vEndTime}, '${fOption}', ${vCustomTime})`, Blockly.JavaScript.ORDER_ATOMIC];
162
184
  };
@@ -215,7 +237,12 @@ Blockly.Blocks['time_compare'] = {
215
237
  },
216
238
  updateShape_: function (isBetween) {
217
239
  // Add or remove a delay Input.
218
- const inputExists = this.getInput('END_TIME');
240
+ let inputExists;
241
+ try {
242
+ inputExists = this.getInput('END_TIME');
243
+ } catch (e) {
244
+ inputExists = null;
245
+ }
219
246
 
220
247
  if (isBetween) {
221
248
  if (!inputExists) {
@@ -235,7 +262,12 @@ Blockly.Blocks['time_compare'] = {
235
262
  Blockly.JavaScript.forBlock['time_compare'] = function (block) {
236
263
  const fOption = block.getFieldValue('OPTION');
237
264
  const fStartTime = block.getFieldValue('START_TIME');
238
- const fEndTime = block.getFieldValue('END_TIME');
265
+ let fEndTime = null;
266
+ try {
267
+ fEndTime = block.getFieldValue('END_TIME');
268
+ } catch (e) {
269
+
270
+ }
239
271
 
240
272
  return [`compareTime(${Blockly.JavaScript.quote_(fStartTime)}, ${fEndTime ? Blockly.JavaScript.quote_(fEndTime) : 'null'}, ${Blockly.JavaScript.quote_(fOption)})`, Blockly.JavaScript.ORDER_ATOMIC];
241
273
  };
@@ -333,7 +365,12 @@ Blockly.Blocks['time_get'] = {
333
365
  },
334
366
  updateShape_: function (isFormat, isLanguage) {
335
367
  // Add or remove a delay Input.
336
- let inputExists = this.getInput('FORMAT');
368
+ let inputExists;
369
+ try {
370
+ inputExists = this.getInput('FORMAT');
371
+ } catch (e) {
372
+ inputExists = null;
373
+ }
337
374
 
338
375
  if (isFormat) {
339
376
  if (!inputExists) {
@@ -345,7 +382,11 @@ Blockly.Blocks['time_get'] = {
345
382
  this.removeInput('FORMAT');
346
383
  }
347
384
 
348
- inputExists = this.getInput('LANGUAGE');
385
+ try {
386
+ inputExists = this.getInput('LANGUAGE');
387
+ } catch (e) {
388
+ inputExists = null;
389
+ }
349
390
 
350
391
  if (isLanguage) {
351
392
  if (!inputExists) {
@@ -140,9 +140,13 @@ Blockly.Blocks['on_ext'] = {
140
140
 
141
141
  // Disconnect any children that don't belong.
142
142
  for (let k = 0; k < this.itemCount_; k++) {
143
- const connection = this.getInput('OID' + k).connection.targetConnection;
144
- if (connection && connections.indexOf(connection) === -1) {
145
- connection.disconnect();
143
+ try {
144
+ const connection = this.getInput('OID' + k).connection.targetConnection;
145
+ if (connection && !connections.includes(connection)) {
146
+ connection.disconnect();
147
+ }
148
+ } catch (e) {
149
+ // Do nothing, input does not exist
146
150
  }
147
151
  }
148
152
 
@@ -167,11 +171,15 @@ Blockly.Blocks['on_ext'] = {
167
171
  let i = 0;
168
172
 
169
173
  while (itemBlock) {
170
- const input = this.getInput('OID' + i);
171
- itemBlock.valueConnection_ = input && input.connection.targetConnection;
174
+ let input;
175
+ try {
176
+ input = this.getInput('OID' + i);
177
+ } catch (e) {
178
+ input = null;
179
+ }
180
+ itemBlock.valueConnection_ = input?.connection.targetConnection;
172
181
  i++;
173
- itemBlock = itemBlock.nextConnection &&
174
- itemBlock.nextConnection.targetBlock();
182
+ itemBlock = itemBlock.nextConnection?.targetBlock();
175
183
  }
176
184
  },
177
185
  /**
@@ -181,15 +189,24 @@ Blockly.Blocks['on_ext'] = {
181
189
  */
182
190
  updateShape_: function () {
183
191
  let conditionValue = undefined;
184
- if (this.getInput('CONDITION')) {
185
- conditionValue = this.getFieldValue('CONDITION');
186
- this.removeInput('CONDITION');
192
+ try {
193
+ if (this.getInput('CONDITION')) {
194
+ conditionValue = this.getFieldValue('CONDITION');
195
+ this.removeInput('CONDITION');
196
+ }
197
+ } catch (e) {
198
+ // Do nothing, input does not exist
187
199
  }
188
200
 
201
+
189
202
  let conditionAckValue = undefined;
190
- if (this.getInput('ACK_CONDITION')) {
191
- conditionAckValue = this.getFieldValue('ACK_CONDITION');
192
- this.removeInput('ACK_CONDITION');
203
+ try {
204
+ if (this.getInput('ACK_CONDITION')) {
205
+ conditionAckValue = this.getFieldValue('ACK_CONDITION');
206
+ this.removeInput('ACK_CONDITION');
207
+ }
208
+ } catch (e) {
209
+ // Do nothing, input does not exist
193
210
  }
194
211
 
195
212
  let input;
@@ -206,7 +223,12 @@ Blockly.Blocks['on_ext'] = {
206
223
 
207
224
  let i;
208
225
  for (i = 0; i < this.itemCount_; i++) {
209
- let _input = this.getInput('OID' + i);
226
+ let _input;
227
+ try {
228
+ _input = this.getInput('OID' + i);
229
+ } catch (e) {
230
+ // Do nothing, input does not exist
231
+ }
210
232
  if (!_input) {
211
233
  _input = this.appendValueInput('OID' + i);
212
234
 
@@ -236,9 +258,13 @@ Blockly.Blocks['on_ext'] = {
236
258
  }
237
259
 
238
260
  // Remove deleted inputs.
239
- while (this.getInput('OID' + i)) {
240
- this.removeInput('OID' + i);
241
- i++;
261
+ try {
262
+ while (this.getInput('OID' + i)) {
263
+ this.removeInput('OID' + i);
264
+ i++;
265
+ }
266
+ } catch (e) {
267
+ // Do nothing, input does not exist
242
268
  }
243
269
 
244
270
  this.appendDummyInput('CONDITION')
@@ -1154,7 +1180,12 @@ Blockly.Blocks['cron_builder'] = {
1154
1180
  updateShape_: function (withSeconds) {
1155
1181
  this.seconds_ = withSeconds;
1156
1182
  // Add or remove a statement Input.
1157
- const inputExists = this.getInput('SECONDS');
1183
+ let inputExists;
1184
+ try {
1185
+ inputExists = this.getInput('SECONDS');
1186
+ } catch (e) {
1187
+ inputExists = null;
1188
+ }
1158
1189
 
1159
1190
  if (withSeconds) {
1160
1191
  if (!inputExists) {
@@ -339,6 +339,10 @@ Blockly.Words['text_newline_tooltip'] = { en: 'Places new line in
339
339
  Blockly.Words['text_contains'] = { en: 'the text', de: 'der Text', ru: 'текст', pt: 'o texto', nl: 'de tekst', fr: 'le texte', it: 'il testo', es: 'el texto', pl: 'tekst', uk: 'текст', 'zh-cn': '文本' };
340
340
  Blockly.Words['text_contains_value'] = { en: 'contains value', de: 'enthält den Wert', ru: 'содержит значение', pt: 'contém valor', nl: 'bevat waarde', fr: 'contient la valeur', it: 'contiene valore', es: 'contiene valor', pl: 'zawiera wartość', uk: 'містить значення', 'zh-cn': '包含值' };
341
341
 
342
+ Blockly.Words['text_format_value'] = { en: 'value to text', de: 'Wert zu Text', ru: 'значение в текст', pt: 'valor em texto', nl: 'waarde voor tekst', fr: 'valeur/texte', it: 'valore a testo', es: 'valor al texto', pl: 'wartość do tekstu', uk: 'значення до тексту', 'zh-cn': '将值转换为文本' };
343
+ Blockly.Words['text_format_value_format'] = { en: 'with format', de: 'mit Format', ru: 'с форматом', pt: 'com formato', nl: 'met formaat', fr: 'avec format', it: 'in formato', es: 'con formato', pl: 'z formatem', uk: 'з форматом', 'zh-cn': '带格式' };
344
+ Blockly.Words['text_format_value_decimals'] = { en: 'decimal places', de: 'Dezimalstellen', ru: 'десятичные знаки', pt: 'casas decimais', nl: 'cijfers achter de komma', fr: 'décimales', it: 'cifre decimali', es: 'decimales', pl: 'miejsca po przecinku', uk: 'десяткові знаки', 'zh-cn': '小数位数' };
345
+
342
346
  // --- system math --------------------------------------------------
343
347
  Blockly.Words['math_rndfixed_round'] = { en: 'Round', de: 'Runde', ru: 'Раунд', pt: 'Arredondar', nl: 'Afronden', fr: 'Arrondir', it: 'Arrotondare', es: 'Redondea', pl: 'Round', uk: 'Круглий', 'zh-cn': '约' };
344
348
  Blockly.Words['math_rndfixed_to'] = { en: 'to', de: 'auf', ru: 'в', pt: 'para', nl: 'naar', fr: 'à', it: 'a', es: 'a', pl: 'to', uk: 'до', 'zh-cn': '至' };
@@ -1 +1 @@
1
- {"id":"iobroker_javascript","name":"iobroker_javascript","metaData":{"name":"iobroker_javascript","type":"app","buildInfo":{"buildVersion":"1.0.0","buildName":"iobroker_javascript"},"remoteEntry":{"name":"remoteEntry.js","path":"","type":"module"},"ssrRemoteEntry":{"name":"remoteEntry.js","path":"","type":"module"},"types":{"path":"","name":""},"globalName":"iobroker_javascript","pluginVersion":"0.2.5","publicPath":"./"},"shared":[{"id":"iobroker_javascript:@iobroker/adapter-react-v5","name":"@iobroker/adapter-react-v5","version":"7.7.0","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-JSzqpJXf.js","assets/createSvgIcon-BQT-7-GS.js","assets/iobroker_javascript__loadShare__react__loadShare__-BiJPUKBK.js","assets/_commonjsHelpers-Cpj98o6Y.js","assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js","assets/index-DnqHzUyv.js","assets/Save-BKC3BS3x.js","assets/useTheme-DF6qfrtI.js","assets/index-Dm1jc4t6.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@mui/material","name":"@mui/material","version":"6.4.12","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-glyB1sbj.js","assets/createSvgIcon-BQT-7-GS.js","assets/iobroker_javascript__loadShare__react__loadShare__-BiJPUKBK.js","assets/_commonjsHelpers-Cpj98o6Y.js","assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js","assets/inheritsLoose--KnFDOw1.js","assets/useTheme-DF6qfrtI.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react-dom","name":"react-dom","version":"18.3.1","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-x0m5vR1T.js","assets/_commonjsHelpers-Cpj98o6Y.js","assets/iobroker_javascript__loadShare__react__loadShare__-BiJPUKBK.js","assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react","name":"react","version":"18.3.1","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-Do-nCdWy.js","assets/_commonjsHelpers-Cpj98o6Y.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:prop-types","name":"prop-types","version":"15.8.1","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-DQiceR5U.js","assets/_commonjsHelpers-Cpj98o6Y.js"]},"css":{"async":[],"sync":[]}}}],"remotes":[],"exposes":[]}
1
+ {"id":"iobroker_javascript","name":"iobroker_javascript","metaData":{"name":"iobroker_javascript","type":"app","buildInfo":{"buildVersion":"1.0.0","buildName":"iobroker_javascript"},"remoteEntry":{"name":"remoteEntry.js","path":"","type":"module"},"ssrRemoteEntry":{"name":"remoteEntry.js","path":"","type":"module"},"types":{"path":"","name":""},"globalName":"iobroker_javascript","pluginVersion":"0.2.5","publicPath":"./"},"shared":[{"id":"iobroker_javascript:@iobroker/adapter-react-v5","name":"@iobroker/adapter-react-v5","version":"7.7.1","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-jqxhK8Zt.js","assets/createSvgIcon-DgblCazZ.js","assets/iobroker_javascript__loadShare__react__loadShare__-BiJPUKBK.js","assets/_commonjsHelpers-Cpj98o6Y.js","assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js","assets/index-CuLNesUT.js","assets/Save-BCszXKYf.js","assets/useTheme-DV2tO1lV.js","assets/index-Dm1jc4t6.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@mui/material","name":"@mui/material","version":"6.5.0","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-DOCky4vY.js","assets/createSvgIcon-DgblCazZ.js","assets/iobroker_javascript__loadShare__react__loadShare__-BiJPUKBK.js","assets/_commonjsHelpers-Cpj98o6Y.js","assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js","assets/inheritsLoose-DSwHLF2T.js","assets/useTheme-DV2tO1lV.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react-dom","name":"react-dom","version":"18.3.1","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-x0m5vR1T.js","assets/_commonjsHelpers-Cpj98o6Y.js","assets/iobroker_javascript__loadShare__react__loadShare__-BiJPUKBK.js","assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react","name":"react","version":"18.3.1","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-Do-nCdWy.js","assets/_commonjsHelpers-Cpj98o6Y.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:prop-types","name":"prop-types","version":"15.8.1","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-DQiceR5U.js","assets/_commonjsHelpers-Cpj98o6Y.js"]},"css":{"async":[],"sync":[]}}}],"remotes":[],"exposes":[]}
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/index-JSzqpJXf.js","./assets/createSvgIcon-BQT-7-GS.js","./assets/iobroker_javascript__loadShare__react__loadShare__-BiJPUKBK.js","./assets/_commonjsHelpers-Cpj98o6Y.js","./assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js","./assets/index-DnqHzUyv.js","./assets/Save-BKC3BS3x.js","./assets/useTheme-DF6qfrtI.js","./assets/index-Dm1jc4t6.js","./assets/index-glyB1sbj.js","./assets/inheritsLoose--KnFDOw1.js","./assets/index-x0m5vR1T.js","./assets/index-Do-nCdWy.js","./assets/index-DQiceR5U.js"])))=>i.map(i=>d[i]);
2
- import{i as d,a as m}from"./assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js";import s from"./assets/virtualExposes-BIHI7g3E.js";import{_ as a}from"./assets/preload-helper-Dp1pzeXC.js";const i={"@iobroker/adapter-react-v5":async()=>await a(()=>import("./assets/index-JSzqpJXf.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),"@mui/material":async()=>await a(()=>import("./assets/index-glyB1sbj.js"),__vite__mapDeps([9,1,2,3,4,10,7]),import.meta.url),"react-dom":async()=>await a(()=>import("./assets/index-x0m5vR1T.js").then(t=>t.i),__vite__mapDeps([11,3,2,4]),import.meta.url),react:async()=>await a(()=>import("./assets/index-Do-nCdWy.js").then(t=>t.i),__vite__mapDeps([12,3]),import.meta.url),"prop-types":async()=>await a(()=>import("./assets/index-DQiceR5U.js").then(t=>t.i),__vite__mapDeps([13,3]),import.meta.url)},o={"@iobroker/adapter-react-v5":{name:"@iobroker/adapter-react-v5",version:"7.7.0",scope:["default"],loaded:!1,from:"iobroker_javascript",async get(){o["@iobroker/adapter-react-v5"].loaded=!0;const{"@iobroker/adapter-react-v5":e}=i,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"@mui/material":{name:"@mui/material",version:"6.4.12",scope:["default"],loaded:!1,from:"iobroker_javascript",async get(){o["@mui/material"].loaded=!0;const{"@mui/material":e}=i,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"react-dom":{name:"react-dom",version:"18.3.1",scope:["default"],loaded:!1,from:"iobroker_javascript",async get(){o["react-dom"].loaded=!0;const{"react-dom":e}=i,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},react:{name:"react",version:"18.3.1",scope:["default"],loaded:!1,from:"iobroker_javascript",async get(){o.react.loaded=!0;const{react:e}=i,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"prop-types":{name:"prop-types",version:"15.8.1",scope:["default"],loaded:!1,from:"iobroker_javascript",async get(){o["prop-types"].loaded=!0;const{"prop-types":e}=i,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}}},_=[],u={},p="default",c="iobroker_javascript";async function k(e={},t=[]){const r=d.init({name:c,remotes:_,shared:o,plugins:[],shareStrategy:"version-first"});var n=u[p];if(n||(n=u[p]={from:c}),!(t.indexOf(n)>=0)){t.push(n),r.initShareScopeMap("default",e);try{await Promise.all(await r.initializeSharing("default",{strategy:"version-first",from:"build",initScope:t}))}catch(l){console.error(l)}return m.initResolve(r),r}}function y(e){if(!(e in s))throw new Error(`Module ${e} does not exist in container.`);return s[e]().then(t=>()=>t)}export{y as get,k as init};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/index-jqxhK8Zt.js","./assets/createSvgIcon-DgblCazZ.js","./assets/iobroker_javascript__loadShare__react__loadShare__-BiJPUKBK.js","./assets/_commonjsHelpers-Cpj98o6Y.js","./assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js","./assets/index-CuLNesUT.js","./assets/Save-BCszXKYf.js","./assets/useTheme-DV2tO1lV.js","./assets/index-Dm1jc4t6.js","./assets/index-DOCky4vY.js","./assets/inheritsLoose-DSwHLF2T.js","./assets/index-x0m5vR1T.js","./assets/index-Do-nCdWy.js","./assets/index-DQiceR5U.js"])))=>i.map(i=>d[i]);
2
+ import{i as d,a as m}from"./assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js";import s from"./assets/virtualExposes-BIHI7g3E.js";import{_ as a}from"./assets/preload-helper-Dp1pzeXC.js";const i={"@iobroker/adapter-react-v5":async()=>await a(()=>import("./assets/index-jqxhK8Zt.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),"@mui/material":async()=>await a(()=>import("./assets/index-DOCky4vY.js"),__vite__mapDeps([9,1,2,3,4,10,7]),import.meta.url),"react-dom":async()=>await a(()=>import("./assets/index-x0m5vR1T.js").then(t=>t.i),__vite__mapDeps([11,3,2,4]),import.meta.url),react:async()=>await a(()=>import("./assets/index-Do-nCdWy.js").then(t=>t.i),__vite__mapDeps([12,3]),import.meta.url),"prop-types":async()=>await a(()=>import("./assets/index-DQiceR5U.js").then(t=>t.i),__vite__mapDeps([13,3]),import.meta.url)},o={"@iobroker/adapter-react-v5":{name:"@iobroker/adapter-react-v5",version:"7.7.1",scope:["default"],loaded:!1,from:"iobroker_javascript",async get(){o["@iobroker/adapter-react-v5"].loaded=!0;const{"@iobroker/adapter-react-v5":e}=i,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"@mui/material":{name:"@mui/material",version:"6.5.0",scope:["default"],loaded:!1,from:"iobroker_javascript",async get(){o["@mui/material"].loaded=!0;const{"@mui/material":e}=i,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"react-dom":{name:"react-dom",version:"18.3.1",scope:["default"],loaded:!1,from:"iobroker_javascript",async get(){o["react-dom"].loaded=!0;const{"react-dom":e}=i,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},react:{name:"react",version:"18.3.1",scope:["default"],loaded:!1,from:"iobroker_javascript",async get(){o.react.loaded=!0;const{react:e}=i,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"prop-types":{name:"prop-types",version:"15.8.1",scope:["default"],loaded:!1,from:"iobroker_javascript",async get(){o["prop-types"].loaded=!0;const{"prop-types":e}=i,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}}},_=[],u={},p="default",c="iobroker_javascript";async function k(e={},t=[]){const r=d.init({name:c,remotes:_,shared:o,plugins:[],shareStrategy:"version-first"});var n=u[p];if(n||(n=u[p]={from:c}),!(t.indexOf(n)>=0)){t.push(n),r.initShareScopeMap("default",e);try{await Promise.all(await r.initializeSharing("default",{strategy:"version-first",from:"build",initScope:t}))}catch(l){console.error(l)}return m.initResolve(r),r}}function y(e){if(!(e in s))throw new Error(`Module ${e} does not exist in container.`);return s[e]().then(t=>()=>t)}export{y as get,k as init};
package/admin/tab.html CHANGED
@@ -115,13 +115,13 @@
115
115
  type="text/javascript"
116
116
  src="google-blockly/own/blocks_object.js"
117
117
  ></script>
118
- <script type="module" crossorigin src="./assets/index-Cek-i92T.js"></script>
118
+ <script type="module" crossorigin src="./assets/index-BzksVH7W.js"></script>
119
119
  <link rel="modulepreload" crossorigin href="./assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js">
120
120
  <link rel="modulepreload" crossorigin href="./assets/_commonjsHelpers-Cpj98o6Y.js">
121
121
  <link rel="modulepreload" crossorigin href="./assets/iobroker_javascript__loadShare__react__loadShare__-BiJPUKBK.js">
122
- <link rel="modulepreload" crossorigin href="./assets/createSvgIcon-BQT-7-GS.js">
123
- <link rel="modulepreload" crossorigin href="./assets/inheritsLoose--KnFDOw1.js">
124
- <link rel="modulepreload" crossorigin href="./assets/index-DnqHzUyv.js">
122
+ <link rel="modulepreload" crossorigin href="./assets/createSvgIcon-DgblCazZ.js">
123
+ <link rel="modulepreload" crossorigin href="./assets/inheritsLoose-DSwHLF2T.js">
124
+ <link rel="modulepreload" crossorigin href="./assets/index-CuLNesUT.js">
125
125
  <link rel="modulepreload" crossorigin href="./assets/preload-helper-Dp1pzeXC.js">
126
126
  <link rel="stylesheet" crossorigin href="./assets/index-Dr_ZFwru.css">
127
127
  </head>
@@ -457,6 +457,19 @@
457
457
  <shadow type="text">text</shadow>
458
458
  </value>
459
459
  </block>
460
+ <block type="text_format_value">
461
+ <value name="VALUE">
462
+ <shadow type="math_number">
463
+ <field name="NUM">1.23</field>
464
+ </shadow>
465
+ </value>
466
+ <field name="FORMAT">system</field>
467
+ <value name="DECIMALS">
468
+ <shadow type="math_number">
469
+ <field name="NUM">2</field>
470
+ </shadow>
471
+ </value>
472
+ </block>
460
473
  </category>
461
474
  <category
462
475
  name="{catLists}"