blockly 9.0.1 → 9.1.0-beta.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/README.md +2 -2
- package/blockly.js +1 -1
- package/blockly.min.js +332 -312
- package/blockly_compressed.js +311 -306
- package/blockly_compressed.js.map +1 -1
- package/blocks.js +1 -1
- package/blocks_compressed.js +1 -1
- package/blocks_compressed.js.map +1 -1
- package/browser.js +1 -1
- package/core/block_drag_surface.d.ts +15 -8
- package/core/block_svg.d.ts +10 -4
- package/core/blockly.d.ts +8 -20
- package/core/bubble.d.ts +32 -32
- package/core/comment.d.ts +15 -19
- package/core/field_angle.d.ts +15 -2
- package/core/field_dropdown.d.ts +19 -24
- package/core/field_variable.d.ts +3 -3
- package/core/generator.d.ts +4 -4
- package/core/interfaces/i_parameter_model.d.ts +8 -0
- package/core/interfaces/i_procedure_block.d.ts +13 -0
- package/core/interfaces/i_procedure_map.d.ts +16 -0
- package/core/menu.d.ts +19 -19
- package/core/menuitem.d.ts +8 -8
- package/core/mutator.d.ts +13 -13
- package/core/procedures/observable_parameter_model.d.ts +11 -0
- package/core/procedures/observable_procedure_map.d.ts +6 -1
- package/core/procedures/observable_procedure_model.d.ts +7 -3
- package/core/procedures/update_procedures.d.ts +13 -0
- package/core/procedures.d.ts +4 -0
- package/core/rendered_connection.d.ts +1 -1
- package/core/renderers/common/constants.d.ts +1 -6
- package/core/scrollbar.d.ts +68 -39
- package/core/serialization/blocks.d.ts +38 -0
- package/core/serialization/priorities.d.ts +4 -0
- package/core/serialization/procedures.d.ts +78 -0
- package/core/serialization/variables.d.ts +33 -0
- package/core/serialization.d.ts +2 -1
- package/core/theme.d.ts +5 -5
- package/core/warning.d.ts +4 -4
- package/core/workspace.d.ts +9 -5
- package/core/workspace_svg.d.ts +26 -26
- package/core/zoom_controls.d.ts +18 -18
- package/core-browser.js +1 -1
- package/core.js +1 -1
- package/dart.js +1 -1
- package/dart_compressed.js +2 -2
- package/dart_compressed.js.map +1 -1
- package/index.js +1 -1
- package/javascript.js +1 -1
- package/javascript_compressed.js +4 -5
- package/javascript_compressed.js.map +1 -1
- package/lua.js +1 -1
- package/lua_compressed.js +2 -3
- package/lua_compressed.js.map +1 -1
- package/msg/ab.js +1 -1
- package/msg/ace.js +1 -1
- package/msg/af.js +1 -1
- package/msg/am.js +1 -1
- package/msg/ar.js +1 -1
- package/msg/ast.js +1 -1
- package/msg/az.js +1 -1
- package/msg/ba.js +1 -1
- package/msg/bcc.js +1 -1
- package/msg/be-tarask.js +1 -1
- package/msg/be.js +1 -1
- package/msg/bg.js +1 -1
- package/msg/bn.js +1 -1
- package/msg/br.js +1 -1
- package/msg/bs.js +1 -1
- package/msg/ca.js +1 -1
- package/msg/cdo.js +1 -1
- package/msg/cs.js +1 -1
- package/msg/da.js +1 -1
- package/msg/de.js +1 -1
- package/msg/diq.js +1 -1
- package/msg/dty.js +1 -1
- package/msg/ee.js +1 -1
- package/msg/el.js +1 -1
- package/msg/en-gb.js +1 -1
- package/msg/en.js +1 -1
- package/msg/eo.js +1 -1
- package/msg/es.js +1 -1
- package/msg/et.js +1 -1
- package/msg/eu.js +1 -1
- package/msg/fa.js +1 -1
- package/msg/fi.js +1 -1
- package/msg/fo.js +1 -1
- package/msg/fr.js +1 -1
- package/msg/frr.js +1 -1
- package/msg/gl.js +1 -1
- package/msg/gn.js +1 -1
- package/msg/gor.js +1 -1
- package/msg/ha.js +1 -1
- package/msg/hak.js +1 -1
- package/msg/he.js +1 -1
- package/msg/hi.js +1 -1
- package/msg/hr.js +1 -1
- package/msg/hrx.js +1 -1
- package/msg/hu.js +1 -1
- package/msg/hy.js +1 -1
- package/msg/ia.js +1 -1
- package/msg/id.js +1 -1
- package/msg/ig.js +1 -1
- package/msg/inh.js +1 -1
- package/msg/is.js +1 -1
- package/msg/it.js +1 -1
- package/msg/ja.js +1 -1
- package/msg/ka.js +1 -1
- package/msg/kab.js +1 -1
- package/msg/kbd-cyrl.js +1 -1
- package/msg/km.js +1 -1
- package/msg/kn.js +1 -1
- package/msg/ko.js +1 -1
- package/msg/ksh.js +1 -1
- package/msg/ku-latn.js +1 -1
- package/msg/ky.js +1 -1
- package/msg/la.js +1 -1
- package/msg/lb.js +1 -1
- package/msg/lki.js +1 -1
- package/msg/lo.js +1 -1
- package/msg/lrc.js +1 -1
- package/msg/lt.js +1 -1
- package/msg/lv.js +1 -1
- package/msg/mg.js +1 -1
- package/msg/mk.js +1 -1
- package/msg/ml.js +1 -1
- package/msg/mnw.js +1 -1
- package/msg/ms.js +1 -1
- package/msg/my.js +1 -1
- package/msg/mzn.js +1 -1
- package/msg/nb.js +1 -1
- package/msg/ne.js +1 -1
- package/msg/nl.js +1 -1
- package/msg/oc.js +1 -1
- package/msg/olo.js +1 -1
- package/msg/pa.js +1 -1
- package/msg/pl.js +1 -1
- package/msg/pms.js +1 -1
- package/msg/ps.js +1 -1
- package/msg/pt-br.js +1 -1
- package/msg/pt.js +1 -1
- package/msg/ro.js +1 -1
- package/msg/ru.js +1 -1
- package/msg/sc.js +1 -1
- package/msg/sco.js +1 -1
- package/msg/sd.js +1 -1
- package/msg/shn.js +1 -1
- package/msg/si.js +1 -1
- package/msg/sk.js +1 -1
- package/msg/skr-arab.js +1 -1
- package/msg/sl.js +1 -1
- package/msg/smn.js +1 -1
- package/msg/sq.js +1 -1
- package/msg/sr-latn.js +1 -1
- package/msg/sr.js +1 -1
- package/msg/sv.js +1 -1
- package/msg/sw.js +1 -1
- package/msg/ta.js +1 -1
- package/msg/tcy.js +1 -1
- package/msg/tdd.js +1 -1
- package/msg/te.js +1 -1
- package/msg/th.js +1 -1
- package/msg/ti.js +1 -1
- package/msg/tl.js +1 -1
- package/msg/tlh.js +1 -1
- package/msg/tr.js +1 -1
- package/msg/ug-arab.js +1 -1
- package/msg/uk.js +1 -1
- package/msg/ur.js +1 -1
- package/msg/uz.js +1 -1
- package/msg/vi.js +1 -1
- package/msg/xmf.js +1 -1
- package/msg/yo.js +1 -1
- package/msg/yue.js +1 -1
- package/msg/zgh.js +1 -1
- package/msg/zh-hans.js +1 -1
- package/msg/zh-hant.js +1 -1
- package/node.js +1 -1
- package/package.json +13 -8
- package/php.js +1 -1
- package/php_compressed.js +2 -3
- package/php_compressed.js.map +1 -1
- package/python.js +1 -1
- package/python_compressed.js +2 -2
- package/python_compressed.js.map +1 -1
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { IParameterModel } from '../interfaces/i_parameter_model.js';
|
|
7
|
+
import { IProcedureModel } from '../interfaces/i_procedure_model.js';
|
|
8
|
+
import type { ISerializer } from '../interfaces/i_serializer.js';
|
|
9
|
+
import { ObservableProcedureModel } from '../procedures/observable_procedure_model.js';
|
|
10
|
+
import { ObservableParameterModel } from '../procedures/observable_parameter_model.js';
|
|
11
|
+
import type { Workspace } from '../workspace.js';
|
|
12
|
+
/**
|
|
13
|
+
* Representation of a procedure data model.
|
|
14
|
+
*/
|
|
15
|
+
export interface State {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
returnTypes: string[] | null;
|
|
19
|
+
parameters?: ParameterState[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Representation of a parameter data model.
|
|
23
|
+
*/
|
|
24
|
+
export interface ParameterState {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
types?: string[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A newable signature for an IProcedureModel.
|
|
31
|
+
*
|
|
32
|
+
* Refer to
|
|
33
|
+
* https://www.typescriptlang.org/docs/handbook/2/generics.html#using-class-types-in-generics
|
|
34
|
+
* for what is going on with this.
|
|
35
|
+
*/
|
|
36
|
+
declare type ProcedureModelConstructor<ProcedureModel extends IProcedureModel> = new (workspace: Workspace, name: string, id: string) => ProcedureModel;
|
|
37
|
+
/**
|
|
38
|
+
* A newable signature for an IParameterModel.
|
|
39
|
+
*
|
|
40
|
+
* Refer to
|
|
41
|
+
* https://www.typescriptlang.org/docs/handbook/2/generics.html#using-class-types-in-generics
|
|
42
|
+
* for what is going on with this.
|
|
43
|
+
*/
|
|
44
|
+
declare type ParameterModelConstructor<ParameterModel extends IParameterModel> = new (workspace: Workspace, name: string, id: string) => ParameterModel;
|
|
45
|
+
/** Serializer for saving and loading procedure state. */
|
|
46
|
+
export declare class ProcedureSerializer<ProcedureModel extends IProcedureModel, ParameterModel extends IParameterModel> implements ISerializer {
|
|
47
|
+
private readonly procedureModelClass;
|
|
48
|
+
private readonly parameterModelClass;
|
|
49
|
+
priority: number;
|
|
50
|
+
/**
|
|
51
|
+
* Constructs the procedure serializer.
|
|
52
|
+
*
|
|
53
|
+
* Example usage:
|
|
54
|
+
* new ProcedureSerializer(MyProcedureModelClass, MyParameterModelClass)
|
|
55
|
+
*
|
|
56
|
+
* @param procedureModelClass The class (implementing IProcedureModel) that
|
|
57
|
+
* you want this serializer to deserialize.
|
|
58
|
+
* @param parameterModelClass The class (implementing IParameterModel) that
|
|
59
|
+
* you want this serializer to deserialize.
|
|
60
|
+
*/
|
|
61
|
+
constructor(procedureModelClass: ProcedureModelConstructor<ProcedureModel>, parameterModelClass: ParameterModelConstructor<ParameterModel>);
|
|
62
|
+
/** Serializes the procedure models of the given workspace. */
|
|
63
|
+
save(workspace: Workspace): State[] | null;
|
|
64
|
+
/**
|
|
65
|
+
* Deserializes the procedures models defined by the given state into the
|
|
66
|
+
* workspace.
|
|
67
|
+
*/
|
|
68
|
+
load(state: State[], workspace: Workspace): void;
|
|
69
|
+
/** Disposes of any procedure models that exist on the workspace. */
|
|
70
|
+
clear(workspace: Workspace): void;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* A ProcedureSerializer that deserializes to create the built-in
|
|
74
|
+
* ObservableProcedureModels and ObservableParameterModels.
|
|
75
|
+
*/
|
|
76
|
+
export declare const observableProcedureSerializer: ProcedureSerializer<ObservableProcedureModel, ObservableParameterModel>;
|
|
77
|
+
export {};
|
|
78
|
+
//# sourceMappingURL=procedures.d.ts.map
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* Copyright 2021 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
import type { ISerializer } from '../interfaces/i_serializer.js';
|
|
7
|
+
import type { Workspace } from '../workspace.js';
|
|
6
8
|
/**
|
|
7
9
|
* Represents the state of a given variable.
|
|
8
10
|
*
|
|
@@ -13,4 +15,35 @@ export interface State {
|
|
|
13
15
|
id: string;
|
|
14
16
|
type: string | undefined;
|
|
15
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Serializer for saving and loading variable state.
|
|
20
|
+
*
|
|
21
|
+
* @alias Blockly.serialization.variables.VariableSerializer
|
|
22
|
+
*/
|
|
23
|
+
export declare class VariableSerializer implements ISerializer {
|
|
24
|
+
priority: number;
|
|
25
|
+
constructor();
|
|
26
|
+
/**
|
|
27
|
+
* Serializes the variables of the given workspace.
|
|
28
|
+
*
|
|
29
|
+
* @param workspace The workspace to save the variables of.
|
|
30
|
+
* @returns The state of the workspace's variables, or null if there are no
|
|
31
|
+
* variables.
|
|
32
|
+
*/
|
|
33
|
+
save(workspace: Workspace): State[] | null;
|
|
34
|
+
/**
|
|
35
|
+
* Deserializes the variable defined by the given state into the given
|
|
36
|
+
* workspace.
|
|
37
|
+
*
|
|
38
|
+
* @param state The state of the variables to deserialize.
|
|
39
|
+
* @param workspace The workspace to deserialize into.
|
|
40
|
+
*/
|
|
41
|
+
load(state: State[], workspace: Workspace): void;
|
|
42
|
+
/**
|
|
43
|
+
* Disposes of any variables that exist on the workspace.
|
|
44
|
+
*
|
|
45
|
+
* @param workspace The workspace to clear the variables of.
|
|
46
|
+
*/
|
|
47
|
+
clear(workspace: Workspace): void;
|
|
48
|
+
}
|
|
16
49
|
//# sourceMappingURL=variables.d.ts.map
|
package/core/serialization.d.ts
CHANGED
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
import * as blocks from './serialization/blocks.js';
|
|
7
7
|
import * as exceptions from './serialization/exceptions.js';
|
|
8
8
|
import * as priorities from './serialization/priorities.js';
|
|
9
|
+
import * as procedures from './serialization/procedures.js';
|
|
9
10
|
import * as registry from './serialization/registry.js';
|
|
10
11
|
import * as variables from './serialization/variables.js';
|
|
11
12
|
import * as workspaces from './serialization/workspaces.js';
|
|
12
13
|
import { ISerializer } from './interfaces/i_serializer.js';
|
|
13
|
-
export { blocks, exceptions, priorities, registry, variables, workspaces, ISerializer, };
|
|
14
|
+
export { blocks, exceptions, priorities, procedures, registry, variables, workspaces, ISerializer, };
|
|
14
15
|
//# sourceMappingURL=serialization.d.ts.map
|
package/core/theme.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export interface ITheme {
|
|
7
7
|
blockStyles?: {
|
|
8
|
-
[key: string]: BlockStyle
|
|
8
|
+
[key: string]: Partial<BlockStyle>;
|
|
9
9
|
};
|
|
10
10
|
categoryStyles?: {
|
|
11
11
|
[key: string]: CategoryStyle;
|
|
@@ -51,7 +51,7 @@ export declare class Theme implements ITheme {
|
|
|
51
51
|
* @param opt_componentStyles A map of Blockly component names to style value.
|
|
52
52
|
*/
|
|
53
53
|
constructor(name: string, opt_blockStyles?: {
|
|
54
|
-
[key: string]: BlockStyle
|
|
54
|
+
[key: string]: Partial<BlockStyle>;
|
|
55
55
|
}, opt_categoryStyles?: {
|
|
56
56
|
[key: string]: CategoryStyle;
|
|
57
57
|
}, opt_componentStyles?: ComponentStyle);
|
|
@@ -115,9 +115,9 @@ export declare class Theme implements ITheme {
|
|
|
115
115
|
export declare namespace Theme {
|
|
116
116
|
interface BlockStyle {
|
|
117
117
|
colourPrimary: string;
|
|
118
|
-
colourSecondary
|
|
119
|
-
colourTertiary
|
|
120
|
-
hat
|
|
118
|
+
colourSecondary: string;
|
|
119
|
+
colourTertiary: string;
|
|
120
|
+
hat: string;
|
|
121
121
|
}
|
|
122
122
|
interface CategoryStyle {
|
|
123
123
|
colour: string;
|
package/core/warning.d.ts
CHANGED
|
@@ -12,9 +12,9 @@ import { Icon } from './icon.js';
|
|
|
12
12
|
* @alias Blockly.Warning
|
|
13
13
|
*/
|
|
14
14
|
export declare class Warning extends Icon {
|
|
15
|
-
private
|
|
15
|
+
private text;
|
|
16
16
|
/** The top-level node of the warning text, or null if not created. */
|
|
17
|
-
private
|
|
17
|
+
private paragraphElement;
|
|
18
18
|
/** Does this icon get hidden when the block is collapsed? */
|
|
19
19
|
collapseHidden: boolean;
|
|
20
20
|
/** @param block The block associated with this warning. */
|
|
@@ -32,9 +32,9 @@ export declare class Warning extends Icon {
|
|
|
32
32
|
*/
|
|
33
33
|
setVisible(visible: boolean): void;
|
|
34
34
|
/** Show the bubble. */
|
|
35
|
-
private
|
|
35
|
+
private createBubble;
|
|
36
36
|
/** Dispose of the bubble and references to it. */
|
|
37
|
-
private
|
|
37
|
+
private disposeBubble;
|
|
38
38
|
/**
|
|
39
39
|
* Set this warning's text.
|
|
40
40
|
*
|
package/core/workspace.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ import type * as toolbox from './utils/toolbox.js';
|
|
|
14
14
|
import { VariableMap } from './variable_map.js';
|
|
15
15
|
import type { VariableModel } from './variable_model.js';
|
|
16
16
|
import type { WorkspaceComment } from './workspace_comment.js';
|
|
17
|
+
import { IProcedureMap } from './interfaces/i_procedure_map.js';
|
|
17
18
|
/**
|
|
18
19
|
* Class for a workspace. This is a data structure that contains blocks.
|
|
19
20
|
* There is no UI, and can be created headlessly.
|
|
@@ -68,15 +69,16 @@ export declare class Workspace implements IASTNodeLocation {
|
|
|
68
69
|
/** Set of databases for rapid lookup of connection locations. */
|
|
69
70
|
connectionDBList: ConnectionDB[];
|
|
70
71
|
connectionChecker: IConnectionChecker;
|
|
71
|
-
private readonly
|
|
72
|
-
private readonly
|
|
72
|
+
private readonly topBlocks;
|
|
73
|
+
private readonly topComments;
|
|
73
74
|
private readonly commentDB;
|
|
74
|
-
private readonly
|
|
75
|
+
private readonly listeners;
|
|
75
76
|
protected undoStack_: Abstract[];
|
|
76
77
|
protected redoStack_: Abstract[];
|
|
77
78
|
private readonly blockDB;
|
|
78
79
|
private readonly typedBlocksDB;
|
|
79
|
-
private
|
|
80
|
+
private variableMap;
|
|
81
|
+
private procedureMap;
|
|
80
82
|
/**
|
|
81
83
|
* Blocks in the flyout can refer to variables that don't exist in the main
|
|
82
84
|
* workspace. For instance, the "get item in list" block refers to an
|
|
@@ -85,7 +87,7 @@ export declare class Workspace implements IASTNodeLocation {
|
|
|
85
87
|
* these by tracking "potential" variables in the flyout. These variables
|
|
86
88
|
* become real when references to them are dragged into the main workspace.
|
|
87
89
|
*/
|
|
88
|
-
private
|
|
90
|
+
private potentialVariableMap;
|
|
89
91
|
/** @param opt_options Dictionary of options. */
|
|
90
92
|
constructor(opt_options?: Options);
|
|
91
93
|
/**
|
|
@@ -419,6 +421,8 @@ export declare class Workspace implements IASTNodeLocation {
|
|
|
419
421
|
* @internal
|
|
420
422
|
*/
|
|
421
423
|
setVariableMap(variableMap: VariableMap): void;
|
|
424
|
+
/** Returns the map of all procedures on the workpace. */
|
|
425
|
+
getProcedureMap(): IProcedureMap;
|
|
422
426
|
/**
|
|
423
427
|
* Find the workspace with the specified ID.
|
|
424
428
|
*
|
package/core/workspace_svg.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
|
|
|
54
54
|
* A wrapper function called when a resize event occurs.
|
|
55
55
|
* You can pass the result to `eventHandling.unbind`.
|
|
56
56
|
*/
|
|
57
|
-
private
|
|
57
|
+
private resizeHandlerWrapper;
|
|
58
58
|
/**
|
|
59
59
|
* The render status of an SVG workspace.
|
|
60
60
|
* Returns `false` for headless workspaces and true for instances of
|
|
@@ -70,7 +70,7 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
|
|
|
70
70
|
* Whether this workspace has resizes enabled.
|
|
71
71
|
* Disable during batch operations for a performance improvement.
|
|
72
72
|
*/
|
|
73
|
-
private
|
|
73
|
+
private resizesEnabled;
|
|
74
74
|
/**
|
|
75
75
|
* Current horizontal scrolling offset in pixel units, relative to the
|
|
76
76
|
* workspace origin.
|
|
@@ -138,15 +138,15 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
|
|
|
138
138
|
/** Vertical scroll value when scrolling started in pixel units. */
|
|
139
139
|
startScrollY: number;
|
|
140
140
|
/** Distance from mouse to object being dragged. */
|
|
141
|
-
private
|
|
141
|
+
private dragDeltaXY;
|
|
142
142
|
/** Current scale. */
|
|
143
143
|
scale: number;
|
|
144
144
|
/** Cached scale value. Used to detect changes in viewport. */
|
|
145
|
-
private
|
|
145
|
+
private oldScale;
|
|
146
146
|
/** Cached viewport top value. Used to detect changes in viewport. */
|
|
147
|
-
private
|
|
147
|
+
private oldTop;
|
|
148
148
|
/** Cached viewport left value. Used to detect changes in viewport. */
|
|
149
|
-
private
|
|
149
|
+
private oldLeft;
|
|
150
150
|
/** The workspace's trashcan (if any). */
|
|
151
151
|
trashcan: Trashcan | null;
|
|
152
152
|
/** This workspace's scrollbars, if they exist. */
|
|
@@ -154,7 +154,7 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
|
|
|
154
154
|
/**
|
|
155
155
|
* Fixed flyout providing blocks which may be dragged into this workspace.
|
|
156
156
|
*/
|
|
157
|
-
private
|
|
157
|
+
private flyout;
|
|
158
158
|
/**
|
|
159
159
|
* Category-based toolbox providing blocks which may be dragged into this
|
|
160
160
|
* workspace.
|
|
@@ -167,32 +167,32 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
|
|
|
167
167
|
*/
|
|
168
168
|
currentGesture_: TouchGesture | null;
|
|
169
169
|
/** This workspace's surface for dragging blocks, if it exists. */
|
|
170
|
-
private readonly
|
|
170
|
+
private readonly blockDragSurface;
|
|
171
171
|
/** This workspace's drag surface, if it exists. */
|
|
172
|
-
private readonly
|
|
172
|
+
private readonly workspaceDragSurface;
|
|
173
173
|
/**
|
|
174
174
|
* Whether to move workspace to the drag surface when it is dragged.
|
|
175
175
|
* True if it should move, false if it should be translated directly.
|
|
176
176
|
*/
|
|
177
|
-
private readonly
|
|
177
|
+
private readonly useWorkspaceDragSurface;
|
|
178
178
|
/**
|
|
179
179
|
* Whether the drag surface is actively in use. When true, calls to
|
|
180
180
|
* translate will translate the drag surface instead of the translating the
|
|
181
181
|
* workspace directly.
|
|
182
182
|
* This is set to true in setupDragSurface and to false in resetDragSurface.
|
|
183
183
|
*/
|
|
184
|
-
private
|
|
184
|
+
private isDragSurfaceActive;
|
|
185
185
|
/**
|
|
186
186
|
* The first parent div with 'injectionDiv' in the name, or null if not set.
|
|
187
187
|
* Access this with getInjectionDiv.
|
|
188
188
|
*/
|
|
189
|
-
private
|
|
189
|
+
private injectionDiv;
|
|
190
190
|
/**
|
|
191
191
|
* Last known position of the page scroll.
|
|
192
192
|
* This is used to determine whether we have recalculated screen coordinate
|
|
193
193
|
* stuff since the page scrolled.
|
|
194
194
|
*/
|
|
195
|
-
private
|
|
195
|
+
private lastRecordedPageScroll;
|
|
196
196
|
/**
|
|
197
197
|
* Developers may define this function to add custom menu options to the
|
|
198
198
|
* workspace's context menu or edit the workspace-created set of menu
|
|
@@ -210,10 +210,10 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
|
|
|
210
210
|
*/
|
|
211
211
|
targetWorkspace: WorkspaceSvg | null;
|
|
212
212
|
/** Inverted screen CTM, for use in mouseToSvg. */
|
|
213
|
-
private
|
|
213
|
+
private inverseScreenCTM;
|
|
214
214
|
/** Inverted screen CTM is dirty, recalculate it. */
|
|
215
|
-
private
|
|
216
|
-
private
|
|
215
|
+
private inverseScreenCTMDirty;
|
|
216
|
+
private metricsManager;
|
|
217
217
|
/** @internal */
|
|
218
218
|
getMetrics: () => Metrics;
|
|
219
219
|
/** @internal */
|
|
@@ -221,15 +221,15 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
|
|
|
221
221
|
x?: number;
|
|
222
222
|
y?: number;
|
|
223
223
|
}) => void;
|
|
224
|
-
private readonly
|
|
224
|
+
private readonly componentManager;
|
|
225
225
|
/**
|
|
226
226
|
* List of currently highlighted blocks. Block highlighting is often used
|
|
227
227
|
* to visually mark blocks currently being executed.
|
|
228
228
|
*/
|
|
229
|
-
private readonly
|
|
230
|
-
private
|
|
231
|
-
private
|
|
232
|
-
private
|
|
229
|
+
private readonly highlightedBlocks;
|
|
230
|
+
private audioManager;
|
|
231
|
+
private grid;
|
|
232
|
+
private markerManager;
|
|
233
233
|
/**
|
|
234
234
|
* Map from function names to callbacks, for deciding what to do when a
|
|
235
235
|
* custom toolbox category is opened.
|
|
@@ -241,16 +241,16 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
|
|
|
241
241
|
*/
|
|
242
242
|
private flyoutButtonCallbacks;
|
|
243
243
|
protected themeManager_: ThemeManager;
|
|
244
|
-
private readonly
|
|
244
|
+
private readonly renderer;
|
|
245
245
|
/** Cached parent SVG. */
|
|
246
|
-
private
|
|
246
|
+
private cachedParentSvg;
|
|
247
247
|
/** True if keyboard accessibility mode is on, false otherwise. */
|
|
248
248
|
keyboardAccessibilityMode: boolean;
|
|
249
249
|
/** The list of top-level bounded elements on the workspace. */
|
|
250
|
-
private
|
|
250
|
+
private topBoundedElements;
|
|
251
251
|
/** The recorded drag targets. */
|
|
252
|
-
private
|
|
253
|
-
private readonly
|
|
252
|
+
private dragTargetAreas;
|
|
253
|
+
private readonly cachedParentSvgSize;
|
|
254
254
|
svgGroup_: SVGElement;
|
|
255
255
|
svgBackground_: SVGElement;
|
|
256
256
|
svgBlockCanvas_: SVGElement;
|
package/core/zoom_controls.d.ts
CHANGED
|
@@ -24,17 +24,17 @@ export declare class ZoomControls implements IPositionable {
|
|
|
24
24
|
* A handle to use to unbind the mouse down event handler for zoom reset
|
|
25
25
|
* button. Opaque data returned from browserEvents.conditionalBind.
|
|
26
26
|
*/
|
|
27
|
-
private
|
|
27
|
+
private onZoomResetWrapper;
|
|
28
28
|
/**
|
|
29
29
|
* A handle to use to unbind the mouse down event handler for zoom in
|
|
30
30
|
* button. Opaque data returned from browserEvents.conditionalBind.
|
|
31
31
|
*/
|
|
32
|
-
private
|
|
32
|
+
private onZoomInWrapper;
|
|
33
33
|
/**
|
|
34
34
|
* A handle to use to unbind the mouse down event handler for zoom out
|
|
35
35
|
* button. Opaque data returned from browserEvents.conditionalBind.
|
|
36
36
|
*/
|
|
37
|
-
private
|
|
37
|
+
private onZoomOutWrapper;
|
|
38
38
|
/** The zoom in svg <g> element. */
|
|
39
39
|
private zoomInGroup;
|
|
40
40
|
/** The zoom out svg <g> element. */
|
|
@@ -42,27 +42,27 @@ export declare class ZoomControls implements IPositionable {
|
|
|
42
42
|
/** The zoom reset svg <g> element. */
|
|
43
43
|
private zoomResetGroup;
|
|
44
44
|
/** Width of the zoom controls. */
|
|
45
|
-
private readonly
|
|
45
|
+
private readonly WIDTH;
|
|
46
46
|
/** Height of each zoom control. */
|
|
47
|
-
private readonly
|
|
47
|
+
private readonly HEIGHT;
|
|
48
48
|
/** Small spacing used between the zoom in and out control, in pixels. */
|
|
49
|
-
private readonly
|
|
49
|
+
private readonly SMALL_SPACING;
|
|
50
50
|
/**
|
|
51
51
|
* Large spacing used between the zoom in and reset control, in pixels.
|
|
52
52
|
*/
|
|
53
|
-
private readonly
|
|
53
|
+
private readonly LARGE_SPACING;
|
|
54
54
|
/** Distance between zoom controls and bottom or top edge of workspace. */
|
|
55
|
-
private readonly
|
|
55
|
+
private readonly MARGIN_VERTICAL;
|
|
56
56
|
/** Distance between zoom controls and right or left edge of workspace. */
|
|
57
|
-
private readonly
|
|
57
|
+
private readonly MARGIN_HORIZONTAL;
|
|
58
58
|
/** The SVG group containing the zoom controls. */
|
|
59
59
|
private svgGroup;
|
|
60
60
|
/** Left coordinate of the zoom controls. */
|
|
61
|
-
private
|
|
61
|
+
private left;
|
|
62
62
|
/** Top coordinate of the zoom controls. */
|
|
63
|
-
private
|
|
63
|
+
private top;
|
|
64
64
|
/** Whether this has been initialized. */
|
|
65
|
-
private
|
|
65
|
+
private initialized;
|
|
66
66
|
/** @param workspace The workspace to sit in. */
|
|
67
67
|
constructor(workspace: WorkspaceSvg);
|
|
68
68
|
/**
|
|
@@ -102,7 +102,7 @@ export declare class ZoomControls implements IPositionable {
|
|
|
102
102
|
* These IDs must be unique in case there are multiple Blockly instances
|
|
103
103
|
* on the same page.
|
|
104
104
|
*/
|
|
105
|
-
private
|
|
105
|
+
private createZoomOutSvg;
|
|
106
106
|
/**
|
|
107
107
|
* Create the zoom out icon and its event handler.
|
|
108
108
|
*
|
|
@@ -110,7 +110,7 @@ export declare class ZoomControls implements IPositionable {
|
|
|
110
110
|
* These IDs must be unique in case there are multiple Blockly instances
|
|
111
111
|
* on the same page.
|
|
112
112
|
*/
|
|
113
|
-
private
|
|
113
|
+
private createZoomInSvg;
|
|
114
114
|
/**
|
|
115
115
|
* Handles a mouse down event on the zoom in or zoom out buttons on the
|
|
116
116
|
* workspace.
|
|
@@ -119,7 +119,7 @@ export declare class ZoomControls implements IPositionable {
|
|
|
119
119
|
* positive amount values zoom in.
|
|
120
120
|
* @param e A mouse down event.
|
|
121
121
|
*/
|
|
122
|
-
private
|
|
122
|
+
private zoom;
|
|
123
123
|
/**
|
|
124
124
|
* Create the zoom reset icon and its event handler.
|
|
125
125
|
*
|
|
@@ -127,14 +127,14 @@ export declare class ZoomControls implements IPositionable {
|
|
|
127
127
|
* These IDs must be unique in case there are multiple Blockly instances
|
|
128
128
|
* on the same page.
|
|
129
129
|
*/
|
|
130
|
-
private
|
|
130
|
+
private createZoomResetSvg;
|
|
131
131
|
/**
|
|
132
132
|
* Handles a mouse down event on the reset zoom button on the workspace.
|
|
133
133
|
*
|
|
134
134
|
* @param e A mouse down event.
|
|
135
135
|
*/
|
|
136
|
-
private
|
|
136
|
+
private resetZoom;
|
|
137
137
|
/** Fires a zoom control UI event. */
|
|
138
|
-
private
|
|
138
|
+
private fireZoomEvent;
|
|
139
139
|
}
|
|
140
140
|
//# sourceMappingURL=zoom_controls.d.ts.map
|
package/core-browser.js
CHANGED
package/core.js
CHANGED
package/dart.js
CHANGED
package/dart_compressed.js
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
}
|
|
14
14
|
}(this, function(__parent__) {
|
|
15
15
|
var $=__parent__.__namespace__;
|
|
16
|
-
var module$exports$Blockly$Dart={},module$contents$Blockly$Dart_Variables=$.module$build$src$core$variables,module$contents$Blockly$Dart_stringUtils=$.module$build$src$core$utils$string,module$contents$Blockly$
|
|
17
|
-
module$exports$Blockly$Dart.dartGenerator=new $.
|
|
16
|
+
var module$exports$Blockly$Dart={},module$contents$Blockly$Dart_Variables=$.module$build$src$core$variables,module$contents$Blockly$Dart_stringUtils=$.module$build$src$core$utils$string,module$contents$Blockly$Dart_CodeGenerator=$.CodeGenerator$$module$build$src$core$generator,module$contents$Blockly$Dart_Names=$.module$build$src$core$names.Names,module$contents$Blockly$Dart_NameType=$.NameType$$module$build$src$core$names,module$contents$Blockly$Dart_inputTypes=$.module$build$src$core$input_types.inputTypes;
|
|
17
|
+
module$exports$Blockly$Dart.dartGenerator=new $.CodeGenerator$$module$build$src$core$generator("Dart");module$exports$Blockly$Dart.dartGenerator.addReservedWords("assert,break,case,catch,class,const,continue,default,do,else,enum,extends,false,final,finally,for,if,in,is,new,null,rethrow,return,super,switch,this,throw,true,try,var,void,while,with,print,identityHashCode,identical,BidirectionalIterator,Comparable,double,Function,int,Invocation,Iterable,Iterator,List,Map,Match,num,Pattern,RegExp,Set,StackTrace,String,StringSink,Type,bool,DateTime,Deprecated,Duration,Expando,Null,Object,RuneIterator,Runes,Stopwatch,StringBuffer,Symbol,Uri,Comparator,AbstractClassInstantiationError,ArgumentError,AssertionError,CastError,ConcurrentModificationError,CyclicInitializationError,Error,Exception,FallThroughError,FormatException,IntegerDivisionByZeroException,NoSuchMethodError,NullThrownError,OutOfMemoryError,RangeError,StackOverflowError,StateError,TypeError,UnimplementedError,UnsupportedError");
|
|
18
18
|
module$exports$Blockly$Dart.dartGenerator.ORDER_ATOMIC=0;module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_POSTFIX=1;module$exports$Blockly$Dart.dartGenerator.ORDER_UNARY_PREFIX=2;module$exports$Blockly$Dart.dartGenerator.ORDER_MULTIPLICATIVE=3;module$exports$Blockly$Dart.dartGenerator.ORDER_ADDITIVE=4;module$exports$Blockly$Dart.dartGenerator.ORDER_SHIFT=5;module$exports$Blockly$Dart.dartGenerator.ORDER_BITWISE_AND=6;module$exports$Blockly$Dart.dartGenerator.ORDER_BITWISE_XOR=7;
|
|
19
19
|
module$exports$Blockly$Dart.dartGenerator.ORDER_BITWISE_OR=8;module$exports$Blockly$Dart.dartGenerator.ORDER_RELATIONAL=9;module$exports$Blockly$Dart.dartGenerator.ORDER_EQUALITY=10;module$exports$Blockly$Dart.dartGenerator.ORDER_LOGICAL_AND=11;module$exports$Blockly$Dart.dartGenerator.ORDER_LOGICAL_OR=12;module$exports$Blockly$Dart.dartGenerator.ORDER_IF_NULL=13;module$exports$Blockly$Dart.dartGenerator.ORDER_CONDITIONAL=14;module$exports$Blockly$Dart.dartGenerator.ORDER_CASCADE=15;
|
|
20
20
|
module$exports$Blockly$Dart.dartGenerator.ORDER_ASSIGNMENT=16;module$exports$Blockly$Dart.dartGenerator.ORDER_NONE=99;module$exports$Blockly$Dart.dartGenerator.isInitialized=!1;
|