@cp949/phyx-blockly 12.5.1-p1 → 13.4.0-patch.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (462) hide show
  1. package/README.md +7 -2
  2. package/blockly.min.js +2280 -2126
  3. package/blockly.mjs +13 -5
  4. package/blockly_compressed.js +1767 -1794
  5. package/blockly_compressed.js.map +1 -1
  6. package/blocks_compressed.js +151 -177
  7. package/blocks_compressed.js.map +1 -1
  8. package/core/block.d.ts +41 -19
  9. package/core/block_aria_composer.d.ts +158 -0
  10. package/core/block_svg.d.ts +88 -35
  11. package/core/blockly.d.ts +22 -22
  12. package/core/bubbles/bubble.d.ts +59 -5
  13. package/core/bubbles/mini_workspace_bubble.d.ts +11 -3
  14. package/core/bubbles/text_bubble.d.ts +7 -4
  15. package/core/bubbles/textinput_bubble.d.ts +11 -1
  16. package/core/clipboard/block_paster.d.ts +5 -5
  17. package/core/clipboard/registry.d.ts +1 -1
  18. package/core/clipboard/workspace_comment_paster.d.ts +4 -4
  19. package/core/clipboard.d.ts +1 -1
  20. package/core/comments/collapse_comment_bar_button.d.ts +7 -4
  21. package/core/comments/comment_bar_button.d.ts +15 -1
  22. package/core/comments/comment_editor.d.ts +21 -6
  23. package/core/comments/comment_view.d.ts +5 -5
  24. package/core/comments/delete_comment_bar_button.d.ts +7 -4
  25. package/core/comments/rendered_workspace_comment.d.ts +17 -12
  26. package/core/comments/workspace_comment.d.ts +2 -2
  27. package/core/common.d.ts +10 -3
  28. package/core/component_manager.d.ts +2 -0
  29. package/core/config.d.ts +37 -11
  30. package/core/connection_db.d.ts +40 -0
  31. package/core/contextmenu_registry.d.ts +12 -2
  32. package/core/css.d.ts +2 -1
  33. package/core/dragging/block_drag_strategy.d.ts +196 -19
  34. package/core/dragging/bubble_drag_strategy.d.ts +5 -4
  35. package/core/dragging/comment_drag_strategy.d.ts +4 -4
  36. package/core/dragging/dragger.d.ts +14 -14
  37. package/core/events/events_block_base.d.ts +2 -1
  38. package/core/events/events_block_change.d.ts +3 -2
  39. package/core/events/events_block_create.d.ts +3 -5
  40. package/core/events/events_block_delete.d.ts +3 -5
  41. package/core/events/events_block_drag.d.ts +2 -2
  42. package/core/events/events_block_field_intermediate_change.d.ts +3 -2
  43. package/core/events/events_block_move.d.ts +2 -1
  44. package/core/events/events_click.d.ts +2 -2
  45. package/core/events/events_comment_base.d.ts +2 -1
  46. package/core/events/events_comment_change.d.ts +2 -1
  47. package/core/events/events_comment_collapse.d.ts +3 -2
  48. package/core/events/events_comment_create.d.ts +2 -4
  49. package/core/events/events_comment_delete.d.ts +2 -4
  50. package/core/events/events_comment_drag.d.ts +2 -2
  51. package/core/events/events_comment_move.d.ts +2 -1
  52. package/core/events/events_comment_resize.d.ts +2 -1
  53. package/core/events/events_selected.d.ts +1 -1
  54. package/core/events/events_theme_change.d.ts +1 -1
  55. package/core/events/events_toolbox_item_select.d.ts +1 -1
  56. package/core/events/events_trashcan_open.d.ts +1 -1
  57. package/core/events/events_var_base.d.ts +2 -1
  58. package/core/events/events_var_create.d.ts +2 -1
  59. package/core/events/events_var_delete.d.ts +2 -1
  60. package/core/events/events_var_rename.d.ts +2 -1
  61. package/core/events/events_var_type_change.d.ts +2 -1
  62. package/core/events/events_viewport.d.ts +1 -1
  63. package/core/field.d.ts +120 -13
  64. package/core/field_checkbox.d.ts +31 -4
  65. package/core/field_dropdown.d.ts +68 -4
  66. package/core/field_image.d.ts +54 -2
  67. package/core/field_input.d.ts +38 -13
  68. package/core/field_label.d.ts +31 -2
  69. package/core/field_label_serializable.d.ts +3 -2
  70. package/core/field_number.d.ts +14 -3
  71. package/core/field_textinput.d.ts +15 -5
  72. package/core/field_variable.d.ts +16 -6
  73. package/core/flyout_base.d.ts +12 -126
  74. package/core/flyout_button.d.ts +11 -0
  75. package/core/flyout_horizontal.d.ts +0 -11
  76. package/core/flyout_metrics_manager.d.ts +2 -1
  77. package/core/flyout_vertical.d.ts +0 -11
  78. package/core/focus_manager.d.ts +52 -2
  79. package/core/generator.d.ts +2 -2
  80. package/core/gesture.d.ts +2 -21
  81. package/core/grid.d.ts +2 -2
  82. package/core/hints.d.ts +78 -0
  83. package/core/icons/comment_icon.d.ts +8 -0
  84. package/core/icons/icon.d.ts +20 -0
  85. package/core/icons/icon_types.d.ts +4 -4
  86. package/core/icons/mutator_icon.d.ts +8 -0
  87. package/core/icons/registry.d.ts +1 -1
  88. package/core/icons/warning_icon.d.ts +8 -0
  89. package/core/inputs/input.d.ts +58 -2
  90. package/core/insertion_marker.d.ts +54 -0
  91. package/core/insertion_marker_previewer.d.ts +20 -4
  92. package/core/interfaces/i_bounded_element.d.ts +7 -0
  93. package/core/interfaces/i_bubble.d.ts +3 -2
  94. package/core/interfaces/i_collapsible_toolbox_item.d.ts +5 -1
  95. package/core/interfaces/i_comment_icon.d.ts +6 -6
  96. package/core/interfaces/i_drag_target.d.ts +2 -2
  97. package/core/interfaces/i_draggable.d.ts +22 -17
  98. package/core/interfaces/i_dragger.d.ts +19 -10
  99. package/core/interfaces/i_flyout.d.ts +1 -31
  100. package/core/interfaces/i_flyout_inflater.d.ts +9 -0
  101. package/core/interfaces/i_focusable_node.d.ts +8 -0
  102. package/core/interfaces/i_focusable_tree.d.ts +8 -0
  103. package/core/interfaces/i_icon.d.ts +1 -1
  104. package/core/interfaces/i_json_block_definition.d.ts +113 -0
  105. package/core/interfaces/i_keyboard_accessible.d.ts +1 -1
  106. package/core/interfaces/i_navigation_policy.d.ts +12 -0
  107. package/core/interfaces/i_parameter_model.d.ts +2 -2
  108. package/core/interfaces/i_paster.d.ts +3 -3
  109. package/core/interfaces/i_procedure_block.d.ts +1 -1
  110. package/core/interfaces/i_procedure_map.d.ts +1 -1
  111. package/core/interfaces/i_procedure_model.d.ts +2 -2
  112. package/core/interfaces/i_selectable.d.ts +3 -3
  113. package/core/interfaces/i_selectable_toolbox_item.d.ts +3 -3
  114. package/core/interfaces/i_toolbox.d.ts +4 -0
  115. package/core/interfaces/i_toolbox_item.d.ts +6 -0
  116. package/core/interfaces/i_variable_backed_parameter_model.d.ts +1 -1
  117. package/core/keyboard_nav/keyboard_mover.d.ts +151 -0
  118. package/core/keyboard_nav/move_indicator.d.ts +35 -0
  119. package/core/keyboard_nav/{block_navigation_policy.d.ts → navigation_policies/block_navigation_policy.d.ts} +17 -25
  120. package/core/keyboard_nav/navigation_policies/bubble_navigation_policy.d.ts +63 -0
  121. package/core/keyboard_nav/{comment_bar_button_navigation_policy.d.ts → navigation_policies/comment_bar_button_navigation_policy.d.ts} +10 -3
  122. package/core/keyboard_nav/{comment_editor_navigation_policy.d.ts → navigation_policies/comment_editor_navigation_policy.d.ts} +10 -3
  123. package/core/keyboard_nav/{connection_navigation_policy.d.ts → navigation_policies/connection_navigation_policy.d.ts} +11 -16
  124. package/core/keyboard_nav/{field_navigation_policy.d.ts → navigation_policies/field_navigation_policy.d.ts} +10 -3
  125. package/core/keyboard_nav/{flyout_button_navigation_policy.d.ts → navigation_policies/flyout_button_navigation_policy.d.ts} +10 -3
  126. package/core/keyboard_nav/{flyout_separator_navigation_policy.d.ts → navigation_policies/flyout_separator_navigation_policy.d.ts} +9 -3
  127. package/core/keyboard_nav/{icon_navigation_policy.d.ts → navigation_policies/icon_navigation_policy.d.ts} +12 -5
  128. package/core/keyboard_nav/navigation_policies/toolbox_item_navigation_policy.d.ts +64 -0
  129. package/core/keyboard_nav/{workspace_comment_navigation_policy.d.ts → navigation_policies/workspace_comment_navigation_policy.d.ts} +14 -9
  130. package/core/keyboard_nav/{workspace_navigation_policy.d.ts → navigation_policies/workspace_navigation_policy.d.ts} +10 -3
  131. package/core/keyboard_nav/navigators/flyout_navigator.d.ts +63 -0
  132. package/core/keyboard_nav/navigators/navigator.d.ts +237 -0
  133. package/core/keyboard_nav/navigators/toolbox_navigator.d.ts +70 -0
  134. package/core/keyboard_navigation_controller.d.ts +12 -0
  135. package/core/layer_manager.d.ts +3 -3
  136. package/core/menu.d.ts +3 -0
  137. package/core/menuitem.d.ts +8 -1
  138. package/core/observable_procedure_map.d.ts +1 -1
  139. package/core/options.d.ts +4 -4
  140. package/core/procedures.d.ts +5 -8
  141. package/core/registry.d.ts +0 -2
  142. package/core/render_management.d.ts +1 -1
  143. package/core/rendered_connection.d.ts +33 -6
  144. package/core/renderers/common/constants.d.ts +4 -7
  145. package/core/renderers/common/i_path_object.d.ts +8 -0
  146. package/core/renderers/common/info.d.ts +1 -1
  147. package/core/renderers/common/path_object.d.ts +7 -16
  148. package/core/renderers/common/renderer.d.ts +3 -3
  149. package/core/renderers/zelos/constants.d.ts +1 -14
  150. package/core/renderers/zelos/drawer.d.ts +1 -1
  151. package/core/renderers/zelos/info.d.ts +10 -1
  152. package/core/renderers/zelos/measurables/bottom_row.d.ts +1 -1
  153. package/core/renderers/zelos/measurables/top_row.d.ts +1 -1
  154. package/core/renderers/zelos/path_object.d.ts +0 -3
  155. package/core/renderers/zelos/renderer.d.ts +8 -0
  156. package/core/serialization/procedures.d.ts +2 -2
  157. package/core/serialization/workspace_comments.d.ts +2 -2
  158. package/core/shortcut_items.d.ts +167 -2
  159. package/core/shortcut_registry.d.ts +9 -3
  160. package/core/theme.d.ts +0 -2
  161. package/core/toast.d.ts +2 -11
  162. package/core/toolbox/category.d.ts +11 -0
  163. package/core/toolbox/collapsible_category.d.ts +2 -0
  164. package/core/toolbox/separator.d.ts +4 -0
  165. package/core/toolbox/toolbox.d.ts +17 -33
  166. package/core/toolbox/toolbox_item.d.ts +4 -0
  167. package/core/tooltip.d.ts +13 -2
  168. package/core/trashcan.d.ts +16 -38
  169. package/core/utils/aria.d.ts +259 -28
  170. package/core/utils/dom.d.ts +1 -1
  171. package/core/utils/focusable_tree_traverser.d.ts +2 -2
  172. package/core/utils/shortcut_formatting.d.ts +22 -0
  173. package/core/utils/style.d.ts +14 -0
  174. package/core/utils/toolbox.d.ts +0 -8
  175. package/core/utils/useragent.d.ts +1 -0
  176. package/core/variable_map.d.ts +1 -41
  177. package/core/variable_model.d.ts +1 -7
  178. package/core/variables.d.ts +7 -8
  179. package/core/variables_dynamic.d.ts +4 -6
  180. package/core/workspace.d.ts +7 -85
  181. package/core/workspace_audio.d.ts +36 -7
  182. package/core/workspace_focus_target.d.ts +51 -0
  183. package/core/workspace_svg.d.ts +79 -60
  184. package/core/xml.d.ts +1 -1
  185. package/core/zoom_controls.d.ts +6 -59
  186. package/dart_compressed.js +123 -164
  187. package/dart_compressed.js.map +1 -1
  188. package/index.mjs +13 -5
  189. package/javascript_compressed.js +96 -147
  190. package/javascript_compressed.js.map +1 -1
  191. package/lua_compressed.js +142 -178
  192. package/lua_compressed.js.map +1 -1
  193. package/media/drop.mp3 +0 -0
  194. package/msg/ab.js +265 -7
  195. package/msg/ab.mjs +259 -1
  196. package/msg/ace.js +266 -8
  197. package/msg/ace.mjs +259 -1
  198. package/msg/af.js +265 -7
  199. package/msg/af.mjs +259 -1
  200. package/msg/am.js +266 -8
  201. package/msg/am.mjs +259 -1
  202. package/msg/ar.js +283 -25
  203. package/msg/ar.mjs +259 -1
  204. package/msg/ast.js +266 -8
  205. package/msg/ast.mjs +259 -1
  206. package/msg/az.js +266 -8
  207. package/msg/az.mjs +259 -1
  208. package/msg/ba.js +265 -7
  209. package/msg/ba.mjs +259 -1
  210. package/msg/bcc.js +265 -7
  211. package/msg/bcc.mjs +259 -1
  212. package/msg/be-tarask.js +297 -39
  213. package/msg/be-tarask.mjs +259 -1
  214. package/msg/be.js +266 -8
  215. package/msg/be.mjs +259 -1
  216. package/msg/bg.js +282 -24
  217. package/msg/bg.mjs +259 -1
  218. package/msg/bn.js +266 -8
  219. package/msg/bn.mjs +259 -1
  220. package/msg/br.js +266 -8
  221. package/msg/br.mjs +259 -1
  222. package/msg/bs.js +265 -7
  223. package/msg/bs.mjs +259 -1
  224. package/msg/ca.js +265 -7
  225. package/msg/ca.mjs +259 -1
  226. package/msg/ce.js +265 -7
  227. package/msg/ce.mjs +259 -1
  228. package/msg/cs.js +290 -32
  229. package/msg/cs.mjs +259 -1
  230. package/msg/csb.js +723 -0
  231. package/msg/csb.mjs +704 -0
  232. package/msg/da.js +284 -26
  233. package/msg/da.mjs +259 -1
  234. package/msg/de.js +265 -7
  235. package/msg/de.mjs +259 -1
  236. package/msg/diq.js +267 -9
  237. package/msg/diq.mjs +259 -1
  238. package/msg/dtp.js +265 -7
  239. package/msg/dtp.mjs +259 -1
  240. package/msg/dty.js +265 -7
  241. package/msg/dty.mjs +259 -1
  242. package/msg/ee.js +265 -7
  243. package/msg/ee.mjs +259 -1
  244. package/msg/el.js +290 -32
  245. package/msg/el.mjs +259 -1
  246. package/msg/en-gb.js +266 -8
  247. package/msg/en-gb.mjs +259 -1
  248. package/msg/en.js +266 -8
  249. package/msg/en.mjs +259 -1
  250. package/msg/eo.js +265 -7
  251. package/msg/eo.mjs +259 -1
  252. package/msg/es.js +282 -24
  253. package/msg/es.mjs +259 -1
  254. package/msg/et.js +265 -7
  255. package/msg/et.mjs +259 -1
  256. package/msg/eu.js +265 -7
  257. package/msg/eu.mjs +259 -1
  258. package/msg/fa.js +266 -8
  259. package/msg/fa.mjs +259 -1
  260. package/msg/fi.js +284 -26
  261. package/msg/fi.mjs +259 -1
  262. package/msg/fo.js +265 -7
  263. package/msg/fo.mjs +259 -1
  264. package/msg/fr.js +283 -25
  265. package/msg/fr.mjs +259 -1
  266. package/msg/frr.js +266 -8
  267. package/msg/frr.mjs +259 -1
  268. package/msg/ga.js +723 -0
  269. package/msg/{cdo.mjs → ga.mjs} +261 -3
  270. package/msg/gl.js +290 -32
  271. package/msg/gl.mjs +259 -1
  272. package/msg/gn.js +266 -8
  273. package/msg/gn.mjs +259 -1
  274. package/msg/gor.js +265 -7
  275. package/msg/gor.mjs +259 -1
  276. package/msg/ha.js +265 -7
  277. package/msg/ha.mjs +259 -1
  278. package/msg/he.js +313 -55
  279. package/msg/he.mjs +259 -1
  280. package/msg/hi.js +265 -7
  281. package/msg/hi.mjs +259 -1
  282. package/msg/hr.js +265 -7
  283. package/msg/hr.mjs +259 -1
  284. package/msg/hrx.js +265 -7
  285. package/msg/hrx.mjs +259 -1
  286. package/msg/hsb.js +265 -7
  287. package/msg/hsb.mjs +259 -1
  288. package/msg/hu.js +270 -12
  289. package/msg/hu.mjs +259 -1
  290. package/msg/hy.js +265 -7
  291. package/msg/hy.mjs +259 -1
  292. package/msg/ia.js +304 -46
  293. package/msg/ia.mjs +259 -1
  294. package/msg/id.js +489 -231
  295. package/msg/id.mjs +259 -1
  296. package/msg/ig.js +270 -12
  297. package/msg/ig.mjs +259 -1
  298. package/msg/inh.js +265 -7
  299. package/msg/inh.mjs +259 -1
  300. package/msg/is.js +265 -7
  301. package/msg/is.mjs +259 -1
  302. package/msg/it.js +289 -31
  303. package/msg/it.mjs +259 -1
  304. package/msg/ja.js +314 -56
  305. package/msg/ja.mjs +259 -1
  306. package/msg/ka.js +267 -9
  307. package/msg/ka.mjs +259 -1
  308. package/msg/kab.js +273 -15
  309. package/msg/kab.mjs +259 -1
  310. package/msg/kbd-cyrl.js +266 -8
  311. package/msg/kbd-cyrl.mjs +259 -1
  312. package/msg/km.js +265 -7
  313. package/msg/km.mjs +259 -1
  314. package/msg/kn.js +273 -15
  315. package/msg/kn.mjs +259 -1
  316. package/msg/ko.js +398 -140
  317. package/msg/ko.mjs +259 -1
  318. package/msg/krc.js +723 -0
  319. package/msg/krc.mjs +704 -0
  320. package/msg/ksh.js +266 -8
  321. package/msg/ksh.mjs +259 -1
  322. package/msg/ku-latn.js +266 -8
  323. package/msg/ku-latn.mjs +259 -1
  324. package/msg/ky.js +325 -67
  325. package/msg/ky.mjs +259 -1
  326. package/msg/la.js +266 -8
  327. package/msg/la.mjs +259 -1
  328. package/msg/lb.js +279 -21
  329. package/msg/lb.mjs +259 -1
  330. package/msg/lki.js +265 -7
  331. package/msg/lki.mjs +259 -1
  332. package/msg/lo.js +265 -7
  333. package/msg/lo.mjs +259 -1
  334. package/msg/lrc.js +265 -7
  335. package/msg/lrc.mjs +259 -1
  336. package/msg/lt.js +266 -8
  337. package/msg/lt.mjs +259 -1
  338. package/msg/lv.js +276 -18
  339. package/msg/lv.mjs +259 -1
  340. package/msg/mg.js +265 -7
  341. package/msg/mg.mjs +259 -1
  342. package/msg/mk.js +265 -7
  343. package/msg/mk.mjs +259 -1
  344. package/msg/ml.js +265 -7
  345. package/msg/ml.mjs +259 -1
  346. package/msg/mnw.js +265 -7
  347. package/msg/mnw.mjs +259 -1
  348. package/msg/ms.js +274 -16
  349. package/msg/ms.mjs +259 -1
  350. package/msg/mt.js +723 -0
  351. package/msg/{hak.mjs → mt.mjs} +261 -3
  352. package/msg/my.js +265 -7
  353. package/msg/my.mjs +259 -1
  354. package/msg/mzn.js +266 -8
  355. package/msg/mzn.mjs +259 -1
  356. package/msg/nb.js +265 -7
  357. package/msg/nb.mjs +259 -1
  358. package/msg/ne.js +275 -17
  359. package/msg/ne.mjs +259 -1
  360. package/msg/nl.js +336 -78
  361. package/msg/nl.mjs +259 -1
  362. package/msg/oc.js +265 -7
  363. package/msg/oc.mjs +259 -1
  364. package/msg/olo.js +266 -8
  365. package/msg/olo.mjs +259 -1
  366. package/msg/pa.js +273 -15
  367. package/msg/pa.mjs +259 -1
  368. package/msg/pl.js +282 -24
  369. package/msg/pl.mjs +259 -1
  370. package/msg/pms.js +283 -25
  371. package/msg/pms.mjs +259 -1
  372. package/msg/ps.js +296 -38
  373. package/msg/ps.mjs +259 -1
  374. package/msg/pt-br.js +282 -24
  375. package/msg/pt-br.mjs +259 -1
  376. package/msg/pt.js +282 -24
  377. package/msg/pt.mjs +259 -1
  378. package/msg/ro.js +299 -41
  379. package/msg/ro.mjs +259 -1
  380. package/msg/ru.js +283 -25
  381. package/msg/ru.mjs +259 -1
  382. package/msg/sc.js +265 -7
  383. package/msg/sc.mjs +259 -1
  384. package/msg/sco.js +266 -8
  385. package/msg/sco.mjs +259 -1
  386. package/msg/sd.js +265 -7
  387. package/msg/sd.mjs +259 -1
  388. package/msg/shn.js +265 -7
  389. package/msg/shn.mjs +259 -1
  390. package/msg/si.js +266 -8
  391. package/msg/si.mjs +259 -1
  392. package/msg/sk.js +283 -25
  393. package/msg/sk.mjs +259 -1
  394. package/msg/skr-arab.js +268 -10
  395. package/msg/skr-arab.mjs +259 -1
  396. package/msg/sl.js +283 -25
  397. package/msg/sl.mjs +259 -1
  398. package/msg/smn.js +267 -9
  399. package/msg/smn.mjs +259 -1
  400. package/msg/sq.js +273 -15
  401. package/msg/sq.mjs +259 -1
  402. package/msg/sr-latn.js +265 -7
  403. package/msg/sr-latn.mjs +259 -1
  404. package/msg/sr.js +266 -8
  405. package/msg/sr.mjs +259 -1
  406. package/msg/sv.js +282 -24
  407. package/msg/sv.mjs +259 -1
  408. package/msg/sw.js +266 -8
  409. package/msg/sw.mjs +259 -1
  410. package/msg/ta.js +283 -25
  411. package/msg/ta.mjs +259 -1
  412. package/msg/tcy.js +328 -70
  413. package/msg/tcy.mjs +259 -1
  414. package/msg/tdd.js +265 -7
  415. package/msg/tdd.mjs +259 -1
  416. package/msg/te.js +265 -7
  417. package/msg/te.mjs +259 -1
  418. package/msg/th.js +266 -8
  419. package/msg/th.mjs +259 -1
  420. package/msg/ti.js +265 -7
  421. package/msg/ti.mjs +259 -1
  422. package/msg/tl.js +265 -7
  423. package/msg/tl.mjs +259 -1
  424. package/msg/tlh.js +265 -7
  425. package/msg/tlh.mjs +259 -1
  426. package/msg/tr.js +284 -26
  427. package/msg/tr.mjs +259 -1
  428. package/msg/ug-arab.js +265 -7
  429. package/msg/ug-arab.mjs +259 -1
  430. package/msg/uk.js +291 -33
  431. package/msg/uk.mjs +259 -1
  432. package/msg/ur.js +265 -7
  433. package/msg/ur.mjs +259 -1
  434. package/msg/uz.js +298 -40
  435. package/msg/uz.mjs +259 -1
  436. package/msg/vi.js +284 -26
  437. package/msg/vi.mjs +259 -1
  438. package/msg/xmf.js +265 -7
  439. package/msg/xmf.mjs +259 -1
  440. package/msg/yo.js +265 -7
  441. package/msg/yo.mjs +259 -1
  442. package/msg/zgh.js +265 -7
  443. package/msg/zgh.mjs +259 -1
  444. package/msg/zh-hans.js +283 -25
  445. package/msg/zh-hans.mjs +259 -1
  446. package/msg/zh-hant.js +283 -25
  447. package/msg/zh-hant.mjs +259 -1
  448. package/package.json +53 -57
  449. package/php_compressed.js +150 -192
  450. package/php_compressed.js.map +1 -1
  451. package/python_compressed.js +85 -126
  452. package/python_compressed.js.map +1 -1
  453. package/core/flyout_navigator.d.ts +0 -11
  454. package/core/keyboard_nav/block_comment_navigation_policy.d.ts +0 -56
  455. package/core/keyboard_nav/flyout_navigation_policy.d.ts +0 -65
  456. package/core/keyboard_nav/line_cursor.d.ts +0 -187
  457. package/core/keyboard_nav/marker.d.ts +0 -53
  458. package/core/marker_manager.d.ts +0 -72
  459. package/core/navigator.d.ts +0 -65
  460. package/media/sprites.png +0 -0
  461. package/msg/cdo.js +0 -465
  462. package/msg/hak.js +0 -465
