blockly 10.0.1 → 10.1.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 +180 -176
- package/blockly_compressed.js +180 -176
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js.map +1 -1
- package/core/block.d.ts +0 -8
- package/core/block_svg.d.ts +1 -14
- package/core/field.d.ts +1 -5
- package/core/field_angle.d.ts +0 -2
- package/core/field_checkbox.d.ts +0 -2
- package/core/field_colour.d.ts +0 -2
- package/core/field_dropdown.d.ts +0 -2
- package/core/field_image.d.ts +2 -4
- package/core/field_input.d.ts +0 -1
- package/core/field_label.d.ts +0 -2
- package/core/field_multilineinput.d.ts +0 -2
- package/core/field_variable.d.ts +0 -2
- package/core/flyout_horizontal.d.ts +1 -1
- package/core/flyout_vertical.d.ts +1 -1
- package/core/generator.d.ts +2 -2
- package/core/render_management.d.ts +8 -0
- package/core/rendered_connection.d.ts +9 -1
- package/core/scrollbar.d.ts +9 -0
- package/core/scrollbar_pair.d.ts +6 -0
- package/core/toolbox/collapsible_category.d.ts +1 -1
- package/core/utils/svg_math.d.ts +9 -0
- package/core/utils/toolbox.d.ts +0 -2
- package/core/workspace_comment_svg.d.ts +0 -2
- package/core/workspace_svg.d.ts +3 -1
- package/core/xml.d.ts +13 -0
- package/dart.d.ts +21 -0
- package/javascript.d.ts +38 -0
- package/lua.d.ts +15 -0
- package/package.json +6 -6
- package/php.d.ts +40 -0
- package/python.d.ts +24 -0
- package/python_compressed.js.map +1 -1
- package/core/block_drag_surface.d.ts +0 -135
- package/core/workspace_drag_surface_svg.d.ts +0 -74
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2016 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { Coordinate } from './utils/coordinate.js';
|
|
7
|
-
/**
|
|
8
|
-
* Class for a drag surface for the currently dragged block. This is a separate
|
|
9
|
-
* SVG that contains only the currently moving block, or nothing.
|
|
10
|
-
*
|
|
11
|
-
* @alias Blockly.BlockDragSurfaceSvg
|
|
12
|
-
*/
|
|
13
|
-
export declare class BlockDragSurfaceSvg {
|
|
14
|
-
private readonly container;
|
|
15
|
-
/**
|
|
16
|
-
* The root element of the drag surface.
|
|
17
|
-
*/
|
|
18
|
-
private svg;
|
|
19
|
-
/**
|
|
20
|
-
* This is where blocks live while they are being dragged if the drag
|
|
21
|
-
* surface is enabled.
|
|
22
|
-
*/
|
|
23
|
-
private dragGroup;
|
|
24
|
-
/**
|
|
25
|
-
* Cached value for the scale of the drag surface.
|
|
26
|
-
* Used to set/get the correct translation during and after a drag.
|
|
27
|
-
*/
|
|
28
|
-
private scale;
|
|
29
|
-
/**
|
|
30
|
-
* Cached value for the translation of the drag surface.
|
|
31
|
-
* This translation is in pixel units, because the scale is applied to the
|
|
32
|
-
* drag group rather than the top-level SVG.
|
|
33
|
-
*/
|
|
34
|
-
private surfaceXY;
|
|
35
|
-
/**
|
|
36
|
-
* Cached value for the translation of the child drag surface in pixel
|
|
37
|
-
* units. Since the child drag surface tracks the translation of the
|
|
38
|
-
* workspace this is ultimately the translation of the workspace.
|
|
39
|
-
*/
|
|
40
|
-
private readonly childSurfaceXY;
|
|
41
|
-
/** @param container Containing element. */
|
|
42
|
-
constructor(container: Element);
|
|
43
|
-
/**
|
|
44
|
-
* Create the drag surface and inject it into the container.
|
|
45
|
-
*
|
|
46
|
-
* @deprecated The DOM is automatically created by the constructor.
|
|
47
|
-
*/
|
|
48
|
-
createDom(): void;
|
|
49
|
-
/**
|
|
50
|
-
* Set the SVG blocks on the drag surface's group and show the surface.
|
|
51
|
-
* Only one block group should be on the drag surface at a time.
|
|
52
|
-
*
|
|
53
|
-
* @param blocks Block or group of blocks to place on the drag surface.
|
|
54
|
-
*/
|
|
55
|
-
setBlocksAndShow(blocks: SVGElement): void;
|
|
56
|
-
/**
|
|
57
|
-
* Translate and scale the entire drag surface group to the given position, to
|
|
58
|
-
* keep in sync with the workspace.
|
|
59
|
-
*
|
|
60
|
-
* @param x X translation in pixel coordinates.
|
|
61
|
-
* @param y Y translation in pixel coordinates.
|
|
62
|
-
* @param scale Scale of the group.
|
|
63
|
-
*/
|
|
64
|
-
translateAndScaleGroup(x: number, y: number, scale: number): void;
|
|
65
|
-
/**
|
|
66
|
-
* Translate the drag surface's SVG based on its internal state.
|
|
67
|
-
*
|
|
68
|
-
* @internal
|
|
69
|
-
*/
|
|
70
|
-
translateSurfaceInternal_(): void;
|
|
71
|
-
/**
|
|
72
|
-
* Translates the entire surface by a relative offset.
|
|
73
|
-
*
|
|
74
|
-
* @param deltaX Horizontal offset in pixel units.
|
|
75
|
-
* @param deltaY Vertical offset in pixel units.
|
|
76
|
-
*/
|
|
77
|
-
translateBy(deltaX: number, deltaY: number): void;
|
|
78
|
-
/**
|
|
79
|
-
* Translate the entire drag surface during a drag.
|
|
80
|
-
* We translate the drag surface instead of the blocks inside the surface
|
|
81
|
-
* so that the browser avoids repainting the SVG.
|
|
82
|
-
* Because of this, the drag coordinates must be adjusted by scale.
|
|
83
|
-
*
|
|
84
|
-
* @param x X translation for the entire surface.
|
|
85
|
-
* @param y Y translation for the entire surface.
|
|
86
|
-
*/
|
|
87
|
-
translateSurface(x: number, y: number): void;
|
|
88
|
-
/**
|
|
89
|
-
* Reports the surface translation in scaled workspace coordinates.
|
|
90
|
-
* Use this when finishing a drag to return blocks to the correct position.
|
|
91
|
-
*
|
|
92
|
-
* @returns Current translation of the surface.
|
|
93
|
-
*/
|
|
94
|
-
getSurfaceTranslation(): Coordinate;
|
|
95
|
-
/**
|
|
96
|
-
* Provide a reference to the drag group (primarily for
|
|
97
|
-
* BlockSvg.getRelativeToSurfaceXY).
|
|
98
|
-
*
|
|
99
|
-
* @returns Drag surface group element.
|
|
100
|
-
*/
|
|
101
|
-
getGroup(): SVGElement;
|
|
102
|
-
/**
|
|
103
|
-
* Returns the SVG drag surface.
|
|
104
|
-
*
|
|
105
|
-
* @returns The SVG drag surface.
|
|
106
|
-
*/
|
|
107
|
-
getSvgRoot(): SVGElement;
|
|
108
|
-
/**
|
|
109
|
-
* Get the current blocks on the drag surface, if any (primarily
|
|
110
|
-
* for BlockSvg.getRelativeToSurfaceXY).
|
|
111
|
-
*
|
|
112
|
-
* @returns Drag surface block DOM element, or null if no blocks exist.
|
|
113
|
-
*/
|
|
114
|
-
getCurrentBlock(): Element | null;
|
|
115
|
-
/**
|
|
116
|
-
* Gets the translation of the child block surface
|
|
117
|
-
* This surface is in charge of keeping track of how much the workspace has
|
|
118
|
-
* moved.
|
|
119
|
-
*
|
|
120
|
-
* @returns The amount the workspace has been moved.
|
|
121
|
-
*/
|
|
122
|
-
getWsTranslation(): Coordinate;
|
|
123
|
-
/**
|
|
124
|
-
* Clear the group and hide the surface; move the blocks off onto the provided
|
|
125
|
-
* element.
|
|
126
|
-
* If the block is being deleted it doesn't need to go back to the original
|
|
127
|
-
* surface, since it would be removed immediately during dispose.
|
|
128
|
-
*
|
|
129
|
-
* @param opt_newSurface Surface the dragging blocks should be moved to, or
|
|
130
|
-
* null if the blocks should be removed from this surface without being
|
|
131
|
-
* moved to a different surface.
|
|
132
|
-
*/
|
|
133
|
-
clearAndHide(opt_newSurface?: Element): void;
|
|
134
|
-
}
|
|
135
|
-
//# sourceMappingURL=block_drag_surface.d.ts.map
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2016 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import type { Coordinate } from './utils/coordinate.js';
|
|
7
|
-
/**
|
|
8
|
-
* Blocks are moved into this SVG during a drag, improving performance.
|
|
9
|
-
* The entire SVG is translated using CSS transforms instead of SVG so the
|
|
10
|
-
* blocks are never repainted during drag improving performance.
|
|
11
|
-
*
|
|
12
|
-
* @alias Blockly.WorkspaceDragSurfaceSvg
|
|
13
|
-
*/
|
|
14
|
-
export declare class WorkspaceDragSurfaceSvg {
|
|
15
|
-
private readonly container;
|
|
16
|
-
/**
|
|
17
|
-
* The SVG drag surface. Set once by WorkspaceDragSurfaceSvg.createDom.
|
|
18
|
-
*/
|
|
19
|
-
private SVG;
|
|
20
|
-
/**
|
|
21
|
-
* The element to insert the block canvas and bubble canvas after when it
|
|
22
|
-
* goes back in the DOM at the end of a drag.
|
|
23
|
-
*/
|
|
24
|
-
private previousSibling;
|
|
25
|
-
/** @param container Containing element. */
|
|
26
|
-
constructor(container: Element);
|
|
27
|
-
/** Create the drag surface and inject it into the container. */
|
|
28
|
-
createDom(): void;
|
|
29
|
-
/**
|
|
30
|
-
* Translate the entire drag surface during a drag.
|
|
31
|
-
* We translate the drag surface instead of the blocks inside the surface
|
|
32
|
-
* so that the browser avoids repainting the SVG.
|
|
33
|
-
* Because of this, the drag coordinates must be adjusted by scale.
|
|
34
|
-
*
|
|
35
|
-
* @param x X translation for the entire surface
|
|
36
|
-
* @param y Y translation for the entire surface
|
|
37
|
-
* @internal
|
|
38
|
-
*/
|
|
39
|
-
translateSurface(x: number, y: number): void;
|
|
40
|
-
/**
|
|
41
|
-
* Reports the surface translation in scaled workspace coordinates.
|
|
42
|
-
* Use this when finishing a drag to return blocks to the correct position.
|
|
43
|
-
*
|
|
44
|
-
* @returns Current translation of the surface
|
|
45
|
-
* @internal
|
|
46
|
-
*/
|
|
47
|
-
getSurfaceTranslation(): Coordinate;
|
|
48
|
-
/**
|
|
49
|
-
* Move the blockCanvas and bubbleCanvas out of the surface SVG and on to
|
|
50
|
-
* newSurface.
|
|
51
|
-
*
|
|
52
|
-
* @param newSurface The element to put the drag surface contents into.
|
|
53
|
-
* @internal
|
|
54
|
-
*/
|
|
55
|
-
clearAndHide(newSurface: SVGElement): void;
|
|
56
|
-
/**
|
|
57
|
-
* Set the SVG to have the block canvas and bubble canvas in it and then
|
|
58
|
-
* show the surface.
|
|
59
|
-
*
|
|
60
|
-
* @param blockCanvas The block canvas <g> element from the
|
|
61
|
-
* workspace.
|
|
62
|
-
* @param bubbleCanvas The <g> element that contains the
|
|
63
|
-
bubbles.
|
|
64
|
-
* @param previousSibling The element to insert the block canvas and
|
|
65
|
-
bubble canvas after when it goes back in the DOM at the end of a
|
|
66
|
-
drag.
|
|
67
|
-
* @param width The width of the workspace SVG element.
|
|
68
|
-
* @param height The height of the workspace SVG element.
|
|
69
|
-
* @param scale The scale of the workspace being dragged.
|
|
70
|
-
* @internal
|
|
71
|
-
*/
|
|
72
|
-
setContentsAndShow(blockCanvas: SVGElement, bubbleCanvas: SVGElement, previousSibling: Element, width: number, height: number, scale: number): void;
|
|
73
|
-
}
|
|
74
|
-
//# sourceMappingURL=workspace_drag_surface_svg.d.ts.map
|