blockly 9.1.1 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blockly.min.js +384 -338
- package/blockly_compressed.js +381 -335
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js +3 -3
- package/blocks_compressed.js.map +1 -1
- package/core/any_aliases.d.ts +1 -1
- package/core/block.d.ts +3 -1
- package/core/block_dragger.d.ts +3 -3
- package/core/block_svg.d.ts +2 -2
- package/core/blockly.d.ts +21 -26
- package/core/blockly_options.d.ts +1 -0
- package/core/blocks.d.ts +2 -2
- package/core/browser_events.d.ts +2 -4
- package/core/bubble.d.ts +8 -8
- package/core/bubble_dragger.d.ts +3 -3
- package/core/component_manager.d.ts +1 -1
- package/core/contextmenu_registry.d.ts +5 -5
- package/core/dropdowndiv.d.ts +8 -4
- package/core/events/events.d.ts +21 -1
- package/core/events/events_abstract.d.ts +14 -1
- package/core/events/events_block_base.d.ts +12 -1
- package/core/events/events_block_change.d.ts +11 -0
- package/core/events/events_block_create.d.ts +11 -0
- package/core/events/events_block_delete.d.ts +11 -0
- package/core/events/events_block_drag.d.ts +11 -0
- package/core/events/events_block_move.d.ts +14 -0
- package/core/events/events_bubble_open.d.ts +11 -0
- package/core/events/events_click.d.ts +11 -0
- package/core/events/events_comment_base.d.ts +11 -0
- package/core/events/events_comment_change.d.ts +11 -0
- package/core/events/events_comment_create.d.ts +11 -0
- package/core/events/events_comment_delete.d.ts +21 -1
- package/core/events/events_comment_move.d.ts +11 -0
- package/core/events/events_marker_move.d.ts +11 -0
- package/core/events/events_procedure_base.d.ts +26 -0
- package/core/events/events_procedure_change_return.d.ts +40 -0
- package/core/events/events_procedure_create.d.ts +34 -0
- package/core/events/events_procedure_delete.d.ts +32 -0
- package/core/events/events_procedure_enable.d.ts +34 -0
- package/core/events/events_procedure_parameter_base.d.ts +26 -0
- package/core/events/events_procedure_parameter_create.d.ts +42 -0
- package/core/events/events_procedure_parameter_delete.d.ts +41 -0
- package/core/events/events_procedure_parameter_rename.d.ts +36 -0
- package/core/events/events_procedure_rename.d.ts +35 -0
- package/core/events/events_selected.d.ts +11 -0
- package/core/events/events_theme_change.d.ts +11 -0
- package/core/events/events_toolbox_item_select.d.ts +11 -0
- package/core/events/events_trashcan_open.d.ts +11 -0
- package/core/events/events_var_base.d.ts +11 -0
- package/core/events/events_var_create.d.ts +11 -0
- package/core/events/events_var_delete.d.ts +11 -0
- package/core/events/events_var_rename.d.ts +11 -0
- package/core/events/events_viewport.d.ts +11 -0
- package/core/events/utils.d.ts +17 -1
- package/core/field.d.ts +20 -9
- package/core/field_angle.d.ts +6 -6
- package/core/field_checkbox.d.ts +4 -3
- package/core/field_colour.d.ts +4 -3
- package/core/field_dropdown.d.ts +7 -6
- package/core/field_image.d.ts +2 -2
- package/core/field_input.d.ts +229 -0
- package/core/field_label.d.ts +2 -2
- package/core/field_label_serializable.d.ts +1 -1
- package/core/field_multilineinput.d.ts +3 -2
- package/core/field_number.d.ts +7 -4
- package/core/field_registry.d.ts +8 -5
- package/core/field_textinput.d.ts +6 -201
- package/core/field_variable.d.ts +3 -2
- package/core/flyout_base.d.ts +3 -4
- package/core/flyout_button.d.ts +1 -1
- package/core/gesture.d.ts +127 -50
- package/core/icon.d.ts +4 -4
- package/core/input.d.ts +8 -7
- package/core/insertion_marker_manager.d.ts +80 -63
- package/core/interfaces/i_copyable.d.ts +1 -1
- package/core/interfaces/i_observable.d.ts +21 -0
- package/core/interfaces/i_parameter_model.d.ts +3 -5
- package/core/keyboard_nav/ast_node.d.ts +1 -1
- package/core/metrics_manager.d.ts +5 -5
- package/core/mutator.d.ts +1 -1
- package/core/names.d.ts +1 -1
- package/core/options.d.ts +5 -4
- package/core/procedures/observable_parameter_model.d.ts +17 -0
- package/core/procedures/observable_procedure_map.d.ts +1 -1
- package/core/procedures/observable_procedure_model.d.ts +13 -0
- package/core/procedures.d.ts +1 -1
- package/core/registry.d.ts +1 -1
- package/core/rendered_connection.d.ts +1 -1
- package/core/renderers/common/constants.d.ts +3 -3
- package/core/serialization/procedures.d.ts +26 -2
- package/core/shortcut_registry.d.ts +1 -1
- package/core/theme.d.ts +4 -4
- package/core/theme_manager.d.ts +1 -1
- package/core/toolbox/category.d.ts +1 -1
- package/core/toolbox/collapsible_category.d.ts +1 -1
- package/core/toolbox/separator.d.ts +1 -1
- package/core/toolbox/toolbox.d.ts +1 -1
- package/core/tooltip.d.ts +2 -2
- package/core/touch.d.ts +12 -17
- package/core/utils/toolbox.d.ts +7 -7
- package/core/workspace_comment_svg.d.ts +18 -17
- package/core/workspace_svg.d.ts +13 -15
- package/core.js +4 -3
- package/msg/bs.js +12 -12
- package/msg/de.js +6 -6
- package/msg/diq.js +6 -6
- package/msg/es.js +15 -15
- package/msg/fr.js +2 -2
- package/msg/he.js +1 -1
- package/msg/hy.js +43 -43
- package/msg/is.js +17 -17
- package/msg/ja.js +1 -1
- package/msg/ko.js +3 -3
- package/msg/nb.js +1 -1
- package/msg/oc.js +2 -2
- package/msg/smn.js +24 -24
- package/msg/zh-hant.js +10 -10
- package/package.json +7 -6
- package/core/interfaces/i_registrable_field.d.ts +0 -19
- package/core/touch_gesture.d.ts +0 -130
|
@@ -14,49 +14,60 @@ import type { Coordinate } from './utils/coordinate.js';
|
|
|
14
14
|
* @alias Blockly.InsertionMarkerManager
|
|
15
15
|
*/
|
|
16
16
|
export declare class InsertionMarkerManager {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
/**
|
|
18
|
+
* The top block in the stack being dragged.
|
|
19
|
+
* Does not change during a drag.
|
|
20
|
+
*/
|
|
21
|
+
private readonly topBlock;
|
|
22
|
+
/**
|
|
23
|
+
* The workspace on which these connections are being dragged.
|
|
24
|
+
* Does not change during a drag.
|
|
25
|
+
*/
|
|
26
|
+
private readonly workspace;
|
|
19
27
|
/**
|
|
20
28
|
* The last connection on the stack, if it's not the last connection on the
|
|
21
29
|
* first block.
|
|
22
30
|
* Set in initAvailableConnections, if at all.
|
|
23
31
|
*/
|
|
24
|
-
private
|
|
32
|
+
private lastOnStack;
|
|
25
33
|
/**
|
|
26
34
|
* The insertion marker corresponding to the last block in the stack, if
|
|
27
35
|
* that's not the same as the first block in the stack.
|
|
28
36
|
* Set in initAvailableConnections, if at all
|
|
29
37
|
*/
|
|
30
|
-
private
|
|
31
|
-
private firstMarker_;
|
|
38
|
+
private lastMarker;
|
|
32
39
|
/**
|
|
33
|
-
* The
|
|
34
|
-
*
|
|
35
|
-
* This is not on any of the blocks that are being dragged.
|
|
40
|
+
* The insertion marker that shows up between blocks to show where a block
|
|
41
|
+
* would go if dropped immediately.
|
|
36
42
|
*/
|
|
37
|
-
private
|
|
43
|
+
private firstMarker;
|
|
38
44
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* the top block that is being dragged or the last block in the dragging
|
|
42
|
-
* stack.
|
|
45
|
+
* Information about the connection that would be made if the dragging block
|
|
46
|
+
* were released immediately. Updated on every mouse move.
|
|
43
47
|
*/
|
|
44
|
-
private
|
|
48
|
+
private activeCandidate;
|
|
45
49
|
/**
|
|
46
50
|
* Whether the block would be deleted if it were dropped immediately.
|
|
47
51
|
* Updated on every mouse move.
|
|
52
|
+
*
|
|
53
|
+
* @internal
|
|
48
54
|
*/
|
|
49
|
-
|
|
55
|
+
wouldDeleteBlock: boolean;
|
|
50
56
|
/**
|
|
51
57
|
* Connection on the insertion marker block that corresponds to
|
|
52
|
-
*
|
|
58
|
+
* the active candidate's local connection on the currently dragged block.
|
|
53
59
|
*/
|
|
54
|
-
private
|
|
60
|
+
private markerConnection;
|
|
55
61
|
/** The block that currently has an input being highlighted, or null. */
|
|
56
|
-
private
|
|
62
|
+
private highlightedBlock;
|
|
57
63
|
/** The block being faded to indicate replacement, or null. */
|
|
58
|
-
private
|
|
59
|
-
|
|
64
|
+
private fadedBlock;
|
|
65
|
+
/**
|
|
66
|
+
* The connections on the dragging blocks that are available to connect to
|
|
67
|
+
* other blocks. This includes all open connections on the top block, as
|
|
68
|
+
* well as the last connection on the block stack.
|
|
69
|
+
*/
|
|
70
|
+
private availableConnections;
|
|
60
71
|
/** @param block The top block in the stack being dragged. */
|
|
61
72
|
constructor(block: BlockSvg);
|
|
62
73
|
/**
|
|
@@ -72,14 +83,6 @@ export declare class InsertionMarkerManager {
|
|
|
72
83
|
* @internal
|
|
73
84
|
*/
|
|
74
85
|
updateAvailableConnections(): void;
|
|
75
|
-
/**
|
|
76
|
-
* Return whether the block would be deleted if dropped immediately, based on
|
|
77
|
-
* information from the most recent move event.
|
|
78
|
-
*
|
|
79
|
-
* @returns True if the block would be deleted if dropped immediately.
|
|
80
|
-
* @internal
|
|
81
|
-
*/
|
|
82
|
-
wouldDeleteBlock(): boolean;
|
|
83
86
|
/**
|
|
84
87
|
* Return whether the block would be connected if dropped immediately, based
|
|
85
88
|
* on information from the most recent move event.
|
|
@@ -109,26 +112,26 @@ export declare class InsertionMarkerManager {
|
|
|
109
112
|
* @param sourceBlock The block that the insertion marker will represent.
|
|
110
113
|
* @returns The insertion marker that represents the given block.
|
|
111
114
|
*/
|
|
112
|
-
private
|
|
115
|
+
private createMarkerBlock;
|
|
113
116
|
/**
|
|
114
117
|
* Populate the list of available connections on this block stack. This
|
|
115
118
|
* should only be called once, at the beginning of a drag. If the stack has
|
|
116
|
-
* more than one block, this function will populate
|
|
119
|
+
* more than one block, this function will populate lastOnStack and create
|
|
117
120
|
* the corresponding insertion marker.
|
|
118
121
|
*
|
|
119
122
|
* @returns A list of available connections.
|
|
120
123
|
*/
|
|
121
|
-
private
|
|
124
|
+
private initAvailableConnections;
|
|
122
125
|
/**
|
|
123
126
|
* Whether the previews (insertion marker and replacement marker) should be
|
|
124
127
|
* updated based on the closest candidate and the current drag distance.
|
|
125
128
|
*
|
|
126
|
-
* @param
|
|
127
|
-
*
|
|
129
|
+
* @param newCandidate A new candidate connection that may replace the current
|
|
130
|
+
* best candidate.
|
|
128
131
|
* @param dxy Position relative to drag start, in workspace units.
|
|
129
132
|
* @returns Whether the preview should be updated.
|
|
130
133
|
*/
|
|
131
|
-
private
|
|
134
|
+
private shouldUpdatePreviews;
|
|
132
135
|
/**
|
|
133
136
|
* Find the nearest valid connection, which may be the same as the current
|
|
134
137
|
* closest connection.
|
|
@@ -137,74 +140,88 @@ export declare class InsertionMarkerManager {
|
|
|
137
140
|
* @returns An object containing a local connection, a closest connection, and
|
|
138
141
|
* a radius.
|
|
139
142
|
*/
|
|
140
|
-
private
|
|
143
|
+
private getCandidate;
|
|
141
144
|
/**
|
|
142
145
|
* Decide the radius at which to start searching for the closest connection.
|
|
143
146
|
*
|
|
144
147
|
* @returns The radius at which to start the search for the closest
|
|
145
148
|
* connection.
|
|
146
149
|
*/
|
|
147
|
-
private
|
|
150
|
+
private getStartRadius;
|
|
148
151
|
/**
|
|
149
152
|
* Whether ending the drag would delete the block.
|
|
150
153
|
*
|
|
151
|
-
* @param
|
|
152
|
-
*
|
|
154
|
+
* @param newCandidate Whether there is a candidate connection that the
|
|
155
|
+
* block could connect to if the drag ended immediately.
|
|
153
156
|
* @param dragTarget The drag target that the block is currently over.
|
|
154
157
|
* @returns Whether dropping the block immediately would delete the block.
|
|
155
158
|
*/
|
|
156
|
-
private
|
|
159
|
+
private shouldDelete;
|
|
157
160
|
/**
|
|
158
161
|
* Show an insertion marker or replacement highlighting during a drag, if
|
|
159
162
|
* needed.
|
|
160
|
-
* At the beginning of this function, this.
|
|
161
|
-
* this.closestConnection_ should both be null.
|
|
163
|
+
* At the beginning of this function, this.activeConnection should be null.
|
|
162
164
|
*
|
|
163
|
-
* @param
|
|
164
|
-
*
|
|
165
|
+
* @param newCandidate A new candidate connection that may replace the current
|
|
166
|
+
* best candidate.
|
|
165
167
|
*/
|
|
166
|
-
private
|
|
168
|
+
private maybeShowPreview;
|
|
167
169
|
/**
|
|
168
170
|
* A preview should be shown. This function figures out if it should be a
|
|
169
171
|
* block highlight or an insertion marker, and shows the appropriate one.
|
|
172
|
+
*
|
|
173
|
+
* @param activeCandidate The connection that will be made if the drag ends
|
|
174
|
+
* immediately.
|
|
170
175
|
*/
|
|
171
|
-
private
|
|
176
|
+
private showPreview;
|
|
172
177
|
/**
|
|
173
|
-
*
|
|
178
|
+
* Hide an insertion marker or replacement highlighting during a drag, if
|
|
174
179
|
* needed.
|
|
175
|
-
* At the end of this function, this.
|
|
176
|
-
* this.closestConnection_ should both be null.
|
|
180
|
+
* At the end of this function, this.activeCandidate will be null.
|
|
177
181
|
*
|
|
178
|
-
* @param
|
|
179
|
-
*
|
|
182
|
+
* @param newCandidate A new candidate connection that may replace the current
|
|
183
|
+
* best candidate.
|
|
180
184
|
*/
|
|
181
|
-
private
|
|
185
|
+
private maybeHidePreview;
|
|
182
186
|
/**
|
|
183
|
-
* A preview should be hidden.
|
|
184
|
-
*
|
|
187
|
+
* A preview should be hidden. Loop through all possible preview modes
|
|
188
|
+
* and hide everything.
|
|
185
189
|
*/
|
|
186
|
-
private
|
|
190
|
+
private hidePreview;
|
|
187
191
|
/**
|
|
188
192
|
* Shows an insertion marker connected to the appropriate blocks (based on
|
|
189
193
|
* manager state).
|
|
194
|
+
*
|
|
195
|
+
* @param activeCandidate The connection that will be made if the drag ends
|
|
196
|
+
* immediately.
|
|
190
197
|
*/
|
|
191
|
-
private
|
|
198
|
+
private showInsertionMarker;
|
|
192
199
|
/**
|
|
193
200
|
* Disconnects and hides the current insertion marker. Should return the
|
|
194
201
|
* blocks to their original state.
|
|
195
202
|
*/
|
|
196
|
-
private
|
|
197
|
-
/**
|
|
198
|
-
|
|
203
|
+
private hideInsertionMarker;
|
|
204
|
+
/**
|
|
205
|
+
* Shows an outline around the input the closest connection belongs to.
|
|
206
|
+
*
|
|
207
|
+
* @param activeCandidate The connection that will be made if the drag ends
|
|
208
|
+
* immediately.
|
|
209
|
+
*/
|
|
210
|
+
private showInsertionInputOutline;
|
|
199
211
|
/** Hides any visible input outlines. */
|
|
200
|
-
private
|
|
212
|
+
private hideInsertionInputOutline;
|
|
201
213
|
/**
|
|
202
214
|
* Shows a replacement fade affect on the closest connection's target block
|
|
203
215
|
* (the block that is currently connected to it).
|
|
216
|
+
*
|
|
217
|
+
* @param activeCandidate The connection that will be made if the drag ends
|
|
218
|
+
* immediately.
|
|
219
|
+
*/
|
|
220
|
+
private showReplacementFade;
|
|
221
|
+
/**
|
|
222
|
+
* Hides/Removes any visible fade affects.
|
|
204
223
|
*/
|
|
205
|
-
private
|
|
206
|
-
/** Hides/Removes any visible fade affects. */
|
|
207
|
-
private hideReplacementFade_;
|
|
224
|
+
private hideReplacementFade;
|
|
208
225
|
/**
|
|
209
226
|
* Get a list of the insertion markers that currently exist. Drags have 0, 1,
|
|
210
227
|
* or 2 insertion markers.
|
|
@@ -225,6 +242,6 @@ export declare namespace InsertionMarkerManager {
|
|
|
225
242
|
REPLACEMENT_FADE = 2
|
|
226
243
|
}
|
|
227
244
|
}
|
|
228
|
-
export
|
|
245
|
+
export type PreviewType = InsertionMarkerManager.PREVIEW_TYPE;
|
|
229
246
|
export declare const PreviewType: typeof InsertionMarkerManager.PREVIEW_TYPE;
|
|
230
247
|
//# sourceMappingURL=insertion_marker_manager.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* An object that fires events optionally.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export interface IObservable {
|
|
12
|
+
startPublishing(): void;
|
|
13
|
+
stopPublishing(): void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Type guard for checking if an object fulfills IObservable.
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare function isObservable(obj: any): obj is IObservable;
|
|
21
|
+
//# sourceMappingURL=i_observable.d.ts.map
|
|
@@ -3,11 +3,7 @@
|
|
|
3
3
|
* Copyright 2022 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
* The interface for the data model of a procedure parameter.
|
|
8
|
-
*
|
|
9
|
-
* @namespace Blockly.IParameterModel
|
|
10
|
-
*/
|
|
6
|
+
import { IProcedureModel } from './i_procedure_model';
|
|
11
7
|
/**
|
|
12
8
|
* A data model for a procedure.
|
|
13
9
|
*/
|
|
@@ -35,5 +31,7 @@ export interface IParameterModel {
|
|
|
35
31
|
* over time.
|
|
36
32
|
*/
|
|
37
33
|
getId(): string;
|
|
34
|
+
/** Sets the procedure model this parameter is associated with. */
|
|
35
|
+
setProcedureModel(model: IProcedureModel): this;
|
|
38
36
|
}
|
|
39
37
|
//# sourceMappingURL=i_parameter_model.d.ts.map
|
|
@@ -208,9 +208,9 @@ export declare namespace MetricsManager {
|
|
|
208
208
|
toolboxMetrics: ToolboxMetrics;
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
-
export
|
|
212
|
-
export
|
|
213
|
-
export
|
|
214
|
-
export
|
|
215
|
-
export
|
|
211
|
+
export type ToolboxMetrics = MetricsManager.ToolboxMetrics;
|
|
212
|
+
export type AbsoluteMetrics = MetricsManager.AbsoluteMetrics;
|
|
213
|
+
export type ContainerRegion = MetricsManager.ContainerRegion;
|
|
214
|
+
export type FixedEdges = MetricsManager.FixedEdges;
|
|
215
|
+
export type UiMetrics = MetricsManager.UiMetrics;
|
|
216
216
|
//# sourceMappingURL=metrics_manager.d.ts.map
|
package/core/mutator.d.ts
CHANGED
package/core/names.d.ts
CHANGED
|
@@ -131,6 +131,6 @@ export declare namespace Names {
|
|
|
131
131
|
PROCEDURE = "PROCEDURE"
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
export
|
|
134
|
+
export type NameType = Names.NameType;
|
|
135
135
|
export declare const NameType: typeof Names.NameType;
|
|
136
136
|
//# sourceMappingURL=names.d.ts.map
|
package/core/options.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export declare class Options {
|
|
|
25
25
|
maxInstances: {
|
|
26
26
|
[key: string]: number;
|
|
27
27
|
} | null;
|
|
28
|
+
modalInputs: boolean;
|
|
28
29
|
pathToMedia: string;
|
|
29
30
|
hasCategories: boolean;
|
|
30
31
|
moveOptions: MoveOptions;
|
|
@@ -136,8 +137,8 @@ export declare namespace Options {
|
|
|
136
137
|
wheel: boolean;
|
|
137
138
|
}
|
|
138
139
|
}
|
|
139
|
-
export
|
|
140
|
-
export
|
|
141
|
-
export
|
|
142
|
-
export
|
|
140
|
+
export type GridOptions = Options.GridOptions;
|
|
141
|
+
export type MoveOptions = Options.MoveOptions;
|
|
142
|
+
export type ScrollbarOptions = Options.ScrollbarOptions;
|
|
143
|
+
export type ZoomOptions = Options.ZoomOptions;
|
|
143
144
|
//# sourceMappingURL=options.d.ts.map
|
|
@@ -4,12 +4,15 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import type { IParameterModel } from '../interfaces/i_parameter_model.js';
|
|
7
|
+
import type { IProcedureModel } from '../interfaces/i_procedure_model';
|
|
7
8
|
import type { VariableModel } from '../variable_model.js';
|
|
8
9
|
import type { Workspace } from '../workspace.js';
|
|
9
10
|
export declare class ObservableParameterModel implements IParameterModel {
|
|
10
11
|
private readonly workspace;
|
|
11
12
|
private id;
|
|
12
13
|
private variable;
|
|
14
|
+
private shouldFireEvents;
|
|
15
|
+
private procedureModel;
|
|
13
16
|
constructor(workspace: Workspace, name: string, id?: string);
|
|
14
17
|
/**
|
|
15
18
|
* Sets the name of this parameter to the given name.
|
|
@@ -41,5 +44,19 @@ export declare class ObservableParameterModel implements IParameterModel {
|
|
|
41
44
|
getId(): string;
|
|
42
45
|
/** Returns the variable model associated with the parameter model. */
|
|
43
46
|
getVariableModel(): VariableModel;
|
|
47
|
+
/**
|
|
48
|
+
* Tells the parameter model it should fire events.
|
|
49
|
+
*
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
startPublishing(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Tells the parameter model it should not fire events.
|
|
55
|
+
*
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
stopPublishing(): void;
|
|
59
|
+
/** Sets the procedure model this parameter is a part of. */
|
|
60
|
+
setProcedureModel(model: IProcedureModel): this;
|
|
44
61
|
}
|
|
45
62
|
//# sourceMappingURL=observable_parameter_model.d.ts.map
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Copyright 2022 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
import { IProcedureMap } from '../interfaces/i_procedure_map.js';
|
|
6
7
|
import type { IProcedureModel } from '../interfaces/i_procedure_model.js';
|
|
7
8
|
import type { Workspace } from '../workspace.js';
|
|
8
|
-
import { IProcedureMap } from '../interfaces/i_procedure_map.js';
|
|
9
9
|
export declare class ObservableProcedureMap extends Map<string, IProcedureModel> implements IProcedureMap {
|
|
10
10
|
private readonly workspace;
|
|
11
11
|
constructor(workspace: Workspace);
|
|
@@ -13,6 +13,7 @@ export declare class ObservableProcedureModel implements IProcedureModel {
|
|
|
13
13
|
private parameters;
|
|
14
14
|
private returnTypes;
|
|
15
15
|
private enabled;
|
|
16
|
+
private shouldFireEvents;
|
|
16
17
|
constructor(workspace: Workspace, name: string, id?: string);
|
|
17
18
|
/** Sets the human-readable name of the procedure. */
|
|
18
19
|
setName(name: string): this;
|
|
@@ -58,5 +59,17 @@ export declare class ObservableProcedureModel implements IProcedureModel {
|
|
|
58
59
|
* disabled, all procedure caller blocks should be disabled as well.
|
|
59
60
|
*/
|
|
60
61
|
getEnabled(): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Tells the procedure model it should fire events.
|
|
64
|
+
*
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
startPublishing(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Tells the procedure model it should not fire events.
|
|
70
|
+
*
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
73
|
+
stopPublishing(): void;
|
|
61
74
|
}
|
|
62
75
|
//# sourceMappingURL=observable_procedure_model.d.ts.map
|
package/core/procedures.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare const CATEGORY_NAME = "PROCEDURE";
|
|
|
28
28
|
* @alias Blockly.Procedures.DEFAULT_ARG
|
|
29
29
|
*/
|
|
30
30
|
export declare const DEFAULT_ARG = "x";
|
|
31
|
-
export
|
|
31
|
+
export type ProcedureTuple = [string, string[], boolean];
|
|
32
32
|
/**
|
|
33
33
|
* Procedure block type.
|
|
34
34
|
*
|
package/core/registry.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export declare class Type<_T> {
|
|
|
47
47
|
static CONNECTION_CHECKER: Type<IConnectionChecker>;
|
|
48
48
|
static CURSOR: Type<Cursor>;
|
|
49
49
|
static EVENT: Type<Abstract>;
|
|
50
|
-
static FIELD: Type<Field
|
|
50
|
+
static FIELD: Type<Field<any>>;
|
|
51
51
|
static RENDERER: Type<Renderer>;
|
|
52
52
|
static TOOLBOX: Type<IToolbox>;
|
|
53
53
|
static THEME: Type<Theme>;
|
|
@@ -208,6 +208,6 @@ export declare namespace RenderedConnection {
|
|
|
208
208
|
TRACKED = 1
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
-
export
|
|
211
|
+
export type TrackedState = RenderedConnection.TrackedState;
|
|
212
212
|
export declare const TrackedState: typeof RenderedConnection.TrackedState;
|
|
213
213
|
//# sourceMappingURL=rendered_connection.d.ts.map
|
|
@@ -51,13 +51,13 @@ export interface JaggedTeeth {
|
|
|
51
51
|
width: number;
|
|
52
52
|
path: string;
|
|
53
53
|
}
|
|
54
|
-
export
|
|
54
|
+
export type BaseShape = {
|
|
55
55
|
type: number;
|
|
56
56
|
width: number;
|
|
57
57
|
height: number;
|
|
58
58
|
};
|
|
59
59
|
/** An object containing sizing and type information about a dynamic shape. */
|
|
60
|
-
export
|
|
60
|
+
export type DynamicShape = {
|
|
61
61
|
type: number;
|
|
62
62
|
width: (p1: number) => number;
|
|
63
63
|
height: (p1: number) => number;
|
|
@@ -70,7 +70,7 @@ export declare type DynamicShape = {
|
|
|
70
70
|
pathRightUp: (p1: number) => string;
|
|
71
71
|
};
|
|
72
72
|
/** An object containing sizing and type information about a shape. */
|
|
73
|
-
export
|
|
73
|
+
export type Shape = BaseShape | DynamicShape;
|
|
74
74
|
/**
|
|
75
75
|
* Returns whether the shape is dynamic or not.
|
|
76
76
|
*
|
|
@@ -33,7 +33,7 @@ export interface ParameterState {
|
|
|
33
33
|
* https://www.typescriptlang.org/docs/handbook/2/generics.html#using-class-types-in-generics
|
|
34
34
|
* for what is going on with this.
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
type ProcedureModelConstructor<ProcedureModel extends IProcedureModel> = new (workspace: Workspace, name: string, id: string) => ProcedureModel;
|
|
37
37
|
/**
|
|
38
38
|
* A newable signature for an IParameterModel.
|
|
39
39
|
*
|
|
@@ -41,7 +41,31 @@ declare type ProcedureModelConstructor<ProcedureModel extends IProcedureModel> =
|
|
|
41
41
|
* https://www.typescriptlang.org/docs/handbook/2/generics.html#using-class-types-in-generics
|
|
42
42
|
* for what is going on with this.
|
|
43
43
|
*/
|
|
44
|
-
|
|
44
|
+
type ParameterModelConstructor<ParameterModel extends IParameterModel> = new (workspace: Workspace, name: string, id: string) => ParameterModel;
|
|
45
|
+
/**
|
|
46
|
+
* Serializes the given IProcedureModel to JSON.
|
|
47
|
+
*
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
export declare function saveProcedure(proc: IProcedureModel): State;
|
|
51
|
+
/**
|
|
52
|
+
* Serializes the given IParameterModel to JSON.
|
|
53
|
+
*
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
export declare function saveParameter(param: IParameterModel): ParameterState;
|
|
57
|
+
/**
|
|
58
|
+
* Deserializes the given procedure model State from JSON.
|
|
59
|
+
*
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
export declare function loadProcedure<ProcedureModel extends IProcedureModel, ParameterModel extends IParameterModel>(procedureModelClass: ProcedureModelConstructor<ProcedureModel>, parameterModelClass: ParameterModelConstructor<ParameterModel>, state: State, workspace: Workspace): ProcedureModel;
|
|
63
|
+
/**
|
|
64
|
+
* Deserializes the given ParameterState from JSON.
|
|
65
|
+
*
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
export declare function loadParameter<ParameterModel extends IParameterModel>(parameterModelClass: ParameterModelConstructor<ParameterModel>, state: ParameterState, workspace: Workspace): ParameterModel;
|
|
45
69
|
/** Serializer for saving and loading procedure state. */
|
|
46
70
|
export declare class ProcedureSerializer<ProcedureModel extends IProcedureModel, ParameterModel extends IParameterModel> implements ISerializer {
|
|
47
71
|
private readonly procedureModelClass;
|
|
@@ -163,5 +163,5 @@ export declare namespace ShortcutRegistry {
|
|
|
163
163
|
Meta = 91
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
export
|
|
166
|
+
export type KeyboardShortcut = ShortcutRegistry.KeyboardShortcut;
|
|
167
167
|
//# sourceMappingURL=shortcut_registry.d.ts.map
|
package/core/theme.d.ts
CHANGED
|
@@ -146,8 +146,8 @@ export declare namespace Theme {
|
|
|
146
146
|
size?: number;
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
export
|
|
150
|
-
export
|
|
151
|
-
export
|
|
152
|
-
export
|
|
149
|
+
export type BlockStyle = Theme.BlockStyle;
|
|
150
|
+
export type CategoryStyle = Theme.CategoryStyle;
|
|
151
|
+
export type ComponentStyle = Theme.ComponentStyle;
|
|
152
|
+
export type FontStyle = Theme.FontStyle;
|
|
153
153
|
//# sourceMappingURL=theme.d.ts.map
|
package/core/theme_manager.d.ts
CHANGED
|
@@ -94,5 +94,5 @@ export declare namespace CollapsibleToolboxCategory {
|
|
|
94
94
|
contents: string | null;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
export
|
|
97
|
+
export type CssConfig = CollapsibleToolboxCategory.CssConfig;
|
|
98
98
|
//# sourceMappingURL=collapsible_category.d.ts.map
|
|
@@ -107,7 +107,7 @@ export declare class Toolbox extends DeleteArea implements IAutoHideable, IKeybo
|
|
|
107
107
|
*
|
|
108
108
|
* @param e Click event to handle.
|
|
109
109
|
*/
|
|
110
|
-
protected onClick_(e:
|
|
110
|
+
protected onClick_(e: PointerEvent): void;
|
|
111
111
|
/**
|
|
112
112
|
* Handles key down events for the toolbox.
|
|
113
113
|
*
|
package/core/tooltip.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @alias Blockly.Tooltip.TipInfo
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export type TipInfo = string | {
|
|
15
15
|
tooltip: any;
|
|
16
16
|
} | (() => TipInfo | string | Function);
|
|
17
17
|
/**
|
|
@@ -22,7 +22,7 @@ export declare type TipInfo = string | {
|
|
|
22
22
|
*
|
|
23
23
|
* @alias Blockly.Tooltip.CustomTooltip
|
|
24
24
|
*/
|
|
25
|
-
export
|
|
25
|
+
export type CustomTooltip = (p1: Element, p2: Element) => any;
|
|
26
26
|
/**
|
|
27
27
|
* Sets a custom function that will be called if present instead of the default
|
|
28
28
|
* tooltip UI.
|