scratch-blocks 2.0.2 → 2.0.3

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 (274) hide show
  1. package/commitlint.config.js +2 -2
  2. package/dist/main.mjs +1 -2
  3. package/dist/types/msg/scratch_msgs.d.ts.map +1 -1
  4. package/dist/types/src/block_reporting.d.ts.map +1 -1
  5. package/dist/types/src/blocks/colour.d.ts +0 -19
  6. package/dist/types/src/blocks/colour.d.ts.map +1 -1
  7. package/dist/types/src/blocks/control.d.ts +0 -19
  8. package/dist/types/src/blocks/control.d.ts.map +1 -1
  9. package/dist/types/src/blocks/data.d.ts +0 -19
  10. package/dist/types/src/blocks/data.d.ts.map +1 -1
  11. package/dist/types/src/blocks/event.d.ts +0 -19
  12. package/dist/types/src/blocks/event.d.ts.map +1 -1
  13. package/dist/types/src/blocks/looks.d.ts +0 -19
  14. package/dist/types/src/blocks/looks.d.ts.map +1 -1
  15. package/dist/types/src/blocks/math.d.ts +0 -19
  16. package/dist/types/src/blocks/math.d.ts.map +1 -1
  17. package/dist/types/src/blocks/matrix.d.ts +0 -19
  18. package/dist/types/src/blocks/matrix.d.ts.map +1 -1
  19. package/dist/types/src/blocks/motion.d.ts +0 -19
  20. package/dist/types/src/blocks/motion.d.ts.map +1 -1
  21. package/dist/types/src/blocks/note.d.ts +0 -19
  22. package/dist/types/src/blocks/note.d.ts.map +1 -1
  23. package/dist/types/src/blocks/operators.d.ts +0 -19
  24. package/dist/types/src/blocks/operators.d.ts.map +1 -1
  25. package/dist/types/src/blocks/procedures.d.ts +6 -9
  26. package/dist/types/src/blocks/procedures.d.ts.map +1 -1
  27. package/dist/types/src/blocks/sensing.d.ts +0 -19
  28. package/dist/types/src/blocks/sensing.d.ts.map +1 -1
  29. package/dist/types/src/blocks/sound.d.ts +0 -19
  30. package/dist/types/src/blocks/sound.d.ts.map +1 -1
  31. package/dist/types/src/blocks/text.d.ts +0 -19
  32. package/dist/types/src/blocks/text.d.ts.map +1 -1
  33. package/dist/types/src/blocks/vertical_extensions.d.ts +0 -19
  34. package/dist/types/src/blocks/vertical_extensions.d.ts.map +1 -1
  35. package/dist/types/src/checkable_continuous_flyout.d.ts +2 -7
  36. package/dist/types/src/checkable_continuous_flyout.d.ts.map +1 -1
  37. package/dist/types/src/checkbox_bubble.d.ts +13 -12
  38. package/dist/types/src/checkbox_bubble.d.ts.map +1 -1
  39. package/dist/types/src/colours.d.ts.map +1 -1
  40. package/dist/types/src/constants.d.ts +0 -7
  41. package/dist/types/src/constants.d.ts.map +1 -1
  42. package/dist/types/src/context_menu_items.d.ts +0 -5
  43. package/dist/types/src/context_menu_items.d.ts.map +1 -1
  44. package/dist/types/src/data_category.d.ts +2 -4
  45. package/dist/types/src/data_category.d.ts.map +1 -1
  46. package/dist/types/src/events/events_block_comment_base.d.ts +2 -3
  47. package/dist/types/src/events/events_block_comment_base.d.ts.map +1 -1
  48. package/dist/types/src/events/events_block_comment_change.d.ts +0 -5
  49. package/dist/types/src/events/events_block_comment_change.d.ts.map +1 -1
  50. package/dist/types/src/events/events_block_comment_collapse.d.ts +0 -5
  51. package/dist/types/src/events/events_block_comment_collapse.d.ts.map +1 -1
  52. package/dist/types/src/events/events_block_comment_create.d.ts +0 -5
  53. package/dist/types/src/events/events_block_comment_create.d.ts.map +1 -1
  54. package/dist/types/src/events/events_block_comment_delete.d.ts +0 -5
  55. package/dist/types/src/events/events_block_comment_delete.d.ts.map +1 -1
  56. package/dist/types/src/events/events_block_comment_move.d.ts +0 -5
  57. package/dist/types/src/events/events_block_comment_move.d.ts.map +1 -1
  58. package/dist/types/src/events/events_block_comment_resize.d.ts +0 -5
  59. package/dist/types/src/events/events_block_comment_resize.d.ts.map +1 -1
  60. package/dist/types/src/events/events_block_drag_end.d.ts +1 -2
  61. package/dist/types/src/events/events_block_drag_end.d.ts.map +1 -1
  62. package/dist/types/src/events/events_block_drag_outside.d.ts +1 -2
  63. package/dist/types/src/events/events_block_drag_outside.d.ts.map +1 -1
  64. package/dist/types/src/events/events_scratch_variable_create.d.ts +0 -5
  65. package/dist/types/src/events/events_scratch_variable_create.d.ts.map +1 -1
  66. package/dist/types/src/fields/field_colour_slider.d.ts +3 -27
  67. package/dist/types/src/fields/field_colour_slider.d.ts.map +1 -1
  68. package/dist/types/src/fields/field_matrix.d.ts +0 -19
  69. package/dist/types/src/fields/field_matrix.d.ts.map +1 -1
  70. package/dist/types/src/fields/field_note.d.ts +8 -23
  71. package/dist/types/src/fields/field_note.d.ts.map +1 -1
  72. package/dist/types/src/fields/field_textinput_removable.d.ts +2 -4
  73. package/dist/types/src/fields/field_textinput_removable.d.ts.map +1 -1
  74. package/dist/types/src/fields/field_variable_getter.d.ts +0 -19
  75. package/dist/types/src/fields/field_variable_getter.d.ts.map +1 -1
  76. package/dist/types/src/fields/field_vertical_separator.d.ts +0 -19
  77. package/dist/types/src/fields/field_vertical_separator.d.ts.map +1 -1
  78. package/dist/types/src/fields/scratch_field_angle.d.ts +0 -19
  79. package/dist/types/src/fields/scratch_field_angle.d.ts.map +1 -1
  80. package/dist/types/src/fields/scratch_field_dropdown.d.ts +0 -5
  81. package/dist/types/src/fields/scratch_field_dropdown.d.ts.map +1 -1
  82. package/dist/types/src/fields/scratch_field_number.d.ts +0 -19
  83. package/dist/types/src/fields/scratch_field_number.d.ts.map +1 -1
  84. package/dist/types/src/fields/scratch_field_variable.d.ts +4 -7
  85. package/dist/types/src/fields/scratch_field_variable.d.ts.map +1 -1
  86. package/dist/types/src/flyout_checkbox_icon.d.ts +2 -3
  87. package/dist/types/src/flyout_checkbox_icon.d.ts.map +1 -1
  88. package/dist/types/src/glows.d.ts +1 -3
  89. package/dist/types/src/glows.d.ts.map +1 -1
  90. package/dist/types/src/index.d.ts +50 -51
  91. package/dist/types/src/index.d.ts.map +1 -1
  92. package/dist/types/src/procedures.d.ts +6 -8
  93. package/dist/types/src/procedures.d.ts.map +1 -1
  94. package/dist/types/src/recyclable_block_flyout_inflater.d.ts +3 -5
  95. package/dist/types/src/recyclable_block_flyout_inflater.d.ts.map +1 -1
  96. package/dist/types/src/renderer/bowler_hat.d.ts +2 -3
  97. package/dist/types/src/renderer/bowler_hat.d.ts.map +1 -1
  98. package/dist/types/src/renderer/cat/cat_face.d.ts +6 -5
  99. package/dist/types/src/renderer/cat/cat_face.d.ts.map +1 -1
  100. package/dist/types/src/renderer/cat/constants.d.ts +2 -2
  101. package/dist/types/src/renderer/cat/constants.d.ts.map +1 -1
  102. package/dist/types/src/renderer/cat/drawer.d.ts +3 -4
  103. package/dist/types/src/renderer/cat/drawer.d.ts.map +1 -1
  104. package/dist/types/src/renderer/cat/path_object.d.ts +2 -3
  105. package/dist/types/src/renderer/cat/path_object.d.ts.map +1 -1
  106. package/dist/types/src/renderer/cat/render_info.d.ts +3 -4
  107. package/dist/types/src/renderer/cat/render_info.d.ts.map +1 -1
  108. package/dist/types/src/renderer/cat/renderer.d.ts +6 -7
  109. package/dist/types/src/renderer/cat/renderer.d.ts.map +1 -1
  110. package/dist/types/src/renderer/constants.d.ts +4 -4
  111. package/dist/types/src/renderer/constants.d.ts.map +1 -1
  112. package/dist/types/src/renderer/drawer.d.ts +5 -4
  113. package/dist/types/src/renderer/drawer.d.ts.map +1 -1
  114. package/dist/types/src/renderer/path_object.d.ts +1 -3
  115. package/dist/types/src/renderer/path_object.d.ts.map +1 -1
  116. package/dist/types/src/renderer/render_info.d.ts +3 -4
  117. package/dist/types/src/renderer/render_info.d.ts.map +1 -1
  118. package/dist/types/src/renderer/renderer.d.ts +8 -15
  119. package/dist/types/src/renderer/renderer.d.ts.map +1 -1
  120. package/dist/types/src/scratch_block_paster.d.ts +0 -5
  121. package/dist/types/src/scratch_block_paster.d.ts.map +1 -1
  122. package/dist/types/src/scratch_blocks_utils.d.ts +0 -20
  123. package/dist/types/src/scratch_blocks_utils.d.ts.map +1 -1
  124. package/dist/types/src/scratch_comment_bubble.d.ts +1 -4
  125. package/dist/types/src/scratch_comment_bubble.d.ts.map +1 -1
  126. package/dist/types/src/scratch_comment_icon.d.ts +2 -3
  127. package/dist/types/src/scratch_comment_icon.d.ts.map +1 -1
  128. package/dist/types/src/scratch_connection_checker.d.ts +0 -5
  129. package/dist/types/src/scratch_connection_checker.d.ts.map +1 -1
  130. package/dist/types/src/scratch_continuous_category.d.ts +5 -5
  131. package/dist/types/src/scratch_continuous_category.d.ts.map +1 -1
  132. package/dist/types/src/scratch_continuous_toolbox.d.ts +3 -6
  133. package/dist/types/src/scratch_continuous_toolbox.d.ts.map +1 -1
  134. package/dist/types/src/scratch_dragger.d.ts +1 -10
  135. package/dist/types/src/scratch_dragger.d.ts.map +1 -1
  136. package/dist/types/src/scratch_insertion_marker_previewer.d.ts +0 -5
  137. package/dist/types/src/scratch_insertion_marker_previewer.d.ts.map +1 -1
  138. package/dist/types/src/scratch_variable_map.d.ts +0 -5
  139. package/dist/types/src/scratch_variable_map.d.ts.map +1 -1
  140. package/dist/types/src/scratch_variable_model.d.ts +1 -2
  141. package/dist/types/src/scratch_variable_model.d.ts.map +1 -1
  142. package/dist/types/src/scratch_zoom_controls.d.ts +4 -6
  143. package/dist/types/src/scratch_zoom_controls.d.ts.map +1 -1
  144. package/dist/types/src/shadows.d.ts +2 -2
  145. package/dist/types/src/shadows.d.ts.map +1 -1
  146. package/dist/types/src/status_indicator_label.d.ts +4 -6
  147. package/dist/types/src/status_indicator_label.d.ts.map +1 -1
  148. package/dist/types/src/status_indicator_label_flyout_inflater.d.ts +1 -6
  149. package/dist/types/src/status_indicator_label_flyout_inflater.d.ts.map +1 -1
  150. package/dist/types/src/variables.d.ts +4 -8
  151. package/dist/types/src/variables.d.ts.map +1 -1
  152. package/dist/types/src/xml.d.ts +2 -3
  153. package/dist/types/src/xml.d.ts.map +1 -1
  154. package/dist/types/tests/jsunit/block_test.d.ts.map +1 -1
  155. package/dist/types/tests/jsunit/connection_db_test.d.ts.map +1 -1
  156. package/dist/types/tests/jsunit/connection_test.d.ts.map +1 -1
  157. package/dist/types/tests/jsunit/event_test.d.ts.map +1 -1
  158. package/dist/types/tests/jsunit/extensions_test.d.ts.map +1 -1
  159. package/dist/types/tests/jsunit/field_number_test.d.ts.map +1 -1
  160. package/dist/types/tests/jsunit/field_test.d.ts.map +1 -1
  161. package/dist/types/tests/jsunit/field_variable_getter_test.d.ts.map +1 -1
  162. package/dist/types/tests/jsunit/field_variable_test.d.ts.map +1 -1
  163. package/dist/types/tests/jsunit/gesture_test.d.ts.map +1 -1
  164. package/dist/types/tests/jsunit/input_test.d.ts +1 -0
  165. package/dist/types/tests/jsunit/input_test.d.ts.map +1 -1
  166. package/dist/types/tests/jsunit/json_test.d.ts.map +1 -1
  167. package/dist/types/tests/jsunit/names_test.d.ts.map +1 -1
  168. package/dist/types/tests/jsunit/procedure_test.d.ts.map +1 -1
  169. package/dist/types/tests/jsunit/scratch_block_comment_test.d.ts.map +1 -1
  170. package/dist/types/tests/jsunit/svg_test.d.ts.map +1 -1
  171. package/dist/types/tests/jsunit/test_utilities.d.ts.map +1 -1
  172. package/dist/types/tests/jsunit/utils_test.d.ts.map +1 -1
  173. package/dist/types/tests/jsunit/variable_map_test.d.ts.map +1 -1
  174. package/dist/types/tests/jsunit/variable_model_test.d.ts.map +1 -1
  175. package/dist/types/tests/jsunit/widget_div_test.d.ts.map +1 -1
  176. package/dist/types/tests/jsunit/workspace_comment_test.d.ts.map +1 -1
  177. package/dist/types/tests/jsunit/workspace_test.d.ts.map +1 -1
  178. package/dist/types/tests/jsunit/workspace_undo_redo_test.d.ts.map +1 -1
  179. package/dist/types/tests/jsunit/xml_test.d.ts.map +1 -1
  180. package/dist/types/tests/workspace_svg/workspace_svg_test.d.ts.map +1 -1
  181. package/eslint.config.mjs +69 -0
  182. package/i18n/create_scratch_msgs.js +44 -45
  183. package/i18n/js_to_json.js +40 -32
  184. package/i18n/json_to_js.js +37 -37
  185. package/i18n/sync_tx_translations.js +64 -65
  186. package/i18n/test_scratch_msgs.js +66 -63
  187. package/msg/js/en.js +289 -287
  188. package/msg/json/en.json +284 -284
  189. package/msg/messages.js +289 -287
  190. package/msg/scratch_msgs.js +22959 -22970
  191. package/package.json +6 -3
  192. package/prettier.config.mjs +3 -0
  193. package/release.config.js +7 -7
  194. package/renovate.json5 +7 -9
  195. package/src/block_reporting.ts +15 -18
  196. package/src/blocks/colour.ts +12 -15
  197. package/src/blocks/control.ts +167 -177
  198. package/src/blocks/data.ts +225 -292
  199. package/src/blocks/event.ts +121 -123
  200. package/src/blocks/looks.ts +165 -167
  201. package/src/blocks/math.ts +44 -46
  202. package/src/blocks/matrix.ts +11 -13
  203. package/src/blocks/motion.ts +151 -153
  204. package/src/blocks/note.ts +11 -13
  205. package/src/blocks/operators.ts +158 -160
  206. package/src/blocks/procedures.ts +415 -523
  207. package/src/blocks/sensing.ts +163 -165
  208. package/src/blocks/sound.ts +58 -60
  209. package/src/blocks/text.ts +10 -12
  210. package/src/blocks/vertical_extensions.ts +86 -102
  211. package/src/checkable_continuous_flyout.ts +25 -42
  212. package/src/checkbox_bubble.ts +83 -100
  213. package/src/colours.ts +35 -37
  214. package/src/constants.ts +22 -29
  215. package/src/context_menu_items.ts +56 -81
  216. package/src/css.ts +3 -4
  217. package/src/data_category.ts +137 -251
  218. package/src/events/events_block_comment_base.ts +21 -31
  219. package/src/events/events_block_comment_change.ts +21 -42
  220. package/src/events/events_block_comment_collapse.ts +22 -43
  221. package/src/events/events_block_comment_create.ts +29 -46
  222. package/src/events/events_block_comment_delete.ts +10 -19
  223. package/src/events/events_block_comment_move.ts +27 -52
  224. package/src/events/events_block_comment_resize.ts +28 -55
  225. package/src/events/events_block_drag_end.ts +16 -26
  226. package/src/events/events_block_drag_outside.ts +12 -22
  227. package/src/events/events_scratch_variable_create.ts +33 -56
  228. package/src/fields/field_colour_slider.ts +173 -228
  229. package/src/fields/field_matrix.ts +200 -269
  230. package/src/fields/field_note.ts +272 -377
  231. package/src/fields/field_textinput_removable.ts +25 -40
  232. package/src/fields/field_variable_getter.ts +26 -31
  233. package/src/fields/field_vertical_separator.ts +19 -24
  234. package/src/fields/scratch_field_angle.ts +150 -186
  235. package/src/fields/scratch_field_dropdown.ts +15 -19
  236. package/src/fields/scratch_field_number.ts +123 -180
  237. package/src/fields/scratch_field_variable.ts +54 -75
  238. package/src/flyout_checkbox_icon.ts +18 -28
  239. package/src/glows.ts +51 -58
  240. package/src/index.ts +119 -133
  241. package/src/procedures.ts +146 -213
  242. package/src/recyclable_block_flyout_inflater.ts +14 -25
  243. package/src/renderer/bowler_hat.ts +6 -8
  244. package/src/renderer/cat/cat_face.ts +98 -99
  245. package/src/renderer/cat/constants.ts +67 -87
  246. package/src/renderer/cat/drawer.ts +21 -27
  247. package/src/renderer/cat/path_object.ts +3 -5
  248. package/src/renderer/cat/render_info.ts +5 -8
  249. package/src/renderer/cat/renderer.ts +11 -15
  250. package/src/renderer/constants.ts +34 -49
  251. package/src/renderer/drawer.ts +35 -51
  252. package/src/renderer/path_object.ts +4 -10
  253. package/src/renderer/render_info.ts +36 -56
  254. package/src/renderer/renderer.ts +16 -29
  255. package/src/scratch_block_paster.ts +12 -20
  256. package/src/scratch_blocks_utils.ts +4 -7
  257. package/src/scratch_comment_bubble.ts +70 -101
  258. package/src/scratch_comment_icon.ts +74 -123
  259. package/src/scratch_connection_checker.ts +7 -17
  260. package/src/scratch_continuous_category.ts +24 -28
  261. package/src/scratch_continuous_toolbox.ts +20 -27
  262. package/src/scratch_dragger.ts +42 -81
  263. package/src/scratch_insertion_marker_previewer.ts +6 -11
  264. package/src/scratch_variable_map.ts +5 -12
  265. package/src/scratch_variable_model.ts +4 -11
  266. package/src/scratch_zoom_controls.ts +101 -156
  267. package/src/shadows.ts +32 -37
  268. package/src/status_indicator_label.ts +54 -67
  269. package/src/status_indicator_label_flyout_inflater.ts +11 -21
  270. package/src/variables.ts +89 -138
  271. package/src/xml.ts +21 -35
  272. package/tsconfig.json +2 -6
  273. package/types/continuous-toolbox.d.ts +1 -1
  274. package/dist/main.mjs.LICENSE.txt +0 -163
