@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
package/core/connection_db.d.ts
CHANGED
|
@@ -15,6 +15,11 @@ export declare class ConnectionDB {
|
|
|
15
15
|
private readonly connectionChecker;
|
|
16
16
|
/** Array of connections sorted by y position in workspace units. */
|
|
17
17
|
private readonly connections;
|
|
18
|
+
/**
|
|
19
|
+
* Count of how many times bulk updates have been enabled. When reaching 0,
|
|
20
|
+
* the connection DB will be resorted.
|
|
21
|
+
*/
|
|
22
|
+
private bulkCounter;
|
|
18
23
|
/**
|
|
19
24
|
* @param connectionChecker The workspace's connection type checker, used to
|
|
20
25
|
* decide if connections are valid during a drag.
|
|
@@ -55,6 +60,17 @@ export declare class ConnectionDB {
|
|
|
55
60
|
* @throws {Error} If the connection cannot be found in the database.
|
|
56
61
|
*/
|
|
57
62
|
removeConnection(connection: RenderedConnection, yPos: number): void;
|
|
63
|
+
/**
|
|
64
|
+
* Moves the given connection in the connection DB to reflect its new Y
|
|
65
|
+
* position. For performance, this will be deferred if the connection DB is in
|
|
66
|
+
* the middle of a bulk update.
|
|
67
|
+
*
|
|
68
|
+
* @param connection The connection that is moving. Should be provided before
|
|
69
|
+
* its `Connection.y` field has been updated.
|
|
70
|
+
* @param newYPos The y coordinate (in workspace units) to which the
|
|
71
|
+
* connection will move.
|
|
72
|
+
*/
|
|
73
|
+
reorderConnection(connection: RenderedConnection, newYPos: number): void;
|
|
58
74
|
/**
|
|
59
75
|
* Find all nearby connections to the given connection.
|
|
60
76
|
* Type checking does not apply, since this function is used for bumping.
|
|
@@ -88,6 +104,30 @@ export declare class ConnectionDB {
|
|
|
88
104
|
connection: RenderedConnection | null;
|
|
89
105
|
radius: number;
|
|
90
106
|
};
|
|
107
|
+
/**
|
|
108
|
+
* Notifies the connection DB that a series of connection moves is about to
|
|
109
|
+
* begin. May be called multiple times, and must be paired with a
|
|
110
|
+
* corresponding call to `endBulkUpdates()`.
|
|
111
|
+
*
|
|
112
|
+
* @internal
|
|
113
|
+
*/
|
|
114
|
+
beginBulkUpdates(): void;
|
|
115
|
+
/**
|
|
116
|
+
* Notifies the connection DB that the most recent bulk series of connection
|
|
117
|
+
* moves has ended. Must be called after the corresponding
|
|
118
|
+
* `beginBulkUpdates()`. If all in-flight bulk updates have ended, this method
|
|
119
|
+
* will reorder the connection DB to reflect the current state of the
|
|
120
|
+
* connections.
|
|
121
|
+
*
|
|
122
|
+
* @internal
|
|
123
|
+
*/
|
|
124
|
+
endBulkUpdates(): void;
|
|
125
|
+
/**
|
|
126
|
+
* Sorts the connections in the connection DB to reflect the current
|
|
127
|
+
* coordinates of the connections to allow for quick and correct connection
|
|
128
|
+
* lookups. Run automatically when a bulk update finishes.
|
|
129
|
+
*/
|
|
130
|
+
private reorderConnections;
|
|
91
131
|
/**
|
|
92
132
|
* Initialize a set of connection DBs for a workspace.
|
|
93
133
|
*
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
* @class
|
|
10
10
|
*/
|
|
11
11
|
import type { BlockSvg } from './block_svg.js';
|
|
12
|
-
import { RenderedWorkspaceComment } from './comments/rendered_workspace_comment.js';
|
|
12
|
+
import type { RenderedWorkspaceComment } from './comments/rendered_workspace_comment.js';
|
|
13
13
|
import type { IFocusableNode } from './interfaces/i_focusable_node.js';
|
|
14
|
-
import { Coordinate } from './utils/coordinate.js';
|
|
14
|
+
import type { Coordinate } from './utils/coordinate.js';
|
|
15
15
|
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
16
16
|
/**
|
|
17
17
|
* Class for the registry of context menu items. This is intended to be a
|
|
@@ -103,6 +103,13 @@ export declare namespace ContextMenuRegistry {
|
|
|
103
103
|
displayText: ((p1: Scope) => string | HTMLElement) | string | HTMLElement;
|
|
104
104
|
separator?: never;
|
|
105
105
|
preconditionFn: (p1: Scope, menuOpenEvent: Event) => string;
|
|
106
|
+
/**
|
|
107
|
+
* Identifier used to associate this context menu item with a keyboard
|
|
108
|
+
* shortcut which will be displayed in the menu as a hint. Should
|
|
109
|
+
* correspond to the name under which a keyboard shortcut that performs the
|
|
110
|
+
* same action as this menu item is registered.
|
|
111
|
+
*/
|
|
112
|
+
associatedKeyboardShortcut?: string;
|
|
106
113
|
}
|
|
107
114
|
/**
|
|
108
115
|
* A representation of a menu separator item in the registry.
|
|
@@ -120,8 +127,10 @@ export declare namespace ContextMenuRegistry {
|
|
|
120
127
|
* Fields common to all context menu items as used by contextmenu.ts.
|
|
121
128
|
*/
|
|
122
129
|
export interface CoreContextMenuOption {
|
|
130
|
+
id: string;
|
|
123
131
|
scope: Scope;
|
|
124
132
|
weight: number;
|
|
133
|
+
associatedKeyboardShortcut?: string;
|
|
125
134
|
}
|
|
126
135
|
/**
|
|
127
136
|
* A representation of a normal, clickable menu item in contextmenu.ts.
|
|
@@ -170,4 +179,5 @@ export type Scope = ContextMenuRegistry.Scope;
|
|
|
170
179
|
export type RegistryItem = ContextMenuRegistry.RegistryItem;
|
|
171
180
|
export type ContextMenuOption = ContextMenuRegistry.ContextMenuOption;
|
|
172
181
|
export type LegacyContextMenuOption = ContextMenuRegistry.LegacyContextMenuOption;
|
|
182
|
+
export type ActionContextMenuOption = ContextMenuRegistry.ActionContextMenuOption;
|
|
173
183
|
//# sourceMappingURL=contextmenu_registry.d.ts.map
|
package/core/css.d.ts
CHANGED
|
@@ -17,9 +17,10 @@ export declare function register(cssContent: string): void;
|
|
|
17
17
|
* b) It speeds up loading by not blocking on a separate HTTP transfer.
|
|
18
18
|
* c) The CSS content may be made dynamic depending on init options.
|
|
19
19
|
*
|
|
20
|
+
* @param container The div or other HTML element into which Blockly was injected.
|
|
20
21
|
* @param hasCss If false, don't inject CSS (providing CSS becomes the
|
|
21
22
|
* document's responsibility).
|
|
22
23
|
* @param pathToMedia Path from page to the Blockly media directory.
|
|
23
24
|
*/
|
|
24
|
-
export declare function inject(hasCss: boolean, pathToMedia: string): void;
|
|
25
|
+
export declare function inject(container: HTMLElement, hasCss: boolean, pathToMedia: string): void;
|
|
25
26
|
//# sourceMappingURL=css.d.ts.map
|
|
@@ -3,12 +3,37 @@
|
|
|
3
3
|
* Copyright 2024 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { BlockSvg } from '../block_svg.js';
|
|
7
|
-
import {
|
|
6
|
+
import type { BlockSvg } from '../block_svg.js';
|
|
7
|
+
import type { IConnectionPreviewer } from '../interfaces/i_connection_previewer.js';
|
|
8
|
+
import type { IDragStrategy } from '../interfaces/i_draggable.js';
|
|
9
|
+
import { DragDisposition } from '../interfaces/i_draggable.js';
|
|
10
|
+
import type { RenderedConnection } from '../rendered_connection.js';
|
|
8
11
|
import { Coordinate } from '../utils.js';
|
|
12
|
+
import type { WorkspaceSvg } from '../workspace_svg.js';
|
|
13
|
+
/** Represents a valid pair of connections between the dragging block and a block on the workspace. */
|
|
14
|
+
interface ConnectionPair {
|
|
15
|
+
/** A connection on the dragging stack that is compatible with neighbour. */
|
|
16
|
+
local: RenderedConnection;
|
|
17
|
+
/** A nearby connection that is compatible with local. */
|
|
18
|
+
neighbour: RenderedConnection;
|
|
19
|
+
}
|
|
20
|
+
/** Represents a nearby valid connection. */
|
|
21
|
+
interface ConnectionCandidate extends ConnectionPair {
|
|
22
|
+
/** The distance between the local connection and the neighbour connection. */
|
|
23
|
+
distance: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Represents a block movement paradigm; constrained moves only to valid
|
|
27
|
+
* connections, while unconstrained allows free movement to anywhere on the
|
|
28
|
+
* workspace.
|
|
29
|
+
*/
|
|
30
|
+
declare enum MoveMode {
|
|
31
|
+
CONSTRAINED = 1,
|
|
32
|
+
UNCONSTRAINED = 2
|
|
33
|
+
}
|
|
9
34
|
export declare class BlockDragStrategy implements IDragStrategy {
|
|
10
|
-
|
|
11
|
-
|
|
35
|
+
protected block: BlockSvg;
|
|
36
|
+
protected workspace: WorkspaceSvg;
|
|
12
37
|
/** The parent block at the start of the drag. */
|
|
13
38
|
private startParentConn;
|
|
14
39
|
/**
|
|
@@ -16,25 +41,76 @@ export declare class BlockDragStrategy implements IDragStrategy {
|
|
|
16
41
|
* `healStack` is true.
|
|
17
42
|
*/
|
|
18
43
|
private startChildConn;
|
|
19
|
-
|
|
44
|
+
protected startLoc: Coordinate | null;
|
|
20
45
|
private connectionCandidate;
|
|
21
|
-
|
|
46
|
+
protected connectionPreviewer: IConnectionPreviewer | null;
|
|
22
47
|
private dragging;
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
private dragOffset;
|
|
48
|
+
/** List of all connections available on the workspace. */
|
|
49
|
+
private allConnectionPairs;
|
|
50
|
+
/** The current movement mode. */
|
|
51
|
+
protected moveMode: MoveMode;
|
|
28
52
|
/** Used to persist an event group when snapping is done async. */
|
|
29
53
|
private originalEventGroup;
|
|
54
|
+
/**
|
|
55
|
+
* Half of the connection of the last announced candidate, or null if that
|
|
56
|
+
* announcement was for the workspace. Undefined if nothing has been
|
|
57
|
+
* announced yet this drag.
|
|
58
|
+
*/
|
|
59
|
+
private lastAnnouncedLocal;
|
|
60
|
+
private lastAnnouncedNeighbour;
|
|
61
|
+
/**
|
|
62
|
+
* Map from block IDs to reason(s) why it was disabled, used to restore
|
|
63
|
+
* disabled state post-drag.
|
|
64
|
+
*/
|
|
65
|
+
private lastBlockDisabledReasons;
|
|
66
|
+
protected readonly BLOCK_CONNECTION_OFFSET = 10;
|
|
67
|
+
/**
|
|
68
|
+
* How far in from the edges of the workspace to position newly placed blocks.
|
|
69
|
+
*/
|
|
70
|
+
protected readonly WORKSPACE_MARGIN = 10;
|
|
30
71
|
constructor(block: BlockSvg);
|
|
31
72
|
/** Returns true if the block is currently movable. False otherwise. */
|
|
32
73
|
isMovable(): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Positions a cloned block on its new workspace.
|
|
76
|
+
*
|
|
77
|
+
* @param oldBlock The flyout block that was cloned.
|
|
78
|
+
* @param newBlock The new block to position.
|
|
79
|
+
*/
|
|
80
|
+
protected positionNewBlock(oldBlock: BlockSvg, newBlock: BlockSvg): void;
|
|
81
|
+
/**
|
|
82
|
+
* Returns the block to use for the current drag operation. This may create
|
|
83
|
+
* and return a newly instantiated block when e.g. dragging from a flyout.
|
|
84
|
+
*/
|
|
85
|
+
protected getTargetBlock(): BlockSvg;
|
|
86
|
+
/**
|
|
87
|
+
* Announces a move on the ARIA live region for assistive technologies.
|
|
88
|
+
*
|
|
89
|
+
* @param isMoveStart Whether this announcement is for the start of a move. If false,
|
|
90
|
+
* skip announcing the block label since it should have already been announced at the
|
|
91
|
+
* start of the move.
|
|
92
|
+
*/
|
|
93
|
+
private announceMove;
|
|
94
|
+
/**
|
|
95
|
+
* Checks if there are multiple compatible connections for the specified side of the pair.
|
|
96
|
+
*
|
|
97
|
+
* @param forLocal Whether we are considering the local or neighbour side of the pair
|
|
98
|
+
* @returns True if there are multiple compatible connections, false otherwise
|
|
99
|
+
*/
|
|
100
|
+
private hasMultipleCompatibleConnections;
|
|
33
101
|
/**
|
|
34
102
|
* Handles any setup for starting the drag, including disconnecting the block
|
|
35
103
|
* from any parent blocks.
|
|
36
104
|
*/
|
|
37
|
-
startDrag(e?: PointerEvent):
|
|
105
|
+
startDrag(e?: PointerEvent | KeyboardEvent): import("../blockly.js").IDraggable;
|
|
106
|
+
/**
|
|
107
|
+
* Caches a list of all valid connection pairs between the dragging block
|
|
108
|
+
* and any other blocks on the workspace. This is used to determine the
|
|
109
|
+
* closest valid connection during keyboard-driven moves and to determine
|
|
110
|
+
* the need to disambiguate between multiple compatible connections when
|
|
111
|
+
* announcing moves to assistive technologies.
|
|
112
|
+
*/
|
|
113
|
+
cacheAllConnectionPairs(): void;
|
|
38
114
|
/**
|
|
39
115
|
* Returns an array of visible bubbles attached to the given block or its
|
|
40
116
|
* descendants.
|
|
@@ -47,20 +123,18 @@ export declare class BlockDragStrategy implements IDragStrategy {
|
|
|
47
123
|
/**
|
|
48
124
|
* Get whether the drag should act on a single block or a block stack.
|
|
49
125
|
*
|
|
50
|
-
* @param e The instigating pointer event, if any.
|
|
126
|
+
* @param e The instigating pointer or keyboard event, if any.
|
|
51
127
|
* @returns True if just the initial block should be dragged out, false
|
|
52
128
|
* if all following blocks should also be dragged.
|
|
53
129
|
*/
|
|
54
|
-
protected shouldHealStack(e: PointerEvent | undefined): boolean;
|
|
55
|
-
/** Starts a drag on a shadow, recording the drag offset. */
|
|
56
|
-
private startDraggingShadow;
|
|
130
|
+
protected shouldHealStack(e: PointerEvent | KeyboardEvent | undefined): boolean;
|
|
57
131
|
/**
|
|
58
132
|
* Whether or not we should disconnect the block when a drag is started.
|
|
59
133
|
*
|
|
60
134
|
* @param healStack Whether or not to heal the stack after disconnecting.
|
|
61
135
|
* @returns True to disconnect the block, false otherwise.
|
|
62
136
|
*/
|
|
63
|
-
|
|
137
|
+
protected shouldDisconnect(healStack: boolean): boolean;
|
|
64
138
|
/**
|
|
65
139
|
* Disconnects the block from any parents. If `healStack` is true and this is
|
|
66
140
|
* a stack block, we also disconnect from any next blocks and attempt to
|
|
@@ -69,6 +143,12 @@ export declare class BlockDragStrategy implements IDragStrategy {
|
|
|
69
143
|
* @param healStack Whether or not to heal the stack after disconnecting.
|
|
70
144
|
*/
|
|
71
145
|
private disconnectBlock;
|
|
146
|
+
/**
|
|
147
|
+
* Stores the dragging block's current parent or child connection before
|
|
148
|
+
* unplugging. This allows us to revert the drag cleanly. In keyboard move mode,
|
|
149
|
+
* the initial connection pair is also used as the first connection candidate.
|
|
150
|
+
*/
|
|
151
|
+
private storeInitialConnections;
|
|
72
152
|
/** Fire a UI event at the start of a block drag. */
|
|
73
153
|
private fireDragStartEvent;
|
|
74
154
|
/** Fire a UI event at the end of a block drag. */
|
|
@@ -76,11 +156,24 @@ export declare class BlockDragStrategy implements IDragStrategy {
|
|
|
76
156
|
/** Fire a move event at the end of a block drag. */
|
|
77
157
|
private fireMoveEvent;
|
|
78
158
|
/** Moves the block and updates any connection previews. */
|
|
79
|
-
drag(newLoc: Coordinate): void;
|
|
159
|
+
drag(newLoc: Coordinate, e?: PointerEvent | KeyboardEvent): void;
|
|
80
160
|
/**
|
|
161
|
+
* Determines the offset to apply to the dragged block's position
|
|
162
|
+
* based on the current connection candidate.
|
|
163
|
+
*
|
|
164
|
+
* @returns coordinates representing the offset
|
|
165
|
+
*/
|
|
166
|
+
private determineConnectionOffset;
|
|
167
|
+
/**
|
|
168
|
+
* Renders the connection preview indicator.
|
|
169
|
+
*
|
|
81
170
|
* @param draggingBlock The block being dragged.
|
|
82
171
|
* @param delta How far the pointer has moved from the position
|
|
83
172
|
* at the start of the drag, in workspace units.
|
|
173
|
+
* @param initialCandidate If provided, a connection candidate that the
|
|
174
|
+
* connection preview indicator will be attached to.
|
|
175
|
+
* @returns The neighbouring connection to which the connection preview will
|
|
176
|
+
* be attached.
|
|
84
177
|
*/
|
|
85
178
|
private updateConnectionPreview;
|
|
86
179
|
/**
|
|
@@ -101,6 +194,14 @@ export declare class BlockDragStrategy implements IDragStrategy {
|
|
|
101
194
|
* compatible type (input, output, etc) and connection check.
|
|
102
195
|
*/
|
|
103
196
|
private getConnectionCandidate;
|
|
197
|
+
/**
|
|
198
|
+
* Returns the closest connection candidate for the given block.
|
|
199
|
+
*
|
|
200
|
+
* @param block The block to find a connection for.
|
|
201
|
+
* @param delta The distance the block has traveled since dragging began.
|
|
202
|
+
* @returns The closest available connection candidate, if any.
|
|
203
|
+
*/
|
|
204
|
+
private getClosestCandidate;
|
|
104
205
|
/**
|
|
105
206
|
* Get the radius to use when searching for a nearby valid connection.
|
|
106
207
|
*/
|
|
@@ -116,7 +217,7 @@ export declare class BlockDragStrategy implements IDragStrategy {
|
|
|
116
217
|
* Cleans up any state at the end of the drag. Applies any pending
|
|
117
218
|
* connections.
|
|
118
219
|
*/
|
|
119
|
-
endDrag(
|
|
220
|
+
endDrag(_e: PointerEvent | KeyboardEvent | undefined, disposition: DragDisposition): void;
|
|
120
221
|
/** Disposes of any state at the end of the drag. */
|
|
121
222
|
private disposeStep;
|
|
122
223
|
/** Connects the given candidate connections. */
|
|
@@ -126,5 +227,81 @@ export declare class BlockDragStrategy implements IDragStrategy {
|
|
|
126
227
|
* including reconnecting connections.
|
|
127
228
|
*/
|
|
128
229
|
revertDrag(): void;
|
|
230
|
+
/**
|
|
231
|
+
* Get the nearest valid candidate connection in traversal order.
|
|
232
|
+
*
|
|
233
|
+
* @param delta The distance the block has moved since this drag began.
|
|
234
|
+
* @returns A candidate connection and radius, or null if none was found.
|
|
235
|
+
*/
|
|
236
|
+
findTraversalCandidate(delta: Coordinate): ConnectionCandidate | null;
|
|
237
|
+
/**
|
|
238
|
+
* Returns whether or not the given block is at a terminal position (start or
|
|
239
|
+
* end) of the blocks on the workspace. This helps distinguish between a block
|
|
240
|
+
* that is at the end of the line because all valid connections have been
|
|
241
|
+
* visited and the proposed constrained move destination is now to drop it on
|
|
242
|
+
* the workspace as a top-level block (in which case it will be in a terminal
|
|
243
|
+
* position), and a block that just entered move mode as a top-level block,
|
|
244
|
+
* and should therefore still be able to move to another connection point
|
|
245
|
+
* even if looping is disabled.
|
|
246
|
+
*
|
|
247
|
+
* @param block The block to check.
|
|
248
|
+
* @param direction The current dragging direction.
|
|
249
|
+
* @returns True if the block is at the start or end of its possible positions
|
|
250
|
+
* on the workspace.
|
|
251
|
+
*/
|
|
252
|
+
private isInTerminalPosition;
|
|
253
|
+
/**
|
|
254
|
+
* Converts a connection pair to a connection candidate with a default
|
|
255
|
+
* distance of 0.
|
|
256
|
+
*/
|
|
257
|
+
private pairToCandidate;
|
|
258
|
+
/**
|
|
259
|
+
* Returns the cardinal direction that the block being dragged would have to
|
|
260
|
+
* move in to reach the given location.
|
|
261
|
+
* The given coordinate should differ from the current location on only one
|
|
262
|
+
* axis.
|
|
263
|
+
*
|
|
264
|
+
* @param newLocation The intended destination for the block.
|
|
265
|
+
* @returns The direction the block would need to travel to reach the new
|
|
266
|
+
* location.
|
|
267
|
+
*/
|
|
268
|
+
private getDirectionToNewLocation;
|
|
269
|
+
/**
|
|
270
|
+
* Returns all navigable connections on the given block and its children.
|
|
271
|
+
* Omits connections on shadow blocks, collapsed blocks, or those that are
|
|
272
|
+
* associated with a hidden input.
|
|
273
|
+
*
|
|
274
|
+
* @param block The block to use as a starting point for retrieving
|
|
275
|
+
* connections.
|
|
276
|
+
* @returns All connections on the block and its children.
|
|
277
|
+
*/
|
|
278
|
+
private getAllConnections;
|
|
279
|
+
/**
|
|
280
|
+
* Returns a connection candidate to move the dragged block to at the start of
|
|
281
|
+
* a drag. If the passively focused node is a connection and the dragged block
|
|
282
|
+
* can connect to it, the connection will be returned. Otherwise, the first
|
|
283
|
+
* compatible connection on the passively focused node's block, if any, will
|
|
284
|
+
* be returned. Returns null if the workspace does not have passive focus.
|
|
285
|
+
*/
|
|
286
|
+
private getInitialCandidate;
|
|
287
|
+
/**
|
|
288
|
+
* Updates the current move mode based on the most recent drag-related event.
|
|
289
|
+
*/
|
|
290
|
+
private updateMoveMode;
|
|
291
|
+
/**
|
|
292
|
+
* Enables the given block and its children.
|
|
293
|
+
* Stores the reasons each block was disabled so they can be restored.
|
|
294
|
+
*
|
|
295
|
+
* @param block The block to enable.
|
|
296
|
+
*/
|
|
297
|
+
private enableAllDraggedBlocks;
|
|
298
|
+
/**
|
|
299
|
+
* Re-disables the given block and its children using their original
|
|
300
|
+
* disabled reasons.
|
|
301
|
+
*
|
|
302
|
+
* @param block The block to re-disable, if applicable.
|
|
303
|
+
*/
|
|
304
|
+
private redisableAllDraggedBlocks;
|
|
129
305
|
}
|
|
306
|
+
export {};
|
|
130
307
|
//# sourceMappingURL=block_drag_strategy.d.ts.map
|
|
@@ -3,16 +3,17 @@
|
|
|
3
3
|
* Copyright 2024 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { IBubble
|
|
7
|
-
import { IDragStrategy } from '../interfaces/i_draggable.js';
|
|
8
|
-
import { Coordinate } from '../utils.js';
|
|
6
|
+
import type { IBubble } from '../interfaces/i_bubble.js';
|
|
7
|
+
import type { IDragStrategy } from '../interfaces/i_draggable.js';
|
|
8
|
+
import type { Coordinate } from '../utils.js';
|
|
9
|
+
import type { WorkspaceSvg } from '../workspace_svg.js';
|
|
9
10
|
export declare class BubbleDragStrategy implements IDragStrategy {
|
|
10
11
|
private bubble;
|
|
11
12
|
private workspace;
|
|
12
13
|
private startLoc;
|
|
13
14
|
constructor(bubble: IBubble, workspace: WorkspaceSvg);
|
|
14
15
|
isMovable(): boolean;
|
|
15
|
-
startDrag():
|
|
16
|
+
startDrag(): IBubble;
|
|
16
17
|
drag(newLoc: Coordinate): void;
|
|
17
18
|
endDrag(): void;
|
|
18
19
|
revertDrag(): void;
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
* Copyright 2024 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { RenderedWorkspaceComment } from '../comments.js';
|
|
7
|
-
import { IDragStrategy } from '../interfaces/i_draggable.js';
|
|
8
|
-
import { Coordinate } from '../utils.js';
|
|
6
|
+
import type { RenderedWorkspaceComment } from '../comments.js';
|
|
7
|
+
import type { IDragStrategy } from '../interfaces/i_draggable.js';
|
|
8
|
+
import type { Coordinate } from '../utils.js';
|
|
9
9
|
export declare class CommentDragStrategy implements IDragStrategy {
|
|
10
10
|
private comment;
|
|
11
11
|
private startLoc;
|
|
12
12
|
private workspace;
|
|
13
13
|
constructor(comment: RenderedWorkspaceComment);
|
|
14
14
|
isMovable(): boolean;
|
|
15
|
-
startDrag():
|
|
15
|
+
startDrag(): RenderedWorkspaceComment;
|
|
16
16
|
drag(newLoc: Coordinate): void;
|
|
17
17
|
endDrag(): void;
|
|
18
18
|
/** Fire a UI event at the start of a comment drag. */
|
|
@@ -3,29 +3,28 @@
|
|
|
3
3
|
* Copyright 2024 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { IDeletable } from '../interfaces/i_deletable.js';
|
|
7
|
-
import { IDragTarget } from '../interfaces/i_drag_target.js';
|
|
8
|
-
import { IDraggable } from '../interfaces/i_draggable.js';
|
|
9
|
-
import { IDragger } from '../interfaces/i_dragger.js';
|
|
6
|
+
import type { IDeletable } from '../interfaces/i_deletable.js';
|
|
7
|
+
import type { IDragTarget } from '../interfaces/i_drag_target.js';
|
|
8
|
+
import { type IDraggable } from '../interfaces/i_draggable.js';
|
|
9
|
+
import type { IDragger } from '../interfaces/i_dragger.js';
|
|
10
10
|
import { Coordinate } from '../utils/coordinate.js';
|
|
11
|
-
import { WorkspaceSvg } from '../workspace_svg.js';
|
|
12
11
|
export declare class Dragger implements IDragger {
|
|
13
12
|
protected draggable: IDraggable;
|
|
14
|
-
protected workspace: WorkspaceSvg;
|
|
15
13
|
protected startLoc: Coordinate;
|
|
16
14
|
protected dragTarget: IDragTarget | null;
|
|
17
|
-
|
|
15
|
+
protected revertShouldDelete: boolean;
|
|
16
|
+
constructor(draggable: IDraggable);
|
|
18
17
|
/** Handles any drag startup. */
|
|
19
|
-
onDragStart(e
|
|
18
|
+
onDragStart(e?: PointerEvent | KeyboardEvent): IDraggable;
|
|
20
19
|
/**
|
|
21
20
|
* Handles calculating where the element should actually be moved to.
|
|
22
21
|
*
|
|
23
22
|
* @param totalDelta The total amount in pixel coordinates the mouse has moved
|
|
24
23
|
* since the start of the drag.
|
|
25
24
|
*/
|
|
26
|
-
onDrag(e: PointerEvent, totalDelta: Coordinate): void;
|
|
25
|
+
onDrag(e: PointerEvent | KeyboardEvent | undefined, totalDelta: Coordinate): void;
|
|
27
26
|
/** Updates the drag target under the pointer (if there is one). */
|
|
28
|
-
protected updateDragTarget(
|
|
27
|
+
protected updateDragTarget(coordinate: Coordinate): void;
|
|
29
28
|
/**
|
|
30
29
|
* Calculates the correct workspace coordinate for the movable and tells
|
|
31
30
|
* the draggable to go to that location.
|
|
@@ -35,15 +34,16 @@ export declare class Dragger implements IDragger {
|
|
|
35
34
|
* Returns true if we would delete the draggable if it was dropped
|
|
36
35
|
* at the current location.
|
|
37
36
|
*/
|
|
38
|
-
protected wouldDeleteDraggable(
|
|
37
|
+
protected wouldDeleteDraggable(coordinate: Coordinate, rootDraggable: IDraggable & IDeletable): boolean;
|
|
39
38
|
/** Handles any drag cleanup. */
|
|
40
|
-
onDragEnd(e
|
|
41
|
-
|
|
39
|
+
onDragEnd(e?: PointerEvent | KeyboardEvent): void;
|
|
40
|
+
/** Handles a drag being reverted. */
|
|
41
|
+
onDragRevert(e?: PointerEvent | KeyboardEvent): void;
|
|
42
42
|
/**
|
|
43
43
|
* Returns true if we should return the draggable to its original location
|
|
44
44
|
* at the end of the drag.
|
|
45
45
|
*/
|
|
46
|
-
protected shouldReturnToStart(
|
|
46
|
+
protected shouldReturnToStart(coordinate: Coordinate, rootDraggable: IDraggable): boolean;
|
|
47
47
|
protected pixelsToWorkspaceUnits(pixelCoord: Coordinate): Coordinate;
|
|
48
48
|
}
|
|
49
49
|
//# sourceMappingURL=dragger.d.ts.map
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { Block } from '../block.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 any event related to blocks.
|
|
16
17
|
*/
|
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { Block } from '../block.js';
|
|
12
12
|
import type { BlockSvg } from '../block_svg.js';
|
|
13
|
-
import { Workspace } from '../workspace.js';
|
|
14
|
-
import {
|
|
13
|
+
import type { Workspace } from '../workspace.js';
|
|
14
|
+
import type { BlockBaseJson } from './events_block_base.js';
|
|
15
|
+
import { BlockBase } from './events_block_base.js';
|
|
15
16
|
import { EventType } from './type.js';
|
|
16
17
|
/**
|
|
17
18
|
* Notifies listeners when some element of a block has changed (e.g.
|
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { Block } from '../block.js';
|
|
12
12
|
import * as blocks from '../serialization/blocks.js';
|
|
13
|
-
import { Workspace } from '../workspace.js';
|
|
14
|
-
import {
|
|
13
|
+
import type { Workspace } from '../workspace.js';
|
|
14
|
+
import type { BlockBaseJson } from './events_block_base.js';
|
|
15
|
+
import { BlockBase } from './events_block_base.js';
|
|
15
16
|
import { EventType } from './type.js';
|
|
16
17
|
/**
|
|
17
18
|
* Notifies listeners when a block (or connected stack of blocks) is
|
|
@@ -19,8 +20,6 @@ import { EventType } from './type.js';
|
|
|
19
20
|
*/
|
|
20
21
|
export declare class BlockCreate extends BlockBase {
|
|
21
22
|
type: EventType;
|
|
22
|
-
/** The XML representation of the created block(s). */
|
|
23
|
-
xml?: Element | DocumentFragment;
|
|
24
23
|
/** The JSON respresentation of the created block(s). */
|
|
25
24
|
json?: blocks.State;
|
|
26
25
|
/** All of the IDs of created blocks. */
|
|
@@ -51,7 +50,6 @@ export declare class BlockCreate extends BlockBase {
|
|
|
51
50
|
run(forward: boolean): void;
|
|
52
51
|
}
|
|
53
52
|
export interface BlockCreateJson extends BlockBaseJson {
|
|
54
|
-
xml: string;
|
|
55
53
|
ids: string[];
|
|
56
54
|
json: object;
|
|
57
55
|
recordUndo?: boolean;
|
|
@@ -10,16 +10,15 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { Block } from '../block.js';
|
|
12
12
|
import * as blocks from '../serialization/blocks.js';
|
|
13
|
-
import { Workspace } from '../workspace.js';
|
|
14
|
-
import {
|
|
13
|
+
import type { Workspace } from '../workspace.js';
|
|
14
|
+
import type { BlockBaseJson } from './events_block_base.js';
|
|
15
|
+
import { BlockBase } from './events_block_base.js';
|
|
15
16
|
import { EventType } from './type.js';
|
|
16
17
|
/**
|
|
17
18
|
* Notifies listeners when a block (or connected stack of blocks) is
|
|
18
19
|
* deleted.
|
|
19
20
|
*/
|
|
20
21
|
export declare class BlockDelete extends BlockBase {
|
|
21
|
-
/** The XML representation of the deleted block(s). */
|
|
22
|
-
oldXml?: Element | DocumentFragment;
|
|
23
22
|
/** The JSON respresentation of the deleted block(s). */
|
|
24
23
|
oldJson?: blocks.State;
|
|
25
24
|
/** All of the IDs of deleted blocks. */
|
|
@@ -53,7 +52,6 @@ export declare class BlockDelete extends BlockBase {
|
|
|
53
52
|
run(forward: boolean): void;
|
|
54
53
|
}
|
|
55
54
|
export interface BlockDeleteJson extends BlockBaseJson {
|
|
56
|
-
oldXml: string;
|
|
57
55
|
ids: string[];
|
|
58
56
|
wasShadow: boolean;
|
|
59
57
|
oldJson: blocks.State;
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* @class
|
|
10
10
|
*/
|
|
11
11
|
import type { Block } from '../block.js';
|
|
12
|
-
import { Workspace } from '../workspace.js';
|
|
13
|
-
import { AbstractEventJson } from './events_abstract.js';
|
|
12
|
+
import type { Workspace } from '../workspace.js';
|
|
13
|
+
import type { AbstractEventJson } from './events_abstract.js';
|
|
14
14
|
import { UiBase } from './events_ui_base.js';
|
|
15
15
|
import { EventType } from './type.js';
|
|
16
16
|
/**
|
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
* @class
|
|
11
11
|
*/
|
|
12
12
|
import type { Block } from '../block.js';
|
|
13
|
-
import { Workspace } from '../workspace.js';
|
|
14
|
-
import {
|
|
13
|
+
import type { Workspace } from '../workspace.js';
|
|
14
|
+
import type { BlockBaseJson } from './events_block_base.js';
|
|
15
|
+
import { BlockBase } from './events_block_base.js';
|
|
15
16
|
import { EventType } from './type.js';
|
|
16
17
|
/**
|
|
17
18
|
* Notifies listeners when the value of a block's field has changed but the
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
import type { Block } from '../block.js';
|
|
12
12
|
import { Coordinate } from '../utils/coordinate.js';
|
|
13
13
|
import type { Workspace } from '../workspace.js';
|
|
14
|
-
import {
|
|
14
|
+
import type { BlockBaseJson } from './events_block_base.js';
|
|
15
|
+
import { BlockBase } from './events_block_base.js';
|
|
15
16
|
import { EventType } from './type.js';
|
|
16
17
|
/**
|
|
17
18
|
* Notifies listeners when a block is moved. This could be from one
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* @class
|
|
10
10
|
*/
|
|
11
11
|
import type { Block } from '../block.js';
|
|
12
|
-
import { Workspace } from '../workspace.js';
|
|
13
|
-
import { AbstractEventJson } from './events_abstract.js';
|
|
12
|
+
import type { Workspace } from '../workspace.js';
|
|
13
|
+
import type { AbstractEventJson } from './events_abstract.js';
|
|
14
14
|
import { UiBase } from './events_ui_base.js';
|
|
15
15
|
import { EventType } from './type.js';
|
|
16
16
|
/**
|
|
@@ -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 { AbstractEventJson } from './events_abstract.js';
|
|
14
|
+
import { Abstract as AbstractEvent } from './events_abstract.js';
|
|
14
15
|
import type { CommentCreate } from './events_comment_create.js';
|
|
15
16
|
import type { CommentDelete } from './events_comment_delete.js';
|
|
16
17
|
/**
|