blockly 8.20220331.0-beta.0 → 9.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (735) hide show
  1. package/blockly.min.js +2000 -2269
  2. package/blockly_compressed.js +1495 -1994
  3. package/blockly_compressed.js.map +1 -1
  4. package/blocks.d.ts +10 -8
  5. package/blocks_compressed.js +189 -171
  6. package/blocks_compressed.js.map +1 -1
  7. package/closure/goog/base.d.ts +2 -0
  8. package/closure/goog/base_minimal.d.ts +19 -0
  9. package/closure/goog/goog.d.ts +26 -0
  10. package/core/any_aliases.d.ts +2 -0
  11. package/core/block.d.ts +871 -0
  12. package/core/block_animations.d.ts +38 -0
  13. package/core/block_drag_surface.d.ts +124 -0
  14. package/core/block_dragger.d.ts +158 -0
  15. package/core/block_svg.d.ts +656 -0
  16. package/core/blockly.d.ts +583 -0
  17. package/core/blockly_options.d.ts +71 -0
  18. package/core/blocks.d.ts +19 -0
  19. package/core/browser_events.d.ts +94 -0
  20. package/core/bubble.d.ts +309 -0
  21. package/core/bubble_dragger.d.ts +80 -0
  22. package/core/bump_objects.d.ts +38 -0
  23. package/core/clipboard.d.ts +46 -0
  24. package/core/comment.d.ts +123 -0
  25. package/core/common.d.ts +155 -0
  26. package/core/component_manager.d.ts +101 -0
  27. package/core/config.d.ts +24 -0
  28. package/core/connection.d.ts +262 -0
  29. package/core/connection_checker.d.ts +87 -0
  30. package/core/connection_db.d.ts +102 -0
  31. package/core/connection_type.d.ts +17 -0
  32. package/core/constants.d.ts +18 -0
  33. package/core/contextmenu.d.ts +90 -0
  34. package/core/contextmenu_items.d.ts +92 -0
  35. package/core/contextmenu_registry.d.ts +110 -0
  36. package/core/css.d.ts +27 -0
  37. package/core/delete_area.d.ts +51 -0
  38. package/core/dialog.d.ts +68 -0
  39. package/core/drag_target.d.ts +71 -0
  40. package/core/dropdowndiv.d.ts +187 -0
  41. package/core/events/events.d.ts +103 -0
  42. package/core/events/events_abstract.d.ts +58 -0
  43. package/core/events/events_block_base.d.ts +35 -0
  44. package/core/events/events_block_change.d.ts +62 -0
  45. package/core/events/events_block_create.d.ts +40 -0
  46. package/core/events/events_block_delete.d.ts +41 -0
  47. package/core/events/events_block_drag.d.ts +40 -0
  48. package/core/events/events_block_move.d.ts +58 -0
  49. package/core/events/events_bubble_open.d.ts +39 -0
  50. package/core/events/events_click.d.ts +40 -0
  51. package/core/events/events_comment_base.d.ts +44 -0
  52. package/core/events/events_comment_change.d.ts +49 -0
  53. package/core/events/events_comment_create.d.ts +40 -0
  54. package/core/events/events_comment_delete.d.ts +40 -0
  55. package/core/events/events_comment_move.d.ts +62 -0
  56. package/core/events/events_marker_move.d.ts +44 -0
  57. package/core/events/events_selected.d.ts +38 -0
  58. package/core/events/events_theme_change.d.ts +34 -0
  59. package/core/events/events_toolbox_item_select.d.ts +38 -0
  60. package/core/events/events_trashcan_open.d.ts +35 -0
  61. package/core/events/events_ui.d.ts +41 -0
  62. package/core/events/events_ui_base.d.ts +28 -0
  63. package/core/events/events_var_base.d.ts +35 -0
  64. package/core/events/events_var_create.d.ts +40 -0
  65. package/core/events/events_var_delete.d.ts +40 -0
  66. package/core/events/events_var_rename.d.ts +41 -0
  67. package/core/events/events_viewport.d.ts +43 -0
  68. package/core/events/utils.d.ts +315 -0
  69. package/core/events/workspace_events.d.ts +40 -0
  70. package/core/extensions.d.ts +117 -0
  71. package/core/field.d.ts +593 -0
  72. package/core/field_angle.d.ts +187 -0
  73. package/core/field_checkbox.d.ts +137 -0
  74. package/core/field_colour.d.ts +216 -0
  75. package/core/field_dropdown.d.ts +242 -0
  76. package/core/field_image.d.ts +145 -0
  77. package/core/field_label.d.ts +77 -0
  78. package/core/field_label_serializable.d.ts +45 -0
  79. package/core/field_multilineinput.d.ts +161 -0
  80. package/core/field_number.d.ts +172 -0
  81. package/core/field_registry.d.ts +51 -0
  82. package/core/field_textinput.d.ts +239 -0
  83. package/core/field_variable.d.ts +240 -0
  84. package/core/flyout_base.d.ts +505 -0
  85. package/core/flyout_button.d.ts +88 -0
  86. package/core/flyout_horizontal.d.ts +90 -0
  87. package/core/flyout_metrics_manager.d.ts +43 -0
  88. package/core/flyout_vertical.d.ts +91 -0
  89. package/core/generator.d.ts +224 -0
  90. package/core/gesture.d.ts +392 -0
  91. package/core/grid.d.ts +87 -0
  92. package/core/icon.d.ts +87 -0
  93. package/core/inject.d.ts +17 -0
  94. package/core/input.d.ts +143 -0
  95. package/core/input_types.d.ts +16 -0
  96. package/core/insertion_marker_manager.d.ts +230 -0
  97. package/core/interfaces/i_ast_node_location.d.ts +13 -0
  98. package/core/interfaces/i_ast_node_location_svg.d.ts +26 -0
  99. package/core/interfaces/i_ast_node_location_with_block.d.ts +21 -0
  100. package/core/interfaces/i_autohideable.d.ts +21 -0
  101. package/core/interfaces/i_block_dragger.d.ts +49 -0
  102. package/core/interfaces/i_bounded_element.d.ts +28 -0
  103. package/core/interfaces/i_bubble.d.ts +68 -0
  104. package/core/interfaces/i_collapsible_toolbox_item.d.ts +30 -0
  105. package/core/interfaces/i_component.d.ts +19 -0
  106. package/core/interfaces/i_connection_checker.d.ts +77 -0
  107. package/core/interfaces/i_contextmenu.d.ts +15 -0
  108. package/core/interfaces/i_copyable.d.ts +26 -0
  109. package/core/interfaces/i_deletable.d.ts +19 -0
  110. package/core/interfaces/i_delete_area.d.ts +28 -0
  111. package/core/interfaces/i_drag_target.d.ts +61 -0
  112. package/core/interfaces/i_draggable.d.ts +14 -0
  113. package/core/interfaces/i_flyout.d.ts +150 -0
  114. package/core/interfaces/i_keyboard_accessible.d.ts +21 -0
  115. package/core/interfaces/i_metrics_manager.d.ts +129 -0
  116. package/core/interfaces/i_movable.d.ts +19 -0
  117. package/core/interfaces/i_positionable.d.ts +31 -0
  118. package/core/interfaces/i_registrable.d.ts +13 -0
  119. package/core/interfaces/i_registrable_field.d.ts +19 -0
  120. package/core/interfaces/i_selectable.d.ts +20 -0
  121. package/core/interfaces/i_selectable_toolbox_item.d.ts +49 -0
  122. package/core/interfaces/i_serializer.d.ts +47 -0
  123. package/core/interfaces/i_styleable.d.ts +25 -0
  124. package/core/interfaces/i_toolbox.d.ts +96 -0
  125. package/core/interfaces/i_toolbox_item.d.ts +72 -0
  126. package/core/internal_constants.d.ts +46 -0
  127. package/core/keyboard_nav/ast_node.d.ts +266 -0
  128. package/core/keyboard_nav/basic_cursor.d.ts +99 -0
  129. package/core/keyboard_nav/cursor.d.ts +47 -0
  130. package/core/keyboard_nav/marker.d.ts +65 -0
  131. package/core/keyboard_nav/tab_navigate_cursor.d.ts +22 -0
  132. package/core/main.d.ts +12 -0
  133. package/core/marker_manager.d.ts +96 -0
  134. package/core/menu.d.ts +167 -0
  135. package/core/menuitem.d.ts +133 -0
  136. package/core/metrics_manager.d.ts +216 -0
  137. package/core/msg.d.ts +10 -0
  138. package/core/mutator.d.ts +140 -0
  139. package/core/names.d.ts +136 -0
  140. package/core/options.d.ts +143 -0
  141. package/core/positionable_helpers.d.ts +96 -0
  142. package/core/procedures.d.ts +125 -0
  143. package/core/registry.d.ts +148 -0
  144. package/core/rendered_connection.d.ts +212 -0
  145. package/core/renderers/common/block_rendering.d.ts +121 -0
  146. package/core/renderers/common/constants.d.ts +490 -0
  147. package/core/renderers/common/debug.d.ts +32 -0
  148. package/core/renderers/common/debugger.d.ts +131 -0
  149. package/core/renderers/common/drawer.d.ts +144 -0
  150. package/core/renderers/common/i_path_object.d.ts +132 -0
  151. package/core/renderers/common/info.d.ts +211 -0
  152. package/core/renderers/common/marker_svg.d.ts +249 -0
  153. package/core/renderers/common/path_object.d.ts +166 -0
  154. package/core/renderers/common/renderer.d.ts +178 -0
  155. package/core/renderers/geras/constants.d.ts +25 -0
  156. package/core/renderers/geras/drawer.d.ts +45 -0
  157. package/core/renderers/geras/geras.d.ts +12 -0
  158. package/core/renderers/geras/highlight_constants.d.ts +111 -0
  159. package/core/renderers/geras/highlighter.d.ts +109 -0
  160. package/core/renderers/geras/info.d.ts +48 -0
  161. package/core/renderers/geras/measurables/inline_input.d.ts +25 -0
  162. package/core/renderers/geras/measurables/statement_input.d.ts +25 -0
  163. package/core/renderers/geras/path_object.d.ts +51 -0
  164. package/core/renderers/geras/renderer.d.ts +79 -0
  165. package/core/renderers/measurables/base.d.ts +29 -0
  166. package/core/renderers/measurables/bottom_row.d.ts +67 -0
  167. package/core/renderers/measurables/connection.d.ts +27 -0
  168. package/core/renderers/measurables/external_value_input.d.ts +28 -0
  169. package/core/renderers/measurables/field.d.ts +31 -0
  170. package/core/renderers/measurables/hat.d.ts +22 -0
  171. package/core/renderers/measurables/icon.d.ts +28 -0
  172. package/core/renderers/measurables/in_row_spacer.d.ts +22 -0
  173. package/core/renderers/measurables/inline_input.d.ts +25 -0
  174. package/core/renderers/measurables/input_connection.d.ts +31 -0
  175. package/core/renderers/measurables/input_row.d.ts +33 -0
  176. package/core/renderers/measurables/jagged_edge.d.ts +21 -0
  177. package/core/renderers/measurables/next_connection.d.ts +24 -0
  178. package/core/renderers/measurables/output_connection.d.ts +27 -0
  179. package/core/renderers/measurables/previous_connection.d.ts +24 -0
  180. package/core/renderers/measurables/round_corner.d.ts +22 -0
  181. package/core/renderers/measurables/row.d.ts +163 -0
  182. package/core/renderers/measurables/spacer_row.d.ts +30 -0
  183. package/core/renderers/measurables/square_corner.d.ts +22 -0
  184. package/core/renderers/measurables/statement_input.d.ts +23 -0
  185. package/core/renderers/measurables/top_row.d.ts +60 -0
  186. package/core/renderers/measurables/types.d.ts +264 -0
  187. package/core/renderers/minimalist/constants.d.ts +16 -0
  188. package/core/renderers/minimalist/drawer.d.ts +23 -0
  189. package/core/renderers/minimalist/info.d.ts +33 -0
  190. package/core/renderers/minimalist/minimalist.d.ts +7 -0
  191. package/core/renderers/minimalist/renderer.d.ts +46 -0
  192. package/core/renderers/thrasos/info.d.ts +43 -0
  193. package/core/renderers/thrasos/renderer.d.ts +28 -0
  194. package/core/renderers/thrasos/thrasos.d.ts +5 -0
  195. package/core/renderers/zelos/constants.d.ts +194 -0
  196. package/core/renderers/zelos/drawer.d.ts +50 -0
  197. package/core/renderers/zelos/info.d.ts +93 -0
  198. package/core/renderers/zelos/marker_svg.d.ts +51 -0
  199. package/core/renderers/zelos/measurables/bottom_row.d.ts +29 -0
  200. package/core/renderers/zelos/measurables/inputs.d.ts +25 -0
  201. package/core/renderers/zelos/measurables/row_elements.d.ts +23 -0
  202. package/core/renderers/zelos/measurables/top_row.d.ts +31 -0
  203. package/core/renderers/zelos/path_object.d.ts +84 -0
  204. package/core/renderers/zelos/renderer.d.ts +82 -0
  205. package/core/renderers/zelos/zelos.d.ts +13 -0
  206. package/core/scrollbar.d.ts +309 -0
  207. package/core/scrollbar_pair.d.ts +119 -0
  208. package/core/serialization/blocks.d.ts +104 -0
  209. package/core/serialization/exceptions.d.ts +78 -0
  210. package/core/serialization/priorities.d.ts +18 -0
  211. package/core/serialization/registry.d.ts +23 -0
  212. package/core/serialization/variables.d.ts +16 -0
  213. package/core/serialization/workspaces.d.ts +31 -0
  214. package/core/shortcut_items.d.ts +71 -0
  215. package/core/shortcut_registry.d.ts +167 -0
  216. package/core/sprites.d.ts +17 -0
  217. package/core/theme/classic.d.ts +14 -0
  218. package/core/theme/themes.d.ts +9 -0
  219. package/core/theme/zelos.d.ts +13 -0
  220. package/core/theme.d.ts +153 -0
  221. package/core/theme_manager.d.ts +90 -0
  222. package/core/toolbox/category.d.ts +266 -0
  223. package/core/toolbox/collapsible_category.d.ts +98 -0
  224. package/core/toolbox/separator.d.ts +42 -0
  225. package/core/toolbox/toolbox.d.ts +400 -0
  226. package/core/toolbox/toolbox_item.d.ts +95 -0
  227. package/core/tooltip.d.ts +147 -0
  228. package/core/touch.d.ts +133 -0
  229. package/core/touch_gesture.d.ts +129 -0
  230. package/core/trashcan.d.ts +216 -0
  231. package/core/utils/aria.d.ts +71 -0
  232. package/core/utils/array.d.ts +16 -0
  233. package/core/utils/colour.d.ts +114 -0
  234. package/core/utils/coordinate.d.ts +82 -0
  235. package/core/utils/deprecation.d.ts +19 -0
  236. package/core/utils/dom.d.ts +185 -0
  237. package/core/utils/idgenerator.d.ts +35 -0
  238. package/core/utils/keycodes.d.ts +138 -0
  239. package/core/utils/math.d.ts +34 -0
  240. package/core/utils/metrics.d.ts +65 -0
  241. package/core/utils/object.d.ts +40 -0
  242. package/core/utils/parsing.d.ts +55 -0
  243. package/core/utils/rect.d.ts +40 -0
  244. package/core/utils/sentinel.d.ts +13 -0
  245. package/core/utils/size.d.ts +29 -0
  246. package/core/utils/string.d.ts +62 -0
  247. package/core/utils/style.d.ts +108 -0
  248. package/core/utils/svg.d.ts +71 -0
  249. package/core/utils/svg_math.d.ts +78 -0
  250. package/core/utils/svg_paths.d.ts +111 -0
  251. package/core/utils/toolbox.d.ts +214 -0
  252. package/core/utils/useragent.d.ts +22 -0
  253. package/core/utils/xml.d.ts +60 -0
  254. package/core/utils.d.ts +239 -0
  255. package/core/variable_map.d.ts +158 -0
  256. package/core/variable_model.d.ts +43 -0
  257. package/core/variables.d.ts +196 -0
  258. package/core/variables_dynamic.d.ts +58 -0
  259. package/core/warning.d.ts +55 -0
  260. package/core/widgetdiv.d.ts +78 -0
  261. package/core/workspace.d.ts +436 -0
  262. package/core/workspace_audio.d.ts +53 -0
  263. package/core/workspace_comment.d.ts +192 -0
  264. package/core/workspace_comment_svg.d.ts +372 -0
  265. package/core/workspace_drag_surface_svg.d.ts +74 -0
  266. package/core/workspace_dragger.d.ts +54 -0
  267. package/core/workspace_svg.d.ts +1032 -0
  268. package/core/xml.d.ts +132 -0
  269. package/core/zoom_controls.d.ts +140 -0
  270. package/core.d.ts +1 -9
  271. package/core.js +1 -2
  272. package/dart.d.ts +1 -9
  273. package/dart_compressed.js +387 -99
  274. package/dart_compressed.js.map +1 -1
  275. package/index.d.ts +4 -16
  276. package/javascript.d.ts +1 -9
  277. package/javascript_compressed.js +314 -104
  278. package/javascript_compressed.js.map +1 -1
  279. package/lua.d.ts +1 -9
  280. package/lua_compressed.js +399 -81
  281. package/lua_compressed.js.map +1 -1
  282. package/msg/ab.js +10 -6
  283. package/msg/ace.js +10 -6
  284. package/msg/af.js +10 -6
  285. package/msg/am.js +10 -6
  286. package/msg/ar.js +10 -6
  287. package/msg/ast.js +10 -6
  288. package/msg/az.js +12 -8
  289. package/msg/ba.js +10 -6
  290. package/msg/bcc.js +10 -6
  291. package/msg/be-tarask.js +10 -6
  292. package/msg/be.js +14 -10
  293. package/msg/bg.js +10 -6
  294. package/msg/bn.js +10 -6
  295. package/msg/br.js +10 -6
  296. package/msg/bs.js +10 -6
  297. package/msg/ca.js +10 -6
  298. package/msg/cdo.js +10 -6
  299. package/msg/cs.js +25 -21
  300. package/msg/da.js +10 -6
  301. package/msg/de.js +11 -7
  302. package/msg/diq.js +11 -7
  303. package/msg/dty.js +10 -6
  304. package/msg/ee.js +10 -6
  305. package/msg/el.js +10 -6
  306. package/msg/en-gb.js +10 -6
  307. package/msg/en.js +10 -6
  308. package/msg/eo.js +11 -7
  309. package/msg/es.js +11 -7
  310. package/msg/et.js +10 -6
  311. package/msg/eu.js +10 -6
  312. package/msg/fa.js +11 -7
  313. package/msg/fi.js +10 -6
  314. package/msg/fo.js +10 -6
  315. package/msg/fr.js +14 -10
  316. package/msg/frr.js +10 -6
  317. package/msg/gl.js +10 -6
  318. package/msg/gn.js +10 -6
  319. package/msg/gor.js +10 -6
  320. package/msg/ha.js +10 -6
  321. package/msg/hak.js +10 -6
  322. package/msg/he.js +11 -7
  323. package/msg/hi.js +10 -6
  324. package/msg/hr.js +12 -8
  325. package/msg/hrx.js +10 -6
  326. package/msg/hu.js +10 -6
  327. package/msg/hy.js +12 -8
  328. package/msg/ia.js +10 -6
  329. package/msg/id.js +22 -18
  330. package/msg/ig.js +10 -6
  331. package/msg/inh.js +24 -20
  332. package/msg/is.js +10 -6
  333. package/msg/it.js +10 -6
  334. package/msg/ja.js +17 -13
  335. package/msg/ka.js +10 -6
  336. package/msg/kab.js +10 -6
  337. package/msg/kbd-cyrl.js +10 -6
  338. package/msg/km.js +10 -6
  339. package/msg/kn.js +10 -6
  340. package/msg/ko.js +10 -6
  341. package/msg/ksh.js +10 -6
  342. package/msg/ku-latn.js +10 -6
  343. package/msg/ky.js +10 -6
  344. package/msg/la.js +10 -6
  345. package/msg/lb.js +10 -6
  346. package/msg/lki.js +10 -6
  347. package/msg/lo.js +10 -6
  348. package/msg/lrc.js +10 -6
  349. package/msg/lt.js +10 -6
  350. package/msg/lv.js +39 -35
  351. package/msg/mg.js +10 -6
  352. package/msg/mk.js +10 -6
  353. package/msg/ml.js +10 -6
  354. package/msg/mnw.js +10 -6
  355. package/msg/ms.js +10 -6
  356. package/msg/my.js +10 -6
  357. package/msg/mzn.js +10 -6
  358. package/msg/nb.js +10 -6
  359. package/msg/ne.js +10 -6
  360. package/msg/nl.js +10 -6
  361. package/msg/oc.js +10 -6
  362. package/msg/olo.js +10 -6
  363. package/msg/pa.js +13 -9
  364. package/msg/pl.js +10 -6
  365. package/msg/pms.js +10 -6
  366. package/msg/ps.js +10 -6
  367. package/msg/pt-br.js +10 -6
  368. package/msg/pt.js +10 -6
  369. package/msg/ro.js +10 -6
  370. package/msg/ru.js +10 -6
  371. package/msg/sc.js +10 -6
  372. package/msg/sco.js +10 -6
  373. package/msg/sd.js +10 -6
  374. package/msg/shn.js +10 -6
  375. package/msg/si.js +10 -6
  376. package/msg/sk.js +10 -6
  377. package/msg/skr-arab.js +10 -6
  378. package/msg/sl.js +10 -6
  379. package/msg/smn.js +440 -0
  380. package/msg/sq.js +10 -6
  381. package/msg/sr-latn.js +10 -6
  382. package/msg/sr.js +10 -6
  383. package/msg/sv.js +10 -6
  384. package/msg/sw.js +10 -6
  385. package/msg/ta.js +10 -6
  386. package/msg/tcy.js +10 -6
  387. package/msg/te.js +11 -7
  388. package/msg/th.js +10 -6
  389. package/msg/ti.js +10 -6
  390. package/msg/tl.js +10 -6
  391. package/msg/tlh.js +10 -6
  392. package/msg/tr.js +10 -6
  393. package/msg/ug-arab.js +10 -6
  394. package/msg/uk.js +10 -6
  395. package/msg/ur.js +10 -6
  396. package/msg/uz.js +10 -6
  397. package/msg/vi.js +10 -6
  398. package/msg/xmf.js +10 -6
  399. package/msg/yo.js +10 -6
  400. package/msg/yue.js +11 -7
  401. package/msg/zgh.js +10 -6
  402. package/msg/zh-hans.js +13 -9
  403. package/msg/zh-hant.js +13 -9
  404. package/package.json +8 -5
  405. package/php.d.ts +1 -9
  406. package/php_compressed.js +322 -93
  407. package/php_compressed.js.map +1 -1
  408. package/python.d.ts +1 -9
  409. package/python_compressed.js +237 -90
  410. package/python_compressed.js.map +1 -1
  411. package/blockly.d.ts +0 -25607
  412. package/blocks/blocks.js +0 -47
  413. package/blocks/colour.js +0 -119
  414. package/blocks/lists.js +0 -924
  415. package/blocks/logic.js +0 -657
  416. package/blocks/loops.js +0 -373
  417. package/blocks/math.js +0 -592
  418. package/blocks/procedures.js +0 -1194
  419. package/blocks/text.js +0 -992
  420. package/blocks/variables.js +0 -174
  421. package/blocks/variables_dynamic.js +0 -190
  422. package/core/block.js +0 -2212
  423. package/core/block_animations.js +0 -206
  424. package/core/block_drag_surface.js +0 -269
  425. package/core/block_dragger.js +0 -484
  426. package/core/block_svg.js +0 -1894
  427. package/core/blockly.js +0 -890
  428. package/core/blockly_options.js +0 -28
  429. package/core/blocks.js +0 -33
  430. package/core/browser_events.js +0 -284
  431. package/core/bubble.js +0 -985
  432. package/core/bubble_dragger.js +0 -298
  433. package/core/bump_objects.js +0 -180
  434. package/core/clipboard.js +0 -80
  435. package/core/comment.js +0 -448
  436. package/core/common.js +0 -265
  437. package/core/component_manager.js +0 -263
  438. package/core/config.js +0 -87
  439. package/core/connection.js +0 -742
  440. package/core/connection_checker.js +0 -312
  441. package/core/connection_db.js +0 -314
  442. package/core/connection_type.js +0 -36
  443. package/core/constants.js +0 -33
  444. package/core/contextmenu.js +0 -398
  445. package/core/contextmenu_items.js +0 -651
  446. package/core/contextmenu_registry.js +0 -178
  447. package/core/css.js +0 -568
  448. package/core/delete_area.js +0 -87
  449. package/core/dialog.js +0 -107
  450. package/core/drag_target.js +0 -98
  451. package/core/dropdowndiv.js +0 -754
  452. package/core/events/events.js +0 -147
  453. package/core/events/events_abstract.js +0 -133
  454. package/core/events/events_block_base.js +0 -70
  455. package/core/events/events_block_change.js +0 -179
  456. package/core/events/events_block_create.js +0 -127
  457. package/core/events/events_block_delete.js +0 -139
  458. package/core/events/events_block_drag.js +0 -89
  459. package/core/events/events_block_move.js +0 -202
  460. package/core/events/events_bubble_open.js +0 -90
  461. package/core/events/events_click.js +0 -87
  462. package/core/events/events_comment_base.js +0 -121
  463. package/core/events/events_comment_change.js +0 -105
  464. package/core/events/events_comment_create.js +0 -84
  465. package/core/events/events_comment_delete.js +0 -81
  466. package/core/events/events_comment_move.js +0 -157
  467. package/core/events/events_marker_move.js +0 -110
  468. package/core/events/events_selected.js +0 -83
  469. package/core/events/events_theme_change.js +0 -72
  470. package/core/events/events_toolbox_item_select.js +0 -84
  471. package/core/events/events_trashcan_open.js +0 -73
  472. package/core/events/events_ui.js +0 -88
  473. package/core/events/events_ui_base.js +0 -63
  474. package/core/events/events_var_base.js +0 -70
  475. package/core/events/events_var_create.js +0 -89
  476. package/core/events/events_var_delete.js +0 -89
  477. package/core/events/events_var_rename.js +0 -90
  478. package/core/events/events_viewport.js +0 -107
  479. package/core/events/utils.js +0 -600
  480. package/core/events/workspace_events.js +0 -93
  481. package/core/extensions.js +0 -523
  482. package/core/field.js +0 -1282
  483. package/core/field_angle.js +0 -591
  484. package/core/field_checkbox.js +0 -255
  485. package/core/field_colour.js +0 -717
  486. package/core/field_dropdown.js +0 -795
  487. package/core/field_image.js +0 -304
  488. package/core/field_label.js +0 -149
  489. package/core/field_label_serializable.js +0 -80
  490. package/core/field_multilineinput.js +0 -463
  491. package/core/field_number.js +0 -340
  492. package/core/field_registry.js +0 -80
  493. package/core/field_textinput.js +0 -619
  494. package/core/field_variable.js +0 -558
  495. package/core/flyout_base.js +0 -1254
  496. package/core/flyout_button.js +0 -356
  497. package/core/flyout_horizontal.js +0 -391
  498. package/core/flyout_metrics_manager.js +0 -106
  499. package/core/flyout_vertical.js +0 -395
  500. package/core/generator.js +0 -564
  501. package/core/gesture.js +0 -1026
  502. package/core/grid.js +0 -226
  503. package/core/icon.js +0 -225
  504. package/core/inject.js +0 -389
  505. package/core/input.js +0 -332
  506. package/core/input_types.js +0 -36
  507. package/core/insertion_marker_manager.js +0 -790
  508. package/core/interfaces/i_ast_node_location.js +0 -26
  509. package/core/interfaces/i_ast_node_location_svg.js +0 -45
  510. package/core/interfaces/i_ast_node_location_with_block.js +0 -41
  511. package/core/interfaces/i_autohideable.js +0 -40
  512. package/core/interfaces/i_block_dragger.js +0 -66
  513. package/core/interfaces/i_bounded_element.js +0 -45
  514. package/core/interfaces/i_bubble.js +0 -95
  515. package/core/interfaces/i_collapsible_toolbox_item.js +0 -53
  516. package/core/interfaces/i_component.js +0 -37
  517. package/core/interfaces/i_connection_checker.js +0 -104
  518. package/core/interfaces/i_contextmenu.js +0 -32
  519. package/core/interfaces/i_copyable.js +0 -49
  520. package/core/interfaces/i_deletable.js +0 -33
  521. package/core/interfaces/i_delete_area.js +0 -50
  522. package/core/interfaces/i_drag_target.js +0 -88
  523. package/core/interfaces/i_draggable.js +0 -31
  524. package/core/interfaces/i_flyout.js +0 -201
  525. package/core/interfaces/i_keyboard_accessible.js +0 -38
  526. package/core/interfaces/i_metrics_manager.js +0 -154
  527. package/core/interfaces/i_movable.js +0 -33
  528. package/core/interfaces/i_positionable.js +0 -51
  529. package/core/interfaces/i_registrable.js +0 -29
  530. package/core/interfaces/i_registrable_field.js +0 -39
  531. package/core/interfaces/i_selectable.js +0 -51
  532. package/core/interfaces/i_selectable_toolbox_item.js +0 -73
  533. package/core/interfaces/i_serializer.js +0 -77
  534. package/core/interfaces/i_styleable.js +0 -39
  535. package/core/interfaces/i_toolbox.js +0 -142
  536. package/core/interfaces/i_toolbox_item.js +0 -85
  537. package/core/internal_constants.js +0 -72
  538. package/core/keyboard_nav/ast_node.js +0 -741
  539. package/core/keyboard_nav/basic_cursor.js +0 -225
  540. package/core/keyboard_nav/cursor.js +0 -144
  541. package/core/keyboard_nav/marker.js +0 -134
  542. package/core/keyboard_nav/tab_navigate_cursor.js +0 -52
  543. package/core/marker_manager.js +0 -213
  544. package/core/menu.js +0 -482
  545. package/core/menuitem.js +0 -292
  546. package/core/metrics_manager.js +0 -495
  547. package/core/msg.js +0 -24
  548. package/core/mutator.js +0 -575
  549. package/core/names.js +0 -289
  550. package/core/options.js +0 -391
  551. package/core/positionable_helpers.js +0 -188
  552. package/core/procedures.js +0 -452
  553. package/core/registry.js +0 -384
  554. package/core/rendered_connection.js +0 -588
  555. package/core/renderers/common/block_rendering.js +0 -170
  556. package/core/renderers/common/constants.js +0 -1250
  557. package/core/renderers/common/debug.js +0 -67
  558. package/core/renderers/common/debugger.js +0 -457
  559. package/core/renderers/common/drawer.js +0 -475
  560. package/core/renderers/common/i_path_object.js +0 -162
  561. package/core/renderers/common/info.js +0 -775
  562. package/core/renderers/common/marker_svg.js +0 -721
  563. package/core/renderers/common/path_object.js +0 -283
  564. package/core/renderers/common/renderer.js +0 -305
  565. package/core/renderers/geras/constants.js +0 -73
  566. package/core/renderers/geras/drawer.js +0 -220
  567. package/core/renderers/geras/geras.js +0 -36
  568. package/core/renderers/geras/highlight_constants.js +0 -299
  569. package/core/renderers/geras/highlighter.js +0 -311
  570. package/core/renderers/geras/info.js +0 -488
  571. package/core/renderers/geras/measurables/inline_input.js +0 -58
  572. package/core/renderers/geras/measurables/statement_input.js +0 -57
  573. package/core/renderers/geras/path_object.js +0 -166
  574. package/core/renderers/geras/renderer.js +0 -149
  575. package/core/renderers/measurables/base.js +0 -64
  576. package/core/renderers/measurables/bottom_row.js +0 -138
  577. package/core/renderers/measurables/connection.js +0 -56
  578. package/core/renderers/measurables/external_value_input.js +0 -70
  579. package/core/renderers/measurables/field.js +0 -71
  580. package/core/renderers/measurables/hat.js +0 -50
  581. package/core/renderers/measurables/icon.js +0 -58
  582. package/core/renderers/measurables/in_row_spacer.js +0 -47
  583. package/core/renderers/measurables/inline_input.js +0 -80
  584. package/core/renderers/measurables/input_connection.js +0 -75
  585. package/core/renderers/measurables/input_row.js +0 -89
  586. package/core/renderers/measurables/jagged_edge.js +0 -46
  587. package/core/renderers/measurables/next_connection.js +0 -50
  588. package/core/renderers/measurables/output_connection.js +0 -61
  589. package/core/renderers/measurables/previous_connection.js +0 -50
  590. package/core/renderers/measurables/round_corner.js +0 -52
  591. package/core/renderers/measurables/row.js +0 -247
  592. package/core/renderers/measurables/spacer_row.js +0 -69
  593. package/core/renderers/measurables/square_corner.js +0 -50
  594. package/core/renderers/measurables/statement_input.js +0 -59
  595. package/core/renderers/measurables/top_row.js +0 -143
  596. package/core/renderers/measurables/types.js +0 -353
  597. package/core/renderers/minimalist/constants.js +0 -37
  598. package/core/renderers/minimalist/drawer.js +0 -42
  599. package/core/renderers/minimalist/info.js +0 -54
  600. package/core/renderers/minimalist/minimalist.js +0 -26
  601. package/core/renderers/minimalist/renderer.js +0 -80
  602. package/core/renderers/thrasos/info.js +0 -339
  603. package/core/renderers/thrasos/renderer.js +0 -53
  604. package/core/renderers/thrasos/thrasos.js +0 -22
  605. package/core/renderers/zelos/constants.js +0 -1005
  606. package/core/renderers/zelos/drawer.js +0 -250
  607. package/core/renderers/zelos/info.js +0 -624
  608. package/core/renderers/zelos/marker_svg.js +0 -179
  609. package/core/renderers/zelos/measurables/bottom_row.js +0 -66
  610. package/core/renderers/zelos/measurables/inputs.js +0 -57
  611. package/core/renderers/zelos/measurables/row_elements.js +0 -46
  612. package/core/renderers/zelos/measurables/top_row.js +0 -71
  613. package/core/renderers/zelos/path_object.js +0 -247
  614. package/core/renderers/zelos/renderer.js +0 -147
  615. package/core/renderers/zelos/zelos.js +0 -38
  616. package/core/scrollbar.js +0 -891
  617. package/core/scrollbar_pair.js +0 -329
  618. package/core/serialization/blocks.js +0 -699
  619. package/core/serialization/exceptions.js +0 -144
  620. package/core/serialization/priorities.js +0 -38
  621. package/core/serialization/registry.js +0 -45
  622. package/core/serialization/variables.js +0 -98
  623. package/core/serialization/workspaces.js +0 -103
  624. package/core/shortcut_items.js +0 -302
  625. package/core/shortcut_registry.js +0 -366
  626. package/core/sprites.js +0 -31
  627. package/core/theme/classic.js +0 -56
  628. package/core/theme/themes.js +0 -23
  629. package/core/theme/zelos.js +0 -94
  630. package/core/theme.js +0 -228
  631. package/core/theme_manager.js +0 -211
  632. package/core/toolbox/category.js +0 -751
  633. package/core/toolbox/collapsible_category.js +0 -311
  634. package/core/toolbox/separator.js +0 -133
  635. package/core/toolbox/toolbox.js +0 -1160
  636. package/core/toolbox/toolbox_item.js +0 -173
  637. package/core/tooltip.js +0 -541
  638. package/core/touch.js +0 -285
  639. package/core/touch_gesture.js +0 -333
  640. package/core/trashcan.js +0 -757
  641. package/core/utils/aria.js +0 -174
  642. package/core/utils/array.js +0 -34
  643. package/core/utils/colour.js +0 -288
  644. package/core/utils/coordinate.js +0 -138
  645. package/core/utils/deprecation.js +0 -41
  646. package/core/utils/dom.js +0 -430
  647. package/core/utils/global.js +0 -41
  648. package/core/utils/idgenerator.js +0 -83
  649. package/core/utils/keycodes.js +0 -172
  650. package/core/utils/math.js +0 -63
  651. package/core/utils/metrics.js +0 -154
  652. package/core/utils/object.js +0 -91
  653. package/core/utils/parsing.js +0 -261
  654. package/core/utils/rect.js +0 -75
  655. package/core/utils/sentinel.js +0 -25
  656. package/core/utils/size.js +0 -65
  657. package/core/utils/string.js +0 -305
  658. package/core/utils/style.js +0 -296
  659. package/core/utils/svg.js +0 -186
  660. package/core/utils/svg_math.js +0 -268
  661. package/core/utils/svg_paths.js +0 -149
  662. package/core/utils/toolbox.js +0 -459
  663. package/core/utils/useragent.js +0 -197
  664. package/core/utils/xml.js +0 -107
  665. package/core/utils.js +0 -383
  666. package/core/variable_map.js +0 -410
  667. package/core/variable_model.js +0 -96
  668. package/core/variables.js +0 -578
  669. package/core/variables_dynamic.js +0 -129
  670. package/core/warning.js +0 -175
  671. package/core/widgetdiv.js +0 -290
  672. package/core/workspace.js +0 -836
  673. package/core/workspace_audio.js +0 -169
  674. package/core/workspace_comment.js +0 -400
  675. package/core/workspace_comment_svg.js +0 -1224
  676. package/core/workspace_drag_surface_svg.js +0 -194
  677. package/core/workspace_dragger.js +0 -115
  678. package/core/workspace_svg.js +0 -2735
  679. package/core/xml.js +0 -1043
  680. package/core/zoom_controls.js +0 -507
  681. package/generators/dart/all.js +0 -25
  682. package/generators/dart/colour.js +0 -105
  683. package/generators/dart/lists.js +0 -431
  684. package/generators/dart/logic.js +0 -123
  685. package/generators/dart/loops.js +0 -161
  686. package/generators/dart/math.js +0 -446
  687. package/generators/dart/procedures.js +0 -105
  688. package/generators/dart/text.js +0 -338
  689. package/generators/dart/variables.js +0 -32
  690. package/generators/dart/variables_dynamic.js +0 -21
  691. package/generators/dart.js +0 -304
  692. package/generators/javascript/all.js +0 -25
  693. package/generators/javascript/colour.js +0 -85
  694. package/generators/javascript/lists.js +0 -405
  695. package/generators/javascript/logic.js +0 -127
  696. package/generators/javascript/loops.js +0 -180
  697. package/generators/javascript/math.js +0 -401
  698. package/generators/javascript/procedures.js +0 -110
  699. package/generators/javascript/text.js +0 -371
  700. package/generators/javascript/variables.js +0 -32
  701. package/generators/javascript/variables_dynamic.js +0 -21
  702. package/generators/javascript.js +0 -324
  703. package/generators/lua/all.js +0 -25
  704. package/generators/lua/colour.js +0 -71
  705. package/generators/lua/lists.js +0 -348
  706. package/generators/lua/logic.js +0 -112
  707. package/generators/lua/loops.js +0 -168
  708. package/generators/lua/math.js +0 -406
  709. package/generators/lua/procedures.js +0 -106
  710. package/generators/lua/text.js +0 -327
  711. package/generators/lua/variables.js +0 -31
  712. package/generators/lua/variables_dynamic.js +0 -21
  713. package/generators/lua.js +0 -207
  714. package/generators/php/all.js +0 -25
  715. package/generators/php/colour.js +0 -81
  716. package/generators/php/lists.js +0 -482
  717. package/generators/php/logic.js +0 -119
  718. package/generators/php/loops.js +0 -161
  719. package/generators/php/math.js +0 -349
  720. package/generators/php/procedures.js +0 -125
  721. package/generators/php/text.js +0 -255
  722. package/generators/php/variables.js +0 -32
  723. package/generators/php/variables_dynamic.js +0 -21
  724. package/generators/php.js +0 -304
  725. package/generators/python/all.js +0 -25
  726. package/generators/python/colour.js +0 -67
  727. package/generators/python/lists.js +0 -346
  728. package/generators/python/logic.js +0 -120
  729. package/generators/python/loops.js +0 -209
  730. package/generators/python/math.js +0 -373
  731. package/generators/python/procedures.js +0 -129
  732. package/generators/python/text.js +0 -291
  733. package/generators/python/variables.js +0 -32
  734. package/generators/python/variables_dynamic.js +0 -21
  735. package/generators/python.js +0 -334
