blockly 11.0.0-beta.1 → 11.0.0-beta.11
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 +852 -891
- package/blockly_compressed.js +794 -796
- package/blockly_compressed.js.map +1 -1
- package/blocks.js +4 -22
- package/blocks_compressed.js +38 -41
- package/blocks_compressed.js.map +1 -1
- package/core/block.d.ts +58 -10
- package/core/block_svg.d.ts +50 -44
- package/core/blockly.d.ts +22 -56
- package/core/bubbles/bubble.d.ts +17 -2
- package/core/bubbles/mini_workspace_bubble.d.ts +1 -1
- package/core/bubbles/text_bubble.d.ts +1 -1
- package/core/bubbles/textinput_bubble.d.ts +1 -1
- package/core/clipboard/workspace_comment_paster.d.ts +5 -4
- package/core/clipboard.d.ts +0 -19
- package/core/comments/comment_view.d.ts +217 -0
- package/core/comments/rendered_workspace_comment.d.ts +90 -0
- package/core/comments/workspace_comment.d.ts +107 -0
- package/core/comments.d.ts +9 -0
- package/core/connection.d.ts +1 -1
- package/core/constants.d.ts +5 -0
- package/core/contextmenu.d.ts +1 -34
- package/core/contextmenu_items.d.ts +8 -0
- package/core/contextmenu_registry.d.ts +18 -3
- package/core/delete_area.d.ts +1 -2
- package/core/dragging/block_drag_strategy.d.ts +105 -0
- package/core/dragging/bubble_drag_strategy.d.ts +20 -0
- package/core/dragging/comment_drag_strategy.d.ts +21 -0
- package/core/dragging/dragger.d.ts +48 -0
- package/core/dragging.d.ts +11 -0
- package/core/events/events.d.ts +3 -0
- package/core/events/events_block_change.d.ts +15 -0
- package/core/events/events_click.d.ts +1 -1
- package/core/events/events_comment_base.d.ts +6 -1
- package/core/events/events_comment_change.d.ts +1 -1
- package/core/events/events_comment_collapse.d.ts +39 -0
- package/core/events/events_comment_create.d.ts +5 -1
- package/core/events/events_comment_delete.d.ts +5 -1
- package/core/events/events_comment_move.d.ts +17 -1
- package/core/events/utils.d.ts +3 -3
- package/core/field_dropdown.d.ts +1 -0
- package/core/field_image.d.ts +1 -1
- package/core/flyout_base.d.ts +25 -1
- package/core/flyout_button.d.ts +26 -1
- package/core/generator.d.ts +1 -1
- package/core/gesture.d.ts +29 -53
- package/core/grid.d.ts +29 -8
- package/core/icons/comment_icon.d.ts +8 -3
- package/core/icons/icon.d.ts +0 -6
- package/core/icons/icon_types.d.ts +2 -2
- package/core/icons/mutator_icon.d.ts +1 -16
- package/core/icons/warning_icon.d.ts +1 -1
- package/core/inputs/input.d.ts +10 -19
- package/core/insertion_marker_manager.d.ts +2 -0
- package/core/insertion_marker_previewer.d.ts +56 -0
- package/core/interfaces/i_comment_icon.d.ts +21 -0
- package/core/interfaces/i_connection_previewer.d.ts +39 -0
- package/core/interfaces/i_deletable.d.ts +6 -0
- package/core/interfaces/i_delete_area.d.ts +1 -2
- package/core/interfaces/i_draggable.d.ts +47 -3
- package/core/interfaces/i_dragger.d.ts +32 -0
- package/core/interfaces/i_has_bubble.d.ts +1 -1
- package/core/interfaces/i_parameter_model.d.ts +7 -0
- package/core/interfaces/i_procedure_model.d.ts +7 -0
- package/core/interfaces/i_selectable.d.ts +5 -3
- package/core/internal_constants.d.ts +0 -7
- package/core/keyboard_nav/ast_node.d.ts +21 -2
- package/core/options.d.ts +1 -0
- package/core/registry.d.ts +10 -4
- package/core/render_management.d.ts +4 -1
- package/core/rendered_connection.d.ts +3 -1
- package/core/renderers/common/constants.d.ts +6 -2
- package/core/renderers/common/drawer.d.ts +18 -7
- package/core/renderers/common/i_path_object.d.ts +6 -15
- package/core/renderers/common/info.d.ts +5 -2
- package/core/renderers/common/marker_svg.d.ts +7 -0
- package/core/renderers/common/path_object.d.ts +13 -0
- package/core/renderers/common/renderer.d.ts +3 -0
- package/core/renderers/measurables/connection.d.ts +1 -0
- package/core/renderers/measurables/icon.d.ts +0 -5
- package/core/renderers/zelos/drawer.d.ts +4 -0
- package/core/renderers/zelos/renderer.d.ts +4 -2
- package/core/serialization/blocks.d.ts +1 -0
- package/core/serialization/priorities.d.ts +2 -0
- package/core/serialization/procedures.d.ts +28 -26
- package/core/serialization/workspace_comments.d.ts +45 -0
- package/core/serialization.d.ts +2 -1
- package/core/toolbox/toolbox.d.ts +1 -2
- package/core/utils/dom.d.ts +0 -9
- package/core/utils/keycodes.d.ts +32 -32
- package/core/utils/size.d.ts +10 -0
- package/core/utils/string.d.ts +0 -10
- package/core/utils/toolbox.d.ts +1 -0
- package/core/workspace.d.ts +9 -1
- package/core/workspace_audio.d.ts +10 -0
- package/core/workspace_svg.d.ts +10 -32
- package/core/xml.d.ts +9 -3
- package/core-node.js +31 -0
- package/core.js +4 -26
- package/dart.js +4 -22
- package/dart_compressed.js +22 -72
- package/dart_compressed.js.map +1 -1
- package/generators/dart/dart_generator.d.ts +17 -17
- package/generators/dart/text.d.ts +0 -1
- package/generators/javascript/javascript_generator.d.ts +34 -35
- package/generators/javascript/text.d.ts +0 -1
- package/generators/lua/lua_generator.d.ts +10 -10
- package/generators/lua/text.d.ts +0 -1
- package/generators/php/php_generator.d.ts +36 -36
- package/generators/php/text.d.ts +0 -1
- package/generators/python/python_generator.d.ts +20 -21
- package/generators/python/text.d.ts +0 -1
- package/index.js +19 -7
- package/javascript.js +4 -23
- package/javascript_compressed.js +19 -54
- package/javascript_compressed.js.map +1 -1
- package/lua.js +4 -22
- package/lua_compressed.js +24 -47
- package/lua_compressed.js.map +1 -1
- package/media/delete-icon.svg +1 -0
- package/media/foldout-icon.svg +1 -0
- package/media/resize-handle.svg +3 -0
- package/msg/ab.js +1 -0
- package/msg/ace.js +1 -0
- package/msg/af.js +1 -0
- package/msg/am.js +1 -0
- package/msg/ar.js +2 -1
- package/msg/ast.js +1 -0
- package/msg/az.js +1 -0
- package/msg/ba.js +1 -0
- package/msg/bcc.js +1 -0
- package/msg/be-tarask.js +9 -8
- package/msg/be.js +1 -0
- package/msg/bg.js +1 -0
- package/msg/bn.js +6 -5
- package/msg/br.js +1 -0
- package/msg/bs.js +1 -0
- package/msg/ca.js +1 -0
- package/msg/cdo.js +1 -0
- package/msg/ce.d.ts +8 -0
- package/msg/ce.js +1 -0
- package/msg/cs.js +1 -0
- package/msg/da.js +5 -4
- package/msg/de.js +1 -0
- package/msg/diq.js +1 -0
- package/msg/dtp.d.ts +8 -0
- package/msg/dtp.js +1 -0
- package/msg/dty.js +1 -0
- package/msg/ee.js +1 -0
- package/msg/el.js +2 -1
- package/msg/en-gb.js +1 -0
- package/msg/en.js +1 -0
- package/msg/eo.js +1 -0
- package/msg/es.js +1 -0
- package/msg/et.js +1 -0
- package/msg/eu.js +1 -0
- package/msg/fa.js +1 -0
- package/msg/fi.js +1 -0
- package/msg/fo.js +1 -0
- package/msg/fr.js +1 -0
- package/msg/frr.js +1 -0
- package/msg/gl.js +1 -0
- package/msg/gn.js +1 -0
- package/msg/gor.js +1 -0
- package/msg/ha.js +1 -0
- package/msg/hak.js +1 -0
- package/msg/he.js +2 -1
- package/msg/hi.js +1 -0
- package/msg/hr.js +1 -0
- package/msg/hrx.js +1 -0
- package/msg/hsb.d.ts +8 -0
- package/msg/hsb.js +1 -0
- package/msg/hu.js +1 -0
- package/msg/hy.js +1 -0
- package/msg/ia.js +1 -0
- package/msg/id.js +7 -6
- package/msg/ig.js +1 -0
- package/msg/inh.js +4 -3
- package/msg/is.js +1 -0
- package/msg/it.js +1 -0
- package/msg/ja.js +2 -1
- package/msg/ka.js +1 -0
- package/msg/kab.js +1 -0
- package/msg/kbd-cyrl.js +1 -0
- package/msg/km.js +1 -0
- package/msg/kn.js +1 -0
- package/msg/ko.js +1 -0
- package/msg/ksh.js +1 -0
- package/msg/ku-latn.js +1 -0
- package/msg/ky.js +1 -0
- package/msg/la.js +1 -0
- package/msg/lb.js +1 -0
- package/msg/lki.js +1 -0
- package/msg/lo.js +1 -0
- package/msg/lrc.js +1 -0
- package/msg/lt.js +1 -0
- package/msg/lv.js +1 -0
- package/msg/mg.js +1 -0
- package/msg/mk.js +1 -0
- package/msg/ml.js +1 -0
- package/msg/mnw.js +1 -0
- package/msg/ms.js +1 -0
- package/msg/my.js +1 -0
- package/msg/mzn.js +1 -0
- package/msg/nb.js +1 -0
- package/msg/ne.js +1 -0
- package/msg/nl.js +4 -3
- package/msg/oc.js +1 -0
- package/msg/olo.js +1 -0
- package/msg/pa.js +1 -0
- package/msg/pl.js +1 -0
- package/msg/pms.js +1 -0
- package/msg/ps.js +1 -0
- package/msg/pt-br.js +1 -0
- package/msg/pt.js +2 -1
- package/msg/ro.js +1 -0
- package/msg/ru.js +1 -0
- package/msg/sc.js +1 -0
- package/msg/sco.js +1 -0
- package/msg/sd.js +1 -0
- package/msg/shn.js +1 -0
- package/msg/si.js +1 -0
- package/msg/sk.js +1 -0
- package/msg/skr-arab.js +1 -0
- package/msg/sl.js +1 -0
- package/msg/smn.js +1 -0
- package/msg/sq.js +1 -0
- package/msg/sr-latn.js +1 -0
- package/msg/sr.js +1 -0
- package/msg/sv.js +1 -0
- package/msg/sw.js +1 -0
- package/msg/ta.js +3 -2
- package/msg/tcy.js +1 -0
- package/msg/tdd.d.ts +8 -0
- package/msg/tdd.js +1 -0
- package/msg/te.js +1 -0
- package/msg/th.js +1 -0
- package/msg/ti.js +1 -0
- package/msg/tl.js +3 -2
- package/msg/tlh.js +1 -0
- package/msg/tr.js +1 -0
- package/msg/ug-arab.js +1 -0
- package/msg/uk.js +1 -0
- package/msg/ur.js +3 -2
- package/msg/uz.js +1 -0
- package/msg/vi.js +1 -0
- package/msg/xmf.js +1 -0
- package/msg/yo.js +1 -0
- package/msg/zgh.js +1 -0
- package/msg/zh-hans.js +1 -0
- package/msg/zh-hant.js +15 -14
- package/package.json +49 -15
- package/php.js +4 -22
- package/php_compressed.js +13 -46
- package/php_compressed.js.map +1 -1
- package/python.js +4 -23
- package/python_compressed.js +21 -40
- package/python_compressed.js.map +1 -1
- package/blockly.js +0 -22
- package/browser.js +0 -30
- package/core/block_dragger.d.ts +0 -162
- package/core/bubble_dragger.d.ts +0 -77
- package/core/field_angle.d.ts +0 -208
- package/core/field_colour.d.ts +0 -243
- package/core/field_multilineinput.d.ts +0 -182
- package/core/interfaces/i_block_dragger.d.ts +0 -47
- package/core/renderers/minimalist/constants.d.ts +0 -21
- package/core/renderers/minimalist/drawer.d.ts +0 -26
- package/core/renderers/minimalist/info.d.ts +0 -35
- package/core/renderers/minimalist/minimalist.d.ts +0 -12
- package/core/renderers/minimalist/renderer.d.ts +0 -48
- package/core/workspace_comment.d.ts +0 -190
- package/core/workspace_comment_svg.d.ts +0 -361
- package/core-browser.js +0 -26
- package/generators/dart/colour.d.ts +0 -16
- package/generators/javascript/colour.d.ts +0 -16
- package/generators/lua/colour.d.ts +0 -16
- package/generators/php/colour.d.ts +0 -16
- package/generators/python/colour.d.ts +0 -16
- package/msg/constants.d.ts +0 -14
- package/msg/qqq.d.ts +0 -14
- package/msg/synonyms.d.ts +0 -14
- package/msg/yue.js +0 -441
- package/node.js +0 -21
|
@@ -7,12 +7,13 @@ import { IPaster } from '../interfaces/i_paster.js';
|
|
|
7
7
|
import { ICopyData } from '../interfaces/i_copyable.js';
|
|
8
8
|
import { Coordinate } from '../utils/coordinate.js';
|
|
9
9
|
import { WorkspaceSvg } from '../workspace_svg.js';
|
|
10
|
-
import
|
|
11
|
-
|
|
10
|
+
import * as commentSerialiation from '../serialization/workspace_comments.js';
|
|
11
|
+
import { RenderedWorkspaceComment } from '../comments/rendered_workspace_comment.js';
|
|
12
|
+
export declare class WorkspaceCommentPaster implements IPaster<WorkspaceCommentCopyData, RenderedWorkspaceComment> {
|
|
12
13
|
static TYPE: string;
|
|
13
|
-
paste(copyData: WorkspaceCommentCopyData, workspace: WorkspaceSvg, coordinate?: Coordinate):
|
|
14
|
+
paste(copyData: WorkspaceCommentCopyData, workspace: WorkspaceSvg, coordinate?: Coordinate): RenderedWorkspaceComment | null;
|
|
14
15
|
}
|
|
15
16
|
export interface WorkspaceCommentCopyData extends ICopyData {
|
|
16
|
-
commentState:
|
|
17
|
+
commentState: commentSerialiation.State;
|
|
17
18
|
}
|
|
18
19
|
//# sourceMappingURL=workspace_comment_paster.d.ts.map
|
package/core/clipboard.d.ts
CHANGED
|
@@ -8,14 +8,6 @@ import { BlockPaster } from './clipboard/block_paster.js';
|
|
|
8
8
|
import { WorkspaceSvg } from './workspace_svg.js';
|
|
9
9
|
import * as registry from './clipboard/registry.js';
|
|
10
10
|
import { Coordinate } from './utils/coordinate.js';
|
|
11
|
-
/**
|
|
12
|
-
* Copy a copyable element onto the local clipboard.
|
|
13
|
-
*
|
|
14
|
-
* @param toCopy The copyable element to be copied.
|
|
15
|
-
* @deprecated v11. Use `myCopyable.toCopyData()` instead. To be removed v12.
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export declare function copy<T extends ICopyData>(toCopy: ICopyable<T>): T | null;
|
|
19
11
|
/**
|
|
20
12
|
* Private version of copy for stubbing in tests.
|
|
21
13
|
*/
|
|
@@ -35,17 +27,6 @@ export declare function paste<T extends ICopyData>(copyData: T, workspace: Works
|
|
|
35
27
|
* @returns the pasted thing if the paste was successful, null otherwise.
|
|
36
28
|
*/
|
|
37
29
|
export declare function paste(): ICopyable<ICopyData> | null;
|
|
38
|
-
/**
|
|
39
|
-
* Duplicate this copy-paste-able element.
|
|
40
|
-
*
|
|
41
|
-
* @param toDuplicate The element to be duplicated.
|
|
42
|
-
* @returns The element that was duplicated, or null if the duplication failed.
|
|
43
|
-
* @deprecated v11. Use
|
|
44
|
-
* `Blockly.clipboard.paste(myCopyable.toCopyData(), myWorkspace)` instead.
|
|
45
|
-
* To be removed v12.
|
|
46
|
-
* @internal
|
|
47
|
-
*/
|
|
48
|
-
export declare function duplicate<U extends ICopyData, T extends ICopyable<U> & IHasWorkspace>(toDuplicate: T): T | null;
|
|
49
30
|
/**
|
|
50
31
|
* Private version of duplicate for stubbing in tests.
|
|
51
32
|
*/
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { IRenderedElement } from '../interfaces/i_rendered_element.js';
|
|
7
|
+
import { WorkspaceSvg } from '../workspace_svg.js';
|
|
8
|
+
import { Coordinate } from '../utils/coordinate.js';
|
|
9
|
+
import { Size } from '../utils/size.js';
|
|
10
|
+
export declare class CommentView implements IRenderedElement {
|
|
11
|
+
private readonly workspace;
|
|
12
|
+
/** The root group element of the comment view. */
|
|
13
|
+
private svgRoot;
|
|
14
|
+
/**
|
|
15
|
+
* The svg rect element that we use to create a hightlight around the comment.
|
|
16
|
+
*/
|
|
17
|
+
private highlightRect;
|
|
18
|
+
/** The group containing all of the top bar elements. */
|
|
19
|
+
private topBarGroup;
|
|
20
|
+
/** The rect background for the top bar. */
|
|
21
|
+
private topBarBackground;
|
|
22
|
+
/** The delete icon that goes in the top bar. */
|
|
23
|
+
private deleteIcon;
|
|
24
|
+
/** The foldout icon that goes in the top bar. */
|
|
25
|
+
private foldoutIcon;
|
|
26
|
+
/** The text element that goes in the top bar. */
|
|
27
|
+
private textPreview;
|
|
28
|
+
/** The actual text node in the text preview. */
|
|
29
|
+
private textPreviewNode;
|
|
30
|
+
/** The resize handle element. */
|
|
31
|
+
private resizeHandle;
|
|
32
|
+
/** The foreignObject containing the HTML text area. */
|
|
33
|
+
private foreignObject;
|
|
34
|
+
/** The text area where the user can type. */
|
|
35
|
+
private textArea;
|
|
36
|
+
/** The current size of the comment in workspace units. */
|
|
37
|
+
private size;
|
|
38
|
+
/** Whether the comment is collapsed or not. */
|
|
39
|
+
private collapsed;
|
|
40
|
+
/** Whether the comment is editable or not. */
|
|
41
|
+
private editable;
|
|
42
|
+
/** The current location of the comment in workspace coordinates. */
|
|
43
|
+
private location;
|
|
44
|
+
/** The current text of the comment. Updates on text area change. */
|
|
45
|
+
private text;
|
|
46
|
+
/** Listeners for changes to text. */
|
|
47
|
+
private textChangeListeners;
|
|
48
|
+
/** Listeners for changes to size. */
|
|
49
|
+
private sizeChangeListeners;
|
|
50
|
+
/** Listeners for disposal. */
|
|
51
|
+
private disposeListeners;
|
|
52
|
+
/** Listeners for collapsing. */
|
|
53
|
+
private collapseChangeListeners;
|
|
54
|
+
/**
|
|
55
|
+
* Event data for the pointer up event on the resize handle. Used to
|
|
56
|
+
* unregister the listener.
|
|
57
|
+
*/
|
|
58
|
+
private resizePointerUpListener;
|
|
59
|
+
/**
|
|
60
|
+
* Event data for the pointer move event on the resize handle. Used to
|
|
61
|
+
* unregister the listener.
|
|
62
|
+
*/
|
|
63
|
+
private resizePointerMoveListener;
|
|
64
|
+
/** Whether this comment view is currently being disposed or not. */
|
|
65
|
+
private disposing;
|
|
66
|
+
/** Whether this comment view has been disposed or not. */
|
|
67
|
+
private disposed;
|
|
68
|
+
constructor(workspace: WorkspaceSvg);
|
|
69
|
+
/**
|
|
70
|
+
* Creates the rect we use for highlighting the comment when it's selected.
|
|
71
|
+
*/
|
|
72
|
+
private createHighlightRect;
|
|
73
|
+
/**
|
|
74
|
+
* Creates the top bar and the elements visually within it.
|
|
75
|
+
* Registers event listeners.
|
|
76
|
+
*/
|
|
77
|
+
private createTopBar;
|
|
78
|
+
/**
|
|
79
|
+
* Creates the text area where users can type. Registers event listeners.
|
|
80
|
+
*/
|
|
81
|
+
private createTextArea;
|
|
82
|
+
/** Creates the DOM elements for the comment resize handle. */
|
|
83
|
+
private createResizeHandle;
|
|
84
|
+
/** Returns the root SVG group element of the comment view. */
|
|
85
|
+
getSvgRoot(): SVGGElement;
|
|
86
|
+
/** Returns the current size of the comment in workspace units. */
|
|
87
|
+
getSize(): Size;
|
|
88
|
+
/**
|
|
89
|
+
* Sets the size of the comment in workspace units, and updates the view
|
|
90
|
+
* elements to reflect the new size.
|
|
91
|
+
*/
|
|
92
|
+
setSize(size: Size): void;
|
|
93
|
+
/**
|
|
94
|
+
* Calculates the minimum size for the uncollapsed comment based on text
|
|
95
|
+
* size and visible icons.
|
|
96
|
+
*
|
|
97
|
+
* The minimum width is based on the width of the truncated preview text.
|
|
98
|
+
*
|
|
99
|
+
* The minimum height is based on the height of the top bar.
|
|
100
|
+
*/
|
|
101
|
+
private calcMinSize;
|
|
102
|
+
/** Calculates the margin that should exist around the delete icon. */
|
|
103
|
+
private calcDeleteMargin;
|
|
104
|
+
/** Calculates the margin that should exist around the foldout icon. */
|
|
105
|
+
private calcFoldoutMargin;
|
|
106
|
+
/** Updates the size of the highlight rect to reflect the new size. */
|
|
107
|
+
private updateHighlightRect;
|
|
108
|
+
/** Updates the size of the top bar to reflect the new size. */
|
|
109
|
+
private updateTopBarSize;
|
|
110
|
+
/** Updates the size of the text area elements to reflect the new size. */
|
|
111
|
+
private updateTextAreaSize;
|
|
112
|
+
/**
|
|
113
|
+
* Updates the position of the delete icon elements to reflect the new size.
|
|
114
|
+
*/
|
|
115
|
+
private updateDeleteIconPosition;
|
|
116
|
+
/**
|
|
117
|
+
* Updates the position of the foldout icon elements to reflect the new size.
|
|
118
|
+
*/
|
|
119
|
+
private updateFoldoutIconPosition;
|
|
120
|
+
/**
|
|
121
|
+
* Updates the size and position of the text preview elements to reflect the new size.
|
|
122
|
+
*/
|
|
123
|
+
private updateTextPreviewSize;
|
|
124
|
+
/** Updates the position of the resize handle to reflect the new size. */
|
|
125
|
+
private updateResizeHandlePosition;
|
|
126
|
+
/**
|
|
127
|
+
* Triggers listeners when the size of the comment changes, either
|
|
128
|
+
* progrmatically or manually by the user.
|
|
129
|
+
*/
|
|
130
|
+
private onSizeChange;
|
|
131
|
+
/**
|
|
132
|
+
* Registers a callback that listens for size changes.
|
|
133
|
+
*
|
|
134
|
+
* @param listener Receives callbacks when the size of the comment changes.
|
|
135
|
+
* The new and old size are in workspace units.
|
|
136
|
+
*/
|
|
137
|
+
addSizeChangeListener(listener: (oldSize: Size, newSize: Size) => void): void;
|
|
138
|
+
/** Removes the given listener from the list of size change listeners. */
|
|
139
|
+
removeSizeChangeListener(listener: () => void): void;
|
|
140
|
+
/**
|
|
141
|
+
* Handles starting an interaction with the resize handle to resize the
|
|
142
|
+
* comment.
|
|
143
|
+
*/
|
|
144
|
+
private onResizePointerDown;
|
|
145
|
+
/** Ends an interaction with the resize handle. */
|
|
146
|
+
private onResizePointerUp;
|
|
147
|
+
/** Resizes the comment in response to a drag on the resize handle. */
|
|
148
|
+
private onResizePointerMove;
|
|
149
|
+
/** Returns true if the comment is currently collapsed. */
|
|
150
|
+
isCollapsed(): boolean;
|
|
151
|
+
/** Sets whether the comment is currently collapsed or not. */
|
|
152
|
+
setCollapsed(collapsed: boolean): void;
|
|
153
|
+
/**
|
|
154
|
+
* Triggers listeners when the collapsed-ness of the comment changes, either
|
|
155
|
+
* progrmatically or manually by the user.
|
|
156
|
+
*/
|
|
157
|
+
private onCollapse;
|
|
158
|
+
/** Registers a callback that listens for collapsed-ness changes. */
|
|
159
|
+
addOnCollapseListener(listener: (newCollapse: boolean) => void): void;
|
|
160
|
+
/** Removes the given listener from the list of on collapse listeners. */
|
|
161
|
+
removeOnCollapseListener(listener: () => void): void;
|
|
162
|
+
/**
|
|
163
|
+
* Toggles the collapsedness of the block when we receive a pointer down
|
|
164
|
+
* event on the foldout icon.
|
|
165
|
+
*/
|
|
166
|
+
private onFoldoutDown;
|
|
167
|
+
/** Returns true if the comment is currently editable. */
|
|
168
|
+
isEditable(): boolean;
|
|
169
|
+
/** Sets the editability of the comment. */
|
|
170
|
+
setEditable(editable: boolean): void;
|
|
171
|
+
/** Returns the current location of the comment in workspace coordinates. */
|
|
172
|
+
getRelativeToSurfaceXY(): Coordinate;
|
|
173
|
+
/**
|
|
174
|
+
* Moves the comment view to the given location.
|
|
175
|
+
*
|
|
176
|
+
* @param location The location to move to in workspace coordinates.
|
|
177
|
+
*/
|
|
178
|
+
moveTo(location: Coordinate): void;
|
|
179
|
+
/** Retursn the current text of the comment. */
|
|
180
|
+
getText(): string;
|
|
181
|
+
/** Sets the current text of the comment. */
|
|
182
|
+
setText(text: string): void;
|
|
183
|
+
/** Registers a callback that listens for text changes. */
|
|
184
|
+
addTextChangeListener(listener: (oldText: string, newText: string) => void): void;
|
|
185
|
+
/** Removes the given listener from the list of text change listeners. */
|
|
186
|
+
removeTextChangeListener(listener: () => void): void;
|
|
187
|
+
/**
|
|
188
|
+
* Triggers listeners when the text of the comment changes, either
|
|
189
|
+
* progrmatically or manually by the user.
|
|
190
|
+
*/
|
|
191
|
+
private onTextChange;
|
|
192
|
+
/** Updates the preview text element to reflect the given text. */
|
|
193
|
+
private updateTextPreview;
|
|
194
|
+
/** Truncates the text to fit within the top view. */
|
|
195
|
+
private truncateText;
|
|
196
|
+
/** Brings the workspace comment to the front of its layer. */
|
|
197
|
+
private bringToFront;
|
|
198
|
+
/**
|
|
199
|
+
* Handles disposing of the comment when we get a pointer down event on the
|
|
200
|
+
* delete icon.
|
|
201
|
+
*/
|
|
202
|
+
private onDeleteDown;
|
|
203
|
+
/** Disposes of this comment view. */
|
|
204
|
+
dispose(): void;
|
|
205
|
+
/** Returns whether this comment view has been disposed or not. */
|
|
206
|
+
isDisposed(): boolean;
|
|
207
|
+
/**
|
|
208
|
+
* Returns true if this comment view is currently being disposed or has
|
|
209
|
+
* already been disposed.
|
|
210
|
+
*/
|
|
211
|
+
isDeadOrDying(): boolean;
|
|
212
|
+
/** Registers a callback that listens for disposal of this view. */
|
|
213
|
+
addDisposeListener(listener: () => void): void;
|
|
214
|
+
/** Removes the given listener from the list of disposal listeners. */
|
|
215
|
+
removeDisposeListener(listener: () => void): void;
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=comment_view.d.ts.map
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { WorkspaceComment } from './workspace_comment.js';
|
|
7
|
+
import { WorkspaceSvg } from '../workspace_svg.js';
|
|
8
|
+
import { Coordinate } from '../utils/coordinate.js';
|
|
9
|
+
import { Rect } from '../utils/rect.js';
|
|
10
|
+
import { Size } from '../utils/size.js';
|
|
11
|
+
import { IBoundedElement } from '../interfaces/i_bounded_element.js';
|
|
12
|
+
import { IRenderedElement } from '../interfaces/i_rendered_element.js';
|
|
13
|
+
import { IDraggable } from '../interfaces/i_draggable.js';
|
|
14
|
+
import { ISelectable } from '../interfaces/i_selectable.js';
|
|
15
|
+
import { IDeletable } from '../interfaces/i_deletable.js';
|
|
16
|
+
import { ICopyable } from '../interfaces/i_copyable.js';
|
|
17
|
+
import { WorkspaceCommentCopyData } from '../clipboard/workspace_comment_paster.js';
|
|
18
|
+
import { IContextMenu } from '../interfaces/i_contextmenu.js';
|
|
19
|
+
export declare class RenderedWorkspaceComment extends WorkspaceComment implements IBoundedElement, IRenderedElement, IDraggable, ISelectable, IDeletable, ICopyable<WorkspaceCommentCopyData>, IContextMenu {
|
|
20
|
+
/** The class encompassing the svg elements making up the workspace comment. */
|
|
21
|
+
private view;
|
|
22
|
+
readonly workspace: WorkspaceSvg;
|
|
23
|
+
private dragStrategy;
|
|
24
|
+
/** Constructs the workspace comment, including the view. */
|
|
25
|
+
constructor(workspace: WorkspaceSvg, id?: string);
|
|
26
|
+
/**
|
|
27
|
+
* Adds listeners to the view that updates the model (i.e. the superclass)
|
|
28
|
+
* when changes are made to the view.
|
|
29
|
+
*/
|
|
30
|
+
private addModelUpdateBindings;
|
|
31
|
+
/** Sets the text of the comment. */
|
|
32
|
+
setText(text: string): void;
|
|
33
|
+
/** Sets the size of the comment. */
|
|
34
|
+
setSize(size: Size): void;
|
|
35
|
+
/** Sets whether the comment is collapsed or not. */
|
|
36
|
+
setCollapsed(collapsed: boolean): void;
|
|
37
|
+
/** Sets whether the comment is editable or not. */
|
|
38
|
+
setEditable(editable: boolean): void;
|
|
39
|
+
/** Returns the root SVG element of this comment. */
|
|
40
|
+
getSvgRoot(): SVGElement;
|
|
41
|
+
/** Returns the bounding rectangle of this comment in workspace coordinates. */
|
|
42
|
+
getBoundingRectangle(): Rect;
|
|
43
|
+
/** Move the comment by the given amounts in workspace coordinates. */
|
|
44
|
+
moveBy(dx: number, dy: number, reason?: string[] | undefined): void;
|
|
45
|
+
/** Moves the comment to the given location in workspace coordinates. */
|
|
46
|
+
moveTo(location: Coordinate, reason?: string[] | undefined): void;
|
|
47
|
+
/**
|
|
48
|
+
* Moves the comment during a drag. Doesn't fire move events.
|
|
49
|
+
*
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
moveDuringDrag(location: Coordinate): void;
|
|
53
|
+
/**
|
|
54
|
+
* Adds the dragging CSS class to this comment.
|
|
55
|
+
*
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
setDragging(dragging: boolean): void;
|
|
59
|
+
/** Disposes of the view. */
|
|
60
|
+
dispose(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Starts a gesture because we detected a pointer down on the comment
|
|
63
|
+
* (that wasn't otherwise gobbled up, e.g. by resizing).
|
|
64
|
+
*/
|
|
65
|
+
private startGesture;
|
|
66
|
+
/** Visually indicates that this comment would be deleted if dropped. */
|
|
67
|
+
setDeleteStyle(wouldDelete: boolean): void;
|
|
68
|
+
/** Returns whether this comment is movable or not. */
|
|
69
|
+
isMovable(): boolean;
|
|
70
|
+
/** Starts a drag on the comment. */
|
|
71
|
+
startDrag(): void;
|
|
72
|
+
/** Drags the comment to the given location. */
|
|
73
|
+
drag(newLoc: Coordinate): void;
|
|
74
|
+
/** Ends the drag on the comment. */
|
|
75
|
+
endDrag(): void;
|
|
76
|
+
/** Moves the comment back to where it was at the start of a drag. */
|
|
77
|
+
revertDrag(): void;
|
|
78
|
+
/** Visually highlights the comment. */
|
|
79
|
+
select(): void;
|
|
80
|
+
/** Visually unhighlights the comment. */
|
|
81
|
+
unselect(): void;
|
|
82
|
+
/**
|
|
83
|
+
* Returns a JSON serializable representation of this comment's state that
|
|
84
|
+
* can be used for pasting.
|
|
85
|
+
*/
|
|
86
|
+
toCopyData(): WorkspaceCommentCopyData | null;
|
|
87
|
+
/** Show a context menu for this comment. */
|
|
88
|
+
showContextMenu(e: PointerEvent): void;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=rendered_workspace_comment.d.ts.map
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Workspace } from '../workspace.js';
|
|
7
|
+
import { Size } from '../utils/size.js';
|
|
8
|
+
import { Coordinate } from '../utils/coordinate.js';
|
|
9
|
+
export declare class WorkspaceComment {
|
|
10
|
+
readonly workspace: Workspace;
|
|
11
|
+
/** The unique identifier for this comment. */
|
|
12
|
+
readonly id: string;
|
|
13
|
+
/** The text of the comment. */
|
|
14
|
+
private text;
|
|
15
|
+
/** The size of the comment in workspace units. */
|
|
16
|
+
private size;
|
|
17
|
+
/** Whether the comment is collapsed or not. */
|
|
18
|
+
private collapsed;
|
|
19
|
+
/** Whether the comment is editable or not. */
|
|
20
|
+
private editable;
|
|
21
|
+
/** Whether the comment is movable or not. */
|
|
22
|
+
private movable;
|
|
23
|
+
/** Whether the comment is deletable or not. */
|
|
24
|
+
private deletable;
|
|
25
|
+
/** The location of the comment in workspace coordinates. */
|
|
26
|
+
protected location: Coordinate;
|
|
27
|
+
/** Whether this comment has been disposed or not. */
|
|
28
|
+
protected disposed: boolean;
|
|
29
|
+
/** Whether this comment is being disposed or not. */
|
|
30
|
+
protected disposing: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Constructs the comment.
|
|
33
|
+
*
|
|
34
|
+
* @param workspace The workspace to construct the comment in.
|
|
35
|
+
* @param id An optional ID to give to the comment. If not provided, one will
|
|
36
|
+
* be generated.
|
|
37
|
+
*/
|
|
38
|
+
constructor(workspace: Workspace, id?: string);
|
|
39
|
+
private fireCreateEvent;
|
|
40
|
+
private fireDeleteEvent;
|
|
41
|
+
/** Fires a comment change event. */
|
|
42
|
+
private fireChangeEvent;
|
|
43
|
+
/** Fires a comment collapse event. */
|
|
44
|
+
private fireCollapseEvent;
|
|
45
|
+
/** Sets the text of the comment. */
|
|
46
|
+
setText(text: string): void;
|
|
47
|
+
/** Returns the text of the comment. */
|
|
48
|
+
getText(): string;
|
|
49
|
+
/** Sets the comment's size in workspace units. */
|
|
50
|
+
setSize(size: Size): void;
|
|
51
|
+
/** Returns the comment's size in workspace units. */
|
|
52
|
+
getSize(): Size;
|
|
53
|
+
/** Sets whether the comment is collapsed or not. */
|
|
54
|
+
setCollapsed(collapsed: boolean): void;
|
|
55
|
+
/** Returns whether the comment is collapsed or not. */
|
|
56
|
+
isCollapsed(): boolean;
|
|
57
|
+
/** Sets whether the comment is editable or not. */
|
|
58
|
+
setEditable(editable: boolean): void;
|
|
59
|
+
/**
|
|
60
|
+
* Returns whether the comment is editable or not, respecting whether the
|
|
61
|
+
* workspace is read-only.
|
|
62
|
+
*/
|
|
63
|
+
isEditable(): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Returns whether the comment is editable or not, only examining its own
|
|
66
|
+
* state and ignoring the state of the workspace.
|
|
67
|
+
*/
|
|
68
|
+
isOwnEditable(): boolean;
|
|
69
|
+
/** Sets whether the comment is movable or not. */
|
|
70
|
+
setMovable(movable: boolean): void;
|
|
71
|
+
/**
|
|
72
|
+
* Returns whether the comment is movable or not, respecting whether the
|
|
73
|
+
* workspace is read-only.
|
|
74
|
+
*/
|
|
75
|
+
isMovable(): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Returns whether the comment is movable or not, only examining its own
|
|
78
|
+
* state and ignoring the state of the workspace.
|
|
79
|
+
*/
|
|
80
|
+
isOwnMovable(): boolean;
|
|
81
|
+
/** Sets whether the comment is deletable or not. */
|
|
82
|
+
setDeletable(deletable: boolean): void;
|
|
83
|
+
/**
|
|
84
|
+
* Returns whether the comment is deletable or not, respecting whether the
|
|
85
|
+
* workspace is read-only.
|
|
86
|
+
*/
|
|
87
|
+
isDeletable(): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Returns whether the comment is deletable or not, only examining its own
|
|
90
|
+
* state and ignoring the state of the workspace.
|
|
91
|
+
*/
|
|
92
|
+
isOwnDeletable(): boolean;
|
|
93
|
+
/** Moves the comment to the given location in workspace coordinates. */
|
|
94
|
+
moveTo(location: Coordinate, reason?: string[] | undefined): void;
|
|
95
|
+
/** Returns the position of the comment in workspace coordinates. */
|
|
96
|
+
getRelativeToSurfaceXY(): Coordinate;
|
|
97
|
+
/** Disposes of this comment. */
|
|
98
|
+
dispose(): void;
|
|
99
|
+
/** Returns whether the comment has been disposed or not. */
|
|
100
|
+
isDisposed(): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Returns true if this comment view is currently being disposed or has
|
|
103
|
+
* already been disposed.
|
|
104
|
+
*/
|
|
105
|
+
isDeadOrDying(): boolean;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=workspace_comment.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export { CommentView } from './comments/comment_view.js';
|
|
7
|
+
export { WorkspaceComment } from './comments/workspace_comment.js';
|
|
8
|
+
export { RenderedWorkspaceComment } from './comments/rendered_workspace_comment.js';
|
|
9
|
+
//# sourceMappingURL=comments.d.ts.map
|
package/core/connection.d.ts
CHANGED
|
@@ -111,7 +111,7 @@ export declare class Connection implements IASTNodeLocationWithBlock {
|
|
|
111
111
|
* Connect this connection to another connection.
|
|
112
112
|
*
|
|
113
113
|
* @param otherConnection Connection to connect to.
|
|
114
|
-
* @returns Whether the
|
|
114
|
+
* @returns Whether the blocks are now connected or not.
|
|
115
115
|
*/
|
|
116
116
|
connect(otherConnection: Connection): boolean;
|
|
117
117
|
/**
|
package/core/constants.d.ts
CHANGED
|
@@ -11,4 +11,9 @@ export declare const COLLAPSED_INPUT_NAME = "_TEMP_COLLAPSED_INPUT";
|
|
|
11
11
|
* The language-neutral ID given to the collapsed field.
|
|
12
12
|
*/
|
|
13
13
|
export declare const COLLAPSED_FIELD_NAME = "_TEMP_COLLAPSED_FIELD";
|
|
14
|
+
/**
|
|
15
|
+
* The language-neutral ID for when the reason why a block is disabled is
|
|
16
|
+
* because the user manually disabled it, such as via the context menu.
|
|
17
|
+
*/
|
|
18
|
+
export declare const MANUALLY_DISABLED = "MANUALLY_DISABLED";
|
|
14
19
|
//# sourceMappingURL=constants.d.ts.map
|
package/core/contextmenu.d.ts
CHANGED
|
@@ -7,8 +7,6 @@ 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 { WorkspaceCommentSvg } from './workspace_comment_svg.js';
|
|
11
|
-
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
12
10
|
/**
|
|
13
11
|
* Gets the block the context menu is currently attached to.
|
|
14
12
|
*
|
|
@@ -28,7 +26,7 @@ export declare function setCurrentBlock(block: Block | null): void;
|
|
|
28
26
|
* @param options Array of menu options.
|
|
29
27
|
* @param rtl True if RTL, false if LTR.
|
|
30
28
|
*/
|
|
31
|
-
export declare function show(e:
|
|
29
|
+
export declare function show(e: PointerEvent, options: (ContextMenuOption | LegacyContextMenuOption)[], rtl: boolean): void;
|
|
32
30
|
/**
|
|
33
31
|
* Hide the context menu.
|
|
34
32
|
*/
|
|
@@ -46,35 +44,4 @@ export declare function dispose(): void;
|
|
|
46
44
|
* @returns Function that creates a block.
|
|
47
45
|
*/
|
|
48
46
|
export declare function callbackFactory(block: Block, state: Element | serializationBlocks.State): () => BlockSvg;
|
|
49
|
-
/**
|
|
50
|
-
* Make a context menu option for deleting the current workspace comment.
|
|
51
|
-
*
|
|
52
|
-
* @param comment The workspace comment where the
|
|
53
|
-
* right-click originated.
|
|
54
|
-
* @returns A menu option,
|
|
55
|
-
* containing text, enabled, and a callback.
|
|
56
|
-
* @internal
|
|
57
|
-
*/
|
|
58
|
-
export declare function commentDeleteOption(comment: WorkspaceCommentSvg): LegacyContextMenuOption;
|
|
59
|
-
/**
|
|
60
|
-
* Make a context menu option for duplicating the current workspace comment.
|
|
61
|
-
*
|
|
62
|
-
* @param comment The workspace comment where the
|
|
63
|
-
* right-click originated.
|
|
64
|
-
* @returns A menu option,
|
|
65
|
-
* containing text, enabled, and a callback.
|
|
66
|
-
* @internal
|
|
67
|
-
*/
|
|
68
|
-
export declare function commentDuplicateOption(comment: WorkspaceCommentSvg): LegacyContextMenuOption;
|
|
69
|
-
/**
|
|
70
|
-
* Make a context menu option for adding a comment on the workspace.
|
|
71
|
-
*
|
|
72
|
-
* @param ws The workspace where the right-click
|
|
73
|
-
* originated.
|
|
74
|
-
* @param e The right-click mouse event.
|
|
75
|
-
* @returns A menu option, containing text, enabled, and a callback.
|
|
76
|
-
* comments are not bundled in.
|
|
77
|
-
* @internal
|
|
78
|
-
*/
|
|
79
|
-
export declare function workspaceCommentOption(ws: WorkspaceSvg, e: Event): ContextMenuOption;
|
|
80
47
|
//# sourceMappingURL=contextmenu.d.ts.map
|
|
@@ -55,6 +55,14 @@ export declare function registerDelete(): void;
|
|
|
55
55
|
* Option to open help for a block.
|
|
56
56
|
*/
|
|
57
57
|
export declare function registerHelp(): void;
|
|
58
|
+
/** Registers an option for deleting a workspace comment. */
|
|
59
|
+
export declare function registerCommentDelete(): void;
|
|
60
|
+
/** Registers an option for duplicating a workspace comment. */
|
|
61
|
+
export declare function registerCommentDuplicate(): void;
|
|
62
|
+
/** Registers an option for adding a workspace comment to the workspace. */
|
|
63
|
+
export declare function registerCommentCreate(): void;
|
|
64
|
+
/** Registers all workspace comment related menu items. */
|
|
65
|
+
export declare function registerCommentOptions(): void;
|
|
58
66
|
/**
|
|
59
67
|
* Registers all default context menu items. This should be called once per
|
|
60
68
|
* instance of ContextMenuRegistry.
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* @class
|
|
10
10
|
*/
|
|
11
11
|
import type { BlockSvg } from './block_svg.js';
|
|
12
|
+
import { RenderedWorkspaceComment } from './comments/rendered_workspace_comment.js';
|
|
12
13
|
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
13
14
|
/**
|
|
14
15
|
* Class for the registry of context menu items. This is intended to be a
|
|
@@ -63,7 +64,8 @@ export declare namespace ContextMenuRegistry {
|
|
|
63
64
|
*/
|
|
64
65
|
enum ScopeType {
|
|
65
66
|
BLOCK = "block",
|
|
66
|
-
WORKSPACE = "workspace"
|
|
67
|
+
WORKSPACE = "workspace",
|
|
68
|
+
COMMENT = "comment"
|
|
67
69
|
}
|
|
68
70
|
/**
|
|
69
71
|
* The actual workspace/block where the menu is being rendered. This is passed
|
|
@@ -72,12 +74,19 @@ export declare namespace ContextMenuRegistry {
|
|
|
72
74
|
interface Scope {
|
|
73
75
|
block?: BlockSvg;
|
|
74
76
|
workspace?: WorkspaceSvg;
|
|
77
|
+
comment?: RenderedWorkspaceComment;
|
|
75
78
|
}
|
|
76
79
|
/**
|
|
77
80
|
* A menu item as entered in the registry.
|
|
78
81
|
*/
|
|
79
82
|
interface RegistryItem {
|
|
80
|
-
|
|
83
|
+
/**
|
|
84
|
+
* @param scope Object that provides a reference to the thing that had its
|
|
85
|
+
* context menu opened.
|
|
86
|
+
* @param e The original event that triggered the context menu to open. Not
|
|
87
|
+
* the event that triggered the click on the option.
|
|
88
|
+
*/
|
|
89
|
+
callback: (scope: Scope, e: PointerEvent) => void;
|
|
81
90
|
scopeType: ScopeType;
|
|
82
91
|
displayText: ((p1: Scope) => string | HTMLElement) | string | HTMLElement;
|
|
83
92
|
preconditionFn: (p1: Scope) => string;
|
|
@@ -90,7 +99,13 @@ export declare namespace ContextMenuRegistry {
|
|
|
90
99
|
interface ContextMenuOption {
|
|
91
100
|
text: string | HTMLElement;
|
|
92
101
|
enabled: boolean;
|
|
93
|
-
|
|
102
|
+
/**
|
|
103
|
+
* @param scope Object that provides a reference to the thing that had its
|
|
104
|
+
* context menu opened.
|
|
105
|
+
* @param e The original event that triggered the context menu to open. Not
|
|
106
|
+
* the event that triggered the click on the option.
|
|
107
|
+
*/
|
|
108
|
+
callback: (scope: Scope, e: PointerEvent) => void;
|
|
94
109
|
scope: Scope;
|
|
95
110
|
weight: number;
|
|
96
111
|
}
|
package/core/delete_area.d.ts
CHANGED
|
@@ -34,11 +34,10 @@ export declare class DeleteArea extends DragTarget implements IDeleteArea {
|
|
|
34
34
|
* before onDragEnter/onDragOver/onDragExit.
|
|
35
35
|
*
|
|
36
36
|
* @param element The block or bubble currently being dragged.
|
|
37
|
-
* @param couldConnect Whether the element could could connect to another.
|
|
38
37
|
* @returns Whether the element provided would be deleted if dropped on this
|
|
39
38
|
* area.
|
|
40
39
|
*/
|
|
41
|
-
wouldDelete(element: IDraggable
|
|
40
|
+
wouldDelete(element: IDraggable): boolean;
|
|
42
41
|
/**
|
|
43
42
|
* Updates the internal wouldDelete_ state.
|
|
44
43
|
*
|