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
@@ -1,11 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import type { IFlyout } from './interfaces/i_flyout.js';
7
- import { Navigator } from './navigator.js';
8
- export declare class FlyoutNavigator extends Navigator {
9
- constructor(flyout: IFlyout);
10
- }
11
- //# sourceMappingURL=flyout_navigator.d.ts.map
@@ -1,65 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import type { IFlyout } from '../interfaces/i_flyout.js';
7
- import type { IFocusableNode } from '../interfaces/i_focusable_node.js';
8
- import type { INavigationPolicy } from '../interfaces/i_navigation_policy.js';
9
- /**
10
- * Generic navigation policy that navigates between items in the flyout.
11
- */
12
- export declare class FlyoutNavigationPolicy<T> implements INavigationPolicy<T> {
13
- private policy;
14
- private flyout;
15
- /**
16
- * Creates a new FlyoutNavigationPolicy instance.
17
- *
18
- * @param policy The policy to defer to for parents/children.
19
- * @param flyout The flyout this policy will control navigation in.
20
- */
21
- constructor(policy: INavigationPolicy<T>, flyout: IFlyout);
22
- /**
23
- * Returns null to prevent navigating into flyout items.
24
- *
25
- * @param _current The flyout item to navigate from.
26
- * @returns Null to prevent navigating into flyout items.
27
- */
28
- getFirstChild(_current: T): IFocusableNode | null;
29
- /**
30
- * Returns the parent of the given flyout item.
31
- *
32
- * @param current The flyout item to navigate from.
33
- * @returns The parent of the given flyout item.
34
- */
35
- getParent(current: T): IFocusableNode | null;
36
- /**
37
- * Returns the next item in the flyout relative to the given item.
38
- *
39
- * @param current The flyout item to navigate from.
40
- * @returns The flyout item following the given one.
41
- */
42
- getNextSibling(current: T): IFocusableNode | null;
43
- /**
44
- * Returns the previous item in the flyout relative to the given item.
45
- *
46
- * @param current The flyout item to navigate from.
47
- * @returns The flyout item preceding the given one.
48
- */
49
- getPreviousSibling(current: T): IFocusableNode | null;
50
- /**
51
- * Returns whether or not the given flyout item can be navigated to.
52
- *
53
- * @param current The instance to check for navigability.
54
- * @returns True if the given flyout item can be focused.
55
- */
56
- isNavigable(current: T): boolean;
57
- /**
58
- * Returns whether the given object can be navigated from by this policy.
59
- *
60
- * @param current The object to check if this policy applies to.
61
- * @returns True if the object is a BlockSvg.
62
- */
63
- isApplicable(current: any): current is T;
64
- }
65
- //# sourceMappingURL=flyout_navigation_policy.d.ts.map
@@ -1,187 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2020 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- /**
7
- * @fileoverview The class representing a line cursor.
8
- * A line cursor tries to traverse the blocks and connections on a block as if
9
- * they were lines of code in a text editor. Previous and next traverse previous
10
- * connections, next connections and blocks, while in and out traverse input
11
- * connections and fields.
12
- * @author aschmiedt@google.com (Abby Schmiedt)
13
- */
14
- import { BlockSvg } from '../block_svg.js';
15
- import type { IFocusableNode } from '../interfaces/i_focusable_node.js';
16
- import type { WorkspaceSvg } from '../workspace_svg.js';
17
- import { Marker } from './marker.js';
18
- /**
19
- * Class for a line cursor.
20
- */
21
- export declare class LineCursor extends Marker {
22
- protected readonly workspace: WorkspaceSvg;
23
- type: string;
24
- /** Locations to try moving the cursor to after a deletion. */
25
- private potentialNodes;
26
- /**
27
- * @param workspace The workspace this cursor belongs to.
28
- */
29
- constructor(workspace: WorkspaceSvg);
30
- /**
31
- * Moves the cursor to the next block or workspace comment in the pre-order
32
- * traversal.
33
- *
34
- * @returns The next node, or null if the current node is not set or there is
35
- * no next value.
36
- */
37
- next(): IFocusableNode | null;
38
- /**
39
- * Moves the cursor to the next input connection or field
40
- * in the pre order traversal.
41
- *
42
- * @returns The next node, or null if the current node is
43
- * not set or there is no next value.
44
- */
45
- in(): IFocusableNode | null;
46
- /**
47
- * Moves the cursor to the previous block or workspace comment in the
48
- * pre-order traversal.
49
- *
50
- * @returns The previous node, or null if the current node is not set or there
51
- * is no previous value.
52
- */
53
- prev(): IFocusableNode | null;
54
- /**
55
- * Moves the cursor to the previous input connection or field in the pre order
56
- * traversal.
57
- *
58
- * @returns The previous node, or null if the current node
59
- * is not set or there is no previous value.
60
- */
61
- out(): IFocusableNode | null;
62
- /**
63
- * Returns true iff the node to which we would navigate if in() were
64
- * called is the same as the node to which we would navigate if next() were
65
- * called - in effect, if the LineCursor is at the end of the 'current
66
- * line' of the program.
67
- */
68
- atEndOfLine(): boolean;
69
- /**
70
- * Uses pre order traversal to navigate the Blockly AST. This will allow
71
- * a user to easily navigate the entire Blockly AST without having to go in
72
- * and out levels on the tree.
73
- *
74
- * @param node The current position in the AST.
75
- * @param isValid A function true/false depending on whether the given node
76
- * should be traversed.
77
- * @param visitedNodes A set of previously visited nodes used to avoid cycles.
78
- * @returns The next node in the traversal.
79
- */
80
- private getNextNodeImpl;
81
- /**
82
- * Get the next node in the AST, optionally allowing for loopback.
83
- *
84
- * @param node The current position in the AST.
85
- * @param isValid A function true/false depending on whether the given node
86
- * should be traversed.
87
- * @param loop Whether to loop around to the beginning of the workspace if no
88
- * valid node was found.
89
- * @returns The next node in the traversal.
90
- */
91
- getNextNode(node: IFocusableNode | null, isValid: (p1: IFocusableNode | null) => boolean, loop: boolean): IFocusableNode | null;
92
- /**
93
- * Reverses the pre order traversal in order to find the previous node. This
94
- * will allow a user to easily navigate the entire Blockly AST without having
95
- * to go in and out levels on the tree.
96
- *
97
- * @param node The current position in the AST.
98
- * @param isValid A function true/false depending on whether the given node
99
- * should be traversed.
100
- * @param visitedNodes A set of previously visited nodes used to avoid cycles.
101
- * @returns The previous node in the traversal or null if no previous node
102
- * exists.
103
- */
104
- private getPreviousNodeImpl;
105
- /**
106
- * Get the previous node in the AST, optionally allowing for loopback.
107
- *
108
- * @param node The current position in the AST.
109
- * @param isValid A function true/false depending on whether the given node
110
- * should be traversed.
111
- * @param loop Whether to loop around to the end of the workspace if no valid
112
- * node was found.
113
- * @returns The previous node in the traversal or null if no previous node
114
- * exists.
115
- */
116
- getPreviousNode(node: IFocusableNode | null, isValid: (p1: IFocusableNode | null) => boolean, loop: boolean): IFocusableNode | null;
117
- /**
118
- * Get the right most child of a node.
119
- *
120
- * @param node The node to find the right most child of.
121
- * @returns The right most child of the given node, or the node if no child
122
- * exists.
123
- */
124
- private getRightMostChild;
125
- /**
126
- * Prepare for the deletion of a block by making a list of nodes we
127
- * could move the cursor to afterwards and save it to
128
- * this.potentialNodes.
129
- *
130
- * After the deletion has occurred, call postDelete to move it to
131
- * the first valid node on that list.
132
- *
133
- * The locations to try (in order of preference) are:
134
- *
135
- * - The current location.
136
- * - The connection to which the deleted block is attached.
137
- * - The block connected to the next connection of the deleted block.
138
- * - The parent block of the deleted block.
139
- * - A location on the workspace beneath the deleted block.
140
- *
141
- * N.B.: When block is deleted, all of the blocks conneccted to that
142
- * block's inputs are also deleted, but not blocks connected to its
143
- * next connection.
144
- *
145
- * @param deletedBlock The block that is being deleted.
146
- */
147
- preDelete(deletedBlock: BlockSvg): void;
148
- /**
149
- * Move the cursor to the first valid location in
150
- * this.potentialNodes, following a block deletion.
151
- */
152
- postDelete(): void;
153
- /**
154
- * Get the current location of the cursor.
155
- *
156
- * Overrides normal Marker getCurNode to update the current node from the
157
- * selected block. This typically happens via the selection listener but that
158
- * is not called immediately when `Gesture` calls
159
- * `Blockly.common.setSelected`. In particular the listener runs after showing
160
- * the context menu.
161
- *
162
- * @returns The current field, connection, or block the cursor is on.
163
- */
164
- getCurNode(): IFocusableNode | null;
165
- /**
166
- * Set the location of the cursor and draw it.
167
- *
168
- * Overrides normal Marker setCurNode logic to call
169
- * this.drawMarker() instead of this.drawer.draw() directly.
170
- *
171
- * @param newNode The new location of the cursor.
172
- */
173
- setCurNode(newNode: IFocusableNode): void;
174
- /**
175
- * Get the first navigable node on the workspace, or null if none exist.
176
- *
177
- * @returns The first navigable node on the workspace, or null.
178
- */
179
- getFirstNode(): IFocusableNode | null;
180
- /**
181
- * Get the last navigable node on the workspace, or null if none exist.
182
- *
183
- * @returns The last navigable node on the workspace, or null.
184
- */
185
- getLastNode(): IFocusableNode | null;
186
- }
187
- //# sourceMappingURL=line_cursor.d.ts.map
@@ -1,53 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- /**
7
- * The class representing a marker.
8
- * Used primarily for keyboard navigation to show a marked location.
9
- *
10
- * @class
11
- */
12
- import { BlockSvg } from '../block_svg.js';
13
- import type { IFocusableNode } from '../interfaces/i_focusable_node.js';
14
- /**
15
- * Class for a marker.
16
- * This is used in keyboard navigation to save a location in the Blockly AST.
17
- */
18
- export declare class Marker {
19
- /** The colour of the marker. */
20
- colour: string | null;
21
- /** The current location of the marker. */
22
- protected curNode: IFocusableNode | null;
23
- /** The type of the marker. */
24
- type: string;
25
- /**
26
- * Gets the current location of the marker.
27
- *
28
- * @returns The current field, connection, or block the marker is on.
29
- */
30
- getCurNode(): IFocusableNode | null;
31
- /**
32
- * Set the location of the marker and call the update method.
33
- *
34
- * @param newNode The new location of the marker, or null to remove it.
35
- */
36
- setCurNode(newNode: IFocusableNode | null): void;
37
- /** Dispose of this marker. */
38
- dispose(): void;
39
- /**
40
- * Returns the block that the given node is a child of.
41
- *
42
- * @returns The parent block of the node if any, otherwise null.
43
- */
44
- getSourceBlockFromNode(node: IFocusableNode | null): BlockSvg | null;
45
- /**
46
- * Returns the block that this marker's current node is a child of.
47
- *
48
- * @returns The parent block of the marker's current node if any, otherwise
49
- * null.
50
- */
51
- getSourceBlock(): BlockSvg | null;
52
- }
53
- //# sourceMappingURL=marker.d.ts.map
@@ -1,72 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- /**
7
- * Object in charge of managing markers and the cursor.
8
- *
9
- * @class
10
- */
11
- import { LineCursor } from './keyboard_nav/line_cursor.js';
12
- import type { Marker } from './keyboard_nav/marker.js';
13
- import type { WorkspaceSvg } from './workspace_svg.js';
14
- /**
15
- * Class to manage the multiple markers and the cursor on a workspace.
16
- */
17
- export declare class MarkerManager {
18
- private readonly workspace;
19
- /** The name of the local marker. */
20
- static readonly LOCAL_MARKER = "local_marker_1";
21
- /** The cursor. */
22
- private cursor;
23
- /** The map of markers for the workspace. */
24
- private markers;
25
- /**
26
- * @param workspace The workspace for the marker manager.
27
- * @internal
28
- */
29
- constructor(workspace: WorkspaceSvg);
30
- /**
31
- * Register the marker by adding it to the map of markers.
32
- *
33
- * @param id A unique identifier for the marker.
34
- * @param marker The marker to register.
35
- */
36
- registerMarker(id: string, marker: Marker): void;
37
- /**
38
- * Unregister the marker by removing it from the map of markers.
39
- *
40
- * @param id The ID of the marker to unregister.
41
- */
42
- unregisterMarker(id: string): void;
43
- /**
44
- * Get the cursor for the workspace.
45
- *
46
- * @returns The cursor for this workspace.
47
- */
48
- getCursor(): LineCursor;
49
- /**
50
- * Get a single marker that corresponds to the given ID.
51
- *
52
- * @param id A unique identifier for the marker.
53
- * @returns The marker that corresponds to the given ID, or null if none
54
- * exists.
55
- */
56
- getMarker(id: string): Marker | null;
57
- /**
58
- * Sets the cursor and initializes the drawer for use with keyboard
59
- * navigation.
60
- *
61
- * @param cursor The cursor used to move around this workspace.
62
- */
63
- setCursor(cursor: LineCursor): void;
64
- /**
65
- * Dispose of the marker manager.
66
- * Go through and delete all markers associated with this marker manager.
67
- *
68
- * @internal
69
- */
70
- dispose(): void;
71
- }
72
- //# sourceMappingURL=marker_manager.d.ts.map
@@ -1,65 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import type { IFocusableNode } from './interfaces/i_focusable_node.js';
7
- import type { INavigationPolicy } from './interfaces/i_navigation_policy.js';
8
- type RuleList<T> = INavigationPolicy<T>[];
9
- /**
10
- * Class responsible for determining where focus should move in response to
11
- * keyboard navigation commands.
12
- */
13
- export declare class Navigator {
14
- /**
15
- * Map from classes to a corresponding ruleset to handle navigation from
16
- * instances of that class.
17
- */
18
- protected rules: RuleList<any>;
19
- /**
20
- * Adds a navigation ruleset to this Navigator.
21
- *
22
- * @param policy A ruleset that determines where focus should move starting
23
- * from an instance of its managed class.
24
- */
25
- addNavigationPolicy(policy: INavigationPolicy<any>): void;
26
- /**
27
- * Returns the navigation ruleset associated with the given object instance's
28
- * class.
29
- *
30
- * @param current An object to retrieve a navigation ruleset for.
31
- * @returns The navigation ruleset of objects of the given object's class, or
32
- * undefined if no ruleset has been registered for the object's class.
33
- */
34
- private get;
35
- /**
36
- * Returns the first child of the given object instance, if any.
37
- *
38
- * @param current The object to retrieve the first child of.
39
- * @returns The first child node of the given object, if any.
40
- */
41
- getFirstChild(current: IFocusableNode): IFocusableNode | null;
42
- /**
43
- * Returns the parent of the given object instance, if any.
44
- *
45
- * @param current The object to retrieve the parent of.
46
- * @returns The parent node of the given object, if any.
47
- */
48
- getParent(current: IFocusableNode): IFocusableNode | null;
49
- /**
50
- * Returns the next sibling of the given object instance, if any.
51
- *
52
- * @param current The object to retrieve the next sibling node of.
53
- * @returns The next sibling node of the given object, if any.
54
- */
55
- getNextSibling(current: IFocusableNode): IFocusableNode | null;
56
- /**
57
- * Returns the previous sibling of the given object instance, if any.
58
- *
59
- * @param current The object to retrieve the previous sibling node of.
60
- * @returns The previous sibling node of the given object, if any.
61
- */
62
- getPreviousSibling(current: IFocusableNode): IFocusableNode | null;
63
- }
64
- export {};
65
- //# sourceMappingURL=navigator.d.ts.map
package/media/sprites.png DELETED
Binary file