scratch-blocks 2.0.0-beta.1 → 2.0.0-spork.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 (1065) hide show
  1. package/CHANGELOG.md +16 -16
  2. package/package.json +1 -1
  3. package/release.config.js +4 -0
  4. package/blockly-rc/.eslintignore +0 -28
  5. package/blockly-rc/.eslintrc.js +0 -187
  6. package/blockly-rc/.gitattributes +0 -1
  7. package/blockly-rc/.github/CODEOWNERS +0 -1
  8. package/blockly-rc/.github/CONTRIBUTING.md +0 -46
  9. package/blockly-rc/.github/ISSUE_TEMPLATE/bug_report.yaml +0 -58
  10. package/blockly-rc/.github/ISSUE_TEMPLATE/config.yml +0 -7
  11. package/blockly-rc/.github/ISSUE_TEMPLATE/documentation.yaml +0 -38
  12. package/blockly-rc/.github/ISSUE_TEMPLATE/feature_request.yaml +0 -39
  13. package/blockly-rc/.github/PULL_REQUEST_TEMPLATE.md +0 -42
  14. package/blockly-rc/.github/dependabot.yml +0 -27
  15. package/blockly-rc/.github/release.yml +0 -32
  16. package/blockly-rc/.github/workflows/appengine_deploy.yml +0 -54
  17. package/blockly-rc/.github/workflows/assign_reviewers.yml +0 -41
  18. package/blockly-rc/.github/workflows/browser_test.yml +0 -55
  19. package/blockly-rc/.github/workflows/build.yml +0 -86
  20. package/blockly-rc/.github/workflows/conventional-label.yml +0 -17
  21. package/blockly-rc/.github/workflows/develop_freeze.yml +0 -26
  22. package/blockly-rc/.github/workflows/tag_module_cleanup.yml +0 -37
  23. package/blockly-rc/.github/workflows/welcome_new_contributors.yml +0 -36
  24. package/blockly-rc/.prettierignore +0 -30
  25. package/blockly-rc/.prettierrc.js +0 -13
  26. package/blockly-rc/CHANGELOG.md +0 -77
  27. package/blockly-rc/LICENSE +0 -202
  28. package/blockly-rc/README.md +0 -80
  29. package/blockly-rc/_config.yml +0 -1
  30. package/blockly-rc/api-extractor.json +0 -385
  31. package/blockly-rc/appengine/.gcloudignore +0 -20
  32. package/blockly-rc/appengine/README.txt +0 -42
  33. package/blockly-rc/appengine/add_timestamps.py +0 -69
  34. package/blockly-rc/appengine/app.yaml +0 -104
  35. package/blockly-rc/appengine/apple-touch-icon.png +0 -0
  36. package/blockly-rc/appengine/blockly_compressed.js +0 -11
  37. package/blockly-rc/appengine/expiration.py +0 -52
  38. package/blockly-rc/appengine/favicon.ico +0 -0
  39. package/blockly-rc/appengine/index.yaml +0 -11
  40. package/blockly-rc/appengine/main.py +0 -39
  41. package/blockly-rc/appengine/redirect.html +0 -107
  42. package/blockly-rc/appengine/requirements.txt +0 -1
  43. package/blockly-rc/appengine/robots.txt +0 -2
  44. package/blockly-rc/appengine/storage.js +0 -190
  45. package/blockly-rc/appengine/storage.py +0 -125
  46. package/blockly-rc/blocks/blocks.ts +0 -44
  47. package/blockly-rc/blocks/lists.ts +0 -1085
  48. package/blockly-rc/blocks/logic.ts +0 -712
  49. package/blockly-rc/blocks/loops.ts +0 -408
  50. package/blockly-rc/blocks/math.ts +0 -591
  51. package/blockly-rc/blocks/procedures.ts +0 -1364
  52. package/blockly-rc/blocks/text.ts +0 -1007
  53. package/blockly-rc/blocks/variables.ts +0 -183
  54. package/blockly-rc/blocks/variables_dynamic.ts +0 -194
  55. package/blockly-rc/core/any_aliases.ts +0 -8
  56. package/blockly-rc/core/block.ts +0 -2523
  57. package/blockly-rc/core/block_animations.ts +0 -225
  58. package/blockly-rc/core/block_flyout_inflater.ts +0 -262
  59. package/blockly-rc/core/block_svg.ts +0 -1768
  60. package/blockly-rc/core/blockly.ts +0 -605
  61. package/blockly-rc/core/blockly_options.ts +0 -71
  62. package/blockly-rc/core/blocks.ts +0 -18
  63. package/blockly-rc/core/browser_events.ts +0 -244
  64. package/blockly-rc/core/bubbles/bubble.ts +0 -658
  65. package/blockly-rc/core/bubbles/mini_workspace_bubble.ts +0 -280
  66. package/blockly-rc/core/bubbles/text_bubble.ts +0 -103
  67. package/blockly-rc/core/bubbles/textinput_bubble.ts +0 -344
  68. package/blockly-rc/core/bubbles.ts +0 -12
  69. package/blockly-rc/core/bump_objects.ts +0 -192
  70. package/blockly-rc/core/button_flyout_inflater.ts +0 -63
  71. package/blockly-rc/core/clipboard/block_paster.ts +0 -142
  72. package/blockly-rc/core/clipboard/registry.ts +0 -31
  73. package/blockly-rc/core/clipboard/workspace_comment_paster.ts +0 -94
  74. package/blockly-rc/core/clipboard.ts +0 -113
  75. package/blockly-rc/core/comments/comment_view.ts +0 -899
  76. package/blockly-rc/core/comments/rendered_workspace_comment.ts +0 -297
  77. package/blockly-rc/core/comments/workspace_comment.ts +0 -237
  78. package/blockly-rc/core/comments.ts +0 -9
  79. package/blockly-rc/core/common.ts +0 -305
  80. package/blockly-rc/core/component_manager.ts +0 -235
  81. package/blockly-rc/core/config.ts +0 -65
  82. package/blockly-rc/core/connection.ts +0 -793
  83. package/blockly-rc/core/connection_checker.ts +0 -348
  84. package/blockly-rc/core/connection_db.ts +0 -297
  85. package/blockly-rc/core/connection_type.ts +0 -21
  86. package/blockly-rc/core/constants.ts +0 -23
  87. package/blockly-rc/core/contextmenu.ts +0 -268
  88. package/blockly-rc/core/contextmenu_items.ts +0 -700
  89. package/blockly-rc/core/contextmenu_registry.ts +0 -194
  90. package/blockly-rc/core/css.ts +0 -481
  91. package/blockly-rc/core/delete_area.ts +0 -77
  92. package/blockly-rc/core/dialog.ts +0 -121
  93. package/blockly-rc/core/drag_target.ts +0 -97
  94. package/blockly-rc/core/dragging/block_drag_strategy.ts +0 -454
  95. package/blockly-rc/core/dragging/bubble_drag_strategy.ts +0 -52
  96. package/blockly-rc/core/dragging/comment_drag_strategy.ts +0 -91
  97. package/blockly-rc/core/dragging/dragger.ts +0 -163
  98. package/blockly-rc/core/dragging.ts +0 -12
  99. package/blockly-rc/core/dropdowndiv.ts +0 -768
  100. package/blockly-rc/core/events/events.ts +0 -163
  101. package/blockly-rc/core/events/events_abstract.ts +0 -130
  102. package/blockly-rc/core/events/events_block_base.ts +0 -88
  103. package/blockly-rc/core/events/events_block_change.ts +0 -259
  104. package/blockly-rc/core/events/events_block_create.ts +0 -185
  105. package/blockly-rc/core/events/events_block_delete.ts +0 -182
  106. package/blockly-rc/core/events/events_block_drag.ts +0 -116
  107. package/blockly-rc/core/events/events_block_field_intermediate_change.ts +0 -167
  108. package/blockly-rc/core/events/events_block_move.ts +0 -307
  109. package/blockly-rc/core/events/events_bubble_open.ts +0 -120
  110. package/blockly-rc/core/events/events_click.ts +0 -110
  111. package/blockly-rc/core/events/events_comment_base.ts +0 -126
  112. package/blockly-rc/core/events/events_comment_change.ts +0 -161
  113. package/blockly-rc/core/events/events_comment_collapse.ts +0 -103
  114. package/blockly-rc/core/events/events_comment_create.ts +0 -118
  115. package/blockly-rc/core/events/events_comment_delete.ts +0 -117
  116. package/blockly-rc/core/events/events_comment_drag.ts +0 -99
  117. package/blockly-rc/core/events/events_comment_move.ts +0 -207
  118. package/blockly-rc/core/events/events_comment_resize.ts +0 -174
  119. package/blockly-rc/core/events/events_marker_move.ts +0 -134
  120. package/blockly-rc/core/events/events_selected.ts +0 -98
  121. package/blockly-rc/core/events/events_theme_change.ts +0 -84
  122. package/blockly-rc/core/events/events_toolbox_item_select.ts +0 -96
  123. package/blockly-rc/core/events/events_trashcan_open.ts +0 -88
  124. package/blockly-rc/core/events/events_ui_base.ts +0 -47
  125. package/blockly-rc/core/events/events_var_base.ts +0 -89
  126. package/blockly-rc/core/events/events_var_create.ts +0 -129
  127. package/blockly-rc/core/events/events_var_delete.ts +0 -124
  128. package/blockly-rc/core/events/events_var_rename.ts +0 -133
  129. package/blockly-rc/core/events/events_var_type_change.ts +0 -122
  130. package/blockly-rc/core/events/events_viewport.ts +0 -149
  131. package/blockly-rc/core/events/utils.ts +0 -595
  132. package/blockly-rc/core/events/workspace_events.ts +0 -46
  133. package/blockly-rc/core/extensions.ts +0 -491
  134. package/blockly-rc/core/field.ts +0 -1471
  135. package/blockly-rc/core/field_checkbox.ts +0 -271
  136. package/blockly-rc/core/field_dropdown.ts +0 -857
  137. package/blockly-rc/core/field_image.ts +0 -297
  138. package/blockly-rc/core/field_input.ts +0 -755
  139. package/blockly-rc/core/field_label.ts +0 -150
  140. package/blockly-rc/core/field_label_serializable.ts +0 -73
  141. package/blockly-rc/core/field_number.ts +0 -381
  142. package/blockly-rc/core/field_registry.ts +0 -115
  143. package/blockly-rc/core/field_textinput.ts +0 -117
  144. package/blockly-rc/core/field_variable.ts +0 -651
  145. package/blockly-rc/core/flyout_base.ts +0 -968
  146. package/blockly-rc/core/flyout_button.ts +0 -416
  147. package/blockly-rc/core/flyout_horizontal.ts +0 -374
  148. package/blockly-rc/core/flyout_metrics_manager.ts +0 -90
  149. package/blockly-rc/core/flyout_separator.ts +0 -61
  150. package/blockly-rc/core/flyout_vertical.ts +0 -353
  151. package/blockly-rc/core/generator.ts +0 -611
  152. package/blockly-rc/core/gesture.ts +0 -1191
  153. package/blockly-rc/core/grid.ts +0 -252
  154. package/blockly-rc/core/icons/comment_icon.ts +0 -435
  155. package/blockly-rc/core/icons/exceptions.ts +0 -23
  156. package/blockly-rc/core/icons/icon.ts +0 -147
  157. package/blockly-rc/core/icons/icon_types.ts +0 -32
  158. package/blockly-rc/core/icons/mutator_icon.ts +0 -354
  159. package/blockly-rc/core/icons/registry.ts +0 -33
  160. package/blockly-rc/core/icons/warning_icon.ts +0 -219
  161. package/blockly-rc/core/icons.ts +0 -24
  162. package/blockly-rc/core/inject.ts +0 -428
  163. package/blockly-rc/core/inputs/align.ts +0 -14
  164. package/blockly-rc/core/inputs/dummy_input.ts +0 -26
  165. package/blockly-rc/core/inputs/end_row_input.ts +0 -31
  166. package/blockly-rc/core/inputs/input.ts +0 -318
  167. package/blockly-rc/core/inputs/input_types.ts +0 -27
  168. package/blockly-rc/core/inputs/statement_input.ts +0 -34
  169. package/blockly-rc/core/inputs/value_input.ts +0 -30
  170. package/blockly-rc/core/inputs.ts +0 -23
  171. package/blockly-rc/core/insertion_marker_manager.ts +0 -742
  172. package/blockly-rc/core/insertion_marker_previewer.ts +0 -254
  173. package/blockly-rc/core/interfaces/i_ast_node_location.ts +0 -12
  174. package/blockly-rc/core/interfaces/i_ast_node_location_svg.ts +0 -28
  175. package/blockly-rc/core/interfaces/i_ast_node_location_with_block.ts +0 -22
  176. package/blockly-rc/core/interfaces/i_autohideable.ts +0 -22
  177. package/blockly-rc/core/interfaces/i_bounded_element.ts +0 -30
  178. package/blockly-rc/core/interfaces/i_bubble.ts +0 -63
  179. package/blockly-rc/core/interfaces/i_collapsible_toolbox_item.ts +0 -33
  180. package/blockly-rc/core/interfaces/i_comment_icon.ts +0 -47
  181. package/blockly-rc/core/interfaces/i_component.ts +0 -19
  182. package/blockly-rc/core/interfaces/i_connection_checker.ts +0 -100
  183. package/blockly-rc/core/interfaces/i_connection_previewer.ts +0 -50
  184. package/blockly-rc/core/interfaces/i_contextmenu.ts +0 -16
  185. package/blockly-rc/core/interfaces/i_copyable.ts +0 -31
  186. package/blockly-rc/core/interfaces/i_deletable.ts +0 -34
  187. package/blockly-rc/core/interfaces/i_delete_area.ts +0 -28
  188. package/blockly-rc/core/interfaces/i_drag_target.ts +0 -69
  189. package/blockly-rc/core/interfaces/i_draggable.ts +0 -72
  190. package/blockly-rc/core/interfaces/i_dragger.ts +0 -35
  191. package/blockly-rc/core/interfaces/i_flyout.ts +0 -189
  192. package/blockly-rc/core/interfaces/i_flyout_inflater.ts +0 -41
  193. package/blockly-rc/core/interfaces/i_has_bubble.ts +0 -20
  194. package/blockly-rc/core/interfaces/i_icon.ts +0 -114
  195. package/blockly-rc/core/interfaces/i_keyboard_accessible.ts +0 -21
  196. package/blockly-rc/core/interfaces/i_legacy_procedure_blocks.ts +0 -50
  197. package/blockly-rc/core/interfaces/i_metrics_manager.ts +0 -149
  198. package/blockly-rc/core/interfaces/i_movable.ts +0 -19
  199. package/blockly-rc/core/interfaces/i_observable.ts +0 -24
  200. package/blockly-rc/core/interfaces/i_parameter_model.ts +0 -51
  201. package/blockly-rc/core/interfaces/i_paster.ts +0 -25
  202. package/blockly-rc/core/interfaces/i_positionable.ts +0 -33
  203. package/blockly-rc/core/interfaces/i_procedure_block.ts +0 -27
  204. package/blockly-rc/core/interfaces/i_procedure_map.ts +0 -18
  205. package/blockly-rc/core/interfaces/i_procedure_model.ts +0 -71
  206. package/blockly-rc/core/interfaces/i_registrable.ts +0 -12
  207. package/blockly-rc/core/interfaces/i_rendered_element.ts +0 -22
  208. package/blockly-rc/core/interfaces/i_selectable.ts +0 -34
  209. package/blockly-rc/core/interfaces/i_selectable_toolbox_item.ts +0 -63
  210. package/blockly-rc/core/interfaces/i_serializable.ts +0 -28
  211. package/blockly-rc/core/interfaces/i_serializer.ts +0 -55
  212. package/blockly-rc/core/interfaces/i_styleable.ts +0 -26
  213. package/blockly-rc/core/interfaces/i_toolbox.ts +0 -112
  214. package/blockly-rc/core/interfaces/i_toolbox_item.ts +0 -81
  215. package/blockly-rc/core/interfaces/i_variable_backed_parameter_model.ts +0 -23
  216. package/blockly-rc/core/interfaces/i_variable_map.ts +0 -65
  217. package/blockly-rc/core/interfaces/i_variable_model.ts +0 -57
  218. package/blockly-rc/core/internal_constants.ts +0 -47
  219. package/blockly-rc/core/keyboard_nav/ast_node.ts +0 -884
  220. package/blockly-rc/core/keyboard_nav/basic_cursor.ts +0 -223
  221. package/blockly-rc/core/keyboard_nav/cursor.ts +0 -138
  222. package/blockly-rc/core/keyboard_nav/marker.ts +0 -113
  223. package/blockly-rc/core/keyboard_nav/tab_navigate_cursor.ts +0 -46
  224. package/blockly-rc/core/label_flyout_inflater.ts +0 -59
  225. package/blockly-rc/core/layer_manager.ts +0 -186
  226. package/blockly-rc/core/layers.ts +0 -17
  227. package/blockly-rc/core/main.ts +0 -31
  228. package/blockly-rc/core/marker_manager.ts +0 -189
  229. package/blockly-rc/core/menu.ts +0 -463
  230. package/blockly-rc/core/menuitem.ts +0 -221
  231. package/blockly-rc/core/metrics_manager.ts +0 -486
  232. package/blockly-rc/core/msg.ts +0 -27
  233. package/blockly-rc/core/names.ts +0 -275
  234. package/blockly-rc/core/observable_procedure_map.ts +0 -66
  235. package/blockly-rc/core/options.ts +0 -377
  236. package/blockly-rc/core/positionable_helpers.ts +0 -186
  237. package/blockly-rc/core/procedures.ts +0 -510
  238. package/blockly-rc/core/registry.ts +0 -400
  239. package/blockly-rc/core/render_management.ts +0 -193
  240. package/blockly-rc/core/rendered_connection.ts +0 -571
  241. package/blockly-rc/core/renderers/common/block_rendering.ts +0 -120
  242. package/blockly-rc/core/renderers/common/constants.ts +0 -1198
  243. package/blockly-rc/core/renderers/common/drawer.ts +0 -518
  244. package/blockly-rc/core/renderers/common/i_path_object.ts +0 -137
  245. package/blockly-rc/core/renderers/common/info.ts +0 -767
  246. package/blockly-rc/core/renderers/common/marker_svg.ts +0 -765
  247. package/blockly-rc/core/renderers/common/path_object.ts +0 -324
  248. package/blockly-rc/core/renderers/common/renderer.ts +0 -281
  249. package/blockly-rc/core/renderers/geras/constants.ts +0 -46
  250. package/blockly-rc/core/renderers/geras/drawer.ts +0 -167
  251. package/blockly-rc/core/renderers/geras/geras.ts +0 -31
  252. package/blockly-rc/core/renderers/geras/highlight_constants.ts +0 -342
  253. package/blockly-rc/core/renderers/geras/highlighter.ts +0 -313
  254. package/blockly-rc/core/renderers/geras/info.ts +0 -478
  255. package/blockly-rc/core/renderers/geras/measurables/inline_input.ts +0 -37
  256. package/blockly-rc/core/renderers/geras/measurables/statement_input.ts +0 -36
  257. package/blockly-rc/core/renderers/geras/path_object.ts +0 -135
  258. package/blockly-rc/core/renderers/geras/renderer.ts +0 -124
  259. package/blockly-rc/core/renderers/measurables/base.ts +0 -41
  260. package/blockly-rc/core/renderers/measurables/bottom_row.ts +0 -104
  261. package/blockly-rc/core/renderers/measurables/connection.ts +0 -43
  262. package/blockly-rc/core/renderers/measurables/external_value_input.ts +0 -53
  263. package/blockly-rc/core/renderers/measurables/field.ts +0 -50
  264. package/blockly-rc/core/renderers/measurables/hat.ts +0 -33
  265. package/blockly-rc/core/renderers/measurables/icon.ts +0 -42
  266. package/blockly-rc/core/renderers/measurables/in_row_spacer.ts +0 -29
  267. package/blockly-rc/core/renderers/measurables/inline_input.ts +0 -63
  268. package/blockly-rc/core/renderers/measurables/input_connection.ts +0 -57
  269. package/blockly-rc/core/renderers/measurables/input_row.ts +0 -67
  270. package/blockly-rc/core/renderers/measurables/jagged_edge.ts +0 -28
  271. package/blockly-rc/core/renderers/measurables/next_connection.ts +0 -34
  272. package/blockly-rc/core/renderers/measurables/output_connection.ts +0 -43
  273. package/blockly-rc/core/renderers/measurables/previous_connection.ts +0 -34
  274. package/blockly-rc/core/renderers/measurables/round_corner.ts +0 -34
  275. package/blockly-rc/core/renderers/measurables/row.ts +0 -191
  276. package/blockly-rc/core/renderers/measurables/spacer_row.ts +0 -44
  277. package/blockly-rc/core/renderers/measurables/square_corner.ts +0 -32
  278. package/blockly-rc/core/renderers/measurables/statement_input.ts +0 -41
  279. package/blockly-rc/core/renderers/measurables/top_row.ts +0 -110
  280. package/blockly-rc/core/renderers/measurables/types.ts +0 -319
  281. package/blockly-rc/core/renderers/thrasos/info.ts +0 -328
  282. package/blockly-rc/core/renderers/thrasos/renderer.ts +0 -40
  283. package/blockly-rc/core/renderers/thrasos/thrasos.ts +0 -14
  284. package/blockly-rc/core/renderers/zelos/constants.ts +0 -877
  285. package/blockly-rc/core/renderers/zelos/drawer.ts +0 -274
  286. package/blockly-rc/core/renderers/zelos/info.ts +0 -652
  287. package/blockly-rc/core/renderers/zelos/marker_svg.ts +0 -145
  288. package/blockly-rc/core/renderers/zelos/measurables/bottom_row.ts +0 -44
  289. package/blockly-rc/core/renderers/zelos/measurables/inputs.ts +0 -41
  290. package/blockly-rc/core/renderers/zelos/measurables/row_elements.ts +0 -29
  291. package/blockly-rc/core/renderers/zelos/measurables/top_row.ts +0 -50
  292. package/blockly-rc/core/renderers/zelos/path_object.ts +0 -209
  293. package/blockly-rc/core/renderers/zelos/renderer.ts +0 -143
  294. package/blockly-rc/core/renderers/zelos/zelos.ts +0 -33
  295. package/blockly-rc/core/scrollbar.ts +0 -898
  296. package/blockly-rc/core/scrollbar_pair.ts +0 -349
  297. package/blockly-rc/core/separator_flyout_inflater.ts +0 -69
  298. package/blockly-rc/core/serialization/blocks.ts +0 -868
  299. package/blockly-rc/core/serialization/exceptions.ts +0 -112
  300. package/blockly-rc/core/serialization/priorities.ts +0 -25
  301. package/blockly-rc/core/serialization/procedures.ts +0 -158
  302. package/blockly-rc/core/serialization/registry.ts +0 -30
  303. package/blockly-rc/core/serialization/variables.ts +0 -68
  304. package/blockly-rc/core/serialization/workspace_comments.ts +0 -143
  305. package/blockly-rc/core/serialization/workspaces.ts +0 -94
  306. package/blockly-rc/core/serialization.ts +0 -32
  307. package/blockly-rc/core/shortcut_items.ts +0 -338
  308. package/blockly-rc/core/shortcut_registry.ts +0 -368
  309. package/blockly-rc/core/sprites.ts +0 -15
  310. package/blockly-rc/core/theme/classic.ts +0 -40
  311. package/blockly-rc/core/theme/themes.ts +0 -12
  312. package/blockly-rc/core/theme/zelos.ts +0 -80
  313. package/blockly-rc/core/theme.ts +0 -232
  314. package/blockly-rc/core/theme_manager.ts +0 -192
  315. package/blockly-rc/core/toolbox/category.ts +0 -739
  316. package/blockly-rc/core/toolbox/collapsible_category.ts +0 -288
  317. package/blockly-rc/core/toolbox/separator.ts +0 -105
  318. package/blockly-rc/core/toolbox/toolbox.ts +0 -1134
  319. package/blockly-rc/core/toolbox/toolbox_item.ts +0 -152
  320. package/blockly-rc/core/tooltip.ts +0 -466
  321. package/blockly-rc/core/touch.ts +0 -155
  322. package/blockly-rc/core/trashcan.ts +0 -748
  323. package/blockly-rc/core/utils/aria.ts +0 -144
  324. package/blockly-rc/core/utils/array.ts +0 -24
  325. package/blockly-rc/core/utils/colour.ts +0 -265
  326. package/blockly-rc/core/utils/coordinate.ts +0 -129
  327. package/blockly-rc/core/utils/deprecation.ts +0 -47
  328. package/blockly-rc/core/utils/dom.ts +0 -356
  329. package/blockly-rc/core/utils/idgenerator.ts +0 -70
  330. package/blockly-rc/core/utils/keycodes.ts +0 -154
  331. package/blockly-rc/core/utils/math.ts +0 -50
  332. package/blockly-rc/core/utils/metrics.ts +0 -86
  333. package/blockly-rc/core/utils/object.ts +0 -28
  334. package/blockly-rc/core/utils/parsing.ts +0 -287
  335. package/blockly-rc/core/utils/rect.ts +0 -69
  336. package/blockly-rc/core/utils/size.ts +0 -62
  337. package/blockly-rc/core/utils/string.ts +0 -289
  338. package/blockly-rc/core/utils/style.ts +0 -219
  339. package/blockly-rc/core/utils/svg.ts +0 -84
  340. package/blockly-rc/core/utils/svg_math.ts +0 -208
  341. package/blockly-rc/core/utils/svg_paths.ts +0 -133
  342. package/blockly-rc/core/utils/toolbox.ts +0 -419
  343. package/blockly-rc/core/utils/useragent.ts +0 -86
  344. package/blockly-rc/core/utils/xml.ts +0 -165
  345. package/blockly-rc/core/utils.ts +0 -59
  346. package/blockly-rc/core/variable_map.ts +0 -437
  347. package/blockly-rc/core/variable_model.ts +0 -149
  348. package/blockly-rc/core/variables.ts +0 -773
  349. package/blockly-rc/core/variables_dynamic.ts +0 -142
  350. package/blockly-rc/core/widgetdiv.ts +0 -319
  351. package/blockly-rc/core/workspace.ts +0 -957
  352. package/blockly-rc/core/workspace_audio.ts +0 -171
  353. package/blockly-rc/core/workspace_dragger.ts +0 -97
  354. package/blockly-rc/core/workspace_svg.ts +0 -2519
  355. package/blockly-rc/core/xml.ts +0 -1133
  356. package/blockly-rc/core/zoom_controls.ts +0 -492
  357. package/blockly-rc/demos/blockfactory/analytics.js +0 -195
  358. package/blockly-rc/demos/blockfactory/app_controller.js +0 -726
  359. package/blockly-rc/demos/blockfactory/block_definition_extractor.js +0 -742
  360. package/blockly-rc/demos/blockfactory/block_exporter_controller.js +0 -311
  361. package/blockly-rc/demos/blockfactory/block_exporter_tools.js +0 -212
  362. package/blockly-rc/demos/blockfactory/block_exporter_view.js +0 -101
  363. package/blockly-rc/demos/blockfactory/block_library_controller.js +0 -325
  364. package/blockly-rc/demos/blockfactory/block_library_storage.js +0 -149
  365. package/blockly-rc/demos/blockfactory/block_library_view.js +0 -178
  366. package/blockly-rc/demos/blockfactory/block_option.js +0 -151
  367. package/blockly-rc/demos/blockfactory/blocks.js +0 -916
  368. package/blockly-rc/demos/blockfactory/cp.css +0 -46
  369. package/blockly-rc/demos/blockfactory/cp.js +0 -179
  370. package/blockly-rc/demos/blockfactory/factory.css +0 -586
  371. package/blockly-rc/demos/blockfactory/factory.js +0 -337
  372. package/blockly-rc/demos/blockfactory/factory_utils.js +0 -1036
  373. package/blockly-rc/demos/blockfactory/icon.png +0 -0
  374. package/blockly-rc/demos/blockfactory/index.html +0 -767
  375. package/blockly-rc/demos/blockfactory/link.png +0 -0
  376. package/blockly-rc/demos/blockfactory/standard_categories.js +0 -384
  377. package/blockly-rc/demos/blockfactory/workspacefactory/wfactory_controller.js +0 -1332
  378. package/blockly-rc/demos/blockfactory/workspacefactory/wfactory_generator.js +0 -224
  379. package/blockly-rc/demos/blockfactory/workspacefactory/wfactory_init.js +0 -541
  380. package/blockly-rc/demos/blockfactory/workspacefactory/wfactory_model.js +0 -548
  381. package/blockly-rc/demos/blockfactory/workspacefactory/wfactory_view.js +0 -424
  382. package/blockly-rc/demos/code/code.js +0 -626
  383. package/blockly-rc/demos/code/icon.png +0 -0
  384. package/blockly-rc/demos/code/icons.png +0 -0
  385. package/blockly-rc/demos/code/index.html +0 -359
  386. package/blockly-rc/demos/code/msg/ar.js +0 -24
  387. package/blockly-rc/demos/code/msg/be-tarask.js +0 -24
  388. package/blockly-rc/demos/code/msg/br.js +0 -24
  389. package/blockly-rc/demos/code/msg/ca.js +0 -24
  390. package/blockly-rc/demos/code/msg/cs.js +0 -24
  391. package/blockly-rc/demos/code/msg/da.js +0 -24
  392. package/blockly-rc/demos/code/msg/de.js +0 -24
  393. package/blockly-rc/demos/code/msg/el.js +0 -24
  394. package/blockly-rc/demos/code/msg/en.js +0 -24
  395. package/blockly-rc/demos/code/msg/es.js +0 -24
  396. package/blockly-rc/demos/code/msg/et.js +0 -24
  397. package/blockly-rc/demos/code/msg/fa.js +0 -24
  398. package/blockly-rc/demos/code/msg/fr.js +0 -24
  399. package/blockly-rc/demos/code/msg/he.js +0 -24
  400. package/blockly-rc/demos/code/msg/hr.js +0 -24
  401. package/blockly-rc/demos/code/msg/hrx.js +0 -24
  402. package/blockly-rc/demos/code/msg/hu.js +0 -24
  403. package/blockly-rc/demos/code/msg/ia.js +0 -24
  404. package/blockly-rc/demos/code/msg/is.js +0 -24
  405. package/blockly-rc/demos/code/msg/it.js +0 -24
  406. package/blockly-rc/demos/code/msg/ja.js +0 -24
  407. package/blockly-rc/demos/code/msg/kab.js +0 -24
  408. package/blockly-rc/demos/code/msg/ko.js +0 -24
  409. package/blockly-rc/demos/code/msg/mk.js +0 -24
  410. package/blockly-rc/demos/code/msg/ms.js +0 -24
  411. package/blockly-rc/demos/code/msg/nb.js +0 -24
  412. package/blockly-rc/demos/code/msg/nl.js +0 -24
  413. package/blockly-rc/demos/code/msg/oc.js +0 -24
  414. package/blockly-rc/demos/code/msg/pl.js +0 -24
  415. package/blockly-rc/demos/code/msg/pms.js +0 -24
  416. package/blockly-rc/demos/code/msg/pt-br.js +0 -24
  417. package/blockly-rc/demos/code/msg/ro.js +0 -24
  418. package/blockly-rc/demos/code/msg/ru.js +0 -24
  419. package/blockly-rc/demos/code/msg/sc.js +0 -24
  420. package/blockly-rc/demos/code/msg/sk.js +0 -24
  421. package/blockly-rc/demos/code/msg/sr.js +0 -24
  422. package/blockly-rc/demos/code/msg/sv.js +0 -24
  423. package/blockly-rc/demos/code/msg/ta.js +0 -24
  424. package/blockly-rc/demos/code/msg/th.js +0 -24
  425. package/blockly-rc/demos/code/msg/tlh.js +0 -24
  426. package/blockly-rc/demos/code/msg/tr.js +0 -24
  427. package/blockly-rc/demos/code/msg/uk.js +0 -24
  428. package/blockly-rc/demos/code/msg/vi.js +0 -24
  429. package/blockly-rc/demos/code/msg/zh-hans.js +0 -24
  430. package/blockly-rc/demos/code/msg/zh-hant.js +0 -24
  431. package/blockly-rc/demos/code/style.css +0 -184
  432. package/blockly-rc/demos/index.html +0 -68
  433. package/blockly-rc/demos/minimap/icon.png +0 -0
  434. package/blockly-rc/demos/minimap/index.html +0 -91
  435. package/blockly-rc/demos/minimap/minimap.js +0 -302
  436. package/blockly-rc/demos/mobile/README.md +0 -53
  437. package/blockly-rc/demos/mobile/android/README.md +0 -45
  438. package/blockly-rc/demos/mobile/android/app/build.gradle +0 -64
  439. package/blockly-rc/demos/mobile/android/app/proguard-rules.pro +0 -21
  440. package/blockly-rc/demos/mobile/android/app/src/androidTest/java/com/example/blocklywebview/ExampleInstrumentedTest.java +0 -26
  441. package/blockly-rc/demos/mobile/android/app/src/main/AndroidManifest.xml +0 -21
  442. package/blockly-rc/demos/mobile/android/app/src/main/java/com/google/blockly/android/webview/BlocklyWebViewFragment.java +0 -40
  443. package/blockly-rc/demos/mobile/android/app/src/main/java/com/google/blockly/android/webview/JsDialogHelper.java +0 -150
  444. package/blockly-rc/demos/mobile/android/app/src/main/java/com/google/blockly/android/webview/WebChromeClient.java +0 -32
  445. package/blockly-rc/demos/mobile/android/app/src/main/java/com/google/blockly/android/webview/demo/MainActivity.java +0 -18
  446. package/blockly-rc/demos/mobile/android/app/src/main/res/drawable/ic_launcher_background.xml +0 -74
  447. package/blockly-rc/demos/mobile/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +0 -34
  448. package/blockly-rc/demos/mobile/android/app/src/main/res/layout/activity_main.xml +0 -17
  449. package/blockly-rc/demos/mobile/android/app/src/main/res/layout/js_prompt.xml +0 -37
  450. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +0 -5
  451. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +0 -5
  452. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  453. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  454. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  455. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  456. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  457. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  458. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  459. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  460. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  461. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  462. package/blockly-rc/demos/mobile/android/app/src/main/res/values/colors.xml +0 -6
  463. package/blockly-rc/demos/mobile/android/app/src/main/res/values/js_dialog_helper.xml +0 -7
  464. package/blockly-rc/demos/mobile/android/app/src/main/res/values/strings.xml +0 -3
  465. package/blockly-rc/demos/mobile/android/app/src/main/res/values/styles.xml +0 -11
  466. package/blockly-rc/demos/mobile/android/app/src/test/java/com/example/blocklywebview/ExampleUnitTest.java +0 -17
  467. package/blockly-rc/demos/mobile/android/build.gradle +0 -27
  468. package/blockly-rc/demos/mobile/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  469. package/blockly-rc/demos/mobile/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  470. package/blockly-rc/demos/mobile/android/gradle.properties +0 -13
  471. package/blockly-rc/demos/mobile/android/gradlew +0 -172
  472. package/blockly-rc/demos/mobile/android/gradlew.bat +0 -84
  473. package/blockly-rc/demos/mobile/android/settings.gradle +0 -1
  474. package/blockly-rc/demos/mobile/html/index.html +0 -31
  475. package/blockly-rc/demos/mobile/html/ln_resources.sh +0 -22
  476. package/blockly-rc/demos/mobile/html/toolbox_standard.js +0 -333
  477. package/blockly-rc/demos/mobile/ios/Blockly WebView/AppDelegate.swift +0 -46
  478. package/blockly-rc/demos/mobile/ios/Blockly WebView/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -98
  479. package/blockly-rc/demos/mobile/ios/Blockly WebView/Assets.xcassets/Contents.json +0 -6
  480. package/blockly-rc/demos/mobile/ios/Blockly WebView/Base.lproj/LaunchScreen.storyboard +0 -25
  481. package/blockly-rc/demos/mobile/ios/Blockly WebView/Base.lproj/Main.storyboard +0 -44
  482. package/blockly-rc/demos/mobile/ios/Blockly WebView/Info.plist +0 -45
  483. package/blockly-rc/demos/mobile/ios/Blockly WebView/ViewController.swift +0 -110
  484. package/blockly-rc/demos/mobile/ios/Blockly WebView.xcodeproj/project.pbxproj +0 -390
  485. package/blockly-rc/demos/mobile/ios/Blockly WebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  486. package/blockly-rc/demos/mobile/ios/Blockly WebView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  487. package/blockly-rc/demos/mobile/ios/cp_resources.sh +0 -21
  488. package/blockly-rc/demos/storage/icon.png +0 -0
  489. package/blockly-rc/demos/storage/index.html +0 -104
  490. package/blockly-rc/generators/dart/dart_generator.ts +0 -321
  491. package/blockly-rc/generators/dart/lists.ts +0 -525
  492. package/blockly-rc/generators/dart/logic.ts +0 -155
  493. package/blockly-rc/generators/dart/loops.ts +0 -217
  494. package/blockly-rc/generators/dart/math.ts +0 -559
  495. package/blockly-rc/generators/dart/procedures.ts +0 -138
  496. package/blockly-rc/generators/dart/text.ts +0 -405
  497. package/blockly-rc/generators/dart/variables.ts +0 -32
  498. package/blockly-rc/generators/dart/variables_dynamic.ts +0 -17
  499. package/blockly-rc/generators/dart.ts +0 -50
  500. package/blockly-rc/generators/javascript/javascript_generator.ts +0 -346
  501. package/blockly-rc/generators/javascript/lists.ts +0 -465
  502. package/blockly-rc/generators/javascript/logic.ts +0 -153
  503. package/blockly-rc/generators/javascript/loops.ts +0 -245
  504. package/blockly-rc/generators/javascript/math.ts +0 -450
  505. package/blockly-rc/generators/javascript/procedures.ts +0 -142
  506. package/blockly-rc/generators/javascript/text.ts +0 -418
  507. package/blockly-rc/generators/javascript/variables.ts +0 -32
  508. package/blockly-rc/generators/javascript/variables_dynamic.ts +0 -17
  509. package/blockly-rc/generators/javascript.ts +0 -46
  510. package/blockly-rc/generators/lua/lists.ts +0 -445
  511. package/blockly-rc/generators/lua/logic.ts +0 -142
  512. package/blockly-rc/generators/lua/loops.ts +0 -192
  513. package/blockly-rc/generators/lua/lua_generator.ts +0 -225
  514. package/blockly-rc/generators/lua/math.ts +0 -473
  515. package/blockly-rc/generators/lua/procedures.ts +0 -144
  516. package/blockly-rc/generators/lua/text.ts +0 -380
  517. package/blockly-rc/generators/lua/variables.ts +0 -31
  518. package/blockly-rc/generators/lua/variables_dynamic.ts +0 -17
  519. package/blockly-rc/generators/lua.ts +0 -44
  520. package/blockly-rc/generators/php/lists.ts +0 -585
  521. package/blockly-rc/generators/php/logic.ts +0 -155
  522. package/blockly-rc/generators/php/loops.ts +0 -218
  523. package/blockly-rc/generators/php/math.ts +0 -408
  524. package/blockly-rc/generators/php/php_generator.ts +0 -320
  525. package/blockly-rc/generators/php/procedures.ts +0 -159
  526. package/blockly-rc/generators/php/text.ts +0 -315
  527. package/blockly-rc/generators/php/variables.ts +0 -32
  528. package/blockly-rc/generators/php/variables_dynamic.ts +0 -17
  529. package/blockly-rc/generators/php.ts +0 -46
  530. package/blockly-rc/generators/python/lists.ts +0 -398
  531. package/blockly-rc/generators/python/logic.ts +0 -148
  532. package/blockly-rc/generators/python/loops.ts +0 -251
  533. package/blockly-rc/generators/python/math.ts +0 -434
  534. package/blockly-rc/generators/python/procedures.ts +0 -159
  535. package/blockly-rc/generators/python/python_generator.ts +0 -355
  536. package/blockly-rc/generators/python/text.ts +0 -338
  537. package/blockly-rc/generators/python/variables.ts +0 -31
  538. package/blockly-rc/generators/python/variables_dynamic.ts +0 -17
  539. package/blockly-rc/generators/python.ts +0 -51
  540. package/blockly-rc/gulpfile.js +0 -54
  541. package/blockly-rc/jsconfig.json +0 -7
  542. package/blockly-rc/media/1x1.gif +0 -0
  543. package/blockly-rc/media/click.mp3 +0 -0
  544. package/blockly-rc/media/click.ogg +0 -0
  545. package/blockly-rc/media/click.wav +0 -0
  546. package/blockly-rc/media/delete-icon.svg +0 -1
  547. package/blockly-rc/media/delete.mp3 +0 -0
  548. package/blockly-rc/media/delete.ogg +0 -0
  549. package/blockly-rc/media/delete.wav +0 -0
  550. package/blockly-rc/media/disconnect.mp3 +0 -0
  551. package/blockly-rc/media/disconnect.ogg +0 -0
  552. package/blockly-rc/media/disconnect.wav +0 -0
  553. package/blockly-rc/media/dropdown-arrow.svg +0 -1
  554. package/blockly-rc/media/foldout-icon.svg +0 -1
  555. package/blockly-rc/media/handclosed.cur +0 -0
  556. package/blockly-rc/media/handdelete.cur +0 -0
  557. package/blockly-rc/media/handopen.cur +0 -0
  558. package/blockly-rc/media/pilcrow.png +0 -0
  559. package/blockly-rc/media/quote0.png +0 -0
  560. package/blockly-rc/media/quote1.png +0 -0
  561. package/blockly-rc/media/resize-handle.svg +0 -3
  562. package/blockly-rc/media/sprites.png +0 -0
  563. package/blockly-rc/media/sprites.svg +0 -74
  564. package/blockly-rc/msg/json/README.md +0 -33
  565. package/blockly-rc/msg/json/ab.json +0 -222
  566. package/blockly-rc/msg/json/ace.json +0 -7
  567. package/blockly-rc/msg/json/af.json +0 -34
  568. package/blockly-rc/msg/json/am.json +0 -30
  569. package/blockly-rc/msg/json/ar.json +0 -355
  570. package/blockly-rc/msg/json/ast.json +0 -10
  571. package/blockly-rc/msg/json/az.json +0 -332
  572. package/blockly-rc/msg/json/ba.json +0 -211
  573. package/blockly-rc/msg/json/bcc.json +0 -290
  574. package/blockly-rc/msg/json/be-tarask.json +0 -334
  575. package/blockly-rc/msg/json/be.json +0 -324
  576. package/blockly-rc/msg/json/bg.json +0 -345
  577. package/blockly-rc/msg/json/bn.json +0 -189
  578. package/blockly-rc/msg/json/br.json +0 -334
  579. package/blockly-rc/msg/json/bs.json +0 -166
  580. package/blockly-rc/msg/json/ca.json +0 -341
  581. package/blockly-rc/msg/json/cdo.json +0 -6
  582. package/blockly-rc/msg/json/ce.json +0 -326
  583. package/blockly-rc/msg/json/constants.json +0 -12
  584. package/blockly-rc/msg/json/cs.json +0 -343
  585. package/blockly-rc/msg/json/da.json +0 -346
  586. package/blockly-rc/msg/json/de.json +0 -369
  587. package/blockly-rc/msg/json/diq.json +0 -258
  588. package/blockly-rc/msg/json/dtp.json +0 -198
  589. package/blockly-rc/msg/json/dty.json +0 -97
  590. package/blockly-rc/msg/json/ee.json +0 -160
  591. package/blockly-rc/msg/json/el.json +0 -356
  592. package/blockly-rc/msg/json/en-gb.json +0 -199
  593. package/blockly-rc/msg/json/en.json +0 -400
  594. package/blockly-rc/msg/json/eo.json +0 -337
  595. package/blockly-rc/msg/json/es.json +0 -358
  596. package/blockly-rc/msg/json/et.json +0 -326
  597. package/blockly-rc/msg/json/eu.json +0 -219
  598. package/blockly-rc/msg/json/fa.json +0 -341
  599. package/blockly-rc/msg/json/fi.json +0 -350
  600. package/blockly-rc/msg/json/fo.json +0 -46
  601. package/blockly-rc/msg/json/fr.json +0 -373
  602. package/blockly-rc/msg/json/frr.json +0 -6
  603. package/blockly-rc/msg/json/gl.json +0 -338
  604. package/blockly-rc/msg/json/gn.json +0 -54
  605. package/blockly-rc/msg/json/gor.json +0 -87
  606. package/blockly-rc/msg/json/ha.json +0 -313
  607. package/blockly-rc/msg/json/hak.json +0 -17
  608. package/blockly-rc/msg/json/he.json +0 -354
  609. package/blockly-rc/msg/json/hi.json +0 -318
  610. package/blockly-rc/msg/json/hr.json +0 -327
  611. package/blockly-rc/msg/json/hrx.json +0 -287
  612. package/blockly-rc/msg/json/hsb.json +0 -128
  613. package/blockly-rc/msg/json/hu.json +0 -349
  614. package/blockly-rc/msg/json/hy.json +0 -337
  615. package/blockly-rc/msg/json/ia.json +0 -337
  616. package/blockly-rc/msg/json/id.json +0 -335
  617. package/blockly-rc/msg/json/ig.json +0 -323
  618. package/blockly-rc/msg/json/inh.json +0 -80
  619. package/blockly-rc/msg/json/is.json +0 -331
  620. package/blockly-rc/msg/json/it.json +0 -346
  621. package/blockly-rc/msg/json/ja.json +0 -361
  622. package/blockly-rc/msg/json/ka.json +0 -14
  623. package/blockly-rc/msg/json/kab.json +0 -323
  624. package/blockly-rc/msg/json/kbd-cyrl.json +0 -84
  625. package/blockly-rc/msg/json/km.json +0 -29
  626. package/blockly-rc/msg/json/kn.json +0 -332
  627. package/blockly-rc/msg/json/ko.json +0 -372
  628. package/blockly-rc/msg/json/ksh.json +0 -43
  629. package/blockly-rc/msg/json/ku-latn.json +0 -41
  630. package/blockly-rc/msg/json/ky.json +0 -71
  631. package/blockly-rc/msg/json/la.json +0 -6
  632. package/blockly-rc/msg/json/lb.json +0 -156
  633. package/blockly-rc/msg/json/lki.json +0 -282
  634. package/blockly-rc/msg/json/lo.json +0 -92
  635. package/blockly-rc/msg/json/lrc.json +0 -123
  636. package/blockly-rc/msg/json/lt.json +0 -321
  637. package/blockly-rc/msg/json/lv.json +0 -324
  638. package/blockly-rc/msg/json/mg.json +0 -58
  639. package/blockly-rc/msg/json/mk.json +0 -178
  640. package/blockly-rc/msg/json/ml.json +0 -35
  641. package/blockly-rc/msg/json/mnw.json +0 -90
  642. package/blockly-rc/msg/json/ms.json +0 -300
  643. package/blockly-rc/msg/json/my.json +0 -57
  644. package/blockly-rc/msg/json/mzn.json +0 -6
  645. package/blockly-rc/msg/json/nb.json +0 -330
  646. package/blockly-rc/msg/json/ne.json +0 -247
  647. package/blockly-rc/msg/json/nl.json +0 -357
  648. package/blockly-rc/msg/json/oc.json +0 -194
  649. package/blockly-rc/msg/json/olo.json +0 -37
  650. package/blockly-rc/msg/json/pa.json +0 -69
  651. package/blockly-rc/msg/json/pl.json +0 -357
  652. package/blockly-rc/msg/json/pms.json +0 -324
  653. package/blockly-rc/msg/json/ps.json +0 -50
  654. package/blockly-rc/msg/json/pt-br.json +0 -369
  655. package/blockly-rc/msg/json/pt.json +0 -358
  656. package/blockly-rc/msg/json/qqq.json +0 -406
  657. package/blockly-rc/msg/json/ro.json +0 -333
  658. package/blockly-rc/msg/json/ru.json +0 -363
  659. package/blockly-rc/msg/json/sc.json +0 -283
  660. package/blockly-rc/msg/json/sco.json +0 -11
  661. package/blockly-rc/msg/json/sd.json +0 -158
  662. package/blockly-rc/msg/json/shn.json +0 -109
  663. package/blockly-rc/msg/json/si.json +0 -16
  664. package/blockly-rc/msg/json/sk.json +0 -332
  665. package/blockly-rc/msg/json/skr-arab.json +0 -117
  666. package/blockly-rc/msg/json/sl.json +0 -355
  667. package/blockly-rc/msg/json/smn.json +0 -133
  668. package/blockly-rc/msg/json/sq.json +0 -343
  669. package/blockly-rc/msg/json/sr-latn.json +0 -324
  670. package/blockly-rc/msg/json/sr.json +0 -348
  671. package/blockly-rc/msg/json/sv.json +0 -347
  672. package/blockly-rc/msg/json/sw.json +0 -12
  673. package/blockly-rc/msg/json/synonyms.json +0 -22
  674. package/blockly-rc/msg/json/ta.json +0 -306
  675. package/blockly-rc/msg/json/tcy.json +0 -316
  676. package/blockly-rc/msg/json/tdd.json +0 -109
  677. package/blockly-rc/msg/json/te.json +0 -101
  678. package/blockly-rc/msg/json/th.json +0 -333
  679. package/blockly-rc/msg/json/ti.json +0 -50
  680. package/blockly-rc/msg/json/tl.json +0 -129
  681. package/blockly-rc/msg/json/tlh.json +0 -179
  682. package/blockly-rc/msg/json/tr.json +0 -369
  683. package/blockly-rc/msg/json/ug-arab.json +0 -132
  684. package/blockly-rc/msg/json/uk.json +0 -345
  685. package/blockly-rc/msg/json/ur.json +0 -117
  686. package/blockly-rc/msg/json/uz.json +0 -36
  687. package/blockly-rc/msg/json/vi.json +0 -345
  688. package/blockly-rc/msg/json/xmf.json +0 -96
  689. package/blockly-rc/msg/json/yo.json +0 -316
  690. package/blockly-rc/msg/json/zgh.json +0 -83
  691. package/blockly-rc/msg/json/zh-hans.json +0 -372
  692. package/blockly-rc/msg/json/zh-hant.json +0 -362
  693. package/blockly-rc/msg/messages.js +0 -1616
  694. package/blockly-rc/package-lock.json +0 -12324
  695. package/blockly-rc/package.json +0 -149
  696. package/blockly-rc/patches/@microsoft+api-documenter+7.22.4.patch +0 -81
  697. package/blockly-rc/scripts/goog_module/convert-file.sh +0 -406
  698. package/blockly-rc/scripts/gulpfiles/appengine_tasks.js +0 -195
  699. package/blockly-rc/scripts/gulpfiles/build_tasks.js +0 -752
  700. package/blockly-rc/scripts/gulpfiles/config.js +0 -41
  701. package/blockly-rc/scripts/gulpfiles/docs_tasks.js +0 -147
  702. package/blockly-rc/scripts/gulpfiles/git_tasks.js +0 -181
  703. package/blockly-rc/scripts/gulpfiles/helper_tasks.js +0 -19
  704. package/blockly-rc/scripts/gulpfiles/package_tasks.js +0 -262
  705. package/blockly-rc/scripts/gulpfiles/release_tasks.js +0 -183
  706. package/blockly-rc/scripts/gulpfiles/test_tasks.js +0 -405
  707. package/blockly-rc/scripts/helpers.js +0 -74
  708. package/blockly-rc/scripts/i18n/common.py +0 -233
  709. package/blockly-rc/scripts/i18n/create_messages.py +0 -167
  710. package/blockly-rc/scripts/i18n/dedup_json.py +0 -72
  711. package/blockly-rc/scripts/i18n/js_to_json.py +0 -135
  712. package/blockly-rc/scripts/i18n/tests.py +0 -46
  713. package/blockly-rc/scripts/migration/cjs2esm +0 -162
  714. package/blockly-rc/scripts/migration/js2ts +0 -168
  715. package/blockly-rc/scripts/migration/renamings.json5 +0 -1599
  716. package/blockly-rc/scripts/package/README.md +0 -93
  717. package/blockly-rc/scripts/package/core-node.js +0 -31
  718. package/blockly-rc/scripts/package/index.js +0 -23
  719. package/blockly-rc/scripts/package/templates/umd-msg.template +0 -16
  720. package/blockly-rc/scripts/package/templates/umd.template +0 -13
  721. package/blockly-rc/scripts/themes/blockStyles_example.json +0 -11
  722. package/blockly-rc/scripts/themes/create_blockStyles.py +0 -181
  723. package/blockly-rc/scripts/tsick.js +0 -86
  724. package/blockly-rc/tests/.eslintrc.json +0 -10
  725. package/blockly-rc/tests/browser/.eslintrc.json +0 -29
  726. package/blockly-rc/tests/browser/.mocharc.js +0 -6
  727. package/blockly-rc/tests/browser/test/basic_block_factory_test.mjs +0 -44
  728. package/blockly-rc/tests/browser/test/basic_block_test.mjs +0 -39
  729. package/blockly-rc/tests/browser/test/basic_playground_test.mjs +0 -198
  730. package/blockly-rc/tests/browser/test/block_undo_test.mjs +0 -50
  731. package/blockly-rc/tests/browser/test/delete_blocks_test.mjs +0 -211
  732. package/blockly-rc/tests/browser/test/extensive_test.mjs +0 -195
  733. package/blockly-rc/tests/browser/test/field_edits_test.mjs +0 -61
  734. package/blockly-rc/tests/browser/test/hooks.mjs +0 -23
  735. package/blockly-rc/tests/browser/test/mutator_test.mjs +0 -88
  736. package/blockly-rc/tests/browser/test/procedure_test.mjs +0 -109
  737. package/blockly-rc/tests/browser/test/test_setup.mjs +0 -589
  738. package/blockly-rc/tests/browser/test/toolbox_drag_test.mjs +0 -207
  739. package/blockly-rc/tests/browser/test/workspace_comment_test.mjs +0 -224
  740. package/blockly-rc/tests/compile/index.html +0 -43
  741. package/blockly-rc/tests/compile/main.js +0 -53
  742. package/blockly-rc/tests/compile/test_blocks.js +0 -47
  743. package/blockly-rc/tests/compile/webdriver.js +0 -81
  744. package/blockly-rc/tests/generators/functions.xml +0 -561
  745. package/blockly-rc/tests/generators/golden/generated.dart +0 -1604
  746. package/blockly-rc/tests/generators/golden/generated.js +0 -1552
  747. package/blockly-rc/tests/generators/golden/generated.lua +0 -1828
  748. package/blockly-rc/tests/generators/golden/generated.php +0 -1611
  749. package/blockly-rc/tests/generators/golden/generated.py +0 -1407
  750. package/blockly-rc/tests/generators/index.html +0 -405
  751. package/blockly-rc/tests/generators/lists.xml +0 -8675
  752. package/blockly-rc/tests/generators/logic.xml +0 -1019
  753. package/blockly-rc/tests/generators/loops1.xml +0 -345
  754. package/blockly-rc/tests/generators/loops2.xml +0 -891
  755. package/blockly-rc/tests/generators/loops3.xml +0 -735
  756. package/blockly-rc/tests/generators/math.xml +0 -2077
  757. package/blockly-rc/tests/generators/text.xml +0 -4651
  758. package/blockly-rc/tests/generators/unittest.js +0 -103
  759. package/blockly-rc/tests/generators/unittest_dart.js +0 -163
  760. package/blockly-rc/tests/generators/unittest_javascript.js +0 -167
  761. package/blockly-rc/tests/generators/unittest_lua.js +0 -165
  762. package/blockly-rc/tests/generators/unittest_php.js +0 -154
  763. package/blockly-rc/tests/generators/unittest_python.js +0 -138
  764. package/blockly-rc/tests/generators/variables.xml +0 -68
  765. package/blockly-rc/tests/generators/webdriver.js +0 -123
  766. package/blockly-rc/tests/media/200px.png +0 -0
  767. package/blockly-rc/tests/media/30px.png +0 -0
  768. package/blockly-rc/tests/media/50px.png +0 -0
  769. package/blockly-rc/tests/media/a.png +0 -0
  770. package/blockly-rc/tests/media/arrow.png +0 -0
  771. package/blockly-rc/tests/media/b.png +0 -0
  772. package/blockly-rc/tests/media/c.png +0 -0
  773. package/blockly-rc/tests/media/d.png +0 -0
  774. package/blockly-rc/tests/media/e.png +0 -0
  775. package/blockly-rc/tests/media/f.png +0 -0
  776. package/blockly-rc/tests/media/g.png +0 -0
  777. package/blockly-rc/tests/media/h.png +0 -0
  778. package/blockly-rc/tests/media/i.png +0 -0
  779. package/blockly-rc/tests/media/j.png +0 -0
  780. package/blockly-rc/tests/media/k.png +0 -0
  781. package/blockly-rc/tests/media/l.png +0 -0
  782. package/blockly-rc/tests/media/m.png +0 -0
  783. package/blockly-rc/tests/migration/renamings.schema.json +0 -59
  784. package/blockly-rc/tests/migration/validate-renamings.mjs +0 -60
  785. package/blockly-rc/tests/mocha/.eslintrc.json +0 -21
  786. package/blockly-rc/tests/mocha/.mocharc.js +0 -6
  787. package/blockly-rc/tests/mocha/astnode_test.js +0 -850
  788. package/blockly-rc/tests/mocha/block_json_test.js +0 -777
  789. package/blockly-rc/tests/mocha/block_test.js +0 -2743
  790. package/blockly-rc/tests/mocha/blocks/lists_test.js +0 -196
  791. package/blockly-rc/tests/mocha/blocks/logic_ternary_test.js +0 -320
  792. package/blockly-rc/tests/mocha/blocks/loops_test.js +0 -56
  793. package/blockly-rc/tests/mocha/blocks/procedures_test.js +0 -2495
  794. package/blockly-rc/tests/mocha/blocks/variables_test.js +0 -311
  795. package/blockly-rc/tests/mocha/clipboard_test.js +0 -136
  796. package/blockly-rc/tests/mocha/comment_deserialization_test.js +0 -122
  797. package/blockly-rc/tests/mocha/comment_test.js +0 -170
  798. package/blockly-rc/tests/mocha/comment_view_test.js +0 -188
  799. package/blockly-rc/tests/mocha/connection_checker_test.js +0 -666
  800. package/blockly-rc/tests/mocha/connection_db_test.js +0 -362
  801. package/blockly-rc/tests/mocha/connection_test.js +0 -3738
  802. package/blockly-rc/tests/mocha/contextmenu_items_test.js +0 -488
  803. package/blockly-rc/tests/mocha/contextmenu_test.js +0 -71
  804. package/blockly-rc/tests/mocha/cursor_test.js +0 -134
  805. package/blockly-rc/tests/mocha/dropdowndiv_test.js +0 -116
  806. package/blockly-rc/tests/mocha/event_block_change_test.js +0 -126
  807. package/blockly-rc/tests/mocha/event_block_create_test.js +0 -109
  808. package/blockly-rc/tests/mocha/event_block_delete_test.js +0 -55
  809. package/blockly-rc/tests/mocha/event_block_drag_test.js +0 -36
  810. package/blockly-rc/tests/mocha/event_block_field_intermediate_change_test.js +0 -67
  811. package/blockly-rc/tests/mocha/event_block_move_test.js +0 -39
  812. package/blockly-rc/tests/mocha/event_bubble_open_test.js +0 -42
  813. package/blockly-rc/tests/mocha/event_click_test.js +0 -40
  814. package/blockly-rc/tests/mocha/event_comment_change_test.js +0 -39
  815. package/blockly-rc/tests/mocha/event_comment_collapse_test.js +0 -34
  816. package/blockly-rc/tests/mocha/event_comment_create_test.js +0 -38
  817. package/blockly-rc/tests/mocha/event_comment_delete_test.js +0 -38
  818. package/blockly-rc/tests/mocha/event_comment_drag_test.js +0 -35
  819. package/blockly-rc/tests/mocha/event_comment_move_test.js +0 -40
  820. package/blockly-rc/tests/mocha/event_comment_resize_test.js +0 -38
  821. package/blockly-rc/tests/mocha/event_marker_move_test.js +0 -44
  822. package/blockly-rc/tests/mocha/event_selected_test.js +0 -41
  823. package/blockly-rc/tests/mocha/event_test.js +0 -1578
  824. package/blockly-rc/tests/mocha/event_theme_change_test.js +0 -36
  825. package/blockly-rc/tests/mocha/event_toolbox_item_select_test.js +0 -64
  826. package/blockly-rc/tests/mocha/event_trashcan_open_test.js +0 -36
  827. package/blockly-rc/tests/mocha/event_var_create_test.js +0 -54
  828. package/blockly-rc/tests/mocha/event_var_delete_test.js +0 -54
  829. package/blockly-rc/tests/mocha/event_var_rename_test.js +0 -39
  830. package/blockly-rc/tests/mocha/event_var_type_change_test.js +0 -43
  831. package/blockly-rc/tests/mocha/event_viewport_test.js +0 -39
  832. package/blockly-rc/tests/mocha/extensions_test.js +0 -613
  833. package/blockly-rc/tests/mocha/field_checkbox_test.js +0 -299
  834. package/blockly-rc/tests/mocha/field_colour_test.js +0 -395
  835. package/blockly-rc/tests/mocha/field_dropdown_test.js +0 -282
  836. package/blockly-rc/tests/mocha/field_image_test.js +0 -241
  837. package/blockly-rc/tests/mocha/field_label_serializable_test.js +0 -252
  838. package/blockly-rc/tests/mocha/field_label_test.js +0 -226
  839. package/blockly-rc/tests/mocha/field_number_test.js +0 -505
  840. package/blockly-rc/tests/mocha/field_registry_test.js +0 -116
  841. package/blockly-rc/tests/mocha/field_test.js +0 -822
  842. package/blockly-rc/tests/mocha/field_textinput_test.js +0 -297
  843. package/blockly-rc/tests/mocha/field_variable_test.js +0 -611
  844. package/blockly-rc/tests/mocha/flyout_test.js +0 -638
  845. package/blockly-rc/tests/mocha/generator_test.js +0 -233
  846. package/blockly-rc/tests/mocha/gesture_test.js +0 -97
  847. package/blockly-rc/tests/mocha/icon_test.js +0 -369
  848. package/blockly-rc/tests/mocha/index.html +0 -229
  849. package/blockly-rc/tests/mocha/input_test.js +0 -296
  850. package/blockly-rc/tests/mocha/insertion_marker_manager_test.js +0 -443
  851. package/blockly-rc/tests/mocha/insertion_marker_test.js +0 -432
  852. package/blockly-rc/tests/mocha/jso_deserialization_test.js +0 -849
  853. package/blockly-rc/tests/mocha/jso_serialization_test.js +0 -1067
  854. package/blockly-rc/tests/mocha/json_test.js +0 -315
  855. package/blockly-rc/tests/mocha/keydown_test.js +0 -364
  856. package/blockly-rc/tests/mocha/layering_test.js +0 -95
  857. package/blockly-rc/tests/mocha/metrics_test.js +0 -671
  858. package/blockly-rc/tests/mocha/mutator_test.js +0 -87
  859. package/blockly-rc/tests/mocha/names_test.js +0 -97
  860. package/blockly-rc/tests/mocha/old_workspace_comment_test.js +0 -256
  861. package/blockly-rc/tests/mocha/procedure_map_test.js +0 -57
  862. package/blockly-rc/tests/mocha/registry_test.js +0 -281
  863. package/blockly-rc/tests/mocha/render_management_test.js +0 -127
  864. package/blockly-rc/tests/mocha/serializer_test.js +0 -2104
  865. package/blockly-rc/tests/mocha/shortcut_registry_test.js +0 -450
  866. package/blockly-rc/tests/mocha/test_helpers/block_definitions.js +0 -204
  867. package/blockly-rc/tests/mocha/test_helpers/code_generation.js +0 -115
  868. package/blockly-rc/tests/mocha/test_helpers/common.js +0 -106
  869. package/blockly-rc/tests/mocha/test_helpers/events.js +0 -290
  870. package/blockly-rc/tests/mocha/test_helpers/fields.js +0 -310
  871. package/blockly-rc/tests/mocha/test_helpers/icon_mocks.js +0 -81
  872. package/blockly-rc/tests/mocha/test_helpers/procedures.js +0 -302
  873. package/blockly-rc/tests/mocha/test_helpers/serialization.js +0 -124
  874. package/blockly-rc/tests/mocha/test_helpers/setup_teardown.js +0 -209
  875. package/blockly-rc/tests/mocha/test_helpers/toolbox_definitions.js +0 -271
  876. package/blockly-rc/tests/mocha/test_helpers/user_input.js +0 -62
  877. package/blockly-rc/tests/mocha/test_helpers/variables.js +0 -23
  878. package/blockly-rc/tests/mocha/test_helpers/warnings.js +0 -83
  879. package/blockly-rc/tests/mocha/test_helpers/workspace.js +0 -1691
  880. package/blockly-rc/tests/mocha/theme_test.js +0 -307
  881. package/blockly-rc/tests/mocha/toolbox_test.js +0 -761
  882. package/blockly-rc/tests/mocha/tooltip_test.js +0 -276
  883. package/blockly-rc/tests/mocha/touch_test.js +0 -109
  884. package/blockly-rc/tests/mocha/trashcan_test.js +0 -375
  885. package/blockly-rc/tests/mocha/utils_test.js +0 -536
  886. package/blockly-rc/tests/mocha/variable_map_test.js +0 -509
  887. package/blockly-rc/tests/mocha/variable_model_test.js +0 -85
  888. package/blockly-rc/tests/mocha/webdriver.js +0 -96
  889. package/blockly-rc/tests/mocha/widget_div_test.js +0 -272
  890. package/blockly-rc/tests/mocha/workspace_comment_test.js +0 -171
  891. package/blockly-rc/tests/mocha/workspace_svg_test.js +0 -414
  892. package/blockly-rc/tests/mocha/workspace_test.js +0 -27
  893. package/blockly-rc/tests/mocha/xml_test.js +0 -951
  894. package/blockly-rc/tests/mocha/zoom_controls_test.js +0 -81
  895. package/blockly-rc/tests/multi_playground.html +0 -482
  896. package/blockly-rc/tests/node/.eslintrc.json +0 -12
  897. package/blockly-rc/tests/node/.mocharc.js +0 -6
  898. package/blockly-rc/tests/node/run_node_test.mjs +0 -72
  899. package/blockly-rc/tests/playground.html +0 -1280
  900. package/blockly-rc/tests/playgrounds/advanced_playground.html +0 -158
  901. package/blockly-rc/tests/playgrounds/iframe.html +0 -40
  902. package/blockly-rc/tests/playgrounds/screenshot.js +0 -123
  903. package/blockly-rc/tests/scripts/check_metadata.sh +0 -166
  904. package/blockly-rc/tests/scripts/compile_typings.sh +0 -32
  905. package/blockly-rc/tests/scripts/load.mjs +0 -140
  906. package/blockly-rc/tests/scripts/setup_linux_env.sh +0 -7
  907. package/blockly-rc/tests/scripts/update_metadata.sh +0 -46
  908. package/blockly-rc/tests/themes/test_themes.js +0 -62
  909. package/blockly-rc/tests/typescript/README.md +0 -4
  910. package/blockly-rc/tests/typescript/src/field/different_user_input.ts +0 -81
  911. package/blockly-rc/tests/typescript/src/generators/dart.ts +0 -24
  912. package/blockly-rc/tests/typescript/src/generators/javascript.ts +0 -28
  913. package/blockly-rc/tests/typescript/src/generators/lua.ts +0 -24
  914. package/blockly-rc/tests/typescript/src/generators/php.ts +0 -24
  915. package/blockly-rc/tests/typescript/src/generators/python.ts +0 -24
  916. package/blockly-rc/tests/typescript/src/generators.ts +0 -31
  917. package/blockly-rc/tests/typescript/src/msg.ts +0 -20
  918. package/blockly-rc/tests/typescript/tsconfig.json +0 -20
  919. package/blockly-rc/tests/xml/README.txt +0 -11
  920. package/blockly-rc/tests/xml/blockly.xsd +0 -178
  921. package/blockly-rc/tests/xml/invalid.xml +0 -6
  922. package/blockly-rc/tests/xml/toolbox.xml +0 -311
  923. package/blockly-rc/tests/xml/workspace.xml +0 -114
  924. package/blockly-rc/tsconfig.json +0 -37
  925. package/blockly-rc/tsdoc.json +0 -35
  926. package/blockly-rc/typings/README.md +0 -5
  927. package/blockly-rc/typings/blocks.d.ts +0 -17
  928. package/blockly-rc/typings/core.d.ts +0 -7
  929. package/blockly-rc/typings/dart.d.ts +0 -7
  930. package/blockly-rc/typings/index.d.ts +0 -10
  931. package/blockly-rc/typings/javascript.d.ts +0 -7
  932. package/blockly-rc/typings/lua.d.ts +0 -7
  933. package/blockly-rc/typings/msg/ab.d.ts +0 -8
  934. package/blockly-rc/typings/msg/ace.d.ts +0 -8
  935. package/blockly-rc/typings/msg/af.d.ts +0 -8
  936. package/blockly-rc/typings/msg/am.d.ts +0 -8
  937. package/blockly-rc/typings/msg/ar.d.ts +0 -8
  938. package/blockly-rc/typings/msg/ast.d.ts +0 -8
  939. package/blockly-rc/typings/msg/az.d.ts +0 -8
  940. package/blockly-rc/typings/msg/ba.d.ts +0 -8
  941. package/blockly-rc/typings/msg/bcc.d.ts +0 -8
  942. package/blockly-rc/typings/msg/be-tarask.d.ts +0 -8
  943. package/blockly-rc/typings/msg/be.d.ts +0 -8
  944. package/blockly-rc/typings/msg/bg.d.ts +0 -8
  945. package/blockly-rc/typings/msg/bn.d.ts +0 -8
  946. package/blockly-rc/typings/msg/br.d.ts +0 -8
  947. package/blockly-rc/typings/msg/bs.d.ts +0 -8
  948. package/blockly-rc/typings/msg/ca.d.ts +0 -8
  949. package/blockly-rc/typings/msg/cdo.d.ts +0 -8
  950. package/blockly-rc/typings/msg/ce.d.ts +0 -8
  951. package/blockly-rc/typings/msg/cs.d.ts +0 -8
  952. package/blockly-rc/typings/msg/da.d.ts +0 -8
  953. package/blockly-rc/typings/msg/de.d.ts +0 -8
  954. package/blockly-rc/typings/msg/diq.d.ts +0 -8
  955. package/blockly-rc/typings/msg/dtp.d.ts +0 -8
  956. package/blockly-rc/typings/msg/dty.d.ts +0 -8
  957. package/blockly-rc/typings/msg/ee.d.ts +0 -8
  958. package/blockly-rc/typings/msg/el.d.ts +0 -8
  959. package/blockly-rc/typings/msg/en-gb.d.ts +0 -8
  960. package/blockly-rc/typings/msg/en.d.ts +0 -8
  961. package/blockly-rc/typings/msg/eo.d.ts +0 -8
  962. package/blockly-rc/typings/msg/es.d.ts +0 -8
  963. package/blockly-rc/typings/msg/et.d.ts +0 -8
  964. package/blockly-rc/typings/msg/eu.d.ts +0 -8
  965. package/blockly-rc/typings/msg/fa.d.ts +0 -8
  966. package/blockly-rc/typings/msg/fi.d.ts +0 -8
  967. package/blockly-rc/typings/msg/fo.d.ts +0 -8
  968. package/blockly-rc/typings/msg/fr.d.ts +0 -8
  969. package/blockly-rc/typings/msg/frr.d.ts +0 -8
  970. package/blockly-rc/typings/msg/gl.d.ts +0 -8
  971. package/blockly-rc/typings/msg/gn.d.ts +0 -8
  972. package/blockly-rc/typings/msg/gor.d.ts +0 -8
  973. package/blockly-rc/typings/msg/ha.d.ts +0 -8
  974. package/blockly-rc/typings/msg/hak.d.ts +0 -8
  975. package/blockly-rc/typings/msg/he.d.ts +0 -8
  976. package/blockly-rc/typings/msg/hi.d.ts +0 -8
  977. package/blockly-rc/typings/msg/hr.d.ts +0 -8
  978. package/blockly-rc/typings/msg/hrx.d.ts +0 -8
  979. package/blockly-rc/typings/msg/hsb.d.ts +0 -8
  980. package/blockly-rc/typings/msg/hu.d.ts +0 -8
  981. package/blockly-rc/typings/msg/hy.d.ts +0 -8
  982. package/blockly-rc/typings/msg/ia.d.ts +0 -8
  983. package/blockly-rc/typings/msg/id.d.ts +0 -8
  984. package/blockly-rc/typings/msg/ig.d.ts +0 -8
  985. package/blockly-rc/typings/msg/inh.d.ts +0 -8
  986. package/blockly-rc/typings/msg/is.d.ts +0 -8
  987. package/blockly-rc/typings/msg/it.d.ts +0 -8
  988. package/blockly-rc/typings/msg/ja.d.ts +0 -8
  989. package/blockly-rc/typings/msg/ka.d.ts +0 -8
  990. package/blockly-rc/typings/msg/kab.d.ts +0 -8
  991. package/blockly-rc/typings/msg/kbd-cyrl.d.ts +0 -8
  992. package/blockly-rc/typings/msg/km.d.ts +0 -8
  993. package/blockly-rc/typings/msg/kn.d.ts +0 -8
  994. package/blockly-rc/typings/msg/ko.d.ts +0 -8
  995. package/blockly-rc/typings/msg/ksh.d.ts +0 -8
  996. package/blockly-rc/typings/msg/ku-latn.d.ts +0 -8
  997. package/blockly-rc/typings/msg/ky.d.ts +0 -8
  998. package/blockly-rc/typings/msg/la.d.ts +0 -8
  999. package/blockly-rc/typings/msg/lb.d.ts +0 -8
  1000. package/blockly-rc/typings/msg/lki.d.ts +0 -8
  1001. package/blockly-rc/typings/msg/lo.d.ts +0 -8
  1002. package/blockly-rc/typings/msg/lrc.d.ts +0 -8
  1003. package/blockly-rc/typings/msg/lt.d.ts +0 -8
  1004. package/blockly-rc/typings/msg/lv.d.ts +0 -8
  1005. package/blockly-rc/typings/msg/mg.d.ts +0 -8
  1006. package/blockly-rc/typings/msg/mk.d.ts +0 -8
  1007. package/blockly-rc/typings/msg/ml.d.ts +0 -8
  1008. package/blockly-rc/typings/msg/mnw.d.ts +0 -8
  1009. package/blockly-rc/typings/msg/ms.d.ts +0 -8
  1010. package/blockly-rc/typings/msg/msg.d.ts +0 -440
  1011. package/blockly-rc/typings/msg/my.d.ts +0 -8
  1012. package/blockly-rc/typings/msg/mzn.d.ts +0 -8
  1013. package/blockly-rc/typings/msg/nb.d.ts +0 -8
  1014. package/blockly-rc/typings/msg/ne.d.ts +0 -8
  1015. package/blockly-rc/typings/msg/nl.d.ts +0 -8
  1016. package/blockly-rc/typings/msg/oc.d.ts +0 -8
  1017. package/blockly-rc/typings/msg/olo.d.ts +0 -8
  1018. package/blockly-rc/typings/msg/pa.d.ts +0 -8
  1019. package/blockly-rc/typings/msg/pl.d.ts +0 -8
  1020. package/blockly-rc/typings/msg/pms.d.ts +0 -8
  1021. package/blockly-rc/typings/msg/ps.d.ts +0 -8
  1022. package/blockly-rc/typings/msg/pt-br.d.ts +0 -8
  1023. package/blockly-rc/typings/msg/pt.d.ts +0 -8
  1024. package/blockly-rc/typings/msg/ro.d.ts +0 -8
  1025. package/blockly-rc/typings/msg/ru.d.ts +0 -8
  1026. package/blockly-rc/typings/msg/sc.d.ts +0 -8
  1027. package/blockly-rc/typings/msg/sco.d.ts +0 -8
  1028. package/blockly-rc/typings/msg/sd.d.ts +0 -8
  1029. package/blockly-rc/typings/msg/shn.d.ts +0 -8
  1030. package/blockly-rc/typings/msg/si.d.ts +0 -8
  1031. package/blockly-rc/typings/msg/sk.d.ts +0 -8
  1032. package/blockly-rc/typings/msg/skr-arab.d.ts +0 -8
  1033. package/blockly-rc/typings/msg/sl.d.ts +0 -8
  1034. package/blockly-rc/typings/msg/smn.d.ts +0 -8
  1035. package/blockly-rc/typings/msg/sq.d.ts +0 -8
  1036. package/blockly-rc/typings/msg/sr-latn.d.ts +0 -8
  1037. package/blockly-rc/typings/msg/sr.d.ts +0 -8
  1038. package/blockly-rc/typings/msg/sv.d.ts +0 -8
  1039. package/blockly-rc/typings/msg/sw.d.ts +0 -8
  1040. package/blockly-rc/typings/msg/ta.d.ts +0 -8
  1041. package/blockly-rc/typings/msg/tcy.d.ts +0 -8
  1042. package/blockly-rc/typings/msg/tdd.d.ts +0 -8
  1043. package/blockly-rc/typings/msg/te.d.ts +0 -8
  1044. package/blockly-rc/typings/msg/th.d.ts +0 -8
  1045. package/blockly-rc/typings/msg/ti.d.ts +0 -8
  1046. package/blockly-rc/typings/msg/tl.d.ts +0 -8
  1047. package/blockly-rc/typings/msg/tlh.d.ts +0 -8
  1048. package/blockly-rc/typings/msg/tr.d.ts +0 -8
  1049. package/blockly-rc/typings/msg/ug-arab.d.ts +0 -8
  1050. package/blockly-rc/typings/msg/uk.d.ts +0 -8
  1051. package/blockly-rc/typings/msg/ur.d.ts +0 -8
  1052. package/blockly-rc/typings/msg/uz.d.ts +0 -8
  1053. package/blockly-rc/typings/msg/vi.d.ts +0 -8
  1054. package/blockly-rc/typings/msg/xmf.d.ts +0 -8
  1055. package/blockly-rc/typings/msg/yo.d.ts +0 -8
  1056. package/blockly-rc/typings/msg/zgh.d.ts +0 -8
  1057. package/blockly-rc/typings/msg/zh-hans.d.ts +0 -8
  1058. package/blockly-rc/typings/msg/zh-hant.d.ts +0 -8
  1059. package/blockly-rc/typings/php.d.ts +0 -7
  1060. package/blockly-rc/typings/python.d.ts +0 -7
  1061. package/blockly-rc/typings/templates/blockly-header.template +0 -11
  1062. package/blockly-rc/typings/templates/blockly-interfaces.template +0 -83
  1063. package/blockly-rc/typings/templates/msg.template +0 -15
  1064. package/blockly-rc/typings/tsconfig.json +0 -23
  1065. package/temp-use-blockly-v12-rc.sh +0 -26
