blockly 9.3.0-beta.0 → 9.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/blockly.min.js +1674 -1520
  2. package/blockly_compressed.js +1313 -1152
  3. package/blockly_compressed.js.map +1 -1
  4. package/blocks_compressed.js +166 -173
  5. package/blocks_compressed.js.map +1 -1
  6. package/core/any_aliases.d.ts +5 -0
  7. package/core/block.d.ts +49 -17
  8. package/core/block_animations.d.ts +0 -4
  9. package/core/block_drag_surface.d.ts +135 -0
  10. package/core/block_dragger.d.ts +2 -7
  11. package/core/block_svg.d.ts +72 -9
  12. package/core/blockly.d.ts +29 -58
  13. package/core/blockly_options.d.ts +0 -2
  14. package/core/blocks.d.ts +0 -2
  15. package/core/browser_events.d.ts +0 -9
  16. package/core/bubble.d.ts +6 -4
  17. package/core/bubble_dragger.d.ts +2 -3
  18. package/core/bump_objects.d.ts +0 -3
  19. package/core/clipboard.d.ts +0 -3
  20. package/core/comment.d.ts +6 -10
  21. package/core/common.d.ts +0 -12
  22. package/core/component_manager.d.ts +0 -2
  23. package/core/connection.d.ts +19 -6
  24. package/core/connection_checker.d.ts +1 -3
  25. package/core/connection_db.d.ts +0 -2
  26. package/core/connection_type.d.ts +0 -2
  27. package/core/constants.d.ts +0 -4
  28. package/core/contextmenu.d.ts +0 -11
  29. package/core/contextmenu_items.d.ts +0 -27
  30. package/core/contextmenu_registry.d.ts +0 -2
  31. package/core/css.d.ts +0 -2
  32. package/core/delete_area.d.ts +0 -2
  33. package/core/dialog.d.ts +0 -6
  34. package/core/drag_target.d.ts +0 -2
  35. package/core/events/events_abstract.d.ts +0 -3
  36. package/core/events/events_block_base.d.ts +0 -2
  37. package/core/events/events_block_change.d.ts +0 -2
  38. package/core/events/events_block_create.d.ts +0 -2
  39. package/core/events/events_block_delete.d.ts +0 -2
  40. package/core/events/events_block_drag.d.ts +0 -2
  41. package/core/events/events_block_move.d.ts +0 -2
  42. package/core/events/events_bubble_open.d.ts +0 -2
  43. package/core/events/events_click.d.ts +0 -2
  44. package/core/events/events_comment_base.d.ts +0 -2
  45. package/core/events/events_comment_change.d.ts +0 -2
  46. package/core/events/events_comment_create.d.ts +0 -2
  47. package/core/events/events_comment_delete.d.ts +0 -2
  48. package/core/events/events_comment_move.d.ts +0 -2
  49. package/core/events/events_marker_move.d.ts +0 -2
  50. package/core/events/events_selected.d.ts +0 -2
  51. package/core/events/events_theme_change.d.ts +0 -2
  52. package/core/events/events_toolbox_item_select.d.ts +0 -2
  53. package/core/events/events_trashcan_open.d.ts +0 -2
  54. package/core/events/events_ui.d.ts +0 -1
  55. package/core/events/events_ui_base.d.ts +0 -2
  56. package/core/events/events_var_base.d.ts +0 -2
  57. package/core/events/events_var_create.d.ts +0 -2
  58. package/core/events/events_viewport.d.ts +0 -2
  59. package/core/events/utils.d.ts +0 -73
  60. package/core/events/workspace_events.d.ts +0 -2
  61. package/core/extensions.d.ts +0 -8
  62. package/core/field.d.ts +16 -15
  63. package/core/field_angle.d.ts +60 -50
  64. package/core/field_checkbox.d.ts +22 -10
  65. package/core/field_colour.d.ts +55 -42
  66. package/core/field_dropdown.d.ts +34 -18
  67. package/core/field_image.d.ts +9 -12
  68. package/core/field_input.d.ts +34 -11
  69. package/core/field_label.d.ts +7 -10
  70. package/core/field_label_serializable.d.ts +4 -6
  71. package/core/field_multilineinput.d.ts +34 -12
  72. package/core/field_number.d.ts +27 -19
  73. package/core/field_registry.d.ts +0 -3
  74. package/core/field_textinput.d.ts +28 -12
  75. package/core/field_variable.d.ts +28 -16
  76. package/core/flyout_base.d.ts +5 -6
  77. package/core/flyout_button.d.ts +2 -2
  78. package/core/flyout_horizontal.d.ts +0 -2
  79. package/core/flyout_metrics_manager.d.ts +0 -2
  80. package/core/flyout_vertical.d.ts +0 -2
  81. package/core/generator.d.ts +0 -1
  82. package/core/gesture.d.ts +4 -17
  83. package/core/grid.d.ts +0 -2
  84. package/core/icon.d.ts +0 -2
  85. package/core/inject.d.ts +0 -1
  86. package/core/input.d.ts +0 -3
  87. package/core/input_types.d.ts +0 -2
  88. package/core/insertion_marker_manager.d.ts +6 -6
  89. package/core/interfaces/i_ast_node_location.d.ts +0 -2
  90. package/core/interfaces/i_ast_node_location_svg.d.ts +0 -2
  91. package/core/interfaces/i_ast_node_location_with_block.d.ts +0 -2
  92. package/core/interfaces/i_autohideable.d.ts +0 -2
  93. package/core/interfaces/i_block_dragger.d.ts +1 -3
  94. package/core/interfaces/i_bounded_element.d.ts +0 -2
  95. package/core/interfaces/i_bubble.d.ts +6 -4
  96. package/core/interfaces/i_collapsible_toolbox_item.d.ts +0 -2
  97. package/core/interfaces/i_component.d.ts +0 -2
  98. package/core/interfaces/i_connection_checker.d.ts +0 -2
  99. package/core/interfaces/i_contextmenu.d.ts +0 -1
  100. package/core/interfaces/i_copyable.d.ts +3 -2
  101. package/core/interfaces/i_deletable.d.ts +0 -2
  102. package/core/interfaces/i_delete_area.d.ts +0 -2
  103. package/core/interfaces/i_drag_target.d.ts +0 -2
  104. package/core/interfaces/i_draggable.d.ts +0 -2
  105. package/core/interfaces/i_flyout.d.ts +0 -2
  106. package/core/interfaces/i_keyboard_accessible.d.ts +0 -2
  107. package/core/interfaces/i_legacy_procedure_blocks.d.ts +34 -0
  108. package/core/interfaces/i_metrics_manager.d.ts +0 -2
  109. package/core/interfaces/i_movable.d.ts +0 -2
  110. package/core/interfaces/i_positionable.d.ts +0 -2
  111. package/core/interfaces/i_procedure_model.d.ts +0 -5
  112. package/core/interfaces/i_registrable.d.ts +0 -2
  113. package/core/interfaces/i_selectable.d.ts +0 -2
  114. package/core/interfaces/i_selectable_toolbox_item.d.ts +4 -2
  115. package/core/interfaces/i_serializer.d.ts +0 -2
  116. package/core/interfaces/i_styleable.d.ts +0 -2
  117. package/core/interfaces/i_toolbox.d.ts +0 -2
  118. package/core/interfaces/i_toolbox_item.d.ts +0 -2
  119. package/core/interfaces/i_variable_backed_parameter_model.d.ts +17 -0
  120. package/core/internal_constants.d.ts +0 -5
  121. package/core/keyboard_nav/ast_node.d.ts +0 -3
  122. package/core/keyboard_nav/basic_cursor.d.ts +0 -3
  123. package/core/keyboard_nav/cursor.d.ts +0 -3
  124. package/core/keyboard_nav/marker.d.ts +0 -2
  125. package/core/keyboard_nav/tab_navigate_cursor.d.ts +0 -2
  126. package/core/marker_manager.d.ts +0 -2
  127. package/core/menu.d.ts +0 -2
  128. package/core/menuitem.d.ts +0 -2
  129. package/core/metrics_manager.d.ts +0 -2
  130. package/core/mutator.d.ts +0 -2
  131. package/core/names.d.ts +0 -3
  132. package/core/options.d.ts +0 -2
  133. package/core/positionable_helpers.d.ts +0 -7
  134. package/core/procedures.d.ts +2 -25
  135. package/core/registry.d.ts +0 -11
  136. package/core/render_management.d.ts +15 -0
  137. package/core/rendered_connection.d.ts +22 -9
  138. package/core/renderers/common/block_rendering.d.ts +0 -3
  139. package/core/renderers/common/constants.d.ts +6 -51
  140. package/core/renderers/common/debug.d.ts +0 -3
  141. package/core/renderers/common/debugger.d.ts +9 -23
  142. package/core/renderers/common/drawer.d.ts +0 -5
  143. package/core/renderers/common/i_path_object.d.ts +0 -17
  144. package/core/renderers/common/info.d.ts +2 -12
  145. package/core/renderers/common/marker_svg.d.ts +2 -4
  146. package/core/renderers/common/path_object.d.ts +0 -24
  147. package/core/renderers/common/renderer.d.ts +5 -20
  148. package/core/renderers/geras/constants.d.ts +0 -5
  149. package/core/renderers/geras/drawer.d.ts +2 -4
  150. package/core/renderers/geras/highlight_constants.d.ts +6 -17
  151. package/core/renderers/geras/highlighter.d.ts +0 -13
  152. package/core/renderers/geras/info.d.ts +2 -5
  153. package/core/renderers/geras/measurables/inline_input.d.ts +0 -3
  154. package/core/renderers/geras/measurables/statement_input.d.ts +0 -3
  155. package/core/renderers/geras/path_object.d.ts +0 -8
  156. package/core/renderers/geras/renderer.d.ts +5 -7
  157. package/core/renderers/measurables/base.d.ts +0 -3
  158. package/core/renderers/measurables/bottom_row.d.ts +0 -9
  159. package/core/renderers/measurables/connection.d.ts +0 -3
  160. package/core/renderers/measurables/external_value_input.d.ts +0 -3
  161. package/core/renderers/measurables/field.d.ts +0 -3
  162. package/core/renderers/measurables/hat.d.ts +0 -3
  163. package/core/renderers/measurables/icon.d.ts +2 -5
  164. package/core/renderers/measurables/in_row_spacer.d.ts +0 -3
  165. package/core/renderers/measurables/inline_input.d.ts +1 -4
  166. package/core/renderers/measurables/input_connection.d.ts +1 -4
  167. package/core/renderers/measurables/input_row.d.ts +0 -7
  168. package/core/renderers/measurables/jagged_edge.d.ts +2 -5
  169. package/core/renderers/measurables/next_connection.d.ts +0 -3
  170. package/core/renderers/measurables/output_connection.d.ts +0 -3
  171. package/core/renderers/measurables/previous_connection.d.ts +0 -3
  172. package/core/renderers/measurables/round_corner.d.ts +0 -3
  173. package/core/renderers/measurables/row.d.ts +0 -39
  174. package/core/renderers/measurables/spacer_row.d.ts +0 -3
  175. package/core/renderers/measurables/square_corner.d.ts +0 -3
  176. package/core/renderers/measurables/statement_input.d.ts +0 -3
  177. package/core/renderers/measurables/top_row.d.ts +0 -6
  178. package/core/renderers/measurables/types.d.ts +0 -31
  179. package/core/renderers/minimalist/constants.d.ts +2 -4
  180. package/core/renderers/minimalist/drawer.d.ts +0 -3
  181. package/core/renderers/minimalist/info.d.ts +0 -4
  182. package/core/renderers/minimalist/renderer.d.ts +0 -3
  183. package/core/renderers/thrasos/info.d.ts +0 -4
  184. package/core/renderers/thrasos/renderer.d.ts +3 -3
  185. package/core/renderers/zelos/constants.d.ts +3 -17
  186. package/core/renderers/zelos/drawer.d.ts +0 -3
  187. package/core/renderers/zelos/info.d.ts +0 -4
  188. package/core/renderers/zelos/marker_svg.d.ts +0 -2
  189. package/core/renderers/zelos/measurables/bottom_row.d.ts +0 -3
  190. package/core/renderers/zelos/measurables/inputs.d.ts +0 -3
  191. package/core/renderers/zelos/measurables/row_elements.d.ts +0 -3
  192. package/core/renderers/zelos/measurables/top_row.d.ts +0 -3
  193. package/core/renderers/zelos/path_object.d.ts +0 -9
  194. package/core/renderers/zelos/renderer.d.ts +3 -5
  195. package/core/scrollbar.d.ts +0 -2
  196. package/core/scrollbar_pair.d.ts +0 -2
  197. package/core/serialization/blocks.d.ts +3 -9
  198. package/core/serialization/exceptions.d.ts +0 -8
  199. package/core/serialization/priorities.d.ts +0 -4
  200. package/core/serialization/registry.d.ts +0 -2
  201. package/core/serialization/variables.d.ts +0 -4
  202. package/core/serialization/workspaces.d.ts +0 -2
  203. package/core/shortcut_items.d.ts +0 -17
  204. package/core/shortcut_registry.d.ts +0 -2
  205. package/core/sprites.d.ts +0 -2
  206. package/core/theme/classic.d.ts +0 -2
  207. package/core/theme/zelos.d.ts +0 -2
  208. package/core/theme.d.ts +0 -2
  209. package/core/theme_manager.d.ts +3 -6
  210. package/core/toolbox/category.d.ts +5 -7
  211. package/core/toolbox/collapsible_category.d.ts +0 -4
  212. package/core/toolbox/separator.d.ts +0 -2
  213. package/core/toolbox/toolbox.d.ts +2 -5
  214. package/core/toolbox/toolbox_item.d.ts +0 -2
  215. package/core/tooltip.d.ts +0 -29
  216. package/core/touch.d.ts +0 -13
  217. package/core/trashcan.d.ts +0 -2
  218. package/core/utils/aria.d.ts +0 -6
  219. package/core/utils/array.d.ts +0 -1
  220. package/core/utils/colour.d.ts +0 -12
  221. package/core/utils/coordinate.d.ts +0 -2
  222. package/core/utils/deprecation.d.ts +0 -1
  223. package/core/utils/dom.d.ts +0 -25
  224. package/core/utils/idgenerator.d.ts +0 -2
  225. package/core/utils/keycodes.d.ts +0 -2
  226. package/core/utils/math.d.ts +0 -3
  227. package/core/utils/metrics.d.ts +0 -1
  228. package/core/utils/object.d.ts +0 -4
  229. package/core/utils/parsing.d.ts +0 -4
  230. package/core/utils/rect.d.ts +0 -2
  231. package/core/utils/size.d.ts +0 -2
  232. package/core/utils/string.d.ts +0 -6
  233. package/core/utils/style.d.ts +0 -8
  234. package/core/utils/svg.d.ts +0 -2
  235. package/core/utils/svg_math.d.ts +0 -6
  236. package/core/utils/svg_paths.d.ts +0 -8
  237. package/core/utils/toolbox.d.ts +2 -35
  238. package/core/utils/useragent.d.ts +0 -8
  239. package/core/utils/xml.d.ts +9 -8
  240. package/core/utils.d.ts +0 -12
  241. package/core/variable_map.d.ts +1 -3
  242. package/core/variable_model.d.ts +0 -1
  243. package/core/variables.d.ts +13 -17
  244. package/core/variables_dynamic.d.ts +0 -4
  245. package/core/warning.d.ts +0 -2
  246. package/core/widgetdiv.d.ts +0 -10
  247. package/core/workspace.d.ts +3 -3
  248. package/core/workspace_audio.d.ts +0 -2
  249. package/core/workspace_comment.d.ts +1 -3
  250. package/core/workspace_comment_svg.d.ts +16 -5
  251. package/core/workspace_drag_surface_svg.d.ts +74 -0
  252. package/core/workspace_dragger.d.ts +3 -2
  253. package/core/workspace_svg.d.ts +48 -8
  254. package/core/xml.d.ts +1 -13
  255. package/core/zoom_controls.d.ts +4 -15
  256. package/dart_compressed.js +199 -199
  257. package/dart_compressed.js.map +1 -1
  258. package/javascript_compressed.js +168 -168
  259. package/javascript_compressed.js.map +1 -1
  260. package/lua_compressed.js +211 -211
  261. package/lua_compressed.js.map +1 -1
  262. package/msg/bn.js +2 -2
  263. package/msg/bs.js +7 -7
  264. package/msg/de.js +1 -1
  265. package/msg/fi.js +1 -1
  266. package/msg/fr.js +3 -3
  267. package/msg/ia.js +5 -5
  268. package/msg/kn.js +5 -5
  269. package/msg/ko.js +1 -1
  270. package/msg/lb.js +22 -22
  271. package/msg/sd.js +9 -9
  272. package/msg/skr-arab.js +2 -2
  273. package/msg/sl.js +18 -18
  274. package/msg/sw.js +1 -1
  275. package/msg/zh-hans.js +6 -6
  276. package/msg/zh-hant.js +2 -2
  277. package/package.json +6 -6
  278. package/php_compressed.js +185 -185
  279. package/php_compressed.js.map +1 -1
  280. package/python_compressed.js +138 -138
  281. package/python_compressed.js.map +1 -1
  282. package/core/utils/sentinel.d.ts +0 -18
