blockly 10.0.0-beta.0 → 10.0.1
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 +462 -479
- package/blockly_compressed.js +275 -294
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js +73 -80
- package/blocks_compressed.js.map +1 -1
- package/core/blockly.d.ts +21 -16
- package/core/bubbles/bubble.d.ts +5 -0
- package/core/bubbles/mini_workspace_bubble.d.ts +4 -0
- package/core/bubbles/text_bubble.d.ts +3 -0
- package/core/bubbles/textinput_bubble.d.ts +4 -0
- package/core/bubbles.d.ts +11 -0
- package/core/events/events.d.ts +4 -0
- package/core/events/events_block_field_intermediate_change.d.ts +58 -0
- package/core/events/utils.d.ts +5 -0
- package/core/field.d.ts +4 -1
- package/core/field_input.d.ts +10 -1
- package/core/icons/comment_icon.d.ts +3 -0
- package/core/icons/exceptions.d.ts +3 -0
- package/core/icons/icon.d.ts +12 -0
- package/core/icons/icon_types.d.ts +3 -0
- package/core/icons/mutator_icon.d.ts +10 -1
- package/core/icons/warning_icon.d.ts +6 -0
- package/core/icons.d.ts +6 -4
- package/core/inputs/align.d.ts +14 -0
- package/core/inputs/input.d.ts +6 -3
- package/core/inputs.d.ts +13 -0
- package/core/main.d.ts +3 -0
- package/core/renderers/minimalist/constants.d.ts +7 -0
- package/core/renderers/minimalist/drawer.d.ts +6 -0
- package/core/renderers/minimalist/info.d.ts +5 -0
- package/core/renderers/minimalist/renderer.d.ts +5 -0
- package/dart_compressed.js +97 -90
- package/dart_compressed.js.map +1 -1
- package/javascript_compressed.js +108 -100
- package/javascript_compressed.js.map +1 -1
- package/lua_compressed.js +81 -78
- package/lua_compressed.js.map +1 -1
- package/msg/ab.js +6 -5
- package/msg/ace.js +6 -5
- package/msg/af.js +6 -5
- package/msg/am.js +6 -5
- package/msg/ar.js +6 -5
- package/msg/ast.js +6 -5
- package/msg/az.js +6 -5
- package/msg/ba.js +6 -5
- package/msg/bcc.js +6 -5
- package/msg/be-tarask.js +6 -5
- package/msg/be.js +7 -6
- package/msg/bg.js +13 -12
- package/msg/bn.js +6 -5
- package/msg/br.js +13 -12
- package/msg/bs.js +6 -5
- package/msg/ca.js +6 -5
- package/msg/cdo.js +6 -5
- package/msg/cs.js +6 -5
- package/msg/da.js +6 -5
- package/msg/de.js +6 -5
- package/msg/diq.js +6 -5
- package/msg/dty.js +6 -5
- package/msg/ee.js +6 -5
- package/msg/el.js +6 -5
- package/msg/en-gb.js +6 -5
- package/msg/en.js +6 -5
- package/msg/eo.js +6 -5
- package/msg/es.js +6 -5
- package/msg/et.js +6 -5
- package/msg/eu.js +6 -5
- package/msg/fa.js +6 -5
- package/msg/fi.js +6 -5
- package/msg/fo.js +6 -5
- package/msg/fr.js +7 -6
- package/msg/frr.js +6 -5
- package/msg/gl.js +6 -5
- package/msg/gn.js +6 -5
- package/msg/gor.js +6 -5
- package/msg/ha.js +6 -5
- package/msg/hak.js +6 -5
- package/msg/he.js +6 -5
- package/msg/hi.js +7 -6
- package/msg/hr.js +6 -5
- package/msg/hrx.js +6 -5
- package/msg/hu.js +6 -5
- package/msg/hy.js +6 -5
- package/msg/ia.js +6 -5
- package/msg/id.js +6 -5
- package/msg/ig.js +6 -5
- package/msg/inh.js +7 -6
- package/msg/is.js +6 -5
- package/msg/it.js +6 -5
- package/msg/ja.js +7 -6
- package/msg/ka.js +6 -5
- package/msg/kab.js +6 -5
- package/msg/kbd-cyrl.js +6 -5
- package/msg/km.js +6 -5
- package/msg/kn.js +15 -14
- package/msg/ko.js +6 -5
- package/msg/ksh.js +6 -5
- package/msg/ku-latn.js +6 -5
- package/msg/ky.js +9 -8
- package/msg/la.js +6 -5
- package/msg/lb.js +7 -6
- package/msg/lki.js +6 -5
- package/msg/lo.js +6 -5
- package/msg/lrc.js +6 -5
- package/msg/lt.js +28 -27
- package/msg/lv.js +6 -5
- package/msg/mg.js +6 -5
- package/msg/mk.js +6 -5
- package/msg/ml.js +6 -5
- package/msg/mnw.js +6 -5
- package/msg/ms.js +6 -5
- package/msg/my.js +6 -5
- package/msg/mzn.js +6 -5
- package/msg/nb.js +9 -8
- package/msg/ne.js +6 -5
- package/msg/nl.js +6 -5
- package/msg/oc.js +6 -5
- package/msg/olo.js +6 -5
- package/msg/pa.js +6 -5
- package/msg/pl.js +6 -5
- package/msg/pms.js +6 -5
- package/msg/ps.js +6 -5
- package/msg/pt-br.js +6 -5
- package/msg/pt.js +6 -5
- package/msg/ro.js +6 -5
- package/msg/ru.js +6 -5
- package/msg/sc.js +6 -5
- package/msg/sco.js +6 -5
- package/msg/sd.js +6 -5
- package/msg/shn.js +6 -5
- package/msg/si.js +6 -5
- package/msg/sk.js +6 -5
- package/msg/skr-arab.js +17 -16
- package/msg/sl.js +6 -5
- package/msg/smn.js +6 -5
- package/msg/sq.js +6 -5
- package/msg/sr-latn.js +6 -5
- package/msg/sr.js +6 -5
- package/msg/sv.js +6 -5
- package/msg/sw.js +6 -5
- package/msg/ta.js +6 -5
- package/msg/tcy.js +6 -5
- package/msg/tdd.js +6 -5
- package/msg/te.js +6 -5
- package/msg/th.js +6 -5
- package/msg/ti.js +6 -5
- package/msg/tl.js +6 -5
- package/msg/tlh.js +6 -5
- package/msg/tr.js +6 -5
- package/msg/ug-arab.js +6 -5
- package/msg/uk.js +6 -5
- package/msg/ur.js +6 -5
- package/msg/uz.js +6 -5
- package/msg/vi.js +6 -5
- package/msg/xmf.js +16 -15
- package/msg/yo.js +6 -5
- package/msg/yue.js +6 -5
- package/msg/zgh.js +6 -5
- package/msg/zh-hans.js +13 -12
- package/msg/zh-hant.js +6 -5
- package/package.json +1 -2
- package/php_compressed.js +100 -95
- package/php_compressed.js.map +1 -1
- package/python_compressed.js +92 -89
- package/python_compressed.js.map +1 -1
- package/core/bubble_old.d.ts +0 -303
package/core/bubble_old.d.ts
DELETED
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2012 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import type { BlockSvg } from './block_svg.js';
|
|
7
|
-
import type { IBubble } from './interfaces/i_bubble.js';
|
|
8
|
-
import { Coordinate } from './utils/coordinate.js';
|
|
9
|
-
import { Size } from './utils/size.js';
|
|
10
|
-
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
11
|
-
/**
|
|
12
|
-
* Class for UI bubble.
|
|
13
|
-
*/
|
|
14
|
-
export declare class Bubble implements IBubble {
|
|
15
|
-
/** Width of the border around the bubble. */
|
|
16
|
-
static BORDER_WIDTH: number;
|
|
17
|
-
/**
|
|
18
|
-
* Determines the thickness of the base of the arrow in relation to the size
|
|
19
|
-
* of the bubble. Higher numbers result in thinner arrows.
|
|
20
|
-
*/
|
|
21
|
-
static ARROW_THICKNESS: number;
|
|
22
|
-
/** The number of degrees that the arrow bends counter-clockwise. */
|
|
23
|
-
static ARROW_ANGLE: number;
|
|
24
|
-
/**
|
|
25
|
-
* The sharpness of the arrow's bend. Higher numbers result in smoother
|
|
26
|
-
* arrows.
|
|
27
|
-
*/
|
|
28
|
-
static ARROW_BEND: number;
|
|
29
|
-
/** Distance between arrow point and anchor point. */
|
|
30
|
-
static ANCHOR_RADIUS: number;
|
|
31
|
-
/** Mouse up event data. */
|
|
32
|
-
private static onMouseUpWrapper;
|
|
33
|
-
/** Mouse move event data. */
|
|
34
|
-
private static onMouseMoveWrapper;
|
|
35
|
-
workspace_: WorkspaceSvg;
|
|
36
|
-
content_: SVGElement;
|
|
37
|
-
shape_: SVGElement;
|
|
38
|
-
/** Flag to stop incremental rendering during construction. */
|
|
39
|
-
private readonly rendered;
|
|
40
|
-
/** The SVG group containing all parts of the bubble. */
|
|
41
|
-
private bubbleGroup;
|
|
42
|
-
/**
|
|
43
|
-
* The SVG path for the arrow from the bubble to the icon on the block.
|
|
44
|
-
*/
|
|
45
|
-
private bubbleArrow;
|
|
46
|
-
/** The SVG rect for the main body of the bubble. */
|
|
47
|
-
private bubbleBack;
|
|
48
|
-
/** The SVG group for the resize hash marks on some bubbles. */
|
|
49
|
-
private resizeGroup;
|
|
50
|
-
/** Absolute coordinate of anchor point, in workspace coordinates. */
|
|
51
|
-
private anchorXY;
|
|
52
|
-
/**
|
|
53
|
-
* Relative X coordinate of bubble with respect to the anchor's centre,
|
|
54
|
-
* in workspace units.
|
|
55
|
-
* In RTL mode the initial value is negated.
|
|
56
|
-
*/
|
|
57
|
-
private relativeLeft;
|
|
58
|
-
/**
|
|
59
|
-
* Relative Y coordinate of bubble with respect to the anchor's centre, in
|
|
60
|
-
* workspace units.
|
|
61
|
-
*/
|
|
62
|
-
private relativeTop;
|
|
63
|
-
/** Width of bubble, in workspace units. */
|
|
64
|
-
private width;
|
|
65
|
-
/** Height of bubble, in workspace units. */
|
|
66
|
-
private height;
|
|
67
|
-
/** Automatically position and reposition the bubble. */
|
|
68
|
-
private autoLayout;
|
|
69
|
-
/** Method to call on resize of bubble. */
|
|
70
|
-
private resizeCallback;
|
|
71
|
-
/** Method to call on move of bubble. */
|
|
72
|
-
private moveCallback;
|
|
73
|
-
/** Mouse down on bubbleBack event data. */
|
|
74
|
-
private onMouseDownBubbleWrapper;
|
|
75
|
-
/** Mouse down on resizeGroup event data. */
|
|
76
|
-
private onMouseDownResizeWrapper;
|
|
77
|
-
/**
|
|
78
|
-
* Describes whether this bubble has been disposed of (nodes and event
|
|
79
|
-
* listeners removed from the page) or not.
|
|
80
|
-
*
|
|
81
|
-
* @internal
|
|
82
|
-
*/
|
|
83
|
-
disposed: boolean;
|
|
84
|
-
private arrowRadians;
|
|
85
|
-
/**
|
|
86
|
-
* @param workspace The workspace on which to draw the bubble.
|
|
87
|
-
* @param content SVG content for the bubble.
|
|
88
|
-
* @param shape SVG element to avoid eclipsing.
|
|
89
|
-
* @param anchorXY Absolute position of bubble's anchor point.
|
|
90
|
-
* @param bubbleWidth Width of bubble, or null if not resizable.
|
|
91
|
-
* @param bubbleHeight Height of bubble, or null if not resizable.
|
|
92
|
-
*/
|
|
93
|
-
constructor(workspace: WorkspaceSvg, content: SVGElement, shape: SVGElement, anchorXY: Coordinate, bubbleWidth: number | null, bubbleHeight: number | null);
|
|
94
|
-
/**
|
|
95
|
-
* Create the bubble's DOM.
|
|
96
|
-
*
|
|
97
|
-
* @param content SVG content for the bubble.
|
|
98
|
-
* @param hasResize Add diagonal resize gripper if true.
|
|
99
|
-
* @returns The bubble's SVG group.
|
|
100
|
-
*/
|
|
101
|
-
private createDom;
|
|
102
|
-
/**
|
|
103
|
-
* Return the root node of the bubble's SVG group.
|
|
104
|
-
*
|
|
105
|
-
* @returns The root SVG node of the bubble's group.
|
|
106
|
-
*/
|
|
107
|
-
getSvgRoot(): SVGElement;
|
|
108
|
-
/**
|
|
109
|
-
* Expose the block's ID on the bubble's top-level SVG group.
|
|
110
|
-
*
|
|
111
|
-
* @param id ID of block.
|
|
112
|
-
*/
|
|
113
|
-
setSvgId(id: string): void;
|
|
114
|
-
/**
|
|
115
|
-
* Handle a pointerdown on bubble's border.
|
|
116
|
-
*
|
|
117
|
-
* @param e Pointer down event.
|
|
118
|
-
*/
|
|
119
|
-
private bubbleMouseDown;
|
|
120
|
-
/**
|
|
121
|
-
* Show the context menu for this bubble.
|
|
122
|
-
*
|
|
123
|
-
* @param _e Mouse event.
|
|
124
|
-
* @internal
|
|
125
|
-
*/
|
|
126
|
-
showContextMenu(_e: Event): void;
|
|
127
|
-
/**
|
|
128
|
-
* Get whether this bubble is deletable or not.
|
|
129
|
-
*
|
|
130
|
-
* @returns True if deletable.
|
|
131
|
-
* @internal
|
|
132
|
-
*/
|
|
133
|
-
isDeletable(): boolean;
|
|
134
|
-
/**
|
|
135
|
-
* Update the style of this bubble when it is dragged over a delete area.
|
|
136
|
-
*
|
|
137
|
-
* @param _enable True if the bubble is about to be deleted, false otherwise.
|
|
138
|
-
*/
|
|
139
|
-
setDeleteStyle(_enable: boolean): void;
|
|
140
|
-
/**
|
|
141
|
-
* Handle a pointerdown on bubble's resize corner.
|
|
142
|
-
*
|
|
143
|
-
* @param e Pointer down event.
|
|
144
|
-
*/
|
|
145
|
-
private resizeMouseDown;
|
|
146
|
-
/**
|
|
147
|
-
* Resize this bubble to follow the pointer.
|
|
148
|
-
*
|
|
149
|
-
* @param e Pointer move event.
|
|
150
|
-
*/
|
|
151
|
-
private resizeMouseMove;
|
|
152
|
-
/**
|
|
153
|
-
* Register a function as a callback event for when the bubble is resized.
|
|
154
|
-
*
|
|
155
|
-
* @param callback The function to call on resize.
|
|
156
|
-
*/
|
|
157
|
-
registerResizeEvent(callback: () => void): void;
|
|
158
|
-
/**
|
|
159
|
-
* Register a function as a callback event for when the bubble is moved.
|
|
160
|
-
*
|
|
161
|
-
* @param callback The function to call on move.
|
|
162
|
-
*/
|
|
163
|
-
registerMoveEvent(callback: () => void): void;
|
|
164
|
-
/**
|
|
165
|
-
* Move this bubble to the top of the stack.
|
|
166
|
-
*
|
|
167
|
-
* @returns Whether or not the bubble has been moved.
|
|
168
|
-
* @internal
|
|
169
|
-
*/
|
|
170
|
-
promote(): boolean;
|
|
171
|
-
/**
|
|
172
|
-
* Notification that the anchor has moved.
|
|
173
|
-
* Update the arrow and bubble accordingly.
|
|
174
|
-
*
|
|
175
|
-
* @param xy Absolute location.
|
|
176
|
-
*/
|
|
177
|
-
setAnchorLocation(xy: Coordinate): void;
|
|
178
|
-
/** Position the bubble so that it does not fall off-screen. */
|
|
179
|
-
private layoutBubble;
|
|
180
|
-
/**
|
|
181
|
-
* Calculate the what percentage of the bubble overlaps with the visible
|
|
182
|
-
* workspace (what percentage of the bubble is visible).
|
|
183
|
-
*
|
|
184
|
-
* @param relativeMin The position of the top-left corner of the bubble
|
|
185
|
-
* relative to the anchor point.
|
|
186
|
-
* @param viewMetrics The view metrics of the workspace the bubble will appear
|
|
187
|
-
* in.
|
|
188
|
-
* @returns The percentage of the bubble that is visible.
|
|
189
|
-
*/
|
|
190
|
-
private getOverlap;
|
|
191
|
-
/**
|
|
192
|
-
* Calculate what the optimal horizontal position of the top-left corner of
|
|
193
|
-
* the bubble is (relative to the anchor point) so that the most area of the
|
|
194
|
-
* bubble is shown.
|
|
195
|
-
*
|
|
196
|
-
* @param viewMetrics The view metrics of the workspace the bubble will appear
|
|
197
|
-
* in.
|
|
198
|
-
* @returns The optimal horizontal position of the top-left corner of the
|
|
199
|
-
* bubble.
|
|
200
|
-
*/
|
|
201
|
-
private getOptimalRelativeLeft;
|
|
202
|
-
/**
|
|
203
|
-
* Calculate what the optimal vertical position of the top-left corner of
|
|
204
|
-
* the bubble is (relative to the anchor point) so that the most area of the
|
|
205
|
-
* bubble is shown.
|
|
206
|
-
*
|
|
207
|
-
* @param viewMetrics The view metrics of the workspace the bubble will appear
|
|
208
|
-
* in.
|
|
209
|
-
* @returns The optimal vertical position of the top-left corner of the
|
|
210
|
-
* bubble.
|
|
211
|
-
*/
|
|
212
|
-
private getOptimalRelativeTop;
|
|
213
|
-
/** Move the bubble to a location relative to the anchor's centre. */
|
|
214
|
-
private positionBubble;
|
|
215
|
-
/**
|
|
216
|
-
* Move the bubble group to the specified location in workspace coordinates.
|
|
217
|
-
*
|
|
218
|
-
* @param x The x position to move to.
|
|
219
|
-
* @param y The y position to move to.
|
|
220
|
-
* @internal
|
|
221
|
-
*/
|
|
222
|
-
moveTo(x: number, y: number): void;
|
|
223
|
-
/**
|
|
224
|
-
* Triggers a move callback if one exists at the end of a drag.
|
|
225
|
-
*
|
|
226
|
-
* @param adding True if adding, false if removing.
|
|
227
|
-
* @internal
|
|
228
|
-
*/
|
|
229
|
-
setDragging(adding: boolean): void;
|
|
230
|
-
/**
|
|
231
|
-
* Get the dimensions of this bubble.
|
|
232
|
-
*
|
|
233
|
-
* @returns The height and width of the bubble.
|
|
234
|
-
*/
|
|
235
|
-
getBubbleSize(): Size;
|
|
236
|
-
/**
|
|
237
|
-
* Size this bubble.
|
|
238
|
-
*
|
|
239
|
-
* @param width Width of the bubble.
|
|
240
|
-
* @param height Height of the bubble.
|
|
241
|
-
*/
|
|
242
|
-
setBubbleSize(width: number, height: number): void;
|
|
243
|
-
/** Draw the arrow between the bubble and the origin. */
|
|
244
|
-
private renderArrow;
|
|
245
|
-
/**
|
|
246
|
-
* Change the colour of a bubble.
|
|
247
|
-
*
|
|
248
|
-
* @param hexColour Hex code of colour.
|
|
249
|
-
*/
|
|
250
|
-
setColour(hexColour: string): void;
|
|
251
|
-
/** Dispose of this bubble. */
|
|
252
|
-
dispose(): void;
|
|
253
|
-
/**
|
|
254
|
-
* Move this bubble during a drag.
|
|
255
|
-
*
|
|
256
|
-
* @param newLoc The location to translate to, in workspace coordinates.
|
|
257
|
-
* @internal
|
|
258
|
-
*/
|
|
259
|
-
moveDuringDrag(newLoc: Coordinate): void;
|
|
260
|
-
/**
|
|
261
|
-
* Return the coordinates of the top-left corner of this bubble's body
|
|
262
|
-
* relative to the drawing surface's origin (0,0), in workspace units.
|
|
263
|
-
*
|
|
264
|
-
* @returns Object with .x and .y properties.
|
|
265
|
-
*/
|
|
266
|
-
getRelativeToSurfaceXY(): Coordinate;
|
|
267
|
-
/**
|
|
268
|
-
* Set whether auto-layout of this bubble is enabled. The first time a bubble
|
|
269
|
-
* is shown it positions itself to not cover any blocks. Once a user has
|
|
270
|
-
* dragged it to reposition, it renders where the user put it.
|
|
271
|
-
*
|
|
272
|
-
* @param enable True if auto-layout should be enabled, false otherwise.
|
|
273
|
-
* @internal
|
|
274
|
-
*/
|
|
275
|
-
setAutoLayout(enable: boolean): void;
|
|
276
|
-
/** Stop binding to the global mouseup and mousemove events. */
|
|
277
|
-
private static unbindDragEvents;
|
|
278
|
-
/**
|
|
279
|
-
* Handle a pointerup event while dragging a bubble's border or resize handle.
|
|
280
|
-
*
|
|
281
|
-
* @param _e Pointer up event.
|
|
282
|
-
*/
|
|
283
|
-
private static bubbleMouseUp;
|
|
284
|
-
/**
|
|
285
|
-
* Create the text for a non editable bubble.
|
|
286
|
-
*
|
|
287
|
-
* @param text The text to display.
|
|
288
|
-
* @returns The top-level node of the text.
|
|
289
|
-
* @internal
|
|
290
|
-
*/
|
|
291
|
-
static textToDom(text: string): SVGTextElement;
|
|
292
|
-
/**
|
|
293
|
-
* Creates a bubble that can not be edited.
|
|
294
|
-
*
|
|
295
|
-
* @param paragraphElement The text element for the non editable bubble.
|
|
296
|
-
* @param block The block that the bubble is attached to.
|
|
297
|
-
* @param iconXY The coordinate of the icon.
|
|
298
|
-
* @returns The non editable bubble.
|
|
299
|
-
* @internal
|
|
300
|
-
*/
|
|
301
|
-
static createNonEditableBubble(paragraphElement: SVGTextElement, block: BlockSvg, iconXY: Coordinate): Bubble;
|
|
302
|
-
}
|
|
303
|
-
//# sourceMappingURL=bubble_old.d.ts.map
|