blockly 8.0.1-beta.0 → 8.0.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.
Files changed (145) hide show
  1. package/blockly.min.js +848 -855
  2. package/blockly_compressed.js +666 -670
  3. package/blockly_compressed.js.map +1 -1
  4. package/blocks/lists.js +5 -11
  5. package/blocks/logic.js +5 -11
  6. package/blocks/loops.js +2 -2
  7. package/blocks/procedures.js +4 -5
  8. package/blocks/text.js +5 -11
  9. package/blocks_compressed.js +143 -148
  10. package/blocks_compressed.js.map +1 -1
  11. package/core/serialization/blocks.js +7 -1
  12. package/core/utils/toolbox.js +1 -1
  13. package/dart_compressed.js +43 -40
  14. package/dart_compressed.js.map +1 -1
  15. package/javascript_compressed.js +39 -37
  16. package/javascript_compressed.js.map +1 -1
  17. package/lua_compressed.js +42 -39
  18. package/lua_compressed.js.map +1 -1
  19. package/msg/ab.js +2 -1
  20. package/msg/ace.js +2 -1
  21. package/msg/af.js +2 -1
  22. package/msg/am.js +2 -1
  23. package/msg/ar.js +2 -1
  24. package/msg/ast.js +2 -1
  25. package/msg/az.js +4 -3
  26. package/msg/ba.js +2 -1
  27. package/msg/bcc.js +2 -1
  28. package/msg/be-tarask.js +2 -1
  29. package/msg/be.js +6 -5
  30. package/msg/bg.js +2 -1
  31. package/msg/bn.js +2 -1
  32. package/msg/br.js +2 -1
  33. package/msg/bs.js +2 -1
  34. package/msg/ca.js +2 -1
  35. package/msg/cdo.js +2 -1
  36. package/msg/cs.js +17 -16
  37. package/msg/da.js +2 -1
  38. package/msg/de.js +3 -2
  39. package/msg/diq.js +3 -2
  40. package/msg/dty.js +2 -1
  41. package/msg/ee.js +2 -1
  42. package/msg/el.js +2 -1
  43. package/msg/en-gb.js +2 -1
  44. package/msg/en.js +2 -1
  45. package/msg/eo.js +3 -2
  46. package/msg/es.js +3 -2
  47. package/msg/et.js +2 -1
  48. package/msg/eu.js +2 -1
  49. package/msg/fa.js +3 -2
  50. package/msg/fi.js +2 -1
  51. package/msg/fo.js +2 -1
  52. package/msg/fr.js +6 -5
  53. package/msg/frr.js +2 -1
  54. package/msg/gl.js +2 -1
  55. package/msg/gn.js +2 -1
  56. package/msg/gor.js +2 -1
  57. package/msg/ha.js +2 -1
  58. package/msg/hak.js +2 -1
  59. package/msg/he.js +3 -2
  60. package/msg/hi.js +2 -1
  61. package/msg/hr.js +4 -3
  62. package/msg/hrx.js +2 -1
  63. package/msg/hu.js +2 -1
  64. package/msg/hy.js +4 -3
  65. package/msg/ia.js +2 -1
  66. package/msg/id.js +14 -13
  67. package/msg/ig.js +2 -1
  68. package/msg/inh.js +16 -15
  69. package/msg/is.js +2 -1
  70. package/msg/it.js +2 -1
  71. package/msg/ja.js +9 -8
  72. package/msg/ka.js +2 -1
  73. package/msg/kab.js +2 -1
  74. package/msg/kbd-cyrl.js +2 -1
  75. package/msg/km.js +2 -1
  76. package/msg/kn.js +2 -1
  77. package/msg/ko.js +2 -1
  78. package/msg/ksh.js +2 -1
  79. package/msg/ku-latn.js +2 -1
  80. package/msg/ky.js +2 -1
  81. package/msg/la.js +2 -1
  82. package/msg/lb.js +2 -1
  83. package/msg/lki.js +2 -1
  84. package/msg/lo.js +2 -1
  85. package/msg/lrc.js +2 -1
  86. package/msg/lt.js +2 -1
  87. package/msg/lv.js +31 -30
  88. package/msg/mg.js +2 -1
  89. package/msg/mk.js +2 -1
  90. package/msg/ml.js +2 -1
  91. package/msg/mnw.js +2 -1
  92. package/msg/ms.js +2 -1
  93. package/msg/my.js +2 -1
  94. package/msg/mzn.js +2 -1
  95. package/msg/nb.js +2 -1
  96. package/msg/ne.js +2 -1
  97. package/msg/nl.js +2 -1
  98. package/msg/oc.js +2 -1
  99. package/msg/olo.js +2 -1
  100. package/msg/pa.js +5 -4
  101. package/msg/pl.js +2 -1
  102. package/msg/pms.js +2 -1
  103. package/msg/ps.js +2 -1
  104. package/msg/pt-br.js +2 -1
  105. package/msg/pt.js +2 -1
  106. package/msg/ro.js +2 -1
  107. package/msg/ru.js +2 -1
  108. package/msg/sc.js +2 -1
  109. package/msg/sco.js +2 -1
  110. package/msg/sd.js +2 -1
  111. package/msg/shn.js +2 -1
  112. package/msg/si.js +2 -1
  113. package/msg/sk.js +2 -1
  114. package/msg/skr-arab.js +2 -1
  115. package/msg/sl.js +2 -1
  116. package/msg/smn.js +2 -1
  117. package/msg/sq.js +2 -1
  118. package/msg/sr-latn.js +2 -1
  119. package/msg/sr.js +2 -1
  120. package/msg/sv.js +2 -1
  121. package/msg/sw.js +2 -1
  122. package/msg/ta.js +2 -1
  123. package/msg/tcy.js +2 -1
  124. package/msg/te.js +3 -2
  125. package/msg/th.js +2 -1
  126. package/msg/ti.js +2 -1
  127. package/msg/tl.js +2 -1
  128. package/msg/tlh.js +2 -1
  129. package/msg/tr.js +2 -1
  130. package/msg/ug-arab.js +2 -1
  131. package/msg/uk.js +2 -1
  132. package/msg/ur.js +2 -1
  133. package/msg/uz.js +2 -1
  134. package/msg/vi.js +2 -1
  135. package/msg/xmf.js +2 -1
  136. package/msg/yo.js +2 -1
  137. package/msg/yue.js +3 -2
  138. package/msg/zgh.js +2 -1
  139. package/msg/zh-hans.js +5 -4
  140. package/msg/zh-hant.js +5 -4
  141. package/package.json +1 -1
  142. package/php_compressed.js +42 -38
  143. package/php_compressed.js.map +1 -1
  144. package/python_compressed.js +25 -26
  145. package/python_compressed.js.map +1 -1
