blockly 11.0.0-beta.7 → 11.0.0-beta.8
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 +66 -63
- package/blockly_compressed.js +66 -63
- package/blockly_compressed.js.map +1 -1
- package/core/block_svg.d.ts +1 -1
- package/core/blockly.d.ts +12 -6
- package/core/comments/comment_view.d.ts +8 -0
- package/core/comments/rendered_workspace_comment.d.ts +8 -1
- package/core/dragging/dragger.d.ts +5 -4
- package/core/dragging.d.ts +11 -0
- package/core/gesture.d.ts +5 -0
- package/core/registry.d.ts +5 -1
- package/core/workspace_svg.d.ts +0 -2
- package/package.json +1 -1
package/core/block_svg.d.ts
CHANGED
|
@@ -659,6 +659,6 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
659
659
|
/**
|
|
660
660
|
* Returns a representation of this block that can be displayed in a flyout.
|
|
661
661
|
*/
|
|
662
|
-
|
|
662
|
+
toFlyoutInfo(): FlyoutItemInfo[];
|
|
663
663
|
}
|
|
664
664
|
//# sourceMappingURL=block_svg.d.ts.map
|
package/core/blockly.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ import * as comments from './comments.js';
|
|
|
30
30
|
import * as Css from './css.js';
|
|
31
31
|
import { DeleteArea } from './delete_area.js';
|
|
32
32
|
import * as dialog from './dialog.js';
|
|
33
|
-
import
|
|
33
|
+
import * as dragging from './dragging.js';
|
|
34
34
|
import { DragTarget } from './drag_target.js';
|
|
35
35
|
import * as dropDownDiv from './dropdowndiv.js';
|
|
36
36
|
import * as Events from './events/events.js';
|
|
@@ -70,11 +70,12 @@ import { IComponent } from './interfaces/i_component.js';
|
|
|
70
70
|
import { IConnectionChecker } from './interfaces/i_connection_checker.js';
|
|
71
71
|
import { IConnectionPreviewer } from './interfaces/i_connection_previewer.js';
|
|
72
72
|
import { IContextMenu } from './interfaces/i_contextmenu.js';
|
|
73
|
-
import { ICopyable, isCopyable } from './interfaces/i_copyable.js';
|
|
73
|
+
import { ICopyable, isCopyable, ICopyData } from './interfaces/i_copyable.js';
|
|
74
74
|
import { IDeletable, isDeletable } from './interfaces/i_deletable.js';
|
|
75
75
|
import { IDeleteArea } from './interfaces/i_delete_area.js';
|
|
76
76
|
import { IDragTarget } from './interfaces/i_drag_target.js';
|
|
77
|
-
import {
|
|
77
|
+
import { IDragger } from './interfaces/i_dragger.js';
|
|
78
|
+
import { IDraggable, isDraggable, IDragStrategy } from './interfaces/i_draggable.js';
|
|
78
79
|
import { IFlyout } from './interfaces/i_flyout.js';
|
|
79
80
|
import { IHasBubble, hasBubble } from './interfaces/i_has_bubble.js';
|
|
80
81
|
import { IIcon, isIcon } from './interfaces/i_icon.js';
|
|
@@ -85,6 +86,7 @@ import { IObservable, isObservable } from './interfaces/i_observable.js';
|
|
|
85
86
|
import { IPaster, isPaster } from './interfaces/i_paster.js';
|
|
86
87
|
import { IPositionable } from './interfaces/i_positionable.js';
|
|
87
88
|
import { IRegistrable } from './interfaces/i_registrable.js';
|
|
89
|
+
import { IRenderedElement, isRenderedElement } from './interfaces/i_rendered_element.js';
|
|
88
90
|
import { ISelectable, isSelectable } from './interfaces/i_selectable.js';
|
|
89
91
|
import { ISelectableToolboxItem } from './interfaces/i_selectable_toolbox_item.js';
|
|
90
92
|
import { ISerializable, isSerializable } from './interfaces/i_serializable.js';
|
|
@@ -98,6 +100,7 @@ import { Cursor } from './keyboard_nav/cursor.js';
|
|
|
98
100
|
import { Marker } from './keyboard_nav/marker.js';
|
|
99
101
|
import { TabNavigateCursor } from './keyboard_nav/tab_navigate_cursor.js';
|
|
100
102
|
import { MarkerManager } from './marker_manager.js';
|
|
103
|
+
import type { LayerManager } from './layer_manager.js';
|
|
101
104
|
import { Menu } from './menu.js';
|
|
102
105
|
import { MenuItem } from './menuitem.js';
|
|
103
106
|
import { MetricsManager } from './metrics_manager.js';
|
|
@@ -307,7 +310,7 @@ export { ContextMenuRegistry };
|
|
|
307
310
|
export { comments };
|
|
308
311
|
export { Cursor };
|
|
309
312
|
export { DeleteArea };
|
|
310
|
-
export {
|
|
313
|
+
export { dragging };
|
|
311
314
|
export { DragTarget };
|
|
312
315
|
export declare const DropDownDiv: typeof dropDownDiv;
|
|
313
316
|
export { Field, FieldConfig, FieldValidator, UnattachedFieldError };
|
|
@@ -339,11 +342,12 @@ export { IConnectionChecker };
|
|
|
339
342
|
export { IConnectionPreviewer };
|
|
340
343
|
export { IContextMenu };
|
|
341
344
|
export { icons };
|
|
342
|
-
export { ICopyable, isCopyable };
|
|
345
|
+
export { ICopyable, isCopyable, ICopyData };
|
|
343
346
|
export { IDeletable, isDeletable };
|
|
344
347
|
export { IDeleteArea };
|
|
345
348
|
export { IDragTarget };
|
|
346
|
-
export {
|
|
349
|
+
export { IDragger };
|
|
350
|
+
export { IDraggable, isDraggable, IDragStrategy };
|
|
347
351
|
export { IFlyout };
|
|
348
352
|
export { IHasBubble, hasBubble };
|
|
349
353
|
export { IIcon, isIcon };
|
|
@@ -358,6 +362,7 @@ export { IObservable, isObservable };
|
|
|
358
362
|
export { IPaster, isPaster };
|
|
359
363
|
export { IPositionable };
|
|
360
364
|
export { IRegistrable };
|
|
365
|
+
export { IRenderedElement, isRenderedElement };
|
|
361
366
|
export { ISelectable, isSelectable };
|
|
362
367
|
export { ISelectableToolboxItem };
|
|
363
368
|
export { ISerializable, isSerializable };
|
|
@@ -367,6 +372,7 @@ export { IToolboxItem };
|
|
|
367
372
|
export { IVariableBackedParameterModel, isVariableBackedParameterModel };
|
|
368
373
|
export { Marker };
|
|
369
374
|
export { MarkerManager };
|
|
375
|
+
export { LayerManager };
|
|
370
376
|
export { Menu };
|
|
371
377
|
export { MenuItem };
|
|
372
378
|
export { MetricsManager };
|
|
@@ -11,6 +11,10 @@ export declare class CommentView implements IRenderedElement {
|
|
|
11
11
|
private readonly workspace;
|
|
12
12
|
/** The root group element of the comment view. */
|
|
13
13
|
private svgRoot;
|
|
14
|
+
/**
|
|
15
|
+
* The svg rect element that we use to create a hightlight around the comment.
|
|
16
|
+
*/
|
|
17
|
+
private highlightRect;
|
|
14
18
|
/** The group containing all of the top bar elements. */
|
|
15
19
|
private topBarGroup;
|
|
16
20
|
/** The rect background for the top bar. */
|
|
@@ -62,6 +66,10 @@ export declare class CommentView implements IRenderedElement {
|
|
|
62
66
|
/** Whether this comment view has been disposed or not. */
|
|
63
67
|
private disposed;
|
|
64
68
|
constructor(workspace: WorkspaceSvg);
|
|
69
|
+
/**
|
|
70
|
+
* Creates the rect we use for highlighting the comment when it's selected.
|
|
71
|
+
*/
|
|
72
|
+
private createHighlightRect;
|
|
65
73
|
/**
|
|
66
74
|
* Creates the top bar and the elements visually within it.
|
|
67
75
|
* Registers event listeners.
|
|
@@ -12,7 +12,8 @@ import { IBoundedElement } from '../interfaces/i_bounded_element.js';
|
|
|
12
12
|
import { IRenderedElement } from '../interfaces/i_rendered_element.js';
|
|
13
13
|
import { IDraggable } from '../interfaces/i_draggable.js';
|
|
14
14
|
import { ISelectable } from '../interfaces/i_selectable.js';
|
|
15
|
-
|
|
15
|
+
import { IDeletable } from '../interfaces/i_deletable.js';
|
|
16
|
+
export declare class RenderedWorkspaceComment extends WorkspaceComment implements IBoundedElement, IRenderedElement, IDraggable, ISelectable, IDeletable {
|
|
16
17
|
/** The class encompassing the svg elements making up the workspace comment. */
|
|
17
18
|
private view;
|
|
18
19
|
readonly workspace: WorkspaceSvg;
|
|
@@ -59,6 +60,10 @@ export declare class RenderedWorkspaceComment extends WorkspaceComment implement
|
|
|
59
60
|
* (that wasn't otherwise gobbled up, e.g. by resizing).
|
|
60
61
|
*/
|
|
61
62
|
private startGesture;
|
|
63
|
+
/** Returns whether this comment is deletable or not. */
|
|
64
|
+
isDeletable(): boolean;
|
|
65
|
+
/** Visually indicates that this comment would be deleted if dropped. */
|
|
66
|
+
setDeleteStyle(wouldDelete: boolean): void;
|
|
62
67
|
/** Returns whether this comment is movable or not. */
|
|
63
68
|
isMovable(): boolean;
|
|
64
69
|
/** Starts a drag on the comment. */
|
|
@@ -69,7 +74,9 @@ export declare class RenderedWorkspaceComment extends WorkspaceComment implement
|
|
|
69
74
|
endDrag(): void;
|
|
70
75
|
/** Moves the comment back to where it was at the start of a drag. */
|
|
71
76
|
revertDrag(): void;
|
|
77
|
+
/** Visually highlights the comment. */
|
|
72
78
|
select(): void;
|
|
79
|
+
/** Visually unhighlights the comment. */
|
|
73
80
|
unselect(): void;
|
|
74
81
|
}
|
|
75
82
|
//# sourceMappingURL=rendered_workspace_comment.d.ts.map
|
|
@@ -3,16 +3,17 @@
|
|
|
3
3
|
* Copyright 2024 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
import { IDragTarget } from '../interfaces/i_drag_target.js';
|
|
6
7
|
import { IDeletable } from '../interfaces/i_deletable.js';
|
|
7
8
|
import { IDragger } from '../interfaces/i_dragger.js';
|
|
8
9
|
import { IDraggable } from '../interfaces/i_draggable.js';
|
|
9
10
|
import { Coordinate } from '../utils/coordinate.js';
|
|
10
11
|
import { WorkspaceSvg } from '../workspace_svg.js';
|
|
11
12
|
export declare class Dragger implements IDragger {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
protected draggable: IDraggable;
|
|
14
|
+
protected workspace: WorkspaceSvg;
|
|
15
|
+
protected startLoc: Coordinate;
|
|
16
|
+
protected dragTarget: IDragTarget | null;
|
|
16
17
|
constructor(draggable: IDraggable, workspace: WorkspaceSvg);
|
|
17
18
|
/** Handles any drag startup. */
|
|
18
19
|
onDragStart(e: PointerEvent): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Dragger } from './dragging/dragger.js';
|
|
7
|
+
import { BlockDragStrategy } from './dragging/block_drag_strategy.js';
|
|
8
|
+
import { BubbleDragStrategy } from './dragging/bubble_drag_strategy.js';
|
|
9
|
+
import { CommentDragStrategy } from './dragging/comment_drag_strategy.js';
|
|
10
|
+
export { Dragger, BlockDragStrategy, BubbleDragStrategy, CommentDragStrategy };
|
|
11
|
+
//# sourceMappingURL=dragging.d.ts.map
|
package/core/gesture.d.ts
CHANGED
|
@@ -15,8 +15,10 @@ import type { Field } from './field.js';
|
|
|
15
15
|
import type { IBubble } from './interfaces/i_bubble.js';
|
|
16
16
|
import type { IFlyout } from './interfaces/i_flyout.js';
|
|
17
17
|
import { Coordinate } from './utils/coordinate.js';
|
|
18
|
+
import { WorkspaceDragger } from './workspace_dragger.js';
|
|
18
19
|
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
19
20
|
import type { IIcon } from './interfaces/i_icon.js';
|
|
21
|
+
import { IDragger } from './interfaces/i_dragger.js';
|
|
20
22
|
import { RenderedWorkspaceComment } from './comments.js';
|
|
21
23
|
/**
|
|
22
24
|
* Class for one gesture.
|
|
@@ -398,6 +400,7 @@ export declare class Gesture {
|
|
|
398
400
|
* @returns Whether this gesture was a click on a bubble.
|
|
399
401
|
*/
|
|
400
402
|
private isBubbleClick;
|
|
403
|
+
private isCommentClick;
|
|
401
404
|
/**
|
|
402
405
|
* Whether this gesture is a click on a block. This should only be called
|
|
403
406
|
* when ending a gesture (pointerup).
|
|
@@ -421,6 +424,8 @@ export declare class Gesture {
|
|
|
421
424
|
* @returns Whether this gesture was a click on a workspace.
|
|
422
425
|
*/
|
|
423
426
|
private isWorkspaceClick;
|
|
427
|
+
/** Returns the current dragger if the gesture is a drag. */
|
|
428
|
+
getCurrentDragger(): WorkspaceDragger | IDragger | null;
|
|
424
429
|
/**
|
|
425
430
|
* Whether this gesture is a drag of either a workspace or block.
|
|
426
431
|
* This function is called externally to block actions that cannot be taken
|
package/core/registry.d.ts
CHANGED
|
@@ -58,7 +58,11 @@ export declare class Type<_T> {
|
|
|
58
58
|
static FLYOUTS_VERTICAL_TOOLBOX: Type<IFlyout>;
|
|
59
59
|
static FLYOUTS_HORIZONTAL_TOOLBOX: Type<IFlyout>;
|
|
60
60
|
static METRICS_MANAGER: Type<IMetricsManager>;
|
|
61
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Type for an IDragger. Formerly behavior was mostly covered by
|
|
63
|
+
* BlockDraggeers, which is why the name is inaccurate.
|
|
64
|
+
*/
|
|
65
|
+
static BLOCK_DRAGGER: Type<IDragger>;
|
|
62
66
|
/** @internal */
|
|
63
67
|
static SERIALIZER: Type<ISerializer>;
|
|
64
68
|
/** @internal */
|
package/core/workspace_svg.d.ts
CHANGED
|
@@ -497,8 +497,6 @@ export declare class WorkspaceSvg extends Workspace implements IASTNodeLocationS
|
|
|
497
497
|
updateScreenCalculationsIfScrolled(): void;
|
|
498
498
|
/**
|
|
499
499
|
* @returns The layer manager for this workspace.
|
|
500
|
-
*
|
|
501
|
-
* @internal
|
|
502
500
|
*/
|
|
503
501
|
getLayerManager(): LayerManager | null;
|
|
504
502
|
/**
|