blockly 12.0.0-beta.4 → 12.0.0-beta.6

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 (336) hide show
  1. package/blockly.min.js +715 -664
  2. package/blockly.mjs +11 -1
  3. package/blockly_compressed.js +679 -661
  4. package/blockly_compressed.js.map +1 -1
  5. package/blocks_compressed.js +3 -3
  6. package/blocks_compressed.js.map +1 -1
  7. package/core/block.d.ts +1 -16
  8. package/core/block_svg.d.ts +19 -31
  9. package/core/blockly.d.ts +15 -7
  10. package/core/bubbles/bubble.d.ts +22 -3
  11. package/core/bubbles/textinput_bubble.d.ts +3 -5
  12. package/core/comments/rendered_workspace_comment.d.ts +11 -0
  13. package/core/common.d.ts +19 -7
  14. package/core/connection.d.ts +3 -2
  15. package/core/contextmenu_registry.d.ts +11 -9
  16. package/core/dialog.d.ts +36 -16
  17. package/core/events/events.d.ts +0 -2
  18. package/core/events/predicates.d.ts +0 -3
  19. package/core/events/utils.d.ts +1 -5
  20. package/core/field.d.ts +28 -30
  21. package/core/field_dropdown.d.ts +17 -3
  22. package/core/field_image.d.ts +0 -2
  23. package/core/field_input.d.ts +9 -0
  24. package/core/field_variable.d.ts +0 -2
  25. package/core/flyout_base.d.ts +25 -1
  26. package/core/flyout_button.d.ts +15 -13
  27. package/core/flyout_item.d.ts +3 -9
  28. package/core/flyout_navigator.d.ts +11 -0
  29. package/core/flyout_separator.d.ts +20 -1
  30. package/core/focus_manager.d.ts +86 -14
  31. package/core/icons/comment_icon.d.ts +3 -0
  32. package/core/icons/icon.d.ts +13 -0
  33. package/core/icons/mutator_icon.d.ts +3 -0
  34. package/core/icons/warning_icon.d.ts +3 -0
  35. package/core/interfaces/i_autohideable.d.ts +2 -0
  36. package/core/interfaces/i_bubble.d.ts +2 -1
  37. package/core/interfaces/i_flyout.d.ts +2 -1
  38. package/core/interfaces/i_focusable_node.d.ts +71 -8
  39. package/core/interfaces/i_focusable_tree.d.ts +67 -0
  40. package/core/interfaces/i_has_bubble.d.ts +13 -0
  41. package/core/interfaces/i_icon.d.ts +2 -1
  42. package/core/interfaces/i_navigation_policy.d.ts +63 -0
  43. package/core/interfaces/i_selectable.d.ts +7 -1
  44. package/core/interfaces/i_toolbox.d.ts +2 -1
  45. package/core/interfaces/i_toolbox_item.d.ts +2 -1
  46. package/core/keyboard_nav/block_navigation_policy.d.ts +59 -0
  47. package/core/keyboard_nav/connection_navigation_policy.d.ts +67 -0
  48. package/core/keyboard_nav/field_navigation_policy.d.ts +56 -0
  49. package/core/keyboard_nav/flyout_button_navigation_policy.d.ts +56 -0
  50. package/core/keyboard_nav/flyout_navigation_policy.d.ts +65 -0
  51. package/core/keyboard_nav/flyout_separator_navigation_policy.d.ts +33 -0
  52. package/core/keyboard_nav/line_cursor.d.ts +24 -185
  53. package/core/keyboard_nav/marker.d.ts +17 -29
  54. package/core/keyboard_nav/workspace_navigation_policy.d.ts +56 -0
  55. package/core/layer_manager.d.ts +3 -2
  56. package/core/marker_manager.d.ts +0 -26
  57. package/core/navigator.d.ts +65 -0
  58. package/core/rendered_connection.d.ts +24 -1
  59. package/core/renderers/common/block_rendering.d.ts +1 -2
  60. package/core/renderers/common/drawer.d.ts +1 -1
  61. package/core/renderers/common/i_path_object.d.ts +1 -25
  62. package/core/renderers/common/path_object.d.ts +1 -26
  63. package/core/renderers/common/renderer.d.ts +0 -11
  64. package/core/renderers/zelos/drawer.d.ts +1 -1
  65. package/core/renderers/zelos/renderer.d.ts +0 -11
  66. package/core/renderers/zelos/zelos.d.ts +1 -2
  67. package/core/shortcut_registry.d.ts +7 -2
  68. package/core/toast.d.ts +74 -0
  69. package/core/toolbox/toolbox.d.ts +25 -1
  70. package/core/toolbox/toolbox_item.d.ts +11 -0
  71. package/core/utils/aria.d.ts +5 -2
  72. package/core/utils/object.d.ts +3 -0
  73. package/core/variable_map.d.ts +11 -6
  74. package/core/variables.d.ts +3 -1
  75. package/core/workspace.d.ts +11 -11
  76. package/core/workspace_dragger.d.ts +5 -0
  77. package/core/workspace_svg.d.ts +99 -48
  78. package/index.mjs +11 -1
  79. package/msg/ab.js +33 -0
  80. package/msg/ab.mjs +33 -0
  81. package/msg/ace.js +33 -0
  82. package/msg/ace.mjs +33 -0
  83. package/msg/af.js +33 -0
  84. package/msg/af.mjs +33 -0
  85. package/msg/am.js +33 -0
  86. package/msg/am.mjs +33 -0
  87. package/msg/ar.js +33 -0
  88. package/msg/ar.mjs +33 -0
  89. package/msg/ast.js +33 -0
  90. package/msg/ast.mjs +33 -0
  91. package/msg/az.js +33 -0
  92. package/msg/az.mjs +33 -0
  93. package/msg/ba.js +33 -0
  94. package/msg/ba.mjs +33 -0
  95. package/msg/bcc.js +33 -0
  96. package/msg/bcc.mjs +33 -0
  97. package/msg/be-tarask.js +33 -0
  98. package/msg/be-tarask.mjs +33 -0
  99. package/msg/be.js +33 -0
  100. package/msg/be.mjs +33 -0
  101. package/msg/bg.js +33 -0
  102. package/msg/bg.mjs +33 -0
  103. package/msg/bn.js +33 -0
  104. package/msg/bn.mjs +33 -0
  105. package/msg/br.js +33 -0
  106. package/msg/br.mjs +33 -0
  107. package/msg/bs.js +33 -0
  108. package/msg/bs.mjs +33 -0
  109. package/msg/ca.js +33 -0
  110. package/msg/ca.mjs +33 -0
  111. package/msg/cdo.js +33 -0
  112. package/msg/cdo.mjs +33 -0
  113. package/msg/ce.js +33 -0
  114. package/msg/ce.mjs +33 -0
  115. package/msg/cs.js +33 -0
  116. package/msg/cs.mjs +33 -0
  117. package/msg/da.js +33 -0
  118. package/msg/da.mjs +33 -0
  119. package/msg/de.js +33 -0
  120. package/msg/de.mjs +33 -0
  121. package/msg/diq.js +33 -0
  122. package/msg/diq.mjs +33 -0
  123. package/msg/dtp.js +33 -0
  124. package/msg/dtp.mjs +33 -0
  125. package/msg/dty.js +33 -0
  126. package/msg/dty.mjs +33 -0
  127. package/msg/ee.js +33 -0
  128. package/msg/ee.mjs +33 -0
  129. package/msg/el.js +33 -0
  130. package/msg/el.mjs +33 -0
  131. package/msg/en-gb.js +33 -0
  132. package/msg/en-gb.mjs +33 -0
  133. package/msg/en.js +33 -0
  134. package/msg/en.mjs +33 -0
  135. package/msg/eo.js +33 -0
  136. package/msg/eo.mjs +33 -0
  137. package/msg/es.js +33 -0
  138. package/msg/es.mjs +33 -0
  139. package/msg/et.js +33 -0
  140. package/msg/et.mjs +33 -0
  141. package/msg/eu.js +33 -0
  142. package/msg/eu.mjs +33 -0
  143. package/msg/fa.js +33 -0
  144. package/msg/fa.mjs +33 -0
  145. package/msg/fi.js +33 -0
  146. package/msg/fi.mjs +33 -0
  147. package/msg/fo.js +33 -0
  148. package/msg/fo.mjs +33 -0
  149. package/msg/fr.js +33 -0
  150. package/msg/fr.mjs +33 -0
  151. package/msg/frr.js +33 -0
  152. package/msg/frr.mjs +33 -0
  153. package/msg/gl.js +33 -0
  154. package/msg/gl.mjs +33 -0
  155. package/msg/gn.js +33 -0
  156. package/msg/gn.mjs +33 -0
  157. package/msg/gor.js +33 -0
  158. package/msg/gor.mjs +33 -0
  159. package/msg/ha.js +33 -0
  160. package/msg/ha.mjs +33 -0
  161. package/msg/hak.js +33 -0
  162. package/msg/hak.mjs +33 -0
  163. package/msg/he.js +33 -0
  164. package/msg/he.mjs +33 -0
  165. package/msg/hi.js +33 -0
  166. package/msg/hi.mjs +33 -0
  167. package/msg/hr.js +33 -0
  168. package/msg/hr.mjs +33 -0
  169. package/msg/hrx.js +33 -0
  170. package/msg/hrx.mjs +33 -0
  171. package/msg/hsb.js +33 -0
  172. package/msg/hsb.mjs +33 -0
  173. package/msg/hu.js +33 -0
  174. package/msg/hu.mjs +33 -0
  175. package/msg/hy.js +33 -0
  176. package/msg/hy.mjs +33 -0
  177. package/msg/ia.js +33 -0
  178. package/msg/ia.mjs +33 -0
  179. package/msg/id.js +33 -0
  180. package/msg/id.mjs +33 -0
  181. package/msg/ig.js +33 -0
  182. package/msg/ig.mjs +33 -0
  183. package/msg/inh.js +33 -0
  184. package/msg/inh.mjs +33 -0
  185. package/msg/is.js +33 -0
  186. package/msg/is.mjs +33 -0
  187. package/msg/it.js +33 -0
  188. package/msg/it.mjs +33 -0
  189. package/msg/ja.js +33 -0
  190. package/msg/ja.mjs +33 -0
  191. package/msg/ka.js +33 -0
  192. package/msg/ka.mjs +33 -0
  193. package/msg/kab.js +33 -0
  194. package/msg/kab.mjs +33 -0
  195. package/msg/kbd-cyrl.js +33 -0
  196. package/msg/kbd-cyrl.mjs +33 -0
  197. package/msg/km.js +33 -0
  198. package/msg/km.mjs +33 -0
  199. package/msg/kn.js +33 -0
  200. package/msg/kn.mjs +33 -0
  201. package/msg/ko.js +33 -0
  202. package/msg/ko.mjs +33 -0
  203. package/msg/ksh.js +33 -0
  204. package/msg/ksh.mjs +33 -0
  205. package/msg/ku-latn.js +33 -0
  206. package/msg/ku-latn.mjs +33 -0
  207. package/msg/ky.js +33 -0
  208. package/msg/ky.mjs +33 -0
  209. package/msg/la.js +33 -0
  210. package/msg/la.mjs +33 -0
  211. package/msg/lb.js +33 -0
  212. package/msg/lb.mjs +33 -0
  213. package/msg/lki.js +33 -0
  214. package/msg/lki.mjs +33 -0
  215. package/msg/lo.js +33 -0
  216. package/msg/lo.mjs +33 -0
  217. package/msg/lrc.js +33 -0
  218. package/msg/lrc.mjs +33 -0
  219. package/msg/lt.js +33 -0
  220. package/msg/lt.mjs +33 -0
  221. package/msg/lv.js +33 -0
  222. package/msg/lv.mjs +33 -0
  223. package/msg/mg.js +33 -0
  224. package/msg/mg.mjs +33 -0
  225. package/msg/mk.js +33 -0
  226. package/msg/mk.mjs +33 -0
  227. package/msg/ml.js +33 -0
  228. package/msg/ml.mjs +33 -0
  229. package/msg/mnw.js +33 -0
  230. package/msg/mnw.mjs +33 -0
  231. package/msg/ms.js +33 -0
  232. package/msg/ms.mjs +33 -0
  233. package/msg/my.js +33 -0
  234. package/msg/my.mjs +33 -0
  235. package/msg/mzn.js +33 -0
  236. package/msg/mzn.mjs +33 -0
  237. package/msg/nb.js +33 -0
  238. package/msg/nb.mjs +33 -0
  239. package/msg/ne.js +33 -0
  240. package/msg/ne.mjs +33 -0
  241. package/msg/nl.js +33 -0
  242. package/msg/nl.mjs +33 -0
  243. package/msg/oc.js +33 -0
  244. package/msg/oc.mjs +33 -0
  245. package/msg/olo.js +33 -0
  246. package/msg/olo.mjs +33 -0
  247. package/msg/pa.js +33 -0
  248. package/msg/pa.mjs +33 -0
  249. package/msg/pl.js +33 -0
  250. package/msg/pl.mjs +33 -0
  251. package/msg/pms.js +33 -0
  252. package/msg/pms.mjs +33 -0
  253. package/msg/ps.js +33 -0
  254. package/msg/ps.mjs +33 -0
  255. package/msg/pt-br.js +33 -0
  256. package/msg/pt-br.mjs +33 -0
  257. package/msg/pt.js +33 -0
  258. package/msg/pt.mjs +33 -0
  259. package/msg/ro.js +33 -0
  260. package/msg/ro.mjs +33 -0
  261. package/msg/ru.js +33 -0
  262. package/msg/ru.mjs +33 -0
  263. package/msg/sc.js +33 -0
  264. package/msg/sc.mjs +33 -0
  265. package/msg/sco.js +33 -0
  266. package/msg/sco.mjs +33 -0
  267. package/msg/sd.js +33 -0
  268. package/msg/sd.mjs +33 -0
  269. package/msg/shn.js +33 -0
  270. package/msg/shn.mjs +33 -0
  271. package/msg/si.js +33 -0
  272. package/msg/si.mjs +33 -0
  273. package/msg/sk.js +33 -0
  274. package/msg/sk.mjs +33 -0
  275. package/msg/skr-arab.js +33 -0
  276. package/msg/skr-arab.mjs +33 -0
  277. package/msg/sl.js +33 -0
  278. package/msg/sl.mjs +33 -0
  279. package/msg/smn.js +33 -0
  280. package/msg/smn.mjs +33 -0
  281. package/msg/sq.js +33 -0
  282. package/msg/sq.mjs +33 -0
  283. package/msg/sr-latn.js +33 -0
  284. package/msg/sr-latn.mjs +33 -0
  285. package/msg/sr.js +33 -0
  286. package/msg/sr.mjs +33 -0
  287. package/msg/sv.js +33 -0
  288. package/msg/sv.mjs +33 -0
  289. package/msg/sw.js +33 -0
  290. package/msg/sw.mjs +33 -0
  291. package/msg/ta.js +33 -0
  292. package/msg/ta.mjs +33 -0
  293. package/msg/tcy.js +33 -0
  294. package/msg/tcy.mjs +33 -0
  295. package/msg/tdd.js +33 -0
  296. package/msg/tdd.mjs +33 -0
  297. package/msg/te.js +33 -0
  298. package/msg/te.mjs +33 -0
  299. package/msg/th.js +33 -0
  300. package/msg/th.mjs +33 -0
  301. package/msg/ti.js +33 -0
  302. package/msg/ti.mjs +33 -0
  303. package/msg/tl.js +33 -0
  304. package/msg/tl.mjs +33 -0
  305. package/msg/tlh.js +33 -0
  306. package/msg/tlh.mjs +33 -0
  307. package/msg/tr.js +33 -0
  308. package/msg/tr.mjs +33 -0
  309. package/msg/ug-arab.js +33 -0
  310. package/msg/ug-arab.mjs +33 -0
  311. package/msg/uk.js +33 -0
  312. package/msg/uk.mjs +33 -0
  313. package/msg/ur.js +33 -0
  314. package/msg/ur.mjs +33 -0
  315. package/msg/uz.js +33 -0
  316. package/msg/uz.mjs +33 -0
  317. package/msg/vi.js +33 -0
  318. package/msg/vi.mjs +33 -0
  319. package/msg/xmf.js +33 -0
  320. package/msg/xmf.mjs +33 -0
  321. package/msg/yo.js +33 -0
  322. package/msg/yo.mjs +33 -0
  323. package/msg/zgh.js +33 -0
  324. package/msg/zgh.mjs +33 -0
  325. package/msg/zh-hans.js +33 -0
  326. package/msg/zh-hans.mjs +33 -0
  327. package/msg/zh-hant.js +33 -0
  328. package/msg/zh-hant.mjs +33 -0
  329. package/package.json +4 -4
  330. package/core/events/events_marker_move.d.ts +0 -69
  331. package/core/interfaces/i_ast_node_location.d.ts +0 -11
  332. package/core/interfaces/i_ast_node_location_svg.d.ts +0 -24
  333. package/core/interfaces/i_ast_node_location_with_block.d.ts +0 -19
  334. package/core/keyboard_nav/ast_node.d.ts +0 -297
  335. package/core/renderers/common/marker_svg.d.ts +0 -256
  336. package/core/renderers/zelos/marker_svg.d.ts +0 -49