@@ -11,6 +11,7 @@ import { IParameterModel } from './interfaces/i_parameter_model.js';
11
11
  import { IProcedureMap } from './interfaces/i_procedure_map.js';
12
12
  import { IProcedureModel } from './interfaces/i_procedure_model.js';
13
13
  import { IProcedureBlock, isProcedureBlock } from './interfaces/i_procedure_block.js';
14
+ import { ProcedureTuple } from './interfaces/i_legacy_procedure_blocks.js';
14
15
  import { ObservableProcedureMap } from './observable_procedure_map.js';
15
16
  import type { Workspace } from './workspace.js';
16
17
  import type { WorkspaceSvg } from './workspace_svg.js';
@@ -20,27 +21,12 @@ import type { WorkspaceSvg } from './workspace_svg.js';
20
21
  * procedure blocks.
21
22
  * See also Blockly.Variables.CATEGORY_NAME and
22
23
  * Blockly.VariablesDynamic.CATEGORY_NAME.
23
- *
24
- * @alias Blockly.Procedures.CATEGORY_NAME
25
24
  */
26
25
  export declare const CATEGORY_NAME = "PROCEDURE";
27
26
  /**
28
27
  * The default argument for a procedures_mutatorarg block.
29
- *
30
- * @alias Blockly.Procedures.DEFAULT_ARG
31
28
  */