@@ -1,1768 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2012 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
-
7
- /**
8
- * Methods for graphically rendering a block as SVG.
9
- *
10
- * @class
11
- */
12
- // Former goog.module ID: Blockly.BlockSvg
13
-
14
- // Unused import preserved for side-effects. Remove if unneeded.
15
- import './events/events_selected.js';
16
-
17
- import {Block} from './block.js';
18
- import * as blockAnimations from './block_animations.js';
19
- import * as browserEvents from './browser_events.js';
20
- import * as common from './common.js';
21
- import {config} from './config.js';
22
- import type {Connection} from './connection.js';
23
- import {ConnectionType} from './connection_type.js';
24
- import * as constants from './constants.js';
25
- import * as ContextMenu from './contextmenu.js';
26
- import {
27
- ContextMenuOption,
28
- ContextMenuRegistry,
29
- LegacyContextMenuOption,
30
- } from './contextmenu_registry.js';
31
- import type {BlockMove} from './events/events_block_move.js';
32
- import * as deprecation from './utils/deprecation.js';
33
- import * as eventUtils from './events/utils.js';
34
- import type {Field} from './field.js';
35
- import {FieldLabel} from './field_label.js';
36
- import type {Input} from './inputs/input.js';
37
- import type {IASTNodeLocationSvg} from './interfaces/i_ast_node_location_svg.js';
38
- import type {IBoundedElement} from './interfaces/i_bounded_element.js';
39
- import type {ICopyable} from './interfaces/i_copyable.js';
40
- import type {IDragStrategy, IDraggable} from './interfaces/i_draggable.js';
41
- import {IIcon} from './interfaces/i_icon.js';
42
- import * as internalConstants from './internal_constants.js';
43
- import {ASTNode} from './keyboard_nav/ast_node.js';
44
- import {TabNavigateCursor} from './keyboard_nav/tab_navigate_cursor.js';
45
- import {MarkerManager} from './marker_manager.js';
46
- import {Msg} from './msg.js';
47
- import {MutatorIcon} from './icons/mutator_icon.js';
48
- import {RenderedConnection} from './rendered_connection.js';
49
- import type {IPathObject} from './renderers/common/i_path_object.js';
50
- import * as blocks from './serialization/blocks.js';
51
- import type {BlockStyle} from './theme.js';
52
- import * as Tooltip from './tooltip.js';
53
- import {Coordinate} from './utils/coordinate.js';
54
- import * as dom from './utils/dom.js';
55
- import {Rect} from './utils/rect.js';
56
- import {Svg} from './utils/svg.js';
57
- import * as svgMath from './utils/svg_math.js';
58
- import {WarningIcon} from './icons/warning_icon.js';
59
- import type {Workspace} from './workspace.js';
60
- import type {WorkspaceSvg} from './workspace_svg.js';
61
- import * as renderManagement from './render_management.js';
62
- import {IconType} from './icons/icon_types.js';
63
- import {BlockCopyData, BlockPaster} from './clipboard/block_paster.js';
64
- import {BlockDragStrategy} from './dragging/block_drag_strategy.js';
65
- import {IDeletable} from './blockly.js';
66
- import {FlyoutItemInfo} from './utils/toolbox.js';
67
-
68
- /**
69
- * Class for a block's SVG representation.
70
- * Not normally called directly, workspace.newBlock() is preferred.
71
- */
72
- export class BlockSvg
73
- extends Block
74
- implements
75
- IASTNodeLocationSvg,
76
- IBoundedElement,
77
- ICopyable<BlockCopyData>,
78
- IDraggable,
79
- IDeletable
80
- {
81
- /**
82
- * Constant for identifying rows that are to be rendered inline.
83
- * Don't collide with Blockly.inputTypes.
84
- */
85
- static readonly INLINE = -1;
86
-
87
- /**
88
- * ID to give the "collapsed warnings" warning. Allows us to remove the
89
- * "collapsed warnings" warning without removing any warnings that belong to
90
- * the block.
91
- */
92
- static readonly COLLAPSED_WARNING_ID = 'TEMP_COLLAPSED_WARNING_';
93
- override decompose?: (p1: Workspace) => BlockSvg;
94
- // override compose?: ((p1: BlockSvg) => void)|null;
95
- saveConnections?: (p1: BlockSvg) => void;
96
- customContextMenu?: (
97
- p1: Array<ContextMenuOption | LegacyContextMenuOption>,
98
- ) => void;
99
-
100
- /**
101
- * Height of this block, not including any statement blocks above or below.
102
- * Height is in workspace units.
103
- */
104
- height = 0;
105
-
106
- /**
107
- * Width of this block, including any connected value blocks.
108
- * Width is in workspace units.
109
- */
110
- width = 0;
111
-
112
- /**
113
- * Width of this block, not including any connected value blocks.
114
- * Width is in workspace units.
115
- *
116
- * @internal
117
- */
118
- childlessWidth = 0;
119
-
120
- /**
121
- * Map from IDs for warnings text to PIDs of functions to apply them.
122
- * Used to be able to maintain multiple warnings.
123
- */
124
- private warningTextDb = new Map<string, ReturnType<typeof setTimeout>>();
125
-
126
- /** Block's mutator icon (if any). */
127
- mutator: MutatorIcon | null = null;
128
-
129
- private svgGroup_: SVGGElement;
130
- style: BlockStyle;
131
- /** @internal */
132
- pathObject: IPathObject;
133
-
134
- /** Is this block a BlockSVG? */
135
- override readonly rendered = true;
136
-
137
- private visuallyDisabled = false;
138
-
139
- /**
140
- * Is this block currently rendering? Used to stop recursive render calls
141
- * from actually triggering a re-render.
142
- */
143
- private renderIsInProgress_ = false;
144
-
145
- /** Whether mousedown events have been bound yet. */
146
- private eventsInit_ = false;
147
-
148
- override workspace: WorkspaceSvg;
149
- // TODO(b/109816955): remove '!', see go/strict-prop-init-fix.
150
- override outputConnection!: RenderedConnection;
151
- // TODO(b/109816955): remove '!', see go/strict-prop-init-fix.
152
- override nextConnection!: RenderedConnection;
153
- // TODO(b/109816955): remove '!', see go/strict-prop-init-fix.
154
- override previousConnection!: RenderedConnection;
155
-
156
- private translation = '';
157
-
158
- /** Whether this block is currently being dragged. */
159
- private dragging = false;
160
-
161
- /**
162
- * The location of the top left of this block (in workspace coordinates)
163
- * relative to either its parent block, or the workspace origin if it has no
164
- * parent.
165
- *
166
- * @internal
167
- */
168
- relativeCoords = new Coordinate(0, 0);
169
-
170
- private dragStrategy: IDragStrategy = new BlockDragStrategy(this);
171
-
172
- /**
173
- * @param workspace The block's workspace.
174
- * @param prototypeName Name of the language object containing type-specific
175
- * functions for this block.
176
- * @param opt_id Optional ID. Use this ID if provided, otherwise create a new
177
- * ID.
178
- */
179
- constructor(workspace: WorkspaceSvg, prototypeName: string, opt_id?: string) {
180
- super(workspace, prototypeName, opt_id);
181
- if (!workspace.rendered) {
182
- throw TypeError('Cannot create a rendered block in a headless workspace');
183
- }
184
- this.workspace = workspace;
185
- this.svgGroup_ = dom.createSvgElement(Svg.G, {});
186
-
187
- if (prototypeName) {
188
- dom.addClass(this.svgGroup_, prototypeName);
189
- }
190
- /** A block style object. */
191
- this.style = workspace.getRenderer().getConstants().getBlockStyle(null);
192
-
193
- /** The renderer's path object. */
194
- this.pathObject = workspace
195
- .getRenderer()
196
- .makePathObject(this.svgGroup_, this.style);
197
-
198
- const svgPath = this.pathObject.svgPath;
199
- (svgPath as any).tooltip = this;
200
- Tooltip.bindMouseEvents(svgPath);
201
-
202
- // Expose this block's ID on its top-level SVG group.
203
- this.svgGroup_.setAttribute('data-id', this.id);
204
-
205
- this.doInit_();
206
- }
207
-
208
- /**
209
- * Create and initialize the SVG representation of the block.
210
- * May be called more than once.
211
- */
212
- initSvg() {
213
- if (this.initialized) return;
214
- for (const input of this.inputList) {
215
- input.init();
216
- }
217
- for (const icon of this.getIcons()) {
218
- icon.initView(this.createIconPointerDownListener(icon));
219
- icon.updateEditable();
220
- }
221
- this.applyColour();
222
- this.pathObject.updateMovable(this.isMovable() || this.isInFlyout);
223
- const svg = this.getSvgRoot();
224
- if (!this.workspace.options.readOnly && svg) {
225
- browserEvents.conditionalBind(
226
- svg,
227
- 'pointerdown',
228
- this,
229
- this.onMouseDown_,
230
- );
231
- }
232
-
233
- if (!svg.parentNode) {
234
- this.workspace.getCanvas().appendChild(svg);
235
- }
236
- this.initialized = true;
237
- }
238
-
239
- /**
240
- * Get the secondary colour of a block.
241
- *
242
- * @returns #RRGGBB string.
243
- */
244
- getColourSecondary(): string | undefined {
245
- return this.style.colourSecondary;
246
- }
247
-
248
- /**
249
- * Get the tertiary colour of a block.
250
- *
251
- * @returns #RRGGBB string.
252
- */
253
- getColourTertiary(): string | undefined {
254
- return this.style.colourTertiary;
255
- }
256
-
257
- /** Selects this block. Highlights the block visually. */
258
- select() {
259
- if (this.isShadow()) {
260
- this.getParent()?.select();
261
- return;
262
- }
263
- this.addSelect();
264
- }
265
-
266
- /** Unselects this block. Unhighlights the blockv visually. */
267
- unselect() {
268
- if (this.isShadow()) {
269
- this.getParent()?.unselect();
270
- return;
271
- }
272
- this.removeSelect();
273
- }
274
-
275
- /**
276
- * Sets the parent of this block to be a new block or null.
277
- *
278
- * @param newParent New parent block.
279
- * @internal
280
- */
281
- override setParent(newParent: this | null) {
282
- const oldParent = this.parentBlock_;
283
- if (newParent === oldParent) {
284
- return;
285
- }
286
-
287
- dom.startTextWidthCache();
288
- super.setParent(newParent);
289
- dom.stopTextWidthCache();
290
-
291
- const svgRoot = this.getSvgRoot();
292
-
293
- // Bail early if workspace is clearing, or we aren't rendered.
294
- // We won't need to reattach ourselves anywhere.
295
- if (this.workspace.isClearing || !svgRoot) {
296
- return;
297
- }
298
-
299
- const oldXY = this.getRelativeToSurfaceXY();
300
- if (newParent) {
301
- (newParent as BlockSvg).getSvgRoot().appendChild(svgRoot);
302
- } else if (oldParent) {
303
- // If we are losing a parent, we want to move our DOM element to the
304
- // root of the workspace.
305
- const draggingBlock = this.workspace
306
- .getCanvas()
307
- .querySelector('.blocklyDragging');
308
- if (draggingBlock) {
309
- this.workspace.getCanvas().insertBefore(svgRoot, draggingBlock);
310
- } else {
311
- this.workspace.getCanvas().appendChild(svgRoot);
312
- }
313
- this.translate(oldXY.x, oldXY.y);
314
- }
315
-
316
- this.applyColour();
317
- }
318
-
319
- /**
320
- * Return the coordinates of the top-left corner of this block relative to the
321
- * drawing surface's origin (0,0), in workspace units.
322
- * If the block is on the workspace, (0, 0) is the origin of the workspace
323
- * coordinate system.
324
- * This does not change with workspace scale.
325
- *
326
- * @returns Object with .x and .y properties in workspace coordinates.
327
- */
328
- override getRelativeToSurfaceXY(): Coordinate {
329
- const layerManger = this.workspace.getLayerManager();
330
- if (!layerManger) {
331
- throw new Error(
332
- 'Cannot calculate position because the workspace has not been appended',
333
- );
334
- }
335
- let x = 0;
336
- let y = 0;
337
-
338
- let element: SVGElement = this.getSvgRoot();
339
- if (element) {
340
- do {
341
- // Loop through this block and every parent.
342
- const xy = svgMath.getRelativeXY(element);
343
- x += xy.x;
344
- y += xy.y;
345
- element = element.parentNode as SVGElement;
346
- } while (element && !layerManger.hasLayer(element));
347
- }
348
- return new Coordinate(x, y);
349
- }
350
-
351
- /**
352
- * Move a block by a relative offset.
353
- *
354
- * @param dx Horizontal offset in workspace units.
355
- * @param dy Vertical offset in workspace units.
356
- * @param reason Why is this move happening? 'drag', 'bump', 'snap', ...
357
- */
358
- override moveBy(dx: number, dy: number, reason?: string[]) {
359
- if (this.parentBlock_) {
360
- throw Error('Block has parent');
361
- }
362
- const eventsEnabled = eventUtils.isEnabled();
363
- let event: BlockMove | null = null;
364
- if (eventsEnabled) {
365
- event = new (eventUtils.get(eventUtils.BLOCK_MOVE)!)(this) as BlockMove;
366
- reason && event.setReason(reason);
367
- }
368
-
369
- const delta = new Coordinate(dx, dy);
370
- const currLoc = this.getRelativeToSurfaceXY();
371
- const newLoc = Coordinate.sum(currLoc, delta);
372
- this.translate(newLoc.x, newLoc.y);
373
- this.updateComponentLocations(newLoc);
374
-
375
- if (eventsEnabled && event) {
376
- event!.recordNew();
377
- eventUtils.fire(event);
378
- }
379
- this.workspace.resizeContents();
380
- }
381
-
382
- /**
383
- * Transforms a block by setting the translation on the transform attribute
384
- * of the block's SVG.
385
- *
386
- * @param x The x coordinate of the translation in workspace units.
387
- * @param y The y coordinate of the translation in workspace units.
388
- */
389
- translate(x: number, y: number) {
390
- this.translation = `translate(${x}, ${y})`;
391
- this.relativeCoords = new Coordinate(x, y);
392
- this.getSvgRoot().setAttribute('transform', this.getTranslation());
393
- }
394
-
395
- /**
396
- * Returns the SVG translation of this block.
397
- *
398
- * @internal
399
- */
400
- getTranslation(): string {
401
- return this.translation;
402
- }
403
-
404
- /**
405
- * Move a block to a position.
406
- *
407
- * @param xy The position to move to in workspace units.
408
- * @param reason Why is this move happening? 'drag', 'bump', 'snap', ...
409
- */
410
- moveTo(xy: Coordinate, reason?: string[]) {
411
- const curXY = this.getRelativeToSurfaceXY();
412
- this.moveBy(xy.x - curXY.x, xy.y - curXY.y, reason);
413
- }
414
-
415
- /**
416
- * Move this block during a drag.
417
- * This block must be a top-level block.
418
- *
419
- * @param newLoc The location to translate to, in workspace coordinates.
420
- * @internal
421
- */
422
- moveDuringDrag(newLoc: Coordinate) {
423
- this.translate(newLoc.x, newLoc.y);
424
- this.getSvgRoot().setAttribute('transform', this.getTranslation());
425
- this.updateComponentLocations(newLoc);
426
- }
427
-
428
- /** Snap this block to the nearest grid point. */
429
- snapToGrid() {
430
- if (this.isDeadOrDying()) return;
431
- if (this.getParent()) return;
432
- if (this.isInFlyout) return;
433
- const grid = this.workspace.getGrid();
434
- if (!grid?.shouldSnap()) return;
435
- const currentXY = this.getRelativeToSurfaceXY();
436
- const alignedXY = grid.alignXY(currentXY);
437
- if (alignedXY !== currentXY) {
438
- this.moveTo(alignedXY, ['snap']);
439
- }
440
- }
441
-
442
- /**
443
- * Returns the coordinates of a bounding box describing the dimensions of this
444
- * block and any blocks stacked below it.
445
- * Coordinate system: workspace coordinates.
446
- *
447
- * @returns Object with coordinates of the bounding box.
448
- */
449
- getBoundingRectangle(): Rect {
450
- return this.getBoundingRectangleWithDimensions(this.getHeightWidth());
451
- }
452
-
453
- /**
454
- * Returns the coordinates of a bounding box describing the dimensions of this
455
- * block alone.
456
- * Coordinate system: workspace coordinates.
457
- *
458
- * @returns Object with coordinates of the bounding box.
459
- */
460
- getBoundingRectangleWithoutChildren(): Rect {
461
- return this.getBoundingRectangleWithDimensions({
462
- height: this.height,
463
- width: this.childlessWidth,
464
- });
465
- }
466
-
467
- private getBoundingRectangleWithDimensions(blockBounds: {
468
- height: number;
469
- width: number;
470
- }) {
471
- const blockXY = this.getRelativeToSurfaceXY();
472
- let left;
473
- let right;
474
- if (this.RTL) {
475
- left = blockXY.x - blockBounds.width;
476
- right = blockXY.x;
477
- } else {
478
- left = blockXY.x;
479
- right = blockXY.x + blockBounds.width;
480
- }
481
- return new Rect(blockXY.y, blockXY.y + blockBounds.height, left, right);
482
- }
483
-
484
- /**
485
- * Notify every input on this block to mark its fields as dirty.
486
- * A dirty field is a field that needs to be re-rendered.
487
- */
488
- markDirty() {
489
- this.pathObject.constants = this.workspace.getRenderer().getConstants();
490
- for (let i = 0, input; (input = this.inputList[i]); i++) {
491
- input.markDirty();
492
- }
493
- }
494
-
495
- /**
496
- * Set whether the block is collapsed or not.
497
- *
498
- * @param collapsed True if collapsed.
499
- */
500
- override setCollapsed(collapsed: boolean) {
501
- if (this.collapsed_ === collapsed) {
502
- return;
503
- }
504
- super.setCollapsed(collapsed);
505
- this.updateCollapsed_();
506
- }
507
-
508
- /**
509
- * Makes sure that when the block is collapsed, it is rendered correctly
510
- * for that state.
511
- */
512
- private updateCollapsed_() {
513
- const collapsed = this.isCollapsed();
514
- const collapsedInputName = constants.COLLAPSED_INPUT_NAME;
515
- const collapsedFieldName = constants.COLLAPSED_FIELD_NAME;
516
-
517
- for (let i = 0, input; (input = this.inputList[i]); i++) {
518
- if (input.name !== collapsedInputName) {
519
- input.setVisible(!collapsed);
520
- }
521
- }
522
-
523
- for (const icon of this.getIcons()) {
524
- icon.updateCollapsed();
525
- }
526
-
527
- if (!collapsed) {
528
- this.updateDisabled();
529
- this.removeInput(collapsedInputName);
530
- dom.removeClass(this.svgGroup_, 'blocklyCollapsed');
531
- return;
532
- }
533
-
534
- dom.addClass(this.svgGroup_, 'blocklyCollapsed');
535
-
536
- const text = this.toString(internalConstants.COLLAPSE_CHARS);
537
- const field = this.getField(collapsedFieldName);
538
- if (field) {
539
- field.setValue(text);
540
- return;
541
- }
542
- const input =
543
- this.getInput(collapsedInputName) ||
544
- this.appendDummyInput(collapsedInputName);
545
- input.appendField(new FieldLabel(text), collapsedFieldName);
546
- }
547
-
548
- /**
549
- * Open the next (or previous) FieldTextInput.
550
- *
551
- * @param start Current field.
552
- * @param forward If true go forward, otherwise backward.
553
- */
554
- tab(start: Field, forward: boolean) {
555
- const tabCursor = new TabNavigateCursor();
556
- tabCursor.setCurNode(ASTNode.createFieldNode(start)!);
557
- const currentNode = tabCursor.getCurNode();
558
-
559
- if (forward) {
560
- tabCursor.next();
561
- } else {
562
- tabCursor.prev();
563
- }
564
-
565
- const nextNode = tabCursor.getCurNode();
566
- if (nextNode && nextNode !== currentNode) {
567
- const nextField = nextNode.getLocation() as Field;
568
- nextField.showEditor();
569
-
570
- // Also move the cursor if we're in keyboard nav mode.
571
- if (this.workspace.keyboardAccessibilityMode) {
572
- this.workspace.getCursor()!.setCurNode(nextNode);
573
- }
574
- }
575
- }
576
-
577
- /**
578
- * Handle a pointerdown on an SVG block.
579
- *
580
- * @param e Pointer down event.
581
- */
582
- private onMouseDown_(e: PointerEvent) {
583
- const gesture = this.workspace.getGesture(e);
584
- if (gesture) {
585
- gesture.handleBlockStart(e, this);
586
- }
587
- }
588
-
589
- /**
590
- * Load the block's help page in a new window.
591
- *
592
- * @internal
593
- */
594
- showHelp() {
595
- const url =
596
- typeof this.helpUrl === 'function' ? this.helpUrl() : this.helpUrl;
597
- if (url) {
598
- window.open(url);
599
- }
600
- }
601
-
602
- /**
603
- * Generate the context menu for this block.
604
- *
605
- * @returns Context menu options or null if no menu.
606
- */
607
- protected generateContextMenu(): Array<
608
- ContextMenuOption | LegacyContextMenuOption
609
- > | null {
610
- if (this.workspace.options.readOnly || !this.contextMenu) {
611
- return null;
612
- }
613
- const menuOptions = ContextMenuRegistry.registry.getContextMenuOptions(
614
- ContextMenuRegistry.ScopeType.BLOCK,
615
- {block: this},
616
- );
617
-
618
- // Allow the block to add or modify menuOptions.
619
- if (this.customContextMenu) {
620
- this.customContextMenu(menuOptions);
621
- }
622
-
623
- return menuOptions;
624
- }
625
-
626
- /**
627
- * Show the context menu for this block.
628
- *
629
- * @param e Mouse event.
630
- * @internal
631
- */
632
- showContextMenu(e: PointerEvent) {
633
- const menuOptions = this.generateContextMenu();
634
-
635
- if (menuOptions && menuOptions.length) {
636
- ContextMenu.show(e, menuOptions, this.RTL, this.workspace);
637
- ContextMenu.setCurrentBlock(this);
638
- }
639
- }
640
-
641
- /**
642
- * Updates the locations of any parts of the block that need to know where
643
- * they are (e.g. connections, icons).
644
- *
645
- * @param blockOrigin The top-left of this block in workspace coordinates.
646
- * @internal
647
- */
648
- updateComponentLocations(blockOrigin: Coordinate) {
649
- if (!this.dragging) this.updateConnectionLocations(blockOrigin);
650
- this.updateIconLocations(blockOrigin);
651
- this.updateFieldLocations(blockOrigin);
652
-
653
- for (const child of this.getChildren(false)) {
654
- child.updateComponentLocations(
655
- Coordinate.sum(blockOrigin, child.relativeCoords),
656
- );
657
- }
658
- }
659
-
660
- private updateConnectionLocations(blockOrigin: Coordinate) {
661
- for (const conn of this.getConnections_(false)) {
662
- conn.moveToOffset(blockOrigin);
663
- }
664
- }
665
-
666
- private updateIconLocations(blockOrigin: Coordinate) {
667
- for (const icon of this.getIcons()) {
668
- icon.onLocationChange(blockOrigin);
669
- }
670
- }
671
-
672
- private updateFieldLocations(blockOrigin: Coordinate) {
673
- for (const input of this.inputList) {
674
- for (const field of input.fieldRow) {
675
- field.onLocationChange(blockOrigin);
676
- }
677
- }
678
- }
679
-
680
- /**
681
- * Add a CSS class to the SVG group of this block.
682
- *
683
- * @param className
684
- */
685
- addClass(className: string) {
686
- dom.addClass(this.svgGroup_, className);
687
- }
688
-
689
- /**
690
- * Remove a CSS class from the SVG group of this block.
691
- *
692
- * @param className
693
- */
694
- removeClass(className: string) {
695
- dom.removeClass(this.svgGroup_, className);
696
- }
697
-
698
- /**
699
- * Recursively adds or removes the dragging class to this node and its
700
- * children.
701
- *
702
- * @param adding True if adding, false if removing.
703
- * @internal
704
- */
705
- setDragging(adding: boolean) {
706
- this.dragging = adding;
707
- if (adding) {
708
- this.translation = '';
709
- common.draggingConnections.push(...this.getConnections_(true));
710
- this.addClass('blocklyDragging');
711
- } else {
712
- common.draggingConnections.length = 0;
713
- this.removeClass('blocklyDragging');
714
- }
715
- // Recurse through all blocks attached under this one.
716
- for (let i = 0; i < this.childBlocks_.length; i++) {
717
- (this.childBlocks_[i] as BlockSvg).setDragging(adding);
718
- }
719
- }
720
-
721
- /**
722
- * Set whether this block is movable or not.
723
- *
724
- * @param movable True if movable.
725
- */
726
- override setMovable(movable: boolean) {
727
- super.setMovable(movable);
728
- this.pathObject.updateMovable(movable);
729
- }
730
-
731
- /**
732
- * Set whether this block is editable or not.
733
- *
734
- * @param editable True if editable.
735
- */
736
- override setEditable(editable: boolean) {
737
- super.setEditable(editable);
738
-
739
- if (editable) {
740
- dom.removeClass(this.svgGroup_, 'blocklyNotEditable');
741
- } else {
742
- dom.addClass(this.svgGroup_, 'blocklyNotEditable');
743
- }
744
-
745
- const icons = this.getIcons();
746
- for (let i = 0; i < icons.length; i++) {
747
- icons[i].updateEditable();
748
- }
749
- }
750
-
751
- /**
752
- * Sets whether this block is a shadow block or not.
753
- * This method is internal and should not be called by users of Blockly. To
754
- * create shadow blocks programmatically call connection.setShadowState
755
- *
756
- * @param shadow True if a shadow.
757
- * @internal
758
- */
759
- override setShadow(shadow: boolean) {
760
- super.setShadow(shadow);
761
- this.applyColour();
762
- }
763
-
764
- /**
765
- * Set whether this block is an insertion marker block or not.
766
- * Once set this cannot be unset.
767
- *
768
- * @param insertionMarker True if an insertion marker.
769
- * @internal
770
- */
771
- override setInsertionMarker(insertionMarker: boolean) {
772
- if (this.isInsertionMarker_ === insertionMarker) {
773
- return; // No change.
774
- }
775
- this.isInsertionMarker_ = insertionMarker;
776
- if (this.isInsertionMarker_) {
777
- this.setColour(
778
- this.workspace.getRenderer().getConstants().INSERTION_MARKER_COLOUR,
779
- );
780
- this.pathObject.updateInsertionMarker(true);
781
- }
782
- }
783
-
784
- /**
785
- * Return the root node of the SVG or null if none exists.
786
- *
787
- * @returns The root SVG node (probably a group).
788
- */
789
- getSvgRoot(): SVGGElement {
790
- return this.svgGroup_;
791
- }
792
-
793
- /**
794
- * Dispose of this block.
795
- *
796
- * @param healStack If true, then try to heal any gap by connecting the next
797
- * statement with the previous statement. Otherwise, dispose of all
798
- * children of this block.
799
- * @param animate If true, show a disposal animation and sound.
800
- */
801
- override dispose(healStack?: boolean, animate?: boolean) {
802
- this.disposing = true;
803
-
804
- Tooltip.dispose();
805
- ContextMenu.hide();
806
-
807
- if (animate) {
808
- this.unplug(healStack);
809
- blockAnimations.disposeUiEffect(this);
810
- }
811
-
812
- super.dispose(!!healStack);
813
- dom.removeNode(this.svgGroup_);
814
- }
815
-
816
- /**
817
- * Disposes of this block without doing things required by the top block.
818
- * E.g. does trigger UI effects, remove nodes, etc.
819
- */
820
- override disposeInternal() {
821
- this.disposing = true;
822
- super.disposeInternal();
823
-
824
- if (common.getSelected() === this) {
825
- this.unselect();
826
- this.workspace.cancelCurrentGesture();
827
- }
828
-
829
- [...this.warningTextDb.values()].forEach((n) => clearTimeout(n));
830
- this.warningTextDb.clear();
831
-
832
- this.getIcons().forEach((i) => i.dispose());
833
- }
834
-
835
- /**
836
- * Delete a block and hide chaff when doing so. The block will not be deleted
837
- * if it's in a flyout. This is called from the context menu and keyboard
838
- * shortcuts as the full delete action. If you are disposing of a block from
839
- * the workspace and don't need to perform flyout checks, handle event
840
- * grouping, or hide chaff, then use `block.dispose()` directly.
841
- */
842
- checkAndDelete() {
843
- if (this.workspace.isFlyout) {
844
- return;
845
- }
846
- eventUtils.setGroup(true);
847
- this.workspace.hideChaff();
848
- if (this.outputConnection) {
849
- // Do not attempt to heal rows
850
- // (https://github.com/google/blockly/issues/4832)
851
- this.dispose(false, true);
852
- } else {
853
- this.dispose(/* heal */ true, true);
854
- }
855
- eventUtils.setGroup(false);
856
- }
857
-
858
- /**
859
- * Encode a block for copying.
860
- *
861
- * @returns Copy metadata, or null if the block is an insertion marker.
862
- */
863
- toCopyData(): BlockCopyData | null {
864
- if (this.isInsertionMarker_) {
865
- return null;
866
- }
867
- return {
868
- paster: BlockPaster.TYPE,
869
- blockState: blocks.save(this, {
870
- addCoordinates: true,
871
- addNextBlocks: false,
872
- }) as blocks.State,
873
- typeCounts: common.getBlockTypeCounts(this, true),
874
- };
875
- }
876
-
877
- /**
878
- * Updates the colour of the block to match the block's state.
879
- *
880
- * @internal
881
- */
882
- applyColour() {
883
- this.pathObject.applyColour?.(this);
884
-
885
- const icons = this.getIcons();
886
- for (let i = 0; i < icons.length; i++) {
887
- icons[i].applyColour();
888
- }
889
-
890
- for (let x = 0, input; (input = this.inputList[x]); x++) {
891
- for (let y = 0, field; (field = input.fieldRow[y]); y++) {
892
- field.applyColour();
893
- }
894
- }
895
- }
896
-
897
- /**
898
- * Updates the colour of the block (and children) to match the current
899
- * disabled state.
900
- *
901
- * @internal
902
- */
903
- updateDisabled() {
904
- const disabled = !this.isEnabled() || this.getInheritedDisabled();
905
-
906
- if (this.visuallyDisabled === disabled) {
907
- this.getNextBlock()?.updateDisabled();
908
- return;
909
- }
910
-
911
- this.applyColour();
912
- this.visuallyDisabled = disabled;
913
- for (const child of this.getChildren(false)) {
914
- child.updateDisabled();
915
- }
916
- }
917
-
918
- /**
919
- * Set this block's warning text.
920
- *
921
- * @param text The text, or null to delete.
922
- * @param id An optional ID for the warning text to be able to maintain
923
- * multiple warnings.
924
- */
925
- override setWarningText(text: string | null, id: string = '') {
926
- if (!id) {
927
- // Kill all previous pending processes, this edit supersedes them all.
928
- for (const timeout of this.warningTextDb.values()) {
929
- clearTimeout(timeout);
930
- }
931
- this.warningTextDb.clear();
932
- } else if (this.warningTextDb.has(id)) {
933
- // Only queue up the latest change. Kill any earlier pending process.
934
- clearTimeout(this.warningTextDb.get(id)!);
935
- this.warningTextDb.delete(id);
936
- }
937
- if (this.workspace.isDragging()) {
938
- // Don't change the warning text during a drag.
939
- // Wait until the drag finishes.
940
- this.warningTextDb.set(
941
- id,
942
- setTimeout(() => {
943
- if (!this.isDeadOrDying()) {
944
- this.warningTextDb.delete(id);
945
- this.setWarningText(text, id);
946
- }
947
- }, 100),
948
- );
949
- return;
950
- }
951
- if (this.isInFlyout) {
952
- text = null;
953
- }
954
-
955
- const icon = this.getIcon(WarningIcon.TYPE) as WarningIcon | undefined;
956
- if (text) {
957
- // Bubble up to add a warning on top-most collapsed block.
958
- // TODO(#6020): This warning is never removed.
959
- let parent = this.getSurroundParent();
960
- let collapsedParent = null;
961
- while (parent) {
962
- if (parent.isCollapsed()) {
963
- collapsedParent = parent;
964
- }
965
- parent = parent.getSurroundParent();
966
- }
967
- if (collapsedParent) {
968
- collapsedParent.setWarningText(
969
- Msg['COLLAPSED_WARNINGS_WARNING'],
970
- BlockSvg.COLLAPSED_WARNING_ID,
971
- );
972
- }
973
-
974
- if (icon) {
975
- (icon as WarningIcon).addMessage(text, id);
976
- } else {
977
- this.addIcon(new WarningIcon(this).addMessage(text, id));
978
- }
979
- } else if (icon) {
980
- // Dispose all warnings if no ID is given.
981
- if (!id) {
982
- this.removeIcon(WarningIcon.TYPE);
983
- } else {
984
- // Remove just this warning id's message.
985
- icon.addMessage('', id);
986
- // Then remove the entire icon if there is no longer any text.
987
- if (!icon.getText()) this.removeIcon(WarningIcon.TYPE);
988
- }
989
- }
990
- }
991
-
992
- /**
993
- * Give this block a mutator dialog.
994
- *
995
- * @param mutator A mutator dialog instance or null to remove.
996
- */
997
- override setMutator(mutator: MutatorIcon | null) {
998
- this.removeIcon(MutatorIcon.TYPE);
999
- if (mutator) this.addIcon(mutator);
1000
- }
1001
-
1002
- override addIcon<T extends IIcon>(icon: T): T {
1003
- super.addIcon(icon);
1004
-
1005
- if (icon instanceof MutatorIcon) this.mutator = icon;
1006
-
1007
- icon.initView(this.createIconPointerDownListener(icon));
1008
- icon.applyColour();
1009
- icon.updateEditable();
1010
- this.queueRender();
1011
-
1012
- return icon;
1013
- }
1014
-
1015
- /**
1016
- * Creates a pointer down event listener for the icon to append to its
1017
- * root svg.
1018
- */
1019
- private createIconPointerDownListener(icon: IIcon) {
1020
- return (e: PointerEvent) => {
1021
- if (this.isDeadOrDying()) return;
1022
- const gesture = this.workspace.getGesture(e);
1023
- if (gesture) {
1024
- gesture.setStartIcon(icon);
1025
- }
1026
- };
1027
- }
1028
-
1029
- override removeIcon(type: IconType<IIcon>): boolean {
1030
- const removed = super.removeIcon(type);
1031
-
1032
- if (type.equals(MutatorIcon.TYPE)) this.mutator = null;
1033
-
1034
- this.queueRender();
1035
-
1036
- return removed;
1037
- }
1038
-
1039
- /**
1040
- * @deprecated v11 - Set whether the block is manually enabled or disabled.
1041
- * The user can toggle whether a block is disabled from a context menu
1042
- * option. A block may still be disabled for other reasons even if the user
1043
- * attempts to manually enable it, such as when the block is in an invalid
1044
- * location. This method is deprecated and setDisabledReason should be used
1045
- * instead.
1046
- *
1047
- * @param enabled True if enabled.
1048
- */
1049
- override setEnabled(enabled: boolean) {
1050
- deprecation.warn(
1051
- 'setEnabled',
1052
- 'v11',
1053
- 'v12',
1054
- 'the setDisabledReason method of BlockSvg',
1055
- );
1056
- const wasEnabled = this.isEnabled();
1057
- super.setEnabled(enabled);
1058
- if (this.isEnabled() !== wasEnabled && !this.getInheritedDisabled()) {
1059
- this.updateDisabled();
1060
- }
1061
- }
1062
-
1063
- /**
1064
- * Add or remove a reason why the block might be disabled. If a block has
1065
- * any reasons to be disabled, then the block itself will be considered
1066
- * disabled. A block could be disabled for multiple independent reasons
1067
- * simultaneously, such as when the user manually disables it, or the block
1068
- * is invalid.
1069
- *
1070
- * @param disabled If true, then the block should be considered disabled for
1071
- * at least the provided reason, otherwise the block is no longer disabled
1072
- * for that reason.
1073
- * @param reason A language-neutral identifier for a reason why the block
1074
- * could be disabled. Call this method again with the same identifier to
1075
- * update whether the block is currently disabled for this reason.
1076
- */
1077
- override setDisabledReason(disabled: boolean, reason: string): void {
1078
- const wasEnabled = this.isEnabled();
1079
- super.setDisabledReason(disabled, reason);
1080
- if (this.isEnabled() !== wasEnabled && !this.getInheritedDisabled()) {
1081
- this.updateDisabled();
1082
- }
1083
- }
1084
-
1085
- /**
1086
- * Add blocklyNotDeletable class when block is not deletable
1087
- * Or remove class when block is deletable
1088
- */
1089
- override setDeletable(deletable: boolean) {
1090
- super.setDeletable(deletable);
1091
-
1092
- if (deletable) {
1093
- dom.removeClass(this.svgGroup_, 'blocklyNotDeletable');
1094
- } else {
1095
- dom.addClass(this.svgGroup_, 'blocklyNotDeletable');
1096
- }
1097
- }
1098
-
1099
- /**
1100
- * Set whether the block is highlighted or not. Block highlighting is
1101
- * often used to visually mark blocks currently being executed.
1102
- *
1103
- * @param highlighted True if highlighted.
1104
- */
1105
- setHighlighted(highlighted: boolean) {
1106
- this.pathObject.updateHighlighted(highlighted);
1107
- }
1108
-
1109
- /**
1110
- * Adds the visual "select" effect to the block, but does not actually select
1111
- * it or fire an event.
1112
- *
1113
- * @see BlockSvg#select
1114
- */
1115
- addSelect() {
1116
- this.pathObject.updateSelected(true);
1117
- }
1118
-
1119
- /**
1120
- * Removes the visual "select" effect from the block, but does not actually
1121
- * unselect it or fire an event.
1122
- *
1123
- * @see BlockSvg#unselect
1124
- */
1125
- removeSelect() {
1126
- this.pathObject.updateSelected(false);
1127
- }
1128
-
1129
- /**
1130
- * Update the cursor over this block by adding or removing a class.
1131
- *
1132
- * @param enable True if the delete cursor should be shown, false otherwise.
1133
- * @internal
1134
- */
1135
- setDeleteStyle(enable: boolean) {
1136
- this.pathObject.updateDraggingDelete(enable);
1137
- }
1138
-
1139
- // Overrides of functions on Blockly.Block that take into account whether the
1140
- // block has been rendered.
1141
-
1142
- /**
1143
- * Get the colour of a block.
1144
- *
1145
- * @returns #RRGGBB string.
1146
- */
1147
- override getColour(): string {
1148
- return this.style.colourPrimary;
1149
- }
1150
-
1151
- /**
1152
- * Change the colour of a block.
1153
- *
1154
- * @param colour HSV hue value, or #RRGGBB string.
1155
- */
1156
- override setColour(colour: number | string) {
1157
- super.setColour(colour);
1158
- const styleObj = this.workspace
1159
- .getRenderer()
1160
- .getConstants()
1161
- .getBlockStyleForColour(this.colour_);
1162
-
1163
- this.pathObject.setStyle?.(styleObj.style);
1164
- this.style = styleObj.style;
1165
- this.styleName_ = styleObj.name;
1166
-
1167
- this.applyColour();
1168
- }
1169
-
1170
- /**
1171
- * Set the style and colour values of a block.
1172
- *
1173
- * @param blockStyleName Name of the block style.
1174
- * @throws {Error} if the block style does not exist.
1175
- */
1176
- override setStyle(blockStyleName: string) {
1177
- const blockStyle = this.workspace
1178
- .getRenderer()
1179
- .getConstants()
1180
- .getBlockStyle(blockStyleName);
1181
-
1182
- if (this.styleName_) {
1183
- dom.removeClass(this.svgGroup_, this.styleName_);
1184
- }
1185
-
1186
- if (blockStyle) {
1187
- this.hat = blockStyle.hat;
1188
- this.pathObject.setStyle?.(blockStyle);
1189
- // Set colour to match Block.
1190
- this.colour_ = blockStyle.colourPrimary;
1191
- this.style = blockStyle;
1192
-
1193
- this.applyColour();
1194
-
1195
- dom.addClass(this.svgGroup_, blockStyleName);
1196
- this.styleName_ = blockStyleName;
1197
- } else {
1198
- throw Error('Invalid style name: ' + blockStyleName);
1199
- }
1200
- }
1201
-
1202
- /**
1203
- * Move this block to the front of the visible workspace.
1204
- * <g> tags do not respect z-index so SVG renders them in the
1205
- * order that they are in the DOM. By placing this block first within the
1206
- * block group's <g>, it will render on top of any other blocks.
1207
- *
1208
- * @param blockOnly: True to only move this block to the front without
1209
- * adjusting its parents.
1210
- * @internal
1211
- */
1212
- bringToFront(blockOnly = false) {
1213
- /* eslint-disable-next-line @typescript-eslint/no-this-alias */
1214
- let block: this | null = this;
1215
- if (block.isDeadOrDying()) {
1216
- return;
1217
- }
1218
- do {
1219
- const root = block.getSvgRoot();
1220
- const parent = root.parentNode;
1221
- const childNodes = parent!.childNodes;
1222
- // Avoid moving the block if it's already at the bottom.
1223
- if (childNodes[childNodes.length - 1] !== root) {
1224
- parent!.appendChild(root);
1225
- }
1226
- if (blockOnly) break;
1227
- block = block.getParent();
1228
- } while (block);
1229
- }
1230
-
1231
- /**
1232
- * Set whether this block can chain onto the bottom of another block.
1233
- *
1234
- * @param newBoolean True if there can be a previous statement.
1235
- * @param opt_check Statement type or list of statement types. Null/undefined
1236
- * if any type could be connected.
1237
- */
1238
- override setPreviousStatement(
1239
- newBoolean: boolean,
1240
- opt_check?: string | string[] | null,
1241
- ) {
1242
- super.setPreviousStatement(newBoolean, opt_check);
1243
- this.queueRender();
1244
- }
1245
-
1246
- /**
1247
- * Set whether another block can chain onto the bottom of this block.
1248
- *
1249
- * @param newBoolean True if there can be a next statement.
1250
- * @param opt_check Statement type or list of statement types. Null/undefined
1251
- * if any type could be connected.
1252
- */
1253
- override setNextStatement(
1254
- newBoolean: boolean,
1255
- opt_check?: string | string[] | null,
1256
- ) {
1257
- super.setNextStatement(newBoolean, opt_check);
1258
- this.queueRender();
1259
- }
1260
-
1261
- /**
1262
- * Set whether this block returns a value.
1263
- *
1264
- * @param newBoolean True if there is an output.
1265
- * @param opt_check Returned type or list of returned types. Null or
1266
- * undefined if any type could be returned (e.g. variable get).
1267
- */
1268
- override setOutput(
1269
- newBoolean: boolean,
1270
- opt_check?: string | string[] | null,
1271
- ) {
1272
- super.setOutput(newBoolean, opt_check);
1273
- this.queueRender();
1274
- }
1275
-
1276
- /**
1277
- * Set whether value inputs are arranged horizontally or vertically.
1278
- *
1279
- * @param newBoolean True if inputs are horizontal.
1280
- */
1281
- override setInputsInline(newBoolean: boolean) {
1282
- super.setInputsInline(newBoolean);
1283
- this.queueRender();
1284
- }
1285
-
1286
- /**
1287
- * Remove an input from this block.
1288
- *
1289
- * @param name The name of the input.
1290
- * @param opt_quiet True to prevent error if input is not present.
1291
- * @returns True if operation succeeds, false if input is not present and
1292
- * opt_quiet is true
1293
- * @throws {Error} if the input is not present and opt_quiet is not true.
1294
- */
1295
- override removeInput(name: string, opt_quiet?: boolean): boolean {
1296
- const removed = super.removeInput(name, opt_quiet);
1297
- this.queueRender();
1298
- return removed;
1299
- }
1300
-
1301
- /**
1302
- * Move a numbered input to a different location on this block.
1303
- *
1304
- * @param inputIndex Index of the input to move.
1305
- * @param refIndex Index of input that should be after the moved input.
1306
- */
1307
- override moveNumberedInputBefore(inputIndex: number, refIndex: number) {
1308
- super.moveNumberedInputBefore(inputIndex, refIndex);
1309
- this.queueRender();
1310
- }
1311
-
1312
- /** @override */
1313
- override appendInput(input: Input): Input {
1314
- super.appendInput(input);
1315
- this.queueRender();
1316
- return input;
1317
- }
1318
-
1319
- /**
1320
- * Sets whether this block's connections are tracked in the database or not.
1321
- *
1322
- * Used by the deserializer to be more efficient. Setting a connection's
1323
- * tracked_ value to false keeps it from adding itself to the db when it
1324
- * gets its first moveTo call, saving expensive ops for later.
1325
- *
1326
- * @param track If true, start tracking. If false, stop tracking.
1327
- * @internal
1328
- */
1329
- setConnectionTracking(track: boolean) {
1330
- if (this.previousConnection) {
1331
- this.previousConnection.setTracking(track);
1332
- }
1333
- if (this.outputConnection) {
1334
- this.outputConnection.setTracking(track);
1335
- }
1336
- if (this.nextConnection) {
1337
- this.nextConnection.setTracking(track);
1338
- const child = this.nextConnection.targetBlock();
1339
- if (child) {
1340
- child.setConnectionTracking(track);
1341
- }
1342
- }
1343
-
1344
- if (this.collapsed_) {
1345
- // When track is true, we don't want to start tracking collapsed
1346
- // connections. When track is false, we're already not tracking
1347
- // collapsed connections, so no need to update.
1348
- return;
1349
- }
1350
-
1351
- for (let i = 0; i < this.inputList.length; i++) {
1352
- const conn = this.inputList[i].connection as RenderedConnection;
1353
- if (conn) {
1354
- conn.setTracking(track);
1355
-
1356
- // Pass tracking on down the chain.
1357
- const block = conn.targetBlock();
1358
- if (block) {
1359
- block.setConnectionTracking(track);
1360
- }
1361
- }
1362
- }
1363
- }
1364
-
1365
- /**
1366
- * Returns connections originating from this block.
1367
- *
1368
- * @param all If true, return all connections even hidden ones.
1369
- * Otherwise, for a collapsed block don't return inputs connections.
1370
- * @returns Array of connections.
1371
- * @internal
1372
- */
1373
- override getConnections_(all: boolean): RenderedConnection[] {
1374
- const myConnections = [];
1375
- if (this.outputConnection) {
1376
- myConnections.push(this.outputConnection);
1377
- }
1378
- if (this.previousConnection) {
1379
- myConnections.push(this.previousConnection);
1380
- }
1381
- if (this.nextConnection) {
1382
- myConnections.push(this.nextConnection);
1383
- }
1384
- if (all || !this.collapsed_) {
1385
- for (let i = 0, input; (input = this.inputList[i]); i++) {
1386
- if (input.connection) {
1387
- myConnections.push(input.connection as RenderedConnection);
1388
- }
1389
- }
1390
- }
1391
- return myConnections;
1392
- }
1393
-
1394
- /**
1395
- * Walks down a stack of blocks and finds the last next connection on the
1396
- * stack.
1397
- *
1398
- * @param ignoreShadows If true,the last connection on a non-shadow block will
1399
- * be returned. If false, this will follow shadows to find the last
1400
- * connection.
1401
- * @returns The last next connection on the stack, or null.
1402
- * @internal
1403
- */
1404
- override lastConnectionInStack(
1405
- ignoreShadows: boolean,
1406
- ): RenderedConnection | null {
1407
- return super.lastConnectionInStack(ignoreShadows) as RenderedConnection;
1408
- }
1409
-
1410
- /**
1411
- * Find the connection on this block that corresponds to the given connection
1412
- * on the other block.
1413
- * Used to match connections between a block and its insertion marker.
1414
- *
1415
- * @param otherBlock The other block to match against.
1416
- * @param conn The other connection to match.
1417
- * @returns The matching connection on this block, or null.
1418
- * @internal
1419
- */
1420
- override getMatchingConnection(
1421
- otherBlock: Block,
1422
- conn: Connection,
1423
- ): RenderedConnection | null {
1424
- return super.getMatchingConnection(otherBlock, conn) as RenderedConnection;
1425
- }
1426
-
1427
- /**
1428
- * Create a connection of the specified type.
1429
- *
1430
- * @param type The type of the connection to create.
1431
- * @returns A new connection of the specified type.
1432
- * @internal
1433
- */
1434
- override makeConnection_(type: ConnectionType): RenderedConnection {
1435
- return new RenderedConnection(this, type);
1436
- }
1437
-
1438
- /**
1439
- * Return the next statement block directly connected to this block.
1440
- *
1441
- * @returns The next statement block or null.
1442
- */
1443
- override getNextBlock(): BlockSvg | null {
1444
- return super.getNextBlock() as BlockSvg;
1445
- }
1446
-
1447
- /**
1448
- * Returns the block connected to the previous connection.
1449
- *
1450
- * @returns The previous statement block or null.
1451
- */
1452
- override getPreviousBlock(): BlockSvg | null {
1453
- return super.getPreviousBlock() as BlockSvg;
1454
- }
1455
-
1456
- /**
1457
- * Bumps unconnected blocks out of alignment.
1458
- *
1459
- * Two blocks which aren't actually connected should not coincidentally line
1460
- * up on screen, because that creates confusion for end-users.
1461
- */
1462
- override bumpNeighbours() {
1463
- const root = this.getRootBlock();
1464
- if (
1465
- this.isDeadOrDying() ||
1466
- this.workspace.isDragging() ||
1467
- root.isInFlyout
1468
- ) {
1469
- return;
1470
- }
1471
-
1472
- function neighbourIsInStack(neighbour: RenderedConnection) {
1473
- return neighbour.getSourceBlock().getRootBlock() === root;
1474
- }
1475
-
1476
- for (const conn of this.getConnections_(false)) {
1477
- if (conn.isSuperior()) {
1478
- // Recurse down the block stack.
1479
- conn.targetBlock()?.bumpNeighbours();
1480
- }
1481
-
1482
- for (const neighbour of conn.neighbours(config.snapRadius)) {
1483
- if (neighbourIsInStack(neighbour)) continue;
1484
- if (conn.isConnected() && neighbour.isConnected()) continue;
1485
-
1486
- if (conn.isSuperior()) {
1487
- neighbour.bumpAwayFrom(conn);
1488
- } else {
1489
- conn.bumpAwayFrom(neighbour);
1490
- }
1491
- }
1492
- }
1493
- }
1494
-
1495
- /**
1496
- * Snap to grid, and then bump neighbouring blocks away at the end of the next
1497
- * render.
1498
- */
1499
- scheduleSnapAndBump() {
1500
- this.snapToGrid();
1501
- this.bumpNeighbours();
1502
- }
1503
-
1504
- /**
1505
- * Position a block so that it doesn't move the target block when connected.
1506
- * The block to position is usually either the first block in a dragged stack
1507
- * or an insertion marker.
1508
- *
1509
- * @param sourceConnection The connection on the moving block's stack.
1510
- * @param originalOffsetToTarget The connection original offset to the target connection
1511
- * @param originalOffsetInBlock The connection original offset in its block
1512
- * @internal
1513
- */
1514
- positionNearConnection(
1515
- sourceConnection: RenderedConnection,
1516
- originalOffsetToTarget: {x: number; y: number},
1517
- originalOffsetInBlock: Coordinate,
1518
- ) {
1519
- // We only need to position the new block if it's before the existing one,
1520
- // otherwise its position is set by the previous block.
1521
- if (
1522
- sourceConnection.type === ConnectionType.NEXT_STATEMENT ||
1523
- sourceConnection.type === ConnectionType.INPUT_VALUE
1524
- ) {
1525
- // First move the block to match the orginal target connection position
1526
- let dx = originalOffsetToTarget.x;
1527
- let dy = originalOffsetToTarget.y;
1528
- // Then adjust its position according to the connection resize
1529
- dx += originalOffsetInBlock.x - sourceConnection.getOffsetInBlock().x;
1530
- dy += originalOffsetInBlock.y - sourceConnection.getOffsetInBlock().y;
1531
-
1532
- this.moveBy(dx, dy);
1533
- }
1534
- }
1535
-
1536
- /**
1537
- * Find all the blocks that are directly nested inside this one.
1538
- * Includes value and statement inputs, as well as any following statement.
1539
- * Excludes any connection on an output tab or any preceding statement.
1540
- * Blocks are optionally sorted by position; top to bottom.
1541
- *
1542
- * @param ordered Sort the list if true.
1543
- * @returns Array of blocks.
1544
- */
1545
- override getChildren(ordered: boolean): BlockSvg[] {
1546
- return super.getChildren(ordered) as BlockSvg[];
1547
- }
1548
-
1549
- /**
1550
- * Triggers a rerender after a delay to allow for batching.
1551
- *
1552
- * @returns A promise that resolves after the currently queued renders have
1553
- * been completed. Used for triggering other behavior that relies on
1554
- * updated size/position location for the block.
1555
- * @internal
1556
- */
1557
- queueRender(): Promise<void> {
1558
- return renderManagement.queueRender(this);
1559
- }
1560
-
1561
- /**
1562
- * Immediately lays out and reflows a block based on its contents and
1563
- * settings.
1564
- */
1565
- render() {
1566
- this.queueRender();
1567
- renderManagement.triggerQueuedRenders();
1568
- }
1569
-
1570
- /**
1571
- * Renders this block in a way that's compatible with the more efficient
1572
- * render management system.
1573
- *
1574
- * @internal
1575
- */
1576
- renderEfficiently() {
1577
- dom.startTextWidthCache();
1578
-
1579
- if (this.isCollapsed()) {
1580
- this.updateCollapsed_();
1581
- }
1582
-
1583
- if (!this.isEnabled()) {
1584
- this.updateDisabled();
1585
- }
1586
-
1587
- this.workspace.getRenderer().render(this);
1588
- this.tightenChildrenEfficiently();
1589
-
1590
- dom.stopTextWidthCache();
1591
- this.updateMarkers_();
1592
- }
1593
-
1594
- /**
1595
- * Tightens all children of this block so they are snuggly rendered against
1596
- * their parent connections.
1597
- *
1598
- * Does not update connection locations, so that they can be updated more
1599
- * efficiently by the render management system.
1600
- *
1601
- * @internal
1602
- */
1603
- tightenChildrenEfficiently() {
1604
- for (const input of this.inputList) {
1605
- const conn = input.connection as RenderedConnection;
1606
- if (conn) conn.tightenEfficiently();
1607
- }
1608
- if (this.nextConnection) this.nextConnection.tightenEfficiently();
1609
- }
1610
-
1611
- /** Redraw any attached marker or cursor svgs if needed. */
1612
- protected updateMarkers_() {
1613
- if (this.workspace.keyboardAccessibilityMode && this.pathObject.cursorSvg) {
1614
- this.workspace.getCursor()!.draw();
1615
- }
1616
- if (this.workspace.keyboardAccessibilityMode && this.pathObject.markerSvg) {
1617
- // TODO(#4592): Update all markers on the block.
1618
- this.workspace.getMarker(MarkerManager.LOCAL_MARKER)!.draw();
1619
- }
1620
- for (const input of this.inputList) {
1621
- for (const field of input.fieldRow) {
1622
- field.updateMarkers_();
1623
- }
1624
- }
1625
- }
1626
-
1627
- /**
1628
- * Add the cursor SVG to this block's SVG group.
1629
- *
1630
- * @param cursorSvg The SVG root of the cursor to be added to the block SVG
1631
- * group.
1632
- * @internal
1633
- */
1634
- setCursorSvg(cursorSvg: SVGElement) {
1635
- this.pathObject.setCursorSvg(cursorSvg);
1636
- }
1637
-
1638
- /**
1639
- * Add the marker SVG to this block's SVG group.
1640
- *
1641
- * @param markerSvg The SVG root of the marker to be added to the block SVG
1642
- * group.
1643
- * @internal
1644
- */
1645
- setMarkerSvg(markerSvg: SVGElement) {
1646
- this.pathObject.setMarkerSvg(markerSvg);
1647
- }
1648
-
1649
- /**
1650
- * Returns a bounding box describing the dimensions of this block
1651
- * and any blocks stacked below it.
1652
- *
1653
- * @returns Object with height and width properties in workspace units.
1654
- * @internal
1655
- */
1656
- getHeightWidth(): {height: number; width: number} {
1657
- let height = this.height;
1658
- let width = this.width;
1659
- // Recursively add size of subsequent blocks.
1660
- const nextBlock = this.getNextBlock();
1661
- if (nextBlock) {
1662
- const nextHeightWidth = nextBlock.getHeightWidth();
1663
- const tabHeight = this.workspace
1664
- .getRenderer()
1665
- .getConstants().NOTCH_HEIGHT;
1666
- height += nextHeightWidth.height - tabHeight;
1667
- width = Math.max(width, nextHeightWidth.width);
1668
- }
1669
- return {height, width};
1670
- }
1671
-
1672
- /**
1673
- * Visual effect to show that if the dragging block is dropped, this block
1674
- * will be replaced. If a shadow block, it will disappear. Otherwise it will
1675
- * bump.
1676
- *
1677
- * @param add True if highlighting should be added.
1678
- * @internal
1679
- */
1680
- fadeForReplacement(add: boolean) {
1681
- // TODO (7204): Remove these internal methods.
1682
- (this.pathObject as AnyDuringMigration).updateReplacementFade(add);
1683
- }
1684
-
1685
- /**
1686
- * Visual effect to show that if the dragging block is dropped it will connect
1687
- * to this input.
1688
- *
1689
- * @param conn The connection on the input to highlight.
1690
- * @param add True if highlighting should be added.
1691
- * @internal
1692
- */
1693
- highlightShapeForInput(conn: RenderedConnection, add: boolean) {
1694
- // TODO (7204): Remove these internal methods.
1695
- (this.pathObject as AnyDuringMigration).updateShapeForInputHighlight(
1696
- conn,
1697
- add,
1698
- );
1699
- }
1700
-
1701
- /** Sets the drag strategy for this block. */
1702
- setDragStrategy(dragStrategy: IDragStrategy) {
1703
- this.dragStrategy = dragStrategy;
1704
- }
1705
-
1706
- /** Returns whether this block is movable or not. */
1707
- override isMovable(): boolean {
1708
- return this.dragStrategy.isMovable();
1709
- }
1710
-
1711
- /** Starts a drag on the block. */
1712
- startDrag(e?: PointerEvent): void {
1713
- this.dragStrategy.startDrag(e);
1714
- }
1715
-
1716
- /** Drags the block to the given location. */
1717
- drag(newLoc: Coordinate, e?: PointerEvent): void {
1718
- this.dragStrategy.drag(newLoc, e);
1719
- }
1720
-
1721
- /** Ends the drag on the block. */
1722
- endDrag(e?: PointerEvent): void {
1723
- this.dragStrategy.endDrag(e);
1724
- }
1725
-
1726
- /** Moves the block back to where it was at the start of a drag. */
1727
- revertDrag(): void {
1728
- this.dragStrategy.revertDrag();
1729
- }
1730
-
1731
- /**
1732
- * Returns a representation of this block that can be displayed in a flyout.
1733
- */
1734
- toFlyoutInfo(): FlyoutItemInfo[] {
1735
- const json: FlyoutItemInfo = {
1736
- kind: 'BLOCK',
1737
- ...blocks.save(this),
1738
- };
1739
-
1740
- const toRemove = new Set(['id', 'height', 'width', 'pinned', 'enabled']);
1741
-
1742
- // Traverse the JSON recursively.
1743
- const traverseJson = function (json: {[key: string]: unknown}) {
1744
- for (const key in json) {
1745
- if (toRemove.has(key)) {
1746
- delete json[key];
1747
- } else if (typeof json[key] === 'object') {
1748
- traverseJson(json[key] as {[key: string]: unknown});
1749
- }
1750
- }
1751
- };
1752
-
1753
- traverseJson(json as unknown as {[key: string]: unknown});
1754
- return [json];
1755
- }
1756
-
1757
- override jsonInit(json: AnyDuringMigration): void {
1758
- super.jsonInit(json);
1759
-
1760
- if (json['classes']) {
1761
- this.addClass(
1762
- Array.isArray(json['classes'])
1763
- ? json['classes'].join(' ')
1764
- : json['classes'],
1765
- );
1766
- }
1767
- }
1768
- }