package/core/block.d.ts CHANGED
@@ -18,7 +18,6 @@ import type { Field } from './field.js';
18
18
  import { IconType } from './icons/icon_types.js';
19
19
  import type { MutatorIcon } from './icons/mutator_icon.js';
20
20
  import { Input } from './inputs/input.js';
21
- import type { IASTNodeLocation } from './interfaces/i_ast_node_location.js';
22
21
  import { type IIcon } from './interfaces/i_icon.js';
23
22
  import type { IVariableModel, IVariableState } from './interfaces/i_variable_model.js';
24
23
  import * as Tooltip from './tooltip.js';
@@ -29,7 +28,7 @@ import type { Workspace } from './workspace.js';
29
28
  * Class for one block.
30
29
  * Not normally called directly, workspace.newBlock() is preferred.
31
30
  */
32
- export declare class Block implements IASTNodeLocation {
31
+ export declare class Block {
33
32
  /**
34
33
  * An optional callback method to use whenever the block's parent workspace
35
34
  * changes. This is usually only called from the constructor, the block type
@@ -647,20 +646,6 @@ export declare class Block implements IASTNodeLocation {
647
646
  * @returns True if enabled.
648
647
  */
649
648
  isEnabled(): boolean;
650
- /** @deprecated v11 - Get or sets whether the block is manually disabled. */
651
- private get disabled();
652
- private set disabled(value);
653
- /**
654
- * @deprecated v11 - Set whether the block is manually enabled or disabled.
655
- * The user can toggle whether a block is disabled from a context menu
656
- * option. A block may still be disabled for other reasons even if the user
657
- * attempts to manually enable it, such as when the block is in an invalid
658
- * location. This method is deprecated and setDisabledReason should be used
659
- * instead.
660
- *
661
- * @param enabled True if enabled.
662
- */
663
- setEnabled(enabled: boolean): void;
664
649
  /**
665
650
  * Add or remove a reason why the block might be disabled. If a block has
666
651
  * any reasons to be disabled, then the block itself will be considered
@@ -17,12 +17,13 @@ import { ContextMenuOption, LegacyContextMenuOption } from './contextmenu_regist
17
17
  import { IconType } from './icons/icon_types.js';
18
18
  import { MutatorIcon } from './icons/mutator_icon.js';
19
19
  import type { Input } from './inputs/input.js';
20
- import type { IASTNodeLocationSvg } from './interfaces/i_ast_node_location_svg.js';
21
20
  import type { IBoundedElement } from './interfaces/i_bounded_element.js';
22
21
  import { IContextMenu } from './interfaces/i_contextmenu.js';
23
22
  import type { ICopyable } from './interfaces/i_copyable.js';
24
23
  import { IDeletable } from './interfaces/i_deletable.js';
25
24
  import type { IDragStrategy, IDraggable } from './interfaces/i_draggable.js';
25
+ import type { IFocusableNode } from './interfaces/i_focusable_node.js';
26
+ import type { IFocusableTree } from './interfaces/i_focusable_tree.js';
26
27
  import { IIcon } from './interfaces/i_icon.js';
27
28
  import { RenderedConnection } from './rendered_connection.js';
28
29
  import type { IPathObject } from './renderers/common/i_path_object.js';
@@ -36,7 +37,7 @@ import type { WorkspaceSvg } from './workspace_svg.js';
36
37
  * Class for a block's SVG representation.
37
38
  * Not normally called directly, workspace.newBlock() is preferred.
38
39
  */
39
- export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBoundedElement, IContextMenu, ICopyable<BlockCopyData>, IDraggable, IDeletable {
40
+ export declare class BlockSvg extends Block implements IBoundedElement, IContextMenu, ICopyable<BlockCopyData>, IDraggable, IDeletable, IFocusableNode {
40
41
  /**
41
42
  * Constant for identifying rows that are to be rendered inline.
42
43
  * Don't collide with Blockly.inputTypes.
@@ -227,6 +228,12 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
227
228
  * @param collapsed True if collapsed.
228
229
  */
229
230
  setCollapsed(collapsed: boolean): void;
231
+ /**
232
+ * Traverses child blocks to see if any of them have a warning.
233
+ *
234
+ * @returns true if any child has a warning, false otherwise.
235
+ */
236
+ private childHasWarning;
230
237
  /**
231
238
  * Makes sure that when the block is collapsed, it is rendered correctly
232
239
  * for that state.
@@ -391,17 +398,6 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
391
398
  */
392
399
  private createIconPointerDownListener;
393
400
  removeIcon(type: IconType<IIcon>): boolean;
394
- /**
395
- * @deprecated v11 - Set whether the block is manually enabled or disabled.
396
- * The user can toggle whether a block is disabled from a context menu
397
- * option. A block may still be disabled for other reasons even if the user
398
- * attempts to manually enable it, such as when the block is in an invalid
399
- * location. This method is deprecated and setDisabledReason should be used
400
- * instead.
401
- *
402
- * @param enabled True if enabled.
403
- */
404
- setEnabled(enabled: boolean): void;
405
401
  /**
406
402
  * Add or remove a reason why the block might be disabled. If a block has
407
403
  * any reasons to be disabled, then the block itself will be considered
@@ -665,24 +661,6 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
665
661
  * @internal
666
662
  */
667
663
  tightenChildrenEfficiently(): void;
668
- /** Redraw any attached marker or cursor svgs if needed. */
669
- protected updateMarkers_(): void;
670
- /**
671
- * Add the cursor SVG to this block's SVG group.
672
- *
673
- * @param cursorSvg The SVG root of the cursor to be added to the block SVG
674
- * group.
675
- * @internal
676
- */
677
- setCursorSvg(cursorSvg: SVGElement): void;
678
- /**
679
- * Add the marker SVG to this block's SVG group.
680
- *
681
- * @param markerSvg The SVG root of the marker to be added to the block SVG
682
- * group.
683
- * @internal
684
- */
685
- setMarkerSvg(markerSvg: SVGElement): void;
686
664
  /**
687
665
  * Returns a bounding box describing the dimensions of this block
688
666
  * and any blocks stacked below it.
@@ -736,5 +714,15 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
736
714
  */
737
715
  toFlyoutInfo(): FlyoutItemInfo[];
738
716
  jsonInit(json: any): void;
717
+ /** See IFocusableNode.getFocusableElement. */
718
+ getFocusableElement(): HTMLElement | SVGElement;
719
+ /** See IFocusableNode.getFocusableTree. */
720
+ getFocusableTree(): IFocusableTree;
721
+ /** See IFocusableNode.onNodeFocus. */
722
+ onNodeFocus(): void;
723
+ /** See IFocusableNode.onNodeBlur. */
724
+ onNodeBlur(): void;
725
+ /** See IFocusableNode.canBeFocused. */
726
+ canBeFocused(): boolean;
739
727
  }
740
728
  //# sourceMappingURL=block_svg.d.ts.map
package/core/blockly.d.ts CHANGED
@@ -65,11 +65,9 @@ import * as inputs from './inputs.js';
65
65
  import { IFlyoutInflater } from './interfaces/i_flyout_inflater.js';
66
66
  import { LabelFlyoutInflater } from './label_flyout_inflater.js';
67
67
  import { SeparatorFlyoutInflater } from './separator_flyout_inflater.js';
68
+ import { FocusableTreeTraverser } from './utils/focusable_tree_traverser.js';
68
69
  import { Input } from './inputs/input.js';
69
70
  import { InsertionMarkerPreviewer } from './insertion_marker_previewer.js';
70
- import { IASTNodeLocation } from './interfaces/i_ast_node_location.js';
71
- import { IASTNodeLocationSvg } from './interfaces/i_ast_node_location_svg.js';
72
- import { IASTNodeLocationWithBlock } from './interfaces/i_ast_node_location_with_block.js';
73
71
  import { IAutoHideable } from './interfaces/i_autohideable.js';
74
72
  import { IBoundedElement } from './interfaces/i_bounded_element.js';
75
73
  import { IBubble } from './interfaces/i_bubble.js';
@@ -106,8 +104,7 @@ import { IToolboxItem } from './interfaces/i_toolbox_item.js';
106
104
  import { IVariableBackedParameterModel, isVariableBackedParameterModel } from './interfaces/i_variable_backed_parameter_model.js';
107
105
  import { IVariableMap } from './interfaces/i_variable_map.js';
108
106
  import { IVariableModel, IVariableState } from './interfaces/i_variable_model.js';
109
- import { ASTNode } from './keyboard_nav/ast_node.js';
110
- import { CursorOptions, LineCursor } from './keyboard_nav/line_cursor.js';
107
+ import { LineCursor } from './keyboard_nav/line_cursor.js';
111
108
  import { Marker } from './keyboard_nav/marker.js';
112
109
  import type { LayerManager } from './layer_manager.js';
113
110
  import * as layers from './layers.js';
@@ -271,7 +268,18 @@ export declare const VARIABLE_DYNAMIC_CATEGORY_NAME: string;
271
268
  * procedure blocks.
272
269
  */
273
270
  export declare const PROCEDURE_CATEGORY_NAME: string;
274
- export { ASTNode, Block, BlockSvg, BlocklyOptions, Blocks, CollapsibleToolboxCategory, ComponentManager, Connection, ConnectionChecker, ConnectionDB, ConnectionType, ContextMenu, ContextMenuItems, ContextMenuRegistry, Css, CursorOptions, DeleteArea, DragTarget, Events, Extensions, LineCursor, Procedures, ShortcutItems, Themes, Tooltip, Touch, Variables, VariablesDynamic, WidgetDiv, Xml, blockAnimations, blockRendering, browserEvents, bubbles, bumpObjects, clipboard, comments, common, constants, dialog, dragging, fieldRegistry, geras, Procedures as procedures, registry, thrasos, uiPosition, utils, zelos, };
271
+ export * from './flyout_navigator.js';
272
+ export * from './interfaces/i_navigation_policy.js';
273
+ export * from './keyboard_nav/block_navigation_policy.js';
274
+ export * from './keyboard_nav/connection_navigation_policy.js';
275
+ export * from './keyboard_nav/field_navigation_policy.js';
276
+ export * from './keyboard_nav/flyout_button_navigation_policy.js';
277
+ export * from './keyboard_nav/flyout_navigation_policy.js';
278
+ export * from './keyboard_nav/flyout_separator_navigation_policy.js';
279
+ export * from './keyboard_nav/workspace_navigation_policy.js';
280
+ export * from './navigator.js';
281
+ export * from './toast.js';
282
+ export { Block, BlockSvg, BlocklyOptions, Blocks, CollapsibleToolboxCategory, ComponentManager, Connection, ConnectionChecker, ConnectionDB, ConnectionType, ContextMenu, ContextMenuItems, ContextMenuRegistry, Css, DeleteArea, DragTarget, Events, Extensions, LineCursor, Procedures, ShortcutItems, Themes, Tooltip, Touch, Variables, VariablesDynamic, WidgetDiv, Xml, blockAnimations, blockRendering, browserEvents, bubbles, bumpObjects, clipboard, comments, common, constants, dialog, dragging, fieldRegistry, geras, Procedures as procedures, registry, thrasos, uiPosition, utils, zelos, };
275
283
  export declare const DropDownDiv: typeof dropDownDiv;
276
- export { BlockFlyoutInflater, ButtonFlyoutInflater, CodeGenerator, Field, FieldCheckbox, FieldCheckboxConfig, FieldCheckboxFromJsonConfig, FieldCheckboxValidator, FieldConfig, FieldDropdown, FieldDropdownConfig, FieldDropdownFromJsonConfig, FieldDropdownValidator, FieldImage, FieldImageConfig, FieldImageFromJsonConfig, FieldLabel, FieldLabelConfig, FieldLabelFromJsonConfig, FieldLabelSerializable, FieldNumber, FieldNumberConfig, FieldNumberFromJsonConfig, FieldNumberValidator, FieldTextInput, FieldTextInputConfig, FieldTextInputFromJsonConfig, FieldTextInputValidator, FieldValidator, FieldVariable, FieldVariableConfig, FieldVariableFromJsonConfig, FieldVariableValidator, Flyout, FlyoutButton, FlyoutItem, FlyoutMetricsManager, FlyoutSeparator, FocusManager, CodeGenerator as Generator, Gesture, Grid, HorizontalFlyout, IASTNodeLocation, IASTNodeLocationSvg, IASTNodeLocationWithBlock, IAutoHideable, IBoundedElement, IBubble, ICollapsibleToolboxItem, IComponent, IConnectionChecker, IConnectionPreviewer, IContextMenu, ICopyData, ICopyable, IDeletable, IDeleteArea, IDragStrategy, IDragTarget, IDraggable, IDragger, IFlyout, IFlyoutInflater, IFocusableNode, IFocusableTree, IHasBubble, IIcon, IKeyboardAccessible, IMetricsManager, IMovable, IObservable, IPaster, IPositionable, IRegistrable, IRenderedElement, ISelectable, ISelectableToolboxItem, ISerializable, IStyleable, IToolbox, IToolboxItem, IVariableBackedParameterModel, IVariableMap, IVariableModel, IVariableState, ImageProperties, Input, InsertionMarkerPreviewer, LabelFlyoutInflater, LayerManager, Marker, MarkerManager, Menu, MenuGenerator, MenuGeneratorFunction, MenuItem, MenuOption, MetricsManager, Msg, Names, Options, RenderedConnection, ReturnEphemeralFocus, Scrollbar, ScrollbarPair, SeparatorFlyoutInflater, ShortcutRegistry, Theme, ThemeManager, Toolbox, ToolboxCategory, ToolboxItem, ToolboxSeparator, Trashcan, UnattachedFieldError, VariableMap, VariableModel, VerticalFlyout, Workspace, WorkspaceAudio, WorkspaceDragger, WorkspaceSvg, ZoomControls, config, getFocusManager, hasBubble, icons, inject, inputs, isCopyable, isDeletable, isDraggable, isIcon, isObservable, isPaster, isRenderedElement, isSelectable, isSerializable, isVariableBackedParameterModel, layers, renderManagement, serialization, setLocale, };
284
+ export { BlockFlyoutInflater, ButtonFlyoutInflater, CodeGenerator, Field, FieldCheckbox, FieldCheckboxConfig, FieldCheckboxFromJsonConfig, FieldCheckboxValidator, FieldConfig, FieldDropdown, FieldDropdownConfig, FieldDropdownFromJsonConfig, FieldDropdownValidator, FieldImage, FieldImageConfig, FieldImageFromJsonConfig, FieldLabel, FieldLabelConfig, FieldLabelFromJsonConfig, FieldLabelSerializable, FieldNumber, FieldNumberConfig, FieldNumberFromJsonConfig, FieldNumberValidator, FieldTextInput, FieldTextInputConfig, FieldTextInputFromJsonConfig, FieldTextInputValidator, FieldValidator, FieldVariable, FieldVariableConfig, FieldVariableFromJsonConfig, FieldVariableValidator, Flyout, FlyoutButton, FlyoutItem, FlyoutMetricsManager, FlyoutSeparator, FocusManager, FocusableTreeTraverser, CodeGenerator as Generator, Gesture, Grid, HorizontalFlyout, IAutoHideable, IBoundedElement, IBubble, ICollapsibleToolboxItem, IComponent, IConnectionChecker, IConnectionPreviewer, IContextMenu, ICopyData, ICopyable, IDeletable, IDeleteArea, IDragStrategy, IDragTarget, IDraggable, IDragger, IFlyout, IFlyoutInflater, IFocusableNode, IFocusableTree, IHasBubble, IIcon, IKeyboardAccessible, IMetricsManager, IMovable, IObservable, IPaster, IPositionable, IRegistrable, IRenderedElement, ISelectable, ISelectableToolboxItem, ISerializable, IStyleable, IToolbox, IToolboxItem, IVariableBackedParameterModel, IVariableMap, IVariableModel, IVariableState, ImageProperties, Input, InsertionMarkerPreviewer, LabelFlyoutInflater, LayerManager, Marker, MarkerManager, Menu, MenuGenerator, MenuGeneratorFunction, MenuItem, MenuOption, MetricsManager, Msg, Names, Options, RenderedConnection, ReturnEphemeralFocus, Scrollbar, ScrollbarPair, SeparatorFlyoutInflater, ShortcutRegistry, Theme, ThemeManager, Toolbox, ToolboxCategory, ToolboxItem, ToolboxSeparator, Trashcan, UnattachedFieldError, VariableMap, VariableModel, VerticalFlyout, Workspace, WorkspaceAudio, WorkspaceDragger, WorkspaceSvg, ZoomControls, config, getFocusManager, hasBubble, icons, inject, inputs, isCopyable, isDeletable, isDraggable, isIcon, isObservable, isPaster, isRenderedElement, isSelectable, isSerializable, isVariableBackedParameterModel, layers, renderManagement, serialization, setLocale, };
277
285
  //# sourceMappingURL=blockly.d.ts.map
@@ -3,8 +3,9 @@
3
3
  * Copyright 2023 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { ISelectable } from '../blockly.js';
7
6
  import { IBubble } from '../interfaces/i_bubble.js';
7
+ import type { IFocusableTree } from '../interfaces/i_focusable_tree.js';
8
+ import { ISelectable } from '../interfaces/i_selectable.js';
8
9
  import { Coordinate } from '../utils/coordinate.js';
9
10
  import { Rect } from '../utils/rect.js';
10
11
  import { Size } from '../utils/size.js';
@@ -60,14 +61,19 @@ export declare abstract class Bubble implements IBubble, ISelectable {
60
61
  /** The position of the left of the bubble realtive to its anchor. */
61
62
  private relativeLeft;
62
63
  private dragStrategy;
64
+ private focusableElement;
63
65
  /**
64
66
  * @param workspace The workspace this bubble belongs to.
65
67
  * @param anchor The anchor location of the thing this bubble is attached to.
66
68
  * The tail of the bubble will point to this location.
67
69
  * @param ownerRect An optional rect we don't want the bubble to overlap with
68
70
  * when automatically positioning.
71
+ * @param overriddenFocusableElement An optional replacement to the focusable
72
+ * element that's represented by this bubble (as a focusable node). This
73
+ * element will have its ID and tabindex overwritten. If not provided, the
74
+ * focusable element of this node will default to the bubble's SVG root.
69
75
  */
70
- constructor(workspace: WorkspaceSvg, anchor: Coordinate, ownerRect?: Rect | undefined);
76
+ constructor(workspace: WorkspaceSvg, anchor: Coordinate, ownerRect?: Rect | undefined, overriddenFocusableElement?: SVGElement | HTMLElement);
71
77
  /** Dispose of this bubble. */
72
78
  dispose(): void;
73
79
  /**
@@ -96,7 +102,10 @@ export declare abstract class Bubble implements IBubble, ISelectable {
96
102
  protected getColour(): string;
97
103
  /** Sets the colour of the background and tail of this bubble. */
98
104
  setColour(colour: string): void;
99
- /** Brings the bubble to the front and passes the pointer event off to the gesture system. */
105
+ /**
106
+ * Passes the pointer event off to the gesture system and ensures the bubble
107
+ * is focused.
108
+ */
100
109
  private onMouseDown;
101
110
  /** Positions the bubble relative to its anchor. Does not render its tail. */
102
111
  protected positionRelativeToAnchor(): void;
@@ -190,5 +199,15 @@ export declare abstract class Bubble implements IBubble, ISelectable {
190
199
  revertDrag(): void;
191
200
  select(): void;
192
201
  unselect(): void;
202
+ /** See IFocusableNode.getFocusableElement. */
203
+ getFocusableElement(): HTMLElement | SVGElement;
204
+ /** See IFocusableNode.getFocusableTree. */
205
+ getFocusableTree(): IFocusableTree;
206
+ /** See IFocusableNode.onNodeFocus. */
207
+ onNodeFocus(): void;
208
+ /** See IFocusableNode.onNodeBlur. */
209
+ onNodeBlur(): void;
210
+ /** See IFocusableNode.canBeFocused. */
211
+ canBeFocused(): boolean;
193
212
  }
194
213
  //# sourceMappingURL=bubble.d.ts.map
@@ -67,7 +67,9 @@ export declare class TextInputBubble extends Bubble {
67
67
  addSizeChangeListener(listener: () => void): void;
68
68
  /** Adds a change listener to be notified when this bubble's location changes. */
69
69
  addLocationChangeListener(listener: () => void): void;
70
- /** Creates the editor UI for this bubble. */
70
+ /** Creates and returns the editable text area for this bubble's editor. */
71
+ private static createTextArea;
72
+ /** Creates and returns the UI container element for this bubble's editor. */
71
73
  private createEditor;
72
74
  /** Binds events to the text area element. */
73
75
  private bindTextAreaEvents;
@@ -93,10 +95,6 @@ export declare class TextInputBubble extends Bubble {
93
95
  private onResizePointerUp;
94
96
  /** Handles pointer move events on the resize target. */
95
97
  private onResizePointerMove;
96
- /**
97
- * Handles starting an edit of the text area. Brings the bubble to the front.
98
- */
99
- private onStartEdit;
100
98
  /** Handles a text change event for the text area. Calls event listeners. */
101
99
  private onTextChange;
102
100
  /** Handles a size change event for the text area. Calls event listeners. */
@@ -9,6 +9,7 @@ import { IContextMenu } from '../interfaces/i_contextmenu.js';
9
9
  import { ICopyable } from '../interfaces/i_copyable.js';
10
10
  import { IDeletable } from '../interfaces/i_deletable.js';
11
11
  import { IDraggable } from '../interfaces/i_draggable.js';
12
+ import type { IFocusableTree } from '../interfaces/i_focusable_tree.js';
12
13
  import { IRenderedElement } from '../interfaces/i_rendered_element.js';
13
14
  import { ISelectable } from '../interfaces/i_selectable.js';
14
15
  import { Coordinate } from '../utils/coordinate.js';
@@ -98,5 +99,15 @@ export declare class RenderedWorkspaceComment extends WorkspaceComment implement
98
99
  showContextMenu(e: Event): void;
99
100
  /** Snap this comment to the nearest grid point. */
100
101
  snapToGrid(): void;
102
+ /** See IFocusableNode.getFocusableElement. */
103
+ getFocusableElement(): HTMLElement | SVGElement;
104
+ /** See IFocusableNode.getFocusableTree. */
105
+ getFocusableTree(): IFocusableTree;
106
+ /** See IFocusableNode.onNodeFocus. */
107
+ onNodeFocus(): void;
108
+ /** See IFocusableNode.onNodeBlur. */
109
+ onNodeBlur(): void;
110
+ /** See IFocusableNode.canBeFocused. */
111
+ canBeFocused(): boolean;
101
112
  }
102
113
  //# sourceMappingURL=rendered_workspace_comment.d.ts.map
package/core/common.d.ts CHANGED
@@ -4,9 +4,9 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { Block } from './block.js';
7
- import { ISelectable } from './blockly.js';
8
7
  import { BlockDefinition } from './blocks.js';
9
8
  import type { Connection } from './connection.js';
9
+ import { ISelectable } from './interfaces/i_selectable.js';
10
10
  import type { Workspace } from './workspace.js';
11
11
  import type { WorkspaceSvg } from './workspace_svg.js';
12
12
  /**
@@ -49,18 +49,30 @@ export declare function getMainWorkspace(): Workspace;
49
49
  */
50
50
  export declare function setMainWorkspace(workspace: Workspace): void;
51
51
  /**
52
- * Returns the currently selected copyable object.
52
+ * Returns the current selection.
53
53
  */
54
54
  export declare function getSelected(): ISelectable | null;
55
55
  /**
56
- * Sets the currently selected block. This function does not visually mark the
57
- * block as selected or fire the required events. If you wish to
58
- * programmatically select a block, use `BlockSvg#select`.
56
+ * Sets the current selection.
59
57
  *
60
- * @param newSelection The newly selected block.
58
+ * To clear the current selection, select another ISelectable or focus a
59
+ * non-selectable (like the workspace root node).
60
+ *
61
+ * @param newSelection The new selection to make.
62
+ * @internal
63
+ */
64
+ export declare function setSelected(newSelection: ISelectable): void;
65
+ /**
66
+ * Fires a selection change event based on the new selection.
67
+ *
68
+ * This is only expected to be called by ISelectable implementations and should
69
+ * always be called before updating the current selection state. It does not
70
+ * change focus or selection state.
71
+ *
72
+ * @param newSelection The new selection.
61
73
  * @internal
62
74
  */
63
- export declare function setSelected(newSelection: ISelectable | null): void;
75
+ export declare function fireSelectedEvent(newSelection: ISelectable | null): void;
64
76
  /**
65
77
  * Get the container element in which to render the WidgetDiv, DropDownDiv and
66
78
  * Tooltip.
@@ -10,13 +10,12 @@
10
10
  */
11
11
  import type { Block } from './block.js';
12
12
  import type { Input } from './inputs/input.js';
13
- import type { IASTNodeLocationWithBlock } from './interfaces/i_ast_node_location_with_block.js';
14
13
  import type { IConnectionChecker } from './interfaces/i_connection_checker.js';
15
14
  import * as blocks from './serialization/blocks.js';
16
15
  /**
17
16
  * Class for a connection between blocks.
18
17
  */
19
- export declare class Connection implements IASTNodeLocationWithBlock {
18
+ export declare class Connection {
20
19
  type: number;
21
20
  /** Constants for checking whether two connections are compatible. */
22
21
  static CAN_CONNECT: number;
@@ -41,6 +40,8 @@ export declare class Connection implements IASTNodeLocationWithBlock {
41
40
  private check;
42
41
  /** DOM representation of a shadow block, or null if none. */
43
42
  private shadowDom;
43
+ /** The unique ID of this connection. */
44
+ id: string;
44
45
  /**
45
46
  * Horizontal location of this connection.
46
47
  *
@@ -10,6 +10,7 @@
10
10
  */
11
11
  import type { BlockSvg } from './block_svg.js';
12
12
  import { RenderedWorkspaceComment } from './comments/rendered_workspace_comment.js';
13
+ import type { IFocusableNode } from './interfaces/i_focusable_node.js';
13
14
  import { Coordinate } from './utils/coordinate.js';
14
15
  import type { WorkspaceSvg } from './workspace_svg.js';
15
16
  /**
@@ -45,17 +46,16 @@ export declare class ContextMenuRegistry {
45
46
  */
46
47
  getItem(id: string): RegistryItem | null;
47
48
  /**
48
- * Gets the valid context menu options for the given scope type (e.g. block or
49
- * workspace) and scope. Blocks are only shown if the preconditionFn shows
49
+ * Gets the valid context menu options for the given scope.
50
+ * Options are only included if the preconditionFn shows
50
51
  * they should not be hidden.
51
52
  *
52
- * @param scopeType Type of scope where menu should be shown (e.g. on a block
53
- * or on a workspace)
54
53
  * @param scope Current scope of context menu (i.e., the exact workspace or
55
- * block being clicked on)
54
+ * block being clicked on).
55
+ * @param menuOpenEvent Event that caused the menu to open.
56
56
  * @returns the list of ContextMenuOptions
57
57
  */
58
- getContextMenuOptions(scopeType: ScopeType, scope: Scope, menuOpenEvent: Event): ContextMenuOption[];
58
+ getContextMenuOptions(scope: Scope, menuOpenEvent: Event): ContextMenuOption[];
59
59
  }
60
60
  export declare namespace ContextMenuRegistry {
61
61
  /**
@@ -69,19 +69,21 @@ export declare namespace ContextMenuRegistry {
69
69
  COMMENT = "comment"
70
70
  }
71
71
  /**
72
- * The actual workspace/block where the menu is being rendered. This is passed
73
- * to callback and displayText functions that depend on this information.
72
+ * The actual workspace/block/focused object where the menu is being
73
+ * rendered. This is passed to callback and displayText functions
74
+ * that depend on this information.
74
75
  */
75
76
  export interface Scope {
76
77
  block?: BlockSvg;
77
78
  workspace?: WorkspaceSvg;
78
79
  comment?: RenderedWorkspaceComment;
80
+ focusedNode?: IFocusableNode;
79
81
  }
80
82
  /**
81
83
  * Fields common to all context menu registry items.
82
84
  */
83
85
  interface CoreRegistryItem {
84
- scopeType: ScopeType;
86
+ scopeType?: ScopeType;
85
87
  weight: number;
86
88
  id: string;
87
89
  }
package/core/dialog.d.ts CHANGED
@@ -3,6 +3,8 @@
3
3
  * Copyright 2021 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
+ import type { ToastOptions } from './toast.js';
7
+ import type { WorkspaceSvg } from './workspace_svg.js';
6
8
  /**
7
9
  * Wrapper to window.alert() that app developers may override via setAlert to
8
10
  * provide alternatives to the modal browser window.
@@ -14,10 +16,11 @@ export declare function alert(message: string, opt_callback?: () => void): void;
14
16
  /**
15
17
  * Sets the function to be run when Blockly.dialog.alert() is called.
16
18
  *
17
- * @param alertFunction The function to be run.
19
+ * @param alertFunction The function to be run, or undefined to restore the
20
+ * default implementation.
18
21
  * @see Blockly.dialog.alert
19
22
  */
20
- export declare function setAlert(alertFunction: (p1: string, p2?: () => void) => void): void;
23
+ export declare function setAlert(alertFunction?: (message: string, callback?: () => void) => void): void;
21
24
  /**
22
25
  * Wrapper to window.confirm() that app developers may override via setConfirm
23
26
  * to provide alternatives to the modal browser window.
@@ -25,18 +28,15 @@ export declare function setAlert(alertFunction: (p1: string, p2?: () => void) =>
25
28
  * @param message The message to display to the user.
26
29
  * @param callback The callback for handling user response.
27
30
  */
28
- export declare function confirm(message: string, callback: (p1: boolean) => void): void;
29
- /**
30
- * Private version of confirm for stubbing in tests.
31
- */
32
- declare function confirmInternal(message: string, callback: (p1: boolean) => void): void;
31
+ export declare function confirm(message: string, callback: (result: boolean) => void): void;
33
32
  /**
34
33
  * Sets the function to be run when Blockly.dialog.confirm() is called.
35
34
  *
36
- * @param confirmFunction The function to be run.
35
+ * @param confirmFunction The function to be run, or undefined to restore the
36
+ * default implementation.
37
37
  * @see Blockly.dialog.confirm
38
38
  */
39
- export declare function setConfirm(confirmFunction: (p1: string, p2: (p1: boolean) => void) => void): void;
39
+ export declare function setConfirm(confirmFunction?: (message: string, callback: (result: boolean) => void) => void): void;
40
40
  /**
41
41
  * Wrapper to window.prompt() that app developers may override via setPrompt to
42
42
  * provide alternatives to the modal browser window. Built-in browser prompts
@@ -47,16 +47,36 @@ export declare function setConfirm(confirmFunction: (p1: string, p2: (p1: boolea
47
47
  * @param defaultValue The value to initialize the prompt with.
48
48
  * @param callback The callback for handling user response.
49
49
  */
50
- export declare function prompt(message: string, defaultValue: string, callback: (p1: string | null) => void): void;
50
+ export declare function prompt(message: string, defaultValue: string, callback: (result: string | null) => void): void;
51
51
  /**
52
52
  * Sets the function to be run when Blockly.dialog.prompt() is called.
53
53
  *
54
- * @param promptFunction The function to be run.
54
+ * **Important**: When overridding this, be aware that non-native prompt
55
+ * experiences may require managing ephemeral focus in FocusManager. This isn't
56
+ * needed for the native window prompt because it prevents focus from being
57
+ * changed while open.
58
+ *
59
+ * @param promptFunction The function to be run, or undefined to restore the
60
+ * default implementation.
55
61
  * @see Blockly.dialog.prompt
56
62
  */
57
- export declare function setPrompt(promptFunction: (p1: string, p2: string, p3: (p1: string | null) => void) => void): void;
58
- export declare const TEST_ONLY: {
59
- confirmInternal: typeof confirmInternal;
60
- };
61
- export {};
63
+ export declare function setPrompt(promptFunction?: (message: string, defaultValue: string, callback: (result: string | null) => void) => void): void;
64
+ /**
65
+ * Displays a temporary notification atop the workspace. Blockly provides a
66
+ * default toast implementation, but developers may provide their own via
67
+ * setToast. For simple appearance customization, CSS should be sufficient.
68
+ *
69
+ * @param workspace The workspace to display the toast notification atop.
70
+ * @param options Configuration options for the notification, including its
71
+ * message and duration.
72
+ */
73
+ export declare function toast(workspace: WorkspaceSvg, options: ToastOptions): void;
74
+ /**
75
+ * Sets the function to be run when Blockly.dialog.toast() is called.
76
+ *
77
+ * @param toastFunction The function to be run, or undefined to restore the
78
+ * default implementation.
79
+ * @see Blockly.dialog.toast
80
+ */
81
+ export declare function setToast(toastFunction?: (workspace: WorkspaceSvg, options: ToastOptions) => void): void;
62
82
  //# sourceMappingURL=dialog.d.ts.map
@@ -22,7 +22,6 @@ export { CommentDelete } from './events_comment_delete.js';
22
22
  export { CommentDrag, CommentDragJson } from './events_comment_drag.js';
23
23
  export { CommentMove, CommentMoveJson } from './events_comment_move.js';
24
24
  export { CommentResize, CommentResizeJson } from './events_comment_resize.js';
25
- export { MarkerMove, MarkerMoveJson } from './events_marker_move.js';
26
25
  export { Selected, SelectedJson } from './events_selected.js';
27
26
  export { ThemeChange, ThemeChangeJson } from './events_theme_change.js';
28
27
  export { ToolboxItemSelect, ToolboxItemSelectJson, } from './events_toolbox_item_select.js';
@@ -57,7 +56,6 @@ export declare const CREATE = EventType.BLOCK_CREATE;
57
56
  /** @deprecated Use BLOCK_DELETE instead */
58
57
  export declare const DELETE = EventType.BLOCK_DELETE;
59
58
  export declare const FINISHED_LOADING = EventType.FINISHED_LOADING;
60
- export declare const MARKER_MOVE = EventType.MARKER_MOVE;
61
59
  /** @deprecated Use BLOCK_MOVE instead */
62
60
  export declare const MOVE = EventType.BLOCK_MOVE;
63
61
  export declare const SELECTED = EventType.SELECTED;
@@ -27,7 +27,6 @@ import type { CommentDelete } from './events_comment_delete.js';
27
27
  import type { CommentDrag } from './events_comment_drag.js';
28
28
  import type { CommentMove } from './events_comment_move.js';
29
29
  import type { CommentResize } from './events_comment_resize.js';
30
- import type { MarkerMove } from './events_marker_move.js';
31
30
  import type { Selected } from './events_selected.js';
32
31
  import type { ThemeChange } from './events_theme_change.js';
33
32
  import type { ToolboxItemSelect } from './events_toolbox_item_select.js';
@@ -59,8 +58,6 @@ export declare function isBlockDrag(event: Abstract): event is BlockDrag;
59
58
  export declare function isSelected(event: Abstract): event is Selected;
60
59
  /** @returns true iff event.type is EventType.CLICK */
61
60
  export declare function isClick(event: Abstract): event is Click;
62
- /** @returns true iff event.type is EventType.MARKER_MOVE */
63
- export declare function isMarkerMove(event: Abstract): event is MarkerMove;
64
61
  /** @returns true iff event.type is EventType.BUBBLE_OPEN */
65
62
  export declare function isBubbleOpen(event: Abstract): event is BubbleOpen;
66
63
  /** @returns true iff event.type is EventType.TRASHCAN_OPEN */
@@ -129,13 +129,9 @@ declare function enqueueEvent(event: Abstract): void;
129
129
  * cause them to be reordered.
130
130
  *
131
131
  * @param queue Array of events.
132
- * @param forward True if forward (redo), false if backward (undo).
133
- * This parameter is deprecated: true is now the default and
134
- * calling filter with it set to false will in future not be
135
- * supported.
136
132
  * @returns Array of filtered events.
137
133
  */
138
- export declare function filter(queue: Abstract[], forward?: boolean): Abstract[];
134
+ export declare function filter(queue: Abstract[]): Abstract[];
139
135
  /**
140
136
  * Modify pending undo events so that when they are fired they don't land
141
137
  * in the undo stack. Called by Workspace.clearUndo.