blockly 9.2.1 → 9.3.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 (74) hide show
  1. package/blockly.min.js +308 -356
  2. package/blockly_compressed.js +308 -356
  3. package/blockly_compressed.js.map +1 -1
  4. package/core/block_dragger.d.ts +1 -1
  5. package/core/block_svg.d.ts +4 -17
  6. package/core/blockly.d.ts +2 -4
  7. package/core/bubble.d.ts +2 -6
  8. package/core/bubble_dragger.d.ts +1 -2
  9. package/core/events/events.d.ts +2 -22
  10. package/core/events/events_abstract.d.ts +7 -0
  11. package/core/events/events_block_base.d.ts +2 -1
  12. package/core/events/events_block_change.d.ts +9 -1
  13. package/core/events/events_block_create.d.ts +6 -2
  14. package/core/events/events_block_delete.d.ts +7 -2
  15. package/core/events/events_block_drag.d.ts +7 -1
  16. package/core/events/events_block_move.d.ts +20 -1
  17. package/core/events/events_bubble_open.d.ts +3 -0
  18. package/core/events/events_click.d.ts +6 -1
  19. package/core/events/events_comment_base.d.ts +1 -0
  20. package/core/events/events_comment_change.d.ts +3 -1
  21. package/core/events/events_comment_create.d.ts +2 -1
  22. package/core/events/events_comment_delete.d.ts +2 -1
  23. package/core/events/events_comment_move.d.ts +4 -2
  24. package/core/events/events_marker_move.d.ts +10 -1
  25. package/core/events/events_selected.d.ts +6 -0
  26. package/core/events/events_theme_change.d.ts +2 -1
  27. package/core/events/events_toolbox_item_select.d.ts +3 -1
  28. package/core/events/events_trashcan_open.d.ts +5 -1
  29. package/core/events/events_var_base.d.ts +1 -0
  30. package/core/events/events_var_create.d.ts +3 -1
  31. package/core/events/events_var_delete.d.ts +4 -2
  32. package/core/events/events_var_rename.d.ts +4 -2
  33. package/core/events/events_viewport.d.ts +14 -1
  34. package/core/events/utils.d.ts +0 -16
  35. package/core/events/workspace_events.d.ts +2 -4
  36. package/core/field.d.ts +42 -9
  37. package/core/field_angle.d.ts +1 -1
  38. package/core/field_checkbox.d.ts +15 -8
  39. package/core/field_colour.d.ts +1 -4
  40. package/core/field_dropdown.d.ts +2 -2
  41. package/core/field_image.d.ts +1 -2
  42. package/core/field_input.d.ts +6 -15
  43. package/core/field_multilineinput.d.ts +2 -2
  44. package/core/field_textinput.d.ts +12 -0
  45. package/core/field_variable.d.ts +2 -2
  46. package/core/gesture.d.ts +1 -1
  47. package/core/interfaces/i_block_dragger.d.ts +1 -1
  48. package/core/interfaces/i_bubble.d.ts +2 -6
  49. package/core/interfaces/i_metrics_manager.d.ts +8 -6
  50. package/core/interfaces/i_procedure_block.d.ts +3 -0
  51. package/core/metrics_manager.d.ts +8 -6
  52. package/core/{procedures/observable_procedure_map.d.ts → observable_procedure_map.d.ts} +4 -5
  53. package/core/procedures.d.ts +6 -4
  54. package/core/serialization/procedures.d.ts +0 -7
  55. package/core/utils/sentinel.d.ts +5 -0
  56. package/core/workspace_comment_svg.d.ts +2 -15
  57. package/core/workspace_dragger.d.ts +0 -3
  58. package/core/workspace_svg.d.ts +1 -44
  59. package/package.json +6 -6
  60. package/core/block_drag_surface.d.ts +0 -135
  61. package/core/events/events_procedure_base.d.ts +0 -26
  62. package/core/events/events_procedure_change_return.d.ts +0 -40
  63. package/core/events/events_procedure_create.d.ts +0 -34
  64. package/core/events/events_procedure_delete.d.ts +0 -32
  65. package/core/events/events_procedure_enable.d.ts +0 -34
  66. package/core/events/events_procedure_parameter_base.d.ts +0 -26
  67. package/core/events/events_procedure_parameter_create.d.ts +0 -42
  68. package/core/events/events_procedure_parameter_delete.d.ts +0 -41
  69. package/core/events/events_procedure_parameter_rename.d.ts +0 -36
  70. package/core/events/events_procedure_rename.d.ts +0 -35
  71. package/core/procedures/observable_parameter_model.d.ts +0 -62
  72. package/core/procedures/observable_procedure_model.d.ts +0 -75
  73. package/core/procedures/update_procedures.d.ts +0 -13
  74. package/core/workspace_drag_surface_svg.d.ts +0 -74
