blockly 12.0.0-beta.3 → 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 +565 -503
- package/blockly.mjs +10 -0
- package/blockly_compressed.js +530 -501
- 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 +53 -23
- package/core/blockly.d.ts +13 -1
- package/core/comments/rendered_workspace_comment.d.ts +1 -1
- package/core/connection.d.ts +2 -0
- package/core/contextmenu.d.ts +6 -2
- package/core/contextmenu_registry.d.ts +21 -16
- 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 +60 -96
- 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/menuitem.d.ts +5 -2
- 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 +105 -48
- 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
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import './events/events_selected.js';
|
|
12
12
|
import { Block } from './block.js';
|
|
13
|
-
import { IDeletable } from './blockly.js';
|
|
14
13
|
import { BlockCopyData } from './clipboard/block_paster.js';
|
|
15
14
|
import type { Connection } from './connection.js';
|
|
16
15
|
import { ConnectionType } from './connection_type.js';
|
|
@@ -20,9 +19,14 @@ import { MutatorIcon } from './icons/mutator_icon.js';
|
|
|
20
19
|
import type { Input } from './inputs/input.js';
|
|
21
20
|
import type { IASTNodeLocationSvg } from './interfaces/i_ast_node_location_svg.js';
|
|
22
21
|
import type { IBoundedElement } from './interfaces/i_bounded_element.js';
|
|
22
|
+
import { IContextMenu } from './interfaces/i_contextmenu.js';
|
|
23
23
|
import type { ICopyable } from './interfaces/i_copyable.js';
|
|
24
|
+
import { IDeletable } from './interfaces/i_deletable.js';
|
|
24
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';
|
|
25
28
|
import { IIcon } from './interfaces/i_icon.js';
|
|
29
|
+
import type { INavigable } from './interfaces/i_navigable.js';
|
|
26
30
|
import { RenderedConnection } from './rendered_connection.js';
|
|
27
31
|
import type { IPathObject } from './renderers/common/i_path_object.js';
|
|
28
32
|
import type { BlockStyle } from './theme.js';
|
|
@@ -35,7 +39,7 @@ import type { WorkspaceSvg } from './workspace_svg.js';
|
|
|
35
39
|
* Class for a block's SVG representation.
|
|
36
40
|
* Not normally called directly, workspace.newBlock() is preferred.
|
|
37
41
|
*/
|
|
38
|
-
export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBoundedElement, ICopyable<BlockCopyData>, IDraggable, IDeletable {
|
|
42
|
+
export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBoundedElement, IContextMenu, ICopyable<BlockCopyData>, IDraggable, IDeletable, IFocusableNode, INavigable<BlockSvg> {
|
|
39
43
|
/**
|
|
40
44
|
* Constant for identifying rows that are to be rendered inline.
|
|
41
45
|
* Don't collide with Blockly.inputTypes.
|
|
@@ -226,6 +230,12 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
226
230
|
* @param collapsed True if collapsed.
|
|
227
231
|
*/
|
|
228
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;
|
|
229
239
|
/**
|
|
230
240
|
* Makes sure that when the block is collapsed, it is rendered correctly
|
|
231
241
|
* for that state.
|
|
@@ -248,14 +258,20 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
248
258
|
*
|
|
249
259
|
* @returns Context menu options or null if no menu.
|
|
250
260
|
*/
|
|
251
|
-
protected generateContextMenu(): Array<ContextMenuOption | LegacyContextMenuOption> | null;
|
|
261
|
+
protected generateContextMenu(e: Event): Array<ContextMenuOption | LegacyContextMenuOption> | null;
|
|
262
|
+
/**
|
|
263
|
+
* Gets the location in which to show the context menu for this block.
|
|
264
|
+
* Use the location of a click if the block was clicked, or a location
|
|
265
|
+
* based on the block's fields otherwise.
|
|
266
|
+
*/
|
|
267
|
+
protected calculateContextMenuLocation(e: Event): Coordinate;
|
|
252
268
|
/**
|
|
253
269
|
* Show the context menu for this block.
|
|
254
270
|
*
|
|
255
271
|
* @param e Mouse event.
|
|
256
272
|
* @internal
|
|
257
273
|
*/
|
|
258
|
-
showContextMenu(e:
|
|
274
|
+
showContextMenu(e: Event): void;
|
|
259
275
|
/**
|
|
260
276
|
* Updates the locations of any parts of the block that need to know where
|
|
261
277
|
* they are (e.g. connections, icons).
|
|
@@ -385,13 +401,15 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
385
401
|
private createIconPointerDownListener;
|
|
386
402
|
removeIcon(type: IconType<IIcon>): boolean;
|
|
387
403
|
/**
|
|
388
|
-
*
|
|
404
|
+
* Set whether the block is manually enabled or disabled.
|
|
405
|
+
*
|
|
389
406
|
* The user can toggle whether a block is disabled from a context menu
|
|
390
407
|
* option. A block may still be disabled for other reasons even if the user
|
|
391
408
|
* attempts to manually enable it, such as when the block is in an invalid
|
|
392
409
|
* location. This method is deprecated and setDisabledReason should be used
|
|
393
410
|
* instead.
|
|
394
411
|
*
|
|
412
|
+
* @deprecated v11: use setDisabledReason.
|
|
395
413
|
* @param enabled True if enabled.
|
|
396
414
|
*/
|
|
397
415
|
setEnabled(enabled: boolean): void;
|
|
@@ -658,24 +676,6 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
658
676
|
* @internal
|
|
659
677
|
*/
|
|
660
678
|
tightenChildrenEfficiently(): void;
|
|
661
|
-
/** Redraw any attached marker or cursor svgs if needed. */
|
|
662
|
-
protected updateMarkers_(): void;
|
|
663
|
-
/**
|
|
664
|
-
* Add the cursor SVG to this block's SVG group.
|
|
665
|
-
*
|
|
666
|
-
* @param cursorSvg The SVG root of the cursor to be added to the block SVG
|
|
667
|
-
* group.
|
|
668
|
-
* @internal
|
|
669
|
-
*/
|
|
670
|
-
setCursorSvg(cursorSvg: SVGElement): void;
|
|
671
|
-
/**
|
|
672
|
-
* Add the marker SVG to this block's SVG group.
|
|
673
|
-
*
|
|
674
|
-
* @param markerSvg The SVG root of the marker to be added to the block SVG
|
|
675
|
-
* group.
|
|
676
|
-
* @internal
|
|
677
|
-
*/
|
|
678
|
-
setMarkerSvg(markerSvg: SVGElement): void;
|
|
679
679
|
/**
|
|
680
680
|
* Returns a bounding box describing the dimensions of this block
|
|
681
681
|
* and any blocks stacked below it.
|
|
@@ -705,6 +705,13 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
705
705
|
* @internal
|
|
706
706
|
*/
|
|
707
707
|
highlightShapeForInput(conn: RenderedConnection, add: boolean): void;
|
|
708
|
+
/**
|
|
709
|
+
* Returns the drag strategy currently in use by this block.
|
|
710
|
+
*
|
|
711
|
+
* @internal
|
|
712
|
+
* @returns This block's drag strategy.
|
|
713
|
+
*/
|
|
714
|
+
getDragStrategy(): IDragStrategy;
|
|
708
715
|
/** Sets the drag strategy for this block. */
|
|
709
716
|
setDragStrategy(dragStrategy: IDragStrategy): void;
|
|
710
717
|
/** Returns whether this block is movable or not. */
|
|
@@ -722,5 +729,28 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
722
729
|
*/
|
|
723
730
|
toFlyoutInfo(): FlyoutItemInfo[];
|
|
724
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;
|
|
725
755
|
}
|
|
726
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
|
|
@@ -95,7 +95,7 @@ export declare class RenderedWorkspaceComment extends WorkspaceComment implement
|
|
|
95
95
|
*/
|
|
96
96
|
toCopyData(): WorkspaceCommentCopyData | null;
|
|
97
97
|
/** Show a context menu for this comment. */
|
|
98
|
-
showContextMenu(e:
|
|
98
|
+
showContextMenu(e: Event): void;
|
|
99
99
|
/** Snap this comment to the nearest grid point. */
|
|
100
100
|
snapToGrid(): void;
|
|
101
101
|
}
|
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
|
*
|
package/core/contextmenu.d.ts
CHANGED
|
@@ -7,9 +7,12 @@ import type { Block } from './block.js';
|
|
|
7
7
|
import type { BlockSvg } from './block_svg.js';
|
|
8
8
|
import type { ContextMenuOption, LegacyContextMenuOption } from './contextmenu_registry.js';
|
|
9
9
|
import * as serializationBlocks from './serialization/blocks.js';
|
|
10
|
+
import { Coordinate } from './utils/coordinate.js';
|
|
10
11
|
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
11
12
|
/**
|
|
12
13
|
* Gets the block the context menu is currently attached to.
|
|
14
|
+
* It is not recommended that you use this function; instead,
|
|
15
|
+
* use the scope object passed to the context menu callback.
|
|
13
16
|
*
|
|
14
17
|
* @returns The block the context menu is attached to.
|
|
15
18
|
*/
|
|
@@ -23,12 +26,13 @@ export declare function setCurrentBlock(block: Block | null): void;
|
|
|
23
26
|
/**
|
|
24
27
|
* Construct the menu based on the list of options and show the menu.
|
|
25
28
|
*
|
|
26
|
-
* @param
|
|
29
|
+
* @param menuOpenEvent Event that caused the menu to open.
|
|
27
30
|
* @param options Array of menu options.
|
|
28
31
|
* @param rtl True if RTL, false if LTR.
|
|
29
32
|
* @param workspace The workspace associated with the context menu, if any.
|
|
33
|
+
* @param location The screen coordinates at which to show the menu.
|
|
30
34
|
*/
|
|
31
|
-
export declare function show(
|
|
35
|
+
export declare function show(menuOpenEvent: Event, options: (ContextMenuOption | LegacyContextMenuOption)[], rtl: boolean, workspace?: WorkspaceSvg, location?: Coordinate): void;
|
|
32
36
|
/**
|
|
33
37
|
* Hide the context menu.
|
|
34
38
|
*/
|
|
@@ -10,6 +10,8 @@
|
|
|
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';
|
|
14
|
+
import { Coordinate } from './utils/coordinate.js';
|
|
13
15
|
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
14
16
|
/**
|
|
15
17
|
* Class for the registry of context menu items. This is intended to be a
|
|
@@ -44,17 +46,16 @@ export declare class ContextMenuRegistry {
|
|
|
44
46
|
*/
|
|
45
47
|
getItem(id: string): RegistryItem | null;
|
|
46
48
|
/**
|
|
47
|
-
* Gets the valid context menu options for the given scope
|
|
48
|
-
*
|
|
49
|
+
* Gets the valid context menu options for the given scope.
|
|
50
|
+
* Options are only included if the preconditionFn shows
|
|
49
51
|
* they should not be hidden.
|
|
50
52
|
*
|
|
51
|
-
* @param scopeType Type of scope where menu should be shown (e.g. on a block
|
|
52
|
-
* or on a workspace)
|
|
53
53
|
* @param scope Current scope of context menu (i.e., the exact workspace or
|
|
54
|
-
* block being clicked on)
|
|
54
|
+
* block being clicked on).
|
|
55
|
+
* @param menuOpenEvent Event that caused the menu to open.
|
|
55
56
|
* @returns the list of ContextMenuOptions
|
|
56
57
|
*/
|
|
57
|
-
getContextMenuOptions(
|
|
58
|
+
getContextMenuOptions(scope: Scope, menuOpenEvent: Event): ContextMenuOption[];
|
|
58
59
|
}
|
|
59
60
|
export declare namespace ContextMenuRegistry {
|
|
60
61
|
/**
|
|
@@ -68,19 +69,21 @@ export declare namespace ContextMenuRegistry {
|
|
|
68
69
|
COMMENT = "comment"
|
|
69
70
|
}
|
|
70
71
|
/**
|
|
71
|
-
* The actual workspace/block where the menu is being
|
|
72
|
-
* 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.
|
|
73
75
|
*/
|
|
74
76
|
export interface Scope {
|
|
75
77
|
block?: BlockSvg;
|
|
76
78
|
workspace?: WorkspaceSvg;
|
|
77
79
|
comment?: RenderedWorkspaceComment;
|
|
80
|
+
focusedNode?: IFocusableNode | any;
|
|
78
81
|
}
|
|
79
82
|
/**
|
|
80
83
|
* Fields common to all context menu registry items.
|
|
81
84
|
*/
|
|
82
85
|
interface CoreRegistryItem {
|
|
83
|
-
scopeType
|
|
86
|
+
scopeType?: ScopeType;
|
|
84
87
|
weight: number;
|
|
85
88
|
id: string;
|
|
86
89
|
}
|
|
@@ -91,12 +94,13 @@ export declare namespace ContextMenuRegistry {
|
|
|
91
94
|
/**
|
|
92
95
|
* @param scope Object that provides a reference to the thing that had its
|
|
93
96
|
* context menu opened.
|
|
94
|
-
* @param
|
|
95
|
-
*
|
|
97
|
+
* @param menuOpenEvent The original event that triggered the context menu to open.
|
|
98
|
+
* @param menuSelectEvent The event that triggered the option being selected.
|
|
99
|
+
* @param location The location in screen coordinates where the menu was opened.
|
|
96
100
|
*/
|
|
97
|
-
callback: (scope: Scope,
|
|
101
|
+
callback: (scope: Scope, menuOpenEvent: Event, menuSelectEvent: Event, location: Coordinate) => void;
|
|
98
102
|
displayText: ((p1: Scope) => string | HTMLElement) | string | HTMLElement;
|
|
99
|
-
preconditionFn: (p1: Scope) => string;
|
|
103
|
+
preconditionFn: (p1: Scope, menuOpenEvent: Event) => string;
|
|
100
104
|
separator?: never;
|
|
101
105
|
}
|
|
102
106
|
/**
|
|
@@ -128,10 +132,11 @@ export declare namespace ContextMenuRegistry {
|
|
|
128
132
|
/**
|
|
129
133
|
* @param scope Object that provides a reference to the thing that had its
|
|
130
134
|
* context menu opened.
|
|
131
|
-
* @param
|
|
132
|
-
*
|
|
135
|
+
* @param menuOpenEvent The original event that triggered the context menu to open.
|
|
136
|
+
* @param menuSelectEvent The event that triggered the option being selected.
|
|
137
|
+
* @param location The location in screen coordinates where the menu was opened.
|
|
133
138
|
*/
|
|
134
|
-
callback: (scope: Scope,
|
|
139
|
+
callback: (scope: Scope, menuOpenEvent: Event, menuSelectEvent: Event, location: Coordinate) => void;
|
|
135
140
|
separator?: never;
|
|
136
141
|
}
|
|
137
142
|
/**
|
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.
|