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,2519 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2014 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
-
7
- /**
8
- * Object representing a workspace rendered as SVG.
9
- *
10
- * @class
11
- */
12
- // Former goog.module ID: Blockly.WorkspaceSvg
13
-
14
- // Unused import preserved for side-effects. Remove if unneeded.
15
- import './events/events_block_create.js';
16
- // Unused import preserved for side-effects. Remove if unneeded.
17
- import './events/events_theme_change.js';
18
- // Unused import preserved for side-effects. Remove if unneeded.
19
- import './events/events_viewport.js';
20
-
21
- import type {Block} from './block.js';
22
- import type {BlockSvg} from './block_svg.js';
23
- import type {BlocklyOptions} from './blockly_options.js';
24
- import * as browserEvents from './browser_events.js';
25
- import * as common from './common.js';
26
- import {ComponentManager} from './component_manager.js';
27
- import {ConnectionDB} from './connection_db.js';
28
- import * as ContextMenu from './contextmenu.js';
29
- import {ContextMenuRegistry} from './contextmenu_registry.js';
30
- import * as dropDownDiv from './dropdowndiv.js';
31
- import * as eventUtils from './events/utils.js';
32
- import {Flyout} from './flyout_base.js';
33
- import type {FlyoutButton} from './flyout_button.js';
34
- import {Gesture} from './gesture.js';
35
- import {Grid} from './grid.js';
36
- import type {IASTNodeLocationSvg} from './interfaces/i_ast_node_location_svg.js';
37
- import type {IBoundedElement} from './interfaces/i_bounded_element.js';
38
- import type {IDragTarget} from './interfaces/i_drag_target.js';
39
- import type {IFlyout} from './interfaces/i_flyout.js';
40
- import type {IMetricsManager} from './interfaces/i_metrics_manager.js';
41
- import type {IToolbox} from './interfaces/i_toolbox.js';
42
- import type {Cursor} from './keyboard_nav/cursor.js';
43
- import type {Marker} from './keyboard_nav/marker.js';
44
- import {MarkerManager} from './marker_manager.js';
45
- import {Options} from './options.js';
46
- import * as Procedures from './procedures.js';
47
- import * as registry from './registry.js';
48
- import * as blockRendering from './renderers/common/block_rendering.js';
49
- import type {Renderer} from './renderers/common/renderer.js';
50
- import type {ScrollbarPair} from './scrollbar_pair.js';
51
- import type {Theme} from './theme.js';
52
- import {Classic} from './theme/classic.js';
53
- import {ThemeManager} from './theme_manager.js';
54
- import * as Tooltip from './tooltip.js';
55
- import type {Trashcan} from './trashcan.js';
56
- import * as arrayUtils from './utils/array.js';
57
- import {Coordinate} from './utils/coordinate.js';
58
- import * as dom from './utils/dom.js';
59
- import type {Metrics} from './utils/metrics.js';
60
- import {Rect} from './utils/rect.js';
61
- import {Size} from './utils/size.js';
62
- import {Svg} from './utils/svg.js';
63
- import * as svgMath from './utils/svg_math.js';
64
- import * as toolbox from './utils/toolbox.js';
65
- import * as userAgent from './utils/useragent.js';
66
- import type {
67
- IVariableModel,
68
- IVariableState,
69
- } from './interfaces/i_variable_model.js';
70
- import * as Variables from './variables.js';
71
- import * as VariablesDynamic from './variables_dynamic.js';
72
- import * as WidgetDiv from './widgetdiv.js';
73
- import {Workspace} from './workspace.js';
74
- import {WorkspaceAudio} from './workspace_audio.js';
75
- import {WorkspaceComment} from './comments/workspace_comment.js';
76
- import {ZoomControls} from './zoom_controls.js';
77
- import {ContextMenuOption} from './contextmenu_registry.js';
78
- import * as renderManagement from './render_management.js';
79
- import {LayerManager} from './layer_manager.js';
80
- import {RenderedWorkspaceComment} from './comments/rendered_workspace_comment.js';
81
-
82
- /** Margin around the top/bottom/left/right after a zoomToFit call. */
83
- const ZOOM_TO_FIT_MARGIN = 20;
84
-
85
- /**
86
- * Class for a workspace. This is an onscreen area with optional trashcan,
87
- * scrollbars, bubbles, and dragging.
88
- */
89
- export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
90
- /**
91
- * A wrapper function called when a resize event occurs.
92
- * You can pass the result to `eventHandling.unbind`.
93
- */
94
- private resizeHandlerWrapper: browserEvents.Data | null = null;
95
-
96
- /**
97
- * The render status of an SVG workspace.
98
- * Returns `false` for headless workspaces and true for instances of
99
- * `WorkspaceSvg`.
100
- */
101
- override rendered = true;
102
-
103
- /**
104
- * Whether the workspace is visible. False if the workspace has been hidden
105
- * by calling `setVisible(false)`.
106
- */
107
- private isVisible_ = true;
108
-
109
- /**
110
- * Whether this workspace has resizes enabled.
111
- * Disable during batch operations for a performance improvement.
112
- */
113
- private resizesEnabled = true;
114
-
115
- /**
116
- * Current horizontal scrolling offset in pixel units, relative to the
117
- * workspace origin.
118
- *
119
- * It is useful to think about a view, and a canvas moving beneath that
120
- * view. As the canvas moves right, this value becomes more positive, and
121
- * the view is now "seeing" the left side of the canvas. As the canvas moves
122
- * left, this value becomes more negative, and the view is now "seeing" the
123
- * right side of the canvas.
124
- *
125
- * The confusing thing about this value is that it does not, and must not
126
- * include the absoluteLeft offset. This is because it is used to calculate
127
- * the viewLeft value.
128
- *
129
- * The viewLeft is relative to the workspace origin (although in pixel
130
- * units). The workspace origin is the top-left corner of the workspace (at
131
- * least when it is enabled). It is shifted from the top-left of the
132
- * blocklyDiv so as not to be beneath the toolbox.
133
- *
134
- * When the workspace is enabled the viewLeft and workspace origin are at
135
- * the same X location. As the canvas slides towards the right beneath the
136
- * view this value (scrollX) becomes more positive, and the viewLeft becomes
137
- * more negative relative to the workspace origin (imagine the workspace
138
- * origin as a dot on the canvas sliding to the right as the canvas moves).
139
- *
140
- * So if the scrollX were to include the absoluteLeft this would in a way
141
- * "unshift" the workspace origin. This means that the viewLeft would be
142
- * representing the left edge of the blocklyDiv, rather than the left edge
143
- * of the workspace.
144
- */
145
- scrollX = 0;
146
-
147
- /**
148
- * Current vertical scrolling offset in pixel units, relative to the
149
- * workspace origin.
150
- *
151
- * It is useful to think about a view, and a canvas moving beneath that
152
- * view. As the canvas moves down, this value becomes more positive, and the
153
- * view is now "seeing" the upper part of the canvas. As the canvas moves
154
- * up, this value becomes more negative, and the view is "seeing" the lower
155
- * part of the canvas.
156
- *
157
- * This confusing thing about this value is that it does not, and must not
158
- * include the absoluteTop offset. This is because it is used to calculate
159
- * the viewTop value.
160
- *
161
- * The viewTop is relative to the workspace origin (although in pixel
162
- * units). The workspace origin is the top-left corner of the workspace (at
163
- * least when it is enabled). It is shifted from the top-left of the
164
- * blocklyDiv so as not to be beneath the toolbox.
165
- *
166
- * When the workspace is enabled the viewTop and workspace origin are at the
167
- * same Y location. As the canvas slides towards the bottom this value
168
- * (scrollY) becomes more positive, and the viewTop becomes more negative
169
- * relative to the workspace origin (image in the workspace origin as a dot
170
- * on the canvas sliding downwards as the canvas moves).
171
- *
172
- * So if the scrollY were to include the absoluteTop this would in a way
173
- * "unshift" the workspace origin. This means that the viewTop would be
174
- * representing the top edge of the blocklyDiv, rather than the top edge of
175
- * the workspace.
176
- */
177
- scrollY = 0;
178
-
179
- /** Horizontal scroll value when scrolling started in pixel units. */
180
- startScrollX = 0;
181
-
182
- /** Vertical scroll value when scrolling started in pixel units. */
183
- startScrollY = 0;
184
-
185
- /** Distance from mouse to object being dragged. */
186
- private dragDeltaXY: Coordinate | null = null;
187
-
188
- /** Current scale. */
189
- scale = 1;
190
-
191
- /** Cached scale value. Used to detect changes in viewport. */
192
- private oldScale = 1;
193
-
194
- /** Cached viewport top value. Used to detect changes in viewport. */
195
- private oldTop = 0;
196
-
197
- /** Cached viewport left value. Used to detect changes in viewport. */
198
- private oldLeft = 0;
199
-
200
- /** The workspace's trashcan (if any). */
201
- trashcan: Trashcan | null = null;
202
-
203
- /** This workspace's scrollbars, if they exist. */
204
- scrollbar: ScrollbarPair | null = null;
205
-
206
- /**
207
- * Fixed flyout providing blocks which may be dragged into this workspace.
208
- */
209
- private flyout: IFlyout | null = null;
210
-
211
- /**
212
- * Category-based toolbox providing blocks which may be dragged into this
213
- * workspace.
214
- */
215
- private toolbox_: IToolbox | null = null;
216
-
217
- /**
218
- * The current gesture in progress on this workspace, if any.
219
- *
220
- * @internal
221
- */
222
- currentGesture_: Gesture | null = null;
223
-
224
- /**
225
- * The first parent div with 'injectionDiv' in the name, or null if not set.
226
- * Access this with getInjectionDiv.
227
- */
228
- private injectionDiv: Element | null = null;
229
-
230
- /**
231
- * Last known position of the page scroll.
232
- * This is used to determine whether we have recalculated screen coordinate
233
- * stuff since the page scrolled.
234
- */
235
- private lastRecordedPageScroll: Coordinate | null = null;
236
-
237
- /**
238
- * Developers may define this function to add custom menu options to the
239
- * workspace's context menu or edit the workspace-created set of menu
240
- * options.
241
- *
242
- * @param options List of menu options to add to.
243
- * @param e The right-click event that triggered the context menu.
244
- */
245
- configureContextMenu:
246
- | ((menuOptions: ContextMenuOption[], e: Event) => void)
247
- | null = null;
248
-
249
- /**
250
- * A dummy wheel event listener used as a workaround for a Safari scrolling issue.
251
- * Set in createDom and used for removal in dispose to ensure proper cleanup.
252
- */
253
- private dummyWheelListener: (() => void) | null = null;
254
-
255
- /**
256
- * In a flyout, the target workspace where blocks should be placed after a
257
- * drag. Otherwise null.
258
- *
259
- * @internal
260
- */
261
- targetWorkspace: WorkspaceSvg | null = null;
262
-
263
- /** Inverted screen CTM, for use in mouseToSvg. */
264
- private inverseScreenCTM: SVGMatrix | null = null;
265
-
266
- /** Inverted screen CTM is dirty, recalculate it. */
267
- private inverseScreenCTMDirty = true;
268
- private metricsManager: IMetricsManager;
269
- /** @internal */
270
- getMetrics: () => Metrics;
271
- /** @internal */
272
- setMetrics: (p1: {x?: number; y?: number}) => void;
273
- private readonly componentManager: ComponentManager;
274
-
275
- /**
276
- * List of currently highlighted blocks. Block highlighting is often used
277
- * to visually mark blocks currently being executed.
278
- */
279
- private readonly highlightedBlocks: BlockSvg[] = [];
280
- private audioManager: WorkspaceAudio;
281
- private grid: Grid | null;
282
- private markerManager: MarkerManager;
283
-
284
- /**
285
- * Map from function names to callbacks, for deciding what to do when a
286
- * custom toolbox category is opened.
287
- */
288
- private toolboxCategoryCallbacks = new Map<
289
- string,
290
- (p1: WorkspaceSvg) => toolbox.FlyoutDefinition
291
- >();
292
-
293
- /**
294
- * Map from function names to callbacks, for deciding what to do when a
295
- * button is clicked.
296
- */
297
- private flyoutButtonCallbacks = new Map<string, (p1: FlyoutButton) => void>();
298
- protected themeManager_: ThemeManager;
299
- private readonly renderer: Renderer;
300
-
301
- /** Cached parent SVG. */
302
- private cachedParentSvg: SVGElement | null = null;
303
-
304
- /** True if keyboard accessibility mode is on, false otherwise. */
305
- keyboardAccessibilityMode = false;
306
-
307
- /** The list of top-level bounded elements on the workspace. */
308
- private topBoundedElements: IBoundedElement[] = [];
309
-
310
- /** The recorded drag targets. */
311
- private dragTargetAreas: Array<{component: IDragTarget; clientRect: Rect}> =
312
- [];
313
- private readonly cachedParentSvgSize: Size;
314
- private layerManager: LayerManager | null = null;
315
- // TODO(b/109816955): remove '!', see go/strict-prop-init-fix.
316
- svgGroup_!: SVGElement;
317
- // TODO(b/109816955): remove '!', see go/strict-prop-init-fix.
318
- svgBackground_!: SVGElement;
319
- // TODO(b/109816955): remove '!', see go/strict-prop-init-fix.
320
- svgBlockCanvas_!: SVGElement;
321
- // TODO(b/109816955): remove '!', see go/strict-prop-init-fix.
322
- svgBubbleCanvas_!: SVGElement;
323
- zoomControls_: ZoomControls | null = null;
324
-
325
- /**
326
- * @param options Dictionary of options.
327
- */
328
- constructor(options: Options) {
329
- super(options);
330
-
331
- const MetricsManagerClass = registry.getClassFromOptions(
332
- registry.Type.METRICS_MANAGER,
333
- options,
334
- true,
335
- );
336
- /** Object in charge of calculating metrics for the workspace. */
337
- this.metricsManager = new MetricsManagerClass!(this);
338
-
339
- /** Method to get all the metrics that have to do with a workspace. */
340
- this.getMetrics =
341
- options.getMetrics ||
342
- this.metricsManager.getMetrics.bind(this.metricsManager);
343
-
344
- /** Translates the workspace. */
345
- this.setMetrics =
346
- options.setMetrics || WorkspaceSvg.setTopLevelWorkspaceMetrics_;
347
-
348
- this.componentManager = new ComponentManager();
349
-
350
- this.connectionDBList = ConnectionDB.init(this.connectionChecker);
351
-
352
- /**
353
- * Object in charge of loading, storing, and playing audio for a workspace.
354
- */
355
- this.audioManager = new WorkspaceAudio(
356
- options.parentWorkspace as WorkspaceSvg,
357
- );
358
-
359
- /** This workspace's grid object or null. */
360
- this.grid = this.options.gridPattern
361
- ? new Grid(this.options.gridPattern, options.gridOptions)
362
- : null;
363
-
364
- /** Manager in charge of markers and cursors. */
365
- this.markerManager = new MarkerManager(this);
366
-
367
- if (Variables && Variables.flyoutCategory) {
368
- this.registerToolboxCategoryCallback(
369
- Variables.CATEGORY_NAME,
370
- Variables.flyoutCategory,
371
- );
372
- }
373
-
374
- if (VariablesDynamic && VariablesDynamic.flyoutCategory) {
375
- this.registerToolboxCategoryCallback(
376
- VariablesDynamic.CATEGORY_NAME,
377
- VariablesDynamic.flyoutCategory,
378
- );
379
- }
380
-
381
- if (Procedures && Procedures.flyoutCategory) {
382
- this.registerToolboxCategoryCallback(
383
- Procedures.CATEGORY_NAME,
384
- Procedures.flyoutCategory,
385
- );
386
- this.addChangeListener(Procedures.mutatorOpenListener);
387
- }
388
-
389
- /** Object in charge of storing and updating the workspace theme. */
390
- this.themeManager_ = this.options.parentWorkspace
391
- ? this.options.parentWorkspace.getThemeManager()
392
- : new ThemeManager(this, this.options.theme || Classic);
393
- this.themeManager_.subscribeWorkspace(this);
394
-
395
- /** The block renderer used for rendering blocks on this workspace. */
396
- this.renderer = blockRendering.init(
397
- this.options.renderer || 'geras',
398
- this.getTheme(),
399
- this.options.rendererOverrides ?? undefined,
400
- );
401
-
402
- /**
403
- * The cached size of the parent svg element.
404
- * Used to compute svg metrics.
405
- */
406
- this.cachedParentSvgSize = new Size(0, 0);
407
- }
408
-
409
- /**
410
- * Get the marker manager for this workspace.
411
- *
412
- * @returns The marker manager.
413
- */
414
- getMarkerManager(): MarkerManager {
415
- return this.markerManager;
416
- }
417
-
418
- /**
419
- * Gets the metrics manager for this workspace.
420
- *
421
- * @returns The metrics manager.
422
- */
423
- getMetricsManager(): IMetricsManager {
424
- return this.metricsManager;
425
- }
426
-
427
- /**
428
- * Sets the metrics manager for the workspace.
429
- *
430
- * @param metricsManager The metrics manager.
431
- * @internal
432
- */
433
- setMetricsManager(metricsManager: IMetricsManager) {
434
- this.metricsManager = metricsManager;
435
- this.getMetrics = this.metricsManager.getMetrics.bind(this.metricsManager);
436
- }
437
-
438
- /**
439
- * Gets the component manager for this workspace.
440
- *
441
- * @returns The component manager.
442
- */
443
- getComponentManager(): ComponentManager {
444
- return this.componentManager;
445
- }
446
-
447
- /**
448
- * Add the cursor SVG to this workspaces SVG group.
449
- *
450
- * @param cursorSvg The SVG root of the cursor to be added to the workspace
451
- * SVG group.
452
- * @internal
453
- */
454
- setCursorSvg(cursorSvg: SVGElement) {
455
- this.markerManager.setCursorSvg(cursorSvg);
456
- }
457
-
458
- /**
459
- * Add the marker SVG to this workspaces SVG group.
460
- *
461
- * @param markerSvg The SVG root of the marker to be added to the workspace
462
- * SVG group.
463
- * @internal
464
- */
465
- setMarkerSvg(markerSvg: SVGElement) {
466
- this.markerManager.setMarkerSvg(markerSvg);
467
- }
468
-
469
- /**
470
- * Get the marker with the given ID.
471
- *
472
- * @param id The ID of the marker.
473
- * @returns The marker with the given ID or null if no marker with the given
474
- * ID exists.
475
- * @internal
476
- */
477
- getMarker(id: string): Marker | null {
478
- if (this.markerManager) {
479
- return this.markerManager.getMarker(id);
480
- }
481
- return null;
482
- }
483
-
484
- /**
485
- * The cursor for this workspace.
486
- *
487
- * @returns The cursor for the workspace.
488
- */
489
- getCursor(): Cursor | null {
490
- if (this.markerManager) {
491
- return this.markerManager.getCursor();
492
- }
493
- return null;
494
- }
495
-
496
- /**
497
- * Get the block renderer attached to this workspace.
498
- *
499
- * @returns The renderer attached to this workspace.
500
- */
501
- getRenderer(): Renderer {
502
- return this.renderer;
503
- }
504
-
505
- /**
506
- * Get the theme manager for this workspace.
507
- *
508
- * @returns The theme manager for this workspace.
509
- * @internal
510
- */
511
- getThemeManager(): ThemeManager {
512
- return this.themeManager_;
513
- }
514
-
515
- /**
516
- * Get the workspace theme object.
517
- *
518
- * @returns The workspace theme object.
519
- */
520
- getTheme(): Theme {
521
- return this.themeManager_.getTheme();
522
- }
523
-
524
- /**
525
- * Set the workspace theme object.
526
- * If no theme is passed, default to the `Classic` theme.
527
- *
528
- * @param theme The workspace theme object.
529
- */
530
- setTheme(theme: Theme) {
531
- if (!theme) {
532
- theme = Classic as Theme;
533
- }
534
- this.themeManager_.setTheme(theme);
535
- }
536
-
537
- /**
538
- * Refresh all blocks on the workspace after a theme update.
539
- */
540
- refreshTheme() {
541
- if (this.svgGroup_) {
542
- this.renderer.refreshDom(this.svgGroup_, this.getTheme());
543
- }
544
-
545
- // Update all blocks in workspace that have a style name.
546
- this.updateBlockStyles_(
547
- this.getAllBlocks(false).filter(function (block) {
548
- return !!block.getStyleName();
549
- }),
550
- );
551
-
552
- // Update current toolbox selection.
553
- this.refreshToolboxSelection();
554
- if (this.toolbox_) {
555
- this.toolbox_.refreshTheme();
556
- }
557
-
558
- // Re-render if workspace is visible
559
- if (this.isVisible()) {
560
- this.setVisible(true);
561
- }
562
-
563
- const event = new (eventUtils.get(eventUtils.THEME_CHANGE))(
564
- this.getTheme().name,
565
- this.id,
566
- );
567
- eventUtils.fire(event);
568
- }
569
-
570
- /**
571
- * Updates all the blocks with new style.
572
- *
573
- * @param blocks List of blocks to update the style on.
574
- */
575
- private updateBlockStyles_(blocks: Block[]) {
576
- for (let i = 0, block; (block = blocks[i]); i++) {
577
- const blockStyleName = block.getStyleName();
578
- if (blockStyleName) {
579
- const blockSvg = block as BlockSvg;
580
- blockSvg.setStyle(blockStyleName);
581
- }
582
- }
583
- }
584
-
585
- /**
586
- * Getter for the inverted screen CTM.
587
- *
588
- * @returns The matrix to use in mouseToSvg
589
- */
590
- getInverseScreenCTM(): SVGMatrix | null {
591
- // Defer getting the screen CTM until we actually need it, this should
592
- // avoid forced reflows from any calls to updateInverseScreenCTM.
593
- if (this.inverseScreenCTMDirty) {
594
- const ctm = this.getParentSvg().getScreenCTM();
595
- if (ctm) {
596
- this.inverseScreenCTM = ctm.inverse();
597
- this.inverseScreenCTMDirty = false;
598
- }
599
- }
600
-
601
- return this.inverseScreenCTM;
602
- }
603
-
604
- /** Mark the inverse screen CTM as dirty. */
605
- updateInverseScreenCTM() {
606
- this.inverseScreenCTMDirty = true;
607
- }
608
-
609
- /**
610
- * Getter for isVisible
611
- *
612
- * @returns Whether the workspace is visible.
613
- * False if the workspace has been hidden by calling `setVisible(false)`.
614
- */
615
- isVisible(): boolean {
616
- return this.isVisible_;
617
- }
618
-
619
- /**
620
- * Return the absolute coordinates of the top-left corner of this element,
621
- * scales that after canvas SVG element, if it's a descendant.
622
- * The origin (0,0) is the top-left corner of the Blockly SVG.
623
- *
624
- * @param element SVG element to find the coordinates of.
625
- * @returns Object with .x and .y properties.
626
- * @internal
627
- */
628
- getSvgXY(element: SVGElement): Coordinate {
629
- let x = 0;
630
- let y = 0;
631
- let scale = 1;
632
- if (
633
- this.getCanvas().contains(element) ||
634
- this.getBubbleCanvas().contains(element)
635
- ) {
636
- // Before the SVG canvas, scale the coordinates.
637
- scale = this.scale;
638
- }
639
- do {
640
- // Loop through this block and every parent.
641
- const xy = svgMath.getRelativeXY(element);
642
- if (element === this.getCanvas() || element === this.getBubbleCanvas()) {
643
- // After the SVG canvas, don't scale the coordinates.
644
- scale = 1;
645
- }
646
- x += xy.x * scale;
647
- y += xy.y * scale;
648
- element = element.parentNode as SVGElement;
649
- } while (
650
- element &&
651
- element !== this.getParentSvg() &&
652
- element !== this.getInjectionDiv()
653
- );
654
- return new Coordinate(x, y);
655
- }
656
-
657
- /**
658
- * Gets the size of the workspace's parent SVG element.
659
- *
660
- * @returns The cached width and height of the workspace's parent SVG element.
661
- * @internal
662
- */
663
- getCachedParentSvgSize(): Size {
664
- const size = this.cachedParentSvgSize;
665
- return new Size(size.width, size.height);
666
- }
667
-
668
- /**
669
- * Return the position of the workspace origin relative to the injection div
670
- * origin in pixels.
671
- * The workspace origin is where a block would render at position (0, 0).
672
- * It is not the upper left corner of the workspace SVG.
673
- *
674
- * @returns Offset in pixels.
675
- * @internal
676
- */
677
- getOriginOffsetInPixels(): Coordinate {
678
- return svgMath.getInjectionDivXY(this.getCanvas());
679
- }
680
-
681
- /**
682
- * Return the injection div that is a parent of this workspace.
683
- * Walks the DOM the first time it's called, then returns a cached value.
684
- * Note: We assume this is only called after the workspace has been injected
685
- * into the DOM.
686
- *
687
- * @returns The first parent div with 'injectionDiv' in the name.
688
- * @internal
689
- */
690
- getInjectionDiv(): Element {
691
- // NB: it would be better to pass this in at createDom, but is more likely
692
- // to break existing uses of Blockly.
693
- if (!this.injectionDiv) {
694
- let element: Element = this.svgGroup_;
695
- while (element) {
696
- const classes = element.getAttribute('class') || '';
697
- if ((' ' + classes + ' ').includes(' injectionDiv ')) {
698
- this.injectionDiv = element;
699
- break;
700
- }
701
- element = element.parentNode as Element;
702
- }
703
- }
704
- return this.injectionDiv!;
705
- }
706
-
707
- /**
708
- * Returns the SVG group for the workspace.
709
- *
710
- * @returns The SVG group for the workspace.
711
- */
712
- getSvgGroup(): Element {
713
- return this.svgGroup_;
714
- }
715
-
716
- /**
717
- * Get the SVG block canvas for the workspace.
718
- *
719
- * @returns The SVG group for the workspace.
720
- * @internal
721
- */
722
- getBlockCanvas(): SVGElement | null {
723
- return this.getCanvas();
724
- }
725
-
726
- /**
727
- * Save resize handler data so we can delete it later in dispose.
728
- *
729
- * @param handler Data that can be passed to eventHandling.unbind.
730
- */
731
- setResizeHandlerWrapper(handler: browserEvents.Data) {
732
- this.resizeHandlerWrapper = handler;
733
- }
734
-
735
- /**
736
- * Create the workspace DOM elements.
737
- *
738
- * @param opt_backgroundClass Either 'blocklyMainBackground' or
739
- * 'blocklyMutatorBackground'.
740
- * @returns The workspace's SVG group.
741
- */
742
- createDom(opt_backgroundClass?: string, injectionDiv?: Element): Element {
743
- if (!this.injectionDiv) {
744
- this.injectionDiv = injectionDiv ?? null;
745
- }
746
-
747
- /**
748
- * <g class="blocklyWorkspace">
749
- * <rect class="blocklyMainBackground" height="100%" width="100%"></rect>
750
- * [Trashcan and/or flyout may go here]
751
- * <g class="blocklyBlockCanvas"></g>
752
- * <g class="blocklyBubbleCanvas"></g>
753
- * </g>
754
- */
755
- this.svgGroup_ = dom.createSvgElement(Svg.G, {'class': 'blocklyWorkspace'});
756
-
757
- // Note that a <g> alone does not receive mouse events--it must have a
758
- // valid target inside it. If no background class is specified, as in the
759
- // flyout, the workspace will not receive mouse events.
760
- if (opt_backgroundClass) {
761
- this.svgBackground_ = dom.createSvgElement(
762
- Svg.RECT,
763
- {'height': '100%', 'width': '100%', 'class': opt_backgroundClass},
764
- this.svgGroup_,
765
- );
766
-
767
- if (opt_backgroundClass === 'blocklyMainBackground' && this.grid) {
768
- this.svgBackground_.style.fill =
769
- 'url(#' + this.grid.getPatternId() + ')';
770
- } else {
771
- this.themeManager_.subscribe(
772
- this.svgBackground_,
773
- 'workspaceBackgroundColour',
774
- 'fill',
775
- );
776
- }
777
- }
778
-
779
- this.layerManager = new LayerManager(this);
780
- // Assign the canvases for backwards compatibility.
781
- this.svgBlockCanvas_ = this.layerManager.getBlockLayer();
782
- this.svgBubbleCanvas_ = this.layerManager.getBubbleLayer();
783
-
784
- if (!this.isFlyout) {
785
- browserEvents.conditionalBind(
786
- this.svgGroup_,
787
- 'pointerdown',
788
- this,
789
- this.onMouseDown_,
790
- false,
791
- );
792
- // This no-op works around https://bugs.webkit.org/show_bug.cgi?id=226683,
793
- // which otherwise prevents zoom/scroll events from being observed in
794
- // Safari. Once that bug is fixed it should be removed.
795
- this.dummyWheelListener = () => {};
796
- document.body.addEventListener('wheel', this.dummyWheelListener);
797
- browserEvents.conditionalBind(
798
- this.svgGroup_,
799
- 'wheel',
800
- this,
801
- this.onMouseWheel_,
802
- );
803
- }
804
-
805
- // Determine if there needs to be a category tree, or a simple list of
806
- // blocks. This cannot be changed later, since the UI is very different.
807
- if (this.options.hasCategories) {
808
- const ToolboxClass = registry.getClassFromOptions(
809
- registry.Type.TOOLBOX,
810
- this.options,
811
- true,
812
- );
813
- this.toolbox_ = new ToolboxClass!(this);
814
- }
815
- if (this.grid) {
816
- this.grid.update(this.scale);
817
- }
818
- this.recordDragTargets();
819
- const CursorClass = registry.getClassFromOptions(
820
- registry.Type.CURSOR,
821
- this.options,
822
- );
823
-
824
- CursorClass && this.markerManager.setCursor(new CursorClass());
825
-
826
- this.renderer.createDom(this.svgGroup_, this.getTheme());
827
- return this.svgGroup_;
828
- }
829
-
830
- /**
831
- * Dispose of this workspace.
832
- * Unlink from all DOM elements to prevent memory leaks.
833
- */
834
- override dispose() {
835
- // Stop rerendering.
836
- this.rendered = false;
837
- if (this.currentGesture_) {
838
- this.currentGesture_.cancel();
839
- }
840
- if (this.svgGroup_) {
841
- dom.removeNode(this.svgGroup_);
842
- }
843
- if (this.toolbox_) {
844
- this.toolbox_.dispose();
845
- this.toolbox_ = null;
846
- }
847
- if (this.flyout) {
848
- this.flyout.dispose();
849
- this.flyout = null;
850
- }
851
- if (this.trashcan) {
852
- this.trashcan.dispose();
853
- this.trashcan = null;
854
- }
855
- if (this.scrollbar) {
856
- this.scrollbar.dispose();
857
- this.scrollbar = null;
858
- }
859
- if (this.zoomControls_) {
860
- this.zoomControls_.dispose();
861
- }
862
-
863
- if (this.audioManager) {
864
- this.audioManager.dispose();
865
- }
866
-
867
- if (this.grid) {
868
- this.grid = null;
869
- }
870
-
871
- this.renderer.dispose();
872
-
873
- if (this.markerManager) {
874
- this.markerManager.dispose();
875
- }
876
-
877
- super.dispose();
878
-
879
- // Dispose of theme manager after all blocks and mutators are disposed of.
880
- if (this.themeManager_) {
881
- this.themeManager_.unsubscribeWorkspace(this);
882
- this.themeManager_.unsubscribe(this.svgBackground_);
883
- if (!this.options.parentWorkspace) {
884
- this.themeManager_.dispose();
885
- }
886
- }
887
-
888
- this.connectionDBList.length = 0;
889
-
890
- this.toolboxCategoryCallbacks.clear();
891
- this.flyoutButtonCallbacks.clear();
892
-
893
- if (!this.options.parentWorkspace) {
894
- // Top-most workspace. Dispose of the div that the
895
- // SVG is injected into (i.e. injectionDiv).
896
- const parentSvg = this.getParentSvg();
897
- if (parentSvg && parentSvg.parentNode) {
898
- dom.removeNode(parentSvg.parentNode);
899
- }
900
- }
901
- if (this.resizeHandlerWrapper) {
902
- browserEvents.unbind(this.resizeHandlerWrapper);
903
- this.resizeHandlerWrapper = null;
904
- }
905
-
906
- // Remove the dummy wheel listener
907
- if (this.dummyWheelListener) {
908
- document.body.removeEventListener('wheel', this.dummyWheelListener);
909
- this.dummyWheelListener = null;
910
- }
911
- }
912
-
913
- /**
914
- * Add a trashcan.
915
- *
916
- * @internal
917
- */
918
- addTrashcan() {
919
- this.trashcan = WorkspaceSvg.newTrashcan(this);
920
- const svgTrashcan = this.trashcan.createDom();
921
- this.svgGroup_.insertBefore(svgTrashcan, this.getCanvas());
922
- }
923
-
924
- /**
925
- * @param _workspace
926
- * @internal
927
- */
928
- static newTrashcan(_workspace: WorkspaceSvg): Trashcan {
929
- throw new Error(
930
- 'The implementation of newTrashcan should be ' +
931
- 'monkey-patched in by blockly.ts',
932
- );
933
- }
934
-
935
- /**
936
- * Add zoom controls.
937
- *
938
- * @internal
939
- */
940
- addZoomControls() {
941
- this.zoomControls_ = new ZoomControls(this);
942
- const svgZoomControls = this.zoomControls_.createDom();
943
- this.svgGroup_.appendChild(svgZoomControls);
944
- }
945
-
946
- /**
947
- * Add a flyout element in an element with the given tag name.
948
- *
949
- * @param tagName What type of tag the flyout belongs in.
950
- * @returns The element containing the flyout DOM.
951
- * @internal
952
- */
953
- addFlyout(tagName: string | Svg<SVGSVGElement> | Svg<SVGGElement>): Element {
954
- const workspaceOptions = new Options({
955
- 'parentWorkspace': this,
956
- 'rtl': this.RTL,
957
- 'oneBasedIndex': this.options.oneBasedIndex,
958
- 'horizontalLayout': this.horizontalLayout,
959
- 'renderer': this.options.renderer,
960
- 'rendererOverrides': this.options.rendererOverrides,
961
- 'move': {
962
- 'scrollbars': true,
963
- },
964
- } as BlocklyOptions);
965
- workspaceOptions.toolboxPosition = this.options.toolboxPosition;
966
- if (this.horizontalLayout) {
967
- const HorizontalFlyout = registry.getClassFromOptions(
968
- registry.Type.FLYOUTS_HORIZONTAL_TOOLBOX,
969
- this.options,
970
- true,
971
- );
972
- this.flyout = new HorizontalFlyout!(workspaceOptions);
973
- } else {
974
- const VerticalFlyout = registry.getClassFromOptions(
975
- registry.Type.FLYOUTS_VERTICAL_TOOLBOX,
976
- this.options,
977
- true,
978
- );
979
- this.flyout = new VerticalFlyout!(workspaceOptions);
980
- }
981
- this.flyout.autoClose = false;
982
- this.flyout.getWorkspace().setVisible(true);
983
-
984
- // Return the element so that callers can place it in their desired
985
- // spot in the DOM. For example, mutator flyouts do not go in the same
986
- // place as main workspace flyouts.
987
- return this.flyout.createDom(tagName);
988
- }
989
-
990
- /**
991
- * Getter for the flyout associated with this workspace. This flyout may be
992
- * owned by either the toolbox or the workspace, depending on toolbox
993
- * configuration. It will be null if there is no flyout.
994
- *
995
- * @param opt_own Whether to only return the workspace's own flyout.
996
- * @returns The flyout on this workspace.
997
- */
998
- getFlyout(opt_own?: boolean): IFlyout | null {
999
- if (this.flyout || opt_own) {
1000
- return this.flyout;
1001
- }
1002
- if (this.toolbox_) {
1003
- return this.toolbox_.getFlyout();
1004
- }
1005
- return null;
1006
- }
1007
-
1008
- /**
1009
- * Getter for the toolbox associated with this workspace, if one exists.
1010
- *
1011
- * @returns The toolbox on this workspace.
1012
- */
1013
- getToolbox(): IToolbox | null {
1014
- return this.toolbox_;
1015
- }
1016
-
1017
- /**
1018
- * Update items that use screen coordinate calculations
1019
- * because something has changed (e.g. scroll position, window size).
1020
- */
1021
- private updateScreenCalculations_() {
1022
- this.updateInverseScreenCTM();
1023
- this.recordDragTargets();
1024
- }
1025
-
1026
- /**
1027
- * If enabled, resize the parts of the workspace that change when the
1028
- * workspace contents (e.g. block positions) change. This will also scroll
1029
- * the workspace contents if needed.
1030
- *
1031
- * @internal
1032
- */
1033
- resizeContents() {
1034
- if (!this.resizesEnabled || !this.rendered) {
1035
- return;
1036
- }
1037
- if (this.scrollbar) {
1038
- this.scrollbar.resize();
1039
- }
1040
- this.updateInverseScreenCTM();
1041
- }
1042
-
1043
- /**
1044
- * Resize and reposition all of the workspace chrome (toolbox,
1045
- * trash, scrollbars etc.)
1046
- * This should be called when something changes that
1047
- * requires recalculating dimensions and positions of the
1048
- * trash, zoom, toolbox, etc. (e.g. window resize).
1049
- */
1050
- resize() {
1051
- if (this.toolbox_) {
1052
- this.toolbox_.position();
1053
- } else if (this.flyout) {
1054
- this.flyout.position();
1055
- }
1056
-
1057
- const positionables = this.componentManager.getComponents(
1058
- ComponentManager.Capability.POSITIONABLE,
1059
- true,
1060
- );
1061
- const metrics = this.getMetricsManager().getUiMetrics();
1062
- const savedPositions = [];
1063
- for (let i = 0, positionable; (positionable = positionables[i]); i++) {
1064
- positionable.position(metrics, savedPositions);
1065
- const boundingRect = positionable.getBoundingRectangle();
1066
- if (boundingRect) {
1067
- savedPositions.push(boundingRect);
1068
- }
1069
- }
1070
-
1071
- if (this.scrollbar) {
1072
- this.scrollbar.resize();
1073
- }
1074
- this.updateScreenCalculations_();
1075
- }
1076
-
1077
- /**
1078
- * Resizes and repositions workspace chrome if the page has a new
1079
- * scroll position.
1080
- *
1081
- * @internal
1082
- */
1083
- updateScreenCalculationsIfScrolled() {
1084
- /* eslint-disable indent */
1085
- const currScroll = svgMath.getDocumentScroll();
1086
- if (!Coordinate.equals(this.lastRecordedPageScroll, currScroll)) {
1087
- this.lastRecordedPageScroll = currScroll;
1088
- this.updateScreenCalculations_();
1089
- }
1090
- }
1091
- /* eslint-enable indent */
1092
-
1093
- /**
1094
- * @returns The layer manager for this workspace.
1095
- */
1096
- getLayerManager(): LayerManager | null {
1097
- return this.layerManager;
1098
- }
1099
-
1100
- /**
1101
- * Get the SVG element that forms the drawing surface.
1102
- *
1103
- * @returns SVG group element.
1104
- */
1105
- getCanvas(): SVGGElement {
1106
- return this.layerManager!.getBlockLayer();
1107
- }
1108
-
1109
- /**
1110
- * Caches the width and height of the workspace's parent SVG element for use
1111
- * with getSvgMetrics.
1112
- *
1113
- * @param width The width of the parent SVG element.
1114
- * @param height The height of the parent SVG element
1115
- * @internal
1116
- */
1117
- setCachedParentSvgSize(width: number | null, height: number | null) {
1118
- const svg = this.getParentSvg();
1119
- if (width != null) {
1120
- this.cachedParentSvgSize.width = width;
1121
- // This is set to support the public (but deprecated) Blockly.svgSize
1122
- // method.
1123
- svg.setAttribute('data-cached-width', `${width}`);
1124
- }
1125
- if (height != null) {
1126
- this.cachedParentSvgSize.height = height;
1127
- // This is set to support the public (but deprecated) Blockly.svgSize
1128
- // method.
1129
- svg.setAttribute('data-cached-height', `${height}`);
1130
- }
1131
- }
1132
-
1133
- /**
1134
- * Get the SVG element that forms the bubble surface.
1135
- *
1136
- * @returns SVG group element.
1137
- */
1138
- getBubbleCanvas(): SVGGElement {
1139
- return this.layerManager!.getBubbleLayer();
1140
- }
1141
-
1142
- /**
1143
- * Get the SVG element that contains this workspace.
1144
- * Note: We assume this is only called after the workspace has been injected
1145
- * into the DOM.
1146
- *
1147
- * @returns SVG element.
1148
- */
1149
- getParentSvg(): SVGSVGElement {
1150
- if (!this.cachedParentSvg) {
1151
- let element = this.svgGroup_;
1152
- while (element) {
1153
- if (element.tagName === 'svg') {
1154
- this.cachedParentSvg = element;
1155
- break;
1156
- }
1157
- element = element.parentNode as SVGSVGElement;
1158
- }
1159
- }
1160
- return this.cachedParentSvg as SVGSVGElement;
1161
- }
1162
-
1163
- /**
1164
- * Fires a viewport event if events are enabled and there is a change in
1165
- * viewport values.
1166
- *
1167
- * @internal
1168
- */
1169
- maybeFireViewportChangeEvent() {
1170
- if (!eventUtils.isEnabled()) {
1171
- return;
1172
- }
1173
- const scale = this.scale;
1174
- const top = -this.scrollY;
1175
- const left = -this.scrollX;
1176
- if (
1177
- scale === this.oldScale &&
1178
- Math.abs(top - this.oldTop) < 1 &&
1179
- Math.abs(left - this.oldLeft) < 1
1180
- ) {
1181
- // Ignore sub-pixel changes in top and left. Due to #4192 there are a lot
1182
- // of negligible changes in viewport top/left.
1183
- return;
1184
- }
1185
- const event = new (eventUtils.get(eventUtils.VIEWPORT_CHANGE))(
1186
- top,
1187
- left,
1188
- scale,
1189
- this.id,
1190
- this.oldScale,
1191
- );
1192
- this.oldScale = scale;
1193
- this.oldTop = top;
1194
- this.oldLeft = left;
1195
- eventUtils.fire(event);
1196
- }
1197
-
1198
- /**
1199
- * Translate this workspace to new coordinates.
1200
- *
1201
- * @param x Horizontal translation, in pixel units relative to the top left of
1202
- * the Blockly div.
1203
- * @param y Vertical translation, in pixel units relative to the top left of
1204
- * the Blockly div.
1205
- */
1206
- translate(x: number, y: number) {
1207
- this.layerManager?.translateLayers(new Coordinate(x, y), this.scale);
1208
- this.grid?.moveTo(x, y);
1209
- this.maybeFireViewportChangeEvent();
1210
- }
1211
-
1212
- /**
1213
- * Returns the horizontal offset of the workspace.
1214
- * Intended for LTR/RTL compatibility in XML.
1215
- *
1216
- * @returns Width.
1217
- */
1218
- override getWidth(): number {
1219
- const metrics = this.getMetrics();
1220
- return metrics ? metrics.viewWidth / this.scale : 0;
1221
- }
1222
-
1223
- /**
1224
- * Toggles the visibility of the workspace.
1225
- * Currently only intended for main workspace.
1226
- *
1227
- * @param isVisible True if workspace should be visible.
1228
- */
1229
- setVisible(isVisible: boolean) {
1230
- this.isVisible_ = isVisible;
1231
- if (!this.svgGroup_) {
1232
- return;
1233
- }
1234
-
1235
- // Tell the scrollbar whether its container is visible so it can
1236
- // tell when to hide itself.
1237
- if (this.scrollbar) {
1238
- this.scrollbar.setContainerVisible(isVisible);
1239
- }
1240
-
1241
- // Tell the flyout whether its container is visible so it can
1242
- // tell when to hide itself.
1243
- if (this.getFlyout()) {
1244
- this.getFlyout()!.setContainerVisible(isVisible);
1245
- }
1246
-
1247
- this.getParentSvg().style.display = isVisible ? 'block' : 'none';
1248
- if (this.toolbox_) {
1249
- // Currently does not support toolboxes in mutators.
1250
- this.toolbox_.setVisible(isVisible);
1251
- }
1252
- if (!isVisible) {
1253
- this.hideChaff(true);
1254
- }
1255
- }
1256
-
1257
- /**
1258
- * Render all blocks in workspace.
1259
- */
1260
- render() {
1261
- // Generate list of all blocks.
1262
- const blocks = this.getAllBlocks(false);
1263
- // Render each block.
1264
- for (let i = blocks.length - 1; i >= 0; i--) {
1265
- blocks[i].queueRender();
1266
- }
1267
-
1268
- this.getTopBlocks()
1269
- .flatMap((block) => block.getDescendants(false))
1270
- .filter((block) => block.isInsertionMarker())
1271
- .forEach((block) => block.queueRender());
1272
-
1273
- renderManagement
1274
- .finishQueuedRenders()
1275
- .then(() => void this.markerManager.updateMarkers());
1276
- }
1277
-
1278
- /**
1279
- * Highlight or unhighlight a block in the workspace. Block highlighting is
1280
- * often used to visually mark blocks currently being executed.
1281
- *
1282
- * @param id ID of block to highlight/unhighlight, or null for no block (used
1283
- * to unhighlight all blocks).
1284
- * @param opt_state If undefined, highlight specified block and automatically
1285
- * unhighlight all others. If true or false, manually
1286
- * highlight/unhighlight the specified block.
1287
- */
1288
- highlightBlock(id: string | null, opt_state?: boolean) {
1289
- if (opt_state === undefined) {
1290
- // Unhighlight all blocks.
1291
- for (let i = 0, block; (block = this.highlightedBlocks[i]); i++) {
1292
- block.setHighlighted(false);
1293
- }
1294
- this.highlightedBlocks.length = 0;
1295
- }
1296
- // Highlight/unhighlight the specified block.
1297
- const block = id ? this.getBlockById(id) : null;
1298
- if (block) {
1299
- const state = opt_state === undefined || opt_state;
1300
- // Using Set here would be great, but at the cost of IE10 support.
1301
- if (!state) {
1302
- arrayUtils.removeElem(this.highlightedBlocks, block);
1303
- } else if (!this.highlightedBlocks.includes(block)) {
1304
- this.highlightedBlocks.push(block);
1305
- }
1306
- block.setHighlighted(state);
1307
- }
1308
- }
1309
-
1310
- /**
1311
- * Refresh the toolbox unless there's a drag in progress.
1312
- *
1313
- * @internal
1314
- */
1315
- refreshToolboxSelection() {
1316
- const ws = this.isFlyout ? this.targetWorkspace : this;
1317
- if (ws && !ws.currentGesture_ && ws.toolbox_ && ws.toolbox_.getFlyout()) {
1318
- ws.toolbox_.refreshSelection();
1319
- }
1320
- }
1321
-
1322
- /**
1323
- * Rename a variable by updating its name in the variable map. Update the
1324
- * flyout to show the renamed variable immediately.
1325
- *
1326
- * @param id ID of the variable to rename.
1327
- * @param newName New variable name.
1328
- */
1329
- override renameVariableById(id: string, newName: string) {
1330
- super.renameVariableById(id, newName);
1331
- this.refreshToolboxSelection();
1332
- }
1333
-
1334
- /**
1335
- * Delete a variable by the passed in ID. Update the flyout to show
1336
- * immediately that the variable is deleted.
1337
- *
1338
- * @param id ID of variable to delete.
1339
- */
1340
- override deleteVariableById(id: string) {
1341
- super.deleteVariableById(id);
1342
- this.refreshToolboxSelection();
1343
- }
1344
-
1345
- /**
1346
- * Create a new variable with the given name. Update the flyout to show the
1347
- * new variable immediately.
1348
- *
1349
- * @param name The new variable's name.
1350
- * @param opt_type The type of the variable like 'int' or 'string'.
1351
- * Does not need to be unique. Field_variable can filter variables based
1352
- * on their type. This will default to '' which is a specific type.
1353
- * @param opt_id The unique ID of the variable. This will default to a UUID.
1354
- * @returns The newly created variable.
1355
- */
1356
- override createVariable(
1357
- name: string,
1358
- opt_type?: string | null,
1359
- opt_id?: string | null,
1360
- ): IVariableModel<IVariableState> {
1361
- const newVar = super.createVariable(name, opt_type, opt_id);
1362
- this.refreshToolboxSelection();
1363
- return newVar;
1364
- }
1365
-
1366
- /** Make a list of all the delete areas for this workspace. */
1367
- recordDragTargets() {
1368
- const dragTargets = this.componentManager.getComponents(
1369
- ComponentManager.Capability.DRAG_TARGET,
1370
- true,
1371
- );
1372
-
1373
- this.dragTargetAreas = [];
1374
- for (let i = 0, targetArea; (targetArea = dragTargets[i]); i++) {
1375
- const rect = targetArea.getClientRect();
1376
- if (rect) {
1377
- this.dragTargetAreas.push({
1378
- component: targetArea,
1379
- clientRect: rect,
1380
- });
1381
- }
1382
- }
1383
- }
1384
- /* eslint-disable jsdoc/require-returns-check */
1385
- /* eslint-disable @typescript-eslint/no-unused-vars */
1386
- /**
1387
- * Obtain a newly created block.
1388
- *
1389
- * @param prototypeName Name of the language object containing type-specific
1390
- * functions for this block.
1391
- * @param opt_id Optional ID. Use this ID if provided, otherwise create a new
1392
- * ID.
1393
- * @returns The created block.
1394
- */
1395
- override newBlock(prototypeName: string, opt_id?: string): BlockSvg {
1396
- throw new Error(
1397
- 'The implementation of newBlock should be ' +
1398
- 'monkey-patched in by blockly.ts',
1399
- );
1400
- }
1401
-
1402
- /**
1403
- * Obtain a newly created comment.
1404
- *
1405
- * @param id Optional ID. Use this ID if provided, otherwise create a new
1406
- * ID.
1407
- * @returns The created comment.
1408
- */
1409
- newComment(id?: string): WorkspaceComment {
1410
- throw new Error(
1411
- 'The implementation of newComment should be ' +
1412
- 'monkey-patched in by blockly.ts',
1413
- );
1414
- }
1415
- /* eslint-enable */
1416
-
1417
- /**
1418
- * Returns the drag target the pointer event is over.
1419
- *
1420
- * @param e Pointer move event.
1421
- * @returns Null if not over a drag target, or the drag target the event is
1422
- * over.
1423
- */
1424
- getDragTarget(e: PointerEvent): IDragTarget | null {
1425
- for (let i = 0, targetArea; (targetArea = this.dragTargetAreas[i]); i++) {
1426
- if (targetArea.clientRect.contains(e.clientX, e.clientY)) {
1427
- return targetArea.component;
1428
- }
1429
- }
1430
- return null;
1431
- }
1432
-
1433
- /**
1434
- * Handle a pointerdown on SVG drawing surface.
1435
- *
1436
- * @param e Pointer down event.
1437
- */
1438
- private onMouseDown_(e: PointerEvent) {
1439
- const gesture = this.getGesture(e);
1440
- if (gesture) {
1441
- gesture.handleWsStart(e, this);
1442
- }
1443
- }
1444
-
1445
- /**
1446
- * Start tracking a drag of an object on this workspace.
1447
- *
1448
- * @param e Pointer down event.
1449
- * @param xy Starting location of object.
1450
- */
1451
- startDrag(e: PointerEvent, xy: Coordinate) {
1452
- // Record the starting offset between the bubble's location and the mouse.
1453
- const point = browserEvents.mouseToSvg(
1454
- e,
1455
- this.getParentSvg(),
1456
- this.getInverseScreenCTM(),
1457
- );
1458
- // Fix scale of mouse event.
1459
- point.x /= this.scale;
1460
- point.y /= this.scale;
1461
- this.dragDeltaXY = Coordinate.difference(xy, point);
1462
- }
1463
-
1464
- /**
1465
- * Track a drag of an object on this workspace.
1466
- *
1467
- * @param e Pointer move event.
1468
- * @returns New location of object.
1469
- */
1470
- moveDrag(e: PointerEvent): Coordinate {
1471
- const point = browserEvents.mouseToSvg(
1472
- e,
1473
- this.getParentSvg(),
1474
- this.getInverseScreenCTM(),
1475
- );
1476
- // Fix scale of mouse event.
1477
- point.x /= this.scale;
1478
- point.y /= this.scale;
1479
- return Coordinate.sum(this.dragDeltaXY!, point);
1480
- }
1481
-
1482
- /**
1483
- * Is the user currently dragging a block or scrolling the flyout/workspace?
1484
- *
1485
- * @returns True if currently dragging or scrolling.
1486
- */
1487
- isDragging(): boolean {
1488
- return this.currentGesture_ !== null && this.currentGesture_.isDragging();
1489
- }
1490
-
1491
- /**
1492
- * Is this workspace draggable?
1493
- *
1494
- * @returns True if this workspace may be dragged.
1495
- */
1496
- isDraggable(): boolean {
1497
- return this.options.moveOptions && this.options.moveOptions.drag;
1498
- }
1499
-
1500
- /**
1501
- * Is this workspace movable?
1502
- *
1503
- * This means the user can reposition the X Y coordinates of the workspace
1504
- * through input. This can be through scrollbars, scroll wheel, dragging, or
1505
- * through zooming with the scroll wheel or pinch (since the zoom is centered
1506
- * on the mouse position). This does not include zooming with the zoom
1507
- * controls since the X Y coordinates are decided programmatically.
1508
- *
1509
- * @returns True if the workspace is movable, false otherwise.
1510
- */
1511
- isMovable(): boolean {
1512
- return (
1513
- (this.options.moveOptions && !!this.options.moveOptions.scrollbars) ||
1514
- (this.options.moveOptions && this.options.moveOptions.wheel) ||
1515
- (this.options.moveOptions && this.options.moveOptions.drag) ||
1516
- (this.options.zoomOptions && this.options.zoomOptions.wheel) ||
1517
- (this.options.zoomOptions && this.options.zoomOptions.pinch)
1518
- );
1519
- }
1520
-
1521
- /**
1522
- * Is this workspace movable horizontally?
1523
- *
1524
- * @returns True if the workspace is movable horizontally, false otherwise.
1525
- */
1526
- isMovableHorizontally(): boolean {
1527
- const hasScrollbars = !!this.scrollbar;
1528
- return (
1529
- this.isMovable() &&
1530
- (!hasScrollbars ||
1531
- (hasScrollbars && this.scrollbar!.canScrollHorizontally()))
1532
- );
1533
- }
1534
-
1535
- /**
1536
- * Is this workspace movable vertically?
1537
- *
1538
- * @returns True if the workspace is movable vertically, false otherwise.
1539
- */
1540
- isMovableVertically(): boolean {
1541
- const hasScrollbars = !!this.scrollbar;
1542
- return (
1543
- this.isMovable() &&
1544
- (!hasScrollbars ||
1545
- (hasScrollbars && this.scrollbar!.canScrollVertically()))
1546
- );
1547
- }
1548
-
1549
- /**
1550
- * Handle a mouse-wheel on SVG drawing surface.
1551
- *
1552
- * @param e Mouse wheel event.
1553
- */
1554
- private onMouseWheel_(e: WheelEvent) {
1555
- // Don't scroll or zoom anything if drag is in progress.
1556
- if (Gesture.inProgress()) {
1557
- e.preventDefault();
1558
- e.stopPropagation();
1559
- return;
1560
- }
1561
- const canWheelZoom =
1562
- this.options.zoomOptions && this.options.zoomOptions.wheel;
1563
- const canWheelMove =
1564
- this.options.moveOptions && this.options.moveOptions.wheel;
1565
- if (!canWheelZoom && !canWheelMove) {
1566
- return;
1567
- }
1568
-
1569
- const scrollDelta = browserEvents.getScrollDeltaPixels(e);
1570
-
1571
- // Zoom should also be enabled by the command key on Mac devices,
1572
- // but not super on Unix.
1573
- let commandKey;
1574
- if (userAgent.MAC) {
1575
- commandKey = e.metaKey;
1576
- }
1577
-
1578
- if (canWheelZoom && (e.ctrlKey || commandKey || !canWheelMove)) {
1579
- // Zoom.
1580
- // The vertical scroll distance that corresponds to a click of a zoom
1581
- // button.
1582
- const PIXELS_PER_ZOOM_STEP = 50;
1583
- const delta = -scrollDelta.y / PIXELS_PER_ZOOM_STEP;
1584
- const position = browserEvents.mouseToSvg(
1585
- e,
1586
- this.getParentSvg(),
1587
- this.getInverseScreenCTM(),
1588
- );
1589
- this.zoom(position.x, position.y, delta);
1590
- } else {
1591
- // Scroll.
1592
- let x = this.scrollX - scrollDelta.x;
1593
- let y = this.scrollY - scrollDelta.y;
1594
-
1595
- if (e.shiftKey && !scrollDelta.x) {
1596
- // Scroll horizontally (based on vertical scroll delta).
1597
- // This is needed as for some browser/system combinations which do not
1598
- // set deltaX.
1599
- x = this.scrollX - scrollDelta.y;
1600
- y = this.scrollY; // Don't scroll vertically.
1601
- }
1602
- this.scroll(x, y);
1603
- }
1604
- e.preventDefault();
1605
- }
1606
-
1607
- /**
1608
- * Calculate the bounding box for the blocks on the workspace.
1609
- * Coordinate system: workspace coordinates.
1610
- *
1611
- * @returns Contains the position and size of the bounding box containing the
1612
- * blocks on the workspace.
1613
- */
1614
- getBlocksBoundingBox(): Rect {
1615
- const topElements = this.getTopBoundedElements();
1616
- // There are no blocks, return empty rectangle.
1617
- if (!topElements.length) {
1618
- return new Rect(0, 0, 0, 0);
1619
- }
1620
-
1621
- // Initialize boundary using the first block.
1622
- const boundary = topElements[0].getBoundingRectangle();
1623
-
1624
- // Start at 1 since the 0th block was used for initialization.
1625
- for (let i = 1; i < topElements.length; i++) {
1626
- const topElement = topElements[i];
1627
- if (
1628
- (topElement as any).isInsertionMarker &&
1629
- (topElement as any).isInsertionMarker()
1630
- ) {
1631
- continue;
1632
- }
1633
- const blockBoundary = topElement.getBoundingRectangle();
1634
- if (blockBoundary.top < boundary.top) {
1635
- boundary.top = blockBoundary.top;
1636
- }
1637
- if (blockBoundary.bottom > boundary.bottom) {
1638
- boundary.bottom = blockBoundary.bottom;
1639
- }
1640
- if (blockBoundary.left < boundary.left) {
1641
- boundary.left = blockBoundary.left;
1642
- }
1643
- if (blockBoundary.right > boundary.right) {
1644
- boundary.right = blockBoundary.right;
1645
- }
1646
- }
1647
- return boundary;
1648
- }
1649
-
1650
- /** Clean up the workspace by ordering all the blocks in a column. */
1651
- cleanUp() {
1652
- this.setResizesEnabled(false);
1653
- eventUtils.setGroup(true);
1654
- const topBlocks = this.getTopBlocks(true);
1655
- let cursorY = 0;
1656
- for (let i = 0, block; (block = topBlocks[i]); i++) {
1657
- if (!block.isMovable()) {
1658
- continue;
1659
- }
1660
- const xy = block.getRelativeToSurfaceXY();
1661
- block.moveBy(-xy.x, cursorY - xy.y, ['cleanup']);
1662
- block.snapToGrid();
1663
- cursorY =
1664
- block.getRelativeToSurfaceXY().y +
1665
- block.getHeightWidth().height +
1666
- this.renderer.getConstants().MIN_BLOCK_HEIGHT;
1667
- }
1668
- eventUtils.setGroup(false);
1669
- this.setResizesEnabled(true);
1670
- }
1671
-
1672
- /**
1673
- * Show the context menu for the workspace.
1674
- *
1675
- * @param e Mouse event.
1676
- * @internal
1677
- */
1678
- showContextMenu(e: PointerEvent) {
1679
- if (this.options.readOnly || this.isFlyout) {
1680
- return;
1681
- }
1682
- const menuOptions = ContextMenuRegistry.registry.getContextMenuOptions(
1683
- ContextMenuRegistry.ScopeType.WORKSPACE,
1684
- {workspace: this},
1685
- );
1686
-
1687
- // Allow the developer to add or modify menuOptions.
1688
- if (this.configureContextMenu) {
1689
- this.configureContextMenu(menuOptions, e);
1690
- }
1691
-
1692
- ContextMenu.show(e, menuOptions, this.RTL, this);
1693
- }
1694
-
1695
- /**
1696
- * Modify the block tree on the existing toolbox.
1697
- *
1698
- * @param toolboxDef DOM tree of toolbox contents, string of toolbox contents,
1699
- * or JSON representing toolbox definition.
1700
- */
1701
- updateToolbox(toolboxDef: toolbox.ToolboxDefinition | null) {
1702
- const parsedToolboxDef = toolbox.convertToolboxDefToJson(toolboxDef);
1703
-
1704
- if (!parsedToolboxDef) {
1705
- if (this.options.languageTree) {
1706
- throw Error("Can't nullify an existing toolbox.");
1707
- }
1708
- return; // No change (null to null).
1709
- }
1710
- if (!this.options.languageTree) {
1711
- throw Error("Existing toolbox is null. Can't create new toolbox.");
1712
- }
1713
-
1714
- if (toolbox.hasCategories(parsedToolboxDef)) {
1715
- if (!this.toolbox_) {
1716
- throw Error("Existing toolbox has no categories. Can't change mode.");
1717
- }
1718
- this.options.languageTree = parsedToolboxDef;
1719
- this.toolbox_.render(parsedToolboxDef);
1720
- } else {
1721
- if (!this.flyout) {
1722
- throw Error("Existing toolbox has categories. Can't change mode.");
1723
- }
1724
- this.options.languageTree = parsedToolboxDef;
1725
- this.flyout.show(parsedToolboxDef);
1726
- }
1727
- }
1728
-
1729
- /** Mark this workspace as the currently focused main workspace. */
1730
- markFocused() {
1731
- if (this.options.parentWorkspace) {
1732
- this.options.parentWorkspace.markFocused();
1733
- } else {
1734
- common.setMainWorkspace(this);
1735
- // We call e.preventDefault in many event handlers which means we
1736
- // need to explicitly grab focus (e.g from a textarea) because
1737
- // the browser will not do it for us.
1738
- this.getParentSvg().focus({preventScroll: true});
1739
- }
1740
- }
1741
-
1742
- /**
1743
- * Zooms the workspace in or out relative to/centered on the given (x, y)
1744
- * coordinate.
1745
- *
1746
- * @param x X coordinate of center, in pixel units relative to the top-left
1747
- * corner of the parentSVG.
1748
- * @param y Y coordinate of center, in pixel units relative to the top-left
1749
- * corner of the parentSVG.
1750
- * @param amount Amount of zooming. The formula for the new scale is newScale
1751
- * = currentScale * (scaleSpeed^amount). scaleSpeed is set in the
1752
- * workspace options. Negative amount values zoom out, and positive amount
1753
- * values zoom in.
1754
- */
1755
- zoom(x: number, y: number, amount: number) {
1756
- // Scale factor.
1757
- const speed = this.options.zoomOptions.scaleSpeed;
1758
- let scaleChange = Math.pow(speed, amount);
1759
- const newScale = this.scale * scaleChange;
1760
- if (this.scale === newScale) {
1761
- return; // No change in zoom.
1762
- }
1763
-
1764
- // Clamp scale within valid range.
1765
- if (newScale > this.options.zoomOptions.maxScale) {
1766
- scaleChange = this.options.zoomOptions.maxScale / this.scale;
1767
- } else if (newScale < this.options.zoomOptions.minScale) {
1768
- scaleChange = this.options.zoomOptions.minScale / this.scale;
1769
- }
1770
-
1771
- // Transform the x/y coordinates from the parentSVG's space into the
1772
- // canvas' space, so that they are in workspace units relative to the top
1773
- // left of the visible portion of the workspace.
1774
- let matrix = this.getCanvas().getCTM();
1775
- let center = this.getParentSvg().createSVGPoint();
1776
- center.x = x;
1777
- center.y = y;
1778
- center = center.matrixTransform(matrix!.inverse());
1779
- x = center.x;
1780
- y = center.y;
1781
-
1782
- // Find the new scrollX/scrollY so that the center remains in the same
1783
- // position (relative to the center) after we zoom.
1784
- // newScale and matrix.a should be identical (within a rounding error).
1785
- matrix = matrix!
1786
- .translate(x * (1 - scaleChange), y * (1 - scaleChange))
1787
- .scale(scaleChange);
1788
- // scrollX and scrollY are in pixels.
1789
- // The scrollX and scrollY still need to have absoluteLeft and absoluteTop
1790
- // subtracted from them, but we'll leave that for setScale so that they're
1791
- // correctly updated for the new flyout size if we have a simple toolbox.
1792
- this.scrollX = matrix.e;
1793
- this.scrollY = matrix.f;
1794
- this.setScale(newScale);
1795
- }
1796
-
1797
- /**
1798
- * Zooming the blocks centered in the center of view with zooming in or out.
1799
- *
1800
- * @param type Type of zooming (-1 zooming out and 1 zooming in).
1801
- */
1802
- zoomCenter(type: number) {
1803
- const metrics = this.getMetrics();
1804
- let x;
1805
- let y;
1806
- if (this.flyout) {
1807
- // If you want blocks in the center of the view (visible portion of the
1808
- // workspace) to stay centered when the size of the view decreases (i.e.
1809
- // when the size of the flyout increases) you need the center of the
1810
- // *blockly div* to stay in the same pixel-position.
1811
- // Note: This only works because of how scrollCenter positions blocks.
1812
- x = metrics.svgWidth ? metrics.svgWidth / 2 : 0;
1813
- y = metrics.svgHeight ? metrics.svgHeight / 2 : 0;
1814
- } else {
1815
- x = metrics.viewWidth / 2 + metrics.absoluteLeft;
1816
- y = metrics.viewHeight / 2 + metrics.absoluteTop;
1817
- }
1818
- this.zoom(x, y, type);
1819
- }
1820
-
1821
- /** Zoom the blocks to fit in the workspace if possible. */
1822
- zoomToFit() {
1823
- if (!this.isMovable()) {
1824
- console.warn(
1825
- 'Tried to move a non-movable workspace. This could result' +
1826
- ' in blocks becoming inaccessible.',
1827
- );
1828
- return;
1829
- }
1830
-
1831
- const metrics = this.getMetrics();
1832
- let workspaceWidth = metrics.viewWidth;
1833
- let workspaceHeight = metrics.viewHeight;
1834
- const blocksBox = this.getBlocksBoundingBox();
1835
- const doubleMargin = ZOOM_TO_FIT_MARGIN * 2;
1836
- let blocksWidth = blocksBox.right - blocksBox.left + doubleMargin;
1837
- let blocksHeight = blocksBox.bottom - blocksBox.top + doubleMargin;
1838
- if (!blocksWidth) {
1839
- return; // Prevents zooming to infinity.
1840
- }
1841
- if (this.flyout) {
1842
- // We have to add the flyout size to both the workspace size and the
1843
- // block size because the blocks we want to resize include the blocks in
1844
- // the flyout, and the area we want to fit them includes the portion of
1845
- // the workspace that is behind the flyout.
1846
- if (this.horizontalLayout) {
1847
- workspaceHeight += this.flyout.getHeight();
1848
- // Convert from pixels to workspace coordinates.
1849
- blocksHeight += this.flyout.getHeight() / this.scale;
1850
- } else {
1851
- workspaceWidth += this.flyout.getWidth();
1852
- // Convert from pixels to workspace coordinates.
1853
- blocksWidth += this.flyout.getWidth() / this.scale;
1854
- }
1855
- }
1856
-
1857
- // Scale Units: (pixels / workspaceUnit)
1858
- const ratioX = workspaceWidth / blocksWidth;
1859
- const ratioY = workspaceHeight / blocksHeight;
1860
- eventUtils.disable();
1861
- try {
1862
- this.setScale(Math.min(ratioX, ratioY));
1863
- this.scrollCenter();
1864
- } finally {
1865
- eventUtils.enable();
1866
- }
1867
- this.maybeFireViewportChangeEvent();
1868
- }
1869
-
1870
- /**
1871
- * Add a transition class to the block and bubble canvas, to animate any
1872
- * transform changes.
1873
- *
1874
- * @internal
1875
- */
1876
- beginCanvasTransition() {
1877
- dom.addClass(this.getCanvas(), 'blocklyCanvasTransitioning');
1878
- dom.addClass(this.getBubbleCanvas(), 'blocklyCanvasTransitioning');
1879
- }
1880
-
1881
- /**
1882
- * Remove transition class from the block and bubble canvas.
1883
- *
1884
- * @internal
1885
- */
1886
- endCanvasTransition() {
1887
- dom.removeClass(this.getCanvas(), 'blocklyCanvasTransitioning');
1888
- dom.removeClass(this.getBubbleCanvas(), 'blocklyCanvasTransitioning');
1889
- }
1890
-
1891
- /** Center the workspace. */
1892
- scrollCenter() {
1893
- if (!this.isMovable()) {
1894
- console.warn(
1895
- 'Tried to move a non-movable workspace. This could result' +
1896
- ' in blocks becoming inaccessible.',
1897
- );
1898
- return;
1899
- }
1900
-
1901
- const metrics = this.getMetrics();
1902
- let x = (metrics.scrollWidth - metrics.viewWidth) / 2;
1903
- let y = (metrics.scrollHeight - metrics.viewHeight) / 2;
1904
-
1905
- // Convert from workspace directions to canvas directions.
1906
- x = -x - metrics.scrollLeft;
1907
- y = -y - metrics.scrollTop;
1908
- this.scroll(x, y);
1909
- }
1910
-
1911
- /**
1912
- * Scroll the workspace to center on the given block. If the block has other
1913
- * blocks stacked below it, the workspace will be centered on the stack,
1914
- * unless blockOnly is true.
1915
- *
1916
- * @param id ID of block center on.
1917
- * @param blockOnly True to center only on the block itself, not its stack.
1918
- */
1919
- centerOnBlock(id: string | null, blockOnly?: boolean) {
1920
- if (!this.isMovable()) {
1921
- console.warn(
1922
- 'Tried to move a non-movable workspace. This could result' +
1923
- ' in blocks becoming inaccessible.',
1924
- );
1925
- return;
1926
- }
1927
-
1928
- const block = id ? this.getBlockById(id) : null;
1929
- if (!block) {
1930
- return;
1931
- }
1932
-
1933
- // XY is in workspace coordinates.
1934
- const xy = block.getRelativeToSurfaceXY();
1935
- // Height/width is in workspace units.
1936
- const heightWidth = blockOnly
1937
- ? {height: block.height, width: block.width}
1938
- : block.getHeightWidth();
1939
-
1940
- // Find the enter of the block in workspace units.
1941
- const blockCenterY = xy.y + heightWidth.height / 2;
1942
-
1943
- // In RTL the block's position is the top right of the block, not top left.
1944
- const multiplier = this.RTL ? -1 : 1;
1945
- const blockCenterX = xy.x + (multiplier * heightWidth.width) / 2;
1946
-
1947
- // Workspace scale, used to convert from workspace coordinates to pixels.
1948
- const scale = this.scale;
1949
-
1950
- // Center of block in pixels, relative to workspace origin (center 0,0).
1951
- // Scrolling to here would put the block in the top-left corner of the
1952
- // visible workspace.
1953
- const pixelX = blockCenterX * scale;
1954
- const pixelY = blockCenterY * scale;
1955
-
1956
- const metrics = this.getMetrics();
1957
-
1958
- // viewHeight and viewWidth are in pixels.
1959
- const halfViewWidth = metrics.viewWidth / 2;
1960
- const halfViewHeight = metrics.viewHeight / 2;
1961
-
1962
- // Put the block in the center of the visible workspace instead.
1963
- const scrollToCenterX = pixelX - halfViewWidth;
1964
- const scrollToCenterY = pixelY - halfViewHeight;
1965
-
1966
- // Convert from workspace directions to canvas directions.
1967
- const x = -scrollToCenterX;
1968
- const y = -scrollToCenterY;
1969
-
1970
- this.scroll(x, y);
1971
- }
1972
-
1973
- /**
1974
- * Set the workspace's zoom factor.
1975
- *
1976
- * @param newScale Zoom factor. Units: (pixels / workspaceUnit).
1977
- */
1978
- setScale(newScale: number) {
1979
- if (
1980
- this.options.zoomOptions.maxScale &&
1981
- newScale > this.options.zoomOptions.maxScale
1982
- ) {
1983
- newScale = this.options.zoomOptions.maxScale;
1984
- } else if (
1985
- this.options.zoomOptions.minScale &&
1986
- newScale < this.options.zoomOptions.minScale
1987
- ) {
1988
- newScale = this.options.zoomOptions.minScale;
1989
- }
1990
- this.scale = newScale;
1991
-
1992
- this.hideChaff(false);
1993
- // Get the flyout, if any, whether our own or owned by the toolbox.
1994
- const flyout = this.getFlyout(false);
1995
- if (flyout && flyout.isVisible()) {
1996
- flyout.reflow();
1997
- this.recordDragTargets();
1998
- }
1999
- if (this.grid) {
2000
- this.grid.update(this.scale);
2001
- }
2002
-
2003
- // We call scroll instead of scrollbar.resize() so that we can center the
2004
- // zoom correctly without scrollbars, but scroll does not resize the
2005
- // scrollbars so we have to call resizeView/resizeContent as well.
2006
- const metrics = this.getMetrics();
2007
-
2008
- this.scrollX -= metrics.absoluteLeft;
2009
- this.scrollY -= metrics.absoluteTop;
2010
- // The scroll values and the view values are additive inverses of
2011
- // each other, so when we subtract from one we have to add to the other.
2012
- metrics.viewLeft += metrics.absoluteLeft;
2013
- metrics.viewTop += metrics.absoluteTop;
2014
-
2015
- this.scroll(this.scrollX, this.scrollY);
2016
- if (this.scrollbar) {
2017
- if (this.flyout) {
2018
- this.scrollbar.resizeView(metrics);
2019
- } else {
2020
- this.scrollbar.resizeContent(metrics);
2021
- }
2022
- }
2023
- }
2024
-
2025
- /**
2026
- * Get the workspace's zoom factor.
2027
- *
2028
- * @returns The workspace zoom factor. Units: (pixels / workspaceUnit).
2029
- */
2030
- getScale(): number {
2031
- return this.scale;
2032
- }
2033
-
2034
- /**
2035
- * Returns the absolute scale of the workspace.
2036
- *
2037
- * Workspace scaling is multiplicative; if a workspace B (e.g. a mutator editor)
2038
- * with scale Y is nested within a root workspace A with scale X, workspace B's
2039
- * effective scale is X * Y, because, as a child of A, it is already transformed
2040
- * by A's scaling factor, and then further transforms itself by its own scaling
2041
- * factor. Normally this Just Works, but for global elements (e.g. field
2042
- * editors) that are visually associated with a particular workspace but live at
2043
- * the top level of the DOM rather than being a child of their associated
2044
- * workspace, the absolute/effective scale may be needed to render
2045
- * appropriately.
2046
- *
2047
- * @returns The absolute/effective scale of the given workspace.
2048
- */
2049
- getAbsoluteScale() {
2050
- // Returns a workspace's own scale, without regard to multiplicative scaling.
2051
- const getLocalScale = (workspace: WorkspaceSvg): number => {
2052
- // Workspaces in flyouts may have a distinct scale; use this if relevant.
2053
- if (workspace.isFlyout) {
2054
- const flyout = workspace.targetWorkspace?.getFlyout();
2055
- if (flyout instanceof Flyout) {
2056
- return flyout.getFlyoutScale();
2057
- }
2058
- }
2059
-
2060
- return workspace.getScale();
2061
- };
2062
-
2063
- const computeScale = (workspace: WorkspaceSvg, scale: number): number => {
2064
- // If the workspace has no parent, or it does have a parent but is not
2065
- // actually a child of its parent workspace in the DOM (this is the case for
2066
- // flyouts in the main workspace), we're done; just return the scale so far
2067
- // multiplied by the workspace's own scale.
2068
- if (
2069
- !workspace.options.parentWorkspace ||
2070
- !workspace.options.parentWorkspace
2071
- .getSvgGroup()
2072
- .contains(workspace.getSvgGroup())
2073
- ) {
2074
- return scale * getLocalScale(workspace);
2075
- }
2076
-
2077
- // If there is a parent workspace, and this workspace is a child of it in
2078
- // the DOM, scales are multiplicative, so recurse up the workspace
2079
- // hierarchy.
2080
- return computeScale(
2081
- workspace.options.parentWorkspace,
2082
- scale * getLocalScale(workspace),
2083
- );
2084
- };
2085
-
2086
- return computeScale(this, 1);
2087
- }
2088
-
2089
- /**
2090
- * Scroll the workspace to a specified offset (in pixels), keeping in the
2091
- * workspace bounds. See comment on workspaceSvg.scrollX for more detail on
2092
- * the meaning of these values.
2093
- *
2094
- * @param x Target X to scroll to.
2095
- * @param y Target Y to scroll to.
2096
- */
2097
- scroll(x: number, y: number) {
2098
- this.hideChaff(/* opt_onlyClosePopups= */ true);
2099
-
2100
- // Keep scrolling within the bounds of the content.
2101
- const metrics = this.getMetrics();
2102
- // Canvas coordinates (aka scroll coordinates) have inverse directionality
2103
- // to workspace coordinates so we have to inverse them.
2104
- x = Math.min(x, -metrics.scrollLeft);
2105
- y = Math.min(y, -metrics.scrollTop);
2106
- const maxXDisplacement = Math.max(
2107
- 0,
2108
- metrics.scrollWidth - metrics.viewWidth,
2109
- );
2110
- const maxXScroll = metrics.scrollLeft + maxXDisplacement;
2111
- const maxYDisplacement = Math.max(
2112
- 0,
2113
- metrics.scrollHeight - metrics.viewHeight,
2114
- );
2115
- const maxYScroll = metrics.scrollTop + maxYDisplacement;
2116
- x = Math.max(x, -maxXScroll);
2117
- y = Math.max(y, -maxYScroll);
2118
- this.scrollX = x;
2119
- this.scrollY = y;
2120
-
2121
- if (this.scrollbar) {
2122
- // The content position (displacement from the content's top-left to the
2123
- // origin) plus the scroll position (displacement from the view's top-left
2124
- // to the origin) gives us the distance from the view's top-left to the
2125
- // content's top-left. Then we negate this so we get the displacement from
2126
- // the content's top-left to the view's top-left, matching the
2127
- // directionality of the scrollbars.
2128
- this.scrollbar.set(
2129
- -(x + metrics.scrollLeft),
2130
- -(y + metrics.scrollTop),
2131
- false,
2132
- );
2133
- }
2134
- // We have to shift the translation so that when the canvas is at 0, 0 the
2135
- // workspace origin is not underneath the toolbox.
2136
- x += metrics.absoluteLeft;
2137
- y += metrics.absoluteTop;
2138
- this.translate(x, y);
2139
- }
2140
-
2141
- /**
2142
- * Find the block on this workspace with the specified ID.
2143
- *
2144
- * @param id ID of block to find.
2145
- * @returns The sought after block, or null if not found.
2146
- */
2147
- override getBlockById(id: string): BlockSvg | null {
2148
- return super.getBlockById(id) as BlockSvg;
2149
- }
2150
-
2151
- /**
2152
- * Find all blocks in workspace. Blocks are optionally sorted
2153
- * by position; top to bottom (with slight LTR or RTL bias).
2154
- *
2155
- * @param ordered Sort the list if true.
2156
- * @returns Array of blocks.
2157
- */
2158
- override getAllBlocks(ordered = false): BlockSvg[] {
2159
- return super.getAllBlocks(ordered) as BlockSvg[];
2160
- }
2161
-
2162
- /**
2163
- * Finds the top-level blocks and returns them. Blocks are optionally sorted
2164
- * by position; top to bottom (with slight LTR or RTL bias).
2165
- *
2166
- * @param ordered Sort the list if true.
2167
- * @returns The top-level block objects.
2168
- */
2169
- override getTopBlocks(ordered = false): BlockSvg[] {
2170
- return super.getTopBlocks(ordered) as BlockSvg[];
2171
- }
2172
-
2173
- /**
2174
- * Adds a block to the list of top blocks.
2175
- *
2176
- * @param block Block to add.
2177
- */
2178
- override addTopBlock(block: Block) {
2179
- this.addTopBoundedElement(block as BlockSvg);
2180
- super.addTopBlock(block);
2181
- }
2182
-
2183
- /**
2184
- * Removes a block from the list of top blocks.
2185
- *
2186
- * @param block Block to remove.
2187
- */
2188
- override removeTopBlock(block: Block) {
2189
- this.removeTopBoundedElement(block as BlockSvg);
2190
- super.removeTopBlock(block);
2191
- }
2192
-
2193
- /**
2194
- * Adds a comment to the list of top comments.
2195
- *
2196
- * @param comment comment to add.
2197
- */
2198
- override addTopComment(comment: WorkspaceComment) {
2199
- this.addTopBoundedElement(comment as RenderedWorkspaceComment);
2200
- super.addTopComment(comment);
2201
- }
2202
-
2203
- /**
2204
- * Removes a comment from the list of top comments.
2205
- *
2206
- * @param comment comment to remove.
2207
- */
2208
- override removeTopComment(comment: WorkspaceComment) {
2209
- this.removeTopBoundedElement(comment as RenderedWorkspaceComment);
2210
- super.removeTopComment(comment);
2211
- }
2212
-
2213
- override getRootWorkspace(): WorkspaceSvg | null {
2214
- return super.getRootWorkspace() as WorkspaceSvg | null;
2215
- }
2216
-
2217
- /**
2218
- * Adds a bounded element to the list of top bounded elements.
2219
- *
2220
- * @param element Bounded element to add.
2221
- */
2222
- addTopBoundedElement(element: IBoundedElement) {
2223
- this.topBoundedElements.push(element);
2224
- }
2225
-
2226
- /**
2227
- * Removes a bounded element from the list of top bounded elements.
2228
- *
2229
- * @param element Bounded element to remove.
2230
- */
2231
- removeTopBoundedElement(element: IBoundedElement) {
2232
- arrayUtils.removeElem(this.topBoundedElements, element);
2233
- }
2234
-
2235
- /**
2236
- * Finds the top-level bounded elements and returns them.
2237
- *
2238
- * @returns The top-level bounded elements.
2239
- */
2240
- getTopBoundedElements(): IBoundedElement[] {
2241
- return new Array<IBoundedElement>().concat(this.topBoundedElements);
2242
- }
2243
-
2244
- /**
2245
- * Update whether this workspace has resizes enabled.
2246
- * If enabled, workspace will resize when appropriate.
2247
- * If disabled, workspace will not resize until re-enabled.
2248
- * Use to avoid resizing during a batch operation, for performance.
2249
- *
2250
- * @param enabled Whether resizes should be enabled.
2251
- */
2252
- setResizesEnabled(enabled: boolean) {
2253
- const reenabled = !this.resizesEnabled && enabled;
2254
- this.resizesEnabled = enabled;
2255
- if (reenabled) {
2256
- // Newly enabled. Trigger a resize.
2257
- this.resizeContents();
2258
- }
2259
- }
2260
-
2261
- /**
2262
- * Dispose of all blocks in workspace, with an optimization to prevent
2263
- * resizes.
2264
- */
2265
- override clear() {
2266
- this.setResizesEnabled(false);
2267
- super.clear();
2268
- this.topBoundedElements = [];
2269
- this.setResizesEnabled(true);
2270
- }
2271
-
2272
- /**
2273
- * Register a callback function associated with a given key, for clicks on
2274
- * buttons and labels in the flyout.
2275
- * For instance, a button specified by the XML
2276
- * <button text="create variable" callbackKey="CREATE_VARIABLE"></button>
2277
- * should be matched by a call to
2278
- * registerButtonCallback("CREATE_VARIABLE", yourCallbackFunction).
2279
- *
2280
- * @param key The name to use to look up this function.
2281
- * @param func The function to call when the given button is clicked.
2282
- */
2283
- registerButtonCallback(key: string, func: (p1: FlyoutButton) => void) {
2284
- if (typeof func !== 'function') {
2285
- throw TypeError('Button callbacks must be functions.');
2286
- }
2287
- this.flyoutButtonCallbacks.set(key, func);
2288
- }
2289
-
2290
- /**
2291
- * Get the callback function associated with a given key, for clicks on
2292
- * buttons and labels in the flyout.
2293
- *
2294
- * @param key The name to use to look up the function.
2295
- * @returns The function corresponding to the given key for this workspace;
2296
- * null if no callback is registered.
2297
- */
2298
- getButtonCallback(key: string): ((p1: FlyoutButton) => void) | null {
2299
- return this.flyoutButtonCallbacks.get(key) ?? null;
2300
- }
2301
-
2302
- /**
2303
- * Remove a callback for a click on a button in the flyout.
2304
- *
2305
- * @param key The name associated with the callback function.
2306
- */
2307
- removeButtonCallback(key: string) {
2308
- this.flyoutButtonCallbacks.delete(key);
2309
- }
2310
-
2311
- /**
2312
- * Register a callback function associated with a given key, for populating
2313
- * custom toolbox categories in this workspace. See the variable and
2314
- * procedure categories as an example.
2315
- *
2316
- * @param key The name to use to look up this function.
2317
- * @param func The function to call when the given toolbox category is opened.
2318
- */
2319
- registerToolboxCategoryCallback(
2320
- key: string,
2321
- func: (p1: WorkspaceSvg) => toolbox.FlyoutDefinition,
2322
- ) {
2323
- if (typeof func !== 'function') {
2324
- throw TypeError('Toolbox category callbacks must be functions.');
2325
- }
2326
- this.toolboxCategoryCallbacks.set(key, func);
2327
- }
2328
-
2329
- /**
2330
- * Get the callback function associated with a given key, for populating
2331
- * custom toolbox categories in this workspace.
2332
- *
2333
- * @param key The name to use to look up the function.
2334
- * @returns The function corresponding to the given key for this workspace, or
2335
- * null if no function is registered.
2336
- */
2337
- getToolboxCategoryCallback(
2338
- key: string,
2339
- ): ((p1: WorkspaceSvg) => toolbox.FlyoutDefinition) | null {
2340
- return this.toolboxCategoryCallbacks.get(key) || null;
2341
- }
2342
-
2343
- /**
2344
- * Remove a callback for a click on a custom category's name in the toolbox.
2345
- *
2346
- * @param key The name associated with the callback function.
2347
- */
2348
- removeToolboxCategoryCallback(key: string) {
2349
- this.toolboxCategoryCallbacks.delete(key);
2350
- }
2351
-
2352
- /**
2353
- * Look up the gesture that is tracking this touch stream on this workspace.
2354
- * May create a new gesture.
2355
- *
2356
- * @param e Pointer event.
2357
- * @returns The gesture that is tracking this touch stream, or null if no
2358
- * valid gesture exists.
2359
- * @internal
2360
- */
2361
- getGesture(e: PointerEvent): Gesture | null {
2362
- const isStart = e.type === 'pointerdown';
2363
-
2364
- const gesture = this.currentGesture_;
2365
- if (gesture) {
2366
- if (isStart && gesture.hasStarted()) {
2367
- console.warn('Tried to start the same gesture twice.');
2368
- // That's funny. We must have missed a mouse up.
2369
- // Cancel it, rather than try to retrieve all of the state we need.
2370
- gesture.cancel();
2371
- return null;
2372
- }
2373
- return gesture;
2374
- }
2375
-
2376
- // No gesture existed on this workspace, but this looks like the start of a
2377
- // new gesture.
2378
- if (isStart) {
2379
- this.currentGesture_ = new Gesture(e, this);
2380
- return this.currentGesture_;
2381
- }
2382
- // No gesture existed and this event couldn't be the start of a new gesture.
2383
- return null;
2384
- }
2385
-
2386
- /**
2387
- * Clear the reference to the current gesture.
2388
- *
2389
- * @internal
2390
- */
2391
- clearGesture() {
2392
- this.currentGesture_ = null;
2393
- }
2394
-
2395
- /**
2396
- * Cancel the current gesture, if one exists.
2397
- *
2398
- * @internal
2399
- */
2400
- cancelCurrentGesture() {
2401
- if (this.currentGesture_) {
2402
- this.currentGesture_.cancel();
2403
- }
2404
- }
2405
-
2406
- /**
2407
- * Get the audio manager for this workspace.
2408
- *
2409
- * @returns The audio manager for this workspace.
2410
- */
2411
- getAudioManager(): WorkspaceAudio {
2412
- return this.audioManager;
2413
- }
2414
-
2415
- /**
2416
- * Get the grid object for this workspace, or null if there is none.
2417
- *
2418
- * @returns The grid object for this workspace.
2419
- */
2420
- getGrid(): Grid | null {
2421
- return this.grid;
2422
- }
2423
-
2424
- /**
2425
- * Close tooltips, context menus, dropdown selections, etc.
2426
- *
2427
- * @param onlyClosePopups Whether only popups should be closed. Defaults to
2428
- * false.
2429
- */
2430
- hideChaff(onlyClosePopups = false) {
2431
- Tooltip.hide();
2432
- WidgetDiv.hideIfOwnerIsInWorkspace(this);
2433
- dropDownDiv.hideWithoutAnimation();
2434
-
2435
- this.hideComponents(onlyClosePopups);
2436
- }
2437
-
2438
- /**
2439
- * Hide any autohideable components (like flyout, trashcan, and any
2440
- * user-registered components).
2441
- *
2442
- * @param onlyClosePopups Whether only popups should be closed. Defaults to
2443
- * false.
2444
- */
2445
- hideComponents(onlyClosePopups = false) {
2446
- const autoHideables = this.getComponentManager().getComponents(
2447
- ComponentManager.Capability.AUTOHIDEABLE,
2448
- true,
2449
- );
2450
- autoHideables.forEach((autoHideable) =>
2451
- autoHideable.autoHide(onlyClosePopups),
2452
- );
2453
- }
2454
-
2455
- /**
2456
- * Sets the X/Y translations of a top level workspace.
2457
- *
2458
- * @param xyRatio Contains an x and/or y property which is a float between 0
2459
- * and 1 specifying the degree of scrolling.
2460
- */
2461
- private static setTopLevelWorkspaceMetrics_(
2462
- this: WorkspaceSvg,
2463
- xyRatio: {x?: number; y?: number},
2464
- ) {
2465
- const metrics = this.getMetrics();
2466
-
2467
- if (typeof xyRatio.x === 'number') {
2468
- this.scrollX = -(
2469
- metrics.scrollLeft +
2470
- (metrics.scrollWidth - metrics.viewWidth) * xyRatio.x
2471
- );
2472
- }
2473
- if (typeof xyRatio.y === 'number') {
2474
- this.scrollY = -(
2475
- metrics.scrollTop +
2476
- (metrics.scrollHeight - metrics.viewHeight) * xyRatio.y
2477
- );
2478
- }
2479
- // We have to shift the translation so that when the canvas is at 0, 0 the
2480
- // workspace origin is not underneath the toolbox.
2481
- const x = this.scrollX + metrics.absoluteLeft;
2482
- const y = this.scrollY + metrics.absoluteTop;
2483
- // We could call scroll here, but that has extra checks we don't need to do.
2484
- this.translate(x, y);
2485
- }
2486
-
2487
- /**
2488
- * Adds a CSS class to the workspace.
2489
- *
2490
- * @param className Name of class to add.
2491
- */
2492
- addClass(className: string) {
2493
- if (this.injectionDiv) {
2494
- dom.addClass(this.injectionDiv, className);
2495
- }
2496
- }
2497
-
2498
- /**
2499
- * Removes a CSS class from the workspace.
2500
- *
2501
- * @param className Name of class to remove.
2502
- */
2503
- removeClass(className: string) {
2504
- if (this.injectionDiv) {
2505
- dom.removeClass(this.injectionDiv, className);
2506
- }
2507
- }
2508
- }
2509
-
2510
- /**
2511
- * Size the workspace when the contents change. This also updates
2512
- * scrollbars accordingly.
2513
- *
2514
- * @param workspace The workspace to resize.
2515
- * @internal
2516
- */
2517
- export function resizeSvgContents(workspace: WorkspaceSvg) {
2518
- workspace.resizeContents();
2519
- }