blockly 11.1.1 → 11.2.0-beta.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.
Files changed (158) hide show
  1. package/blockly.min.js +471 -448
  2. package/blockly.mjs +1 -0
  3. package/blockly_compressed.js +462 -439
  4. package/blockly_compressed.js.map +1 -1
  5. package/blocks_compressed.js +9 -9
  6. package/blocks_compressed.js.map +1 -1
  7. package/core/block.d.ts +20 -14
  8. package/core/block_svg.d.ts +42 -9
  9. package/core/blockly.d.ts +11 -147
  10. package/core/blockly_options.d.ts +2 -2
  11. package/core/browser_events.d.ts +2 -2
  12. package/core/bubbles/bubble.d.ts +2 -2
  13. package/core/bubbles/mini_workspace_bubble.d.ts +3 -3
  14. package/core/bubbles/text_bubble.d.ts +1 -1
  15. package/core/bubbles/textinput_bubble.d.ts +1 -1
  16. package/core/bubbles.d.ts +2 -2
  17. package/core/clipboard/workspace_comment_paster.d.ts +3 -3
  18. package/core/clipboard.d.ts +2 -2
  19. package/core/comments/comment_view.d.ts +10 -3
  20. package/core/comments/rendered_workspace_comment.d.ts +10 -10
  21. package/core/comments/workspace_comment.d.ts +2 -2
  22. package/core/comments.d.ts +1 -1
  23. package/core/component_manager.d.ts +8 -0
  24. package/core/dragging/block_drag_strategy.d.ts +3 -1
  25. package/core/dragging/bubble_drag_strategy.d.ts +3 -1
  26. package/core/dragging/comment_drag_strategy.d.ts +8 -1
  27. package/core/dragging/dragger.d.ts +2 -2
  28. package/core/dragging.d.ts +2 -2
  29. package/core/dropdowndiv.d.ts +3 -3
  30. package/core/events/events.d.ts +67 -127
  31. package/core/events/events_abstract.d.ts +0 -1
  32. package/core/events/events_block_change.d.ts +2 -1
  33. package/core/events/events_block_create.d.ts +3 -2
  34. package/core/events/events_block_delete.d.ts +3 -2
  35. package/core/events/events_block_drag.d.ts +3 -2
  36. package/core/events/events_block_field_intermediate_change.d.ts +2 -1
  37. package/core/events/events_block_move.d.ts +3 -2
  38. package/core/events/events_bubble_open.d.ts +4 -3
  39. package/core/events/events_click.d.ts +3 -2
  40. package/core/events/events_comment_base.d.ts +1 -1
  41. package/core/events/events_comment_change.d.ts +8 -2
  42. package/core/events/events_comment_collapse.d.ts +3 -2
  43. package/core/events/events_comment_create.d.ts +8 -2
  44. package/core/events/events_comment_delete.d.ts +8 -2
  45. package/core/events/events_comment_drag.d.ts +51 -0
  46. package/core/events/events_comment_move.d.ts +9 -3
  47. package/core/events/events_comment_resize.d.ts +68 -0
  48. package/core/events/events_marker_move.d.ts +2 -1
  49. package/core/events/events_selected.d.ts +3 -2
  50. package/core/events/events_theme_change.d.ts +3 -2
  51. package/core/events/events_toolbox_item_select.d.ts +3 -2
  52. package/core/events/events_trashcan_open.d.ts +3 -2
  53. package/core/events/events_var_base.d.ts +1 -1
  54. package/core/events/events_var_create.d.ts +3 -2
  55. package/core/events/events_var_delete.d.ts +3 -2
  56. package/core/events/events_var_rename.d.ts +3 -2
  57. package/core/events/events_viewport.d.ts +3 -2
  58. package/core/events/predicates.d.ts +90 -0
  59. package/core/events/type.d.ts +79 -0
  60. package/core/events/utils.d.ts +93 -125
  61. package/core/events/workspace_events.d.ts +2 -1
  62. package/core/extensions.d.ts +1 -1
  63. package/core/field.d.ts +1 -1
  64. package/core/field_input.d.ts +1 -1
  65. package/core/field_label.d.ts +6 -0
  66. package/core/flyout_base.d.ts +1 -1
  67. package/core/flyout_button.d.ts +6 -1
  68. package/core/generator.d.ts +3 -2
  69. package/core/gesture.d.ts +3 -3
  70. package/core/grid.d.ts +7 -1
  71. package/core/icons/comment_icon.d.ts +3 -3
  72. package/core/icons/icon.d.ts +1 -1
  73. package/core/icons/mutator_icon.d.ts +3 -3
  74. package/core/icons/warning_icon.d.ts +2 -2
  75. package/core/icons.d.ts +5 -5
  76. package/core/inputs/input.d.ts +1 -1
  77. package/core/inputs.d.ts +3 -3
  78. package/core/interfaces/i_ast_node_location_with_block.d.ts +1 -1
  79. package/core/interfaces/i_comment_icon.d.ts +2 -2
  80. package/core/interfaces/i_drag_target.d.ts +1 -1
  81. package/core/interfaces/i_flyout.d.ts +3 -3
  82. package/core/interfaces/i_legacy_procedure_blocks.d.ts +2 -2
  83. package/core/interfaces/i_metrics_manager.d.ts +2 -2
  84. package/core/interfaces/i_positionable.d.ts +1 -1
  85. package/core/interfaces/i_selectable.d.ts +1 -1
  86. package/core/interfaces/i_serializer.d.ts +2 -2
  87. package/core/interfaces/i_toolbox.d.ts +3 -3
  88. package/core/keyboard_nav/ast_node.d.ts +1 -1
  89. package/core/layer_manager.d.ts +1 -1
  90. package/core/layers.d.ts +0 -2
  91. package/core/procedures.d.ts +3 -3
  92. package/core/registry.d.ts +6 -6
  93. package/core/renderers/common/block_rendering.d.ts +3 -30
  94. package/core/renderers/common/i_path_object.d.ts +2 -2
  95. package/core/renderers/common/info.d.ts +1 -1
  96. package/core/renderers/common/marker_svg.d.ts +5 -5
  97. package/core/renderers/zelos/constants.d.ts +1 -1
  98. package/core/serialization/procedures.d.ts +2 -2
  99. package/core/serialization/workspace_comments.d.ts +1 -1
  100. package/core/serialization.d.ts +3 -3
  101. package/core/toolbox/toolbox.d.ts +1 -6
  102. package/core/tooltip.d.ts +1 -1
  103. package/core/trashcan.d.ts +1 -6
  104. package/core/utils/size.d.ts +1 -1
  105. package/core/variables_dynamic.d.ts +1 -1
  106. package/core/workspace.d.ts +4 -5
  107. package/core/workspace_svg.d.ts +3 -3
  108. package/core/xml.d.ts +1 -1
  109. package/dart_compressed.js.map +1 -1
  110. package/generators/dart/dart_generator.d.ts +4 -0
  111. package/generators/dart/lists.d.ts +0 -3
  112. package/generators/dart/procedures.d.ts +0 -3
  113. package/generators/dart/text.d.ts +0 -3
  114. package/generators/javascript/javascript_generator.d.ts +4 -0
  115. package/generators/javascript/lists.d.ts +0 -3
  116. package/generators/javascript/procedures.d.ts +0 -3
  117. package/generators/javascript/text.d.ts +0 -3
  118. package/generators/lua/lists.d.ts +0 -3
  119. package/generators/lua/lua_generator.d.ts +6 -0
  120. package/generators/lua/procedures.d.ts +0 -3
  121. package/generators/lua/text.d.ts +0 -3
  122. package/generators/lua.d.ts +0 -4
  123. package/generators/php/lists.d.ts +1 -1
  124. package/generators/php/logic.d.ts +1 -1
  125. package/generators/php/math.d.ts +1 -1
  126. package/generators/php/php_generator.d.ts +4 -0
  127. package/generators/php/procedures.d.ts +1 -1
  128. package/generators/php/text.d.ts +1 -4
  129. package/generators/php/variables.d.ts +1 -1
  130. package/generators/php.d.ts +0 -5
  131. package/generators/python/lists.d.ts +1 -1
  132. package/generators/python/procedures.d.ts +1 -1
  133. package/generators/python/python_generator.d.ts +4 -0
  134. package/generators/python/text.d.ts +1 -1
  135. package/generators/python.d.ts +0 -5
  136. package/index.mjs +1 -0
  137. package/javascript_compressed.js.map +1 -1
  138. package/lua_compressed.js.map +1 -1
  139. package/media/1x1.gif +0 -0
  140. package/media/click.mp3 +0 -0
  141. package/media/click.ogg +0 -0
  142. package/media/click.wav +0 -0
  143. package/media/delete.mp3 +0 -0
  144. package/media/delete.ogg +0 -0
  145. package/media/delete.wav +0 -0
  146. package/media/disconnect.mp3 +0 -0
  147. package/media/disconnect.ogg +0 -0
  148. package/media/disconnect.wav +0 -0
  149. package/media/handclosed.cur +0 -0
  150. package/media/handdelete.cur +0 -0
  151. package/media/handopen.cur +0 -0
  152. package/media/pilcrow.png +0 -0
  153. package/media/quote0.png +0 -0
  154. package/media/quote1.png +0 -0
  155. package/media/sprites.png +0 -0
  156. package/package.json +14 -11
  157. package/php_compressed.js.map +1 -1
  158. package/python_compressed.js.map +1 -1