@@ -1,5 +1,4 @@
1
1
  /**
2
- * @license
3
2
  * Visual Blocks Editor
4
3
  *
5
4
  * Copyright 2016 Massachusetts Institute of Technology
@@ -17,10 +16,9 @@
17
16
  * See the License for the specific language governing permissions and
18
17
  * limitations under the License.
19
18
  */
19
+ import * as Blockly from 'blockly/core'
20
20
 
21
- import * as Blockly from "blockly/core";
22
-
23
- Blockly.Blocks["motion_movesteps"] = {
21
+ Blockly.Blocks.motion_movesteps = {
24
22
  /**
25
23
  * Block to move steps.
26
24
  */
@@ -29,66 +27,66 @@ Blockly.Blocks["motion_movesteps"] = {
29
27
  message0: Blockly.Msg.MOTION_MOVESTEPS,
30
28
  args0: [
31
29
  {
32
- type: "input_value",
33
- name: "STEPS",
30
+ type: 'input_value',
31
+ name: 'STEPS',
34
32
  },
35
33
  ],
36
- extensions: ["colours_motion", "shape_statement"],
37
- });
34
+ extensions: ['colours_motion', 'shape_statement'],
35
+ })
38
36
  },
39
- };
37
+ }
40
38
 
41
- Blockly.Blocks["motion_turnright"] = {
39
+ Blockly.Blocks.motion_turnright = {
42
40
  /**
43
41
  * Block to turn right.
44
42
  */
45
43
  init: function (this: Blockly.Block) {
46
- const ws = this.workspace.options.parentWorkspace || this.workspace;
44
+ const ws = this.workspace.options.parentWorkspace || this.workspace
47
45
  this.jsonInit({
48
46
  message0: Blockly.Msg.MOTION_TURNRIGHT,
49
47
  args0: [
50
48
  {
51
- type: "field_image",
52
- src: ws.options.pathToMedia + "rotate-right.svg",
49
+ type: 'field_image',
50
+ src: ws.options.pathToMedia + 'rotate-right.svg',
53
51
  width: 24,
54
52
  height: 24,
55
53
  },
56
54
  {
57
- type: "input_value",
58
- name: "DEGREES",
55
+ type: 'input_value',
56
+ name: 'DEGREES',
59
57
  },
60
58
  ],
61
- extensions: ["colours_motion", "shape_statement"],
62
- });
59
+ extensions: ['colours_motion', 'shape_statement'],
60
+ })
63
61
  },
