blockly 12.5.1 → 13.0.0-beta.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/blockly.min.js +1541 -700
- package/blockly.mjs +13 -5
- package/blockly_compressed.js +1449 -674
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js +16 -16
- package/blocks_compressed.js.map +1 -1
- package/core/block.d.ts +1 -1
- package/core/block_aria_composer.d.ts +119 -0
- package/core/block_svg.d.ts +59 -16
- package/core/blockly.d.ts +21 -16
- package/core/bubbles/bubble.d.ts +17 -2
- package/core/bubbles/mini_workspace_bubble.d.ts +9 -1
- package/core/bubbles/text_bubble.d.ts +4 -1
- package/core/bubbles/textinput_bubble.d.ts +5 -0
- package/core/comments/comment_editor.d.ts +2 -2
- package/core/comments/rendered_workspace_comment.d.ts +6 -1
- package/core/common.d.ts +1 -1
- package/core/css.d.ts +2 -1
- package/core/dragging/block_drag_strategy.d.ts +126 -14
- 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 +13 -14
- package/core/events/events_block_create.d.ts +0 -3
- package/core/events/events_block_delete.d.ts +0 -3
- package/core/events/events_comment_create.d.ts +0 -3
- package/core/events/events_comment_delete.d.ts +0 -3
- package/core/field.d.ts +69 -2
- package/core/field_input.d.ts +23 -0
- package/core/flyout_base.d.ts +1 -125
- package/core/flyout_button.d.ts +9 -0
- package/core/flyout_horizontal.d.ts +0 -11
- package/core/flyout_vertical.d.ts +0 -11
- package/core/focus_manager.d.ts +47 -2
- package/core/gesture.d.ts +0 -12
- package/core/hints.d.ts +44 -0
- package/core/icons/icon.d.ts +6 -0
- package/core/inputs/input.d.ts +22 -1
- 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_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_focusable_node.d.ts +8 -0
- package/core/interfaces/i_focusable_tree.d.ts +8 -0
- package/core/interfaces/i_json_block_definition.d.ts +102 -0
- package/core/interfaces/i_navigation_policy.d.ts +12 -0
- package/core/interfaces/i_selectable.d.ts +2 -2
- 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/keyboard_nav/keyboard_mover.d.ts +149 -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 +225 -0
- package/core/keyboard_nav/navigators/toolbox_navigator.d.ts +70 -0
- package/core/registry.d.ts +0 -2
- package/core/renderers/common/constants.d.ts +4 -7
- package/core/renderers/common/i_path_object.d.ts +8 -0
- package/core/renderers/common/path_object.d.ts +5 -14
- package/core/renderers/common/renderer.d.ts +3 -3
- package/core/renderers/zelos/constants.d.ts +1 -14
- 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/shortcut_items.d.ts +73 -1
- package/core/shortcut_registry.d.ts +6 -0
- package/core/theme.d.ts +0 -2
- package/core/toast.d.ts +2 -11
- package/core/toolbox/category.d.ts +5 -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/utils/aria.d.ts +245 -28
- package/core/utils/dom.d.ts +1 -1
- package/core/utils/shortcut_formatting.d.ts +22 -0
- package/core/utils/useragent.d.ts +1 -0
- package/core/variables.d.ts +1 -1
- package/core/workspace_audio.d.ts +23 -0
- package/core/workspace_svg.d.ts +8 -50
- package/dart_compressed.js +9 -9
- package/dart_compressed.js.map +1 -1
- package/index.mjs +13 -5
- package/javascript_compressed.js +11 -10
- package/javascript_compressed.js.map +1 -1
- package/lua_compressed.js +7 -7
- package/lua_compressed.js.map +1 -1
- package/msg/ab.js +65 -0
- package/msg/ab.mjs +65 -0
- package/msg/ace.js +65 -0
- package/msg/ace.mjs +65 -0
- package/msg/af.js +65 -0
- package/msg/af.mjs +65 -0
- package/msg/am.js +65 -0
- package/msg/am.mjs +65 -0
- package/msg/ar.js +65 -0
- package/msg/ar.mjs +65 -0
- package/msg/ast.js +65 -0
- package/msg/ast.mjs +65 -0
- package/msg/az.js +65 -0
- package/msg/az.mjs +65 -0
- package/msg/ba.js +65 -0
- package/msg/ba.mjs +65 -0
- package/msg/bcc.js +65 -0
- package/msg/bcc.mjs +65 -0
- package/msg/be-tarask.js +65 -0
- package/msg/be-tarask.mjs +65 -0
- package/msg/be.js +65 -0
- package/msg/be.mjs +65 -0
- package/msg/bg.js +65 -0
- package/msg/bg.mjs +65 -0
- package/msg/bn.js +65 -0
- package/msg/bn.mjs +65 -0
- package/msg/br.js +65 -0
- package/msg/br.mjs +65 -0
- package/msg/bs.js +65 -0
- package/msg/bs.mjs +65 -0
- package/msg/ca.js +65 -0
- package/msg/ca.mjs +65 -0
- package/msg/cdo.js +65 -0
- package/msg/cdo.mjs +65 -0
- package/msg/ce.js +65 -0
- package/msg/ce.mjs +65 -0
- package/msg/cs.js +65 -0
- package/msg/cs.mjs +65 -0
- package/msg/da.js +65 -0
- package/msg/da.mjs +65 -0
- package/msg/de.js +65 -0
- package/msg/de.mjs +65 -0
- package/msg/diq.js +65 -0
- package/msg/diq.mjs +65 -0
- package/msg/dtp.js +65 -0
- package/msg/dtp.mjs +65 -0
- package/msg/dty.js +65 -0
- package/msg/dty.mjs +65 -0
- package/msg/ee.js +65 -0
- package/msg/ee.mjs +65 -0
- package/msg/el.js +65 -0
- package/msg/el.mjs +65 -0
- package/msg/en-gb.js +65 -0
- package/msg/en-gb.mjs +65 -0
- package/msg/en.js +65 -0
- package/msg/en.mjs +65 -0
- package/msg/eo.js +65 -0
- package/msg/eo.mjs +65 -0
- package/msg/es.js +65 -0
- package/msg/es.mjs +65 -0
- package/msg/et.js +65 -0
- package/msg/et.mjs +65 -0
- package/msg/eu.js +65 -0
- package/msg/eu.mjs +65 -0
- package/msg/fa.js +65 -0
- package/msg/fa.mjs +65 -0
- package/msg/fi.js +65 -0
- package/msg/fi.mjs +65 -0
- package/msg/fo.js +65 -0
- package/msg/fo.mjs +65 -0
- package/msg/fr.js +65 -0
- package/msg/fr.mjs +65 -0
- package/msg/frr.js +65 -0
- package/msg/frr.mjs +65 -0
- package/msg/gl.js +65 -0
- package/msg/gl.mjs +65 -0
- package/msg/gn.js +65 -0
- package/msg/gn.mjs +65 -0
- package/msg/gor.js +65 -0
- package/msg/gor.mjs +65 -0
- package/msg/ha.js +65 -0
- package/msg/ha.mjs +65 -0
- package/msg/hak.js +65 -0
- package/msg/hak.mjs +65 -0
- package/msg/he.js +65 -0
- package/msg/he.mjs +65 -0
- package/msg/hi.js +65 -0
- package/msg/hi.mjs +65 -0
- package/msg/hr.js +65 -0
- package/msg/hr.mjs +65 -0
- package/msg/hrx.js +65 -0
- package/msg/hrx.mjs +65 -0
- package/msg/hsb.js +65 -0
- package/msg/hsb.mjs +65 -0
- package/msg/hu.js +65 -0
- package/msg/hu.mjs +65 -0
- package/msg/hy.js +65 -0
- package/msg/hy.mjs +65 -0
- package/msg/ia.js +65 -0
- package/msg/ia.mjs +65 -0
- package/msg/id.js +65 -0
- package/msg/id.mjs +65 -0
- package/msg/ig.js +65 -0
- package/msg/ig.mjs +65 -0
- package/msg/inh.js +65 -0
- package/msg/inh.mjs +65 -0
- package/msg/is.js +65 -0
- package/msg/is.mjs +65 -0
- package/msg/it.js +65 -0
- package/msg/it.mjs +65 -0
- package/msg/ja.js +65 -0
- package/msg/ja.mjs +65 -0
- package/msg/ka.js +65 -0
- package/msg/ka.mjs +65 -0
- package/msg/kab.js +65 -0
- package/msg/kab.mjs +65 -0
- package/msg/kbd-cyrl.js +65 -0
- package/msg/kbd-cyrl.mjs +65 -0
- package/msg/km.js +65 -0
- package/msg/km.mjs +65 -0
- package/msg/kn.js +65 -0
- package/msg/kn.mjs +65 -0
- package/msg/ko.js +65 -0
- package/msg/ko.mjs +65 -0
- package/msg/ksh.js +65 -0
- package/msg/ksh.mjs +65 -0
- package/msg/ku-latn.js +65 -0
- package/msg/ku-latn.mjs +65 -0
- package/msg/ky.js +65 -0
- package/msg/ky.mjs +65 -0
- package/msg/la.js +65 -0
- package/msg/la.mjs +65 -0
- package/msg/lb.js +65 -0
- package/msg/lb.mjs +65 -0
- package/msg/lki.js +65 -0
- package/msg/lki.mjs +65 -0
- package/msg/lo.js +65 -0
- package/msg/lo.mjs +65 -0
- package/msg/lrc.js +65 -0
- package/msg/lrc.mjs +65 -0
- package/msg/lt.js +65 -0
- package/msg/lt.mjs +65 -0
- package/msg/lv.js +65 -0
- package/msg/lv.mjs +65 -0
- package/msg/mg.js +65 -0
- package/msg/mg.mjs +65 -0
- package/msg/mk.js +65 -0
- package/msg/mk.mjs +65 -0
- package/msg/ml.js +65 -0
- package/msg/ml.mjs +65 -0
- package/msg/mnw.js +65 -0
- package/msg/mnw.mjs +65 -0
- package/msg/ms.js +65 -0
- package/msg/ms.mjs +65 -0
- package/msg/my.js +65 -0
- package/msg/my.mjs +65 -0
- package/msg/mzn.js +65 -0
- package/msg/mzn.mjs +65 -0
- package/msg/nb.js +65 -0
- package/msg/nb.mjs +65 -0
- package/msg/ne.js +65 -0
- package/msg/ne.mjs +65 -0
- package/msg/nl.js +65 -0
- package/msg/nl.mjs +65 -0
- package/msg/oc.js +65 -0
- package/msg/oc.mjs +65 -0
- package/msg/olo.js +65 -0
- package/msg/olo.mjs +65 -0
- package/msg/pa.js +65 -0
- package/msg/pa.mjs +65 -0
- package/msg/pl.js +65 -0
- package/msg/pl.mjs +65 -0
- package/msg/pms.js +65 -0
- package/msg/pms.mjs +65 -0
- package/msg/ps.js +65 -0
- package/msg/ps.mjs +65 -0
- package/msg/pt-br.js +65 -0
- package/msg/pt-br.mjs +65 -0
- package/msg/pt.js +65 -0
- package/msg/pt.mjs +65 -0
- package/msg/ro.js +65 -0
- package/msg/ro.mjs +65 -0
- package/msg/ru.js +65 -0
- package/msg/ru.mjs +65 -0
- package/msg/sc.js +65 -0
- package/msg/sc.mjs +65 -0
- package/msg/sco.js +65 -0
- package/msg/sco.mjs +65 -0
- package/msg/sd.js +65 -0
- package/msg/sd.mjs +65 -0
- package/msg/shn.js +65 -0
- package/msg/shn.mjs +65 -0
- package/msg/si.js +65 -0
- package/msg/si.mjs +65 -0
- package/msg/sk.js +65 -0
- package/msg/sk.mjs +65 -0
- package/msg/skr-arab.js +65 -0
- package/msg/skr-arab.mjs +65 -0
- package/msg/sl.js +65 -0
- package/msg/sl.mjs +65 -0
- package/msg/smn.js +65 -0
- package/msg/smn.mjs +65 -0
- package/msg/sq.js +65 -0
- package/msg/sq.mjs +65 -0
- package/msg/sr-latn.js +65 -0
- package/msg/sr-latn.mjs +65 -0
- package/msg/sr.js +65 -0
- package/msg/sr.mjs +65 -0
- package/msg/sv.js +65 -0
- package/msg/sv.mjs +65 -0
- package/msg/sw.js +65 -0
- package/msg/sw.mjs +65 -0
- package/msg/ta.js +65 -0
- package/msg/ta.mjs +65 -0
- package/msg/tcy.js +65 -0
- package/msg/tcy.mjs +65 -0
- package/msg/tdd.js +65 -0
- package/msg/tdd.mjs +65 -0
- package/msg/te.js +65 -0
- package/msg/te.mjs +65 -0
- package/msg/th.js +65 -0
- package/msg/th.mjs +65 -0
- package/msg/ti.js +65 -0
- package/msg/ti.mjs +65 -0
- package/msg/tl.js +65 -0
- package/msg/tl.mjs +65 -0
- package/msg/tlh.js +65 -0
- package/msg/tlh.mjs +65 -0
- package/msg/tr.js +65 -0
- package/msg/tr.mjs +65 -0
- package/msg/ug-arab.js +65 -0
- package/msg/ug-arab.mjs +65 -0
- package/msg/uk.js +65 -0
- package/msg/uk.mjs +65 -0
- package/msg/ur.js +65 -0
- package/msg/ur.mjs +65 -0
- package/msg/uz.js +65 -0
- package/msg/uz.mjs +65 -0
- package/msg/vi.js +65 -0
- package/msg/vi.mjs +65 -0
- package/msg/xmf.js +65 -0
- package/msg/xmf.mjs +65 -0
- package/msg/yo.js +65 -0
- package/msg/yo.mjs +65 -0
- package/msg/zgh.js +65 -0
- package/msg/zgh.mjs +65 -0
- package/msg/zh-hans.js +65 -0
- package/msg/zh-hans.mjs +65 -0
- package/msg/zh-hant.js +65 -0
- package/msg/zh-hant.mjs +65 -0
- package/package.json +11 -11
- package/php_compressed.js +2 -2
- package/php_compressed.js.map +1 -1
- package/python_compressed.js +2 -2
- 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
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
import type { Navigator } from '../keyboard_nav/navigators/navigator';
|
|
6
7
|
import type { IFocusableNode } from './i_focusable_node.js';
|
|
7
8
|
/**
|
|
8
9
|
* Represents a tree of focusable elements with its own active/passive focus
|
|
@@ -113,6 +114,13 @@ export interface IFocusableTree {
|
|
|
113
114
|
* as in the case that Blockly is entirely losing DOM focus).
|
|
114
115
|
*/
|
|
115
116
|
onTreeBlur(nextTree: IFocusableTree | null): void;
|
|
117
|
+
/**
|
|
118
|
+
* Returns a Navigator instance to be used to determine the navigation order
|
|
119
|
+
* between IFocusableNodes contained within this IFocusableTree. Generally
|
|
120
|
+
* this can just be an instance of Navigator, but trees may choose to return a
|
|
121
|
+
* subclass to customize navigation behavior within their context.
|
|
122
|
+
*/
|
|
123
|
+
getNavigator(): Navigator;
|
|
116
124
|
}
|
|
117
125
|
/**
|
|
118
126
|
* Determines whether the provided object fulfills the contract of
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { FieldCheckboxFromJsonConfig } from '../field_checkbox.js';
|
|
7
|
+
import { FieldDropdownFromJsonConfig } from '../field_dropdown';
|
|
8
|
+
import { FieldImageFromJsonConfig } from '../field_image';
|
|
9
|
+
import { FieldNumberFromJsonConfig } from '../field_number';
|
|
10
|
+
import { FieldTextInputFromJsonConfig } from '../field_textinput';
|
|
11
|
+
import { FieldVariableFromJsonConfig } from '../field_variable';
|
|
12
|
+
import { Align } from '../inputs/align.js';
|
|
13
|
+
/**
|
|
14
|
+
* Defines the JSON structure for a block definition.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const blockDef: JsonBlockDefinition = {
|
|
19
|
+
* type: 'custom_block',
|
|
20
|
+
* message0: 'move %1 steps',
|
|
21
|
+
* args0: [
|
|
22
|
+
* {
|
|
23
|
+
* 'type': 'field_number',
|
|
24
|
+
* 'name': 'INPUT',
|
|
25
|
+
* },
|
|
26
|
+
* ],
|
|
27
|
+
* previousStatement: null,
|
|
28
|
+
* nextStatement: null,
|
|
29
|
+
* };
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export interface JsonBlockDefinition {
|
|
33
|
+
type: string;
|
|
34
|
+
style?: string | null;
|
|
35
|
+
colour?: string | number;
|
|
36
|
+
output?: string | string[] | null;
|
|
37
|
+
previousStatement?: string | string[] | null;
|
|
38
|
+
nextStatement?: string | string[] | null;
|
|
39
|
+
outputShape?: number;
|
|
40
|
+
inputsInline?: boolean;
|
|
41
|
+
tooltip?: string;
|
|
42
|
+
helpUrl?: string;
|
|
43
|
+
extensions?: string[];
|
|
44
|
+
mutator?: string;
|
|
45
|
+
enableContextMenu?: boolean;
|
|
46
|
+
suppressPrefixSuffix?: boolean;
|
|
47
|
+
[key: `message${number}`]: string | undefined;
|
|
48
|
+
[key: `args${number}`]: JsonBlockArg[] | undefined;
|
|
49
|
+
[key: `implicitAlign${number}`]: string | undefined;
|
|
50
|
+
}
|
|
51
|
+
export type JsonBlockArg = InputValueArg | InputStatementArg | InputDummyArg | InputEndRowArg | FieldInputArg | FieldNumberArg | FieldDropdownArg | FieldCheckboxArg | FieldImageArg | FieldVariableArg | UnknownArg;
|
|
52
|
+
interface UnknownArg {
|
|
53
|
+
type: string;
|
|
54
|
+
[key: string]: unknown;
|
|
55
|
+
}
|
|
56
|
+
/** Input args */
|
|
57
|
+
interface InputValueArg {
|
|
58
|
+
type: 'input_value';
|
|
59
|
+
name?: string;
|
|
60
|
+
check?: string | string[];
|
|
61
|
+
align?: Align;
|
|
62
|
+
}
|
|
63
|
+
interface InputStatementArg {
|
|
64
|
+
type: 'input_statement';
|
|
65
|
+
name?: string;
|
|
66
|
+
check?: string | string[];
|
|
67
|
+
}
|
|
68
|
+
interface InputDummyArg {
|
|
69
|
+
type: 'input_dummy';
|
|
70
|
+
name?: string;
|
|
71
|
+
}
|
|
72
|
+
interface InputEndRowArg {
|
|
73
|
+
type: 'input_end_row';
|
|
74
|
+
name?: string;
|
|
75
|
+
}
|
|
76
|
+
/** Field args */
|
|
77
|
+
interface FieldInputArg extends FieldTextInputFromJsonConfig {
|
|
78
|
+
type: 'field_input';
|
|
79
|
+
name?: string;
|
|
80
|
+
}
|
|
81
|
+
interface FieldNumberArg extends FieldNumberFromJsonConfig {
|
|
82
|
+
type: 'field_number';
|
|
83
|
+
name?: string;
|
|
84
|
+
}
|
|
85
|
+
interface FieldDropdownArg extends FieldDropdownFromJsonConfig {
|
|
86
|
+
type: 'field_dropdown';
|
|
87
|
+
name?: string;
|
|
88
|
+
}
|
|
89
|
+
interface FieldCheckboxArg extends FieldCheckboxFromJsonConfig {
|
|
90
|
+
type: 'field_checkbox';
|
|
91
|
+
name?: string;
|
|
92
|
+
}
|
|
93
|
+
interface FieldImageArg extends FieldImageFromJsonConfig {
|
|
94
|
+
type: 'field_image';
|
|
95
|
+
name?: string;
|
|
96
|
+
}
|
|
97
|
+
interface FieldVariableArg extends FieldVariableFromJsonConfig {
|
|
98
|
+
type: 'field_variable';
|
|
99
|
+
name?: string;
|
|
100
|
+
}
|
|
101
|
+
export {};
|
|
102
|
+
//# sourceMappingURL=i_json_block_definition.d.ts.map
|
|
@@ -38,6 +38,18 @@ export interface INavigationPolicy<T> {
|
|
|
38
38
|
* there is none.
|
|
39
39
|
*/
|
|
40
40
|
getPreviousSibling(current: T): IFocusableNode | null;
|
|
41
|
+
/**
|
|
42
|
+
* Returns an ID corresponding to the visual "row" the given element is part
|
|
43
|
+
* of. All elements on the same visual row should share the same ID. For
|
|
44
|
+
* example, icons share their parent block's row ID, as do inline connected
|
|
45
|
+
* blocks or value inputs. Statement inputs, external inputs, or blocks
|
|
46
|
+
* connected to one another's previous or next connections form distinct
|
|
47
|
+
* visual rows and should have distinct row IDs.
|
|
48
|
+
*
|
|
49
|
+
* @param current The element to return the row ID of.
|
|
50
|
+
* @returns The row ID of the given element.
|
|
51
|
+
*/
|
|
52
|
+
getRowId(current: T): string;
|
|
41
53
|
/**
|
|
42
54
|
* Returns whether or not the given instance should be reachable via keyboard
|
|
43
55
|
* navigation.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import type {
|
|
6
|
+
import type { WorkspaceSvg } from '../workspace_svg.js';
|
|
7
7
|
import { IFocusableNode } from './i_focusable_node.js';
|
|
8
8
|
/**
|
|
9
9
|
* The interface for an object that is selectable.
|
|
@@ -15,7 +15,7 @@ import { IFocusableNode } from './i_focusable_node.js';
|
|
|
15
15
|
*/
|
|
16
16
|
export interface ISelectable extends IFocusableNode {
|
|
17
17
|
id: string;
|
|
18
|
-
workspace:
|
|
18
|
+
workspace: WorkspaceSvg;
|
|
19
19
|
/** Select this. Highlight it visually. */
|
|
20
20
|
select(): void;
|
|
21
21
|
/** Unselect this. Unhighlight it visually. */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import type { FlyoutItemInfoArray } from '../utils/toolbox';
|
|
7
|
-
import type
|
|
7
|
+
import { type IToolboxItem } from './i_toolbox_item.js';
|
|
8
8
|
/**
|
|
9
9
|
* Interface for an item in the toolbox that can be selected.
|
|
10
10
|
*/
|
|
@@ -45,7 +45,7 @@ export interface ISelectableToolboxItem extends IToolboxItem {
|
|
|
45
45
|
onClick(_e: Event): void;
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
|
-
* Type guard that checks whether an
|
|
48
|
+
* Type guard that checks whether an object is an ISelectableToolboxItem.
|
|
49
49
|
*/
|
|
50
|
-
export declare function isSelectableToolboxItem(
|
|
50
|
+
export declare function isSelectableToolboxItem(obj: any): obj is ISelectableToolboxItem;
|
|
51
51
|
//# sourceMappingURL=i_selectable_toolbox_item.d.ts.map
|
|
@@ -98,5 +98,9 @@ export interface IToolbox extends IRegistrable, IFocusableTree {
|
|
|
98
98
|
setSelectedItem(item: IToolboxItem | null): void;
|
|
99
99
|
/** Disposes of this toolbox. */
|
|
100
100
|
dispose(): void;
|
|
101
|
+
/**
|
|
102
|
+
* Returns a list of items in this toolbox.
|
|
103
|
+
*/
|
|
104
|
+
getToolboxItems(): IToolboxItem[];
|
|
101
105
|
}
|
|
102
106
|
//# sourceMappingURL=i_toolbox.d.ts.map
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import type { IFocusableNode } from './i_focusable_node.js';
|
|
7
|
+
import type { IToolbox } from './i_toolbox.js';
|
|
7
8
|
/**
|
|
8
9
|
* Interface for an item in the toolbox.
|
|
9
10
|
*/
|
|
@@ -67,5 +68,10 @@ export interface IToolboxItem extends IFocusableNode {
|
|
|
67
68
|
* @param isVisible True if category should be visible.
|
|
68
69
|
*/
|
|
69
70
|
setVisible_(isVisible: boolean): void;
|
|
71
|
+
getParentToolbox(): IToolbox;
|
|
70
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Type guard that checks whether an object is an IToolboxItem.
|
|
75
|
+
*/
|
|
76
|
+
export declare function isToolboxItem(obj: any): obj is IToolboxItem;
|
|
71
77
|
//# sourceMappingURL=i_toolbox_item.d.ts.map
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type { IDraggable } from '../interfaces/i_draggable.js';
|
|
2
|
+
/**
|
|
3
|
+
* Cardinal directions in which a move can proceed.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum Direction {
|
|
6
|
+
NONE = 0,
|
|
7
|
+
UP = 1,
|
|
8
|
+
DOWN = 2,
|
|
9
|
+
LEFT = 3,
|
|
10
|
+
RIGHT = 4
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Class responsible for coordinating keyboard-driven moves with the workspace
|
|
14
|
+
* and dragging system.
|
|
15
|
+
*/
|
|
16
|
+
export declare class KeyboardMover {
|
|
17
|
+
/**
|
|
18
|
+
* Object responsible for dragging workspace elements in response to move
|
|
19
|
+
* commands.
|
|
20
|
+
*/
|
|
21
|
+
private dragger?;
|
|
22
|
+
/**
|
|
23
|
+
* The object that is currently being moved.
|
|
24
|
+
*/
|
|
25
|
+
private draggable?;
|
|
26
|
+
/**
|
|
27
|
+
* Workspace coordinate that the current move started from.
|
|
28
|
+
*/
|
|
29
|
+
private startLocation?;
|
|
30
|
+
/**
|
|
31
|
+
* The total distance, in workspace coordinates, that the element being moved
|
|
32
|
+
* has been moved since the movement process started.
|
|
33
|
+
*/
|
|
34
|
+
private totalDelta;
|
|
35
|
+
/**
|
|
36
|
+
* The distance to move an item in workspace coordinates.
|
|
37
|
+
*/
|
|
38
|
+
private stepDistance;
|
|
39
|
+
/**
|
|
40
|
+
* Symbol attached to the item being moved to indicate it is in move mode.
|
|
41
|
+
*/
|
|
42
|
+
private moveIndicator?;
|
|
43
|
+
private allowedShortcuts;
|
|
44
|
+
private readonly blurListener;
|
|
45
|
+
static mover: KeyboardMover;
|
|
46
|
+
private constructor();
|
|
47
|
+
/**
|
|
48
|
+
* Returns true iff the given draggable is allowed to be moved.
|
|
49
|
+
*
|
|
50
|
+
* @param draggable The draggable element to try to move.
|
|
51
|
+
* @returns True iff movement is allowed.
|
|
52
|
+
*/
|
|
53
|
+
canMove(draggable: IDraggable): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Returns true iff this Mover is currently moving an element.
|
|
56
|
+
*
|
|
57
|
+
* @returns True iff a workspace element is being moved.
|
|
58
|
+
*/
|
|
59
|
+
isMoving(): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Start moving the currently-focused item on workspace, if possible.
|
|
62
|
+
*
|
|
63
|
+
* @param draggable The element to start moving.
|
|
64
|
+
* @param event The keyboard event that triggered this move.
|
|
65
|
+
* @returns True iff a move has successfully begun.
|
|
66
|
+
*/
|
|
67
|
+
startMove(draggable: IDraggable, event?: KeyboardEvent): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Moves the current element in the given direction.
|
|
70
|
+
*
|
|
71
|
+
* @param direction The direction to move the currently-moving element.
|
|
72
|
+
* @param event The event that triggered this move, if any.
|
|
73
|
+
* @returns True iff this action applies and has been performed.
|
|
74
|
+
*/
|
|
75
|
+
move(direction: Direction, event?: KeyboardEvent | PointerEvent): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Finish moving the item that is currently being moved.
|
|
78
|
+
*
|
|
79
|
+
* @param event The event that triggered the end of the move, if any.
|
|
80
|
+
* @returns True iff move successfully finished.
|
|
81
|
+
*/
|
|
82
|
+
finishMove(event?: KeyboardEvent | PointerEvent): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Abort moving the currently-focused item on workspace.
|
|
85
|
+
*
|
|
86
|
+
* @param event The event that triggered the end of the move, if any.
|
|
87
|
+
* @returns True iff move successfully aborted.
|
|
88
|
+
*/
|
|
89
|
+
abortMove(event?: KeyboardEvent | PointerEvent): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Sets the distance by which an object will be moved.
|
|
92
|
+
*
|
|
93
|
+
* @param stepDistance The distance in workspace coordinates that each move
|
|
94
|
+
* should move elements on the workspace by.
|
|
95
|
+
*/
|
|
96
|
+
setMoveDistance(stepDistance: number): void;
|
|
97
|
+
/**
|
|
98
|
+
* Returns a list of the names of shortcuts that are allowed to be run while
|
|
99
|
+
* a keyboard-driven move is in progress.
|
|
100
|
+
*/
|
|
101
|
+
getAllowedShortcuts(): string[];
|
|
102
|
+
/**
|
|
103
|
+
* Adds shortcuts with the given names to the list of shortcuts that are
|
|
104
|
+
* allowed to be run while a keyboard-driven move is in progress.
|
|
105
|
+
*/
|
|
106
|
+
setAllowedShortcuts(shortcutNames: string[]): void;
|
|
107
|
+
/**
|
|
108
|
+
* Repositions the move indicator to the corner of the item being moved.
|
|
109
|
+
*/
|
|
110
|
+
private repositionMoveIndicator;
|
|
111
|
+
/**
|
|
112
|
+
* Returns a bounding box used for positioning the move indicator on a block.
|
|
113
|
+
* Blocks require special treatment because `BlockSvg.getBoundingRectangle()`
|
|
114
|
+
* includes the bounds of nested and subsequent blocks. Since the move
|
|
115
|
+
* indicator is positioned at the top right corner of the bounds, this can
|
|
116
|
+
* result in it appearing to float in empty space when e.g. a small block has
|
|
117
|
+
* a much wider block nested inside a statement input. BlockSvg also provides
|
|
118
|
+
* `getBoundingRectangleWithoutChildren()`, which addresses that case, but is
|
|
119
|
+
* insufficient because in the case of nested *value* blocks in a row, the
|
|
120
|
+
* child blocks' bounds should contribute to the bounding box.
|
|
121
|
+
*
|
|
122
|
+
* @param block The block to retrieve an adjusted bounding box for.
|
|
123
|
+
* @returns A bounding box for the given block whose top-right corner
|
|
124
|
+
* corresponds to the maximum visual extent of the given block's row.
|
|
125
|
+
*/
|
|
126
|
+
private positionForBlockMoveIndicator;
|
|
127
|
+
/**
|
|
128
|
+
* Common clean-up for finish/abort run before terminating the move.
|
|
129
|
+
*/
|
|
130
|
+
private preDragEndCleanup;
|
|
131
|
+
/**
|
|
132
|
+
* Common clean-up for finish/abort run after terminating the move.
|
|
133
|
+
*/
|
|
134
|
+
private postDragEndCleanup;
|
|
135
|
+
/**
|
|
136
|
+
* Returns the total distance current element has moved in pixels.
|
|
137
|
+
*/
|
|
138
|
+
private totalPixelDelta;
|
|
139
|
+
/**
|
|
140
|
+
* Scrolls the current element into view.
|
|
141
|
+
*/
|
|
142
|
+
private scrollCurrentElementIntoView;
|
|
143
|
+
/**
|
|
144
|
+
* Recalculates the total movement delta from the starting location and the
|
|
145
|
+
* current position of the item being moved.
|
|
146
|
+
*/
|
|
147
|
+
private updateTotalDelta;
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=keyboard_mover.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Raspberry Pi Foundation
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { WorkspaceSvg } from '../workspace_svg.js';
|
|
7
|
+
/**
|
|
8
|
+
* Four-way arrow indicator attached to a workspace element to indicate that it
|
|
9
|
+
* is being moved.
|
|
10
|
+
*/
|
|
11
|
+
export declare class MoveIndicator {
|
|
12
|
+
private workspace;
|
|
13
|
+
/**
|
|
14
|
+
* Root SVG element for the indicator.
|
|
15
|
+
*/
|
|
16
|
+
svgRoot: SVGGElement;
|
|
17
|
+
/**
|
|
18
|
+
* Creates a new move indicator.
|
|
19
|
+
*
|
|
20
|
+
* @param workspace The workspace the indicator should be displayed on.
|
|
21
|
+
*/
|
|
22
|
+
constructor(workspace: WorkspaceSvg);
|
|
23
|
+
/**
|
|
24
|
+
* Moves this indicator to the specified location.
|
|
25
|
+
*
|
|
26
|
+
* @param x The location on the X axis to move to.
|
|
27
|
+
* @param y The location on the Y axis to move to.
|
|
28
|
+
*/
|
|
29
|
+
moveTo(x: number, y: number): void;
|
|
30
|
+
/**
|
|
31
|
+
* Disposes of this move indicator.
|
|
32
|
+
*/
|
|
33
|
+
dispose(): void;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=move_indicator.d.ts.map
|
|
@@ -3,13 +3,9 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { BlockSvg } from '
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type { IFocusableNode } from '../interfaces/i_focusable_node.js';
|
|
10
|
-
import type { INavigationPolicy } from '../interfaces/i_navigation_policy.js';
|
|
11
|
-
import type { ISelectable } from '../interfaces/i_selectable.js';
|
|
12
|
-
import { RenderedConnection } from '../rendered_connection.js';
|
|
6
|
+
import { BlockSvg } from '../../block_svg.js';
|
|
7
|
+
import type { IFocusableNode } from '../../interfaces/i_focusable_node.js';
|
|
8
|
+
import type { INavigationPolicy } from '../../interfaces/i_navigation_policy.js';
|
|
13
9
|
/**
|
|
14
10
|
* Set of rules controlling keyboard navigation from a block.
|
|
15
11
|
*/
|
|
@@ -18,7 +14,7 @@ export declare class BlockNavigationPolicy implements INavigationPolicy<BlockSvg
|
|
|
18
14
|
* Returns the first child of the given block.
|
|
19
15
|
*
|
|
20
16
|
* @param current The block to return the first child of.
|
|
21
|
-
* @returns The first field or input of the given block, if any.
|
|
17
|
+
* @returns The first icon, field, or input of the given block, if any.
|
|
22
18
|
*/
|
|
23
19
|
getFirstChild(current: BlockSvg): IFocusableNode | null;
|
|
24
20
|
/**
|
|
@@ -33,18 +29,25 @@ export declare class BlockNavigationPolicy implements INavigationPolicy<BlockSvg
|
|
|
33
29
|
* Returns the next peer node of the given block.
|
|
34
30
|
*
|
|
35
31
|
* @param current The block to find the following element of.
|
|
36
|
-
* @returns The
|
|
37
|
-
*
|
|
32
|
+
* @returns The block's next connection, or the next peer on its parent block,
|
|
33
|
+
* otherwise null.
|
|
38
34
|
*/
|
|
39
35
|
getNextSibling(current: BlockSvg): IFocusableNode | null;
|
|
40
36
|
/**
|
|
41
37
|
* Returns the previous peer node of the given block.
|
|
42
38
|
*
|
|
43
39
|
* @param current The block to find the preceding element of.
|
|
44
|
-
* @returns The block's previous
|
|
45
|
-
*
|
|
40
|
+
* @returns The block's previous connection, or the previous peer on its
|
|
41
|
+
* parent block, otherwise null.
|
|
46
42
|
*/
|
|
47
43
|
getPreviousSibling(current: BlockSvg): IFocusableNode | null;
|
|
44
|
+
/**
|
|
45
|
+
* Returns the visual row ID of the given block.
|
|
46
|
+
*
|
|
47
|
+
* @param current The block to retrieve the row ID of.
|
|
48
|
+
* @returns The row ID of the given block.
|
|
49
|
+
*/
|
|
50
|
+
getRowId(current: BlockSvg): string;
|
|
48
51
|
/**
|
|
49
52
|
* Returns whether or not the given block can be navigated to.
|
|
50
53
|
*
|
|
@@ -60,25 +63,14 @@ export declare class BlockNavigationPolicy implements INavigationPolicy<BlockSvg
|
|
|
60
63
|
*/
|
|
61
64
|
isApplicable(current: any): current is BlockSvg;
|
|
62
65
|
}
|
|
63
|
-
/**
|
|
64
|
-
* Returns the next/previous stack relative to the given element's stack.
|
|
65
|
-
*
|
|
66
|
-
* @param current The element whose stack will be navigated relative to.
|
|
67
|
-
* @param delta The difference in index to navigate; positive values navigate
|
|
68
|
-
* to the nth next stack, while negative values navigate to the nth previous
|
|
69
|
-
* stack.
|
|
70
|
-
* @returns The first element in the stack offset by `delta` relative to the
|
|
71
|
-
* current element's stack, or the last element in the stack offset by
|
|
72
|
-
* `delta` relative to the current element's stack when navigating backwards.
|
|
73
|
-
*/
|
|
74
|
-
export declare function navigateStacks(current: ISelectable, delta: number): IFocusableNode | null;
|
|
75
66
|
/**
|
|
76
67
|
* Returns the next navigable item relative to the provided block child.
|
|
77
68
|
*
|
|
69
|
+
* @param block The block whose children should be navigated.
|
|
78
70
|
* @param current The navigable block child item to navigate relative to.
|
|
79
71
|
* @param delta The difference in index to navigate; positive values navigate
|
|
80
72
|
* forward by n, while negative values navigate backwards by n.
|
|
81
73
|
* @returns The navigable block child offset by `delta` relative to `current`.
|
|
82
74
|
*/
|
|
83
|
-
export declare function navigateBlock(
|
|
75
|
+
export declare function navigateBlock(block: BlockSvg, current: IFocusableNode, delta: number): IFocusableNode | null;
|
|
84
76
|
//# sourceMappingURL=block_navigation_policy.d.ts.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Bubble } from '../../bubbles/bubble.js';
|
|
7
|
+
import type { IFocusableNode } from '../../interfaces/i_focusable_node.js';
|
|
8
|
+
import type { INavigationPolicy } from '../../interfaces/i_navigation_policy.js';
|
|
9
|
+
/**
|
|
10
|
+
* Set of rules controlling keyboard navigation from a Bubble.
|
|
11
|
+
*/
|
|
12
|
+
export declare class BubbleNavigationPolicy implements INavigationPolicy<Bubble> {
|
|
13
|
+
/**
|
|
14
|
+
* Returns the first child of the given bubble.
|
|
15
|
+
*
|
|
16
|
+
* @param _current The bubble to return the first child of.
|
|
17
|
+
* @returns Null.
|
|
18
|
+
*/
|
|
19
|
+
getFirstChild(_current: Bubble): IFocusableNode | null;
|
|
20
|
+
/**
|
|
21
|
+
* Returns the parent of the given bubble.
|
|
22
|
+
*
|
|
23
|
+
* @param current The bubble to return the parent of.
|
|
24
|
+
* @returns The parent block of the given bubble.
|
|
25
|
+
*/
|
|
26
|
+
getParent(current: Bubble): IFocusableNode | null;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the next peer node of the given bubble.
|
|
29
|
+
*
|
|
30
|
+
* @param current The bubble to find the following element of.
|
|
31
|
+
* @returns The next navigable item on the bubble's icon's parent block.
|
|
32
|
+
*/
|
|
33
|
+
getNextSibling(current: Bubble): IFocusableNode | null;
|
|
34
|
+
/**
|
|
35
|
+
* Returns the previous peer node of the given bubble.
|
|
36
|
+
*
|
|
37
|
+
* @param current The bubble to find the preceding element of.
|
|
38
|
+
* @returns The previous navigable item on the bubble's icon's parent block.
|
|
39
|
+
*/
|
|
40
|
+
getPreviousSibling(current: Bubble): IFocusableNode | null;
|
|
41
|
+
/**
|
|
42
|
+
* Returns the row ID of the given bubble.
|
|
43
|
+
*
|
|
44
|
+
* @param current The bubble to retrieve the row ID of.
|
|
45
|
+
* @returns The row ID of the given bubble.
|
|
46
|
+
*/
|
|
47
|
+
getRowId(current: Bubble): string;
|
|
48
|
+
/**
|
|
49
|
+
* Returns whether or not the given bubble can be navigated to.
|
|
50
|
+
*
|
|
51
|
+
* @param current The instance to check for navigability.
|
|
52
|
+
* @returns True if the given bubble can be focused.
|
|
53
|
+
*/
|
|
54
|
+
isNavigable(current: Bubble): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Returns whether the given object can be navigated from by this policy.
|
|
57
|
+
*
|
|
58
|
+
* @param current The object to check if this policy applies to.
|
|
59
|
+
* @returns True if the object is an Bubble.
|
|
60
|
+
*/
|
|
61
|
+
isApplicable(current: any): current is Bubble;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=bubble_navigation_policy.d.ts.map
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { CommentBarButton } from '
|
|
7
|
-
import type { IFocusableNode } from '
|
|
8
|
-
import type { INavigationPolicy } from '
|
|
6
|
+
import { CommentBarButton } from '../../comments/comment_bar_button.js';
|
|
7
|
+
import type { IFocusableNode } from '../../interfaces/i_focusable_node.js';
|
|
8
|
+
import type { INavigationPolicy } from '../../interfaces/i_navigation_policy.js';
|
|
9
9
|
/**
|
|
10
10
|
* Set of rules controlling keyboard navigation from a CommentBarButton.
|
|
11
11
|
*/
|
|
@@ -38,6 +38,13 @@ export declare class CommentBarButtonNavigationPolicy implements INavigationPoli
|
|
|
38
38
|
* @returns The CommentBarButton's previous CommentBarButton, if any.
|
|
39
39
|
*/
|
|
40
40
|
getPreviousSibling(current: CommentBarButton): IFocusableNode | null;
|
|
41
|
+
/**
|
|
42
|
+
* Returns the row ID of the given CommentBarButton.
|
|
43
|
+
*
|
|
44
|
+
* @param current The CommentBarButton to retrieve the row ID of.
|
|
45
|
+
* @returns The row ID of the given CommentBarButton.
|
|
46
|
+
*/
|
|
47
|
+
getRowId(current: CommentBarButton): string;
|
|
41
48
|
/**
|
|
42
49
|
* Returns whether or not the given CommentBarButton can be navigated to.
|
|
43
50
|
*
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { CommentEditor } from '
|
|
7
|
-
import type { IFocusableNode } from '
|
|
8
|
-
import type { INavigationPolicy } from '
|
|
6
|
+
import { CommentEditor } from '../../comments/comment_editor.js';
|
|
7
|
+
import type { IFocusableNode } from '../../interfaces/i_focusable_node.js';
|
|
8
|
+
import type { INavigationPolicy } from '../../interfaces/i_navigation_policy.js';
|
|
9
9
|
/**
|
|
10
10
|
* Set of rules controlling keyboard navigation from a comment editor.
|
|
11
11
|
* This is a no-op placeholder (other than isNavigable/isApplicable) since
|
|
@@ -16,6 +16,13 @@ export declare class CommentEditorNavigationPolicy implements INavigationPolicy<
|
|
|
16
16
|
getParent(_current: CommentEditor): IFocusableNode | null;
|
|
17
17
|
getNextSibling(_current: CommentEditor): IFocusableNode | null;
|
|
18
18
|
getPreviousSibling(_current: CommentEditor): IFocusableNode | null;
|
|
19
|
+
/**
|
|
20
|
+
* Returns the row ID of the given comment editor.
|
|
21
|
+
*
|
|
22
|
+
* @param current The comment editor to retrieve the row ID of.
|
|
23
|
+
* @returns The row ID of the given comment editor.
|
|
24
|
+
*/
|
|
25
|
+
getRowId(current: CommentEditor): string;
|
|
19
26
|
/**
|
|
20
27
|
* Returns whether or not the given comment editor can be navigated to.
|
|
21
28
|
*
|
|
@@ -3,26 +3,24 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import
|
|
9
|
-
import { RenderedConnection } from '../rendered_connection.js';
|
|
6
|
+
import type { IFocusableNode } from '../../interfaces/i_focusable_node.js';
|
|
7
|
+
import type { INavigationPolicy } from '../../interfaces/i_navigation_policy.js';
|
|
8
|
+
import { RenderedConnection } from '../../rendered_connection.js';
|
|
10
9
|
/**
|
|
11
10
|
* Set of rules controlling keyboard navigation from a connection.
|
|
12
11
|
*/
|
|
13
12
|
export declare class ConnectionNavigationPolicy implements INavigationPolicy<RenderedConnection> {
|
|
14
13
|
/**
|
|
15
|
-
* Returns the first child of
|
|
14
|
+
* Returns the first child of a connection.
|
|
16
15
|
*
|
|
17
|
-
* @
|
|
18
|
-
* @returns The connection's first child element, or null if not none.
|
|
16
|
+
* @returns Null, as connections do not have children.
|
|
19
17
|
*/
|
|
20
|
-
getFirstChild(
|
|
18
|
+
getFirstChild(): IFocusableNode | null;
|
|
21
19
|
/**
|
|
22
20
|
* Returns the parent of the given connection.
|
|
23
21
|
*
|
|
24
22
|
* @param current The connection to return the parent of.
|
|
25
|
-
* @returns The given connection's parent
|
|
23
|
+
* @returns The given connection's parent block.
|
|
26
24
|
*/
|
|
27
25
|
getParent(current: RenderedConnection): IFocusableNode | null;
|
|
28
26
|
/**
|
|
@@ -40,15 +38,12 @@ export declare class ConnectionNavigationPolicy implements INavigationPolicy<Ren
|
|
|
40
38
|
*/
|
|
41
39
|
getPreviousSibling(current: RenderedConnection): IFocusableNode | null;
|
|
42
40
|
/**
|
|
43
|
-
*
|
|
44
|
-
* This is either an output connection, previous connection or undefined.
|
|
45
|
-
* If both connections exist return the one that is actually connected
|
|
46
|
-
* to another block.
|
|
41
|
+
* Returns the row ID of the given connection.
|
|
47
42
|
*
|
|
48
|
-
* @param
|
|
49
|
-
* @returns The
|
|
43
|
+
* @param current The connection to retrieve the row ID of.
|
|
44
|
+
* @returns The row ID of the given connection.
|
|
50
45
|
*/
|
|
51
|
-
|
|
46
|
+
getRowId(current: RenderedConnection): string;
|
|
52
47
|
/**
|
|
53
48
|
* Returns whether or not the given connection can be navigated to.
|
|
54
49
|
*
|