@@ -92,6 +92,12 @@ export declare class ComponentManager {
92
92
  getComponents<T extends IComponent>(capability: string | Capability<T>, sorted: boolean): T[];
93
93
  }
94
94
  export declare namespace ComponentManager {
95
+ enum ComponentWeight {
96
+ TOOLBOX_WEIGHT = 0,
97
+ FLYOUT_WEIGHT = 1,
98
+ TRASHCAN_WEIGHT = 2,
99
+ ZOOM_CONTROLS_WEIGHT = 3
100
+ }
95
101
  /** An object storing component information. */
96
102
  interface ComponentDatum {
97
103
  component: IComponent;
@@ -99,6 +105,8 @@ export declare namespace ComponentManager {
99
105
  weight: number;
100
106
  }
101
107
  }
108
+ export type ComponentWeight = ComponentManager.ComponentWeight;
109
+ export declare const ComponentWeight: typeof ComponentManager.ComponentWeight;
102
110
  export type ComponentDatum = ComponentManager.ComponentDatum;
103
111
  export {};
104
112
  //# sourceMappingURL=component_manager.d.ts.map
@@ -3,9 +3,9 @@
3
3
  * Copyright 2024 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
+ import { BlockSvg } from '../block_svg.js';
6
7
  import { IDragStrategy } from '../interfaces/i_draggable.js';
7
8
  import { Coordinate } from '../utils.js';
8
- import { BlockSvg } from '../block_svg.js';
9
9
  export declare class BlockDragStrategy implements IDragStrategy {
10
10
  private block;
11
11
  private workspace;
@@ -25,6 +25,8 @@ export declare class BlockDragStrategy implements IDragStrategy {
25
25
  * block, to add to the drag location. In workspace units.
26
26
  */
27
27
  private dragOffset;
28
+ /** Was there already an event group in progress when the drag started? */
29
+ private inGroup;
28
30
  constructor(block: BlockSvg);
29
31
  /** Returns true if the block is currently movable. False otherwise. */
30
32
  isMovable(): boolean;
@@ -3,13 +3,15 @@
3
3
  * Copyright 2024 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
+ import { IBubble, WorkspaceSvg } from '../blockly.js';
6
7
  import { IDragStrategy } from '../interfaces/i_draggable.js';
7
8
  import { Coordinate } from '../utils.js';
8
- import { IBubble, WorkspaceSvg } from '../blockly.js';
9
9
  export declare class BubbleDragStrategy implements IDragStrategy {
10
10
  private bubble;
11
11
  private workspace;
12
12
  private startLoc;
13
+ /** Was there already an event group in progress when the drag started? */
14
+ private inGroup;
13
15
  constructor(bubble: IBubble, workspace: WorkspaceSvg);
14
16
  isMovable(): boolean;
15
17
  startDrag(): void;
@@ -3,18 +3,25 @@
3
3
  * Copyright 2024 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
+ import { RenderedWorkspaceComment } from '../comments.js';
6
7
  import { IDragStrategy } from '../interfaces/i_draggable.js';
7
8
  import { Coordinate } from '../utils.js';
8
- import { RenderedWorkspaceComment } from '../comments.js';
9
9
  export declare class CommentDragStrategy implements IDragStrategy {
10
10
  private comment;
11
11
  private startLoc;
12
12
  private workspace;
13
+ /** Was there already an event group in progress when the drag started? */
14
+ private inGroup;
13
15
  constructor(comment: RenderedWorkspaceComment);
14
16
  isMovable(): boolean;
15
17
  startDrag(): void;
16
18
  drag(newLoc: Coordinate): void;
17
19
  endDrag(): void;
20
+ /** Fire a UI event at the start of a comment drag. */
21
+ private fireDragStartEvent;
22
+ /** Fire a UI event at the end of a comment drag. */
23
+ private fireDragEndEvent;
24
+ /** Fire a move event at the end of a comment drag. */
18
25
  private fireMoveEvent;
19
26
  revertDrag(): void;
20
27
  }
@@ -3,10 +3,10 @@
3
3
  * Copyright 2024 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { IDragTarget } from '../interfaces/i_drag_target.js';
7
6
  import { IDeletable } from '../interfaces/i_deletable.js';
8
- import { IDragger } from '../interfaces/i_dragger.js';
7
+ import { IDragTarget } from '../interfaces/i_drag_target.js';
9
8
  import { IDraggable } from '../interfaces/i_draggable.js';
9
+ import { IDragger } from '../interfaces/i_dragger.js';
10
10
  import { Coordinate } from '../utils/coordinate.js';
11
11
  import { WorkspaceSvg } from '../workspace_svg.js';
12
12
  export declare class Dragger implements IDragger {
@@ -3,9 +3,9 @@
3
3
  * Copyright 2024 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { Dragger } from './dragging/dragger.js';
7
6
  import { BlockDragStrategy } from './dragging/block_drag_strategy.js';
8
7
  import { BubbleDragStrategy } from './dragging/bubble_drag_strategy.js';
9
8
  import { CommentDragStrategy } from './dragging/comment_drag_strategy.js';
10
- export { Dragger, BlockDragStrategy, BubbleDragStrategy, CommentDragStrategy };
9
+ import { Dragger } from './dragging/dragger.js';
10
+ export { BlockDragStrategy, BubbleDragStrategy, CommentDragStrategy, Dragger };
11
11
  //# sourceMappingURL=dragging.d.ts.map
@@ -97,7 +97,7 @@ export declare function setColour(backgroundColour: string, borderColour: string
97
97
  * @param opt_secondaryYOffset Optional Y offset for above-block positioning.
98
98
  * @returns True if the menu rendered below block; false if above.
99
99
  */
100
- export declare function showPositionedByBlock<T>(field: Field<T>, block: BlockSvg, opt_onHide?: Function, opt_secondaryYOffset?: number): boolean;
100
+ export declare function showPositionedByBlock<T>(field: Field<T>, block: BlockSvg, opt_onHide?: () => void, opt_secondaryYOffset?: number): boolean;
101
101
  /**
102
102
  * Shortcut to show and place the drop-down with positioning determined
103
103
  * by a particular field. The primary position will be below the field,
@@ -109,7 +109,7 @@ export declare function showPositionedByBlock<T>(field: Field<T>, block: BlockSv
109
109
  * @param opt_secondaryYOffset Optional Y offset for above-block positioning.
110
110
  * @returns True if the menu rendered below block; false if above.
111
111
  */
112
- export declare function showPositionedByField<T>(field: Field<T>, opt_onHide?: Function, opt_secondaryYOffset?: number): boolean;
112
+ export declare function showPositionedByField<T>(field: Field<T>, opt_onHide?: () => void, opt_secondaryYOffset?: number): boolean;
113
113
  /**
114
114
  * Show and place the drop-down.
115
115
  * The drop-down is placed with an absolute "origin point" (x, y) - i.e.,
@@ -129,7 +129,7 @@ export declare function showPositionedByField<T>(field: Field<T>, opt_onHide?: F
129
129
  * @returns True if the menu rendered at the primary origin point.
130
130
  * @internal
131
131
  */
132
- export declare function show<T>(newOwner: Field<T>, rtl: boolean, primaryX: number, primaryY: number, secondaryX: number, secondaryY: number, opt_onHide?: Function): boolean;
132
+ export declare function show<T>(newOwner: Field<T>, rtl: boolean, primaryX: number, primaryY: number, secondaryX: number, secondaryY: number, opt_onHide?: () => void): boolean;
133
133
  /**
134
134
  * Get the x positions for the left side of the DropDownDiv and the arrow,
135
135
  * accounting for the bounds of the workspace.
@@ -3,131 +3,71 @@
3
3
  * Copyright 2016 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { Abstract, AbstractEventJson } from './events_abstract.js';
7
- import { BlockBase, BlockBaseJson } from './events_block_base.js';
8
- import { BlockChange, BlockChangeJson } from './events_block_change.js';
9
- import { BlockCreate, BlockCreateJson } from './events_block_create.js';
10
- import { BlockDelete, BlockDeleteJson } from './events_block_delete.js';
11
- import { BlockDrag, BlockDragJson } from './events_block_drag.js';
12
- import { BlockFieldIntermediateChange, BlockFieldIntermediateChangeJson } from './events_block_field_intermediate_change.js';
13
- import { BlockMove, BlockMoveJson } from './events_block_move.js';
14
- import { BubbleOpen, BubbleOpenJson, BubbleType } from './events_bubble_open.js';
15
- import { Click, ClickJson, ClickTarget } from './events_click.js';
16
- import { CommentBase, CommentBaseJson } from './events_comment_base.js';
17
- import { CommentChange, CommentChangeJson } from './events_comment_change.js';
18
- import { CommentCreate, CommentCreateJson } from './events_comment_create.js';
19
- import { CommentDelete } from './events_comment_delete.js';
20
- import { CommentMove, CommentMoveJson } from './events_comment_move.js';
21
- import { CommentCollapse, CommentCollapseJson } from './events_comment_collapse.js';
22
- import { MarkerMove, MarkerMoveJson } from './events_marker_move.js';
23
- import { Selected, SelectedJson } from './events_selected.js';
24
- import { ThemeChange, ThemeChangeJson } from './events_theme_change.js';
25
- import { ToolboxItemSelect, ToolboxItemSelectJson } from './events_toolbox_item_select.js';
26
- import { TrashcanOpen, TrashcanOpenJson } from './events_trashcan_open.js';
27
- import { UiBase } from './events_ui_base.js';
28
- import { VarBase, VarBaseJson } from './events_var_base.js';
29
- import { VarCreate, VarCreateJson } from './events_var_create.js';
30
- import { VarDelete, VarDeleteJson } from './events_var_delete.js';
31
- import { VarRename, VarRenameJson } from './events_var_rename.js';
32
- import { ViewportChange, ViewportChangeJson } from './events_viewport.js';
33
- import * as eventUtils from './utils.js';
34
- import { FinishedLoading } from './workspace_events.js';
35
- export { Abstract };
36
- export { AbstractEventJson };
37
- export { BubbleOpen };
38
- export { BubbleOpenJson };
39
- export { BubbleType };
40
- export { BlockBase };
41
- export { BlockBaseJson };
42
- export { BlockChange };
43
- export { BlockChangeJson };
44
- export { BlockCreate };
45
- export { BlockCreateJson };
46
- export { BlockDelete };
47
- export { BlockDeleteJson };
48
- export { BlockDrag };
49
- export { BlockDragJson };
50
- export { BlockFieldIntermediateChange };
51
- export { BlockFieldIntermediateChangeJson };
52
- export { BlockMove };
53
- export { BlockMoveJson };
54
- export { Click };
55
- export { ClickJson };
56
- export { ClickTarget };
57
- export { CommentBase };
58
- export { CommentBaseJson };
59
- export { CommentChange };
60
- export { CommentChangeJson };
61
- export { CommentCreate };
62
- export { CommentCreateJson };
63
- export { CommentDelete };
64
- export { CommentMove };
65
- export { CommentMoveJson };
66
- export { CommentCollapse };
67
- export { CommentCollapseJson };
68
- export { FinishedLoading };
69
- export { MarkerMove };
70
- export { MarkerMoveJson };
71
- export { Selected };
72
- export { SelectedJson };
73
- export { ThemeChange };
74
- export { ThemeChangeJson };
75
- export { ToolboxItemSelect };
76
- export { ToolboxItemSelectJson };
77
- export { TrashcanOpen };
78
- export { TrashcanOpenJson };
79
- export { UiBase };
80
- export { VarBase };
81
- export { VarBaseJson };
82
- export { VarCreate };
83
- export { VarCreateJson };
84
- export { VarDelete };
85
- export { VarDeleteJson };
86
- export { VarRename };
87
- export { VarRenameJson };
88
- export { ViewportChange };
89
- export { ViewportChangeJson };
90
- export declare const BLOCK_CHANGE = "change";
91
- export declare const BLOCK_CREATE = "create";
92
- export declare const BLOCK_DELETE = "delete";
93
- export declare const BLOCK_DRAG = "drag";
94
- export declare const BLOCK_MOVE = "move";
95
- export declare const BLOCK_FIELD_INTERMEDIATE_CHANGE = "block_field_intermediate_change";
96
- export declare const BUBBLE_OPEN = "bubble_open";
97
- export type BumpEvent = eventUtils.BumpEvent;
98
- export declare const BUMP_EVENTS: string[];
99
- export declare const CHANGE = "change";
100
- export declare const CLICK = "click";
101
- export declare const COMMENT_CHANGE = "comment_change";
102
- export declare const COMMENT_CREATE = "comment_create";
103
- export declare const COMMENT_DELETE = "comment_delete";
104
- export declare const COMMENT_MOVE = "comment_move";
105
- export declare const CREATE = "create";
106
- export declare const DELETE = "delete";
107
- export declare const FINISHED_LOADING = "finished_loading";
108
- export declare const MARKER_MOVE = "marker_move";
109
- export declare const MOVE = "move";
110
- export declare const SELECTED = "selected";
111
- export declare const THEME_CHANGE = "theme_change";
112
- export declare const TOOLBOX_ITEM_SELECT = "toolbox_item_select";
113
- export declare const TRASHCAN_OPEN = "trashcan_open";
114
- export declare const UI = "ui";
115
- export declare const VAR_CREATE = "var_create";
116
- export declare const VAR_DELETE = "var_delete";
117
- export declare const VAR_RENAME = "var_rename";
118
- export declare const VIEWPORT_CHANGE = "viewport_change";
119
- export declare const clearPendingUndo: typeof eventUtils.clearPendingUndo;
120
- export declare const disable: typeof eventUtils.disable;
121
- export declare const enable: typeof eventUtils.enable;
122
- export declare const filter: typeof eventUtils.filter;
123
- export declare const fire: typeof eventUtils.fire;
124
- export declare const fromJson: typeof eventUtils.fromJson;
125
- export declare const getDescendantIds: typeof eventUtils.getDescendantIds;
126
- export declare const get: typeof eventUtils.get;
127
- export declare const getGroup: typeof eventUtils.getGroup;
128
- export declare const getRecordUndo: typeof eventUtils.getRecordUndo;
129
- export declare const isEnabled: typeof eventUtils.isEnabled;
130
- export declare const setGroup: typeof eventUtils.setGroup;
131
- export declare const setRecordUndo: typeof eventUtils.setRecordUndo;
132
- export declare const disableOrphans: typeof eventUtils.disableOrphans;
6
+ import { EventType } from './type.js';
7
+ export { Abstract, AbstractEventJson } from './events_abstract.js';
8
+ export { BlockBase, BlockBaseJson } from './events_block_base.js';
9
+ export { BlockChange, BlockChangeJson } from './events_block_change.js';
10
+ export { BlockCreate, BlockCreateJson } from './events_block_create.js';
11
+ export { BlockDelete, BlockDeleteJson } from './events_block_delete.js';
12
+ export { BlockDrag, BlockDragJson } from './events_block_drag.js';
13
+ export { BlockFieldIntermediateChange, BlockFieldIntermediateChangeJson, } from './events_block_field_intermediate_change.js';
14
+ export { BlockMove, BlockMoveJson } from './events_block_move.js';
15
+ export { BubbleOpen, BubbleOpenJson, BubbleType } from './events_bubble_open.js';
16
+ export { Click, ClickJson, ClickTarget } from './events_click.js';
17
+ export { CommentBase, CommentBaseJson } from './events_comment_base.js';
18
+ export { CommentChange, CommentChangeJson } from './events_comment_change.js';
19
+ export { CommentCollapse, CommentCollapseJson, } from './events_comment_collapse.js';
20
+ export { CommentCreate, CommentCreateJson } from './events_comment_create.js';
21
+ export { CommentDelete } from './events_comment_delete.js';
22
+ export { CommentDrag, CommentDragJson } from './events_comment_drag.js';
23
+ export { CommentMove, CommentMoveJson } from './events_comment_move.js';
24
+ export { CommentResize, CommentResizeJson } from './events_comment_resize.js';
25
+ export { MarkerMove, MarkerMoveJson } from './events_marker_move.js';
26
+ export { Selected, SelectedJson } from './events_selected.js';
27
+ export { ThemeChange, ThemeChangeJson } from './events_theme_change.js';
28
+ export { ToolboxItemSelect, ToolboxItemSelectJson, } from './events_toolbox_item_select.js';
29
+ export { TrashcanOpen, TrashcanOpenJson } from './events_trashcan_open.js';
30
+ export { UiBase } from './events_ui_base.js';
31
+ export { VarBase, VarBaseJson } from './events_var_base.js';
32
+ export { VarCreate, VarCreateJson } from './events_var_create.js';
33
+ export { VarDelete, VarDeleteJson } from './events_var_delete.js';
34
+ export { VarRename, VarRenameJson } from './events_var_rename.js';
35
+ export { ViewportChange, ViewportChangeJson } from './events_viewport.js';
36
+ export { FinishedLoading } from './workspace_events.js';
37
+ export type { BumpEvent } from './utils.js';
38
+ export declare const BLOCK_CHANGE = EventType.BLOCK_CHANGE;
39
+ export declare const BLOCK_CREATE = EventType.BLOCK_CREATE;
40
+ export declare const BLOCK_DELETE = EventType.BLOCK_DELETE;
41
+ export declare const BLOCK_DRAG = EventType.BLOCK_DRAG;
42
+ export declare const BLOCK_MOVE = EventType.BLOCK_MOVE;
43
+ export declare const BLOCK_FIELD_INTERMEDIATE_CHANGE = EventType.BLOCK_FIELD_INTERMEDIATE_CHANGE;
44
+ export declare const BUBBLE_OPEN = EventType.BUBBLE_OPEN;
45
+ /** @deprecated Use BLOCK_CHANGE instead */
46
+ export declare const CHANGE = EventType.BLOCK_CHANGE;
47
+ export declare const CLICK = EventType.CLICK;
48
+ export declare const COMMENT_CHANGE = EventType.COMMENT_CHANGE;
49
+ export declare const COMMENT_CREATE = EventType.COMMENT_CREATE;
50
+ export declare const COMMENT_DELETE = EventType.COMMENT_DELETE;
51
+ export declare const COMMENT_MOVE = EventType.COMMENT_MOVE;
52
+ export declare const COMMENT_RESIZE = EventType.COMMENT_RESIZE;
53
+ export declare const COMMENT_DRAG = EventType.COMMENT_DRAG;
54
+ /** @deprecated Use BLOCK_CREATE instead */
55
+ export declare const CREATE = EventType.BLOCK_CREATE;
56
+ /** @deprecated Use BLOCK_DELETE instead */
57
+ export declare const DELETE = EventType.BLOCK_DELETE;
58
+ export declare const FINISHED_LOADING = EventType.FINISHED_LOADING;
59
+ export declare const MARKER_MOVE = EventType.MARKER_MOVE;
60
+ /** @deprecated Use BLOCK_MOVE instead */
61
+ export declare const MOVE = EventType.BLOCK_MOVE;
62
+ export declare const SELECTED = EventType.SELECTED;
63
+ export declare const THEME_CHANGE = EventType.THEME_CHANGE;
64
+ export declare const TOOLBOX_ITEM_SELECT = EventType.TOOLBOX_ITEM_SELECT;
65
+ export declare const TRASHCAN_OPEN = EventType.TRASHCAN_OPEN;
66
+ export declare const UI = EventType.UI;
67
+ export declare const VAR_CREATE = EventType.VAR_CREATE;
68
+ export declare const VAR_DELETE = EventType.VAR_DELETE;
69
+ export declare const VAR_RENAME = EventType.VAR_RENAME;
70
+ export declare const VIEWPORT_CHANGE = EventType.VIEWPORT_CHANGE;
71
+ export { BUMP_EVENTS } from './type.js';
72
+ export { clearPendingUndo, disable, disableOrphans, enable, filter, fire, fromJson, get, getDescendantIds, getGroup, getRecordUndo, isEnabled, setGroup, setRecordUndo, } from './utils.js';
133
73
  //# sourceMappingURL=events.d.ts.map
@@ -62,7 +62,6 @@ export declare abstract class Abstract {
62
62
  *
63
63
  * @returns The workspace the event belongs to.
64
64
  * @throws {Error} if workspace is null.
65
- * @internal
66
65
  */
67
66
  getEventWorkspace_(): Workspace;
68
67
  }
@@ -12,12 +12,13 @@ import type { Block } from '../block.js';
12
12
  import type { BlockSvg } from '../block_svg.js';
13
13
  import { Workspace } from '../workspace.js';
14
14
  import { BlockBase, BlockBaseJson } from './events_block_base.js';
15
+ import { EventType } from './type.js';
15
16
  /**
16
17
  * Notifies listeners when some element of a block has changed (e.g.
17
18
  * field values, comments, etc).
18
19
  */
19
20
  export declare class BlockChange extends BlockBase {
20
- type: string;
21
+ type: EventType;
21
22
  /**
22
23
  * The element that changed; one of 'field', 'comment', 'collapsed',
23
24
  * 'disabled', 'inline', or 'mutation'
@@ -10,14 +10,15 @@
10
10
  */
11
11
  import type { Block } from '../block.js';
12
12
  import * as blocks from '../serialization/blocks.js';
13
- import { BlockBase, BlockBaseJson } from './events_block_base.js';
14
13
  import { Workspace } from '../workspace.js';
14
+ import { BlockBase, BlockBaseJson } from './events_block_base.js';
15
+ import { EventType } from './type.js';
15
16
  /**
16
17
  * Notifies listeners when a block (or connected stack of blocks) is
17
18
  * created.
18
19
  */
19
20
  export declare class BlockCreate extends BlockBase {
20
- type: string;
21
+ type: EventType;
21
22
  /** The XML representation of the created block(s). */
22
23
  xml?: Element | DocumentFragment;
23
24
  /** The JSON respresentation of the created block(s). */
@@ -10,8 +10,9 @@
10
10
  */
11
11
  import type { Block } from '../block.js';
12
12
  import * as blocks from '../serialization/blocks.js';
13
- import { BlockBase, BlockBaseJson } from './events_block_base.js';
14
13
  import { Workspace } from '../workspace.js';
14
+ import { BlockBase, BlockBaseJson } from './events_block_base.js';
15
+ import { EventType } from './type.js';
15
16
  /**
16
17
  * Notifies listeners when a block (or connected stack of blocks) is
17
18
  * deleted.
@@ -25,7 +26,7 @@ export declare class BlockDelete extends BlockBase {
25
26
  ids?: string[];
26
27
  /** True if the deleted block was a shadow block, false otherwise. */
27
28
  wasShadow?: boolean;
28
- type: string;
29
+ type: EventType;
29
30
  /** @param opt_block The deleted block. Undefined for a blank event. */
30
31
  constructor(opt_block?: Block);
31
32
  /**
@@ -9,9 +9,10 @@
9
9
  * @class
10
10
  */
11
11
  import type { Block } from '../block.js';
12
+ import { Workspace } from '../workspace.js';
12
13
  import { AbstractEventJson } from './events_abstract.js';
13
14
  import { UiBase } from './events_ui_base.js';
14
- import { Workspace } from '../workspace.js';
15
+ import { EventType } from './type.js';
15
16
  /**
16
17
  * Notifies listeners when a block is being manually dragged/dropped.
17
18
  */
@@ -25,7 +26,7 @@ export declare class BlockDrag extends UiBase {
25
26
  * with the block ID) being dragged.
26
27
  */
27
28
  blocks?: Block[];
28
- type: string;
29
+ type: EventType;
29
30
  /**
30
31
  * @param opt_block The top block in the stack that is being dragged.
31
32
  * Undefined for a blank event.
@@ -12,13 +12,14 @@
12
12
  import type { Block } from '../block.js';
13
13
  import { Workspace } from '../workspace.js';
14
14
  import { BlockBase, BlockBaseJson } from './events_block_base.js';
15
+ import { EventType } from './type.js';
15
16
  /**
16
17
  * Notifies listeners when the value of a block's field has changed but the
17
18
  * change is not yet complete, and is expected to be followed by a block change
18
19
  * event.
19
20
  */
20
21
  export declare class BlockFieldIntermediateChange extends BlockBase {
21
- type: string;
22
+ type: EventType;
22
23
  recordUndo: boolean;
23
24
  /** The name of the field that changed. */
24
25
  name?: string;
@@ -10,14 +10,15 @@
10
10
  */
11
11
  import type { Block } from '../block.js';
12
12
  import { Coordinate } from '../utils/coordinate.js';
13
- import { BlockBase, BlockBaseJson } from './events_block_base.js';
14
13
  import type { Workspace } from '../workspace.js';
14
+ import { BlockBase, BlockBaseJson } from './events_block_base.js';
15
+ import { EventType } from './type.js';
15
16
  /**
16
17
  * Notifies listeners when a block is moved. This could be from one
17
18
  * connection to another, or from one location on the workspace to another.
18
19
  */
19
20
  export declare class BlockMove extends BlockBase {
20
- type: string;
21
+ type: EventType;
21
22
  /** The ID of the old parent block. Undefined if it was a top-level block. */
22
23
  oldParentId?: string;
23
24
  /**
@@ -8,10 +8,11 @@
8
8
  *
9
9
  * @class
10
10
  */
11
- import type { AbstractEventJson } from './events_abstract.js';
12
11
  import type { BlockSvg } from '../block_svg.js';
13
- import { UiBase } from './events_ui_base.js';
14
12
  import type { Workspace } from '../workspace.js';
13
+ import type { AbstractEventJson } from './events_abstract.js';
14
+ import { UiBase } from './events_ui_base.js';
15
+ import { EventType } from './type.js';
15
16
  /**
16
17
  * Class for a bubble open event.
17
18
  */
@@ -22,7 +23,7 @@ export declare class BubbleOpen extends UiBase {
22
23
  isOpen?: boolean;
23
24
  /** The type of bubble; one of 'mutator', 'comment', or 'warning'. */
24
25
  bubbleType?: BubbleType;
25
- type: string;
26
+ type: EventType;
26
27
  /**
27
28
  * @param opt_block The associated block. Undefined for a blank event.
28
29
  * @param opt_isOpen Whether the bubble is opening (false if closing).
@@ -9,9 +9,10 @@
9
9
  * @class
10
10
  */
11
11
  import type { Block } from '../block.js';
12
+ import { Workspace } from '../workspace.js';
12
13
  import { AbstractEventJson } from './events_abstract.js';
13
14
  import { UiBase } from './events_ui_base.js';
14
- import { Workspace } from '../workspace.js';
15
+ import { EventType } from './type.js';
15
16
  /**
16
17
  * Notifies listeners that some blockly element was clicked.
17
18
  */
@@ -23,7 +24,7 @@ export declare class Click extends UiBase {
23
24
  * or 'zoom_controls'.
24
25
  */
25
26
  targetType?: ClickTarget;
26
- type: string;
27
+ type: EventType;
27
28
  /**
28
29
  * @param opt_block The affected block. Null for click events that do not have
29
30
  * an associated block (i.e. workspace click). Undefined for a blank
@@ -9,10 +9,10 @@
9
9
  * @class
10
10
  */
11
11
  import type { WorkspaceComment } from '../comments/workspace_comment.js';
12
+ import type { Workspace } from '../workspace.js';
12
13
  import { Abstract as AbstractEvent, AbstractEventJson } from './events_abstract.js';
13
14
  import type { CommentCreate } from './events_comment_create.js';
14
15
  import type { CommentDelete } from './events_comment_delete.js';
15
- import type { Workspace } from '../workspace.js';
16
16
  /**
17
17
  * Abstract class for a comment event.
18
18
  */
@@ -3,14 +3,20 @@
3
3
  * Copyright 2018 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
+ /**
7
+ * Class for comment change event.
8
+ *
9
+ * @class
10
+ */
6
11
  import type { WorkspaceComment } from '../comments/workspace_comment.js';
7
- import { CommentBase, CommentBaseJson } from './events_comment_base.js';
8
12
  import type { Workspace } from '../workspace.js';
13
+ import { CommentBase, CommentBaseJson } from './events_comment_base.js';
14
+ import { EventType } from './type.js';
9
15
  /**
10
16
  * Notifies listeners that the contents of a workspace comment has changed.
11
17
  */
12
18
  export declare class CommentChange extends CommentBase {
13
- type: string;
19
+ type: EventType;
14
20
  /** The previous contents of the comment. */
15
21
  oldContents_?: string;
16
22
  /** The new contents of the comment. */
@@ -4,11 +4,12 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { WorkspaceComment } from '../comments/workspace_comment.js';
7
- import { CommentBase, CommentBaseJson } from './events_comment_base.js';
8
7
  import type { Workspace } from '../workspace.js';
8
+ import { CommentBase, CommentBaseJson } from './events_comment_base.js';
9
+ import { EventType } from './type.js';
9
10
  export declare class CommentCollapse extends CommentBase {
10
11
  newCollapsed?: boolean | undefined;
11
- type: string;
12
+ type: EventType;
12
13
  constructor(comment?: WorkspaceComment, newCollapsed?: boolean | undefined);
13
14
  /**
14
15
  * Encode the event as JSON.
@@ -3,15 +3,21 @@
3
3
  * Copyright 2018 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
+ /**
7
+ * Class for comment creation event.
8
+ *
9
+ * @class
10
+ */
6
11
  import type { WorkspaceComment } from '../comments/workspace_comment.js';
7
12
  import * as comments from '../serialization/workspace_comments.js';
8
- import { CommentBase, CommentBaseJson } from './events_comment_base.js';
9
13
  import type { Workspace } from '../workspace.js';
14
+ import { CommentBase, CommentBaseJson } from './events_comment_base.js';
15
+ import { EventType } from './type.js';
10
16
  /**
11
17
  * Notifies listeners that a workspace comment was created.
12
18
  */
13
19
  export declare class CommentCreate extends CommentBase {
14
- type: string;
20
+ type: EventType;
15
21
  /** The XML representation of the created workspace comment. */
16
22
  xml?: Element | DocumentFragment;
17
23
  /** The JSON representation of the created workspace comment. */
@@ -3,15 +3,21 @@
3
3
  * Copyright 2018 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
+ /**
7
+ * Class for comment deletion event.
8
+ *
9
+ * @class
10
+ */
6
11
  import type { WorkspaceComment } from '../comments/workspace_comment.js';
7
12
  import * as comments from '../serialization/workspace_comments.js';
8
- import { CommentBase, CommentBaseJson } from './events_comment_base.js';
9
13
  import type { Workspace } from '../workspace.js';
14
+ import { CommentBase, CommentBaseJson } from './events_comment_base.js';
15
+ import { EventType } from './type.js';
10
16
  /**
11
17
  * Notifies listeners that a workspace comment has been deleted.
12
18
  */
13
19
  export declare class CommentDelete extends CommentBase {
14
- type: string;
20
+ type: EventType;
15
21
  /** The XML representation of the deleted workspace comment. */
16
22
  xml?: Element;
17
23
  /** The JSON representation of the created workspace comment. */