64
- };
62
+ }
65
63
 
66
- Blockly.Blocks["motion_turnleft"] = {
64
+ Blockly.Blocks.motion_turnleft = {
67
65
  /**
68
66
  * Block to turn left.
69
67
  */
70
68
  init: function (this: Blockly.Block) {
71
- const ws = this.workspace.options.parentWorkspace || this.workspace;
69
+ const ws = this.workspace.options.parentWorkspace || this.workspace
72
70
  this.jsonInit({
73
71
  message0: Blockly.Msg.MOTION_TURNLEFT,
74
72
  args0: [
75
73
  {
76
- type: "field_image",
77
- src: ws.options.pathToMedia + "rotate-left.svg",
74
+ type: 'field_image',
75
+ src: ws.options.pathToMedia + 'rotate-left.svg',
78
76
  width: 24,
79
77
  height: 24,
80
78
  },
81
79
  {
82
- type: "input_value",
83
- name: "DEGREES",
80
+ type: 'input_value',
81
+ name: 'DEGREES',
84
82
  },
85
83
  ],
86
- extensions: ["colours_motion", "shape_statement"],
87
- });
84
+ extensions: ['colours_motion', 'shape_statement'],
85
+ })
88
86
  },
89
- };
87
+ }
90
88
 
91
- Blockly.Blocks["motion_pointindirection"] = {
89
+ Blockly.Blocks.motion_pointindirection = {
92
90
  /**
93
91
  * Block to point in direction.
94
92
  */
@@ -97,21 +95,21 @@ Blockly.Blocks["motion_pointindirection"] = {
97
95
  message0: Blockly.Msg.MOTION_POINTINDIRECTION,
98
96
  args0: [
99
97
  {
100
- type: "input_value",
101
- name: "DIRECTION",
98
+ type: 'input_value',
99
+ name: 'DIRECTION',
102
100
  },
103
101
  ],
104
- extensions: ["colours_motion", "shape_statement"],
105
- });
102
+ extensions: ['colours_motion', 'shape_statement'],
103
+ })
106
104
  },