@@ -10,7 +10,8 @@
10
10
  */
11
11
  import type { WorkspaceComment } from '../comments/workspace_comment.js';
12
12
  import type { Workspace } from '../workspace.js';
13
- import { CommentBase, CommentBaseJson } from './events_comment_base.js';
13
+ import type { CommentBaseJson } from './events_comment_base.js';
14
+ import { CommentBase } from './events_comment_base.js';
14
15
  import { EventType } from './type.js';
15
16
  /**
16
17
  * Notifies listeners that the contents of a workspace comment has changed.
@@ -3,9 +3,10 @@
3
3
  * Copyright 2024 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { WorkspaceComment } from '../comments/workspace_comment.js';
6
+ import type { WorkspaceComment } from '../comments/workspace_comment.js';
7
7
  import type { Workspace } from '../workspace.js';
8
- import { CommentBase, CommentBaseJson } from './events_comment_base.js';
8
+ import type { CommentBaseJson } from './events_comment_base.js';
9
+ import { CommentBase } from './events_comment_base.js';
9
10
  import { EventType } from './type.js';
10
11
  export declare class CommentCollapse extends CommentBase {
11
12
  newCollapsed?: boolean | undefined;
@@ -11,15 +11,14 @@
11
11
  import type { WorkspaceComment } from '../comments/workspace_comment.js';
12
12
  import * as comments from '../serialization/workspace_comments.js';
13
13
  import type { Workspace } from '../workspace.js';
14
- import { CommentBase, CommentBaseJson } from './events_comment_base.js';
14
+ import type { CommentBaseJson } from './events_comment_base.js';
15
+ import { CommentBase } from './events_comment_base.js';
15
16
  import { EventType } from './type.js';
16
17
  /**
17
18
  * Notifies listeners that a workspace comment was created.
18
19
  */
