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/events/utils.d.ts
CHANGED
|
@@ -14,170 +14,116 @@ import type { CommentMove } from './events_comment_move.js';
|
|
|
14
14
|
* Sets whether events should be added to the undo stack.
|
|
15
15
|
*
|
|
16
16
|
* @param newValue True if events should be added to the undo stack.
|
|
17
|
-
* @alias Blockly.Events.utils.setRecordUndo
|
|
18
17
|
*/
|
|
19
18
|
export declare function setRecordUndo(newValue: boolean): void;
|
|
20
19
|
/**
|
|
21
20
|
* Returns whether or not events will be added to the undo stack.
|
|
22
21
|
*
|
|
23
22
|
* @returns True if events will be added to the undo stack.
|
|
24
|
-
* @alias Blockly.Events.utils.getRecordUndo
|
|
25
23
|
*/
|
|
26
24
|
export declare function getRecordUndo(): boolean;
|
|
27
25
|
/**
|
|
28
26
|
* Name of event that creates a block. Will be deprecated for BLOCK_CREATE.
|
|
29
|
-
*
|
|
30
|
-
* @alias Blockly.Events.utils.CREATE
|
|
31
27
|
*/
|
|
32
28
|
export declare const CREATE = "create";
|
|
33
29
|
/**
|
|
34
30
|
* Name of event that creates a block.
|
|
35
|
-
*
|
|
36
|
-
* @alias Blockly.Events.utils.BLOCK_CREATE
|
|
37
31
|
*/
|
|
38
32
|
export declare const BLOCK_CREATE = "create";
|
|
39
33
|
/**
|
|
40
34
|
* Name of event that deletes a block. Will be deprecated for BLOCK_DELETE.
|
|
41
|
-
*
|
|
42
|
-
* @alias Blockly.Events.utils.DELETE
|
|
43
35
|
*/
|
|
44
36
|
export declare const DELETE = "delete";
|
|
45
37
|
/**
|
|
46
38
|
* Name of event that deletes a block.
|
|
47
|
-
*
|
|
48
|
-
* @alias Blockly.Events.utils.BLOCK_DELETE
|
|
49
39
|
*/
|
|
50
40
|
export declare const BLOCK_DELETE = "delete";
|
|
51
41
|
/**
|
|
52
42
|
* Name of event that changes a block. Will be deprecated for BLOCK_CHANGE.
|
|
53
|
-
*
|
|
54
|
-
* @alias Blockly.Events.utils.CHANGE
|
|
55
43
|
*/
|
|
56
44
|
export declare const CHANGE = "change";
|
|
57
45
|
/**
|
|
58
46
|
* Name of event that changes a block.
|
|
59
|
-
*
|
|
60
|
-
* @alias Blockly.Events.utils.BLOCK_CHANGE
|
|
61
47
|
*/
|
|
62
48
|
export declare const BLOCK_CHANGE = "change";
|
|
63
49
|
/**
|
|
64
50
|
* Name of event that moves a block. Will be deprecated for BLOCK_MOVE.
|
|
65
|
-
*
|
|
66
|
-
* @alias Blockly.Events.utils.MOVE
|
|
67
51
|
*/
|
|
68
52
|
export declare const MOVE = "move";
|
|
69
53
|
/**
|
|
70
54
|
* Name of event that moves a block.
|
|
71
|
-
*
|
|
72
|
-
* @alias Blockly.Events.utils.BLOCK_MOVE
|
|
73
55
|
*/
|
|
74
56
|
export declare const BLOCK_MOVE = "move";
|
|
75
57
|
/**
|
|
76
58
|
* Name of event that creates a variable.
|
|
77
|
-
*
|
|
78
|
-
* @alias Blockly.Events.utils.VAR_CREATE
|
|
79
59
|
*/
|
|
80
60
|
export declare const VAR_CREATE = "var_create";
|
|
81
61
|
/**
|
|
82
62
|
* Name of event that deletes a variable.
|
|
83
|
-
*
|
|
84
|
-
* @alias Blockly.Events.utils.VAR_DELETE
|
|
85
63
|
*/
|
|
86
64
|
export declare const VAR_DELETE = "var_delete";
|
|
87
65
|
/**
|
|
88
66
|
* Name of event that renames a variable.
|
|
89
|
-
*
|
|
90
|
-
* @alias Blockly.Events.utils.VAR_RENAME
|
|
91
67
|
*/
|
|
92
68
|
export declare const VAR_RENAME = "var_rename";
|
|
93
69
|
/**
|
|
94
70
|
* Name of generic event that records a UI change.
|
|
95
|
-
*
|
|
96
|
-
* @alias Blockly.Events.utils.UI
|
|
97
71
|
*/
|
|
98
72
|
export declare const UI = "ui";
|
|
99
73
|
/**
|
|
100
74
|
* Name of event that record a block drags a block.
|
|
101
|
-
*
|
|
102
|
-
* @alias Blockly.Events.utils.BLOCK_DRAG
|
|
103
75
|
*/
|
|
104
76
|
export declare const BLOCK_DRAG = "drag";
|
|
105
77
|
/**
|
|
106
78
|
* Name of event that records a change in selected element.
|
|
107
|
-
*
|
|
108
|
-
* @alias Blockly.Events.utils.SELECTED
|
|
109
79
|
*/
|
|
110
80
|
export declare const SELECTED = "selected";
|
|
111
81
|
/**
|
|
112
82
|
* Name of event that records a click.
|
|
113
|
-
*
|
|
114
|
-
* @alias Blockly.Events.utils.CLICK
|
|
115
83
|
*/
|
|
116
84
|
export declare const CLICK = "click";
|
|
117
85
|
/**
|
|
118
86
|
* Name of event that records a marker move.
|
|
119
|
-
*
|
|
120
|
-
* @alias Blockly.Events.utils.MARKER_MOVE
|
|
121
87
|
*/
|
|
122
88
|
export declare const MARKER_MOVE = "marker_move";
|
|
123
89
|
/**
|
|
124
90
|
* Name of event that records a bubble open.
|
|
125
|
-
*
|
|
126
|
-
* @alias Blockly.Events.utils.BUBBLE_OPEN
|
|
127
91
|
*/
|
|
128
92
|
export declare const BUBBLE_OPEN = "bubble_open";
|
|
129
93
|
/**
|
|
130
94
|
* Name of event that records a trashcan open.
|
|
131
|
-
*
|
|
132
|
-
* @alias Blockly.Events.utils.TRASHCAN_OPEN
|
|
133
95
|
*/
|
|
134
96
|
export declare const TRASHCAN_OPEN = "trashcan_open";
|
|
135
97
|
/**
|
|
136
98
|
* Name of event that records a toolbox item select.
|
|
137
|
-
*
|
|
138
|
-
* @alias Blockly.Events.utils.TOOLBOX_ITEM_SELECT
|
|
139
99
|
*/
|
|
140
100
|
export declare const TOOLBOX_ITEM_SELECT = "toolbox_item_select";
|
|
141
101
|
/**
|
|
142
102
|
* Name of event that records a theme change.
|
|
143
|
-
*
|
|
144
|
-
* @alias Blockly.Events.utils.THEME_CHANGE
|
|
145
103
|
*/
|
|
146
104
|
export declare const THEME_CHANGE = "theme_change";
|
|
147
105
|
/**
|
|
148
106
|
* Name of event that records a viewport change.
|
|
149
|
-
*
|
|
150
|
-
* @alias Blockly.Events.utils.VIEWPORT_CHANGE
|
|
151
107
|
*/
|
|
152
108
|
export declare const VIEWPORT_CHANGE = "viewport_change";
|
|
153
109
|
/**
|
|
154
110
|
* Name of event that creates a comment.
|
|
155
|
-
*
|
|
156
|
-
* @alias Blockly.Events.utils.COMMENT_CREATE
|
|
157
111
|
*/
|
|
158
112
|
export declare const COMMENT_CREATE = "comment_create";
|
|
159
113
|
/**
|
|
160
114
|
* Name of event that deletes a comment.
|
|
161
|
-
*
|
|
162
|
-
* @alias Blockly.Events.utils.COMMENT_DELETE
|
|
163
115
|
*/
|
|
164
116
|
export declare const COMMENT_DELETE = "comment_delete";
|
|
165
117
|
/**
|
|
166
118
|
* Name of event that changes a comment.
|
|
167
|
-
*
|
|
168
|
-
* @alias Blockly.Events.utils.COMMENT_CHANGE
|
|
169
119
|
*/
|
|
170
120
|
export declare const COMMENT_CHANGE = "comment_change";
|
|
171
121
|
/**
|
|
172
122
|
* Name of event that moves a comment.
|
|
173
|
-
*
|
|
174
|
-
* @alias Blockly.Events.utils.COMMENT_MOVE
|
|
175
123
|
*/
|
|
176
124
|
export declare const COMMENT_MOVE = "comment_move";
|
|
177
125
|
/**
|
|
178
126
|
* Name of event that records a workspace load.
|
|
179
|
-
*
|
|
180
|
-
* @alias Blockly.Events.utils.FINISHED_LOADING
|
|
181
127
|
*/
|
|
182
128
|
export declare const FINISHED_LOADING = "finished_loading";
|
|
183
129
|
/**
|
|
@@ -186,8 +132,6 @@ export declare const FINISHED_LOADING = "finished_loading";
|
|
|
186
132
|
*
|
|
187
133
|
* Not to be confused with bumping so that disconnected connections do not
|
|
188
134
|
* appear connected.
|
|
189
|
-
*
|
|
190
|
-
* @alias Blockly.Events.utils.BumpEvent
|
|
191
135
|
*/
|
|
192
136
|
export type BumpEvent = BlockCreate | BlockMove | CommentCreate | CommentMove;
|
|
193
137
|
/**
|
|
@@ -196,15 +140,12 @@ export type BumpEvent = BlockCreate | BlockMove | CommentCreate | CommentMove;
|
|
|
196
140
|
*
|
|
197
141
|
* Not to be confused with bumping so that disconnected connections do not
|
|
198
142
|
* appear connected.
|
|
199
|
-
*
|
|
200
|
-
* @alias Blockly.Events.utils.BUMP_EVENTS
|
|
201
143
|
*/
|
|
202
144
|
export declare const BUMP_EVENTS: string[];
|
|
203
145
|
/**
|
|
204
146
|
* Create a custom event and fire it.
|
|
205
147
|
*
|
|
206
148
|
* @param event Custom data for event.
|
|
207
|
-
* @alias Blockly.Events.utils.fire
|
|
208
149
|
*/
|
|
209
150
|
export declare function fire(event: Abstract): void;
|
|
210
151
|
/**
|
|
@@ -219,41 +160,32 @@ declare function fireNow(): void;
|
|
|
219
160
|
* @param queueIn Array of events.
|
|
220
161
|
* @param forward True if forward (redo), false if backward (undo).
|
|
221
162
|
* @returns Array of filtered events.
|
|
222
|
-
* @alias Blockly.Events.utils.filter
|
|
223
163
|
*/
|
|
224
164
|
export declare function filter(queueIn: Abstract[], forward: boolean): Abstract[];
|
|
225
165
|
/**
|
|
226
166
|
* Modify pending undo events so that when they are fired they don't land
|
|
227
167
|
* in the undo stack. Called by Workspace.clearUndo.
|
|
228
|
-
*
|
|
229
|
-
* @alias Blockly.Events.utils.clearPendingUndo
|
|
230
168
|
*/
|
|
231
169
|
export declare function clearPendingUndo(): void;
|
|
232
170
|
/**
|
|
233
171
|
* Stop sending events. Every call to this function MUST also call enable.
|
|
234
|
-
*
|
|
235
|
-
* @alias Blockly.Events.utils.disable
|
|
236
172
|
*/
|
|
237
173
|
export declare function disable(): void;
|
|
238
174
|
/**
|
|
239
175
|
* Start sending events. Unless events were already disabled when the
|
|
240
176
|
* corresponding call to disable was made.
|
|
241
|
-
*
|
|
242
|
-
* @alias Blockly.Events.utils.enable
|
|
243
177
|
*/
|
|
244
178
|
export declare function enable(): void;
|
|
245
179
|
/**
|
|
246
180
|
* Returns whether events may be fired or not.
|
|
247
181
|
*
|
|
248
182
|
* @returns True if enabled.
|
|
249
|
-
* @alias Blockly.Events.utils.isEnabled
|
|
250
183
|
*/
|
|
251
184
|
export declare function isEnabled(): boolean;
|
|
252
185
|
/**
|
|
253
186
|
* Current group.
|
|
254
187
|
*
|
|
255
188
|
* @returns ID string.
|
|
256
|
-
* @alias Blockly.Events.utils.getGroup
|
|
257
189
|
*/
|
|
258
190
|
export declare function getGroup(): string;
|
|
259
191
|
/**
|
|
@@ -261,7 +193,6 @@ export declare function getGroup(): string;
|
|
|
261
193
|
*
|
|
262
194
|
* @param state True to start new group, false to end group.
|
|
263
195
|
* String to set group explicitly.
|
|
264
|
-
* @alias Blockly.Events.utils.setGroup
|
|
265
196
|
*/
|
|
266
197
|
export declare function setGroup(state: boolean | string): void;
|
|
267
198
|
/**
|
|
@@ -273,7 +204,6 @@ declare function setGroupInternal(state: boolean | string): void;
|
|
|
273
204
|
*
|
|
274
205
|
* @param block The root block.
|
|
275
206
|
* @returns List of block IDs.
|
|
276
|
-
* @alias Blockly.Events.utils.getDescendantIds
|
|
277
207
|
* @internal
|
|
278
208
|
*/
|
|
279
209
|
export declare function getDescendantIds(block: Block): string[];
|
|
@@ -284,7 +214,6 @@ export declare function getDescendantIds(block: Block): string[];
|
|
|
284
214
|
* @param workspace Target workspace for event.
|
|
285
215
|
* @returns The event represented by the JSON.
|
|
286
216
|
* @throws {Error} if an event type is not found in the registry.
|
|
287
|
-
* @alias Blockly.Events.utils.fromJson
|
|
288
217
|
*/
|
|
289
218
|
export declare function fromJson(json: any, workspace: Workspace): Abstract;
|
|
290
219
|
/**
|
|
@@ -292,7 +221,6 @@ export declare function fromJson(json: any, workspace: Workspace): Abstract;
|
|
|
292
221
|
*
|
|
293
222
|
* @param eventType The type of the event to get.
|
|
294
223
|
* @returns The event class with the given type.
|
|
295
|
-
* @alias Blockly.Events.utils.get
|
|
296
224
|
*/
|
|
297
225
|
export declare function get(eventType: string): (new (...p1: any[]) => Abstract);
|
|
298
226
|
/**
|
|
@@ -302,7 +230,6 @@ export declare function get(eventType: string): (new (...p1: any[]) => Abstract)
|
|
|
302
230
|
* users don't try to re-enable disabled orphan blocks.
|
|
303
231
|
*
|
|
304
232
|
* @param event Custom data for event.
|
|
305
|
-
* @alias Blockly.Events.utils.disableOrphans
|
|
306
233
|
*/
|
|
307
234
|
export declare function disableOrphans(event: Abstract): void;
|
|
308
235
|
export declare const TEST_ONLY: {
|
|
@@ -8,8 +8,6 @@ import { Abstract as AbstractEvent, AbstractEventJson } from './events_abstract.
|
|
|
8
8
|
/**
|
|
9
9
|
* Notifies listeners when the workspace has finished deserializing from
|
|
10
10
|
* JSON/XML.
|
|
11
|
-
*
|
|
12
|
-
* @alias Blockly.Events.FinishedLoading
|
|
13
11
|
*/
|
|
14
12
|
export declare class FinishedLoading extends AbstractEvent {
|
|
15
13
|
isBlank: boolean;
|
package/core/extensions.d.ts
CHANGED
|
@@ -17,7 +17,6 @@ export declare const TEST_ONLY: {
|
|
|
17
17
|
* @param initFn The function to initialize an extended block.
|
|
18
18
|
* @throws {Error} if the extension name is empty, the extension is already
|
|
19
19
|
* registered, or extensionFn is not a function.
|
|
20
|
-
* @alias Blockly.Extensions.register
|
|
21
20
|
*/
|
|
22
21
|
export declare function register(name: string, initFn: Function): void;
|
|
23
22
|
/**
|
|
@@ -27,7 +26,6 @@ export declare function register(name: string, initFn: Function): void;
|
|
|
27
26
|
* @param mixinObj The values to mix in.
|
|
28
27
|
* @throws {Error} if the extension name is empty or the extension is already
|
|
29
28
|
* registered.
|
|
30
|
-
* @alias Blockly.Extensions.registerMixin
|
|
31
29
|
*/
|
|
32
30
|
export declare function registerMixin(name: string, mixinObj: any): void;
|
|
33
31
|
/**
|
|
@@ -42,14 +40,12 @@ export declare function registerMixin(name: string, mixinObj: any): void;
|
|
|
42
40
|
* @param opt_blockList A list of blocks to appear in the flyout of the mutator
|
|
43
41
|
* dialog.
|
|
44
42
|
* @throws {Error} if the mutation is invalid or can't be applied to the block.
|
|
45
|
-
* @alias Blockly.Extensions.registerMutator
|
|
46
43
|
*/
|
|
47
44
|
export declare function registerMutator(name: string, mixinObj: any, opt_helperFn?: () => any, opt_blockList?: string[]): void;
|
|
48
45
|
/**
|
|
49
46
|
* Unregisters the extension registered with the given name.
|
|
50
47
|
*
|
|
51
48
|
* @param name The name of the extension to unregister.
|
|
52
|
-
* @alias Blockly.Extensions.unregister
|
|
53
49
|
*/
|
|
54
50
|
export declare function unregister(name: string): void;
|
|
55
51
|
/**
|
|
@@ -57,7 +53,6 @@ export declare function unregister(name: string): void;
|
|
|
57
53
|
*
|
|
58
54
|
* @param name The name of the extension to check for.
|
|
59
55
|
* @returns True if the extension is registered. False if it is not registered.
|
|
60
|
-
* @alias Blockly.Extensions.isRegistered
|
|
61
56
|
*/
|
|
62
57
|
export declare function isRegistered(name: string): boolean;
|
|
63
58
|
/**
|
|
@@ -68,7 +63,6 @@ export declare function isRegistered(name: string): boolean;
|
|
|
68
63
|
* @param block The block to apply the named extension to.
|
|
69
64
|
* @param isMutator True if this extension defines a mutator.
|
|
70
65
|
* @throws {Error} if the extension is not found.
|
|
71
|
-
* @alias Blockly.Extensions.apply
|
|
72
66
|
*/
|
|
73
67
|
export declare function apply(name: string, block: Block, isMutator: boolean): void;
|
|
74
68
|
/**
|
|
@@ -97,7 +91,6 @@ export declare function runAfterPageLoad(fn: () => void): void;
|
|
|
97
91
|
* lookup table.
|
|
98
92
|
* @param lookupTable The table of field values to tooltip text.
|
|
99
93
|
* @returns The extension function.
|
|
100
|
-
* @alias Blockly.Extensions.buildTooltipForDropdown
|
|
101
94
|
*/
|
|
102
95
|
export declare function buildTooltipForDropdown(dropdownName: string, lookupTable: {
|
|
103
96
|
[key: string]: string;
|
|
@@ -111,7 +104,6 @@ export declare function buildTooltipForDropdown(dropdownName: string, lookupTabl
|
|
|
111
104
|
* placeholder.
|
|
112
105
|
* @param fieldName The field with the replacement text.
|
|
113
106
|
* @returns The extension function.
|
|
114
|
-
* @alias Blockly.Extensions.buildTooltipWithFieldText
|
|
115
107
|
*/
|
|
116
108
|
export declare function buildTooltipWithFieldText(msgTemplate: string, fieldName: string): Function;
|
|
117
109
|
//# sourceMappingURL=extensions.d.ts.map
|
package/core/field.d.ts
CHANGED
|
@@ -15,14 +15,11 @@ import type { KeyboardShortcut } from './shortcut_registry.js';
|
|
|
15
15
|
import * as Tooltip from './tooltip.js';
|
|
16
16
|
import type { Coordinate } from './utils/coordinate.js';
|
|
17
17
|
import { Rect } from './utils/rect.js';
|
|
18
|
-
import { Sentinel } from './utils/sentinel.js';
|
|
19
18
|
import { Size } from './utils/size.js';
|
|
20
19
|
/**
|
|
21
20
|
* A function that is called to validate changes to the field's value before
|
|
22
21
|
* they are set.
|
|
23
22
|
*
|
|
24
|
-
* **NOTE:** Validation returns one option between `T`, `null`, and `undefined`.
|
|
25
|
-
*
|
|
26
23
|
* @see {@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/validators#return_values}
|
|
27
24
|
* @param newValue The value to be validated.
|
|
28
25
|
* @returns One of three instructions for setting the new value: `T`, `null`,
|
|
@@ -38,7 +35,6 @@ export type FieldValidator<T = any> = (newValue: T) => T | null | undefined;
|
|
|
38
35
|
/**
|
|
39
36
|
* Abstract class for an editable field.
|
|
40
37
|
*
|
|
41
|
-
* @alias Blockly.Field
|
|
42
38
|
* @typeParam T - The value stored on the field.
|
|
43
39
|
*/
|
|
44
40
|
export declare abstract class Field<T = any> implements IASTNodeLocationSvg, IASTNodeLocationWithBlock, IKeyboardAccessible, IRegistrable {
|
|
@@ -59,8 +55,7 @@ export declare abstract class Field<T = any> implements IASTNodeLocationSvg, IAS
|
|
|
59
55
|
* field's value or run configure_, and should allow a subclass to do that
|
|
60
56
|
* instead.
|
|
61
57
|
*/
|
|
62
|
-
static readonly SKIP_SETUP:
|
|
63
|
-
static isSentinel<T>(value: T | Sentinel): value is Sentinel;
|
|
58
|
+
static readonly SKIP_SETUP: unique symbol;
|
|
64
59
|
/**
|
|
65
60
|
* Name of field. Unique within each block.
|
|
66
61
|
* Static labels are usually unnamed.
|
|
@@ -147,14 +142,14 @@ export declare abstract class Field<T = any> implements IASTNodeLocationSvg, IAS
|
|
|
147
142
|
* Also accepts Field.SKIP_SETUP if you wish to skip setup (only used by
|
|
148
143
|
* subclasses that want to handle configuration and setting the field value
|
|
149
144
|
* after their own constructors have run).
|
|
150
|
-
* @param
|
|
145
|
+
* @param validator A function that is called to validate changes to the
|
|
151
146
|
* field's value. Takes in a value & returns a validated value, or null to
|
|
152
147
|
* abort the change.
|
|
153
|
-
* @param
|
|
148
|
+
* @param config A map of options used to configure the field.
|
|
154
149
|
* Refer to the individual field's documentation for a list of properties
|
|
155
150
|
* this parameter supports.
|
|
156
151
|
*/
|
|
157
|
-
constructor(value: T |
|
|
152
|
+
constructor(value: T | typeof Field.SKIP_SETUP, validator?: FieldValidator<T> | null, config?: FieldConfig);
|
|
158
153
|
/**
|
|
159
154
|
* Process the configuration map passed to the field.
|
|
160
155
|
*
|
|
@@ -402,12 +397,12 @@ export declare abstract class Field<T = any> implements IASTNodeLocationSvg, IAS
|
|
|
402
397
|
* Calls showEditor_ when the field is clicked if the field is clickable.
|
|
403
398
|
* Do not override.
|
|
404
399
|
*
|
|
405
|
-
* @param
|
|
400
|
+
* @param e Optional mouse event that triggered the field to open, or
|
|
406
401
|
* undefined if triggered programmatically.
|
|
407
402
|
* @sealed
|
|
408
403
|
* @internal
|
|
409
404
|
*/
|
|
410
|
-
showEditor(
|
|
405
|
+
showEditor(e?: Event): void;
|
|
411
406
|
/**
|
|
412
407
|
* A developer hook to create an editor for the field. This is no-op by
|
|
413
408
|
* default, and must be overriden to create an editor.
|
|
@@ -419,9 +414,9 @@ export declare abstract class Field<T = any> implements IASTNodeLocationSvg, IAS
|
|
|
419
414
|
/**
|
|
420
415
|
* Updates the size of the field based on the text.
|
|
421
416
|
*
|
|
422
|
-
* @param
|
|
417
|
+
* @param margin margin to use when positioning the text element.
|
|
423
418
|
*/
|
|
424
|
-
protected updateSize_(
|
|
419
|
+
protected updateSize_(margin?: number): void;
|
|
425
420
|
/**
|
|
426
421
|
* Position a field's text element after a size change. This handles both LTR
|
|
427
422
|
* and RTL positioning.
|
|
@@ -645,8 +640,12 @@ export declare abstract class Field<T = any> implements IASTNodeLocationSvg, IAS
|
|
|
645
640
|
* @internal
|
|
646
641
|
*/
|
|
647
642
|
setMarkerSvg(markerSvg: SVGElement): void;
|
|
648
|
-
/**
|
|
649
|
-
|
|
643
|
+
/**
|
|
644
|
+
* Redraw any attached marker or cursor svgs if needed.
|
|
645
|
+
*
|
|
646
|
+
* @internal
|
|
647
|
+
*/
|
|
648
|
+
updateMarkers_(): void;
|
|
650
649
|
}
|
|
651
650
|
/**
|
|
652
651
|
* Extra configuration options for the base field.
|
|
@@ -657,6 +656,8 @@ export interface FieldConfig {
|
|
|
657
656
|
/**
|
|
658
657
|
* For use by Field and descendants of Field. Constructors can change
|
|
659
658
|
* in descendants, though they should contain all of Field's prototype methods.
|
|
659
|
+
*
|
|
660
|
+
* @internal
|
|
660
661
|
*/
|
|
661
662
|
export type FieldProto = Pick<typeof Field, 'prototype'>;
|
|
662
663
|
/**
|
package/core/field_angle.d.ts
CHANGED
|
@@ -3,22 +3,19 @@
|
|
|
3
3
|
* Copyright 2013 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
import { Field } from './field.js';
|
|
6
7
|
import { FieldInput, FieldInputConfig, FieldInputValidator } from './field_input.js';
|
|
7
|
-
import type { Sentinel } from './utils/sentinel.js';
|
|
8
|
-
export type FieldAngleValidator = FieldInputValidator<number>;
|
|
9
8
|
/**
|
|
10
9
|
* Class for an editable angle field.
|
|
11
|
-
*
|
|
12
|
-
* @alias Blockly.FieldAngle
|
|
13
10
|
*/
|
|
14
11
|
export declare class FieldAngle extends FieldInput<number> {
|
|
15
|
-
/**
|
|
16
|
-
* The default amount to round angles to when using a mouse or keyboard nav
|
|
17
|
-
* input. Must be a positive integer to support keyboard navigation.
|
|
18
|
-
*/
|
|
19
|
-
static readonly ROUND = 15;
|
|
20
12
|
/** Half the width of protractor image. */
|
|
21
13
|
static readonly HALF: number;
|
|
14
|
+
/**
|
|
15
|
+
* Radius of protractor circle. Slightly smaller than protractor size since
|
|
16
|
+
* otherwise SVG crops off half the border at the edges.
|
|
17
|
+
*/
|
|
18
|
+
static readonly RADIUS: number;
|
|
22
19
|
/**
|
|
23
20
|
* Default property describing which direction makes an angle field's value
|
|
24
21
|
* increase. Angle increases clockwise (true) or counterclockwise (false).
|
|
@@ -36,60 +33,53 @@ export declare class FieldAngle extends FieldInput<number> {
|
|
|
36
33
|
*/
|
|
37
34
|
static readonly WRAP = 360;
|
|
38
35
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
36
|
+
* The default amount to round angles to when using a mouse or keyboard nav
|
|
37
|
+
* input. Must be a positive integer to support keyboard navigation.
|
|
41
38
|
*/
|
|
42
|
-
static readonly
|
|
39
|
+
static readonly ROUND = 15;
|
|
43
40
|
/**
|
|
44
41
|
* Whether the angle should increase as the angle picker is moved clockwise
|
|
45
42
|
* (true) or counterclockwise (false).
|
|
46
43
|
*/
|
|
47
|
-
private
|
|
44
|
+
private clockwise;
|
|
48
45
|
/**
|
|
49
46
|
* The offset of zero degrees (and all other angles).
|
|
50
47
|
*/
|
|
51
|
-
private
|
|
48
|
+
private offset;
|
|
52
49
|
/**
|
|
53
50
|
* The maximum angle to allow before wrapping.
|
|
54
51
|
*/
|
|
55
|
-
private
|
|
52
|
+
private wrap;
|
|
56
53
|
/**
|
|
57
54
|
* The amount to round angles to when using a mouse or keyboard nav input.
|
|
58
55
|
*/
|
|
59
|
-
private
|
|
60
|
-
/** The angle picker's SVG element. */
|
|
61
|
-
private editor_;
|
|
62
|
-
/** The angle picker's gauge path depending on the value. */
|
|
63
|
-
gauge_: SVGPathElement | null;
|
|
64
|
-
/** The angle picker's line drawn representing the value's angle. */
|
|
65
|
-
line_: SVGLineElement | null;
|
|
66
|
-
/** The degree symbol for this field. */
|
|
67
|
-
protected symbol_: SVGTSpanElement;
|
|
68
|
-
/** Wrapper click event data. */
|
|
69
|
-
private clickWrapper_;
|
|
70
|
-
/** Surface click event data. */
|
|
71
|
-
private clickSurfaceWrapper_;
|
|
72
|
-
/** Surface mouse move event data. */
|
|
73
|
-
private moveSurfaceWrapper_;
|
|
56
|
+
private round;
|
|
74
57
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
58
|
+
* Array holding info needed to unbind events.
|
|
59
|
+
* Used for disposing.
|
|
60
|
+
* Ex: [[node, name, func], [node, name, func]].
|
|
77
61
|
*/
|
|
78
|
-
|
|
62
|
+
private boundEvents;
|
|
63
|
+
/** Dynamic red line pointing at the value's angle. */
|
|
64
|
+
private line;
|
|
65
|
+
/** Dynamic pink area extending from 0 to the value's angle. */
|
|
66
|
+
private gauge;
|
|
67
|
+
/** The degree symbol for this field. */
|
|
68
|
+
protected symbol_: SVGTSpanElement | null;
|
|
79
69
|
/**
|
|
80
|
-
* @param
|
|
70
|
+
* @param value The initial value of the field. Should cast to a number.
|
|
81
71
|
* Defaults to 0. Also accepts Field.SKIP_SETUP if you wish to skip setup
|
|
82
72
|
* (only used by subclasses that want to handle configuration and setting
|
|
83
73
|
* the field value after their own constructors have run).
|
|
84
|
-
* @param
|
|
74
|
+
* @param validator A function that is called to validate changes to the
|
|
85
75
|
* field's value. Takes in a number & returns a validated number, or null
|
|
86
76
|
* to abort the change.
|
|
87
|
-
* @param
|
|
77
|
+
* @param config A map of options used to configure the field.
|
|
88
78
|
* See the [field creation documentation]{@link
|
|
89
79
|
* https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/angle#creation}
|
|
90
80
|
* for a list of properties this parameter supports.
|
|
91
81
|
*/
|
|
92
|
-
constructor(
|
|
82
|
+
constructor(value?: string | number | typeof Field.SKIP_SETUP, validator?: FieldAngleValidator, config?: FieldAngleConfig);
|
|
93
83
|
/**
|
|
94
84
|
* Configure the field based on the given map of options.
|
|
95
85
|
*
|
|
@@ -102,21 +92,25 @@ export declare class FieldAngle extends FieldInput<number> {
|
|
|
102
92
|
* @internal
|
|
103
93
|
*/
|
|
104
94
|
initView(): void;
|
|
105
|
-
/** Updates the
|
|
95
|
+
/** Updates the angle when the field rerenders. */
|
|
106
96
|
protected render_(): void;
|
|
107
97
|
/**
|
|
108
98
|
* Create and show the angle field's editor.
|
|
109
99
|
*
|
|
110
|
-
* @param
|
|
111
|
-
* undefined if triggered programmatically.
|
|
100
|
+
* @param e Optional mouse event that triggered the field to open,
|
|
101
|
+
* or undefined if triggered programmatically.
|
|
102
|
+
*/
|
|
103
|
+
protected showEditor_(e?: Event): void;
|
|
104
|
+
/**
|
|
105
|
+
* Creates the angle dropdown editor.
|
|
106
|
+
*
|
|
107
|
+
* @returns The newly created slider.
|
|
112
108
|
*/
|
|
113
|
-
|
|
114
|
-
/** Create the angle dropdown editor. */
|
|
115
|
-
private dropdownCreate_;
|
|
109
|
+
private dropdownCreate;
|
|
116
110
|
/** Disposes of events and DOM-references belonging to the angle editor. */
|
|
117
|
-
private
|
|
111
|
+
private dropdownDispose;
|
|
118
112
|
/** Hide the editor. */
|
|
119
|
-
private
|
|
113
|
+
private hide;
|
|
120
114
|
/**
|
|
121
115
|
* Set the angle to match the mouse's position.
|
|
122
116
|
*
|
|
@@ -130,9 +124,9 @@ export declare class FieldAngle extends FieldInput<number> {
|
|
|
130
124
|
*
|
|
131
125
|
* @param angle New angle.
|
|
132
126
|
*/
|
|
133
|
-
private
|
|
127
|
+
private displayMouseOrKeyboardValue;
|
|
134
128
|
/** Redraw the graph with the current angle. */
|
|
135
|
-
private
|
|
129
|
+
private updateGraph;
|
|
136
130
|
/**
|
|
137
131
|
* Handle key down to the editor.
|
|
138
132
|
*
|
|
@@ -142,17 +136,17 @@ export declare class FieldAngle extends FieldInput<number> {
|
|
|
142
136
|
/**
|
|
143
137
|
* Ensure that the input value is a valid angle.
|
|
144
138
|
*
|
|
145
|
-
* @param
|
|
139
|
+
* @param newValue The input value.
|
|
146
140
|
* @returns A valid angle, or null if invalid.
|
|
147
141
|
*/
|
|
148
|
-
protected doClassValidation_(
|
|
142
|
+
protected doClassValidation_(newValue?: any): number | null;
|
|
149
143
|
/**
|
|
150
144
|
* Wraps the value so that it is in the range (-360 + wrap, wrap).
|
|
151
145
|
*
|
|
152
146
|
* @param value The value to wrap.
|
|
153
147
|
* @returns The wrapped value.
|
|
154
148
|
*/
|
|
155
|
-
private
|
|
149
|
+
private wrapValue;
|
|
156
150
|
/**
|
|
157
151
|
* Construct a FieldAngle from a JSON arg object.
|
|
158
152
|
*
|
|
@@ -197,4 +191,20 @@ export interface FieldAngleConfig extends FieldInputConfig {
|
|
|
197
191
|
export interface FieldAngleFromJsonConfig extends FieldAngleConfig {
|
|
198
192
|
angle?: number;
|
|
199
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* A function that is called to validate changes to the field's value before
|
|
196
|
+
* they are set.
|
|
197
|
+
*
|
|
198
|
+
* @see {@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/validators#return_values}
|
|
199
|
+
* @param newValue The value to be validated.
|
|
200
|
+
* @returns One of three instructions for setting the new value: `T`, `null`,
|
|
201
|
+
* or `undefined`.
|
|
202
|
+
*
|
|
203
|
+
* - `T` to set this function's returned value instead of `newValue`.
|
|
204
|
+
*
|
|
205
|
+
* - `null` to invoke `doValueInvalid_` and not set a value.
|
|
206
|
+
*
|
|
207
|
+
* - `undefined` to set `newValue` as is.
|
|
208
|
+
*/
|
|
209
|
+
export type FieldAngleValidator = FieldInputValidator<number>;
|
|
200
210
|
//# sourceMappingURL=field_angle.d.ts.map
|