@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.
- package/README.md +7 -2
- package/blockly.min.js +2280 -2126
- package/blockly.mjs +13 -5
- package/blockly_compressed.js +1767 -1794
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js +151 -177
- package/blocks_compressed.js.map +1 -1
- package/core/block.d.ts +41 -19
- package/core/block_aria_composer.d.ts +158 -0
- package/core/block_svg.d.ts +88 -35
- package/core/blockly.d.ts +22 -22
- package/core/bubbles/bubble.d.ts +59 -5
- package/core/bubbles/mini_workspace_bubble.d.ts +11 -3
- package/core/bubbles/text_bubble.d.ts +7 -4
- package/core/bubbles/textinput_bubble.d.ts +11 -1
- package/core/clipboard/block_paster.d.ts +5 -5
- package/core/clipboard/registry.d.ts +1 -1
- package/core/clipboard/workspace_comment_paster.d.ts +4 -4
- package/core/clipboard.d.ts +1 -1
- package/core/comments/collapse_comment_bar_button.d.ts +7 -4
- package/core/comments/comment_bar_button.d.ts +15 -1
- package/core/comments/comment_editor.d.ts +21 -6
- package/core/comments/comment_view.d.ts +5 -5
- package/core/comments/delete_comment_bar_button.d.ts +7 -4
- package/core/comments/rendered_workspace_comment.d.ts +17 -12
- package/core/comments/workspace_comment.d.ts +2 -2
- package/core/common.d.ts +10 -3
- package/core/component_manager.d.ts +2 -0
- package/core/config.d.ts +37 -11
- package/core/connection_db.d.ts +40 -0
- package/core/contextmenu_registry.d.ts +12 -2
- package/core/css.d.ts +2 -1
- package/core/dragging/block_drag_strategy.d.ts +196 -19
- package/core/dragging/bubble_drag_strategy.d.ts +5 -4
- package/core/dragging/comment_drag_strategy.d.ts +4 -4
- package/core/dragging/dragger.d.ts +14 -14
- package/core/events/events_block_base.d.ts +2 -1
- package/core/events/events_block_change.d.ts +3 -2
- package/core/events/events_block_create.d.ts +3 -5
- package/core/events/events_block_delete.d.ts +3 -5
- package/core/events/events_block_drag.d.ts +2 -2
- package/core/events/events_block_field_intermediate_change.d.ts +3 -2
- package/core/events/events_block_move.d.ts +2 -1
- package/core/events/events_click.d.ts +2 -2
- package/core/events/events_comment_base.d.ts +2 -1
- package/core/events/events_comment_change.d.ts +2 -1
- package/core/events/events_comment_collapse.d.ts +3 -2
- package/core/events/events_comment_create.d.ts +2 -4
- package/core/events/events_comment_delete.d.ts +2 -4
- package/core/events/events_comment_drag.d.ts +2 -2
- package/core/events/events_comment_move.d.ts +2 -1
- package/core/events/events_comment_resize.d.ts +2 -1
- package/core/events/events_selected.d.ts +1 -1
- package/core/events/events_theme_change.d.ts +1 -1
- package/core/events/events_toolbox_item_select.d.ts +1 -1
- package/core/events/events_trashcan_open.d.ts +1 -1
- package/core/events/events_var_base.d.ts +2 -1
- package/core/events/events_var_create.d.ts +2 -1
- package/core/events/events_var_delete.d.ts +2 -1
- package/core/events/events_var_rename.d.ts +2 -1
- package/core/events/events_var_type_change.d.ts +2 -1
- package/core/events/events_viewport.d.ts +1 -1
- package/core/field.d.ts +120 -13
- package/core/field_checkbox.d.ts +31 -4
- package/core/field_dropdown.d.ts +68 -4
- package/core/field_image.d.ts +54 -2
- package/core/field_input.d.ts +38 -13
- package/core/field_label.d.ts +31 -2
- package/core/field_label_serializable.d.ts +3 -2
- package/core/field_number.d.ts +14 -3
- package/core/field_textinput.d.ts +15 -5
- package/core/field_variable.d.ts +16 -6
- package/core/flyout_base.d.ts +12 -126
- package/core/flyout_button.d.ts +11 -0
- package/core/flyout_horizontal.d.ts +0 -11
- package/core/flyout_metrics_manager.d.ts +2 -1
- package/core/flyout_vertical.d.ts +0 -11
- package/core/focus_manager.d.ts +52 -2
- package/core/generator.d.ts +2 -2
- package/core/gesture.d.ts +2 -21
- package/core/grid.d.ts +2 -2
- package/core/hints.d.ts +78 -0
- package/core/icons/comment_icon.d.ts +8 -0
- package/core/icons/icon.d.ts +20 -0
- package/core/icons/icon_types.d.ts +4 -4
- package/core/icons/mutator_icon.d.ts +8 -0
- package/core/icons/registry.d.ts +1 -1
- package/core/icons/warning_icon.d.ts +8 -0
- package/core/inputs/input.d.ts +58 -2
- package/core/insertion_marker.d.ts +54 -0
- package/core/insertion_marker_previewer.d.ts +20 -4
- package/core/interfaces/i_bounded_element.d.ts +7 -0
- package/core/interfaces/i_bubble.d.ts +3 -2
- package/core/interfaces/i_collapsible_toolbox_item.d.ts +5 -1
- package/core/interfaces/i_comment_icon.d.ts +6 -6
- package/core/interfaces/i_drag_target.d.ts +2 -2
- package/core/interfaces/i_draggable.d.ts +22 -17
- package/core/interfaces/i_dragger.d.ts +19 -10
- package/core/interfaces/i_flyout.d.ts +1 -31
- package/core/interfaces/i_flyout_inflater.d.ts +9 -0
- package/core/interfaces/i_focusable_node.d.ts +8 -0
- package/core/interfaces/i_focusable_tree.d.ts +8 -0
- package/core/interfaces/i_icon.d.ts +1 -1
- package/core/interfaces/i_json_block_definition.d.ts +113 -0
- package/core/interfaces/i_keyboard_accessible.d.ts +1 -1
- package/core/interfaces/i_navigation_policy.d.ts +12 -0
- package/core/interfaces/i_parameter_model.d.ts +2 -2
- package/core/interfaces/i_paster.d.ts +3 -3
- package/core/interfaces/i_procedure_block.d.ts +1 -1
- package/core/interfaces/i_procedure_map.d.ts +1 -1
- package/core/interfaces/i_procedure_model.d.ts +2 -2
- package/core/interfaces/i_selectable.d.ts +3 -3
- package/core/interfaces/i_selectable_toolbox_item.d.ts +3 -3
- package/core/interfaces/i_toolbox.d.ts +4 -0
- package/core/interfaces/i_toolbox_item.d.ts +6 -0
- package/core/interfaces/i_variable_backed_parameter_model.d.ts +1 -1
- package/core/keyboard_nav/keyboard_mover.d.ts +151 -0
- package/core/keyboard_nav/move_indicator.d.ts +35 -0
- package/core/keyboard_nav/{block_navigation_policy.d.ts → navigation_policies/block_navigation_policy.d.ts} +17 -25
- package/core/keyboard_nav/navigation_policies/bubble_navigation_policy.d.ts +63 -0
- package/core/keyboard_nav/{comment_bar_button_navigation_policy.d.ts → navigation_policies/comment_bar_button_navigation_policy.d.ts} +10 -3
- package/core/keyboard_nav/{comment_editor_navigation_policy.d.ts → navigation_policies/comment_editor_navigation_policy.d.ts} +10 -3
- package/core/keyboard_nav/{connection_navigation_policy.d.ts → navigation_policies/connection_navigation_policy.d.ts} +11 -16
- package/core/keyboard_nav/{field_navigation_policy.d.ts → navigation_policies/field_navigation_policy.d.ts} +10 -3
- package/core/keyboard_nav/{flyout_button_navigation_policy.d.ts → navigation_policies/flyout_button_navigation_policy.d.ts} +10 -3
- package/core/keyboard_nav/{flyout_separator_navigation_policy.d.ts → navigation_policies/flyout_separator_navigation_policy.d.ts} +9 -3
- package/core/keyboard_nav/{icon_navigation_policy.d.ts → navigation_policies/icon_navigation_policy.d.ts} +12 -5
- package/core/keyboard_nav/navigation_policies/toolbox_item_navigation_policy.d.ts +64 -0
- package/core/keyboard_nav/{workspace_comment_navigation_policy.d.ts → navigation_policies/workspace_comment_navigation_policy.d.ts} +14 -9
- package/core/keyboard_nav/{workspace_navigation_policy.d.ts → navigation_policies/workspace_navigation_policy.d.ts} +10 -3
- package/core/keyboard_nav/navigators/flyout_navigator.d.ts +63 -0
- package/core/keyboard_nav/navigators/navigator.d.ts +237 -0
- package/core/keyboard_nav/navigators/toolbox_navigator.d.ts +70 -0
- package/core/keyboard_navigation_controller.d.ts +12 -0
- package/core/layer_manager.d.ts +3 -3
- package/core/menu.d.ts +3 -0
- package/core/menuitem.d.ts +8 -1
- package/core/observable_procedure_map.d.ts +1 -1
- package/core/options.d.ts +4 -4
- package/core/procedures.d.ts +5 -8
- package/core/registry.d.ts +0 -2
- package/core/render_management.d.ts +1 -1
- package/core/rendered_connection.d.ts +33 -6
- package/core/renderers/common/constants.d.ts +4 -7
- package/core/renderers/common/i_path_object.d.ts +8 -0
- package/core/renderers/common/info.d.ts +1 -1
- package/core/renderers/common/path_object.d.ts +7 -16
- package/core/renderers/common/renderer.d.ts +3 -3
- package/core/renderers/zelos/constants.d.ts +1 -14
- package/core/renderers/zelos/drawer.d.ts +1 -1
- package/core/renderers/zelos/info.d.ts +10 -1
- package/core/renderers/zelos/measurables/bottom_row.d.ts +1 -1
- package/core/renderers/zelos/measurables/top_row.d.ts +1 -1
- package/core/renderers/zelos/path_object.d.ts +0 -3
- package/core/renderers/zelos/renderer.d.ts +8 -0
- package/core/serialization/procedures.d.ts +2 -2
- package/core/serialization/workspace_comments.d.ts +2 -2
- package/core/shortcut_items.d.ts +167 -2
- package/core/shortcut_registry.d.ts +9 -3
- package/core/theme.d.ts +0 -2
- package/core/toast.d.ts +2 -11
- package/core/toolbox/category.d.ts +11 -0
- package/core/toolbox/collapsible_category.d.ts +2 -0
- package/core/toolbox/separator.d.ts +4 -0
- package/core/toolbox/toolbox.d.ts +17 -33
- package/core/toolbox/toolbox_item.d.ts +4 -0
- package/core/tooltip.d.ts +13 -2
- package/core/trashcan.d.ts +16 -38
- package/core/utils/aria.d.ts +259 -28
- package/core/utils/dom.d.ts +1 -1
- package/core/utils/focusable_tree_traverser.d.ts +2 -2
- package/core/utils/shortcut_formatting.d.ts +22 -0
- package/core/utils/style.d.ts +14 -0
- package/core/utils/toolbox.d.ts +0 -8
- package/core/utils/useragent.d.ts +1 -0
- package/core/variable_map.d.ts +1 -41
- package/core/variable_model.d.ts +1 -7
- package/core/variables.d.ts +7 -8
- package/core/variables_dynamic.d.ts +4 -6
- package/core/workspace.d.ts +7 -85
- package/core/workspace_audio.d.ts +36 -7
- package/core/workspace_focus_target.d.ts +51 -0
- package/core/workspace_svg.d.ts +79 -60
- package/core/xml.d.ts +1 -1
- package/core/zoom_controls.d.ts +6 -59
- package/dart_compressed.js +123 -164
- package/dart_compressed.js.map +1 -1
- package/index.mjs +13 -5
- package/javascript_compressed.js +96 -147
- package/javascript_compressed.js.map +1 -1
- package/lua_compressed.js +142 -178
- package/lua_compressed.js.map +1 -1
- package/media/drop.mp3 +0 -0
- package/msg/ab.js +265 -7
- package/msg/ab.mjs +259 -1
- package/msg/ace.js +266 -8
- package/msg/ace.mjs +259 -1
- package/msg/af.js +265 -7
- package/msg/af.mjs +259 -1
- package/msg/am.js +266 -8
- package/msg/am.mjs +259 -1
- package/msg/ar.js +283 -25
- package/msg/ar.mjs +259 -1
- package/msg/ast.js +266 -8
- package/msg/ast.mjs +259 -1
- package/msg/az.js +266 -8
- package/msg/az.mjs +259 -1
- package/msg/ba.js +265 -7
- package/msg/ba.mjs +259 -1
- package/msg/bcc.js +265 -7
- package/msg/bcc.mjs +259 -1
- package/msg/be-tarask.js +297 -39
- package/msg/be-tarask.mjs +259 -1
- package/msg/be.js +266 -8
- package/msg/be.mjs +259 -1
- package/msg/bg.js +282 -24
- package/msg/bg.mjs +259 -1
- package/msg/bn.js +266 -8
- package/msg/bn.mjs +259 -1
- package/msg/br.js +266 -8
- package/msg/br.mjs +259 -1
- package/msg/bs.js +265 -7
- package/msg/bs.mjs +259 -1
- package/msg/ca.js +265 -7
- package/msg/ca.mjs +259 -1
- package/msg/ce.js +265 -7
- package/msg/ce.mjs +259 -1
- package/msg/cs.js +290 -32
- package/msg/cs.mjs +259 -1
- package/msg/csb.js +723 -0
- package/msg/csb.mjs +704 -0
- package/msg/da.js +284 -26
- package/msg/da.mjs +259 -1
- package/msg/de.js +265 -7
- package/msg/de.mjs +259 -1
- package/msg/diq.js +267 -9
- package/msg/diq.mjs +259 -1
- package/msg/dtp.js +265 -7
- package/msg/dtp.mjs +259 -1
- package/msg/dty.js +265 -7
- package/msg/dty.mjs +259 -1
- package/msg/ee.js +265 -7
- package/msg/ee.mjs +259 -1
- package/msg/el.js +290 -32
- package/msg/el.mjs +259 -1
- package/msg/en-gb.js +266 -8
- package/msg/en-gb.mjs +259 -1
- package/msg/en.js +266 -8
- package/msg/en.mjs +259 -1
- package/msg/eo.js +265 -7
- package/msg/eo.mjs +259 -1
- package/msg/es.js +282 -24
- package/msg/es.mjs +259 -1
- package/msg/et.js +265 -7
- package/msg/et.mjs +259 -1
- package/msg/eu.js +265 -7
- package/msg/eu.mjs +259 -1
- package/msg/fa.js +266 -8
- package/msg/fa.mjs +259 -1
- package/msg/fi.js +284 -26
- package/msg/fi.mjs +259 -1
- package/msg/fo.js +265 -7
- package/msg/fo.mjs +259 -1
- package/msg/fr.js +283 -25
- package/msg/fr.mjs +259 -1
- package/msg/frr.js +266 -8
- package/msg/frr.mjs +259 -1
- package/msg/ga.js +723 -0
- package/msg/{cdo.mjs → ga.mjs} +261 -3
- package/msg/gl.js +290 -32
- package/msg/gl.mjs +259 -1
- package/msg/gn.js +266 -8
- package/msg/gn.mjs +259 -1
- package/msg/gor.js +265 -7
- package/msg/gor.mjs +259 -1
- package/msg/ha.js +265 -7
- package/msg/ha.mjs +259 -1
- package/msg/he.js +313 -55
- package/msg/he.mjs +259 -1
- package/msg/hi.js +265 -7
- package/msg/hi.mjs +259 -1
- package/msg/hr.js +265 -7
- package/msg/hr.mjs +259 -1
- package/msg/hrx.js +265 -7
- package/msg/hrx.mjs +259 -1
- package/msg/hsb.js +265 -7
- package/msg/hsb.mjs +259 -1
- package/msg/hu.js +270 -12
- package/msg/hu.mjs +259 -1
- package/msg/hy.js +265 -7
- package/msg/hy.mjs +259 -1
- package/msg/ia.js +304 -46
- package/msg/ia.mjs +259 -1
- package/msg/id.js +489 -231
- package/msg/id.mjs +259 -1
- package/msg/ig.js +270 -12
- package/msg/ig.mjs +259 -1
- package/msg/inh.js +265 -7
- package/msg/inh.mjs +259 -1
- package/msg/is.js +265 -7
- package/msg/is.mjs +259 -1
- package/msg/it.js +289 -31
- package/msg/it.mjs +259 -1
- package/msg/ja.js +314 -56
- package/msg/ja.mjs +259 -1
- package/msg/ka.js +267 -9
- package/msg/ka.mjs +259 -1
- package/msg/kab.js +273 -15
- package/msg/kab.mjs +259 -1
- package/msg/kbd-cyrl.js +266 -8
- package/msg/kbd-cyrl.mjs +259 -1
- package/msg/km.js +265 -7
- package/msg/km.mjs +259 -1
- package/msg/kn.js +273 -15
- package/msg/kn.mjs +259 -1
- package/msg/ko.js +398 -140
- package/msg/ko.mjs +259 -1
- package/msg/krc.js +723 -0
- package/msg/krc.mjs +704 -0
- package/msg/ksh.js +266 -8
- package/msg/ksh.mjs +259 -1
- package/msg/ku-latn.js +266 -8
- package/msg/ku-latn.mjs +259 -1
- package/msg/ky.js +325 -67
- package/msg/ky.mjs +259 -1
- package/msg/la.js +266 -8
- package/msg/la.mjs +259 -1
- package/msg/lb.js +279 -21
- package/msg/lb.mjs +259 -1
- package/msg/lki.js +265 -7
- package/msg/lki.mjs +259 -1
- package/msg/lo.js +265 -7
- package/msg/lo.mjs +259 -1
- package/msg/lrc.js +265 -7
- package/msg/lrc.mjs +259 -1
- package/msg/lt.js +266 -8
- package/msg/lt.mjs +259 -1
- package/msg/lv.js +276 -18
- package/msg/lv.mjs +259 -1
- package/msg/mg.js +265 -7
- package/msg/mg.mjs +259 -1
- package/msg/mk.js +265 -7
- package/msg/mk.mjs +259 -1
- package/msg/ml.js +265 -7
- package/msg/ml.mjs +259 -1
- package/msg/mnw.js +265 -7
- package/msg/mnw.mjs +259 -1
- package/msg/ms.js +274 -16
- package/msg/ms.mjs +259 -1
- package/msg/mt.js +723 -0
- package/msg/{hak.mjs → mt.mjs} +261 -3
- package/msg/my.js +265 -7
- package/msg/my.mjs +259 -1
- package/msg/mzn.js +266 -8
- package/msg/mzn.mjs +259 -1
- package/msg/nb.js +265 -7
- package/msg/nb.mjs +259 -1
- package/msg/ne.js +275 -17
- package/msg/ne.mjs +259 -1
- package/msg/nl.js +336 -78
- package/msg/nl.mjs +259 -1
- package/msg/oc.js +265 -7
- package/msg/oc.mjs +259 -1
- package/msg/olo.js +266 -8
- package/msg/olo.mjs +259 -1
- package/msg/pa.js +273 -15
- package/msg/pa.mjs +259 -1
- package/msg/pl.js +282 -24
- package/msg/pl.mjs +259 -1
- package/msg/pms.js +283 -25
- package/msg/pms.mjs +259 -1
- package/msg/ps.js +296 -38
- package/msg/ps.mjs +259 -1
- package/msg/pt-br.js +282 -24
- package/msg/pt-br.mjs +259 -1
- package/msg/pt.js +282 -24
- package/msg/pt.mjs +259 -1
- package/msg/ro.js +299 -41
- package/msg/ro.mjs +259 -1
- package/msg/ru.js +283 -25
- package/msg/ru.mjs +259 -1
- package/msg/sc.js +265 -7
- package/msg/sc.mjs +259 -1
- package/msg/sco.js +266 -8
- package/msg/sco.mjs +259 -1
- package/msg/sd.js +265 -7
- package/msg/sd.mjs +259 -1
- package/msg/shn.js +265 -7
- package/msg/shn.mjs +259 -1
- package/msg/si.js +266 -8
- package/msg/si.mjs +259 -1
- package/msg/sk.js +283 -25
- package/msg/sk.mjs +259 -1
- package/msg/skr-arab.js +268 -10
- package/msg/skr-arab.mjs +259 -1
- package/msg/sl.js +283 -25
- package/msg/sl.mjs +259 -1
- package/msg/smn.js +267 -9
- package/msg/smn.mjs +259 -1
- package/msg/sq.js +273 -15
- package/msg/sq.mjs +259 -1
- package/msg/sr-latn.js +265 -7
- package/msg/sr-latn.mjs +259 -1
- package/msg/sr.js +266 -8
- package/msg/sr.mjs +259 -1
- package/msg/sv.js +282 -24
- package/msg/sv.mjs +259 -1
- package/msg/sw.js +266 -8
- package/msg/sw.mjs +259 -1
- package/msg/ta.js +283 -25
- package/msg/ta.mjs +259 -1
- package/msg/tcy.js +328 -70
- package/msg/tcy.mjs +259 -1
- package/msg/tdd.js +265 -7
- package/msg/tdd.mjs +259 -1
- package/msg/te.js +265 -7
- package/msg/te.mjs +259 -1
- package/msg/th.js +266 -8
- package/msg/th.mjs +259 -1
- package/msg/ti.js +265 -7
- package/msg/ti.mjs +259 -1
- package/msg/tl.js +265 -7
- package/msg/tl.mjs +259 -1
- package/msg/tlh.js +265 -7
- package/msg/tlh.mjs +259 -1
- package/msg/tr.js +284 -26
- package/msg/tr.mjs +259 -1
- package/msg/ug-arab.js +265 -7
- package/msg/ug-arab.mjs +259 -1
- package/msg/uk.js +291 -33
- package/msg/uk.mjs +259 -1
- package/msg/ur.js +265 -7
- package/msg/ur.mjs +259 -1
- package/msg/uz.js +298 -40
- package/msg/uz.mjs +259 -1
- package/msg/vi.js +284 -26
- package/msg/vi.mjs +259 -1
- package/msg/xmf.js +265 -7
- package/msg/xmf.mjs +259 -1
- package/msg/yo.js +265 -7
- package/msg/yo.mjs +259 -1
- package/msg/zgh.js +265 -7
- package/msg/zgh.mjs +259 -1
- package/msg/zh-hans.js +283 -25
- package/msg/zh-hans.mjs +259 -1
- package/msg/zh-hant.js +283 -25
- package/msg/zh-hant.mjs +259 -1
- package/package.json +53 -57
- package/php_compressed.js +150 -192
- package/php_compressed.js.map +1 -1
- package/python_compressed.js +85 -126
- package/python_compressed.js.map +1 -1
- package/core/flyout_navigator.d.ts +0 -11
- package/core/keyboard_nav/block_comment_navigation_policy.d.ts +0 -56
- package/core/keyboard_nav/flyout_navigation_policy.d.ts +0 -65
- package/core/keyboard_nav/line_cursor.d.ts +0 -187
- package/core/keyboard_nav/marker.d.ts +0 -53
- package/core/marker_manager.d.ts +0 -72
- package/core/navigator.d.ts +0 -65
- package/media/sprites.png +0 -0
- package/msg/cdo.js +0 -465
- 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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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://
|
|
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
|
-
* @
|
|
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
|
-
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
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
|
-
*
|
|
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://
|
|
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://
|
|
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`
|
package/core/field_checkbox.d.ts
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @class
|
|
10
10
|
*/
|
|
11
|
-
import './
|
|
12
|
-
import { Field
|
|
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://
|
|
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://
|
|
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`.
|
package/core/field_dropdown.d.ts
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* Copyright 2012 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
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://
|
|
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 = [
|
|
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://
|
|
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`.
|