blockly 11.2.0 → 12.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blockly.min.js +783 -767
- package/blockly.mjs +6 -1
- package/blockly_compressed.js +768 -752
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js +15 -15
- package/blocks_compressed.js.map +1 -1
- package/core/block.d.ts +11 -6
- package/core/block_flyout_inflater.d.ts +95 -0
- package/core/block_svg.d.ts +26 -2
- package/core/blockly.d.ts +11 -3
- package/core/bubbles/textinput_bubble.d.ts +9 -0
- package/core/button_flyout_inflater.d.ts +42 -0
- package/core/clipboard.d.ts +2 -2
- package/core/comments/comment_view.d.ts +4 -0
- package/core/comments/rendered_workspace_comment.d.ts +2 -0
- package/core/connection.d.ts +1 -1
- package/core/dropdowndiv.d.ts +1 -1
- package/core/events/events.d.ts +1 -0
- package/core/events/events_var_base.d.ts +2 -2
- package/core/events/events_var_create.d.ts +7 -2
- package/core/events/events_var_delete.d.ts +2 -4
- package/core/events/events_var_rename.d.ts +2 -4
- package/core/events/events_var_type_change.d.ts +55 -0
- package/core/events/type.d.ts +2 -0
- package/core/field.d.ts +0 -13
- package/core/field_checkbox.d.ts +0 -4
- package/core/field_dropdown.d.ts +0 -2
- package/core/field_input.d.ts +0 -2
- package/core/field_number.d.ts +6 -0
- package/core/field_textinput.d.ts +1 -0
- package/core/field_variable.d.ts +9 -2
- package/core/flyout_base.d.ts +45 -181
- package/core/flyout_button.d.ts +25 -6
- package/core/flyout_horizontal.d.ts +4 -4
- package/core/flyout_item.d.ts +32 -0
- package/core/flyout_separator.d.ts +45 -0
- package/core/flyout_vertical.d.ts +5 -5
- package/core/grid.d.ts +4 -1
- package/core/icons/comment_icon.d.ts +15 -0
- package/core/interfaces/i_comment_icon.d.ts +3 -0
- package/core/interfaces/i_flyout.d.ts +1 -1
- package/core/interfaces/i_flyout_inflater.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/interfaces/i_toolbox.d.ts +8 -1
- package/core/interfaces/i_variable_backed_parameter_model.d.ts +2 -2
- package/core/interfaces/i_variable_map.d.ts +48 -0
- package/core/interfaces/i_variable_model.d.ts +36 -0
- package/core/label_flyout_inflater.d.ts +42 -0
- package/core/menu.d.ts +1 -3
- package/core/menuitem.d.ts +0 -7
- package/core/metrics_manager.d.ts +1 -1
- package/core/names.d.ts +8 -2
- package/core/procedures.d.ts +7 -4
- package/core/registry.d.ts +6 -0
- package/core/renderers/common/constants.d.ts +6 -1
- package/core/renderers/common/i_path_object.d.ts +13 -13
- package/core/renderers/common/renderer.d.ts +13 -18
- package/core/renderers/geras/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/renderers/zelos/constants.d.ts +8 -2
- package/core/renderers/zelos/renderer.d.ts +0 -7
- package/core/separator_flyout_inflater.d.ts +57 -0
- package/core/serialization/variables.d.ts +3 -10
- package/core/toolbox/toolbox.d.ts +2 -5
- package/core/variable_map.d.ts +27 -29
- package/core/variable_model.d.ts +37 -11
- package/core/variables.d.ts +56 -12
- package/core/variables_dynamic.d.ts +7 -5
- package/core/widgetdiv.d.ts +2 -2
- package/core/workspace.d.ts +21 -19
- package/core/workspace_svg.d.ts +34 -6
- package/core/xml.d.ts +2 -2
- package/index.mjs +6 -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 +1 -1
- package/php_compressed.js +1 -1
- package/php_compressed.js.map +1 -1
- package/python_compressed.js +1 -1
- package/python_compressed.js.map +1 -1
- package/core/insertion_marker_manager.d.ts +0 -249
package/core/block.d.ts
CHANGED
|
@@ -20,10 +20,10 @@ import type { MutatorIcon } from './icons/mutator_icon.js';
|
|
|
20
20
|
import { Input } from './inputs/input.js';
|
|
21
21
|
import type { IASTNodeLocation } from './interfaces/i_ast_node_location.js';
|
|
22
22
|
import { type IIcon } from './interfaces/i_icon.js';
|
|
23
|
+
import type { IVariableModel, IVariableState } from './interfaces/i_variable_model.js';
|
|
23
24
|
import * as Tooltip from './tooltip.js';
|
|
24
25
|
import { Coordinate } from './utils/coordinate.js';
|
|
25
26
|
import { Size } from './utils/size.js';
|
|
26
|
-
import type { VariableModel } from './variable_model.js';
|
|
27
27
|
import type { Workspace } from './workspace.js';
|
|
28
28
|
/**
|
|
29
29
|
* Class for one block.
|
|
@@ -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
|
*
|
|
@@ -552,7 +558,7 @@ export declare class Block implements IASTNodeLocation {
|
|
|
552
558
|
* @returns List of variable models.
|
|
553
559
|
* @internal
|
|
554
560
|
*/
|
|
555
|
-
getVarModels():
|
|
561
|
+
getVarModels(): IVariableModel<IVariableState>[];
|
|
556
562
|
/**
|
|
557
563
|
* Notification that a variable is renaming but keeping the same ID. If the
|
|
558
564
|
* variable is in use on this block, rerender to show the new name.
|
|
@@ -560,7 +566,7 @@ export declare class Block implements IASTNodeLocation {
|
|
|
560
566
|
* @param variable The variable being renamed.
|
|
561
567
|
* @internal
|
|
562
568
|
*/
|
|
563
|
-
updateVarName(variable:
|
|
569
|
+
updateVarName(variable: IVariableModel<IVariableState>): void;
|
|
564
570
|
/**
|
|
565
571
|
* Notification that a variable is renaming.
|
|
566
572
|
* If the ID matches one of this block's variables, rename it.
|
|
@@ -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
|
*/
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { BlockSvg } from './block_svg.js';
|
|
7
|
+
import * as browserEvents from './browser_events.js';
|
|
8
|
+
import { FlyoutItem } from './flyout_item.js';
|
|
9
|
+
import type { IFlyout } from './interfaces/i_flyout.js';
|
|
10
|
+
import type { IFlyoutInflater } from './interfaces/i_flyout_inflater.js';
|
|
11
|
+
import type { BlockInfo } from './utils/toolbox.js';
|
|
12
|
+
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
13
|
+
/**
|
|
14
|
+
* Class responsible for creating blocks for flyouts.
|
|
15
|
+
*/
|
|
16
|
+
export declare class BlockFlyoutInflater implements IFlyoutInflater {
|
|
17
|
+
protected permanentlyDisabledBlocks: Set<BlockSvg>;
|
|
18
|
+
protected listeners: Map<string, browserEvents.Data[]>;
|
|
19
|
+
protected flyoutWorkspace?: WorkspaceSvg;
|
|
20
|
+
protected flyout?: IFlyout;
|
|
21
|
+
private capacityWrapper;
|
|
22
|
+
/**
|
|
23
|
+
* Creates a new BlockFlyoutInflater instance.
|
|
24
|
+
*/
|
|
25
|
+
constructor();
|
|
26
|
+
/**
|
|
27
|
+
* Inflates a flyout block from the given state and adds it to the flyout.
|
|
28
|
+
*
|
|
29
|
+
* @param state A JSON representation of a flyout block.
|
|
30
|
+
* @param flyoutWorkspace The workspace to create the block on.
|
|
31
|
+
* @returns A newly created block.
|
|
32
|
+
*/
|
|
33
|
+
load(state: object, flyoutWorkspace: WorkspaceSvg): FlyoutItem;
|
|
34
|
+
/**
|
|
35
|
+
* Creates a block on the given workspace.
|
|
36
|
+
*
|
|
37
|
+
* @param blockDefinition A JSON representation of the block to create.
|
|
38
|
+
* @param workspace The workspace to create the block on.
|
|
39
|
+
* @returns The newly created block.
|
|
40
|
+
*/
|
|
41
|
+
createBlock(blockDefinition: BlockInfo, workspace: WorkspaceSvg): BlockSvg;
|
|
42
|
+
/**
|
|
43
|
+
* Returns the amount of space that should follow this block.
|
|
44
|
+
*
|
|
45
|
+
* @param state A JSON representation of a flyout block.
|
|
46
|
+
* @param defaultGap The default spacing for flyout items.
|
|
47
|
+
* @returns The amount of space that should follow this block.
|
|
48
|
+
*/
|
|
49
|
+
gapForItem(state: object, defaultGap: number): number;
|
|
50
|
+
/**
|
|
51
|
+
* Disposes of the given block.
|
|
52
|
+
*
|
|
53
|
+
* @param item The flyout block to dispose of.
|
|
54
|
+
*/
|
|
55
|
+
disposeItem(item: FlyoutItem): void;
|
|
56
|
+
/**
|
|
57
|
+
* Removes event listeners for the block with the given ID.
|
|
58
|
+
*
|
|
59
|
+
* @param blockId The ID of the block to remove event listeners from.
|
|
60
|
+
*/
|
|
61
|
+
protected removeListeners(blockId: string): void;
|
|
62
|
+
/**
|
|
63
|
+
* Updates this inflater's flyout workspace.
|
|
64
|
+
*
|
|
65
|
+
* @param workspace The workspace of the flyout that owns this inflater.
|
|
66
|
+
*/
|
|
67
|
+
protected setFlyoutWorkspace(workspace: WorkspaceSvg): void;
|
|
68
|
+
/**
|
|
69
|
+
* Updates the enabled state of the given block based on the capacity of the
|
|
70
|
+
* workspace.
|
|
71
|
+
*
|
|
72
|
+
* @param block The block to update the enabled/disabled state of.
|
|
73
|
+
*/
|
|
74
|
+
private updateStateBasedOnCapacity;
|
|
75
|
+
/**
|
|
76
|
+
* Add listeners to a block that has been added to the flyout.
|
|
77
|
+
*
|
|
78
|
+
* @param block The block to add listeners for.
|
|
79
|
+
*/
|
|
80
|
+
protected addBlockListeners(block: BlockSvg): void;
|
|
81
|
+
/**
|
|
82
|
+
* Updates the state of blocks in our owning flyout to be disabled/enabled
|
|
83
|
+
* based on the capacity of the workspace for more blocks of that type.
|
|
84
|
+
*
|
|
85
|
+
* @param event The event that triggered this update.
|
|
86
|
+
*/
|
|
87
|
+
private filterFlyoutBasedOnCapacity;
|
|
88
|
+
/**
|
|
89
|
+
* Returns the type of items this inflater is responsible for creating.
|
|
90
|
+
*
|
|
91
|
+
* @returns An identifier for the type of items this inflater creates.
|
|
92
|
+
*/
|
|
93
|
+
getType(): string;
|
|
94
|
+
}
|
|
95
|
+
//# 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. */
|
|
@@ -275,6 +275,18 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
275
275
|
private updateConnectionLocations;
|
|
276
276
|
private updateIconLocations;
|
|
277
277
|
private updateFieldLocations;
|
|
278
|
+
/**
|
|
279
|
+
* Add a CSS class to the SVG group of this block.
|
|
280
|
+
*
|
|
281
|
+
* @param className
|
|
282
|
+
*/
|
|
283
|
+
addClass(className: string): void;
|
|
284
|
+
/**
|
|
285
|
+
* Remove a CSS class from the SVG group of this block.
|
|
286
|
+
*
|
|
287
|
+
* @param className
|
|
288
|
+
*/
|
|
289
|
+
removeClass(className: string): void;
|
|
278
290
|
/**
|
|
279
291
|
* Recursively adds or removes the dragging class to this node and its
|
|
280
292
|
* children.
|
|
@@ -406,6 +418,11 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
406
418
|
* update whether the block is currently disabled for this reason.
|
|
407
419
|
*/
|
|
408
420
|
setDisabledReason(disabled: boolean, reason: string): void;
|
|
421
|
+
/**
|
|
422
|
+
* Add blocklyNotDeletable class when block is not deletable
|
|
423
|
+
* Or remove class when block is deletable
|
|
424
|
+
*/
|
|
425
|
+
setDeletable(deletable: boolean): void;
|
|
409
426
|
/**
|
|
410
427
|
* Set whether the block is highlighted or not. Block highlighting is
|
|
411
428
|
* often used to visually mark blocks currently being executed.
|
|
@@ -453,6 +470,12 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
453
470
|
* @throws {Error} if the block style does not exist.
|
|
454
471
|
*/
|
|
455
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;
|
|
456
479
|
/**
|
|
457
480
|
* Move this block to the front of the visible workspace.
|
|
458
481
|
* <g> tags do not respect z-index so SVG renders them in the
|
|
@@ -706,5 +729,6 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
706
729
|
* Returns a representation of this block that can be displayed in a flyout.
|
|
707
730
|
*/
|
|
708
731
|
toFlyoutInfo(): FlyoutItemInfo[];
|
|
732
|
+
jsonInit(json: any): void;
|
|
709
733
|
}
|
|
710
734
|
//# sourceMappingURL=block_svg.d.ts.map
|
package/core/blockly.d.ts
CHANGED
|
@@ -9,12 +9,14 @@ import './events/events_ui_base.js';
|
|
|
9
9
|
import './events/events_var_create.js';
|
|
10
10
|
import { Block } from './block.js';
|
|
11
11
|
import * as blockAnimations from './block_animations.js';
|
|
12
|
+
import { BlockFlyoutInflater } from './block_flyout_inflater.js';
|
|
12
13
|
import { BlockSvg } from './block_svg.js';
|
|
13
14
|
import { BlocklyOptions } from './blockly_options.js';
|
|
14
15
|
import { Blocks } from './blocks.js';
|
|
15
16
|
import * as browserEvents from './browser_events.js';
|
|
16
17
|
import * as bubbles from './bubbles.js';
|
|
17
18
|
import * as bumpObjects from './bump_objects.js';
|
|
19
|
+
import { ButtonFlyoutInflater } from './button_flyout_inflater.js';
|
|
18
20
|
import * as clipboard from './clipboard.js';
|
|
19
21
|
import * as comments from './comments.js';
|
|
20
22
|
import * as common from './common.js';
|
|
@@ -38,7 +40,7 @@ import * as Events from './events/events.js';
|
|
|
38
40
|
import * as Extensions from './extensions.js';
|
|
39
41
|
import { Field, FieldConfig, FieldValidator, UnattachedFieldError } from './field.js';
|
|
40
42
|
import { FieldCheckbox, FieldCheckboxConfig, FieldCheckboxFromJsonConfig, FieldCheckboxValidator } from './field_checkbox.js';
|
|
41
|
-
import { FieldDropdown, FieldDropdownConfig, FieldDropdownFromJsonConfig, FieldDropdownValidator, MenuGenerator, MenuGeneratorFunction, MenuOption } from './field_dropdown.js';
|
|
43
|
+
import { FieldDropdown, FieldDropdownConfig, FieldDropdownFromJsonConfig, FieldDropdownValidator, ImageProperties, MenuGenerator, MenuGeneratorFunction, MenuOption } from './field_dropdown.js';
|
|
42
44
|
import { FieldImage, FieldImageConfig, FieldImageFromJsonConfig } from './field_image.js';
|
|
43
45
|
import { FieldLabel, FieldLabelConfig, FieldLabelFromJsonConfig } from './field_label.js';
|
|
44
46
|
import { FieldLabelSerializable } from './field_label_serializable.js';
|
|
@@ -49,7 +51,9 @@ import { FieldVariable, FieldVariableConfig, FieldVariableFromJsonConfig, FieldV
|
|
|
49
51
|
import { Flyout } from './flyout_base.js';
|
|
50
52
|
import { FlyoutButton } from './flyout_button.js';
|
|
51
53
|
import { HorizontalFlyout } from './flyout_horizontal.js';
|
|
54
|
+
import { FlyoutItem } from './flyout_item.js';
|
|
52
55
|
import { FlyoutMetricsManager } from './flyout_metrics_manager.js';
|
|
56
|
+
import { FlyoutSeparator } from './flyout_separator.js';
|
|
53
57
|
import { VerticalFlyout } from './flyout_vertical.js';
|
|
54
58
|
import { CodeGenerator } from './generator.js';
|
|
55
59
|
import { Gesture } from './gesture.js';
|
|
@@ -57,8 +61,10 @@ import { Grid } from './grid.js';
|
|
|
57
61
|
import * as icons from './icons.js';
|
|
58
62
|
import { inject } from './inject.js';
|
|
59
63
|
import * as inputs from './inputs.js';
|
|
64
|
+
import { IFlyoutInflater } from './interfaces/i_flyout_inflater.js';
|
|
65
|
+
import { LabelFlyoutInflater } from './label_flyout_inflater.js';
|
|
66
|
+
import { SeparatorFlyoutInflater } from './separator_flyout_inflater.js';
|
|
60
67
|
import { Input } from './inputs/input.js';
|
|
61
|
-
import { InsertionMarkerManager } from './insertion_marker_manager.js';
|
|
62
68
|
import { InsertionMarkerPreviewer } from './insertion_marker_previewer.js';
|
|
63
69
|
import { IASTNodeLocation } from './interfaces/i_ast_node_location.js';
|
|
64
70
|
import { IASTNodeLocationSvg } from './interfaces/i_ast_node_location_svg.js';
|
|
@@ -95,6 +101,8 @@ import { IStyleable } from './interfaces/i_styleable.js';
|
|
|
95
101
|
import { IToolbox } from './interfaces/i_toolbox.js';
|
|
96
102
|
import { IToolboxItem } from './interfaces/i_toolbox_item.js';
|
|
97
103
|
import { IVariableBackedParameterModel, isVariableBackedParameterModel } from './interfaces/i_variable_backed_parameter_model.js';
|
|
104
|
+
import { IVariableMap } from './interfaces/i_variable_map.js';
|
|
105
|
+
import { IVariableModel, IVariableState } from './interfaces/i_variable_model.js';
|
|
98
106
|
import { ASTNode } from './keyboard_nav/ast_node.js';
|
|
99
107
|
import { BasicCursor } from './keyboard_nav/basic_cursor.js';
|
|
100
108
|
import { Cursor } from './keyboard_nav/cursor.js';
|
|
@@ -264,5 +272,5 @@ export declare const VARIABLE_DYNAMIC_CATEGORY_NAME: string;
|
|
|
264
272
|
export declare const PROCEDURE_CATEGORY_NAME: string;
|
|
265
273
|
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, };
|
|
266
274
|
export declare const DropDownDiv: typeof dropDownDiv;
|
|
267
|
-
export { 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, FlyoutMetricsManager, 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, IHasBubble, IIcon, IKeyboardAccessible, IMetricsManager, IMovable, IObservable, IPaster, IPositionable, IRegistrable, IRenderedElement, ISelectable, ISelectableToolboxItem, ISerializable, IStyleable, IToolbox, IToolboxItem, IVariableBackedParameterModel,
|
|
275
|
+
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, };
|
|
268
276
|
//# sourceMappingURL=blockly.d.ts.map
|
|
@@ -36,6 +36,8 @@ export declare class TextInputBubble extends Bubble {
|
|
|
36
36
|
private textChangeListeners;
|
|
37
37
|
/** Functions listening for changes to the size of this bubble. */
|
|
38
38
|
private sizeChangeListeners;
|
|
39
|
+
/** Functions listening for changes to the location of this bubble. */
|
|
40
|
+
private locationChangeListeners;
|
|
39
41
|
/** The text of this bubble. */
|
|
40
42
|
private text;
|
|
41
43
|
/** The default size of this bubble, including borders. */
|
|
@@ -63,6 +65,8 @@ export declare class TextInputBubble extends Bubble {
|
|
|
63
65
|
addTextChangeListener(listener: () => void): void;
|
|
64
66
|
/** Adds a change listener to be notified when this bubble's size changes. */
|
|
65
67
|
addSizeChangeListener(listener: () => void): void;
|
|
68
|
+
/** Adds a change listener to be notified when this bubble's location changes. */
|
|
69
|
+
addLocationChangeListener(listener: () => void): void;
|
|
66
70
|
/** Creates the editor UI for this bubble. */
|
|
67
71
|
private createEditor;
|
|
68
72
|
/** Binds events to the text area element. */
|
|
@@ -80,6 +84,9 @@ export declare class TextInputBubble extends Bubble {
|
|
|
80
84
|
setSize(size: Size, relayout?: boolean): void;
|
|
81
85
|
/** @returns the size of this bubble. */
|
|
82
86
|
getSize(): Size;
|
|
87
|
+
moveDuringDrag(newLoc: Coordinate): void;
|
|
88
|
+
setPositionRelativeToAnchor(left: number, top: number): void;
|
|
89
|
+
protected positionByRect(rect?: Rect): void;
|
|
83
90
|
/** Handles mouse down events on the resize target. */
|
|
84
91
|
private onResizePointerDown;
|
|
85
92
|
/** Handles pointer up events on the resize target. */
|
|
@@ -94,5 +101,7 @@ export declare class TextInputBubble extends Bubble {
|
|
|
94
101
|
private onTextChange;
|
|
95
102
|
/** Handles a size change event for the text area. Calls event listeners. */
|
|
96
103
|
private onSizeChange;
|
|
104
|
+
/** Handles a location change event for the text area. Calls event listeners. */
|
|
105
|
+
private onLocationChange;
|
|
97
106
|
}
|
|
98
107
|
//# sourceMappingURL=textinput_bubble.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { FlyoutItem } from './flyout_item.js';
|
|
7
|
+
import type { IFlyoutInflater } from './interfaces/i_flyout_inflater.js';
|
|
8
|
+
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
9
|
+
/**
|
|
10
|
+
* Class responsible for creating buttons for flyouts.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ButtonFlyoutInflater implements IFlyoutInflater {
|
|
13
|
+
/**
|
|
14
|
+
* Inflates a flyout button from the given state and adds it to the flyout.
|
|
15
|
+
*
|
|
16
|
+
* @param state A JSON representation of a flyout button.
|
|
17
|
+
* @param flyoutWorkspace The workspace to create the button on.
|
|
18
|
+
* @returns A newly created FlyoutButton.
|
|
19
|
+
*/
|
|
20
|
+
load(state: object, flyoutWorkspace: WorkspaceSvg): FlyoutItem;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the amount of space that should follow this button.
|
|
23
|
+
*
|
|
24
|
+
* @param state A JSON representation of a flyout button.
|
|
25
|
+
* @param defaultGap The default spacing for flyout items.
|
|
26
|
+
* @returns The amount of space that should follow this button.
|
|
27
|
+
*/
|
|
28
|
+
gapForItem(state: object, defaultGap: number): number;
|
|
29
|
+
/**
|
|
30
|
+
* Disposes of the given button.
|
|
31
|
+
*
|
|
32
|
+
* @param item The flyout button to dispose of.
|
|
33
|
+
*/
|
|
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;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=button_flyout_inflater.d.ts.map
|
package/core/clipboard.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2021 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { BlockPaster } from './clipboard/block_paster.js';
|
|
6
|
+
import { BlockCopyData, BlockPaster } from './clipboard/block_paster.js';
|
|
7
7
|
import * as registry from './clipboard/registry.js';
|
|
8
8
|
import type { ICopyData, ICopyable } from './interfaces/i_copyable.js';
|
|
9
9
|
import { Coordinate } from './utils/coordinate.js';
|
|
@@ -38,5 +38,5 @@ export declare const TEST_ONLY: {
|
|
|
38
38
|
duplicateInternal: typeof duplicateInternal;
|
|
39
39
|
copyInternal: typeof copyInternal;
|
|
40
40
|
};
|
|
41
|
-
export { BlockPaster, registry };
|
|
41
|
+
export { BlockCopyData, BlockPaster, registry };
|
|
42
42
|
//# sourceMappingURL=clipboard.d.ts.map
|
|
@@ -67,6 +67,8 @@ export declare class CommentView implements IRenderedElement {
|
|
|
67
67
|
private disposed;
|
|
68
68
|
/** Size of this comment when the resize drag was initiated. */
|
|
69
69
|
private preResizeSize?;
|
|
70
|
+
/** The default size of newly created comments. */
|
|
71
|
+
static defaultCommentSize: Size;
|
|
70
72
|
constructor(workspace: WorkspaceSvg);
|
|
71
73
|
/**
|
|
72
74
|
* Creates the rect we use for highlighting the comment when it's selected.
|
|
@@ -190,6 +192,8 @@ export declare class CommentView implements IRenderedElement {
|
|
|
190
192
|
getText(): string;
|
|
191
193
|
/** Sets the current text of the comment. */
|
|
192
194
|
setText(text: string): void;
|
|
195
|
+
/** Sets the placeholder text displayed for an empty comment. */
|
|
196
|
+
setPlaceholderText(text: string): void;
|
|
193
197
|
/** Registers a callback that listens for text changes. */
|
|
194
198
|
addTextChangeListener(listener: (oldText: string, newText: string) => void): void;
|
|
195
199
|
/** Removes the given listener from the list of text change listeners. */
|
|
@@ -30,6 +30,8 @@ export declare class RenderedWorkspaceComment extends WorkspaceComment implement
|
|
|
30
30
|
private addModelUpdateBindings;
|
|
31
31
|
/** Sets the text of the comment. */
|
|
32
32
|
setText(text: string): void;
|
|
33
|
+
/** Sets the placeholder text displayed if the comment is empty. */
|
|
34
|
+
setPlaceholderText(text: string): void;
|
|
33
35
|
/** Sets the size of the comment. */
|
|
34
36
|
setSize(size: Size): void;
|
|
35
37
|
/** Sets whether the comment is collapsed or not. */
|
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.
|
package/core/dropdowndiv.d.ts
CHANGED
|
@@ -75,7 +75,7 @@ export declare function getOwner(): Field | null;
|
|
|
75
75
|
*
|
|
76
76
|
* @returns Div to populate with content.
|
|
77
77
|
*/
|
|
78
|
-
export declare function getContentDiv():
|
|
78
|
+
export declare function getContentDiv(): HTMLDivElement;
|
|
79
79
|
/** Clear the content of the drop-down. */
|
|
80
80
|
export declare function clearContent(): void;
|
|
81
81
|
/**
|
package/core/events/events.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export { VarBase, VarBaseJson } from './events_var_base.js';
|
|
|
32
32
|
export { VarCreate, VarCreateJson } from './events_var_create.js';
|
|
33
33
|
export { VarDelete, VarDeleteJson } from './events_var_delete.js';
|
|
34
34
|
export { VarRename, VarRenameJson } from './events_var_rename.js';
|
|
35
|
+
export { VarTypeChange, VarTypeChangeJson } from './events_var_type_change.js';
|
|
35
36
|
export { ViewportChange, ViewportChangeJson } from './events_viewport.js';
|
|
36
37
|
export { FinishedLoading } from './workspace_events.js';
|
|
37
38
|
export type { BumpEvent } from './utils.js';
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @class
|
|
10
10
|
*/
|
|
11
|
-
import type {
|
|
11
|
+
import type { IVariableModel, IVariableState } from '../interfaces/i_variable_model.js';
|
|
12
12
|
import type { Workspace } from '../workspace.js';
|
|
13
13
|
import { Abstract as AbstractEvent, AbstractEventJson } from './events_abstract.js';
|
|
14
14
|
/**
|
|
@@ -22,7 +22,7 @@ export declare class VarBase extends AbstractEvent {
|
|
|
22
22
|
* @param opt_variable The variable this event corresponds to. Undefined for
|
|
23
23
|
* a blank event.
|
|
24
24
|
*/
|
|
25
|
-
constructor(opt_variable?:
|
|
25
|
+
constructor(opt_variable?: IVariableModel<IVariableState>);
|
|
26
26
|
/**
|
|
27
27
|
* Encode the event as JSON.
|
|
28
28
|
*
|
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
* Copyright 2018 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Class for a variable creation event.
|
|
8
|
+
*
|
|
9
|
+
* @class
|
|
10
|
+
*/
|
|
11
|
+
import type { IVariableModel, IVariableState } from '../interfaces/i_variable_model.js';
|
|
7
12
|
import type { Workspace } from '../workspace.js';
|
|
8
13
|
import { VarBase, VarBaseJson } from './events_var_base.js';
|
|
9
14
|
import { EventType } from './type.js';
|
|
@@ -19,7 +24,7 @@ export declare class VarCreate extends VarBase {
|
|
|
19
24
|
/**
|
|
20
25
|
* @param opt_variable The created variable. Undefined for a blank event.
|
|
21
26
|
*/
|
|
22
|
-
constructor(opt_variable?:
|
|
27
|
+
constructor(opt_variable?: IVariableModel<IVariableState>);
|
|
23
28
|
/**
|
|
24
29
|
* Encode the event as JSON.
|
|
25
30
|
*
|
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
* Copyright 2018 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import type {
|
|
6
|
+
import type { IVariableModel, IVariableState } from '../interfaces/i_variable_model.js';
|
|
7
7
|
import type { Workspace } from '../workspace.js';
|
|
8
8
|
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;
|
|
@@ -21,7 +19,7 @@ export declare class VarDelete extends VarBase {
|
|
|
21
19
|
/**
|
|
22
20
|
* @param opt_variable The deleted variable. Undefined for a blank event.
|
|
23
21
|
*/
|
|
24
|
-
constructor(opt_variable?:
|
|
22
|
+
constructor(opt_variable?: IVariableModel<IVariableState>);
|
|
25
23
|
/**
|
|
26
24
|
* Encode the event as JSON.
|
|
27
25
|
*
|
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
* Copyright 2018 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import type {
|
|
6
|
+
import type { IVariableModel, IVariableState } from '../interfaces/i_variable_model.js';
|
|
7
7
|
import type { Workspace } from '../workspace.js';
|
|
8
8
|
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 was renamed.
|
|
12
|
-
*
|
|
13
|
-
* @class
|
|
14
12
|
*/
|
|
15
13
|
export declare class VarRename extends VarBase {
|
|
16
14
|
type: EventType;
|
|
@@ -22,7 +20,7 @@ export declare class VarRename extends VarBase {
|
|
|
22
20
|
* @param opt_variable The renamed variable. Undefined for a blank event.
|
|
23
21
|
* @param newName The new name the variable will be changed to.
|
|
24
22
|
*/
|
|
25
|
-
constructor(opt_variable?:
|
|
23
|
+
constructor(opt_variable?: IVariableModel<IVariableState>, newName?: string);
|
|
26
24
|
/**
|
|
27
25
|
* Encode the event as JSON.
|
|
28
26
|
*
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Class for a variable type change event.
|
|
8
|
+
*
|
|
9
|
+
* @class
|
|
10
|
+
*/
|
|
11
|
+
import type { IVariableModel, IVariableState } from '../interfaces/i_variable_model.js';
|
|
12
|
+
import type { Workspace } from '../workspace.js';
|
|
13
|
+
import { VarBase, VarBaseJson } from './events_var_base.js';
|
|
14
|
+
import { EventType } from './type.js';
|
|
15
|
+
/**
|
|
16
|
+
* Notifies listeners that a variable's type has changed.
|
|
17
|
+
*/
|
|
18
|
+
export declare class VarTypeChange extends VarBase {
|
|
19
|
+
oldType?: string | undefined;
|
|
20
|
+
newType?: string | undefined;
|
|
21
|
+
type: EventType;
|
|
22
|
+
/**
|
|
23
|
+
* @param variable The variable whose type changed. Undefined for a blank event.
|
|
24
|
+
* @param oldType The old type of the variable. Undefined for a blank event.
|
|
25
|
+
* @param newType The new type of the variable. Undefined for a blank event.
|
|
26
|
+
*/
|
|
27
|
+
constructor(variable?: IVariableModel<IVariableState>, oldType?: string | undefined, newType?: string | undefined);
|
|
28
|
+
/**
|
|
29
|
+
* Encode the event as JSON.
|
|
30
|
+
*
|
|
31
|
+
* @returns JSON representation.
|
|
32
|
+
*/
|
|
33
|
+
toJson(): VarTypeChangeJson;
|
|
34
|
+
/**
|
|
35
|
+
* Deserializes the JSON event.
|
|
36
|
+
*
|
|
37
|
+
* @param event The event to append new properties to. Should be a subclass
|
|
38
|
+
* of VarTypeChange, but we can't specify that due to the fact that
|
|
39
|
+
* parameters to static methods in subclasses must be supertypes of
|
|
40
|
+
* parameters to static methods in superclasses.
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
static fromJson(json: VarTypeChangeJson, workspace: Workspace, event?: any): VarTypeChange;
|
|
44
|
+
/**
|
|
45
|
+
* Run a variable type change event.
|
|
46
|
+
*
|
|
47
|
+
* @param forward True if run forward, false if run backward (undo).
|
|
48
|
+
*/
|
|
49
|
+
run(forward: boolean): void;
|
|
50
|
+
}
|
|
51
|
+
export interface VarTypeChangeJson extends VarBaseJson {
|
|
52
|
+
oldType: string;
|
|
53
|
+
newType: string;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=events_var_type_change.d.ts.map
|
package/core/events/type.d.ts
CHANGED
|
@@ -27,6 +27,8 @@ export declare enum EventType {
|
|
|
27
27
|
VAR_DELETE = "var_delete",
|
|
28
28
|
/** Type of event that renames a variable. */
|
|
29
29
|
VAR_RENAME = "var_rename",
|
|
30
|
+
/** Type of event that changes the type of a variable. */
|
|
31
|
+
VAR_TYPE_CHANGE = "var_type_change",
|
|
30
32
|
/**
|
|
31
33
|
* Type of generic event that records a UI change.
|
|
32
34
|
*
|