scratch-blocks 1.2.0-beta.1 → 1.2.0

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 (1297) hide show
  1. package/.husky/commit-msg +3 -0
  2. package/blockly_compressed_horizontal.js +2255 -0
  3. package/blockly_compressed_vertical.js +2283 -0
  4. package/blockly_uncompressed_horizontal.js +1210 -0
  5. package/blockly_uncompressed_vertical.js +1210 -0
  6. package/blocks_common/colour.js +61 -0
  7. package/blocks_common/math.js +159 -0
  8. package/blocks_common/matrix.js +54 -0
  9. package/blocks_common/note.js +58 -0
  10. package/blocks_common/text.js +57 -0
  11. package/blocks_compressed.js +36 -0
  12. package/blocks_compressed_horizontal.js +67 -0
  13. package/blocks_compressed_vertical.js +208 -0
  14. package/blocks_horizontal/control.js +212 -0
  15. package/blocks_horizontal/default_toolbox.js +139 -0
  16. package/blocks_horizontal/event.js +190 -0
  17. package/blocks_horizontal/wedo.js +325 -0
  18. package/blocks_vertical/control.js +532 -0
  19. package/blocks_vertical/data.js +666 -0
  20. package/blocks_vertical/default_toolbox.js +564 -0
  21. package/blocks_vertical/event.js +329 -0
  22. package/blocks_vertical/extensions.js +294 -0
  23. package/blocks_vertical/looks.js +591 -0
  24. package/blocks_vertical/motion.js +587 -0
  25. package/blocks_vertical/operators.js +470 -0
  26. package/blocks_vertical/procedures.js +973 -0
  27. package/blocks_vertical/sensing.js +554 -0
  28. package/blocks_vertical/sound.js +246 -0
  29. package/blocks_vertical/vertical_extensions.js +266 -0
  30. package/build/gen_blocks.js +1 -0
  31. package/build/test_expect.js +1 -0
  32. package/build/test_input.js +1 -0
  33. package/build.py +636 -0
  34. package/cleanup.sh +101 -0
  35. package/core/block.js +1837 -0
  36. package/core/block_animations.js +107 -0
  37. package/core/block_drag_surface.js +299 -0
  38. package/core/block_dragger.js +421 -0
  39. package/core/block_events.js +531 -0
  40. package/core/block_render_svg_horizontal.js +890 -0
  41. package/core/block_render_svg_vertical.js +1732 -0
  42. package/core/block_svg.js +1316 -0
  43. package/core/blockly.js +622 -0
  44. package/core/blocks.js +37 -0
  45. package/core/bubble.js +664 -0
  46. package/core/bubble_dragger.js +285 -0
  47. package/core/colours.js +160 -0
  48. package/core/comment.js +293 -0
  49. package/core/comment_events.js +539 -0
  50. package/core/connection.js +766 -0
  51. package/core/connection_db.js +300 -0
  52. package/core/constants.js +387 -0
  53. package/core/contextmenu.js +519 -0
  54. package/core/css.js +1351 -0
  55. package/core/data_category.js +490 -0
  56. package/core/dragged_connection_manager.js +260 -0
  57. package/core/dropdowndiv.js +408 -0
  58. package/core/events.js +429 -0
  59. package/core/events_abstract.js +113 -0
  60. package/core/extensions.js +450 -0
  61. package/core/field.js +807 -0
  62. package/core/field_angle.js +398 -0
  63. package/core/field_checkbox.js +133 -0
  64. package/core/field_colour.js +253 -0
  65. package/core/field_colour_slider.js +387 -0
  66. package/core/field_date.js +353 -0
  67. package/core/field_dropdown.js +483 -0
  68. package/core/field_iconmenu.js +309 -0
  69. package/core/field_image.js +193 -0
  70. package/core/field_label.js +136 -0
  71. package/core/field_label_serializable.js +125 -0
  72. package/core/field_matrix.js +566 -0
  73. package/core/field_note.js +850 -0
  74. package/core/field_number.js +366 -0
  75. package/core/field_numberdropdown.js +77 -0
  76. package/core/field_textdropdown.js +164 -0
  77. package/core/field_textinput.js +675 -0
  78. package/core/field_textinput_removable.js +105 -0
  79. package/core/field_variable.js +385 -0
  80. package/core/field_variable_getter.js +185 -0
  81. package/core/field_vertical_separator.js +161 -0
  82. package/core/flyout_base.js +923 -0
  83. package/core/flyout_button.js +322 -0
  84. package/core/flyout_dragger.js +83 -0
  85. package/core/flyout_extension_category_header.js +159 -0
  86. package/core/flyout_horizontal.js +475 -0
  87. package/core/flyout_vertical.js +770 -0
  88. package/core/generator.js +426 -0
  89. package/core/gesture.js +1011 -0
  90. package/core/grid.js +227 -0
  91. package/core/icon.js +205 -0
  92. package/core/inject.js +491 -0
  93. package/core/input.js +285 -0
  94. package/core/insertion_marker_manager.js +678 -0
  95. package/core/msg.js +62 -0
  96. package/core/mutator.js +426 -0
  97. package/core/names.js +198 -0
  98. package/core/options.js +244 -0
  99. package/core/procedures.js +577 -0
  100. package/core/rendered_connection.js +417 -0
  101. package/core/scratch_block_comment.js +653 -0
  102. package/core/scratch_blocks_utils.js +244 -0
  103. package/core/scratch_bubble.js +696 -0
  104. package/core/scratch_events.js +131 -0
  105. package/core/scratch_msgs.js +85 -0
  106. package/core/scrollbar.js +875 -0
  107. package/core/toolbox.js +801 -0
  108. package/core/tooltip.js +337 -0
  109. package/core/touch.js +226 -0
  110. package/core/trashcan.js +343 -0
  111. package/core/ui_events.js +91 -0
  112. package/core/ui_menu_utils.js +68 -0
  113. package/core/utils.js +948 -0
  114. package/core/variable_events.js +259 -0
  115. package/core/variable_map.js +415 -0
  116. package/core/variable_model.js +116 -0
  117. package/core/variables.js +674 -0
  118. package/core/warning.js +199 -0
  119. package/core/widgetdiv.js +344 -0
  120. package/core/workspace.js +673 -0
  121. package/core/workspace_audio.js +170 -0
  122. package/core/workspace_comment.js +432 -0
  123. package/core/workspace_comment_render_svg.js +723 -0
  124. package/core/workspace_comment_svg.js +611 -0
  125. package/core/workspace_drag_surface_svg.js +195 -0
  126. package/core/workspace_dragger.js +132 -0
  127. package/core/workspace_svg.js +2267 -0
  128. package/core/xml.js +919 -0
  129. package/core/zoom_controls.js +301 -0
  130. package/dist/horizontal.js +222 -0
  131. package/dist/vertical.js +222 -0
  132. package/dist/web/horizontal.js +232 -0
  133. package/dist/web/vertical.js +232 -0
  134. package/local_build.sh +70 -0
  135. package/msg/js/en.js +1 -0
  136. package/msg/json/en.json +1 -0
  137. package/msg/messages.js +1 -0
  138. package/msg/scratch_msgs.js +244 -184
  139. package/package.json +40 -25
  140. package/pull_from_blockly.sh +151 -0
  141. package/release.config.js +0 -8
  142. package/shim/blockly_compressed_horizontal-blocks_compressed.js +1 -0
  143. package/shim/blockly_compressed_horizontal.Blockly.js +1 -0
  144. package/shim/blockly_compressed_horizontal.goog.js +1 -0
  145. package/shim/blockly_compressed_horizontal.js +1 -0
  146. package/shim/blockly_compressed_vertical-blocks_compressed.js +1 -0
  147. package/shim/blockly_compressed_vertical.Blockly.js +1 -0
  148. package/shim/blockly_compressed_vertical.goog.js +1 -0
  149. package/shim/blockly_compressed_vertical.js +1 -0
  150. package/shim/blocks_compressed_horizontal-blockly_compressed_horizontal-messages.js +1 -0
  151. package/shim/blocks_compressed_horizontal.js +1 -0
  152. package/shim/blocks_compressed_vertical-blockly_compressed_vertical-messages.js +1 -0
  153. package/shim/blocks_compressed_vertical.js +1 -0
  154. package/shim/gh-pages.js +1 -0
  155. package/shim/horizontal.js +1 -0
  156. package/shim/index.js +17 -0
  157. package/shim/vertical.js +1 -0
  158. package/CHANGELOG.md +0 -1104
  159. package/TODO.md +0 -16
  160. package/blockly-rc/.eslintignore +0 -28
  161. package/blockly-rc/.eslintrc.js +0 -187
  162. package/blockly-rc/.gitattributes +0 -1
  163. package/blockly-rc/.github/CODEOWNERS +0 -1
  164. package/blockly-rc/.github/CONTRIBUTING.md +0 -46
  165. package/blockly-rc/.github/ISSUE_TEMPLATE/bug_report.yaml +0 -58
  166. package/blockly-rc/.github/ISSUE_TEMPLATE/config.yml +0 -7
  167. package/blockly-rc/.github/ISSUE_TEMPLATE/documentation.yaml +0 -38
  168. package/blockly-rc/.github/ISSUE_TEMPLATE/feature_request.yaml +0 -39
  169. package/blockly-rc/.github/PULL_REQUEST_TEMPLATE.md +0 -42
  170. package/blockly-rc/.github/dependabot.yml +0 -27
  171. package/blockly-rc/.github/release.yml +0 -32
  172. package/blockly-rc/.github/workflows/appengine_deploy.yml +0 -54
  173. package/blockly-rc/.github/workflows/assign_reviewers.yml +0 -41
  174. package/blockly-rc/.github/workflows/browser_test.yml +0 -55
  175. package/blockly-rc/.github/workflows/build.yml +0 -86
  176. package/blockly-rc/.github/workflows/conventional-label.yml +0 -17
  177. package/blockly-rc/.github/workflows/develop_freeze.yml +0 -26
  178. package/blockly-rc/.github/workflows/tag_module_cleanup.yml +0 -37
  179. package/blockly-rc/.github/workflows/welcome_new_contributors.yml +0 -36
  180. package/blockly-rc/.prettierignore +0 -30
  181. package/blockly-rc/.prettierrc.js +0 -13
  182. package/blockly-rc/CHANGELOG.md +0 -77
  183. package/blockly-rc/LICENSE +0 -202
  184. package/blockly-rc/README.md +0 -80
  185. package/blockly-rc/_config.yml +0 -1
  186. package/blockly-rc/api-extractor.json +0 -385
  187. package/blockly-rc/appengine/.gcloudignore +0 -20
  188. package/blockly-rc/appengine/README.txt +0 -42
  189. package/blockly-rc/appengine/add_timestamps.py +0 -69
  190. package/blockly-rc/appengine/app.yaml +0 -104
  191. package/blockly-rc/appengine/apple-touch-icon.png +0 -0
  192. package/blockly-rc/appengine/blockly_compressed.js +0 -11
  193. package/blockly-rc/appengine/expiration.py +0 -52
  194. package/blockly-rc/appengine/favicon.ico +0 -0
  195. package/blockly-rc/appengine/index.yaml +0 -11
  196. package/blockly-rc/appengine/main.py +0 -39
  197. package/blockly-rc/appengine/redirect.html +0 -107
  198. package/blockly-rc/appengine/requirements.txt +0 -1
  199. package/blockly-rc/appengine/robots.txt +0 -2
  200. package/blockly-rc/appengine/storage.js +0 -190
  201. package/blockly-rc/appengine/storage.py +0 -125
  202. package/blockly-rc/blocks/blocks.ts +0 -44
  203. package/blockly-rc/blocks/lists.ts +0 -1085
  204. package/blockly-rc/blocks/logic.ts +0 -712
  205. package/blockly-rc/blocks/loops.ts +0 -408
  206. package/blockly-rc/blocks/math.ts +0 -591
  207. package/blockly-rc/blocks/procedures.ts +0 -1364
  208. package/blockly-rc/blocks/text.ts +0 -1007
  209. package/blockly-rc/blocks/variables.ts +0 -183
  210. package/blockly-rc/blocks/variables_dynamic.ts +0 -194
  211. package/blockly-rc/core/any_aliases.ts +0 -8
  212. package/blockly-rc/core/block.ts +0 -2523
  213. package/blockly-rc/core/block_animations.ts +0 -225
  214. package/blockly-rc/core/block_flyout_inflater.ts +0 -262
  215. package/blockly-rc/core/block_svg.ts +0 -1768
  216. package/blockly-rc/core/blockly.ts +0 -605
  217. package/blockly-rc/core/blockly_options.ts +0 -71
  218. package/blockly-rc/core/blocks.ts +0 -18
  219. package/blockly-rc/core/browser_events.ts +0 -244
  220. package/blockly-rc/core/bubbles/bubble.ts +0 -658
  221. package/blockly-rc/core/bubbles/mini_workspace_bubble.ts +0 -280
  222. package/blockly-rc/core/bubbles/text_bubble.ts +0 -103
  223. package/blockly-rc/core/bubbles/textinput_bubble.ts +0 -344
  224. package/blockly-rc/core/bubbles.ts +0 -12
  225. package/blockly-rc/core/bump_objects.ts +0 -192
  226. package/blockly-rc/core/button_flyout_inflater.ts +0 -63
  227. package/blockly-rc/core/clipboard/block_paster.ts +0 -142
  228. package/blockly-rc/core/clipboard/registry.ts +0 -31
  229. package/blockly-rc/core/clipboard/workspace_comment_paster.ts +0 -94
  230. package/blockly-rc/core/clipboard.ts +0 -113
  231. package/blockly-rc/core/comments/comment_view.ts +0 -899
  232. package/blockly-rc/core/comments/rendered_workspace_comment.ts +0 -297
  233. package/blockly-rc/core/comments/workspace_comment.ts +0 -237
  234. package/blockly-rc/core/comments.ts +0 -9
  235. package/blockly-rc/core/common.ts +0 -305
  236. package/blockly-rc/core/component_manager.ts +0 -235
  237. package/blockly-rc/core/config.ts +0 -65
  238. package/blockly-rc/core/connection.ts +0 -793
  239. package/blockly-rc/core/connection_checker.ts +0 -348
  240. package/blockly-rc/core/connection_db.ts +0 -297
  241. package/blockly-rc/core/connection_type.ts +0 -21
  242. package/blockly-rc/core/constants.ts +0 -23
  243. package/blockly-rc/core/contextmenu.ts +0 -268
  244. package/blockly-rc/core/contextmenu_items.ts +0 -700
  245. package/blockly-rc/core/contextmenu_registry.ts +0 -194
  246. package/blockly-rc/core/css.ts +0 -481
  247. package/blockly-rc/core/delete_area.ts +0 -77
  248. package/blockly-rc/core/dialog.ts +0 -121
  249. package/blockly-rc/core/drag_target.ts +0 -97
  250. package/blockly-rc/core/dragging/block_drag_strategy.ts +0 -454
  251. package/blockly-rc/core/dragging/bubble_drag_strategy.ts +0 -52
  252. package/blockly-rc/core/dragging/comment_drag_strategy.ts +0 -91
  253. package/blockly-rc/core/dragging/dragger.ts +0 -163
  254. package/blockly-rc/core/dragging.ts +0 -12
  255. package/blockly-rc/core/dropdowndiv.ts +0 -768
  256. package/blockly-rc/core/events/events.ts +0 -163
  257. package/blockly-rc/core/events/events_abstract.ts +0 -130
  258. package/blockly-rc/core/events/events_block_base.ts +0 -88
  259. package/blockly-rc/core/events/events_block_change.ts +0 -259
  260. package/blockly-rc/core/events/events_block_create.ts +0 -185
  261. package/blockly-rc/core/events/events_block_delete.ts +0 -182
  262. package/blockly-rc/core/events/events_block_drag.ts +0 -116
  263. package/blockly-rc/core/events/events_block_field_intermediate_change.ts +0 -167
  264. package/blockly-rc/core/events/events_block_move.ts +0 -307
  265. package/blockly-rc/core/events/events_bubble_open.ts +0 -120
  266. package/blockly-rc/core/events/events_click.ts +0 -110
  267. package/blockly-rc/core/events/events_comment_base.ts +0 -126
  268. package/blockly-rc/core/events/events_comment_change.ts +0 -161
  269. package/blockly-rc/core/events/events_comment_collapse.ts +0 -103
  270. package/blockly-rc/core/events/events_comment_create.ts +0 -118
  271. package/blockly-rc/core/events/events_comment_delete.ts +0 -117
  272. package/blockly-rc/core/events/events_comment_drag.ts +0 -99
  273. package/blockly-rc/core/events/events_comment_move.ts +0 -207
  274. package/blockly-rc/core/events/events_comment_resize.ts +0 -174
  275. package/blockly-rc/core/events/events_marker_move.ts +0 -134
  276. package/blockly-rc/core/events/events_selected.ts +0 -98
  277. package/blockly-rc/core/events/events_theme_change.ts +0 -84
  278. package/blockly-rc/core/events/events_toolbox_item_select.ts +0 -96
  279. package/blockly-rc/core/events/events_trashcan_open.ts +0 -88
  280. package/blockly-rc/core/events/events_ui_base.ts +0 -47
  281. package/blockly-rc/core/events/events_var_base.ts +0 -89
  282. package/blockly-rc/core/events/events_var_create.ts +0 -129
  283. package/blockly-rc/core/events/events_var_delete.ts +0 -124
  284. package/blockly-rc/core/events/events_var_rename.ts +0 -133
  285. package/blockly-rc/core/events/events_var_type_change.ts +0 -122
  286. package/blockly-rc/core/events/events_viewport.ts +0 -149
  287. package/blockly-rc/core/events/utils.ts +0 -595
  288. package/blockly-rc/core/events/workspace_events.ts +0 -46
  289. package/blockly-rc/core/extensions.ts +0 -491
  290. package/blockly-rc/core/field.ts +0 -1471
  291. package/blockly-rc/core/field_checkbox.ts +0 -271
  292. package/blockly-rc/core/field_dropdown.ts +0 -857
  293. package/blockly-rc/core/field_image.ts +0 -297
  294. package/blockly-rc/core/field_input.ts +0 -755
  295. package/blockly-rc/core/field_label.ts +0 -150
  296. package/blockly-rc/core/field_label_serializable.ts +0 -73
  297. package/blockly-rc/core/field_number.ts +0 -381
  298. package/blockly-rc/core/field_registry.ts +0 -115
  299. package/blockly-rc/core/field_textinput.ts +0 -117
  300. package/blockly-rc/core/field_variable.ts +0 -651
  301. package/blockly-rc/core/flyout_base.ts +0 -968
  302. package/blockly-rc/core/flyout_button.ts +0 -416
  303. package/blockly-rc/core/flyout_horizontal.ts +0 -374
  304. package/blockly-rc/core/flyout_metrics_manager.ts +0 -90
  305. package/blockly-rc/core/flyout_separator.ts +0 -61
  306. package/blockly-rc/core/flyout_vertical.ts +0 -353
  307. package/blockly-rc/core/generator.ts +0 -611
  308. package/blockly-rc/core/gesture.ts +0 -1191
  309. package/blockly-rc/core/grid.ts +0 -252
  310. package/blockly-rc/core/icons/comment_icon.ts +0 -435
  311. package/blockly-rc/core/icons/exceptions.ts +0 -23
  312. package/blockly-rc/core/icons/icon.ts +0 -147
  313. package/blockly-rc/core/icons/icon_types.ts +0 -32
  314. package/blockly-rc/core/icons/mutator_icon.ts +0 -354
  315. package/blockly-rc/core/icons/registry.ts +0 -33
  316. package/blockly-rc/core/icons/warning_icon.ts +0 -219
  317. package/blockly-rc/core/icons.ts +0 -24
  318. package/blockly-rc/core/inject.ts +0 -428
  319. package/blockly-rc/core/inputs/align.ts +0 -14
  320. package/blockly-rc/core/inputs/dummy_input.ts +0 -26
  321. package/blockly-rc/core/inputs/end_row_input.ts +0 -31
  322. package/blockly-rc/core/inputs/input.ts +0 -318
  323. package/blockly-rc/core/inputs/input_types.ts +0 -27
  324. package/blockly-rc/core/inputs/statement_input.ts +0 -34
  325. package/blockly-rc/core/inputs/value_input.ts +0 -30
  326. package/blockly-rc/core/inputs.ts +0 -23
  327. package/blockly-rc/core/insertion_marker_manager.ts +0 -742
  328. package/blockly-rc/core/insertion_marker_previewer.ts +0 -254
  329. package/blockly-rc/core/interfaces/i_ast_node_location.ts +0 -12
  330. package/blockly-rc/core/interfaces/i_ast_node_location_svg.ts +0 -28
  331. package/blockly-rc/core/interfaces/i_ast_node_location_with_block.ts +0 -22
  332. package/blockly-rc/core/interfaces/i_autohideable.ts +0 -22
  333. package/blockly-rc/core/interfaces/i_bounded_element.ts +0 -30
  334. package/blockly-rc/core/interfaces/i_bubble.ts +0 -63
  335. package/blockly-rc/core/interfaces/i_collapsible_toolbox_item.ts +0 -33
  336. package/blockly-rc/core/interfaces/i_comment_icon.ts +0 -47
  337. package/blockly-rc/core/interfaces/i_component.ts +0 -19
  338. package/blockly-rc/core/interfaces/i_connection_checker.ts +0 -100
  339. package/blockly-rc/core/interfaces/i_connection_previewer.ts +0 -50
  340. package/blockly-rc/core/interfaces/i_contextmenu.ts +0 -16
  341. package/blockly-rc/core/interfaces/i_copyable.ts +0 -31
  342. package/blockly-rc/core/interfaces/i_deletable.ts +0 -34
  343. package/blockly-rc/core/interfaces/i_delete_area.ts +0 -28
  344. package/blockly-rc/core/interfaces/i_drag_target.ts +0 -69
  345. package/blockly-rc/core/interfaces/i_draggable.ts +0 -72
  346. package/blockly-rc/core/interfaces/i_dragger.ts +0 -35
  347. package/blockly-rc/core/interfaces/i_flyout.ts +0 -189
  348. package/blockly-rc/core/interfaces/i_flyout_inflater.ts +0 -41
  349. package/blockly-rc/core/interfaces/i_has_bubble.ts +0 -20
  350. package/blockly-rc/core/interfaces/i_icon.ts +0 -114
  351. package/blockly-rc/core/interfaces/i_keyboard_accessible.ts +0 -21
  352. package/blockly-rc/core/interfaces/i_legacy_procedure_blocks.ts +0 -50
  353. package/blockly-rc/core/interfaces/i_metrics_manager.ts +0 -149
  354. package/blockly-rc/core/interfaces/i_movable.ts +0 -19
  355. package/blockly-rc/core/interfaces/i_observable.ts +0 -24
  356. package/blockly-rc/core/interfaces/i_parameter_model.ts +0 -51
  357. package/blockly-rc/core/interfaces/i_paster.ts +0 -25
  358. package/blockly-rc/core/interfaces/i_positionable.ts +0 -33
  359. package/blockly-rc/core/interfaces/i_procedure_block.ts +0 -27
  360. package/blockly-rc/core/interfaces/i_procedure_map.ts +0 -18
  361. package/blockly-rc/core/interfaces/i_procedure_model.ts +0 -71
  362. package/blockly-rc/core/interfaces/i_registrable.ts +0 -12
  363. package/blockly-rc/core/interfaces/i_rendered_element.ts +0 -22
  364. package/blockly-rc/core/interfaces/i_selectable.ts +0 -34
  365. package/blockly-rc/core/interfaces/i_selectable_toolbox_item.ts +0 -63
  366. package/blockly-rc/core/interfaces/i_serializable.ts +0 -28
  367. package/blockly-rc/core/interfaces/i_serializer.ts +0 -55
  368. package/blockly-rc/core/interfaces/i_styleable.ts +0 -26
  369. package/blockly-rc/core/interfaces/i_toolbox.ts +0 -112
  370. package/blockly-rc/core/interfaces/i_toolbox_item.ts +0 -81
  371. package/blockly-rc/core/interfaces/i_variable_backed_parameter_model.ts +0 -23
  372. package/blockly-rc/core/interfaces/i_variable_map.ts +0 -65
  373. package/blockly-rc/core/interfaces/i_variable_model.ts +0 -57
  374. package/blockly-rc/core/internal_constants.ts +0 -47
  375. package/blockly-rc/core/keyboard_nav/ast_node.ts +0 -884
  376. package/blockly-rc/core/keyboard_nav/basic_cursor.ts +0 -223
  377. package/blockly-rc/core/keyboard_nav/cursor.ts +0 -138
  378. package/blockly-rc/core/keyboard_nav/marker.ts +0 -113
  379. package/blockly-rc/core/keyboard_nav/tab_navigate_cursor.ts +0 -46
  380. package/blockly-rc/core/label_flyout_inflater.ts +0 -59
  381. package/blockly-rc/core/layer_manager.ts +0 -186
  382. package/blockly-rc/core/layers.ts +0 -17
  383. package/blockly-rc/core/main.ts +0 -31
  384. package/blockly-rc/core/marker_manager.ts +0 -189
  385. package/blockly-rc/core/menu.ts +0 -463
  386. package/blockly-rc/core/menuitem.ts +0 -221
  387. package/blockly-rc/core/metrics_manager.ts +0 -486
  388. package/blockly-rc/core/msg.ts +0 -27
  389. package/blockly-rc/core/names.ts +0 -275
  390. package/blockly-rc/core/observable_procedure_map.ts +0 -66
  391. package/blockly-rc/core/options.ts +0 -377
  392. package/blockly-rc/core/positionable_helpers.ts +0 -186
  393. package/blockly-rc/core/procedures.ts +0 -510
  394. package/blockly-rc/core/registry.ts +0 -400
  395. package/blockly-rc/core/render_management.ts +0 -193
  396. package/blockly-rc/core/rendered_connection.ts +0 -571
  397. package/blockly-rc/core/renderers/common/block_rendering.ts +0 -120
  398. package/blockly-rc/core/renderers/common/constants.ts +0 -1198
  399. package/blockly-rc/core/renderers/common/drawer.ts +0 -518
  400. package/blockly-rc/core/renderers/common/i_path_object.ts +0 -137
  401. package/blockly-rc/core/renderers/common/info.ts +0 -767
  402. package/blockly-rc/core/renderers/common/marker_svg.ts +0 -765
  403. package/blockly-rc/core/renderers/common/path_object.ts +0 -324
  404. package/blockly-rc/core/renderers/common/renderer.ts +0 -281
  405. package/blockly-rc/core/renderers/geras/constants.ts +0 -46
  406. package/blockly-rc/core/renderers/geras/drawer.ts +0 -167
  407. package/blockly-rc/core/renderers/geras/geras.ts +0 -31
  408. package/blockly-rc/core/renderers/geras/highlight_constants.ts +0 -342
  409. package/blockly-rc/core/renderers/geras/highlighter.ts +0 -313
  410. package/blockly-rc/core/renderers/geras/info.ts +0 -478
  411. package/blockly-rc/core/renderers/geras/measurables/inline_input.ts +0 -37
  412. package/blockly-rc/core/renderers/geras/measurables/statement_input.ts +0 -36
  413. package/blockly-rc/core/renderers/geras/path_object.ts +0 -135
  414. package/blockly-rc/core/renderers/geras/renderer.ts +0 -124
  415. package/blockly-rc/core/renderers/measurables/base.ts +0 -41
  416. package/blockly-rc/core/renderers/measurables/bottom_row.ts +0 -104
  417. package/blockly-rc/core/renderers/measurables/connection.ts +0 -43
  418. package/blockly-rc/core/renderers/measurables/external_value_input.ts +0 -53
  419. package/blockly-rc/core/renderers/measurables/field.ts +0 -50
  420. package/blockly-rc/core/renderers/measurables/hat.ts +0 -33
  421. package/blockly-rc/core/renderers/measurables/icon.ts +0 -42
  422. package/blockly-rc/core/renderers/measurables/in_row_spacer.ts +0 -29
  423. package/blockly-rc/core/renderers/measurables/inline_input.ts +0 -63
  424. package/blockly-rc/core/renderers/measurables/input_connection.ts +0 -57
  425. package/blockly-rc/core/renderers/measurables/input_row.ts +0 -67
  426. package/blockly-rc/core/renderers/measurables/jagged_edge.ts +0 -28
  427. package/blockly-rc/core/renderers/measurables/next_connection.ts +0 -34
  428. package/blockly-rc/core/renderers/measurables/output_connection.ts +0 -43
  429. package/blockly-rc/core/renderers/measurables/previous_connection.ts +0 -34
  430. package/blockly-rc/core/renderers/measurables/round_corner.ts +0 -34
  431. package/blockly-rc/core/renderers/measurables/row.ts +0 -191
  432. package/blockly-rc/core/renderers/measurables/spacer_row.ts +0 -44
  433. package/blockly-rc/core/renderers/measurables/square_corner.ts +0 -32
  434. package/blockly-rc/core/renderers/measurables/statement_input.ts +0 -41
  435. package/blockly-rc/core/renderers/measurables/top_row.ts +0 -110
  436. package/blockly-rc/core/renderers/measurables/types.ts +0 -319
  437. package/blockly-rc/core/renderers/thrasos/info.ts +0 -328
  438. package/blockly-rc/core/renderers/thrasos/renderer.ts +0 -40
  439. package/blockly-rc/core/renderers/thrasos/thrasos.ts +0 -14
  440. package/blockly-rc/core/renderers/zelos/constants.ts +0 -877
  441. package/blockly-rc/core/renderers/zelos/drawer.ts +0 -274
  442. package/blockly-rc/core/renderers/zelos/info.ts +0 -652
  443. package/blockly-rc/core/renderers/zelos/marker_svg.ts +0 -145
  444. package/blockly-rc/core/renderers/zelos/measurables/bottom_row.ts +0 -44
  445. package/blockly-rc/core/renderers/zelos/measurables/inputs.ts +0 -41
  446. package/blockly-rc/core/renderers/zelos/measurables/row_elements.ts +0 -29
  447. package/blockly-rc/core/renderers/zelos/measurables/top_row.ts +0 -50
  448. package/blockly-rc/core/renderers/zelos/path_object.ts +0 -209
  449. package/blockly-rc/core/renderers/zelos/renderer.ts +0 -143
  450. package/blockly-rc/core/renderers/zelos/zelos.ts +0 -33
  451. package/blockly-rc/core/scrollbar.ts +0 -898
  452. package/blockly-rc/core/scrollbar_pair.ts +0 -349
  453. package/blockly-rc/core/separator_flyout_inflater.ts +0 -69
  454. package/blockly-rc/core/serialization/blocks.ts +0 -868
  455. package/blockly-rc/core/serialization/exceptions.ts +0 -112
  456. package/blockly-rc/core/serialization/priorities.ts +0 -25
  457. package/blockly-rc/core/serialization/procedures.ts +0 -158
  458. package/blockly-rc/core/serialization/registry.ts +0 -30
  459. package/blockly-rc/core/serialization/variables.ts +0 -68
  460. package/blockly-rc/core/serialization/workspace_comments.ts +0 -143
  461. package/blockly-rc/core/serialization/workspaces.ts +0 -94
  462. package/blockly-rc/core/serialization.ts +0 -32
  463. package/blockly-rc/core/shortcut_items.ts +0 -338
  464. package/blockly-rc/core/shortcut_registry.ts +0 -368
  465. package/blockly-rc/core/sprites.ts +0 -15
  466. package/blockly-rc/core/theme/classic.ts +0 -40
  467. package/blockly-rc/core/theme/themes.ts +0 -12
  468. package/blockly-rc/core/theme/zelos.ts +0 -80
  469. package/blockly-rc/core/theme.ts +0 -232
  470. package/blockly-rc/core/theme_manager.ts +0 -192
  471. package/blockly-rc/core/toolbox/category.ts +0 -739
  472. package/blockly-rc/core/toolbox/collapsible_category.ts +0 -288
  473. package/blockly-rc/core/toolbox/separator.ts +0 -105
  474. package/blockly-rc/core/toolbox/toolbox.ts +0 -1134
  475. package/blockly-rc/core/toolbox/toolbox_item.ts +0 -152
  476. package/blockly-rc/core/tooltip.ts +0 -466
  477. package/blockly-rc/core/touch.ts +0 -155
  478. package/blockly-rc/core/trashcan.ts +0 -748
  479. package/blockly-rc/core/utils/aria.ts +0 -144
  480. package/blockly-rc/core/utils/array.ts +0 -24
  481. package/blockly-rc/core/utils/colour.ts +0 -265
  482. package/blockly-rc/core/utils/coordinate.ts +0 -129
  483. package/blockly-rc/core/utils/deprecation.ts +0 -47
  484. package/blockly-rc/core/utils/dom.ts +0 -356
  485. package/blockly-rc/core/utils/idgenerator.ts +0 -70
  486. package/blockly-rc/core/utils/keycodes.ts +0 -154
  487. package/blockly-rc/core/utils/math.ts +0 -50
  488. package/blockly-rc/core/utils/metrics.ts +0 -86
  489. package/blockly-rc/core/utils/object.ts +0 -28
  490. package/blockly-rc/core/utils/parsing.ts +0 -287
  491. package/blockly-rc/core/utils/rect.ts +0 -69
  492. package/blockly-rc/core/utils/size.ts +0 -62
  493. package/blockly-rc/core/utils/string.ts +0 -289
  494. package/blockly-rc/core/utils/style.ts +0 -219
  495. package/blockly-rc/core/utils/svg.ts +0 -84
  496. package/blockly-rc/core/utils/svg_math.ts +0 -208
  497. package/blockly-rc/core/utils/svg_paths.ts +0 -133
  498. package/blockly-rc/core/utils/toolbox.ts +0 -419
  499. package/blockly-rc/core/utils/useragent.ts +0 -86
  500. package/blockly-rc/core/utils/xml.ts +0 -165
  501. package/blockly-rc/core/utils.ts +0 -59
  502. package/blockly-rc/core/variable_map.ts +0 -437
  503. package/blockly-rc/core/variable_model.ts +0 -149
  504. package/blockly-rc/core/variables.ts +0 -773
  505. package/blockly-rc/core/variables_dynamic.ts +0 -142
  506. package/blockly-rc/core/widgetdiv.ts +0 -319
  507. package/blockly-rc/core/workspace.ts +0 -957
  508. package/blockly-rc/core/workspace_audio.ts +0 -171
  509. package/blockly-rc/core/workspace_dragger.ts +0 -97
  510. package/blockly-rc/core/workspace_svg.ts +0 -2519
  511. package/blockly-rc/core/xml.ts +0 -1133
  512. package/blockly-rc/core/zoom_controls.ts +0 -492
  513. package/blockly-rc/demos/blockfactory/analytics.js +0 -195
  514. package/blockly-rc/demos/blockfactory/app_controller.js +0 -726
  515. package/blockly-rc/demos/blockfactory/block_definition_extractor.js +0 -742
  516. package/blockly-rc/demos/blockfactory/block_exporter_controller.js +0 -311
  517. package/blockly-rc/demos/blockfactory/block_exporter_tools.js +0 -212
  518. package/blockly-rc/demos/blockfactory/block_exporter_view.js +0 -101
  519. package/blockly-rc/demos/blockfactory/block_library_controller.js +0 -325
  520. package/blockly-rc/demos/blockfactory/block_library_storage.js +0 -149
  521. package/blockly-rc/demos/blockfactory/block_library_view.js +0 -178
  522. package/blockly-rc/demos/blockfactory/block_option.js +0 -151
  523. package/blockly-rc/demos/blockfactory/blocks.js +0 -916
  524. package/blockly-rc/demos/blockfactory/cp.css +0 -46
  525. package/blockly-rc/demos/blockfactory/cp.js +0 -179
  526. package/blockly-rc/demos/blockfactory/factory.css +0 -586
  527. package/blockly-rc/demos/blockfactory/factory.js +0 -337
  528. package/blockly-rc/demos/blockfactory/factory_utils.js +0 -1036
  529. package/blockly-rc/demos/blockfactory/icon.png +0 -0
  530. package/blockly-rc/demos/blockfactory/index.html +0 -767
  531. package/blockly-rc/demos/blockfactory/link.png +0 -0
  532. package/blockly-rc/demos/blockfactory/standard_categories.js +0 -384
  533. package/blockly-rc/demos/blockfactory/workspacefactory/wfactory_controller.js +0 -1332
  534. package/blockly-rc/demos/blockfactory/workspacefactory/wfactory_generator.js +0 -224
  535. package/blockly-rc/demos/blockfactory/workspacefactory/wfactory_init.js +0 -541
  536. package/blockly-rc/demos/blockfactory/workspacefactory/wfactory_model.js +0 -548
  537. package/blockly-rc/demos/blockfactory/workspacefactory/wfactory_view.js +0 -424
  538. package/blockly-rc/demos/code/code.js +0 -626
  539. package/blockly-rc/demos/code/icon.png +0 -0
  540. package/blockly-rc/demos/code/icons.png +0 -0
  541. package/blockly-rc/demos/code/index.html +0 -359
  542. package/blockly-rc/demos/code/msg/ar.js +0 -24
  543. package/blockly-rc/demos/code/msg/be-tarask.js +0 -24
  544. package/blockly-rc/demos/code/msg/br.js +0 -24
  545. package/blockly-rc/demos/code/msg/ca.js +0 -24
  546. package/blockly-rc/demos/code/msg/cs.js +0 -24
  547. package/blockly-rc/demos/code/msg/da.js +0 -24
  548. package/blockly-rc/demos/code/msg/de.js +0 -24
  549. package/blockly-rc/demos/code/msg/el.js +0 -24
  550. package/blockly-rc/demos/code/msg/en.js +0 -24
  551. package/blockly-rc/demos/code/msg/es.js +0 -24
  552. package/blockly-rc/demos/code/msg/et.js +0 -24
  553. package/blockly-rc/demos/code/msg/fa.js +0 -24
  554. package/blockly-rc/demos/code/msg/fr.js +0 -24
  555. package/blockly-rc/demos/code/msg/he.js +0 -24
  556. package/blockly-rc/demos/code/msg/hr.js +0 -24
  557. package/blockly-rc/demos/code/msg/hrx.js +0 -24
  558. package/blockly-rc/demos/code/msg/hu.js +0 -24
  559. package/blockly-rc/demos/code/msg/ia.js +0 -24
  560. package/blockly-rc/demos/code/msg/is.js +0 -24
  561. package/blockly-rc/demos/code/msg/it.js +0 -24
  562. package/blockly-rc/demos/code/msg/ja.js +0 -24
  563. package/blockly-rc/demos/code/msg/kab.js +0 -24
  564. package/blockly-rc/demos/code/msg/ko.js +0 -24
  565. package/blockly-rc/demos/code/msg/mk.js +0 -24
  566. package/blockly-rc/demos/code/msg/ms.js +0 -24
  567. package/blockly-rc/demos/code/msg/nb.js +0 -24
  568. package/blockly-rc/demos/code/msg/nl.js +0 -24
  569. package/blockly-rc/demos/code/msg/oc.js +0 -24
  570. package/blockly-rc/demos/code/msg/pl.js +0 -24
  571. package/blockly-rc/demos/code/msg/pms.js +0 -24
  572. package/blockly-rc/demos/code/msg/pt-br.js +0 -24
  573. package/blockly-rc/demos/code/msg/ro.js +0 -24
  574. package/blockly-rc/demos/code/msg/ru.js +0 -24
  575. package/blockly-rc/demos/code/msg/sc.js +0 -24
  576. package/blockly-rc/demos/code/msg/sk.js +0 -24
  577. package/blockly-rc/demos/code/msg/sr.js +0 -24
  578. package/blockly-rc/demos/code/msg/sv.js +0 -24
  579. package/blockly-rc/demos/code/msg/ta.js +0 -24
  580. package/blockly-rc/demos/code/msg/th.js +0 -24
  581. package/blockly-rc/demos/code/msg/tlh.js +0 -24
  582. package/blockly-rc/demos/code/msg/tr.js +0 -24
  583. package/blockly-rc/demos/code/msg/uk.js +0 -24
  584. package/blockly-rc/demos/code/msg/vi.js +0 -24
  585. package/blockly-rc/demos/code/msg/zh-hans.js +0 -24
  586. package/blockly-rc/demos/code/msg/zh-hant.js +0 -24
  587. package/blockly-rc/demos/code/style.css +0 -184
  588. package/blockly-rc/demos/index.html +0 -68
  589. package/blockly-rc/demos/minimap/icon.png +0 -0
  590. package/blockly-rc/demos/minimap/index.html +0 -91
  591. package/blockly-rc/demos/minimap/minimap.js +0 -302
  592. package/blockly-rc/demos/mobile/README.md +0 -53
  593. package/blockly-rc/demos/mobile/android/README.md +0 -45
  594. package/blockly-rc/demos/mobile/android/app/build.gradle +0 -64
  595. package/blockly-rc/demos/mobile/android/app/proguard-rules.pro +0 -21
  596. package/blockly-rc/demos/mobile/android/app/src/androidTest/java/com/example/blocklywebview/ExampleInstrumentedTest.java +0 -26
  597. package/blockly-rc/demos/mobile/android/app/src/main/AndroidManifest.xml +0 -21
  598. package/blockly-rc/demos/mobile/android/app/src/main/java/com/google/blockly/android/webview/BlocklyWebViewFragment.java +0 -40
  599. package/blockly-rc/demos/mobile/android/app/src/main/java/com/google/blockly/android/webview/JsDialogHelper.java +0 -150
  600. package/blockly-rc/demos/mobile/android/app/src/main/java/com/google/blockly/android/webview/WebChromeClient.java +0 -32
  601. package/blockly-rc/demos/mobile/android/app/src/main/java/com/google/blockly/android/webview/demo/MainActivity.java +0 -18
  602. package/blockly-rc/demos/mobile/android/app/src/main/res/drawable/ic_launcher_background.xml +0 -74
  603. package/blockly-rc/demos/mobile/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +0 -34
  604. package/blockly-rc/demos/mobile/android/app/src/main/res/layout/activity_main.xml +0 -17
  605. package/blockly-rc/demos/mobile/android/app/src/main/res/layout/js_prompt.xml +0 -37
  606. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +0 -5
  607. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +0 -5
  608. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  609. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  610. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  611. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  612. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  613. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  614. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  615. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  616. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  617. package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  618. package/blockly-rc/demos/mobile/android/app/src/main/res/values/colors.xml +0 -6
  619. package/blockly-rc/demos/mobile/android/app/src/main/res/values/js_dialog_helper.xml +0 -7
  620. package/blockly-rc/demos/mobile/android/app/src/main/res/values/strings.xml +0 -3
  621. package/blockly-rc/demos/mobile/android/app/src/main/res/values/styles.xml +0 -11
  622. package/blockly-rc/demos/mobile/android/app/src/test/java/com/example/blocklywebview/ExampleUnitTest.java +0 -17
  623. package/blockly-rc/demos/mobile/android/build.gradle +0 -27
  624. package/blockly-rc/demos/mobile/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  625. package/blockly-rc/demos/mobile/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  626. package/blockly-rc/demos/mobile/android/gradle.properties +0 -13
  627. package/blockly-rc/demos/mobile/android/gradlew +0 -172
  628. package/blockly-rc/demos/mobile/android/gradlew.bat +0 -84
  629. package/blockly-rc/demos/mobile/android/settings.gradle +0 -1
  630. package/blockly-rc/demos/mobile/html/index.html +0 -31
  631. package/blockly-rc/demos/mobile/html/ln_resources.sh +0 -22
  632. package/blockly-rc/demos/mobile/html/toolbox_standard.js +0 -333
  633. package/blockly-rc/demos/mobile/ios/Blockly WebView/AppDelegate.swift +0 -46
  634. package/blockly-rc/demos/mobile/ios/Blockly WebView/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -98
  635. package/blockly-rc/demos/mobile/ios/Blockly WebView/Assets.xcassets/Contents.json +0 -6
  636. package/blockly-rc/demos/mobile/ios/Blockly WebView/Base.lproj/LaunchScreen.storyboard +0 -25
  637. package/blockly-rc/demos/mobile/ios/Blockly WebView/Base.lproj/Main.storyboard +0 -44
  638. package/blockly-rc/demos/mobile/ios/Blockly WebView/Info.plist +0 -45
  639. package/blockly-rc/demos/mobile/ios/Blockly WebView/ViewController.swift +0 -110
  640. package/blockly-rc/demos/mobile/ios/Blockly WebView.xcodeproj/project.pbxproj +0 -390
  641. package/blockly-rc/demos/mobile/ios/Blockly WebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  642. package/blockly-rc/demos/mobile/ios/Blockly WebView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  643. package/blockly-rc/demos/mobile/ios/cp_resources.sh +0 -21
  644. package/blockly-rc/demos/storage/icon.png +0 -0
  645. package/blockly-rc/demos/storage/index.html +0 -104
  646. package/blockly-rc/generators/dart/dart_generator.ts +0 -321
  647. package/blockly-rc/generators/dart/lists.ts +0 -525
  648. package/blockly-rc/generators/dart/logic.ts +0 -155
  649. package/blockly-rc/generators/dart/loops.ts +0 -217
  650. package/blockly-rc/generators/dart/math.ts +0 -559
  651. package/blockly-rc/generators/dart/procedures.ts +0 -138
  652. package/blockly-rc/generators/dart/text.ts +0 -405
  653. package/blockly-rc/generators/dart/variables.ts +0 -32
  654. package/blockly-rc/generators/dart/variables_dynamic.ts +0 -17
  655. package/blockly-rc/generators/dart.ts +0 -50
  656. package/blockly-rc/generators/javascript/javascript_generator.ts +0 -346
  657. package/blockly-rc/generators/javascript/lists.ts +0 -465
  658. package/blockly-rc/generators/javascript/logic.ts +0 -153
  659. package/blockly-rc/generators/javascript/loops.ts +0 -245
  660. package/blockly-rc/generators/javascript/math.ts +0 -450
  661. package/blockly-rc/generators/javascript/procedures.ts +0 -142
  662. package/blockly-rc/generators/javascript/text.ts +0 -418
  663. package/blockly-rc/generators/javascript/variables.ts +0 -32
  664. package/blockly-rc/generators/javascript/variables_dynamic.ts +0 -17
  665. package/blockly-rc/generators/javascript.ts +0 -46
  666. package/blockly-rc/generators/lua/lists.ts +0 -445
  667. package/blockly-rc/generators/lua/logic.ts +0 -142
  668. package/blockly-rc/generators/lua/loops.ts +0 -192
  669. package/blockly-rc/generators/lua/lua_generator.ts +0 -225
  670. package/blockly-rc/generators/lua/math.ts +0 -473
  671. package/blockly-rc/generators/lua/procedures.ts +0 -144
  672. package/blockly-rc/generators/lua/text.ts +0 -380
  673. package/blockly-rc/generators/lua/variables.ts +0 -31
  674. package/blockly-rc/generators/lua/variables_dynamic.ts +0 -17
  675. package/blockly-rc/generators/lua.ts +0 -44
  676. package/blockly-rc/generators/php/lists.ts +0 -585
  677. package/blockly-rc/generators/php/logic.ts +0 -155
  678. package/blockly-rc/generators/php/loops.ts +0 -218
  679. package/blockly-rc/generators/php/math.ts +0 -408
  680. package/blockly-rc/generators/php/php_generator.ts +0 -320
  681. package/blockly-rc/generators/php/procedures.ts +0 -159
  682. package/blockly-rc/generators/php/text.ts +0 -315
  683. package/blockly-rc/generators/php/variables.ts +0 -32
  684. package/blockly-rc/generators/php/variables_dynamic.ts +0 -17
  685. package/blockly-rc/generators/php.ts +0 -46
  686. package/blockly-rc/generators/python/lists.ts +0 -398
  687. package/blockly-rc/generators/python/logic.ts +0 -148
  688. package/blockly-rc/generators/python/loops.ts +0 -251
  689. package/blockly-rc/generators/python/math.ts +0 -434
  690. package/blockly-rc/generators/python/procedures.ts +0 -159
  691. package/blockly-rc/generators/python/python_generator.ts +0 -355
  692. package/blockly-rc/generators/python/text.ts +0 -338
  693. package/blockly-rc/generators/python/variables.ts +0 -31
  694. package/blockly-rc/generators/python/variables_dynamic.ts +0 -17
  695. package/blockly-rc/generators/python.ts +0 -51
  696. package/blockly-rc/gulpfile.js +0 -54
  697. package/blockly-rc/jsconfig.json +0 -7
  698. package/blockly-rc/media/1x1.gif +0 -0
  699. package/blockly-rc/media/click.mp3 +0 -0
  700. package/blockly-rc/media/click.ogg +0 -0
  701. package/blockly-rc/media/click.wav +0 -0
  702. package/blockly-rc/media/delete-icon.svg +0 -1
  703. package/blockly-rc/media/delete.mp3 +0 -0
  704. package/blockly-rc/media/delete.ogg +0 -0
  705. package/blockly-rc/media/delete.wav +0 -0
  706. package/blockly-rc/media/disconnect.mp3 +0 -0
  707. package/blockly-rc/media/disconnect.ogg +0 -0
  708. package/blockly-rc/media/disconnect.wav +0 -0
  709. package/blockly-rc/media/dropdown-arrow.svg +0 -1
  710. package/blockly-rc/media/foldout-icon.svg +0 -1
  711. package/blockly-rc/media/handclosed.cur +0 -0
  712. package/blockly-rc/media/handdelete.cur +0 -0
  713. package/blockly-rc/media/handopen.cur +0 -0
  714. package/blockly-rc/media/pilcrow.png +0 -0
  715. package/blockly-rc/media/quote0.png +0 -0
  716. package/blockly-rc/media/quote1.png +0 -0
  717. package/blockly-rc/media/resize-handle.svg +0 -3
  718. package/blockly-rc/media/sprites.png +0 -0
  719. package/blockly-rc/media/sprites.svg +0 -74
  720. package/blockly-rc/msg/json/README.md +0 -33
  721. package/blockly-rc/msg/json/ab.json +0 -222
  722. package/blockly-rc/msg/json/ace.json +0 -7
  723. package/blockly-rc/msg/json/af.json +0 -34
  724. package/blockly-rc/msg/json/am.json +0 -30
  725. package/blockly-rc/msg/json/ar.json +0 -355
  726. package/blockly-rc/msg/json/ast.json +0 -10
  727. package/blockly-rc/msg/json/az.json +0 -332
  728. package/blockly-rc/msg/json/ba.json +0 -211
  729. package/blockly-rc/msg/json/bcc.json +0 -290
  730. package/blockly-rc/msg/json/be-tarask.json +0 -334
  731. package/blockly-rc/msg/json/be.json +0 -324
  732. package/blockly-rc/msg/json/bg.json +0 -345
  733. package/blockly-rc/msg/json/bn.json +0 -189
  734. package/blockly-rc/msg/json/br.json +0 -334
  735. package/blockly-rc/msg/json/bs.json +0 -166
  736. package/blockly-rc/msg/json/ca.json +0 -341
  737. package/blockly-rc/msg/json/cdo.json +0 -6
  738. package/blockly-rc/msg/json/ce.json +0 -326
  739. package/blockly-rc/msg/json/constants.json +0 -12
  740. package/blockly-rc/msg/json/cs.json +0 -343
  741. package/blockly-rc/msg/json/da.json +0 -346
  742. package/blockly-rc/msg/json/de.json +0 -369
  743. package/blockly-rc/msg/json/diq.json +0 -258
  744. package/blockly-rc/msg/json/dtp.json +0 -198
  745. package/blockly-rc/msg/json/dty.json +0 -97
  746. package/blockly-rc/msg/json/ee.json +0 -160
  747. package/blockly-rc/msg/json/el.json +0 -356
  748. package/blockly-rc/msg/json/en-gb.json +0 -199
  749. package/blockly-rc/msg/json/en.json +0 -400
  750. package/blockly-rc/msg/json/eo.json +0 -337
  751. package/blockly-rc/msg/json/es.json +0 -358
  752. package/blockly-rc/msg/json/et.json +0 -326
  753. package/blockly-rc/msg/json/eu.json +0 -219
  754. package/blockly-rc/msg/json/fa.json +0 -341
  755. package/blockly-rc/msg/json/fi.json +0 -350
  756. package/blockly-rc/msg/json/fo.json +0 -46
  757. package/blockly-rc/msg/json/fr.json +0 -373
  758. package/blockly-rc/msg/json/frr.json +0 -6
  759. package/blockly-rc/msg/json/gl.json +0 -338
  760. package/blockly-rc/msg/json/gn.json +0 -54
  761. package/blockly-rc/msg/json/gor.json +0 -87
  762. package/blockly-rc/msg/json/ha.json +0 -313
  763. package/blockly-rc/msg/json/hak.json +0 -17
  764. package/blockly-rc/msg/json/he.json +0 -354
  765. package/blockly-rc/msg/json/hi.json +0 -318
  766. package/blockly-rc/msg/json/hr.json +0 -327
  767. package/blockly-rc/msg/json/hrx.json +0 -287
  768. package/blockly-rc/msg/json/hsb.json +0 -128
  769. package/blockly-rc/msg/json/hu.json +0 -349
  770. package/blockly-rc/msg/json/hy.json +0 -337
  771. package/blockly-rc/msg/json/ia.json +0 -337
  772. package/blockly-rc/msg/json/id.json +0 -335
  773. package/blockly-rc/msg/json/ig.json +0 -323
  774. package/blockly-rc/msg/json/inh.json +0 -80
  775. package/blockly-rc/msg/json/is.json +0 -331
  776. package/blockly-rc/msg/json/it.json +0 -346
  777. package/blockly-rc/msg/json/ja.json +0 -361
  778. package/blockly-rc/msg/json/ka.json +0 -14
  779. package/blockly-rc/msg/json/kab.json +0 -323
  780. package/blockly-rc/msg/json/kbd-cyrl.json +0 -84
  781. package/blockly-rc/msg/json/km.json +0 -29
  782. package/blockly-rc/msg/json/kn.json +0 -332
  783. package/blockly-rc/msg/json/ko.json +0 -372
  784. package/blockly-rc/msg/json/ksh.json +0 -43
  785. package/blockly-rc/msg/json/ku-latn.json +0 -41
  786. package/blockly-rc/msg/json/ky.json +0 -71
  787. package/blockly-rc/msg/json/la.json +0 -6
  788. package/blockly-rc/msg/json/lb.json +0 -156
  789. package/blockly-rc/msg/json/lki.json +0 -282
  790. package/blockly-rc/msg/json/lo.json +0 -92
  791. package/blockly-rc/msg/json/lrc.json +0 -123
  792. package/blockly-rc/msg/json/lt.json +0 -321
  793. package/blockly-rc/msg/json/lv.json +0 -324
  794. package/blockly-rc/msg/json/mg.json +0 -58
  795. package/blockly-rc/msg/json/mk.json +0 -178
  796. package/blockly-rc/msg/json/ml.json +0 -35
  797. package/blockly-rc/msg/json/mnw.json +0 -90
  798. package/blockly-rc/msg/json/ms.json +0 -300
  799. package/blockly-rc/msg/json/my.json +0 -57
  800. package/blockly-rc/msg/json/mzn.json +0 -6
  801. package/blockly-rc/msg/json/nb.json +0 -330
  802. package/blockly-rc/msg/json/ne.json +0 -247
  803. package/blockly-rc/msg/json/nl.json +0 -357
  804. package/blockly-rc/msg/json/oc.json +0 -194
  805. package/blockly-rc/msg/json/olo.json +0 -37
  806. package/blockly-rc/msg/json/pa.json +0 -69
  807. package/blockly-rc/msg/json/pl.json +0 -357
  808. package/blockly-rc/msg/json/pms.json +0 -324
  809. package/blockly-rc/msg/json/ps.json +0 -50
  810. package/blockly-rc/msg/json/pt-br.json +0 -369
  811. package/blockly-rc/msg/json/pt.json +0 -358
  812. package/blockly-rc/msg/json/qqq.json +0 -406
  813. package/blockly-rc/msg/json/ro.json +0 -333
  814. package/blockly-rc/msg/json/ru.json +0 -363
  815. package/blockly-rc/msg/json/sc.json +0 -283
  816. package/blockly-rc/msg/json/sco.json +0 -11
  817. package/blockly-rc/msg/json/sd.json +0 -158
  818. package/blockly-rc/msg/json/shn.json +0 -109
  819. package/blockly-rc/msg/json/si.json +0 -16
  820. package/blockly-rc/msg/json/sk.json +0 -332
  821. package/blockly-rc/msg/json/skr-arab.json +0 -117
  822. package/blockly-rc/msg/json/sl.json +0 -355
  823. package/blockly-rc/msg/json/smn.json +0 -133
  824. package/blockly-rc/msg/json/sq.json +0 -343
  825. package/blockly-rc/msg/json/sr-latn.json +0 -324
  826. package/blockly-rc/msg/json/sr.json +0 -348
  827. package/blockly-rc/msg/json/sv.json +0 -347
  828. package/blockly-rc/msg/json/sw.json +0 -12
  829. package/blockly-rc/msg/json/synonyms.json +0 -22
  830. package/blockly-rc/msg/json/ta.json +0 -306
  831. package/blockly-rc/msg/json/tcy.json +0 -316
  832. package/blockly-rc/msg/json/tdd.json +0 -109
  833. package/blockly-rc/msg/json/te.json +0 -101
  834. package/blockly-rc/msg/json/th.json +0 -333
  835. package/blockly-rc/msg/json/ti.json +0 -50
  836. package/blockly-rc/msg/json/tl.json +0 -129
  837. package/blockly-rc/msg/json/tlh.json +0 -179
  838. package/blockly-rc/msg/json/tr.json +0 -369
  839. package/blockly-rc/msg/json/ug-arab.json +0 -132
  840. package/blockly-rc/msg/json/uk.json +0 -345
  841. package/blockly-rc/msg/json/ur.json +0 -117
  842. package/blockly-rc/msg/json/uz.json +0 -36
  843. package/blockly-rc/msg/json/vi.json +0 -345
  844. package/blockly-rc/msg/json/xmf.json +0 -96
  845. package/blockly-rc/msg/json/yo.json +0 -316
  846. package/blockly-rc/msg/json/zgh.json +0 -83
  847. package/blockly-rc/msg/json/zh-hans.json +0 -372
  848. package/blockly-rc/msg/json/zh-hant.json +0 -362
  849. package/blockly-rc/msg/messages.js +0 -1616
  850. package/blockly-rc/package-lock.json +0 -12324
  851. package/blockly-rc/package.json +0 -149
  852. package/blockly-rc/patches/@microsoft+api-documenter+7.22.4.patch +0 -81
  853. package/blockly-rc/scripts/goog_module/convert-file.sh +0 -406
  854. package/blockly-rc/scripts/gulpfiles/appengine_tasks.js +0 -195
  855. package/blockly-rc/scripts/gulpfiles/build_tasks.js +0 -752
  856. package/blockly-rc/scripts/gulpfiles/config.js +0 -41
  857. package/blockly-rc/scripts/gulpfiles/docs_tasks.js +0 -147
  858. package/blockly-rc/scripts/gulpfiles/git_tasks.js +0 -181
  859. package/blockly-rc/scripts/gulpfiles/helper_tasks.js +0 -19
  860. package/blockly-rc/scripts/gulpfiles/package_tasks.js +0 -262
  861. package/blockly-rc/scripts/gulpfiles/release_tasks.js +0 -183
  862. package/blockly-rc/scripts/gulpfiles/test_tasks.js +0 -405
  863. package/blockly-rc/scripts/helpers.js +0 -74
  864. package/blockly-rc/scripts/i18n/common.py +0 -233
  865. package/blockly-rc/scripts/i18n/create_messages.py +0 -167
  866. package/blockly-rc/scripts/i18n/dedup_json.py +0 -72
  867. package/blockly-rc/scripts/i18n/js_to_json.py +0 -135
  868. package/blockly-rc/scripts/i18n/tests.py +0 -46
  869. package/blockly-rc/scripts/migration/cjs2esm +0 -162
  870. package/blockly-rc/scripts/migration/js2ts +0 -168
  871. package/blockly-rc/scripts/migration/renamings.json5 +0 -1599
  872. package/blockly-rc/scripts/package/README.md +0 -93
  873. package/blockly-rc/scripts/package/core-node.js +0 -31
  874. package/blockly-rc/scripts/package/index.js +0 -23
  875. package/blockly-rc/scripts/package/templates/umd-msg.template +0 -16
  876. package/blockly-rc/scripts/package/templates/umd.template +0 -13
  877. package/blockly-rc/scripts/themes/blockStyles_example.json +0 -11
  878. package/blockly-rc/scripts/themes/create_blockStyles.py +0 -181
  879. package/blockly-rc/scripts/tsick.js +0 -86
  880. package/blockly-rc/tests/.eslintrc.json +0 -10
  881. package/blockly-rc/tests/browser/.eslintrc.json +0 -29
  882. package/blockly-rc/tests/browser/.mocharc.js +0 -6
  883. package/blockly-rc/tests/browser/test/basic_block_factory_test.mjs +0 -44
  884. package/blockly-rc/tests/browser/test/basic_block_test.mjs +0 -39
  885. package/blockly-rc/tests/browser/test/basic_playground_test.mjs +0 -198
  886. package/blockly-rc/tests/browser/test/block_undo_test.mjs +0 -50
  887. package/blockly-rc/tests/browser/test/delete_blocks_test.mjs +0 -211
  888. package/blockly-rc/tests/browser/test/extensive_test.mjs +0 -195
  889. package/blockly-rc/tests/browser/test/field_edits_test.mjs +0 -61
  890. package/blockly-rc/tests/browser/test/hooks.mjs +0 -23
  891. package/blockly-rc/tests/browser/test/mutator_test.mjs +0 -88
  892. package/blockly-rc/tests/browser/test/procedure_test.mjs +0 -109
  893. package/blockly-rc/tests/browser/test/test_setup.mjs +0 -589
  894. package/blockly-rc/tests/browser/test/toolbox_drag_test.mjs +0 -207
  895. package/blockly-rc/tests/browser/test/workspace_comment_test.mjs +0 -224
  896. package/blockly-rc/tests/compile/index.html +0 -43
  897. package/blockly-rc/tests/compile/main.js +0 -53
  898. package/blockly-rc/tests/compile/test_blocks.js +0 -47
  899. package/blockly-rc/tests/compile/webdriver.js +0 -81
  900. package/blockly-rc/tests/generators/functions.xml +0 -561
  901. package/blockly-rc/tests/generators/golden/generated.dart +0 -1604
  902. package/blockly-rc/tests/generators/golden/generated.js +0 -1552
  903. package/blockly-rc/tests/generators/golden/generated.lua +0 -1828
  904. package/blockly-rc/tests/generators/golden/generated.php +0 -1611
  905. package/blockly-rc/tests/generators/golden/generated.py +0 -1407
  906. package/blockly-rc/tests/generators/index.html +0 -405
  907. package/blockly-rc/tests/generators/lists.xml +0 -8675
  908. package/blockly-rc/tests/generators/logic.xml +0 -1019
  909. package/blockly-rc/tests/generators/loops1.xml +0 -345
  910. package/blockly-rc/tests/generators/loops2.xml +0 -891
  911. package/blockly-rc/tests/generators/loops3.xml +0 -735
  912. package/blockly-rc/tests/generators/math.xml +0 -2077
  913. package/blockly-rc/tests/generators/text.xml +0 -4651
  914. package/blockly-rc/tests/generators/unittest.js +0 -103
  915. package/blockly-rc/tests/generators/unittest_dart.js +0 -163
  916. package/blockly-rc/tests/generators/unittest_javascript.js +0 -167
  917. package/blockly-rc/tests/generators/unittest_lua.js +0 -165
  918. package/blockly-rc/tests/generators/unittest_php.js +0 -154
  919. package/blockly-rc/tests/generators/unittest_python.js +0 -138
  920. package/blockly-rc/tests/generators/variables.xml +0 -68
  921. package/blockly-rc/tests/generators/webdriver.js +0 -123
  922. package/blockly-rc/tests/media/200px.png +0 -0
  923. package/blockly-rc/tests/media/30px.png +0 -0
  924. package/blockly-rc/tests/media/50px.png +0 -0
  925. package/blockly-rc/tests/media/a.png +0 -0
  926. package/blockly-rc/tests/media/arrow.png +0 -0
  927. package/blockly-rc/tests/media/b.png +0 -0
  928. package/blockly-rc/tests/media/c.png +0 -0
  929. package/blockly-rc/tests/media/d.png +0 -0
  930. package/blockly-rc/tests/media/e.png +0 -0
  931. package/blockly-rc/tests/media/f.png +0 -0
  932. package/blockly-rc/tests/media/g.png +0 -0
  933. package/blockly-rc/tests/media/h.png +0 -0
  934. package/blockly-rc/tests/media/i.png +0 -0
  935. package/blockly-rc/tests/media/j.png +0 -0
  936. package/blockly-rc/tests/media/k.png +0 -0
  937. package/blockly-rc/tests/media/l.png +0 -0
  938. package/blockly-rc/tests/media/m.png +0 -0
  939. package/blockly-rc/tests/migration/renamings.schema.json +0 -59
  940. package/blockly-rc/tests/migration/validate-renamings.mjs +0 -60
  941. package/blockly-rc/tests/mocha/.eslintrc.json +0 -21
  942. package/blockly-rc/tests/mocha/.mocharc.js +0 -6
  943. package/blockly-rc/tests/mocha/astnode_test.js +0 -850
  944. package/blockly-rc/tests/mocha/block_json_test.js +0 -777
  945. package/blockly-rc/tests/mocha/block_test.js +0 -2743
  946. package/blockly-rc/tests/mocha/blocks/lists_test.js +0 -196
  947. package/blockly-rc/tests/mocha/blocks/logic_ternary_test.js +0 -320
  948. package/blockly-rc/tests/mocha/blocks/loops_test.js +0 -56
  949. package/blockly-rc/tests/mocha/blocks/procedures_test.js +0 -2495
  950. package/blockly-rc/tests/mocha/blocks/variables_test.js +0 -311
  951. package/blockly-rc/tests/mocha/clipboard_test.js +0 -136
  952. package/blockly-rc/tests/mocha/comment_deserialization_test.js +0 -122
  953. package/blockly-rc/tests/mocha/comment_test.js +0 -170
  954. package/blockly-rc/tests/mocha/comment_view_test.js +0 -188
  955. package/blockly-rc/tests/mocha/connection_checker_test.js +0 -666
  956. package/blockly-rc/tests/mocha/connection_db_test.js +0 -362
  957. package/blockly-rc/tests/mocha/connection_test.js +0 -3738
  958. package/blockly-rc/tests/mocha/contextmenu_items_test.js +0 -488
  959. package/blockly-rc/tests/mocha/contextmenu_test.js +0 -71
  960. package/blockly-rc/tests/mocha/cursor_test.js +0 -134
  961. package/blockly-rc/tests/mocha/dropdowndiv_test.js +0 -116
  962. package/blockly-rc/tests/mocha/event_block_change_test.js +0 -126
  963. package/blockly-rc/tests/mocha/event_block_create_test.js +0 -109
  964. package/blockly-rc/tests/mocha/event_block_delete_test.js +0 -55
  965. package/blockly-rc/tests/mocha/event_block_drag_test.js +0 -36
  966. package/blockly-rc/tests/mocha/event_block_field_intermediate_change_test.js +0 -67
  967. package/blockly-rc/tests/mocha/event_block_move_test.js +0 -39
  968. package/blockly-rc/tests/mocha/event_bubble_open_test.js +0 -42
  969. package/blockly-rc/tests/mocha/event_click_test.js +0 -40
  970. package/blockly-rc/tests/mocha/event_comment_change_test.js +0 -39
  971. package/blockly-rc/tests/mocha/event_comment_collapse_test.js +0 -34
  972. package/blockly-rc/tests/mocha/event_comment_create_test.js +0 -38
  973. package/blockly-rc/tests/mocha/event_comment_delete_test.js +0 -38
  974. package/blockly-rc/tests/mocha/event_comment_drag_test.js +0 -35
  975. package/blockly-rc/tests/mocha/event_comment_move_test.js +0 -40
  976. package/blockly-rc/tests/mocha/event_comment_resize_test.js +0 -38
  977. package/blockly-rc/tests/mocha/event_marker_move_test.js +0 -44
  978. package/blockly-rc/tests/mocha/event_selected_test.js +0 -41
  979. package/blockly-rc/tests/mocha/event_test.js +0 -1578
  980. package/blockly-rc/tests/mocha/event_theme_change_test.js +0 -36
  981. package/blockly-rc/tests/mocha/event_toolbox_item_select_test.js +0 -64
  982. package/blockly-rc/tests/mocha/event_trashcan_open_test.js +0 -36
  983. package/blockly-rc/tests/mocha/event_var_create_test.js +0 -54
  984. package/blockly-rc/tests/mocha/event_var_delete_test.js +0 -54
  985. package/blockly-rc/tests/mocha/event_var_rename_test.js +0 -39
  986. package/blockly-rc/tests/mocha/event_var_type_change_test.js +0 -43
  987. package/blockly-rc/tests/mocha/event_viewport_test.js +0 -39
  988. package/blockly-rc/tests/mocha/extensions_test.js +0 -613
  989. package/blockly-rc/tests/mocha/field_checkbox_test.js +0 -299
  990. package/blockly-rc/tests/mocha/field_colour_test.js +0 -395
  991. package/blockly-rc/tests/mocha/field_dropdown_test.js +0 -282
  992. package/blockly-rc/tests/mocha/field_image_test.js +0 -241
  993. package/blockly-rc/tests/mocha/field_label_serializable_test.js +0 -252
  994. package/blockly-rc/tests/mocha/field_label_test.js +0 -226
  995. package/blockly-rc/tests/mocha/field_number_test.js +0 -505
  996. package/blockly-rc/tests/mocha/field_registry_test.js +0 -116
  997. package/blockly-rc/tests/mocha/field_test.js +0 -822
  998. package/blockly-rc/tests/mocha/field_textinput_test.js +0 -297
  999. package/blockly-rc/tests/mocha/field_variable_test.js +0 -611
  1000. package/blockly-rc/tests/mocha/flyout_test.js +0 -638
  1001. package/blockly-rc/tests/mocha/generator_test.js +0 -233
  1002. package/blockly-rc/tests/mocha/gesture_test.js +0 -97
  1003. package/blockly-rc/tests/mocha/icon_test.js +0 -369
  1004. package/blockly-rc/tests/mocha/index.html +0 -229
  1005. package/blockly-rc/tests/mocha/input_test.js +0 -296
  1006. package/blockly-rc/tests/mocha/insertion_marker_manager_test.js +0 -443
  1007. package/blockly-rc/tests/mocha/insertion_marker_test.js +0 -432
  1008. package/blockly-rc/tests/mocha/jso_deserialization_test.js +0 -849
  1009. package/blockly-rc/tests/mocha/jso_serialization_test.js +0 -1067
  1010. package/blockly-rc/tests/mocha/json_test.js +0 -315
  1011. package/blockly-rc/tests/mocha/keydown_test.js +0 -364
  1012. package/blockly-rc/tests/mocha/layering_test.js +0 -95
  1013. package/blockly-rc/tests/mocha/metrics_test.js +0 -671
  1014. package/blockly-rc/tests/mocha/mutator_test.js +0 -87
  1015. package/blockly-rc/tests/mocha/names_test.js +0 -97
  1016. package/blockly-rc/tests/mocha/old_workspace_comment_test.js +0 -256
  1017. package/blockly-rc/tests/mocha/procedure_map_test.js +0 -57
  1018. package/blockly-rc/tests/mocha/registry_test.js +0 -281
  1019. package/blockly-rc/tests/mocha/render_management_test.js +0 -127
  1020. package/blockly-rc/tests/mocha/serializer_test.js +0 -2104
  1021. package/blockly-rc/tests/mocha/shortcut_registry_test.js +0 -450
  1022. package/blockly-rc/tests/mocha/test_helpers/block_definitions.js +0 -204
  1023. package/blockly-rc/tests/mocha/test_helpers/code_generation.js +0 -115
  1024. package/blockly-rc/tests/mocha/test_helpers/common.js +0 -106
  1025. package/blockly-rc/tests/mocha/test_helpers/events.js +0 -290
  1026. package/blockly-rc/tests/mocha/test_helpers/fields.js +0 -310
  1027. package/blockly-rc/tests/mocha/test_helpers/icon_mocks.js +0 -81
  1028. package/blockly-rc/tests/mocha/test_helpers/procedures.js +0 -302
  1029. package/blockly-rc/tests/mocha/test_helpers/serialization.js +0 -124
  1030. package/blockly-rc/tests/mocha/test_helpers/setup_teardown.js +0 -209
  1031. package/blockly-rc/tests/mocha/test_helpers/toolbox_definitions.js +0 -271
  1032. package/blockly-rc/tests/mocha/test_helpers/user_input.js +0 -62
  1033. package/blockly-rc/tests/mocha/test_helpers/variables.js +0 -23
  1034. package/blockly-rc/tests/mocha/test_helpers/warnings.js +0 -83
  1035. package/blockly-rc/tests/mocha/test_helpers/workspace.js +0 -1691
  1036. package/blockly-rc/tests/mocha/theme_test.js +0 -307
  1037. package/blockly-rc/tests/mocha/toolbox_test.js +0 -761
  1038. package/blockly-rc/tests/mocha/tooltip_test.js +0 -276
  1039. package/blockly-rc/tests/mocha/touch_test.js +0 -109
  1040. package/blockly-rc/tests/mocha/trashcan_test.js +0 -375
  1041. package/blockly-rc/tests/mocha/utils_test.js +0 -536
  1042. package/blockly-rc/tests/mocha/variable_map_test.js +0 -509
  1043. package/blockly-rc/tests/mocha/variable_model_test.js +0 -85
  1044. package/blockly-rc/tests/mocha/webdriver.js +0 -96
  1045. package/blockly-rc/tests/mocha/widget_div_test.js +0 -272
  1046. package/blockly-rc/tests/mocha/workspace_comment_test.js +0 -171
  1047. package/blockly-rc/tests/mocha/workspace_svg_test.js +0 -414
  1048. package/blockly-rc/tests/mocha/workspace_test.js +0 -27
  1049. package/blockly-rc/tests/mocha/xml_test.js +0 -951
  1050. package/blockly-rc/tests/mocha/zoom_controls_test.js +0 -81
  1051. package/blockly-rc/tests/multi_playground.html +0 -482
  1052. package/blockly-rc/tests/node/.eslintrc.json +0 -12
  1053. package/blockly-rc/tests/node/.mocharc.js +0 -6
  1054. package/blockly-rc/tests/node/run_node_test.mjs +0 -72
  1055. package/blockly-rc/tests/playground.html +0 -1280
  1056. package/blockly-rc/tests/playgrounds/advanced_playground.html +0 -158
  1057. package/blockly-rc/tests/playgrounds/iframe.html +0 -40
  1058. package/blockly-rc/tests/playgrounds/screenshot.js +0 -123
  1059. package/blockly-rc/tests/scripts/check_metadata.sh +0 -166
  1060. package/blockly-rc/tests/scripts/compile_typings.sh +0 -32
  1061. package/blockly-rc/tests/scripts/load.mjs +0 -140
  1062. package/blockly-rc/tests/scripts/setup_linux_env.sh +0 -7
  1063. package/blockly-rc/tests/scripts/update_metadata.sh +0 -46
  1064. package/blockly-rc/tests/themes/test_themes.js +0 -62
  1065. package/blockly-rc/tests/typescript/README.md +0 -4
  1066. package/blockly-rc/tests/typescript/src/field/different_user_input.ts +0 -81
  1067. package/blockly-rc/tests/typescript/src/generators/dart.ts +0 -24
  1068. package/blockly-rc/tests/typescript/src/generators/javascript.ts +0 -28
  1069. package/blockly-rc/tests/typescript/src/generators/lua.ts +0 -24
  1070. package/blockly-rc/tests/typescript/src/generators/php.ts +0 -24
  1071. package/blockly-rc/tests/typescript/src/generators/python.ts +0 -24
  1072. package/blockly-rc/tests/typescript/src/generators.ts +0 -31
  1073. package/blockly-rc/tests/typescript/src/msg.ts +0 -20
  1074. package/blockly-rc/tests/typescript/tsconfig.json +0 -20
  1075. package/blockly-rc/tests/xml/README.txt +0 -11
  1076. package/blockly-rc/tests/xml/blockly.xsd +0 -178
  1077. package/blockly-rc/tests/xml/invalid.xml +0 -6
  1078. package/blockly-rc/tests/xml/toolbox.xml +0 -311
  1079. package/blockly-rc/tests/xml/workspace.xml +0 -114
  1080. package/blockly-rc/tsconfig.json +0 -37
  1081. package/blockly-rc/tsdoc.json +0 -35
  1082. package/blockly-rc/typings/README.md +0 -5
  1083. package/blockly-rc/typings/blocks.d.ts +0 -17
  1084. package/blockly-rc/typings/core.d.ts +0 -7
  1085. package/blockly-rc/typings/dart.d.ts +0 -7
  1086. package/blockly-rc/typings/index.d.ts +0 -10
  1087. package/blockly-rc/typings/javascript.d.ts +0 -7
  1088. package/blockly-rc/typings/lua.d.ts +0 -7
  1089. package/blockly-rc/typings/msg/ab.d.ts +0 -8
  1090. package/blockly-rc/typings/msg/ace.d.ts +0 -8
  1091. package/blockly-rc/typings/msg/af.d.ts +0 -8
  1092. package/blockly-rc/typings/msg/am.d.ts +0 -8
  1093. package/blockly-rc/typings/msg/ar.d.ts +0 -8
  1094. package/blockly-rc/typings/msg/ast.d.ts +0 -8
  1095. package/blockly-rc/typings/msg/az.d.ts +0 -8
  1096. package/blockly-rc/typings/msg/ba.d.ts +0 -8
  1097. package/blockly-rc/typings/msg/bcc.d.ts +0 -8
  1098. package/blockly-rc/typings/msg/be-tarask.d.ts +0 -8
  1099. package/blockly-rc/typings/msg/be.d.ts +0 -8
  1100. package/blockly-rc/typings/msg/bg.d.ts +0 -8
  1101. package/blockly-rc/typings/msg/bn.d.ts +0 -8
  1102. package/blockly-rc/typings/msg/br.d.ts +0 -8
  1103. package/blockly-rc/typings/msg/bs.d.ts +0 -8
  1104. package/blockly-rc/typings/msg/ca.d.ts +0 -8
  1105. package/blockly-rc/typings/msg/cdo.d.ts +0 -8
  1106. package/blockly-rc/typings/msg/ce.d.ts +0 -8
  1107. package/blockly-rc/typings/msg/cs.d.ts +0 -8
  1108. package/blockly-rc/typings/msg/da.d.ts +0 -8
  1109. package/blockly-rc/typings/msg/de.d.ts +0 -8
  1110. package/blockly-rc/typings/msg/diq.d.ts +0 -8
  1111. package/blockly-rc/typings/msg/dtp.d.ts +0 -8
  1112. package/blockly-rc/typings/msg/dty.d.ts +0 -8
  1113. package/blockly-rc/typings/msg/ee.d.ts +0 -8
  1114. package/blockly-rc/typings/msg/el.d.ts +0 -8
  1115. package/blockly-rc/typings/msg/en-gb.d.ts +0 -8
  1116. package/blockly-rc/typings/msg/en.d.ts +0 -8
  1117. package/blockly-rc/typings/msg/eo.d.ts +0 -8
  1118. package/blockly-rc/typings/msg/es.d.ts +0 -8
  1119. package/blockly-rc/typings/msg/et.d.ts +0 -8
  1120. package/blockly-rc/typings/msg/eu.d.ts +0 -8
  1121. package/blockly-rc/typings/msg/fa.d.ts +0 -8
  1122. package/blockly-rc/typings/msg/fi.d.ts +0 -8
  1123. package/blockly-rc/typings/msg/fo.d.ts +0 -8
  1124. package/blockly-rc/typings/msg/fr.d.ts +0 -8
  1125. package/blockly-rc/typings/msg/frr.d.ts +0 -8
  1126. package/blockly-rc/typings/msg/gl.d.ts +0 -8
  1127. package/blockly-rc/typings/msg/gn.d.ts +0 -8
  1128. package/blockly-rc/typings/msg/gor.d.ts +0 -8
  1129. package/blockly-rc/typings/msg/ha.d.ts +0 -8
  1130. package/blockly-rc/typings/msg/hak.d.ts +0 -8
  1131. package/blockly-rc/typings/msg/he.d.ts +0 -8
  1132. package/blockly-rc/typings/msg/hi.d.ts +0 -8
  1133. package/blockly-rc/typings/msg/hr.d.ts +0 -8
  1134. package/blockly-rc/typings/msg/hrx.d.ts +0 -8
  1135. package/blockly-rc/typings/msg/hsb.d.ts +0 -8
  1136. package/blockly-rc/typings/msg/hu.d.ts +0 -8
  1137. package/blockly-rc/typings/msg/hy.d.ts +0 -8
  1138. package/blockly-rc/typings/msg/ia.d.ts +0 -8
  1139. package/blockly-rc/typings/msg/id.d.ts +0 -8
  1140. package/blockly-rc/typings/msg/ig.d.ts +0 -8
  1141. package/blockly-rc/typings/msg/inh.d.ts +0 -8
  1142. package/blockly-rc/typings/msg/is.d.ts +0 -8
  1143. package/blockly-rc/typings/msg/it.d.ts +0 -8
  1144. package/blockly-rc/typings/msg/ja.d.ts +0 -8
  1145. package/blockly-rc/typings/msg/ka.d.ts +0 -8
  1146. package/blockly-rc/typings/msg/kab.d.ts +0 -8
  1147. package/blockly-rc/typings/msg/kbd-cyrl.d.ts +0 -8
  1148. package/blockly-rc/typings/msg/km.d.ts +0 -8
  1149. package/blockly-rc/typings/msg/kn.d.ts +0 -8
  1150. package/blockly-rc/typings/msg/ko.d.ts +0 -8
  1151. package/blockly-rc/typings/msg/ksh.d.ts +0 -8
  1152. package/blockly-rc/typings/msg/ku-latn.d.ts +0 -8
  1153. package/blockly-rc/typings/msg/ky.d.ts +0 -8
  1154. package/blockly-rc/typings/msg/la.d.ts +0 -8
  1155. package/blockly-rc/typings/msg/lb.d.ts +0 -8
  1156. package/blockly-rc/typings/msg/lki.d.ts +0 -8
  1157. package/blockly-rc/typings/msg/lo.d.ts +0 -8
  1158. package/blockly-rc/typings/msg/lrc.d.ts +0 -8
  1159. package/blockly-rc/typings/msg/lt.d.ts +0 -8
  1160. package/blockly-rc/typings/msg/lv.d.ts +0 -8
  1161. package/blockly-rc/typings/msg/mg.d.ts +0 -8
  1162. package/blockly-rc/typings/msg/mk.d.ts +0 -8
  1163. package/blockly-rc/typings/msg/ml.d.ts +0 -8
  1164. package/blockly-rc/typings/msg/mnw.d.ts +0 -8
  1165. package/blockly-rc/typings/msg/ms.d.ts +0 -8
  1166. package/blockly-rc/typings/msg/msg.d.ts +0 -440
  1167. package/blockly-rc/typings/msg/my.d.ts +0 -8
  1168. package/blockly-rc/typings/msg/mzn.d.ts +0 -8
  1169. package/blockly-rc/typings/msg/nb.d.ts +0 -8
  1170. package/blockly-rc/typings/msg/ne.d.ts +0 -8
  1171. package/blockly-rc/typings/msg/nl.d.ts +0 -8
  1172. package/blockly-rc/typings/msg/oc.d.ts +0 -8
  1173. package/blockly-rc/typings/msg/olo.d.ts +0 -8
  1174. package/blockly-rc/typings/msg/pa.d.ts +0 -8
  1175. package/blockly-rc/typings/msg/pl.d.ts +0 -8
  1176. package/blockly-rc/typings/msg/pms.d.ts +0 -8
  1177. package/blockly-rc/typings/msg/ps.d.ts +0 -8
  1178. package/blockly-rc/typings/msg/pt-br.d.ts +0 -8
  1179. package/blockly-rc/typings/msg/pt.d.ts +0 -8
  1180. package/blockly-rc/typings/msg/ro.d.ts +0 -8
  1181. package/blockly-rc/typings/msg/ru.d.ts +0 -8
  1182. package/blockly-rc/typings/msg/sc.d.ts +0 -8
  1183. package/blockly-rc/typings/msg/sco.d.ts +0 -8
  1184. package/blockly-rc/typings/msg/sd.d.ts +0 -8
  1185. package/blockly-rc/typings/msg/shn.d.ts +0 -8
  1186. package/blockly-rc/typings/msg/si.d.ts +0 -8
  1187. package/blockly-rc/typings/msg/sk.d.ts +0 -8
  1188. package/blockly-rc/typings/msg/skr-arab.d.ts +0 -8
  1189. package/blockly-rc/typings/msg/sl.d.ts +0 -8
  1190. package/blockly-rc/typings/msg/smn.d.ts +0 -8
  1191. package/blockly-rc/typings/msg/sq.d.ts +0 -8
  1192. package/blockly-rc/typings/msg/sr-latn.d.ts +0 -8
  1193. package/blockly-rc/typings/msg/sr.d.ts +0 -8
  1194. package/blockly-rc/typings/msg/sv.d.ts +0 -8
  1195. package/blockly-rc/typings/msg/sw.d.ts +0 -8
  1196. package/blockly-rc/typings/msg/ta.d.ts +0 -8
  1197. package/blockly-rc/typings/msg/tcy.d.ts +0 -8
  1198. package/blockly-rc/typings/msg/tdd.d.ts +0 -8
  1199. package/blockly-rc/typings/msg/te.d.ts +0 -8
  1200. package/blockly-rc/typings/msg/th.d.ts +0 -8
  1201. package/blockly-rc/typings/msg/ti.d.ts +0 -8
  1202. package/blockly-rc/typings/msg/tl.d.ts +0 -8
  1203. package/blockly-rc/typings/msg/tlh.d.ts +0 -8
  1204. package/blockly-rc/typings/msg/tr.d.ts +0 -8
  1205. package/blockly-rc/typings/msg/ug-arab.d.ts +0 -8
  1206. package/blockly-rc/typings/msg/uk.d.ts +0 -8
  1207. package/blockly-rc/typings/msg/ur.d.ts +0 -8
  1208. package/blockly-rc/typings/msg/uz.d.ts +0 -8
  1209. package/blockly-rc/typings/msg/vi.d.ts +0 -8
  1210. package/blockly-rc/typings/msg/xmf.d.ts +0 -8
  1211. package/blockly-rc/typings/msg/yo.d.ts +0 -8
  1212. package/blockly-rc/typings/msg/zgh.d.ts +0 -8
  1213. package/blockly-rc/typings/msg/zh-hans.d.ts +0 -8
  1214. package/blockly-rc/typings/msg/zh-hant.d.ts +0 -8
  1215. package/blockly-rc/typings/php.d.ts +0 -7
  1216. package/blockly-rc/typings/python.d.ts +0 -7
  1217. package/blockly-rc/typings/templates/blockly-header.template +0 -11
  1218. package/blockly-rc/typings/templates/blockly-interfaces.template +0 -83
  1219. package/blockly-rc/typings/templates/msg.template +0 -15
  1220. package/blockly-rc/typings/tsconfig.json +0 -23
  1221. package/continuous-toolbox.d.ts +0 -1
  1222. package/dist/main.js +0 -2
  1223. package/dist/main.js.LICENSE.txt +0 -163
  1224. package/media/delete-icon.svg +0 -10
  1225. package/media/resize-handle.svg +0 -3
  1226. package/src/block_reporting.js +0 -31
  1227. package/src/blocks/colour.js +0 -56
  1228. package/src/blocks/control.js +0 -492
  1229. package/src/blocks/data.js +0 -690
  1230. package/src/blocks/event.js +0 -305
  1231. package/src/blocks/looks.js +0 -537
  1232. package/src/blocks/math.js +0 -137
  1233. package/src/blocks/matrix.js +0 -47
  1234. package/src/blocks/motion.js +0 -513
  1235. package/src/blocks/note.js +0 -48
  1236. package/src/blocks/operators.js +0 -463
  1237. package/src/blocks/procedures.js +0 -1009
  1238. package/src/blocks/sensing.js +0 -441
  1239. package/src/blocks/sound.js +0 -205
  1240. package/src/blocks/text.js +0 -45
  1241. package/src/blocks/vertical_extensions.js +0 -309
  1242. package/src/categories.js +0 -15
  1243. package/src/checkable_continuous_flyout.js +0 -138
  1244. package/src/checkbox_bubble.js +0 -282
  1245. package/src/colours.js +0 -77
  1246. package/src/constants.js +0 -63
  1247. package/src/context_menu_items.js +0 -150
  1248. package/src/css.js +0 -1197
  1249. package/src/data_category.js +0 -556
  1250. package/src/events/events_block_comment_base.js +0 -35
  1251. package/src/events/events_block_comment_change.js +0 -43
  1252. package/src/events/events_block_comment_collapse.js +0 -43
  1253. package/src/events/events_block_comment_create.js +0 -52
  1254. package/src/events/events_block_comment_delete.js +0 -27
  1255. package/src/events/events_block_comment_move.js +0 -54
  1256. package/src/events/events_block_comment_resize.js +0 -52
  1257. package/src/events/events_block_drag_end.js +0 -33
  1258. package/src/events/events_block_drag_outside.js +0 -30
  1259. package/src/events/events_scratch_variable_create.js +0 -67
  1260. package/src/fields/field_angle.js +0 -433
  1261. package/src/fields/field_colour_slider.js +0 -388
  1262. package/src/fields/field_dropdown.js +0 -42
  1263. package/src/fields/field_matrix.js +0 -634
  1264. package/src/fields/field_note.js +0 -937
  1265. package/src/fields/field_number.js +0 -380
  1266. package/src/fields/field_textinput_removable.js +0 -107
  1267. package/src/fields/field_variable.js +0 -171
  1268. package/src/fields/field_variable_getter.js +0 -109
  1269. package/src/fields/field_vertical_separator.js +0 -139
  1270. package/src/flyout_checkbox_icon.js +0 -88
  1271. package/src/glows.js +0 -98
  1272. package/src/index.ts +0 -137
  1273. package/src/procedures.js +0 -425
  1274. package/src/recyclable_block_flyout_inflater.js +0 -194
  1275. package/src/renderer/bowler_hat.js +0 -17
  1276. package/src/renderer/constants.js +0 -45
  1277. package/src/renderer/drawer.js +0 -51
  1278. package/src/renderer/path_object.js +0 -35
  1279. package/src/renderer/render_info.js +0 -98
  1280. package/src/renderer/renderer.js +0 -74
  1281. package/src/scratch_block_paster.js +0 -46
  1282. package/src/scratch_blocks_utils.js +0 -148
  1283. package/src/scratch_comment_bubble.js +0 -169
  1284. package/src/scratch_comment_icon.js +0 -195
  1285. package/src/scratch_connection_checker.js +0 -29
  1286. package/src/scratch_continuous_category.js +0 -80
  1287. package/src/scratch_continuous_toolbox.js +0 -78
  1288. package/src/scratch_dragger.js +0 -142
  1289. package/src/scratch_variable_map.js +0 -25
  1290. package/src/scratch_variable_model.js +0 -24
  1291. package/src/shadows.js +0 -61
  1292. package/src/status_indicator_label.js +0 -186
  1293. package/src/status_indicator_label_flyout_inflater.js +0 -42
  1294. package/src/variables.js +0 -355
  1295. package/temp-use-blockly-v12-rc.sh +0 -26
  1296. package/tsconfig.json +0 -13
  1297. /package/media/{foldout-icon.svg → comment-arrow-down.svg} +0 -0
