blockly 9.2.1 → 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 (299) hide show
  1. package/blockly.min.js +1615 -1509
  2. package/blockly_compressed.js +1249 -1136
  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_dragger.d.ts +1 -6
  10. package/core/block_svg.d.ts +58 -8
  11. package/core/blockly.d.ts +27 -58
  12. package/core/blockly_options.d.ts +0 -2
  13. package/core/blocks.d.ts +0 -2
  14. package/core/browser_events.d.ts +0 -9
  15. package/core/bubble.d.ts +0 -2
  16. package/core/bubble_dragger.d.ts +0 -2
  17. package/core/bump_objects.d.ts +0 -3
  18. package/core/clipboard.d.ts +0 -3
  19. package/core/comment.d.ts +6 -10
  20. package/core/common.d.ts +0 -12
  21. package/core/component_manager.d.ts +0 -2
  22. package/core/connection.d.ts +19 -6
  23. package/core/connection_checker.d.ts +1 -3
  24. package/core/connection_db.d.ts +0 -2
  25. package/core/connection_type.d.ts +0 -2
  26. package/core/constants.d.ts +0 -4
  27. package/core/contextmenu.d.ts +0 -11
  28. package/core/contextmenu_items.d.ts +0 -27
  29. package/core/contextmenu_registry.d.ts +0 -2
  30. package/core/css.d.ts +0 -2
  31. package/core/delete_area.d.ts +0 -2
  32. package/core/dialog.d.ts +0 -6
  33. package/core/drag_target.d.ts +0 -2
  34. package/core/events/events.d.ts +2 -22
  35. package/core/events/events_abstract.d.ts +7 -3
  36. package/core/events/events_block_base.d.ts +2 -3
  37. package/core/events/events_block_change.d.ts +9 -3
  38. package/core/events/events_block_create.d.ts +6 -4
  39. package/core/events/events_block_delete.d.ts +7 -4
  40. package/core/events/events_block_drag.d.ts +7 -3
  41. package/core/events/events_block_move.d.ts +20 -3
  42. package/core/events/events_bubble_open.d.ts +3 -2
  43. package/core/events/events_click.d.ts +6 -3
  44. package/core/events/events_comment_base.d.ts +1 -2
  45. package/core/events/events_comment_change.d.ts +3 -3
  46. package/core/events/events_comment_create.d.ts +2 -3
  47. package/core/events/events_comment_delete.d.ts +2 -3
  48. package/core/events/events_comment_move.d.ts +4 -4
  49. package/core/events/events_marker_move.d.ts +10 -3
  50. package/core/events/events_selected.d.ts +6 -2
  51. package/core/events/events_theme_change.d.ts +2 -3
  52. package/core/events/events_toolbox_item_select.d.ts +3 -3
  53. package/core/events/events_trashcan_open.d.ts +5 -3
  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 +1 -2
  57. package/core/events/events_var_create.d.ts +3 -3
  58. package/core/events/events_var_delete.d.ts +4 -2
  59. package/core/events/events_var_rename.d.ts +4 -2
  60. package/core/events/events_viewport.d.ts +13 -2
  61. package/core/events/utils.d.ts +0 -89
  62. package/core/events/workspace_events.d.ts +2 -6
  63. package/core/extensions.d.ts +0 -8
  64. package/core/field.d.ts +55 -21
  65. package/core/field_angle.d.ts +61 -51
  66. package/core/field_checkbox.d.ts +34 -15
  67. package/core/field_colour.d.ts +56 -46
  68. package/core/field_dropdown.d.ts +35 -19
  69. package/core/field_image.d.ts +10 -14
  70. package/core/field_input.d.ts +39 -25
  71. package/core/field_label.d.ts +7 -10
  72. package/core/field_label_serializable.d.ts +4 -6
  73. package/core/field_multilineinput.d.ts +36 -14
  74. package/core/field_number.d.ts +27 -19
  75. package/core/field_registry.d.ts +0 -3
  76. package/core/field_textinput.d.ts +36 -8
  77. package/core/field_variable.d.ts +30 -18
  78. package/core/flyout_base.d.ts +5 -6
  79. package/core/flyout_button.d.ts +2 -2
  80. package/core/flyout_horizontal.d.ts +0 -2
  81. package/core/flyout_metrics_manager.d.ts +0 -2
  82. package/core/flyout_vertical.d.ts +0 -2
  83. package/core/generator.d.ts +0 -1
  84. package/core/gesture.d.ts +5 -18
  85. package/core/grid.d.ts +0 -2
  86. package/core/icon.d.ts +0 -2
  87. package/core/inject.d.ts +0 -1
  88. package/core/input.d.ts +0 -3
  89. package/core/input_types.d.ts +0 -2
  90. package/core/insertion_marker_manager.d.ts +6 -6
  91. package/core/interfaces/i_ast_node_location.d.ts +0 -2
  92. package/core/interfaces/i_ast_node_location_svg.d.ts +0 -2
  93. package/core/interfaces/i_ast_node_location_with_block.d.ts +0 -2
  94. package/core/interfaces/i_autohideable.d.ts +0 -2
  95. package/core/interfaces/i_block_dragger.d.ts +0 -2
  96. package/core/interfaces/i_bounded_element.d.ts +0 -2
  97. package/core/interfaces/i_bubble.d.ts +0 -2
  98. package/core/interfaces/i_collapsible_toolbox_item.d.ts +0 -2
  99. package/core/interfaces/i_component.d.ts +0 -2
  100. package/core/interfaces/i_connection_checker.d.ts +0 -2
  101. package/core/interfaces/i_contextmenu.d.ts +0 -1
  102. package/core/interfaces/i_copyable.d.ts +3 -2
  103. package/core/interfaces/i_deletable.d.ts +0 -2
  104. package/core/interfaces/i_delete_area.d.ts +0 -2
  105. package/core/interfaces/i_drag_target.d.ts +0 -2
  106. package/core/interfaces/i_draggable.d.ts +0 -2
  107. package/core/interfaces/i_flyout.d.ts +0 -2
  108. package/core/interfaces/i_keyboard_accessible.d.ts +0 -2
  109. package/core/interfaces/i_legacy_procedure_blocks.d.ts +34 -0
  110. package/core/interfaces/i_metrics_manager.d.ts +8 -8
  111. package/core/interfaces/i_movable.d.ts +0 -2
  112. package/core/interfaces/i_positionable.d.ts +0 -2
  113. package/core/interfaces/i_procedure_block.d.ts +3 -0
  114. package/core/interfaces/i_procedure_model.d.ts +0 -5
  115. package/core/interfaces/i_registrable.d.ts +0 -2
  116. package/core/interfaces/i_selectable.d.ts +0 -2
  117. package/core/interfaces/i_selectable_toolbox_item.d.ts +4 -2
  118. package/core/interfaces/i_serializer.d.ts +0 -2
  119. package/core/interfaces/i_styleable.d.ts +0 -2
  120. package/core/interfaces/i_toolbox.d.ts +0 -2
  121. package/core/interfaces/i_toolbox_item.d.ts +0 -2
  122. package/core/interfaces/i_variable_backed_parameter_model.d.ts +17 -0
  123. package/core/internal_constants.d.ts +0 -5
  124. package/core/keyboard_nav/ast_node.d.ts +0 -3
  125. package/core/keyboard_nav/basic_cursor.d.ts +0 -3
  126. package/core/keyboard_nav/cursor.d.ts +0 -3
  127. package/core/keyboard_nav/marker.d.ts +0 -2
  128. package/core/keyboard_nav/tab_navigate_cursor.d.ts +0 -2
  129. package/core/marker_manager.d.ts +0 -2
  130. package/core/menu.d.ts +0 -2
  131. package/core/menuitem.d.ts +0 -2
  132. package/core/metrics_manager.d.ts +8 -8
  133. package/core/mutator.d.ts +0 -2
  134. package/core/names.d.ts +0 -3
  135. package/core/{procedures/observable_procedure_map.d.ts → observable_procedure_map.d.ts} +4 -5
  136. package/core/options.d.ts +0 -2
  137. package/core/positionable_helpers.d.ts +0 -7
  138. package/core/procedures.d.ts +7 -28
  139. package/core/registry.d.ts +0 -11
  140. package/core/render_management.d.ts +15 -0
  141. package/core/rendered_connection.d.ts +22 -9
  142. package/core/renderers/common/block_rendering.d.ts +0 -3
  143. package/core/renderers/common/constants.d.ts +6 -51
  144. package/core/renderers/common/debug.d.ts +0 -3
  145. package/core/renderers/common/debugger.d.ts +9 -23
  146. package/core/renderers/common/drawer.d.ts +0 -5
  147. package/core/renderers/common/i_path_object.d.ts +0 -17
  148. package/core/renderers/common/info.d.ts +2 -12
  149. package/core/renderers/common/marker_svg.d.ts +2 -4
  150. package/core/renderers/common/path_object.d.ts +0 -24
  151. package/core/renderers/common/renderer.d.ts +5 -20
  152. package/core/renderers/geras/constants.d.ts +0 -5
  153. package/core/renderers/geras/drawer.d.ts +2 -4
  154. package/core/renderers/geras/highlight_constants.d.ts +6 -17
  155. package/core/renderers/geras/highlighter.d.ts +0 -13
  156. package/core/renderers/geras/info.d.ts +2 -5
  157. package/core/renderers/geras/measurables/inline_input.d.ts +0 -3
  158. package/core/renderers/geras/measurables/statement_input.d.ts +0 -3
  159. package/core/renderers/geras/path_object.d.ts +0 -8
  160. package/core/renderers/geras/renderer.d.ts +5 -7
  161. package/core/renderers/measurables/base.d.ts +0 -3
  162. package/core/renderers/measurables/bottom_row.d.ts +0 -9
  163. package/core/renderers/measurables/connection.d.ts +0 -3
  164. package/core/renderers/measurables/external_value_input.d.ts +0 -3
  165. package/core/renderers/measurables/field.d.ts +0 -3
  166. package/core/renderers/measurables/hat.d.ts +0 -3
  167. package/core/renderers/measurables/icon.d.ts +2 -5
  168. package/core/renderers/measurables/in_row_spacer.d.ts +0 -3
  169. package/core/renderers/measurables/inline_input.d.ts +1 -4
  170. package/core/renderers/measurables/input_connection.d.ts +1 -4
  171. package/core/renderers/measurables/input_row.d.ts +0 -7
  172. package/core/renderers/measurables/jagged_edge.d.ts +2 -5
  173. package/core/renderers/measurables/next_connection.d.ts +0 -3
  174. package/core/renderers/measurables/output_connection.d.ts +0 -3
  175. package/core/renderers/measurables/previous_connection.d.ts +0 -3
  176. package/core/renderers/measurables/round_corner.d.ts +0 -3
  177. package/core/renderers/measurables/row.d.ts +0 -39
  178. package/core/renderers/measurables/spacer_row.d.ts +0 -3
  179. package/core/renderers/measurables/square_corner.d.ts +0 -3
  180. package/core/renderers/measurables/statement_input.d.ts +0 -3
  181. package/core/renderers/measurables/top_row.d.ts +0 -6
  182. package/core/renderers/measurables/types.d.ts +0 -31
  183. package/core/renderers/minimalist/constants.d.ts +2 -4
  184. package/core/renderers/minimalist/drawer.d.ts +0 -3
  185. package/core/renderers/minimalist/info.d.ts +0 -4
  186. package/core/renderers/minimalist/renderer.d.ts +0 -3
  187. package/core/renderers/thrasos/info.d.ts +0 -4
  188. package/core/renderers/thrasos/renderer.d.ts +3 -3
  189. package/core/renderers/zelos/constants.d.ts +3 -17
  190. package/core/renderers/zelos/drawer.d.ts +0 -3
  191. package/core/renderers/zelos/info.d.ts +0 -4
  192. package/core/renderers/zelos/marker_svg.d.ts +0 -2
  193. package/core/renderers/zelos/measurables/bottom_row.d.ts +0 -3
  194. package/core/renderers/zelos/measurables/inputs.d.ts +0 -3
  195. package/core/renderers/zelos/measurables/row_elements.d.ts +0 -3
  196. package/core/renderers/zelos/measurables/top_row.d.ts +0 -3
  197. package/core/renderers/zelos/path_object.d.ts +0 -9
  198. package/core/renderers/zelos/renderer.d.ts +3 -5
  199. package/core/scrollbar.d.ts +0 -2
  200. package/core/scrollbar_pair.d.ts +0 -2
  201. package/core/serialization/blocks.d.ts +3 -9
  202. package/core/serialization/exceptions.d.ts +0 -8
  203. package/core/serialization/priorities.d.ts +0 -4
  204. package/core/serialization/procedures.d.ts +0 -7
  205. package/core/serialization/registry.d.ts +0 -2
  206. package/core/serialization/variables.d.ts +0 -4
  207. package/core/serialization/workspaces.d.ts +0 -2
  208. package/core/shortcut_items.d.ts +0 -17
  209. package/core/shortcut_registry.d.ts +0 -2
  210. package/core/sprites.d.ts +0 -2
  211. package/core/theme/classic.d.ts +0 -2
  212. package/core/theme/zelos.d.ts +0 -2
  213. package/core/theme.d.ts +0 -2
  214. package/core/theme_manager.d.ts +3 -6
  215. package/core/toolbox/category.d.ts +5 -7
  216. package/core/toolbox/collapsible_category.d.ts +0 -4
  217. package/core/toolbox/separator.d.ts +0 -2
  218. package/core/toolbox/toolbox.d.ts +2 -5
  219. package/core/toolbox/toolbox_item.d.ts +0 -2
  220. package/core/tooltip.d.ts +0 -29
  221. package/core/touch.d.ts +0 -13
  222. package/core/trashcan.d.ts +0 -2
  223. package/core/utils/aria.d.ts +0 -6
  224. package/core/utils/array.d.ts +0 -1
  225. package/core/utils/colour.d.ts +0 -12
  226. package/core/utils/coordinate.d.ts +0 -2
  227. package/core/utils/deprecation.d.ts +0 -1
  228. package/core/utils/dom.d.ts +0 -25
  229. package/core/utils/idgenerator.d.ts +0 -2
  230. package/core/utils/keycodes.d.ts +0 -2
  231. package/core/utils/math.d.ts +0 -3
  232. package/core/utils/metrics.d.ts +0 -1
  233. package/core/utils/object.d.ts +0 -4
  234. package/core/utils/parsing.d.ts +0 -4
  235. package/core/utils/rect.d.ts +0 -2
  236. package/core/utils/size.d.ts +0 -2
  237. package/core/utils/string.d.ts +0 -6
  238. package/core/utils/style.d.ts +0 -8
  239. package/core/utils/svg.d.ts +0 -2
  240. package/core/utils/svg_math.d.ts +0 -6
  241. package/core/utils/svg_paths.d.ts +0 -8
  242. package/core/utils/toolbox.d.ts +2 -35
  243. package/core/utils/useragent.d.ts +0 -8
  244. package/core/utils/xml.d.ts +9 -8
  245. package/core/utils.d.ts +0 -12
  246. package/core/variable_map.d.ts +1 -3
  247. package/core/variable_model.d.ts +0 -1
  248. package/core/variables.d.ts +13 -17
  249. package/core/variables_dynamic.d.ts +0 -4
  250. package/core/warning.d.ts +0 -2
  251. package/core/widgetdiv.d.ts +0 -10
  252. package/core/workspace.d.ts +3 -3
  253. package/core/workspace_audio.d.ts +0 -2
  254. package/core/workspace_comment.d.ts +1 -3
  255. package/core/workspace_comment_svg.d.ts +1 -3
  256. package/core/workspace_dragger.d.ts +0 -2
  257. package/core/workspace_svg.d.ts +4 -7
  258. package/core/xml.d.ts +1 -13
  259. package/core/zoom_controls.d.ts +4 -15
  260. package/dart_compressed.js +199 -199
  261. package/dart_compressed.js.map +1 -1
  262. package/javascript_compressed.js +168 -168
  263. package/javascript_compressed.js.map +1 -1
  264. package/lua_compressed.js +211 -211
  265. package/lua_compressed.js.map +1 -1
  266. package/msg/bn.js +2 -2
  267. package/msg/bs.js +7 -7
  268. package/msg/de.js +1 -1
  269. package/msg/fi.js +1 -1
  270. package/msg/fr.js +3 -3
  271. package/msg/ia.js +5 -5
  272. package/msg/kn.js +5 -5
  273. package/msg/ko.js +1 -1
  274. package/msg/lb.js +22 -22
  275. package/msg/sd.js +9 -9
  276. package/msg/skr-arab.js +2 -2
  277. package/msg/sl.js +18 -18
  278. package/msg/sw.js +1 -1
  279. package/msg/zh-hans.js +6 -6
  280. package/msg/zh-hant.js +2 -2
  281. package/package.json +9 -9
  282. package/php_compressed.js +185 -185
  283. package/php_compressed.js.map +1 -1
  284. package/python_compressed.js +138 -138
  285. package/python_compressed.js.map +1 -1
  286. package/core/events/events_procedure_base.d.ts +0 -26
  287. package/core/events/events_procedure_change_return.d.ts +0 -40
  288. package/core/events/events_procedure_create.d.ts +0 -34
  289. package/core/events/events_procedure_delete.d.ts +0 -32
  290. package/core/events/events_procedure_enable.d.ts +0 -34
  291. package/core/events/events_procedure_parameter_base.d.ts +0 -26
  292. package/core/events/events_procedure_parameter_create.d.ts +0 -42
  293. package/core/events/events_procedure_parameter_delete.d.ts +0 -41
  294. package/core/events/events_procedure_parameter_rename.d.ts +0 -36
  295. package/core/events/events_procedure_rename.d.ts +0 -35
  296. package/core/procedures/observable_parameter_model.d.ts +0 -62
  297. package/core/procedures/observable_procedure_model.d.ts +0 -75
  298. package/core/procedures/update_procedures.d.ts +0 -13
  299. package/core/utils/sentinel.d.ts +0 -13
