blockly 9.1.0 → 9.2.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.
- package/blockly.min.js +395 -349
- package/blockly_compressed.js +392 -346
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js +3 -3
- package/blocks_compressed.js.map +1 -1
- package/core/any_aliases.d.ts +1 -1
- package/core/block.d.ts +3 -1
- package/core/block_dragger.d.ts +3 -3
- package/core/block_svg.d.ts +2 -2
- package/core/blockly.d.ts +21 -26
- package/core/blockly_options.d.ts +1 -0
- package/core/blocks.d.ts +2 -2
- package/core/browser_events.d.ts +2 -4
- package/core/bubble.d.ts +8 -8
- package/core/bubble_dragger.d.ts +3 -3
- package/core/component_manager.d.ts +1 -1
- package/core/contextmenu_registry.d.ts +5 -5
- package/core/dropdowndiv.d.ts +8 -4
- package/core/events/events.d.ts +21 -1
- package/core/events/events_abstract.d.ts +14 -1
- package/core/events/events_block_base.d.ts +12 -1
- package/core/events/events_block_change.d.ts +11 -0
- package/core/events/events_block_create.d.ts +11 -0
- package/core/events/events_block_delete.d.ts +11 -0
- package/core/events/events_block_drag.d.ts +11 -0
- package/core/events/events_block_move.d.ts +14 -0
- package/core/events/events_bubble_open.d.ts +11 -0
- package/core/events/events_click.d.ts +11 -0
- package/core/events/events_comment_base.d.ts +11 -0
- package/core/events/events_comment_change.d.ts +11 -0
- package/core/events/events_comment_create.d.ts +11 -0
- package/core/events/events_comment_delete.d.ts +21 -1
- package/core/events/events_comment_move.d.ts +11 -0
- package/core/events/events_marker_move.d.ts +11 -0
- package/core/events/events_procedure_base.d.ts +26 -0
- package/core/events/events_procedure_change_return.d.ts +40 -0
- package/core/events/events_procedure_create.d.ts +34 -0
- package/core/events/events_procedure_delete.d.ts +32 -0
- package/core/events/events_procedure_enable.d.ts +34 -0
- package/core/events/events_procedure_parameter_base.d.ts +26 -0
- package/core/events/events_procedure_parameter_create.d.ts +42 -0
- package/core/events/events_procedure_parameter_delete.d.ts +41 -0
- package/core/events/events_procedure_parameter_rename.d.ts +36 -0
- package/core/events/events_procedure_rename.d.ts +35 -0
- package/core/events/events_selected.d.ts +11 -0
- package/core/events/events_theme_change.d.ts +11 -0
- package/core/events/events_toolbox_item_select.d.ts +11 -0
- package/core/events/events_trashcan_open.d.ts +11 -0
- package/core/events/events_var_base.d.ts +11 -0
- package/core/events/events_var_create.d.ts +11 -0
- package/core/events/events_var_delete.d.ts +11 -0
- package/core/events/events_var_rename.d.ts +11 -0
- package/core/events/events_viewport.d.ts +11 -0
- package/core/events/utils.d.ts +17 -1
- package/core/field.d.ts +20 -9
- package/core/field_angle.d.ts +6 -6
- package/core/field_checkbox.d.ts +4 -3
- package/core/field_colour.d.ts +4 -3
- package/core/field_dropdown.d.ts +7 -6
- package/core/field_image.d.ts +2 -2
- package/core/field_input.d.ts +229 -0
- package/core/field_label.d.ts +2 -2
- package/core/field_label_serializable.d.ts +1 -1
- package/core/field_multilineinput.d.ts +3 -2
- package/core/field_number.d.ts +7 -4
- package/core/field_registry.d.ts +8 -5
- package/core/field_textinput.d.ts +6 -201
- package/core/field_variable.d.ts +3 -2
- package/core/flyout_base.d.ts +3 -4
- package/core/flyout_button.d.ts +1 -1
- package/core/gesture.d.ts +127 -50
- package/core/icon.d.ts +4 -4
- package/core/input.d.ts +8 -7
- package/core/insertion_marker_manager.d.ts +80 -63
- package/core/interfaces/i_copyable.d.ts +1 -1
- package/core/interfaces/i_observable.d.ts +21 -0
- package/core/interfaces/i_parameter_model.d.ts +3 -5
- package/core/keyboard_nav/ast_node.d.ts +1 -1
- package/core/metrics_manager.d.ts +5 -5
- package/core/mutator.d.ts +7 -3
- package/core/names.d.ts +1 -1
- package/core/options.d.ts +5 -4
- package/core/procedures/observable_parameter_model.d.ts +17 -0
- package/core/procedures/observable_procedure_map.d.ts +1 -1
- package/core/procedures/observable_procedure_model.d.ts +13 -0
- package/core/procedures.d.ts +1 -1
- package/core/registry.d.ts +1 -1
- package/core/rendered_connection.d.ts +1 -1
- package/core/renderers/common/constants.d.ts +3 -3
- package/core/serialization/procedures.d.ts +26 -2
- package/core/shortcut_registry.d.ts +1 -1
- package/core/theme.d.ts +4 -4
- package/core/theme_manager.d.ts +1 -1
- package/core/toolbox/category.d.ts +1 -1
- package/core/toolbox/collapsible_category.d.ts +1 -1
- package/core/toolbox/separator.d.ts +1 -1
- package/core/toolbox/toolbox.d.ts +1 -1
- package/core/tooltip.d.ts +2 -2
- package/core/touch.d.ts +12 -17
- package/core/utils/toolbox.d.ts +7 -7
- package/core/workspace_comment_svg.d.ts +18 -17
- package/core/workspace_svg.d.ts +13 -15
- package/core.js +4 -3
- package/msg/bs.js +12 -12
- package/msg/de.js +6 -6
- package/msg/diq.js +6 -6
- package/msg/es.js +15 -15
- package/msg/fr.js +2 -2
- package/msg/he.js +1 -1
- package/msg/hy.js +43 -43
- package/msg/is.js +17 -17
- package/msg/ja.js +1 -1
- package/msg/ko.js +3 -3
- package/msg/nb.js +1 -1
- package/msg/oc.js +2 -2
- package/msg/smn.js +24 -24
- package/msg/zh-hant.js +10 -10
- package/package.json +7 -6
- package/core/interfaces/i_registrable_field.d.ts +0 -19
- package/core/touch_gesture.d.ts +0 -130
package/core/field_number.d.ts
CHANGED
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
* Copyright 2016 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { FieldInput, FieldInputConfig, FieldInputValidator } from './field_input.js';
|
|
7
7
|
import type { Sentinel } from './utils/sentinel.js';
|
|
8
|
+
export type FieldNumberValidator = FieldInputValidator<number>;
|
|
8
9
|
/**
|
|
9
10
|
* Class for an editable number field.
|
|
10
11
|
*
|
|
11
12
|
* @alias Blockly.FieldNumber
|
|
12
13
|
*/
|
|
13
|
-
export declare class FieldNumber extends
|
|
14
|
+
export declare class FieldNumber extends FieldInput<number> {
|
|
14
15
|
/** The minimum value this number field can contain. */
|
|
15
16
|
protected min_: number;
|
|
16
17
|
/** The maximum value this number field can contain. */
|
|
@@ -27,6 +28,8 @@ export declare class FieldNumber extends FieldTextInput {
|
|
|
27
28
|
* are not. Editable fields should also be serializable.
|
|
28
29
|
*/
|
|
29
30
|
SERIALIZABLE: boolean;
|
|
31
|
+
/** Don't spellcheck numbers. Our validator does a better job. */
|
|
32
|
+
protected spellcheck_: boolean;
|
|
30
33
|
/**
|
|
31
34
|
* @param opt_value The initial value of the field. Should cast to a number.
|
|
32
35
|
* Defaults to 0. Also accepts Field.SKIP_SETUP if you wish to skip setup
|
|
@@ -46,7 +49,7 @@ export declare class FieldNumber extends FieldTextInput {
|
|
|
46
49
|
* https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/number#creation}
|
|
47
50
|
* for a list of properties this parameter supports.
|
|
48
51
|
*/
|
|
49
|
-
constructor(opt_value?: string | number | Sentinel, opt_min?: string | number | null, opt_max?: string | number | null, opt_precision?: string | number | null, opt_validator?:
|
|
52
|
+
constructor(opt_value?: string | number | Sentinel, opt_min?: string | number | null, opt_max?: string | number | null, opt_precision?: string | number | null, opt_validator?: FieldNumberValidator | null, opt_config?: FieldNumberConfig);
|
|
50
53
|
/**
|
|
51
54
|
* Configure the field based on the given map of options.
|
|
52
55
|
*
|
|
@@ -158,7 +161,7 @@ export declare class FieldNumber extends FieldTextInput {
|
|
|
158
161
|
/**
|
|
159
162
|
* Config options for the number field.
|
|
160
163
|
*/
|
|
161
|
-
export interface FieldNumberConfig extends
|
|
164
|
+
export interface FieldNumberConfig extends FieldInputConfig {
|
|
162
165
|
min?: number;
|
|
163
166
|
max?: number;
|
|
164
167
|
precision?: number;
|
package/core/field_registry.d.ts
CHANGED
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import type { Field } from './field.js';
|
|
7
|
-
|
|
6
|
+
import type { Field, FieldProto } from './field.js';
|
|
7
|
+
interface RegistryOptions {
|
|
8
|
+
type: string;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
8
11
|
/**
|
|
9
12
|
* Registers a field type.
|
|
10
13
|
* fieldRegistry.fromJson uses this registry to
|
|
@@ -17,7 +20,7 @@ import type { IRegistrableField } from './interfaces/i_registrable_field.js';
|
|
|
17
20
|
* or the fieldClass is not an object containing a fromJson function.
|
|
18
21
|
* @alias Blockly.fieldRegistry.register
|
|
19
22
|
*/
|
|
20
|
-
export declare function register(type: string, fieldClass:
|
|
23
|
+
export declare function register(type: string, fieldClass: FieldProto): void;
|
|
21
24
|
/**
|
|
22
25
|
* Unregisters the field registered with the given type.
|
|
23
26
|
*
|
|
@@ -37,13 +40,13 @@ export declare function unregister(type: string): void;
|
|
|
37
40
|
* @alias Blockly.fieldRegistry.fromJson
|
|
38
41
|
* @internal
|
|
39
42
|
*/
|
|
40
|
-
export declare function fromJson(options:
|
|
43
|
+
export declare function fromJson<T>(options: RegistryOptions): Field<T> | null;
|
|
41
44
|
/**
|
|
42
45
|
* Private version of fromJson for stubbing in tests.
|
|
43
46
|
*
|
|
44
47
|
* @param options
|
|
45
48
|
*/
|
|
46
|
-
declare function fromJsonInternal(options:
|
|
49
|
+
declare function fromJsonInternal<T>(options: RegistryOptions): Field<T> | null;
|
|
47
50
|
export declare const TEST_ONLY: {
|
|
48
51
|
fromJsonInternal: typeof fromJsonInternal;
|
|
49
52
|
};
|
|
@@ -4,51 +4,10 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import './events/events_block_change.js';
|
|
7
|
-
import {
|
|
7
|
+
import { FieldInput, FieldInputConfig, FieldInputValidator } from './field_input.js';
|
|
8
8
|
import type { Sentinel } from './utils/sentinel.js';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* Class for an editable text field.
|
|
12
|
-
*
|
|
13
|
-
* @alias Blockly.FieldTextInput
|
|
14
|
-
*/
|
|
15
|
-
export declare class FieldTextInput extends Field {
|
|
16
|
-
/**
|
|
17
|
-
* Pixel size of input border radius.
|
|
18
|
-
* Should match blocklyText's border-radius in CSS.
|
|
19
|
-
*/
|
|
20
|
-
static BORDERRADIUS: number;
|
|
21
|
-
/** Allow browser to spellcheck this field. */
|
|
22
|
-
protected spellcheck_: boolean;
|
|
23
|
-
/** The HTML input element. */
|
|
24
|
-
protected htmlInput_: HTMLInputElement | null;
|
|
25
|
-
/** True if the field's value is currently being edited via the UI. */
|
|
26
|
-
protected isBeingEdited_: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* True if the value currently displayed in the field's editory UI is valid.
|
|
29
|
-
*/
|
|
30
|
-
protected isTextValid_: boolean;
|
|
31
|
-
/** Key down event data. */
|
|
32
|
-
private onKeyDownWrapper_;
|
|
33
|
-
/** Key input event data. */
|
|
34
|
-
private onKeyInputWrapper_;
|
|
35
|
-
/**
|
|
36
|
-
* Whether the field should consider the whole parent block to be its click
|
|
37
|
-
* target.
|
|
38
|
-
*/
|
|
39
|
-
fullBlockClickTarget_: boolean | null;
|
|
40
|
-
/** The workspace that this field belongs to. */
|
|
41
|
-
protected workspace_: WorkspaceSvg | null;
|
|
42
|
-
/**
|
|
43
|
-
* Serializable fields are saved by the serializer, non-serializable fields
|
|
44
|
-
* are not. Editable fields should also be serializable.
|
|
45
|
-
*/
|
|
46
|
-
SERIALIZABLE: boolean;
|
|
47
|
-
/** Mouse cursor style when over the hotspot that initiates the editor. */
|
|
48
|
-
CURSOR: string;
|
|
49
|
-
clickTarget_: any;
|
|
50
|
-
value_: any;
|
|
51
|
-
isDirty_: any;
|
|
9
|
+
export type FieldTextInputValidator = FieldInputValidator<string>;
|
|
10
|
+
export declare class FieldTextInput extends FieldInput<string> {
|
|
52
11
|
/**
|
|
53
12
|
* @param opt_value The initial value of the field. Should cast to a string.
|
|
54
13
|
* Defaults to an empty string if null or undefined. Also accepts
|
|
@@ -63,156 +22,7 @@ export declare class FieldTextInput extends Field {
|
|
|
63
22
|
* https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/text-input#creation}
|
|
64
23
|
* for a list of properties this parameter supports.
|
|
65
24
|
*/
|
|
66
|
-
constructor(opt_value?: string | Sentinel, opt_validator?:
|
|
67
|
-
protected configure_(config: FieldTextInputConfig): void;
|
|
68
|
-
/** @internal */
|
|
69
|
-
initView(): void;
|
|
70
|
-
/**
|
|
71
|
-
* Ensure that the input value casts to a valid string.
|
|
72
|
-
*
|
|
73
|
-
* @param opt_newValue The input value.
|
|
74
|
-
* @returns A valid string, or null if invalid.
|
|
75
|
-
*/
|
|
76
|
-
protected doClassValidation_(opt_newValue?: any): any;
|
|
77
|
-
/**
|
|
78
|
-
* Called by setValue if the text input is not valid. If the field is
|
|
79
|
-
* currently being edited it reverts value of the field to the previous
|
|
80
|
-
* value while allowing the display text to be handled by the htmlInput_.
|
|
81
|
-
*
|
|
82
|
-
* @param _invalidValue The input value that was determined to be invalid.
|
|
83
|
-
* This is not used by the text input because its display value is stored
|
|
84
|
-
* on the htmlInput_.
|
|
85
|
-
*/
|
|
86
|
-
protected doValueInvalid_(_invalidValue: any): void;
|
|
87
|
-
/**
|
|
88
|
-
* Called by setValue if the text input is valid. Updates the value of the
|
|
89
|
-
* field, and updates the text of the field if it is not currently being
|
|
90
|
-
* edited (i.e. handled by the htmlInput_).
|
|
91
|
-
*
|
|
92
|
-
* @param newValue The value to be saved. The default validator guarantees
|
|
93
|
-
* that this is a string.
|
|
94
|
-
*/
|
|
95
|
-
protected doValueUpdate_(newValue: any): void;
|
|
96
|
-
/**
|
|
97
|
-
* Updates text field to match the colour/style of the block.
|
|
98
|
-
*
|
|
99
|
-
* @internal
|
|
100
|
-
*/
|
|
101
|
-
applyColour(): void;
|
|
102
|
-
/**
|
|
103
|
-
* Updates the colour of the htmlInput given the current validity of the
|
|
104
|
-
* field's value.
|
|
105
|
-
*/
|
|
106
|
-
protected render_(): void;
|
|
107
|
-
/**
|
|
108
|
-
* Set whether this field is spellchecked by the browser.
|
|
109
|
-
*
|
|
110
|
-
* @param check True if checked.
|
|
111
|
-
*/
|
|
112
|
-
setSpellcheck(check: boolean): void;
|
|
113
|
-
/**
|
|
114
|
-
* Show the inline free-text editor on top of the text.
|
|
115
|
-
*
|
|
116
|
-
* @param _opt_e Optional mouse event that triggered the field to open, or
|
|
117
|
-
* undefined if triggered programmatically.
|
|
118
|
-
* @param opt_quietInput True if editor should be created without focus.
|
|
119
|
-
* Defaults to false.
|
|
120
|
-
*/
|
|
121
|
-
protected showEditor_(_opt_e?: Event, opt_quietInput?: boolean): void;
|
|
122
|
-
/**
|
|
123
|
-
* Create and show a text input editor that is a prompt (usually a popup).
|
|
124
|
-
* Mobile browsers have issues with in-line textareas (focus and keyboards).
|
|
125
|
-
*/
|
|
126
|
-
private showPromptEditor_;
|
|
127
|
-
/**
|
|
128
|
-
* Create and show a text input editor that sits directly over the text input.
|
|
129
|
-
*
|
|
130
|
-
* @param quietInput True if editor should be created without focus.
|
|
131
|
-
*/
|
|
132
|
-
private showInlineEditor_;
|
|
133
|
-
/**
|
|
134
|
-
* Create the text input editor widget.
|
|
135
|
-
*
|
|
136
|
-
* @returns The newly created text input editor.
|
|
137
|
-
*/
|
|
138
|
-
protected widgetCreate_(): HTMLElement;
|
|
139
|
-
/**
|
|
140
|
-
* Closes the editor, saves the results, and disposes of any events or
|
|
141
|
-
* DOM-references belonging to the editor.
|
|
142
|
-
*/
|
|
143
|
-
protected widgetDispose_(): void;
|
|
144
|
-
/**
|
|
145
|
-
* A callback triggered when the user is done editing the field via the UI.
|
|
146
|
-
*
|
|
147
|
-
* @param _value The new value of the field.
|
|
148
|
-
*/
|
|
149
|
-
onFinishEditing_(_value: any): void;
|
|
150
|
-
/**
|
|
151
|
-
* Bind handlers for user input on the text input field's editor.
|
|
152
|
-
*
|
|
153
|
-
* @param htmlInput The htmlInput to which event handlers will be bound.
|
|
154
|
-
*/
|
|
155
|
-
protected bindInputEvents_(htmlInput: HTMLElement): void;
|
|
156
|
-
/** Unbind handlers for user input and workspace size changes. */
|
|
157
|
-
protected unbindInputEvents_(): void;
|
|
158
|
-
/**
|
|
159
|
-
* Handle key down to the editor.
|
|
160
|
-
*
|
|
161
|
-
* @param e Keyboard event.
|
|
162
|
-
*/
|
|
163
|
-
protected onHtmlInputKeyDown_(e: Event): void;
|
|
164
|
-
/**
|
|
165
|
-
* Handle a change to the editor.
|
|
166
|
-
*
|
|
167
|
-
* @param _e Keyboard event.
|
|
168
|
-
*/
|
|
169
|
-
private onHtmlInputChange_;
|
|
170
|
-
/**
|
|
171
|
-
* Set the HTML input value and the field's internal value. The difference
|
|
172
|
-
* between this and `setValue` is that this also updates the HTML input
|
|
173
|
-
* value whilst editing.
|
|
174
|
-
*
|
|
175
|
-
* @param newValue New value.
|
|
176
|
-
*/
|
|
177
|
-
protected setEditorValue_(newValue: any): void;
|
|
178
|
-
/** Resize the editor to fit the text. */
|
|
179
|
-
protected resizeEditor_(): void;
|
|
180
|
-
/**
|
|
181
|
-
* Returns whether or not the field is tab navigable.
|
|
182
|
-
*
|
|
183
|
-
* @returns True if the field is tab navigable.
|
|
184
|
-
*/
|
|
185
|
-
isTabNavigable(): boolean;
|
|
186
|
-
/**
|
|
187
|
-
* Use the `getText_` developer hook to override the field's text
|
|
188
|
-
* representation. When we're currently editing, return the current HTML value
|
|
189
|
-
* instead. Otherwise, return null which tells the field to use the default
|
|
190
|
-
* behaviour (which is a string cast of the field's value).
|
|
191
|
-
*
|
|
192
|
-
* @returns The HTML value if we're editing, otherwise null.
|
|
193
|
-
*/
|
|
194
|
-
protected getText_(): string | null;
|
|
195
|
-
/**
|
|
196
|
-
* Transform the provided value into a text to show in the HTML input.
|
|
197
|
-
* Override this method if the field's HTML input representation is different
|
|
198
|
-
* than the field's value. This should be coupled with an override of
|
|
199
|
-
* `getValueFromEditorText_`.
|
|
200
|
-
*
|
|
201
|
-
* @param value The value stored in this field.
|
|
202
|
-
* @returns The text to show on the HTML input.
|
|
203
|
-
*/
|
|
204
|
-
protected getEditorText_(value: any): string;
|
|
205
|
-
/**
|
|
206
|
-
* Transform the text received from the HTML input into a value to store
|
|
207
|
-
* in this field.
|
|
208
|
-
* Override this method if the field's HTML input representation is different
|
|
209
|
-
* than the field's value. This should be coupled with an override of
|
|
210
|
-
* `getEditorText_`.
|
|
211
|
-
*
|
|
212
|
-
* @param text Text received from the HTML input.
|
|
213
|
-
* @returns The value to store.
|
|
214
|
-
*/
|
|
215
|
-
protected getValueFromEditorText_(text: string): any;
|
|
25
|
+
constructor(opt_value?: string | Sentinel, opt_validator?: FieldTextInputValidator | null, opt_config?: FieldInputConfig);
|
|
216
26
|
/**
|
|
217
27
|
* Construct a FieldTextInput from a JSON arg object,
|
|
218
28
|
* dereferencing any string table references.
|
|
@@ -224,16 +34,11 @@ export declare class FieldTextInput extends Field {
|
|
|
224
34
|
*/
|
|
225
35
|
static fromJson(options: FieldTextInputFromJsonConfig): FieldTextInput;
|
|
226
36
|
}
|
|
227
|
-
/**
|
|
228
|
-
* Config options for the text input field.
|
|
229
|
-
*/
|
|
230
|
-
export interface FieldTextInputConfig extends FieldConfig {
|
|
231
|
-
spellcheck?: boolean;
|
|
232
|
-
}
|
|
233
37
|
/**
|
|
234
38
|
* fromJson config options for the text input field.
|
|
235
39
|
*/
|
|
236
|
-
export interface FieldTextInputFromJsonConfig extends
|
|
40
|
+
export interface FieldTextInputFromJsonConfig extends FieldInputConfig {
|
|
237
41
|
text?: string;
|
|
238
42
|
}
|
|
43
|
+
export { FieldInputConfig as FieldTextInputConfig };
|
|
239
44
|
//# sourceMappingURL=field_textinput.d.ts.map
|
package/core/field_variable.d.ts
CHANGED
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
import './events/events_block_change.js';
|
|
7
7
|
import type { Block } from './block.js';
|
|
8
8
|
import { FieldConfig } from './field.js';
|
|
9
|
-
import { FieldDropdown, MenuGenerator, MenuOption } from './field_dropdown.js';
|
|
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
12
|
import type { Sentinel } from './utils/sentinel.js';
|
|
13
13
|
import { Size } from './utils/size.js';
|
|
14
14
|
import { VariableModel } from './variable_model.js';
|
|
15
|
+
export type FieldVariableValidator = FieldDropdownValidator;
|
|
15
16
|
/**
|
|
16
17
|
* Class for a variable's dropdown field.
|
|
17
18
|
*
|
|
@@ -54,7 +55,7 @@ export declare class FieldVariable extends FieldDropdown {
|
|
|
54
55
|
* https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/variable#creation}
|
|
55
56
|
* for a list of properties this parameter supports.
|
|
56
57
|
*/
|
|
57
|
-
constructor(varName: string | null | Sentinel, opt_validator?:
|
|
58
|
+
constructor(varName: string | null | Sentinel, opt_validator?: FieldVariableValidator, opt_variableTypes?: string[], opt_defaultType?: string, opt_config?: FieldVariableConfig);
|
|
58
59
|
/**
|
|
59
60
|
* Configure the field based on the given map of options.
|
|
60
61
|
*
|
package/core/flyout_base.d.ts
CHANGED
|
@@ -252,7 +252,6 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
|
|
|
252
252
|
* Get the workspace inside the flyout.
|
|
253
253
|
*
|
|
254
254
|
* @returns The workspace inside the flyout.
|
|
255
|
-
* @internal
|
|
256
255
|
*/
|
|
257
256
|
getWorkspace(): WorkspaceSvg;
|
|
258
257
|
/**
|
|
@@ -396,16 +395,16 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
|
|
|
396
395
|
*/
|
|
397
396
|
protected addBlockListeners_(root: SVGElement, block: BlockSvg, rect: SVGElement): void;
|
|
398
397
|
/**
|
|
399
|
-
* Handle a
|
|
398
|
+
* Handle a pointerdown on an SVG block in a non-closing flyout.
|
|
400
399
|
*
|
|
401
400
|
* @param block The flyout block to copy.
|
|
402
401
|
* @returns Function to call when block is clicked.
|
|
403
402
|
*/
|
|
404
403
|
private blockMouseDown_;
|
|
405
404
|
/**
|
|
406
|
-
*
|
|
405
|
+
* Pointer down on the flyout background. Start a vertical scroll drag.
|
|
407
406
|
*
|
|
408
|
-
* @param e
|
|
407
|
+
* @param e Pointer down event.
|
|
409
408
|
*/
|
|
410
409
|
private onMouseDown_;
|
|
411
410
|
/**
|