blockly 11.1.0 → 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
@@ -3,11 +3,11 @@
3
3
  * Copyright 2020 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import type { IRegistrable } from './i_registrable.js';
7
- import type { IToolboxItem } from './i_toolbox_item.js';
8
6
  import type { ToolboxInfo } from '../utils/toolbox.js';
9
- import type { IFlyout } from './i_flyout.js';
10
7
  import type { WorkspaceSvg } from '../workspace_svg.js';
8
+ import type { IFlyout } from './i_flyout.js';
9
+ import type { IRegistrable } from './i_registrable.js';
10
+ import type { IToolboxItem } from './i_toolbox_item.js';
11
11
  /**
12
12
  * Interface for a toolbox.
13
13
  */
@@ -12,11 +12,11 @@
12
12
  import { Block } from '../block.js';
13
13
  import type { Connection } from '../connection.js';
14
14
  import type { Field } from '../field.js';
15
+ import { FlyoutButton } from '../flyout_button.js';
15
16
  import type { Input } from '../inputs/input.js';
16
17
  import type { IASTNodeLocation } from '../interfaces/i_ast_node_location.js';
17
18
  import { Coordinate } from '../utils/coordinate.js';
18
19
  import type { Workspace } from '../workspace.js';
19
- import { FlyoutButton } from '../flyout_button.js';
20
20
  /**
21
21
  * Class for an AST node.
22
22
  * It is recommended that you use one of the createNode methods instead of
@@ -3,9 +3,9 @@
3
3
  * Copyright 2023 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { WorkspaceSvg } from './workspace_svg.js';
7
6
  import { IRenderedElement } from './interfaces/i_rendered_element.js';
8
7
  import { Coordinate } from './utils/coordinate.js';
8
+ import { WorkspaceSvg } from './workspace_svg.js';
9
9
  /** @internal */