@@ -40,7 +40,7 @@ export declare class BlockDragger implements IBlockDragger {
40
40
  */
41
41
  dispose(): void;
42
42
  /**
43
- * Start dragging a block. This includes moving it to the drag surface.
43
+ * Start dragging a block.
44
44
  *
45
45
  * @param currentDragDeltaXY How far the pointer has moved from the position
46
46
  * at mouse down, in pixel units.
@@ -89,7 +89,7 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
89
89
  outputConnection: RenderedConnection;
90
90
  nextConnection: RenderedConnection;
91
91
  previousConnection: RenderedConnection;
92
- private readonly useDragSurface_;
92
+ private translation;
93
93
  /**
94
94
  * @param workspace The block's workspace.
95
95
  * @param prototypeName Name of the language object containing type-specific
@@ -164,13 +164,11 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
164
164
  */
165
165
  translate(x: number, y: number): void;
166
166
  /**
167
- * Move this block to its workspace's drag surface, accounting for
168
- * positioning. Generally should be called at the same time as
169
- * setDragging_(true). Does nothing if useDragSurface_ is false.
167
+ * Returns the SVG translation of this block.
170
168
  *
171
169
  * @internal
172
170
  */
173
- moveToDragSurface(): void;
171
+ getTranslation(): string;
174
172
  /**
175
173
  * Move a block to a position.
176
174
  *
@@ -178,18 +176,7 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
178
176
  */
179
177
  moveTo(xy: Coordinate): void;
180
178
  /**
181
- * Move this block back to the workspace block canvas.
182
- * Generally should be called at the same time as setDragging_(false).
183
- * Does nothing if useDragSurface_ is false.
184
- *
185
- * @param newXY The position the block should take on on the workspace canvas,
186
- * in workspace coordinates.
187
- * @internal
188
- */
189
- moveOffDragSurface(newXY: Coordinate): void;
190
- /**
191
- * Move this block during a drag, taking into account whether we are using a
192
- * drag surface to translate blocks.
179
+ * Move this block during a drag.
193
180
  * This block must be a top-level block.
194
181
  *
195
182
  * @param newLoc The location to translate to, in workspace coordinates.
package/core/blockly.d.ts CHANGED
@@ -10,7 +10,6 @@ import './events/events_ui_base.js';
10
10
  import './events/events_var_create.js';
11
11
  import { Block } from './block.js';
12
12
  import * as blockAnimations from './block_animations.js';
13
- import { BlockDragSurfaceSvg } from './block_drag_surface.js';
14
13
  import { BlockDragger } from './block_dragger.js';
15
14
  import { BlockSvg } from './block_svg.js';
16
15
  import { BlocklyOptions } from './blockly_options.js';
@@ -84,6 +83,7 @@ import { IFlyout } from './interfaces/i_flyout.js';
84
83
  import { IKeyboardAccessible } from './interfaces/i_keyboard_accessible.js';
85
84
  import { IMetricsManager } from './interfaces/i_metrics_manager.js';
86
85
  import { IMovable } from './interfaces/i_movable.js';
86
+ import { IObservable, isObservable } from './interfaces/i_observable.js';
87
87
  import { IPositionable } from './interfaces/i_positionable.js';
88
88
  import { IRegistrable } from './interfaces/i_registrable.js';
89
89
  import { ISelectable } from './interfaces/i_selectable.js';
@@ -141,7 +141,6 @@ import { Workspace } from './workspace.js';
141
141
  import { WorkspaceAudio } from './workspace_audio.js';
142
142
  import { WorkspaceComment } from './workspace_comment.js';
143
143
  import { WorkspaceCommentSvg } from './workspace_comment_svg.js';
144
- import { WorkspaceDragSurfaceSvg } from './workspace_drag_surface_svg.js';
145
144
  import { WorkspaceDragger } from './workspace_dragger.js';
146
145
  import { WorkspaceSvg } from './workspace_svg.js';
147
146
  import * as Xml from './xml.js';
@@ -446,7 +445,6 @@ export { BasicCursor };
446
445
  export { Block };
447
446
  export { BlocklyOptions };
448
447
  export { BlockDragger };
449
- export { BlockDragSurfaceSvg };
450
448
  export { BlockSvg };
451
449
  export { Blocks };
452
450
  export { Bubble };
@@ -507,6 +505,7 @@ export { IMetricsManager };
507
505
  export { IMovable };
508
506
  export { Input };
509
507
  export { InsertionMarkerManager };
508
+ export { IObservable, isObservable };
510
509
  export { IPositionable };
511
510
  export { IRegistrable };
512
511
  export { ISelectable };
@@ -543,7 +542,6 @@ export { Workspace };
543
542
  export { WorkspaceAudio };
544
543
  export { WorkspaceComment };
545
544
  export { WorkspaceCommentSvg };
546
- export { WorkspaceDragSurfaceSvg };
547
545
  export { WorkspaceDragger };
548
546
  export { WorkspaceSvg };
549
547
  export { ZoomControls };
package/core/bubble.d.ts CHANGED
@@ -3,7 +3,6 @@
3
3
  * Copyright 2012 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import type { BlockDragSurfaceSvg } from './block_drag_surface.js';
7
6
  import type { BlockSvg } from './block_svg.js';
8
7
  import type { IBubble } from './interfaces/i_bubble.js';
9
8
  import { Coordinate } from './utils/coordinate.js';
@@ -254,15 +253,12 @@ export declare class Bubble implements IBubble {
254
253
  /** Dispose of this bubble. */
255
254
  dispose(): void;
256
255
  /**
257
- * Move this bubble during a drag, taking into account whether or not there is
258
- * a drag surface.
256
+ * Move this bubble during a drag.
259
257
  *
260
- * @param dragSurface The surface that carries rendered items during a drag,
261
- * or null if no drag surface is in use.
262
258
  * @param newLoc The location to translate to, in workspace coordinates.
263
259
  * @internal
264
260
  */
265
- moveDuringDrag(dragSurface: BlockDragSurfaceSvg, newLoc: Coordinate): void;
261
+ moveDuringDrag(newLoc: Coordinate): void;
266
262
  /**
267
263
  * Return the coordinates of the top-left corner of this bubble's body
268
264
  * relative to the drawing surface's origin (0,0), in workspace units.
@@ -21,14 +21,13 @@ export declare class BubbleDragger {
21
21
  /** Whether the bubble would be deleted if dropped immediately. */
22
22
  private wouldDeleteBubble_;
23
23
  private readonly startXY_;
24
- private dragSurface_;
25
24
  /**
26
25
  * @param bubble The item on the bubble canvas to drag.
27
26
  * @param workspace The workspace to drag on.
28
27
  */
29
28
  constructor(bubble: IBubble, workspace: WorkspaceSvg);
30
29
  /**
31
- * Start dragging a bubble. This includes moving it to the drag surface.
30
+ * Start dragging a bubble.
32
31
  *
33
32
  * @internal
34
33
  */
@@ -3,7 +3,7 @@
3
3
  * Copyright 2016 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { Abstract as AbstractEvent, AbstractEventJson } from './events_abstract.js';
6
+ import { Abstract, AbstractEventJson } from './events_abstract.js';
7
7
  import { BlockBase, BlockBaseJson } from './events_block_base.js';
8
8
  import { BlockChange, BlockChangeJson } from './events_block_change.js';
9
9
  import { BlockCreate, BlockCreateJson } from './events_block_create.js';
@@ -18,16 +18,6 @@ import { CommentCreate, CommentCreateJson } from './events_comment_create.js';
18
18
  import { CommentDelete } from './events_comment_delete.js';
19
19
  import { CommentMove, CommentMoveJson } from './events_comment_move.js';
20
20
  import { MarkerMove, MarkerMoveJson } from './events_marker_move.js';
21
- import { ProcedureBase } from './events_procedure_base.js';
22
- import { ProcedureChangeReturn } from './events_procedure_change_return.js';
23
- import { ProcedureCreate } from './events_procedure_create.js';
24
- import { ProcedureDelete } from './events_procedure_delete.js';
25
- import { ProcedureEnable } from './events_procedure_enable.js';
26
- import { ProcedureRename } from './events_procedure_rename.js';
27
- import { ProcedureParameterBase } from './events_procedure_parameter_base.js';
28
- import { ProcedureParameterCreate } from './events_procedure_parameter_create.js';
29
- import { ProcedureParameterDelete } from './events_procedure_parameter_delete.js';
30
- import { ProcedureParameterRename } from './events_procedure_parameter_rename.js';
31
21
  import { Selected, SelectedJson } from './events_selected.js';
32
22
  import { ThemeChange, ThemeChangeJson } from './events_theme_change.js';
33
23
  import { ToolboxItemSelect, ToolboxItemSelectJson } from './events_toolbox_item_select.js';
@@ -41,7 +31,7 @@ import { VarRename, VarRenameJson } from './events_var_rename.js';
41
31
  import { ViewportChange, ViewportChangeJson } from './events_viewport.js';
42
32
  import * as eventUtils from './utils.js';
43
33
  import { FinishedLoading, FinishedLoadingJson } from './workspace_events.js';
44
- export declare const Abstract: typeof AbstractEvent;
34
+ export { Abstract };
45
35
  export { AbstractEventJson };
46
36
  export { BubbleOpen };
47
37
  export { BubbleOpenJson };
@@ -74,16 +64,6 @@ export { FinishedLoading };
74
64
  export { FinishedLoadingJson };
75
65
  export { MarkerMove };
76
66
  export { MarkerMoveJson };
77
- export { ProcedureBase };
78
- export { ProcedureChangeReturn };
79
- export { ProcedureCreate };
80
- export { ProcedureDelete };
81
- export { ProcedureEnable };
82
- export { ProcedureRename };
83
- export { ProcedureParameterBase };
84
- export { ProcedureParameterCreate };
85
- export { ProcedureParameterDelete };
86
- export { ProcedureParameterRename };
87
67
  export { Selected };
88
68
  export { SelectedJson };
89
69
  export { ThemeChange };
@@ -17,7 +17,14 @@ export declare abstract class Abstract {
17
17
  abstract isBlank: boolean;
18
18
  /** The workspace identifier for this event. */
19
19
  workspaceId?: string;
20
+ /**
21
+ * An ID for the group of events this block is associated with.
22
+ *
23
+ * Groups define events that should be treated as an single action from the
24
+ * user's perspective, and should be undone together.
25
+ */
20
26
  group: string;
27
+ /** Whether this event is undoable or not. */
21
28
  recordUndo: boolean;
22
29
  /** Whether or not the event is a UI event. */
23
30
  isUiEvent: boolean;
@@ -7,12 +7,13 @@ import type { Block } from '../block.js';
7
7
  import type { Workspace } from '../workspace.js';
8
8
  import { Abstract as AbstractEvent, AbstractEventJson } from './events_abstract.js';
9
9
  /**
10
- * Abstract class for a block event.
10
+ * Abstract class for any event related to blocks.
11
11
  *
12
12
  * @alias Blockly.Events.BlockBase
13
13
  */
14
14
  export declare class BlockBase extends AbstractEvent {
15
15
  isBlank: boolean;
16
+ /** The ID of the block associated with this event. */
16
17
  blockId?: string;
17
18
  /**
18
19
  * @param opt_block The block this event corresponds to.
@@ -8,15 +8,23 @@ import type { BlockSvg } from '../block_svg.js';
8
8
  import { Workspace } from '../workspace.js';
9
9
  import { BlockBase, BlockBaseJson } from './events_block_base.js';
10
10
  /**
11
- * Class for a block change event.
11
+ * Notifies listeners when some element of a block has changed (e.g.
12
+ * field values, comments, etc).
12
13
  *
13
14
  * @alias Blockly.Events.BlockChange
14
15
  */
15
16
  export declare class BlockChange extends BlockBase {
16
17
  type: string;
18
+ /**
19
+ * The element that changed; one of 'field', 'comment', 'collapsed',
20
+ * 'disabled', 'inline', or 'mutation'
21
+ */
17
22
  element?: string;
23
+ /** The name of the field that changed, if this is a change to a field. */
18
24
  name?: string;
25
+ /** The original value of the element. */
19
26
  oldValue: unknown;
27
+ /** The new value of the element. */
20
28
  newValue: unknown;
21
29
  /**
22
30
  * @param opt_block The changed block. Undefined for a blank event.
@@ -8,15 +8,19 @@ import * as blocks from '../serialization/blocks.js';
8
8
  import { BlockBase, BlockBaseJson } from './events_block_base.js';
9
9
  import { Workspace } from '../workspace.js';
10
10
  /**
11
- * Class for a block creation event.
11
+ * Notifies listeners when a block (or connected stack of blocks) is
12
+ * created.
12
13
  *
13
14
  * @alias Blockly.Events.BlockCreate
14
15
  */
15
16
  export declare class BlockCreate extends BlockBase {
16
17
  type: string;
18
+ /** The XML representation of the created block(s). */
17
19
  xml?: Element | DocumentFragment;
18
- ids?: string[];
20
+ /** The JSON respresentation of the created block(s). */
19
21
  json?: blocks.State;
22
+ /** All of the IDs of created blocks. */
23
+ ids?: string[];
20
24
  /** @param opt_block The created block. Undefined for a blank event. */
21
25
  constructor(opt_block?: Block);
22
26
  /**
@@ -8,15 +8,20 @@ import * as blocks from '../serialization/blocks.js';
8
8
  import { BlockBase, BlockBaseJson } from './events_block_base.js';
9
9
  import { Workspace } from '../workspace.js';
10
10
  /**
11
- * Class for a block deletion event.
11
+ * Notifies listeners when a block (or connected stack of blocks) is
12
+ * deleted.
12
13
  *
13
14
  * @alias Blockly.Events.BlockDelete
14
15
  */
15
16
  export declare class BlockDelete extends BlockBase {
17
+ /** The XML representation of the deleted block(s). */
16
18
  oldXml?: Element | DocumentFragment;
19
+ /** The JSON respresentation of the deleted block(s). */
20
+ oldJson?: blocks.State;
21
+ /** All of the IDs of deleted blocks. */
17
22
  ids?: string[];
23
+ /** True if the deleted block was a shadow block, false otherwise. */
18
24
  wasShadow?: boolean;
19
- oldJson?: blocks.State;
20
25
  type: string;
21
26
  /** @param opt_block The deleted block. Undefined for a blank event. */
22
27
  constructor(opt_block?: Block);
@@ -8,13 +8,19 @@ import { AbstractEventJson } from './events_abstract.js';
8
8
  import { UiBase } from './events_ui_base.js';
9
9
  import { Workspace } from '../workspace.js';
10
10
  /**
11
- * Class for a block drag event.
11
+ * Notifies listeners when a block is being manually dragged/dropped.
12
12
  *
13
13
  * @alias Blockly.Events.BlockDrag
14
14
  */
15
15
  export declare class BlockDrag extends UiBase {
16
+ /** The ID of the top-level block being dragged. */
16
17
  blockId?: string;
18
+ /** True if this is the start of a drag, false if this is the end of one. */
17
19
  isStart?: boolean;
20
+ /**
21
+ * A list of all of the blocks (i.e. all descendants of the block associated
22
+ * with the block ID) being dragged.
23
+ */
18
24
  blocks?: Block[];
19
25
  type: string;
20
26
  /**
@@ -8,17 +8,36 @@ import { Coordinate } from '../utils/coordinate.js';
8
8
  import { BlockBase, BlockBaseJson } from './events_block_base.js';
9
9
  import type { Workspace } from '../workspace.js';
10
10
  /**
11
- * Class for a block move event. Created before the move.
11
+ * Notifies listeners when a block is moved. This could be from one
12
+ * connection to another, or from one location on the workspace to another.
12
13
  *
13
14
  * @alias Blockly.Events.BlockMove
14
15
  */
15
16
  export declare class BlockMove extends BlockBase {
16
17
  type: string;
18
+ /** The ID of the old parent block. Undefined if it was a top-level block. */
17
19
  oldParentId?: string;
20
+ /**
21
+ * The name of the old input. Undefined if it was a top-level block or the
22
+ * parent's next block.
23
+ */
18
24
  oldInputName?: string;
25
+ /**
26
+ * The old X and Y workspace coordinates of the block if it was a top level
27
+ * block. Undefined if it was not a top level block.
28
+ */
19
29
  oldCoordinate?: Coordinate;
30
+ /** The ID of the new parent block. Undefined if it is a top-level block. */
20
31
  newParentId?: string;
32
+ /**
33
+ * The name of the new input. Undefined if it is a top-level block or the
34
+ * parent's next block.
35
+ */
21
36
  newInputName?: string;
37
+ /**
38
+ * The new X and Y workspace coordinates of the block if it is a top level
39
+ * block. Undefined if it is not a top level block.
40
+ */
22
41
  newCoordinate?: Coordinate;
23
42
  /** @param opt_block The moved block. Undefined for a blank event. */
24
43
  constructor(opt_block?: Block);
@@ -13,8 +13,11 @@ import type { Workspace } from '../workspace.js';
13
13
  * @alias Blockly.Events.BubbleOpen
14
14
  */
15
15
  export declare class BubbleOpen extends UiBase {
16
+ /** The ID of the block the bubble is attached to. */
16
17
  blockId?: string;
18
+ /** True if the bubble is opening, false if closing. */
17
19
  isOpen?: boolean;
20
+ /** The type of bubble; one of 'mutator', 'comment', or 'warning'. */
18
21
  bubbleType?: BubbleType;
19
22
  type: string;
20
23
  /**
@@ -8,12 +8,17 @@ import { AbstractEventJson } from './events_abstract.js';
8
8
  import { UiBase } from './events_ui_base.js';
9
9
  import { Workspace } from '../workspace.js';
10
10
  /**
11
- * Class for a click event.
11
+ * Notifies listeners that ome blockly element was clicked.
12
12
  *
13
13
  * @alias Blockly.Events.Click
14
14
  */
15
15
  export declare class Click extends UiBase {
16
+ /** The ID of the block that was clicked, if a block was clicked. */
16
17
  blockId?: string;
18
+ /**
19
+ * The type of element that was clicked; one of 'block', 'workspace',
20
+ * or 'zoom_controls'.
21
+ */
17
22
  targetType?: ClickTarget;
18
23
  type: string;
19
24
  /**
@@ -15,6 +15,7 @@ import type { Workspace } from '../workspace.js';
15
15
  */
16
16
  export declare class CommentBase extends AbstractEvent {
17
17
  isBlank: boolean;
18
+ /** The ID of the comment that this event references. */
18
19
  commentId?: string;
19
20
  /**
20
21
  * @param opt_comment The comment this event corresponds to. Undefined for a
@@ -7,13 +7,15 @@ import type { WorkspaceComment } from '../workspace_comment.js';
7
7
  import { CommentBase, CommentBaseJson } from './events_comment_base.js';
8
8
  import type { Workspace } from '../workspace.js';
9
9
  /**
10
- * Class for a comment change event.
10
+ * Notifies listeners that the contents of a workspace comment has changed.
11
11
  *
12
12
  * @alias Blockly.Events.CommentChange
13
13
  */
14
14
  export declare class CommentChange extends CommentBase {
15
15
  type: string;
16
+ /** The previous contents of the comment. */
16
17
  oldContents_?: string;
18
+ /** The new contents of the comment. */
17
19
  newContents_?: string;
18
20
  /**
19
21
  * @param opt_comment The comment that is being changed. Undefined for a
@@ -7,12 +7,13 @@ import type { WorkspaceComment } from '../workspace_comment.js';
7
7
  import { CommentBase, CommentBaseJson } from './events_comment_base.js';
8
8
  import type { Workspace } from '../workspace.js';
9
9
  /**
10
- * Class for a comment creation event.
10
+ * Notifies listeners that a workspace comment was created.
11
11
  *
12
12
  * @alias Blockly.Events.CommentCreate
13
13
  */
14
14
  export declare class CommentCreate extends CommentBase {
15
15
  type: string;
16
+ /** The XML representation of the created workspace comment. */
16
17
  xml?: Element | DocumentFragment;
17
18
  /**
18
19
  * @param opt_comment The created comment.
@@ -7,12 +7,13 @@ import type { WorkspaceComment } from '../workspace_comment.js';
7
7
  import { CommentBase, CommentBaseJson } from './events_comment_base.js';
8
8
  import type { Workspace } from '../workspace.js';
9
9
  /**
10
- * Class for a comment deletion event.
10
+ * Notifies listeners that a workspace comment has been deleted.
11
11
  *
12
12
  * @alias Blockly.Events.CommentDelete
13
13
  */
14
14
  export declare class CommentDelete extends CommentBase {
15
15
  type: string;
16
+ /** The XML representation of the deleted workspace comment. */
16
17
  xml?: Element;
17
18
  /**
18
19
  * @param opt_comment The deleted comment.
@@ -8,15 +8,17 @@ import type { WorkspaceComment } from '../workspace_comment.js';
8
8
  import { CommentBase, CommentBaseJson } from './events_comment_base.js';
9
9
  import type { Workspace } from '../workspace.js';
10
10
  /**
11
- * Class for a comment move event. Created before the move.
11
+ * Notifies listeners that a workspace comment has moved.
12
12
  *
13
13
  * @alias Blockly.Events.CommentMove
14
14
  */
15
15
  export declare class CommentMove extends CommentBase {
16
16
  type: string;
17
+ /** The comment that is being moved. */
17
18
  comment_?: WorkspaceComment;
19
+ /** The location of the comment before the move, in workspace coordinates. */
18
20
  oldCoordinate_?: Coordinate;
19
- /** The location after the move, in workspace coordinates. */
21
+ /** The location of the comment after the move, in workspace coordinates. */
20
22
  newCoordinate_?: Coordinate;
21
23
  /**
22
24
  * @param opt_comment The comment that is being moved. Undefined for a blank
@@ -9,14 +9,23 @@ import type { Workspace } from '../workspace.js';
9
9
  import { AbstractEventJson } from './events_abstract.js';
10
10
  import { UiBase } from './events_ui_base.js';
11
11
  /**
12
- * Class for a marker move event.
12
+ * Notifies listeners that a marker (used for keyboard navigation) has
13
+ * moved.
13
14
  *
14
15
  * @alias Blockly.Events.MarkerMove
15
16
  */
16
17
  export declare class MarkerMove extends UiBase {
18
+ /** The ID of the block the marker is now on, if any. */
17
19
  blockId?: string;
20
+ /** The old node the marker used to be on, if any. */
18
21
  oldNode?: ASTNode;
22
+ /** The new node the marker is now on. */
19
23
  newNode?: ASTNode;
24
+ /**
25
+ * True if this is a cursor event, false otherwise.
26
+ * For information about cursors vs markers see {@link
27
+ * https://blocklycodelabs.dev/codelabs/keyboard-navigation/index.html?index=..%2F..index#1}.
28
+ */
20
29
  isCursor?: boolean;
21
30
  type: string;
22
31
  /**
@@ -8,11 +8,17 @@ import { UiBase } from './events_ui_base.js';
8
8
  import type { Workspace } from '../workspace.js';
9
9
  /**
10
10
  * Class for a selected event.
11
+ * Notifies listeners that a new element has been selected.
11
12
  *
12
13
  * @alias Blockly.Events.Selected
13
14
  */
14
15
  export declare class Selected extends UiBase {
16
+ /** The id of the last selected selectable element. */
15
17
  oldElementId?: string;
18
+ /**
19
+ * The id of the newly selected selectable element,
20
+ * or undefined if unselected.
21
+ */
16
22
  newElementId?: string;
17
23
  type: string;
18
24
  /**
@@ -7,11 +7,12 @@ import { AbstractEventJson } from './events_abstract.js';
7
7
  import { UiBase } from './events_ui_base.js';
8
8
  import type { Workspace } from '../workspace.js';
9
9
  /**
10
- * Class for a theme change event.
10
+ * Notifies listeners that the workspace theme has changed.
11
11
  *
12
12
  * @alias Blockly.Events.ThemeChange
13
13
  */
14
14
  export declare class ThemeChange extends UiBase {
15
+ /** The name of the new theme that has been set. */
15
16
  themeName?: string;
16
17
  type: string;
17
18
  /**
@@ -7,12 +7,14 @@ import { AbstractEventJson } from './events_abstract.js';
7
7
  import { UiBase } from './events_ui_base.js';
8
8
  import type { Workspace } from '../workspace.js';
9
9
  /**
10
- * Class for a toolbox item select event.
10
+ * Notifies listeners that a toolbox item has been selected.
11
11
  *
12
12
  * @alias Blockly.Events.ToolboxItemSelect
13
13
  */
14
14
  export declare class ToolboxItemSelect extends UiBase {
15
+ /** The previously selected toolbox item. */
15
16
  oldItem?: string;
17
+ /** The newly selected toolbox item. */
16
18
  newItem?: string;
17
19
  type: string;
18
20
  /**
@@ -7,11 +7,15 @@ import { AbstractEventJson } from './events_abstract.js';
7
7
  import { UiBase } from './events_ui_base.js';
8
8
  import type { Workspace } from '../workspace.js';
9
9
  /**
10
- * Class for a trashcan open event.
10
+ * Notifies listeners when the trashcan is opening or closing.
11
11
  *
12
12
  * @alias Blockly.Events.TrashcanOpen
13
13
  */
14
14
  export declare class TrashcanOpen extends UiBase {
15
+ /**
16
+ * True if the trashcan is currently opening (previously closed).
17
+ * False if it is currently closing (previously open).
18
+ */
15
19
  isOpen?: boolean;
16
20
  type: string;
17
21
  /**
@@ -13,6 +13,7 @@ import type { Workspace } from '../workspace.js';
13
13
  */
14
14
  export declare class VarBase extends AbstractEvent {
15
15
  isBlank: boolean;
16
+ /** The ID of the variable this event references. */
16
17
  varId?: string;
17
18
  /**
18
19
  * @param opt_variable The variable this event corresponds to. Undefined for
@@ -7,13 +7,15 @@ import type { VariableModel } from '../variable_model.js';
7
7
  import { VarBase, VarBaseJson } from './events_var_base.js';
8
8
  import type { Workspace } from '../workspace.js';
9
9
  /**
10
- * Class for a variable creation event.
10
+ * Notifies listeners that a variable model has been created.
11
11
  *
12
12
  * @alias Blockly.Events.VarCreate
13
13
  */
14
14
  export declare class VarCreate extends VarBase {
15
15
  type: string;
16
+ /** The type of the variable that was created. */
16
17
  varType?: string;
18
+ /** The name of the variable that was created. */
17
19
  varName?: string;
18
20
  /**
19
21
  * @param opt_variable The created variable. Undefined for a blank event.
@@ -7,13 +7,15 @@ import type { VariableModel } from '../variable_model.js';
7
7
  import { VarBase, VarBaseJson } from './events_var_base.js';
8
8
  import type { Workspace } from '../workspace.js';
9
9
  /**
10
- * Class for a variable deletion event.
10
+ * Notifies listeners that a variable model has been deleted.
11
11
  *
12
- * @alias Blockly.Events.VarDelete
12
+ * @class
13
13
  */
14
14
  export declare class VarDelete extends VarBase {
15
15
  type: string;
16
+ /** The type of the variable that was deleted. */
16
17
  varType?: string;
18
+ /** The name of the variable that was deleted. */
17
19
  varName?: string;
18
20
  /**
19
21
  * @param opt_variable The deleted variable. Undefined for a blank event.
@@ -7,13 +7,15 @@ import type { VariableModel } from '../variable_model.js';
7
7
  import { VarBase, VarBaseJson } from './events_var_base.js';
8
8
  import type { Workspace } from '../workspace.js';
9
9
  /**
10
- * Class for a variable rename event.
10
+ * Notifies listeners that a variable model was renamed.
11
11
  *
12
- * @alias Blockly.Events.VarRename
12
+ * @class
13
13
  */
14
14
  export declare class VarRename extends VarBase {
15
15
  type: string;
16
+ /** The previous name of the variable. */
16
17
  oldName?: string;
18
+ /** The new name of the variable. */
17
19
  newName?: string;
18
20
  /**
19
21
  * @param opt_variable The renamed variable. Undefined for a blank event.