107
- };
105
+ }
108
106
 
109
107
  /**
110
108
  * Point towards drop-down menu. Populated dynamically by scratch-gui.
111
109
  */
112
- Blockly.Blocks["motion_pointtowards_menu"] = {};
110
+ Blockly.Blocks.motion_pointtowards_menu = {}
113
111
 
114
- Blockly.Blocks["motion_pointtowards"] = {
112
+ Blockly.Blocks.motion_pointtowards = {
115
113
  /**
116
114
  * Block to point in direction.
117
115
  */
@@ -120,21 +118,21 @@ Blockly.Blocks["motion_pointtowards"] = {
120
118
  message0: Blockly.Msg.MOTION_POINTTOWARDS,
121
119
  args0: [
122
120
  {
123
- type: "input_value",
124
- name: "TOWARDS",
121
+ type: 'input_value',
122
+ name: 'TOWARDS',
125
123
  },
126
124
  ],
127
- extensions: ["colours_motion", "shape_statement"],
128
- });
125
+ extensions: ['colours_motion', 'shape_statement'],
126
+ })
129
127
  },
130
- };
128
+ }
131
129
 
132
130
  /**
133
131
  * Go to drop-down menu. Populated dynamically by scratch-gui.
134
132
  */
135
- Blockly.Blocks["motion_goto_menu"] = {};
133
+ Blockly.Blocks.motion_goto_menu = {}
136
134
 