@@ -0,0 +1,871 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2011 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import './events/events_block_change.js';
7
+ import './events/events_block_create.js';
8
+ import './events/events_block_delete.js';
9
+ import type { Comment } from './comment.js';
10
+ import { Connection } from './connection.js';
11
+ import type { Abstract } from './events/events_abstract.js';
12
+ import type { Field } from './field.js';
13
+ import { Input } from './input.js';
14
+ import type { IASTNodeLocation } from './interfaces/i_ast_node_location.js';
15
+ import type { IDeletable } from './interfaces/i_deletable.js';
16
+ import type { Mutator } from './mutator.js';
17
+ import * as Tooltip from './tooltip.js';
18
+ import { Coordinate } from './utils/coordinate.js';
19
+ import { Size } from './utils/size.js';
20
+ import type { VariableModel } from './variable_model.js';
21
+ import type { Workspace } from './workspace.js';
22
+ /**
23
+ * Class for one block.
24
+ * Not normally called directly, workspace.newBlock() is preferred.
25
+ *
26
+ * @alias Blockly.Block
27
+ */
28
+ export declare class Block implements IASTNodeLocation, IDeletable {
29
+ /**
30
+ * An optional callback method to use whenever the block's parent workspace
31
+ * changes. This is usually only called from the constructor, the block type
32
+ * initializer function, or an extension initializer function.
33
+ */
34
+ onchange?: ((p1: Abstract) => any) | null;
35
+ /** The language-neutral ID given to the collapsed input. */
36
+ static readonly COLLAPSED_INPUT_NAME: string;
37
+ /** The language-neutral ID given to the collapsed field. */
38
+ static readonly COLLAPSED_FIELD_NAME: string;
39
+ /**
40
+ * Optional text data that round-trips between blocks and XML.
41
+ * Has no effect. May be used by 3rd parties for meta information.
42
+ */
43
+ data: string | null;
44
+ /**
45
+ * Has this block been disposed of?
46
+ *
47
+ * @internal
48
+ */
49
+ disposed: boolean;
50
+ /**
51
+ * Colour of the block as HSV hue value (0-360)
52
+ * This may be null if the block colour was not set via a hue number.
53
+ */
54
+ private hue_;
55
+ /** Colour of the block in '#RRGGBB' format. */
56
+ protected colour_: string;
57
+ /** Name of the block style. */
58
+ protected styleName_: string;
59
+ /** An optional method called during initialization. */
60
+ init?: (() => any) | null;
61
+ /**
62
+ * An optional serialization method for defining how to serialize the
63
+ * mutation state to XML. This must be coupled with defining
64
+ * `domToMutation`.
65
+ */
66
+ mutationToDom?: ((...p1: any[]) => Element) | null;
67
+ /**
68
+ * An optional deserialization method for defining how to deserialize the
69
+ * mutation state from XML. This must be coupled with defining
70
+ * `mutationToDom`.
71
+ */
72
+ domToMutation?: ((p1: Element) => any) | null;
73
+ /**
74
+ * An optional serialization method for defining how to serialize the
75
+ * block's extra state (eg mutation state) to something JSON compatible.
76
+ * This must be coupled with defining `loadExtraState`.
77
+ */
78
+ saveExtraState?: (() => any) | null;
79
+ /**
80
+ * An optional serialization method for defining how to deserialize the
81
+ * block's extra state (eg mutation state) from something JSON compatible.
82
+ * This must be coupled with defining `saveExtraState`.
83
+ */
84
+ loadExtraState?: ((p1: any) => any) | null;
85
+ /**
86
+ * An optional property for suppressing adding STATEMENT_PREFIX and
87
+ * STATEMENT_SUFFIX to generated code.
88
+ */
89
+ suppressPrefixSuffix: boolean | null;
90
+ /**
91
+ * An optional property for declaring developer variables. Return a list of
92
+ * variable names for use by generators. Developer variables are never
93
+ * shown to the user, but are declared as global variables in the generated
94
+ * code.
95
+ */
96
+ getDeveloperVariables?: (() => string[]);
97
+ /**
98
+ * An optional function that reconfigures the block based on the contents of
99
+ * the mutator dialog.
100
+ */
101
+ compose?: ((p1: Block) => void);
102
+ /**
103
+ * An optional function that populates the mutator's dialog with
104
+ * this block's components.
105
+ */
106
+ decompose?: ((p1: Workspace) => Block);
107
+ id: string;
108
+ outputConnection: Connection;
109
+ nextConnection: Connection;
110
+ previousConnection: Connection;
111
+ inputList: Input[];
112
+ inputsInline?: boolean;
113
+ private disabled;
114
+ tooltip: Tooltip.TipInfo;
115
+ contextMenu: boolean;
116
+ protected parentBlock_: this | null;
117
+ protected childBlocks_: this[];
118
+ private deletable_;
119
+ private movable_;
120
+ private editable_;
121
+ private isShadow_;
122
+ protected collapsed_: boolean;
123
+ protected outputShape_: number | null;
124
+ /**
125
+ * A string representing the comment attached to this block.
126
+ *
127
+ * @deprecated August 2019. Use getCommentText instead.
128
+ */
129
+ comment: string | Comment | null;
130
+ /** @internal */
131
+ commentModel: CommentModel;
132
+ private readonly xy_;
133
+ isInFlyout: boolean;
134
+ isInMutator: boolean;
135
+ RTL: boolean;
136
+ /** True if this block is an insertion marker. */
137
+ protected isInsertionMarker_: boolean;
138
+ /** Name of the type of hat. */
139
+ hat?: string;
140
+ rendered: boolean | null;
141
+ /**
142
+ * String for block help, or function that returns a URL. Null for no help.
143
+ */
144
+ helpUrl: string | Function;
145
+ /** A bound callback function to use when the parent workspace changes. */
146
+ private onchangeWrapper_;
147
+ /**
148
+ * A count of statement inputs on the block.
149
+ *
150
+ * @internal
151
+ */
152
+ statementInputCount: number;
153
+ type: string;
154
+ inputsInlineDefault?: boolean;
155
+ workspace: Workspace;
156
+ /**
157
+ * @param workspace The block's workspace.
158
+ * @param prototypeName Name of the language object containing type-specific
159
+ * functions for this block.
160
+ * @param opt_id Optional ID. Use this ID if provided, otherwise create a new
161
+ * ID.
162
+ * @throws When the prototypeName is not valid or not allowed.
163
+ */
164
+ constructor(workspace: Workspace, prototypeName: string, opt_id?: string);
165
+ /** Calls the init() function and handles associated event firing, etc. */
166
+ protected doInit_(): void;
167
+ /**
168
+ * Dispose of this block.
169
+ *
170
+ * @param healStack If true, then try to heal any gap by connecting the next
171
+ * statement with the previous statement. Otherwise, dispose of all
172
+ * children of this block.
173
+ * @suppress {checkTypes}
174
+ */
175
+ dispose(healStack: boolean): void;
176
+ /**
177
+ * Call initModel on all fields on the block.
178
+ * May be called more than once.
179
+ * Either initModel or initSvg must be called after creating a block and
180
+ * before the first interaction with it. Interactions include UI actions
181
+ * (e.g. clicking and dragging) and firing events (e.g. create, delete, and
182
+ * change).
183
+ */
184
+ initModel(): void;
185
+ /**
186
+ * Unplug this block from its superior block. If this block is a statement,
187
+ * optionally reconnect the block underneath with the block on top.
188
+ *
189
+ * @param opt_healStack Disconnect child statement and reconnect stack.
190
+ * Defaults to false.
191
+ */
192
+ unplug(opt_healStack?: boolean): void;
193
+ /**
194
+ * Unplug this block's output from an input on another block. Optionally
195
+ * reconnect the block's parent to the only child block, if possible.
196
+ *
197
+ * @param opt_healStack Disconnect right-side block and connect to left-side
198
+ * block. Defaults to false.
199
+ */
200
+ private unplugFromRow_;
201
+ /**
202
+ * Returns the connection on the value input that is connected to another
203
+ * block. When an insertion marker is connected to a connection with a block
204
+ * already attached, the connected block is attached to the insertion marker.
205
+ * Since only one block can be displaced and attached to the insertion marker
206
+ * this should only ever return one connection.
207
+ *
208
+ * @returns The connection on the value input, or null.
209
+ */
210
+ private getOnlyValueConnection_;
211
+ /**
212
+ * Unplug this statement block from its superior block. Optionally reconnect
213
+ * the block underneath with the block on top.
214
+ *
215
+ * @param opt_healStack Disconnect child statement and reconnect stack.
216
+ * Defaults to false.
217
+ */
218
+ private unplugFromStack_;
219
+ /**
220
+ * Returns all connections originating from this block.
221
+ *
222
+ * @param _all If true, return all connections even hidden ones.
223
+ * @returns Array of connections.
224
+ * @internal
225
+ */
226
+ getConnections_(_all: boolean): Connection[];
227
+ /**
228
+ * Walks down a stack of blocks and finds the last next connection on the
229
+ * stack.
230
+ *
231
+ * @param ignoreShadows If true,the last connection on a non-shadow block will
232
+ * be returned. If false, this will follow shadows to find the last
233
+ * connection.
234
+ * @returns The last next connection on the stack, or null.
235
+ * @internal
236
+ */
237
+ lastConnectionInStack(ignoreShadows: boolean): Connection | null;
238
+ /**
239
+ * Bump unconnected blocks out of alignment. Two blocks which aren't actually
240
+ * connected should not coincidentally line up on screen.
241
+ */
242
+ bumpNeighbours(): void;
243
+ /**
244
+ * Return the parent block or null if this block is at the top level. The
245
+ * parent block is either the block connected to the previous connection (for
246
+ * a statement block) or the block connected to the output connection (for a
247
+ * value block).
248
+ *
249
+ * @returns The block (if any) that holds the current block.
250
+ */
251
+ getParent(): this | null;
252
+ /**
253
+ * Return the input that connects to the specified block.
254
+ *
255
+ * @param block A block connected to an input on this block.
256
+ * @returns The input (if any) that connects to the specified block.
257
+ */
258
+ getInputWithBlock(block: Block): Input | null;
259
+ /**
260
+ * Return the parent block that surrounds the current block, or null if this
261
+ * block has no surrounding block. A parent block might just be the previous
262
+ * statement, whereas the surrounding block is an if statement, while loop,
263
+ * etc.
264
+ *
265
+ * @returns The block (if any) that surrounds the current block.
266
+ */
267
+ getSurroundParent(): this | null;
268
+ /**
269
+ * Return the next statement block directly connected to this block.
270
+ *
271
+ * @returns The next statement block or null.
272
+ */
273
+ getNextBlock(): Block | null;
274
+ /**
275
+ * Returns the block connected to the previous connection.
276
+ *
277
+ * @returns The previous statement block or null.
278
+ */
279
+ getPreviousBlock(): Block | null;
280
+ /**
281
+ * Return the connection on the first statement input on this block, or null
282
+ * if there are none.
283
+ *
284
+ * @returns The first statement connection or null.
285
+ * @internal
286
+ */
287
+ getFirstStatementConnection(): Connection | null;
288
+ /**
289
+ * Return the top-most block in this block's tree.
290
+ * This will return itself if this block is at the top level.
291
+ *
292
+ * @returns The root block.
293
+ */
294
+ getRootBlock(): this;
295
+ /**
296
+ * Walk up from the given block up through the stack of blocks to find
297
+ * the top block of the sub stack. If we are nested in a statement input only
298
+ * find the top-most nested block. Do not go all the way to the root block.
299
+ *
300
+ * @returns The top block in a stack.
301
+ * @internal
302
+ */
303
+ getTopStackBlock(): this;
304
+ /**
305
+ * Find all the blocks that are directly nested inside this one.
306
+ * Includes value and statement inputs, as well as any following statement.
307
+ * Excludes any connection on an output tab or any preceding statement.
308
+ * Blocks are optionally sorted by position; top to bottom.
309
+ *
310
+ * @param ordered Sort the list if true.
311
+ * @returns Array of blocks.
312
+ */
313
+ getChildren(ordered: boolean): Block[];
314
+ /**
315
+ * Set parent of this block to be a new block or null.
316
+ *
317
+ * @param newParent New parent block.
318
+ * @internal
319
+ */
320
+ setParent(newParent: this | null): void;
321
+ /**
322
+ * Find all the blocks that are directly or indirectly nested inside this one.
323
+ * Includes this block in the list.
324
+ * Includes value and statement inputs, as well as any following statements.
325
+ * Excludes any connection on an output tab or any preceding statements.
326
+ * Blocks are optionally sorted by position; top to bottom.
327
+ *
328
+ * @param ordered Sort the list if true.
329
+ * @returns Flattened array of blocks.
330
+ */
331
+ getDescendants(ordered: boolean): this[];
332
+ /**
333
+ * Get whether this block is deletable or not.
334
+ *
335
+ * @returns True if deletable.
336
+ */
337
+ isDeletable(): boolean;
338
+ /**
339
+ * Set whether this block is deletable or not.
340
+ *
341
+ * @param deletable True if deletable.
342
+ */
343
+ setDeletable(deletable: boolean): void;
344
+ /**
345
+ * Get whether this block is movable or not.
346
+ *
347
+ * @returns True if movable.
348
+ */
349
+ isMovable(): boolean;
350
+ /**
351
+ * Set whether this block is movable or not.
352
+ *
353
+ * @param movable True if movable.
354
+ */
355
+ setMovable(movable: boolean): void;
356
+ /**
357
+ * Get whether is block is duplicatable or not. If duplicating this block and
358
+ * descendants will put this block over the workspace's capacity this block is
359
+ * not duplicatable. If duplicating this block and descendants will put any
360
+ * type over their maxInstances this block is not duplicatable.
361
+ *
362
+ * @returns True if duplicatable.
363
+ */
364
+ isDuplicatable(): boolean;
365
+ /**
366
+ * Get whether this block is a shadow block or not.
367
+ *
368
+ * @returns True if a shadow.
369
+ */
370
+ isShadow(): boolean;
371
+ /**
372
+ * Set whether this block is a shadow block or not.
373
+ *
374
+ * @param shadow True if a shadow.
375
+ * @internal
376
+ */
377
+ setShadow(shadow: boolean): void;
378
+ /**
379
+ * Get whether this block is an insertion marker block or not.
380
+ *
381
+ * @returns True if an insertion marker.
382
+ */
383
+ isInsertionMarker(): boolean;
384
+ /**
385
+ * Set whether this block is an insertion marker block or not.
386
+ * Once set this cannot be unset.
387
+ *
388
+ * @param insertionMarker True if an insertion marker.
389
+ * @internal
390
+ */
391
+ setInsertionMarker(insertionMarker: boolean): void;
392
+ /**
393
+ * Get whether this block is editable or not.
394
+ *
395
+ * @returns True if editable.
396
+ */
397
+ isEditable(): boolean;
398
+ /**
399
+ * Set whether this block is editable or not.
400
+ *
401
+ * @param editable True if editable.
402
+ */
403
+ setEditable(editable: boolean): void;
404
+ /**
405
+ * Returns if this block has been disposed of / deleted.
406
+ *
407
+ * @returns True if this block has been disposed of / deleted.
408
+ */
409
+ isDisposed(): boolean;
410
+ /**
411
+ * Find the connection on this block that corresponds to the given connection
412
+ * on the other block.
413
+ * Used to match connections between a block and its insertion marker.
414
+ *
415
+ * @param otherBlock The other block to match against.
416
+ * @param conn The other connection to match.
417
+ * @returns The matching connection on this block, or null.
418
+ * @internal
419
+ */
420
+ getMatchingConnection(otherBlock: Block, conn: Connection): Connection | null;
421
+ /**
422
+ * Set the URL of this block's help page.
423
+ *
424
+ * @param url URL string for block help, or function that returns a URL. Null
425
+ * for no help.
426
+ */
427
+ setHelpUrl(url: string | Function): void;
428
+ /**
429
+ * Sets the tooltip for this block.
430
+ *
431
+ * @param newTip The text for the tooltip, a function that returns the text
432
+ * for the tooltip, or a parent object whose tooltip will be used. To not
433
+ * display a tooltip pass the empty string.
434
+ */
435
+ setTooltip(newTip: Tooltip.TipInfo): void;
436
+ /**
437
+ * Returns the tooltip text for this block.
438
+ *
439
+ * @returns The tooltip text for this block.
440
+ */
441
+ getTooltip(): string;
442
+ /**
443
+ * Get the colour of a block.
444
+ *
445
+ * @returns #RRGGBB string.
446
+ */
447
+ getColour(): string;
448
+ /**
449
+ * Get the name of the block style.
450
+ *
451
+ * @returns Name of the block style.
452
+ */
453
+ getStyleName(): string;
454
+ /**
455
+ * Get the HSV hue value of a block. Null if hue not set.
456
+ *
457
+ * @returns Hue value (0-360).
458
+ */
459
+ getHue(): number | null;
460
+ /**
461
+ * Change the colour of a block.
462
+ *
463
+ * @param colour HSV hue value (0 to 360), #RRGGBB string, or a message
464
+ * reference string pointing to one of those two values.
465
+ */
466
+ setColour(colour: number | string): void;
467
+ /**
468
+ * Set the style and colour values of a block.
469
+ *
470
+ * @param blockStyleName Name of the block style.
471
+ */
472
+ setStyle(blockStyleName: string): void;
473
+ /**
474
+ * Sets a callback function to use whenever the block's parent workspace
475
+ * changes, replacing any prior onchange handler. This is usually only called
476
+ * from the constructor, the block type initializer function, or an extension
477
+ * initializer function.
478
+ *
479
+ * @param onchangeFn The callback to call when the block's workspace changes.
480
+ * @throws {Error} if onchangeFn is not falsey and not a function.
481
+ */
482
+ setOnChange(onchangeFn: (p1: Abstract) => any): void;
483
+ /**
484
+ * Returns the named field from a block.
485
+ *
486
+ * @param name The name of the field.
487
+ * @returns Named field, or null if field does not exist.
488
+ */
489
+ getField(name: string): Field | null;
490
+ /**
491
+ * Return all variables referenced by this block.
492
+ *
493
+ * @returns List of variable ids.
494
+ */
495
+ getVars(): string[];
496
+ /**
497
+ * Return all variables referenced by this block.
498
+ *
499
+ * @returns List of variable models.
500
+ * @internal
501
+ */
502
+ getVarModels(): VariableModel[];
503
+ /**
504
+ * Notification that a variable is renaming but keeping the same ID. If the
505
+ * variable is in use on this block, rerender to show the new name.
506
+ *
507
+ * @param variable The variable being renamed.
508
+ * @internal
509
+ */
510
+ updateVarName(variable: VariableModel): void;
511
+ /**
512
+ * Notification that a variable is renaming.
513
+ * If the ID matches one of this block's variables, rename it.
514
+ *
515
+ * @param oldId ID of variable to rename.
516
+ * @param newId ID of new variable. May be the same as oldId, but with an
517
+ * updated name.
518
+ */
519
+ renameVarById(oldId: string, newId: string): void;
520
+ /**
521
+ * Returns the language-neutral value of the given field.
522
+ *
523
+ * @param name The name of the field.
524
+ * @returns Value of the field or null if field does not exist.
525
+ */
526
+ getFieldValue(name: string): any;
527
+ /**
528
+ * Sets the value of the given field for this block.
529
+ *
530
+ * @param newValue The value to set.
531
+ * @param name The name of the field to set the value of.
532
+ */
533
+ setFieldValue(newValue: any, name: string): void;
534
+ /**
535
+ * Set whether this block can chain onto the bottom of another block.
536
+ *
537
+ * @param newBoolean True if there can be a previous statement.
538
+ * @param opt_check Statement type or list of statement types. Null/undefined
539
+ * if any type could be connected.
540
+ */
541
+ setPreviousStatement(newBoolean: boolean, opt_check?: string | string[] | null): void;
542
+ /**
543
+ * Set whether another block can chain onto the bottom of this block.
544
+ *
545
+ * @param newBoolean True if there can be a next statement.
546
+ * @param opt_check Statement type or list of statement types. Null/undefined
547
+ * if any type could be connected.
548
+ */
549
+ setNextStatement(newBoolean: boolean, opt_check?: string | string[] | null): void;
550
+ /**
551
+ * Set whether this block returns a value.
552
+ *
553
+ * @param newBoolean True if there is an output.
554
+ * @param opt_check Returned type or list of returned types. Null or
555
+ * undefined if any type could be returned (e.g. variable get).
556
+ */
557
+ setOutput(newBoolean: boolean, opt_check?: string | string[] | null): void;
558
+ /**
559
+ * Set whether value inputs are arranged horizontally or vertically.
560
+ *
561
+ * @param newBoolean True if inputs are horizontal.
562
+ */
563
+ setInputsInline(newBoolean: boolean): void;
564
+ /**
565
+ * Get whether value inputs are arranged horizontally or vertically.
566
+ *
567
+ * @returns True if inputs are horizontal.
568
+ */
569
+ getInputsInline(): boolean;
570
+ /**
571
+ * Set the block's output shape.
572
+ *
573
+ * @param outputShape Value representing an output shape.
574
+ */
575
+ setOutputShape(outputShape: number | null): void;
576
+ /**
577
+ * Get the block's output shape.
578
+ *
579
+ * @returns Value representing output shape if one exists.
580
+ */
581
+ getOutputShape(): number | null;
582
+ /**
583
+ * Get whether this block is enabled or not.
584
+ *
585
+ * @returns True if enabled.
586
+ */
587
+ isEnabled(): boolean;
588
+ /**
589
+ * Set whether the block is enabled or not.
590
+ *
591
+ * @param enabled True if enabled.
592
+ */
593
+ setEnabled(enabled: boolean): void;
594
+ /**
595
+ * Get whether the block is disabled or not due to parents.
596
+ * The block's own disabled property is not considered.
597
+ *
598
+ * @returns True if disabled.
599
+ */
600
+ getInheritedDisabled(): boolean;
601
+ /**
602
+ * Get whether the block is collapsed or not.
603
+ *
604
+ * @returns True if collapsed.
605
+ */
606
+ isCollapsed(): boolean;
607
+ /**
608
+ * Set whether the block is collapsed or not.
609
+ *
610
+ * @param collapsed True if collapsed.
611
+ */
612
+ setCollapsed(collapsed: boolean): void;
613
+ /**
614
+ * Create a human-readable text representation of this block and any children.
615
+ *
616
+ * @param opt_maxLength Truncate the string to this length.
617
+ * @param opt_emptyToken The placeholder string used to denote an empty field.
618
+ * If not specified, '?' is used.
619
+ * @returns Text of block.
620
+ */
621
+ toString(opt_maxLength?: number, opt_emptyToken?: string): string;
622
+ /**
623
+ * Shortcut for appending a value input row.
624
+ *
625
+ * @param name Language-neutral identifier which may used to find this input
626
+ * again. Should be unique to this block.
627
+ * @returns The input object created.
628
+ */
629
+ appendValueInput(name: string): Input;
630
+ /**
631
+ * Shortcut for appending a statement input row.
632
+ *
633
+ * @param name Language-neutral identifier which may used to find this input
634
+ * again. Should be unique to this block.
635
+ * @returns The input object created.
636
+ */
637
+ appendStatementInput(name: string): Input;
638
+ /**
639
+ * Shortcut for appending a dummy input row.
640
+ *
641
+ * @param opt_name Language-neutral identifier which may used to find this
642
+ * input again. Should be unique to this block.
643
+ * @returns The input object created.
644
+ */
645
+ appendDummyInput(opt_name?: string): Input;
646
+ /**
647
+ * Initialize this block using a cross-platform, internationalization-friendly
648
+ * JSON description.
649
+ *
650
+ * @param json Structured data describing the block.
651
+ */
652
+ jsonInit(json: any): void;
653
+ /**
654
+ * Initialize the colour of this block from the JSON description.
655
+ *
656
+ * @param json Structured data describing the block.
657
+ * @param warningPrefix Warning prefix string identifying block.
658
+ */
659
+ private jsonInitColour_;
660
+ /**
661
+ * Initialize the style of this block from the JSON description.
662
+ *
663
+ * @param json Structured data describing the block.
664
+ * @param warningPrefix Warning prefix string identifying block.
665
+ */
666
+ private jsonInitStyle_;
667
+ /**
668
+ * Add key/values from mixinObj to this block object. By default, this method
669
+ * will check that the keys in mixinObj will not overwrite existing values in
670
+ * the block, including prototype values. This provides some insurance against
671
+ * mixin / extension incompatibilities with future block features. This check
672
+ * can be disabled by passing true as the second argument.
673
+ *
674
+ * @param mixinObj The key/values pairs to add to this block object.
675
+ * @param opt_disableCheck Option flag to disable overwrite checks.
676
+ */
677
+ mixin(mixinObj: any, opt_disableCheck?: boolean): void;
678
+ /**
679
+ * Interpolate a message description onto the block.
680
+ *
681
+ * @param message Text contains interpolation tokens (%1, %2, ...) that match
682
+ * with fields or inputs defined in the args array.
683
+ * @param args Array of arguments to be interpolated.
684
+ * @param lastDummyAlign If a dummy input is added at the end, how should it
685
+ * be aligned?
686
+ * @param warningPrefix Warning prefix string identifying block.
687
+ */
688
+ private interpolate_;
689
+ /**
690
+ * Validates that the tokens are within the correct bounds, with no
691
+ * duplicates, and that all of the arguments are referred to. Throws errors if
692
+ * any of these things are not true.
693
+ *
694
+ * @param tokens An array of tokens to validate
695
+ * @param argsCount The number of args that need to be referred to.
696
+ */
697
+ private validateTokens_;
698
+ /**
699
+ * Inserts args in place of numerical tokens. String args are converted to
700
+ * JSON that defines a label field. If necessary an extra dummy input is added
701
+ * to the end of the elements.
702
+ *
703
+ * @param tokens The tokens to interpolate
704
+ * @param args The arguments to insert.
705
+ * @param lastDummyAlign The alignment the added dummy input should have, if
706
+ * we are required to add one.
707
+ * @returns The JSON definitions of field and inputs to add to the block.
708
+ */
709
+ private interpolateArguments_;
710
+ /**
711
+ * Creates a field from the JSON definition of a field. If a field with the
712
+ * given type cannot be found, this attempts to create a different field using
713
+ * the 'alt' property of the JSON definition (if it exists).
714
+ *
715
+ * @param element The element to try to turn into a field.
716
+ * @returns The field defined by the JSON, or null if one couldn't be created.
717
+ */
718
+ private fieldFromJson_;
719
+ /**
720
+ * Creates an input from the JSON definition of an input. Sets the input's
721
+ * check and alignment if they are provided.
722
+ *
723
+ * @param element The JSON to turn into an input.
724
+ * @param warningPrefix The prefix to add to warnings to help the developer
725
+ * debug.
726
+ * @returns The input that has been created, or null if one could not be
727
+ * created for some reason (should never happen).
728
+ */
729
+ private inputFromJson_;
730
+ /**
731
+ * Returns true if the given string matches one of the input keywords.
732
+ *
733
+ * @param str The string to check.
734
+ * @returns True if the given string matches one of the input keywords, false
735
+ * otherwise.
736
+ */
737
+ private isInputKeyword_;
738
+ /**
739
+ * Turns a string into the JSON definition of a label field. If the string
740
+ * becomes an empty string when trimmed, this returns null.
741
+ *
742
+ * @param str String to turn into the JSON definition of a label field.
743
+ * @returns The JSON definition or null.
744
+ */
745
+ private stringToFieldJson_;
746
+ /**
747
+ * Add a value input, statement input or local variable to this block.
748
+ *
749
+ * @param type One of Blockly.inputTypes.
750
+ * @param name Language-neutral identifier which may used to find this input
751
+ * again. Should be unique to this block.
752
+ * @returns The input object created.
753
+ */
754
+ protected appendInput_(type: number, name: string): Input;
755
+ /**
756
+ * Move a named input to a different location on this block.
757
+ *
758
+ * @param name The name of the input to move.
759
+ * @param refName Name of input that should be after the moved input, or null
760
+ * to be the input at the end.
761
+ */
762
+ moveInputBefore(name: string, refName: string | null): void;
763
+ /**
764
+ * Move a numbered input to a different location on this block.
765
+ *
766
+ * @param inputIndex Index of the input to move.
767
+ * @param refIndex Index of input that should be after the moved input.
768
+ */
769
+ moveNumberedInputBefore(inputIndex: number, refIndex: number): void;
770
+ /**
771
+ * Remove an input from this block.
772
+ *
773
+ * @param name The name of the input.
774
+ * @param opt_quiet True to prevent an error if input is not present.
775
+ * @returns True if operation succeeds, false if input is not present and
776
+ * opt_quiet is true.
777
+ * @throws {Error} if the input is not present and opt_quiet is not true.
778
+ */
779
+ removeInput(name: string, opt_quiet?: boolean): boolean;
780
+ /**
781
+ * Fetches the named input object.
782
+ *
783
+ * @param name The name of the input.
784
+ * @returns The input object, or null if input does not exist.
785
+ */
786
+ getInput(name: string): Input | null;
787
+ /**
788
+ * Fetches the block attached to the named input.
789
+ *
790
+ * @param name The name of the input.
791
+ * @returns The attached value block, or null if the input is either
792
+ * disconnected or if the input does not exist.
793
+ */
794
+ getInputTargetBlock(name: string): Block | null;
795
+ /**
796
+ * Returns the comment on this block (or null if there is no comment).
797
+ *
798
+ * @returns Block's comment.
799
+ */
800
+ getCommentText(): string | null;
801
+ /**
802
+ * Set this block's comment text.
803
+ *
804
+ * @param text The text, or null to delete.
805
+ */
806
+ setCommentText(text: string | null): void;
807
+ /**
808
+ * Set this block's warning text.
809
+ *
810
+ * @param _text The text, or null to delete.
811
+ * @param _opt_id An optional ID for the warning text to be able to maintain
812
+ * multiple warnings.
813
+ */
814
+ setWarningText(_text: string | null, _opt_id?: string): void;
815
+ /**
816
+ * Give this block a mutator dialog.
817
+ *
818
+ * @param _mutator A mutator dialog instance or null to remove.
819
+ */
820
+ setMutator(_mutator: Mutator): void;
821
+ /**
822
+ * Return the coordinates of the top-left corner of this block relative to the
823
+ * drawing surface's origin (0,0), in workspace units.
824
+ *
825
+ * @returns Object with .x and .y properties.
826
+ */
827
+ getRelativeToSurfaceXY(): Coordinate;
828
+ /**
829
+ * Move a block by a relative offset.
830
+ *
831
+ * @param dx Horizontal offset, in workspace units.
832
+ * @param dy Vertical offset, in workspace units.
833
+ */
834
+ moveBy(dx: number, dy: number): void;
835
+ /**
836
+ * Create a connection of the specified type.
837
+ *
838
+ * @param type The type of the connection to create.
839
+ * @returns A new connection of the specified type.
840
+ */
841
+ protected makeConnection_(type: number): Connection;
842
+ /**
843
+ * Recursively checks whether all statement and value inputs are filled with
844
+ * blocks. Also checks all following statement blocks in this stack.
845
+ *
846
+ * @param opt_shadowBlocksAreFilled An optional argument controlling whether
847
+ * shadow blocks are counted as filled. Defaults to true.
848
+ * @returns True if all inputs are filled, false otherwise.
849
+ */
850
+ allInputsFilled(opt_shadowBlocksAreFilled?: boolean): boolean;
851
+ /**
852
+ * This method returns a string describing this Block in developer terms (type
853
+ * name and ID; English only).
854
+ *
855
+ * Intended to on be used in console logs and errors. If you need a string
856
+ * that uses the user's native language (including block text, field values,
857
+ * and child blocks), use [toString()]{@link Block#toString}.
858
+ *
859
+ * @returns The description.
860
+ */
861
+ toDevString(): string;
862
+ }
863
+ export declare namespace Block {
864
+ interface CommentModel {
865
+ text: string | null;
866
+ pinned: boolean;
867
+ size: Size;
868
+ }
869
+ }
870
+ export declare type CommentModel = Block.CommentModel;
871
+ //# sourceMappingURL=block.d.ts.map