blockly 12.0.0-beta.0 → 12.0.0-beta.2
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 +384 -370
- package/blockly.mjs +1 -0
- package/blockly_compressed.js +364 -350
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js +5 -5
- package/blocks_compressed.js.map +1 -1
- package/core/block.d.ts +8 -3
- package/core/block_flyout_inflater.d.ts +15 -10
- package/core/block_svg.d.ts +8 -2
- package/core/blockly.d.ts +5 -2
- package/core/bubbles/text_bubble.d.ts +5 -5
- package/core/button_flyout_inflater.d.ts +13 -7
- package/core/comments/comment_view.d.ts +3 -3
- package/core/connection.d.ts +1 -1
- package/core/contextmenu_registry.d.ts +51 -11
- package/core/dragging/block_drag_strategy.d.ts +2 -2
- package/core/dragging/bubble_drag_strategy.d.ts +0 -2
- package/core/dragging/comment_drag_strategy.d.ts +0 -2
- package/core/events/events_var_delete.d.ts +0 -2
- package/core/events/events_var_rename.d.ts +0 -2
- package/core/field.d.ts +0 -2
- package/core/field_dropdown.d.ts +7 -9
- package/core/flyout_base.d.ts +1 -8
- package/core/flyout_horizontal.d.ts +2 -1
- package/core/flyout_item.d.ts +32 -0
- package/core/flyout_vertical.d.ts +2 -1
- package/core/interfaces/i_flyout.d.ts +1 -1
- package/core/interfaces/i_flyout_inflater.d.ts +15 -6
- package/core/interfaces/i_focusable_node.d.ts +34 -0
- package/core/interfaces/i_focusable_tree.d.ts +48 -0
- package/core/interfaces/i_metrics_manager.d.ts +1 -1
- package/core/interfaces/i_rendered_element.d.ts +1 -4
- package/core/keyboard_nav/marker.d.ts +4 -8
- package/core/label_flyout_inflater.d.ts +13 -7
- package/core/menu.d.ts +30 -26
- package/core/menu_separator.d.ts +25 -0
- package/core/menuitem.d.ts +7 -0
- package/core/metrics_manager.d.ts +1 -1
- package/core/procedures.d.ts +7 -4
- package/core/renderers/common/marker_svg.d.ts +2 -2
- package/core/renderers/common/renderer.d.ts +1 -1
- package/core/renderers/measurables/in_row_spacer.d.ts +1 -0
- package/core/renderers/measurables/jagged_edge.d.ts +1 -0
- package/core/renderers/measurables/next_connection.d.ts +1 -0
- package/core/renderers/measurables/previous_connection.d.ts +1 -0
- package/core/renderers/measurables/round_corner.d.ts +1 -0
- package/core/renderers/measurables/square_corner.d.ts +1 -0
- package/core/renderers/measurables/statement_input.d.ts +1 -0
- package/core/renderers/measurables/types.d.ts +49 -24
- package/core/separator_flyout_inflater.d.ts +17 -7
- package/core/utils/aria.d.ts +2 -1
- package/core/utils/toolbox.d.ts +0 -2
- package/core/variables.d.ts +18 -4
- package/core/variables_dynamic.d.ts +7 -5
- package/core/workspace.d.ts +13 -0
- package/core/workspace_svg.d.ts +2 -0
- package/dart_compressed.js +1 -1
- package/dart_compressed.js.map +1 -1
- package/index.mjs +1 -0
- package/javascript_compressed.js +15 -15
- package/javascript_compressed.js.map +1 -1
- package/lua_compressed.js +1 -1
- package/lua_compressed.js.map +1 -1
- package/media/1x1.gif +0 -0
- package/media/click.mp3 +0 -0
- package/media/click.ogg +0 -0
- package/media/click.wav +0 -0
- package/media/delete.mp3 +0 -0
- package/media/delete.ogg +0 -0
- package/media/delete.wav +0 -0
- package/media/disconnect.mp3 +0 -0
- package/media/disconnect.ogg +0 -0
- package/media/disconnect.wav +0 -0
- package/media/handclosed.cur +0 -0
- package/media/handdelete.cur +0 -0
- package/media/handopen.cur +0 -0
- package/media/pilcrow.png +0 -0
- package/media/quote0.png +0 -0
- package/media/quote1.png +0 -0
- package/media/sprites.png +0 -0
- package/package.json +2 -2
- package/php_compressed.js +1 -1
- package/php_compressed.js.map +1 -1
- package/python_compressed.js +3 -3
- package/python_compressed.js.map +1 -1
package/core/block.d.ts
CHANGED
|
@@ -540,6 +540,12 @@ export declare class Block implements IASTNodeLocation {
|
|
|
540
540
|
* @returns Named field, or null if field does not exist.
|
|
541
541
|
*/
|
|
542
542
|
getField(name: string): Field | null;
|
|
543
|
+
/**
|
|
544
|
+
* Returns a generator that provides every field on the block.
|
|
545
|
+
*
|
|
546
|
+
* @yields A generator that can be used to iterate the fields on the block.
|
|
547
|
+
*/
|
|
548
|
+
getFields(): Generator<Field>;
|
|
543
549
|
/**
|
|
544
550
|
* Return all variables referenced by this block.
|
|
545
551
|
*
|
|
@@ -641,9 +647,8 @@ export declare class Block implements IASTNodeLocation {
|
|
|
641
647
|
* @returns True if enabled.
|
|
642
648
|
*/
|
|
643
649
|
isEnabled(): boolean;
|
|
644
|
-
/** @deprecated v11 - Get whether the block is manually disabled. */
|
|
650
|
+
/** @deprecated v11 - Get or sets whether the block is manually disabled. */
|
|
645
651
|
private get disabled();
|
|
646
|
-
/** @deprecated v11 - Set whether the block is manually disabled. */
|
|
647
652
|
private set disabled(value);
|
|
648
653
|
/**
|
|
649
654
|
* @deprecated v11 - Set whether the block is manually enabled or disabled.
|
|
@@ -999,7 +1004,7 @@ export declare class Block implements IASTNodeLocation {
|
|
|
999
1004
|
*
|
|
1000
1005
|
* Intended to on be used in console logs and errors. If you need a string
|
|
1001
1006
|
* that uses the user's native language (including block text, field values,
|
|
1002
|
-
* and child blocks), use
|
|
1007
|
+
* and child blocks), use {@link (Block:class).toString | toString()}.
|
|
1003
1008
|
*
|
|
1004
1009
|
* @returns The description.
|
|
1005
1010
|
*/
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { BlockSvg } from './block_svg.js';
|
|
7
7
|
import * as browserEvents from './browser_events.js';
|
|
8
|
-
import
|
|
8
|
+
import { FlyoutItem } from './flyout_item.js';
|
|
9
9
|
import type { IFlyout } from './interfaces/i_flyout.js';
|
|
10
10
|
import type { IFlyoutInflater } from './interfaces/i_flyout_inflater.js';
|
|
11
11
|
import type { BlockInfo } from './utils/toolbox.js';
|
|
@@ -16,7 +16,6 @@ import type { WorkspaceSvg } from './workspace_svg.js';
|
|
|
16
16
|
export declare class BlockFlyoutInflater implements IFlyoutInflater {
|
|
17
17
|
protected permanentlyDisabledBlocks: Set<BlockSvg>;
|
|
18
18
|
protected listeners: Map<string, browserEvents.Data[]>;
|
|
19
|
-
protected flyoutWorkspace?: WorkspaceSvg;
|
|
20
19
|
protected flyout?: IFlyout;
|
|
21
20
|
private capacityWrapper;
|
|
22
21
|
/**
|
|
@@ -27,10 +26,10 @@ export declare class BlockFlyoutInflater implements IFlyoutInflater {
|
|
|
27
26
|
* Inflates a flyout block from the given state and adds it to the flyout.
|
|
28
27
|
*
|
|
29
28
|
* @param state A JSON representation of a flyout block.
|
|
30
|
-
* @param
|
|
29
|
+
* @param flyout The flyout to create the block on.
|
|
31
30
|
* @returns A newly created block.
|
|
32
31
|
*/
|
|
33
|
-
load(state: object,
|
|
32
|
+
load(state: object, flyout: IFlyout): FlyoutItem;
|
|
34
33
|
/**
|
|
35
34
|
* Creates a block on the given workspace.
|
|
36
35
|
*
|
|
@@ -46,13 +45,13 @@ export declare class BlockFlyoutInflater implements IFlyoutInflater {
|
|
|
46
45
|
* @param defaultGap The default spacing for flyout items.
|
|
47
46
|
* @returns The amount of space that should follow this block.
|
|
48
47
|
*/
|
|
49
|
-
|
|
48
|
+
gapForItem(state: object, defaultGap: number): number;
|
|
50
49
|
/**
|
|
51
50
|
* Disposes of the given block.
|
|
52
51
|
*
|
|
53
|
-
* @param
|
|
52
|
+
* @param item The flyout block to dispose of.
|
|
54
53
|
*/
|
|
55
|
-
|
|
54
|
+
disposeItem(item: FlyoutItem): void;
|
|
56
55
|
/**
|
|
57
56
|
* Removes event listeners for the block with the given ID.
|
|
58
57
|
*
|
|
@@ -60,11 +59,11 @@ export declare class BlockFlyoutInflater implements IFlyoutInflater {
|
|
|
60
59
|
*/
|
|
61
60
|
protected removeListeners(blockId: string): void;
|
|
62
61
|
/**
|
|
63
|
-
* Updates this inflater's flyout
|
|
62
|
+
* Updates this inflater's flyout.
|
|
64
63
|
*
|
|
65
|
-
* @param
|
|
64
|
+
* @param flyout The flyout that owns this inflater.
|
|
66
65
|
*/
|
|
67
|
-
protected
|
|
66
|
+
protected setFlyout(flyout: IFlyout): void;
|
|
68
67
|
/**
|
|
69
68
|
* Updates the enabled state of the given block based on the capacity of the
|
|
70
69
|
* workspace.
|
|
@@ -85,5 +84,11 @@ export declare class BlockFlyoutInflater implements IFlyoutInflater {
|
|
|
85
84
|
* @param event The event that triggered this update.
|
|
86
85
|
*/
|
|
87
86
|
private filterFlyoutBasedOnCapacity;
|
|
87
|
+
/**
|
|
88
|
+
* Returns the type of items this inflater is responsible for creating.
|
|
89
|
+
*
|
|
90
|
+
* @returns An identifier for the type of items this inflater creates.
|
|
91
|
+
*/
|
|
92
|
+
getType(): string;
|
|
88
93
|
}
|
|
89
94
|
//# sourceMappingURL=block_flyout_inflater.d.ts.map
|
package/core/block_svg.d.ts
CHANGED
|
@@ -132,13 +132,13 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
132
132
|
*
|
|
133
133
|
* @returns #RRGGBB string.
|
|
134
134
|
*/
|
|
135
|
-
getColourSecondary(): string
|
|
135
|
+
getColourSecondary(): string;
|
|
136
136
|
/**
|
|
137
137
|
* Get the tertiary colour of a block.
|
|
138
138
|
*
|
|
139
139
|
* @returns #RRGGBB string.
|
|
140
140
|
*/
|
|
141
|
-
getColourTertiary(): string
|
|
141
|
+
getColourTertiary(): string;
|
|
142
142
|
/** Selects this block. Highlights the block visually. */
|
|
143
143
|
select(): void;
|
|
144
144
|
/** Unselects this block. Unhighlights the block visually. */
|
|
@@ -470,6 +470,12 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
470
470
|
* @throws {Error} if the block style does not exist.
|
|
471
471
|
*/
|
|
472
472
|
setStyle(blockStyleName: string): void;
|
|
473
|
+
/**
|
|
474
|
+
* Returns the BlockStyle object used to style this block.
|
|
475
|
+
*
|
|
476
|
+
* @returns This block's style object.
|
|
477
|
+
*/
|
|
478
|
+
getStyle(): BlockStyle;
|
|
473
479
|
/**
|
|
474
480
|
* Move this block to the front of the visible workspace.
|
|
475
481
|
* <g> tags do not respect z-index so SVG renders them in the
|
package/core/blockly.d.ts
CHANGED
|
@@ -48,9 +48,10 @@ import { FieldNumber, FieldNumberConfig, FieldNumberFromJsonConfig, FieldNumberV
|
|
|
48
48
|
import * as fieldRegistry from './field_registry.js';
|
|
49
49
|
import { FieldTextInput, FieldTextInputConfig, FieldTextInputFromJsonConfig, FieldTextInputValidator } from './field_textinput.js';
|
|
50
50
|
import { FieldVariable, FieldVariableConfig, FieldVariableFromJsonConfig, FieldVariableValidator } from './field_variable.js';
|
|
51
|
-
import { Flyout
|
|
51
|
+
import { Flyout } from './flyout_base.js';
|
|
52
52
|
import { FlyoutButton } from './flyout_button.js';
|
|
53
53
|
import { HorizontalFlyout } from './flyout_horizontal.js';
|
|
54
|
+
import { FlyoutItem } from './flyout_item.js';
|
|
54
55
|
import { FlyoutMetricsManager } from './flyout_metrics_manager.js';
|
|
55
56
|
import { FlyoutSeparator } from './flyout_separator.js';
|
|
56
57
|
import { VerticalFlyout } from './flyout_vertical.js';
|
|
@@ -83,6 +84,8 @@ import { IDragTarget } from './interfaces/i_drag_target.js';
|
|
|
83
84
|
import { IDragStrategy, IDraggable, isDraggable } from './interfaces/i_draggable.js';
|
|
84
85
|
import { IDragger } from './interfaces/i_dragger.js';
|
|
85
86
|
import { IFlyout } from './interfaces/i_flyout.js';
|
|
87
|
+
import { IFocusableNode } from './interfaces/i_focusable_node.js';
|
|
88
|
+
import { IFocusableTree } from './interfaces/i_focusable_tree.js';
|
|
86
89
|
import { IHasBubble, hasBubble } from './interfaces/i_has_bubble.js';
|
|
87
90
|
import { IIcon, isIcon } from './interfaces/i_icon.js';
|
|
88
91
|
import { IKeyboardAccessible } from './interfaces/i_keyboard_accessible.js';
|
|
@@ -271,5 +274,5 @@ export declare const VARIABLE_DYNAMIC_CATEGORY_NAME: string;
|
|
|
271
274
|
export declare const PROCEDURE_CATEGORY_NAME: string;
|
|
272
275
|
export { ASTNode, BasicCursor, Block, BlockSvg, BlocklyOptions, Blocks, CollapsibleToolboxCategory, ComponentManager, Connection, ConnectionChecker, ConnectionDB, ConnectionType, ContextMenu, ContextMenuItems, ContextMenuRegistry, Css, Cursor, DeleteArea, DragTarget, Events, Extensions, 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, };
|
|
273
276
|
export declare const DropDownDiv: typeof dropDownDiv;
|
|
274
|
-
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, 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, 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, Scrollbar, ScrollbarPair, SeparatorFlyoutInflater, ShortcutRegistry, TabNavigateCursor, Theme, ThemeManager, Toolbox, ToolboxCategory, ToolboxItem, ToolboxSeparator, Trashcan, UnattachedFieldError, VariableMap, VariableModel, VerticalFlyout, Workspace, WorkspaceAudio, WorkspaceDragger, WorkspaceSvg, ZoomControls, config, hasBubble, icons, inject, inputs, isCopyable, isDeletable, isDraggable, isIcon, isObservable, isPaster, isRenderedElement, isSelectable, isSerializable, isVariableBackedParameterModel, layers, renderManagement, serialization, setLocale, };
|
|
277
|
+
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, 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, Scrollbar, ScrollbarPair, SeparatorFlyoutInflater, ShortcutRegistry, TabNavigateCursor, Theme, ThemeManager, Toolbox, ToolboxCategory, ToolboxItem, ToolboxSeparator, Trashcan, UnattachedFieldError, VariableMap, VariableModel, VerticalFlyout, Workspace, WorkspaceAudio, WorkspaceDragger, WorkspaceSvg, ZoomControls, config, hasBubble, icons, inject, inputs, isCopyable, isDeletable, isDraggable, isIcon, isObservable, isPaster, isRenderedElement, isSelectable, isSerializable, isVariableBackedParameterModel, layers, renderManagement, serialization, setLocale, };
|
|
275
278
|
//# sourceMappingURL=blockly.d.ts.map
|
|
@@ -26,12 +26,12 @@ export declare class TextBubble extends Bubble {
|
|
|
26
26
|
* broken up by newlines.
|
|
27
27
|
*/
|
|
28
28
|
private stringToSvg;
|
|
29
|
-
/** Creates the paragraph container for this bubble's view's
|
|
29
|
+
/** Creates the paragraph container for this bubble's view's text fragments. */
|
|
30
30
|
private createParagraph;
|
|
31
|
-
/** Creates the
|
|
32
|
-
private
|
|
33
|
-
/** Right aligns the given
|
|
34
|
-
private
|
|
31
|
+
/** Creates the text fragments visualizing the text of this bubble. */
|
|
32
|
+
private createTextFragments;
|
|
33
|
+
/** Right aligns the given text fragments. */
|
|
34
|
+
private rightAlignTextFragments;
|
|
35
35
|
/** Updates the size of this bubble to account for the size of the text. */
|
|
36
36
|
private updateBubbleSize;
|
|
37
37
|
}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Copyright 2024 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
6
|
+
import { FlyoutItem } from './flyout_item.js';
|
|
7
|
+
import type { IFlyout } from './interfaces/i_flyout.js';
|
|
7
8
|
import type { IFlyoutInflater } from './interfaces/i_flyout_inflater.js';
|
|
8
|
-
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
9
9
|
/**
|
|
10
10
|
* Class responsible for creating buttons for flyouts.
|
|
11
11
|
*/
|
|
@@ -14,10 +14,10 @@ export declare class ButtonFlyoutInflater implements IFlyoutInflater {
|
|
|
14
14
|
* Inflates a flyout button from the given state and adds it to the flyout.
|
|
15
15
|
*
|
|
16
16
|
* @param state A JSON representation of a flyout button.
|
|
17
|
-
* @param
|
|
17
|
+
* @param flyout The flyout to create the button on.
|
|
18
18
|
* @returns A newly created FlyoutButton.
|
|
19
19
|
*/
|
|
20
|
-
load(state: object,
|
|
20
|
+
load(state: object, flyout: IFlyout): FlyoutItem;
|
|
21
21
|
/**
|
|
22
22
|
* Returns the amount of space that should follow this button.
|
|
23
23
|
*
|
|
@@ -25,12 +25,18 @@ export declare class ButtonFlyoutInflater implements IFlyoutInflater {
|
|
|
25
25
|
* @param defaultGap The default spacing for flyout items.
|
|
26
26
|
* @returns The amount of space that should follow this button.
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
gapForItem(state: object, defaultGap: number): number;
|
|
29
29
|
/**
|
|
30
30
|
* Disposes of the given button.
|
|
31
31
|
*
|
|
32
|
-
* @param
|
|
32
|
+
* @param item The flyout button to dispose of.
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
disposeItem(item: FlyoutItem): void;
|
|
35
|
+
/**
|
|
36
|
+
* Returns the type of items this inflater is responsible for creating.
|
|
37
|
+
*
|
|
38
|
+
* @returns An identifier for the type of items this inflater creates.
|
|
39
|
+
*/
|
|
40
|
+
getType(): string;
|
|
35
41
|
}
|
|
36
42
|
//# sourceMappingURL=button_flyout_inflater.d.ts.map
|
|
@@ -8,7 +8,7 @@ import { Coordinate } from '../utils/coordinate.js';
|
|
|
8
8
|
import { Size } from '../utils/size.js';
|
|
9
9
|
import { WorkspaceSvg } from '../workspace_svg.js';
|
|
10
10
|
export declare class CommentView implements IRenderedElement {
|
|
11
|
-
|
|
11
|
+
readonly workspace: WorkspaceSvg;
|
|
12
12
|
/** The root group element of the comment view. */
|
|
13
13
|
private svgRoot;
|
|
14
14
|
/**
|
|
@@ -62,9 +62,9 @@ export declare class CommentView implements IRenderedElement {
|
|
|
62
62
|
*/
|
|
63
63
|
private resizePointerMoveListener;
|
|
64
64
|
/** Whether this comment view is currently being disposed or not. */
|
|
65
|
-
|
|
65
|
+
protected disposing: boolean;
|
|
66
66
|
/** Whether this comment view has been disposed or not. */
|
|
67
|
-
|
|
67
|
+
protected disposed: boolean;
|
|
68
68
|
/** Size of this comment when the resize drag was initiated. */
|
|
69
69
|
private preResizeSize?;
|
|
70
70
|
/** The default size of newly created comments. */
|
package/core/connection.d.ts
CHANGED
|
@@ -216,7 +216,7 @@ export declare class Connection implements IASTNodeLocationWithBlock {
|
|
|
216
216
|
*
|
|
217
217
|
* Headless configurations (the default) do not have neighboring connection,
|
|
218
218
|
* and always return an empty list (the default).
|
|
219
|
-
* {@link RenderedConnection
|
|
219
|
+
* {@link (RenderedConnection:class).neighbours} overrides this behavior with a list
|
|
220
220
|
* computed from the rendered positioning.
|
|
221
221
|
*
|
|
222
222
|
* @param _maxLimit The maximum radius to another connection.
|
|
@@ -62,7 +62,7 @@ export declare namespace ContextMenuRegistry {
|
|
|
62
62
|
* rendered in multiple scopes, e.g. on both a block and a workspace, it
|
|
63
63
|
* should be registered for each scope.
|
|
64
64
|
*/
|
|
65
|
-
enum ScopeType {
|
|
65
|
+
export enum ScopeType {
|
|
66
66
|
BLOCK = "block",
|
|
67
67
|
WORKSPACE = "workspace",
|
|
68
68
|
COMMENT = "comment"
|
|
@@ -71,15 +71,23 @@ export declare namespace ContextMenuRegistry {
|
|
|
71
71
|
* The actual workspace/block where the menu is being rendered. This is passed
|
|
72
72
|
* to callback and displayText functions that depend on this information.
|
|
73
73
|
*/
|
|
74
|
-
interface Scope {
|
|
74
|
+
export interface Scope {
|
|
75
75
|
block?: BlockSvg;
|
|
76
76
|
workspace?: WorkspaceSvg;
|
|
77
77
|
comment?: RenderedWorkspaceComment;
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
|
-
*
|
|
80
|
+
* Fields common to all context menu registry items.
|
|
81
|
+
*/
|
|
82
|
+
interface CoreRegistryItem {
|
|
83
|
+
scopeType: ScopeType;
|
|
84
|
+
weight: number;
|
|
85
|
+
id: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* A representation of a normal, clickable menu item in the registry.
|
|
81
89
|
*/
|
|
82
|
-
interface
|
|
90
|
+
interface ActionRegistryItem extends CoreRegistryItem {
|
|
83
91
|
/**
|
|
84
92
|
* @param scope Object that provides a reference to the thing that had its
|
|
85
93
|
* context menu opened.
|
|
@@ -87,16 +95,34 @@ export declare namespace ContextMenuRegistry {
|
|
|
87
95
|
* the event that triggered the click on the option.
|
|
88
96
|
*/
|
|
89
97
|
callback: (scope: Scope, e: PointerEvent) => void;
|
|
90
|
-
scopeType: ScopeType;
|
|
91
98
|
displayText: ((p1: Scope) => string | HTMLElement) | string | HTMLElement;
|
|
92
99
|
preconditionFn: (p1: Scope) => string;
|
|
100
|
+
separator?: never;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A representation of a menu separator item in the registry.
|
|
104
|
+
*/
|
|
105
|
+
interface SeparatorRegistryItem extends CoreRegistryItem {
|
|
106
|
+
separator: true;
|
|
107
|
+
callback?: never;
|
|
108
|
+
displayText?: never;
|
|
109
|
+
preconditionFn?: never;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* A menu item as entered in the registry.
|
|
113
|
+
*/
|
|
114
|
+
export type RegistryItem = ActionRegistryItem | SeparatorRegistryItem;
|
|
115
|
+
/**
|
|
116
|
+
* Fields common to all context menu items as used by contextmenu.ts.
|
|
117
|
+
*/
|
|
118
|
+
export interface CoreContextMenuOption {
|
|
119
|
+
scope: Scope;
|
|
93
120
|
weight: number;
|
|
94
|
-
id: string;
|
|
95
121
|
}
|
|
96
122
|
/**
|
|
97
|
-
* A menu item
|
|
123
|
+
* A representation of a normal, clickable menu item in contextmenu.ts.
|
|
98
124
|
*/
|
|
99
|
-
interface
|
|
125
|
+
export interface ActionContextMenuOption extends CoreContextMenuOption {
|
|
100
126
|
text: string | HTMLElement;
|
|
101
127
|
enabled: boolean;
|
|
102
128
|
/**
|
|
@@ -106,18 +132,32 @@ export declare namespace ContextMenuRegistry {
|
|
|
106
132
|
* the event that triggered the click on the option.
|
|
107
133
|
*/
|
|
108
134
|
callback: (scope: Scope, e: PointerEvent) => void;
|
|
109
|
-
|
|
110
|
-
|
|
135
|
+
separator?: never;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* A representation of a menu separator item in contextmenu.ts.
|
|
139
|
+
*/
|
|
140
|
+
export interface SeparatorContextMenuOption extends CoreContextMenuOption {
|
|
141
|
+
separator: true;
|
|
142
|
+
text?: never;
|
|
143
|
+
enabled?: never;
|
|
144
|
+
callback?: never;
|
|
111
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* A menu item as presented to contextmenu.ts.
|
|
148
|
+
*/
|
|
149
|
+
export type ContextMenuOption = ActionContextMenuOption | SeparatorContextMenuOption;
|
|
112
150
|
/**
|
|
113
151
|
* A subset of ContextMenuOption corresponding to what was publicly
|
|
114
152
|
* documented. ContextMenuOption should be preferred for new code.
|
|
115
153
|
*/
|
|
116
|
-
interface LegacyContextMenuOption {
|
|
154
|
+
export interface LegacyContextMenuOption {
|
|
117
155
|
text: string;
|
|
118
156
|
enabled: boolean;
|
|
119
157
|
callback: (p1: Scope) => void;
|
|
158
|
+
separator?: never;
|
|
120
159
|
}
|
|
160
|
+
export {};
|
|
121
161
|
}
|
|
122
162
|
export type ScopeType = ContextMenuRegistry.ScopeType;
|
|
123
163
|
export declare const ScopeType: typeof ContextMenuRegistry.ScopeType;
|
|
@@ -25,8 +25,8 @@ export declare class BlockDragStrategy implements IDragStrategy {
|
|
|
25
25
|
* block, to add to the drag location. In workspace units.
|
|
26
26
|
*/
|
|
27
27
|
private dragOffset;
|
|
28
|
-
/**
|
|
29
|
-
private
|
|
28
|
+
/** Used to persist an event group when snapping is done async. */
|
|
29
|
+
private originalEventGroup;
|
|
30
30
|
constructor(block: BlockSvg);
|
|
31
31
|
/** Returns true if the block is currently movable. False otherwise. */
|
|
32
32
|
isMovable(): boolean;
|
|
@@ -10,8 +10,6 @@ export declare class BubbleDragStrategy implements IDragStrategy {
|
|
|
10
10
|
private bubble;
|
|
11
11
|
private workspace;
|
|
12
12
|
private startLoc;
|
|
13
|
-
/** Was there already an event group in progress when the drag started? */
|
|
14
|
-
private inGroup;
|
|
15
13
|
constructor(bubble: IBubble, workspace: WorkspaceSvg);
|
|
16
14
|
isMovable(): boolean;
|
|
17
15
|
startDrag(): void;
|
|
@@ -10,8 +10,6 @@ export declare class CommentDragStrategy implements IDragStrategy {
|
|
|
10
10
|
private comment;
|
|
11
11
|
private startLoc;
|
|
12
12
|
private workspace;
|
|
13
|
-
/** Was there already an event group in progress when the drag started? */
|
|
14
|
-
private inGroup;
|
|
15
13
|
constructor(comment: RenderedWorkspaceComment);
|
|
16
14
|
isMovable(): boolean;
|
|
17
15
|
startDrag(): void;
|
|
@@ -9,8 +9,6 @@ import { VarBase, VarBaseJson } from './events_var_base.js';
|
|
|
9
9
|
import { EventType } from './type.js';
|
|
10
10
|
/**
|
|
11
11
|
* Notifies listeners that a variable model has been deleted.
|
|
12
|
-
*
|
|
13
|
-
* @class
|
|
14
12
|
*/
|
|
15
13
|
export declare class VarDelete extends VarBase {
|
|
16
14
|
type: EventType;
|
package/core/field.d.ts
CHANGED
|
@@ -54,8 +54,6 @@ export declare abstract class Field<T = any> implements IASTNodeLocationSvg, IAS
|
|
|
54
54
|
* `FieldImage.prototype.DEFAULT_VALUE = null;`
|
|
55
55
|
*/
|
|
56
56
|
DEFAULT_VALUE: T | null;
|
|
57
|
-
/** Non-breaking space. */
|
|
58
|
-
static readonly NBSP = "\u00A0";
|
|
59
57
|
/**
|
|
60
58
|
* A value used to signal when a field's constructor should *not* set the
|
|
61
59
|
* field's value or run configure_, and should allow a subclass to do that
|
package/core/field_dropdown.d.ts
CHANGED
|
@@ -10,13 +10,10 @@ import { MenuItem } from './menuitem.js';
|
|
|
10
10
|
* Class for an editable dropdown field.
|
|
11
11
|
*/
|
|
12
12
|
export declare class FieldDropdown extends Field<string> {
|
|
13
|
-
/** Horizontal distance that a checkmark overhangs the dropdown. */
|
|
14
|
-
static CHECKMARK_OVERHANG: number;
|
|
15
13
|
/**
|
|
16
|
-
*
|
|
17
|
-
* height.
|
|
14
|
+
* Magic constant used to represent a separator in a list of dropdown items.
|
|
18
15
|
*/
|
|
19
|
-
static
|
|
16
|
+
static readonly SEPARATOR = "separator";
|
|
20
17
|
static ARROW_CHAR: string;
|
|
21
18
|
/** A reference to the currently selected menu item. */
|
|
22
19
|
private selectedMenuItem;
|
|
@@ -239,11 +236,12 @@ export interface ImageProperties {
|
|
|
239
236
|
height: number;
|
|
240
237
|
}
|
|
241
238
|
/**
|
|
242
|
-
* An individual option in the dropdown menu.
|
|
243
|
-
*
|
|
244
|
-
*
|
|
239
|
+
* An individual option in the dropdown menu. Can be either the string literal
|
|
240
|
+
* `separator` for a menu separator item, or an array for normal action menu
|
|
241
|
+
* items. In the latter case, the first element is the human-readable value
|
|
242
|
+
* (text or image), and the second element is the language-neutral value.
|
|
245
243
|
*/
|
|
246
|
-
export type MenuOption = [string | ImageProperties, string];
|
|
244
|
+
export type MenuOption = [string | ImageProperties, string] | 'separator';
|
|
247
245
|
/**
|
|
248
246
|
* A function that generates an array of menu options for FieldDropdown
|
|
249
247
|
* or its descendants.
|
package/core/flyout_base.d.ts
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { BlockSvg } from './block_svg.js';
|
|
12
12
|
import { DeleteArea } from './delete_area.js';
|
|
13
|
+
import { FlyoutItem } from './flyout_item.js';
|
|
13
14
|
import { IAutoHideable } from './interfaces/i_autohideable.js';
|
|
14
|
-
import type { IBoundedElement } from './interfaces/i_bounded_element.js';
|
|
15
15
|
import type { IFlyout } from './interfaces/i_flyout.js';
|
|
16
16
|
import type { IFlyoutInflater } from './interfaces/i_flyout_inflater.js';
|
|
17
17
|
import type { Options } from './options.js';
|
|
@@ -400,11 +400,4 @@ export declare abstract class Flyout extends DeleteArea implements IAutoHideable
|
|
|
400
400
|
*/
|
|
401
401
|
protected getInflaterForType(type: string): IFlyoutInflater | null;
|
|
402
402
|
}
|
|
403
|
-
/**
|
|
404
|
-
* A flyout content item.
|
|
405
|
-
*/
|
|
406
|
-
export interface FlyoutItem {
|
|
407
|
-
type: string;
|
|
408
|
-
element: IBoundedElement;
|
|
409
|
-
}
|
|
410
403
|
//# sourceMappingURL=flyout_base.d.ts.map
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { Flyout
|
|
6
|
+
import { Flyout } from './flyout_base.js';
|
|
7
|
+
import type { FlyoutItem } from './flyout_item.js';
|
|
7
8
|
import type { Options } from './options.js';
|
|
8
9
|
import type { Coordinate } from './utils/coordinate.js';
|
|
9
10
|
import { Rect } from './utils/rect.js';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { IBoundedElement } from './interfaces/i_bounded_element.js';
|
|
2
|
+
/**
|
|
3
|
+
* Representation of an item displayed in a flyout.
|
|
4
|
+
*/
|
|
5
|
+
export declare class FlyoutItem {
|
|
6
|
+
private element;
|
|
7
|
+
private type;
|
|
8
|
+
private focusable;
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new FlyoutItem.
|
|
11
|
+
*
|
|
12
|
+
* @param element The element that will be displayed in the flyout.
|
|
13
|
+
* @param type The type of element. Should correspond to the type of the
|
|
14
|
+
* flyout inflater that created this object.
|
|
15
|
+
* @param focusable True if the element should be allowed to be focused by
|
|
16
|
+
* e.g. keyboard navigation in the flyout.
|
|
17
|
+
*/
|
|
18
|
+
constructor(element: IBoundedElement, type: string, focusable: boolean);
|
|
19
|
+
/**
|
|
20
|
+
* Returns the element displayed in the flyout.
|
|
21
|
+
*/
|
|
22
|
+
getElement(): IBoundedElement;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the type of flyout element this item represents.
|
|
25
|
+
*/
|
|
26
|
+
getType(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Returns whether or not the flyout element can receive focus.
|
|
29
|
+
*/
|
|
30
|
+
isFocusable(): boolean;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=flyout_item.d.ts.map
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { Flyout
|
|
6
|
+
import { Flyout } from './flyout_base.js';
|
|
7
|
+
import type { FlyoutItem } from './flyout_item.js';
|
|
7
8
|
import type { Options } from './options.js';
|
|
8
9
|
import type { Coordinate } from './utils/coordinate.js';
|
|
9
10
|
import { Rect } from './utils/rect.js';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import type { BlockSvg } from '../block_svg.js';
|
|
7
|
-
import { FlyoutItem } from '../
|
|
7
|
+
import type { FlyoutItem } from '../flyout_item.js';
|
|
8
8
|
import type { Coordinate } from '../utils/coordinate.js';
|
|
9
9
|
import type { Svg } from '../utils/svg.js';
|
|
10
10
|
import type { FlyoutDefinition } from '../utils/toolbox.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { FlyoutItem } from '../flyout_item.js';
|
|
2
|
+
import type { IFlyout } from './i_flyout.js';
|
|
3
3
|
export interface IFlyoutInflater {
|
|
4
4
|
/**
|
|
5
5
|
* Loads the object represented by the given state onto the workspace.
|
|
@@ -8,14 +8,14 @@ export interface IFlyoutInflater {
|
|
|
8
8
|
* allow for code reuse.
|
|
9
9
|
*
|
|
10
10
|
* @param state A JSON representation of an element to inflate on the flyout.
|
|
11
|
-
* @param
|
|
11
|
+
* @param flyout The flyout on whose workspace the inflated element
|
|
12
12
|
* should be created. If the inflated element is an `IRenderedElement` it
|
|
13
13
|
* itself or the inflater should append it to the workspace; the flyout
|
|
14
14
|
* will not do so itself. The flyout is responsible for positioning the
|
|
15
15
|
* element, however.
|
|
16
16
|
* @returns The newly inflated flyout element.
|
|
17
17
|
*/
|
|
18
|
-
load(state: object,
|
|
18
|
+
load(state: object, flyout: IFlyout): FlyoutItem;
|
|
19
19
|
/**
|
|
20
20
|
* Returns the amount of spacing that should follow the element corresponding
|
|
21
21
|
* to the given JSON representation.
|
|
@@ -24,7 +24,7 @@ export interface IFlyoutInflater {
|
|
|
24
24
|
* @param defaultGap The default gap for elements in this flyout.
|
|
25
25
|
* @returns The gap that should follow the given element.
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
gapForItem(state: object, defaultGap: number): number;
|
|
28
28
|
/**
|
|
29
29
|
* Disposes of the given element.
|
|
30
30
|
*
|
|
@@ -34,6 +34,15 @@ export interface IFlyoutInflater {
|
|
|
34
34
|
*
|
|
35
35
|
* @param element The flyout element to dispose of.
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
disposeItem(item: FlyoutItem): void;
|
|
38
|
+
/**
|
|
39
|
+
* Returns the type of items that this inflater is responsible for inflating.
|
|
40
|
+
* This should be the same as the name under which this inflater registers
|
|
41
|
+
* itself, as well as the value returned by `getType()` on the `FlyoutItem`
|
|
42
|
+
* objects returned by `load()`.
|
|
43
|
+
*
|
|
44
|
+
* @returns The type of items this inflater creates.
|
|
45
|
+
*/
|
|
46
|
+
getType(): string;
|
|
38
47
|
}
|
|
39
48
|
//# sourceMappingURL=i_flyout_inflater.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { IFocusableTree } from './i_focusable_tree.js';
|
|
7
|
+
/** Represents anything that can have input focus. */
|
|
8
|
+
export interface IFocusableNode {
|
|
9
|
+
/**
|
|
10
|
+
* Returns the DOM element that can be explicitly requested to receive focus.
|
|
11
|
+
*
|
|
12
|
+
* IMPORTANT: Please note that this element is expected to have a visual
|
|
13
|
+
* presence on the page as it will both be explicitly focused and have its
|
|
14
|
+
* style changed depending on its current focus state (i.e. blurred, actively
|
|
15
|
+
* focused, and passively focused). The element will have one of two styles
|
|
16
|
+
* attached (where no style indicates blurred/not focused):
|
|
17
|
+
* - blocklyActiveFocus
|
|
18
|
+
* - blocklyPassiveFocus
|
|
19
|
+
*
|
|
20
|
+
* The returned element must also have a valid ID specified, and unique to the
|
|
21
|
+
* element relative to its nearest IFocusableTree parent.
|
|
22
|
+
*
|
|
23
|
+
* It's expected the return element will not change for the lifetime of the
|
|
24
|
+
* node.
|
|
25
|
+
*/
|
|
26
|
+
getFocusableElement(): HTMLElement | SVGElement;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the closest parent tree of this node (in cases where a tree has
|
|
29
|
+
* distinct trees underneath it), which represents the tree to which this node
|
|
30
|
+
* belongs.
|
|
31
|
+
*/
|
|
32
|
+
getFocusableTree(): IFocusableTree;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=i_focusable_node.d.ts.map
|