137
- Blockly.Blocks["motion_gotoxy"] = {
135
+ Blockly.Blocks.motion_gotoxy = {
138
136
  /**
139
137
  * Block to go to X, Y.
140
138
  */
@@ -143,20 +141,20 @@ Blockly.Blocks["motion_gotoxy"] = {
143
141
  message0: Blockly.Msg.MOTION_GOTOXY,
144
142
  args0: [
145
143
  {
146
- type: "input_value",
147
- name: "X",
144
+ type: 'input_value',
145
+ name: 'X',
148
146
  },
149
147
  {
150
- type: "input_value",
151
- name: "Y",
148
+ type: 'input_value',
149
+ name: 'Y',
152
150
  },
153
151
  ],
154
- extensions: ["colours_motion", "shape_statement"],
155
- });
152
+ extensions: ['colours_motion', 'shape_statement'],
153
+ })
156
154
  },
157
- };
155
+ }
158
156
 
159
- Blockly.Blocks["motion_goto"] = {
157
+ Blockly.Blocks.motion_goto = {
160
158
  /**
161
159
  * Block to go to a menu item.
162
160
  */
@@ -165,16 +163,16 @@ Blockly.Blocks["motion_goto"] = {
165
163
  message0: Blockly.Msg.MOTION_GOTO,
166
164
  args0: [
167
165
  {
168
- type: "input_value",
169
- name: "TO",
166
+ type: 'input_value',
167
+ name: 'TO',
170
168
  },
171
169
  ],
172
- extensions: ["colours_motion", "shape_statement"],
173
- });
170
+ extensions: ['colours_motion', 'shape_statement'],
171
+ })
174
172
  },
