blockly 9.3.0-beta.0 → 9.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blockly.min.js +1674 -1520
- package/blockly_compressed.js +1313 -1152
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js +166 -173
- package/blocks_compressed.js.map +1 -1
- package/core/any_aliases.d.ts +5 -0
- package/core/block.d.ts +49 -17
- package/core/block_animations.d.ts +0 -4
- package/core/block_drag_surface.d.ts +135 -0
- package/core/block_dragger.d.ts +2 -7
- package/core/block_svg.d.ts +72 -9
- package/core/blockly.d.ts +29 -58
- package/core/blockly_options.d.ts +0 -2
- package/core/blocks.d.ts +0 -2
- package/core/browser_events.d.ts +0 -9
- package/core/bubble.d.ts +6 -4
- package/core/bubble_dragger.d.ts +2 -3
- package/core/bump_objects.d.ts +0 -3
- package/core/clipboard.d.ts +0 -3
- package/core/comment.d.ts +6 -10
- package/core/common.d.ts +0 -12
- package/core/component_manager.d.ts +0 -2
- package/core/connection.d.ts +19 -6
- package/core/connection_checker.d.ts +1 -3
- package/core/connection_db.d.ts +0 -2
- package/core/connection_type.d.ts +0 -2
- package/core/constants.d.ts +0 -4
- package/core/contextmenu.d.ts +0 -11
- package/core/contextmenu_items.d.ts +0 -27
- package/core/contextmenu_registry.d.ts +0 -2
- package/core/css.d.ts +0 -2
- package/core/delete_area.d.ts +0 -2
- package/core/dialog.d.ts +0 -6
- package/core/drag_target.d.ts +0 -2
- package/core/events/events_abstract.d.ts +0 -3
- package/core/events/events_block_base.d.ts +0 -2
- package/core/events/events_block_change.d.ts +0 -2
- package/core/events/events_block_create.d.ts +0 -2
- package/core/events/events_block_delete.d.ts +0 -2
- package/core/events/events_block_drag.d.ts +0 -2
- package/core/events/events_block_move.d.ts +0 -2
- package/core/events/events_bubble_open.d.ts +0 -2
- package/core/events/events_click.d.ts +0 -2
- package/core/events/events_comment_base.d.ts +0 -2
- package/core/events/events_comment_change.d.ts +0 -2
- package/core/events/events_comment_create.d.ts +0 -2
- package/core/events/events_comment_delete.d.ts +0 -2
- package/core/events/events_comment_move.d.ts +0 -2
- package/core/events/events_marker_move.d.ts +0 -2
- package/core/events/events_selected.d.ts +0 -2
- package/core/events/events_theme_change.d.ts +0 -2
- package/core/events/events_toolbox_item_select.d.ts +0 -2
- package/core/events/events_trashcan_open.d.ts +0 -2
- package/core/events/events_ui.d.ts +0 -1
- package/core/events/events_ui_base.d.ts +0 -2
- package/core/events/events_var_base.d.ts +0 -2
- package/core/events/events_var_create.d.ts +0 -2
- package/core/events/events_viewport.d.ts +0 -2
- package/core/events/utils.d.ts +0 -73
- package/core/events/workspace_events.d.ts +0 -2
- package/core/extensions.d.ts +0 -8
- package/core/field.d.ts +16 -15
- package/core/field_angle.d.ts +60 -50
- package/core/field_checkbox.d.ts +22 -10
- package/core/field_colour.d.ts +55 -42
- package/core/field_dropdown.d.ts +34 -18
- package/core/field_image.d.ts +9 -12
- package/core/field_input.d.ts +34 -11
- package/core/field_label.d.ts +7 -10
- package/core/field_label_serializable.d.ts +4 -6
- package/core/field_multilineinput.d.ts +34 -12
- package/core/field_number.d.ts +27 -19
- package/core/field_registry.d.ts +0 -3
- package/core/field_textinput.d.ts +28 -12
- package/core/field_variable.d.ts +28 -16
- package/core/flyout_base.d.ts +5 -6
- package/core/flyout_button.d.ts +2 -2
- package/core/flyout_horizontal.d.ts +0 -2
- package/core/flyout_metrics_manager.d.ts +0 -2
- package/core/flyout_vertical.d.ts +0 -2
- package/core/generator.d.ts +0 -1
- package/core/gesture.d.ts +4 -17
- package/core/grid.d.ts +0 -2
- package/core/icon.d.ts +0 -2
- package/core/inject.d.ts +0 -1
- package/core/input.d.ts +0 -3
- package/core/input_types.d.ts +0 -2
- package/core/insertion_marker_manager.d.ts +6 -6
- package/core/interfaces/i_ast_node_location.d.ts +0 -2
- package/core/interfaces/i_ast_node_location_svg.d.ts +0 -2
- package/core/interfaces/i_ast_node_location_with_block.d.ts +0 -2
- package/core/interfaces/i_autohideable.d.ts +0 -2
- package/core/interfaces/i_block_dragger.d.ts +1 -3
- package/core/interfaces/i_bounded_element.d.ts +0 -2
- package/core/interfaces/i_bubble.d.ts +6 -4
- package/core/interfaces/i_collapsible_toolbox_item.d.ts +0 -2
- package/core/interfaces/i_component.d.ts +0 -2
- package/core/interfaces/i_connection_checker.d.ts +0 -2
- package/core/interfaces/i_contextmenu.d.ts +0 -1
- package/core/interfaces/i_copyable.d.ts +3 -2
- package/core/interfaces/i_deletable.d.ts +0 -2
- package/core/interfaces/i_delete_area.d.ts +0 -2
- package/core/interfaces/i_drag_target.d.ts +0 -2
- package/core/interfaces/i_draggable.d.ts +0 -2
- package/core/interfaces/i_flyout.d.ts +0 -2
- package/core/interfaces/i_keyboard_accessible.d.ts +0 -2
- package/core/interfaces/i_legacy_procedure_blocks.d.ts +34 -0
- package/core/interfaces/i_metrics_manager.d.ts +0 -2
- package/core/interfaces/i_movable.d.ts +0 -2
- package/core/interfaces/i_positionable.d.ts +0 -2
- package/core/interfaces/i_procedure_model.d.ts +0 -5
- package/core/interfaces/i_registrable.d.ts +0 -2
- package/core/interfaces/i_selectable.d.ts +0 -2
- package/core/interfaces/i_selectable_toolbox_item.d.ts +4 -2
- package/core/interfaces/i_serializer.d.ts +0 -2
- package/core/interfaces/i_styleable.d.ts +0 -2
- package/core/interfaces/i_toolbox.d.ts +0 -2
- package/core/interfaces/i_toolbox_item.d.ts +0 -2
- package/core/interfaces/i_variable_backed_parameter_model.d.ts +17 -0
- package/core/internal_constants.d.ts +0 -5
- package/core/keyboard_nav/ast_node.d.ts +0 -3
- package/core/keyboard_nav/basic_cursor.d.ts +0 -3
- package/core/keyboard_nav/cursor.d.ts +0 -3
- package/core/keyboard_nav/marker.d.ts +0 -2
- package/core/keyboard_nav/tab_navigate_cursor.d.ts +0 -2
- package/core/marker_manager.d.ts +0 -2
- package/core/menu.d.ts +0 -2
- package/core/menuitem.d.ts +0 -2
- package/core/metrics_manager.d.ts +0 -2
- package/core/mutator.d.ts +0 -2
- package/core/names.d.ts +0 -3
- package/core/options.d.ts +0 -2
- package/core/positionable_helpers.d.ts +0 -7
- package/core/procedures.d.ts +2 -25
- package/core/registry.d.ts +0 -11
- package/core/render_management.d.ts +15 -0
- package/core/rendered_connection.d.ts +22 -9
- package/core/renderers/common/block_rendering.d.ts +0 -3
- package/core/renderers/common/constants.d.ts +6 -51
- package/core/renderers/common/debug.d.ts +0 -3
- package/core/renderers/common/debugger.d.ts +9 -23
- package/core/renderers/common/drawer.d.ts +0 -5
- package/core/renderers/common/i_path_object.d.ts +0 -17
- package/core/renderers/common/info.d.ts +2 -12
- package/core/renderers/common/marker_svg.d.ts +2 -4
- package/core/renderers/common/path_object.d.ts +0 -24
- package/core/renderers/common/renderer.d.ts +5 -20
- package/core/renderers/geras/constants.d.ts +0 -5
- package/core/renderers/geras/drawer.d.ts +2 -4
- package/core/renderers/geras/highlight_constants.d.ts +6 -17
- package/core/renderers/geras/highlighter.d.ts +0 -13
- package/core/renderers/geras/info.d.ts +2 -5
- package/core/renderers/geras/measurables/inline_input.d.ts +0 -3
- package/core/renderers/geras/measurables/statement_input.d.ts +0 -3
- package/core/renderers/geras/path_object.d.ts +0 -8
- package/core/renderers/geras/renderer.d.ts +5 -7
- package/core/renderers/measurables/base.d.ts +0 -3
- package/core/renderers/measurables/bottom_row.d.ts +0 -9
- package/core/renderers/measurables/connection.d.ts +0 -3
- package/core/renderers/measurables/external_value_input.d.ts +0 -3
- package/core/renderers/measurables/field.d.ts +0 -3
- package/core/renderers/measurables/hat.d.ts +0 -3
- package/core/renderers/measurables/icon.d.ts +2 -5
- package/core/renderers/measurables/in_row_spacer.d.ts +0 -3
- package/core/renderers/measurables/inline_input.d.ts +1 -4
- package/core/renderers/measurables/input_connection.d.ts +1 -4
- package/core/renderers/measurables/input_row.d.ts +0 -7
- package/core/renderers/measurables/jagged_edge.d.ts +2 -5
- package/core/renderers/measurables/next_connection.d.ts +0 -3
- package/core/renderers/measurables/output_connection.d.ts +0 -3
- package/core/renderers/measurables/previous_connection.d.ts +0 -3
- package/core/renderers/measurables/round_corner.d.ts +0 -3
- package/core/renderers/measurables/row.d.ts +0 -39
- package/core/renderers/measurables/spacer_row.d.ts +0 -3
- package/core/renderers/measurables/square_corner.d.ts +0 -3
- package/core/renderers/measurables/statement_input.d.ts +0 -3
- package/core/renderers/measurables/top_row.d.ts +0 -6
- package/core/renderers/measurables/types.d.ts +0 -31
- package/core/renderers/minimalist/constants.d.ts +2 -4
- package/core/renderers/minimalist/drawer.d.ts +0 -3
- package/core/renderers/minimalist/info.d.ts +0 -4
- package/core/renderers/minimalist/renderer.d.ts +0 -3
- package/core/renderers/thrasos/info.d.ts +0 -4
- package/core/renderers/thrasos/renderer.d.ts +3 -3
- package/core/renderers/zelos/constants.d.ts +3 -17
- package/core/renderers/zelos/drawer.d.ts +0 -3
- package/core/renderers/zelos/info.d.ts +0 -4
- package/core/renderers/zelos/marker_svg.d.ts +0 -2
- package/core/renderers/zelos/measurables/bottom_row.d.ts +0 -3
- package/core/renderers/zelos/measurables/inputs.d.ts +0 -3
- package/core/renderers/zelos/measurables/row_elements.d.ts +0 -3
- package/core/renderers/zelos/measurables/top_row.d.ts +0 -3
- package/core/renderers/zelos/path_object.d.ts +0 -9
- package/core/renderers/zelos/renderer.d.ts +3 -5
- package/core/scrollbar.d.ts +0 -2
- package/core/scrollbar_pair.d.ts +0 -2
- package/core/serialization/blocks.d.ts +3 -9
- package/core/serialization/exceptions.d.ts +0 -8
- package/core/serialization/priorities.d.ts +0 -4
- package/core/serialization/registry.d.ts +0 -2
- package/core/serialization/variables.d.ts +0 -4
- package/core/serialization/workspaces.d.ts +0 -2
- package/core/shortcut_items.d.ts +0 -17
- package/core/shortcut_registry.d.ts +0 -2
- package/core/sprites.d.ts +0 -2
- package/core/theme/classic.d.ts +0 -2
- package/core/theme/zelos.d.ts +0 -2
- package/core/theme.d.ts +0 -2
- package/core/theme_manager.d.ts +3 -6
- package/core/toolbox/category.d.ts +5 -7
- package/core/toolbox/collapsible_category.d.ts +0 -4
- package/core/toolbox/separator.d.ts +0 -2
- package/core/toolbox/toolbox.d.ts +2 -5
- package/core/toolbox/toolbox_item.d.ts +0 -2
- package/core/tooltip.d.ts +0 -29
- package/core/touch.d.ts +0 -13
- package/core/trashcan.d.ts +0 -2
- package/core/utils/aria.d.ts +0 -6
- package/core/utils/array.d.ts +0 -1
- package/core/utils/colour.d.ts +0 -12
- package/core/utils/coordinate.d.ts +0 -2
- package/core/utils/deprecation.d.ts +0 -1
- package/core/utils/dom.d.ts +0 -25
- package/core/utils/idgenerator.d.ts +0 -2
- package/core/utils/keycodes.d.ts +0 -2
- package/core/utils/math.d.ts +0 -3
- package/core/utils/metrics.d.ts +0 -1
- package/core/utils/object.d.ts +0 -4
- package/core/utils/parsing.d.ts +0 -4
- package/core/utils/rect.d.ts +0 -2
- package/core/utils/size.d.ts +0 -2
- package/core/utils/string.d.ts +0 -6
- package/core/utils/style.d.ts +0 -8
- package/core/utils/svg.d.ts +0 -2
- package/core/utils/svg_math.d.ts +0 -6
- package/core/utils/svg_paths.d.ts +0 -8
- package/core/utils/toolbox.d.ts +2 -35
- package/core/utils/useragent.d.ts +0 -8
- package/core/utils/xml.d.ts +9 -8
- package/core/utils.d.ts +0 -12
- package/core/variable_map.d.ts +1 -3
- package/core/variable_model.d.ts +0 -1
- package/core/variables.d.ts +13 -17
- package/core/variables_dynamic.d.ts +0 -4
- package/core/warning.d.ts +0 -2
- package/core/widgetdiv.d.ts +0 -10
- package/core/workspace.d.ts +3 -3
- package/core/workspace_audio.d.ts +0 -2
- package/core/workspace_comment.d.ts +1 -3
- package/core/workspace_comment_svg.d.ts +16 -5
- package/core/workspace_drag_surface_svg.d.ts +74 -0
- package/core/workspace_dragger.d.ts +3 -2
- package/core/workspace_svg.d.ts +48 -8
- package/core/xml.d.ts +1 -13
- package/core/zoom_controls.d.ts +4 -15
- package/dart_compressed.js +199 -199
- package/dart_compressed.js.map +1 -1
- package/javascript_compressed.js +168 -168
- package/javascript_compressed.js.map +1 -1
- package/lua_compressed.js +211 -211
- package/lua_compressed.js.map +1 -1
- package/msg/bn.js +2 -2
- package/msg/bs.js +7 -7
- package/msg/de.js +1 -1
- package/msg/fi.js +1 -1
- package/msg/fr.js +3 -3
- package/msg/ia.js +5 -5
- package/msg/kn.js +5 -5
- package/msg/ko.js +1 -1
- package/msg/lb.js +22 -22
- package/msg/sd.js +9 -9
- package/msg/skr-arab.js +2 -2
- package/msg/sl.js +18 -18
- package/msg/sw.js +1 -1
- package/msg/zh-hans.js +6 -6
- package/msg/zh-hant.js +2 -2
- package/package.json +6 -6
- package/php_compressed.js +185 -185
- package/php_compressed.js.map +1 -1
- package/python_compressed.js +138 -138
- package/python_compressed.js.map +1 -1
- package/core/utils/sentinel.d.ts +0 -18
package/core/field_checkbox.d.ts
CHANGED
|
@@ -5,14 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import './events/events_block_change.js';
|
|
7
7
|
import { Field, FieldConfig, FieldValidator } from './field.js';
|
|
8
|
-
import type { Sentinel } from './utils/sentinel.js';
|
|
9
8
|
type BoolString = 'TRUE' | 'FALSE';
|
|
10
9
|
type CheckboxBool = BoolString | boolean;
|
|
11
|
-
export type FieldCheckboxValidator = FieldValidator<CheckboxBool>;
|
|
12
10
|
/**
|
|
13
11
|
* Class for a checkbox field.
|
|
14
|
-
*
|
|
15
|
-
* @alias Blockly.FieldCheckbox
|
|
16
12
|
*/
|
|
17
13
|
export declare class FieldCheckbox extends Field<CheckboxBool> {
|
|
18
14
|
/** Default character for the checkmark. */
|
|
@@ -33,20 +29,20 @@ export declare class FieldCheckbox extends Field<CheckboxBool> {
|
|
|
33
29
|
*/
|
|
34
30
|
value_: boolean | null;
|
|
35
31
|
/**
|
|
36
|
-
* @param
|
|
32
|
+
* @param value The initial value of the field. Should either be 'TRUE',
|
|
37
33
|
* 'FALSE' or a boolean. Defaults to 'FALSE'. Also accepts
|
|
38
34
|
* Field.SKIP_SETUP if you wish to skip setup (only used by subclasses
|
|
39
35
|
* that want to handle configuration and setting the field value after
|
|
40
36
|
* their own constructors have run).
|
|
41
|
-
* @param
|
|
37
|
+
* @param validator A function that is called to validate changes to the
|
|
42
38
|
* field's value. Takes in a value ('TRUE' or 'FALSE') & returns a
|
|
43
39
|
* validated value ('TRUE' or 'FALSE'), or null to abort the change.
|
|
44
|
-
* @param
|
|
40
|
+
* @param config A map of options used to configure the field.
|
|
45
41
|
* See the [field creation documentation]{@link
|
|
46
42
|
* https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/checkbox#creation}
|
|
47
43
|
* for a list of properties this parameter supports.
|
|
48
44
|
*/
|
|
49
|
-
constructor(
|
|
45
|
+
constructor(value?: CheckboxBool | typeof Field.SKIP_SETUP, validator?: FieldCheckboxValidator, config?: FieldCheckboxConfig);
|
|
50
46
|
/**
|
|
51
47
|
* Configure the field based on the given map of options.
|
|
52
48
|
*
|
|
@@ -80,10 +76,10 @@ export declare class FieldCheckbox extends Field<CheckboxBool> {
|
|
|
80
76
|
/**
|
|
81
77
|
* Ensure that the input value is valid ('TRUE' or 'FALSE').
|
|
82
78
|
*
|
|
83
|
-
* @param
|
|
79
|
+
* @param newValue The input value.
|
|
84
80
|
* @returns A valid value ('TRUE' or 'FALSE), or null if invalid.
|
|
85
81
|
*/
|
|
86
|
-
protected doClassValidation_(
|
|
82
|
+
protected doClassValidation_(newValue?: any): BoolString | null;
|
|
87
83
|
/**
|
|
88
84
|
* Update the value of the field, and update the checkElement.
|
|
89
85
|
*
|
|
@@ -141,5 +137,21 @@ export interface FieldCheckboxConfig extends FieldConfig {
|
|
|
141
137
|
export interface FieldCheckboxFromJsonConfig extends FieldCheckboxConfig {
|
|
142
138
|
checked?: boolean;
|
|
143
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* A function that is called to validate changes to the field's value before
|
|
142
|
+
* they are set.
|
|
143
|
+
*
|
|
144
|
+
* @see {@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/validators#return_values}
|
|
145
|
+
* @param newValue The value to be validated.
|
|
146
|
+
* @returns One of three instructions for setting the new value: `T`, `null`,
|
|
147
|
+
* or `undefined`.
|
|
148
|
+
*
|
|
149
|
+
* - `T` to set this function's returned value instead of `newValue`.
|
|
150
|
+
*
|
|
151
|
+
* - `null` to invoke `doValueInvalid_` and not set a value.
|
|
152
|
+
*
|
|
153
|
+
* - `undefined` to set `newValue` as is.
|
|
154
|
+
*/
|
|
155
|
+
export type FieldCheckboxValidator = FieldValidator<CheckboxBool>;
|
|
144
156
|
export {};
|
|
145
157
|
//# sourceMappingURL=field_checkbox.d.ts.map
|
package/core/field_colour.d.ts
CHANGED
|
@@ -5,12 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import './events/events_block_change.js';
|
|
7
7
|
import { Field, FieldConfig, FieldValidator } from './field.js';
|
|
8
|
-
import type { Sentinel } from './utils/sentinel.js';
|
|
9
|
-
export type FieldColourValidator = FieldValidator<string>;
|
|
10
8
|
/**
|
|
11
9
|
* Class for a colour input field.
|
|
12
|
-
*
|
|
13
|
-
* @alias Blockly.FieldColour
|
|
14
10
|
*/
|
|
15
11
|
export declare class FieldColour extends Field<string> {
|
|
16
12
|
/**
|
|
@@ -31,19 +27,15 @@ export declare class FieldColour extends Field<string> {
|
|
|
31
27
|
*/
|
|
32
28
|
static COLUMNS: number;
|
|
33
29
|
/** The field's colour picker element. */
|
|
34
|
-
private
|
|
30
|
+
private picker;
|
|
35
31
|
/** Index of the currently highlighted element. */
|
|
36
|
-
private
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
private
|
|
43
|
-
/** Mouse leave event data. */
|
|
44
|
-
private onMouseLeaveWrapper_;
|
|
45
|
-
/** Key down event data. */
|
|
46
|
-
private onKeyDownWrapper_;
|
|
32
|
+
private highlightedIndex;
|
|
33
|
+
/**
|
|
34
|
+
* Array holding info needed to unbind events.
|
|
35
|
+
* Used for disposing.
|
|
36
|
+
* Ex: [[node, name, func], [node, name, func]].
|
|
37
|
+
*/
|
|
38
|
+
private boundEvents;
|
|
47
39
|
/**
|
|
48
40
|
* Serializable fields are saved by the serializer, non-serializable fields
|
|
49
41
|
* are not. Editable fields should also be serializable.
|
|
@@ -58,32 +50,32 @@ export declare class FieldColour extends Field<string> {
|
|
|
58
50
|
*/
|
|
59
51
|
protected isDirty_: boolean;
|
|
60
52
|
/** Array of colours used by this field. If null, use the global list. */
|
|
61
|
-
private
|
|
53
|
+
private colours;
|
|
62
54
|
/**
|
|
63
55
|
* Array of colour tooltips used by this field. If null, use the global
|
|
64
56
|
* list.
|
|
65
57
|
*/
|
|
66
|
-
private
|
|
58
|
+
private titles;
|
|
67
59
|
/**
|
|
68
60
|
* Number of colour columns used by this field. If 0, use the global
|
|
69
61
|
* setting. By default use the global constants for columns.
|
|
70
62
|
*/
|
|
71
|
-
private
|
|
63
|
+
private columns;
|
|
72
64
|
/**
|
|
73
|
-
* @param
|
|
65
|
+
* @param value The initial value of the field. Should be in '#rrggbb'
|
|
74
66
|
* format. Defaults to the first value in the default colour array. Also
|
|
75
67
|
* accepts Field.SKIP_SETUP if you wish to skip setup (only used by
|
|
76
68
|
* subclasses that want to handle configuration and setting the field
|
|
77
69
|
* value after their own constructors have run).
|
|
78
|
-
* @param
|
|
70
|
+
* @param validator A function that is called to validate changes to the
|
|
79
71
|
* field's value. Takes in a colour string & returns a validated colour
|
|
80
|
-
* string ('#rrggbb' format), or null to abort the change.
|
|
81
|
-
* @param
|
|
72
|
+
* string ('#rrggbb' format), or null to abort the change.
|
|
73
|
+
* @param config A map of options used to configure the field.
|
|
82
74
|
* See the [field creation documentation]{@link
|
|
83
75
|
* https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/colour}
|
|
84
76
|
* for a list of properties this parameter supports.
|
|
85
77
|
*/
|
|
86
|
-
constructor(
|
|
78
|
+
constructor(value?: string | typeof Field.SKIP_SETUP, validator?: FieldColourValidator, config?: FieldColourConfig);
|
|
87
79
|
/**
|
|
88
80
|
* Configure the field based on the given map of options.
|
|
89
81
|
*
|
|
@@ -96,14 +88,19 @@ export declare class FieldColour extends Field<string> {
|
|
|
96
88
|
* @internal
|
|
97
89
|
*/
|
|
98
90
|
initView(): void;
|
|
91
|
+
/**
|
|
92
|
+
* Updates text field to match the colour/style of the block.
|
|
93
|
+
*
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
99
96
|
applyColour(): void;
|
|
100
97
|
/**
|
|
101
98
|
* Ensure that the input value is a valid colour.
|
|
102
99
|
*
|
|
103
|
-
* @param
|
|
100
|
+
* @param newValue The input value.
|
|
104
101
|
* @returns A valid colour, or null if invalid.
|
|
105
102
|
*/
|
|
106
|
-
protected doClassValidation_(
|
|
103
|
+
protected doClassValidation_(newValue?: any): string | null;
|
|
107
104
|
/**
|
|
108
105
|
* Update the value of this colour field, and update the displayed colour.
|
|
109
106
|
*
|
|
@@ -122,11 +119,11 @@ export declare class FieldColour extends Field<string> {
|
|
|
122
119
|
*
|
|
123
120
|
* @param colours Array of colours for this block, or null to use default
|
|
124
121
|
* (FieldColour.COLOURS).
|
|
125
|
-
* @param
|
|
122
|
+
* @param titles Optional array of colour tooltips, or null to use default
|
|
126
123
|
* (FieldColour.TITLES).
|
|
127
124
|
* @returns Returns itself (for method chaining).
|
|
128
125
|
*/
|
|
129
|
-
setColours(colours: string[],
|
|
126
|
+
setColours(colours: string[], titles?: string[]): FieldColour;
|
|
130
127
|
/**
|
|
131
128
|
* Set a custom grid size for this field.
|
|
132
129
|
*
|
|
@@ -142,51 +139,51 @@ export declare class FieldColour extends Field<string> {
|
|
|
142
139
|
*
|
|
143
140
|
* @param e Mouse event.
|
|
144
141
|
*/
|
|
145
|
-
private
|
|
142
|
+
private onClick;
|
|
146
143
|
/**
|
|
147
144
|
* Handle a key down event. Navigate around the grid with the
|
|
148
145
|
* arrow keys. Enter selects the highlighted colour.
|
|
149
146
|
*
|
|
150
147
|
* @param e Keyboard event.
|
|
151
148
|
*/
|
|
152
|
-
private
|
|
149
|
+
private onKeyDown;
|
|
153
150
|
/**
|
|
154
151
|
* Move the currently highlighted position by dx and dy.
|
|
155
152
|
*
|
|
156
|
-
* @param dx Change of x
|
|
157
|
-
* @param dy Change of y
|
|
153
|
+
* @param dx Change of x.
|
|
154
|
+
* @param dy Change of y.
|
|
158
155
|
*/
|
|
159
|
-
private
|
|
156
|
+
private moveHighlightBy;
|
|
160
157
|
/**
|
|
161
158
|
* Handle a mouse move event. Highlight the hovered colour.
|
|
162
159
|
*
|
|
163
160
|
* @param e Mouse event.
|
|
164
161
|
*/
|
|
165
|
-
private
|
|
162
|
+
private onMouseMove;
|
|
166
163
|
/** Handle a mouse enter event. Focus the picker. */
|
|
167
|
-
private
|
|
164
|
+
private onMouseEnter;
|
|
168
165
|
/**
|
|
169
166
|
* Handle a mouse leave event. Blur the picker and unhighlight
|
|
170
167
|
* the currently highlighted colour.
|
|
171
168
|
*/
|
|
172
|
-
private
|
|
169
|
+
private onMouseLeave;
|
|
173
170
|
/**
|
|
174
171
|
* Returns the currently highlighted item (if any).
|
|
175
172
|
*
|
|
176
173
|
* @returns Highlighted item (null if none).
|
|
177
174
|
*/
|
|
178
|
-
private
|
|
175
|
+
private getHighlighted;
|
|
179
176
|
/**
|
|
180
177
|
* Update the currently highlighted cell.
|
|
181
178
|
*
|
|
182
|
-
* @param cell
|
|
183
|
-
* @param index
|
|
179
|
+
* @param cell The new cell to highlight.
|
|
180
|
+
* @param index The index of the new cell.
|
|
184
181
|
*/
|
|
185
|
-
private
|
|
182
|
+
private setHighlightedCell;
|
|
186
183
|
/** Create a colour picker dropdown editor. */
|
|
187
|
-
private
|
|
184
|
+
private dropdownCreate;
|
|
188
185
|
/** Disposes of events and DOM-references belonging to the colour editor. */
|
|
189
|
-
private
|
|
186
|
+
private dropdownDispose;
|
|
190
187
|
/**
|
|
191
188
|
* Construct a FieldColour from a JSON arg object.
|
|
192
189
|
*
|
|
@@ -211,4 +208,20 @@ export interface FieldColourConfig extends FieldConfig {
|
|
|
211
208
|
export interface FieldColourFromJsonConfig extends FieldColourConfig {
|
|
212
209
|
colour?: string;
|
|
213
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* A function that is called to validate changes to the field's value before
|
|
213
|
+
* they are set.
|
|
214
|
+
*
|
|
215
|
+
* @see {@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/validators#return_values}
|
|
216
|
+
* @param newValue The value to be validated.
|
|
217
|
+
* @returns One of three instructions for setting the new value: `T`, `null`,
|
|
218
|
+
* or `undefined`.
|
|
219
|
+
*
|
|
220
|
+
* - `T` to set this function's returned value instead of `newValue`.
|
|
221
|
+
*
|
|
222
|
+
* - `null` to invoke `doValueInvalid_` and not set a value.
|
|
223
|
+
*
|
|
224
|
+
* - `undefined` to set `newValue` as is.
|
|
225
|
+
*/
|
|
226
|
+
export type FieldColourValidator = FieldValidator<string>;
|
|
214
227
|
//# sourceMappingURL=field_colour.d.ts.map
|
package/core/field_dropdown.d.ts
CHANGED
|
@@ -6,12 +6,8 @@
|
|
|
6
6
|
import { Field, FieldConfig, FieldValidator } from './field.js';
|
|
7
7
|
import { Menu } from './menu.js';
|
|
8
8
|
import { MenuItem } from './menuitem.js';
|
|
9
|
-
import type { Sentinel } from './utils/sentinel.js';
|
|
10
|
-
export type FieldDropdownValidator = FieldValidator<string>;
|
|
11
9
|
/**
|
|
12
10
|
* Class for an editable dropdown field.
|
|
13
|
-
*
|
|
14
|
-
* @alias Blockly.FieldDropdown
|
|
15
11
|
*/
|
|
16
12
|
export declare class FieldDropdown extends Field<string> {
|
|
17
13
|
/** Horizontal distance that a checkmark overhangs the dropdown. */
|
|
@@ -64,18 +60,18 @@ export declare class FieldDropdown extends Field<string> {
|
|
|
64
60
|
* if you wish to skip setup (only used by subclasses that want to handle
|
|
65
61
|
* configuration and setting the field value after their own constructors
|
|
66
62
|
* have run).
|
|
67
|
-
* @param
|
|
63
|
+
* @param validator A function that is called to validate changes to the
|
|
68
64
|
* field's value. Takes in a language-neutral dropdown option & returns a
|
|
69
65
|
* validated language-neutral dropdown option, or null to abort the
|
|
70
66
|
* change.
|
|
71
|
-
* @param
|
|
67
|
+
* @param config A map of options used to configure the field.
|
|
72
68
|
* See the [field creation documentation]{@link
|
|
73
69
|
* https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/dropdown#creation}
|
|
74
70
|
* for a list of properties this parameter supports.
|
|
75
71
|
* @throws {TypeError} If `menuGenerator` options are incorrectly structured.
|
|
76
72
|
*/
|
|
77
|
-
constructor(menuGenerator: MenuGenerator,
|
|
78
|
-
constructor(menuGenerator:
|
|
73
|
+
constructor(menuGenerator: MenuGenerator, validator?: FieldDropdownValidator, config?: FieldDropdownConfig);
|
|
74
|
+
constructor(menuGenerator: typeof Field.SKIP_SETUP);
|
|
79
75
|
/**
|
|
80
76
|
* Sets the field's value based on the given XML element. Should only be
|
|
81
77
|
* called by Blockly.Xml.
|
|
@@ -110,16 +106,16 @@ export declare class FieldDropdown extends Field<string> {
|
|
|
110
106
|
/**
|
|
111
107
|
* Create a dropdown menu under the text.
|
|
112
108
|
*
|
|
113
|
-
* @param
|
|
109
|
+
* @param e Optional mouse event that triggered the field to open, or
|
|
114
110
|
* undefined if triggered programmatically.
|
|
115
111
|
*/
|
|
116
|
-
protected showEditor_(
|
|
112
|
+
protected showEditor_(e?: MouseEvent): void;
|
|
117
113
|
/** Create the dropdown editor. */
|
|
118
114
|
private dropdownCreate_;
|
|
119
115
|
/**
|
|
120
116
|
* Disposes of events and DOM-references belonging to the dropdown editor.
|
|
121
117
|
*/
|
|
122
|
-
|
|
118
|
+
protected dropdownDispose_(): void;
|
|
123
119
|
/**
|
|
124
120
|
* Handle an action in the dropdown menu.
|
|
125
121
|
*
|
|
@@ -141,20 +137,20 @@ export declare class FieldDropdown extends Field<string> {
|
|
|
141
137
|
/**
|
|
142
138
|
* Return a list of the options for this dropdown.
|
|
143
139
|
*
|
|
144
|
-
* @param
|
|
140
|
+
* @param useCache For dynamic options, whether or not to use the cached
|
|
145
141
|
* options or to re-generate them.
|
|
146
142
|
* @returns A non-empty array of option tuples:
|
|
147
143
|
* (human-readable text or image, language-neutral name).
|
|
148
144
|
* @throws {TypeError} If generated options are incorrectly structured.
|
|
149
145
|
*/
|
|
150
|
-
getOptions(
|
|
146
|
+
getOptions(useCache?: boolean): MenuOption[];
|
|
151
147
|
/**
|
|
152
148
|
* Ensure that the input value is a valid language-neutral option.
|
|
153
149
|
*
|
|
154
|
-
* @param
|
|
150
|
+
* @param newValue The input value.
|
|
155
151
|
* @returns A valid language-neutral option, or null if invalid.
|
|
156
152
|
*/
|
|
157
|
-
protected doClassValidation_(
|
|
153
|
+
protected doClassValidation_(newValue?: string): string | null;
|
|
158
154
|
/**
|
|
159
155
|
* Update the value of this dropdown field.
|
|
160
156
|
*
|
|
@@ -188,8 +184,8 @@ export declare class FieldDropdown extends Field<string> {
|
|
|
188
184
|
private positionSVGArrow_;
|
|
189
185
|
/**
|
|
190
186
|
* Use the `getText_` developer hook to override the field's text
|
|
191
|
-
* representation. Get the selected option text.
|
|
192
|
-
* image we return the image alt text.
|
|
187
|
+
* representation. Get the selected option text. If the selected option is
|
|
188
|
+
* an image we return the image alt text.
|
|
193
189
|
*
|
|
194
190
|
* @returns Selected option text.
|
|
195
191
|
*/
|
|
@@ -229,10 +225,30 @@ export type MenuGeneratorFunction = (this: FieldDropdown) => MenuOption[];
|
|
|
229
225
|
* menu options for FieldDropdown or its descendants.
|
|
230
226
|
*/
|
|
231
227
|
export type MenuGenerator = MenuOption[] | MenuGeneratorFunction;
|
|
228
|
+
/**
|
|
229
|
+
* Config options for the dropdown field.
|
|
230
|
+
*/
|
|
231
|
+
export type FieldDropdownConfig = FieldConfig;
|
|
232
232
|
/**
|
|
233
233
|
* fromJson config for the dropdown field.
|
|
234
234
|
*/
|
|
235
|
-
export interface FieldDropdownFromJsonConfig extends
|
|
235
|
+
export interface FieldDropdownFromJsonConfig extends FieldDropdownConfig {
|
|
236
236
|
options?: MenuOption[];
|
|
237
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* A function that is called to validate changes to the field's value before
|
|
240
|
+
* they are set.
|
|
241
|
+
*
|
|
242
|
+
* @see {@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/validators#return_values}
|
|
243
|
+
* @param newValue The value to be validated.
|
|
244
|
+
* @returns One of three instructions for setting the new value: `T`, `null`,
|
|
245
|
+
* or `undefined`.
|
|
246
|
+
*
|
|
247
|
+
* - `T` to set this function's returned value instead of `newValue`.
|
|
248
|
+
*
|
|
249
|
+
* - `null` to invoke `doValueInvalid_` and not set a value.
|
|
250
|
+
*
|
|
251
|
+
* - `undefined` to set `newValue` as is.
|
|
252
|
+
*/
|
|
253
|
+
export type FieldDropdownValidator = FieldValidator<string>;
|
|
238
254
|
//# sourceMappingURL=field_dropdown.d.ts.map
|
package/core/field_image.d.ts
CHANGED
|
@@ -4,12 +4,9 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { Field, FieldConfig } from './field.js';
|
|
7
|
-
import type { Sentinel } from './utils/sentinel.js';
|
|
8
7
|
import { Size } from './utils/size.js';
|
|
9
8
|
/**
|
|
10
9
|
* Class for an image on a block.
|
|
11
|
-
*
|
|
12
|
-
* @alias Blockly.FieldImage
|
|
13
10
|
*/
|
|
14
11
|
export declare class FieldImage extends Field<string> {
|
|
15
12
|
/**
|
|
@@ -45,16 +42,16 @@ export declare class FieldImage extends Field<string> {
|
|
|
45
42
|
* after their own constructors have run).
|
|
46
43
|
* @param width Width of the image.
|
|
47
44
|
* @param height Height of the image.
|
|
48
|
-
* @param
|
|
49
|
-
* @param
|
|
50
|
-
* clicked. If
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
45
|
+
* @param alt Optional alt text for when block is collapsed.
|
|
46
|
+
* @param onClick Optional function to be called when the image is
|
|
47
|
+
* clicked. If onClick is defined, alt must also be defined.
|
|
48
|
+
* @param flipRtl Whether to flip the icon in RTL.
|
|
49
|
+
* @param config A map of options used to configure the field.
|
|
53
50
|
* See the [field creation documentation]{@link
|
|
54
51
|
* https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/image#creation}
|
|
55
52
|
* for a list of properties this parameter supports.
|
|
56
53
|
*/
|
|
57
|
-
constructor(src: string |
|
|
54
|
+
constructor(src: string | typeof Field.SKIP_SETUP, width: string | number, height: string | number, alt?: string, onClick?: (p1: FieldImage) => void, flipRtl?: boolean, config?: FieldImageConfig);
|
|
58
55
|
/**
|
|
59
56
|
* Configure the field based on the given map of options.
|
|
60
57
|
*
|
|
@@ -71,10 +68,10 @@ export declare class FieldImage extends Field<string> {
|
|
|
71
68
|
/**
|
|
72
69
|
* Ensure that the input value (the source URL) is a string.
|
|
73
70
|
*
|
|
74
|
-
* @param
|
|
71
|
+
* @param newValue The input value.
|
|
75
72
|
* @returns A string, or null if invalid.
|
|
76
73
|
*/
|
|
77
|
-
protected doClassValidation_(
|
|
74
|
+
protected doClassValidation_(newValue?: any): string | null;
|
|
78
75
|
/**
|
|
79
76
|
* Update the value of this image field, and update the displayed image.
|
|
80
77
|
*
|
|
@@ -105,7 +102,7 @@ export declare class FieldImage extends Field<string> {
|
|
|
105
102
|
* @param func The function that is called when the image is clicked, or null
|
|
106
103
|
* to remove.
|
|
107
104
|
*/
|
|
108
|
-
setOnClickHandler(func: ((p1: FieldImage) =>
|
|
105
|
+
setOnClickHandler(func: ((p1: FieldImage) => void) | null): void;
|
|
109
106
|
/**
|
|
110
107
|
* Use the `getText_` developer hook to override the field's text
|
|
111
108
|
* representation.
|
package/core/field_input.d.ts
CHANGED
|
@@ -5,15 +5,18 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import './events/events_block_change.js';
|
|
7
7
|
import { Field, FieldConfig, FieldValidator } from './field.js';
|
|
8
|
-
import type { Sentinel } from './utils/sentinel.js';
|
|
9
8
|
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Supported types for FieldInput subclasses.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
type InputTypes = string | number;
|
|
12
15
|
/**
|
|
13
16
|
* Abstract class for an editable input field.
|
|
14
17
|
*
|
|
15
|
-
* @alias Blockly.FieldInput
|
|
16
18
|
* @typeParam T - The value stored on the field.
|
|
19
|
+
* @internal
|
|
17
20
|
*/
|
|
18
21
|
export declare abstract class FieldInput<T extends InputTypes> extends Field<string | T> {
|
|
19
22
|
/**
|
|
@@ -50,20 +53,20 @@ export declare abstract class FieldInput<T extends InputTypes> extends Field<str
|
|
|
50
53
|
/** Mouse cursor style when over the hotspot that initiates the editor. */
|
|
51
54
|
CURSOR: string;
|
|
52
55
|
/**
|
|
53
|
-
* @param
|
|
56
|
+
* @param value The initial value of the field. Should cast to a string.
|
|
54
57
|
* Defaults to an empty string if null or undefined. Also accepts
|
|
55
58
|
* Field.SKIP_SETUP if you wish to skip setup (only used by subclasses
|
|
56
59
|
* that want to handle configuration and setting the field value after
|
|
57
60
|
* their own constructors have run).
|
|
58
|
-
* @param
|
|
61
|
+
* @param validator A function that is called to validate changes to the
|
|
59
62
|
* field's value. Takes in a string & returns a validated string, or null
|
|
60
63
|
* to abort the change.
|
|
61
|
-
* @param
|
|
64
|
+
* @param config A map of options used to configure the field.
|
|
62
65
|
* See the [field creation documentation]{@link
|
|
63
66
|
* https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/text-input#creation}
|
|
64
67
|
* for a list of properties this parameter supports.
|
|
65
68
|
*/
|
|
66
|
-
constructor(
|
|
69
|
+
constructor(value?: string | typeof Field.SKIP_SETUP, validator?: FieldInputValidator<T> | null, config?: FieldInputConfig);
|
|
67
70
|
protected configure_(config: FieldInputConfig): void;
|
|
68
71
|
/** @internal */
|
|
69
72
|
initView(): void;
|
|
@@ -109,12 +112,12 @@ export declare abstract class FieldInput<T extends InputTypes> extends Field<str
|
|
|
109
112
|
* Shows a prompt editor for mobile browsers if the modalInputs option is
|
|
110
113
|
* enabled.
|
|
111
114
|
*
|
|
112
|
-
* @param
|
|
115
|
+
* @param _e Optional mouse event that triggered the field to open, or
|
|
113
116
|
* undefined if triggered programmatically.
|
|
114
|
-
* @param
|
|
117
|
+
* @param quietInput True if editor should be created without focus.
|
|
115
118
|
* Defaults to false.
|
|
116
119
|
*/
|
|
117
|
-
protected showEditor_(
|
|
120
|
+
protected showEditor_(_e?: Event, quietInput?: boolean): void;
|
|
118
121
|
/**
|
|
119
122
|
* Create and show a text input editor that is a prompt (usually a popup).
|
|
120
123
|
* Mobile browsers may have issues with in-line textareas (focus and
|
|
@@ -213,8 +216,28 @@ export declare abstract class FieldInput<T extends InputTypes> extends Field<str
|
|
|
213
216
|
}
|
|
214
217
|
/**
|
|
215
218
|
* Config options for the input field.
|
|
219
|
+
*
|
|
220
|
+
* @internal
|
|
216
221
|
*/
|
|
217
222
|
export interface FieldInputConfig extends FieldConfig {
|
|
218
223
|
spellcheck?: boolean;
|
|
219
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* A function that is called to validate changes to the field's value before
|
|
227
|
+
* they are set.
|
|
228
|
+
*
|
|
229
|
+
* @see {@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/validators#return_values}
|
|
230
|
+
* @param newValue The value to be validated.
|
|
231
|
+
* @returns One of three instructions for setting the new value: `T`, `null`,
|
|
232
|
+
* or `undefined`.
|
|
233
|
+
*
|
|
234
|
+
* - `T` to set this function's returned value instead of `newValue`.
|
|
235
|
+
*
|
|
236
|
+
* - `null` to invoke `doValueInvalid_` and not set a value.
|
|
237
|
+
*
|
|
238
|
+
* - `undefined` to set `newValue` as is.
|
|
239
|
+
* @internal
|
|
240
|
+
*/
|
|
241
|
+
export type FieldInputValidator<T extends InputTypes> = FieldValidator<string | T>;
|
|
242
|
+
export {};
|
|
220
243
|
//# sourceMappingURL=field_input.d.ts.map
|
package/core/field_label.d.ts
CHANGED
|
@@ -4,14 +4,11 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { Field, FieldConfig } from './field.js';
|
|
7
|
-
import type { Sentinel } from './utils/sentinel.js';
|
|
8
7
|
/**
|
|
9
8
|
* Class for a non-editable, non-serializable text field.
|
|
10
|
-
*
|
|
11
|
-
* @alias Blockly.FieldLabel
|
|
12
9
|
*/
|
|
13
10
|
export declare class FieldLabel extends Field<string> {
|
|
14
|
-
/** The
|
|
11
|
+
/** The HTML class name to use for this field. */
|
|
15
12
|
private class_;
|
|
16
13
|
/**
|
|
17
14
|
* Editable fields usually show some sort of UI indicating they are
|
|
@@ -19,18 +16,18 @@ export declare class FieldLabel extends Field<string> {
|
|
|
19
16
|
*/
|
|
20
17
|
EDITABLE: boolean;
|
|
21
18
|
/**
|
|
22
|
-
* @param
|
|
19
|
+
* @param value The initial value of the field. Should cast to a string.
|
|
23
20
|
* Defaults to an empty string if null or undefined. Also accepts
|
|
24
21
|
* Field.SKIP_SETUP if you wish to skip setup (only used by subclasses
|
|
25
22
|
* that want to handle configuration and setting the field value after
|
|
26
23
|
* their own constructors have run).
|
|
27
|
-
* @param
|
|
28
|
-
* @param
|
|
24
|
+
* @param textClass Optional CSS class for the field's text.
|
|
25
|
+
* @param config A map of options used to configure the field.
|
|
29
26
|
* See the [field creation documentation]{@link
|
|
30
27
|
* https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/label#creation}
|
|
31
28
|
* for a list of properties this parameter supports.
|
|
32
29
|
*/
|
|
33
|
-
constructor(
|
|
30
|
+
constructor(value?: string | typeof Field.SKIP_SETUP, textClass?: string, config?: FieldLabelConfig);
|
|
34
31
|
protected configure_(config: FieldLabelConfig): void;
|
|
35
32
|
/**
|
|
36
33
|
* Create block UI for this label.
|
|
@@ -41,10 +38,10 @@ export declare class FieldLabel extends Field<string> {
|
|
|
41
38
|
/**
|
|
42
39
|
* Ensure that the input value casts to a valid string.
|
|
43
40
|
*
|
|
44
|
-
* @param
|
|
41
|
+
* @param newValue The input value.
|
|
45
42
|
* @returns A valid string, or null if invalid.
|
|
46
43
|
*/
|
|
47
|
-
protected doClassValidation_(
|
|
44
|
+
protected doClassValidation_(newValue?: any): string | null;
|
|
48
45
|
/**
|
|
49
46
|
* Set the CSS class applied to the field's textElement_.
|
|
50
47
|
*
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
import { FieldLabel, FieldLabelConfig, FieldLabelFromJsonConfig } from './field_label.js';
|
|
7
7
|
/**
|
|
8
8
|
* Class for a non-editable, serializable text field.
|
|
9
|
-
*
|
|
10
|
-
* @alias Blockly.FieldLabelSerializable
|
|
11
9
|
*/
|
|
12
10
|
export declare class FieldLabelSerializable extends FieldLabel {
|
|
13
11
|
/**
|
|
@@ -22,15 +20,15 @@ export declare class FieldLabelSerializable extends FieldLabel {
|
|
|
22
20
|
*/
|
|
23
21
|
SERIALIZABLE: boolean;
|
|
24
22
|
/**
|
|
25
|
-
* @param
|
|
23
|
+
* @param value The initial value of the field. Should cast to a string.
|
|
26
24
|
* Defaults to an empty string if null or undefined.
|
|
27
|
-
* @param
|
|
28
|
-
* @param
|
|
25
|
+
* @param textClass Optional CSS class for the field's text.
|
|
26
|
+
* @param config A map of options used to configure the field.
|
|
29
27
|
* See the [field creation documentation]{@link
|
|
30
28
|
* https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/label-serializable#creation}
|
|
31
29
|
* for a list of properties this parameter supports.
|
|
32
30
|
*/
|
|
33
|
-
constructor(
|
|
31
|
+
constructor(value?: string, textClass?: string, config?: FieldLabelConfig);
|
|
34
32
|
/**
|
|
35
33
|
* Construct a FieldLabelSerializable from a JSON arg object,
|
|
36
34
|
* dereferencing any string table references.
|