@@ -0,0 +1,1732 @@
1
+ /**
2
+ * @license
3
+ * Visual Blocks Editor
4
+ *
5
+ * Copyright 2012 Google Inc.
6
+ * https://developers.google.com/blockly/
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */
20
+
21
+ /**
22
+ * @fileoverview Methods for graphically rendering a block as SVG.
23
+ * @author fraser@google.com (Neil Fraser)
24
+ */
25
+ 'use strict';
26
+
27
+ goog.provide('Blockly.BlockSvg.render');
28
+
29
+ goog.require('Blockly.BlockSvg');
30
+ goog.require('Blockly.scratchBlocksUtils');
31
+ goog.require('Blockly.utils');
32
+
33
+
34
+ // UI constants for rendering blocks.
35
+ /**
36
+ * Grid unit to pixels conversion
37
+ * @const
38
+ */
39
+ Blockly.BlockSvg.GRID_UNIT = 4;
40
+
41
+ /**
42
+ * Horizontal space between elements.
43
+ * @const
44
+ */
45
+ Blockly.BlockSvg.SEP_SPACE_X = 2 * Blockly.BlockSvg.GRID_UNIT;
46
+
47
+ /**
48
+ * Vertical space between elements.
49
+ * @const
50
+ */
51
+ Blockly.BlockSvg.SEP_SPACE_Y = 2 * Blockly.BlockSvg.GRID_UNIT;
52
+
53
+ /**
54
+ * Minimum width of a block.
55
+ * @const
56
+ */
57
+ Blockly.BlockSvg.MIN_BLOCK_X = 16 * Blockly.BlockSvg.GRID_UNIT;
58
+
59
+ /**
60
+ * Minimum width of a block with output (reporters).
61
+ * @const
62
+ */
63
+ Blockly.BlockSvg.MIN_BLOCK_X_OUTPUT = 12 * Blockly.BlockSvg.GRID_UNIT;
64
+
65
+ /**
66
+ * Minimum width of a shadow block with output (single fields).
67
+ * @const
68
+ */
69
+ Blockly.BlockSvg.MIN_BLOCK_X_SHADOW_OUTPUT = 10 * Blockly.BlockSvg.GRID_UNIT;
70
+
71
+ /**
72
+ * Minimum height of a block.
73
+ * @const
74
+ */
75
+ Blockly.BlockSvg.MIN_BLOCK_Y = 12 * Blockly.BlockSvg.GRID_UNIT;
76
+
77
+ /**
78
+ * Height of extra row after a statement input.
79
+ * @const
80
+ */
81
+ Blockly.BlockSvg.EXTRA_STATEMENT_ROW_Y = 8 * Blockly.BlockSvg.GRID_UNIT;
82
+
83
+ /**
84
+ * Minimum width of a C- or E-shaped block.
85
+ * @const
86
+ */
87
+ Blockly.BlockSvg.MIN_BLOCK_X_WITH_STATEMENT = 40 * Blockly.BlockSvg.GRID_UNIT;
88
+
89
+ /**
90
+ * Minimum height of a shadow block with output and a single field.
91
+ * This is used for shadow blocks that only contain a field - which are smaller than even reporters.
92
+ * @const
93
+ */
94
+ Blockly.BlockSvg.MIN_BLOCK_Y_SINGLE_FIELD_OUTPUT = 8 * Blockly.BlockSvg.GRID_UNIT;
95
+
96
+ /**
97
+ * Minimum height of a non-shadow block with output, i.e. a reporter.
98
+ * @const
99
+ */
100
+ Blockly.BlockSvg.MIN_BLOCK_Y_REPORTER = 10 * Blockly.BlockSvg.GRID_UNIT;
101
+
102
+ /**
103
+ * Minimum space for a statement input height.
104
+ * @const
105
+ */
106
+ Blockly.BlockSvg.MIN_STATEMENT_INPUT_HEIGHT = 6 * Blockly.BlockSvg.GRID_UNIT;
107
+
108
+ /**
109
+ * Width of vertical notch.
110
+ * @const
111
+ */
112
+ Blockly.BlockSvg.NOTCH_WIDTH = 8 * Blockly.BlockSvg.GRID_UNIT;
113
+
114
+ /**
115
+ * Height of vertical notch.
116
+ * @const
117
+ */
118
+ Blockly.BlockSvg.NOTCH_HEIGHT = 2 * Blockly.BlockSvg.GRID_UNIT;
119
+
120
+ /**
121
+ * Rounded corner radius.
122
+ * @const
123
+ */
124
+ Blockly.BlockSvg.CORNER_RADIUS = 1 * Blockly.BlockSvg.GRID_UNIT;
125
+
126
+ /**
127
+ * Minimum width of statement input edge on the left, in px.
128
+ * @const
129
+ */
130
+ Blockly.BlockSvg.STATEMENT_INPUT_EDGE_WIDTH = 4 * Blockly.BlockSvg.GRID_UNIT;
131
+
132
+ /**
133
+ * Inner space between edge of statement input and notch.
134
+ * @const
135
+ */
136
+ Blockly.BlockSvg.STATEMENT_INPUT_INNER_SPACE = 2 * Blockly.BlockSvg.GRID_UNIT;
137
+
138
+ /**
139
+ * Height of the top hat.
140
+ * @const
141
+ */
142
+ Blockly.BlockSvg.START_HAT_HEIGHT = 16;
143
+
144
+ /**
145
+ * Height of the vertical separator line for icons that appear at the left edge
146
+ * of a block, such as extension icons.
147
+ * @const
148
+ */
149
+ Blockly.BlockSvg.ICON_SEPARATOR_HEIGHT = 10 * Blockly.BlockSvg.GRID_UNIT;
150
+
151
+ /**
152
+ * Path of the top hat's curve.
153
+ * @const
154
+ */
155
+ Blockly.BlockSvg.START_HAT_PATH = 'c 25,-22 71,-22 96,0';
156
+
157
+ /**
158
+ * SVG path for drawing next/previous notch from left to right.
159
+ * @const
160
+ */
161
+ Blockly.BlockSvg.NOTCH_PATH_LEFT = (
162
+ 'c 2,0 3,1 4,2 ' +
163
+ 'l 4,4 ' +
164
+ 'c 1,1 2,2 4,2 ' +
165
+ 'h 12 ' +
166
+ 'c 2,0 3,-1 4,-2 ' +
167
+ 'l 4,-4 ' +
168
+ 'c 1,-1 2,-2 4,-2'
169
+ );
170
+
171
+ /**
172
+ * SVG path for drawing next/previous notch from right to left.
173
+ * @const
174
+ */
175
+ Blockly.BlockSvg.NOTCH_PATH_RIGHT = (
176
+ 'c -2,0 -3,1 -4,2 ' +
177
+ 'l -4,4 ' +
178
+ 'c -1,1 -2,2 -4,2 ' +
179
+ 'h -12 ' +
180
+ 'c -2,0 -3,-1 -4,-2 ' +
181
+ 'l -4,-4 ' +
182
+ 'c -1,-1 -2,-2 -4,-2'
183
+ );
184
+
185
+ /**
186
+ * Amount of padding before the notch.
187
+ * @const
188
+ */
189
+ Blockly.BlockSvg.NOTCH_START_PADDING = 3 * Blockly.BlockSvg.GRID_UNIT;
190
+
191
+ /**
192
+ * SVG start point for drawing the top-left corner.
193
+ * @const
194
+ */
195
+ Blockly.BlockSvg.TOP_LEFT_CORNER_START =
196
+ 'm 0,' + Blockly.BlockSvg.CORNER_RADIUS;
197
+
198
+ /**
199
+ * SVG path for drawing the rounded top-left corner.
200
+ * @const
201
+ */
202
+ Blockly.BlockSvg.TOP_LEFT_CORNER =
203
+ 'A ' + Blockly.BlockSvg.CORNER_RADIUS + ',' +
204
+ Blockly.BlockSvg.CORNER_RADIUS + ' 0 0,1 ' +
205
+ Blockly.BlockSvg.CORNER_RADIUS + ',0';
206
+
207
+ /**
208
+ * SVG path for drawing the rounded top-right corner.
209
+ * @const
210
+ */
211
+ Blockly.BlockSvg.TOP_RIGHT_CORNER =
212
+ 'a ' + Blockly.BlockSvg.CORNER_RADIUS + ',' +
213
+ Blockly.BlockSvg.CORNER_RADIUS + ' 0 0,1 ' +
214
+ Blockly.BlockSvg.CORNER_RADIUS + ',' +
215
+ Blockly.BlockSvg.CORNER_RADIUS;
216
+
217
+ /**
218
+ * SVG path for drawing the rounded bottom-right corner.
219
+ * @const
220
+ */
221
+ Blockly.BlockSvg.BOTTOM_RIGHT_CORNER =
222
+ ' a ' + Blockly.BlockSvg.CORNER_RADIUS + ',' +
223
+ Blockly.BlockSvg.CORNER_RADIUS + ' 0 0,1 -' +
224
+ Blockly.BlockSvg.CORNER_RADIUS + ',' +
225
+ Blockly.BlockSvg.CORNER_RADIUS;
226
+
227
+ /**
228
+ * SVG path for drawing the rounded bottom-left corner.
229
+ * @const
230
+ */
231
+ Blockly.BlockSvg.BOTTOM_LEFT_CORNER =
232
+ 'a ' + Blockly.BlockSvg.CORNER_RADIUS + ',' +
233
+ Blockly.BlockSvg.CORNER_RADIUS + ' 0 0,1 -' +
234
+ Blockly.BlockSvg.CORNER_RADIUS + ',-' +
235
+ Blockly.BlockSvg.CORNER_RADIUS;
236
+
237
+ /**
238
+ * SVG path for drawing the top-left corner of a statement input.
239
+ * @const
240
+ */
241
+ Blockly.BlockSvg.INNER_TOP_LEFT_CORNER =
242
+ ' a ' + Blockly.BlockSvg.CORNER_RADIUS + ',' +
243
+ Blockly.BlockSvg.CORNER_RADIUS + ' 0 0,0 -' +
244
+ Blockly.BlockSvg.CORNER_RADIUS + ',' +
245
+ Blockly.BlockSvg.CORNER_RADIUS;
246
+
247
+ /**
248
+ * SVG path for drawing the bottom-left corner of a statement input.
249
+ * Includes the rounded inside corner.
250
+ * @const
251
+ */
252
+ Blockly.BlockSvg.INNER_BOTTOM_LEFT_CORNER =
253
+ 'a ' + Blockly.BlockSvg.CORNER_RADIUS + ',' +
254
+ Blockly.BlockSvg.CORNER_RADIUS + ' 0 0,0 ' +
255
+ Blockly.BlockSvg.CORNER_RADIUS + ',' +
256
+ Blockly.BlockSvg.CORNER_RADIUS;
257
+
258
+ /**
259
+ * SVG path for an empty hexagonal input shape.
260
+ * @const
261
+ */
262
+ Blockly.BlockSvg.INPUT_SHAPE_HEXAGONAL =
263
+ 'M ' + 4 * Blockly.BlockSvg.GRID_UNIT + ',0 ' +
264
+ ' h ' + 4 * Blockly.BlockSvg.GRID_UNIT +
265
+ ' l ' + 4 * Blockly.BlockSvg.GRID_UNIT + ',' + 4 * Blockly.BlockSvg.GRID_UNIT +
266
+ ' l ' + -4 * Blockly.BlockSvg.GRID_UNIT + ',' + 4 * Blockly.BlockSvg.GRID_UNIT +
267
+ ' h ' + -4 * Blockly.BlockSvg.GRID_UNIT +
268
+ ' l ' + -4 * Blockly.BlockSvg.GRID_UNIT + ',' + -4 * Blockly.BlockSvg.GRID_UNIT +
269
+ ' l ' + 4 * Blockly.BlockSvg.GRID_UNIT + ',' + -4 * Blockly.BlockSvg.GRID_UNIT +
270
+ ' z';
271
+
272
+ /**
273
+ * Width of empty boolean input shape.
274
+ * @const
275
+ */
276
+ Blockly.BlockSvg.INPUT_SHAPE_HEXAGONAL_WIDTH = 12 * Blockly.BlockSvg.GRID_UNIT;
277
+
278
+ /**
279
+ * SVG path for an empty square input shape.
280
+ * @const
281
+ */
282
+ Blockly.BlockSvg.INPUT_SHAPE_SQUARE =
283
+ Blockly.BlockSvg.TOP_LEFT_CORNER_START +
284
+ Blockly.BlockSvg.TOP_LEFT_CORNER +
285
+ ' h ' + (12 * Blockly.BlockSvg.GRID_UNIT - 2 * Blockly.BlockSvg.CORNER_RADIUS) +
286
+ Blockly.BlockSvg.TOP_RIGHT_CORNER +
287
+ ' v ' + (8 * Blockly.BlockSvg.GRID_UNIT - 2 * Blockly.BlockSvg.CORNER_RADIUS) +
288
+ Blockly.BlockSvg.BOTTOM_RIGHT_CORNER +
289
+ ' h ' + (-12 * Blockly.BlockSvg.GRID_UNIT + 2 * Blockly.BlockSvg.CORNER_RADIUS) +
290
+ Blockly.BlockSvg.BOTTOM_LEFT_CORNER +
291
+ ' z';
292
+
293
+ /**
294
+ * Width of empty square input shape.
295
+ * @const
296
+ */
297
+ Blockly.BlockSvg.INPUT_SHAPE_SQUARE_WIDTH = 10 * Blockly.BlockSvg.GRID_UNIT;
298
+
299
+ /**
300
+ * SVG path for an empty round input shape.
301
+ * @const
302
+ */
303
+
304
+ Blockly.BlockSvg.INPUT_SHAPE_ROUND =
305
+ 'M ' + (4 * Blockly.BlockSvg.GRID_UNIT) + ',0' +
306
+ ' h ' + (4 * Blockly.BlockSvg.GRID_UNIT) +
307
+ ' a ' + (4 * Blockly.BlockSvg.GRID_UNIT) + ' ' +
308
+ (4 * Blockly.BlockSvg.GRID_UNIT) + ' 0 0 1 0 ' + (8 * Blockly.BlockSvg.GRID_UNIT) +
309
+ ' h ' + (-4 * Blockly.BlockSvg.GRID_UNIT) +
310
+ ' a ' + (4 * Blockly.BlockSvg.GRID_UNIT) + ' ' +
311
+ (4 * Blockly.BlockSvg.GRID_UNIT) + ' 0 0 1 0 -' + (8 * Blockly.BlockSvg.GRID_UNIT) +
312
+ ' z';
313
+
314
+ /**
315
+ * Width of empty round input shape.
316
+ * @const
317
+ */
318
+ Blockly.BlockSvg.INPUT_SHAPE_ROUND_WIDTH = 12 * Blockly.BlockSvg.GRID_UNIT;
319
+
320
+ /**
321
+ * Height of empty input shape.
322
+ * @const
323
+ */
324
+ Blockly.BlockSvg.INPUT_SHAPE_HEIGHT = 8 * Blockly.BlockSvg.GRID_UNIT;
325
+
326
+ /**
327
+ * Height of user inputs
328
+ * @const
329
+ */
330
+ Blockly.BlockSvg.FIELD_HEIGHT = 8 * Blockly.BlockSvg.GRID_UNIT;
331
+
332
+ /**
333
+ * Width of user inputs
334
+ * @const
335
+ */
336
+ Blockly.BlockSvg.FIELD_WIDTH = 6 * Blockly.BlockSvg.GRID_UNIT;
337
+
338
+ /**
339
+ * Editable field padding (left/right of the text).
340
+ * @const
341
+ */
342
+ Blockly.BlockSvg.EDITABLE_FIELD_PADDING = 6;
343
+
344
+ /**
345
+ * Square box field padding (left/right of the text).
346
+ * @const
347
+ */
348
+ Blockly.BlockSvg.BOX_FIELD_PADDING = 2 * Blockly.BlockSvg.GRID_UNIT;
349
+
350
+ /**
351
+ * Drop-down arrow padding.
352
+ * @const
353
+ */
354
+ Blockly.BlockSvg.DROPDOWN_ARROW_PADDING = 2 * Blockly.BlockSvg.GRID_UNIT;
355
+
356
+ /**
357
+ * Minimum width of user inputs during editing
358
+ * @const
359
+ */
360
+ Blockly.BlockSvg.FIELD_WIDTH_MIN_EDIT = 8 * Blockly.BlockSvg.GRID_UNIT;
361
+
362
+ /**
363
+ * Maximum width of user inputs during editing
364
+ * @const
365
+ */
366
+ Blockly.BlockSvg.FIELD_WIDTH_MAX_EDIT = Infinity;
367
+
368
+ /**
369
+ * Maximum height of user inputs during editing
370
+ * @const
371
+ */
372
+ Blockly.BlockSvg.FIELD_HEIGHT_MAX_EDIT = Blockly.BlockSvg.FIELD_HEIGHT;
373
+
374
+ /**
375
+ * Top padding of user inputs
376
+ * @const
377
+ */
378
+ Blockly.BlockSvg.FIELD_TOP_PADDING = 0.5 * Blockly.BlockSvg.GRID_UNIT;
379
+
380
+ /**
381
+ * Corner radius of number inputs
382
+ * @const
383
+ */
384
+ Blockly.BlockSvg.NUMBER_FIELD_CORNER_RADIUS = 4 * Blockly.BlockSvg.GRID_UNIT;
385
+
386
+ /**
387
+ * Corner radius of text inputs
388
+ * @const
389
+ */
390
+ Blockly.BlockSvg.TEXT_FIELD_CORNER_RADIUS = 1 * Blockly.BlockSvg.GRID_UNIT;
391
+
392
+ /**
393
+ * Default radius for a field, in px.
394
+ * @const
395
+ */
396
+ Blockly.BlockSvg.FIELD_DEFAULT_CORNER_RADIUS = 4 * Blockly.BlockSvg.GRID_UNIT;
397
+
398
+ /**
399
+ * Max text display length for a field (per-horizontal/vertical)
400
+ * @const
401
+ */
402
+ Blockly.BlockSvg.MAX_DISPLAY_LENGTH = Infinity;
403
+
404
+ /**
405
+ * Minimum X of inputs and fields for blocks with a previous connection.
406
+ * Ensures that inputs will not overlap with the top notch of blocks.
407
+ * @const
408
+ */
409
+ Blockly.BlockSvg.INPUT_AND_FIELD_MIN_X = 12 * Blockly.BlockSvg.GRID_UNIT;
410
+
411
+ /**
412
+ * Vertical padding around inline elements.
413
+ * @const
414
+ */
415
+ Blockly.BlockSvg.INLINE_PADDING_Y = 1 * Blockly.BlockSvg.GRID_UNIT;
416
+
417
+ /**
418
+ * Point size of text field before animation. Must match size in CSS.
419
+ * See implementation in field_textinput.
420
+ */
421
+ Blockly.BlockSvg.FIELD_TEXTINPUT_FONTSIZE_INITIAL = 12;
422
+
423
+ /**
424
+ * Point size of text field after animation.
425
+ * See implementation in field_textinput.
426
+ */
427
+ Blockly.BlockSvg.FIELD_TEXTINPUT_FONTSIZE_FINAL = 12;
428
+
429
+ /**
430
+ * Whether text fields are allowed to expand past their truncated block size.
431
+ * @const{boolean}
432
+ */
433
+ Blockly.BlockSvg.FIELD_TEXTINPUT_EXPAND_PAST_TRUNCATION = false;
434
+
435
+ /**
436
+ * Whether text fields should animate their positioning.
437
+ * @const{boolean}
438
+ */
439
+ Blockly.BlockSvg.FIELD_TEXTINPUT_ANIMATE_POSITIONING = false;
440
+
441
+ /**
442
+ * Map of output/input shapes and the amount they should cause a block to be padded.
443
+ * Outer key is the outer shape, inner key is the inner shape.
444
+ * When a block with the outer shape contains an input block with the inner shape
445
+ * on its left or right edge, that side is extended by the padding specified.
446
+ * See also: `Blockly.BlockSvg.computeOutputPadding_`.
447
+ */
448
+ Blockly.BlockSvg.SHAPE_IN_SHAPE_PADDING = {
449
+ 1: { // Outer shape: hexagon.
450
+ 0: 5 * Blockly.BlockSvg.GRID_UNIT, // Field in hexagon.
451
+ 1: 2 * Blockly.BlockSvg.GRID_UNIT, // Hexagon in hexagon.
452
+ 2: 5 * Blockly.BlockSvg.GRID_UNIT, // Round in hexagon.
453
+ 3: 5 * Blockly.BlockSvg.GRID_UNIT // Square in hexagon.
454
+ },
455
+ 2: { // Outer shape: round.
456
+ 0: 3 * Blockly.BlockSvg.GRID_UNIT, // Field in round.
457
+ 1: 3 * Blockly.BlockSvg.GRID_UNIT, // Hexagon in round.
458
+ 2: 1 * Blockly.BlockSvg.GRID_UNIT, // Round in round.
459
+ 3: 2 * Blockly.BlockSvg.GRID_UNIT // Square in round.
460
+ },
461
+ 3: { // Outer shape: square.
462
+ 0: 2 * Blockly.BlockSvg.GRID_UNIT, // Field in square.
463
+ 1: 2 * Blockly.BlockSvg.GRID_UNIT, // Hexagon in square.
464
+ 2: 2 * Blockly.BlockSvg.GRID_UNIT, // Round in square.
465
+ 3: 2 * Blockly.BlockSvg.GRID_UNIT // Square in square.
466
+ }
467
+ };
468
+
469
+ /**
470
+ * Corner radius of the hat on the define block.
471
+ * @const
472
+ */
473
+ Blockly.BlockSvg.DEFINE_HAT_CORNER_RADIUS = 5 * Blockly.BlockSvg.GRID_UNIT;
474
+
475
+ /**
476
+ * SVG path for drawing the rounded top-left corner.
477
+ * @const
478
+ */
479
+ Blockly.BlockSvg.TOP_LEFT_CORNER_DEFINE_HAT =
480
+ 'a ' + Blockly.BlockSvg.DEFINE_HAT_CORNER_RADIUS + ',' +
481
+ Blockly.BlockSvg.DEFINE_HAT_CORNER_RADIUS + ' 0 0,1 ' +
482
+ Blockly.BlockSvg.DEFINE_HAT_CORNER_RADIUS + ',-' +
483
+ Blockly.BlockSvg.DEFINE_HAT_CORNER_RADIUS;
484
+
485
+ /**
486
+ * SVG path for drawing the rounded top-left corner.
487
+ * @const
488
+ */
489
+ Blockly.BlockSvg.TOP_RIGHT_CORNER_DEFINE_HAT =
490
+ 'a ' + Blockly.BlockSvg.DEFINE_HAT_CORNER_RADIUS + ',' +
491
+ Blockly.BlockSvg.DEFINE_HAT_CORNER_RADIUS + ' 0 0,1 ' +
492
+ Blockly.BlockSvg.DEFINE_HAT_CORNER_RADIUS + ',' +
493
+ Blockly.BlockSvg.DEFINE_HAT_CORNER_RADIUS;
494
+
495
+ /**
496
+ * Padding on the right side of the internal block on the define block.
497
+ * @const
498
+ */
499
+ Blockly.BlockSvg.DEFINE_BLOCK_PADDING_RIGHT = 2 * Blockly.BlockSvg.GRID_UNIT;
500
+
501
+ /**
502
+ * Change the colour of a block.
503
+ */
504
+ Blockly.BlockSvg.prototype.updateColour = function() {
505
+ var strokeColour = this.getColourTertiary();
506
+ var renderShadowed = this.isShadow() &&
507
+ !Blockly.scratchBlocksUtils.isShadowArgumentReporter(this);
508
+
509
+ if (renderShadowed && this.parentBlock_) {
510
+ // Pull shadow block stroke colour from parent block's tertiary if possible.
511
+ strokeColour = this.parentBlock_.getColourTertiary();
512
+ // Special case: if we contain a colour field, set to a special stroke colour.
513
+ if (this.inputList[0] &&
514
+ this.inputList[0].fieldRow[0] &&
515
+ (this.inputList[0].fieldRow[0] instanceof Blockly.FieldColour ||
516
+ this.inputList[0].fieldRow[0] instanceof Blockly.FieldColourSlider)) {
517
+ strokeColour = Blockly.Colours.colourPickerStroke;
518
+ }
519
+ }
520
+
521
+ // Render block stroke
522
+ this.svgPath_.setAttribute('stroke', strokeColour);
523
+
524
+ // Render block fill
525
+ if (this.isGlowingBlock_ || renderShadowed) {
526
+ // Use the block's shadow colour if possible.
527
+ if (this.getShadowColour()) {
528
+ var fillColour = this.getShadowColour();
529
+ } else {
530
+ var fillColour = this.getColourSecondary();
531
+ }
532
+ } else {
533
+ var fillColour = this.getColour();
534
+ }
535
+ this.svgPath_.setAttribute('fill', fillColour);
536
+
537
+ // Render opacity
538
+ this.svgPath_.setAttribute('fill-opacity', this.getOpacity());
539
+
540
+ // Update colours of input shapes.
541
+ for (var i = 0, input; input = this.inputList[i]; i++) {
542
+ if (input.outlinePath) {
543
+ input.outlinePath.setAttribute('fill', this.getColourTertiary());
544
+ }
545
+ }
546
+
547
+ // Render icon(s) if applicable
548
+ var icons = this.getIcons();
549
+ for (var i = 0; i < icons.length; i++) {
550
+ icons[i].updateColour();
551
+ }
552
+
553
+ // Bump every dropdown to change its colour.
554
+ for (var x = 0, input; input = this.inputList[x]; x++) {
555
+ for (var y = 0, field; field = input.fieldRow[y]; y++) {
556
+ field.setText(null);
557
+ }
558
+ }
559
+ };
560
+
561
+ /**
562
+ * Visual effect to show that if the dragging block is dropped, this block will
563
+ * be replaced. If a shadow block it will disappear. Otherwise it will bump.
564
+ * @param {boolean} add True if highlighting should be added.
565
+ */
566
+ Blockly.BlockSvg.prototype.highlightForReplacement = function(add) {
567
+ if (add) {
568
+ var replacementGlowFilterId = this.workspace.options.replacementGlowFilterId
569
+ || 'blocklyReplacementGlowFilter';
570
+ this.svgPath_.setAttribute('filter', 'url(#' + replacementGlowFilterId + ')');
571
+ Blockly.utils.addClass(/** @type {!Element} */ (this.svgGroup_),
572
+ 'blocklyReplaceable');
573
+ } else {
574
+ this.svgPath_.removeAttribute('filter');
575
+ Blockly.utils.removeClass(/** @type {!Element} */ (this.svgGroup_),
576
+ 'blocklyReplaceable');
577
+ }
578
+ };
579
+
580
+ /**
581
+ * Visual effect to show that if the dragging block is dropped it will connect
582
+ * to this input.
583
+ * @param {Blockly.Connection} conn The connection on the input to highlight.
584
+ * @param {boolean} add True if highlighting should be added.
585
+ */
586
+ Blockly.BlockSvg.prototype.highlightShapeForInput = function(conn, add) {
587
+ var input = this.getInputWithConnection(conn);
588
+ if (!input) {
589
+ throw 'No input found for the connection';
590
+ }
591
+ if (!input.outlinePath) {
592
+ return;
593
+ }
594
+ if (add) {
595
+ var replacementGlowFilterId = this.workspace.options.replacementGlowFilterId
596
+ || 'blocklyReplacementGlowFilter';
597
+ input.outlinePath.setAttribute('filter',
598
+ 'url(#' + replacementGlowFilterId + ')');
599
+ Blockly.utils.addClass(/** @type {!Element} */ (this.svgGroup_),
600
+ 'blocklyReplaceable');
601
+ } else {
602
+ input.outlinePath.removeAttribute('filter');
603
+ Blockly.utils.removeClass(/** @type {!Element} */ (this.svgGroup_),
604
+ 'blocklyReplaceable');
605
+ }
606
+ };
607
+
608
+ /**
609
+ * Returns a bounding box describing the dimensions of this block
610
+ * and any blocks stacked below it.
611
+ * @return {!{height: number, width: number}} Object with height and width properties.
612
+ */
613
+ Blockly.BlockSvg.prototype.getHeightWidth = function() {
614
+ var height = this.height;
615
+ var width = this.width;
616
+ // Recursively add size of subsequent blocks.
617
+ var nextBlock = this.getNextBlock();
618
+ if (nextBlock) {
619
+ var nextHeightWidth = nextBlock.getHeightWidth();
620
+ height += nextHeightWidth.height;
621
+ height -= Blockly.BlockSvg.NOTCH_HEIGHT; // Exclude height of connected notch.
622
+ width = Math.max(width, nextHeightWidth.width);
623
+ }
624
+ return {height: height, width: width};
625
+ };
626
+
627
+ /**
628
+ * Render the block.
629
+ * Lays out and reflows a block based on its contents and settings.
630
+ * @param {boolean=} opt_bubble If false, just render this block.
631
+ * If true, also render block's parent, grandparent, etc. Defaults to true.
632
+ */
633
+ Blockly.BlockSvg.prototype.render = function(opt_bubble) {
634
+ Blockly.Field.startCache();
635
+ this.rendered = true;
636
+
637
+ var cursorX = Blockly.BlockSvg.SEP_SPACE_X;
638
+ if (this.RTL) {
639
+ cursorX = -cursorX;
640
+ }
641
+ // Move the icons into position.
642
+ var icons = this.getIcons();
643
+ var scratchCommentIcon = null;
644
+ for (var i = 0; i < icons.length; i++) {
645
+ if (icons[i] instanceof Blockly.ScratchBlockComment) {
646
+ // Don't render scratch block comment icon until
647
+ // after the inputs
648
+ scratchCommentIcon = icons[i];
649
+ } else {
650
+ cursorX = icons[i].renderIcon(cursorX);
651
+ }
652
+ }
653
+ cursorX += this.RTL ?
654
+ Blockly.BlockSvg.SEP_SPACE_X : -Blockly.BlockSvg.SEP_SPACE_X;
655
+ // If there are no icons, cursorX will be 0, otherwise it will be the
656
+ // width that the first label needs to move over by.
657
+
658
+ // If this is an extension reporter block, add a horizontal offset.
659
+ if (this.isScratchExtension && this.outputConnection) {
660
+ cursorX += this.RTL ?
661
+ -Blockly.BlockSvg.GRID_UNIT : Blockly.BlockSvg.GRID_UNIT;
662
+ }
663
+
664
+ var inputRows = this.renderCompute_(cursorX);
665
+ this.renderDraw_(cursorX, inputRows);
666
+ this.renderMoveConnections_();
667
+
668
+ this.renderClassify_();
669
+
670
+ // Position the Scratch Block Comment Icon at the end of the block
671
+ if (scratchCommentIcon) {
672
+ var iconX = this.RTL ? -inputRows.rightEdge : inputRows.rightEdge;
673
+ var inputMarginY = inputRows[0].height / 2;
674
+ scratchCommentIcon.renderIcon(iconX, inputMarginY);
675
+ }
676
+
677
+ if (opt_bubble !== false) {
678
+ // Render all blocks above this one (propagate a reflow).
679
+ var parentBlock = this.getParent();
680
+ if (parentBlock) {
681
+ parentBlock.render(true);
682
+ } else {
683
+ // Top-most block. Fire an event to allow scrollbars to resize.
684
+ Blockly.resizeSvgContents(this.workspace);
685
+ }
686
+ }
687
+ Blockly.Field.stopCache();
688
+ };
689
+
690
+ /**
691
+ * Render a list of fields starting at the specified location.
692
+ * @param {!Array.<!Blockly.Field>} fieldList List of fields.
693
+ * @param {number} cursorX X-coordinate to start the fields.
694
+ * @param {number} cursorY Y-coordinate around which fields are centered.
695
+ * @return {number} X-coordinate of the end of the field row (plus a gap).
696
+ * @private
697
+ */
698
+ Blockly.BlockSvg.prototype.renderFields_ = function(fieldList, cursorX,
699
+ cursorY) {
700
+ if (this.RTL) {
701
+ cursorX = -cursorX;
702
+ }
703
+ for (var t = 0, field; field = fieldList[t]; t++) {
704
+ var root = field.getSvgRoot();
705
+ if (!root) {
706
+ continue;
707
+ }
708
+ // In blocks with a notch, fields should be bumped to a min X,
709
+ // to avoid overlapping with the notch. Label and image fields are
710
+ // excluded.
711
+ if (this.previousConnection && !(field instanceof Blockly.FieldLabel) &&
712
+ !(field instanceof Blockly.FieldImage)) {
713
+ cursorX = this.RTL ?
714
+ Math.min(cursorX, -Blockly.BlockSvg.INPUT_AND_FIELD_MIN_X) :
715
+ Math.max(cursorX, Blockly.BlockSvg.INPUT_AND_FIELD_MIN_X);
716
+ }
717
+ // Offset the field upward by half its height.
718
+ // This vertically centers the fields around cursorY.
719
+ var yOffset = -field.getSize().height / 2;
720
+
721
+ // If this is an extension block, and this field is the first field, and
722
+ // it is an image field, and this block has a previous connection, bump
723
+ // the image down by one grid unit to align it vertically.
724
+ if (this.isScratchExtension && (field === this.inputList[0].fieldRow[0])
725
+ && (field instanceof Blockly.FieldImage) && this.previousConnection) {
726
+ yOffset += Blockly.BlockSvg.GRID_UNIT;
727
+ }
728
+
729
+ // If this is an extension hat block, adjust the height of the vertical
730
+ // separator without adjusting the field height. The effect is to move
731
+ // the bottom end of the line up one grid unit.
732
+ if (this.isScratchExtension &&
733
+ !this.previousConnection && this.nextConnection &&
734
+ field instanceof Blockly.FieldVerticalSeparator) {
735
+ field.setLineHeight(Blockly.BlockSvg.ICON_SEPARATOR_HEIGHT -
736
+ Blockly.BlockSvg.GRID_UNIT);
737
+ }
738
+
739
+ var translateX, translateY;
740
+ var scale = '';
741
+ if (this.RTL) {
742
+ cursorX -= field.renderSep + field.renderWidth;
743
+ translateX = cursorX;
744
+ translateY = cursorY + yOffset;
745
+ if (field.renderWidth) {
746
+ cursorX -= Blockly.BlockSvg.SEP_SPACE_X;
747
+ }
748
+ } else {
749
+ translateX = cursorX + field.renderSep;
750
+ translateY = cursorY + yOffset;
751
+ if (field.renderWidth) {
752
+ cursorX += field.renderSep + field.renderWidth +
753
+ Blockly.BlockSvg.SEP_SPACE_X;
754
+ }
755
+ }
756
+ if (this.RTL &&
757
+ field instanceof Blockly.FieldImage &&
758
+ field.getFlipRTL()) {
759
+ scale = 'scale(-1 1)';
760
+ translateX += field.renderWidth;
761
+ }
762
+ root.setAttribute('transform',
763
+ 'translate(' + translateX + ', ' + translateY + ') ' + scale);
764
+
765
+ // Fields are invisible on insertion marker.
766
+ if (this.isInsertionMarker()) {
767
+ root.setAttribute('display', 'none');
768
+ }
769
+ }
770
+ return this.RTL ? -cursorX : cursorX;
771
+ };
772
+
773
+ /**
774
+ * Computes the height and widths for each row and field.
775
+ * @param {number} iconWidth Offset of first row due to icons.
776
+ * @return {!Array.<!Array.<!Object>>} 2D array of objects, each containing
777
+ * position information.
778
+ * @private
779
+ */
780
+ Blockly.BlockSvg.prototype.renderCompute_ = function(iconWidth) {
781
+ var inputList = this.inputList;
782
+ var inputRows = [];
783
+ // Block will be drawn from 0 (left edge) to rightEdge, in px.
784
+ inputRows.rightEdge = 0;
785
+ // Drawn from 0 to bottomEdge vertically.
786
+ inputRows.bottomEdge = 0;
787
+ var fieldValueWidth = 0; // Width of longest external value field.
788
+ var fieldStatementWidth = 0; // Width of longest statement field.
789
+ var hasValue = false;
790
+ var hasStatement = false;
791
+ var hasDummy = false;
792
+ var lastType = undefined;
793
+
794
+ // Previously created row, for special-casing row heights on C- and E- shaped blocks.
795
+ var previousRow;
796
+ for (var i = 0, input; input = inputList[i]; i++) {
797
+ if (!input.isVisible()) {
798
+ continue;
799
+ }
800
+ var isSecondInputOnProcedure = this.type == 'procedures_definition' &&
801
+ lastType && lastType == Blockly.NEXT_STATEMENT;
802
+ var row;
803
+ // Don't create a new row for the second dummy input on a procedure block.
804
+ // See github.com/LLK/scratch-blocks/issues/1658
805
+ // In all other cases, statement and value inputs catch all preceding dummy
806
+ // inputs, and cause a line break before following inputs.
807
+ if (!isSecondInputOnProcedure &&
808
+ (!lastType || lastType == Blockly.NEXT_STATEMENT ||
809
+ input.type == Blockly.NEXT_STATEMENT)) {
810
+ lastType = input.type;
811
+ row = this.createRowForInput_(input);
812
+ inputRows.push(row);
813
+ } else {
814
+ row = inputRows[inputRows.length - 1];
815
+ }
816
+ row.push(input);
817
+
818
+ // Compute minimum dimensions for this input.
819
+ input.renderHeight = this.computeInputHeight_(input, row, previousRow);
820
+ input.renderWidth = this.computeInputWidth_(input);
821
+
822
+ // If the input is a statement input, determine if a notch
823
+ // should be drawn at the inner bottom of the C.
824
+ row.statementNotchAtBottom = true;
825
+ if (input.connection && input.connection.type === Blockly.NEXT_STATEMENT) {
826
+ var linkedBlock = input.connection.targetBlock();
827
+ if (linkedBlock && !linkedBlock.lastConnectionInStack()) {
828
+ row.statementNotchAtBottom = false;
829
+ }
830
+ }
831
+
832
+ // Expand input size.
833
+ if (input.connection) {
834
+ var linkedBlock = input.connection.targetBlock();
835
+ var paddedHeight = 0;
836
+ var paddedWidth = 0;
837
+ if (linkedBlock) {
838
+ // A block is connected to the input - use its size.
839
+ var bBox = linkedBlock.getHeightWidth();
840
+ paddedHeight = bBox.height;
841
+ paddedWidth = bBox.width;
842
+ } else {
843
+ // No block connected - use the size of the rendered empty input shape.
844
+ paddedHeight = Blockly.BlockSvg.INPUT_SHAPE_HEIGHT;
845
+ }
846
+ if (input.connection.type === Blockly.INPUT_VALUE) {
847
+ paddedHeight += 2 * Blockly.BlockSvg.INLINE_PADDING_Y;
848
+ }
849
+ if (input.connection.type === Blockly.NEXT_STATEMENT) {
850
+ // Subtract height of notch, only if the last block in the stack has a next connection.
851
+ if (row.statementNotchAtBottom) {
852
+ paddedHeight -= Blockly.BlockSvg.NOTCH_HEIGHT;
853
+ }
854
+ }
855
+ input.renderHeight = Math.max(input.renderHeight, paddedHeight);
856
+ input.renderWidth = Math.max(input.renderWidth, paddedWidth);
857
+ }
858
+ row.height = Math.max(row.height, input.renderHeight);
859
+ input.fieldWidth = 0;
860
+ if (inputRows.length == 1) {
861
+ // The first row gets shifted to accommodate any icons.
862
+ input.fieldWidth += this.RTL ? -iconWidth : iconWidth;
863
+ }
864
+ var previousFieldEditable = false;
865
+ for (var j = 0, field; field = input.fieldRow[j]; j++) {
866
+ if (j != 0) {
867
+ input.fieldWidth += Blockly.BlockSvg.SEP_SPACE_X;
868
+ }
869
+ // Get the dimensions of the field.
870
+ var fieldSize = field.getSize();
871
+ field.renderWidth = fieldSize.width;
872
+ field.renderSep = (previousFieldEditable && field.EDITABLE) ?
873
+ Blockly.BlockSvg.SEP_SPACE_X : 0;
874
+ // See github.com/LLK/scratch-blocks/issues/1658
875
+ if (!isSecondInputOnProcedure) {
876
+ input.fieldWidth += field.renderWidth + field.renderSep;
877
+ }
878
+ row.height = Math.max(row.height, fieldSize.height);
879
+ previousFieldEditable = field.EDITABLE;
880
+ }
881
+
882
+ if (row.type != Blockly.BlockSvg.INLINE) {
883
+ if (row.type == Blockly.NEXT_STATEMENT) {
884
+ hasStatement = true;
885
+ fieldStatementWidth = Math.max(fieldStatementWidth, input.fieldWidth);
886
+ } else {
887
+ if (row.type == Blockly.INPUT_VALUE) {
888
+ hasValue = true;
889
+ } else if (row.type == Blockly.DUMMY_INPUT) {
890
+ hasDummy = true;
891
+ }
892
+ fieldValueWidth = Math.max(fieldValueWidth, input.fieldWidth);
893
+ }
894
+ }
895
+ previousRow = row;
896
+ }
897
+ // Compute padding for output blocks.
898
+ // Data is attached to the row.
899
+ this.computeOutputPadding_(inputRows);
900
+ // Compute the statement edge.
901
+ // This is the width of a block where statements are nested.
902
+ inputRows.statementEdge = Blockly.BlockSvg.STATEMENT_INPUT_EDGE_WIDTH +
903
+ fieldStatementWidth;
904
+
905
+ // Compute the preferred right edge.
906
+ inputRows.rightEdge = this.computeRightEdge_(inputRows.rightEdge,
907
+ hasStatement);
908
+
909
+ // Bottom edge is sum of row heights
910
+ for (var i = 0; i < inputRows.length; i++) {
911
+ inputRows.bottomEdge += inputRows[i].height;
912
+ }
913
+
914
+ inputRows.hasValue = hasValue;
915
+ inputRows.hasStatement = hasStatement;
916
+ inputRows.hasDummy = hasDummy;
917
+ return inputRows;
918
+ };
919
+
920
+ /**
921
+ * Compute the minimum width of this input based on the connection type and
922
+ * outputs.
923
+ * @param {!Blockly.Input} input The input to measure.
924
+ * @return {number} the computed width of this input.
925
+ * @private
926
+ */
927
+ Blockly.BlockSvg.prototype.computeInputWidth_ = function(input) {
928
+ // Empty input shape widths.
929
+ if (input.type == Blockly.INPUT_VALUE &&
930
+ (!input.connection || !input.connection.isConnected())) {
931
+ switch (input.connection.getOutputShape()) {
932
+ case Blockly.OUTPUT_SHAPE_SQUARE:
933
+ return Blockly.BlockSvg.INPUT_SHAPE_SQUARE_WIDTH;
934
+ case Blockly.OUTPUT_SHAPE_ROUND:
935
+ return Blockly.BlockSvg.INPUT_SHAPE_ROUND_WIDTH;
936
+ case Blockly.OUTPUT_SHAPE_HEXAGONAL:
937
+ return Blockly.BlockSvg.INPUT_SHAPE_HEXAGONAL_WIDTH;
938
+ default:
939
+ return 0;
940
+ }
941
+ } else {
942
+ return 0;
943
+ }
944
+ };
945
+
946
+ /**
947
+ * Compute the minimum height of this input.
948
+ * @param {!Blockly.Input} input The input to measure.
949
+ * @param {!Object} row The row of the block that is currently being measured.
950
+ * @param {!Object} previousRow The previous row of the block, which was just
951
+ * measured.
952
+ * @return {number} the computed height of this input.
953
+ * @private
954
+ */
955
+ Blockly.BlockSvg.prototype.computeInputHeight_ = function(input, row,
956
+ previousRow) {
957
+ if (this.inputList.length === 1 && this.outputConnection &&
958
+ (this.isShadow() &&
959
+ !Blockly.scratchBlocksUtils.isShadowArgumentReporter(this))) {
960
+ // "Lone" field blocks are smaller.
961
+ return Blockly.BlockSvg.MIN_BLOCK_Y_SINGLE_FIELD_OUTPUT;
962
+ } else if (this.outputConnection) {
963
+ // If this is an extension reporter block, make it taller.
964
+ if (this.isScratchExtension) {
965
+ return Blockly.BlockSvg.MIN_BLOCK_Y_REPORTER + 2 * Blockly.BlockSvg.GRID_UNIT;
966
+ }
967
+ // All other reporters.
968
+ return Blockly.BlockSvg.MIN_BLOCK_Y_REPORTER;
969
+ } else if (row.type == Blockly.NEXT_STATEMENT) {
970
+ // Statement input.
971
+ return Blockly.BlockSvg.MIN_STATEMENT_INPUT_HEIGHT;
972
+ } else if (previousRow && previousRow.type == Blockly.NEXT_STATEMENT) {
973
+ // Extra row for below statement input.
974
+ return Blockly.BlockSvg.EXTRA_STATEMENT_ROW_Y;
975
+ } else {
976
+ // If this is an extension block, and it has a previous connection,
977
+ // make it taller.
978
+ if (this.isScratchExtension && this.previousConnection) {
979
+ return Blockly.BlockSvg.MIN_BLOCK_Y + 2 * Blockly.BlockSvg.GRID_UNIT;
980
+ }
981
+ // All other blocks.
982
+ return Blockly.BlockSvg.MIN_BLOCK_Y;
983
+ }
984
+ };
985
+
986
+ /**
987
+ * Create a row for an input and associated fields.
988
+ * @param {!Blockly.Input} input The input that the row is based on.
989
+ * @return {!Object} The new row, with the correct type and default sizing info.
990
+ */
991
+ Blockly.BlockSvg.prototype.createRowForInput_ = function(input) {
992
+ // Create new row.
993
+ var row = [];
994
+ if (input.type != Blockly.NEXT_STATEMENT) {
995
+ row.type = Blockly.BlockSvg.INLINE;
996
+ } else {
997
+ row.type = input.type;
998
+ }
999
+ row.height = 0;
1000
+ // Default padding for a block: same as separators between fields/inputs.
1001
+ row.paddingStart = Blockly.BlockSvg.SEP_SPACE_X;
1002
+ row.paddingEnd = Blockly.BlockSvg.SEP_SPACE_X;
1003
+ return row;
1004
+ };
1005
+
1006
+ /**
1007
+ * Compute the preferred right edge of the block.
1008
+ * @param {number} curEdge The previously calculated right edge.
1009
+ * @param {boolean} hasStatement Whether this block has a statement input.
1010
+ * @return {number} The preferred right edge of the block.
1011
+ */
1012
+ Blockly.BlockSvg.prototype.computeRightEdge_ = function(curEdge, hasStatement) {
1013
+ var edge = curEdge;
1014
+ if (this.previousConnection || this.nextConnection) {
1015
+ // Blocks with notches
1016
+ edge = Math.max(edge, Blockly.BlockSvg.MIN_BLOCK_X);
1017
+ } else if (this.outputConnection) {
1018
+ if (this.isShadow() &&
1019
+ !Blockly.scratchBlocksUtils.isShadowArgumentReporter(this)) {
1020
+ // Single-fields
1021
+ edge = Math.max(edge, Blockly.BlockSvg.MIN_BLOCK_X_SHADOW_OUTPUT);
1022
+ } else {
1023
+ // Reporters
1024
+ edge = Math.max(edge, Blockly.BlockSvg.MIN_BLOCK_X_OUTPUT);
1025
+ }
1026
+ }
1027
+ if (hasStatement) {
1028
+ // Statement blocks (C- or E- shaped) have a longer minimum width.
1029
+ edge = Math.max(edge, Blockly.BlockSvg.MIN_BLOCK_X_WITH_STATEMENT);
1030
+ }
1031
+
1032
+ // Ensure insertion markers are at least insertionMarkerMinWidth_ wide.
1033
+ if (this.insertionMarkerMinWidth_ > 0) {
1034
+ edge = Math.max(edge, this.insertionMarkerMinWidth_);
1035
+ }
1036
+ return edge;
1037
+ };
1038
+
1039
+ /**
1040
+ * For a block with output,
1041
+ * determine start and end padding, based on connected inputs.
1042
+ * Padding will depend on the shape of the output, the shape of the input,
1043
+ * and possibly the size of the input.
1044
+ * @param {!Array.<!Array.<!Object>>} inputRows Partially calculated rows.
1045
+ */
1046
+ Blockly.BlockSvg.prototype.computeOutputPadding_ = function(inputRows) {
1047
+ // Only apply to blocks with outputs and not single fields (shadows).
1048
+ if (!this.getOutputShape() || !this.outputConnection ||
1049
+ (this.isShadow() &&
1050
+ !Blockly.scratchBlocksUtils.isShadowArgumentReporter(this))) {
1051
+ return;
1052
+ }
1053
+ // Blocks with outputs must have single row to be padded.
1054
+ if (inputRows.length > 1) {
1055
+ return;
1056
+ }
1057
+ var row = inputRows[0];
1058
+ var shape = this.getOutputShape();
1059
+ // Reset any padding: it's about to be set.
1060
+ row.paddingStart = 0;
1061
+ row.paddingEnd = 0;
1062
+ // Start row padding: based on first input or first field.
1063
+ var firstInput = row[0];
1064
+ var firstField = firstInput.fieldRow[0];
1065
+ var otherShape;
1066
+ // In checking the left/start side, a field takes precedence over any input.
1067
+ // That's because a field will be rendered before any value input.
1068
+ if (firstField) {
1069
+ otherShape = 0; // Field comes first in the row.
1070
+ } else {
1071
+ // Value input comes first in the row.
1072
+ var inputConnection = firstInput.connection;
1073
+ if (!inputConnection.targetConnection) {
1074
+ // Not connected: use the drawn shape.
1075
+ otherShape = inputConnection.getOutputShape();
1076
+ } else {
1077
+ // Connected: use the connected block's output shape.
1078
+ otherShape = inputConnection.targetConnection.getSourceBlock().getOutputShape();
1079
+ }
1080
+ // Special case for hexagonal output: if the connection is larger height
1081
+ // than a standard reporter, add some start padding.
1082
+ // https://github.com/LLK/scratch-blocks/issues/376
1083
+ if (shape == Blockly.OUTPUT_SHAPE_HEXAGONAL &&
1084
+ otherShape != Blockly.OUTPUT_SHAPE_HEXAGONAL) {
1085
+ var deltaHeight = firstInput.renderHeight - Blockly.BlockSvg.MIN_BLOCK_Y_REPORTER;
1086
+ // One grid unit per level of nesting.
1087
+ row.paddingStart += deltaHeight / 2;
1088
+ }
1089
+ }
1090
+ row.paddingStart += Blockly.BlockSvg.SHAPE_IN_SHAPE_PADDING[shape][otherShape];
1091
+ // End row padding: based on last input or last field.
1092
+ var lastInput = row[row.length - 1];
1093
+ // In checking the right/end side, any value input takes precedence over any field.
1094
+ // That's because fields are rendered before inputs...the last item
1095
+ // in the row will be an input, if one exists.
1096
+ if (lastInput.connection) {
1097
+ // Value input last in the row.
1098
+ var inputConnection = lastInput.connection;
1099
+ if (!inputConnection.targetConnection) {
1100
+ // Not connected: use the drawn shape.
1101
+ otherShape = inputConnection.getOutputShape();
1102
+ } else {
1103
+ // Connected: use the connected block's output shape.
1104
+ otherShape = inputConnection.targetConnection.getSourceBlock().getOutputShape();
1105
+ }
1106
+ // Special case for hexagonal output: if the connection is larger height
1107
+ // than a standard reporter, add some end padding.
1108
+ // https://github.com/LLK/scratch-blocks/issues/376
1109
+ if (shape == Blockly.OUTPUT_SHAPE_HEXAGONAL &&
1110
+ otherShape != Blockly.OUTPUT_SHAPE_HEXAGONAL) {
1111
+ var deltaHeight = lastInput.renderHeight - Blockly.BlockSvg.MIN_BLOCK_Y_REPORTER;
1112
+ // One grid unit per level of nesting.
1113
+ row.paddingEnd += deltaHeight / 2;
1114
+ }
1115
+ } else {
1116
+ // No input in this row - mark as field.
1117
+ otherShape = 0;
1118
+ }
1119
+ row.paddingEnd += Blockly.BlockSvg.SHAPE_IN_SHAPE_PADDING[shape][otherShape];
1120
+ };
1121
+
1122
+ /**
1123
+ * Draw the path of the block.
1124
+ * Move the fields to the correct locations.
1125
+ * @param {number} iconWidth Offset of first row due to icons.
1126
+ * @param {!Array.<!Array.<!Object>>} inputRows 2D array of objects, each
1127
+ * containing position information.
1128
+ * @private
1129
+ */
1130
+ Blockly.BlockSvg.prototype.renderDraw_ = function(iconWidth, inputRows) {
1131
+ this.startHat_ = false;
1132
+ // Should the top left corners be rounded or square?
1133
+ // Currently, it is squared only if it's a hat.
1134
+ this.squareTopLeftCorner_ = false;
1135
+ if (!this.outputConnection && !this.previousConnection) {
1136
+ // No output or previous connection.
1137
+ this.squareTopLeftCorner_ = true;
1138
+ this.startHat_ = true;
1139
+ inputRows.rightEdge = Math.max(inputRows.rightEdge, 100);
1140
+ }
1141
+
1142
+ // Amount of space to skip drawing the top and bottom,
1143
+ // to make room for the left and right to draw shapes (curves or angles).
1144
+ this.edgeShapeWidth_ = 0;
1145
+ this.edgeShape_ = null;
1146
+ if (this.outputConnection) {
1147
+ // Width of the curve/pointy-curve
1148
+ var shape = this.getOutputShape();
1149
+ if (shape === Blockly.OUTPUT_SHAPE_HEXAGONAL || shape === Blockly.OUTPUT_SHAPE_ROUND) {
1150
+ this.edgeShapeWidth_ = inputRows.bottomEdge / 2;
1151
+ this.edgeShape_ = shape;
1152
+ this.squareTopLeftCorner_ = true;
1153
+ }
1154
+ }
1155
+
1156
+ // Assemble the block's path.
1157
+ var steps = [];
1158
+
1159
+ this.renderDrawTop_(steps, inputRows.rightEdge);
1160
+ var cursorY = this.renderDrawRight_(steps, inputRows, iconWidth);
1161
+ this.renderDrawBottom_(steps, cursorY);
1162
+ this.renderDrawLeft_(steps);
1163
+
1164
+ var pathString = steps.join(' ');
1165
+ this.svgPath_.setAttribute('d', pathString);
1166
+
1167
+ if (this.RTL) {
1168
+ // Mirror the block's path.
1169
+ // This is awesome.
1170
+ this.svgPath_.setAttribute('transform', 'scale(-1 1)');
1171
+ }
1172
+ };
1173
+
1174
+ /**
1175
+ * Give the block an attribute 'data-shapes' that lists its shape[s], and an
1176
+ * attribute 'data-category' with its category.
1177
+ * @private
1178
+ */
1179
+ Blockly.BlockSvg.prototype.renderClassify_ = function() {
1180
+ var shapes = [];
1181
+
1182
+ if (this.outputConnection) {
1183
+ if (this.isShadow_) {
1184
+ shapes.push('argument');
1185
+ } else {
1186
+ shapes.push('reporter');
1187
+ }
1188
+ if (this.edgeShape_ === Blockly.OUTPUT_SHAPE_HEXAGONAL) {
1189
+ shapes.push('boolean');
1190
+ } else if (this.edgeShape_ === Blockly.OUTPUT_SHAPE_ROUND) {
1191
+ shapes.push('round');
1192
+ }
1193
+ } else {
1194
+ // count the number of statement inputs
1195
+ var inputList = this.inputList;
1196
+ var statementCount = 0;
1197
+ for (var i = 0, input; input = inputList[i]; i++) {
1198
+ if (input.connection && input.connection.type === Blockly.NEXT_STATEMENT) {
1199
+ statementCount++;
1200
+ }
1201
+ }
1202
+
1203
+ if (statementCount) {
1204
+ shapes.push('c-block');
1205
+ shapes.push('c-' + statementCount);
1206
+ }
1207
+ if (this.startHat_) {
1208
+ shapes.push('hat'); // c-block+hats are possible (e.x. reprter procedures)
1209
+ } else if (!statementCount) {
1210
+ shapes.push('stack'); //only call it "stack" if it's not a c-block
1211
+ }
1212
+ if (!this.nextConnection) {
1213
+ shapes.push('end');
1214
+ }
1215
+ }
1216
+
1217
+ this.svgGroup_.setAttribute('data-shapes', shapes.join(' '));
1218
+
1219
+ if (this.getCategory()) {
1220
+ this.svgGroup_.setAttribute('data-category', this.getCategory());
1221
+ }
1222
+ };
1223
+
1224
+ /**
1225
+ * Render the top edge of the block.
1226
+ * @param {!Array.<string>} steps Path of block outline.
1227
+ * @param {number} rightEdge Minimum width of block.
1228
+ * @private
1229
+ */
1230
+ Blockly.BlockSvg.prototype.renderDrawTop_ = function(steps, rightEdge) {
1231
+ if (this.type == Blockly.PROCEDURES_DEFINITION_BLOCK_TYPE) {
1232
+ steps.push('m 0, 0');
1233
+ steps.push(Blockly.BlockSvg.TOP_LEFT_CORNER_DEFINE_HAT);
1234
+ } else {
1235
+ // Position the cursor at the top-left starting point.
1236
+ if (this.squareTopLeftCorner_) {
1237
+ steps.push('m 0,0');
1238
+ if (this.startHat_) {
1239
+ steps.push(Blockly.BlockSvg.START_HAT_PATH);
1240
+ }
1241
+ // Skip space for the output shape
1242
+ if (this.edgeShapeWidth_) {
1243
+ steps.push('m ' + this.edgeShapeWidth_ + ',0');
1244
+ }
1245
+ } else {
1246
+ steps.push(Blockly.BlockSvg.TOP_LEFT_CORNER_START);
1247
+ // Top-left rounded corner.
1248
+ steps.push(Blockly.BlockSvg.TOP_LEFT_CORNER);
1249
+ }
1250
+
1251
+ // Top edge.
1252
+ if (this.previousConnection) {
1253
+ // Space before the notch
1254
+ steps.push('H', Blockly.BlockSvg.NOTCH_START_PADDING);
1255
+ steps.push(Blockly.BlockSvg.NOTCH_PATH_LEFT);
1256
+ // Create previous block connection.
1257
+ var connectionX = (this.RTL ?
1258
+ -Blockly.BlockSvg.NOTCH_WIDTH : Blockly.BlockSvg.NOTCH_WIDTH);
1259
+ this.previousConnection.setOffsetInBlock(connectionX, 0);
1260
+ }
1261
+ }
1262
+ this.width = rightEdge;
1263
+ };
1264
+
1265
+ /**
1266
+ * Render the right edge of the block.
1267
+ * @param {!Array.<string>} steps Path of block outline.
1268
+ * @param {!Array.<!Array.<!Object>>} inputRows 2D array of objects, each
1269
+ * containing position information.
1270
+ * @param {number} iconWidth Offset of first row due to icons.
1271
+ * @return {number} Height of block.
1272
+ * @private
1273
+ */
1274
+ Blockly.BlockSvg.prototype.renderDrawRight_ = function(steps,
1275
+ inputRows, iconWidth) {
1276
+ var cursorX = 0;
1277
+ var cursorY = 0;
1278
+ var connectionX, connectionY;
1279
+ for (var y = 0, row; row = inputRows[y]; y++) {
1280
+ cursorX = row.paddingStart;
1281
+ if (y == 0) {
1282
+ cursorX += this.RTL ? -iconWidth : iconWidth;
1283
+ }
1284
+
1285
+ if (row.type == Blockly.BlockSvg.INLINE) {
1286
+ // Inline inputs.
1287
+ for (var x = 0, input; input = row[x]; x++) {
1288
+ // Align fields vertically within the row.
1289
+ // Moves the field to half of the row's height.
1290
+ // In renderFields_, the field is further centered
1291
+ // by its own rendered height.
1292
+ var fieldY = cursorY + row.height / 2;
1293
+
1294
+ var fieldX = Blockly.BlockSvg.getAlignedCursor_(cursorX, input,
1295
+ inputRows.rightEdge);
1296
+
1297
+ cursorX = this.renderFields_(input.fieldRow, fieldX, fieldY);
1298
+ if (input.type == Blockly.INPUT_VALUE) {
1299
+ // Create inline input connection.
1300
+ // In blocks with a notch, inputs should be bumped to a min X,
1301
+ // to avoid overlapping with the notch.
1302
+ if (this.previousConnection) {
1303
+ cursorX = Math.max(cursorX, Blockly.BlockSvg.INPUT_AND_FIELD_MIN_X);
1304
+ }
1305
+ connectionX = this.RTL ? -cursorX : cursorX;
1306
+ // Attempt to center the connection vertically.
1307
+ var connectionYOffset = row.height / 2;
1308
+ connectionY = cursorY + connectionYOffset;
1309
+ input.connection.setOffsetInBlock(connectionX, connectionY);
1310
+ this.renderInputShape_(input, cursorX, cursorY + connectionYOffset);
1311
+ cursorX += input.renderWidth + Blockly.BlockSvg.SEP_SPACE_X;
1312
+ }
1313
+ }
1314
+ // Remove final separator and replace it with right-padding.
1315
+ cursorX -= Blockly.BlockSvg.SEP_SPACE_X;
1316
+ cursorX += row.paddingEnd;
1317
+ // Update right edge for all inputs, such that all rows
1318
+ // stretch to be at least the size of all previous rows.
1319
+ inputRows.rightEdge = Math.max(cursorX, inputRows.rightEdge);
1320
+ // Move to the right edge
1321
+ cursorX = Math.max(cursorX, inputRows.rightEdge);
1322
+ this.width = Math.max(this.width, cursorX);
1323
+ if (!this.edgeShape_) {
1324
+ // Include corner radius in drawing the horizontal line.
1325
+ steps.push('H', cursorX - Blockly.BlockSvg.CORNER_RADIUS - this.edgeShapeWidth_);
1326
+ steps.push(Blockly.BlockSvg.TOP_RIGHT_CORNER);
1327
+ } else {
1328
+ // Don't include corner radius - no corner (edge shape drawn).
1329
+ steps.push('H', cursorX - this.edgeShapeWidth_);
1330
+ }
1331
+ // Subtract CORNER_RADIUS * 2 to account for the top right corner
1332
+ // and also the bottom right corner. Only move vertically the non-corner length.
1333
+ if (!this.edgeShape_) {
1334
+ steps.push('v', row.height - Blockly.BlockSvg.CORNER_RADIUS * 2);
1335
+ }
1336
+ } else if (row.type == Blockly.NEXT_STATEMENT) {
1337
+ // Nested statement.
1338
+ var input = row[0];
1339
+ var fieldX = cursorX;
1340
+ // Align fields vertically within the row.
1341
+ // In renderFields_, the field is further centered by its own height.
1342
+ var fieldY = cursorY;
1343
+ fieldY += Blockly.BlockSvg.MIN_STATEMENT_INPUT_HEIGHT;
1344
+ this.renderFields_(input.fieldRow, fieldX, fieldY);
1345
+ // Move to the start of the notch.
1346
+ cursorX = inputRows.statementEdge + Blockly.BlockSvg.NOTCH_WIDTH;
1347
+
1348
+ if (this.type == Blockly.PROCEDURES_DEFINITION_BLOCK_TYPE) {
1349
+ this.renderDefineBlock_(steps, inputRows, input, row, cursorY);
1350
+ } else {
1351
+ Blockly.BlockSvg.drawStatementInputFromTopRight_(steps, cursorX,
1352
+ inputRows.rightEdge, row);
1353
+ }
1354
+
1355
+ // Create statement connection.
1356
+ connectionX = this.RTL ? -cursorX : cursorX;
1357
+ input.connection.setOffsetInBlock(connectionX, cursorY);
1358
+ if (input.connection.isConnected()) {
1359
+ this.width = Math.max(this.width, inputRows.statementEdge +
1360
+ input.connection.targetBlock().getHeightWidth().width);
1361
+ }
1362
+ if (this.type != Blockly.PROCEDURES_DEFINITION_BLOCK_TYPE &&
1363
+ (y == inputRows.length - 1 ||
1364
+ inputRows[y + 1].type == Blockly.NEXT_STATEMENT)) {
1365
+ // If the final input is a statement stack, add a small row underneath.
1366
+ // Consecutive statement stacks are also separated by a small divider.
1367
+ steps.push(Blockly.BlockSvg.TOP_RIGHT_CORNER);
1368
+ steps.push('v', Blockly.BlockSvg.EXTRA_STATEMENT_ROW_Y - 2 * Blockly.BlockSvg.CORNER_RADIUS);
1369
+ cursorY += Blockly.BlockSvg.EXTRA_STATEMENT_ROW_Y;
1370
+ }
1371
+ }
1372
+ cursorY += row.height;
1373
+ }
1374
+ this.drawEdgeShapeRight_(steps);
1375
+ if (!inputRows.length) {
1376
+ cursorY = Blockly.BlockSvg.MIN_BLOCK_Y;
1377
+ steps.push('V', cursorY);
1378
+ }
1379
+ return cursorY;
1380
+ };
1381
+
1382
+ /**
1383
+ * Render the input shapes.
1384
+ * If there's a connected block, hide the input shape.
1385
+ * Otherwise, draw and set the position of the input shape.
1386
+ * @param {!Blockly.Input} input Input to be rendered.
1387
+ * @param {Number} x X offset of input.
1388
+ * @param {Number} y Y offset of input.
1389
+ */
1390
+ Blockly.BlockSvg.prototype.renderInputShape_ = function(input, x, y) {
1391
+ var inputShape = input.outlinePath;
1392
+ if (!inputShape) {
1393
+ // No input shape for this input - e.g., the block is an insertion marker.
1394
+ return;
1395
+ }
1396
+ // Input shapes are only visibly rendered on non-connected slots.
1397
+ if (input.connection.targetConnection) {
1398
+ inputShape.setAttribute('style', 'visibility: hidden');
1399
+ } else {
1400
+ var inputShapeX = 0, inputShapeY = 0;
1401
+ var inputShapeInfo =
1402
+ Blockly.BlockSvg.getInputShapeInfo_(input.connection.getOutputShape());
1403
+ if (this.RTL) {
1404
+ inputShapeX = -x - inputShapeInfo.width;
1405
+ } else {
1406
+ inputShapeX = x;
1407
+ }
1408
+ inputShapeY = y - (Blockly.BlockSvg.INPUT_SHAPE_HEIGHT / 2);
1409
+ inputShape.setAttribute('d', inputShapeInfo.path);
1410
+ inputShape.setAttribute('transform',
1411
+ 'translate(' + inputShapeX + ',' + inputShapeY + ')');
1412
+ inputShape.setAttribute('data-argument-type', inputShapeInfo.argType);
1413
+ inputShape.setAttribute('style', 'visibility: visible');
1414
+ }
1415
+ };
1416
+
1417
+ /**
1418
+ * Render the bottom edge of the block.
1419
+ * @param {!Array.<string>} steps Path of block outline.
1420
+ * @param {number} cursorY Height of block.
1421
+ * @private
1422
+ */
1423
+ Blockly.BlockSvg.prototype.renderDrawBottom_ = function(steps, cursorY) {
1424
+ this.height = cursorY;
1425
+ if (!this.edgeShape_) {
1426
+ steps.push(Blockly.BlockSvg.BOTTOM_RIGHT_CORNER);
1427
+ }
1428
+ if (this.nextConnection) {
1429
+ // Move to the right-side of the notch.
1430
+ var notchStart = (
1431
+ Blockly.BlockSvg.NOTCH_WIDTH +
1432
+ Blockly.BlockSvg.NOTCH_START_PADDING +
1433
+ Blockly.BlockSvg.CORNER_RADIUS
1434
+ );
1435
+ steps.push('H', notchStart, ' ');
1436
+ steps.push(Blockly.BlockSvg.NOTCH_PATH_RIGHT);
1437
+ // Create next block connection.
1438
+ var connectionX = this.RTL ? -Blockly.BlockSvg.NOTCH_WIDTH :
1439
+ Blockly.BlockSvg.NOTCH_WIDTH;
1440
+ this.nextConnection.setOffsetInBlock(connectionX, cursorY);
1441
+ // Include height of notch in block height.
1442
+ this.height += Blockly.BlockSvg.NOTCH_HEIGHT;
1443
+ }
1444
+ // Bottom horizontal line
1445
+ if (!this.edgeShape_) {
1446
+ steps.push('H', Blockly.BlockSvg.CORNER_RADIUS);
1447
+ // Bottom left corner
1448
+ steps.push(Blockly.BlockSvg.BOTTOM_LEFT_CORNER);
1449
+ } else {
1450
+ steps.push('H', this.edgeShapeWidth_);
1451
+ }
1452
+ };
1453
+
1454
+ /**
1455
+ * Render the left edge of the block.
1456
+ * @param {!Array.<string>} steps Path of block outline.
1457
+ * @param {number} cursorY Height of block.
1458
+ * @private
1459
+ */
1460
+ Blockly.BlockSvg.prototype.renderDrawLeft_ = function(steps) {
1461
+ if (this.outputConnection) {
1462
+ // Scratch-style reporters have output connection y at half block height.
1463
+ this.outputConnection.setOffsetInBlock(0, this.height / 2);
1464
+ }
1465
+ if (this.edgeShape_) {
1466
+ // Draw the left-side edge shape.
1467
+ if (this.edgeShape_ === Blockly.OUTPUT_SHAPE_ROUND) {
1468
+ // Draw a rounded arc.
1469
+ steps.push('a ' + this.edgeShapeWidth_ + ' ' + this.edgeShapeWidth_ + ' 0 0 1 0 -' + this.edgeShapeWidth_ * 2);
1470
+ } else if (this.edgeShape_ === Blockly.OUTPUT_SHAPE_HEXAGONAL) {
1471
+ // Draw a half-hexagon.
1472
+ steps.push('l ' + -this.edgeShapeWidth_ + ' ' + -this.edgeShapeWidth_ +
1473
+ ' l ' + this.edgeShapeWidth_ + ' ' + -this.edgeShapeWidth_);
1474
+ }
1475
+ }
1476
+ steps.push('z');
1477
+ };
1478
+
1479
+ /**
1480
+ * Draw the edge shape (rounded or hexagonal) on the right side of a block with
1481
+ * an output.
1482
+ * @param {!Array.<string>} steps Path of block outline.
1483
+ * @private
1484
+ */
1485
+ Blockly.BlockSvg.prototype.drawEdgeShapeRight_ = function(steps) {
1486
+ if (this.edgeShape_) {
1487
+ // Draw the right-side edge shape.
1488
+ if (this.edgeShape_ === Blockly.OUTPUT_SHAPE_ROUND) {
1489
+ // Draw a rounded arc.
1490
+ steps.push('a ' + this.edgeShapeWidth_ + ' ' + this.edgeShapeWidth_ +
1491
+ ' 0 0 1 0 ' + this.edgeShapeWidth_ * 2);
1492
+ } else if (this.edgeShape_ === Blockly.OUTPUT_SHAPE_HEXAGONAL) {
1493
+ // Draw an half-hexagon.
1494
+ steps.push('l ' + this.edgeShapeWidth_ + ' ' + this.edgeShapeWidth_ +
1495
+ ' l ' + -this.edgeShapeWidth_ + ' ' + this.edgeShapeWidth_);
1496
+ }
1497
+ }
1498
+ };
1499
+
1500
+ /**
1501
+ * Position an new block correctly, so that it doesn't move the existing block
1502
+ * when connected to it.
1503
+ * @param {!Blockly.Block} newBlock The block to position - either the first
1504
+ * block in a dragged stack or an insertion marker.
1505
+ * @param {!Blockly.Connection} newConnection The connection on the new block's
1506
+ * stack - either a connection on newBlock, or the last NEXT_STATEMENT
1507
+ * connection on the stack if the stack's being dropped before another
1508
+ * block.
1509
+ * @param {!Blockly.Connection} existingConnection The connection on the
1510
+ * existing block, which newBlock should line up with.
1511
+ */
1512
+ Blockly.BlockSvg.prototype.positionNewBlock = function(newBlock, newConnection,
1513
+ existingConnection) {
1514
+ // We only need to position the new block if it's before the existing one,
1515
+ // otherwise its position is set by the previous block.
1516
+ if (newConnection.type == Blockly.NEXT_STATEMENT) {
1517
+ var dx = existingConnection.x_ - newConnection.x_;
1518
+ var dy = existingConnection.y_ - newConnection.y_;
1519
+
1520
+ newBlock.moveBy(dx, dy);
1521
+ }
1522
+ };
1523
+
1524
+ /**
1525
+ * Draw the outline of a statement input, starting at the top right corner.
1526
+ * @param {!Array.<string>} steps Path of block outline.
1527
+ * @param {number} cursorX The x position of the start of the notch at the top
1528
+ * of the input.
1529
+ * @param {number} rightEdge The far right edge of the block, which determines
1530
+ * how wide the statement input is.
1531
+ * @param {!Array.<!Object>} row An object containing information about the
1532
+ * current row, including its height and whether it should have a notch at
1533
+ * the bottom.
1534
+ * @private
1535
+ */
1536
+ Blockly.BlockSvg.drawStatementInputFromTopRight_ = function(steps, cursorX,
1537
+ rightEdge, row) {
1538
+ Blockly.BlockSvg.drawStatementInputTop_(steps, cursorX);
1539
+ steps.push('v', row.height - 2 * Blockly.BlockSvg.CORNER_RADIUS);
1540
+ Blockly.BlockSvg.drawStatementInputBottom_(steps, rightEdge, row);
1541
+ };
1542
+
1543
+ /**
1544
+ * Draw the top of the outline of a statement input, starting at the top right
1545
+ * corner.
1546
+ * @param {!Array.<string>} steps Path of block outline.
1547
+ * @param {number} cursorX The x position of the start of the notch at the top
1548
+ * of the input.
1549
+ * @private
1550
+ */
1551
+ Blockly.BlockSvg.drawStatementInputTop_ = function(steps, cursorX) {
1552
+ steps.push(Blockly.BlockSvg.BOTTOM_RIGHT_CORNER);
1553
+ steps.push('H', cursorX + Blockly.BlockSvg.STATEMENT_INPUT_INNER_SPACE +
1554
+ 2 * Blockly.BlockSvg.CORNER_RADIUS);
1555
+ steps.push(Blockly.BlockSvg.NOTCH_PATH_RIGHT);
1556
+ steps.push('h', '-' + Blockly.BlockSvg.STATEMENT_INPUT_INNER_SPACE);
1557
+ steps.push(Blockly.BlockSvg.INNER_TOP_LEFT_CORNER);
1558
+ };
1559
+
1560
+ /**
1561
+ * Draw the bottom of the outline of a statement input, starting at the inner
1562
+ * left corner.
1563
+ * @param {!Array.<string>} steps Path of block outline.
1564
+ * @param {number} rightEdge The far right edge of the block, which determines
1565
+ * how wide the statement input is.
1566
+ * @param {!Array.<!Object>} row An object containing information about the
1567
+ * current row, including its height and whether it should have a notch at
1568
+ * the bottom.
1569
+ * @private
1570
+ */
1571
+ Blockly.BlockSvg.drawStatementInputBottom_ = function(steps, rightEdge, row) {
1572
+ steps.push(Blockly.BlockSvg.INNER_BOTTOM_LEFT_CORNER);
1573
+ if (row.statementNotchAtBottom) {
1574
+ steps.push('h ', Blockly.BlockSvg.STATEMENT_INPUT_INNER_SPACE);
1575
+ steps.push(Blockly.BlockSvg.NOTCH_PATH_LEFT);
1576
+ }
1577
+ steps.push('H', rightEdge - Blockly.BlockSvg.CORNER_RADIUS);
1578
+ };
1579
+
1580
+ /**
1581
+ * Render part of the hat and the right side of the define block to fully wrap
1582
+ * the connected statement block.
1583
+ * Scratch-specific.
1584
+ * @param {!Array.<string>} steps Path of block outline.
1585
+ * @param {!Array.<!Array.<!Object>>} inputRows 2D array of objects, each
1586
+ * containing position information.
1587
+ * @param {!Blockly.Input} input The input that is currently being rendered.
1588
+ * @param {!Array.<!Object>} row An object containing information about the
1589
+ * current row, including its height and whether it should have a notch at
1590
+ * the bottom.
1591
+ * @param {number} cursorY The y position of the start of this row. Used to
1592
+ * position the following dummy input's fields.
1593
+ * @private
1594
+ */
1595
+ Blockly.BlockSvg.prototype.renderDefineBlock_ = function(steps, inputRows,
1596
+ input, row, cursorY) {
1597
+ // Following text shows up as a dummy input after the statement input, which
1598
+ // we are forcing to stay inline with the statement input instead of letting
1599
+ // it drop to a new line.
1600
+ var hasFollowingText = row.length == 2;
1601
+
1602
+ // Figure out where the right side of the block is.
1603
+ var rightSide = inputRows.rightEdge;
1604
+ if (input.connection && input.connection.targetBlock()) {
1605
+ rightSide = inputRows.statementEdge +
1606
+ input.connection.targetBlock().getHeightWidth().width +
1607
+ Blockly.BlockSvg.DEFINE_BLOCK_PADDING_RIGHT;
1608
+ } else {
1609
+ // Handles the case where block is being rendered as an insertion marker
1610
+ rightSide = Math.max(Blockly.BlockSvg.MIN_BLOCK_X_WITH_STATEMENT, rightSide)
1611
+ + Blockly.BlockSvg.DEFINE_BLOCK_PADDING_RIGHT;
1612
+ }
1613
+ rightSide -= Blockly.BlockSvg.DEFINE_HAT_CORNER_RADIUS;
1614
+
1615
+ if (hasFollowingText) {
1616
+ var followingTextInput = row[1];
1617
+ var fieldStart = rightSide + 3 * Blockly.BlockSvg.SEP_SPACE_X;
1618
+ rightSide += followingTextInput.fieldRow[0].getSize().width;
1619
+ rightSide += 2 * Blockly.BlockSvg.SEP_SPACE_X;
1620
+
1621
+ // Align fields vertically within the row.
1622
+ // In renderFields_, the field is further centered by its own height.
1623
+ // The dummy input's fields did not get laid out normally because we're
1624
+ // forcing them to stay inline with a statement input.
1625
+ var fieldY = cursorY;
1626
+ fieldY += Blockly.BlockSvg.MIN_STATEMENT_INPUT_HEIGHT;
1627
+ this.renderFields_(followingTextInput.fieldRow, fieldStart, fieldY);
1628
+ }
1629
+ // Draw the top and the right corner of the hat.
1630
+ steps.push('H', rightSide);
1631
+ steps.push(Blockly.BlockSvg.TOP_RIGHT_CORNER_DEFINE_HAT);
1632
+ row.height += 3 * Blockly.BlockSvg.GRID_UNIT;
1633
+ // Draw the right side of the block around the statement input.
1634
+ steps.push('v', row.height);
1635
+ // row.height will be used to update the cursor in the calling function.
1636
+ row.height += Blockly.BlockSvg.GRID_UNIT;
1637
+
1638
+ };
1639
+
1640
+ /**
1641
+ * Get some information about the input shape to draw, based on the type of the
1642
+ * connection.
1643
+ * @param {number} shape An enum representing the shape of the connection we're
1644
+ * drawing around.
1645
+ * @return {!Object} An object containing an SVG path, a string representation
1646
+ * of the argument type, and a width.
1647
+ * @private
1648
+ */
1649
+ Blockly.BlockSvg.getInputShapeInfo_ = function(shape) {
1650
+ var inputShapePath = null;
1651
+ var inputShapeArgType = null;
1652
+ var inputShapeWidth = 0;
1653
+
1654
+ switch (shape) {
1655
+ case Blockly.OUTPUT_SHAPE_HEXAGONAL:
1656
+ inputShapePath = Blockly.BlockSvg.INPUT_SHAPE_HEXAGONAL;
1657
+ inputShapeWidth = Blockly.BlockSvg.INPUT_SHAPE_HEXAGONAL_WIDTH;
1658
+ inputShapeArgType = 'boolean';
1659
+ break;
1660
+ case Blockly.OUTPUT_SHAPE_ROUND:
1661
+ inputShapePath = Blockly.BlockSvg.INPUT_SHAPE_ROUND;
1662
+ inputShapeWidth = Blockly.BlockSvg.INPUT_SHAPE_ROUND_WIDTH;
1663
+ inputShapeArgType = 'round';
1664
+ break;
1665
+ case Blockly.OUTPUT_SHAPE_SQUARE:
1666
+ default: // If the input connection is not connected, draw a hole shape.
1667
+ inputShapePath = Blockly.BlockSvg.INPUT_SHAPE_SQUARE;
1668
+ inputShapeWidth = Blockly.BlockSvg.INPUT_SHAPE_SQUARE_WIDTH;
1669
+ inputShapeArgType = 'square';
1670
+ break;
1671
+ }
1672
+ return {
1673
+ path: inputShapePath,
1674
+ argType: inputShapeArgType,
1675
+ width: inputShapeWidth
1676
+ };
1677
+ };
1678
+
1679
+ /**
1680
+ * Get the correct cursor position for the given input, based on alignment,
1681
+ * the total size of the block, and the size of the input.
1682
+ * @param {number} cursorX The minimum x value of the cursor.
1683
+ * @param {!Blockly.Input} input The input to align the fields for.
1684
+ * @param {number} rightEdge The maximum width of the block. Right-aligned
1685
+ * fields are positioned based on this number.
1686
+ * @return {number} The new cursor position.
1687
+ * @private
1688
+ */
1689
+ Blockly.BlockSvg.getAlignedCursor_ = function(cursorX, input, rightEdge) {
1690
+ // Align inline field rows (left/right/centre).
1691
+ if (input.align === Blockly.ALIGN_RIGHT) {
1692
+ cursorX += rightEdge - input.fieldWidth -
1693
+ (2 * Blockly.BlockSvg.SEP_SPACE_X);
1694
+ } else if (input.align === Blockly.ALIGN_CENTRE) {
1695
+ cursorX = Math.max(cursorX, rightEdge / 2 - input.fieldWidth / 2);
1696
+ }
1697
+ return cursorX;
1698
+ };
1699
+
1700
+ /**
1701
+ * Update all of the connections on this block with the new locaitons calculated
1702
+ * in renderCompute, and move all of the connected blocks based on the new
1703
+ * connection locations.
1704
+ * @private
1705
+ */
1706
+ Blockly.BlockSvg.prototype.renderMoveConnections_ = function() {
1707
+ var blockTL = this.getRelativeToSurfaceXY();
1708
+ // Don't tighten previous or output connections because they are inferior.
1709
+ if (this.previousConnection) {
1710
+ this.previousConnection.moveToOffset(blockTL);
1711
+ }
1712
+ if (this.outputConnection) {
1713
+ this.outputConnection.moveToOffset(blockTL);
1714
+ }
1715
+
1716
+ for (var i = 0; i < this.inputList.length; i++) {
1717
+ var conn = this.inputList[i].connection;
1718
+ if (conn) {
1719
+ conn.moveToOffset(blockTL);
1720
+ if (conn.isConnected()) {
1721
+ conn.tighten_();
1722
+ }
1723
+ }
1724
+ }
1725
+
1726
+ if (this.nextConnection) {
1727
+ this.nextConnection.moveToOffset(blockTL);
1728
+ if (this.nextConnection.isConnected()) {
1729
+ this.nextConnection.tighten_();
1730
+ }
1731
+ }
1732
+ };