175
- };
173
+ }
176
174
 
177
- Blockly.Blocks["motion_glidesecstoxy"] = {
175
+ Blockly.Blocks.motion_glidesecstoxy = {
178
176
  /**
179
177
  * Block to glide for a specified time.
180
178
  */
@@ -183,29 +181,29 @@ Blockly.Blocks["motion_glidesecstoxy"] = {
183
181
  message0: Blockly.Msg.MOTION_GLIDESECSTOXY,
184
182
  args0: [
185
183
  {
186
- type: "input_value",
187
- name: "SECS",
184
+ type: 'input_value',
185
+ name: 'SECS',
188
186
  },
189
187
  {
190
- type: "input_value",
191
- name: "X",
188
+ type: 'input_value',
189
+ name: 'X',
192
190
  },
193
191
  {
194
- type: "input_value",
195
- name: "Y",
192
+ type: 'input_value',
193
+ name: 'Y',
196
194
  },
197
195
  ],
198
- extensions: ["colours_motion", "shape_statement"],
199
- });
196
+ extensions: ['colours_motion', 'shape_statement'],
197
+ })
200
198
  },
201
- };
199
+ }
202
200
 
203
201
  /**
204
202
  * Glide to drop-down menu. Populated dynamically by scratch-gui.
205
203
  */
206
- Blockly.Blocks["motion_glideto_menu"] = {};
204
+ Blockly.Blocks.motion_glideto_menu = {}
207
205
 
208
- Blockly.Blocks["motion_glideto"] = {
206
+ Blockly.Blocks.motion_glideto = {
209
207
  /**
210
208
  * Block to glide to a menu item
211
209
  */
@@ -214,20 +212,20 @@ Blockly.Blocks["motion_glideto"] = {
214
212
  message0: Blockly.Msg.MOTION_GLIDETO,
215
213
  args0: [
216
214
  {
217
- type: "input_value",
218
- name: "SECS",
215
+ type: 'input_value',
216
+ name: 'SECS',
219
217
  },
220
218
  {
221
- type: "input_value",
222
- name: "TO",
219
+ type: 'input_value',
220
+ name: 'TO',
223
221
  },
224
222
  ],
225
- extensions: ["colours_motion", "shape_statement"],
226
- });
223
+ extensions: ['colours_motion', 'shape_statement'],
224
+ })
227
225
  },
228
- };
226
+ }
229
227
 
230
- Blockly.Blocks["motion_changexby"] = {
228
+ Blockly.Blocks.motion_changexby = {
231
229
  /**
232
230
  * Block to change X.
233
231
  */
@@ -236,16 +234,16 @@ Blockly.Blocks["motion_changexby"] = {
236
234
  message0: Blockly.Msg.MOTION_CHANGEXBY,
237
235
  args0: [
238
236
  {
239
- type: "input_value",
240
- name: "DX",
237
+ type: 'input_value',
238
+ name: 'DX',
241
239
  },
242
240
  ],
243
- extensions: ["colours_motion", "shape_statement"],
244
- });
241
+ extensions: ['colours_motion', 'shape_statement'],
242
+ })
245
243
  },
246
- };
244
+ }
247
245
 
248
- Blockly.Blocks["motion_setx"] = {
246
+ Blockly.Blocks.motion_setx = {
249
247
  /**
250
248
  * Block to set X.
251
249
  */
@@ -254,16 +252,16 @@ Blockly.Blocks["motion_setx"] = {
254
252
  message0: Blockly.Msg.MOTION_SETX,
255
253
  args0: [
256
254
  {
257
- type: "input_value",
258
- name: "X",
255
+ type: 'input_value',
256
+ name: 'X',
259
257
  },
260
258
  ],
261
- extensions: ["colours_motion", "shape_statement"],
262
- });
259
+ extensions: ['colours_motion', 'shape_statement'],
260
+ })
263
261
  },
264
- };
262
+ }
265
263
 
266
- Blockly.Blocks["motion_changeyby"] = {
264
+ Blockly.Blocks.motion_changeyby = {
267
265
  /**
268
266
  * Block to change Y.
269
267
  */
@@ -272,16 +270,16 @@ Blockly.Blocks["motion_changeyby"] = {
272
270
  message0: Blockly.Msg.MOTION_CHANGEYBY,
273
271
  args0: [
274
272
  {
275
- type: "input_value",
276
- name: "DY",
273
+ type: 'input_value',
274
+ name: 'DY',
277
275
  },
278
276
  ],
279
- extensions: ["colours_motion", "shape_statement"],
280
- });
277
+ extensions: ['colours_motion', 'shape_statement'],
278
+ })
281
279
  },
282
- };
280
+ }
283
281
 
284
- Blockly.Blocks["motion_sety"] = {
282
+ Blockly.Blocks.motion_sety = {
285
283
  /**
286
284
  * Block to set Y.
287
285
  */
@@ -290,28 +288,28 @@ Blockly.Blocks["motion_sety"] = {
290
288
  message0: Blockly.Msg.MOTION_SETY,
291
289
  args0: [
292
290
  {
293
- type: "input_value",
294
- name: "Y",
291
+ type: 'input_value',
292
+ name: 'Y',
295
293
  },
296
294
  ],
297
- extensions: ["colours_motion", "shape_statement"],
298
- });
295
+ extensions: ['colours_motion', 'shape_statement'],
296
+ })
299
297
  },