32
29
  export declare const DEFAULT_ARG = "x";
33
- export type ProcedureTuple = [string, string[], boolean];
34
- /**
35
- * Procedure block type.
36
- *
37
- * @alias Blockly.Procedures.ProcedureBlock
38
- */
39
- export interface ProcedureBlock {
40
- getProcedureCall: () => string;
41
- renameProcedure: (p1: string, p2: string) => void;
42
- getProcedureDef: () => ProcedureTuple;
43
- }
44
30
  /**
45
31
  * Find all user-created procedure definitions in a workspace.
46
32
  *
@@ -48,7 +34,6 @@ export interface ProcedureBlock {
48
34
  * @returns Pair of arrays, the first contains procedures without return
49
35
  * variables, the second with. Each procedure is defined by a three-element
50
36
  * list of name, parameter list, and return value boolean.
51
- * @alias Blockly.Procedures.allProcedures
52
37
  */
53
38
  export declare function allProcedures(root: Workspace): [
54
39
  ProcedureTuple[],
@@ -62,7 +47,6 @@ export declare function allProcedures(root: Workspace): [
62
47
  * @param name Proposed procedure name.
63
48
  * @param block Block to disambiguate.
64
49
  * @returns Non-colliding name.
65
- * @alias Blockly.Procedures.findLegalName
66
50
  */
67
51
  export declare function findLegalName(name: string, block: Block): string;
68
52
  /**
@@ -73,7 +57,6 @@ export declare function findLegalName(name: string, block: Block): string;
73
57
  * @param opt_exclude Optional block to exclude from comparisons (one doesn't
74
58
  * want to collide with oneself).
75
59
  * @returns True if the name is used, otherwise return false.
76
- * @alias Blockly.Procedures.isNameUsed
77
60
  */
78
61
  export declare function isNameUsed(name: string, workspace: Workspace, opt_exclude?: Block): boolean;
79
62
  /**
@@ -81,7 +64,6 @@ export declare function isNameUsed(name: string, workspace: Workspace, opt_exclu
81
64
  *
82
65
  * @param name The proposed new name.
83
66
  * @returns The accepted name.
84
- * @alias Blockly.Procedures.rename
85
67
  */
86
68
  export declare function rename(this: Field, name: string): string;
87
69
  /**
@@ -89,7 +71,6 @@ export declare function rename(this: Field, name: string): string;
89
71
  *
90
72
  * @param workspace The workspace containing procedures.
91
73
  * @returns Array of XML block elements.
92
- * @alias Blockly.Procedures.flyoutCategory
93
74
  */
94
75
  export declare function flyoutCategory(workspace: WorkspaceSvg): Element[];
95
76
  /**
@@ -97,7 +78,6 @@ export declare function flyoutCategory(workspace: WorkspaceSvg): Element[];
97
78
  * update and adds a mutator change listener to the mutator workspace.
98
79
  *
99
80
  * @param e The event that triggered this listener.
100
- * @alias Blockly.Procedures.mutatorOpenListener
101
81
  * @internal
102
82
  */
103
83
  export declare function mutatorOpenListener(e: Abstract): void;
@@ -107,7 +87,6 @@ export declare function mutatorOpenListener(e: Abstract): void;
107
87
  * @param name Name of procedure.
108
88
  * @param workspace The workspace to find callers in.
109
89
  * @returns Array of caller blocks.
110
- * @alias Blockly.Procedures.getCallers
111
90
  */
112
91
  export declare function getCallers(name: string, workspace: Workspace): Block[];
113
92
  /**
@@ -115,7 +94,6 @@ export declare function getCallers(name: string, workspace: Workspace): Block[];
115
94
  * callers.
116
95
  *
117
96
  * @param defBlock Procedure definition block.
118
- * @alias Blockly.Procedures.mutateCallers
119
97
  */
120
98
  export declare function mutateCallers(defBlock: Block): void;
121
99
  /**
@@ -124,8 +102,7 @@ export declare function mutateCallers(defBlock: Block): void;
124
102
  * @param name Name of procedure.
125
103
  * @param workspace The workspace to search.
126
104
  * @returns The procedure definition block, or null not found.
127
- * @alias Blockly.Procedures.getDefinition
128
105
  */
129
106
  export declare function getDefinition(name: string, workspace: Workspace): Block | null;
130
- export { ObservableProcedureMap, IParameterModel, IProcedureBlock, isProcedureBlock, IProcedureMap, IProcedureModel, };
107
+ export { ObservableProcedureMap, IParameterModel, IProcedureBlock, isProcedureBlock, IProcedureMap, IProcedureModel, ProcedureTuple, };
131
108
  //# sourceMappingURL=procedures.d.ts.map
@@ -25,14 +25,10 @@ export declare const TEST_ONLY: {
25
25
  };
26
26
  /**
27
27
  * The string used to register the default class for a type of plugin.
28
- *
29
- * @alias Blockly.registry.DEFAULT
30
28
  */
31
29
  export declare const DEFAULT = "default";
32
30
  /**
33
31
  * A name with the type of the element stored in the generic.
34
- *
35
- * @alias Blockly.registry.Type
36
32
  */
37
33
  export declare class Type<_T> {
38
34
  private readonly name;
@@ -71,7 +67,6 @@ export declare class Type<_T> {
71
67
  * @throws {Error} if the type or name is empty, a name with the given type has
72
68
  * already been registered, or if the given class or object is not valid for
73
69
  * its type.
74
- * @alias Blockly.registry.register
75
70
  */
76
71
  export declare function register<T>(type: string | Type<T>, name: string, registryItem: (new (...p1: any[]) => T) | null | any, opt_allowOverrides?: boolean): void;
77
72
  /**
@@ -80,7 +75,6 @@ export declare function register<T>(type: string | Type<T>, name: string, regist
80
75
  * @param type The type of the plugin.
81
76
  * (e.g. Field, Renderer)
82
77
  * @param name The plugin's name. (Ex. field_angle, geras)
83
- * @alias Blockly.registry.unregister
84
78
  */
85
79
  export declare function unregister<T>(type: string | Type<T>, name: string): void;
86
80
  /**
@@ -92,7 +86,6 @@ export declare function unregister<T>(type: string | Type<T>, name: string): voi
92
86
  * @param name The plugin's name. (Ex. field_angle, geras)
93
87
  * @returns True if the registry has an item with the given type and name, false
94
88
  * otherwise.
95
- * @alias Blockly.registry.hasItem
96
89
  */
97
90
  export declare function hasItem<T>(type: string | Type<T>, name: string): boolean;
98
91
  /**
@@ -104,7 +97,6 @@ export declare function hasItem<T>(type: string | Type<T>, name: string): boolea
104
97
  * @param opt_throwIfMissing Whether or not to throw an error if we are unable
105
98
  * to find the plugin.
106
99
  * @returns The class with the given name and type or null if none exists.
107
- * @alias Blockly.registry.getClass
108
100
  */
109
101
  export declare function getClass<T>(type: string | Type<T>, name: string, opt_throwIfMissing?: boolean): (new (...p1: any[]) => T) | null;
110
102
  /**
@@ -116,7 +108,6 @@ export declare function getClass<T>(type: string | Type<T>, name: string, opt_th
116
108
  * @param opt_throwIfMissing Whether or not to throw an error if we are unable
117
109
  * to find the object.
118
110
  * @returns The object with the given name and type or null if none exists.
119
- * @alias Blockly.registry.getObject
120
111
  */
121
112
  export declare function getObject<T>(type: string | Type<T>, name: string, opt_throwIfMissing?: boolean): T | null;
122
113
  /**
@@ -128,7 +119,6 @@ export declare function getObject<T>(type: string | Type<T>, name: string, opt_t
128
119
  * @param opt_throwIfMissing Whether or not to throw an error if we are unable
129
120
  * to find the object. False by default.
130
121
  * @returns A map of objects with the given type, or null if none exists.
131
- * @alias Blockly.registry.getAllItems
132
122
  */
133
123
  export declare function getAllItems<T>(type: string | Type<T>, opt_cased?: boolean, opt_throwIfMissing?: boolean): {
134
124
  [key: string]: T | null | (new (...p1: any[]) => T);
@@ -142,7 +132,6 @@ export declare function getAllItems<T>(type: string | Type<T>, opt_cased?: boole
142
132
  * @param opt_throwIfMissing Whether or not to throw an error if we are unable
143
133
  * to find the plugin.
144
134
  * @returns The class for the plugin.
145
- * @alias Blockly.registry.getClassFromOptions
146
135
  */
147
136
  export declare function getClassFromOptions<T>(type: Type<T>, options: Options, opt_throwIfMissing?: boolean): (new (...p1: any[]) => T) | null;
148
137
  //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { BlockSvg } from './block_svg.js';
7
+ /**
8
+ * Registers that the given block and all of its parents need to be rerendered,
9
+ * and registers a callback to do so after a delay, to allowf or batching.
10
+ *
11
+ * @param block The block to rerender.
12
+ * @internal
13
+ */
14
+ export declare function queueRender(block: BlockSvg): void;
15
+ //# sourceMappingURL=render_management.d.ts.map
@@ -9,8 +9,6 @@ import { Connection } from './connection.js';
9
9
  import { Coordinate } from './utils/coordinate.js';
10
10
  /**
11
11
  * Class for a connection between blocks that may be rendered on screen.
12
- *
13
- * @alias Blockly.RenderedConnection
14
12
  */
15
13
  export declare class RenderedConnection extends Connection {
16
14
  sourceBlock_: BlockSvg;
@@ -66,23 +64,29 @@ export declare class RenderedConnection extends Connection {
66
64
  *
67
65
  * @param x New absolute x coordinate, in workspace coordinates.
68
66
  * @param y New absolute y coordinate, in workspace coordinates.
67
+ * @return True if the position of the connection in the connection db
68
+ * was updated.
69
69
  */
70
- moveTo(x: number, y: number): void;
70
+ moveTo(x: number, y: number): boolean;
71
71
  /**
72
72
  * Change the connection's coordinates.
73
73
  *
74
74
  * @param dx Change to x coordinate, in workspace units.
75
75
  * @param dy Change to y coordinate, in workspace units.
76
+ * @return True if the position of the connection in the connection db
77
+ * was updated.
76
78
  */
77
- moveBy(dx: number, dy: number): void;
79
+ moveBy(dx: number, dy: number): boolean;
78
80
  /**
79
81
  * Move this connection to the location given by its offset within the block
80
82
  * and the location of the block's top left corner.
81
83
  *
82
84
  * @param blockTL The location of the top left corner of the block, in
83
85
  * workspace coordinates.
86
+ * @return True if the position of the connection in the connection db
87
+ * was updated.
84
88
  */
85
- moveToOffset(blockTL: Coordinate): void;
89
+ moveToOffset(blockTL: Coordinate): boolean;
86
90
  /**
87
91
  * Set the offset of this connection relative to the top left of its block.
88
92
  *
@@ -103,6 +107,13 @@ export declare class RenderedConnection extends Connection {
103
107
  * @internal
104
108
  */
105
109
  tighten(): void;
110
+ /**
111
+ * Moves the blocks on either side of this connection right next to
112
+ * each other, based on their local offsets, not global positions.
113
+ *
114
+ * @internal
115
+ */
116
+ tightenEfficiently(): void;
106
117
  /**
107
118
  * Find the closest compatible connection to this connection.
108
119
  * All parameters are in workspace units.
@@ -147,7 +158,7 @@ export declare class RenderedConnection extends Connection {
147
158
  */
148
159
  startTrackingAll(): Block[];
149
160
  /**
150
- * Behavior after a connection attempt fails.
161
+ * Behaviour after a connection attempt fails.
151
162
  * Bumps this connection away from the other connection. Called when an
152
163
  * attempted connection fails.
153
164
  *
@@ -159,10 +170,12 @@ export declare class RenderedConnection extends Connection {
159
170
  /**
160
171
  * Disconnect two blocks that are connected by this connection.
161
172
  *
162
- * @param parentBlock The superior block.
163
- * @param childBlock The inferior block.
173
+ * @param setParent Whether to set the parent of the disconnected block or
174
+ * not, defaults to true.
175
+ * If you do not set the parent, ensure that a subsequent action does,
176
+ * otherwise the view and model will be out of sync.
164
177
  */
165
- protected disconnectInternal_(parentBlock: Block, childBlock: Block): void;
178
+ disconnectInternal(setParent?: boolean): void;
166
179
  /**
167
180
  * Respawn the shadow block if there was one connected to the this connection.
168
181
  * Render/rerender blocks as needed.
@@ -46,13 +46,11 @@ export declare function register(name: string, rendererClass: Function): void;
46
46
  * Unregisters the renderer registered with the given name.
47
47
  *
48
48
  * @param name The name of the renderer.
49
- * @alias Blockly.blockRendering.unregister
50
49
  */
51
50
  export declare function unregister(name: string): void;
52
51
  /**
53
52
  * Turn off the blocks debugger.
54
53
  *
55
- * @alias Blockly.blockRendering.stopDebugger
56
54
  * @deprecated Use the debug renderer in **\@blockly/dev-tools** (See {@link
57
55
  * https://www.npmjs.com/package/@blockly/dev-tools}.)
58
56
  * @internal
@@ -66,7 +64,6 @@ export declare function stopDebugger(): void;
66
64
  * @param opt_rendererOverrides Rendering constant overrides.
67
65
  * @returns The new instance of a renderer.
68
66
  * Already initialized.
69
- * @alias Blockly.blockRendering.init
70
67
  * @internal
71
68
  */
72
69
  export declare function init(name: string, theme: Theme, opt_rendererOverrides?: {
@@ -80,8 +80,6 @@ export type Shape = BaseShape | DynamicShape;
80
80
  export declare function isDynamicShape(shape: Shape): shape is DynamicShape;
81
81
  /**
82
82
  * An object that provides constants for rendering blocks.
83
- *
84
- * @alias Blockly.blockRendering.ConstantProvider
85
83
  */
86
84
  export declare class ConstantProvider {
87
85
  /** The size of an empty spacer. */
@@ -180,8 +178,6 @@ export declare class ConstantProvider {
180
178
  FIELD_BORDER_RECT_Y_PADDING: number;
181
179
  /**
182
180
  * The backing colour of a field's border rect.
183
- *
184
- * @internal
185
181
  */
186
182
  FIELD_BORDER_RECT_COLOUR: string;
187
183
  FIELD_TEXT_BASELINE_CENTER: boolean;
@@ -216,7 +212,6 @@ export declare class ConstantProvider {
216
212
  FIELD_COLOUR_DEFAULT_WIDTH: number;
217
213
  FIELD_COLOUR_DEFAULT_HEIGHT: number;
218
214
  FIELD_CHECKBOX_X_OFFSET: number;
219
- /** @internal */
220
215
  randomIdentifier: string;
221
216
  /**
222
217
  * The defs tag that contains all filters and patterns for this Blockly
@@ -225,16 +220,12 @@ export declare class ConstantProvider {
225
220
  private defs_;
226
221
  /**
227
222
  * The ID of the emboss filter, or the empty string if no filter is set.
228
- *
229
- * @internal
230
223
  */
231
224
  embossFilterId: string;
232
225
  /** The <filter> element to use for highlighting, or null if not set. */
233
226
  private embossFilter_;
234
227
  /**
235
228
  * The ID of the disabled pattern, or the empty string if no pattern is set.
236
- *
237
- * @internal
238
229
  */
239
230
  disabledPatternId: string;
240
231
  /**
@@ -253,63 +244,43 @@ export declare class ConstantProvider {
253
244
  private cssNode_;
254
245
  /**
255
246
  * Cursor colour.
256
- *
257
- * @internal
258
247
  */
259
248
  CURSOR_COLOUR: string;
260
249
  /**
261
250
  * Immovable marker colour.
262
- *
263
- * @internal
264
251
  */
265
252
  MARKER_COLOUR: string;
266
253
  /**
267
254
  * Width of the horizontal cursor.
268
- *
269
- * @internal
270
255
  */
271
256
  CURSOR_WS_WIDTH: number;
272
257
  /**
273
258
  * Height of the horizontal cursor.
274
- *
275
- * @internal
276
259
  */
277
260
  WS_CURSOR_HEIGHT: number;
278
261
  /**
279
262
  * Padding around a stack.
280
- *
281
- * @internal
282
263
  */
283
264
  CURSOR_STACK_PADDING: number;
284
265
  /**
285
266
  * Padding around a block.
286
- *
287
- * @internal
288
267
  */
289
268
  CURSOR_BLOCK_PADDING: number;
290
269
  /**
291
270
  * Stroke of the cursor.
292
- *
293
- * @internal
294
271
  */
295
272
  CURSOR_STROKE_WIDTH: number;
296
273
  /**
297
274
  * Whether text input and colour fields fill up the entire source block.
298
- *
299
- * @internal
300
275
  */
301
276
  FULL_BLOCK_FIELDS: boolean;
302
277
  /**
303
278
  * The main colour of insertion markers, in hex. The block is rendered a
304
279
  * transparent grey by changing the fill opacity in CSS.
305
- *
306
- * @internal
307
280
  */
308
281
  INSERTION_MARKER_COLOUR: string;
309
282
  /**
310
283
  * The insertion marker opacity.
311
- *
312
- * @internal
313
284
  */
314
285
  INSERTION_MARKER_OPACITY: number;
315
286
  SHAPES: {
@@ -321,23 +292,18 @@ export declare class ConstantProvider {
321
292
  PUZZLE_TAB: PuzzleTab;
322
293
  INSIDE_CORNERS: InsideCorners;
323
294
  OUTSIDE_CORNERS: OutsideCorners;
324
- /** @internal */
325
295
  blockStyles: {
326
296
  [key: string]: BlockStyle;
327
297
  };
328
- /** @internal */
329
298
  constructor();
330
299
  /**
331
300
  * Initialize shape objects based on the constants set in the constructor.
332
- *
333
- * @internal
334
301
  */
335
302
  init(): void;
336
303
  /**
337
304
  * Refresh constants properties that depend on the theme.
338
305
  *
339
306
  * @param theme The current workspace theme.
340
- * @internal
341
307
  */
342
308
  setTheme(theme: Theme): void;
343
309
  /**
@@ -365,7 +331,6 @@ export declare class ConstantProvider {
365
331
  * @param colour #RRGGBB colour string.
366
332
  * @returns An object containing the style and an autogenerated name for that
367
333
  * style.
368
- * @internal
369
334
  */
370
335
  getBlockStyleForColour(colour: string): {
371
336
  style: BlockStyle;
@@ -411,51 +376,42 @@ export declare class ConstantProvider {
411
376
  /**
412
377
  * Dispose of this constants provider.
413
378
  * Delete all DOM elements that this provider created.
414
- *
415
- * @internal
416
379
  */
417
380
  dispose(): void;
418
381
  /**
419
382
  * @returns An object containing sizing and path information about collapsed
420
383
  * block indicators.
421
- * @internal
422
384
  */
423
- makeJaggedTeeth(): JaggedTeeth;
385
+ protected makeJaggedTeeth(): JaggedTeeth;
424
386
  /**
425
387
  * @returns An object containing sizing and path information about start hats.
426
- * @internal
427
388
  */
428
- makeStartHat(): StartHat;
389
+ protected makeStartHat(): StartHat;
429
390
  /**
430
391
  * @returns An object containing sizing and path information about puzzle
431
392
  * tabs.
432
- * @internal
433
393
  */
434
- makePuzzleTab(): PuzzleTab;
394
+ protected makePuzzleTab(): PuzzleTab;
435
395
  /**
436
396
  * @returns An object containing sizing and path information about notches.
437
- * @internal
438
397
  */
439
- makeNotch(): Notch;
398
+ protected makeNotch(): Notch;
440
399
  /**
441
400
  * @returns An object containing sizing and path information about inside
442
401
  * corners.
443
- * @internal
444
402
  */
445
- makeInsideCorners(): InsideCorners;
403
+ protected makeInsideCorners(): InsideCorners;
446
404
  /**
447
405
  * @returns An object containing sizing and path information about outside
448
406
  * corners.
449
- * @internal
450
407
  */
451
- makeOutsideCorners(): OutsideCorners;
408
+ protected makeOutsideCorners(): OutsideCorners;
452
409
  /**
453
410
  * Get an object with connection shape and sizing information based on the
454
411
  * type of the connection.
455
412
  *
456
413
  * @param connection The connection to find a shape object for
457
414
  * @returns The shape object for the connection.
458
- * @internal
459
415
  */
460
416
  shapeFor(connection: RenderedConnection): Shape;
461
417
  /**
@@ -466,7 +422,6 @@ export declare class ConstantProvider {
466
422
  * @param selector The CSS selector to use.
467
423
  * @suppress {strictModuleDepCheck} Debug renderer only included in
468
424
  * playground.
469
- * @internal
470
425
  */
471
426
  createDom(svg: SVGElement, tagName: string, selector: string): void;
472
427
  /**
@@ -7,14 +7,12 @@
7
7
  * Returns whether the debugger is turned on.
8
8
  *
9
9
  * @returns Whether the debugger is turned on.
10
- * @alias Blockly.blockRendering.debug.isDebuggerEnabled
11
10
  * @internal
12
11
  */
13
12
  export declare function isDebuggerEnabled(): boolean;
14
13
  /**
15
14
  * Turn on the blocks debugger.
16
15
  *
17
- * @alias Blockly.blockRendering.debug.startDebugger
18
16
  * @deprecated March 2022. Use the rendering debugger in @blockly/dev-tools.
19
17
  * See https://www.npmjs.com/package/@blockly/dev-tools for more information.
20
18
  * @internal
@@ -23,7 +21,6 @@ export declare function startDebugger(): void;
23
21
  /**
24
22
  * Turn off the blocks debugger.
25
23
  *
26
- * @alias Blockly.blockRendering.debug.stopDebugger
27
24
  * @deprecated March 2022. Use the rendering debugger in @blockly/dev-tools.
28
25
  * See https://www.npmjs.com/package/@blockly/dev-tools for more information.
29
26
  * @internal
@@ -12,8 +12,6 @@ import type { ConstantProvider } from './constants.js';
12
12
  import type { RenderInfo } from './info.js';
13
13
  /**
14
14
  * An object that renders rectangles and dots for debugging rendering code.
15
- *
16
- * @alias Blockly.blockRendering.Debug
17
15
  */
18
16
  export declare class Debug {
19
17
  private readonly constants;
@@ -41,41 +39,35 @@ export declare class Debug {
41
39
  private randomColour_;
42
40
  /**
43
41
  * @param constants The renderer's constants.
44
- * @internal
45
42
  */
46
43
  constructor(constants: ConstantProvider);
47
44
  /**
48
45
  * Remove all elements the this object created on the last pass.
49
- *
50
- * @internal
51
46
  */
52
- clearElems(): void;
47
+ protected clearElems(): void;
53
48
  /**
54
49
  * Draw a debug rectangle for a spacer (empty) row.
55
50
  *
56
51
  * @param row The row to render.
57
52
  * @param cursorY The y position of the top of the row.
58
53
  * @param isRtl Whether the block is rendered RTL.
59
- * @internal
60
54
  */
61
- drawSpacerRow(row: Row, cursorY: number, isRtl: boolean): void;
55
+ protected drawSpacerRow(row: Row, cursorY: number, isRtl: boolean): void;
62
56
  /**
63
57
  * Draw a debug rectangle for a horizontal spacer.
64
58
  *
65
59
  * @param elem The spacer to render.
66
60
  * @param rowHeight The height of the container row.
67
61
  * @param isRtl Whether the block is rendered RTL.
68
- * @internal
69
62
  */
70
- drawSpacerElem(elem: InRowSpacer, rowHeight: number, isRtl: boolean): void;
63
+ protected drawSpacerElem(elem: InRowSpacer, rowHeight: number, isRtl: boolean): void;
71
64
  /**
72
65
  * Draw a debug rectangle for an in-row element.
73
66
  *
74
67
  * @param elem The element to render.
75
68
  * @param isRtl Whether the block is rendered RTL.
76
- * @internal
77
69
  */
78
- drawRenderedElem(elem: Measurable, isRtl: boolean): void;
70
+ protected drawRenderedElem(elem: Measurable, isRtl: boolean): void;
79
71
  /**
80
72
  * Draw a circle at the location of the given connection. Inputs and outputs
81
73
  * share the same colours, as do previous and next. When positioned correctly
@@ -84,48 +76,42 @@ export declare class Debug {
84
76
  * @param conn The connection to circle.
85
77
  * @suppress {visibility} Suppress visibility of conn.offsetInBlock_ since
86
78
  * this is a debug module.
87
- * @internal
88
79
  */
89
- drawConnection(conn: RenderedConnection): void;
80
+ protected drawConnection(conn: RenderedConnection): void;
90
81
  /**
91
82
  * Draw a debug rectangle for a non-empty row.
92
83
  *
93
84
  * @param row The non-empty row to render.
94
85
  * @param cursorY The y position of the top of the row.
95
86
  * @param isRtl Whether the block is rendered RTL.
96
- * @internal
97
87
  */
98
- drawRenderedRow(row: Row, cursorY: number, isRtl: boolean): void;
88
+ protected drawRenderedRow(row: Row, cursorY: number, isRtl: boolean): void;
99
89
  /**
100
90
  * Draw debug rectangles for a non-empty row and all of its subcomponents.
101
91
  *
102
92
  * @param row The non-empty row to render.
103
93
  * @param cursorY The y position of the top of the row.
104
94
  * @param isRtl Whether the block is rendered RTL.
105
- * @internal
106
95
  */
107
- drawRowWithElements(row: Row, cursorY: number, isRtl: boolean): void;
96
+ protected drawRowWithElements(row: Row, cursorY: number, isRtl: boolean): void;
108
97
  /**
109
98
  * Draw a debug rectangle around the entire block.
110
99
  *
111
100
  * @param info Rendering information about the block to debug.
112
- * @internal
113
101
  */
114
- drawBoundingBox(info: RenderInfo): void;
102
+ protected drawBoundingBox(info: RenderInfo): void;
115
103
  /**
116
104
  * Do all of the work to draw debug information for the whole block.
117
105
  *
118
106
  * @param block The block to draw debug information for.
119
107
  * @param info Rendering information about the block to debug.
120
- * @internal
121
108
  */
122
109
  drawDebug(block: BlockSvg, info: RenderInfo): void;
123
110
  /**
124
111
  * Show a debug filter to highlight that a block has been rendered.
125
112
  *
126
113
  * @param svgPath The block's SVG path.
127
- * @internal
128
114
  */
129
- drawRender(svgPath: SVGElement): void;
115
+ protected drawRender(svgPath: SVGElement): void;
130
116
  }
131
117
  //# sourceMappingURL=debugger.d.ts.map
@@ -13,8 +13,6 @@ import type { ConstantProvider } from './constants.js';
13
13
  import type { RenderInfo } from './info.js';
14
14
  /**
15
15
  * An object that draws a block based on the given rendering information.
16
- *
17
- * @alias Blockly.blockRendering.Drawer
18
16
  */
19
17
  export declare class Drawer {
20
18
  block_: BlockSvg;
@@ -27,7 +25,6 @@ export declare class Drawer {
27
25
  * @param block The block to render.
28
26
  * @param info An object containing all information needed to render this
29
27
  * block.
30
- * @internal
31
28
  */
32
29
  constructor(block: BlockSvg, info: RenderInfo);
33
30
  /**
@@ -38,8 +35,6 @@ export declare class Drawer {
38
35
  * joined with spaces and set directly on the block. This guarantees that
39
36
  * the steps are separated by spaces for improved readability, but isn't
40
37
  * required.
41
- *
42
- * @internal
43
38
  */
44
39
  draw(): void;
45
40
  /**