blockly 11.0.0-beta.4 → 11.0.0-beta.5

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 (101) hide show
  1. package/blockly.js +22 -0
  2. package/blockly.min.js +572 -508
  3. package/blockly_compressed.js +494 -467
  4. package/blockly_compressed.js.map +1 -1
  5. package/blocks.js +22 -0
  6. package/blocks_compressed.js +29 -27
  7. package/blocks_compressed.js.map +1 -1
  8. package/browser.js +30 -0
  9. package/core/block.d.ts +3 -10
  10. package/core/block_dragger.d.ts +10 -10
  11. package/core/block_svg.d.ts +32 -5
  12. package/core/blockly.d.ts +38 -3
  13. package/core/clipboard.d.ts +19 -0
  14. package/core/{insertion_marker_previewer.d.ts → connection_previewers/insertion_marker_previewer.d.ts} +3 -3
  15. package/core/events/events_click.d.ts +1 -1
  16. package/core/field_angle.d.ts +208 -0
  17. package/core/field_colour.d.ts +243 -0
  18. package/core/field_dropdown.d.ts +0 -1
  19. package/core/field_image.d.ts +1 -1
  20. package/core/field_multilineinput.d.ts +182 -0
  21. package/core/generator.d.ts +1 -1
  22. package/core/gesture.d.ts +0 -2
  23. package/core/grid.d.ts +9 -9
  24. package/core/icons/comment_icon.d.ts +3 -3
  25. package/core/icons/icon.d.ts +6 -0
  26. package/core/icons/icon_types.d.ts +2 -2
  27. package/core/icons/mutator_icon.d.ts +16 -1
  28. package/core/icons/warning_icon.d.ts +1 -1
  29. package/core/inputs/input.d.ts +19 -10
  30. package/core/interfaces/i_has_bubble.d.ts +1 -1
  31. package/core/interfaces/i_parameter_model.d.ts +0 -7
  32. package/core/interfaces/i_procedure_model.d.ts +0 -7
  33. package/core/options.d.ts +0 -1
  34. package/core/renderers/common/drawer.d.ts +7 -0
  35. package/core/renderers/measurables/icon.d.ts +5 -0
  36. package/core/renderers/minimalist/constants.d.ts +21 -0
  37. package/core/renderers/minimalist/drawer.d.ts +26 -0
  38. package/core/renderers/minimalist/info.d.ts +35 -0
  39. package/core/renderers/minimalist/minimalist.d.ts +12 -0
  40. package/core/renderers/minimalist/renderer.d.ts +48 -0
  41. package/core/serialization/procedures.d.ts +26 -28
  42. package/core/utils/dom.d.ts +9 -0
  43. package/core/utils/keycodes.d.ts +32 -32
  44. package/core/utils/size.d.ts +0 -10
  45. package/core/utils/string.d.ts +10 -0
  46. package/core/workspace_svg.d.ts +27 -0
  47. package/core-browser.js +26 -0
  48. package/core.js +26 -0
  49. package/dart.d.ts +24 -1
  50. package/dart.js +22 -0
  51. package/dart_compressed.js +68 -18
  52. package/dart_compressed.js.map +1 -1
  53. package/generators/dart/colour.d.ts +16 -0
  54. package/generators/dart/dart_generator.d.ts +17 -17
  55. package/generators/dart/text.d.ts +1 -0
  56. package/generators/javascript/colour.d.ts +16 -0
  57. package/generators/javascript/javascript_generator.d.ts +35 -34
  58. package/generators/javascript/text.d.ts +1 -0
  59. package/generators/lua/colour.d.ts +16 -0
  60. package/generators/lua/lua_generator.d.ts +10 -10
  61. package/generators/lua/text.d.ts +1 -0
  62. package/generators/php/colour.d.ts +16 -0
  63. package/generators/php/php_generator.d.ts +36 -36
  64. package/generators/php/text.d.ts +1 -0
  65. package/generators/python/colour.d.ts +16 -0
  66. package/generators/python/python_generator.d.ts +21 -20
  67. package/generators/python/text.d.ts +1 -0
  68. package/index.js +7 -19
  69. package/javascript.d.ts +41 -1
  70. package/javascript.js +23 -0
  71. package/javascript_compressed.js +49 -14
  72. package/javascript_compressed.js.map +1 -1
  73. package/lua.d.ts +18 -1
  74. package/lua.js +22 -0
  75. package/lua_compressed.js +40 -18
  76. package/lua_compressed.js.map +1 -1
  77. package/msg/constants.d.ts +14 -0
  78. package/msg/msg.d.ts +440 -0
  79. package/msg/qqq.d.ts +14 -0
  80. package/msg/synonyms.d.ts +14 -0
  81. package/node.js +21 -0
  82. package/package.json +11 -45
  83. package/php.d.ts +43 -1
  84. package/php.js +22 -0
  85. package/php_compressed.js +43 -10
  86. package/php_compressed.js.map +1 -1
  87. package/python.d.ts +27 -1
  88. package/python.js +23 -0
  89. package/python_compressed.js +37 -18
  90. package/python_compressed.js.map +1 -1
  91. package/core/comments/comment_view.d.ts +0 -200
  92. package/core/comments/workspace_comment.d.ts +0 -94
  93. package/core/comments.d.ts +0 -8
  94. package/core/interfaces/i_comment_icon.d.ts +0 -17
  95. package/core-node.js +0 -31
  96. package/media/arrow-dropdown.svg +0 -1
  97. package/media/resize-handle.svg +0 -3
  98. package/msg/ce.d.ts +0 -8
  99. package/msg/dtp.d.ts +0 -8
  100. package/msg/hsb.d.ts +0 -8
  101. package/msg/tdd.d.ts +0 -8