300
- };
298
+ }
301
299
 
302
- Blockly.Blocks["motion_ifonedgebounce"] = {
300
+ Blockly.Blocks.motion_ifonedgebounce = {
303
301
  /**
304
302
  * Block to bounce on edge.
305
303
  */
306
304
  init: function (this: Blockly.Block) {
307
305
  this.jsonInit({
308
306
  message0: Blockly.Msg.MOTION_IFONEDGEBOUNCE,
309
- extensions: ["colours_motion", "shape_statement"],
310
- });
307
+ extensions: ['colours_motion', 'shape_statement'],
308
+ })
311
309
  },
312
- };
310
+ }
313
311
 
314
- Blockly.Blocks["motion_setrotationstyle"] = {
312
+ Blockly.Blocks.motion_setrotationstyle = {
315
313
  /**
316
314
  * Block to set rotation style.
317
315
  */
@@ -320,57 +318,57 @@ Blockly.Blocks["motion_setrotationstyle"] = {
320
318
  message0: Blockly.Msg.MOTION_SETROTATIONSTYLE,
321
319
  args0: [
322
320
  {
323
- type: "field_dropdown",
324
- name: "STYLE",
321
+ type: 'field_dropdown',
322
+ name: 'STYLE',
325
323
  options: [
326
- [Blockly.Msg.MOTION_SETROTATIONSTYLE_LEFTRIGHT, "left-right"],
324
+ [Blockly.Msg.MOTION_SETROTATIONSTYLE_LEFTRIGHT, 'left-right'],
327
325
  [Blockly.Msg.MOTION_SETROTATIONSTYLE_DONTROTATE, "don't rotate"],
328
- [Blockly.Msg.MOTION_SETROTATIONSTYLE_ALLAROUND, "all around"],
326
+ [Blockly.Msg.MOTION_SETROTATIONSTYLE_ALLAROUND, 'all around'],
329
327
  ],
330
328
  },
331
329
  ],
332
- extensions: ["colours_motion", "shape_statement"],
333
- });
330
+ extensions: ['colours_motion', 'shape_statement'],
331
+ })
334
332
  },
335
- };
333
+ }
336
334
 
337
- Blockly.Blocks["motion_xposition"] = {
335
+ Blockly.Blocks.motion_xposition = {
338
336
  /**
339
337
  * Block to report X.
340
338
  */
341
339
  init: function (this: Blockly.Block) {
342
340
  this.jsonInit({
343
341
  message0: Blockly.Msg.MOTION_XPOSITION,
344
- extensions: ["colours_motion", "output_number", "monitor_block"],
345
- });
342
+ extensions: ['colours_motion', 'output_number', 'monitor_block'],
343
+ })
346
344
  },
347
- };
345
+ }
348
346
 
349
- Blockly.Blocks["motion_yposition"] = {
347
+ Blockly.Blocks.motion_yposition = {
350
348
  /**
351
349
  * Block to report Y.
352
350
  */
353
351
  init: function (this: Blockly.Block) {
354
352
  this.jsonInit({
355
353
  message0: Blockly.Msg.MOTION_YPOSITION,
356
- extensions: ["colours_motion", "output_number", "monitor_block"],
357
- });
354
+ extensions: ['colours_motion', 'output_number', 'monitor_block'],
355
+ })
358
356
  },
359
- };
357
+ }
360
358
 
361
- Blockly.Blocks["motion_direction"] = {
359
+ Blockly.Blocks.motion_direction = {
362
360
  /**
363
361
  * Block to report direction.
364
362
  */
365
363
  init: function (this: Blockly.Block) {
366
364
  this.jsonInit({
367
365
  message0: Blockly.Msg.MOTION_DIRECTION,
368
- extensions: ["colours_motion", "output_number", "monitor_block"],
369
- });
366
+ extensions: ['colours_motion', 'output_number', 'monitor_block'],
367
+ })
370
368
  },
371
- };
369
+ }
372
370
 