10
10
  export declare class LayerManager {
11
11
  private workspace;
package/core/layers.d.ts CHANGED
@@ -6,13 +6,11 @@
6
6
  /**
7
7
  * The layer to place blocks on.
8
8
  *
9
- * @internal
10
9
  */
11
10
  export declare const BLOCK = 50;
12
11
  /**
13
12
  * The layer to place bubbles on.
14
13
  *
15
- * @internal
16
14
  */
17
15
  export declare const BUBBLE = 100;
18
16
  //# sourceMappingURL=layers.d.ts.map
@@ -7,11 +7,11 @@ import './events/events_block_change.js';
7
7
  import type { Block } from './block.js';
8
8
  import type { Abstract } from './events/events_abstract.js';
9
9
  import { Field } from './field.js';
10
+ import { ProcedureTuple } from './interfaces/i_legacy_procedure_blocks.js';
10
11
  import { IParameterModel } from './interfaces/i_parameter_model.js';
12
+ import { IProcedureBlock, isProcedureBlock } from './interfaces/i_procedure_block.js';
11
13
  import { IProcedureMap } from './interfaces/i_procedure_map.js';
12
14
  import { IProcedureModel } from './interfaces/i_procedure_model.js';
13
- import { IProcedureBlock, isProcedureBlock } from './interfaces/i_procedure_block.js';
14
- import { ProcedureTuple } from './interfaces/i_legacy_procedure_blocks.js';
15
15
  import { ObservableProcedureMap } from './observable_procedure_map.js';
16
16
  import type { Workspace } from './workspace.js';
17
17
  import type { WorkspaceSvg } from './workspace_svg.js';
@@ -101,5 +101,5 @@ export declare function mutateCallers(defBlock: Block): void;
101
101
  * @returns The procedure definition block, or null not found.
102
102
  */
103
103
  export declare function getDefinition(name: string, workspace: Workspace): Block | null;
104
- export { ObservableProcedureMap, IParameterModel, IProcedureBlock, isProcedureBlock, IProcedureMap, IProcedureModel, ProcedureTuple, };
104
+ export { IParameterModel, IProcedureBlock, IProcedureMap, IProcedureModel, isProcedureBlock, ObservableProcedureMap, ProcedureTuple, };
105
105
  //# sourceMappingURL=procedures.d.ts.map
@@ -5,11 +5,15 @@
5
5
  */
6
6
  import type { Abstract } from './events/events_abstract.js';
7
7
  import type { Field } from './field.js';
8
+ import type { Input } from './inputs/input.js';
8
9
  import type { IConnectionChecker } from './interfaces/i_connection_checker.js';
10
+ import type { IConnectionPreviewer } from './interfaces/i_connection_previewer.js';
11
+ import type { ICopyable } from './interfaces/i_copyable.js';
12
+ import type { IDragger } from './interfaces/i_dragger.js';
9
13
  import type { IFlyout } from './interfaces/i_flyout.js';
10
- import type { IMetricsManager } from './interfaces/i_metrics_manager.js';
11
14
  import type { IIcon } from './interfaces/i_icon.js';
12
- import type { Input } from './inputs/input.js';
15
+ import type { IMetricsManager } from './interfaces/i_metrics_manager.js';
16
+ import type { IPaster } from './interfaces/i_paster.js';
13
17
  import type { ISerializer } from './interfaces/i_serializer.js';
14
18
  import type { IToolbox } from './interfaces/i_toolbox.js';
15
19
  import type { Cursor } from './keyboard_nav/cursor.js';
@@ -17,10 +21,6 @@ import type { Options } from './options.js';
17
21
  import type { Renderer } from './renderers/common/renderer.js';
18
22
  import type { Theme } from './theme.js';
19
23
  import type { ToolboxItem } from './toolbox/toolbox_item.js';
20
- import type { IPaster } from './interfaces/i_paster.js';
21
- import type { ICopyable } from './interfaces/i_copyable.js';
22
- import type { IConnectionPreviewer } from './interfaces/i_connection_previewer.js';
23
- import type { IDragger } from './interfaces/i_dragger.js';
24
24
  export declare const TEST_ONLY: {
25
25
  typeMap: {
26
26
  [key: string]: {
@@ -39,7 +39,7 @@ import { Renderer } from './renderer.js';
39
39
  * @param rendererClass The new renderer class to register.
40
40
  * @throws {Error} if a renderer with the same name has already been registered.
41
41
  */
42
- export declare function register(name: string, rendererClass: Function): void;
42
+ export declare function register(name: string, rendererClass: new (name: string) => Renderer): void;
43
43
  /**
44
44
  * Unregisters the renderer registered with the given name.
45
45
  *
@@ -59,33 +59,6 @@ export declare function unregister(name: string): void;
59
59
  export declare function init(name: string, theme: Theme, opt_rendererOverrides?: {
60
60
  [rendererConstant: string]: any;
61
61
  }): Renderer;
62
- export { BottomRow };
63
- export { Connection };
64
- export { Drawer };
65
- export { ExternalValueInput };
66
- export { Field };
67
- export { Hat };
68
- export { Icon };
69
- export { InRowSpacer };
70
- export { InlineInput };
71
- export { InputConnection };
72
- export { InputRow };
73
- export { IPathObject };
74
- export { JaggedEdge };
75
- export { MarkerSvg };
76
- export { Measurable };
77
- export { NextConnection };
78
- export { OutputConnection };
79
- export { PathObject };
80
- export { PreviousConnection };
81
- export { Renderer };
82
- export { RenderInfo };
83
- export { RoundCorner };
84
- export { Row };
85
- export { SpacerRow };
86
- export { SquareCorner };
87
- export { StatementInput };
88
- export { TopRow };
89
- export { Types };
90
- export { OutsideCorners, InsideCorners, StartHat, Notch, PuzzleTab, JaggedTeeth, BaseShape, DynamicShape, ConstantProvider, } from './constants.js';
62
+ export { BottomRow, Connection, Drawer, ExternalValueInput, Field, Hat, Icon, InlineInput, InputConnection, InputRow, InRowSpacer, IPathObject, JaggedEdge, MarkerSvg, Measurable, NextConnection, OutputConnection, PathObject, PreviousConnection, Renderer, RenderInfo, RoundCorner, Row, SpacerRow, SquareCorner, StatementInput, TopRow, Types, };
63
+ export { BaseShape, ConstantProvider, DynamicShape, InsideCorners, JaggedTeeth, Notch, OutsideCorners, PuzzleTab, StartHat, } from './constants.js';
91
64
  //# sourceMappingURL=block_rendering.d.ts.map
@@ -3,11 +3,11 @@
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import type { BlockStyle } from '../../theme.js';
7
6
  import type { BlockSvg } from '../../block_svg.js';
8
- import type { ConstantProvider } from './constants.js';
9
7
  import type { RenderedConnection } from '../../rendered_connection.js';
8
+ import type { BlockStyle } from '../../theme.js';
10
9
  import type { Coordinate } from '../../utils/coordinate.js';
10
+ import type { ConstantProvider } from './constants.js';
11
11
  /**
12
12
  * An interface for a block's path object.
13
13
  *
@@ -8,6 +8,7 @@ import { Input } from '../../inputs/input.js';
8
8
  import type { RenderedConnection } from '../../rendered_connection.js';
9
9
  import type { Measurable } from '../measurables/base.js';
10
10
  import { BottomRow } from '../measurables/bottom_row.js';
11
+ import { Connection } from '../measurables/connection.js';
11
12
  import { InputRow } from '../measurables/input_row.js';
12
13
  import { OutputConnection } from '../measurables/output_connection.js';
13
14
  import type { Row } from '../measurables/row.js';
@@ -15,7 +16,6 @@ import { SpacerRow } from '../measurables/spacer_row.js';
15
16
  import { TopRow } from '../measurables/top_row.js';
16
17
  import type { ConstantProvider } from './constants.js';
17
18
  import type { Renderer } from './renderer.js';
18
- import { Connection } from '../measurables/connection.js';
19
19
  /**
20
20
  * An object containing all sizing information needed to draw this block.
21
21
  *
@@ -15,13 +15,13 @@ import type { ConstantProvider, Notch, PuzzleTab } from './constants.js';
15
15
  * SVG.
16
16
  */
17
17
  export declare class MarkerSvg {
18
- private readonly workspace;
19
- private readonly marker;
18
+ protected readonly workspace: WorkspaceSvg;
19
+ protected readonly marker: Marker;
20
20
  /**
21
21
  * The workspace, field, or block that the marker SVG element should be
22
22
  * attached to.
23
23
  */
24
- private parent;
24
+ protected parent: IASTNodeLocationSvg | null;
25
25
  /** The current SVG element for the marker. */
26
26
  currentMarkerSvg: SVGElement | null;
27
27
  colour_: string;
@@ -94,7 +94,7 @@ export declare class MarkerSvg {
94
94
  *
95
95
  * @param curNode The node to draw the marker for.
96
96
  */
97
- private showWithBlockPrevOutput;
97
+ protected showWithBlockPrevOutput(curNode: ASTNode): void;
98
98
  /**
99
99
  * Position and display the marker for a block.
100
100
  *
@@ -229,7 +229,7 @@ export declare class MarkerSvg {
229
229
  * @param oldNode The old node the marker used to be on.
230
230
  * @param curNode The new node the marker is currently on.
231
231
  */
232
- private fireMarkerEvent;
232
+ protected fireMarkerEvent(oldNode: ASTNode, curNode: ASTNode): void;
233
233
  /**
234
234
  * Get the properties to make a marker blink.
235
235
  *
@@ -5,8 +5,8 @@
5
5
  */
6
6
  import type { RenderedConnection } from '../../rendered_connection.js';
7
7
  import type { Theme } from '../../theme.js';
8
- import { ConstantProvider as BaseConstantProvider } from '../common/constants.js';
9
8
  import type { Shape } from '../common/constants.js';
9
+ import { ConstantProvider as BaseConstantProvider } from '../common/constants.js';
10
10
  /** An object containing sizing and path information about inside corners. */
11
11
  export interface InsideCorners {
12
12
  width: number;
@@ -38,7 +38,7 @@ interface ProcedureModelConstructor<ProcedureModel extends IProcedureModel> {
38
38
  * @param workspace The workspace to load the procedure model into.
39
39
  * @returns The constructed procedure model.
40
40
  */
41
- loadState(state: Object, workspace: Workspace): ProcedureModel;
41
+ loadState(state: object, workspace: Workspace): ProcedureModel;
42
42
  }
43
43
  /**
44
44
  * A newable signature for an IParameterModel.
@@ -56,7 +56,7 @@ interface ParameterModelConstructor<ParameterModel extends IParameterModel> {
56
56
  * @param workspace The workspace to load the parameter model into.
57
57
  * @returns The constructed parameter model.
58
58
  */
59
- loadState(state: Object, workspace: Workspace): ParameterModel;
59
+ loadState(state: object, workspace: Workspace): ParameterModel;
60
60
  }
61
61
  /**
62
62
  * Serializes the given IProcedureModel to JSON.
@@ -3,9 +3,9 @@
3
3
  * Copyright 2024 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
+ import type { WorkspaceComment } from '../comments/workspace_comment.js';
6
7
  import { ISerializer } from '../interfaces/i_serializer.js';
7
8
  import { Workspace } from '../workspace.js';
8
- import type { WorkspaceComment } from '../comments/workspace_comment.js';
9
9
  export interface State {
10
10
  id?: string;
11
11
  text?: string;
@@ -6,14 +6,14 @@
6
6
  /**
7
7
  * Serialization methods.
8
8
  */
9
+ import { ISerializer } from './interfaces/i_serializer.js';
9
10
  import * as blocks from './serialization/blocks.js';
10
11
  import * as exceptions from './serialization/exceptions.js';
11
12
  import * as priorities from './serialization/priorities.js';
12
13
  import * as procedures from './serialization/procedures.js';
13
14
  import * as registry from './serialization/registry.js';
14
15
  import * as variables from './serialization/variables.js';
15
- import * as workspaces from './serialization/workspaces.js';
16
16
  import * as workspaceComments from './serialization/workspace_comments.js';
17
- import { ISerializer } from './interfaces/i_serializer.js';
18
- export { blocks, exceptions, priorities, procedures, registry, variables, workspaces, workspaceComments, ISerializer, };
17
+ import * as workspaces from './serialization/workspaces.js';
18
+ export { blocks, exceptions, ISerializer, priorities, procedures, registry, variables, workspaceComments, workspaces, };
19
19
  //# sourceMappingURL=serialization.d.ts.map
@@ -3,14 +3,9 @@
3
3
  * Copyright 2020 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- /**
7
- * Toolbox from whence to create blocks.
8
- *
9
- * @class
10
- */
11
- import '../events/events_toolbox_item_select.js';
12
6
  import * as browserEvents from '../browser_events.js';
13
7
  import { DeleteArea } from '../delete_area.js';
8
+ import '../events/events_toolbox_item_select.js';
14
9
  import type { IAutoHideable } from '../interfaces/i_autohideable.js';
15
10
  import type { IDraggable } from '../interfaces/i_draggable.js';
16
11
  import type { IFlyout } from '../interfaces/i_flyout.js';
package/core/tooltip.d.ts CHANGED
@@ -11,7 +11,7 @@
11
11
  */
12
12
  export type TipInfo = string | {
13
13
  tooltip: any;
14
- } | (() => TipInfo | string | Function);
14
+ } | (() => TipInfo | string);
15
15
  /**
16
16
  * A function that renders custom tooltip UI.
17
17
  * 1st parameter: the div element to render content into.
@@ -3,13 +3,8 @@
3
3
  * Copyright 2011 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- /**
7
- * Object representing a trash can icon.
8
- *
9
- * @class
10
- */
11
- import './events/events_trashcan_open.js';
12
6
  import { DeleteArea } from './delete_area.js';
7
+ import './events/events_trashcan_open.js';
13
8
  import type { IAutoHideable } from './interfaces/i_autohideable.js';
14
9
  import type { IDraggable } from './interfaces/i_draggable.js';
15
10
  import type { IFlyout } from './interfaces/i_flyout.js';
@@ -29,7 +29,7 @@ export declare class Size {
29
29
  * @returns True iff the sizes have equal widths and equal heights, or if both
30
30
  * are null.
31
31
  */
32
- static equals(a: Size | null, b: Size | null): boolean;
32
+ static equals(a?: Size | null, b?: Size | null): boolean;
33
33
  /**
34
34
  * Returns a new size with the maximum width and height values out of both
35
35
  * sizes.
@@ -3,9 +3,9 @@
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
+ import type { FlyoutButton } from './flyout_button.js';
6
7
  import type { Workspace } from './workspace.js';
7
8
  import type { WorkspaceSvg } from './workspace_svg.js';
8
- import type { FlyoutButton } from './flyout_button.js';
9
9
  /**
10
10
  * String for use in the "custom" attribute of a category in toolbox XML.
11
11
  * This string indicates that the category should be dynamically populated with
@@ -10,16 +10,16 @@
10
10
  */
11
11
  import './connection_checker.js';
12
12
  import type { Block } from './block.js';
13
+ import { WorkspaceComment } from './comments/workspace_comment.js';
13
14
  import type { ConnectionDB } from './connection_db.js';
14
15
  import type { Abstract } from './events/events_abstract.js';
15
16
  import type { IASTNodeLocation } from './interfaces/i_ast_node_location.js';
16
17
  import type { IConnectionChecker } from './interfaces/i_connection_checker.js';
18
+ import { IProcedureMap } from './interfaces/i_procedure_map.js';
17
19
  import { Options } from './options.js';
18
20
  import type * as toolbox from './utils/toolbox.js';
19
21
  import { VariableMap } from './variable_map.js';
20
22
  import type { VariableModel } from './variable_model.js';
21
- import { WorkspaceComment } from './comments/workspace_comment.js';
22
- import { IProcedureMap } from './interfaces/i_procedure_map.js';
23
23
  /**
24
24
  * Class for a workspace. This is a data structure that contains blocks.
25
25
  * There is no UI, and can be created headlessly.
@@ -353,13 +353,13 @@ export declare class Workspace implements IASTNodeLocation {
353
353
  * @param func Function to call.
354
354
  * @returns Obsolete return value, ignore.
355
355
  */
356
- addChangeListener(func: (e: Abstract) => void): Function;
356
+ addChangeListener(func: (e: Abstract) => void): (e: Abstract) => void;
357
357
  /**
358
358
  * Stop listening for this workspace's changes.
359
359
  *
360
360
  * @param func Function to stop calling.
361
361
  */
362
- removeChangeListener(func: Function): void;
362
+ removeChangeListener(func: (e: Abstract) => void): void;
363
363
  /**
364
364
  * Fire a change event.
365
365
  *
@@ -393,7 +393,6 @@ export declare class Workspace implements IASTNodeLocation {
393
393
  *
394
394
  * @param id ID of comment to find.
395
395
  * @returns The sought after comment, or null if not found.
396
- * @internal
397
396
  */
398
397
  getCommentById(id: string): WorkspaceComment | null;
399
398
  /**
@@ -14,7 +14,9 @@ import './events/events_viewport.js';
14
14
  import type { Block } from './block.js';
15
15
  import type { BlockSvg } from './block_svg.js';
16
16
  import * as browserEvents from './browser_events.js';
17
+ import { WorkspaceComment } from './comments/workspace_comment.js';
17
18
  import { ComponentManager } from './component_manager.js';
19
+ import { ContextMenuOption } from './contextmenu_registry.js';
18
20
  import type { FlyoutButton } from './flyout_button.js';
19
21
  import { Gesture } from './gesture.js';
20
22
  import { Grid } from './grid.js';
@@ -26,6 +28,7 @@ import type { IMetricsManager } from './interfaces/i_metrics_manager.js';
26
28
  import type { IToolbox } from './interfaces/i_toolbox.js';
27
29
  import type { Cursor } from './keyboard_nav/cursor.js';
28
30
  import type { Marker } from './keyboard_nav/marker.js';
31
+ import { LayerManager } from './layer_manager.js';
29
32
  import { MarkerManager } from './marker_manager.js';
30
33
  import { Options } from './options.js';
31
34
  import type { Renderer } from './renderers/common/renderer.js';
@@ -42,10 +45,7 @@ import * as toolbox from './utils/toolbox.js';
42
45
  import type { VariableModel } from './variable_model.js';
43
46
  import { Workspace } from './workspace.js';
44
47
  import { WorkspaceAudio } from './workspace_audio.js';
45
- import { WorkspaceComment } from './comments/workspace_comment.js';
46
48
  import { ZoomControls } from './zoom_controls.js';
47
- import { ContextMenuOption } from './contextmenu_registry.js';
48
- import { LayerManager } from './layer_manager.js';
49
49
  /**
50
50
  * Class for a workspace. This is an onscreen area with optional trashcan,
51
51
  * scrollbars, bubbles, and dragging.
package/core/xml.d.ts CHANGED
@@ -4,10 +4,10 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { Block } from './block.js';
7
+ import { WorkspaceComment } from './comments/workspace_comment.js';
7
8
  import type { VariableModel } from './variable_model.js';
8
9
  import type { Workspace } from './workspace.js';
9
10
  import { WorkspaceSvg } from './workspace_svg.js';
10
- import { WorkspaceComment } from './comments/workspace_comment.js';
11
11
  /**
12
12
  * Encode a block tree as XML.
13
13
  *