blockly 9.2.1 → 9.3.0
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 +1615 -1509
- package/blockly_compressed.js +1249 -1136
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js +166 -173
- package/blocks_compressed.js.map +1 -1
- package/core/any_aliases.d.ts +5 -0
- package/core/block.d.ts +49 -17
- package/core/block_animations.d.ts +0 -4
- package/core/block_dragger.d.ts +1 -6
- package/core/block_svg.d.ts +58 -8
- package/core/blockly.d.ts +27 -58
- package/core/blockly_options.d.ts +0 -2
- package/core/blocks.d.ts +0 -2
- package/core/browser_events.d.ts +0 -9
- package/core/bubble.d.ts +0 -2
- package/core/bubble_dragger.d.ts +0 -2
- package/core/bump_objects.d.ts +0 -3
- package/core/clipboard.d.ts +0 -3
- package/core/comment.d.ts +6 -10
- package/core/common.d.ts +0 -12
- package/core/component_manager.d.ts +0 -2
- package/core/connection.d.ts +19 -6
- package/core/connection_checker.d.ts +1 -3
- package/core/connection_db.d.ts +0 -2
- package/core/connection_type.d.ts +0 -2
- package/core/constants.d.ts +0 -4
- package/core/contextmenu.d.ts +0 -11
- package/core/contextmenu_items.d.ts +0 -27
- package/core/contextmenu_registry.d.ts +0 -2
- package/core/css.d.ts +0 -2
- package/core/delete_area.d.ts +0 -2
- package/core/dialog.d.ts +0 -6
- package/core/drag_target.d.ts +0 -2
- package/core/events/events.d.ts +2 -22
- package/core/events/events_abstract.d.ts +7 -3
- package/core/events/events_block_base.d.ts +2 -3
- package/core/events/events_block_change.d.ts +9 -3
- package/core/events/events_block_create.d.ts +6 -4
- package/core/events/events_block_delete.d.ts +7 -4
- package/core/events/events_block_drag.d.ts +7 -3
- package/core/events/events_block_move.d.ts +20 -3
- package/core/events/events_bubble_open.d.ts +3 -2
- package/core/events/events_click.d.ts +6 -3
- package/core/events/events_comment_base.d.ts +1 -2
- package/core/events/events_comment_change.d.ts +3 -3
- package/core/events/events_comment_create.d.ts +2 -3
- package/core/events/events_comment_delete.d.ts +2 -3
- package/core/events/events_comment_move.d.ts +4 -4
- package/core/events/events_marker_move.d.ts +10 -3
- package/core/events/events_selected.d.ts +6 -2
- package/core/events/events_theme_change.d.ts +2 -3
- package/core/events/events_toolbox_item_select.d.ts +3 -3
- package/core/events/events_trashcan_open.d.ts +5 -3
- package/core/events/events_ui.d.ts +0 -1
- package/core/events/events_ui_base.d.ts +0 -2
- package/core/events/events_var_base.d.ts +1 -2
- package/core/events/events_var_create.d.ts +3 -3
- package/core/events/events_var_delete.d.ts +4 -2
- package/core/events/events_var_rename.d.ts +4 -2
- package/core/events/events_viewport.d.ts +13 -2
- package/core/events/utils.d.ts +0 -89
- package/core/events/workspace_events.d.ts +2 -6
- package/core/extensions.d.ts +0 -8
- package/core/field.d.ts +55 -21
- package/core/field_angle.d.ts +61 -51
- package/core/field_checkbox.d.ts +34 -15
- package/core/field_colour.d.ts +56 -46
- package/core/field_dropdown.d.ts +35 -19
- package/core/field_image.d.ts +10 -14
- package/core/field_input.d.ts +39 -25
- package/core/field_label.d.ts +7 -10
- package/core/field_label_serializable.d.ts +4 -6
- package/core/field_multilineinput.d.ts +36 -14
- package/core/field_number.d.ts +27 -19
- package/core/field_registry.d.ts +0 -3
- package/core/field_textinput.d.ts +36 -8
- package/core/field_variable.d.ts +30 -18
- package/core/flyout_base.d.ts +5 -6
- package/core/flyout_button.d.ts +2 -2
- package/core/flyout_horizontal.d.ts +0 -2
- package/core/flyout_metrics_manager.d.ts +0 -2
- package/core/flyout_vertical.d.ts +0 -2
- package/core/generator.d.ts +0 -1
- package/core/gesture.d.ts +5 -18
- package/core/grid.d.ts +0 -2
- package/core/icon.d.ts +0 -2
- package/core/inject.d.ts +0 -1
- package/core/input.d.ts +0 -3
- package/core/input_types.d.ts +0 -2
- package/core/insertion_marker_manager.d.ts +6 -6
- package/core/interfaces/i_ast_node_location.d.ts +0 -2
- package/core/interfaces/i_ast_node_location_svg.d.ts +0 -2
- package/core/interfaces/i_ast_node_location_with_block.d.ts +0 -2
- package/core/interfaces/i_autohideable.d.ts +0 -2
- package/core/interfaces/i_block_dragger.d.ts +0 -2
- package/core/interfaces/i_bounded_element.d.ts +0 -2
- package/core/interfaces/i_bubble.d.ts +0 -2
- package/core/interfaces/i_collapsible_toolbox_item.d.ts +0 -2
- package/core/interfaces/i_component.d.ts +0 -2
- package/core/interfaces/i_connection_checker.d.ts +0 -2
- package/core/interfaces/i_contextmenu.d.ts +0 -1
- package/core/interfaces/i_copyable.d.ts +3 -2
- package/core/interfaces/i_deletable.d.ts +0 -2
- package/core/interfaces/i_delete_area.d.ts +0 -2
- package/core/interfaces/i_drag_target.d.ts +0 -2
- package/core/interfaces/i_draggable.d.ts +0 -2
- package/core/interfaces/i_flyout.d.ts +0 -2
- package/core/interfaces/i_keyboard_accessible.d.ts +0 -2
- package/core/interfaces/i_legacy_procedure_blocks.d.ts +34 -0
- package/core/interfaces/i_metrics_manager.d.ts +8 -8
- package/core/interfaces/i_movable.d.ts +0 -2
- package/core/interfaces/i_positionable.d.ts +0 -2
- package/core/interfaces/i_procedure_block.d.ts +3 -0
- package/core/interfaces/i_procedure_model.d.ts +0 -5
- package/core/interfaces/i_registrable.d.ts +0 -2
- package/core/interfaces/i_selectable.d.ts +0 -2
- package/core/interfaces/i_selectable_toolbox_item.d.ts +4 -2
- package/core/interfaces/i_serializer.d.ts +0 -2
- package/core/interfaces/i_styleable.d.ts +0 -2
- package/core/interfaces/i_toolbox.d.ts +0 -2
- package/core/interfaces/i_toolbox_item.d.ts +0 -2
- package/core/interfaces/i_variable_backed_parameter_model.d.ts +17 -0
- package/core/internal_constants.d.ts +0 -5
- package/core/keyboard_nav/ast_node.d.ts +0 -3
- package/core/keyboard_nav/basic_cursor.d.ts +0 -3
- package/core/keyboard_nav/cursor.d.ts +0 -3
- package/core/keyboard_nav/marker.d.ts +0 -2
- package/core/keyboard_nav/tab_navigate_cursor.d.ts +0 -2
- package/core/marker_manager.d.ts +0 -2
- package/core/menu.d.ts +0 -2
- package/core/menuitem.d.ts +0 -2
- package/core/metrics_manager.d.ts +8 -8
- package/core/mutator.d.ts +0 -2
- package/core/names.d.ts +0 -3
- package/core/{procedures/observable_procedure_map.d.ts → observable_procedure_map.d.ts} +4 -5
- package/core/options.d.ts +0 -2
- package/core/positionable_helpers.d.ts +0 -7
- package/core/procedures.d.ts +7 -28
- package/core/registry.d.ts +0 -11
- package/core/render_management.d.ts +15 -0
- package/core/rendered_connection.d.ts +22 -9
- package/core/renderers/common/block_rendering.d.ts +0 -3
- package/core/renderers/common/constants.d.ts +6 -51
- package/core/renderers/common/debug.d.ts +0 -3
- package/core/renderers/common/debugger.d.ts +9 -23
- package/core/renderers/common/drawer.d.ts +0 -5
- package/core/renderers/common/i_path_object.d.ts +0 -17
- package/core/renderers/common/info.d.ts +2 -12
- package/core/renderers/common/marker_svg.d.ts +2 -4
- package/core/renderers/common/path_object.d.ts +0 -24
- package/core/renderers/common/renderer.d.ts +5 -20
- package/core/renderers/geras/constants.d.ts +0 -5
- package/core/renderers/geras/drawer.d.ts +2 -4
- package/core/renderers/geras/highlight_constants.d.ts +6 -17
- package/core/renderers/geras/highlighter.d.ts +0 -13
- package/core/renderers/geras/info.d.ts +2 -5
- package/core/renderers/geras/measurables/inline_input.d.ts +0 -3
- package/core/renderers/geras/measurables/statement_input.d.ts +0 -3
- package/core/renderers/geras/path_object.d.ts +0 -8
- package/core/renderers/geras/renderer.d.ts +5 -7
- package/core/renderers/measurables/base.d.ts +0 -3
- package/core/renderers/measurables/bottom_row.d.ts +0 -9
- package/core/renderers/measurables/connection.d.ts +0 -3
- package/core/renderers/measurables/external_value_input.d.ts +0 -3
- package/core/renderers/measurables/field.d.ts +0 -3
- package/core/renderers/measurables/hat.d.ts +0 -3
- package/core/renderers/measurables/icon.d.ts +2 -5
- package/core/renderers/measurables/in_row_spacer.d.ts +0 -3
- package/core/renderers/measurables/inline_input.d.ts +1 -4
- package/core/renderers/measurables/input_connection.d.ts +1 -4
- package/core/renderers/measurables/input_row.d.ts +0 -7
- package/core/renderers/measurables/jagged_edge.d.ts +2 -5
- package/core/renderers/measurables/next_connection.d.ts +0 -3
- package/core/renderers/measurables/output_connection.d.ts +0 -3
- package/core/renderers/measurables/previous_connection.d.ts +0 -3
- package/core/renderers/measurables/round_corner.d.ts +0 -3
- package/core/renderers/measurables/row.d.ts +0 -39
- package/core/renderers/measurables/spacer_row.d.ts +0 -3
- package/core/renderers/measurables/square_corner.d.ts +0 -3
- package/core/renderers/measurables/statement_input.d.ts +0 -3
- package/core/renderers/measurables/top_row.d.ts +0 -6
- package/core/renderers/measurables/types.d.ts +0 -31
- package/core/renderers/minimalist/constants.d.ts +2 -4
- package/core/renderers/minimalist/drawer.d.ts +0 -3
- package/core/renderers/minimalist/info.d.ts +0 -4
- package/core/renderers/minimalist/renderer.d.ts +0 -3
- package/core/renderers/thrasos/info.d.ts +0 -4
- package/core/renderers/thrasos/renderer.d.ts +3 -3
- package/core/renderers/zelos/constants.d.ts +3 -17
- package/core/renderers/zelos/drawer.d.ts +0 -3
- package/core/renderers/zelos/info.d.ts +0 -4
- package/core/renderers/zelos/marker_svg.d.ts +0 -2
- package/core/renderers/zelos/measurables/bottom_row.d.ts +0 -3
- package/core/renderers/zelos/measurables/inputs.d.ts +0 -3
- package/core/renderers/zelos/measurables/row_elements.d.ts +0 -3
- package/core/renderers/zelos/measurables/top_row.d.ts +0 -3
- package/core/renderers/zelos/path_object.d.ts +0 -9
- package/core/renderers/zelos/renderer.d.ts +3 -5
- package/core/scrollbar.d.ts +0 -2
- package/core/scrollbar_pair.d.ts +0 -2
- package/core/serialization/blocks.d.ts +3 -9
- package/core/serialization/exceptions.d.ts +0 -8
- package/core/serialization/priorities.d.ts +0 -4
- package/core/serialization/procedures.d.ts +0 -7
- package/core/serialization/registry.d.ts +0 -2
- package/core/serialization/variables.d.ts +0 -4
- package/core/serialization/workspaces.d.ts +0 -2
- package/core/shortcut_items.d.ts +0 -17
- package/core/shortcut_registry.d.ts +0 -2
- package/core/sprites.d.ts +0 -2
- package/core/theme/classic.d.ts +0 -2
- package/core/theme/zelos.d.ts +0 -2
- package/core/theme.d.ts +0 -2
- package/core/theme_manager.d.ts +3 -6
- package/core/toolbox/category.d.ts +5 -7
- package/core/toolbox/collapsible_category.d.ts +0 -4
- package/core/toolbox/separator.d.ts +0 -2
- package/core/toolbox/toolbox.d.ts +2 -5
- package/core/toolbox/toolbox_item.d.ts +0 -2
- package/core/tooltip.d.ts +0 -29
- package/core/touch.d.ts +0 -13
- package/core/trashcan.d.ts +0 -2
- package/core/utils/aria.d.ts +0 -6
- package/core/utils/array.d.ts +0 -1
- package/core/utils/colour.d.ts +0 -12
- package/core/utils/coordinate.d.ts +0 -2
- package/core/utils/deprecation.d.ts +0 -1
- package/core/utils/dom.d.ts +0 -25
- package/core/utils/idgenerator.d.ts +0 -2
- package/core/utils/keycodes.d.ts +0 -2
- package/core/utils/math.d.ts +0 -3
- package/core/utils/metrics.d.ts +0 -1
- package/core/utils/object.d.ts +0 -4
- package/core/utils/parsing.d.ts +0 -4
- package/core/utils/rect.d.ts +0 -2
- package/core/utils/size.d.ts +0 -2
- package/core/utils/string.d.ts +0 -6
- package/core/utils/style.d.ts +0 -8
- package/core/utils/svg.d.ts +0 -2
- package/core/utils/svg_math.d.ts +0 -6
- package/core/utils/svg_paths.d.ts +0 -8
- package/core/utils/toolbox.d.ts +2 -35
- package/core/utils/useragent.d.ts +0 -8
- package/core/utils/xml.d.ts +9 -8
- package/core/utils.d.ts +0 -12
- package/core/variable_map.d.ts +1 -3
- package/core/variable_model.d.ts +0 -1
- package/core/variables.d.ts +13 -17
- package/core/variables_dynamic.d.ts +0 -4
- package/core/warning.d.ts +0 -2
- package/core/widgetdiv.d.ts +0 -10
- package/core/workspace.d.ts +3 -3
- package/core/workspace_audio.d.ts +0 -2
- package/core/workspace_comment.d.ts +1 -3
- package/core/workspace_comment_svg.d.ts +1 -3
- package/core/workspace_dragger.d.ts +0 -2
- package/core/workspace_svg.d.ts +4 -7
- package/core/xml.d.ts +1 -13
- package/core/zoom_controls.d.ts +4 -15
- package/dart_compressed.js +199 -199
- package/dart_compressed.js.map +1 -1
- package/javascript_compressed.js +168 -168
- package/javascript_compressed.js.map +1 -1
- package/lua_compressed.js +211 -211
- package/lua_compressed.js.map +1 -1
- package/msg/bn.js +2 -2
- package/msg/bs.js +7 -7
- package/msg/de.js +1 -1
- package/msg/fi.js +1 -1
- package/msg/fr.js +3 -3
- package/msg/ia.js +5 -5
- package/msg/kn.js +5 -5
- package/msg/ko.js +1 -1
- package/msg/lb.js +22 -22
- package/msg/sd.js +9 -9
- package/msg/skr-arab.js +2 -2
- package/msg/sl.js +18 -18
- package/msg/sw.js +1 -1
- package/msg/zh-hans.js +6 -6
- package/msg/zh-hant.js +2 -2
- package/package.json +9 -9
- package/php_compressed.js +185 -185
- package/php_compressed.js.map +1 -1
- package/python_compressed.js +138 -138
- package/python_compressed.js.map +1 -1
- package/core/events/events_procedure_base.d.ts +0 -26
- package/core/events/events_procedure_change_return.d.ts +0 -40
- package/core/events/events_procedure_create.d.ts +0 -34
- package/core/events/events_procedure_delete.d.ts +0 -32
- package/core/events/events_procedure_enable.d.ts +0 -34
- package/core/events/events_procedure_parameter_base.d.ts +0 -26
- package/core/events/events_procedure_parameter_create.d.ts +0 -42
- package/core/events/events_procedure_parameter_delete.d.ts +0 -41
- package/core/events/events_procedure_parameter_rename.d.ts +0 -36
- package/core/events/events_procedure_rename.d.ts +0 -35
- package/core/procedures/observable_parameter_model.d.ts +0 -62
- package/core/procedures/observable_procedure_model.d.ts +0 -75
- package/core/procedures/update_procedures.d.ts +0 -13
- package/core/utils/sentinel.d.ts +0 -13
|
@@ -3,11 +3,6 @@
|
|
|
3
3
|
* Copyright 2022 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
/**
|
|
7
|
-
* The interface for the data model of a procedure.
|
|
8
|
-
*
|
|
9
|
-
* @namespace Blockly.IProcedureModel
|
|
10
|
-
*/
|
|
11
6
|
import { IParameterModel } from './i_parameter_model.js';
|
|
12
7
|
/**
|
|
13
8
|
* A data model for a procedure.
|
|
@@ -7,8 +7,6 @@ import type { IDeletable } from './i_deletable.js';
|
|
|
7
7
|
import type { IMovable } from './i_movable.js';
|
|
8
8
|
/**
|
|
9
9
|
* The interface for an object that is selectable.
|
|
10
|
-
*
|
|
11
|
-
* @alias Blockly.ISelectable
|
|
12
10
|
*/
|
|
13
11
|
export interface ISelectable extends IDeletable, IMovable {
|
|
14
12
|
id: string;
|
|
@@ -7,8 +7,6 @@ import type { FlyoutItemInfoArray } from '../utils/toolbox';
|
|
|
7
7
|
import type { IToolboxItem } from './i_toolbox_item.js';
|
|
8
8
|
/**
|
|
9
9
|
* Interface for an item in the toolbox that can be selected.
|
|
10
|
-
*
|
|
11
|
-
* @alias Blockly.ISelectableToolboxItem
|
|
12
10
|
*/
|
|
13
11
|
export interface ISelectableToolboxItem extends IToolboxItem {
|
|
14
12
|
/**
|
|
@@ -46,4 +44,8 @@ export interface ISelectableToolboxItem extends IToolboxItem {
|
|
|
46
44
|
*/
|
|
47
45
|
onClick(_e: Event): void;
|
|
48
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Type guard that checks whether an IToolboxItem is an ISelectableToolboxItem.
|
|
49
|
+
*/
|
|
50
|
+
export declare function isSelectableToolboxItem(toolboxItem: IToolboxItem): toolboxItem is ISelectableToolboxItem;
|
|
49
51
|
//# sourceMappingURL=i_selectable_toolbox_item.d.ts.map
|
|
@@ -10,8 +10,6 @@ import type { IFlyout } from './i_flyout.js';
|
|
|
10
10
|
import type { WorkspaceSvg } from '../workspace_svg.js';
|
|
11
11
|
/**
|
|
12
12
|
* Interface for a toolbox.
|
|
13
|
-
*
|
|
14
|
-
* @alias Blockly.IToolbox
|
|
15
13
|
*/
|
|
16
14
|
export interface IToolbox extends IRegistrable {
|
|
17
15
|
/** Initializes the toolbox. */
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { VariableModel } from '../variable_model.js';
|
|
7
|
+
import { IParameterModel } from './i_parameter_model.js';
|
|
8
|
+
/** Interface for a parameter model that holds a variable model. */
|
|
9
|
+
export interface IVariableBackedParameterModel extends IParameterModel {
|
|
10
|
+
/** Returns the variable model held by this type. */
|
|
11
|
+
getVariableModel(): VariableModel;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Returns whether the given object is a variable holder or not.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isVariableBackedParameterModel(param: IParameterModel): param is IVariableBackedParameterModel;
|
|
17
|
+
//# sourceMappingURL=i_variable_backed_parameter_model.d.ts.map
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* Number of characters to truncate a collapsed block to.
|
|
8
8
|
*
|
|
9
|
-
* @alias Blockly.internalConstants.COLLAPSE_CHARS
|
|
10
9
|
* @internal
|
|
11
10
|
*/
|
|
12
11
|
export declare const COLLAPSE_CHARS = 30;
|
|
@@ -14,14 +13,12 @@ export declare const COLLAPSE_CHARS = 30;
|
|
|
14
13
|
* When dragging a block out of a stack, split the stack in two (true), or drag
|
|
15
14
|
* out the block healing the stack (false).
|
|
16
15
|
*
|
|
17
|
-
* @alias Blockly.internalConstants.DRAG_STACK
|
|
18
16
|
* @internal
|
|
19
17
|
*/
|
|
20
18
|
export declare const DRAG_STACK = true;
|
|
21
19
|
/**
|
|
22
20
|
* Lookup table for determining the opposite type of a connection.
|
|
23
21
|
*
|
|
24
|
-
* @alias Blockly.internalConstants.OPPOSITE_TYPE
|
|
25
22
|
* @internal
|
|
26
23
|
*/
|
|
27
24
|
export declare const OPPOSITE_TYPE: number[];
|
|
@@ -30,7 +27,6 @@ export declare const OPPOSITE_TYPE: number[];
|
|
|
30
27
|
* This string indicates that this option in the dropdown is 'Rename
|
|
31
28
|
* variable...' and if selected, should trigger the prompt to rename a variable.
|
|
32
29
|
*
|
|
33
|
-
* @alias Blockly.internalConstants.RENAME_VARIABLE_ID
|
|
34
30
|
* @internal
|
|
35
31
|
*/
|
|
36
32
|
export declare const RENAME_VARIABLE_ID = "RENAME_VARIABLE_ID";
|
|
@@ -39,7 +35,6 @@ export declare const RENAME_VARIABLE_ID = "RENAME_VARIABLE_ID";
|
|
|
39
35
|
* This string indicates that this option in the dropdown is 'Delete the "%1"
|
|
40
36
|
* variable' and if selected, should trigger the prompt to delete a variable.
|
|
41
37
|
*
|
|
42
|
-
* @alias Blockly.internalConstants.DELETE_VARIABLE_ID
|
|
43
38
|
* @internal
|
|
44
39
|
*/
|
|
45
40
|
export declare const DELETE_VARIABLE_ID = "DELETE_VARIABLE_ID";
|
|
@@ -14,8 +14,6 @@ import type { Workspace } from '../workspace.js';
|
|
|
14
14
|
* Class for an AST node.
|
|
15
15
|
* It is recommended that you use one of the createNode methods instead of
|
|
16
16
|
* creating a node directly.
|
|
17
|
-
*
|
|
18
|
-
* @alias Blockly.ASTNode
|
|
19
17
|
*/
|
|
20
18
|
export declare class ASTNode {
|
|
21
19
|
/**
|
|
@@ -37,7 +35,6 @@ export declare class ASTNode {
|
|
|
37
35
|
* Must be in ASTNode.types.
|
|
38
36
|
* @param location The position in the AST.
|
|
39
37
|
* @param opt_params Optional dictionary of options.
|
|
40
|
-
* @alias Blockly.ASTNode
|
|
41
38
|
*/
|
|
42
39
|
constructor(type: string, location: IASTNodeLocation, opt_params?: Params);
|
|
43
40
|
/**
|
|
@@ -9,13 +9,10 @@ import { Cursor } from './cursor.js';
|
|
|
9
9
|
* Class for a basic cursor.
|
|
10
10
|
* This will allow the user to get to all nodes in the AST by hitting next or
|
|
11
11
|
* previous.
|
|
12
|
-
*
|
|
13
|
-
* @alias Blockly.BasicCursor
|
|
14
12
|
*/
|
|
15
13
|
export declare class BasicCursor extends Cursor {
|
|
16
14
|
/** Name used for registering a basic cursor. */
|
|
17
15
|
static readonly registrationName = "basicCursor";
|
|
18
|
-
/** @alias Blockly.BasicCursor */
|
|
19
16
|
constructor();
|
|
20
17
|
/**
|
|
21
18
|
* Find the next node in the pre order traversal.
|
|
@@ -8,12 +8,9 @@ import { Marker } from './marker.js';
|
|
|
8
8
|
/**
|
|
9
9
|
* Class for a cursor.
|
|
10
10
|
* A cursor controls how a user navigates the Blockly AST.
|
|
11
|
-
*
|
|
12
|
-
* @alias Blockly.Cursor
|
|
13
11
|
*/
|
|
14
12
|
export declare class Cursor extends Marker {
|
|
15
13
|
type: string;
|
|
16
|
-
/** @alias Blockly.Cursor */
|
|
17
14
|
constructor();
|
|
18
15
|
/**
|
|
19
16
|
* Find the next connection, field, or block.
|
|
@@ -7,8 +7,6 @@ import { ASTNode } from './ast_node.js';
|
|
|
7
7
|
import { BasicCursor } from './basic_cursor.js';
|
|
8
8
|
/**
|
|
9
9
|
* A cursor for navigating between tab navigable fields.
|
|
10
|
-
*
|
|
11
|
-
* @alias Blockly.TabNavigateCursor
|
|
12
10
|
*/
|
|
13
11
|
export declare class TabNavigateCursor extends BasicCursor {
|
|
14
12
|
/**
|
package/core/marker_manager.d.ts
CHANGED
|
@@ -8,8 +8,6 @@ import type { Marker } from './keyboard_nav/marker.js';
|
|
|
8
8
|
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
9
9
|
/**
|
|
10
10
|
* Class to manage the multiple markers and the cursor on a workspace.
|
|
11
|
-
*
|
|
12
|
-
* @alias Blockly.MarkerManager
|
|
13
11
|
*/
|
|
14
12
|
export declare class MarkerManager {
|
|
15
13
|
private readonly workspace;
|
package/core/menu.d.ts
CHANGED
package/core/menuitem.d.ts
CHANGED
|
@@ -12,8 +12,6 @@ import * as toolboxUtils from './utils/toolbox.js';
|
|
|
12
12
|
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
13
13
|
/**
|
|
14
14
|
* The manager for all workspace metrics calculations.
|
|
15
|
-
*
|
|
16
|
-
* @alias Blockly.MetricsManager
|
|
17
15
|
*/
|
|
18
16
|
export declare class MetricsManager implements IMetricsManager {
|
|
19
17
|
/** The workspace to calculate metrics for. */
|
|
@@ -30,11 +28,14 @@ export declare class MetricsManager implements IMetricsManager {
|
|
|
30
28
|
*/
|
|
31
29
|
protected getDimensionsPx_(elem: IToolbox | null | IFlyout): Size;
|
|
32
30
|
/**
|
|
33
|
-
* Gets the width and the height of the flyout
|
|
34
|
-
* coordinates.
|
|
35
|
-
*
|
|
31
|
+
* Gets the width and the height of the flyout in pixel
|
|
32
|
+
* coordinates. By default, will get metrics for either a simple flyout (owned
|
|
33
|
+
* directly by the workspace) or for the flyout owned by the toolbox. If you
|
|
34
|
+
* pass `opt_own` as `true` then only metrics for the simple flyout will be
|
|
35
|
+
* returned, and it will return 0 for the width and height if the workspace
|
|
36
|
+
* has a category toolbox instead of a simple toolbox.
|
|
36
37
|
*
|
|
37
|
-
* @param opt_own Whether to only return the workspace's own flyout.
|
|
38
|
+
* @param opt_own Whether to only return the workspace's own flyout metrics.
|
|
38
39
|
* @returns The width and height of the flyout.
|
|
39
40
|
*/
|
|
40
41
|
getFlyoutMetrics(opt_own?: boolean): ToolboxMetrics;
|
|
@@ -42,8 +43,7 @@ export declare class MetricsManager implements IMetricsManager {
|
|
|
42
43
|
* Gets the width, height and position of the toolbox on the workspace in
|
|
43
44
|
* pixel coordinates. Returns 0 for the width and height if the workspace has
|
|
44
45
|
* a simple toolbox instead of a category toolbox. To get the width and height
|
|
45
|
-
* of a
|
|
46
|
-
* simple toolbox @see {@link MetricsManager#getFlyoutMetrics}.
|
|
46
|
+
* of a simple toolbox, see {@link MetricsManager#getFlyoutMetrics}.
|
|
47
47
|
*
|
|
48
48
|
* @returns The object with the width, height and position of the toolbox.
|
|
49
49
|
*/
|
package/core/mutator.d.ts
CHANGED
package/core/names.d.ts
CHANGED
|
@@ -7,8 +7,6 @@ import type { VariableMap } from './variable_map.js';
|
|
|
7
7
|
import type { Workspace } from './workspace.js';
|
|
8
8
|
/**
|
|
9
9
|
* Class for a database of entity names (variables, procedures, etc).
|
|
10
|
-
*
|
|
11
|
-
* @alias Blockly.Names
|
|
12
10
|
*/
|
|
13
11
|
export declare class Names {
|
|
14
12
|
static DEVELOPER_VARIABLE_TYPE: NameType;
|
|
@@ -123,7 +121,6 @@ export declare namespace Names {
|
|
|
123
121
|
* getName('foo', 'VARIABLE') = 'foo'
|
|
124
122
|
* getName('foo', 'PROCEDURE') = 'foo2'
|
|
125
123
|
*
|
|
126
|
-
* @alias Blockly.Names.NameType
|
|
127
124
|
*/
|
|
128
125
|
enum NameType {
|
|
129
126
|
DEVELOPER_VARIABLE = "DEVELOPER_VARIABLE",
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
* Copyright 2022 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { IProcedureMap } from '
|
|
7
|
-
import type { IProcedureModel } from '
|
|
8
|
-
import type { Workspace } from '../workspace.js';
|
|
6
|
+
import { IProcedureMap } from './interfaces/i_procedure_map.js';
|
|
7
|
+
import type { IProcedureModel } from './interfaces/i_procedure_model.js';
|
|
9
8
|
export declare class ObservableProcedureMap extends Map<string, IProcedureModel> implements IProcedureMap {
|
|
10
|
-
|
|
11
|
-
constructor(
|
|
9
|
+
/** @internal */
|
|
10
|
+
constructor();
|
|
12
11
|
/**
|
|
13
12
|
* Adds the given procedure model to the procedure map.
|
|
14
13
|
*/
|
package/core/options.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ import type { WorkspaceSvg } from './workspace_svg.js';
|
|
|
10
10
|
/**
|
|
11
11
|
* Enum for vertical positioning.
|
|
12
12
|
*
|
|
13
|
-
* @alias Blockly.uiPosition.verticalPosition
|
|
14
13
|
* @internal
|
|
15
14
|
*/
|
|
16
15
|
export declare enum verticalPosition {
|
|
@@ -20,7 +19,6 @@ export declare enum verticalPosition {
|
|
|
20
19
|
/**
|
|
21
20
|
* Enum for horizontal positioning.
|
|
22
21
|
*
|
|
23
|
-
* @alias Blockly.uiPosition.horizontalPosition
|
|
24
22
|
* @internal
|
|
25
23
|
*/
|
|
26
24
|
export declare enum horizontalPosition {
|
|
@@ -30,7 +28,6 @@ export declare enum horizontalPosition {
|
|
|
30
28
|
/**
|
|
31
29
|
* An object defining a horizontal and vertical positioning.
|
|
32
30
|
*
|
|
33
|
-
* @alias Blockly.uiPosition.Position
|
|
34
31
|
* @internal
|
|
35
32
|
*/
|
|
36
33
|
export interface Position {
|
|
@@ -40,7 +37,6 @@ export interface Position {
|
|
|
40
37
|
/**
|
|
41
38
|
* Enum for bump rules to use for dealing with collisions.
|
|
42
39
|
*
|
|
43
|
-
* @alias Blockly.uiPosition.bumpDirection
|
|
44
40
|
* @internal
|
|
45
41
|
*/
|
|
46
42
|
export declare enum bumpDirection {
|
|
@@ -60,7 +56,6 @@ export declare enum bumpDirection {
|
|
|
60
56
|
* @param metrics The workspace UI metrics.
|
|
61
57
|
* @param workspace The workspace.
|
|
62
58
|
* @returns The suggested start position.
|
|
63
|
-
* @alias Blockly.uiPosition.getStartPositionRect
|
|
64
59
|
* @internal
|
|
65
60
|
*/
|
|
66
61
|
export declare function getStartPositionRect(position: Position, size: Size, horizontalPadding: number, verticalPadding: number, metrics: UiMetrics, workspace: WorkspaceSvg): Rect;
|
|
@@ -73,7 +68,6 @@ export declare function getStartPositionRect(position: Position, size: Size, hor
|
|
|
73
68
|
* @param workspace The workspace.
|
|
74
69
|
* @param metrics The workspace metrics.
|
|
75
70
|
* @returns The suggested corner position.
|
|
76
|
-
* @alias Blockly.uiPosition.getCornerOppositeToolbox
|
|
77
71
|
* @internal
|
|
78
72
|
*/
|
|
79
73
|
export declare function getCornerOppositeToolbox(workspace: WorkspaceSvg, metrics: UiMetrics): Position;
|
|
@@ -89,7 +83,6 @@ export declare function getCornerOppositeToolbox(workspace: WorkspaceSvg, metric
|
|
|
89
83
|
* @param savedPositions List of rectangles that represent the positions of UI
|
|
90
84
|
* elements already placed.
|
|
91
85
|
* @returns The suggested position rectangle.
|
|
92
|
-
* @alias Blockly.uiPosition.bumpPositionRect
|
|
93
86
|
* @internal
|
|
94
87
|
*/
|
|
95
88
|
export declare function bumpPositionRect(startRect: Rect, margin: number, bumpDir: bumpDirection, savedPositions: Rect[]): Rect;
|
package/core/procedures.d.ts
CHANGED
|
@@ -7,9 +7,12 @@ import './events/events_block_change.js';
|
|
|
7
7
|
import type { Block } from './block.js';
|
|
8
8
|
import type { Abstract } from './events/events_abstract.js';
|
|
9
9
|
import { Field } from './field.js';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
10
|
+
import { IParameterModel } from './interfaces/i_parameter_model.js';
|
|
11
|
+
import { IProcedureMap } from './interfaces/i_procedure_map.js';
|
|
12
|
+
import { IProcedureModel } from './interfaces/i_procedure_model.js';
|
|
13
|
+
import { IProcedureBlock, isProcedureBlock } from './interfaces/i_procedure_block.js';
|
|
14
|
+
import { ProcedureTuple } from './interfaces/i_legacy_procedure_blocks.js';
|
|
15
|
+
import { ObservableProcedureMap } from './observable_procedure_map.js';
|
|
13
16
|
import type { Workspace } from './workspace.js';
|
|
14
17
|
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
15
18
|
/**
|
|
@@ -18,27 +21,12 @@ import type { WorkspaceSvg } from './workspace_svg.js';
|
|
|
18
21
|
* procedure blocks.
|
|
19
22
|
* See also Blockly.Variables.CATEGORY_NAME and
|
|
20
23
|
* Blockly.VariablesDynamic.CATEGORY_NAME.
|
|
21
|
-
*
|
|
22
|
-
* @alias Blockly.Procedures.CATEGORY_NAME
|
|
23
24
|
*/
|
|
24
25
|
export declare const CATEGORY_NAME = "PROCEDURE";
|
|
25
26
|
/**
|
|
26
27
|
* The default argument for a procedures_mutatorarg block.
|
|
27
|
-
*
|
|
28
|
-
* @alias Blockly.Procedures.DEFAULT_ARG
|
|
29
28
|
*/
|
|
30
29
|
export declare const DEFAULT_ARG = "x";
|
|
31
|
-
export type ProcedureTuple = [string, string[], boolean];
|
|
32
|
-
/**
|
|
33
|
-
* Procedure block type.
|
|
34
|
-
*
|
|
35
|
-
* @alias Blockly.Procedures.ProcedureBlock
|
|
36
|
-
*/
|
|
37
|
-
export interface ProcedureBlock {
|
|
38
|
-
getProcedureCall: () => string;
|
|
39
|
-
renameProcedure: (p1: string, p2: string) => void;
|
|
40
|
-
getProcedureDef: () => ProcedureTuple;
|
|
41
|
-
}
|
|
42
30
|
/**
|
|
43
31
|
* Find all user-created procedure definitions in a workspace.
|
|
44
32
|
*
|
|
@@ -46,7 +34,6 @@ export interface ProcedureBlock {
|
|
|
46
34
|
* @returns Pair of arrays, the first contains procedures without return
|
|
47
35
|
* variables, the second with. Each procedure is defined by a three-element
|
|
48
36
|
* list of name, parameter list, and return value boolean.
|
|
49
|
-
* @alias Blockly.Procedures.allProcedures
|
|
50
37
|
*/
|
|
51
38
|
export declare function allProcedures(root: Workspace): [
|
|
52
39
|
ProcedureTuple[],
|
|
@@ -60,7 +47,6 @@ export declare function allProcedures(root: Workspace): [
|
|
|
60
47
|
* @param name Proposed procedure name.
|
|
61
48
|
* @param block Block to disambiguate.
|
|
62
49
|
* @returns Non-colliding name.
|
|
63
|
-
* @alias Blockly.Procedures.findLegalName
|
|
64
50
|
*/
|
|
65
51
|
export declare function findLegalName(name: string, block: Block): string;
|
|
66
52
|
/**
|
|
@@ -71,7 +57,6 @@ export declare function findLegalName(name: string, block: Block): string;
|
|
|
71
57
|
* @param opt_exclude Optional block to exclude from comparisons (one doesn't
|
|
72
58
|
* want to collide with oneself).
|
|
73
59
|
* @returns True if the name is used, otherwise return false.
|
|
74
|
-
* @alias Blockly.Procedures.isNameUsed
|
|
75
60
|
*/
|
|
76
61
|
export declare function isNameUsed(name: string, workspace: Workspace, opt_exclude?: Block): boolean;
|
|
77
62
|
/**
|
|
@@ -79,7 +64,6 @@ export declare function isNameUsed(name: string, workspace: Workspace, opt_exclu
|
|
|
79
64
|
*
|
|
80
65
|
* @param name The proposed new name.
|
|
81
66
|
* @returns The accepted name.
|
|
82
|
-
* @alias Blockly.Procedures.rename
|
|
83
67
|
*/
|
|
84
68
|
export declare function rename(this: Field, name: string): string;
|
|
85
69
|
/**
|
|
@@ -87,7 +71,6 @@ export declare function rename(this: Field, name: string): string;
|
|
|
87
71
|
*
|
|
88
72
|
* @param workspace The workspace containing procedures.
|
|
89
73
|
* @returns Array of XML block elements.
|
|
90
|
-
* @alias Blockly.Procedures.flyoutCategory
|
|
91
74
|
*/
|
|
92
75
|
export declare function flyoutCategory(workspace: WorkspaceSvg): Element[];
|
|
93
76
|
/**
|
|
@@ -95,7 +78,6 @@ export declare function flyoutCategory(workspace: WorkspaceSvg): Element[];
|
|
|
95
78
|
* update and adds a mutator change listener to the mutator workspace.
|
|
96
79
|
*
|
|
97
80
|
* @param e The event that triggered this listener.
|
|
98
|
-
* @alias Blockly.Procedures.mutatorOpenListener
|
|
99
81
|
* @internal
|
|
100
82
|
*/
|
|
101
83
|
export declare function mutatorOpenListener(e: Abstract): void;
|
|
@@ -105,7 +87,6 @@ export declare function mutatorOpenListener(e: Abstract): void;
|
|
|
105
87
|
* @param name Name of procedure.
|
|
106
88
|
* @param workspace The workspace to find callers in.
|
|
107
89
|
* @returns Array of caller blocks.
|
|
108
|
-
* @alias Blockly.Procedures.getCallers
|
|
109
90
|
*/
|
|
110
91
|
export declare function getCallers(name: string, workspace: Workspace): Block[];
|
|
111
92
|
/**
|
|
@@ -113,7 +94,6 @@ export declare function getCallers(name: string, workspace: Workspace): Block[];
|
|
|
113
94
|
* callers.
|
|
114
95
|
*
|
|
115
96
|
* @param defBlock Procedure definition block.
|
|
116
|
-
* @alias Blockly.Procedures.mutateCallers
|
|
117
97
|
*/
|
|
118
98
|
export declare function mutateCallers(defBlock: Block): void;
|
|
119
99
|
/**
|
|
@@ -122,8 +102,7 @@ export declare function mutateCallers(defBlock: Block): void;
|
|
|
122
102
|
* @param name Name of procedure.
|
|
123
103
|
* @param workspace The workspace to search.
|
|
124
104
|
* @returns The procedure definition block, or null not found.
|
|
125
|
-
* @alias Blockly.Procedures.getDefinition
|
|
126
105
|
*/
|
|
127
106
|
export declare function getDefinition(name: string, workspace: Workspace): Block | null;
|
|
128
|
-
export { ObservableProcedureMap,
|
|
107
|
+
export { ObservableProcedureMap, IParameterModel, IProcedureBlock, isProcedureBlock, IProcedureMap, IProcedureModel, ProcedureTuple, };
|
|
129
108
|
//# sourceMappingURL=procedures.d.ts.map
|
package/core/registry.d.ts
CHANGED
|
@@ -25,14 +25,10 @@ export declare const TEST_ONLY: {
|
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
27
|
* The string used to register the default class for a type of plugin.
|
|
28
|
-
*
|
|
29
|
-
* @alias Blockly.registry.DEFAULT
|
|
30
28
|
*/
|
|
31
29
|
export declare const DEFAULT = "default";
|
|
32
30
|
/**
|
|
33
31
|
* A name with the type of the element stored in the generic.
|
|
34
|
-
*
|
|
35
|
-
* @alias Blockly.registry.Type
|
|
36
32
|
*/
|
|
37
33
|
export declare class Type<_T> {
|
|
38
34
|
private readonly name;
|
|
@@ -71,7 +67,6 @@ export declare class Type<_T> {
|
|
|
71
67
|
* @throws {Error} if the type or name is empty, a name with the given type has
|
|
72
68
|
* already been registered, or if the given class or object is not valid for
|
|
73
69
|
* its type.
|
|
74
|
-
* @alias Blockly.registry.register
|
|
75
70
|
*/
|
|
76
71
|
export declare function register<T>(type: string | Type<T>, name: string, registryItem: (new (...p1: any[]) => T) | null | any, opt_allowOverrides?: boolean): void;
|
|
77
72
|
/**
|
|
@@ -80,7 +75,6 @@ export declare function register<T>(type: string | Type<T>, name: string, regist
|
|
|
80
75
|
* @param type The type of the plugin.
|
|
81
76
|
* (e.g. Field, Renderer)
|
|
82
77
|
* @param name The plugin's name. (Ex. field_angle, geras)
|
|
83
|
-
* @alias Blockly.registry.unregister
|
|
84
78
|
*/
|
|
85
79
|
export declare function unregister<T>(type: string | Type<T>, name: string): void;
|
|
86
80
|
/**
|
|
@@ -92,7 +86,6 @@ export declare function unregister<T>(type: string | Type<T>, name: string): voi
|
|
|
92
86
|
* @param name The plugin's name. (Ex. field_angle, geras)
|
|
93
87
|
* @returns True if the registry has an item with the given type and name, false
|
|
94
88
|
* otherwise.
|
|
95
|
-
* @alias Blockly.registry.hasItem
|
|
96
89
|
*/
|
|
97
90
|
export declare function hasItem<T>(type: string | Type<T>, name: string): boolean;
|
|
98
91
|
/**
|
|
@@ -104,7 +97,6 @@ export declare function hasItem<T>(type: string | Type<T>, name: string): boolea
|
|
|
104
97
|
* @param opt_throwIfMissing Whether or not to throw an error if we are unable
|
|
105
98
|
* to find the plugin.
|
|
106
99
|
* @returns The class with the given name and type or null if none exists.
|
|
107
|
-
* @alias Blockly.registry.getClass
|
|
108
100
|
*/
|
|
109
101
|
export declare function getClass<T>(type: string | Type<T>, name: string, opt_throwIfMissing?: boolean): (new (...p1: any[]) => T) | null;
|
|
110
102
|
/**
|
|
@@ -116,7 +108,6 @@ export declare function getClass<T>(type: string | Type<T>, name: string, opt_th
|
|
|
116
108
|
* @param opt_throwIfMissing Whether or not to throw an error if we are unable
|
|
117
109
|
* to find the object.
|
|
118
110
|
* @returns The object with the given name and type or null if none exists.
|
|
119
|
-
* @alias Blockly.registry.getObject
|
|
120
111
|
*/
|
|
121
112
|
export declare function getObject<T>(type: string | Type<T>, name: string, opt_throwIfMissing?: boolean): T | null;
|
|
122
113
|
/**
|
|
@@ -128,7 +119,6 @@ export declare function getObject<T>(type: string | Type<T>, name: string, opt_t
|
|
|
128
119
|
* @param opt_throwIfMissing Whether or not to throw an error if we are unable
|
|
129
120
|
* to find the object. False by default.
|
|
130
121
|
* @returns A map of objects with the given type, or null if none exists.
|
|
131
|
-
* @alias Blockly.registry.getAllItems
|
|
132
122
|
*/
|
|
133
123
|
export declare function getAllItems<T>(type: string | Type<T>, opt_cased?: boolean, opt_throwIfMissing?: boolean): {
|
|
134
124
|
[key: string]: T | null | (new (...p1: any[]) => T);
|
|
@@ -142,7 +132,6 @@ export declare function getAllItems<T>(type: string | Type<T>, opt_cased?: boole
|
|
|
142
132
|
* @param opt_throwIfMissing Whether or not to throw an error if we are unable
|
|
143
133
|
* to find the plugin.
|
|
144
134
|
* @returns The class for the plugin.
|
|
145
|
-
* @alias Blockly.registry.getClassFromOptions
|
|
146
135
|
*/
|
|
147
136
|
export declare function getClassFromOptions<T>(type: Type<T>, options: Options, opt_throwIfMissing?: boolean): (new (...p1: any[]) => T) | null;
|
|
148
137
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { BlockSvg } from './block_svg.js';
|
|
7
|
+
/**
|
|
8
|
+
* Registers that the given block and all of its parents need to be rerendered,
|
|
9
|
+
* and registers a callback to do so after a delay, to allowf or batching.
|
|
10
|
+
*
|
|
11
|
+
* @param block The block to rerender.
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare function queueRender(block: BlockSvg): void;
|
|
15
|
+
//# sourceMappingURL=render_management.d.ts.map
|