373
- Blockly.Blocks["motion_scroll_right"] = {
371
+ Blockly.Blocks.motion_scroll_right = {
374
372
  /**
375
373
  * Block to scroll the stage right. Does not actually do anything. This is
376
374
  * an obsolete block that is implemented for compatibility with Scratch 2.0
@@ -381,16 +379,16 @@ Blockly.Blocks["motion_scroll_right"] = {
381
379
  message0: Blockly.Msg.MOTION_SCROLLRIGHT,
382
380
  args0: [
383
381
  {
384
- type: "input_value",
385
- name: "DISTANCE",
382
+ type: 'input_value',
383
+ name: 'DISTANCE',
386
384
  },
387
385
  ],
388
- extensions: ["colours_motion", "shape_statement"],
389
- });
386
+ extensions: ['colours_motion', 'shape_statement'],
387
+ })
390
388
  },
391
- };
389
+ }
392
390
 
393
- Blockly.Blocks["motion_scroll_up"] = {
391
+ Blockly.Blocks.motion_scroll_up = {
394
392
  /**
395
393
  * Block to scroll the stage up. Does not actually do anything. This is an
396
394
  * obsolete block that is implemented for compatibility with Scratch 2.0
@@ -401,16 +399,16 @@ Blockly.Blocks["motion_scroll_up"] = {
401
399
  message0: Blockly.Msg.MOTION_SCROLLUP,
402
400
  args0: [
403
401
  {
404
- type: "input_value",
405
- name: "DISTANCE",
402
+ type: 'input_value',
403
+ name: 'DISTANCE',
406
404
  },
407
405
  ],
408
- extensions: ["colours_motion", "shape_statement"],
409
- });
406
+ extensions: ['colours_motion', 'shape_statement'],
407
+ })
410
408
  },
411
- };
409
+ }
412
410
 
413
- Blockly.Blocks["motion_align_scene"] = {
411
+ Blockly.Blocks.motion_align_scene = {
414
412
  /**
415
413
  * Block to change the stage's scrolling alignment. Does not actually do
416
414
  * anything. This is an obsolete block that is implemented for compatibility
@@ -421,23 +419,23 @@ Blockly.Blocks["motion_align_scene"] = {
421
419
  message0: Blockly.Msg.MOTION_ALIGNSCENE,
422
420
  args0: [
423
421
  {
424
- type: "field_dropdown",
425
- name: "ALIGNMENT",
422
+ type: 'field_dropdown',
423
+ name: 'ALIGNMENT',
426
424
  options: [
427
- [Blockly.Msg.MOTION_ALIGNSCENE_BOTTOMLEFT, "bottom-left"],
428
- [Blockly.Msg.MOTION_ALIGNSCENE_BOTTOMRIGHT, "bottom-right"],
429
- [Blockly.Msg.MOTION_ALIGNSCENE_MIDDLE, "middle"],
430
- [Blockly.Msg.MOTION_ALIGNSCENE_TOPLEFT, "top-left"],
431
- [Blockly.Msg.MOTION_ALIGNSCENE_TOPRIGHT, "top-right"],
425
+ [Blockly.Msg.MOTION_ALIGNSCENE_BOTTOMLEFT, 'bottom-left'],
426
+ [Blockly.Msg.MOTION_ALIGNSCENE_BOTTOMRIGHT, 'bottom-right'],
427
+ [Blockly.Msg.MOTION_ALIGNSCENE_MIDDLE, 'middle'],
428
+ [Blockly.Msg.MOTION_ALIGNSCENE_TOPLEFT, 'top-left'],
429
+ [Blockly.Msg.MOTION_ALIGNSCENE_TOPRIGHT, 'top-right'],
432
430
  ],
433
431
  },
434
432
  ],
435
- extensions: ["colours_motion", "shape_statement"],
436
- });
433
+ extensions: ['colours_motion', 'shape_statement'],
434
+ })
437
435
  },
438
- };
436
+ }
439
437
 
440
- Blockly.Blocks["motion_xscroll"] = {
438
+ Blockly.Blocks.motion_xscroll = {
441
439
  /**
442
440
  * Block to report the stage's scroll position's X value. Does not actually
443
441
  * do anything. This is an obsolete block that is implemented for
@@ -446,12 +444,12 @@ Blockly.Blocks["motion_xscroll"] = {
446
444
  init: function (this: Blockly.Block) {
447
445
  this.jsonInit({
448
446
  message0: Blockly.Msg.MOTION_XSCROLL,
449
- extensions: ["colours_motion", "output_number"],
450
- });
447
+ extensions: ['colours_motion', 'output_number'],
448
+ })
451
449
  },
452
- };
450
+ }
453
451
 
454
- Blockly.Blocks["motion_yscroll"] = {
452
+ Blockly.Blocks.motion_yscroll = {
455
453
  /**
456
454
  * Block to report the stage's scroll position's Y value. Does not actually
457
455
  * do anything. This is an obsolete block that is implemented for
@@ -460,7 +458,7 @@ Blockly.Blocks["motion_yscroll"] = {
460
458
  init: function (this: Blockly.Block) {
461
459
  this.jsonInit({
462
460
  message0: Blockly.Msg.MOTION_YSCROLL,
463
- extensions: ["colours_motion", "output_number"],
464
- });
461
+ extensions: ['colours_motion', 'output_number'],
462
+ })
465
463
  },
466
- };
464
+ }
@@ -1,5 +1,4 @@
1
1
  /**
2
- * @license
3
2
  * Visual Blocks Editor
4
3
  *
5
4
  * Copyright 2012 Google Inc.
@@ -17,31 +16,30 @@
17
16
  * See the License for the specific language governing permissions and
18
17
  * limitations under the License.
19
18
  */
20
-
21
19
  /**
22
- * @fileoverview Note block.
20
+ * @file Note block.
23
21
  * @author ericr@media.mit.edu (Eric Rosenbaum)
24
22
  */
25
- import * as Blockly from "blockly/core";
26
- import * as Constants from "../constants";
23
+ import * as Blockly from 'blockly/core'
24
+ import * as Constants from '../constants'
27
25
 
28
- Blockly.Blocks["note"] = {
26
+ Blockly.Blocks.note = {
29
27
  /**
30
28
  * Block for musical note value.
31
29
  */
32
30
  init: function (this: Blockly.Block) {
33
31
  this.jsonInit({
34
- message0: "%1",
32
+ message0: '%1',
35
33
  args0: [
36
34
  {
37
- type: "field_note",
38
- name: "NOTE",
35
+ type: 'field_note',
36
+ name: 'NOTE',
39
37
  value: 60,
40
38
  },
41
39
  ],
42
40
  outputShape: Constants.OUTPUT_SHAPE_ROUND,
43
- output: "Number",
44
- extensions: ["colours_textfield"],
45
- });
41
+ output: 'Number',
42
+ extensions: ['colours_textfield'],
43
+ })
46
44
  },
47
- };
45
+ }