blockly 13.0.0 → 13.1.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 (293) hide show
  1. package/README.md +42 -16
  2. package/blockly.min.js +1078 -1031
  3. package/blockly_compressed.js +945 -918
  4. package/blockly_compressed.js.map +1 -1
  5. package/blocks_compressed.js +85 -85
  6. package/blocks_compressed.js.map +1 -1
  7. package/core/block.d.ts +0 -8
  8. package/core/block_aria_composer.d.ts +13 -2
  9. package/core/block_svg.d.ts +13 -1
  10. package/core/blockly.d.ts +0 -4
  11. package/core/component_manager.d.ts +2 -0
  12. package/core/dragging/dragger.d.ts +5 -0
  13. package/core/field.d.ts +8 -2
  14. package/core/field_checkbox.d.ts +0 -1
  15. package/core/field_dropdown.d.ts +1 -1
  16. package/core/field_input.d.ts +0 -6
  17. package/core/field_label.d.ts +1 -0
  18. package/core/field_textinput.d.ts +0 -1
  19. package/core/field_variable.d.ts +0 -1
  20. package/core/gesture.d.ts +0 -7
  21. package/core/inputs/input.d.ts +0 -1
  22. package/core/procedures.d.ts +0 -1
  23. package/core/rendered_connection.d.ts +6 -0
  24. package/core/shortcut_items.d.ts +42 -1
  25. package/core/toolbox/collapsible_category.d.ts +2 -0
  26. package/core/trashcan.d.ts +2 -8
  27. package/core/utils/aria.d.ts +2 -2
  28. package/core/variable_map.d.ts +0 -7
  29. package/core/variable_model.d.ts +0 -6
  30. package/core/workspace.d.ts +0 -1
  31. package/core/workspace_focus_target.d.ts +46 -0
  32. package/core/workspace_svg.d.ts +36 -4
  33. package/core/zoom_controls.d.ts +0 -46
  34. package/dart_compressed.js +23 -23
  35. package/javascript_compressed.js +26 -26
  36. package/lua_compressed.js +41 -41
  37. package/msg/ab.js +22 -2
  38. package/msg/ab.mjs +20 -0
  39. package/msg/ace.js +22 -2
  40. package/msg/ace.mjs +20 -0
  41. package/msg/af.js +22 -2
  42. package/msg/af.mjs +20 -0
  43. package/msg/am.js +22 -2
  44. package/msg/am.mjs +20 -0
  45. package/msg/ar.js +30 -10
  46. package/msg/ar.mjs +20 -0
  47. package/msg/ast.js +22 -2
  48. package/msg/ast.mjs +20 -0
  49. package/msg/az.js +22 -2
  50. package/msg/az.mjs +20 -0
  51. package/msg/ba.js +22 -2
  52. package/msg/ba.mjs +20 -0
  53. package/msg/bcc.js +22 -2
  54. package/msg/bcc.mjs +20 -0
  55. package/msg/be-tarask.js +22 -2
  56. package/msg/be-tarask.mjs +20 -0
  57. package/msg/be.js +22 -2
  58. package/msg/be.mjs +20 -0
  59. package/msg/bg.js +24 -4
  60. package/msg/bg.mjs +20 -0
  61. package/msg/bn.js +22 -2
  62. package/msg/bn.mjs +20 -0
  63. package/msg/br.js +22 -2
  64. package/msg/br.mjs +20 -0
  65. package/msg/bs.js +22 -2
  66. package/msg/bs.mjs +20 -0
  67. package/msg/ca.js +27 -7
  68. package/msg/ca.mjs +20 -0
  69. package/msg/ce.js +22 -2
  70. package/msg/ce.mjs +20 -0
  71. package/msg/cs.js +22 -2
  72. package/msg/cs.mjs +20 -0
  73. package/msg/csb.js +22 -2
  74. package/msg/csb.mjs +20 -0
  75. package/msg/da.js +22 -2
  76. package/msg/da.mjs +20 -0
  77. package/msg/de.js +22 -2
  78. package/msg/de.mjs +20 -0
  79. package/msg/diq.js +22 -2
  80. package/msg/diq.mjs +20 -0
  81. package/msg/dtp.js +22 -2
  82. package/msg/dtp.mjs +20 -0
  83. package/msg/dty.js +22 -2
  84. package/msg/dty.mjs +20 -0
  85. package/msg/ee.js +22 -2
  86. package/msg/ee.mjs +20 -0
  87. package/msg/el.js +22 -2
  88. package/msg/el.mjs +20 -0
  89. package/msg/en-gb.js +22 -2
  90. package/msg/en-gb.mjs +20 -0
  91. package/msg/en.js +22 -2
  92. package/msg/en.mjs +20 -0
  93. package/msg/eo.js +22 -2
  94. package/msg/eo.mjs +20 -0
  95. package/msg/es.js +22 -2
  96. package/msg/es.mjs +20 -0
  97. package/msg/et.js +22 -2
  98. package/msg/et.mjs +20 -0
  99. package/msg/eu.js +22 -2
  100. package/msg/eu.mjs +20 -0
  101. package/msg/fa.js +22 -2
  102. package/msg/fa.mjs +20 -0
  103. package/msg/fi.js +22 -2
  104. package/msg/fi.mjs +20 -0
  105. package/msg/fo.js +22 -2
  106. package/msg/fo.mjs +20 -0
  107. package/msg/fr.js +24 -4
  108. package/msg/fr.mjs +20 -0
  109. package/msg/frr.js +22 -2
  110. package/msg/frr.mjs +20 -0
  111. package/msg/ga.js +238 -218
  112. package/msg/ga.mjs +20 -0
  113. package/msg/gl.js +184 -164
  114. package/msg/gl.mjs +20 -0
  115. package/msg/gn.js +22 -2
  116. package/msg/gn.mjs +20 -0
  117. package/msg/gor.js +22 -2
  118. package/msg/gor.mjs +20 -0
  119. package/msg/ha.js +22 -2
  120. package/msg/ha.mjs +20 -0
  121. package/msg/he.js +24 -4
  122. package/msg/he.mjs +20 -0
  123. package/msg/hi.js +22 -2
  124. package/msg/hi.mjs +20 -0
  125. package/msg/hr.js +22 -2
  126. package/msg/hr.mjs +20 -0
  127. package/msg/hrx.js +22 -2
  128. package/msg/hrx.mjs +20 -0
  129. package/msg/hsb.js +22 -2
  130. package/msg/hsb.mjs +20 -0
  131. package/msg/hu.js +32 -12
  132. package/msg/hu.mjs +20 -0
  133. package/msg/hy.js +22 -2
  134. package/msg/hy.mjs +20 -0
  135. package/msg/ia.js +22 -2
  136. package/msg/ia.mjs +20 -0
  137. package/msg/id.js +22 -2
  138. package/msg/id.mjs +20 -0
  139. package/msg/ig.js +22 -2
  140. package/msg/ig.mjs +20 -0
  141. package/msg/inh.js +22 -2
  142. package/msg/inh.mjs +20 -0
  143. package/msg/is.js +22 -2
  144. package/msg/is.mjs +20 -0
  145. package/msg/it.js +22 -2
  146. package/msg/it.mjs +20 -0
  147. package/msg/ja.js +22 -2
  148. package/msg/ja.mjs +20 -0
  149. package/msg/ka.js +22 -2
  150. package/msg/ka.mjs +20 -0
  151. package/msg/kab.js +22 -2
  152. package/msg/kab.mjs +20 -0
  153. package/msg/kbd-cyrl.js +22 -2
  154. package/msg/kbd-cyrl.mjs +20 -0
  155. package/msg/km.js +22 -2
  156. package/msg/km.mjs +20 -0
  157. package/msg/kn.js +22 -2
  158. package/msg/kn.mjs +20 -0
  159. package/msg/ko.js +23 -3
  160. package/msg/ko.mjs +20 -0
  161. package/msg/krc.js +22 -2
  162. package/msg/krc.mjs +20 -0
  163. package/msg/ksh.js +22 -2
  164. package/msg/ksh.mjs +20 -0
  165. package/msg/ku-latn.js +22 -2
  166. package/msg/ku-latn.mjs +20 -0
  167. package/msg/ky.js +22 -2
  168. package/msg/ky.mjs +20 -0
  169. package/msg/la.js +22 -2
  170. package/msg/la.mjs +20 -0
  171. package/msg/lb.js +27 -7
  172. package/msg/lb.mjs +20 -0
  173. package/msg/lki.js +22 -2
  174. package/msg/lki.mjs +20 -0
  175. package/msg/lo.js +22 -2
  176. package/msg/lo.mjs +20 -0
  177. package/msg/lrc.js +22 -2
  178. package/msg/lrc.mjs +20 -0
  179. package/msg/lt.js +22 -2
  180. package/msg/lt.mjs +20 -0
  181. package/msg/lv.js +22 -2
  182. package/msg/lv.mjs +20 -0
  183. package/msg/mg.js +22 -2
  184. package/msg/mg.mjs +20 -0
  185. package/msg/mk.js +22 -2
  186. package/msg/mk.mjs +20 -0
  187. package/msg/ml.js +22 -2
  188. package/msg/ml.mjs +20 -0
  189. package/msg/mnw.js +22 -2
  190. package/msg/mnw.mjs +20 -0
  191. package/msg/ms.js +22 -2
  192. package/msg/ms.mjs +20 -0
  193. package/msg/mt.js +22 -2
  194. package/msg/mt.mjs +20 -0
  195. package/msg/my.js +22 -2
  196. package/msg/my.mjs +20 -0
  197. package/msg/mzn.js +22 -2
  198. package/msg/mzn.mjs +20 -0
  199. package/msg/nb.js +22 -2
  200. package/msg/nb.mjs +20 -0
  201. package/msg/ne.js +22 -2
  202. package/msg/ne.mjs +20 -0
  203. package/msg/nl.js +150 -130
  204. package/msg/nl.mjs +20 -0
  205. package/msg/oc.js +22 -2
  206. package/msg/oc.mjs +20 -0
  207. package/msg/olo.js +22 -2
  208. package/msg/olo.mjs +20 -0
  209. package/msg/pa.js +22 -2
  210. package/msg/pa.mjs +20 -0
  211. package/msg/pl.js +22 -2
  212. package/msg/pl.mjs +20 -0
  213. package/msg/pms.js +116 -96
  214. package/msg/pms.mjs +20 -0
  215. package/msg/ps.js +22 -2
  216. package/msg/ps.mjs +20 -0
  217. package/msg/pt-br.js +22 -2
  218. package/msg/pt-br.mjs +20 -0
  219. package/msg/pt.js +22 -2
  220. package/msg/pt.mjs +20 -0
  221. package/msg/ro.js +22 -2
  222. package/msg/ro.mjs +20 -0
  223. package/msg/ru.js +22 -2
  224. package/msg/ru.mjs +20 -0
  225. package/msg/sc.js +22 -2
  226. package/msg/sc.mjs +20 -0
  227. package/msg/sco.js +22 -2
  228. package/msg/sco.mjs +20 -0
  229. package/msg/sd.js +22 -2
  230. package/msg/sd.mjs +20 -0
  231. package/msg/shn.js +22 -2
  232. package/msg/shn.mjs +20 -0
  233. package/msg/si.js +22 -2
  234. package/msg/si.mjs +20 -0
  235. package/msg/sk.js +235 -215
  236. package/msg/sk.mjs +20 -0
  237. package/msg/skr-arab.js +22 -2
  238. package/msg/skr-arab.mjs +20 -0
  239. package/msg/sl.js +22 -2
  240. package/msg/sl.mjs +20 -0
  241. package/msg/smn.js +22 -2
  242. package/msg/smn.mjs +20 -0
  243. package/msg/sq.js +22 -2
  244. package/msg/sq.mjs +20 -0
  245. package/msg/sr-latn.js +22 -2
  246. package/msg/sr-latn.mjs +20 -0
  247. package/msg/sr.js +22 -2
  248. package/msg/sr.mjs +20 -0
  249. package/msg/sv.js +22 -2
  250. package/msg/sv.mjs +20 -0
  251. package/msg/sw.js +22 -2
  252. package/msg/sw.mjs +20 -0
  253. package/msg/ta.js +22 -2
  254. package/msg/ta.mjs +20 -0
  255. package/msg/tcy.js +22 -2
  256. package/msg/tcy.mjs +20 -0
  257. package/msg/tdd.js +22 -2
  258. package/msg/tdd.mjs +20 -0
  259. package/msg/te.js +22 -2
  260. package/msg/te.mjs +20 -0
  261. package/msg/th.js +22 -2
  262. package/msg/th.mjs +20 -0
  263. package/msg/ti.js +22 -2
  264. package/msg/ti.mjs +20 -0
  265. package/msg/tl.js +22 -2
  266. package/msg/tl.mjs +20 -0
  267. package/msg/tlh.js +22 -2
  268. package/msg/tlh.mjs +20 -0
  269. package/msg/tr.js +36 -16
  270. package/msg/tr.mjs +20 -0
  271. package/msg/ug-arab.js +22 -2
  272. package/msg/ug-arab.mjs +20 -0
  273. package/msg/uk.js +22 -2
  274. package/msg/uk.mjs +20 -0
  275. package/msg/ur.js +22 -2
  276. package/msg/ur.mjs +20 -0
  277. package/msg/uz.js +22 -2
  278. package/msg/uz.mjs +20 -0
  279. package/msg/vi.js +22 -2
  280. package/msg/vi.mjs +20 -0
  281. package/msg/xmf.js +22 -2
  282. package/msg/xmf.mjs +20 -0
  283. package/msg/yo.js +22 -2
  284. package/msg/yo.mjs +20 -0
  285. package/msg/zgh.js +22 -2
  286. package/msg/zgh.mjs +20 -0
  287. package/msg/zh-hans.js +62 -42
  288. package/msg/zh-hans.mjs +20 -0
  289. package/msg/zh-hant.js +22 -2
  290. package/msg/zh-hant.mjs +20 -0
  291. package/package.json +12 -12
  292. package/php_compressed.js +21 -21
  293. package/python_compressed.js +27 -27
