blockly 11.0.0-beta.3 → 11.0.0-beta.5
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 +504 -474
- package/blockly_compressed.js +494 -464
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js +10 -10
- package/blocks_compressed.js.map +1 -1
- package/core/block.d.ts +1 -8
- package/core/block_dragger.d.ts +66 -4
- package/core/block_svg.d.ts +32 -5
- package/core/blockly.d.ts +35 -0
- package/core/clipboard.d.ts +19 -0
- package/core/connection_previewers/insertion_marker_previewer.d.ts +56 -0
- package/core/gesture.d.ts +0 -2
- package/core/grid.d.ts +24 -3
- package/core/icons/comment_icon.d.ts +2 -2
- package/core/icons/icon.d.ts +6 -0
- package/core/icons/mutator_icon.d.ts +16 -1
- package/core/icons/warning_icon.d.ts +1 -1
- package/core/inputs/input.d.ts +19 -10
- package/core/insertion_marker_manager.d.ts +2 -0
- package/core/interfaces/i_connection_previewer.d.ts +39 -0
- package/core/interfaces/i_has_bubble.d.ts +1 -1
- package/core/interfaces/i_parameter_model.d.ts +0 -7
- package/core/interfaces/i_procedure_model.d.ts +0 -7
- package/core/options.d.ts +0 -1
- package/core/registry.d.ts +4 -2
- package/core/render_management.d.ts +4 -1
- package/core/rendered_connection.d.ts +3 -1
- package/core/renderers/common/constants.d.ts +6 -2
- package/core/renderers/common/drawer.d.ts +25 -0
- package/core/renderers/common/i_path_object.d.ts +6 -15
- package/core/renderers/common/info.d.ts +5 -2
- package/core/renderers/common/path_object.d.ts +13 -0
- package/core/renderers/common/renderer.d.ts +3 -0
- package/core/renderers/measurables/connection.d.ts +1 -0
- package/core/renderers/measurables/icon.d.ts +5 -0
- package/core/renderers/minimalist/constants.d.ts +21 -0
- package/core/renderers/minimalist/drawer.d.ts +26 -0
- package/core/renderers/minimalist/info.d.ts +35 -0
- package/core/renderers/minimalist/minimalist.d.ts +12 -0
- package/core/renderers/minimalist/renderer.d.ts +48 -0
- package/core/renderers/zelos/drawer.d.ts +4 -0
- package/core/renderers/zelos/renderer.d.ts +4 -2
- package/core/serialization/procedures.d.ts +26 -28
- package/core/utils/dom.d.ts +9 -0
- package/core/utils/string.d.ts +10 -0
- package/core/workspace_audio.d.ts +10 -0
- package/core/workspace_svg.d.ts +27 -1
- package/dart.d.ts +24 -1
- package/javascript.d.ts +41 -1
- package/lua.d.ts +18 -1
- package/msg/ar.js +1 -1
- package/msg/be-tarask.js +8 -8
- package/msg/bn.js +5 -5
- package/msg/da.js +4 -4
- package/msg/el.js +1 -1
- package/msg/he.js +1 -1
- package/msg/id.js +6 -6
- package/msg/inh.js +3 -3
- package/msg/ja.js +1 -1
- package/msg/nl.js +3 -3
- package/msg/pt.js +1 -1
- package/msg/ta.js +2 -2
- package/msg/tl.js +2 -2
- package/msg/ur.js +2 -2
- package/msg/zh-hant.js +14 -14
- package/package.json +5 -8
- package/php.d.ts +43 -1
- package/python.d.ts +27 -1
- package/msg/yue.js +0 -441
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Copyright 2022 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { ParameterState } from '../serialization/procedures';
|
|
7
6
|
import { IProcedureModel } from './i_procedure_model';
|
|
8
7
|
/**
|
|
9
8
|
* A data model for a procedure.
|
|
@@ -34,11 +33,5 @@ export interface IParameterModel {
|
|
|
34
33
|
getId(): string;
|
|
35
34
|
/** Sets the procedure model this parameter is associated with. */
|
|
36
35
|
setProcedureModel(model: IProcedureModel): this;
|
|
37
|
-
/**
|
|
38
|
-
* Serializes the state of the parameter to JSON.
|
|
39
|
-
*
|
|
40
|
-
* @returns JSON serializable state of the parameter.
|
|
41
|
-
*/
|
|
42
|
-
saveState(): ParameterState;
|
|
43
36
|
}
|
|
44
37
|
//# sourceMappingURL=i_parameter_model.d.ts.map
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Copyright 2022 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { State } from '../serialization/procedures.js';
|
|
7
6
|
import { IParameterModel } from './i_parameter_model.js';
|
|
8
7
|
/**
|
|
9
8
|
* A data model for a procedure.
|
|
@@ -49,11 +48,5 @@ export interface IProcedureModel {
|
|
|
49
48
|
* disabled, all procedure caller blocks should be disabled as well.
|
|
50
49
|
*/
|
|
51
50
|
getEnabled(): boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Serializes the state of the procedure to JSON.
|
|
54
|
-
*
|
|
55
|
-
* @returns JSON serializable state of the procedure.
|
|
56
|
-
*/
|
|
57
|
-
saveState(): State;
|
|
58
51
|
}
|
|
59
52
|
//# sourceMappingURL=i_procedure_model.d.ts.map
|
package/core/options.d.ts
CHANGED
package/core/registry.d.ts
CHANGED
|
@@ -18,8 +18,9 @@ import type { Options } from './options.js';
|
|
|
18
18
|
import type { Renderer } from './renderers/common/renderer.js';
|
|
19
19
|
import type { Theme } from './theme.js';
|
|
20
20
|
import type { ToolboxItem } from './toolbox/toolbox_item.js';
|
|
21
|
-
import { IPaster } from './interfaces/i_paster.js';
|
|
22
|
-
import { ICopyable } from './interfaces/i_copyable.js';
|
|
21
|
+
import type { IPaster } from './interfaces/i_paster.js';
|
|
22
|
+
import type { ICopyable } from './interfaces/i_copyable.js';
|
|
23
|
+
import type { IConnectionPreviewer } from './interfaces/i_connection_previewer.js';
|
|
23
24
|
export declare const TEST_ONLY: {
|
|
24
25
|
typeMap: {
|
|
25
26
|
[key: string]: {
|
|
@@ -45,6 +46,7 @@ export declare class Type<_T> {
|
|
|
45
46
|
*/
|
|
46
47
|
toString(): string;
|
|
47
48
|
static CONNECTION_CHECKER: Type<IConnectionChecker>;
|
|
49
|
+
static CONNECTION_PREVIEWER: Type<IConnectionPreviewer>;
|
|
48
50
|
static CURSOR: Type<Cursor>;
|
|
49
51
|
static EVENT: Type<Abstract>;
|
|
50
52
|
static FIELD: Type<Field<any>>;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { BlockSvg } from './block_svg.js';
|
|
7
|
+
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
7
8
|
/**
|
|
8
9
|
* Registers that the given block and all of its parents need to be rerendered,
|
|
9
10
|
* and registers a callback to do so after a delay, to allowf or batching.
|
|
@@ -25,7 +26,9 @@ export declare function finishQueuedRenders(): Promise<void>;
|
|
|
25
26
|
* cases where queueing renders breaks functionality + backwards compatibility
|
|
26
27
|
* (such as rendering icons).
|
|
27
28
|
*
|
|
29
|
+
* @param workspace If provided, only rerender blocks in this workspace.
|
|
30
|
+
*
|
|
28
31
|
* @internal
|
|
29
32
|
*/
|
|
30
|
-
export declare function triggerQueuedRenders(): void;
|
|
33
|
+
export declare function triggerQueuedRenders(workspace?: WorkspaceSvg): void;
|
|
31
34
|
//# sourceMappingURL=render_management.d.ts.map
|
|
@@ -21,7 +21,7 @@ export declare class RenderedConnection extends Connection {
|
|
|
21
21
|
private readonly dbOpposite;
|
|
22
22
|
private readonly offsetInBlock;
|
|
23
23
|
private trackedState;
|
|
24
|
-
private
|
|
24
|
+
private highlighted;
|
|
25
25
|
/** Connection this connection connects to. Null if not connected. */
|
|
26
26
|
targetConnection: RenderedConnection | null;
|
|
27
27
|
/**
|
|
@@ -130,6 +130,8 @@ export declare class RenderedConnection extends Connection {
|
|
|
130
130
|
highlight(): void;
|
|
131
131
|
/** Remove the highlighting around this connection. */
|
|
132
132
|
unhighlight(): void;
|
|
133
|
+
/** Returns true if this connection is highlighted, false otherwise. */
|
|
134
|
+
isHighlighted(): boolean;
|
|
133
135
|
/**
|
|
134
136
|
* Set whether this connections is tracked in the database or not.
|
|
135
137
|
*
|
|
@@ -39,8 +39,8 @@ export interface PuzzleTab {
|
|
|
39
39
|
type: number;
|
|
40
40
|
width: number;
|
|
41
41
|
height: number;
|
|
42
|
-
pathDown: string
|
|
43
|
-
pathUp: string
|
|
42
|
+
pathDown: string;
|
|
43
|
+
pathUp: string;
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* An object containing sizing and path information about collapsed block
|
|
@@ -78,6 +78,10 @@ export type Shape = BaseShape | DynamicShape;
|
|
|
78
78
|
* @returns Whether the shape is a dynamic shape or not.
|
|
79
79
|
*/
|
|
80
80
|
export declare function isDynamicShape(shape: Shape): shape is DynamicShape;
|
|
81
|
+
/** Returns whether the shape is a puzzle tab or not. */
|
|
82
|
+
export declare function isPuzzleTab(shape: Shape): shape is PuzzleTab;
|
|
83
|
+
/** Returns whether the shape is a notch or not. */
|
|
84
|
+
export declare function isNotch(shape: Shape): shape is Notch;
|
|
81
85
|
/**
|
|
82
86
|
* An object that provides constants for rendering blocks.
|
|
83
87
|
*/
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { BlockSvg } from '../../block_svg.js';
|
|
7
7
|
import { Coordinate } from '../../utils.js';
|
|
8
|
+
import { Connection } from '../measurables/connection.js';
|
|
8
9
|
import type { Field } from '../measurables/field.js';
|
|
9
10
|
import type { Icon } from '../measurables/icon.js';
|
|
10
11
|
import type { InlineInput } from '../measurables/inline_input.js';
|
|
@@ -37,6 +38,13 @@ export declare class Drawer {
|
|
|
37
38
|
* required.
|
|
38
39
|
*/
|
|
39
40
|
draw(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Hide icons that were marked as hidden.
|
|
43
|
+
*
|
|
44
|
+
* @deprecated Manually hiding icons is no longer necessary. To be removed
|
|
45
|
+
* in v11.
|
|
46
|
+
*/
|
|
47
|
+
protected hideHiddenIcons_(): void;
|
|
40
48
|
/**
|
|
41
49
|
* Save sizing information back to the block
|
|
42
50
|
* Most of the rendering information can be thrown away at the end of the
|
|
@@ -134,5 +142,22 @@ export declare class Drawer {
|
|
|
134
142
|
protected positionNextConnection_(): void;
|
|
135
143
|
/** Position the output connection on a block. */
|
|
136
144
|
protected positionOutputConnection_(): void;
|
|
145
|
+
/**
|
|
146
|
+
* Updates the path object to reflect which connections on the block are
|
|
147
|
+
* highlighted.
|
|
148
|
+
*/
|
|
149
|
+
protected updateConnectionHighlights(): void;
|
|
150
|
+
/** Returns a path to highlight the given connection. */
|
|
151
|
+
drawConnectionHighlightPath(measurable: Connection): void;
|
|
152
|
+
/**
|
|
153
|
+
* Returns a path to highlight the given conneciton, assuming it is an
|
|
154
|
+
* input or output connection.
|
|
155
|
+
*/
|
|
156
|
+
private getExpressionConnectionHighlightPath;
|
|
157
|
+
/**
|
|
158
|
+
* Returns a path to highlight the given conneciton, assuming it is a
|
|
159
|
+
* next or previous connection.
|
|
160
|
+
*/
|
|
161
|
+
private getStatementConnectionHighlightPath;
|
|
137
162
|
}
|
|
138
163
|
//# sourceMappingURL=drawer.d.ts.map
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
import type { BlockStyle } from '../../theme.js';
|
|
7
7
|
import type { BlockSvg } from '../../block_svg.js';
|
|
8
8
|
import type { ConstantProvider } from './constants.js';
|
|
9
|
-
import { RenderedConnection } from '../../rendered_connection.js';
|
|
9
|
+
import type { RenderedConnection } from '../../rendered_connection.js';
|
|
10
|
+
import type { Coordinate } from '../../utils/coordinate.js';
|
|
10
11
|
/**
|
|
11
12
|
* An interface for a block's path object.
|
|
12
13
|
*
|
|
@@ -101,21 +102,11 @@ export interface IPathObject {
|
|
|
101
102
|
* @param enable True if the block is movable, false otherwise.
|
|
102
103
|
*/
|
|
103
104
|
updateMovable(enabled: boolean): void;
|
|
105
|
+
/** Adds the given path as a connection highlight for the given connection. */
|
|
106
|
+
addConnectionHighlight?(connection: RenderedConnection, connectionPath: string, offset: Coordinate, rtl: boolean): void;
|
|
104
107
|
/**
|
|
105
|
-
*
|
|
106
|
-
* this block will be replaced. If a shadow block, it will disappear.
|
|
107
|
-
* Otherwise it will bump.
|
|
108
|
-
*
|
|
109
|
-
* @param enable True if styling should be added.
|
|
110
|
-
*/
|
|
111
|
-
updateReplacementFade(enabled: boolean): void;
|
|
112
|
-
/**
|
|
113
|
-
* Add or remove styling that shows that if the dragging block is dropped,
|
|
114
|
-
* this block will be connected to the input.
|
|
115
|
-
*
|
|
116
|
-
* @param conn The connection on the input to highlight.
|
|
117
|
-
* @param enable True if styling should be added.
|
|
108
|
+
* Removes any highlight associated with the given connection, if it exists.
|
|
118
109
|
*/
|
|
119
|
-
|
|
110
|
+
removeConnectionHighlight?(connection: RenderedConnection): void;
|
|
120
111
|
}
|
|
121
112
|
//# sourceMappingURL=i_path_object.d.ts.map
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { BlockSvg } from '../../block_svg.js';
|
|
7
7
|
import { Input } from '../../inputs/input.js';
|
|
8
|
+
import type { RenderedConnection } from '../../rendered_connection.js';
|
|
8
9
|
import type { Measurable } from '../measurables/base.js';
|
|
9
10
|
import { BottomRow } from '../measurables/bottom_row.js';
|
|
10
11
|
import { InputRow } from '../measurables/input_row.js';
|
|
@@ -14,6 +15,7 @@ import { SpacerRow } from '../measurables/spacer_row.js';
|
|
|
14
15
|
import { TopRow } from '../measurables/top_row.js';
|
|
15
16
|
import type { ConstantProvider } from './constants.js';
|
|
16
17
|
import type { Renderer } from './renderer.js';
|
|
18
|
+
import { Connection } from '../measurables/connection.js';
|
|
17
19
|
/**
|
|
18
20
|
* An object containing all sizing information needed to draw this block.
|
|
19
21
|
*
|
|
@@ -61,8 +63,7 @@ export declare class RenderInfo {
|
|
|
61
63
|
*/
|
|
62
64
|
getRenderer(): Renderer;
|
|
63
65
|
/**
|
|
64
|
-
* Populate
|
|
65
|
-
* draw this block.
|
|
66
|
+
* Populate this object with all sizing information needed to draw the block.
|
|
66
67
|
*
|
|
67
68
|
* This measure pass does not propagate changes to the block (although fields
|
|
68
69
|
* may choose to rerender when getSize() is called). However, calling it
|
|
@@ -194,5 +195,7 @@ export declare class RenderInfo {
|
|
|
194
195
|
* store the y position of each row, and record the height of the full block.
|
|
195
196
|
*/
|
|
196
197
|
protected finalize_(): void;
|
|
198
|
+
/** Returns the connection measurable associated with the given connection. */
|
|
199
|
+
getMeasureableForConnection(conn: RenderedConnection): Connection | null;
|
|
197
200
|
}
|
|
198
201
|
//# sourceMappingURL=info.d.ts.map
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { BlockSvg } from '../../block_svg.js';
|
|
7
7
|
import type { Connection } from '../../connection.js';
|
|
8
|
+
import { RenderedConnection } from '../../rendered_connection.js';
|
|
8
9
|
import type { BlockStyle } from '../../theme.js';
|
|
10
|
+
import { Coordinate } from '../../utils/coordinate.js';
|
|
9
11
|
import type { ConstantProvider } from './constants.js';
|
|
10
12
|
import type { IPathObject } from './i_path_object.js';
|
|
11
13
|
/**
|
|
@@ -27,6 +29,10 @@ export declare class PathObject implements IPathObject {
|
|
|
27
29
|
markerSvg: SVGElement | null;
|
|
28
30
|
constants: ConstantProvider;
|
|
29
31
|
style: BlockStyle;
|
|
32
|
+
/** Highlight paths associated with connections. */
|
|
33
|
+
private connectionHighlights;
|
|
34
|
+
/** Locations of connection highlights. */
|
|
35
|
+
private highlightOffsets;
|
|
30
36
|
/**
|
|
31
37
|
* @param root The root SVG element.
|
|
32
38
|
* @param style The style object to use for colouring.
|
|
@@ -138,5 +144,12 @@ export declare class PathObject implements IPathObject {
|
|
|
138
144
|
* @param _enable True if styling should be added.
|
|
139
145
|
*/
|
|
140
146
|
updateShapeForInputHighlight(_conn: Connection, _enable: boolean): void;
|
|
147
|
+
/** Adds the given path as a connection highlight for the given connection. */
|
|
148
|
+
addConnectionHighlight(connection: RenderedConnection, connectionPath: string, offset: Coordinate, rtl: boolean): void;
|
|
149
|
+
private currentHighlightMatchesNew;
|
|
150
|
+
/**
|
|
151
|
+
* Removes any highlight associated with the given connection, if it exists.
|
|
152
|
+
*/
|
|
153
|
+
removeConnectionHighlight(connection: RenderedConnection): void;
|
|
141
154
|
}
|
|
142
155
|
//# sourceMappingURL=path_object.d.ts.map
|
|
@@ -141,6 +141,9 @@ export declare class Renderer implements IRegistrable {
|
|
|
141
141
|
* @param local The connection currently being dragged.
|
|
142
142
|
* @param topBlock The block currently being dragged.
|
|
143
143
|
* @returns The preview type to display.
|
|
144
|
+
*
|
|
145
|
+
* @deprecated v10 - This function is no longer respected. A custom
|
|
146
|
+
* IConnectionPreviewer may be able to fulfill the functionality.
|
|
144
147
|
*/
|
|
145
148
|
getConnectionPreviewMethod(closest: RenderedConnection, local: RenderedConnection, topBlock: BlockSvg): PreviewType;
|
|
146
149
|
/**
|
|
@@ -14,6 +14,7 @@ export declare class Connection extends Measurable {
|
|
|
14
14
|
connectionModel: RenderedConnection;
|
|
15
15
|
shape: Shape;
|
|
16
16
|
isDynamicShape: boolean;
|
|
17
|
+
highlighted: boolean;
|
|
17
18
|
/**
|
|
18
19
|
* @param constants The rendering constants provider.
|
|
19
20
|
* @param connectionModel The connection object on the block that this
|
|
@@ -12,6 +12,11 @@ import { Measurable } from './base.js';
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class Icon extends Measurable {
|
|
14
14
|
icon: BlocklyIcon;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Will be removed in v11. Create a subclass of the Icon
|
|
17
|
+
* measurable if this data is necessary for you.
|
|
18
|
+
*/
|
|
19
|
+
isVisible: boolean;
|
|
15
20
|
flipRtl: boolean;
|
|
16
21
|
/**
|
|
17
22
|
* An object containing information about the space an icon takes up during
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { BlockSvg } from '../../block_svg.js';
|
|
7
7
|
import { Drawer as BaseDrawer } from '../common/drawer.js';
|
|
8
|
+
import { Connection } from '../measurables/connection.js';
|
|
8
9
|
import type { InlineInput } from '../measurables/inline_input.js';
|
|
9
10
|
import type { Row } from '../measurables/row.js';
|
|
10
11
|
import type { RenderInfo } from './info.js';
|
|
@@ -42,6 +43,9 @@ export declare class Drawer extends BaseDrawer {
|
|
|
42
43
|
/** Add steps to draw a flat bottom row. */
|
|
43
44
|
protected drawFlatBottom_(): void;
|
|
44
45
|
drawInlineInput_(input: InlineInput): void;
|
|
46
|
+
private getInlineInputPath;
|
|
45
47
|
drawStatementInput_(row: Row): void;
|
|
48
|
+
/** Returns a path to highlight the given connection. */
|
|
49
|
+
drawConnectionHighlightPath(measurable: Connection): void;
|
|
46
50
|
}
|
|
47
51
|
//# sourceMappingURL=drawer.d.ts.map
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import type { BlockSvg } from '../../block_svg.js';
|
|
7
|
-
import type { Connection } from '../../connection.js';
|
|
8
7
|
import { InsertionMarkerManager } from '../../insertion_marker_manager.js';
|
|
9
8
|
import type { Marker } from '../../keyboard_nav/marker.js';
|
|
10
9
|
import type { RenderedConnection } from '../../rendered_connection.js';
|
|
@@ -74,7 +73,10 @@ export declare class Renderer extends BaseRenderer {
|
|
|
74
73
|
* @returns The constant provider.
|
|
75
74
|
*/
|
|
76
75
|
getConstants(): ConstantProvider;
|
|
77
|
-
|
|
76
|
+
/**
|
|
77
|
+
* @deprecated v10 - This function is no longer respected. A custom
|
|
78
|
+
* IConnectionPreviewer may be able to fulfill the functionality.
|
|
79
|
+
*/
|
|
78
80
|
getConnectionPreviewMethod(closest: RenderedConnection, local: RenderedConnection, topBlock: BlockSvg): InsertionMarkerManager.PREVIEW_TYPE;
|
|
79
81
|
}
|
|
80
82
|
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -7,65 +7,63 @@ import { IParameterModel } from '../interfaces/i_parameter_model.js';
|
|
|
7
7
|
import { IProcedureModel } from '../interfaces/i_procedure_model.js';
|
|
8
8
|
import type { ISerializer } from '../interfaces/i_serializer.js';
|
|
9
9
|
import type { Workspace } from '../workspace.js';
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Representation of a procedure data model.
|
|
12
|
+
*/
|
|
11
13
|
export interface State {
|
|
12
14
|
id: string;
|
|
13
15
|
name: string;
|
|
14
16
|
returnTypes: string[] | null;
|
|
15
17
|
parameters?: ParameterState[];
|
|
16
|
-
[key: string]: unknown;
|
|
17
18
|
}
|
|
18
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Representation of a parameter data model.
|
|
21
|
+
*/
|
|
19
22
|
export interface ParameterState {
|
|
20
23
|
id: string;
|
|
21
24
|
name: string;
|
|
22
25
|
types?: string[];
|
|
23
|
-
[key: string]: unknown;
|
|
24
26
|
}
|
|
25
27
|
/**
|
|
26
28
|
* A newable signature for an IProcedureModel.
|
|
27
29
|
*
|
|
28
30
|
* Refer to
|
|
29
|
-
* https://www.typescriptlang.org/docs/handbook/
|
|
31
|
+
* https://www.typescriptlang.org/docs/handbook/2/generics.html#using-class-types-in-generics
|
|
30
32
|
* for what is going on with this.
|
|
31
33
|
*/
|
|
32
|
-
|
|
33
|
-
new (workspace: Workspace, name: string, id: string): ProcedureModel;
|
|
34
|
-
/**
|
|
35
|
-
* Deserializes the JSON state and returns a procedure model.
|
|
36
|
-
*
|
|
37
|
-
* @param state The state to deserialize.
|
|
38
|
-
* @param workspace The workspace to load the procedure model into.
|
|
39
|
-
* @returns The constructed procedure model.
|
|
40
|
-
*/
|
|
41
|
-
loadState(state: Object, workspace: Workspace): ProcedureModel;
|
|
42
|
-
}
|
|
34
|
+
type ProcedureModelConstructor<ProcedureModel extends IProcedureModel> = new (workspace: Workspace, name: string, id: string) => ProcedureModel;
|
|
43
35
|
/**
|
|
44
36
|
* A newable signature for an IParameterModel.
|
|
45
37
|
*
|
|
46
38
|
* Refer to
|
|
47
|
-
* https://www.typescriptlang.org/docs/handbook/
|
|
39
|
+
* https://www.typescriptlang.org/docs/handbook/2/generics.html#using-class-types-in-generics
|
|
48
40
|
* for what is going on with this.
|
|
49
41
|
*/
|
|
50
|
-
|
|
51
|
-
new (workspace: Workspace, name: string, id: string): ParameterModel;
|
|
52
|
-
/**
|
|
53
|
-
* Deserializes the JSON state and returns a parameter model.
|
|
54
|
-
*
|
|
55
|
-
* @param state The state to deserialize.
|
|
56
|
-
* @param workspace The workspace to load the parameter model into.
|
|
57
|
-
* @returns The constructed parameter model.
|
|
58
|
-
*/
|
|
59
|
-
loadState(state: Object, workspace: Workspace): ParameterModel;
|
|
60
|
-
}
|
|
42
|
+
type ParameterModelConstructor<ParameterModel extends IParameterModel> = new (workspace: Workspace, name: string, id: string) => ParameterModel;
|
|
61
43
|
/**
|
|
62
44
|
* Serializes the given IProcedureModel to JSON.
|
|
45
|
+
*
|
|
46
|
+
* @internal
|
|
63
47
|
*/
|
|
64
48
|
export declare function saveProcedure(proc: IProcedureModel): State;
|
|
49
|
+
/**
|
|
50
|
+
* Serializes the given IParameterModel to JSON.
|
|
51
|
+
*
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
export declare function saveParameter(param: IParameterModel): ParameterState;
|
|
65
55
|
/**
|
|
66
56
|
* Deserializes the given procedure model State from JSON.
|
|
57
|
+
*
|
|
58
|
+
* @internal
|
|
67
59
|
*/
|
|
68
60
|
export declare function loadProcedure<ProcedureModel extends IProcedureModel, ParameterModel extends IParameterModel>(procedureModelClass: ProcedureModelConstructor<ProcedureModel>, parameterModelClass: ParameterModelConstructor<ParameterModel>, state: State, workspace: Workspace): ProcedureModel;
|
|
61
|
+
/**
|
|
62
|
+
* Deserializes the given ParameterState from JSON.
|
|
63
|
+
*
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
export declare function loadParameter<ParameterModel extends IParameterModel>(parameterModelClass: ParameterModelConstructor<ParameterModel>, state: ParameterState, workspace: Workspace): ParameterModel;
|
|
69
67
|
/** Serializer for saving and loading procedure state. */
|
|
70
68
|
export declare class ProcedureSerializer<ProcedureModel extends IProcedureModel, ParameterModel extends IParameterModel> implements ISerializer {
|
|
71
69
|
private readonly procedureModelClass;
|
package/core/utils/dom.d.ts
CHANGED
|
@@ -86,6 +86,15 @@ export declare function removeNode(node: Node | null): Node | null;
|
|
|
86
86
|
* @param refNode Existing element to precede new node.
|
|
87
87
|
*/
|
|
88
88
|
export declare function insertAfter(newNode: Element, refNode: Element): void;
|
|
89
|
+
/**
|
|
90
|
+
* Whether a node contains another node.
|
|
91
|
+
*
|
|
92
|
+
* @param parent The node that should contain the other node.
|
|
93
|
+
* @param descendant The node to test presence of.
|
|
94
|
+
* @returns Whether the parent node contains the descendant node.
|
|
95
|
+
* @deprecated Use native 'contains' DOM method.
|
|
96
|
+
*/
|
|
97
|
+
export declare function containsNode(parent: Node, descendant: Node): boolean;
|
|
89
98
|
/**
|
|
90
99
|
* Sets the CSS transform property on an element. This function sets the
|
|
91
100
|
* non-vendor-prefixed and vendor-prefixed versions for backwards compatibility
|
package/core/utils/string.d.ts
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* Fast prefix-checker.
|
|
8
|
+
* Copied from Closure's goog.string.startsWith.
|
|
9
|
+
*
|
|
10
|
+
* @param str The string to check.
|
|
11
|
+
* @param prefix A string to look for at the start of `str`.
|
|
12
|
+
* @returns True if `str` begins with `prefix`.
|
|
13
|
+
* @deprecated Use built-in **string.startsWith** instead.
|
|
14
|
+
*/
|
|
15
|
+
export declare function startsWith(str: string, prefix: string): boolean;
|
|
6
16
|
/**
|
|
7
17
|
* Given an array of strings, return the length of the shortest one.
|
|
8
18
|
*
|
|
@@ -13,6 +13,8 @@ export declare class WorkspaceAudio {
|
|
|
13
13
|
private sounds;
|
|
14
14
|
/** Time that the last sound was played. */
|
|
15
15
|
private lastSound_;
|
|
16
|
+
/** Whether the audio is muted or not. */
|
|
17
|
+
private muted;
|
|
16
18
|
/**
|
|
17
19
|
* @param parentWorkspace The parent of the workspace this audio object
|
|
18
20
|
* belongs to, or null.
|
|
@@ -47,5 +49,13 @@ export declare class WorkspaceAudio {
|
|
|
47
49
|
* @param opt_volume Volume of sound (0-1).
|
|
48
50
|
*/
|
|
49
51
|
play(name: string, opt_volume?: number): void;
|
|
52
|
+
/**
|
|
53
|
+
* @param muted If true, mute sounds. Otherwise, play them.
|
|
54
|
+
*/
|
|
55
|
+
setMuted(muted: boolean): void;
|
|
56
|
+
/**
|
|
57
|
+
* @returns Whether the audio is currently muted or not.
|
|
58
|
+
*/
|
|
59
|
+
getMuted(): boolean;
|
|
50
60
|
}
|
|
51
61
|
//# sourceMappingURL=workspace_audio.d.ts.map
|