blockly 12.0.0-beta.4 → 12.0.0-beta.5
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 +552 -494
- package/blockly.mjs +10 -0
- package/blockly_compressed.js +517 -492
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js +2 -2
- package/blocks_compressed.js.map +1 -1
- package/core/block_svg.d.ts +36 -20
- package/core/blockly.d.ts +13 -1
- package/core/connection.d.ts +2 -0
- package/core/contextmenu_registry.d.ts +11 -9
- package/core/dialog.d.ts +36 -16
- package/core/field.d.ts +29 -31
- package/core/field_checkbox.d.ts +9 -0
- package/core/field_dropdown.d.ts +19 -2
- package/core/field_image.d.ts +9 -0
- package/core/field_label.d.ts +9 -0
- package/core/field_number.d.ts +9 -0
- package/core/field_textinput.d.ts +9 -0
- package/core/flyout_base.d.ts +23 -1
- package/core/flyout_button.d.ts +30 -7
- package/core/flyout_item.d.ts +3 -9
- package/core/flyout_separator.d.ts +18 -1
- package/core/focus_manager.d.ts +82 -14
- package/core/interfaces/i_ast_node_location_svg.d.ts +0 -12
- package/core/interfaces/i_autohideable.d.ts +2 -0
- package/core/interfaces/i_flyout.d.ts +2 -1
- package/core/interfaces/i_focusable_node.d.ts +31 -2
- package/core/interfaces/i_focusable_tree.d.ts +67 -0
- package/core/interfaces/i_navigable.d.ts +30 -0
- package/core/interfaces/i_navigation_policy.d.ts +42 -0
- package/core/interfaces/i_toolbox.d.ts +2 -1
- package/core/interfaces/i_toolbox_item.d.ts +2 -1
- package/core/keyboard_nav/ast_node.d.ts +1 -113
- package/core/keyboard_nav/block_navigation_policy.d.ts +56 -0
- package/core/keyboard_nav/connection_navigation_policy.d.ts +53 -0
- package/core/keyboard_nav/field_navigation_policy.d.ts +42 -0
- package/core/keyboard_nav/flyout_button_navigation_policy.d.ts +42 -0
- package/core/keyboard_nav/flyout_navigation_policy.d.ts +51 -0
- package/core/keyboard_nav/flyout_separator_navigation_policy.d.ts +19 -0
- package/core/keyboard_nav/line_cursor.d.ts +32 -103
- package/core/keyboard_nav/marker.d.ts +20 -29
- package/core/keyboard_nav/workspace_navigation_policy.d.ts +42 -0
- package/core/marker_manager.d.ts +0 -26
- package/core/navigator.d.ts +65 -0
- package/core/rendered_connection.d.ts +35 -1
- package/core/renderers/common/block_rendering.d.ts +1 -2
- package/core/renderers/common/drawer.d.ts +1 -1
- package/core/renderers/common/i_path_object.d.ts +1 -25
- package/core/renderers/common/path_object.d.ts +1 -26
- package/core/renderers/common/renderer.d.ts +0 -11
- package/core/renderers/zelos/drawer.d.ts +1 -1
- package/core/renderers/zelos/renderer.d.ts +0 -11
- package/core/renderers/zelos/zelos.d.ts +1 -2
- package/core/shortcut_registry.d.ts +7 -2
- package/core/toast.d.ts +74 -0
- package/core/toolbox/toolbox.d.ts +23 -1
- package/core/toolbox/toolbox_item.d.ts +9 -0
- package/core/utils/aria.d.ts +5 -2
- package/core/variable_map.d.ts +4 -4
- package/core/variables.d.ts +3 -1
- package/core/workspace.d.ts +10 -9
- package/core/workspace_svg.d.ts +103 -47
- package/index.mjs +10 -0
- package/msg/ab.js +33 -0
- package/msg/ab.mjs +33 -0
- package/msg/ace.js +33 -0
- package/msg/ace.mjs +33 -0
- package/msg/af.js +33 -0
- package/msg/af.mjs +33 -0
- package/msg/am.js +33 -0
- package/msg/am.mjs +33 -0
- package/msg/ar.js +33 -0
- package/msg/ar.mjs +33 -0
- package/msg/ast.js +33 -0
- package/msg/ast.mjs +33 -0
- package/msg/az.js +33 -0
- package/msg/az.mjs +33 -0
- package/msg/ba.js +33 -0
- package/msg/ba.mjs +33 -0
- package/msg/bcc.js +33 -0
- package/msg/bcc.mjs +33 -0
- package/msg/be-tarask.js +33 -0
- package/msg/be-tarask.mjs +33 -0
- package/msg/be.js +33 -0
- package/msg/be.mjs +33 -0
- package/msg/bg.js +33 -0
- package/msg/bg.mjs +33 -0
- package/msg/bn.js +33 -0
- package/msg/bn.mjs +33 -0
- package/msg/br.js +33 -0
- package/msg/br.mjs +33 -0
- package/msg/bs.js +33 -0
- package/msg/bs.mjs +33 -0
- package/msg/ca.js +33 -0
- package/msg/ca.mjs +33 -0
- package/msg/cdo.js +33 -0
- package/msg/cdo.mjs +33 -0
- package/msg/ce.js +33 -0
- package/msg/ce.mjs +33 -0
- package/msg/cs.js +33 -0
- package/msg/cs.mjs +33 -0
- package/msg/da.js +33 -0
- package/msg/da.mjs +33 -0
- package/msg/de.js +33 -0
- package/msg/de.mjs +33 -0
- package/msg/diq.js +33 -0
- package/msg/diq.mjs +33 -0
- package/msg/dtp.js +33 -0
- package/msg/dtp.mjs +33 -0
- package/msg/dty.js +33 -0
- package/msg/dty.mjs +33 -0
- package/msg/ee.js +33 -0
- package/msg/ee.mjs +33 -0
- package/msg/el.js +33 -0
- package/msg/el.mjs +33 -0
- package/msg/en-gb.js +33 -0
- package/msg/en-gb.mjs +33 -0
- package/msg/en.js +33 -0
- package/msg/en.mjs +33 -0
- package/msg/eo.js +33 -0
- package/msg/eo.mjs +33 -0
- package/msg/es.js +33 -0
- package/msg/es.mjs +33 -0
- package/msg/et.js +33 -0
- package/msg/et.mjs +33 -0
- package/msg/eu.js +33 -0
- package/msg/eu.mjs +33 -0
- package/msg/fa.js +33 -0
- package/msg/fa.mjs +33 -0
- package/msg/fi.js +33 -0
- package/msg/fi.mjs +33 -0
- package/msg/fo.js +33 -0
- package/msg/fo.mjs +33 -0
- package/msg/fr.js +33 -0
- package/msg/fr.mjs +33 -0
- package/msg/frr.js +33 -0
- package/msg/frr.mjs +33 -0
- package/msg/gl.js +33 -0
- package/msg/gl.mjs +33 -0
- package/msg/gn.js +33 -0
- package/msg/gn.mjs +33 -0
- package/msg/gor.js +33 -0
- package/msg/gor.mjs +33 -0
- package/msg/ha.js +33 -0
- package/msg/ha.mjs +33 -0
- package/msg/hak.js +33 -0
- package/msg/hak.mjs +33 -0
- package/msg/he.js +33 -0
- package/msg/he.mjs +33 -0
- package/msg/hi.js +33 -0
- package/msg/hi.mjs +33 -0
- package/msg/hr.js +33 -0
- package/msg/hr.mjs +33 -0
- package/msg/hrx.js +33 -0
- package/msg/hrx.mjs +33 -0
- package/msg/hsb.js +33 -0
- package/msg/hsb.mjs +33 -0
- package/msg/hu.js +33 -0
- package/msg/hu.mjs +33 -0
- package/msg/hy.js +33 -0
- package/msg/hy.mjs +33 -0
- package/msg/ia.js +33 -0
- package/msg/ia.mjs +33 -0
- package/msg/id.js +33 -0
- package/msg/id.mjs +33 -0
- package/msg/ig.js +33 -0
- package/msg/ig.mjs +33 -0
- package/msg/inh.js +33 -0
- package/msg/inh.mjs +33 -0
- package/msg/is.js +33 -0
- package/msg/is.mjs +33 -0
- package/msg/it.js +33 -0
- package/msg/it.mjs +33 -0
- package/msg/ja.js +33 -0
- package/msg/ja.mjs +33 -0
- package/msg/ka.js +33 -0
- package/msg/ka.mjs +33 -0
- package/msg/kab.js +33 -0
- package/msg/kab.mjs +33 -0
- package/msg/kbd-cyrl.js +33 -0
- package/msg/kbd-cyrl.mjs +33 -0
- package/msg/km.js +33 -0
- package/msg/km.mjs +33 -0
- package/msg/kn.js +33 -0
- package/msg/kn.mjs +33 -0
- package/msg/ko.js +33 -0
- package/msg/ko.mjs +33 -0
- package/msg/ksh.js +33 -0
- package/msg/ksh.mjs +33 -0
- package/msg/ku-latn.js +33 -0
- package/msg/ku-latn.mjs +33 -0
- package/msg/ky.js +33 -0
- package/msg/ky.mjs +33 -0
- package/msg/la.js +33 -0
- package/msg/la.mjs +33 -0
- package/msg/lb.js +33 -0
- package/msg/lb.mjs +33 -0
- package/msg/lki.js +33 -0
- package/msg/lki.mjs +33 -0
- package/msg/lo.js +33 -0
- package/msg/lo.mjs +33 -0
- package/msg/lrc.js +33 -0
- package/msg/lrc.mjs +33 -0
- package/msg/lt.js +33 -0
- package/msg/lt.mjs +33 -0
- package/msg/lv.js +33 -0
- package/msg/lv.mjs +33 -0
- package/msg/mg.js +33 -0
- package/msg/mg.mjs +33 -0
- package/msg/mk.js +33 -0
- package/msg/mk.mjs +33 -0
- package/msg/ml.js +33 -0
- package/msg/ml.mjs +33 -0
- package/msg/mnw.js +33 -0
- package/msg/mnw.mjs +33 -0
- package/msg/ms.js +33 -0
- package/msg/ms.mjs +33 -0
- package/msg/my.js +33 -0
- package/msg/my.mjs +33 -0
- package/msg/mzn.js +33 -0
- package/msg/mzn.mjs +33 -0
- package/msg/nb.js +33 -0
- package/msg/nb.mjs +33 -0
- package/msg/ne.js +33 -0
- package/msg/ne.mjs +33 -0
- package/msg/nl.js +33 -0
- package/msg/nl.mjs +33 -0
- package/msg/oc.js +33 -0
- package/msg/oc.mjs +33 -0
- package/msg/olo.js +33 -0
- package/msg/olo.mjs +33 -0
- package/msg/pa.js +33 -0
- package/msg/pa.mjs +33 -0
- package/msg/pl.js +33 -0
- package/msg/pl.mjs +33 -0
- package/msg/pms.js +33 -0
- package/msg/pms.mjs +33 -0
- package/msg/ps.js +33 -0
- package/msg/ps.mjs +33 -0
- package/msg/pt-br.js +33 -0
- package/msg/pt-br.mjs +33 -0
- package/msg/pt.js +33 -0
- package/msg/pt.mjs +33 -0
- package/msg/ro.js +33 -0
- package/msg/ro.mjs +33 -0
- package/msg/ru.js +33 -0
- package/msg/ru.mjs +33 -0
- package/msg/sc.js +33 -0
- package/msg/sc.mjs +33 -0
- package/msg/sco.js +33 -0
- package/msg/sco.mjs +33 -0
- package/msg/sd.js +33 -0
- package/msg/sd.mjs +33 -0
- package/msg/shn.js +33 -0
- package/msg/shn.mjs +33 -0
- package/msg/si.js +33 -0
- package/msg/si.mjs +33 -0
- package/msg/sk.js +33 -0
- package/msg/sk.mjs +33 -0
- package/msg/skr-arab.js +33 -0
- package/msg/skr-arab.mjs +33 -0
- package/msg/sl.js +33 -0
- package/msg/sl.mjs +33 -0
- package/msg/smn.js +33 -0
- package/msg/smn.mjs +33 -0
- package/msg/sq.js +33 -0
- package/msg/sq.mjs +33 -0
- package/msg/sr-latn.js +33 -0
- package/msg/sr-latn.mjs +33 -0
- package/msg/sr.js +33 -0
- package/msg/sr.mjs +33 -0
- package/msg/sv.js +33 -0
- package/msg/sv.mjs +33 -0
- package/msg/sw.js +33 -0
- package/msg/sw.mjs +33 -0
- package/msg/ta.js +33 -0
- package/msg/ta.mjs +33 -0
- package/msg/tcy.js +33 -0
- package/msg/tcy.mjs +33 -0
- package/msg/tdd.js +33 -0
- package/msg/tdd.mjs +33 -0
- package/msg/te.js +33 -0
- package/msg/te.mjs +33 -0
- package/msg/th.js +33 -0
- package/msg/th.mjs +33 -0
- package/msg/ti.js +33 -0
- package/msg/ti.mjs +33 -0
- package/msg/tl.js +33 -0
- package/msg/tl.mjs +33 -0
- package/msg/tlh.js +33 -0
- package/msg/tlh.mjs +33 -0
- package/msg/tr.js +33 -0
- package/msg/tr.mjs +33 -0
- package/msg/ug-arab.js +33 -0
- package/msg/ug-arab.mjs +33 -0
- package/msg/uk.js +33 -0
- package/msg/uk.mjs +33 -0
- package/msg/ur.js +33 -0
- package/msg/ur.mjs +33 -0
- package/msg/uz.js +33 -0
- package/msg/uz.mjs +33 -0
- package/msg/vi.js +33 -0
- package/msg/vi.mjs +33 -0
- package/msg/xmf.js +33 -0
- package/msg/xmf.mjs +33 -0
- package/msg/yo.js +33 -0
- package/msg/yo.mjs +33 -0
- package/msg/zgh.js +33 -0
- package/msg/zgh.mjs +33 -0
- package/msg/zh-hans.js +33 -0
- package/msg/zh-hans.mjs +33 -0
- package/msg/zh-hant.js +33 -0
- package/msg/zh-hant.mjs +33 -0
- package/package.json +4 -4
- package/core/renderers/common/marker_svg.d.ts +0 -256
- package/core/renderers/zelos/marker_svg.d.ts +0 -49
package/core/block_svg.d.ts
CHANGED
|
@@ -23,7 +23,10 @@ import { IContextMenu } from './interfaces/i_contextmenu.js';
|
|
|
23
23
|
import type { ICopyable } from './interfaces/i_copyable.js';
|
|
24
24
|
import { IDeletable } from './interfaces/i_deletable.js';
|
|
25
25
|
import type { IDragStrategy, IDraggable } from './interfaces/i_draggable.js';
|
|
26
|
+
import type { IFocusableNode } from './interfaces/i_focusable_node.js';
|
|
27
|
+
import type { IFocusableTree } from './interfaces/i_focusable_tree.js';
|
|
26
28
|
import { IIcon } from './interfaces/i_icon.js';
|
|
29
|
+
import type { INavigable } from './interfaces/i_navigable.js';
|
|
27
30
|
import { RenderedConnection } from './rendered_connection.js';
|
|
28
31
|
import type { IPathObject } from './renderers/common/i_path_object.js';
|
|
29
32
|
import type { BlockStyle } from './theme.js';
|
|
@@ -36,7 +39,7 @@ import type { WorkspaceSvg } from './workspace_svg.js';
|
|
|
36
39
|
* Class for a block's SVG representation.
|
|
37
40
|
* Not normally called directly, workspace.newBlock() is preferred.
|
|
38
41
|
*/
|
|
39
|
-
export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBoundedElement, IContextMenu, ICopyable<BlockCopyData>, IDraggable, IDeletable {
|
|
42
|
+
export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBoundedElement, IContextMenu, ICopyable<BlockCopyData>, IDraggable, IDeletable, IFocusableNode, INavigable<BlockSvg> {
|
|
40
43
|
/**
|
|
41
44
|
* Constant for identifying rows that are to be rendered inline.
|
|
42
45
|
* Don't collide with Blockly.inputTypes.
|
|
@@ -227,6 +230,12 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
227
230
|
* @param collapsed True if collapsed.
|
|
228
231
|
*/
|
|
229
232
|
setCollapsed(collapsed: boolean): void;
|
|
233
|
+
/**
|
|
234
|
+
* Traverses child blocks to see if any of them have a warning.
|
|
235
|
+
*
|
|
236
|
+
* @returns true if any child has a warning, false otherwise.
|
|
237
|
+
*/
|
|
238
|
+
private childHasWarning;
|
|
230
239
|
/**
|
|
231
240
|
* Makes sure that when the block is collapsed, it is rendered correctly
|
|
232
241
|
* for that state.
|
|
@@ -392,13 +401,15 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
392
401
|
private createIconPointerDownListener;
|
|
393
402
|
removeIcon(type: IconType<IIcon>): boolean;
|
|
394
403
|
/**
|
|
395
|
-
*
|
|
404
|
+
* Set whether the block is manually enabled or disabled.
|
|
405
|
+
*
|
|
396
406
|
* The user can toggle whether a block is disabled from a context menu
|
|
397
407
|
* option. A block may still be disabled for other reasons even if the user
|
|
398
408
|
* attempts to manually enable it, such as when the block is in an invalid
|
|
399
409
|
* location. This method is deprecated and setDisabledReason should be used
|
|
400
410
|
* instead.
|
|
401
411
|
*
|
|
412
|
+
* @deprecated v11: use setDisabledReason.
|
|
402
413
|
* @param enabled True if enabled.
|
|
403
414
|
*/
|
|
404
415
|
setEnabled(enabled: boolean): void;
|
|
@@ -665,24 +676,6 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
665
676
|
* @internal
|
|
666
677
|
*/
|
|
667
678
|
tightenChildrenEfficiently(): void;
|
|
668
|
-
/** Redraw any attached marker or cursor svgs if needed. */
|
|
669
|
-
protected updateMarkers_(): void;
|
|
670
|
-
/**
|
|
671
|
-
* Add the cursor SVG to this block's SVG group.
|
|
672
|
-
*
|
|
673
|
-
* @param cursorSvg The SVG root of the cursor to be added to the block SVG
|
|
674
|
-
* group.
|
|
675
|
-
* @internal
|
|
676
|
-
*/
|
|
677
|
-
setCursorSvg(cursorSvg: SVGElement): void;
|
|
678
|
-
/**
|
|
679
|
-
* Add the marker SVG to this block's SVG group.
|
|
680
|
-
*
|
|
681
|
-
* @param markerSvg The SVG root of the marker to be added to the block SVG
|
|
682
|
-
* group.
|
|
683
|
-
* @internal
|
|
684
|
-
*/
|
|
685
|
-
setMarkerSvg(markerSvg: SVGElement): void;
|
|
686
679
|
/**
|
|
687
680
|
* Returns a bounding box describing the dimensions of this block
|
|
688
681
|
* and any blocks stacked below it.
|
|
@@ -736,5 +729,28 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
736
729
|
*/
|
|
737
730
|
toFlyoutInfo(): FlyoutItemInfo[];
|
|
738
731
|
jsonInit(json: any): void;
|
|
732
|
+
/** See IFocusableNode.getFocusableElement. */
|
|
733
|
+
getFocusableElement(): HTMLElement | SVGElement;
|
|
734
|
+
/** See IFocusableNode.getFocusableTree. */
|
|
735
|
+
getFocusableTree(): IFocusableTree;
|
|
736
|
+
/** See IFocusableNode.onNodeFocus. */
|
|
737
|
+
onNodeFocus(): void;
|
|
738
|
+
/** See IFocusableNode.onNodeBlur. */
|
|
739
|
+
onNodeBlur(): void;
|
|
740
|
+
/**
|
|
741
|
+
* Returns whether or not this block can be navigated to via the keyboard.
|
|
742
|
+
*
|
|
743
|
+
* @returns True if this block is keyboard navigable, otherwise false.
|
|
744
|
+
*/
|
|
745
|
+
isNavigable(): boolean;
|
|
746
|
+
/**
|
|
747
|
+
* Returns this block's class.
|
|
748
|
+
*
|
|
749
|
+
* Used by keyboard navigation to look up the rules for navigating from this
|
|
750
|
+
* block.
|
|
751
|
+
*
|
|
752
|
+
* @returns This block's class.
|
|
753
|
+
*/
|
|
754
|
+
getClass(): typeof BlockSvg;
|
|
739
755
|
}
|
|
740
756
|
//# sourceMappingURL=block_svg.d.ts.map
|
package/core/blockly.d.ts
CHANGED
|
@@ -65,6 +65,7 @@ import * as inputs from './inputs.js';
|
|
|
65
65
|
import { IFlyoutInflater } from './interfaces/i_flyout_inflater.js';
|
|
66
66
|
import { LabelFlyoutInflater } from './label_flyout_inflater.js';
|
|
67
67
|
import { SeparatorFlyoutInflater } from './separator_flyout_inflater.js';
|
|
68
|
+
import { FocusableTreeTraverser } from './utils/focusable_tree_traverser.js';
|
|
68
69
|
import { Input } from './inputs/input.js';
|
|
69
70
|
import { InsertionMarkerPreviewer } from './insertion_marker_previewer.js';
|
|
70
71
|
import { IASTNodeLocation } from './interfaces/i_ast_node_location.js';
|
|
@@ -271,7 +272,18 @@ export declare const VARIABLE_DYNAMIC_CATEGORY_NAME: string;
|
|
|
271
272
|
* procedure blocks.
|
|
272
273
|
*/
|
|
273
274
|
export declare const PROCEDURE_CATEGORY_NAME: string;
|
|
275
|
+
export * from './interfaces/i_navigable.js';
|
|
276
|
+
export * from './interfaces/i_navigation_policy.js';
|
|
277
|
+
export * from './keyboard_nav/block_navigation_policy.js';
|
|
278
|
+
export * from './keyboard_nav/connection_navigation_policy.js';
|
|
279
|
+
export * from './keyboard_nav/field_navigation_policy.js';
|
|
280
|
+
export * from './keyboard_nav/flyout_button_navigation_policy.js';
|
|
281
|
+
export * from './keyboard_nav/flyout_navigation_policy.js';
|
|
282
|
+
export * from './keyboard_nav/flyout_separator_navigation_policy.js';
|
|
283
|
+
export * from './keyboard_nav/workspace_navigation_policy.js';
|
|
284
|
+
export * from './navigator.js';
|
|
285
|
+
export * from './toast.js';
|
|
274
286
|
export { ASTNode, Block, BlockSvg, BlocklyOptions, Blocks, CollapsibleToolboxCategory, ComponentManager, Connection, ConnectionChecker, ConnectionDB, ConnectionType, ContextMenu, ContextMenuItems, ContextMenuRegistry, Css, CursorOptions, DeleteArea, DragTarget, Events, Extensions, LineCursor, Procedures, ShortcutItems, Themes, Tooltip, Touch, Variables, VariablesDynamic, WidgetDiv, Xml, blockAnimations, blockRendering, browserEvents, bubbles, bumpObjects, clipboard, comments, common, constants, dialog, dragging, fieldRegistry, geras, Procedures as procedures, registry, thrasos, uiPosition, utils, zelos, };
|
|
275
287
|
export declare const DropDownDiv: typeof dropDownDiv;
|
|
276
|
-
export { BlockFlyoutInflater, ButtonFlyoutInflater, CodeGenerator, Field, FieldCheckbox, FieldCheckboxConfig, FieldCheckboxFromJsonConfig, FieldCheckboxValidator, FieldConfig, FieldDropdown, FieldDropdownConfig, FieldDropdownFromJsonConfig, FieldDropdownValidator, FieldImage, FieldImageConfig, FieldImageFromJsonConfig, FieldLabel, FieldLabelConfig, FieldLabelFromJsonConfig, FieldLabelSerializable, FieldNumber, FieldNumberConfig, FieldNumberFromJsonConfig, FieldNumberValidator, FieldTextInput, FieldTextInputConfig, FieldTextInputFromJsonConfig, FieldTextInputValidator, FieldValidator, FieldVariable, FieldVariableConfig, FieldVariableFromJsonConfig, FieldVariableValidator, Flyout, FlyoutButton, FlyoutItem, FlyoutMetricsManager, FlyoutSeparator, FocusManager, CodeGenerator as Generator, Gesture, Grid, HorizontalFlyout, IASTNodeLocation, IASTNodeLocationSvg, IASTNodeLocationWithBlock, IAutoHideable, IBoundedElement, IBubble, ICollapsibleToolboxItem, IComponent, IConnectionChecker, IConnectionPreviewer, IContextMenu, ICopyData, ICopyable, IDeletable, IDeleteArea, IDragStrategy, IDragTarget, IDraggable, IDragger, IFlyout, IFlyoutInflater, IFocusableNode, IFocusableTree, IHasBubble, IIcon, IKeyboardAccessible, IMetricsManager, IMovable, IObservable, IPaster, IPositionable, IRegistrable, IRenderedElement, ISelectable, ISelectableToolboxItem, ISerializable, IStyleable, IToolbox, IToolboxItem, IVariableBackedParameterModel, IVariableMap, IVariableModel, IVariableState, ImageProperties, Input, InsertionMarkerPreviewer, LabelFlyoutInflater, LayerManager, Marker, MarkerManager, Menu, MenuGenerator, MenuGeneratorFunction, MenuItem, MenuOption, MetricsManager, Msg, Names, Options, RenderedConnection, ReturnEphemeralFocus, Scrollbar, ScrollbarPair, SeparatorFlyoutInflater, ShortcutRegistry, Theme, ThemeManager, Toolbox, ToolboxCategory, ToolboxItem, ToolboxSeparator, Trashcan, UnattachedFieldError, VariableMap, VariableModel, VerticalFlyout, Workspace, WorkspaceAudio, WorkspaceDragger, WorkspaceSvg, ZoomControls, config, getFocusManager, hasBubble, icons, inject, inputs, isCopyable, isDeletable, isDraggable, isIcon, isObservable, isPaster, isRenderedElement, isSelectable, isSerializable, isVariableBackedParameterModel, layers, renderManagement, serialization, setLocale, };
|
|
288
|
+
export { BlockFlyoutInflater, ButtonFlyoutInflater, CodeGenerator, Field, FieldCheckbox, FieldCheckboxConfig, FieldCheckboxFromJsonConfig, FieldCheckboxValidator, FieldConfig, FieldDropdown, FieldDropdownConfig, FieldDropdownFromJsonConfig, FieldDropdownValidator, FieldImage, FieldImageConfig, FieldImageFromJsonConfig, FieldLabel, FieldLabelConfig, FieldLabelFromJsonConfig, FieldLabelSerializable, FieldNumber, FieldNumberConfig, FieldNumberFromJsonConfig, FieldNumberValidator, FieldTextInput, FieldTextInputConfig, FieldTextInputFromJsonConfig, FieldTextInputValidator, FieldValidator, FieldVariable, FieldVariableConfig, FieldVariableFromJsonConfig, FieldVariableValidator, Flyout, FlyoutButton, FlyoutItem, FlyoutMetricsManager, FlyoutSeparator, FocusManager, FocusableTreeTraverser, CodeGenerator as Generator, Gesture, Grid, HorizontalFlyout, IASTNodeLocation, IASTNodeLocationSvg, IASTNodeLocationWithBlock, IAutoHideable, IBoundedElement, IBubble, ICollapsibleToolboxItem, IComponent, IConnectionChecker, IConnectionPreviewer, IContextMenu, ICopyData, ICopyable, IDeletable, IDeleteArea, IDragStrategy, IDragTarget, IDraggable, IDragger, IFlyout, IFlyoutInflater, IFocusableNode, IFocusableTree, IHasBubble, IIcon, IKeyboardAccessible, IMetricsManager, IMovable, IObservable, IPaster, IPositionable, IRegistrable, IRenderedElement, ISelectable, ISelectableToolboxItem, ISerializable, IStyleable, IToolbox, IToolboxItem, IVariableBackedParameterModel, IVariableMap, IVariableModel, IVariableState, ImageProperties, Input, InsertionMarkerPreviewer, LabelFlyoutInflater, LayerManager, Marker, MarkerManager, Menu, MenuGenerator, MenuGeneratorFunction, MenuItem, MenuOption, MetricsManager, Msg, Names, Options, RenderedConnection, ReturnEphemeralFocus, Scrollbar, ScrollbarPair, SeparatorFlyoutInflater, ShortcutRegistry, Theme, ThemeManager, Toolbox, ToolboxCategory, ToolboxItem, ToolboxSeparator, Trashcan, UnattachedFieldError, VariableMap, VariableModel, VerticalFlyout, Workspace, WorkspaceAudio, WorkspaceDragger, WorkspaceSvg, ZoomControls, config, getFocusManager, hasBubble, icons, inject, inputs, isCopyable, isDeletable, isDraggable, isIcon, isObservable, isPaster, isRenderedElement, isSelectable, isSerializable, isVariableBackedParameterModel, layers, renderManagement, serialization, setLocale, };
|
|
277
289
|
//# sourceMappingURL=blockly.d.ts.map
|
package/core/connection.d.ts
CHANGED
|
@@ -41,6 +41,8 @@ export declare class Connection implements IASTNodeLocationWithBlock {
|
|
|
41
41
|
private check;
|
|
42
42
|
/** DOM representation of a shadow block, or null if none. */
|
|
43
43
|
private shadowDom;
|
|
44
|
+
/** The unique ID of this connection. */
|
|
45
|
+
id: string;
|
|
44
46
|
/**
|
|
45
47
|
* Horizontal location of this connection.
|
|
46
48
|
*
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { BlockSvg } from './block_svg.js';
|
|
12
12
|
import { RenderedWorkspaceComment } from './comments/rendered_workspace_comment.js';
|
|
13
|
+
import type { IFocusableNode } from './interfaces/i_focusable_node.js';
|
|
13
14
|
import { Coordinate } from './utils/coordinate.js';
|
|
14
15
|
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
15
16
|
/**
|
|
@@ -45,17 +46,16 @@ export declare class ContextMenuRegistry {
|
|
|
45
46
|
*/
|
|
46
47
|
getItem(id: string): RegistryItem | null;
|
|
47
48
|
/**
|
|
48
|
-
* Gets the valid context menu options for the given scope
|
|
49
|
-
*
|
|
49
|
+
* Gets the valid context menu options for the given scope.
|
|
50
|
+
* Options are only included if the preconditionFn shows
|
|
50
51
|
* they should not be hidden.
|
|
51
52
|
*
|
|
52
|
-
* @param scopeType Type of scope where menu should be shown (e.g. on a block
|
|
53
|
-
* or on a workspace)
|
|
54
53
|
* @param scope Current scope of context menu (i.e., the exact workspace or
|
|
55
|
-
* block being clicked on)
|
|
54
|
+
* block being clicked on).
|
|
55
|
+
* @param menuOpenEvent Event that caused the menu to open.
|
|
56
56
|
* @returns the list of ContextMenuOptions
|
|
57
57
|
*/
|
|
58
|
-
getContextMenuOptions(
|
|
58
|
+
getContextMenuOptions(scope: Scope, menuOpenEvent: Event): ContextMenuOption[];
|
|
59
59
|
}
|
|
60
60
|
export declare namespace ContextMenuRegistry {
|
|
61
61
|
/**
|
|
@@ -69,19 +69,21 @@ export declare namespace ContextMenuRegistry {
|
|
|
69
69
|
COMMENT = "comment"
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
|
-
* The actual workspace/block where the menu is being
|
|
73
|
-
* to callback and displayText functions
|
|
72
|
+
* The actual workspace/block/focused object where the menu is being
|
|
73
|
+
* rendered. This is passed to callback and displayText functions
|
|
74
|
+
* that depend on this information.
|
|
74
75
|
*/
|
|
75
76
|
export interface Scope {
|
|
76
77
|
block?: BlockSvg;
|
|
77
78
|
workspace?: WorkspaceSvg;
|
|
78
79
|
comment?: RenderedWorkspaceComment;
|
|
80
|
+
focusedNode?: IFocusableNode | any;
|
|
79
81
|
}
|
|
80
82
|
/**
|
|
81
83
|
* Fields common to all context menu registry items.
|
|
82
84
|
*/
|
|
83
85
|
interface CoreRegistryItem {
|
|
84
|
-
scopeType
|
|
86
|
+
scopeType?: ScopeType;
|
|
85
87
|
weight: number;
|
|
86
88
|
id: string;
|
|
87
89
|
}
|
package/core/dialog.d.ts
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* Copyright 2021 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
import type { ToastOptions } from './toast.js';
|
|
7
|
+
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
6
8
|
/**
|
|
7
9
|
* Wrapper to window.alert() that app developers may override via setAlert to
|
|
8
10
|
* provide alternatives to the modal browser window.
|
|
@@ -14,10 +16,11 @@ export declare function alert(message: string, opt_callback?: () => void): void;
|
|
|
14
16
|
/**
|
|
15
17
|
* Sets the function to be run when Blockly.dialog.alert() is called.
|
|
16
18
|
*
|
|
17
|
-
* @param alertFunction The function to be run
|
|
19
|
+
* @param alertFunction The function to be run, or undefined to restore the
|
|
20
|
+
* default implementation.
|
|
18
21
|
* @see Blockly.dialog.alert
|
|
19
22
|
*/
|
|
20
|
-
export declare function setAlert(alertFunction
|
|
23
|
+
export declare function setAlert(alertFunction?: (message: string, callback?: () => void) => void): void;
|
|
21
24
|
/**
|
|
22
25
|
* Wrapper to window.confirm() that app developers may override via setConfirm
|
|
23
26
|
* to provide alternatives to the modal browser window.
|
|
@@ -25,18 +28,15 @@ export declare function setAlert(alertFunction: (p1: string, p2?: () => void) =>
|
|
|
25
28
|
* @param message The message to display to the user.
|
|
26
29
|
* @param callback The callback for handling user response.
|
|
27
30
|
*/
|
|
28
|
-
export declare function confirm(message: string, callback: (
|
|
29
|
-
/**
|
|
30
|
-
* Private version of confirm for stubbing in tests.
|
|
31
|
-
*/
|
|
32
|
-
declare function confirmInternal(message: string, callback: (p1: boolean) => void): void;
|
|
31
|
+
export declare function confirm(message: string, callback: (result: boolean) => void): void;
|
|
33
32
|
/**
|
|
34
33
|
* Sets the function to be run when Blockly.dialog.confirm() is called.
|
|
35
34
|
*
|
|
36
|
-
* @param confirmFunction The function to be run
|
|
35
|
+
* @param confirmFunction The function to be run, or undefined to restore the
|
|
36
|
+
* default implementation.
|
|
37
37
|
* @see Blockly.dialog.confirm
|
|
38
38
|
*/
|
|
39
|
-
export declare function setConfirm(confirmFunction
|
|
39
|
+
export declare function setConfirm(confirmFunction?: (message: string, callback: (result: boolean) => void) => void): void;
|
|
40
40
|
/**
|
|
41
41
|
* Wrapper to window.prompt() that app developers may override via setPrompt to
|
|
42
42
|
* provide alternatives to the modal browser window. Built-in browser prompts
|
|
@@ -47,16 +47,36 @@ export declare function setConfirm(confirmFunction: (p1: string, p2: (p1: boolea
|
|
|
47
47
|
* @param defaultValue The value to initialize the prompt with.
|
|
48
48
|
* @param callback The callback for handling user response.
|
|
49
49
|
*/
|
|
50
|
-
export declare function prompt(message: string, defaultValue: string, callback: (
|
|
50
|
+
export declare function prompt(message: string, defaultValue: string, callback: (result: string | null) => void): void;
|
|
51
51
|
/**
|
|
52
52
|
* Sets the function to be run when Blockly.dialog.prompt() is called.
|
|
53
53
|
*
|
|
54
|
-
*
|
|
54
|
+
* **Important**: When overridding this, be aware that non-native prompt
|
|
55
|
+
* experiences may require managing ephemeral focus in FocusManager. This isn't
|
|
56
|
+
* needed for the native window prompt because it prevents focus from being
|
|
57
|
+
* changed while open.
|
|
58
|
+
*
|
|
59
|
+
* @param promptFunction The function to be run, or undefined to restore the
|
|
60
|
+
* default implementation.
|
|
55
61
|
* @see Blockly.dialog.prompt
|
|
56
62
|
*/
|
|
57
|
-
export declare function setPrompt(promptFunction
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
export declare function setPrompt(promptFunction?: (message: string, defaultValue: string, callback: (result: string | null) => void) => void): void;
|
|
64
|
+
/**
|
|
65
|
+
* Displays a temporary notification atop the workspace. Blockly provides a
|
|
66
|
+
* default toast implementation, but developers may provide their own via
|
|
67
|
+
* setToast. For simple appearance customization, CSS should be sufficient.
|
|
68
|
+
*
|
|
69
|
+
* @param workspace The workspace to display the toast notification atop.
|
|
70
|
+
* @param options Configuration options for the notification, including its
|
|
71
|
+
* message and duration.
|
|
72
|
+
*/
|
|
73
|
+
export declare function toast(workspace: WorkspaceSvg, options: ToastOptions): void;
|
|
74
|
+
/**
|
|
75
|
+
* Sets the function to be run when Blockly.dialog.toast() is called.
|
|
76
|
+
*
|
|
77
|
+
* @param toastFunction The function to be run, or undefined to restore the
|
|
78
|
+
* default implementation.
|
|
79
|
+
* @see Blockly.dialog.toast
|
|
80
|
+
*/
|
|
81
|
+
export declare function setToast(toastFunction?: (workspace: WorkspaceSvg, options: ToastOptions) => void): void;
|
|
62
82
|
//# sourceMappingURL=dialog.d.ts.map
|
package/core/field.d.ts
CHANGED
|
@@ -15,7 +15,10 @@ import type { Block } from './block.js';
|
|
|
15
15
|
import type { Input } from './inputs/input.js';
|
|
16
16
|
import type { IASTNodeLocationSvg } from './interfaces/i_ast_node_location_svg.js';
|
|
17
17
|
import type { IASTNodeLocationWithBlock } from './interfaces/i_ast_node_location_with_block.js';
|
|
18
|
+
import type { IFocusableNode } from './interfaces/i_focusable_node.js';
|
|
19
|
+
import type { IFocusableTree } from './interfaces/i_focusable_tree.js';
|
|
18
20
|
import type { IKeyboardAccessible } from './interfaces/i_keyboard_accessible.js';
|
|
21
|
+
import type { INavigable } from './interfaces/i_navigable.js';
|
|
19
22
|
import type { IRegistrable } from './interfaces/i_registrable.js';
|
|
20
23
|
import { ISerializable } from './interfaces/i_serializable.js';
|
|
21
24
|
import type { ConstantProvider } from './renderers/common/constants.js';
|
|
@@ -45,7 +48,7 @@ export type FieldValidator<T = any> = (newValue: T) => T | null | undefined;
|
|
|
45
48
|
*
|
|
46
49
|
* @typeParam T - The value stored on the field.
|
|
47
50
|
*/
|
|
48
|
-
export declare abstract class Field<T = any> implements IASTNodeLocationSvg, IASTNodeLocationWithBlock, IKeyboardAccessible, IRegistrable, ISerializable {
|
|
51
|
+
export declare abstract class Field<T = any> implements IASTNodeLocationSvg, IASTNodeLocationWithBlock, IKeyboardAccessible, IRegistrable, ISerializable, IFocusableNode, INavigable<Field<T>> {
|
|
49
52
|
/**
|
|
50
53
|
* To overwrite the default value which is set in **Field**, directly update
|
|
51
54
|
* the prototype.
|
|
@@ -74,16 +77,6 @@ export declare abstract class Field<T = any> implements IASTNodeLocationSvg, IAS
|
|
|
74
77
|
*/
|
|
75
78
|
private tooltip;
|
|
76
79
|
protected size_: Size;
|
|
77
|
-
/**
|
|
78
|
-
* Holds the cursors svg element when the cursor is attached to the field.
|
|
79
|
-
* This is null if there is no cursor on the field.
|
|
80
|
-
*/
|
|
81
|
-
private cursorSvg;
|
|
82
|
-
/**
|
|
83
|
-
* Holds the markers svg element when the marker is attached to the field.
|
|
84
|
-
* This is null if there is no marker on the field.
|
|
85
|
-
*/
|
|
86
|
-
private markerSvg;
|
|
87
80
|
/** The rendered field's SVG group element. */
|
|
88
81
|
protected fieldGroup_: SVGGElement | null;
|
|
89
82
|
/** The rendered field's SVG border element. */
|
|
@@ -139,6 +132,8 @@ export declare abstract class Field<T = any> implements IASTNodeLocationSvg, IAS
|
|
|
139
132
|
* case by default so that SERIALIZABLE is backwards compatible.
|
|
140
133
|
*/
|
|
141
134
|
SERIALIZABLE: boolean;
|
|
135
|
+
/** The unique ID of this field. */
|
|
136
|
+
private id_;
|
|
142
137
|
/**
|
|
143
138
|
* @param value The initial value of the field.
|
|
144
139
|
* Also accepts Field.SKIP_SETUP if you wish to skip setup (only used by
|
|
@@ -669,26 +664,14 @@ export declare abstract class Field<T = any> implements IASTNodeLocationSvg, IAS
|
|
|
669
664
|
* @returns True if the shortcut has been handled, false otherwise.
|
|
670
665
|
*/
|
|
671
666
|
onShortcut(_shortcut: KeyboardShortcut): boolean;
|
|
672
|
-
/**
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
* Add the marker SVG to this fields SVG group.
|
|
681
|
-
*
|
|
682
|
-
* @param markerSvg The SVG root of the marker to be added to the field group.
|
|
683
|
-
* @internal
|
|
684
|
-
*/
|
|
685
|
-
setMarkerSvg(markerSvg: SVGElement): void;
|
|
686
|
-
/**
|
|
687
|
-
* Redraw any attached marker or cursor svgs if needed.
|
|
688
|
-
*
|
|
689
|
-
* @internal
|
|
690
|
-
*/
|
|
691
|
-
updateMarkers_(): void;
|
|
667
|
+
/** See IFocusableNode.getFocusableElement. */
|
|
668
|
+
getFocusableElement(): HTMLElement | SVGElement;
|
|
669
|
+
/** See IFocusableNode.getFocusableTree. */
|
|
670
|
+
getFocusableTree(): IFocusableTree;
|
|
671
|
+
/** See IFocusableNode.onNodeFocus. */
|
|
672
|
+
onNodeFocus(): void;
|
|
673
|
+
/** See IFocusableNode.onNodeBlur. */
|
|
674
|
+
onNodeBlur(): void;
|
|
692
675
|
/**
|
|
693
676
|
* Subclasses should reimplement this method to construct their Field
|
|
694
677
|
* subclass from a JSON arg object.
|
|
@@ -700,6 +683,21 @@ export declare abstract class Field<T = any> implements IASTNodeLocationSvg, IAS
|
|
|
700
683
|
* to configure a specific field.
|
|
701
684
|
*/
|
|
702
685
|
static fromJson(_options: FieldConfig): Field;
|
|
686
|
+
/**
|
|
687
|
+
* Returns whether or not this field is accessible by keyboard navigation.
|
|
688
|
+
*
|
|
689
|
+
* @returns True if this field is keyboard accessible, otherwise false.
|
|
690
|
+
*/
|
|
691
|
+
isNavigable(): boolean;
|
|
692
|
+
/**
|
|
693
|
+
* Returns this field's class.
|
|
694
|
+
*
|
|
695
|
+
* Used by keyboard navigation to look up the rules for navigating from this
|
|
696
|
+
* field. Must be implemented by subclasses.
|
|
697
|
+
*
|
|
698
|
+
* @returns This field's class.
|
|
699
|
+
*/
|
|
700
|
+
abstract getClass(): new (...args: any) => Field<T>;
|
|
703
701
|
}
|
|
704
702
|
/**
|
|
705
703
|
* Extra configuration options for the base field.
|
package/core/field_checkbox.d.ts
CHANGED
|
@@ -123,6 +123,15 @@ export declare class FieldCheckbox extends Field<CheckboxBool> {
|
|
|
123
123
|
* @internal
|
|
124
124
|
*/
|
|
125
125
|
static fromJson(options: FieldCheckboxFromJsonConfig): FieldCheckbox;
|
|
126
|
+
/**
|
|
127
|
+
* Returns this field's class.
|
|
128
|
+
*
|
|
129
|
+
* Used by keyboard navigation to look up the rules for navigating from this
|
|
130
|
+
* field.
|
|
131
|
+
*
|
|
132
|
+
* @returns This field's class.
|
|
133
|
+
*/
|
|
134
|
+
getClass(): typeof FieldCheckbox;
|
|
126
135
|
}
|
|
127
136
|
/**
|
|
128
137
|
* Config options for the checkbox field.
|
package/core/field_dropdown.d.ts
CHANGED
|
@@ -144,6 +144,13 @@ export declare class FieldDropdown extends Field<string> {
|
|
|
144
144
|
* @throws {TypeError} If generated options are incorrectly structured.
|
|
145
145
|
*/
|
|
146
146
|
getOptions(useCache?: boolean): MenuOption[];
|
|
147
|
+
/**
|
|
148
|
+
* Update the options on this dropdown. This will reset the selected item to
|
|
149
|
+
* the first item in the list.
|
|
150
|
+
*
|
|
151
|
+
* @param menuGenerator The array of options or a generator function.
|
|
152
|
+
*/
|
|
153
|
+
setOptions(menuGenerator: MenuGenerator): void;
|
|
147
154
|
/**
|
|
148
155
|
* Ensure that the input value is a valid language-neutral option.
|
|
149
156
|
*
|
|
@@ -225,6 +232,15 @@ export declare class FieldDropdown extends Field<string> {
|
|
|
225
232
|
* @throws {TypeError} If proposed options are incorrectly structured.
|
|
226
233
|
*/
|
|
227
234
|
protected validateOptions(options: MenuOption[]): void;
|
|
235
|
+
/**
|
|
236
|
+
* Returns this field's class.
|
|
237
|
+
*
|
|
238
|
+
* Used by keyboard navigation to look up the rules for navigating from this
|
|
239
|
+
* field.
|
|
240
|
+
*
|
|
241
|
+
* @returns This field's class.
|
|
242
|
+
*/
|
|
243
|
+
getClass(): typeof FieldDropdown;
|
|
228
244
|
}
|
|
229
245
|
/**
|
|
230
246
|
* Definition of a human-readable image dropdown option.
|
|
@@ -239,9 +255,10 @@ export interface ImageProperties {
|
|
|
239
255
|
* An individual option in the dropdown menu. Can be either the string literal
|
|
240
256
|
* `separator` for a menu separator item, or an array for normal action menu
|
|
241
257
|
* items. In the latter case, the first element is the human-readable value
|
|
242
|
-
* (text or
|
|
258
|
+
* (text, ImageProperties object, or HTML element), and the second element is
|
|
259
|
+
* the language-neutral value.
|
|
243
260
|
*/
|
|
244
|
-
export type MenuOption = [string | ImageProperties, string] | 'separator';
|
|
261
|
+
export type MenuOption = [string | ImageProperties | HTMLElement, string] | 'separator';
|
|
245
262
|
/**
|
|
246
263
|
* A function that generates an array of menu options for FieldDropdown
|
|
247
264
|
* or its descendants.
|
package/core/field_image.d.ts
CHANGED
|
@@ -125,6 +125,15 @@ export declare class FieldImage extends Field<string> {
|
|
|
125
125
|
* @internal
|
|
126
126
|
*/
|
|
127
127
|
static fromJson(options: FieldImageFromJsonConfig): FieldImage;
|
|
128
|
+
/**
|
|
129
|
+
* Returns this field's class.
|
|
130
|
+
*
|
|
131
|
+
* Used by keyboard navigation to look up the rules for navigating from this
|
|
132
|
+
* field.
|
|
133
|
+
*
|
|
134
|
+
* @returns This field's class.
|
|
135
|
+
*/
|
|
136
|
+
getClass(): typeof FieldImage;
|
|
128
137
|
}
|
|
129
138
|
/**
|
|
130
139
|
* Config options for the image field.
|
package/core/field_label.d.ts
CHANGED
|
@@ -64,6 +64,15 @@ export declare class FieldLabel extends Field<string> {
|
|
|
64
64
|
* @internal
|
|
65
65
|
*/
|
|
66
66
|
static fromJson(options: FieldLabelFromJsonConfig): FieldLabel;
|
|
67
|
+
/**
|
|
68
|
+
* Returns this field's class.
|
|
69
|
+
*
|
|
70
|
+
* Used by keyboard navigation to look up the rules for navigating from this
|
|
71
|
+
* field.
|
|
72
|
+
*
|
|
73
|
+
* @returns This field's class.
|
|
74
|
+
*/
|
|
75
|
+
getClass(): typeof FieldLabel;
|
|
67
76
|
}
|
|
68
77
|
/**
|
|
69
78
|
* Config options for the label field.
|
package/core/field_number.d.ts
CHANGED
|
@@ -160,6 +160,15 @@ export declare class FieldNumber extends FieldInput<number> {
|
|
|
160
160
|
* @internal
|
|
161
161
|
*/
|
|
162
162
|
static fromJson(options: FieldNumberFromJsonConfig): FieldNumber;
|
|
163
|
+
/**
|
|
164
|
+
* Returns this field's class.
|
|
165
|
+
*
|
|
166
|
+
* Used by keyboard navigation to look up the rules for navigating from this
|
|
167
|
+
* field.
|
|
168
|
+
*
|
|
169
|
+
* @returns This field's class.
|
|
170
|
+
*/
|
|
171
|
+
getClass(): typeof FieldNumber;
|
|
163
172
|
}
|
|
164
173
|
/**
|
|
165
174
|
* Config options for the number field.
|
|
@@ -48,6 +48,15 @@ export declare class FieldTextInput extends FieldInput<string> {
|
|
|
48
48
|
* @internal
|
|
49
49
|
*/
|
|
50
50
|
static fromJson(options: FieldTextInputFromJsonConfig): FieldTextInput;
|
|
51
|
+
/**
|
|
52
|
+
* Returns this field's class.
|
|
53
|
+
*
|
|
54
|
+
* Used by keyboard navigation to look up the rules for navigating from this
|
|
55
|
+
* field.
|
|
56
|
+
*
|
|
57
|
+
* @returns This field's class.
|
|
58
|
+
*/
|
|
59
|
+
getClass(): typeof FieldTextInput;
|
|
51
60
|
}
|
|
52
61
|
/**
|
|
53
62
|
* Config options for the text input field.
|
package/core/flyout_base.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ import { FlyoutItem } from './flyout_item.js';
|
|
|
14
14
|
import { IAutoHideable } from './interfaces/i_autohideable.js';
|
|
15
15
|
import type { IFlyout } from './interfaces/i_flyout.js';
|
|
16
16
|
import type { IFlyoutInflater } from './interfaces/i_flyout_inflater.js';
|
|
17
|
+
import { IFocusableNode } from './interfaces/i_focusable_node.js';
|
|
18
|
+
import { IFocusableTree } from './interfaces/i_focusable_tree.js';
|
|
17
19
|
import type { Options } from './options.js';
|
|
18
20
|
import * as blocks from './serialization/blocks.js';
|
|
19
21
|
import { Coordinate } from './utils/coordinate.js';
|
|
@@ -23,7 +25,7 @@ import { WorkspaceSvg } from './workspace_svg.js';
|
|
|
23
25
|
/**
|
|
24
26
|
* Class for a flyout.
|
|
25
27
|
*/
|
|
26
|
-
export declare abstract class Flyout extends DeleteArea implements IAutoHideable, IFlyout {
|
|
28
|
+
export declare abstract class Flyout extends DeleteArea implements IAutoHideable, IFlyout, IFocusableNode {
|
|
27
29
|
/**
|
|
28
30
|
* Position the flyout.
|
|
29
31
|
*/
|
|
@@ -399,5 +401,25 @@ export declare abstract class Flyout extends DeleteArea implements IAutoHideable
|
|
|
399
401
|
* is registered for that type.
|
|
400
402
|
*/
|
|
401
403
|
protected getInflaterForType(type: string): IFlyoutInflater | null;
|
|
404
|
+
/** See IFocusableNode.getFocusableElement. */
|
|
405
|
+
getFocusableElement(): HTMLElement | SVGElement;
|
|
406
|
+
/** See IFocusableNode.getFocusableTree. */
|
|
407
|
+
getFocusableTree(): IFocusableTree;
|
|
408
|
+
/** See IFocusableNode.onNodeFocus. */
|
|
409
|
+
onNodeFocus(): void;
|
|
410
|
+
/** See IFocusableNode.onNodeBlur. */
|
|
411
|
+
onNodeBlur(): void;
|
|
412
|
+
/** See IFocusableTree.getRootFocusableNode. */
|
|
413
|
+
getRootFocusableNode(): IFocusableNode;
|
|
414
|
+
/** See IFocusableTree.getRestoredFocusableNode. */
|
|
415
|
+
getRestoredFocusableNode(_previousNode: IFocusableNode | null): IFocusableNode | null;
|
|
416
|
+
/** See IFocusableTree.getNestedTrees. */
|
|
417
|
+
getNestedTrees(): Array<IFocusableTree>;
|
|
418
|
+
/** See IFocusableTree.lookUpFocusableNode. */
|
|
419
|
+
lookUpFocusableNode(_id: string): IFocusableNode | null;
|
|
420
|
+
/** See IFocusableTree.onTreeFocus. */
|
|
421
|
+
onTreeFocus(_node: IFocusableNode, _previousTree: IFocusableTree | null): void;
|
|
422
|
+
/** See IFocusableTree.onTreeBlur. */
|
|
423
|
+
onTreeBlur(nextTree: IFocusableTree | null): void;
|
|
402
424
|
}
|
|
403
425
|
//# sourceMappingURL=flyout_base.d.ts.map
|
package/core/flyout_button.d.ts
CHANGED
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { IASTNodeLocationSvg } from './blockly.js';
|
|
12
12
|
import type { IBoundedElement } from './interfaces/i_bounded_element.js';
|
|
13
|
+
import type { IFocusableNode } from './interfaces/i_focusable_node.js';
|
|
14
|
+
import type { IFocusableTree } from './interfaces/i_focusable_tree.js';
|
|
15
|
+
import type { INavigable } from './interfaces/i_navigable.js';
|
|
13
16
|
import type { IRenderedElement } from './interfaces/i_rendered_element.js';
|
|
14
17
|
import { Coordinate } from './utils/coordinate.js';
|
|
15
18
|
import { Rect } from './utils/rect.js';
|
|
@@ -18,7 +21,7 @@ import type { WorkspaceSvg } from './workspace_svg.js';
|
|
|
18
21
|
/**
|
|
19
22
|
* Class for a button or label in the flyout.
|
|
20
23
|
*/
|
|
21
|
-
export declare class FlyoutButton implements IASTNodeLocationSvg, IBoundedElement, IRenderedElement {
|
|
24
|
+
export declare class FlyoutButton implements IASTNodeLocationSvg, IBoundedElement, IRenderedElement, IFocusableNode, INavigable<FlyoutButton> {
|
|
22
25
|
private readonly workspace;
|
|
23
26
|
private readonly targetWorkspace;
|
|
24
27
|
private readonly isFlyoutLabel;
|
|
@@ -49,6 +52,8 @@ export declare class FlyoutButton implements IASTNodeLocationSvg, IBoundedElemen
|
|
|
49
52
|
* This is null if there is no cursor on the button.
|
|
50
53
|
*/
|
|
51
54
|
cursorSvg: SVGElement | null;
|
|
55
|
+
/** The unique ID for this FlyoutButton. */
|
|
56
|
+
private id;
|
|
52
57
|
/**
|
|
53
58
|
* @param workspace The workspace in which to place this button.
|
|
54
59
|
* @param targetWorkspace The flyout's target workspace.
|
|
@@ -116,12 +121,6 @@ export declare class FlyoutButton implements IASTNodeLocationSvg, IBoundedElemen
|
|
|
116
121
|
* group.
|
|
117
122
|
*/
|
|
118
123
|
setCursorSvg(cursorSvg: SVGElement): void;
|
|
119
|
-
/**
|
|
120
|
-
* Required by IASTNodeLocationSvg, but not used. A marker cannot be set on a
|
|
121
|
-
* button. If the 'mark' shortcut is used on a button, its associated callback
|
|
122
|
-
* function is triggered.
|
|
123
|
-
*/
|
|
124
|
-
setMarkerSvg(): void;
|
|
125
124
|
/**
|
|
126
125
|
* Do something when the button is clicked.
|
|
127
126
|
*
|
|
@@ -133,5 +132,29 @@ export declare class FlyoutButton implements IASTNodeLocationSvg, IBoundedElemen
|
|
|
133
132
|
* @returns The root SVG element of this rendered element.
|
|
134
133
|
*/
|
|
135
134
|
getSvgRoot(): SVGGElement;
|
|
135
|
+
/** See IFocusableNode.getFocusableElement. */
|
|
136
|
+
getFocusableElement(): HTMLElement | SVGElement;
|
|
137
|
+
/** See IFocusableNode.getFocusableTree. */
|
|
138
|
+
getFocusableTree(): IFocusableTree;
|
|
139
|
+
/** See IFocusableNode.onNodeFocus. */
|
|
140
|
+
onNodeFocus(): void;
|
|
141
|
+
/** See IFocusableNode.onNodeBlur. */
|
|
142
|
+
onNodeBlur(): void;
|
|
143
|
+
/**
|
|
144
|
+
* Returns whether or not this button is accessible through keyboard
|
|
145
|
+
* navigation.
|
|
146
|
+
*
|
|
147
|
+
* @returns True if this button is keyboard accessible, otherwise false.
|
|
148
|
+
*/
|
|
149
|
+
isNavigable(): boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Returns this button's class.
|
|
152
|
+
*
|
|
153
|
+
* Used by keyboard navigation to look up the rules for navigating from this
|
|
154
|
+
* button.
|
|
155
|
+
*
|
|
156
|
+
* @returns This button's class.
|
|
157
|
+
*/
|
|
158
|
+
getClass(): typeof FlyoutButton;
|
|
136
159
|
}
|
|
137
160
|
//# sourceMappingURL=flyout_button.d.ts.map
|