@@ -0,0 +1,243 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2012 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ /**
7
+ * Colour input field.
8
+ *
9
+ * @class
10
+ */
11
+ import './events/events_block_change.js';
12
+ import { Field, FieldConfig, FieldValidator } from './field.js';
13
+ import { Size } from './utils/size.js';
14
+ /**
15
+ * Class for a colour input field.
16
+ */
17
+ export declare class FieldColour extends Field<string> {
18
+ /**
19
+ * An array of colour strings for the palette.
20
+ * Copied from goog.ui.ColorPicker.SIMPLE_GRID_COLORS
21
+ * All colour pickers use this unless overridden with setColours.
22
+ */
23
+ static COLOURS: string[];
24
+ /**
25
+ * An array of tooltip strings for the palette. If not the same length as
26
+ * COLOURS, the colour's hex code will be used for any missing titles.
27
+ * All colour pickers use this unless overridden with setColours.
28
+ */
29
+ static TITLES: string[];
30
+ /**
31
+ * Number of columns in the palette.
32
+ * All colour pickers use this unless overridden with setColumns.
33
+ */
34
+ static COLUMNS: number;
35
+ /** The field's colour picker element. */
36
+ private picker;
37
+ /** Index of the currently highlighted element. */
38
+ private highlightedIndex;
39
+ /**
40
+ * Array holding info needed to unbind events.
41
+ * Used for disposing.
42
+ * Ex: [[node, name, func], [node, name, func]].
43
+ */
44
+ private boundEvents;
45
+ /**
46
+ * Serializable fields are saved by the serializer, non-serializable fields
47
+ * are not. Editable fields should also be serializable.
48
+ */
49
+ SERIALIZABLE: boolean;
50
+ /** Mouse cursor style when over the hotspot that initiates the editor. */
51
+ CURSOR: string;
52
+ /**
53
+ * Used to tell if the field needs to be rendered the next time the block is
54
+ * rendered. Colour fields are statically sized, and only need to be
55
+ * rendered at initialization.
56
+ */
57
+ protected isDirty_: boolean;
58
+ /** Array of colours used by this field. If null, use the global list. */
59
+ private colours;
60
+ /**
61
+ * Array of colour tooltips used by this field. If null, use the global
62
+ * list.
63
+ */
64
+ private titles;
65
+ /**
66
+ * Number of colour columns used by this field. If 0, use the global
67
+ * setting. By default use the global constants for columns.
68
+ */
69
+ private columns;
70
+ /**
71
+ * @param value The initial value of the field. Should be in '#rrggbb'
72
+ * format. Defaults to the first value in the default colour array. Also
73
+ * accepts Field.SKIP_SETUP if you wish to skip setup (only used by
74
+ * subclasses that want to handle configuration and setting the field
75
+ * value after their own constructors have run).
76
+ * @param validator A function that is called to validate changes to the
77
+ * field's value. Takes in a colour string & returns a validated colour
78
+ * string ('#rrggbb' format), or null to abort the change.
79
+ * @param config A map of options used to configure the field.
80
+ * See the [field creation documentation]{@link
81
+ * https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/colour}
82
+ * for a list of properties this parameter supports.
83
+ */
84
+ constructor(value?: string | typeof Field.SKIP_SETUP, validator?: FieldColourValidator, config?: FieldColourConfig);
85
+ /**
86
+ * Configure the field based on the given map of options.
87
+ *
88
+ * @param config A map of options to configure the field based on.
89
+ */
90
+ protected configure_(config: FieldColourConfig): void;
91
+ /**
92
+ * Create the block UI for this colour field.
93
+ */
94
+ initView(): void;
95
+ protected isFullBlockField(): boolean;
96
+ /**
97
+ * Updates text field to match the colour/style of the block.
98
+ */
99
+ applyColour(): void;
100
+ /**
101
+ * Returns the height and width of the field.
102
+ *
103
+ * This should *in general* be the only place render_ gets called from.
104
+ *
105
+ * @returns Height and width.
106
+ */
107
+ getSize(): Size;
108
+ /**
109
+ * Updates the colour of the block to reflect whether this is a full
110
+ * block field or not.
111
+ */
112
+ protected render_(): void;
113
+ /**
114
+ * Updates the size of the field based on whether it is a full block field
115
+ * or not.
116
+ *
117
+ * @param margin margin to use when positioning the field.
118
+ */
119
+ protected updateSize_(margin?: number): void;
120
+ /**
121
+ * Ensure that the input value is a valid colour.
122
+ *
123
+ * @param newValue The input value.
124
+ * @returns A valid colour, or null if invalid.
125
+ */
126
+ protected doClassValidation_(newValue?: any): string | null;
127
+ /**
128
+ * Get the text for this field. Used when the block is collapsed.
129
+ *
130
+ * @returns Text representing the value of this field.
131
+ */
132
+ getText(): string;
133
+ /**
134
+ * Set a custom colour grid for this field.
135
+ *
136
+ * @param colours Array of colours for this block, or null to use default
137
+ * (FieldColour.COLOURS).
138
+ * @param titles Optional array of colour tooltips, or null to use default
139
+ * (FieldColour.TITLES).
140
+ * @returns Returns itself (for method chaining).
141
+ */
142
+ setColours(colours: string[], titles?: string[]): FieldColour;
143
+ /**
144
+ * Set a custom grid size for this field.
145
+ *
146
+ * @param columns Number of columns for this block, or 0 to use default
147
+ * (FieldColour.COLUMNS).
148
+ * @returns Returns itself (for method chaining).
149
+ */
150
+ setColumns(columns: number): FieldColour;
151
+ /** Create and show the colour field's editor. */
152
+ protected showEditor_(): void;
153
+ /**
154
+ * Handle a click on a colour cell.
155
+ *
156
+ * @param e Mouse event.
157
+ */
158
+ private onClick;
159
+ /**
160
+ * Handle a key down event. Navigate around the grid with the
161
+ * arrow keys. Enter selects the highlighted colour.
162
+ *
163
+ * @param e Keyboard event.
164
+ */
165
+ private onKeyDown;
166
+ /**
167
+ * Move the currently highlighted position by dx and dy.
168
+ *
169
+ * @param dx Change of x.
170
+ * @param dy Change of y.
171
+ */
172
+ private moveHighlightBy;
173
+ /**
174
+ * Handle a mouse move event. Highlight the hovered colour.
175
+ *
176
+ * @param e Mouse event.
177
+ */
178
+ private onMouseMove;
179
+ /** Handle a mouse enter event. Focus the picker. */
180
+ private onMouseEnter;
181
+ /**
182
+ * Handle a mouse leave event. Blur the picker and unhighlight
183
+ * the currently highlighted colour.
184
+ */
185
+ private onMouseLeave;
186
+ /**
187
+ * Returns the currently highlighted item (if any).
188
+ *
189
+ * @returns Highlighted item (null if none).
190
+ */
191
+ private getHighlighted;
192
+ /**
193
+ * Update the currently highlighted cell.
194
+ *
195
+ * @param cell The new cell to highlight.
196
+ * @param index The index of the new cell.
197
+ */
198
+ private setHighlightedCell;
199
+ /** Create a colour picker dropdown editor. */
200
+ private dropdownCreate;
201
+ /** Disposes of events and DOM-references belonging to the colour editor. */
202
+ private dropdownDispose;
203
+ /**
204
+ * Construct a FieldColour from a JSON arg object.
205
+ *
206
+ * @param options A JSON object with options (colour).
207
+ * @returns The new field instance.
208
+ * @nocollapse
209
+ * @internal
210
+ */
211
+ static fromJson(options: FieldColourFromJsonConfig): FieldColour;
212
+ }
213
+ /**
214
+ * Config options for the colour field.
215
+ */
216
+ export interface FieldColourConfig extends FieldConfig {
217
+ colourOptions?: string[];
218
+ colourTitles?: string[];
219
+ columns?: number;
220
+ }
221
+ /**
222
+ * fromJson config options for the colour field.
223
+ */
224
+ export interface FieldColourFromJsonConfig extends FieldColourConfig {
225
+ colour?: string;
226
+ }
227
+ /**
228
+ * A function that is called to validate changes to the field's value before
229
+ * they are set.
230
+ *
231
+ * @see {@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/validators#return_values}
232
+ * @param newValue The value to be validated.
233
+ * @returns One of three instructions for setting the new value: `T`, `null`,
234
+ * or `undefined`.
235
+ *
236
+ * - `T` to set this function's returned value instead of `newValue`.
237
+ *
238
+ * - `null` to invoke `doValueInvalid_` and not set a value.
239
+ *
240
+ * - `undefined` to set `newValue` as is.
241
+ */
242
+ export type FieldColourValidator = FieldValidator<string>;
243
+ //# sourceMappingURL=field_colour.d.ts.map
@@ -148,7 +148,6 @@ export declare class FieldDropdown extends Field<string> {
148
148
  * @param newValue The input value.
149
149
  * @returns A valid language-neutral option, or null if invalid.
150
150
  */
151
- protected doClassValidation_(newValue: string): string | null | undefined;
152
151
  protected doClassValidation_(newValue?: string): string | null;
153
152
  /**
154
153
  * Update the value of this dropdown field.
@@ -134,7 +134,7 @@ export interface FieldImageConfig extends FieldConfig {
134
134
  alt?: string;
135
135
  }
136
136
  /**
137
- * fromJson config options for the image field.
137
+ * fromJson config options for the colour field.
138
138
  */
139
139
  export interface FieldImageFromJsonConfig extends FieldImageConfig {
140
140
  src?: string;
@@ -0,0 +1,182 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { Field } from './field.js';
7
+ import { FieldTextInput, FieldTextInputConfig, FieldTextInputValidator } from './field_textinput.js';
8
+ /**
9
+ * Class for an editable text area field.
10
+ */
11
+ export declare class FieldMultilineInput extends FieldTextInput {
12
+ /**
13
+ * The SVG group element that will contain a text element for each text row
14
+ * when initialized.
15
+ */
16
+ textGroup: SVGGElement | null;
17
+ /**
18
+ * Defines the maximum number of lines of field.
19
+ * If exceeded, scrolling functionality is enabled.
20
+ */
21
+ protected maxLines_: number;
22
+ /** Whether Y overflow is currently occurring. */
23
+ protected isOverflowedY_: boolean;
24
+ /**
25
+ * @param value The initial content of the field. Should cast to a string.
26
+ * Defaults to an empty string if null or undefined. Also accepts
27
+ * Field.SKIP_SETUP if you wish to skip setup (only used by subclasses
28
+ * that want to handle configuration and setting the field value after
29
+ * their own constructors have run).
30
+ * @param validator An optional function that is called to validate any
31
+ * constraints on what the user entered. Takes the new text as an
32
+ * argument and returns either the accepted text, a replacement text, or
33
+ * null to abort the change.
34
+ * @param config A map of options used to configure the field.
35
+ * See the [field creation documentation]{@link
36
+ * https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/multiline-text-input#creation}
37
+ * for a list of properties this parameter supports.
38
+ */
39
+ constructor(value?: string | typeof Field.SKIP_SETUP, validator?: FieldMultilineInputValidator, config?: FieldMultilineInputConfig);
40
+ /**
41
+ * Configure the field based on the given map of options.
42
+ *
43
+ * @param config A map of options to configure the field based on.
44
+ */
45
+ protected configure_(config: FieldMultilineInputConfig): void;
46
+ /**
47
+ * Serializes this field's value to XML. Should only be called by Blockly.Xml.
48
+ *
49
+ * @param fieldElement The element to populate with info about the field's
50
+ * state.
51
+ * @returns The element containing info about the field's state.
52
+ * @internal
53
+ */
54
+ toXml(fieldElement: Element): Element;
55
+ /**
56
+ * Sets the field's value based on the given XML element. Should only be
57
+ * called by Blockly.Xml.
58
+ *
59
+ * @param fieldElement The element containing info about the field's state.
60
+ * @internal
61
+ */
62
+ fromXml(fieldElement: Element): void;
63
+ /**
64
+ * Saves this field's value.
65
+ * This function only exists for subclasses of FieldMultilineInput which
66
+ * predate the load/saveState API and only define to/fromXml.
67
+ *
68
+ * @returns The state of this field.
69
+ * @internal
70
+ */
71
+ saveState(): any;
72
+ /**
73
+ * Sets the field's value based on the given state.
74
+ * This function only exists for subclasses of FieldMultilineInput which
75
+ * predate the load/saveState API and only define to/fromXml.
76
+ *
77
+ * @param state The state of the variable to assign to this variable field.
78
+ * @internal
79
+ */
80
+ loadState(state: any): void;
81
+ /**
82
+ * Create the block UI for this field.
83
+ */
84
+ initView(): void;
85
+ /**
86
+ * Get the text from this field as displayed on screen. May differ from
87
+ * getText due to ellipsis, and other formatting.
88
+ *
89
+ * @returns Currently displayed text.
90
+ */
91
+ protected getDisplayText_(): string;
92
+ /**
93
+ * Called by setValue if the text input is valid. Updates the value of the
94
+ * field, and updates the text of the field if it is not currently being
95
+ * edited (i.e. handled by the htmlInput_). Is being redefined here to update
96
+ * overflow state of the field.
97
+ *
98
+ * @param newValue The value to be saved. The default validator guarantees
99
+ * that this is a string.
100
+ */
101
+ protected doValueUpdate_(newValue: string): void;
102
+ /** Updates the text of the textElement. */
103
+ protected render_(): void;
104
+ /** Updates the size of the field based on the text. */
105
+ protected updateSize_(): void;
106
+ /**
107
+ * Show the inline free-text editor on top of the text.
108
+ * Overrides the default behaviour to force rerender in order to
109
+ * correct block size, based on editor text.
110
+ *
111
+ * @param e Optional mouse event that triggered the field to open, or
112
+ * undefined if triggered programmatically.
113
+ * @param quietInput True if editor should be created without focus.
114
+ * Defaults to false.
115
+ */
116
+ showEditor_(e?: Event, quietInput?: boolean): void;
117
+ /**
118
+ * Create the text input editor widget.
119
+ *
120
+ * @returns The newly created text input editor.
121
+ */
122
+ protected widgetCreate_(): HTMLTextAreaElement;
123
+ /**
124
+ * Sets the maxLines config for this field.
125
+ *
126
+ * @param maxLines Defines the maximum number of lines allowed, before
127
+ * scrolling functionality is enabled.
128
+ */
129
+ setMaxLines(maxLines: number): void;
130
+ /**
131
+ * Returns the maxLines config of this field.
132
+ *
133
+ * @returns The maxLines config value.
134
+ */
135
+ getMaxLines(): number;
136
+ /**
137
+ * Handle key down to the editor. Override the text input definition of this
138
+ * so as to not close the editor when enter is typed in.
139
+ *
140
+ * @param e Keyboard event.
141
+ */
142
+ protected onHtmlInputKeyDown_(e: KeyboardEvent): void;
143
+ /**
144
+ * Construct a FieldMultilineInput from a JSON arg object,
145
+ * dereferencing any string table references.
146
+ *
147
+ * @param options A JSON object with options (text, and spellcheck).
148
+ * @returns The new field instance.
149
+ * @nocollapse
150
+ * @internal
151
+ */
152
+ static fromJson(options: FieldMultilineInputFromJsonConfig): FieldMultilineInput;
153
+ }
154
+ /**
155
+ * Config options for the multiline input field.
156
+ */
157
+ export interface FieldMultilineInputConfig extends FieldTextInputConfig {
158
+ maxLines?: number;
159
+ }
160
+ /**
161
+ * fromJson config options for the multiline input field.
162
+ */
163
+ export interface FieldMultilineInputFromJsonConfig extends FieldMultilineInputConfig {
164
+ text?: string;
165
+ }
166
+ /**
167
+ * A function that is called to validate changes to the field's value before
168
+ * they are set.
169
+ *
170
+ * @see {@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/validators#return_values}
171
+ * @param newValue The value to be validated.
172
+ * @returns One of three instructions for setting the new value: `T`, `null`,
173
+ * or `undefined`.
174
+ *
175
+ * - `T` to set this function's returned value instead of `newValue`.
176
+ *
177
+ * - `null` to invoke `doValueInvalid_` and not set a value.
178
+ *
179
+ * - `undefined` to set `newValue` as is.
180
+ */
181
+ export type FieldMultilineInputValidator = FieldTextInputValidator;
182
+ //# sourceMappingURL=field_multilineinput.d.ts.map
@@ -254,7 +254,7 @@ export declare class CodeGenerator {
254
254
  * @param _opt_thisOnly True to generate code for only this statement.
255
255
  * @returns Code with comments and subsequent blocks added.
256
256
  */
257
- scrub_(_block: Block, code: string, _opt_thisOnly?: boolean): string;
257
+ protected scrub_(_block: Block, code: string, _opt_thisOnly?: boolean): string;
258
258
  /**
259
259
  * Hook for code to run at end of code generation.
260
260
  * Subclasses may override this, e.g. to prepend the generated code with
package/core/gesture.d.ts CHANGED
@@ -86,8 +86,6 @@ export declare class Gesture {
86
86
  * is in progress.
87
87
  */
88
88
  private workspaceDragger;
89
- /** Whether the gesture is dragging or not. */
90
- private dragging;
91
89
  /** The flyout a gesture started in, if any. */
92
90
  private flyout;
93
91
  /** Boolean for sanity-checking that some code is only called once. */
package/core/grid.d.ts CHANGED
@@ -31,16 +31,8 @@ export declare class Grid {
31
31
  * dropped it will snap to the grid if snapping to the grid is enabled.
32
32
  */
33
33
  setSpacing(spacing: number): void;
34
- /**
35
- * Get the spacing of the grid points (in px).
36
- *
37
- * @returns The spacing of the grid points.
38
- */
39
- getSpacing(): number;
40
34
  /** Sets the length of the grid lines. */
41
35
  setLength(length: number): void;
42
- /** Get the length of the grid lines (in px). */
43
- getLength(): number;
44
36
  /**
45
37
  * Sets whether blocks should snap to the grid or not.
46
38
  *
@@ -51,11 +43,19 @@ export declare class Grid {
51
43
  */
52
44
  setSnapToGrid(snap: boolean): void;
53
45
  /**
54
- * Whether blocks should snap to the grid.
46
+ * Whether blocks should snap to the grid, based on the initial configuration.
55
47
  *
56
48
  * @returns True if blocks should snap, false otherwise.
49
+ * @internal
57
50
  */
58
51
  shouldSnap(): boolean;
52
+ /**
53
+ * Get the spacing of the grid points (in px).
54
+ *
55
+ * @returns The spacing of the grid points.
56
+ * @internal
57
+ */
58
+ getSpacing(): number;
59
59
  /**
60
60
  * Get the ID of the pattern element, which should be randomized to avoid
61
61
  * conflicts with other Blockly instances on the page.
@@ -16,7 +16,7 @@ import { Size } from '../utils/size.js';
16
16
  export declare class CommentIcon extends Icon implements IHasBubble, ISerializable {
17
17
  protected readonly sourceBlock: Block;
18
18
  /** The type string used to identify this icon. */
19
- static readonly TYPE: IconType<import("../interfaces/i_comment_icon.js").ICommentIcon>;
19
+ static readonly TYPE: IconType<CommentIcon>;
20
20
  /**
21
21
  * The weight this icon has relative to other icons. Icons with more positive
22
22
  * weight values are rendered farther toward the end of the block.
@@ -49,7 +49,7 @@ export declare class CommentIcon extends Icon implements IHasBubble, ISerializab
49
49
  * Updates the state of the bubble (editable / noneditable) to reflect the
50
50
  * state of the bubble if the bubble is currently shown.
51
51
  */
52
- updateEditable(): Promise<void>;
52
+ updateEditable(): void;
53
53
  onLocationChange(blockOrigin: Coordinate): void;
54
54
  /** Sets the text of this comment. Updates any bubbles if they are visible. */
55
55
  setText(text: string): void;
@@ -82,7 +82,7 @@ export declare class CommentIcon extends Icon implements IHasBubble, ISerializab
82
82
  */
83
83
  onSizeChange(): void;
84
84
  bubbleIsVisible(): boolean;
85
- setBubbleVisible(visible: boolean): Promise<void>;
85
+ setBubbleVisible(visible: boolean): void;
86
86
  /**
87
87
  * Shows the editable text bubble for this comment, and adds change listeners
88
88
  * to update the state of this icon in response to changes in the bubble.
@@ -59,5 +59,11 @@ export declare abstract class Icon implements IIcon {
59
59
  * @returns Whether the icon should be clickable while the block is in a flyout.
60
60
  */
61
61
  isClickableInFlyout(autoClosingFlyout: boolean): boolean;
62
+ /**
63
+ * Sets the visibility of the icon's bubble if one exists.
64
+ *
65
+ * @deprecated Use `setBubbleVisible` instead. To be removed in v11.
66
+ */
67
+ setVisible(visibility: boolean): void;
62
68
  }
63
69
  //# sourceMappingURL=icon.d.ts.map
@@ -3,8 +3,8 @@
3
3
  * Copyright 2023 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { ICommentIcon } from '../interfaces/i_comment_icon.js';
7
6
  import { IIcon } from '../interfaces/i_icon.js';
7
+ import { CommentIcon } from './comment_icon.js';
8
8
  import { MutatorIcon } from './mutator_icon.js';
9
9
  import { WarningIcon } from './warning_icon.js';
10
10
  /**
@@ -20,6 +20,6 @@ export declare class IconType<_T extends IIcon> {
20
20
  equals(type: IconType<IIcon>): boolean;
21
21
  static MUTATOR: IconType<MutatorIcon>;
22
22
  static WARNING: IconType<WarningIcon>;
23
- static COMMENT: IconType<ICommentIcon>;
23
+ static COMMENT: IconType<CommentIcon>;
24
24
  }
25
25
  //# sourceMappingURL=icon_types.d.ts.map
@@ -4,7 +4,9 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { Abstract } from '../events/events_abstract.js';
7
+ import type { Block } from '../block.js';
7
8
  import type { BlockSvg } from '../block_svg.js';
9
+ import type { Connection } from '../connection.js';
8
10
  import { Coordinate } from '../utils/coordinate.js';
9
11
  import type { IHasBubble } from '../interfaces/i_has_bubble.js';
10
12
  import { Icon } from './icon.js';
@@ -53,7 +55,7 @@ export declare class MutatorIcon extends Icon implements IHasBubble {
53
55
  onClick(): void;
54
56
  isClickableInFlyout(): boolean;
55
57
  bubbleIsVisible(): boolean;
56
- setBubbleVisible(visible: boolean): Promise<void>;
58
+ setBubbleVisible(visible: boolean): void;
57
59
  /** @returns the configuration the mini workspace should have. */
58
60
  private getMiniWorkspaceConfig;
59
61
  /**
@@ -89,5 +91,18 @@ export declare class MutatorIcon extends Icon implements IHasBubble {
89
91
  * currently open.
90
92
  */
91
93
  getWorkspace(): WorkspaceSvg | undefined;
94
+ /**
95
+ * Reconnects the given connection to the mutated input on the given block.
96
+ *
97
+ * @deprecated Use connection.reconnect instead. To be removed in v11.
98
+ */
99
+ static reconnect(connectionChild: Connection | null, block: Block, inputName: string): boolean;
100
+ /**
101
+ * Returns the parent workspace of a workspace that is inside a mini workspace
102
+ * bubble, taking into account whether the workspace is a flyout.
103
+ *
104
+ * @deprecated Use workspace.getRootWorkspace. To be removed in v11.
105
+ */
106
+ static findParentWs(workspace: WorkspaceSvg): WorkspaceSvg | null;
92
107
  }
93
108
  //# sourceMappingURL=mutator_icon.d.ts.map
@@ -59,7 +59,7 @@ export declare class WarningIcon extends Icon implements IHasBubble {
59
59
  onClick(): void;
60
60
  isClickableInFlyout(): boolean;
61
61
  bubbleIsVisible(): boolean;
62
- setBubbleVisible(visible: boolean): Promise<void>;
62
+ setBubbleVisible(visible: boolean): void;
63
63
  /**
64
64
  * @returns the location the bubble should be anchored to.
65
65
  * I.E. the middle of this icon.
@@ -15,14 +15,13 @@ import type { Connection } from '../connection.js';
15
15
  import type { ConnectionType } from '../connection_type.js';
16
16
  import type { Field } from '../field.js';
17
17
  import { inputTypes } from './input_types.js';
18
- import { Align } from './align.js';
19
18
  /** Class for an input with optional fields. */
20
19
  export declare class Input {
21
20
  name: string;
22
21
  private sourceBlock;
23
22
  fieldRow: Field[];
24
23
  /** Alignment of input's fields (left, right or centre). */
25
- align: Align;
24
+ align: Input.Align;
26
25
  /** Is the input visible? */
27
26
  private visible;
28
27
  readonly type: inputTypes;
@@ -122,14 +121,6 @@ export declare class Input {
122
121
  getShadowDom(): Element | null;
123
122
  /** Initialize the fields on this input. */
124
123
  init(): void;
125
- /**
126
- * Initializes the fields on this input for a headless block.
127
- *
128
- * @internal
129
- */
130
- initModel(): void;
131
- /** Initializes the given field. */
132
- private initField;
133
124
  /**
134
125
  * Sever all links to this input.
135
126
  */
@@ -144,4 +135,22 @@ export declare class Input {
144
135
  */
145
136
  protected makeConnection(type: ConnectionType): Connection;
146
137
  }
138
+ export declare namespace Input {
139
+ /**
140
+ * Enum for alignment of inputs.
141
+ *
142
+ * @deprecated Use Blockly.inputs.Align. To be removed in v11.
143
+ */
144
+ enum Align {
145
+ LEFT = -1,
146
+ CENTRE = 0,
147
+ RIGHT = 1
148
+ }
149
+ }
150
+ /** @deprecated Use Blockly.inputs.Align. To be removed in v11. */
151
+ /** @suppress {deprecated} */
152
+ export type Align = Input.Align;
153
+ /** @deprecated Use Blockly.inputs.Align. To be removed in v11. */
154
+ /** @suppress {deprecated} */
155
+ export declare const Align: typeof Input.Align;
147
156
  //# sourceMappingURL=input.d.ts.map
@@ -7,7 +7,7 @@ export interface IHasBubble {
7
7
  /** @returns True if the bubble is currently open, false otherwise. */
8
8
  bubbleIsVisible(): boolean;
9
9
  /** Sets whether the bubble is open or not. */
10
- setBubbleVisible(visible: boolean): Promise<void>;
10
+ setBubbleVisible(visible: boolean): void;
11
11
  }
12
12
  /** Type guard that checks whether the given object is a IHasBubble. */
13
13
  export declare function hasBubble(obj: any): obj is IHasBubble;