blockly 11.0.0 → 11.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 +235 -227
- package/blockly_compressed.js +235 -227
- package/blockly_compressed.js.map +1 -1
- package/core/block.d.ts +0 -6
- package/core/contextmenu.d.ts +3 -1
- package/core/dragging/block_drag_strategy.d.ts +8 -1
- package/core/dragging/dragger.d.ts +3 -2
- package/core/field_input.d.ts +1 -1
- package/core/flyout_base.d.ts +6 -0
- package/core/flyout_button.d.ts +3 -3
- package/core/flyout_horizontal.d.ts +0 -1
- package/core/flyout_vertical.d.ts +0 -1
- package/core/widgetdiv.d.ts +10 -1
- package/core/workspace_svg.d.ts +0 -1
- package/msg/be-tarask.mjs +2 -2
- package/msg/en-gb.mjs +2 -2
- package/msg/kbd-cyrl.mjs +2 -2
- package/msg/ku-latn.mjs +2 -2
- package/msg/pt-br.mjs +2 -2
- package/msg/skr-arab.mjs +2 -2
- package/msg/sr-latn.mjs +2 -2
- package/msg/ug-arab.mjs +2 -2
- package/msg/zh-hans.mjs +2 -2
- package/msg/zh-hant.mjs +2 -2
- package/package.json +2 -2
package/core/block.d.ts
CHANGED
|
@@ -320,12 +320,6 @@ export declare class Block implements IASTNodeLocation {
|
|
|
320
320
|
* @internal
|
|
321
321
|
*/
|
|
322
322
|
getTopStackBlock(): this;
|
|
323
|
-
/**
|
|
324
|
-
* Returns this block if it is a shadow block, or the first non-shadow parent.
|
|
325
|
-
*
|
|
326
|
-
* @internal
|
|
327
|
-
*/
|
|
328
|
-
getFirstNonShadowBlock(): this;
|
|
329
323
|
/**
|
|
330
324
|
* Find all the blocks that are directly nested inside this one.
|
|
331
325
|
* Includes value and statement inputs, as well as any following statement.
|
package/core/contextmenu.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { Block } from './block.js';
|
|
|
7
7
|
import type { BlockSvg } from './block_svg.js';
|
|
8
8
|
import type { ContextMenuOption, LegacyContextMenuOption } from './contextmenu_registry.js';
|
|
9
9
|
import * as serializationBlocks from './serialization/blocks.js';
|
|
10
|
+
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
10
11
|
/**
|
|
11
12
|
* Gets the block the context menu is currently attached to.
|
|
12
13
|
*
|
|
@@ -25,8 +26,9 @@ export declare function setCurrentBlock(block: Block | null): void;
|
|
|
25
26
|
* @param e Mouse event.
|
|
26
27
|
* @param options Array of menu options.
|
|
27
28
|
* @param rtl True if RTL, false if LTR.
|
|
29
|
+
* @param workspace The workspace associated with the context menu, if any.
|
|
28
30
|
*/
|
|
29
|
-
export declare function show(e: PointerEvent, options: (ContextMenuOption | LegacyContextMenuOption)[], rtl: boolean): void;
|
|
31
|
+
export declare function show(e: PointerEvent, options: (ContextMenuOption | LegacyContextMenuOption)[], rtl: boolean, workspace?: WorkspaceSvg): void;
|
|
30
32
|
/**
|
|
31
33
|
* Hide the context menu.
|
|
32
34
|
*/
|
|
@@ -20,6 +20,11 @@ export declare class BlockDragStrategy implements IDragStrategy {
|
|
|
20
20
|
private connectionCandidate;
|
|
21
21
|
private connectionPreviewer;
|
|
22
22
|
private dragging;
|
|
23
|
+
/**
|
|
24
|
+
* If this is a shadow block, the offset between this block and the parent
|
|
25
|
+
* block, to add to the drag location. In workspace units.
|
|
26
|
+
*/
|
|
27
|
+
private dragOffset;
|
|
23
28
|
constructor(block: BlockSvg);
|
|
24
29
|
/** Returns true if the block is currently movable. False otherwise. */
|
|
25
30
|
isMovable(): boolean;
|
|
@@ -28,6 +33,8 @@ export declare class BlockDragStrategy implements IDragStrategy {
|
|
|
28
33
|
* from any parent blocks.
|
|
29
34
|
*/
|
|
30
35
|
startDrag(e?: PointerEvent): void;
|
|
36
|
+
/** Starts a drag on a shadow, recording the drag offset. */
|
|
37
|
+
private startDraggingShadow;
|
|
31
38
|
/**
|
|
32
39
|
* Whether or not we should disconnect the block when a drag is started.
|
|
33
40
|
*
|
|
@@ -86,7 +93,7 @@ export declare class BlockDragStrategy implements IDragStrategy {
|
|
|
86
93
|
* Cleans up any state at the end of the drag. Applies any pending
|
|
87
94
|
* connections.
|
|
88
95
|
*/
|
|
89
|
-
endDrag(): void;
|
|
96
|
+
endDrag(e?: PointerEvent): void;
|
|
90
97
|
/** Connects the given candidate connections. */
|
|
91
98
|
private applyConnections;
|
|
92
99
|
/**
|
|
@@ -35,14 +35,15 @@ export declare class Dragger implements IDragger {
|
|
|
35
35
|
* Returns true if we would delete the draggable if it was dropped
|
|
36
36
|
* at the current location.
|
|
37
37
|
*/
|
|
38
|
-
protected wouldDeleteDraggable(e: PointerEvent,
|
|
38
|
+
protected wouldDeleteDraggable(e: PointerEvent, rootDraggable: IDraggable & IDeletable): boolean;
|
|
39
39
|
/** Handles any drag cleanup. */
|
|
40
40
|
onDragEnd(e: PointerEvent): void;
|
|
41
|
+
private getRoot;
|
|
41
42
|
/**
|
|
42
43
|
* Returns true if we should return the draggable to its original location
|
|
43
44
|
* at the end of the drag.
|
|
44
45
|
*/
|
|
45
|
-
protected shouldReturnToStart(e: PointerEvent,
|
|
46
|
+
protected shouldReturnToStart(e: PointerEvent, rootDraggable: IDraggable): boolean;
|
|
46
47
|
protected pixelsToWorkspaceUnits(pixelCoord: Coordinate): Coordinate;
|
|
47
48
|
}
|
|
48
49
|
//# sourceMappingURL=dragger.d.ts.map
|
package/core/field_input.d.ts
CHANGED
|
@@ -162,7 +162,7 @@ export declare abstract class FieldInput<T extends InputTypes> extends Field<str
|
|
|
162
162
|
*
|
|
163
163
|
* @returns The newly created text input editor.
|
|
164
164
|
*/
|
|
165
|
-
protected widgetCreate_():
|
|
165
|
+
protected widgetCreate_(): HTMLInputElement | HTMLTextAreaElement;
|
|
166
166
|
/**
|
|
167
167
|
* Closes the editor, saves the results, and disposes of any events or
|
|
168
168
|
* DOM-references belonging to the editor.
|
package/core/flyout_base.d.ts
CHANGED
|
@@ -264,6 +264,12 @@ export declare abstract class Flyout extends DeleteArea implements IAutoHideable
|
|
|
264
264
|
setAutoClose(autoClose: boolean): void;
|
|
265
265
|
/** Automatically hides the flyout if it is an autoclosing flyout. */
|
|
266
266
|
autoHide(onlyClosePopups: boolean): void;
|
|
267
|
+
/**
|
|
268
|
+
* Get the target workspace inside the flyout.
|
|
269
|
+
*
|
|
270
|
+
* @returns The target workspace inside the flyout.
|
|
271
|
+
*/
|
|
272
|
+
getTargetWorkspace(): WorkspaceSvg;
|
|
267
273
|
/**
|
|
268
274
|
* Is the flyout visible?
|
|
269
275
|
*
|
package/core/flyout_button.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ import type { IASTNodeLocationSvg } from './blockly.js';
|
|
|
13
13
|
export declare class FlyoutButton implements IASTNodeLocationSvg {
|
|
14
14
|
private readonly workspace;
|
|
15
15
|
private readonly targetWorkspace;
|
|
16
|
-
private readonly
|
|
16
|
+
private readonly isFlyoutLabel;
|
|
17
17
|
/** The horizontal margin around the text in the button. */
|
|
18
18
|
static TEXT_MARGIN_X: number;
|
|
19
19
|
/** The vertical margin around the text in the button. */
|
|
@@ -44,10 +44,10 @@ export declare class FlyoutButton implements IASTNodeLocationSvg {
|
|
|
44
44
|
* @param workspace The workspace in which to place this button.
|
|
45
45
|
* @param targetWorkspace The flyout's target workspace.
|
|
46
46
|
* @param json The JSON specifying the label/button.
|
|
47
|
-
* @param
|
|
47
|
+
* @param isFlyoutLabel Whether this button should be styled as a label.
|
|
48
48
|
* @internal
|
|
49
49
|
*/
|
|
50
|
-
constructor(workspace: WorkspaceSvg, targetWorkspace: WorkspaceSvg, json: toolbox.ButtonOrLabelInfo,
|
|
50
|
+
constructor(workspace: WorkspaceSvg, targetWorkspace: WorkspaceSvg, json: toolbox.ButtonOrLabelInfo, isFlyoutLabel: boolean);
|
|
51
51
|
/**
|
|
52
52
|
* Create the button elements.
|
|
53
53
|
*
|
|
@@ -68,7 +68,6 @@ export declare class HorizontalFlyout extends Flyout {
|
|
|
68
68
|
* @param currentDragDeltaXY How far the pointer has moved from the position
|
|
69
69
|
* at mouse down, in pixel units.
|
|
70
70
|
* @returns True if the drag is toward the workspace.
|
|
71
|
-
* @internal
|
|
72
71
|
*/
|
|
73
72
|
isDragTowardWorkspace(currentDragDeltaXY: Coordinate): boolean;
|
|
74
73
|
/**
|
|
@@ -69,7 +69,6 @@ export declare class VerticalFlyout extends Flyout {
|
|
|
69
69
|
* @param currentDragDeltaXY How far the pointer has moved from the position
|
|
70
70
|
* at mouse down, in pixel units.
|
|
71
71
|
* @returns True if the drag is toward the workspace.
|
|
72
|
-
* @internal
|
|
73
72
|
*/
|
|
74
73
|
isDragTowardWorkspace(currentDragDeltaXY: Coordinate): boolean;
|
|
75
74
|
/**
|
package/core/widgetdiv.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { Rect } from './utils/rect.js';
|
|
7
7
|
import type { Size } from './utils/size.js';
|
|
8
|
+
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
8
9
|
/**
|
|
9
10
|
* Returns the HTML container for editor widgets.
|
|
10
11
|
*
|
|
@@ -29,8 +30,9 @@ export declare function createDom(): void;
|
|
|
29
30
|
* @param rtl Right-to-left (true) or left-to-right (false).
|
|
30
31
|
* @param newDispose Optional cleanup function to be run when the widget is
|
|
31
32
|
* closed.
|
|
33
|
+
* @param workspace The workspace associated with the widget owner.
|
|
32
34
|
*/
|
|
33
|
-
export declare function show(newOwner: unknown, rtl: boolean, newDispose: () => void): void;
|
|
35
|
+
export declare function show(newOwner: unknown, rtl: boolean, newDispose: () => void, workspace?: WorkspaceSvg | null): void;
|
|
34
36
|
/**
|
|
35
37
|
* Destroy the widget and hide the div.
|
|
36
38
|
*/
|
|
@@ -48,6 +50,13 @@ export declare function isVisible(): boolean;
|
|
|
48
50
|
* @param oldOwner The object that was using this container.
|
|
49
51
|
*/
|
|
50
52
|
export declare function hideIfOwner(oldOwner: unknown): void;
|
|
53
|
+
/**
|
|
54
|
+
* Destroy the widget and hide the div if it is being used by an object in the
|
|
55
|
+
* specified workspace, or if it is used by an unknown workspace.
|
|
56
|
+
*
|
|
57
|
+
* @param oldOwnerWorkspace The workspace that was using this container.
|
|
58
|
+
*/
|
|
59
|
+
export declare function hideIfOwnerIsInWorkspace(oldOwnerWorkspace: WorkspaceSvg): void;
|
|
51
60
|
/**
|
|
52
61
|
* Position the widget div based on an anchor rectangle.
|
|
53
62
|
* The widget should be placed adjacent to but not overlapping the anchor
|
package/core/workspace_svg.d.ts
CHANGED
package/msg/be-tarask.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import be_tarask from './be-tarask.js';
|
|
2
2
|
export const {
|
|
3
3
|
LOGIC_HUE,
|
|
4
4
|
LOOPS_HUE,
|
|
@@ -420,4 +420,4 @@ export const {
|
|
|
420
420
|
COLLAPSED_WARNINGS_WARNING,
|
|
421
421
|
DIALOG_OK,
|
|
422
422
|
DIALOG_CANCEL,
|
|
423
|
-
} =
|
|
423
|
+
} = be_tarask;
|
package/msg/en-gb.mjs
CHANGED
package/msg/kbd-cyrl.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import kbd_cyrl from './kbd-cyrl.js';
|
|
2
2
|
export const {
|
|
3
3
|
LOGIC_HUE,
|
|
4
4
|
LOOPS_HUE,
|
|
@@ -420,4 +420,4 @@ export const {
|
|
|
420
420
|
COLLAPSED_WARNINGS_WARNING,
|
|
421
421
|
DIALOG_OK,
|
|
422
422
|
DIALOG_CANCEL,
|
|
423
|
-
} =
|
|
423
|
+
} = kbd_cyrl;
|
package/msg/ku-latn.mjs
CHANGED
package/msg/pt-br.mjs
CHANGED
package/msg/skr-arab.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import skr_arab from './skr-arab.js';
|
|
2
2
|
export const {
|
|
3
3
|
LOGIC_HUE,
|
|
4
4
|
LOOPS_HUE,
|
|
@@ -420,4 +420,4 @@ export const {
|
|
|
420
420
|
COLLAPSED_WARNINGS_WARNING,
|
|
421
421
|
DIALOG_OK,
|
|
422
422
|
DIALOG_CANCEL,
|
|
423
|
-
} =
|
|
423
|
+
} = skr_arab;
|
package/msg/sr-latn.mjs
CHANGED
package/msg/ug-arab.mjs
CHANGED
package/msg/zh-hans.mjs
CHANGED
package/msg/zh-hant.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blockly",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.1.0",
|
|
4
4
|
"description": "Blockly is a library for building visual programming editors.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"blockly"
|
|
7
7
|
],
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "https://github.com/google/blockly.git"
|
|
10
|
+
"url": "git+https://github.com/google/blockly.git"
|
|
11
11
|
},
|
|
12
12
|
"bugs": {
|
|
13
13
|
"url": "https://github.com/google/blockly/issues"
|