19
20
  export declare class CommentCreate extends CommentBase {
20
21
  type: EventType;
21
- /** The XML representation of the created workspace comment. */
22
- xml?: Element | DocumentFragment;
23
22
  /** The JSON representation of the created workspace comment. */
24
23
  json?: comments.State;
25
24
  /**
@@ -51,7 +50,6 @@ export declare class CommentCreate extends CommentBase {
51
50
  run(forward: boolean): void;
52
51
  }
53
52
  export interface CommentCreateJson extends CommentBaseJson {
54
- xml: string;
55
53
  json: object;
56
54
  }
57
55
  //# sourceMappingURL=events_comment_create.d.ts.map
@@ -11,15 +11,14 @@
11
11
  import type { WorkspaceComment } from '../comments/workspace_comment.js';
12
12
  import * as comments from '../serialization/workspace_comments.js';
13
13
  import type { Workspace } from '../workspace.js';
14
- import { CommentBase, CommentBaseJson } from './events_comment_base.js';
14
+ import type { CommentBaseJson } from './events_comment_base.js';
15
+ import { CommentBase } from './events_comment_base.js';
15
16
  import { EventType } from './type.js';
16
17
  /**
17
18
  * Notifies listeners that a workspace comment has been deleted.
18
19
  */
19
20
  export declare class CommentDelete extends CommentBase {
20
21
  type: EventType;
21
- /** The XML representation of the deleted workspace comment. */
22
- xml?: Element;
23
22
  /** The JSON representation of the created workspace comment. */
24
23
  json?: comments.State;
25
24
  /**
@@ -51,7 +50,6 @@ export declare class CommentDelete extends CommentBase {
51
50
  static fromJson(json: CommentDeleteJson, workspace: Workspace, event?: any): CommentDelete;
52
51
  }
53
52
  export interface CommentDeleteJson extends CommentBaseJson {
54
- xml: string;
55
53
  json: object;
56
54
  }
57
55
  //# sourceMappingURL=events_comment_delete.d.ts.map
@@ -7,8 +7,8 @@
7
7
  * Events fired when a workspace comment is dragged.
8
8
  */
9
9
  import type { WorkspaceComment } from '../comments/workspace_comment.js';
10
- import { Workspace } from '../workspace.js';
11
- import { AbstractEventJson } from './events_abstract.js';
10
+ import type { Workspace } from '../workspace.js';
11
+ import type { AbstractEventJson } from './events_abstract.js';
12
12
  import { UiBase } from './events_ui_base.js';
13
13
  import { EventType } from './type.js';
14
14
  /**
@@ -11,7 +11,8 @@
11
11
  import type { WorkspaceComment } from '../comments/workspace_comment.js';
12
12
  import { Coordinate } from '../utils/coordinate.js';
13
13
  import type { Workspace } from '../workspace.js';
14
- import { CommentBase, CommentBaseJson } from './events_comment_base.js';
14
+ import type { CommentBaseJson } from './events_comment_base.js';
15
+ import { CommentBase } from './events_comment_base.js';
15
16
  import { EventType } from './type.js';
16
17
  /**
17
18
  * Notifies listeners that a workspace comment has moved.
@@ -9,7 +9,8 @@
9
9
  import type { WorkspaceComment } from '../comments/workspace_comment.js';
10
10
  import { Size } from '../utils/size.js';
11
11
  import type { Workspace } from '../workspace.js';
12
- import { CommentBase, CommentBaseJson } from './events_comment_base.js';
12
+ import type { CommentBaseJson } from './events_comment_base.js';
13
+ import { CommentBase } from './events_comment_base.js';
13
14
  import { EventType } from './type.js';
14
15
  /**
15
16
  * Notifies listeners that a workspace comment has resized.
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { Workspace } from '../workspace.js';
7
- import { AbstractEventJson } from './events_abstract.js';
7
+ import type { AbstractEventJson } from './events_abstract.js';
8
8
  import { UiBase } from './events_ui_base.js';
9
9
  import { EventType } from './type.js';
10
10
  /**
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { Workspace } from '../workspace.js';
7
- import { AbstractEventJson } from './events_abstract.js';
7
+ import type { AbstractEventJson } from './events_abstract.js';
8
8
  import { UiBase } from './events_ui_base.js';
9
9
  import { EventType } from './type.js';
10
10
  /**
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { Workspace } from '../workspace.js';
7
- import { AbstractEventJson } from './events_abstract.js';
7
+ import type { AbstractEventJson } from './events_abstract.js';
8
8
  import { UiBase } from './events_ui_base.js';
9
9
  import { EventType } from './type.js';
10
10
  /**
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { Workspace } from '../workspace.js';
7
- import { AbstractEventJson } from './events_abstract.js';
7
+ import type { AbstractEventJson } from './events_abstract.js';
8
8
  import { UiBase } from './events_ui_base.js';
9
9
  import { EventType } from './type.js';
10
10
  /**
@@ -10,7 +10,8 @@
10
10
  */
11
11
  import type { IVariableModel, IVariableState } from '../interfaces/i_variable_model.js';
12
12
  import type { Workspace } from '../workspace.js';
13
- import { Abstract as AbstractEvent, AbstractEventJson } from './events_abstract.js';
13
+ import type { AbstractEventJson } from './events_abstract.js';
14
+ import { Abstract as AbstractEvent } from './events_abstract.js';
14
15
  /**
15
16
  * Abstract class for a variable event.
16
17
  */
@@ -10,7 +10,8 @@
10
10
  */
11
11
  import type { IVariableModel, IVariableState } from '../interfaces/i_variable_model.js';
12
12
  import type { Workspace } from '../workspace.js';
13
- import { VarBase, VarBaseJson } from './events_var_base.js';
13
+ import type { VarBaseJson } from './events_var_base.js';
14
+ import { VarBase } from './events_var_base.js';
14
15
  import { EventType } from './type.js';
15
16
  /**
16
17
  * Notifies listeners that a variable model has been created.
@@ -5,7 +5,8 @@
5
5
  */
6
6
  import type { IVariableModel, IVariableState } from '../interfaces/i_variable_model.js';
7
7
  import type { Workspace } from '../workspace.js';
8
- import { VarBase, VarBaseJson } from './events_var_base.js';
8
+ import type { VarBaseJson } from './events_var_base.js';
9
+ import { VarBase } from './events_var_base.js';
9
10
  import { EventType } from './type.js';
10
11
  /**
11
12
  * Notifies listeners that a variable model has been deleted.
@@ -5,7 +5,8 @@
5
5
  */
6
6
  import type { IVariableModel, IVariableState } from '../interfaces/i_variable_model.js';
7
7
  import type { Workspace } from '../workspace.js';
8
- import { VarBase, VarBaseJson } from './events_var_base.js';
8
+ import type { VarBaseJson } from './events_var_base.js';
9
+ import { VarBase } from './events_var_base.js';
9
10
  import { EventType } from './type.js';
10
11
  /**
11
12
  * Notifies listeners that a variable model was renamed.
@@ -10,7 +10,8 @@
10
10
  */
11
11
  import type { IVariableModel, IVariableState } from '../interfaces/i_variable_model.js';
12
12
  import type { Workspace } from '../workspace.js';
13
- import { VarBase, VarBaseJson } from './events_var_base.js';
13
+ import type { VarBaseJson } from './events_var_base.js';
14
+ import { VarBase } from './events_var_base.js';
14
15
  import { EventType } from './type.js';
15
16
  /**
16
17
  * Notifies listeners that a variable's type has changed.
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { Workspace } from '../workspace.js';
7
- import { AbstractEventJson } from './events_abstract.js';
7
+ import type { AbstractEventJson } from './events_abstract.js';
8
8
  import { UiBase } from './events_ui_base.js';
9
9
  import { EventType } from './type.js';
10
10
  /**
package/core/field.d.ts CHANGED
@@ -10,14 +10,13 @@
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';
17
16
  import type { IFocusableTree } from './interfaces/i_focusable_tree.js';
18
17
  import type { IKeyboardAccessible } from './interfaces/i_keyboard_accessible.js';
19
18
  import type { IRegistrable } from './interfaces/i_registrable.js';
20
- import { ISerializable } from './interfaces/i_serializable.js';
19
+ import type { ISerializable } from './interfaces/i_serializable.js';
21
20
  import type { ConstantProvider } from './renderers/common/constants.js';
22
21
  import type { KeyboardShortcut } from './shortcut_registry.js';
23
22
  import * as Tooltip from './tooltip.js';
@@ -28,7 +27,7 @@ import { Size } from './utils/size.js';
28
27
  * A function that is called to validate changes to the field's value before
29
28
  * they are set.
30
29
  *
31
- * @see {@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/validators#return_values}
30
+ * @see {@link https://docs.blockly.com/guides/create-custom-blocks/fields/validators/#return-values}
32
31
  * @param newValue The value to be validated.
33
32
  * @returns One of three instructions for setting the new value: `T`, `null`,
34
33
  * or `undefined`.
@@ -43,7 +42,7 @@ export type FieldValidator<T = any> = (newValue: T) => T | null | undefined;
43
42
  /**
44
43
  * Abstract class for an editable field.
45
44
  *
46
- * @typeParam T - The value stored on the field.
45
+ * @template T - The value stored on the field.
47
46
  */
48
47
  export declare abstract class Field<T = any> implements IKeyboardAccessible, IRegistrable, ISerializable, IFocusableNode {
49
48
  /**
@@ -70,6 +69,8 @@ export declare abstract class Field<T = any> implements IKeyboardAccessible, IRe
70
69
  protected value_: T | null;
71
70
  /** Validation function called when user edits an editable field. */
72
71
  protected validator_: FieldValidator<T> | null;
72
+ /** The ARIA-friendly label representation of this field's type. */
73
+ protected ariaTypeName: string | null;
73
74
  /**
74
75
  * Used to cache the field's tooltip value if setTooltip is called when the
75
76
  * field is not yet initialized. Is *not* guaranteed to be accurate.
@@ -184,6 +185,77 @@ export declare abstract class Field<T = any> implements IKeyboardAccessible, IRe
184
185
  * @throws An error if the source block is not defined.
185
186
  */
186
187
  getSourceBlock(): Block | null;
188
+ /**
189
+ * Gets an ARIA-friendly label representation of this field's type.
190
+ *
191
+ * Implementations are responsible for, and encouraged to, return a localized
192
+ * version of the ARIA representation of the field's type.
193
+ *
194
+ * @returns An ARIA representation of the field's type or null if it is
195
+ * unspecified.
196
+ */
197
+ getAriaTypeName(): string | null;
198
+ /**
199
+ * Sets the ARIA-friendly label representation of this field's type.
200
+ *
201
+ * Implementations are responsible for, and encouraged to, set a localized
202
+ * version of the ARIA representation of the field's type. To that end, the
203
+ * provided value may contain message references of the form `%{BKY_...}`
204
+ * (e.g. `%{BKY_MY_FIELD_ARIA_TYPE}`), which are replaced with the
205
+ * corresponding `Blockly.Msg` value.
206
+ *
207
+ * @param ariaTypeName An ARIA representation of the field's type.
208
+ */
209
+ setAriaTypeName(ariaTypeName: string): void;
210
+ /**
211
+ * Gets an ARIA-friendly label representation of this field's value.
212
+ *
213
+ * Note that implementations should generally always override this value to
214
+ * ensure a non-null value is returned. The default implementation relies on
215
+ * 'getText' which may return an empty string. A null return value from this
216
+ * function will prompt ARIA label generation to skip the field's value
217
+ * entirely when there may be a better contextual placeholder to use isstead.
218
+ *
219
+ * For example, to avoid hiding an empty text input field from screen reader,
220
+ * implementations should ensure that if the text is an empty string, this
221
+ * function would return an appropriate, localized value such as "empty text".
222
+ *
223
+ * Implementations are responsible for, and encouraged to, return a localized
224
+ * version of the ARIA representation of the field's value.
225
+ *
226
+ * @returns An ARIA representation of the field's text, or null if no text is
227
+ * currently defined or known for the field.
228
+ */
229
+ getAriaValue(): string | null;
230
+ /**
231
+ * Computes a descriptive ARIA label to represent this field with configurable
232
+ * verbosity.
233
+ *
234
+ * A 'verbose' label includes type information, if available, whereas a
235
+ * non-verbose label only contains the field's value.
236
+ *
237
+ * Note that this will always return the latest representation of the field's
238
+ * label which may differ from any previously set ARIA label for the field
239
+ * itself. Implementations are largely responsible for ensuring that the
240
+ * field's ARIA label is set correctly at relevant moments in the field's
241
+ * lifecycle (such as when its value changes).
242
+ *
243
+ * Finally, it is never guaranteed that implementations use the label returned
244
+ * by this method for their actual ARIA label. Some implementations may rely
245
+ * on other contexts to convey information like the field's value. Example:
246
+ * checkboxes represent their checked/non-checked status (i.e. value) through
247
+ * a separate ARIA property.
248
+ *
249
+ * If the field's value is empty then it will return a localized placeholder
250
+ * indicating that its value is empty. If this method returns an empty string,
251
+ * the output will be ignored when composing the block-level ARIA label. Make
252
+ * sure you want your label hidden from screenreaders before returning an
253
+ * empty string.
254
+ *
255
+ * @param includeTypeInfo Whether to include the field's type information in
256
+ * the returned label, if available.
257
+ */
258
+ computeAriaLabel(includeTypeInfo?: boolean): string;
187
259
  /**
188
260
  * Initialize everything to render this field. Override
189
261
  * methods initModel and initView rather than this method.
@@ -204,14 +276,25 @@ export declare abstract class Field<T = any> implements IKeyboardAccessible, IRe
204
276
  /**
205
277
  * Defines whether this field should take up the full block or not.
206
278
  *
207
- * Be cautious when overriding this function. It may not work as you expect /
208
- * intend because the behavior was kind of hacked in. If you are thinking
209
- * about overriding this function, post on the forum with your intended
210
- * behavior to see if there's another approach.
279
+ * This is typically only done for certain kinds of fields and in certain
280
+ * renderers. You should only override this if you're sure your field will
281
+ * render correctly in zelos and other renderers that support full-block
282
+ * fields.
211
283
  *
212
- * @internal
284
+ * Blocks that contain only a single field that is a full-block-field
285
+ * have a special appearance in some renderers and their behavior is
286
+ * unique, because we pretend that the field is a whole block in some cases.
287
+ * This is hacky and you should use caution when attempting to do anything
288
+ * with this method.
213
289
  */
214
290
  isFullBlockField(): boolean;
291
+ /**
292
+ * Returns whether this field is a static text label (ex. FieldLabel).
293
+ * Used internally instead of `instanceof FieldLabel` to avoid circular imports.
294
+ *
295
+ * @internal
296
+ */
297
+ isLabelField(): boolean;
215
298
  /**
216
299
  * Create a field border rect element. Not to be overridden by subclasses.
217
300
  * Instead modify the result of the function inside initView, or create a
@@ -219,9 +302,11 @@ export declare abstract class Field<T = any> implements IKeyboardAccessible, IRe
219
302
  */
220
303
  protected createBorderRect_(): void;
221
304
  /**
222
- * Create a field text element. Not to be overridden by subclasses. Instead
305
+ * Create a field text element. Not to be overridden by subclasses. Instead,
223
306
  * modify the result of the function inside initView, or create a separate
224
- * function to call.
307
+ * function to call. Aria state is hidden; use the aria label for the field
308
+ * and/or containing block to expose content to screen readers. Text content
309
+ * for custom blocks can be set after creation.
225
310
  */
226
311
  protected createTextElement_(): void;
227
312
  /**
@@ -409,7 +494,7 @@ export declare abstract class Field<T = any> implements IKeyboardAccessible, IRe
409
494
  * at relevant times, such as when the parent block or renderer changes.
410
495
  *
411
496
  * See {@link
412
- * https://developers.google.com/blockly/guides/create-custom-blocks/fields/customizing-fields/creating#matching_block_colours
497
+ * https://docs.blockly.com/guides/create-custom-blocks/fields/customizing-fields/creating/#matching-block-colours
413
498
  * | the field documentation} for more information, or FieldDropdown for an
414
499
  * example.
415
500
  */
@@ -575,7 +660,7 @@ export declare abstract class Field<T = any> implements IKeyboardAccessible, IRe
575
660
  * it is valid for a subclass to return `undefined` if the new value is
576
661
  * compatible with `T`.
577
662
  *
578
- * @see {@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/validators#return_values}
663
+ * @see {@link https://docs.blockly.com/guides/create-custom-blocks/fields/validators/#return-values}
579
664
  * @param newValue - The value to be validated.
580
665
  * @returns One of three instructions for setting the new value: `T`, `null`,
581
666
  * or `undefined`.
@@ -684,6 +769,27 @@ export declare abstract class Field<T = any> implements IKeyboardAccessible, IRe
684
769
  onNodeBlur(): void;
685
770
  /** See IFocusableNode.canBeFocused. */
686
771
  canBeFocused(): boolean;
772
+ /**
773
+ * Handles the user acting on this field via keyboard navigation.
774
+ * Shows and focuses the field editor.
775
+ */
776
+ performAction(): void;
777
+ /**
778
+ * Recomputes the aria state and label for this field. Fields are generally hidden
779
+ * when in blocks in the flyout (except for top-level full-block fields), and
780
+ * otherwise set to a role of button (indicating they can be clicked to edit)
781
+ * and given the label returned from their `computeAriaLabel` method.
782
+ *
783
+ * Subclasses can override this in order to change the role or label, but they must
784
+ * ensure they keep the correct behavior for fields in flyout blocks.
785
+ *
786
+ * This method will return a boolean indicating if the element is displayed in the
787
+ * aria tree or not. This can be used by subclasses to determine whether or not
788
+ * to continue customizing the role and label (hidden elements should not have labels).
789
+ *
790
+ * @returns true if the element is in the accessibility tree, false if the aria state is hidden
791
+ */
792
+ recomputeAriaContext(): boolean;
687
793
  /**
688
794
  * Subclasses should reimplement this method to construct their Field
689
795
  * subclass from a JSON arg object.
@@ -701,6 +807,7 @@ export declare abstract class Field<T = any> implements IKeyboardAccessible, IRe
701
807
  */
702
808
  export interface FieldConfig {
703
809
  tooltip?: string;
810
+ ariaTypeName?: string;
704
811
  }
705
812
  /**
706
813
  * Represents an object that has all the prototype properties of the `Field`
@@ -8,8 +8,8 @@
8
8
  *
9
9
  * @class
10
10
  */
11
- import './events/events_block_change.js';
12
- import { Field, FieldConfig, FieldValidator } from './field.js';
11
+ import type { FieldConfig, FieldValidator } from './field.js';
12
+ import { Field } from './field.js';
13
13
  type BoolString = 'TRUE' | 'FALSE';
14
14
  type CheckboxBool = BoolString | boolean;
15
15
  /**
@@ -40,7 +40,7 @@ export declare class FieldCheckbox extends Field<CheckboxBool> {
40
40
  * validated value ('TRUE' or 'FALSE'), or null to abort the change.
41
41
  * @param config A map of options used to configure the field.
42
42
  * See the [field creation documentation]{@link
43
- * https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/checkbox#creation}
43
+ * https://docs.blockly.com/guides/create-custom-blocks/fields/built-in-fields/checkbox/#creation}
44
44
  * for a list of properties this parameter supports.
45
45
  */
46
46
  constructor(value?: CheckboxBool | typeof Field.SKIP_SETUP, validator?: FieldCheckboxValidator, config?: FieldCheckboxConfig);
@@ -114,6 +114,29 @@ export declare class FieldCheckbox extends Field<CheckboxBool> {
114
114
  * @returns The converted value.
115
115
  */
116
116
  private convertValueToBool;
117
+ /**
118
+ * Gets an ARIA-friendly label representation of this field's type.
119
+ *
120
+ * Implementations are responsible for, and encouraged to, return a localized
121
+ * version of the ARIA representation of the field's type.
122
+ *
123
+ * @returns An ARIA representation of the field's type or a default if it is
124
+ * unspecified.
125
+ */
126
+ getAriaTypeName(): string;
127
+ /**
128
+ * Gets an ARIA-friendly label representation of this field's value.
129
+ *
130
+ * Implementations are responsible for, and encouraged to, return a localized
131
+ * version of the ARIA representation of the field's value.
132
+ *
133
+ * The FieldCheckbox implementation is not used for the actual ARIA label of
134
+ * the field, since the checked state is already included in the ARIA checked
135
+ * state, but it is used for the ARIA label of its source block.
136
+ *
137
+ * @returns An ARIA representation of the field's text.
138
+ */
139
+ getAriaValue(): string | null;
117
140
  /**
118
141
  * Construct a FieldCheckbox from a JSON arg object.
119
142
  *
@@ -123,6 +146,10 @@ export declare class FieldCheckbox extends Field<CheckboxBool> {
123
146
  * @internal
124
147
  */
125
148
  static fromJson(options: FieldCheckboxFromJsonConfig): FieldCheckbox;
149
+ /**
150
+ * Customizes the label and sets additional aria state.
151
+ */
152
+ recomputeAriaContext(): boolean;
126
153
  }
127
154
  /**
128
155
  * Config options for the checkbox field.
@@ -140,7 +167,7 @@ export interface FieldCheckboxFromJsonConfig extends FieldCheckboxConfig {
140
167
  * A function that is called to validate changes to the field's value before
141
168
  * they are set.
142
169
  *
143
- * @see {@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/validators#return_values}
170
+ * @see {@link https://docs.blockly.com/guides/create-custom-blocks/fields/validators/#return-values}
144
171
  * @param newValue The value to be validated.
145
172
  * @returns One of three instructions for setting the new value: `T`, `null`,
146
173
  * or `undefined`.
@@ -3,7 +3,8 @@
3
3
  * Copyright 2012 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { Field, FieldConfig, FieldValidator } from './field.js';
6
+ import type { FieldConfig, FieldValidator } from './field.js';
7
+ import { Field } from './field.js';
7
8
  import { Menu } from './menu.js';
8
9
  import { MenuItem } from './menuitem.js';
9
10
  /**
@@ -56,6 +57,11 @@ export declare class FieldDropdown extends Field<string> {
56
57
  protected static IMAGE_Y_OFFSET: number;
57
58
  /** The total vertical padding above and below an image. */
58
59
  protected static IMAGE_Y_PADDING: number;
60
+ /**
61
+ * True once the field’s DOM has been created and it is safe to run ARIA
62
+ * updates in response to value changes.
63
+ */
64
+ isInitialized: boolean;
59
65
  /**
60
66
  * @param menuGenerator A non-empty array of options for a dropdown list, or a
61
67
  * function which generates these options. Also accepts Field.SKIP_SETUP
@@ -68,7 +74,7 @@ export declare class FieldDropdown extends Field<string> {
68
74
  * change.
69
75
  * @param config A map of options used to configure the field.
70
76
  * See the [field creation documentation]{@link
71
- * https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/dropdown#creation}
77
+ * https://docs.blockly.com/guides/create-custom-blocks/fields/built-in-fields/dropdown/#creation}
72
78
  * for a list of properties this parameter supports.
73
79
  * @throws {TypeError} If `menuGenerator` options are incorrectly structured.
74
80
  */
@@ -93,6 +99,15 @@ export declare class FieldDropdown extends Field<string> {
93
99
  * Create the block UI for this dropdown.
94
100
  */
95
101
  initView(): void;
102
+ /**
103
+ * This is hacky way of determining if a dropdown field is a full-block field or not.
104
+ * The constants that control the border rect are the same ones that determine how we
105
+ * render full-block dropdown fields. It's a full-block field if it doesn't have the
106
+ * border rect (and it's a simple reporter block).
107
+ *
108
+ * @returns true if this field should be treated as a full-block field
109
+ */
110
+ isFullBlockField(): boolean;
96
111
  /**
97
112
  * Whether or not the dropdown should add a border rect.
98
113
  *
@@ -238,6 +253,50 @@ export declare class FieldDropdown extends Field<string> {
238
253
  * @throws {TypeError} If proposed options are incorrectly structured.
239
254
  */
240
255
  protected validateOptions(options: MenuOption[]): void;
256
+ /**
257
+ * Gets an ARIA-friendly label representation of this field's type.
258
+ *
259
+ * Implementations are responsible for, and encouraged to, return a localized
260
+ * version of the ARIA representation of the field's type.
261
+ *
262
+ * @returns An ARIA representation of the field's type or a default if it is
263
+ * unspecified.
264
+ */
265
+ getAriaTypeName(): string | null;
266
+ /**
267
+ * Gets an ARIA-friendly label representation of this field's value.
268
+ *
269
+ * Implementations are responsible for, and encouraged to, return a localized
270
+ * version of the ARIA representation of the field's value.
271
+ *
272
+ * @returns An ARIA representation of the field's text.
273
+ */
274
+ getAriaValue(): string;
275
+ /**
276
+ * Returns the ARIA label for the currently selected dropdown option.
277
+ *
278
+ * @returns The computed ARIA label for the selected option, or `null` if no
279
+ * option is selected.
280
+ */
281
+ private getSelectedAriaLabel;
282
+ /**
283
+ * Sets additional aria state.
284
+ */
285
+ recomputeAriaContext(): boolean;
286
+ /**
287
+ * Computes an ARIA-friendly label for a dropdown option.
288
+ *
289
+ * The label is derived using a prioritized set of sources.
290
+ *
291
+ * Returned values are guaranteed to be non-empty strings for all non-separator
292
+ * options. Whitespace-only values are ignored when determining a usable label.
293
+ *
294
+ * @param option The dropdown option for which to compute the ARIA label.
295
+ * @param index The index of the option within the dropdown (0-based).
296
+ * @returns A string suitable for use as an ARIA label. Returns an empty string
297
+ * only if the option is a separator.
298
+ */
299
+ private computeOptionAriaLabel;
241
300
  }
242
301
  /**
243
302
  * Definition of a human-readable image dropdown option.
@@ -247,6 +306,7 @@ export interface ImageProperties {
247
306
  alt: string;
248
307
  width: number;
249
308
  height: number;
309
+ ariaLabel?: string;
250
310
  }
251
311
  /**
252
312
  * An individual option in the dropdown menu. Can be either the string literal
@@ -255,7 +315,11 @@ export interface ImageProperties {
255
315
  * (text, ImageProperties object, or HTML element), and the second element is
256
316
  * the language-neutral value.
257
317
  */
258
- export type MenuOption = [string | ImageProperties | HTMLElement, string] | 'separator';
318
+ export type MenuOption = [
319
+ string | ImageProperties | HTMLElement,
320
+ string,
321
+ string?
322
+ ] | 'separator';
259
323
  /**
260
324
  * A function that generates an array of menu options for FieldDropdown
261
325
  * or its descendants.
@@ -280,7 +344,7 @@ export interface FieldDropdownFromJsonConfig extends FieldDropdownConfig {
280
344
  * A function that is called to validate changes to the field's value before
281
345
  * they are set.
282
346
  *
283
- * @see {@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/validators#return_values}
347
+ * @see {@link https://docs.blockly.com/guides/create-custom-blocks/fields/validators/#return-values}
284
348
  * @param newValue The value to be validated.
285
349
  * @returns One of three instructions for setting the new value: `T`, `null`,
286
350
  * or `undefined`.