blockly 11.0.0-beta.5 → 11.0.0-beta.7
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 +722 -763
- package/blockly_compressed.js +676 -680
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js +27 -29
- package/blocks_compressed.js.map +1 -1
- package/core/block.d.ts +12 -6
- package/core/block_svg.d.ts +28 -42
- package/core/blockly.d.ts +11 -51
- package/core/bubbles/bubble.d.ts +17 -2
- package/core/bubbles/mini_workspace_bubble.d.ts +1 -1
- package/core/bubbles/text_bubble.d.ts +1 -1
- package/core/bubbles/textinput_bubble.d.ts +1 -1
- package/core/clipboard.d.ts +0 -19
- package/core/comments/comment_view.d.ts +207 -0
- package/core/comments/rendered_workspace_comment.d.ts +75 -0
- package/core/comments/workspace_comment.d.ts +107 -0
- package/core/comments.d.ts +9 -0
- package/core/connection.d.ts +1 -1
- package/core/delete_area.d.ts +1 -2
- package/core/dragging/block_drag_strategy.d.ts +105 -0
- package/core/dragging/bubble_drag_strategy.d.ts +20 -0
- package/core/dragging/comment_drag_strategy.d.ts +20 -0
- package/core/dragging/dragger.d.ts +47 -0
- package/core/events/events.d.ts +3 -0
- package/core/events/events_click.d.ts +1 -1
- package/core/events/events_comment_base.d.ts +6 -1
- package/core/events/events_comment_change.d.ts +1 -1
- package/core/events/events_comment_collapse.d.ts +39 -0
- package/core/events/events_comment_create.d.ts +5 -1
- package/core/events/events_comment_delete.d.ts +5 -1
- package/core/events/events_comment_move.d.ts +17 -1
- package/core/events/utils.d.ts +2 -0
- package/core/field_dropdown.d.ts +1 -0
- package/core/field_image.d.ts +1 -1
- package/core/flyout_base.d.ts +17 -1
- package/core/flyout_button.d.ts +26 -1
- package/core/generator.d.ts +1 -1
- package/core/gesture.d.ts +25 -54
- package/core/grid.d.ts +9 -9
- package/core/icons/comment_icon.d.ts +8 -3
- package/core/icons/icon.d.ts +0 -6
- package/core/icons/icon_types.d.ts +2 -2
- package/core/icons/mutator_icon.d.ts +1 -16
- package/core/icons/warning_icon.d.ts +1 -1
- package/core/inputs/input.d.ts +10 -19
- package/core/{connection_previewers/insertion_marker_previewer.d.ts → insertion_marker_previewer.d.ts} +3 -3
- package/core/interfaces/i_comment_icon.d.ts +21 -0
- package/core/interfaces/i_deletable.d.ts +6 -0
- package/core/interfaces/i_delete_area.d.ts +1 -2
- package/core/interfaces/i_draggable.d.ts +47 -3
- package/core/interfaces/i_dragger.d.ts +32 -0
- package/core/interfaces/i_has_bubble.d.ts +1 -1
- package/core/interfaces/i_parameter_model.d.ts +7 -0
- package/core/interfaces/i_procedure_model.d.ts +7 -0
- package/core/interfaces/i_selectable.d.ts +5 -3
- package/core/internal_constants.d.ts +0 -7
- package/core/keyboard_nav/ast_node.d.ts +21 -2
- package/core/options.d.ts +1 -0
- package/core/registry.d.ts +2 -2
- package/core/renderers/common/drawer.d.ts +0 -7
- package/core/renderers/common/marker_svg.d.ts +7 -0
- package/core/renderers/measurables/icon.d.ts +0 -5
- package/core/serialization/priorities.d.ts +2 -0
- package/core/serialization/procedures.d.ts +28 -26
- package/core/serialization/workspace_comments.d.ts +45 -0
- package/core/serialization.d.ts +2 -1
- package/core/toolbox/toolbox.d.ts +1 -2
- package/core/utils/dom.d.ts +0 -9
- package/core/utils/keycodes.d.ts +32 -32
- package/core/utils/size.d.ts +10 -0
- package/core/utils/string.d.ts +0 -10
- package/core/workspace_comment_svg.d.ts +1 -2
- package/core/workspace_svg.d.ts +0 -27
- package/core/xml.d.ts +9 -3
- package/core-node.js +31 -0
- package/dart.d.ts +1 -24
- package/dart_compressed.js +22 -72
- package/dart_compressed.js.map +1 -1
- package/generators/dart/dart_generator.d.ts +17 -17
- package/generators/dart/text.d.ts +0 -1
- package/generators/javascript/javascript_generator.d.ts +34 -35
- package/generators/javascript/text.d.ts +0 -1
- package/generators/lua/lua_generator.d.ts +10 -10
- package/generators/lua/text.d.ts +0 -1
- package/generators/php/php_generator.d.ts +36 -36
- package/generators/php/text.d.ts +0 -1
- package/generators/python/python_generator.d.ts +20 -21
- package/generators/python/text.d.ts +0 -1
- package/index.js +19 -7
- package/javascript.d.ts +1 -41
- package/javascript_compressed.js +19 -54
- package/javascript_compressed.js.map +1 -1
- package/lua.d.ts +1 -18
- package/lua_compressed.js +24 -47
- package/lua_compressed.js.map +1 -1
- package/media/delete-icon.svg +1 -0
- package/media/foldout-icon.svg +1 -0
- package/media/resize-handle.svg +3 -0
- package/msg/ce.d.ts +8 -0
- package/msg/dtp.d.ts +8 -0
- package/msg/hsb.d.ts +8 -0
- package/msg/tdd.d.ts +8 -0
- package/package.json +46 -12
- package/php.d.ts +1 -43
- package/php_compressed.js +13 -46
- package/php_compressed.js.map +1 -1
- package/python.d.ts +1 -27
- package/python_compressed.js +21 -40
- package/python_compressed.js.map +1 -1
- package/blockly.js +0 -22
- package/blocks.js +0 -22
- package/browser.js +0 -30
- package/core/block_dragger.d.ts +0 -212
- package/core/bubble_dragger.d.ts +0 -77
- package/core/field_angle.d.ts +0 -208
- package/core/field_colour.d.ts +0 -243
- package/core/field_multilineinput.d.ts +0 -182
- package/core/interfaces/i_block_dragger.d.ts +0 -47
- package/core/renderers/minimalist/constants.d.ts +0 -21
- package/core/renderers/minimalist/drawer.d.ts +0 -26
- package/core/renderers/minimalist/info.d.ts +0 -35
- package/core/renderers/minimalist/minimalist.d.ts +0 -12
- package/core/renderers/minimalist/renderer.d.ts +0 -48
- package/core-browser.js +0 -26
- package/core.js +0 -26
- package/dart.js +0 -22
- package/generators/dart/colour.d.ts +0 -16
- package/generators/javascript/colour.d.ts +0 -16
- package/generators/lua/colour.d.ts +0 -16
- package/generators/php/colour.d.ts +0 -16
- package/generators/python/colour.d.ts +0 -16
- package/javascript.js +0 -23
- package/lua.js +0 -22
- package/msg/constants.d.ts +0 -14
- package/msg/qqq.d.ts +0 -14
- package/msg/synonyms.d.ts +0 -14
- package/node.js +0 -21
- package/php.js +0 -22
- package/python.js +0 -23
package/core/field_colour.d.ts
DELETED
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2012 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Colour input field.
|
|
8
|
-
*
|
|
9
|
-
* @class
|
|
10
|
-
*/
|
|
11
|
-
import './events/events_block_change.js';
|
|
12
|
-
import { Field, FieldConfig, FieldValidator } from './field.js';
|
|
13
|
-
import { Size } from './utils/size.js';
|
|
14
|
-
/**
|
|
15
|
-
* Class for a colour input field.
|
|
16
|
-
*/
|
|
17
|
-
export declare class FieldColour extends Field<string> {
|
|
18
|
-
/**
|
|
19
|
-
* An array of colour strings for the palette.
|
|
20
|
-
* Copied from goog.ui.ColorPicker.SIMPLE_GRID_COLORS
|
|
21
|
-
* All colour pickers use this unless overridden with setColours.
|
|
22
|
-
*/
|
|
23
|
-
static COLOURS: string[];
|
|
24
|
-
/**
|
|
25
|
-
* An array of tooltip strings for the palette. If not the same length as
|
|
26
|
-
* COLOURS, the colour's hex code will be used for any missing titles.
|
|
27
|
-
* All colour pickers use this unless overridden with setColours.
|
|
28
|
-
*/
|
|
29
|
-
static TITLES: string[];
|
|
30
|
-
/**
|
|
31
|
-
* Number of columns in the palette.
|
|
32
|
-
* All colour pickers use this unless overridden with setColumns.
|
|
33
|
-
*/
|
|
34
|
-
static COLUMNS: number;
|
|
35
|
-
/** The field's colour picker element. */
|
|
36
|
-
private picker;
|
|
37
|
-
/** Index of the currently highlighted element. */
|
|
38
|
-
private highlightedIndex;
|
|
39
|
-
/**
|
|
40
|
-
* Array holding info needed to unbind events.
|
|
41
|
-
* Used for disposing.
|
|
42
|
-
* Ex: [[node, name, func], [node, name, func]].
|
|
43
|
-
*/
|
|
44
|
-
private boundEvents;
|
|
45
|
-
/**
|
|
46
|
-
* Serializable fields are saved by the serializer, non-serializable fields
|
|
47
|
-
* are not. Editable fields should also be serializable.
|
|
48
|
-
*/
|
|
49
|
-
SERIALIZABLE: boolean;
|
|
50
|
-
/** Mouse cursor style when over the hotspot that initiates the editor. */
|
|
51
|
-
CURSOR: string;
|
|
52
|
-
/**
|
|
53
|
-
* Used to tell if the field needs to be rendered the next time the block is
|
|
54
|
-
* rendered. Colour fields are statically sized, and only need to be
|
|
55
|
-
* rendered at initialization.
|
|
56
|
-
*/
|
|
57
|
-
protected isDirty_: boolean;
|
|
58
|
-
/** Array of colours used by this field. If null, use the global list. */
|
|
59
|
-
private colours;
|
|
60
|
-
/**
|
|
61
|
-
* Array of colour tooltips used by this field. If null, use the global
|
|
62
|
-
* list.
|
|
63
|
-
*/
|
|
64
|
-
private titles;
|
|
65
|
-
/**
|
|
66
|
-
* Number of colour columns used by this field. If 0, use the global
|
|
67
|
-
* setting. By default use the global constants for columns.
|
|
68
|
-
*/
|
|
69
|
-
private columns;
|
|
70
|
-
/**
|
|
71
|
-
* @param value The initial value of the field. Should be in '#rrggbb'
|
|
72
|
-
* format. Defaults to the first value in the default colour array. Also
|
|
73
|
-
* accepts Field.SKIP_SETUP if you wish to skip setup (only used by
|
|
74
|
-
* subclasses that want to handle configuration and setting the field
|
|
75
|
-
* value after their own constructors have run).
|
|
76
|
-
* @param validator A function that is called to validate changes to the
|
|
77
|
-
* field's value. Takes in a colour string & returns a validated colour
|
|
78
|
-
* string ('#rrggbb' format), or null to abort the change.
|
|
79
|
-
* @param config A map of options used to configure the field.
|
|
80
|
-
* See the [field creation documentation]{@link
|
|
81
|
-
* https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/colour}
|
|
82
|
-
* for a list of properties this parameter supports.
|
|
83
|
-
*/
|
|
84
|
-
constructor(value?: string | typeof Field.SKIP_SETUP, validator?: FieldColourValidator, config?: FieldColourConfig);
|
|
85
|
-
/**
|
|
86
|
-
* Configure the field based on the given map of options.
|
|
87
|
-
*
|
|
88
|
-
* @param config A map of options to configure the field based on.
|
|
89
|
-
*/
|
|
90
|
-
protected configure_(config: FieldColourConfig): void;
|
|
91
|
-
/**
|
|
92
|
-
* Create the block UI for this colour field.
|
|
93
|
-
*/
|
|
94
|
-
initView(): void;
|
|
95
|
-
protected isFullBlockField(): boolean;
|
|
96
|
-
/**
|
|
97
|
-
* Updates text field to match the colour/style of the block.
|
|
98
|
-
*/
|
|
99
|
-
applyColour(): void;
|
|
100
|
-
/**
|
|
101
|
-
* Returns the height and width of the field.
|
|
102
|
-
*
|
|
103
|
-
* This should *in general* be the only place render_ gets called from.
|
|
104
|
-
*
|
|
105
|
-
* @returns Height and width.
|
|
106
|
-
*/
|
|
107
|
-
getSize(): Size;
|
|
108
|
-
/**
|
|
109
|
-
* Updates the colour of the block to reflect whether this is a full
|
|
110
|
-
* block field or not.
|
|
111
|
-
*/
|
|
112
|
-
protected render_(): void;
|
|
113
|
-
/**
|
|
114
|
-
* Updates the size of the field based on whether it is a full block field
|
|
115
|
-
* or not.
|
|
116
|
-
*
|
|
117
|
-
* @param margin margin to use when positioning the field.
|
|
118
|
-
*/
|
|
119
|
-
protected updateSize_(margin?: number): void;
|
|
120
|
-
/**
|
|
121
|
-
* Ensure that the input value is a valid colour.
|
|
122
|
-
*
|
|
123
|
-
* @param newValue The input value.
|
|
124
|
-
* @returns A valid colour, or null if invalid.
|
|
125
|
-
*/
|
|
126
|
-
protected doClassValidation_(newValue?: any): string | null;
|
|
127
|
-
/**
|
|
128
|
-
* Get the text for this field. Used when the block is collapsed.
|
|
129
|
-
*
|
|
130
|
-
* @returns Text representing the value of this field.
|
|
131
|
-
*/
|
|
132
|
-
getText(): string;
|
|
133
|
-
/**
|
|
134
|
-
* Set a custom colour grid for this field.
|
|
135
|
-
*
|
|
136
|
-
* @param colours Array of colours for this block, or null to use default
|
|
137
|
-
* (FieldColour.COLOURS).
|
|
138
|
-
* @param titles Optional array of colour tooltips, or null to use default
|
|
139
|
-
* (FieldColour.TITLES).
|
|
140
|
-
* @returns Returns itself (for method chaining).
|
|
141
|
-
*/
|
|
142
|
-
setColours(colours: string[], titles?: string[]): FieldColour;
|
|
143
|
-
/**
|
|
144
|
-
* Set a custom grid size for this field.
|
|
145
|
-
*
|
|
146
|
-
* @param columns Number of columns for this block, or 0 to use default
|
|
147
|
-
* (FieldColour.COLUMNS).
|
|
148
|
-
* @returns Returns itself (for method chaining).
|
|
149
|
-
*/
|
|
150
|
-
setColumns(columns: number): FieldColour;
|
|
151
|
-
/** Create and show the colour field's editor. */
|
|
152
|
-
protected showEditor_(): void;
|
|
153
|
-
/**
|
|
154
|
-
* Handle a click on a colour cell.
|
|
155
|
-
*
|
|
156
|
-
* @param e Mouse event.
|
|
157
|
-
*/
|
|
158
|
-
private onClick;
|
|
159
|
-
/**
|
|
160
|
-
* Handle a key down event. Navigate around the grid with the
|
|
161
|
-
* arrow keys. Enter selects the highlighted colour.
|
|
162
|
-
*
|
|
163
|
-
* @param e Keyboard event.
|
|
164
|
-
*/
|
|
165
|
-
private onKeyDown;
|
|
166
|
-
/**
|
|
167
|
-
* Move the currently highlighted position by dx and dy.
|
|
168
|
-
*
|
|
169
|
-
* @param dx Change of x.
|
|
170
|
-
* @param dy Change of y.
|
|
171
|
-
*/
|
|
172
|
-
private moveHighlightBy;
|
|
173
|
-
/**
|
|
174
|
-
* Handle a mouse move event. Highlight the hovered colour.
|
|
175
|
-
*
|
|
176
|
-
* @param e Mouse event.
|
|
177
|
-
*/
|
|
178
|
-
private onMouseMove;
|
|
179
|
-
/** Handle a mouse enter event. Focus the picker. */
|
|
180
|
-
private onMouseEnter;
|
|
181
|
-
/**
|
|
182
|
-
* Handle a mouse leave event. Blur the picker and unhighlight
|
|
183
|
-
* the currently highlighted colour.
|
|
184
|
-
*/
|
|
185
|
-
private onMouseLeave;
|
|
186
|
-
/**
|
|
187
|
-
* Returns the currently highlighted item (if any).
|
|
188
|
-
*
|
|
189
|
-
* @returns Highlighted item (null if none).
|
|
190
|
-
*/
|
|
191
|
-
private getHighlighted;
|
|
192
|
-
/**
|
|
193
|
-
* Update the currently highlighted cell.
|
|
194
|
-
*
|
|
195
|
-
* @param cell The new cell to highlight.
|
|
196
|
-
* @param index The index of the new cell.
|
|
197
|
-
*/
|
|
198
|
-
private setHighlightedCell;
|
|
199
|
-
/** Create a colour picker dropdown editor. */
|
|
200
|
-
private dropdownCreate;
|
|
201
|
-
/** Disposes of events and DOM-references belonging to the colour editor. */
|
|
202
|
-
private dropdownDispose;
|
|
203
|
-
/**
|
|
204
|
-
* Construct a FieldColour from a JSON arg object.
|
|
205
|
-
*
|
|
206
|
-
* @param options A JSON object with options (colour).
|
|
207
|
-
* @returns The new field instance.
|
|
208
|
-
* @nocollapse
|
|
209
|
-
* @internal
|
|
210
|
-
*/
|
|
211
|
-
static fromJson(options: FieldColourFromJsonConfig): FieldColour;
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Config options for the colour field.
|
|
215
|
-
*/
|
|
216
|
-
export interface FieldColourConfig extends FieldConfig {
|
|
217
|
-
colourOptions?: string[];
|
|
218
|
-
colourTitles?: string[];
|
|
219
|
-
columns?: number;
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* fromJson config options for the colour field.
|
|
223
|
-
*/
|
|
224
|
-
export interface FieldColourFromJsonConfig extends FieldColourConfig {
|
|
225
|
-
colour?: string;
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* A function that is called to validate changes to the field's value before
|
|
229
|
-
* they are set.
|
|
230
|
-
*
|
|
231
|
-
* @see {@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/validators#return_values}
|
|
232
|
-
* @param newValue The value to be validated.
|
|
233
|
-
* @returns One of three instructions for setting the new value: `T`, `null`,
|
|
234
|
-
* or `undefined`.
|
|
235
|
-
*
|
|
236
|
-
* - `T` to set this function's returned value instead of `newValue`.
|
|
237
|
-
*
|
|
238
|
-
* - `null` to invoke `doValueInvalid_` and not set a value.
|
|
239
|
-
*
|
|
240
|
-
* - `undefined` to set `newValue` as is.
|
|
241
|
-
*/
|
|
242
|
-
export type FieldColourValidator = FieldValidator<string>;
|
|
243
|
-
//# sourceMappingURL=field_colour.d.ts.map
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { Field } from './field.js';
|
|
7
|
-
import { FieldTextInput, FieldTextInputConfig, FieldTextInputValidator } from './field_textinput.js';
|
|
8
|
-
/**
|
|
9
|
-
* Class for an editable text area field.
|
|
10
|
-
*/
|
|
11
|
-
export declare class FieldMultilineInput extends FieldTextInput {
|
|
12
|
-
/**
|
|
13
|
-
* The SVG group element that will contain a text element for each text row
|
|
14
|
-
* when initialized.
|
|
15
|
-
*/
|
|
16
|
-
textGroup: SVGGElement | null;
|
|
17
|
-
/**
|
|
18
|
-
* Defines the maximum number of lines of field.
|
|
19
|
-
* If exceeded, scrolling functionality is enabled.
|
|
20
|
-
*/
|
|
21
|
-
protected maxLines_: number;
|
|
22
|
-
/** Whether Y overflow is currently occurring. */
|
|
23
|
-
protected isOverflowedY_: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* @param value The initial content of the field. Should cast to a string.
|
|
26
|
-
* Defaults to an empty string if null or undefined. Also accepts
|
|
27
|
-
* Field.SKIP_SETUP if you wish to skip setup (only used by subclasses
|
|
28
|
-
* that want to handle configuration and setting the field value after
|
|
29
|
-
* their own constructors have run).
|
|
30
|
-
* @param validator An optional function that is called to validate any
|
|
31
|
-
* constraints on what the user entered. Takes the new text as an
|
|
32
|
-
* argument and returns either the accepted text, a replacement text, or
|
|
33
|
-
* null to abort the change.
|
|
34
|
-
* @param config A map of options used to configure the field.
|
|
35
|
-
* See the [field creation documentation]{@link
|
|
36
|
-
* https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/multiline-text-input#creation}
|
|
37
|
-
* for a list of properties this parameter supports.
|
|
38
|
-
*/
|
|
39
|
-
constructor(value?: string | typeof Field.SKIP_SETUP, validator?: FieldMultilineInputValidator, config?: FieldMultilineInputConfig);
|
|
40
|
-
/**
|
|
41
|
-
* Configure the field based on the given map of options.
|
|
42
|
-
*
|
|
43
|
-
* @param config A map of options to configure the field based on.
|
|
44
|
-
*/
|
|
45
|
-
protected configure_(config: FieldMultilineInputConfig): void;
|
|
46
|
-
/**
|
|
47
|
-
* Serializes this field's value to XML. Should only be called by Blockly.Xml.
|
|
48
|
-
*
|
|
49
|
-
* @param fieldElement The element to populate with info about the field's
|
|
50
|
-
* state.
|
|
51
|
-
* @returns The element containing info about the field's state.
|
|
52
|
-
* @internal
|
|
53
|
-
*/
|
|
54
|
-
toXml(fieldElement: Element): Element;
|
|
55
|
-
/**
|
|
56
|
-
* Sets the field's value based on the given XML element. Should only be
|
|
57
|
-
* called by Blockly.Xml.
|
|
58
|
-
*
|
|
59
|
-
* @param fieldElement The element containing info about the field's state.
|
|
60
|
-
* @internal
|
|
61
|
-
*/
|
|
62
|
-
fromXml(fieldElement: Element): void;
|
|
63
|
-
/**
|
|
64
|
-
* Saves this field's value.
|
|
65
|
-
* This function only exists for subclasses of FieldMultilineInput which
|
|
66
|
-
* predate the load/saveState API and only define to/fromXml.
|
|
67
|
-
*
|
|
68
|
-
* @returns The state of this field.
|
|
69
|
-
* @internal
|
|
70
|
-
*/
|
|
71
|
-
saveState(): any;
|
|
72
|
-
/**
|
|
73
|
-
* Sets the field's value based on the given state.
|
|
74
|
-
* This function only exists for subclasses of FieldMultilineInput which
|
|
75
|
-
* predate the load/saveState API and only define to/fromXml.
|
|
76
|
-
*
|
|
77
|
-
* @param state The state of the variable to assign to this variable field.
|
|
78
|
-
* @internal
|
|
79
|
-
*/
|
|
80
|
-
loadState(state: any): void;
|
|
81
|
-
/**
|
|
82
|
-
* Create the block UI for this field.
|
|
83
|
-
*/
|
|
84
|
-
initView(): void;
|
|
85
|
-
/**
|
|
86
|
-
* Get the text from this field as displayed on screen. May differ from
|
|
87
|
-
* getText due to ellipsis, and other formatting.
|
|
88
|
-
*
|
|
89
|
-
* @returns Currently displayed text.
|
|
90
|
-
*/
|
|
91
|
-
protected getDisplayText_(): string;
|
|
92
|
-
/**
|
|
93
|
-
* Called by setValue if the text input is valid. Updates the value of the
|
|
94
|
-
* field, and updates the text of the field if it is not currently being
|
|
95
|
-
* edited (i.e. handled by the htmlInput_). Is being redefined here to update
|
|
96
|
-
* overflow state of the field.
|
|
97
|
-
*
|
|
98
|
-
* @param newValue The value to be saved. The default validator guarantees
|
|
99
|
-
* that this is a string.
|
|
100
|
-
*/
|
|
101
|
-
protected doValueUpdate_(newValue: string): void;
|
|
102
|
-
/** Updates the text of the textElement. */
|
|
103
|
-
protected render_(): void;
|
|
104
|
-
/** Updates the size of the field based on the text. */
|
|
105
|
-
protected updateSize_(): void;
|
|
106
|
-
/**
|
|
107
|
-
* Show the inline free-text editor on top of the text.
|
|
108
|
-
* Overrides the default behaviour to force rerender in order to
|
|
109
|
-
* correct block size, based on editor text.
|
|
110
|
-
*
|
|
111
|
-
* @param e Optional mouse event that triggered the field to open, or
|
|
112
|
-
* undefined if triggered programmatically.
|
|
113
|
-
* @param quietInput True if editor should be created without focus.
|
|
114
|
-
* Defaults to false.
|
|
115
|
-
*/
|
|
116
|
-
showEditor_(e?: Event, quietInput?: boolean): void;
|
|
117
|
-
/**
|
|
118
|
-
* Create the text input editor widget.
|
|
119
|
-
*
|
|
120
|
-
* @returns The newly created text input editor.
|
|
121
|
-
*/
|
|
122
|
-
protected widgetCreate_(): HTMLTextAreaElement;
|
|
123
|
-
/**
|
|
124
|
-
* Sets the maxLines config for this field.
|
|
125
|
-
*
|
|
126
|
-
* @param maxLines Defines the maximum number of lines allowed, before
|
|
127
|
-
* scrolling functionality is enabled.
|
|
128
|
-
*/
|
|
129
|
-
setMaxLines(maxLines: number): void;
|
|
130
|
-
/**
|
|
131
|
-
* Returns the maxLines config of this field.
|
|
132
|
-
*
|
|
133
|
-
* @returns The maxLines config value.
|
|
134
|
-
*/
|
|
135
|
-
getMaxLines(): number;
|
|
136
|
-
/**
|
|
137
|
-
* Handle key down to the editor. Override the text input definition of this
|
|
138
|
-
* so as to not close the editor when enter is typed in.
|
|
139
|
-
*
|
|
140
|
-
* @param e Keyboard event.
|
|
141
|
-
*/
|
|
142
|
-
protected onHtmlInputKeyDown_(e: KeyboardEvent): void;
|
|
143
|
-
/**
|
|
144
|
-
* Construct a FieldMultilineInput from a JSON arg object,
|
|
145
|
-
* dereferencing any string table references.
|
|
146
|
-
*
|
|
147
|
-
* @param options A JSON object with options (text, and spellcheck).
|
|
148
|
-
* @returns The new field instance.
|
|
149
|
-
* @nocollapse
|
|
150
|
-
* @internal
|
|
151
|
-
*/
|
|
152
|
-
static fromJson(options: FieldMultilineInputFromJsonConfig): FieldMultilineInput;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Config options for the multiline input field.
|
|
156
|
-
*/
|
|
157
|
-
export interface FieldMultilineInputConfig extends FieldTextInputConfig {
|
|
158
|
-
maxLines?: number;
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* fromJson config options for the multiline input field.
|
|
162
|
-
*/
|
|
163
|
-
export interface FieldMultilineInputFromJsonConfig extends FieldMultilineInputConfig {
|
|
164
|
-
text?: string;
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* A function that is called to validate changes to the field's value before
|
|
168
|
-
* they are set.
|
|
169
|
-
*
|
|
170
|
-
* @see {@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/validators#return_values}
|
|
171
|
-
* @param newValue The value to be validated.
|
|
172
|
-
* @returns One of three instructions for setting the new value: `T`, `null`,
|
|
173
|
-
* or `undefined`.
|
|
174
|
-
*
|
|
175
|
-
* - `T` to set this function's returned value instead of `newValue`.
|
|
176
|
-
*
|
|
177
|
-
* - `null` to invoke `doValueInvalid_` and not set a value.
|
|
178
|
-
*
|
|
179
|
-
* - `undefined` to set `newValue` as is.
|
|
180
|
-
*/
|
|
181
|
-
export type FieldMultilineInputValidator = FieldTextInputValidator;
|
|
182
|
-
//# sourceMappingURL=field_multilineinput.d.ts.map
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2021 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import type { Coordinate } from '../utils/coordinate.js';
|
|
7
|
-
import type { BlockSvg } from '../block_svg.js';
|
|
8
|
-
/**
|
|
9
|
-
* A block dragger interface.
|
|
10
|
-
*/
|
|
11
|
-
export interface IBlockDragger {
|
|
12
|
-
/**
|
|
13
|
-
* Start dragging a block.
|
|
14
|
-
*
|
|
15
|
-
* @param currentDragDeltaXY How far the pointer has moved from the position
|
|
16
|
-
* at mouse down, in pixel units.
|
|
17
|
-
* @param healStack Whether or not to heal the stack after disconnecting.
|
|
18
|
-
*/
|
|
19
|
-
startDrag(currentDragDeltaXY: Coordinate, healStack: boolean): void;
|
|
20
|
-
/**
|
|
21
|
-
* Execute a step of block dragging, based on the given event. Update the
|
|
22
|
-
* display accordingly.
|
|
23
|
-
*
|
|
24
|
-
* @param e The most recent move event.
|
|
25
|
-
* @param currentDragDeltaXY How far the pointer has moved from the position
|
|
26
|
-
* at the start of the drag, in pixel units.
|
|
27
|
-
*/
|
|
28
|
-
drag(e: Event, currentDragDeltaXY: Coordinate): void;
|
|
29
|
-
/**
|
|
30
|
-
* Finish a block drag and put the block back on the workspace.
|
|
31
|
-
*
|
|
32
|
-
* @param e The mouseup/touchend event.
|
|
33
|
-
* @param currentDragDeltaXY How far the pointer has moved from the position
|
|
34
|
-
* at the start of the drag, in pixel units.
|
|
35
|
-
*/
|
|
36
|
-
endDrag(e: Event, currentDragDeltaXY: Coordinate): void;
|
|
37
|
-
/**
|
|
38
|
-
* Get a list of the insertion markers that currently exist. Drags have 0, 1,
|
|
39
|
-
* or 2 insertion markers.
|
|
40
|
-
*
|
|
41
|
-
* @returns A possibly empty list of insertion marker blocks.
|
|
42
|
-
*/
|
|
43
|
-
getInsertionMarkers(): BlockSvg[];
|
|
44
|
-
/** Sever all links from this object and do any necessary cleanup. */
|
|
45
|
-
dispose(): void;
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=i_block_dragger.d.ts.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { ConstantProvider as BaseConstantProvider } from '../common/constants.js';
|
|
7
|
-
/**
|
|
8
|
-
* An object that provides constants for rendering blocks in the minimalist
|
|
9
|
-
* renderer.
|
|
10
|
-
*
|
|
11
|
-
* @deprecated Use Blockly.blockRendering.ConstantProvider instead.
|
|
12
|
-
* To be removed in v11.
|
|
13
|
-
*/
|
|
14
|
-
export declare class ConstantProvider extends BaseConstantProvider {
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated Use Blockly.blockRendering.ConstantProvider instead.
|
|
17
|
-
* To be removed in v11.
|
|
18
|
-
*/
|
|
19
|
-
constructor();
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import type { BlockSvg } from '../../block_svg.js';
|
|
7
|
-
import { Drawer as BaseDrawer } from '../common/drawer.js';
|
|
8
|
-
import type { RenderInfo } from './info.js';
|
|
9
|
-
/**
|
|
10
|
-
* An object that draws a block based on the given rendering information.
|
|
11
|
-
*
|
|
12
|
-
* @deprecated Use Blockly.blockRendering.Drawer instead.
|
|
13
|
-
* To be removed in v11.
|
|
14
|
-
*/
|
|
15
|
-
export declare class Drawer extends BaseDrawer {
|
|
16
|
-
/**
|
|
17
|
-
* @param block The block to render.
|
|
18
|
-
* @param info An object containing all information needed to render this
|
|
19
|
-
* block.
|
|
20
|
-
*
|
|
21
|
-
* @deprecated Use Blockly.blockRendering.Drawer instead.
|
|
22
|
-
* To be removed in v11.
|
|
23
|
-
*/
|
|
24
|
-
constructor(block: BlockSvg, info: RenderInfo);
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=drawer.d.ts.map
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import type { BlockSvg } from '../../block_svg.js';
|
|
7
|
-
import { RenderInfo as BaseRenderInfo } from '../common/info.js';
|
|
8
|
-
import type { Renderer } from './renderer.js';
|
|
9
|
-
/**
|
|
10
|
-
* An object containing all sizing information needed to draw this block.
|
|
11
|
-
*
|
|
12
|
-
* This measure pass does not propagate changes to the block (although fields
|
|
13
|
-
* may choose to rerender when getSize() is called). However, calling it
|
|
14
|
-
* repeatedly may be expensive.
|
|
15
|
-
*
|
|
16
|
-
* @deprecated Use Blockly.blockRendering.RenderInfo instead. To be removed
|
|
17
|
-
* in v11.
|
|
18
|
-
*/
|
|
19
|
-
export declare class RenderInfo extends BaseRenderInfo {
|
|
20
|
-
protected renderer_: Renderer;
|
|
21
|
-
/**
|
|
22
|
-
* @param renderer The renderer in use.
|
|
23
|
-
* @param block The block to measure.
|
|
24
|
-
* @deprecated Use Blockly.blockRendering.RenderInfo instead. To be removed
|
|
25
|
-
* in v11.
|
|
26
|
-
*/
|
|
27
|
-
constructor(renderer: Renderer, block: BlockSvg);
|
|
28
|
-
/**
|
|
29
|
-
* Get the block renderer in use.
|
|
30
|
-
*
|
|
31
|
-
* @returns The block renderer in use.
|
|
32
|
-
*/
|
|
33
|
-
getRenderer(): Renderer;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=info.d.ts.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** @file Re-exports of Blockly.minimalist.* modules. */
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright 2021 Google LLC
|
|
5
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
-
*/
|
|
7
|
-
import { ConstantProvider } from './constants.js';
|
|
8
|
-
import { Drawer } from './drawer.js';
|
|
9
|
-
import { RenderInfo } from './info.js';
|
|
10
|
-
import { Renderer } from './renderer.js';
|
|
11
|
-
export { ConstantProvider, Drawer, Renderer, RenderInfo };
|
|
12
|
-
//# sourceMappingURL=minimalist.d.ts.map
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import type { BlockSvg } from '../../block_svg.js';
|
|
7
|
-
import type { RenderInfo as BaseRenderInfo } from '../common/info.js';
|
|
8
|
-
import { Renderer as BaseRenderer } from '../common/renderer.js';
|
|
9
|
-
import { ConstantProvider } from './constants.js';
|
|
10
|
-
import { Drawer } from './drawer.js';
|
|
11
|
-
import { RenderInfo } from './info.js';
|
|
12
|
-
/**
|
|
13
|
-
* The minimalist renderer.
|
|
14
|
-
*
|
|
15
|
-
* @deprecated Use Blockly.blockRendering.Renderer instead. To be removed
|
|
16
|
-
* in v11.
|
|
17
|
-
*/
|
|
18
|
-
export declare class Renderer extends BaseRenderer {
|
|
19
|
-
/**
|
|
20
|
-
* @param name The renderer name.
|
|
21
|
-
* @deprecated Use Blockly.blockRendering.Renderer instead. To be removed
|
|
22
|
-
* in v11.
|
|
23
|
-
*/
|
|
24
|
-
constructor(name: string);
|
|
25
|
-
/**
|
|
26
|
-
* Create a new instance of the renderer's constant provider.
|
|
27
|
-
*
|
|
28
|
-
* @returns The constant provider.
|
|
29
|
-
*/
|
|
30
|
-
protected makeConstants_(): ConstantProvider;
|
|
31
|
-
/**
|
|
32
|
-
* Create a new instance of the renderer's render info object.
|
|
33
|
-
*
|
|
34
|
-
* @param block The block to measure.
|
|
35
|
-
* @returns The render info object.
|
|
36
|
-
*/
|
|
37
|
-
protected makeRenderInfo_(block: BlockSvg): RenderInfo;
|
|
38
|
-
/**
|
|
39
|
-
* Create a new instance of the renderer's drawer.
|
|
40
|
-
*
|
|
41
|
-
* @param block The block to render.
|
|
42
|
-
* @param info An object containing all information needed to render this
|
|
43
|
-
* block.
|
|
44
|
-
* @returns The drawer.
|
|
45
|
-
*/
|
|
46
|
-
protected makeDrawer_(block: BlockSvg, info: BaseRenderInfo): Drawer;
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=renderer.d.ts.map
|
package/core-browser.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
;(function(root, factory) {
|
|
3
|
-
if (typeof define === 'function' && define.amd) { // AMD
|
|
4
|
-
define(['./blockly'], factory);
|
|
5
|
-
} else if (typeof exports === 'object') { // Node.js
|
|
6
|
-
module.exports = factory(require('./blockly'));
|
|
7
|
-
} else { // Browser
|
|
8
|
-
root.Blockly = factory(root.Blockly);
|
|
9
|
-
}
|
|
10
|
-
}(this, function(Blockly) {
|
|
11
|
-
/**
|
|
12
|
-
* @license
|
|
13
|
-
* Copyright 2019 Google LLC
|
|
14
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @fileoverview Blockly core module for the browser. It includes blockly.js
|
|
19
|
-
* and adds a helper method for setting the locale.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/* eslint-disable */
|
|
23
|
-
'use strict';
|
|
24
|
-
|
|
25
|
-
return Blockly;
|
|
26
|
-
}));
|
package/core.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
(function (Blockly){
|
|
3
|
-
/**
|
|
4
|
-
* @license
|
|
5
|
-
* Copyright 2019 Google LLC
|
|
6
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @fileoverview Blockly core module for Node. It includes blockly-node.js
|
|
11
|
-
* and adds a helper method for setting the locale.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/* eslint-disable */
|
|
15
|
-
'use strict';
|
|
16
|
-
|
|
17
|
-
// Override textToDomDocument and provide Node.js alternatives to DOMParser and
|
|
18
|
-
// XMLSerializer.
|
|
19
|
-
if (typeof globalThis.document !== 'object') {
|
|
20
|
-
const {JSDOM} = require('jsdom');
|
|
21
|
-
const {window} = new JSDOM(`<!DOCTYPE html>`);
|
|
22
|
-
Blockly.utils.xml.injectDependencies(window);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
module.exports = Blockly;
|
|
26
|
-
})(require('./blockly'));
|