blockly 12.0.0-beta.0 → 12.0.0-beta.2
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 -370
- package/blockly.mjs +1 -0
- package/blockly_compressed.js +364 -350
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js +5 -5
- package/blocks_compressed.js.map +1 -1
- package/core/block.d.ts +8 -3
- package/core/block_flyout_inflater.d.ts +15 -10
- package/core/block_svg.d.ts +8 -2
- package/core/blockly.d.ts +5 -2
- package/core/bubbles/text_bubble.d.ts +5 -5
- package/core/button_flyout_inflater.d.ts +13 -7
- package/core/comments/comment_view.d.ts +3 -3
- package/core/connection.d.ts +1 -1
- package/core/contextmenu_registry.d.ts +51 -11
- package/core/dragging/block_drag_strategy.d.ts +2 -2
- package/core/dragging/bubble_drag_strategy.d.ts +0 -2
- package/core/dragging/comment_drag_strategy.d.ts +0 -2
- package/core/events/events_var_delete.d.ts +0 -2
- package/core/events/events_var_rename.d.ts +0 -2
- package/core/field.d.ts +0 -2
- package/core/field_dropdown.d.ts +7 -9
- package/core/flyout_base.d.ts +1 -8
- package/core/flyout_horizontal.d.ts +2 -1
- package/core/flyout_item.d.ts +32 -0
- package/core/flyout_vertical.d.ts +2 -1
- package/core/interfaces/i_flyout.d.ts +1 -1
- package/core/interfaces/i_flyout_inflater.d.ts +15 -6
- package/core/interfaces/i_focusable_node.d.ts +34 -0
- package/core/interfaces/i_focusable_tree.d.ts +48 -0
- package/core/interfaces/i_metrics_manager.d.ts +1 -1
- package/core/interfaces/i_rendered_element.d.ts +1 -4
- package/core/keyboard_nav/marker.d.ts +4 -8
- package/core/label_flyout_inflater.d.ts +13 -7
- package/core/menu.d.ts +30 -26
- package/core/menu_separator.d.ts +25 -0
- package/core/menuitem.d.ts +7 -0
- package/core/metrics_manager.d.ts +1 -1
- package/core/procedures.d.ts +7 -4
- package/core/renderers/common/marker_svg.d.ts +2 -2
- package/core/renderers/common/renderer.d.ts +1 -1
- package/core/renderers/measurables/in_row_spacer.d.ts +1 -0
- package/core/renderers/measurables/jagged_edge.d.ts +1 -0
- package/core/renderers/measurables/next_connection.d.ts +1 -0
- package/core/renderers/measurables/previous_connection.d.ts +1 -0
- package/core/renderers/measurables/round_corner.d.ts +1 -0
- package/core/renderers/measurables/square_corner.d.ts +1 -0
- package/core/renderers/measurables/statement_input.d.ts +1 -0
- package/core/renderers/measurables/types.d.ts +49 -24
- package/core/separator_flyout_inflater.d.ts +17 -7
- package/core/utils/aria.d.ts +2 -1
- package/core/utils/toolbox.d.ts +0 -2
- package/core/variables.d.ts +18 -4
- package/core/variables_dynamic.d.ts +7 -5
- package/core/workspace.d.ts +13 -0
- package/core/workspace_svg.d.ts +2 -0
- package/dart_compressed.js +1 -1
- package/dart_compressed.js.map +1 -1
- package/index.mjs +1 -0
- package/javascript_compressed.js +15 -15
- package/javascript_compressed.js.map +1 -1
- package/lua_compressed.js +1 -1
- package/lua_compressed.js.map +1 -1
- package/media/1x1.gif +0 -0
- package/media/click.mp3 +0 -0
- package/media/click.ogg +0 -0
- package/media/click.wav +0 -0
- package/media/delete.mp3 +0 -0
- package/media/delete.ogg +0 -0
- package/media/delete.wav +0 -0
- package/media/disconnect.mp3 +0 -0
- package/media/disconnect.ogg +0 -0
- package/media/disconnect.wav +0 -0
- package/media/handclosed.cur +0 -0
- package/media/handdelete.cur +0 -0
- package/media/handopen.cur +0 -0
- package/media/pilcrow.png +0 -0
- package/media/quote0.png +0 -0
- package/media/quote1.png +0 -0
- package/media/sprites.png +0 -0
- package/package.json +2 -2
- package/php_compressed.js +1 -1
- package/php_compressed.js.map +1 -1
- package/python_compressed.js +3 -3
- package/python_compressed.js.map +1 -1
|
@@ -4,7 +4,24 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import type { Measurable } from './base.js';
|
|
7
|
+
import type { BottomRow } from './bottom_row.js';
|
|
8
|
+
import type { ExternalValueInput } from './external_value_input.js';
|
|
9
|
+
import type { Field } from './field.js';
|
|
10
|
+
import type { Hat } from './hat.js';
|
|
11
|
+
import type { Icon } from './icon.js';
|
|
12
|
+
import type { InRowSpacer } from './in_row_spacer.js';
|
|
13
|
+
import type { InlineInput } from './inline_input.js';
|
|
14
|
+
import type { InputConnection } from './input_connection.js';
|
|
15
|
+
import type { InputRow } from './input_row.js';
|
|
16
|
+
import type { JaggedEdge } from './jagged_edge.js';
|
|
17
|
+
import type { NextConnection } from './next_connection.js';
|
|
18
|
+
import type { PreviousConnection } from './previous_connection.js';
|
|
19
|
+
import type { RoundCorner } from './round_corner.js';
|
|
7
20
|
import type { Row } from './row.js';
|
|
21
|
+
import type { SpacerRow } from './spacer_row.js';
|
|
22
|
+
import type { SquareCorner } from './square_corner.js';
|
|
23
|
+
import type { StatementInput } from './statement_input.js';
|
|
24
|
+
import type { TopRow } from './top_row.js';
|
|
8
25
|
/**
|
|
9
26
|
* Types of rendering elements.
|
|
10
27
|
*/
|
|
@@ -63,77 +80,84 @@ declare class TypesContainer {
|
|
|
63
80
|
* @param elem The element to check.
|
|
64
81
|
* @returns 1 if the object stores information about a field.
|
|
65
82
|
*/
|
|
66
|
-
isField(elem: Measurable):
|
|
83
|
+
isField(elem: Measurable): elem is Field;
|
|
67
84
|
/**
|
|
68
85
|
* Whether a measurable stores information about a hat.
|
|
69
86
|
*
|
|
70
87
|
* @param elem The element to check.
|
|
71
88
|
* @returns 1 if the object stores information about a hat.
|
|
72
89
|
*/
|
|
73
|
-
isHat(elem: Measurable):
|
|
90
|
+
isHat(elem: Measurable): elem is Hat;
|
|
74
91
|
/**
|
|
75
92
|
* Whether a measurable stores information about an icon.
|
|
76
93
|
*
|
|
77
94
|
* @param elem The element to check.
|
|
78
95
|
* @returns 1 if the object stores information about an icon.
|
|
79
96
|
*/
|
|
80
|
-
isIcon(elem: Measurable):
|
|
97
|
+
isIcon(elem: Measurable): elem is Icon;
|
|
81
98
|
/**
|
|
82
99
|
* Whether a measurable stores information about a spacer.
|
|
83
100
|
*
|
|
84
101
|
* @param elem The element to check.
|
|
85
102
|
* @returns 1 if the object stores information about a spacer.
|
|
86
103
|
*/
|
|
87
|
-
isSpacer(elem: Measurable | Row):
|
|
104
|
+
isSpacer(elem: Measurable | Row): elem is SpacerRow | InRowSpacer;
|
|
88
105
|
/**
|
|
89
106
|
* Whether a measurable stores information about an in-row spacer.
|
|
90
107
|
*
|
|
91
108
|
* @param elem The element to check.
|
|
92
109
|
* @returns 1 if the object stores information about an in-row spacer.
|
|
93
110
|
*/
|
|
94
|
-
isInRowSpacer(elem: Measurable):
|
|
111
|
+
isInRowSpacer(elem: Measurable): elem is InRowSpacer;
|
|
112
|
+
/**
|
|
113
|
+
* Whether a row is a spacer row.
|
|
114
|
+
*
|
|
115
|
+
* @param row The row to check.
|
|
116
|
+
* @returns True if the row is a spacer row.
|
|
117
|
+
*/
|
|
118
|
+
isSpacerRow(row: Row): row is SpacerRow;
|
|
95
119
|
/**
|
|
96
120
|
* Whether a measurable stores information about an input.
|
|
97
121
|
*
|
|
98
122
|
* @param elem The element to check.
|
|
99
123
|
* @returns 1 if the object stores information about an input.
|
|
100
124
|
*/
|
|
101
|
-
isInput(elem: Measurable):
|
|
125
|
+
isInput(elem: Measurable): elem is InputConnection;
|
|
102
126
|
/**
|
|
103
127
|
* Whether a measurable stores information about an external input.
|
|
104
128
|
*
|
|
105
129
|
* @param elem The element to check.
|
|
106
130
|
* @returns 1 if the object stores information about an external input.
|
|
107
131
|
*/
|
|
108
|
-
isExternalInput(elem: Measurable):
|
|
132
|
+
isExternalInput(elem: Measurable): elem is ExternalValueInput;
|
|
109
133
|
/**
|
|
110
134
|
* Whether a measurable stores information about an inline input.
|
|
111
135
|
*
|
|
112
136
|
* @param elem The element to check.
|
|
113
137
|
* @returns 1 if the object stores information about an inline input.
|
|
114
138
|
*/
|
|
115
|
-
isInlineInput(elem: Measurable):
|
|
139
|
+
isInlineInput(elem: Measurable): elem is InlineInput;
|
|
116
140
|
/**
|
|
117
141
|
* Whether a measurable stores information about a statement input.
|
|
118
142
|
*
|
|
119
143
|
* @param elem The element to check.
|
|
120
144
|
* @returns 1 if the object stores information about a statement input.
|
|
121
145
|
*/
|
|
122
|
-
isStatementInput(elem: Measurable):
|
|
146
|
+
isStatementInput(elem: Measurable): elem is StatementInput;
|
|
123
147
|
/**
|
|
124
148
|
* Whether a measurable stores information about a previous connection.
|
|
125
149
|
*
|
|
126
150
|
* @param elem The element to check.
|
|
127
151
|
* @returns 1 if the object stores information about a previous connection.
|
|
128
152
|
*/
|
|
129
|
-
isPreviousConnection(elem: Measurable):
|
|
153
|
+
isPreviousConnection(elem: Measurable): elem is PreviousConnection;
|
|
130
154
|
/**
|
|
131
155
|
* Whether a measurable stores information about a next connection.
|
|
132
156
|
*
|
|
133
157
|
* @param elem The element to check.
|
|
134
158
|
* @returns 1 if the object stores information about a next connection.
|
|
135
159
|
*/
|
|
136
|
-
isNextConnection(elem: Measurable):
|
|
160
|
+
isNextConnection(elem: Measurable): elem is NextConnection;
|
|
137
161
|
/**
|
|
138
162
|
* Whether a measurable stores information about a previous or next
|
|
139
163
|
* connection.
|
|
@@ -142,91 +166,92 @@ declare class TypesContainer {
|
|
|
142
166
|
* @returns 1 if the object stores information about a previous or next
|
|
143
167
|
* connection.
|
|
144
168
|
*/
|
|
145
|
-
isPreviousOrNextConnection(elem: Measurable):
|
|
169
|
+
isPreviousOrNextConnection(elem: Measurable): elem is PreviousConnection | NextConnection;
|
|
170
|
+
isRoundCorner(elem: Measurable): elem is RoundCorner;
|
|
146
171
|
/**
|
|
147
172
|
* Whether a measurable stores information about a left round corner.
|
|
148
173
|
*
|
|
149
174
|
* @param elem The element to check.
|
|
150
175
|
* @returns 1 if the object stores information about a left round corner.
|
|
151
176
|
*/
|
|
152
|
-
isLeftRoundedCorner(elem: Measurable):
|
|
177
|
+
isLeftRoundedCorner(elem: Measurable): boolean;
|
|
153
178
|
/**
|
|
154
179
|
* Whether a measurable stores information about a right round corner.
|
|
155
180
|
*
|
|
156
181
|
* @param elem The element to check.
|
|
157
182
|
* @returns 1 if the object stores information about a right round corner.
|
|
158
183
|
*/
|
|
159
|
-
isRightRoundedCorner(elem: Measurable):
|
|
184
|
+
isRightRoundedCorner(elem: Measurable): boolean;
|
|
160
185
|
/**
|
|
161
186
|
* Whether a measurable stores information about a left square corner.
|
|
162
187
|
*
|
|
163
188
|
* @param elem The element to check.
|
|
164
189
|
* @returns 1 if the object stores information about a left square corner.
|
|
165
190
|
*/
|
|
166
|
-
isLeftSquareCorner(elem: Measurable):
|
|
191
|
+
isLeftSquareCorner(elem: Measurable): boolean;
|
|
167
192
|
/**
|
|
168
193
|
* Whether a measurable stores information about a right square corner.
|
|
169
194
|
*
|
|
170
195
|
* @param elem The element to check.
|
|
171
196
|
* @returns 1 if the object stores information about a right square corner.
|
|
172
197
|
*/
|
|
173
|
-
isRightSquareCorner(elem: Measurable):
|
|
198
|
+
isRightSquareCorner(elem: Measurable): boolean;
|
|
174
199
|
/**
|
|
175
200
|
* Whether a measurable stores information about a corner.
|
|
176
201
|
*
|
|
177
202
|
* @param elem The element to check.
|
|
178
203
|
* @returns 1 if the object stores information about a corner.
|
|
179
204
|
*/
|
|
180
|
-
isCorner(elem: Measurable):
|
|
205
|
+
isCorner(elem: Measurable): elem is SquareCorner | RoundCorner;
|
|
181
206
|
/**
|
|
182
207
|
* Whether a measurable stores information about a jagged edge.
|
|
183
208
|
*
|
|
184
209
|
* @param elem The element to check.
|
|
185
210
|
* @returns 1 if the object stores information about a jagged edge.
|
|
186
211
|
*/
|
|
187
|
-
isJaggedEdge(elem: Measurable):
|
|
212
|
+
isJaggedEdge(elem: Measurable): elem is JaggedEdge;
|
|
188
213
|
/**
|
|
189
214
|
* Whether a measurable stores information about a row.
|
|
190
215
|
*
|
|
191
216
|
* @param row The row to check.
|
|
192
217
|
* @returns 1 if the object stores information about a row.
|
|
193
218
|
*/
|
|
194
|
-
isRow(row: Row):
|
|
219
|
+
isRow(row: Row): row is Row;
|
|
195
220
|
/**
|
|
196
221
|
* Whether a measurable stores information about a between-row spacer.
|
|
197
222
|
*
|
|
198
223
|
* @param row The row to check.
|
|
199
224
|
* @returns 1 if the object stores information about a between-row spacer.
|
|
200
225
|
*/
|
|
201
|
-
isBetweenRowSpacer(row: Row):
|
|
226
|
+
isBetweenRowSpacer(row: Row): row is SpacerRow;
|
|
202
227
|
/**
|
|
203
228
|
* Whether a measurable stores information about a top row.
|
|
204
229
|
*
|
|
205
230
|
* @param row The row to check.
|
|
206
231
|
* @returns 1 if the object stores information about a top row.
|
|
207
232
|
*/
|
|
208
|
-
isTopRow(row: Row):
|
|
233
|
+
isTopRow(row: Row): row is TopRow;
|
|
209
234
|
/**
|
|
210
235
|
* Whether a measurable stores information about a bottom row.
|
|
211
236
|
*
|
|
212
237
|
* @param row The row to check.
|
|
213
238
|
* @returns 1 if the object stores information about a bottom row.
|
|
214
239
|
*/
|
|
215
|
-
isBottomRow(row: Row):
|
|
240
|
+
isBottomRow(row: Row): row is BottomRow;
|
|
216
241
|
/**
|
|
217
242
|
* Whether a measurable stores information about a top or bottom row.
|
|
218
243
|
*
|
|
219
244
|
* @param row The row to check.
|
|
220
245
|
* @returns 1 if the object stores information about a top or bottom row.
|
|
221
246
|
*/
|
|
222
|
-
isTopOrBottomRow(row: Row):
|
|
247
|
+
isTopOrBottomRow(row: Row): row is TopRow | BottomRow;
|
|
223
248
|
/**
|
|
224
249
|
* Whether a measurable stores information about an input row.
|
|
225
250
|
*
|
|
226
251
|
* @param row The row to check.
|
|
227
252
|
* @returns 1 if the object stores information about an input row.
|
|
228
253
|
*/
|
|
229
|
-
isInputRow(row: Row):
|
|
254
|
+
isInputRow(row: Row): row is InputRow;
|
|
230
255
|
}
|
|
231
256
|
export declare const Types: TypesContainer;
|
|
232
257
|
export {};
|
|
@@ -3,9 +3,13 @@
|
|
|
3
3
|
* Copyright 2024 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
6
|
+
import { FlyoutItem } from './flyout_item.js';
|
|
7
|
+
import type { IFlyout } from './interfaces/i_flyout.js';
|
|
7
8
|
import type { IFlyoutInflater } from './interfaces/i_flyout_inflater.js';
|
|
8
|
-
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare const SEPARATOR_TYPE = "sep";
|
|
9
13
|
/**
|
|
10
14
|
* Class responsible for creating separators for flyouts.
|
|
11
15
|
*/
|
|
@@ -25,10 +29,10 @@ export declare class SeparatorFlyoutInflater implements IFlyoutInflater {
|
|
|
25
29
|
* returned by gapForElement, which knows the default gap, unlike this method.
|
|
26
30
|
*
|
|
27
31
|
* @param _state A JSON representation of a flyout separator.
|
|
28
|
-
* @param
|
|
32
|
+
* @param flyout The flyout to create the separator for.
|
|
29
33
|
* @returns A newly created FlyoutSeparator.
|
|
30
34
|
*/
|
|
31
|
-
load(_state: object,
|
|
35
|
+
load(_state: object, flyout: IFlyout): FlyoutItem;
|
|
32
36
|
/**
|
|
33
37
|
* Returns the size of the separator. See `load` for more details.
|
|
34
38
|
*
|
|
@@ -36,12 +40,18 @@ export declare class SeparatorFlyoutInflater implements IFlyoutInflater {
|
|
|
36
40
|
* @param defaultGap The default spacing for flyout items.
|
|
37
41
|
* @returns The desired size of the separator.
|
|
38
42
|
*/
|
|
39
|
-
|
|
43
|
+
gapForItem(state: object, defaultGap: number): number;
|
|
40
44
|
/**
|
|
41
45
|
* Disposes of the given separator. Intentional no-op.
|
|
42
46
|
*
|
|
43
|
-
* @param
|
|
47
|
+
* @param _item The flyout separator to dispose of.
|
|
48
|
+
*/
|
|
49
|
+
disposeItem(_item: FlyoutItem): void;
|
|
50
|
+
/**
|
|
51
|
+
* Returns the type of items this inflater is responsible for creating.
|
|
52
|
+
*
|
|
53
|
+
* @returns An identifier for the type of items this inflater creates.
|
|
44
54
|
*/
|
|
45
|
-
|
|
55
|
+
getType(): string;
|
|
46
56
|
}
|
|
47
57
|
//# sourceMappingURL=separator_flyout_inflater.d.ts.map
|
package/core/utils/aria.d.ts
CHANGED
package/core/utils/toolbox.d.ts
CHANGED
package/core/variables.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { Block } from './block.js';
|
|
7
7
|
import { IVariableModel, IVariableState } from './interfaces/i_variable_model.js';
|
|
8
|
+
import type { BlockInfo, FlyoutItemInfo } from './utils/toolbox.js';
|
|
8
9
|
import type { Workspace } from './workspace.js';
|
|
9
10
|
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
10
11
|
/**
|
|
@@ -38,13 +39,26 @@ export declare function allUsedVarModels(ws: Workspace): IVariableModel<IVariabl
|
|
|
38
39
|
*/
|
|
39
40
|
export declare function allDeveloperVariables(workspace: Workspace): string[];
|
|
40
41
|
/**
|
|
41
|
-
*
|
|
42
|
-
* variable category.
|
|
42
|
+
* Internal wrapper that returns the contents of the variables category.
|
|
43
43
|
*
|
|
44
|
+
* @internal
|
|
45
|
+
* @param workspace The workspace to populate variable blocks for.
|
|
46
|
+
*/
|
|
47
|
+
export declare function internalFlyoutCategory(workspace: WorkspaceSvg): FlyoutItemInfo[];
|
|
48
|
+
export declare function flyoutCategory(workspace: WorkspaceSvg, useXml: true): Element[];
|
|
49
|
+
export declare function flyoutCategory(workspace: WorkspaceSvg, useXml: false): FlyoutItemInfo[];
|
|
50
|
+
/**
|
|
51
|
+
* Construct the blocks required by the flyout for the variable category.
|
|
52
|
+
*
|
|
53
|
+
* @internal
|
|
44
54
|
* @param workspace The workspace containing variables.
|
|
45
|
-
* @
|
|
55
|
+
* @param variables List of variables to create blocks for.
|
|
56
|
+
* @param includeChangeBlocks True to include `change x by _` blocks.
|
|
57
|
+
* @param getterType The type of the variable getter block to generate.
|
|
58
|
+
* @param setterType The type of the variable setter block to generate.
|
|
59
|
+
* @returns JSON list of blocks.
|
|
46
60
|
*/
|
|
47
|
-
export declare function
|
|
61
|
+
export declare function jsonFlyoutCategoryBlocks(workspace: Workspace, variables: IVariableModel<IVariableState>[], includeChangeBlocks: boolean, getterType?: string, setterType?: string): BlockInfo[];
|
|
48
62
|
/**
|
|
49
63
|
* Construct the blocks required by the flyout for the variable category.
|
|
50
64
|
*
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import type { FlyoutButton } from './flyout_button.js';
|
|
7
|
+
import type { FlyoutItemInfo } from './utils/toolbox.js';
|
|
7
8
|
import type { Workspace } from './workspace.js';
|
|
8
9
|
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
9
10
|
/**
|
|
@@ -36,13 +37,14 @@ export declare const onCreateVariableButtonClick_Number: typeof numberButtonClic
|
|
|
36
37
|
declare function colourButtonClickHandler(button: FlyoutButton): void;
|
|
37
38
|
export declare const onCreateVariableButtonClick_Colour: typeof colourButtonClickHandler;
|
|
38
39
|
/**
|
|
39
|
-
*
|
|
40
|
-
* variable category.
|
|
40
|
+
* Internal wrapper that returns the contents of the dynamic variables category.
|
|
41
41
|
*
|
|
42
|
-
* @
|
|
43
|
-
* @
|
|
42
|
+
* @internal
|
|
43
|
+
* @param workspace The workspace to populate variable blocks for.
|
|
44
44
|
*/
|
|
45
|
-
export declare function
|
|
45
|
+
export declare function internalFlyoutCategory(workspace: WorkspaceSvg): FlyoutItemInfo[];
|
|
46
|
+
export declare function flyoutCategory(workspace: WorkspaceSvg, useXml: true): Element[];
|
|
47
|
+
export declare function flyoutCategory(workspace: WorkspaceSvg, useXml: false): FlyoutItemInfo[];
|
|
46
48
|
/**
|
|
47
49
|
* Construct the blocks required by the flyout for the variable category.
|
|
48
50
|
*
|
package/core/workspace.d.ts
CHANGED
|
@@ -82,6 +82,7 @@ export declare class Workspace implements IASTNodeLocation {
|
|
|
82
82
|
private readonly typedBlocksDB;
|
|
83
83
|
private variableMap;
|
|
84
84
|
private procedureMap;
|
|
85
|
+
private readOnly;
|
|
85
86
|
/**
|
|
86
87
|
* Blocks in the flyout can refer to variables that don't exist in the main
|
|
87
88
|
* workspace. For instance, the "get item in list" block refers to an
|
|
@@ -456,5 +457,17 @@ export declare class Workspace implements IASTNodeLocation {
|
|
|
456
457
|
*/
|
|
457
458
|
static getAll(): Workspace[];
|
|
458
459
|
protected getVariableMapClass(): new (...p1: any[]) => IVariableMap<IVariableModel<IVariableState>>;
|
|
460
|
+
/**
|
|
461
|
+
* Returns whether or not this workspace is in readonly mode.
|
|
462
|
+
*
|
|
463
|
+
* @returns True if the workspace is readonly, otherwise false.
|
|
464
|
+
*/
|
|
465
|
+
isReadOnly(): boolean;
|
|
466
|
+
/**
|
|
467
|
+
* Sets whether or not this workspace is in readonly mode.
|
|
468
|
+
*
|
|
469
|
+
* @param readOnly True to make the workspace readonly, otherwise false.
|
|
470
|
+
*/
|
|
471
|
+
setIsReadOnly(readOnly: boolean): void;
|
|
459
472
|
}
|
|
460
473
|
//# sourceMappingURL=workspace.d.ts.map
|
package/core/workspace_svg.d.ts
CHANGED
|
@@ -495,6 +495,7 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
|
|
|
495
495
|
updateScreenCalculationsIfScrolled(): void;
|
|
496
496
|
/**
|
|
497
497
|
* @returns The layer manager for this workspace.
|
|
498
|
+
* @internal
|
|
498
499
|
*/
|
|
499
500
|
getLayerManager(): LayerManager | null;
|
|
500
501
|
/**
|
|
@@ -1002,6 +1003,7 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
|
|
|
1002
1003
|
* @param className Name of class to remove.
|
|
1003
1004
|
*/
|
|
1004
1005
|
removeClass(className: string): void;
|
|
1006
|
+
setIsReadOnly(readOnly: boolean): void;
|
|
1005
1007
|
}
|
|
1006
1008
|
/**
|
|
1007
1009
|
* Size the workspace when the contents change. This also updates
|
package/dart_compressed.js
CHANGED
|
@@ -79,7 +79,7 @@ List ${b.FUNCTION_NAME_PLACEHOLDER_}(List list, String type, int direction) {
|
|
|
79
79
|
}
|
|
80
80
|
`)+"("+c+', "'+a+'", '+d+")",Order$$module$build$src$generators$dart$dart_generator.UNARY_POSTFIX]},lists_split$$module$build$src$generators$dart$lists=function(a,b){let c=b.valueToCode(a,"INPUT",Order$$module$build$src$generators$dart$dart_generator.UNARY_POSTFIX);b=b.valueToCode(a,"DELIM",Order$$module$build$src$generators$dart$dart_generator.NONE)||"''";a=a.getFieldValue("MODE");if("SPLIT"===a)c||(c="''"),a="split";else if("JOIN"===a)c||(c="[]"),a="join";else throw Error("Unknown mode: "+a);return[c+
|
|
81
81
|
"."+a+"("+b+")",Order$$module$build$src$generators$dart$dart_generator.UNARY_POSTFIX]},lists_reverse$$module$build$src$generators$dart$lists=function(a,b){return["new List.from("+(b.valueToCode(a,"LIST",Order$$module$build$src$generators$dart$dart_generator.NONE)||"[]")+".reversed)",Order$$module$build$src$generators$dart$dart_generator.UNARY_POSTFIX]},controls_if$$module$build$src$generators$dart$logic=function(a,b){let c=0,d="",e,f;b.STATEMENT_PREFIX&&(d+=b.injectId(b.STATEMENT_PREFIX,a));do f=
|
|
82
|
-
b.valueToCode(a,"IF"+c,Order$$module$build$src$generators$dart$dart_generator.NONE)||"false",e=b.statementToCode(a,"DO"+c),b.STATEMENT_SUFFIX&&(e=b.prefixLines(b.injectId(b.STATEMENT_SUFFIX,a),b.INDENT)+e),d+=(0<c?"else ":"")+"if ("+f+") {\n"+e+"}",c++;while(a.getInput("IF"+c));if(a.getInput("ELSE")||b.STATEMENT_SUFFIX)e=b.statementToCode(a,"ELSE"),b.STATEMENT_SUFFIX&&(e=b.prefixLines(b.injectId(b.STATEMENT_SUFFIX,a),b.INDENT)+e),d+=" else {\n"+e+"}";return d+"\n"},logic_compare$$module$build$src$generators$dart$logic=
|
|
82
|
+
b.valueToCode(a,"IF"+c,Order$$module$build$src$generators$dart$dart_generator.NONE)||"false",e=b.statementToCode(a,"DO"+c),b.STATEMENT_SUFFIX&&(e=b.prefixLines(b.injectId(b.STATEMENT_SUFFIX,a),b.INDENT)+e),d+=(0<c?"else ":"")+"if ("+f+") {\n"+e+"}",c++;while(a.getInput("IF"+c));if(a.getInput("ELSE")||b.STATEMENT_SUFFIX)e=a.getInput("ELSE")?b.statementToCode(a,"ELSE"):"",b.STATEMENT_SUFFIX&&(e=b.prefixLines(b.injectId(b.STATEMENT_SUFFIX,a),b.INDENT)+e),d+=" else {\n"+e+"}";return d+"\n"},logic_compare$$module$build$src$generators$dart$logic=
|
|
83
83
|
function(a,b){const c={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="}[a.getFieldValue("OP")],d="=="===c||"!="===c?Order$$module$build$src$generators$dart$dart_generator.EQUALITY:Order$$module$build$src$generators$dart$dart_generator.RELATIONAL,e=b.valueToCode(a,"A",d)||"0";a=b.valueToCode(a,"B",d)||"0";return[e+" "+c+" "+a,d]},logic_operation$$module$build$src$generators$dart$logic=function(a,b){const c="AND"===a.getFieldValue("OP")?"&&":"||",d="&&"===c?Order$$module$build$src$generators$dart$dart_generator.LOGICAL_AND:
|
|
84
84
|
Order$$module$build$src$generators$dart$dart_generator.LOGICAL_OR;let e=b.valueToCode(a,"A",d);a=b.valueToCode(a,"B",d);e||a?(b="&&"===c?"true":"false",e||(e=b),a||(a=b)):a=e="false";return[e+" "+c+" "+a,d]},logic_negate$$module$build$src$generators$dart$logic=function(a,b){const c=Order$$module$build$src$generators$dart$dart_generator.UNARY_PREFIX;return["!"+(b.valueToCode(a,"BOOL",c)||"true"),c]},logic_boolean$$module$build$src$generators$dart$logic=function(a,b){return["TRUE"===a.getFieldValue("BOOL")?
|
|
85
85
|
"true":"false",Order$$module$build$src$generators$dart$dart_generator.ATOMIC]},logic_null$$module$build$src$generators$dart$logic=function(a,b){return["null",Order$$module$build$src$generators$dart$dart_generator.ATOMIC]},logic_ternary$$module$build$src$generators$dart$logic=function(a,b){const c=b.valueToCode(a,"IF",Order$$module$build$src$generators$dart$dart_generator.CONDITIONAL)||"false",d=b.valueToCode(a,"THEN",Order$$module$build$src$generators$dart$dart_generator.CONDITIONAL)||"null";a=b.valueToCode(a,
|