blockly 11.1.1 → 11.2.0-beta.1

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 (164) hide show
  1. package/blockly.min.js +551 -525
  2. package/blockly.mjs +1 -0
  3. package/blockly_compressed.js +519 -493
  4. package/blockly_compressed.js.map +1 -1
  5. package/blocks_compressed.js +32 -32
  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 +6 -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/connection.d.ts +3 -3
  25. package/core/dragging/block_drag_strategy.d.ts +3 -1
  26. package/core/dragging/bubble_drag_strategy.d.ts +3 -1
  27. package/core/dragging/comment_drag_strategy.d.ts +8 -1
  28. package/core/dragging/dragger.d.ts +2 -2
  29. package/core/dragging.d.ts +2 -2
  30. package/core/dropdowndiv.d.ts +3 -3
  31. package/core/events/events.d.ts +67 -127
  32. package/core/events/events_abstract.d.ts +0 -1
  33. package/core/events/events_block_change.d.ts +2 -1
  34. package/core/events/events_block_create.d.ts +3 -2
  35. package/core/events/events_block_delete.d.ts +3 -2
  36. package/core/events/events_block_drag.d.ts +3 -2
  37. package/core/events/events_block_field_intermediate_change.d.ts +2 -1
  38. package/core/events/events_block_move.d.ts +3 -2
  39. package/core/events/events_bubble_open.d.ts +4 -3
  40. package/core/events/events_click.d.ts +3 -2
  41. package/core/events/events_comment_base.d.ts +1 -1
  42. package/core/events/events_comment_change.d.ts +8 -2
  43. package/core/events/events_comment_collapse.d.ts +3 -2
  44. package/core/events/events_comment_create.d.ts +8 -2
  45. package/core/events/events_comment_delete.d.ts +8 -2
  46. package/core/events/events_comment_drag.d.ts +51 -0
  47. package/core/events/events_comment_move.d.ts +9 -3
  48. package/core/events/events_comment_resize.d.ts +68 -0
  49. package/core/events/events_marker_move.d.ts +2 -1
  50. package/core/events/events_selected.d.ts +3 -2
  51. package/core/events/events_theme_change.d.ts +3 -2
  52. package/core/events/events_toolbox_item_select.d.ts +3 -2
  53. package/core/events/events_trashcan_open.d.ts +3 -2
  54. package/core/events/events_var_base.d.ts +1 -1
  55. package/core/events/events_var_create.d.ts +3 -2
  56. package/core/events/events_var_delete.d.ts +3 -2
  57. package/core/events/events_var_rename.d.ts +3 -2
  58. package/core/events/events_viewport.d.ts +3 -2
  59. package/core/events/predicates.d.ts +90 -0
  60. package/core/events/type.d.ts +79 -0
  61. package/core/events/utils.d.ts +93 -125
  62. package/core/events/workspace_events.d.ts +2 -1
  63. package/core/extensions.d.ts +1 -1
  64. package/core/field.d.ts +1 -1
  65. package/core/field_dropdown.d.ts +34 -0
  66. package/core/field_input.d.ts +1 -1
  67. package/core/field_label.d.ts +6 -0
  68. package/core/flyout_base.d.ts +1 -1
  69. package/core/flyout_button.d.ts +6 -1
  70. package/core/generator.d.ts +3 -2
  71. package/core/gesture.d.ts +3 -3
  72. package/core/grid.d.ts +7 -1
  73. package/core/icons/comment_icon.d.ts +5 -6
  74. package/core/icons/icon.d.ts +1 -1
  75. package/core/icons/mutator_icon.d.ts +3 -3
  76. package/core/icons/warning_icon.d.ts +2 -2
  77. package/core/icons.d.ts +5 -5
  78. package/core/inputs/input.d.ts +1 -1
  79. package/core/inputs.d.ts +3 -3
  80. package/core/interfaces/i_ast_node_location_with_block.d.ts +1 -1
  81. package/core/interfaces/i_comment_icon.d.ts +2 -2
  82. package/core/interfaces/i_drag_target.d.ts +1 -1
  83. package/core/interfaces/i_flyout.d.ts +3 -3
  84. package/core/interfaces/i_legacy_procedure_blocks.d.ts +2 -2
  85. package/core/interfaces/i_metrics_manager.d.ts +2 -2
  86. package/core/interfaces/i_positionable.d.ts +1 -1
  87. package/core/interfaces/i_selectable.d.ts +1 -1
  88. package/core/interfaces/i_serializer.d.ts +2 -2
  89. package/core/interfaces/i_toolbox.d.ts +3 -3
  90. package/core/keyboard_nav/ast_node.d.ts +1 -1
  91. package/core/layer_manager.d.ts +1 -1
  92. package/core/layers.d.ts +0 -2
  93. package/core/procedures.d.ts +3 -3
  94. package/core/registry.d.ts +6 -6
  95. package/core/rendered_connection.d.ts +10 -5
  96. package/core/renderers/common/block_rendering.d.ts +3 -30
  97. package/core/renderers/common/i_path_object.d.ts +2 -2
  98. package/core/renderers/common/info.d.ts +1 -1
  99. package/core/renderers/common/marker_svg.d.ts +5 -5
  100. package/core/renderers/zelos/constants.d.ts +1 -1
  101. package/core/serialization/procedures.d.ts +2 -2
  102. package/core/serialization/workspace_comments.d.ts +1 -1
  103. package/core/serialization.d.ts +3 -3
  104. package/core/shortcut_registry.d.ts +70 -10
  105. package/core/toolbox/toolbox.d.ts +1 -6
  106. package/core/tooltip.d.ts +1 -1
  107. package/core/trashcan.d.ts +1 -6
  108. package/core/utils/drag.d.ts +33 -0
  109. package/core/utils/rect.d.ts +26 -0
  110. package/core/utils/size.d.ts +1 -1
  111. package/core/variables_dynamic.d.ts +1 -1
  112. package/core/workspace.d.ts +4 -5
  113. package/core/workspace_svg.d.ts +4 -6
  114. package/core/xml.d.ts +1 -1
  115. package/dart_compressed.js.map +1 -1
  116. package/generators/dart/dart_generator.d.ts +4 -0
  117. package/generators/dart/lists.d.ts +0 -3
  118. package/generators/dart/procedures.d.ts +0 -3
  119. package/generators/dart/text.d.ts +0 -3
  120. package/generators/javascript/javascript_generator.d.ts +4 -0
  121. package/generators/javascript/lists.d.ts +0 -3
  122. package/generators/javascript/procedures.d.ts +0 -3
  123. package/generators/javascript/text.d.ts +0 -3
  124. package/generators/lua/lists.d.ts +0 -3
  125. package/generators/lua/lua_generator.d.ts +6 -0
  126. package/generators/lua/procedures.d.ts +0 -3
  127. package/generators/lua/text.d.ts +0 -3
  128. package/generators/lua.d.ts +0 -4
  129. package/generators/php/lists.d.ts +1 -1
  130. package/generators/php/logic.d.ts +1 -1
  131. package/generators/php/math.d.ts +1 -1
  132. package/generators/php/php_generator.d.ts +4 -0
  133. package/generators/php/procedures.d.ts +1 -1
  134. package/generators/php/text.d.ts +1 -4
  135. package/generators/php/variables.d.ts +1 -1
  136. package/generators/php.d.ts +0 -5
  137. package/generators/python/lists.d.ts +1 -1
  138. package/generators/python/procedures.d.ts +1 -1
  139. package/generators/python/python_generator.d.ts +4 -0
  140. package/generators/python/text.d.ts +1 -1
  141. package/generators/python.d.ts +0 -5
  142. package/index.mjs +1 -0
  143. package/javascript_compressed.js.map +1 -1
  144. package/lua_compressed.js.map +1 -1
  145. package/media/1x1.gif +0 -0
  146. package/media/click.mp3 +0 -0
  147. package/media/click.ogg +0 -0
  148. package/media/click.wav +0 -0
  149. package/media/delete.mp3 +0 -0
  150. package/media/delete.ogg +0 -0
  151. package/media/delete.wav +0 -0
  152. package/media/disconnect.mp3 +0 -0
  153. package/media/disconnect.ogg +0 -0
  154. package/media/disconnect.wav +0 -0
  155. package/media/handclosed.cur +0 -0
  156. package/media/handdelete.cur +0 -0
  157. package/media/handopen.cur +0 -0
  158. package/media/pilcrow.png +0 -0
  159. package/media/quote0.png +0 -0
  160. package/media/quote1.png +0 -0
  161. package/media/sprites.png +0 -0
  162. package/package.json +16 -13
  163. package/php_compressed.js.map +1 -1
  164. package/python_compressed.js.map +1 -1
@@ -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.
@@ -138,8 +138,6 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
138
138
  startScrollX: number;
139
139
  /** Vertical scroll value when scrolling started in pixel units. */
140
140
  startScrollY: number;
141
- /** Distance from mouse to object being dragged. */
142
- private dragDeltaXY;
143
141
  /** Current scale. */
144
142
  scale: number;
145
143
  /** Cached scale value. Used to detect changes in viewport. */
@@ -704,7 +702,7 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
704
702
  * blocks on the workspace.
705
703
  */
706
704
  getBlocksBoundingBox(): Rect;
707
- /** Clean up the workspace by ordering all the blocks in a column. */
705
+ /** Clean up the workspace by ordering all the blocks in a column such that none overlap. */
708
706
  cleanUp(): void;
709
707
  /**
710
708
  * Show the context menu for the workspace.
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
  *