@@ -5,18 +5,14 @@
5
5
  */
6
6
  import './events/events_block_change.js';
7
7
  import type { Block } from './block.js';
8
- import { FieldConfig } from './field.js';
8
+ import { Field, FieldConfig } from './field.js';
9
9
  import { FieldDropdown, FieldDropdownValidator, MenuGenerator, MenuOption } from './field_dropdown.js';
10
10
  import type { Menu } from './menu.js';
11
11
  import type { MenuItem } from './menuitem.js';
12
- import type { Sentinel } from './utils/sentinel.js';
13
12
  import { Size } from './utils/size.js';
14
13
  import { VariableModel } from './variable_model.js';
15
- export type FieldVariableValidator = FieldDropdownValidator;
16
14
  /**
17
15
  * Class for a variable's dropdown field.
18
- *
19
- * @alias Blockly.FieldVariable
20
16
  */
21
17
  export declare class FieldVariable extends FieldDropdown {
22
18
  protected menuGenerator_: MenuGenerator | undefined;
@@ -42,20 +38,20 @@ export declare class FieldVariable extends FieldDropdown {
42
38
  * Also accepts Field.SKIP_SETUP if you wish to skip setup (only used by
43
39
  * subclasses that want to handle configuration and setting the field value
44
40
  * after their own constructors have run).
45
- * @param opt_validator A function that is called to validate changes to the
41
+ * @param validator A function that is called to validate changes to the
46
42
  * field's value. Takes in a variable ID & returns a validated variable
47
43
  * ID, or null to abort the change.
48
- * @param opt_variableTypes A list of the types of variables to include in the
49
- * dropdown. Will only be used if opt_config is not provided.
50
- * @param opt_defaultType The type of variable to create if this field's value
51
- * is not explicitly set. Defaults to ''. Will only be used if opt_config
44
+ * @param variableTypes A list of the types of variables to include in the
45
+ * dropdown. Will only be used if config is not provided.
46
+ * @param defaultType The type of variable to create if this field's value
47
+ * is not explicitly set. Defaults to ''. Will only be used if config
52
48
  * is not provided.
53
- * @param opt_config A map of options used to configure the field.
49
+ * @param config A map of options used to configure the field.
54
50
  * See the [field creation documentation]{@link
55
51
  * https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/variable#creation}
56
52
  * for a list of properties this parameter supports.
57
53
  */
58
- constructor(varName: string | null | Sentinel, opt_validator?: FieldVariableValidator, opt_variableTypes?: string[], opt_defaultType?: string, opt_config?: FieldVariableConfig);
54
+ constructor(varName: string | null | typeof Field.SKIP_SETUP, validator?: FieldVariableValidator, variableTypes?: string[], defaultType?: string, config?: FieldVariableConfig);
59
55
  /**
60
56
  * Configure the field based on the given map of options.
61
57
  *
@@ -139,14 +135,14 @@ export declare class FieldVariable extends FieldDropdown {
139
135
  *
140
136
  * @returns Validation function, or null.
141
137
  */
142
- getValidator(): Function | null;
138
+ getValidator(): FieldVariableValidator | null;
143
139
  /**
144
140
  * Ensure that the ID belongs to a valid variable of an allowed type.
145
141
  *
146
- * @param opt_newValue The ID of the new variable to set.
142
+ * @param newValue The ID of the new variable to set.
147
143
  * @returns The validated ID, or null if invalid.
148
144
  */
149
- protected doClassValidation_(opt_newValue?: any): string | null;
145
+ protected doClassValidation_(newValue?: any): string | null;
150
146
  /**
151
147
  * Update the value of this variable field, as well as its variable and text.
152
148
  *
@@ -155,7 +151,7 @@ export declare class FieldVariable extends FieldDropdown {
155
151
  *
156
152
  * @param newId The value to be saved.
157
153
  */
158
- protected doValueUpdate_(newId: any): void;
154
+ protected doValueUpdate_(newId: string): void;
159
155
  /**
160
156
  * Check whether the given variable type is allowed on this field.
161
157
  *
@@ -174,10 +170,10 @@ export declare class FieldVariable extends FieldDropdown {
174
170
  * Parse the optional arguments representing the allowed variable types and
175
171
  * the default variable type.
176
172
  *
177
- * @param opt_variableTypes A list of the types of variables to include in the
173
+ * @param variableTypes A list of the types of variables to include in the
178
174
  * dropdown. If null or undefined, variables of all types will be
179
175
  * displayed in the dropdown.
180
- * @param opt_defaultType The type of the variable to create if this field's
176
+ * @param defaultType The type of the variable to create if this field's
181
177
  * value is not explicitly set. Defaults to ''.
182
178
  */
183
179
  private setTypes_;
@@ -238,4 +234,20 @@ export interface FieldVariableConfig extends FieldConfig {
238
234
  export interface FieldVariableFromJsonConfig extends FieldVariableConfig {
239
235
  variable?: string;
240
236
  }
237
+ /**
238
+ * A function that is called to validate changes to the field's value before
239
+ * they are set.
240
+ *
241
+ * @see {@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/validators#return_values}
242
+ * @param newValue The value to be validated.
243
+ * @returns One of three instructions for setting the new value: `T`, `null`,
244
+ * or `undefined`.
245
+ *
246
+ * - `T` to set this function's returned value instead of `newValue`.
247
+ *
248
+ * - `null` to invoke `doValueInvalid_` and not set a value.
249
+ *
250
+ * - `undefined` to set `newValue` as is.
251
+ */
252
+ export type FieldVariableValidator = FieldDropdownValidator;
241
253
  //# sourceMappingURL=field_variable.d.ts.map
@@ -18,8 +18,6 @@ declare enum FlyoutItemType {
18
18
  }
19
19
  /**
20
20
  * Class for a flyout.
21
- *
22
- * @alias Blockly.Flyout
23
21
  */
24
22
  export declare abstract class Flyout extends DeleteArea implements IFlyout {
25
23
  /**
@@ -50,8 +48,7 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
50
48
  /**
51
49
  * Lay out the blocks in the flyout.
52
50
  *
53
- * @param contents The blocks and buttons to lay
54
- * out.
51
+ * @param contents The blocks and buttons to lay out.
55
52
  * @param gaps The visible gaps between blocks.
56
53
  */
57
54
  protected abstract layout_(contents: FlyoutItem[], gaps: number[]): void;
@@ -96,9 +93,11 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
96
93
  horizontalLayout: boolean;
97
94
  protected toolboxPosition_: number;
98
95
  /**
99
- * Opaque data that can be passed to Blockly.unbindEvent_.
96
+ * Array holding info needed to unbind events.
97
+ * Used for disposing.
98
+ * Ex: [[node, name, func], [node, name, func]].
100
99
  */
101
- private eventWrappers_;
100
+ private boundEvents;
102
101
  /**
103
102
  * Function that will be registered as a change listener on the workspace
104
103
  * to reflow when blocks in the flyout workspace change.
@@ -8,8 +8,6 @@ import type * as toolbox from './utils/toolbox.js';
8
8
  import type { WorkspaceSvg } from './workspace_svg.js';
9
9
  /**
10
10
  * Class for a button or label in the flyout.
11
- *
12
- * @alias Blockly.FlyoutButton
13
11
  */
14
12
  export declare class FlyoutButton {
15
13
  private readonly workspace;
@@ -19,6 +17,8 @@ export declare class FlyoutButton {
19
17
  static TEXT_MARGIN_X: number;
20
18
  /** The vertical margin around the text in the button. */
21
19
  static TEXT_MARGIN_Y: number;
20
+ /** The radius of the flyout button's borders. */
21
+ static BORDER_RADIUS: number;
22
22
  private readonly text_;
23
23
  private readonly position_;
24
24
  private readonly callbackKey_;
@@ -9,8 +9,6 @@ import type { Coordinate } from './utils/coordinate.js';
9
9
  import { Rect } from './utils/rect.js';
10
10
  /**
11
11
  * Class for a flyout.
12
- *
13
- * @alias Blockly.HorizontalFlyout
14
12
  */
15
13
  export declare class HorizontalFlyout extends Flyout {
16
14
  horizontalLayout: boolean;
@@ -9,8 +9,6 @@ import type { WorkspaceSvg } from './workspace_svg.js';
9
9
  /**
10
10
  * Calculates metrics for a flyout's workspace.
11
11
  * The metrics are mainly used to size scrollbars for the flyout.
12
- *
13
- * @alias Blockly.FlyoutMetricsManager
14
12
  */
15
13
  export declare class FlyoutMetricsManager extends MetricsManager {
16
14
  /** The flyout that owns the workspace to calculate metrics for. */
@@ -9,8 +9,6 @@ import type { Coordinate } from './utils/coordinate.js';
9
9
  import { Rect } from './utils/rect.js';
10
10
  /**
11
11
  * Class for a flyout.
12
- *
13
- * @alias Blockly.VerticalFlyout
14
12
  */
15
13
  export declare class VerticalFlyout extends Flyout {
16
14
  /** The name of the vertical flyout in the registry. */
@@ -10,7 +10,6 @@ import type { Workspace } from './workspace.js';
10
10
  * Class for a code generator that translates the blocks into a language.
11
11
  *
12
12
  * @unrestricted
13
- * @alias Blockly.CodeGenerator
14
13
  */
15
14
  export declare class CodeGenerator {
16
15
  name_: string;
package/core/gesture.d.ts CHANGED
@@ -5,7 +5,6 @@
5
5
  */
6
6
  import './events/events_click.js';
7
7
  import type { BlockSvg } from './block_svg.js';
8
- import * as browserEvents from './browser_events.js';
9
8
  import { BubbleDragger } from './bubble_dragger.js';
10
9
  import type { Field } from './field.js';
11
10
  import type { IBlockDragger } from './interfaces/i_block_dragger.js';
@@ -16,8 +15,6 @@ import { WorkspaceDragger } from './workspace_dragger.js';
16
15
  import type { WorkspaceSvg } from './workspace_svg.js';
17
16
  /**
18
17
  * Class for one gesture.
19
- *
20
- * @alias Blockly.Gesture
21
18
  */
22
19
  export declare class Gesture {
23
20
  private readonly creatorWorkspace;
@@ -63,15 +60,11 @@ export declare class Gesture {
63
60
  */
64
61
  private hasExceededDragRadius_;
65
62
  /**
66
- * A handle to use to unbind a pointermove listener at the end of a drag.
67
- * Opaque data returned from Blockly.bindEventWithChecks_.
63
+ * Array holding info needed to unbind events.
64
+ * Used for disposing.
65
+ * Ex: [[node, name, func], [node, name, func]].
68
66
  */
69
- protected onMoveWrapper_: browserEvents.Data | null;
70
- /**
71
- * A handle to use to unbind a pointerup listener at the end of a drag.
72
- * Opaque data returned from Blockly.bindEventWithChecks_.
73
- */
74
- protected onUpWrapper_: browserEvents.Data | null;
67
+ private boundEvents;
75
68
  /** The object tracking a bubble drag, or null if none is in progress. */
76
69
  private bubbleDragger_;
77
70
  /** The object tracking a block drag, or null if none is in progress. */
@@ -105,12 +98,6 @@ export declare class Gesture {
105
98
  private previousScale_;
106
99
  /** The starting distance between two touch points. */
107
100
  private startDistance_;
108
- /**
109
- * A handle to use to unbind the second pointerdown listener
110
- * at the end of a drag.
111
- * Opaque data returned from Blockly.bindEventWithChecks_.
112
- */
113
- private onStartWrapper_;
114
101
  /** Boolean for whether or not the workspace supports pinch-zoom. */
115
102
  private isPinchZoomEnabled_;
116
103
  /**
@@ -360,7 +347,7 @@ export declare class Gesture {
360
347
  * @param field The field the gesture started on.
361
348
  * @internal
362
349
  */
363
- setStartField(field: Field): void;
350
+ setStartField<T>(field: Field<T>): void;
364
351
  /**
365
352
  * Record the bubble that a gesture started on
366
353
  *
package/core/grid.d.ts CHANGED
@@ -6,8 +6,6 @@
6
6
  import { GridOptions } from './options.js';
7
7
  /**
8
8
  * Class for a workspace's grid.
9
- *
10
- * @alias Blockly.Grid
11
9
  */
12
10
  export declare class Grid {
13
11
  private pattern;
package/core/icon.d.ts CHANGED
@@ -9,8 +9,6 @@ import { Coordinate } from './utils/coordinate.js';
9
9
  import { Size } from './utils/size.js';
10
10
  /**
11
11
  * Class for an icon.
12
- *
13
- * @alias Blockly.Icon
14
12
  */
15
13
  export declare abstract class Icon {
16
14
  protected block_: BlockSvg | null;
package/core/inject.d.ts CHANGED
@@ -11,7 +11,6 @@ import { WorkspaceSvg } from './workspace_svg.js';
11
11
  * @param container Containing element, or its ID, or a CSS selector.
12
12
  * @param opt_options Optional dictionary of options.
13
13
  * @returns Newly created main workspace.
14
- * @alias Blockly.inject
15
14
  */
16
15
  export declare function inject(container: Element | string, opt_options?: BlocklyOptions): WorkspaceSvg;
17
16
  //# sourceMappingURL=inject.d.ts.map
package/core/input.d.ts CHANGED
@@ -10,8 +10,6 @@ import type { Connection } from './connection.js';
10
10
  import type { Field } from './field.js';
11
11
  /**
12
12
  * Class for an input with an optional field.
13
- *
14
- * @alias Blockly.Input
15
13
  */
16
14
  export declare class Input {
17
15
  type: number;
@@ -131,7 +129,6 @@ export declare namespace Input {
131
129
  /**
132
130
  * Enum for alignment of inputs.
133
131
  *
134
- * @alias Blockly.Input.Align
135
132
  */
136
133
  enum Align {
137
134
  LEFT = -1,
@@ -5,8 +5,6 @@
5
5
  */
6
6
  /**
7
7
  * Enum for the type of a connection or input.
8
- *
9
- * @alias Blockly.inputTypes
10
8
  */
11
9
  export declare enum inputTypes {
12
10
  VALUE = 1,
@@ -10,8 +10,6 @@ import type { Coordinate } from './utils/coordinate.js';
10
10
  * Class that controls updates to connections during drags. It is primarily
11
11
  * responsible for finding the closest eligible connection and highlighting or
12
12
  * unhighlighting it as needed during a drag.
13
- *
14
- * @alias Blockly.InsertionMarkerManager
15
13
  */
16
14
  export declare class InsertionMarkerManager {
17
15
  /**
@@ -114,10 +112,8 @@ export declare class InsertionMarkerManager {
114
112
  */
115
113
  private createMarkerBlock;
116
114
  /**
117
- * Populate the list of available connections on this block stack. This
118
- * should only be called once, at the beginning of a drag. If the stack has
119
- * more than one block, this function will populate lastOnStack and create
120
- * the corresponding insertion marker.
115
+ * Populate the list of available connections on this block stack. If the
116
+ * stack has more than one block, this function will also update lastOnStack.
121
117
  *
122
118
  * @returns A list of available connections.
123
119
  */
@@ -230,6 +226,10 @@ export declare class InsertionMarkerManager {
230
226
  * @internal
231
227
  */
232
228
  getInsertionMarkers(): BlockSvg[];
229
+ /**
230
+ * Safely disposes of an insertion marker.
231
+ */
232
+ private disposeInsertionMarker;
233
233
  }
234
234
  export declare namespace InsertionMarkerManager {
235
235
  /**
@@ -5,8 +5,6 @@
5
5
  */
6
6
  /**
7
7
  * An AST node location interface.
8
- *
9
- * @alias Blockly.IASTNodeLocation
10
8
  */
11
9
  export interface IASTNodeLocation {
12
10
  }
@@ -6,8 +6,6 @@
6
6
  import type { IASTNodeLocation } from './i_ast_node_location.js';
7
7
  /**
8
8
  * An AST node location SVG interface.
9
- *
10
- * @alias Blockly.IASTNodeLocationSvg
11
9
  */
12
10
  export interface IASTNodeLocationSvg extends IASTNodeLocation {
13
11
  /**
@@ -7,8 +7,6 @@ import type { IASTNodeLocation } from './i_ast_node_location.js';
7
7
  import type { Block } from '../block.js';
8
8
  /**
9
9
  * An AST node location that has an associated block.
10
- *
11
- * @alias Blockly.IASTNodeLocationWithBlock
12
10
  */
13
11
  export interface IASTNodeLocationWithBlock extends IASTNodeLocation {
14
12
  /**
@@ -6,8 +6,6 @@
6
6
  import type { IComponent } from './i_component.js';
7
7
  /**
8
8
  * Interface for a component that can be automatically hidden.
9
- *
10
- * @alias Blockly.IAutoHideable
11
9
  */
12
10
  export interface IAutoHideable extends IComponent {
13
11
  /**
@@ -7,8 +7,6 @@ import type { Coordinate } from '../utils/coordinate.js';
7
7
  import type { BlockSvg } from '../block_svg.js';
8
8
  /**
9
9
  * A block dragger interface.
10
- *
11
- * @alias Blockly.IBlockDragger
12
10
  */
13
11
  export interface IBlockDragger {
14
12
  /**
@@ -6,8 +6,6 @@
6
6
  import type { Rect } from '../utils/rect.js';
7
7
  /**
8
8
  * A bounded element interface.
9
- *
10
- * @alias Blockly.IBoundedElement
11
9
  */
12
10
  export interface IBoundedElement {
13
11
  /**
@@ -9,8 +9,6 @@ import type { IContextMenu } from './i_contextmenu.js';
9
9
  import type { IDraggable } from './i_draggable.js';
10
10
  /**
11
11
  * A bubble interface.
12
- *
13
- * @alias Blockly.IBubble
14
12
  */
15
13
  export interface IBubble extends IDraggable, IContextMenu {
16
14
  /**
@@ -7,8 +7,6 @@ import type { ISelectableToolboxItem } from './i_selectable_toolbox_item.js';
7
7
  import type { IToolboxItem } from './i_toolbox_item.js';
8
8
  /**
9
9
  * Interface for an item in the toolbox that can be collapsed.
10
- *
11
- * @alias Blockly.ICollapsibleToolboxItem
12
10
  */
13
11
  export interface ICollapsibleToolboxItem extends ISelectableToolboxItem {
14
12
  /**
@@ -6,8 +6,6 @@
6
6
  /**
7
7
  * The interface for a workspace component that can be registered with the
8
8
  * ComponentManager.
9
- *
10
- * @alias Blockly.IComponent
11
9
  */
12
10
  export interface IComponent {
13
11
  /**
@@ -7,8 +7,6 @@ import type { Connection } from '../connection.js';
7
7
  import type { RenderedConnection } from '../rendered_connection.js';
8
8
  /**
9
9
  * Class for connection type checking logic.
10
- *
11
- * @alias Blockly.IConnectionChecker
12
10
  */
13
11
  export interface IConnectionChecker {
14
12
  /**
@@ -3,7 +3,6 @@
3
3
  * Copyright 2020 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- /** @alias Blockly.IContextMenu */
7
6
  export interface IContextMenu {
8
7
  /**
9
8
  * Show the context menu for this object.
@@ -5,7 +5,6 @@
5
5
  */
6
6
  import type { WorkspaceSvg } from '../workspace_svg.js';
7
7
  import type { ISelectable } from './i_selectable.js';
8
- /** @alias Blockly.ICopyable */
9
8
  export interface ICopyable extends ISelectable {
10
9
  /**
11
10
  * Encode for copying.
@@ -19,7 +18,9 @@ export declare namespace ICopyable {
19
18
  interface CopyData {
20
19
  saveInfo: Object | Element;
21
20
  source: WorkspaceSvg;
22
- typeCounts: Object | null;
21
+ typeCounts: {
22
+ [key: string]: number;
23
+ } | null;
23
24
  }
24
25
  }
25
26
  export type CopyData = ICopyable.CopyData;
@@ -5,8 +5,6 @@
5
5
  */
6
6
  /**
7
7
  * The interface for an object that can be deleted.
8
- *
9
- * @alias Blockly.IDeletable
10
8
  */
11
9
  export interface IDeletable {
12
10
  /**
@@ -8,8 +8,6 @@ import type { IDraggable } from './i_draggable.js';
8
8
  /**
9
9
  * Interface for a component that can delete a block or bubble that is dropped
10
10
  * on top of it.
11
- *
12
- * @alias Blockly.IDeleteArea
13
11
  */
14
12
  export interface IDeleteArea extends IDragTarget {
15
13
  /**
@@ -9,8 +9,6 @@ import type { IComponent } from './i_component.js';
9
9
  /**
10
10
  * Interface for a component with custom behaviour when a block or bubble is
11
11
  * dragged over or dropped on top of it.
12
- *
13
- * @alias Blockly.IDragTarget
14
12
  */
15
13
  export interface IDragTarget extends IComponent {
16
14
  /**
@@ -6,8 +6,6 @@
6
6
  import type { IDeletable } from './i_deletable.js';
7
7
  /**
8
8
  * The interface for an object that can be dragged.
9
- *
10
- * @alias Blockly.IDraggable
11
9
  */
12
10
  export interface IDraggable extends IDeletable {
13
11
  }
@@ -11,8 +11,6 @@ import type { Svg } from '../utils/svg.js';
11
11
  import type { IRegistrable } from './i_registrable.js';
12
12
  /**
13
13
  * Interface for a flyout.
14
- *
15
- * @alias Blockly.IFlyout
16
14
  */
17
15
  export interface IFlyout extends IRegistrable {
18
16
  /** Whether the flyout is laid out horizontally or not. */
@@ -6,8 +6,6 @@
6
6
  import { KeyboardShortcut } from '../shortcut_registry.js';
7
7
  /**
8
8
  * An interface for an object that handles keyboard shortcuts.
9
- *
10
- * @alias Blockly.IKeyboardAccessible
11
9
  */
12
10
  export interface IKeyboardAccessible {
13
11
  /**
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ /**
7
+ * Legacy means of representing a procedure signature. The elements are
8
+ * respectively: name, parameter names, and whether it has a return value.
9
+ */
10
+ export type ProcedureTuple = [string, string[], boolean];
11
+ /**
12
+ * Procedure block type.
13
+ *
14
+ * @internal
15
+ */
16
+ export interface ProcedureBlock {
17
+ getProcedureCall: () => string;
18
+ renameProcedure: (p1: string, p2: string) => void;
19
+ getProcedureDef: () => ProcedureTuple;
20
+ }
21
+ /** @internal */
22
+ export interface LegacyProcedureDefBlock {
23
+ getProcedureDef: () => ProcedureTuple;
24
+ }
25
+ /** @internal */
26
+ export declare function isLegacyProcedureDefBlock(block: Object): block is LegacyProcedureDefBlock;
27
+ /** @internal */
28
+ export interface LegacyProcedureCallBlock {
29
+ getProcedureCall: () => string;
30
+ renameProcedure: (p1: string, p2: string) => void;
31
+ }
32
+ /** @internal */
33
+ export declare function isLegacyProcedureCallBlock(block: Object): block is LegacyProcedureCallBlock;
34
+ //# sourceMappingURL=i_legacy_procedure_blocks.d.ts.map
@@ -8,8 +8,6 @@ import type { Size } from '../utils/size.js';
8
8
  import type { Metrics } from '../utils/metrics.js';
9
9
  /**
10
10
  * Interface for a metrics manager.
11
- *
12
- * @alias Blockly.IMetricsManager
13
11
  */
14
12
  export interface IMetricsManager {
15
13
  /**
@@ -34,11 +32,14 @@ export interface IMetricsManager {
34
32
  */
35
33
  getScrollMetrics(opt_getWorkspaceCoordinates?: boolean, opt_viewMetrics?: ContainerRegion, opt_contentMetrics?: ContainerRegion): ContainerRegion;
36
34
  /**
37
- * Gets the width and the height of the flyout on the workspace in pixel
38
- * coordinates. Returns 0 for the width and height if the workspace has a
39
- * category toolbox instead of a simple toolbox.
35
+ * Gets the width and the height of the flyout in pixel
36
+ * coordinates. By default, will get metrics for either a simple flyout (owned
37
+ * directly by the workspace) or for the flyout owned by the toolbox. If you
38
+ * pass `opt_own` as `true` then only metrics for the simple flyout will be
39
+ * returned, and it will return 0 for the width and height if the workspace
40
+ * has a category toolbox instead of a simple toolbox.
40
41
  *
41
- * @param opt_own Whether to only return the workspace's own flyout.
42
+ * @param opt_own Whether to only return the workspace's own flyout metrics.
42
43
  * @returns The width and height of the flyout.
43
44
  */
44
45
  getFlyoutMetrics(opt_own?: boolean): ToolboxMetrics;
@@ -46,8 +47,7 @@ export interface IMetricsManager {
46
47
  * Gets the width, height and position of the toolbox on the workspace in
47
48
  * pixel coordinates. Returns 0 for the width and height if the workspace has
48
49
  * a simple toolbox instead of a category toolbox. To get the width and height
49
- * of a
50
- * simple toolbox @see {@link IMetricsManager#getFlyoutMetrics}.
50
+ * of a simple toolbox, see {@link IMetricsManager#getFlyoutMetrics}.
51
51
  *
52
52
  * @returns The object with the width, height and position of the toolbox.
53
53
  */
@@ -5,8 +5,6 @@
5
5
  */
6
6
  /**
7
7
  * The interface for an object that is movable.
8
- *
9
- * @alias Blockly.IMovable
10
8
  */
11
9
  export interface IMovable {
12
10
  /**
@@ -8,8 +8,6 @@ import type { UiMetrics } from '../metrics_manager.js';
8
8
  import type { IComponent } from './i_component.js';
9
9
  /**
10
10
  * Interface for a component that is positioned on top of the workspace.
11
- *
12
- * @alias Blockly.IPositionable
13
11
  */
14
12
  export interface IPositionable extends IComponent {
15
13
  /**
@@ -4,9 +4,12 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { Block } from '../block.js';
7
+ import { IProcedureModel } from './i_procedure_model.js';
7
8
  /** The interface for a block which models a procedure. */
8
9
  export interface IProcedureBlock {
10
+ getProcedureModel(): IProcedureModel;
9
11
  doProcedureUpdate(): void;
12
+ isProcedureDef(): boolean;
10
13
  }
11
14
  /** A type guard which checks if the given block is a procedure block. */
12
15
  export declare function isProcedureBlock(block: Block | IProcedureBlock): block is IProcedureBlock;