package/blocks/lists.js CHANGED
@@ -198,13 +198,10 @@ blocks['lists_create_with'] = {
198
198
  let itemBlock = containerBlock.getInputTargetBlock('STACK');
199
199
  // Count number of inputs.
200
200
  const connections = [];
201
- while (itemBlock) {
202
- if (itemBlock.isInsertionMarker()) {
203
- itemBlock = itemBlock.getNextBlock();
204
- continue;
205
- }
201
+ while (itemBlock && !itemBlock.isInsertionMarker()) {
206
202
  connections.push(itemBlock.valueConnection_);
207
- itemBlock = itemBlock.getNextBlock();
203
+ itemBlock =
204
+ itemBlock.nextConnection && itemBlock.nextConnection.targetBlock();
208
205
  }
209
206
  // Disconnect any children that don't belong.
210
207
  for (let i = 0; i < this.itemCount_; i++) {
@@ -229,13 +226,10 @@ blocks['lists_create_with'] = {
229
226
  let itemBlock = containerBlock.getInputTargetBlock('STACK');
230
227
  let i = 0;
231
228
  while (itemBlock) {
232
- if (itemBlock.isInsertionMarker()) {
233
- itemBlock = itemBlock.getNextBlock();
234
- continue;
235
- }
236
229
  const input = this.getInput('ADD' + i);
237
230
  itemBlock.valueConnection_ = input && input.connection.targetConnection;
238
- itemBlock = itemBlock.getNextBlock();
231
+ itemBlock =
232
+ itemBlock.nextConnection && itemBlock.nextConnection.targetBlock();
239
233
  i++;
240
234
  }
241
235
  },
package/blocks/logic.js CHANGED
@@ -394,11 +394,7 @@ const CONTROLS_IF_MUTATOR_MIXIN = {
394
394
  const valueConnections = [null];
395
395
  const statementConnections = [null];
396
396
  let elseStatementConnection = null;
397
- while (clauseBlock) {
398
- if (clauseBlock.isInsertionMarker()) {
399
- clauseBlock = clauseBlock.getNextBlock();
400
- continue;
401
- }
397
+ while (clauseBlock && !clauseBlock.isInsertionMarker()) {
402
398
  switch (clauseBlock.type) {
403
399
  case 'controls_if_elseif':
404
400
  this.elseifCount_++;
@@ -412,7 +408,8 @@ const CONTROLS_IF_MUTATOR_MIXIN = {
412
408
  default:
413
409
  throw TypeError('Unknown block type: ' + clauseBlock.type);
414
410
  }
415
- clauseBlock = clauseBlock.getNextBlock();
411
+ clauseBlock = clauseBlock.nextConnection &&
412
+ clauseBlock.nextConnection.targetBlock();
416
413
  }
417
414
  this.updateShape_();
418
415
  // Reconnect any child blocks.
@@ -428,10 +425,6 @@ const CONTROLS_IF_MUTATOR_MIXIN = {
428
425
  let clauseBlock = containerBlock.nextConnection.targetBlock();
429
426
  let i = 1;
430
427
  while (clauseBlock) {
431
- if (clauseBlock.isInsertionMarker()) {
432
- clauseBlock = clauseBlock.getNextBlock();
433
- continue;
434
- }
435
428
  switch (clauseBlock.type) {
436
429
  case 'controls_if_elseif': {
437
430
  const inputIf = this.getInput('IF' + i);
@@ -452,7 +445,8 @@ const CONTROLS_IF_MUTATOR_MIXIN = {
452
445
  default:
453
446
  throw TypeError('Unknown block type: ' + clauseBlock.type);
454
447
  }
455
- clauseBlock = clauseBlock.getNextBlock();
448
+ clauseBlock = clauseBlock.nextConnection &&
449
+ clauseBlock.nextConnection.targetBlock();
456
450
  }
457
451
  },
458
452
  /**
package/blocks/loops.js CHANGED
@@ -293,8 +293,8 @@ Extensions.register(
293
293
  * To add a new loop type add this to your code:
294
294
  *
295
295
  * // If using the Blockly npm package and es6 import syntax:
296
- * import {loops} from 'blockly/blocks';
297
- * loops.loopTypes.add('custom_loop');
296
+ * import {loopTypes} from 'blockly/blocks';
297
+ * loopTypes.add('custom_loop');
298
298
  *
299
299
  * // Else if using Closure Compiler and goog.modules:
300
300
  * const {loopTypes} = goog.require('Blockly.libraryBlocks.loops');
@@ -721,10 +721,10 @@ const PROCEDURE_CALL_COMMON = {
721
721
  if (!mutatorOpen) {
722
722
  this.quarkConnections_ = {};
723
723
  this.quarkIds_ = null;
724
- }
725
- if (!paramIds) {
726
- // Reset the quarks (a mutator is about to open).
727
- return;
724
+ } else {
725
+ // fix #6091 - this call could cause an error when outside if-else
726
+ // expanding block while mutating prevents another error (ancient fix)
727
+ this.setCollapsed(false);
728
728
  }
729
729
  // Test arguments (arrays of strings) for changes. '\n' is not a valid
730
730
  // argument name character, so it is a valid delimiter here.
@@ -736,7 +736,6 @@ const PROCEDURE_CALL_COMMON = {
736
736
  if (paramIds.length !== paramNames.length) {
737
737
  throw RangeError('paramNames and paramIds must be the same length.');
738
738
  }
739
- this.setCollapsed(false);
740
739
  if (!this.quarkIds_) {
741
740
  // Initialize tracking for this block.
742
741
  this.quarkConnections_ = {};
package/blocks/text.js CHANGED
@@ -781,13 +781,10 @@ const TEXT_JOIN_MUTATOR_MIXIN = {
781
781
  let itemBlock = containerBlock.getInputTargetBlock('STACK');
782
782
  // Count number of inputs.
783
783
  const connections = [];
784
- while (itemBlock) {
785
- if (itemBlock.isInsertionMarker()) {
786
- itemBlock = itemBlock.getNextBlock();
787
- continue;
788
- }
784
+ while (itemBlock && !itemBlock.isInsertionMarker()) {
789
785
  connections.push(itemBlock.valueConnection_);
790
- itemBlock = itemBlock.getNextBlock();
786
+ itemBlock =
787
+ itemBlock.nextConnection && itemBlock.nextConnection.targetBlock();
791
788
  }
792
789
  // Disconnect any children that don't belong.
793
790
  for (let i = 0; i < this.itemCount_; i++) {
@@ -812,13 +809,10 @@ const TEXT_JOIN_MUTATOR_MIXIN = {
812
809
  let itemBlock = containerBlock.getInputTargetBlock('STACK');
813
810
  let i = 0;
814
811
  while (itemBlock) {
815
- if (itemBlock.isInsertionMarker()) {
816
- itemBlock = itemBlock.getNextBlock();
817
- continue;
818
- }
819
812
  const input = this.getInput('ADD' + i);
820
813
  itemBlock.valueConnection_ = input && input.connection.targetConnection;
821
- itemBlock = itemBlock.getNextBlock();
814
+ itemBlock =
815
+ itemBlock.nextConnection && itemBlock.nextConnection.targetBlock();
822
816
  i++;
823
817
  }
824
818
  },