blockly 9.3.0-beta.0 → 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 +1674 -1520
- package/blockly_compressed.js +1313 -1152
- 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_drag_surface.d.ts +135 -0
- package/core/block_dragger.d.ts +2 -7
- package/core/block_svg.d.ts +72 -9
- package/core/blockly.d.ts +29 -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 +6 -4
- package/core/bubble_dragger.d.ts +2 -3
- 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_abstract.d.ts +0 -3
- package/core/events/events_block_base.d.ts +0 -2
- package/core/events/events_block_change.d.ts +0 -2
- package/core/events/events_block_create.d.ts +0 -2
- package/core/events/events_block_delete.d.ts +0 -2
- package/core/events/events_block_drag.d.ts +0 -2
- package/core/events/events_block_move.d.ts +0 -2
- package/core/events/events_bubble_open.d.ts +0 -2
- package/core/events/events_click.d.ts +0 -2
- package/core/events/events_comment_base.d.ts +0 -2
- package/core/events/events_comment_change.d.ts +0 -2
- package/core/events/events_comment_create.d.ts +0 -2
- package/core/events/events_comment_delete.d.ts +0 -2
- package/core/events/events_comment_move.d.ts +0 -2
- package/core/events/events_marker_move.d.ts +0 -2
- package/core/events/events_selected.d.ts +0 -2
- package/core/events/events_theme_change.d.ts +0 -2
- package/core/events/events_toolbox_item_select.d.ts +0 -2
- package/core/events/events_trashcan_open.d.ts +0 -2
- 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 +0 -2
- package/core/events/events_var_create.d.ts +0 -2
- package/core/events/events_viewport.d.ts +0 -2
- package/core/events/utils.d.ts +0 -73
- package/core/events/workspace_events.d.ts +0 -2
- package/core/extensions.d.ts +0 -8
- package/core/field.d.ts +16 -15
- package/core/field_angle.d.ts +60 -50
- package/core/field_checkbox.d.ts +22 -10
- package/core/field_colour.d.ts +55 -42
- package/core/field_dropdown.d.ts +34 -18
- package/core/field_image.d.ts +9 -12
- package/core/field_input.d.ts +34 -11
- package/core/field_label.d.ts +7 -10
- package/core/field_label_serializable.d.ts +4 -6
- package/core/field_multilineinput.d.ts +34 -12
- package/core/field_number.d.ts +27 -19
- package/core/field_registry.d.ts +0 -3
- package/core/field_textinput.d.ts +28 -12
- package/core/field_variable.d.ts +28 -16
- 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 +4 -17
- 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 +1 -3
- package/core/interfaces/i_bounded_element.d.ts +0 -2
- package/core/interfaces/i_bubble.d.ts +6 -4
- 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 +0 -2
- package/core/interfaces/i_movable.d.ts +0 -2
- package/core/interfaces/i_positionable.d.ts +0 -2
- 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 +0 -2
- package/core/mutator.d.ts +0 -2
- package/core/names.d.ts +0 -3
- package/core/options.d.ts +0 -2
- package/core/positionable_helpers.d.ts +0 -7
- package/core/procedures.d.ts +2 -25
- 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/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 +16 -5
- package/core/workspace_drag_surface_svg.d.ts +74 -0
- package/core/workspace_dragger.d.ts +3 -2
- package/core/workspace_svg.d.ts +48 -8
- 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 +6 -6
- 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/utils/sentinel.d.ts +0 -18
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import './events/events_selected.js';
|
|
7
|
+
import type { BlockDragSurfaceSvg } from './block_drag_surface.js';
|
|
7
8
|
import type { IBoundedElement } from './interfaces/i_bounded_element.js';
|
|
8
9
|
import type { IBubble } from './interfaces/i_bubble.js';
|
|
9
10
|
import type { CopyData, ICopyable } from './interfaces/i_copyable.js';
|
|
@@ -13,8 +14,6 @@ import { WorkspaceComment } from './workspace_comment.js';
|
|
|
13
14
|
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
14
15
|
/**
|
|
15
16
|
* Class for a workspace comment's SVG representation.
|
|
16
|
-
*
|
|
17
|
-
* @alias Blockly.WorkspaceCommentSvg
|
|
18
17
|
*/
|
|
19
18
|
export declare class WorkspaceCommentSvg extends WorkspaceComment implements IBoundedElement, IBubble, ICopyable {
|
|
20
19
|
/**
|
|
@@ -43,9 +42,10 @@ export declare class WorkspaceCommentSvg extends WorkspaceComment implements IBo
|
|
|
43
42
|
private focused_;
|
|
44
43
|
private autoLayout_;
|
|
45
44
|
private readonly svgGroup_;
|
|
46
|
-
svgRect_:
|
|
45
|
+
svgRect_: SVGRectElement;
|
|
47
46
|
/** Whether the comment is rendered onscreen and is a part of the DOM. */
|
|
48
47
|
private rendered_;
|
|
48
|
+
private readonly useDragSurface_;
|
|
49
49
|
/**
|
|
50
50
|
* @param workspace The block's workspace.
|
|
51
51
|
* @param content The content of this workspace comment.
|
|
@@ -147,12 +147,23 @@ export declare class WorkspaceCommentSvg extends WorkspaceComment implements IBo
|
|
|
147
147
|
*/
|
|
148
148
|
translate(x: number, y: number): void;
|
|
149
149
|
/**
|
|
150
|
-
* Move this comment
|
|
150
|
+
* Move this comment to its workspace's drag surface, accounting for
|
|
151
|
+
* positioning. Generally should be called at the same time as
|
|
152
|
+
* setDragging(true). Does nothing if useDragSurface_ is false.
|
|
151
153
|
*
|
|
154
|
+
* @internal
|
|
155
|
+
*/
|
|
156
|
+
moveToDragSurface(): void;
|
|
157
|
+
/**
|
|
158
|
+
* Move this comment during a drag, taking into account whether we are using a
|
|
159
|
+
* drag surface to translate blocks.
|
|
160
|
+
*
|
|
161
|
+
* @param dragSurface The surface that carries rendered items during a drag,
|
|
162
|
+
* or null if no drag surface is in use.
|
|
152
163
|
* @param newLoc The location to translate to, in workspace coordinates.
|
|
153
164
|
* @internal
|
|
154
165
|
*/
|
|
155
|
-
moveDuringDrag(newLoc: Coordinate): void;
|
|
166
|
+
moveDuringDrag(dragSurface: BlockDragSurfaceSvg, newLoc: Coordinate): void;
|
|
156
167
|
/**
|
|
157
168
|
* Move the bubble group to the specified location in workspace coordinates.
|
|
158
169
|
*
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2016 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { Coordinate } from './utils/coordinate.js';
|
|
7
|
+
/**
|
|
8
|
+
* Blocks are moved into this SVG during a drag, improving performance.
|
|
9
|
+
* The entire SVG is translated using CSS transforms instead of SVG so the
|
|
10
|
+
* blocks are never repainted during drag improving performance.
|
|
11
|
+
*
|
|
12
|
+
* @alias Blockly.WorkspaceDragSurfaceSvg
|
|
13
|
+
*/
|
|
14
|
+
export declare class WorkspaceDragSurfaceSvg {
|
|
15
|
+
private readonly container;
|
|
16
|
+
/**
|
|
17
|
+
* The SVG drag surface. Set once by WorkspaceDragSurfaceSvg.createDom.
|
|
18
|
+
*/
|
|
19
|
+
private SVG;
|
|
20
|
+
/**
|
|
21
|
+
* The element to insert the block canvas and bubble canvas after when it
|
|
22
|
+
* goes back in the DOM at the end of a drag.
|
|
23
|
+
*/
|
|
24
|
+
private previousSibling;
|
|
25
|
+
/** @param container Containing element. */
|
|
26
|
+
constructor(container: Element);
|
|
27
|
+
/** Create the drag surface and inject it into the container. */
|
|
28
|
+
createDom(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Translate the entire drag surface during a drag.
|
|
31
|
+
* We translate the drag surface instead of the blocks inside the surface
|
|
32
|
+
* so that the browser avoids repainting the SVG.
|
|
33
|
+
* Because of this, the drag coordinates must be adjusted by scale.
|
|
34
|
+
*
|
|
35
|
+
* @param x X translation for the entire surface
|
|
36
|
+
* @param y Y translation for the entire surface
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
translateSurface(x: number, y: number): void;
|
|
40
|
+
/**
|
|
41
|
+
* Reports the surface translation in scaled workspace coordinates.
|
|
42
|
+
* Use this when finishing a drag to return blocks to the correct position.
|
|
43
|
+
*
|
|
44
|
+
* @returns Current translation of the surface
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
getSurfaceTranslation(): Coordinate;
|
|
48
|
+
/**
|
|
49
|
+
* Move the blockCanvas and bubbleCanvas out of the surface SVG and on to
|
|
50
|
+
* newSurface.
|
|
51
|
+
*
|
|
52
|
+
* @param newSurface The element to put the drag surface contents into.
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
clearAndHide(newSurface: SVGElement): void;
|
|
56
|
+
/**
|
|
57
|
+
* Set the SVG to have the block canvas and bubble canvas in it and then
|
|
58
|
+
* show the surface.
|
|
59
|
+
*
|
|
60
|
+
* @param blockCanvas The block canvas <g> element from the
|
|
61
|
+
* workspace.
|
|
62
|
+
* @param bubbleCanvas The <g> element that contains the
|
|
63
|
+
bubbles.
|
|
64
|
+
* @param previousSibling The element to insert the block canvas and
|
|
65
|
+
bubble canvas after when it goes back in the DOM at the end of a
|
|
66
|
+
drag.
|
|
67
|
+
* @param width The width of the workspace SVG element.
|
|
68
|
+
* @param height The height of the workspace SVG element.
|
|
69
|
+
* @param scale The scale of the workspace being dragged.
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
setContentsAndShow(blockCanvas: SVGElement, bubbleCanvas: SVGElement, previousSibling: Element, width: number, height: number, scale: number): void;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=workspace_drag_surface_svg.d.ts.map
|
|
@@ -8,8 +8,9 @@ import type { WorkspaceSvg } from './workspace_svg.js';
|
|
|
8
8
|
/**
|
|
9
9
|
* Class for a workspace dragger. It moves the workspace around when it is
|
|
10
10
|
* being dragged by a mouse or touch.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Note that the workspace itself manages whether or not it has a drag surface
|
|
12
|
+
* and how to do translations based on that. This simply passes the right
|
|
13
|
+
* commands based on events.
|
|
13
14
|
*/
|
|
14
15
|
export declare class WorkspaceDragger {
|
|
15
16
|
private workspace;
|
package/core/workspace_svg.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import './events/events_block_create.js';
|
|
|
7
7
|
import './events/events_theme_change.js';
|
|
8
8
|
import './events/events_viewport.js';
|
|
9
9
|
import type { Block } from './block.js';
|
|
10
|
+
import type { BlockDragSurfaceSvg } from './block_drag_surface.js';
|
|
10
11
|
import type { BlockSvg } from './block_svg.js';
|
|
11
12
|
import * as browserEvents from './browser_events.js';
|
|
12
13
|
import { ComponentManager } from './component_manager.js';
|
|
@@ -39,13 +40,12 @@ import type { VariableModel } from './variable_model.js';
|
|
|
39
40
|
import { Workspace } from './workspace.js';
|
|
40
41
|
import { WorkspaceAudio } from './workspace_audio.js';
|
|
41
42
|
import { WorkspaceComment } from './workspace_comment.js';
|
|
43
|
+
import type { WorkspaceDragSurfaceSvg } from './workspace_drag_surface_svg.js';
|
|
42
44
|
import { ZoomControls } from './zoom_controls.js';
|
|
43
45
|
import { ContextMenuOption } from './contextmenu_registry.js';
|
|
44
46
|
/**
|
|
45
47
|
* Class for a workspace. This is an onscreen area with optional trashcan,
|
|
46
48
|
* scrollbars, bubbles, and dragging.
|
|
47
|
-
*
|
|
48
|
-
* @alias Blockly.WorkspaceSvg
|
|
49
49
|
*/
|
|
50
50
|
export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
|
51
51
|
/**
|
|
@@ -164,6 +164,22 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
|
|
|
164
164
|
* @internal
|
|
165
165
|
*/
|
|
166
166
|
currentGesture_: Gesture | null;
|
|
167
|
+
/** This workspace's surface for dragging blocks, if it exists. */
|
|
168
|
+
private readonly blockDragSurface;
|
|
169
|
+
/** This workspace's drag surface, if it exists. */
|
|
170
|
+
private readonly workspaceDragSurface;
|
|
171
|
+
/**
|
|
172
|
+
* Whether to move workspace to the drag surface when it is dragged.
|
|
173
|
+
* True if it should move, false if it should be translated directly.
|
|
174
|
+
*/
|
|
175
|
+
private readonly useWorkspaceDragSurface;
|
|
176
|
+
/**
|
|
177
|
+
* Whether the drag surface is actively in use. When true, calls to
|
|
178
|
+
* translate will translate the drag surface instead of the translating the
|
|
179
|
+
* workspace directly.
|
|
180
|
+
* This is set to true in setupDragSurface and to false in resetDragSurface.
|
|
181
|
+
*/
|
|
182
|
+
private isDragSurfaceActive;
|
|
167
183
|
/**
|
|
168
184
|
* The first parent div with 'injectionDiv' in the name, or null if not set.
|
|
169
185
|
* Access this with getInjectionDiv.
|
|
@@ -240,8 +256,10 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
|
|
|
240
256
|
zoomControls_: ZoomControls | null;
|
|
241
257
|
/**
|
|
242
258
|
* @param options Dictionary of options.
|
|
259
|
+
* @param opt_blockDragSurface Drag surface for blocks.
|
|
260
|
+
* @param opt_wsDragSurface Drag surface for the workspace.
|
|
243
261
|
*/
|
|
244
|
-
constructor(options: Options);
|
|
262
|
+
constructor(options: Options, opt_blockDragSurface?: BlockDragSurfaceSvg, opt_wsDragSurface?: WorkspaceDragSurfaceSvg);
|
|
245
263
|
/**
|
|
246
264
|
* Get the marker manager for this workspace.
|
|
247
265
|
*
|
|
@@ -527,6 +545,29 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
|
|
|
527
545
|
* the Blockly div.
|
|
528
546
|
*/
|
|
529
547
|
translate(x: number, y: number): void;
|
|
548
|
+
/**
|
|
549
|
+
* Called at the end of a workspace drag to take the contents
|
|
550
|
+
* out of the drag surface and put them back into the workspace SVG.
|
|
551
|
+
* Does nothing if the workspace drag surface is not enabled.
|
|
552
|
+
*
|
|
553
|
+
* @internal
|
|
554
|
+
*/
|
|
555
|
+
resetDragSurface(): void;
|
|
556
|
+
/**
|
|
557
|
+
* Called at the beginning of a workspace drag to move contents of
|
|
558
|
+
* the workspace to the drag surface.
|
|
559
|
+
* Does nothing if the drag surface is not enabled.
|
|
560
|
+
*
|
|
561
|
+
* @internal
|
|
562
|
+
*/
|
|
563
|
+
setupDragSurface(): void;
|
|
564
|
+
/**
|
|
565
|
+
* Gets the drag surface blocks are moved to when a drag is started.
|
|
566
|
+
*
|
|
567
|
+
* @returns This workspace's block drag surface, if one is in use.
|
|
568
|
+
* @internal
|
|
569
|
+
*/
|
|
570
|
+
getBlockDragSurface(): BlockDragSurfaceSvg | null;
|
|
530
571
|
/**
|
|
531
572
|
* Returns the horizontal offset of the workspace.
|
|
532
573
|
* Intended for LTR/RTL compatibility in XML.
|
|
@@ -721,8 +762,6 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
|
|
|
721
762
|
updateToolbox(toolboxDef: toolbox.ToolboxDefinition | null): void;
|
|
722
763
|
/** Mark this workspace as the currently focused main workspace. */
|
|
723
764
|
markFocused(): void;
|
|
724
|
-
/** Set the workspace to have focus in the browser. */
|
|
725
|
-
private setBrowserFocus;
|
|
726
765
|
/**
|
|
727
766
|
* Zooms the workspace in or out relative to/centered on the given (x, y)
|
|
728
767
|
* coordinate.
|
|
@@ -762,11 +801,13 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
|
|
|
762
801
|
scrollCenter(): void;
|
|
763
802
|
/**
|
|
764
803
|
* Scroll the workspace to center on the given block. If the block has other
|
|
765
|
-
* blocks stacked below it, the workspace will be centered on the stack
|
|
804
|
+
* blocks stacked below it, the workspace will be centered on the stack,
|
|
805
|
+
* unless blockOnly is true.
|
|
766
806
|
*
|
|
767
807
|
* @param id ID of block center on.
|
|
808
|
+
* @param blockOnly True to center only on the block itself, not its stack.
|
|
768
809
|
*/
|
|
769
|
-
centerOnBlock(id: string | null): void;
|
|
810
|
+
centerOnBlock(id: string | null, blockOnly?: boolean): void;
|
|
770
811
|
/**
|
|
771
812
|
* Set the workspace's zoom factor.
|
|
772
813
|
*
|
|
@@ -974,7 +1015,6 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
|
|
|
974
1015
|
* scrollbars accordingly.
|
|
975
1016
|
*
|
|
976
1017
|
* @param workspace The workspace to resize.
|
|
977
|
-
* @alias Blockly.WorkspaceSvg.resizeSvgContents
|
|
978
1018
|
* @internal
|
|
979
1019
|
*/
|
|
980
1020
|
export declare function resizeSvgContents(workspace: WorkspaceSvg): void;
|
package/core/xml.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ import type { WorkspaceSvg } from './workspace_svg.js';
|
|
|
13
13
|
* @param workspace The workspace containing blocks.
|
|
14
14
|
* @param opt_noId True if the encoder should skip the block IDs.
|
|
15
15
|
* @returns XML DOM element.
|
|
16
|
-
* @alias Blockly.Xml.workspaceToDom
|
|
17
16
|
*/
|
|
18
17
|
export declare function workspaceToDom(workspace: Workspace, opt_noId?: boolean): Element;
|
|
19
18
|
/**
|
|
@@ -21,7 +20,6 @@ export declare function workspaceToDom(workspace: Workspace, opt_noId?: boolean)
|
|
|
21
20
|
*
|
|
22
21
|
* @param variableList List of all variable models.
|
|
23
22
|
* @returns Tree of XML elements.
|
|
24
|
-
* @alias Blockly.Xml.variablesToDom
|
|
25
23
|
*/
|
|
26
24
|
export declare function variablesToDom(variableList: VariableModel[]): Element;
|
|
27
25
|
/**
|
|
@@ -31,7 +29,6 @@ export declare function variablesToDom(variableList: VariableModel[]): Element;
|
|
|
31
29
|
* @param opt_noId True if the encoder should skip the block ID.
|
|
32
30
|
* @returns Tree of XML elements or an empty document fragment if the block was
|
|
33
31
|
* an insertion marker.
|
|
34
|
-
* @alias Blockly.Xml.blockToDomWithXY
|
|
35
32
|
*/
|
|
36
33
|
export declare function blockToDomWithXY(block: Block, opt_noId?: boolean): Element | DocumentFragment;
|
|
37
34
|
/**
|
|
@@ -41,7 +38,6 @@ export declare function blockToDomWithXY(block: Block, opt_noId?: boolean): Elem
|
|
|
41
38
|
* @param opt_noId True if the encoder should skip the block ID.
|
|
42
39
|
* @returns Tree of XML elements or an empty document fragment if the block was
|
|
43
40
|
* an insertion marker.
|
|
44
|
-
* @alias Blockly.Xml.blockToDom
|
|
45
41
|
*/
|
|
46
42
|
export declare function blockToDom(block: Block, opt_noId?: boolean): Element | DocumentFragment;
|
|
47
43
|
/**
|
|
@@ -51,7 +47,6 @@ export declare function blockToDom(block: Block, opt_noId?: boolean): Element |
|
|
|
51
47
|
*
|
|
52
48
|
* @param dom A tree of XML nodes.
|
|
53
49
|
* @returns Text representation.
|
|
54
|
-
* @alias Blockly.Xml.domToText
|
|
55
50
|
*/
|
|
56
51
|
export declare function domToText(dom: Node): string;
|
|
57
52
|
/**
|
|
@@ -59,7 +54,6 @@ export declare function domToText(dom: Node): string;
|
|
|
59
54
|
*
|
|
60
55
|
* @param dom A tree of XML elements.
|
|
61
56
|
* @returns Text representation.
|
|
62
|
-
* @alias Blockly.Xml.domToPrettyText
|
|
63
57
|
*/
|
|
64
58
|
export declare function domToPrettyText(dom: Node): string;
|
|
65
59
|
/**
|
|
@@ -69,7 +63,7 @@ export declare function domToPrettyText(dom: Node): string;
|
|
|
69
63
|
* @returns A DOM object representing the singular child of the document
|
|
70
64
|
* element.
|
|
71
65
|
* @throws if the text doesn't parse.
|
|
72
|
-
* @
|
|
66
|
+
* @deprecated Moved to core/utils/xml.js.
|
|
73
67
|
*/
|
|
74
68
|
export declare function textToDom(text: string): Element;
|
|
75
69
|
/**
|
|
@@ -79,7 +73,6 @@ export declare function textToDom(text: string): Element;
|
|
|
79
73
|
* @param xml XML DOM.
|
|
80
74
|
* @param workspace The workspace.
|
|
81
75
|
* @returns An array containing new block IDs.
|
|
82
|
-
* @alias Blockly.Xml.clearWorkspaceAndLoadFromXml
|
|
83
76
|
*/
|
|
84
77
|
export declare function clearWorkspaceAndLoadFromXml(xml: Element, workspace: WorkspaceSvg): string[];
|
|
85
78
|
/**
|
|
@@ -90,7 +83,6 @@ export declare function clearWorkspaceAndLoadFromXml(xml: Element, workspace: Wo
|
|
|
90
83
|
* @returns An array containing new block IDs.
|
|
91
84
|
* @suppress {strictModuleDepCheck} Suppress module check while workspace
|
|
92
85
|
* comments are not bundled in.
|
|
93
|
-
* @alias Blockly.Xml.domToWorkspace
|
|
94
86
|
*/
|
|
95
87
|
export declare function domToWorkspace(xml: Element, workspace: Workspace): string[];
|
|
96
88
|
/**
|
|
@@ -100,7 +92,6 @@ export declare function domToWorkspace(xml: Element, workspace: Workspace): stri
|
|
|
100
92
|
* @param xml The XML DOM.
|
|
101
93
|
* @param workspace The workspace to add to.
|
|
102
94
|
* @returns An array containing new block IDs.
|
|
103
|
-
* @alias Blockly.Xml.appendDomToWorkspace
|
|
104
95
|
*/
|
|
105
96
|
export declare function appendDomToWorkspace(xml: Element, workspace: WorkspaceSvg): string[];
|
|
106
97
|
/**
|
|
@@ -110,7 +101,6 @@ export declare function appendDomToWorkspace(xml: Element, workspace: WorkspaceS
|
|
|
110
101
|
* @param xmlBlock XML block element.
|
|
111
102
|
* @param workspace The workspace.
|
|
112
103
|
* @returns The root block created.
|
|
113
|
-
* @alias Blockly.Xml.domToBlock
|
|
114
104
|
*/
|
|
115
105
|
export declare function domToBlock(xmlBlock: Element, workspace: Workspace): Block;
|
|
116
106
|
/**
|
|
@@ -118,7 +108,6 @@ export declare function domToBlock(xmlBlock: Element, workspace: Workspace): Blo
|
|
|
118
108
|
*
|
|
119
109
|
* @param xmlVariables List of XML variable elements.
|
|
120
110
|
* @param workspace The workspace to which the variable should be added.
|
|
121
|
-
* @alias Blockly.Xml.domToVariables
|
|
122
111
|
*/
|
|
123
112
|
export declare function domToVariables(xmlVariables: Element, workspace: Workspace): void;
|
|
124
113
|
/**
|
|
@@ -126,7 +115,6 @@ export declare function domToVariables(xmlVariables: Element, workspace: Workspa
|
|
|
126
115
|
*
|
|
127
116
|
* @param xmlBlock XML block element or an empty DocumentFragment if the block
|
|
128
117
|
* was an insertion marker.
|
|
129
|
-
* @alias Blockly.Xml.deleteNext
|
|
130
118
|
*/
|
|
131
119
|
export declare function deleteNext(xmlBlock: Element | DocumentFragment): void;
|
|
132
120
|
//# sourceMappingURL=xml.d.ts.map
|
package/core/zoom_controls.d.ts
CHANGED
|
@@ -10,8 +10,6 @@ import { Rect } from './utils/rect.js';
|
|
|
10
10
|
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
11
11
|
/**
|
|
12
12
|
* Class for a zoom controls.
|
|
13
|
-
*
|
|
14
|
-
* @alias Blockly.ZoomControls
|
|
15
13
|
*/
|
|
16
14
|
export declare class ZoomControls implements IPositionable {
|
|
17
15
|
private readonly workspace;
|
|
@@ -21,20 +19,11 @@ export declare class ZoomControls implements IPositionable {
|
|
|
21
19
|
*/
|
|
22
20
|
id: string;
|
|
23
21
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
22
|
+
* Array holding info needed to unbind events.
|
|
23
|
+
* Used for disposing.
|
|
24
|
+
* Ex: [[node, name, func], [node, name, func]].
|
|
26
25
|
*/
|
|
27
|
-
private
|
|
28
|
-
/**
|
|
29
|
-
* A handle to use to unbind the mouse down event handler for zoom in
|
|
30
|
-
* button. Opaque data returned from browserEvents.conditionalBind.
|
|
31
|
-
*/
|
|
32
|
-
private onZoomInWrapper;
|
|
33
|
-
/**
|
|
34
|
-
* A handle to use to unbind the mouse down event handler for zoom out
|
|
35
|
-
* button. Opaque data returned from browserEvents.conditionalBind.
|
|
36
|
-
*/
|
|
37
|
-
private onZoomOutWrapper;
|
|
26
|
+
private boundEvents;
|
|
38
27
|
/** The zoom in svg <g> element. */
|
|
39
28
|
private zoomInGroup;
|
|
40
29
|
/** The zoom out svg <g> element. */
|