blockly 12.5.1 → 13.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (355) hide show
  1. package/blockly.min.js +645 -533
  2. package/blockly.mjs +13 -5
  3. package/blockly_compressed.js +610 -507
  4. package/blockly_compressed.js.map +1 -1
  5. package/blocks_compressed.js +16 -16
  6. package/blocks_compressed.js.map +1 -1
  7. package/core/block.d.ts +1 -1
  8. package/core/block_svg.d.ts +39 -16
  9. package/core/blockly.d.ts +21 -16
  10. package/core/bubbles/bubble.d.ts +17 -2
  11. package/core/bubbles/mini_workspace_bubble.d.ts +5 -0
  12. package/core/bubbles/textinput_bubble.d.ts +5 -0
  13. package/core/comments/comment_editor.d.ts +2 -2
  14. package/core/comments/rendered_workspace_comment.d.ts +6 -1
  15. package/core/common.d.ts +1 -1
  16. package/core/css.d.ts +2 -1
  17. package/core/dragging/block_drag_strategy.d.ts +84 -14
  18. package/core/dragging/bubble_drag_strategy.d.ts +5 -4
  19. package/core/dragging/comment_drag_strategy.d.ts +4 -4
  20. package/core/dragging/dragger.d.ts +13 -14
  21. package/core/events/events_block_create.d.ts +0 -3
  22. package/core/events/events_block_delete.d.ts +0 -3
  23. package/core/events/events_comment_create.d.ts +0 -3
  24. package/core/events/events_comment_delete.d.ts +0 -3
  25. package/core/field.d.ts +69 -0
  26. package/core/flyout_base.d.ts +1 -125
  27. package/core/flyout_button.d.ts +9 -0
  28. package/core/flyout_horizontal.d.ts +0 -11
  29. package/core/flyout_vertical.d.ts +0 -11
  30. package/core/gesture.d.ts +0 -12
  31. package/core/hints.d.ts +44 -0
  32. package/core/icons/icon.d.ts +6 -0
  33. package/core/inputs/input.d.ts +7 -1
  34. package/core/interfaces/i_bounded_element.d.ts +7 -0
  35. package/core/interfaces/i_bubble.d.ts +3 -2
  36. package/core/interfaces/i_collapsible_toolbox_item.d.ts +5 -1
  37. package/core/interfaces/i_draggable.d.ts +22 -17
  38. package/core/interfaces/i_dragger.d.ts +19 -10
  39. package/core/interfaces/i_flyout.d.ts +1 -31
  40. package/core/interfaces/i_focusable_node.d.ts +6 -0
  41. package/core/interfaces/i_focusable_tree.d.ts +8 -0
  42. package/core/interfaces/i_json_block_definition.d.ts +102 -0
  43. package/core/interfaces/i_navigation_policy.d.ts +12 -0
  44. package/core/interfaces/i_selectable.d.ts +2 -2
  45. package/core/interfaces/i_selectable_toolbox_item.d.ts +3 -3
  46. package/core/interfaces/i_toolbox.d.ts +4 -0
  47. package/core/interfaces/i_toolbox_item.d.ts +6 -0
  48. package/core/keyboard_nav/keyboard_mover.d.ts +138 -0
  49. package/core/keyboard_nav/move_indicator.d.ts +35 -0
  50. package/core/keyboard_nav/{block_comment_navigation_policy.d.ts → navigation_policies/block_comment_navigation_policy.d.ts} +10 -3
  51. package/core/keyboard_nav/{block_navigation_policy.d.ts → navigation_policies/block_navigation_policy.d.ts} +17 -25
  52. package/core/keyboard_nav/{comment_bar_button_navigation_policy.d.ts → navigation_policies/comment_bar_button_navigation_policy.d.ts} +10 -3
  53. package/core/keyboard_nav/{comment_editor_navigation_policy.d.ts → navigation_policies/comment_editor_navigation_policy.d.ts} +10 -3
  54. package/core/keyboard_nav/{connection_navigation_policy.d.ts → navigation_policies/connection_navigation_policy.d.ts} +11 -16
  55. package/core/keyboard_nav/{field_navigation_policy.d.ts → navigation_policies/field_navigation_policy.d.ts} +10 -3
  56. package/core/keyboard_nav/{flyout_button_navigation_policy.d.ts → navigation_policies/flyout_button_navigation_policy.d.ts} +10 -3
  57. package/core/keyboard_nav/{flyout_separator_navigation_policy.d.ts → navigation_policies/flyout_separator_navigation_policy.d.ts} +9 -3
  58. package/core/keyboard_nav/{icon_navigation_policy.d.ts → navigation_policies/icon_navigation_policy.d.ts} +10 -3
  59. package/core/keyboard_nav/navigation_policies/toolbox_item_navigation_policy.d.ts +64 -0
  60. package/core/keyboard_nav/{workspace_comment_navigation_policy.d.ts → navigation_policies/workspace_comment_navigation_policy.d.ts} +14 -9
  61. package/core/keyboard_nav/{workspace_navigation_policy.d.ts → navigation_policies/workspace_navigation_policy.d.ts} +10 -3
  62. package/core/keyboard_nav/navigators/flyout_navigator.d.ts +63 -0
  63. package/core/keyboard_nav/navigators/navigator.d.ts +225 -0
  64. package/core/keyboard_nav/navigators/toolbox_navigator.d.ts +70 -0
  65. package/core/registry.d.ts +0 -2
  66. package/core/renderers/common/constants.d.ts +4 -7
  67. package/core/renderers/common/i_path_object.d.ts +8 -0
  68. package/core/renderers/common/path_object.d.ts +5 -14
  69. package/core/renderers/common/renderer.d.ts +3 -3
  70. package/core/renderers/zelos/constants.d.ts +1 -14
  71. package/core/renderers/zelos/measurables/bottom_row.d.ts +1 -1
  72. package/core/renderers/zelos/measurables/top_row.d.ts +1 -1
  73. package/core/renderers/zelos/path_object.d.ts +0 -3
  74. package/core/renderers/zelos/renderer.d.ts +8 -0
  75. package/core/shortcut_items.d.ts +63 -1
  76. package/core/theme.d.ts +0 -2
  77. package/core/toast.d.ts +2 -11
  78. package/core/toolbox/category.d.ts +5 -0
  79. package/core/toolbox/separator.d.ts +4 -0
  80. package/core/toolbox/toolbox.d.ts +12 -22
  81. package/core/toolbox/toolbox_item.d.ts +4 -0
  82. package/core/utils/aria.d.ts +292 -23
  83. package/core/utils/shortcut_formatting.d.ts +24 -0
  84. package/core/utils/useragent.d.ts +1 -0
  85. package/core/workspace_audio.d.ts +23 -0
  86. package/core/workspace_svg.d.ts +8 -50
  87. package/dart_compressed.js +9 -9
  88. package/dart_compressed.js.map +1 -1
  89. package/index.mjs +13 -5
  90. package/javascript_compressed.js +11 -10
  91. package/javascript_compressed.js.map +1 -1
  92. package/lua_compressed.js +7 -7
  93. package/lua_compressed.js.map +1 -1
  94. package/msg/ab.js +8 -0
  95. package/msg/ab.mjs +8 -0
  96. package/msg/ace.js +8 -0
  97. package/msg/ace.mjs +8 -0
  98. package/msg/af.js +8 -0
  99. package/msg/af.mjs +8 -0
  100. package/msg/am.js +8 -0
  101. package/msg/am.mjs +8 -0
  102. package/msg/ar.js +8 -0
  103. package/msg/ar.mjs +8 -0
  104. package/msg/ast.js +8 -0
  105. package/msg/ast.mjs +8 -0
  106. package/msg/az.js +8 -0
  107. package/msg/az.mjs +8 -0
  108. package/msg/ba.js +8 -0
  109. package/msg/ba.mjs +8 -0
  110. package/msg/bcc.js +8 -0
  111. package/msg/bcc.mjs +8 -0
  112. package/msg/be-tarask.js +8 -0
  113. package/msg/be-tarask.mjs +8 -0
  114. package/msg/be.js +8 -0
  115. package/msg/be.mjs +8 -0
  116. package/msg/bg.js +8 -0
  117. package/msg/bg.mjs +8 -0
  118. package/msg/bn.js +8 -0
  119. package/msg/bn.mjs +8 -0
  120. package/msg/br.js +8 -0
  121. package/msg/br.mjs +8 -0
  122. package/msg/bs.js +8 -0
  123. package/msg/bs.mjs +8 -0
  124. package/msg/ca.js +8 -0
  125. package/msg/ca.mjs +8 -0
  126. package/msg/cdo.js +8 -0
  127. package/msg/cdo.mjs +8 -0
  128. package/msg/ce.js +8 -0
  129. package/msg/ce.mjs +8 -0
  130. package/msg/cs.js +8 -0
  131. package/msg/cs.mjs +8 -0
  132. package/msg/da.js +8 -0
  133. package/msg/da.mjs +8 -0
  134. package/msg/de.js +8 -0
  135. package/msg/de.mjs +8 -0
  136. package/msg/diq.js +8 -0
  137. package/msg/diq.mjs +8 -0
  138. package/msg/dtp.js +8 -0
  139. package/msg/dtp.mjs +8 -0
  140. package/msg/dty.js +8 -0
  141. package/msg/dty.mjs +8 -0
  142. package/msg/ee.js +8 -0
  143. package/msg/ee.mjs +8 -0
  144. package/msg/el.js +8 -0
  145. package/msg/el.mjs +8 -0
  146. package/msg/en-gb.js +8 -0
  147. package/msg/en-gb.mjs +8 -0
  148. package/msg/en.js +8 -0
  149. package/msg/en.mjs +8 -0
  150. package/msg/eo.js +8 -0
  151. package/msg/eo.mjs +8 -0
  152. package/msg/es.js +8 -0
  153. package/msg/es.mjs +8 -0
  154. package/msg/et.js +8 -0
  155. package/msg/et.mjs +8 -0
  156. package/msg/eu.js +8 -0
  157. package/msg/eu.mjs +8 -0
  158. package/msg/fa.js +8 -0
  159. package/msg/fa.mjs +8 -0
  160. package/msg/fi.js +8 -0
  161. package/msg/fi.mjs +8 -0
  162. package/msg/fo.js +8 -0
  163. package/msg/fo.mjs +8 -0
  164. package/msg/fr.js +8 -0
  165. package/msg/fr.mjs +8 -0
  166. package/msg/frr.js +8 -0
  167. package/msg/frr.mjs +8 -0
  168. package/msg/gl.js +8 -0
  169. package/msg/gl.mjs +8 -0
  170. package/msg/gn.js +8 -0
  171. package/msg/gn.mjs +8 -0
  172. package/msg/gor.js +8 -0
  173. package/msg/gor.mjs +8 -0
  174. package/msg/ha.js +8 -0
  175. package/msg/ha.mjs +8 -0
  176. package/msg/hak.js +8 -0
  177. package/msg/hak.mjs +8 -0
  178. package/msg/he.js +8 -0
  179. package/msg/he.mjs +8 -0
  180. package/msg/hi.js +8 -0
  181. package/msg/hi.mjs +8 -0
  182. package/msg/hr.js +8 -0
  183. package/msg/hr.mjs +8 -0
  184. package/msg/hrx.js +8 -0
  185. package/msg/hrx.mjs +8 -0
  186. package/msg/hsb.js +8 -0
  187. package/msg/hsb.mjs +8 -0
  188. package/msg/hu.js +8 -0
  189. package/msg/hu.mjs +8 -0
  190. package/msg/hy.js +8 -0
  191. package/msg/hy.mjs +8 -0
  192. package/msg/ia.js +8 -0
  193. package/msg/ia.mjs +8 -0
  194. package/msg/id.js +8 -0
  195. package/msg/id.mjs +8 -0
  196. package/msg/ig.js +8 -0
  197. package/msg/ig.mjs +8 -0
  198. package/msg/inh.js +8 -0
  199. package/msg/inh.mjs +8 -0
  200. package/msg/is.js +8 -0
  201. package/msg/is.mjs +8 -0
  202. package/msg/it.js +8 -0
  203. package/msg/it.mjs +8 -0
  204. package/msg/ja.js +8 -0
  205. package/msg/ja.mjs +8 -0
  206. package/msg/ka.js +8 -0
  207. package/msg/ka.mjs +8 -0
  208. package/msg/kab.js +8 -0
  209. package/msg/kab.mjs +8 -0
  210. package/msg/kbd-cyrl.js +8 -0
  211. package/msg/kbd-cyrl.mjs +8 -0
  212. package/msg/km.js +8 -0
  213. package/msg/km.mjs +8 -0
  214. package/msg/kn.js +8 -0
  215. package/msg/kn.mjs +8 -0
  216. package/msg/ko.js +8 -0
  217. package/msg/ko.mjs +8 -0
  218. package/msg/ksh.js +8 -0
  219. package/msg/ksh.mjs +8 -0
  220. package/msg/ku-latn.js +8 -0
  221. package/msg/ku-latn.mjs +8 -0
  222. package/msg/ky.js +8 -0
  223. package/msg/ky.mjs +8 -0
  224. package/msg/la.js +8 -0
  225. package/msg/la.mjs +8 -0
  226. package/msg/lb.js +8 -0
  227. package/msg/lb.mjs +8 -0
  228. package/msg/lki.js +8 -0
  229. package/msg/lki.mjs +8 -0
  230. package/msg/lo.js +8 -0
  231. package/msg/lo.mjs +8 -0
  232. package/msg/lrc.js +8 -0
  233. package/msg/lrc.mjs +8 -0
  234. package/msg/lt.js +8 -0
  235. package/msg/lt.mjs +8 -0
  236. package/msg/lv.js +8 -0
  237. package/msg/lv.mjs +8 -0
  238. package/msg/mg.js +8 -0
  239. package/msg/mg.mjs +8 -0
  240. package/msg/mk.js +8 -0
  241. package/msg/mk.mjs +8 -0
  242. package/msg/ml.js +8 -0
  243. package/msg/ml.mjs +8 -0
  244. package/msg/mnw.js +8 -0
  245. package/msg/mnw.mjs +8 -0
  246. package/msg/ms.js +8 -0
  247. package/msg/ms.mjs +8 -0
  248. package/msg/my.js +8 -0
  249. package/msg/my.mjs +8 -0
  250. package/msg/mzn.js +8 -0
  251. package/msg/mzn.mjs +8 -0
  252. package/msg/nb.js +8 -0
  253. package/msg/nb.mjs +8 -0
  254. package/msg/ne.js +8 -0
  255. package/msg/ne.mjs +8 -0
  256. package/msg/nl.js +8 -0
  257. package/msg/nl.mjs +8 -0
  258. package/msg/oc.js +8 -0
  259. package/msg/oc.mjs +8 -0
  260. package/msg/olo.js +8 -0
  261. package/msg/olo.mjs +8 -0
  262. package/msg/pa.js +8 -0
  263. package/msg/pa.mjs +8 -0
  264. package/msg/pl.js +8 -0
  265. package/msg/pl.mjs +8 -0
  266. package/msg/pms.js +8 -0
  267. package/msg/pms.mjs +8 -0
  268. package/msg/ps.js +8 -0
  269. package/msg/ps.mjs +8 -0
  270. package/msg/pt-br.js +8 -0
  271. package/msg/pt-br.mjs +8 -0
  272. package/msg/pt.js +8 -0
  273. package/msg/pt.mjs +8 -0
  274. package/msg/ro.js +8 -0
  275. package/msg/ro.mjs +8 -0
  276. package/msg/ru.js +8 -0
  277. package/msg/ru.mjs +8 -0
  278. package/msg/sc.js +8 -0
  279. package/msg/sc.mjs +8 -0
  280. package/msg/sco.js +8 -0
  281. package/msg/sco.mjs +8 -0
  282. package/msg/sd.js +8 -0
  283. package/msg/sd.mjs +8 -0
  284. package/msg/shn.js +8 -0
  285. package/msg/shn.mjs +8 -0
  286. package/msg/si.js +8 -0
  287. package/msg/si.mjs +8 -0
  288. package/msg/sk.js +8 -0
  289. package/msg/sk.mjs +8 -0
  290. package/msg/skr-arab.js +8 -0
  291. package/msg/skr-arab.mjs +8 -0
  292. package/msg/sl.js +8 -0
  293. package/msg/sl.mjs +8 -0
  294. package/msg/smn.js +8 -0
  295. package/msg/smn.mjs +8 -0
  296. package/msg/sq.js +8 -0
  297. package/msg/sq.mjs +8 -0
  298. package/msg/sr-latn.js +8 -0
  299. package/msg/sr-latn.mjs +8 -0
  300. package/msg/sr.js +8 -0
  301. package/msg/sr.mjs +8 -0
  302. package/msg/sv.js +8 -0
  303. package/msg/sv.mjs +8 -0
  304. package/msg/sw.js +8 -0
  305. package/msg/sw.mjs +8 -0
  306. package/msg/ta.js +8 -0
  307. package/msg/ta.mjs +8 -0
  308. package/msg/tcy.js +8 -0
  309. package/msg/tcy.mjs +8 -0
  310. package/msg/tdd.js +8 -0
  311. package/msg/tdd.mjs +8 -0
  312. package/msg/te.js +8 -0
  313. package/msg/te.mjs +8 -0
  314. package/msg/th.js +8 -0
  315. package/msg/th.mjs +8 -0
  316. package/msg/ti.js +8 -0
  317. package/msg/ti.mjs +8 -0
  318. package/msg/tl.js +8 -0
  319. package/msg/tl.mjs +8 -0
  320. package/msg/tlh.js +8 -0
  321. package/msg/tlh.mjs +8 -0
  322. package/msg/tr.js +8 -0
  323. package/msg/tr.mjs +8 -0
  324. package/msg/ug-arab.js +8 -0
  325. package/msg/ug-arab.mjs +8 -0
  326. package/msg/uk.js +8 -0
  327. package/msg/uk.mjs +8 -0
  328. package/msg/ur.js +8 -0
  329. package/msg/ur.mjs +8 -0
  330. package/msg/uz.js +8 -0
  331. package/msg/uz.mjs +8 -0
  332. package/msg/vi.js +8 -0
  333. package/msg/vi.mjs +8 -0
  334. package/msg/xmf.js +8 -0
  335. package/msg/xmf.mjs +8 -0
  336. package/msg/yo.js +8 -0
  337. package/msg/yo.mjs +8 -0
  338. package/msg/zgh.js +8 -0
  339. package/msg/zgh.mjs +8 -0
  340. package/msg/zh-hans.js +8 -0
  341. package/msg/zh-hans.mjs +8 -0
  342. package/msg/zh-hant.js +8 -0
  343. package/msg/zh-hant.mjs +8 -0
  344. package/package.json +11 -11
  345. package/php_compressed.js +2 -2
  346. package/php_compressed.js.map +1 -1
  347. package/python_compressed.js +2 -2
  348. package/python_compressed.js.map +1 -1
  349. package/core/flyout_navigator.d.ts +0 -11
  350. package/core/keyboard_nav/flyout_navigation_policy.d.ts +0 -65
  351. package/core/keyboard_nav/line_cursor.d.ts +0 -187
  352. package/core/keyboard_nav/marker.d.ts +0 -53
  353. package/core/marker_manager.d.ts +0 -72
  354. package/core/navigator.d.ts +0 -65
  355. package/media/sprites.png +0 -0