package/core/block.d.ts CHANGED
@@ -3,14 +3,6 @@
3
3
  * Copyright 2011 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- /**
7
- * The class representing one block.
8
- *
9
- * @class
10
- */
11
- import './events/events_block_change.js';
12
- import './events/events_block_create.js';
13
- import './events/events_block_delete.js';
14
6
  import { Connection } from './connection.js';
15
7
  import { ConnectionType } from './connection_type.js';
16
8
  import type { Abstract } from './events/events_abstract.js';
@@ -46,9 +46,10 @@ export declare enum ConnectionPreposition {
46
46
  * @internal
47
47
  * @param block The block for which an ARIA representation should be created.
48
48
  * @param verbosity How much detail to include in the description.
49
+ * @param fullBlockFieldLabel An optional override for input labels for full-block fields
49
50
  * @returns The ARIA representation for the specified block.
50
51
  */
51
- export declare function computeAriaLabel(block: BlockSvg, verbosity?: Verbosity): string;
52
+ export declare function computeAriaLabel(block: BlockSvg, verbosity?: Verbosity, fullBlockFieldLabel?: string | undefined): string;
52
53
  /**
53
54
  * Sets the ARIA role and role description for the specified block, accounting
54
55
  * for whether the block is part of a flyout.
@@ -83,6 +84,15 @@ export declare function configureAriaRole(block: BlockSvg): void;
83
84
  * lookback is specified) as the given input.
84
85
  */
85
86
  export declare function computeFieldRowLabel(input: Input, lookback: boolean, verbosity?: Verbosity): string[];
87
+ /**
88
+ * Returns text indicating that a block is the root block of a stack.
89
+ *
90
+ * @internal
91
+ * @param block The block to retrieve a label for.
92
+ * @returns Text indicating that the block begins a stack, or undefined if it
93
+ * does not.
94
+ */
95
+ export declare function getBeginStackLabel(block: BlockSvg): string | undefined;
86
96
  /**
87
97
  * Returns a list of accessibility labels for fields and inputs on a block.
88
98
  * Each entry in the returned array corresponds to one of: (a) a label for a
@@ -98,9 +108,10 @@ export declare function computeFieldRowLabel(input: Input, lookback: boolean, ve
98
108
  * @internal
99
109
  * @param block The block to retrieve a list of field/input labels for.
100
110
  * @param verbosity How much detail to include in each input label.
111
+ * @param fullBlockFieldLabel An optional override for full-block fields.
101
112
  * @returns A list of field/input labels for the given block.
102
113
  */
103
- export declare function getInputLabels(block: BlockSvg, verbosity?: Verbosity): string[];
114
+ export declare function getInputLabels(block: BlockSvg, verbosity?: Verbosity, fullBlockFieldLabel?: string | undefined): string[];
104
115
  /**
105
116
  * Returns a subset of derived labels for inputs on the given block, ending at
106
117
  * the specified input. Used to disambiguate move targets and connection
@@ -8,7 +8,6 @@
8
8
  *
9
9
  * @class
10
10
  */
11
- import './events/events_selected.js';
12
11
  import { Block } from './block.js';
13
12
  import { BlockCopyData } from './clipboard/block_paster.js';
14
13
  import type { Connection } from './connection.js';
@@ -495,6 +494,19 @@ export declare class BlockSvg extends Block implements IBoundedElement, IContext
495
494
  * adjusting its parents.
496
495
  */
497
496
  bringToFront(blockOnly?: boolean): void;
497
+ /**
498
+ * Reorders this block's SVG root and those of its parents (unless
499
+ * `blockOnly`` is set to `true`) to the end of their respective parents so
500
+ * they render on top of their siblings.
501
+ *
502
+ * Unlike `bringToFront`, this does not preserve focus across the reorder, so
503
+ * it is safe to call from within a focus callback
504
+ *
505
+ * @param blockOnly True to only move this block to the front without
506
+ * adjusting its parents.
507
+ * @internal
508
+ */
509
+ moveSvgRootToFront(blockOnly?: boolean): void;
498
510
  /**
499
511
  * Set whether this block can chain onto the bottom of another block.
500
512
  *
package/core/blockly.d.ts CHANGED
@@ -3,10 +3,6 @@
3
3
  * Copyright 2011 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import './events/events_block_create.js';
7
- import './events/workspace_events.js';
8
- import './events/events_ui_base.js';
9
- import './events/events_var_create.js';
10
6
  import { Block } from './block.js';
11
7
  import * as blockAnimations from './block_animations.js';
12
8
  import { BlockFlyoutInflater } from './block_flyout_inflater.js';
@@ -12,12 +12,14 @@ import type { IAutoHideable } from './interfaces/i_autohideable.js';
12
12
  import type { IComponent } from './interfaces/i_component.js';
13
13
  import type { IDeleteArea } from './interfaces/i_delete_area.js';
14
14
  import type { IDragTarget } from './interfaces/i_drag_target.js';
15
+ import type { IFocusableNode } from './interfaces/i_focusable_node.js';
15
16
  import type { IPositionable } from './interfaces/i_positionable.js';
16
17
  declare class Capability<_T> {
17
18
  static POSITIONABLE: Capability<IPositionable>;
18
19
  static DRAG_TARGET: Capability<IDragTarget>;
19
20
  static DELETE_AREA: Capability<IDeleteArea>;
20
21
  static AUTOHIDEABLE: Capability<IAutoHideable>;
22
+ static FOCUSABLE: Capability<IFocusableNode>;
21
23
  private readonly name;
22
24
  /** @param name The name of the component capability. */
23
25
  constructor(name: string);
@@ -43,6 +43,11 @@ export declare class Dragger implements IDragger {
43
43
  * at the end of the drag.
44
44
  */
45
45
  protected shouldReturnToStart(coordinate: Coordinate, rootDraggable: IDraggable): boolean;
46
+ /**
47
+ * Returns the workspace coordinate for a pointer position, for delete-area
48
+ * hit testing.
49
+ */
50
+ private pointerToWorkspaceCoordinate;
46
51
  protected pixelsToWorkspaceUnits(pixelCoord: Coordinate): Coordinate;
47
52
  }
48
53
  //# sourceMappingURL=dragger.d.ts.map
package/core/field.d.ts CHANGED
@@ -10,7 +10,6 @@
10
10
  *
11
11
  * @class
12
12
  */
13
- import './events/events_block_change.js';
14
13
  import type { Block } from './block.js';
15
14
  import type { Input } from './inputs/input.js';
16
15
  import type { IFocusableNode } from './interfaces/i_focusable_node.js';
@@ -277,6 +276,13 @@ export declare abstract class Field<T = any> implements IKeyboardAccessible, IRe
277
276
  * with this method.
278
277
  */
279
278
  isFullBlockField(): boolean;
279
+ /**
280
+ * Returns whether this field is a static text label (ex. FieldLabel).
281
+ * Used internally instead of `instanceof FieldLabel` to avoid circular imports.
282
+ *
283
+ * @internal
284
+ */
285
+ isLabelField(): boolean;
280
286
  /**
281
287
  * Create a field border rect element. Not to be overridden by subclasses.
282
288
  * Instead modify the result of the function inside initView, or create a
@@ -771,7 +777,7 @@ export declare abstract class Field<T = any> implements IKeyboardAccessible, IRe
771
777
  *
772
778
  * @returns true if the element is in the accessibility tree, false if the aria state is hidden
773
779
  */
774
- protected recomputeAriaContext(): boolean;
780
+ recomputeAriaContext(): boolean;
775
781
  /**
776
782
  * Subclasses should reimplement this method to construct their Field
777
783
  * subclass from a JSON arg object.
@@ -8,7 +8,6 @@
8
8
  *
9
9
  * @class
10
10
  */
11
- import './events/events_block_change.js';
12
11
  import { Field, FieldConfig, FieldValidator } from './field.js';
13
12
  type BoolString = 'TRUE' | 'FALSE';
14
13
  type CheckboxBool = BoolString | boolean;
@@ -279,7 +279,7 @@ export declare class FieldDropdown extends Field<string> {
279
279
  */
280
280
  private getSelectedAriaLabel;
281
281
  /**
282
- * Overrides the default label and sets additional aria state.
282
+ * Sets additional aria state.
283
283
  */
284
284
  recomputeAriaContext(): boolean;
285
285
  /**
@@ -3,12 +3,6 @@
3
3
  * Copyright 2012 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- /**
7
- * Text input field.
8
- *
9
- * @class
10
- */
11
- import './events/events_block_change.js';
12
6
  import { Field, FieldConfig, FieldValidator } from './field.js';
13
7
  import { Size } from './utils/size.js';
14
8
  import type { WorkspaceSvg } from './workspace_svg.js';
@@ -23,6 +23,7 @@ export declare class FieldLabel extends Field<string> {
23
23
  EDITABLE: boolean;
24
24
  /** Text labels should not truncate. */
25
25
  maxDisplayLength: number;
26
+ isLabelField(): boolean;
26
27
  /**
27
28
  * @param value The initial value of the field. Should cast to a string.
28
29
  * Defaults to an empty string if null or undefined. Also accepts
@@ -8,7 +8,6 @@
8
8
  *
9
9
  * @class
10
10
  */
11
- import './events/events_block_change.js';
12
11
  import { Field } from './field.js';
13
12
  import { FieldInput, FieldInputConfig, FieldInputValidator } from './field_input.js';
14
13
  /**
@@ -8,7 +8,6 @@
8
8
  *
9
9
  * @class
10
10
  */
11
- import './events/events_block_change.js';
12
11
  import type { Block } from './block.js';
13
12
  import { Field, FieldConfig } from './field.js';
14
13
  import { FieldDropdown, FieldDropdownValidator, MenuGenerator, MenuOption } from './field_dropdown.js';
package/core/gesture.d.ts CHANGED
@@ -3,13 +3,6 @@
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- /**
7
- * The class representing an in-progress gesture, e.g. a drag,
8
- * tap, or pinch to zoom.
9
- *
10
- * @class
11
- */
12
- import './events/events_click.js';
13
6
  import type { BlockSvg } from './block_svg.js';
14
7
  import { RenderedWorkspaceComment } from './comments.js';
15
8
  import type { Field } from './field.js';
@@ -8,7 +8,6 @@
8
8
  *
9
9
  * @class
10
10
  */
11
- import '../field_label.js';
12
11
  import type { Block } from '../block.js';
13
12
  import type { BlockSvg } from '../block_svg.js';
14
13
  import type { Connection } from '../connection.js';
@@ -3,7 +3,6 @@
3
3
  * Copyright 2012 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import './events/events_block_change.js';
7
6
  import type { Block } from './block.js';
8
7
  import type { Abstract } from './events/events_abstract.js';
9
8
  import { Field } from './field.js';
@@ -128,6 +128,12 @@ export declare class RenderedConnection extends Connection implements IContextMe
128
128
  connection: RenderedConnection | null;
129
129
  radius: number;
130
130
  };
131
+ /**
132
+ * Sets the aria role and role description for this connection.
133
+ *
134
+ * @param highlightSvg The focusable element for this connection.
135
+ */
136
+ setAriaRole(highlightSvg: SVGElement): void;
131
137
  /**
132
138
  * Sets the aria role, label, and other state for this connection.
133
139
  *
@@ -40,7 +40,13 @@ export declare enum names {
40
40
  SHOW_TOOLTIP = "show_tooltip",
41
41
  NEXT_HEADING = "next_heading",
42
42
  PREVIOUS_HEADING = "previous_heading",
43
- TOGGLE_SCREENREADER = "toggle_screenreader"
43
+ TOGGLE_SCREENREADER = "toggle_screenreader",
44
+ JUMP_TOP_STACK = "jump_to_top_of_stack",
45
+ JUMP_BOTTOM_STACK = "jump_to_bottom_of_stack",
46
+ JUMP_BLOCK_START = "jump_to_block_start",
47
+ JUMP_BLOCK_END = "jump_to_block_end",
48
+ JUMP_FIRST_BLOCK = "jump_to_first_block",
49
+ JUMP_LAST_BLOCK = "jump_to_last_block"
44
50
  }
45
51
  /**
46
52
  * Keyboard shortcut to hide chaff on escape.
@@ -141,6 +147,36 @@ export declare function registerShowTooltip(): void;
141
147
  * improve the experience for individuals using screenreaders.
142
148
  */
143
149
  export declare function registerToggleScreenreaderMode(): void;
150
+ /**
151
+ * Registers a keyboard shortcut that sets the focus to the block
152
+ * that owns the current focused node.
153
+ */
154
+ export declare function registerJumpBlockStart(): void;
155
+ /**
156
+ * Registers a keyboard shortcut that sets the focus to the
157
+ * last input of the block that owns the current focused node.
158
+ */
159
+ export declare function registerJumpBlockEnd(): void;
160
+ /**
161
+ * Registers a keyboard shortcut that sets the focus to the top block
162
+ * in the current stack.
163
+ */
164
+ export declare function registerJumpTopStack(): void;
165
+ /**
166
+ * Registers a keyboard shortcut that sets the focus to the bottom block
167
+ * in the current stack.
168
+ */
169
+ export declare function registerJumpBottomStack(): void;
170
+ /**
171
+ * Registers a keyboard shortcut that sets the focus to the first
172
+ * block in the workspace.
173
+ */
174
+ export declare function registerJumpFirstBlock(): void;
175
+ /**
176
+ * Registers a keyboard shortcut that sets the focus to the last
177
+ * block in the workspace.
178
+ */
179
+ export declare function registerJumpLastBlock(): void;
144
180
  /**
145
181
  * Registers all default keyboard shortcut item. This should be called once per
146
182
  * instance of KeyboardShortcutRegistry.
@@ -157,4 +193,9 @@ export declare function registerKeyboardNavigationShortcuts(): void;
157
193
  * Registers keyboard shortcuts used to announce screen reader information.
158
194
  */
159
195
  export declare function registerScreenReaderShortcuts(): void;
196
+ /**
197
+ * Registers keyboard shortcuts used to jump between blocks and stacks in the workspace.
198
+ * Note these are not registered by default, so call this function to enable them if desired.
199
+ */
200
+ export declare function registerNavigationShortcuts(): void;
160
201
  //# sourceMappingURL=shortcut_items.d.ts.map
@@ -67,6 +67,8 @@ export declare class CollapsibleToolboxCategory extends ToolboxCategory implemen
67
67
  isExpanded(): boolean;
68
68
  isCollapsible(): boolean;
69
69
  onClick(_e: Event): void;
70
+ /** Sets the visibility of the parent toolbox's flyout. */
71
+ private setFlyoutVisible;
70
72
  /** Toggles whether or not the category is expanded. */
71
73
  toggleExpanded(): void;
72
74
  getDiv(): HTMLDivElement | null;
@@ -6,6 +6,7 @@
6
6
  import { DeleteArea } from './delete_area.js';
7
7
  import './events/events_trashcan_open.js';
8
8
  import type { IAutoHideable } from './interfaces/i_autohideable.js';
9
+ import type { IComponent } from './interfaces/i_component';
9
10
  import type { IDraggable } from './interfaces/i_draggable.js';
10
11
  import type { IFlyout } from './interfaces/i_flyout.js';
11
12
  import type { IFocusableNode } from './interfaces/i_focusable_node.js';
@@ -16,7 +17,7 @@ import type { WorkspaceSvg } from './workspace_svg.js';
16
17
  /**
17
18
  * Class for a trash can.
18
19
  */
19
- export declare class Trashcan extends DeleteArea implements IAutoHideable, IPositionable, IFocusableNode {
20
+ export declare class Trashcan extends DeleteArea implements IAutoHideable, IPositionable, IFocusableNode, IComponent {
20
21
  private workspace;
21
22
  /**
22
23
  * The id for this component that is used to register with the
@@ -186,12 +187,5 @@ export declare class Trashcan extends DeleteArea implements IAutoHideable, IPosi
186
187
  onNodeBlur(): void;
187
188
  canBeFocused(): boolean;
188
189
  performAction(): void;
189
- /**
190
- * Retrieves the globally unique ID of this Trashcan instance. Used for focus
191
- * management.
192
- *
193
- * @internal
194
- */
195
- getGloballyUniqueId(): string;
196
190
  }
197
191
  //# sourceMappingURL=trashcan.d.ts.map
@@ -61,10 +61,10 @@ export declare enum Role {
61
61
  MENU = "menu",
62
62
  /** See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/menuitem_role. */
63
63
  MENUITEM = "menuitem",
64
+ /** See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/none_role. */
65
+ NONE = "none",
64
66
  /** See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/option_role. */
65
67
  OPTION = "option",
66
- /** See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/presentation_role. */
67
- PRESENTATION = "presentation",
68
68
  /** See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/region_role. */
69
69
  REGION = "region",
70
70
  /** See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/row_role. */
@@ -3,13 +3,6 @@
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- /**
7
- * Object representing a map of variables and their types.
8
- *
9
- * @class
10
- */
11
- import './events/events_var_delete.js';
12
- import './events/events_var_rename.js';
13
6
  import type { IVariableMap } from './interfaces/i_variable_map.js';
14
7
  import { IVariableModel, IVariableState } from './interfaces/i_variable_model.js';
15
8
  import type { Workspace } from './workspace.js';
@@ -3,12 +3,6 @@
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- /**
7
- * Components for the variable model.
8
- *
9
- * @class
10
- */
11
- import './events/events_var_create.js';
12
6
  import { IVariableModel, IVariableState } from './interfaces/i_variable_model.js';
13
7
  import type { Workspace } from './workspace.js';
14
8
  /**
@@ -8,7 +8,6 @@
8
8
  *
9
9
  * @class
10
10
  */
11
- import './connection_checker.js';
12
11
  import type { Block } from './block.js';
13
12
  import { WorkspaceComment } from './comments/workspace_comment.js';
14
13
  import type { ConnectionDB } from './connection_db.js';
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Raspberry Pi Foundation
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { IFocusableNode } from './interfaces/i_focusable_node.js';
7
+ import type { IFocusableTree } from './interfaces/i_focusable_tree.js';
8
+ import type { WorkspaceSvg } from './workspace_svg.js';
9
+ /**
10
+ * A focusable element representing the workspace as a whole.
11
+ *
12
+ * Focus on the workspace itself (i.e. not on any block, comment, or other
13
+ * content) lands here rather than on the workspace's region element. VoiceOver
14
+ * does not announce a region when focus moves into it from a node already
15
+ * inside that region, so focusing the region directly (e.g. after pressing "W"
16
+ * from a block) would be silent. This is an ordinary focusable node, so moving
17
+ * to it is announced. It carries the stack count and a "workspace" role
18
+ * description; the enclosing region keeps a short, stable label
19
+ * ("Blocks workspace.").
20
+ */
21
+ export declare class WorkspaceFocusTarget implements IFocusableNode {
22
+ private readonly workspace;
23
+ private readonly element;
24
+ /**
25
+ * @param workspace The workspace this focus target represents.
26
+ * @param element The SVG element that receives focus for the workspace.
27
+ */
28
+ constructor(workspace: WorkspaceSvg, element: SVGElement);
29
+ /** See IFocusableNode.getFocusableElement. */
30
+ getFocusableElement(): SVGElement;
31
+ /** See IFocusableNode.getFocusableTree. */
32
+ getFocusableTree(): IFocusableTree;
33
+ /** See IFocusableNode.onNodeFocus. */
34
+ onNodeFocus(): void;
35
+ /** See IFocusableNode.onNodeBlur. */
36
+ onNodeBlur(): void;
37
+ /** See IFocusableNode.canBeFocused. */
38
+ canBeFocused(): boolean;
39
+ /**
40
+ * Returns the workspace this focus target represents.
41
+ *
42
+ * @returns The workspace this focus target represents.
43
+ */
44
+ getWorkspace(): WorkspaceSvg;
45
+ }
46
+ //# sourceMappingURL=workspace_focus_target.d.ts.map
@@ -8,9 +8,6 @@
8
8
  *
9
9
  * @class
10
10
  */
11
- import './events/events_block_create.js';
12
- import './events/events_theme_change.js';
13
- import './events/events_viewport.js';
14
11
  import type { Block } from './block.js';
15
12
  import type { BlockSvg } from './block_svg.js';
16
13
  import * as browserEvents from './browser_events.js';
@@ -45,6 +42,7 @@ import { Svg } from './utils/svg.js';
45
42
  import * as toolbox from './utils/toolbox.js';
46
43
  import { Workspace } from './workspace.js';
47
44
  import { WorkspaceAudio } from './workspace_audio.js';
45
+ import { WorkspaceFocusTarget } from './workspace_focus_target.js';
48
46
  import { ZoomControls } from './zoom_controls.js';
49
47
  /**
50
48
  * Class for a workspace. This is an onscreen area with optional trashcan,
@@ -250,6 +248,18 @@ export declare class WorkspaceSvg extends Workspace implements IContextMenu, IFo
250
248
  * Selection ring inside the workspace.
251
249
  */
252
250
  private workspaceSelectionRing;
251
+ /**
252
+ * Element that receives focus when the workspace itself (rather than any of
253
+ * its contents) is focused. See {@link WorkspaceFocusTarget}. This is the
254
+ * selection ring (which already represents the workspace being the active
255
+ * node); it's set only for main (non-flyout, non-mutator) workspaces.
256
+ */
257
+ private workspaceFocusTargetElement;
258
+ /**
259
+ * Focusable node wrapping {@link workspaceFocusTargetElement}, or null if this
260
+ * workspace has no focus target.
261
+ */
262
+ private workspaceFocusTarget;
253
263
  /**
254
264
  * Navigator that handles moving focus between items in this workspace in
255
265
  * response to keyboard navigation commands.
@@ -395,7 +405,8 @@ export declare class WorkspaceSvg extends Workspace implements IContextMenu, IFo
395
405
  */
396
406
  setInitialAriaContext(): void;
397
407
  /**
398
- * Updates the label on the workspace to reflect the number of top-level stacks in the workspace.
408
+ * Updates the focus target's label to reflect the number of top-level stacks in the
409
+ * workspace. No-op for workspaces without a focus target (flyouts and mutators).
399
410
  */
400
411
  private updateAriaLabel;
401
412
  /**
@@ -1036,6 +1047,17 @@ export declare class WorkspaceSvg extends Workspace implements IContextMenu, IFo
1036
1047
  getFocusableTree(): IFocusableTree;
1037
1048
  /** See IFocusableNode.onNodeFocus. */
1038
1049
  onNodeFocus(): void;
1050
+ /**
1051
+ * Handles the workspace's focus target receiving focus, which represents focus
1052
+ * landing on the workspace as a whole.
1053
+ *
1054
+ * @internal
1055
+ */
1056
+ handleWorkspaceFocusTargetFocus(): void;
1057
+ /**
1058
+ * Announces the screen reader hint the first time any workspace is focused.
1059
+ */
1060
+ private maybeAnnounceScreenreaderHint;
1039
1061
  /** See IFocusableNode.onNodeBlur. */
1040
1062
  onNodeBlur(): void;
1041
1063
  /** See IFocusableNode.canBeFocused. */
@@ -1044,6 +1066,16 @@ export declare class WorkspaceSvg extends Workspace implements IContextMenu, IFo
1044
1066
  getRootFocusableNode(): IFocusableNode;
1045
1067
  /** See IFocusableTree.getRestoredFocusableNode. */
1046
1068
  getRestoredFocusableNode(previousNode: IFocusableNode | null): IFocusableNode | null;
1069
+ /**
1070
+ * Returns the focusable node representing this workspace as a whole, or null
1071
+ * for workspaces without one (flyouts and mutators).
1072
+ *
1073
+ * Focus lands here when the workspace itself is focused (e.g. via the focus
1074
+ * workspace shortcut) rather than on any of its contents.
1075
+ *
1076
+ * @returns This workspace's focus target node, if any.
1077
+ */
1078
+ getWorkspaceFocusTarget(): WorkspaceFocusTarget | null;
1047
1079
  /** See IFocusableTree.getNestedTrees. */
1048
1080
  getNestedTrees(): Array<IFocusableTree>;
1049
1081
  /**
@@ -3,48 +3,10 @@
3
3
  * Copyright 2015 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- /**
7
- * Object representing a zoom icons.
8
- *
9
- * @class
10
- */
11
- import './events/events_click.js';
12
- import { IFocusableNode } from './interfaces/i_focusable_node.js';
13
6
  import type { IPositionable } from './interfaces/i_positionable.js';
14
7
  import type { UiMetrics } from './metrics_manager.js';
15
8
  import { Rect } from './utils/rect.js';
16
9
  import type { WorkspaceSvg } from './workspace_svg.js';
17
- /**
18
- * Base class for an individual zoom control (in, out, reset).
19
- *
20
- * @internal
21
- */
22
- declare abstract class ZoomControl implements IFocusableNode {
23
- protected workspace: WorkspaceSvg;
24
- protected group: SVGGElement;
25
- private pointerDownHandler;
26
- private id;
27
- constructor(workspace: WorkspaceSvg, group: SVGGElement);
28
- getId(): string;
29
- /**
30
- * Handles a mouse down event on the zoom in or zoom out buttons on the
31
- * workspace.
32
- *
33
- * @param amount Amount of zooming. Negative amount values zoom out, and
34
- * positive amount values zoom in.
35
- * @param e A mouse down or keydown event.
36
- */
37
- protected zoom(amount: number, e: Event): void;
38
- /** Fires a zoom control UI event. */
39
- protected fireZoomEvent(): void;
40
- getFocusableElement(): SVGGElement;
41
- getFocusableTree(): WorkspaceSvg;
42
- onNodeFocus(): void;
43
- onNodeBlur(): void;
44
- canBeFocused(): boolean;
45
- abstract performAction(_e: Event): void;
46
- dispose(): void;
47
- }
48
10
  /**
49
11
  * Class for a zoom controls.
50
12
  */
@@ -115,13 +77,5 @@ export declare class ZoomControls implements IPositionable {
115
77
  * @param savedPositions List of rectangles that are already on the workspace.
116
78
  */
117
79
  position(metrics: UiMetrics, savedPositions: Rect[]): void;
118
- /**
119
- * Returns the individual zoom control, if any, with the given ID. Used for
120
- * focus management.
121
- *
122
- * @internal
123
- */
124
- getControlWithId(id: string): ZoomControl | undefined;
125
80
  }
126
- export {};
127
81
  //# sourceMappingURL=zoom_controls.d.ts.map