@@ -19,7 +19,6 @@ import type { ISerializer } from './interfaces/i_serializer.js';
19
19
  import type { IToolbox } from './interfaces/i_toolbox.js';
20
20
  import type { IVariableMap } from './interfaces/i_variable_map.js';
21
21
  import type { IVariableModel, IVariableModelStatic, IVariableState } from './interfaces/i_variable_model.js';
22
- import type { LineCursor } from './keyboard_nav/line_cursor.js';
23
22
  import type { Options } from './options.js';
24
23
  import type { Renderer } from './renderers/common/renderer.js';
25
24
  import type { Theme } from './theme.js';
@@ -50,7 +49,6 @@ export declare class Type<_T> {
50
49
  toString(): string;
51
50
  static CONNECTION_CHECKER: Type<IConnectionChecker>;
52
51
  static CONNECTION_PREVIEWER: Type<IConnectionPreviewer>;
53
- static CURSOR: Type<LineCursor>;
54
52
  static EVENT: Type<Abstract>;
55
53
  static FIELD: Type<Field<any>>;
56
54
  static INPUT: Type<Input>;
@@ -244,8 +244,6 @@ export declare class ConstantProvider {
244
244
  * The <filter> element to use for a debug highlight, or null if not set.
245
245
  */
246
246
  private debugFilter;
247
- /** The <style> element to use for injecting renderer specific CSS. */
248
- private cssNode;
249
247
  /**
250
248
  * Cursor colour.
251
249
  */
@@ -422,7 +420,6 @@ export declare class ConstantProvider {
422
420
  * Create any DOM elements that this renderer needs (filters, patterns, etc).
423
421
  *
424
422
  * @param svg The root of the workspace's SVG.
425
- * @param tagName The name to use for the CSS style tag.
426
423
  * @param selector The CSS selector to use.
427
424
  * @param injectionDivIfIsParent The div containing the parent workspace and
428
425
  * all related workspaces and block containers, if this renderer is for the
@@ -430,7 +427,7 @@ export declare class ConstantProvider {
430
427
  * to this container. Child workspaces should not override the CSS variables
431
428
  * created by the parent and thus do not need access to the injection div.
432
429
  */
433
- createDom(svg: SVGElement, tagName: string, selector: string, injectionDivIfIsParent?: HTMLElement): void;
430
+ createDom(svg: SVGElement, selector: string, injectionDivIfIsParent?: HTMLElement): void;
434
431
  /**
435
432
  * Create a filter for highlighting the currently rendering block during
436
433
  * render debugging.
@@ -439,10 +436,10 @@ export declare class ConstantProvider {
439
436
  /**
440
437
  * Inject renderer specific CSS into the page.
441
438
  *
442
- * @param tagName The name of the style tag to use.
443
- * @param selector The CSS selector to use.
439
+ * @param root The document root to inject the CSS into.
440
+ * @param selector The CSS selector to interpolate into the stylesheet.
444
441
  */
445
- protected injectCSS_(tagName: string, selector: string): void;
442
+ protected injectCSS_(root: Document | ShadowRoot, selector: string): void;
446
443
  /**
447
444
  * Get any renderer specific CSS to inject when the renderer is initialized.
448
445
  *
@@ -84,5 +84,13 @@ export interface IPathObject {
84
84
  * @param blockStyle The block style to use.
85
85
  */
86
86
  setStyle?(blockStyle: BlockStyle): void;
87
+ /**
88
+ * Add or remove styling indicating that a block will be bumped out and
89
+ * replaced by another block that is mid-move.
90
+ *
91
+ * @param replacing True if the block is at risk of being replaced, false
92
+ * otherwise.
93
+ */
94
+ updateReplacing?(replacing: boolean): void;
87
95
  }
88
96
  //# sourceMappingURL=i_path_object.d.ts.map
@@ -4,7 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { BlockSvg } from '../../block_svg.js';
7
- import type { Connection } from '../../connection.js';
8
7
  import { RenderedConnection } from '../../rendered_connection.js';
9
8
  import type { BlockStyle } from '../../theme.js';
10
9
  import { Coordinate } from '../../utils/coordinate.js';
@@ -105,21 +104,13 @@ export declare class PathObject implements IPathObject {
105
104
  */
106
105
  updateMovable(enable: boolean): void;
107
106
  /**
108
- * Add or remove styling that shows that if the dragging block is dropped,
109
- * this block will be replaced. If a shadow block, it will disappear.
110
- * Otherwise it will bump.
107
+ * Add or remove styling indicating that a block will be bumped out and
108
+ * replaced by another block that is mid-move.
111
109
  *
112
- * @param enable True if styling should be added.
113
- */
114
- updateReplacementFade(enable: boolean): void;
115
- /**
116
- * Add or remove styling that shows that if the dragging block is dropped,
117
- * this block will be connected to the input.
118
- *
119
- * @param _conn The connection on the input to highlight.
120
- * @param _enable True if styling should be added.
110
+ * @param replacing True if the block is at risk of being replaced, false
111
+ * otherwise.
121
112
  */
122
- updateShapeForInputHighlight(_conn: Connection, _enable: boolean): void;
113
+ updateReplacing(replacing: boolean): void;
123
114
  /** Adds the given path as a connection highlight for the given connection. */
124
115
  addConnectionHighlight(connection: RenderedConnection, connectionPath: string, offset: Coordinate, rtl: boolean): SVGElement;
125
116
  /**
@@ -4,8 +4,8 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { BlockSvg } from '../../block_svg.js';
7
- import { Connection } from '../../connection.js';
8
7
  import type { IRegistrable } from '../../interfaces/i_registrable.js';
8
+ import type { RenderedConnection } from '../../rendered_connection.js';
9
9
  import type { BlockStyle, Theme } from '../../theme.js';
10
10
  import { ConstantProvider } from './constants.js';
11
11
  import { Drawer } from './drawer.js';
@@ -113,10 +113,10 @@ export declare class Renderer implements IRegistrable {
113
113
  /**
114
114
  * Determine whether or not to highlight a connection.
115
115
  *
116
- * @param _conn The connection to determine whether or not to highlight.
116
+ * @param connection The connection to determine whether or not to highlight.
117
117
  * @returns True if we should highlight the connection.
118
118
  */
119
- shouldHighlightConnection(_conn: Connection): boolean;
119
+ shouldHighlightConnection(connection: RenderedConnection): boolean;
120
120
  /**
121
121
  * Checks if an orphaned block can connect to the "end" of the topBlock's
122
122
  * block-clump. If the clump is a row the end is the last input. If the clump
@@ -65,10 +65,6 @@ export declare class ConstantProvider extends BaseConstantProvider {
65
65
  SELECTED_GLOW_COLOUR: string;
66
66
  /** The size of the selected glow. */
67
67
  SELECTED_GLOW_SIZE: number;
68
- /** The replacement glow colour. */
69
- REPLACEMENT_GLOW_COLOUR: string;
70
- /** The size of the selected glow. */
71
- REPLACEMENT_GLOW_SIZE: number;
72
68
  /**
73
69
  * The ID of the selected glow filter, or the empty string if no filter is
74
70
  * set.
@@ -78,15 +74,6 @@ export declare class ConstantProvider extends BaseConstantProvider {
78
74
  * The <filter> element to use for a selected glow, or null if not set.
79
75
  */
80
76
  private selectedGlowFilter;
81
- /**
82
- * The ID of the replacement glow filter, or the empty string if no filter
83
- * is set.
84
- */
85
- replacementGlowFilterId: string;
86
- /**
87
- * The <filter> element to use for a replacement glow, or null if not set.
88
- */
89
- private replacementGlowFilter;
90
77
  /**
91
78
  * The object containing information about the hexagon used for a boolean
92
79
  * reporter block. Null before init is called.
@@ -159,7 +146,7 @@ export declare class ConstantProvider extends BaseConstantProvider {
159
146
  };
160
147
  generateSecondaryColour_(colour: string): string;
161
148
  generateTertiaryColour_(colour: string): string;
162
- createDom(svg: SVGElement, tagName: string, selector: string, injectionDivIfIsParent?: HTMLElement): void;
149
+ createDom(svg: SVGElement, selector: string, injectionDivIfIsParent?: HTMLElement): void;
163
150
  getCSS_(selector: string): string[];
164
151
  }
165
152
  //# sourceMappingURL=constants.d.ts.map
@@ -21,6 +21,6 @@ export declare class BottomRow extends BaseBottomRow {
21
21
  /** Render a round corner unless the block has an output connection. */
22
22
  hasLeftSquareCorner(block: BlockSvg): boolean;
23
23
  /** Render a round corner unless the block has an output connection. */
24
- hasRightSquareCorner(block: BlockSvg): false;
24
+ hasRightSquareCorner(block: BlockSvg): boolean;
25
25
  }
26
26
  //# sourceMappingURL=bottom_row.d.ts.map
@@ -23,6 +23,6 @@ export declare class TopRow extends BaseTopRow {
23
23
  /** Render a round corner unless the block has an output connection. */
24
24
  hasLeftSquareCorner(block: BlockSvg): boolean;
25
25
  /** Render a round corner unless the block has an output connection. */
26
- hasRightSquareCorner(block: BlockSvg): false;
26
+ hasRightSquareCorner(block: BlockSvg): boolean;
27
27
  }
28
28
  //# sourceMappingURL=top_row.d.ts.map
@@ -4,7 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { BlockSvg } from '../../block_svg.js';
7
- import type { Connection } from '../../connection.js';
8
7
  import type { BlockStyle } from '../../theme.js';
9
8
  import { PathObject as BasePathObject } from '../common/path_object.js';
10
9
  import type { ConstantProvider } from './constants.js';
@@ -40,8 +39,6 @@ export declare class PathObject extends BasePathObject {
40
39
  applyColour(block: BlockSvg): void;
41
40
  flipRTL(): void;
42
41
  updateSelected(enable: boolean): void;
43
- updateReplacementFade(enable: boolean): void;
44
- updateShapeForInputHighlight(conn: Connection, enable: boolean): void;
45
42
  /**
46
43
  * Method that's called when the drawer is about to draw the block.
47
44
  */
@@ -4,6 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { BlockSvg } from '../../block_svg.js';
7
+ import type { RenderedConnection } from '../../rendered_connection.js';
7
8
  import type { BlockStyle } from '../../theme.js';
8
9
  import type { RenderInfo as BaseRenderInfo } from '../common/info.js';
9
10
  import { Renderer as BaseRenderer } from '../common/renderer.js';
@@ -60,5 +61,12 @@ export declare class Renderer extends BaseRenderer {
60
61
  * @returns The constant provider.
61
62
  */
62
63
  getConstants(): ConstantProvider;
64
+ /**
65
+ * Determine whether or not to highlight a connection.
66
+ *
67
+ * @param connection The connection to determine whether or not to highlight.
68
+ * @returns True if we should highlight the connection.
69
+ */
70
+ shouldHighlightConnection(connection: RenderedConnection): boolean;
63
71
  }
64
72
  //# sourceMappingURL=renderer.d.ts.map
@@ -14,7 +14,26 @@ export declare enum names {
14
14
  PASTE = "paste",
15
15
  UNDO = "undo",
16
16
  REDO = "redo",
17
- MENU = "menu"
17
+ MENU = "menu",
18
+ FOCUS_WORKSPACE = "focus_workspace",
19
+ FOCUS_TOOLBOX = "focus_toolbox",
20
+ START_MOVE = "start_move",
21
+ START_MOVE_STACK = "start_move_stack",
22
+ FINISH_MOVE = "finish_move",
23
+ ABORT_MOVE = "abort_move",
24
+ MOVE_UP = "move_up",
25
+ MOVE_DOWN = "move_down",
26
+ MOVE_LEFT = "move_left",
27
+ MOVE_RIGHT = "move_right",
28
+ NAVIGATE_RIGHT = "right",
29
+ NAVIGATE_LEFT = "left",
30
+ NAVIGATE_UP = "up",
31
+ NAVIGATE_DOWN = "down",
32
+ DISCONNECT = "disconnect",
33
+ NEXT_STACK = "next_stack",
34
+ PREVIOUS_STACK = "previous_stack",
35
+ INFORMATION = "information",
36
+ PERFORM_ACTION = "perform_action"
18
37
  }
19
38
  /**
20
39
  * Keyboard shortcut to hide chaff on escape.
@@ -45,10 +64,44 @@ export declare function registerUndo(): void;
45
64
  * or alt+shift+z.
46
65
  */
47
66
  export declare function registerRedo(): void;
67
+ /**
68
+ * Registers keyboard shortcuts for keyboard-driven movement of workspace
69
+ * elements.
70
+ */
71
+ export declare function registerMovementShortcuts(): void;
48
72
  /**
49
73
  * Keyboard shortcut to show the context menu on ctrl/cmd+Enter.
50
74
  */
51
75
  export declare function registerShowContextMenu(): void;
76
+ /**
77
+ * Registers keyboard shortcuts to navigate around the Blockly interface.
78
+ */
79
+ export declare function registerArrowNavigation(): void;
80
+ /**
81
+ * Registers keyboard shortcut to focus the workspace.
82
+ */
83
+ export declare function registerFocusWorkspace(): void;
84
+ /**
85
+ * Registers keyboard shortcut to focus the toolbox.
86
+ */
87
+ export declare function registerFocusToolbox(): void;
88
+ /**
89
+ * Registers keyboard shortcut to get count of block stacks and comments.
90
+ */
91
+ export declare function registerWorkspaceOverview(): void;
92
+ /**
93
+ * Registers keyboard shortcut to disconnect the focused block.
94
+ */
95
+ export declare function registerDisconnectBlock(): void;
96
+ /**
97
+ * Registers keyboard shortcuts to jump between stacks/top-level items on the
98
+ * workspace.
99
+ */
100
+ export declare function registerStackNavigation(): void;
101
+ /**
102
+ * Registers keyboard shortcut to perform an action on the focused element.
103
+ */
104
+ export declare function registerPerformAction(): void;
52
105
  /**
53
106
  * Registers all default keyboard shortcut item. This should be called once per
54
107
  * instance of KeyboardShortcutRegistry.
@@ -56,4 +109,13 @@ export declare function registerShowContextMenu(): void;
56
109
  * @internal
57
110
  */
58
111
  export declare function registerDefaultShortcuts(): void;
112
+ /**
113
+ * Registers an extended set of keyboard shortcuts used to support deep keyboard
114
+ * navigation of Blockly.
115
+ */
116
+ export declare function registerKeyboardNavigationShortcuts(): void;
117
+ /**
118
+ * Registers keyboard shortcuts used to announce screen reader information.
119
+ */
120
+ export declare function registerScreenReaderShortcuts(): void;
59
121
  //# sourceMappingURL=shortcut_items.d.ts.map
package/core/theme.d.ts CHANGED
@@ -135,8 +135,6 @@ export declare namespace Theme {
135
135
  cursorColour?: string;
136
136
  selectedGlowColour?: string;
137
137
  selectedGlowOpacity?: number;
138
- replacementGlowColour?: string;
139
- replacementGlowOpacity?: number;
140
138
  }
141
139
  interface FontStyle {
142
140
  family?: string;
package/core/toast.d.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  * Copyright 2025 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
+ import * as aria from './utils/aria.js';
6
7
  import type { WorkspaceSvg } from './workspace_svg.js';
7
8
  /**
8
9
  * Display/configuration options for a toast notification.
@@ -30,7 +31,7 @@ export interface ToastOptions {
30
31
  * How prominently/interrupting the readout of the toast should be for
31
32
  * screenreaders. Corresponds to aria-live and defaults to polite.
32
33
  */
33
- assertiveness?: Toast.Assertiveness;
34
+ assertiveness?: aria.LiveRegionAssertiveness;
34
35
  }
35
36
  /**
36
37
  * Class that allows for showing and dismissing temporary notifications.
@@ -61,14 +62,4 @@ export declare class Toast {
61
62
  */
62
63
  static hide(workspace: WorkspaceSvg, id?: string): void;
63
64
  }
64
- /**
65
- * Options for how aggressively toasts should be read out by screenreaders.
66
- * Values correspond to those for aria-live.
67
- */
68
- export declare namespace Toast {
69
- enum Assertiveness {
70
- ASSERTIVE = "assertive",
71
- POLITE = "polite"
72
- }
73
- }
74
65
  //# sourceMappingURL=toast.d.ts.map
@@ -229,6 +229,11 @@ export declare class ToolboxCategory extends ToolboxItem implements ISelectableT
229
229
  getName(): string;
230
230
  getParent(): ICollapsibleToolboxItem | null;
231
231
  getDiv(): HTMLDivElement | null;
232
+ /**
233
+ * Handles this toolbox category gaining focus by informing its parent
234
+ * toolbox that it has been selected.
235
+ */
236
+ onNodeFocus(): void;
232
237
  /**
233
238
  * Gets the contents of the category. These are items that are meant to be
234
239
  * displayed in the flyout.
@@ -30,6 +30,10 @@ export declare class ToolboxSeparator extends ToolboxItem {
30
30
  protected createDom_(): HTMLDivElement;
31
31
  getDiv(): HTMLDivElement;
32
32
  dispose(): void;
33
+ /**
34
+ * Prevents separator toolbox items from gaining focus.
35
+ */
36
+ canBeFocused(): boolean;
33
37
  }
34
38
  export declare namespace ToolboxSeparator {
35
39
  interface CssConfig {
@@ -16,6 +16,7 @@ import type { ISelectableToolboxItem } from '../interfaces/i_selectable_toolbox_
16
16
  import type { IStyleable } from '../interfaces/i_styleable.js';
17
17
  import type { IToolbox } from '../interfaces/i_toolbox.js';
18
18
  import type { IToolboxItem } from '../interfaces/i_toolbox_item.js';
19
+ import { ToolboxNavigator } from '../keyboard_nav/navigators/toolbox_navigator.js';
19
20
  import type { KeyboardShortcut } from '../shortcut_registry.js';
20
21
  import { Rect } from '../utils/rect.js';
21
22
  import * as toolbox from '../utils/toolbox.js';
@@ -62,6 +63,8 @@ export declare class Toolbox extends DeleteArea implements IAutoHideable, IKeybo
62
63
  protected readonly workspace_: WorkspaceSvg;
63
64
  /** Whether the mouse is currently being clicked. */
64
65
  private mouseDown;
66
+ /** Object used by keyboard navigation to move focus in this toolbox. */
67
+ private navigator;
65
68
  /** @param workspace The workspace in which to create new blocks. */
66
69
  constructor(workspace: WorkspaceSvg);
67
70
  /**
@@ -367,30 +370,12 @@ export declare class Toolbox extends DeleteArea implements IAutoHideable, IKeybo
367
370
  */
368
371
  private fireSelectEvent;
369
372
  /**
370
- * Closes the current item if it is expanded, or selects the parent.
373
+ * Sets the currently selected item's expansion state, if possible.
371
374
  *
372
- * @returns True if a parent category was selected, false otherwise.
375
+ * @param expanded True to expand the item or false to collapse it.
376
+ * @returns True if the selected item's expansion state was updated.
373
377
  */
374
- private selectParent;
375
- /**
376
- * Selects the first child of the currently selected item, or nothing if the
377
- * toolbox item has no children.
378
- *
379
- * @returns True if a child category was selected, false otherwise.
380
- */
381
- private selectChild;
382
- /**
383
- * Selects the next visible toolbox item.
384
- *
385
- * @returns True if a next category was selected, false otherwise.
386
- */
387
- private selectNext;
388
- /**
389
- * Selects the previous visible toolbox item.
390
- *
391
- * @returns True if a previous category was selected, false otherwise.
392
- */
393
- private selectPrevious;
378
+ private toggleSelectedItem;
394
379
  /** Disposes of this toolbox. */
395
380
  dispose(): void;
396
381
  /** See IFocusableNode.getFocusableElement. */
@@ -415,5 +400,10 @@ export declare class Toolbox extends DeleteArea implements IAutoHideable, IKeybo
415
400
  onTreeFocus(node: IFocusableNode, _previousTree: IFocusableTree | null): void;
416
401
  /** See IFocusableTree.onTreeBlur. */
417
402
  onTreeBlur(nextTree: IFocusableTree | null): void;
403
+ /**
404
+ * Returns the Navigator instance to use to move between items in this
405
+ * toolbox.
406
+ */
407
+ getNavigator(): ToolboxNavigator;
418
408
  }
419
409
  //# sourceMappingURL=toolbox.d.ts.map
@@ -105,5 +105,9 @@ export declare class ToolboxItem implements IToolboxItem {
105
105
  onNodeBlur(): void;
106
106
  /** See IFocusableNode.canBeFocused. */
107
107
  canBeFocused(): boolean;
108
+ /**
109
+ * Returns the toolbox this toolbox item belongs to.
110
+ */
111
+ getParentToolbox(): IToolbox;
108
112
  }
109
113
  //# sourceMappingURL=toolbox_item.d.ts.map