blockly 11.0.0-beta.0 → 11.0.0-beta.10
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 +17 -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.d.ts +1 -1
- 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.d.ts +1 -1
- package/javascript.js +4 -23
- package/javascript_compressed.js +19 -54
- package/javascript_compressed.js.map +1 -1
- package/lua.d.ts +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.d.ts +1 -1
- package/php.js +4 -22
- package/php_compressed.js +13 -46
- package/php_compressed.js.map +1 -1
- package/python.d.ts +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
package/core/block.d.ts
CHANGED
|
@@ -17,8 +17,7 @@ import type { Abstract } from './events/events_abstract.js';
|
|
|
17
17
|
import type { Field } from './field.js';
|
|
18
18
|
import { Input } from './inputs/input.js';
|
|
19
19
|
import type { IASTNodeLocation } from './interfaces/i_ast_node_location.js';
|
|
20
|
-
import type
|
|
21
|
-
import type { IIcon } from './interfaces/i_icon.js';
|
|
20
|
+
import { type IIcon } from './interfaces/i_icon.js';
|
|
22
21
|
import type { MutatorIcon } from './icons/mutator_icon.js';
|
|
23
22
|
import * as Tooltip from './tooltip.js';
|
|
24
23
|
import { Coordinate } from './utils/coordinate.js';
|
|
@@ -30,7 +29,7 @@ import { IconType } from './icons/icon_types.js';
|
|
|
30
29
|
* Class for one block.
|
|
31
30
|
* Not normally called directly, workspace.newBlock() is preferred.
|
|
32
31
|
*/
|
|
33
|
-
export declare class Block implements IASTNodeLocation
|
|
32
|
+
export declare class Block implements IASTNodeLocation {
|
|
34
33
|
/**
|
|
35
34
|
* An optional callback method to use whenever the block's parent workspace
|
|
36
35
|
* changes. This is usually only called from the constructor, the block type
|
|
@@ -124,7 +123,7 @@ export declare class Block implements IASTNodeLocation, IDeletable {
|
|
|
124
123
|
inputList: Input[];
|
|
125
124
|
inputsInline?: boolean;
|
|
126
125
|
icons: IIcon[];
|
|
127
|
-
private
|
|
126
|
+
private disabledReasons;
|
|
128
127
|
tooltip: Tooltip.TipInfo;
|
|
129
128
|
contextMenu: boolean;
|
|
130
129
|
protected parentBlock_: this | null;
|
|
@@ -138,7 +137,13 @@ export declare class Block implements IASTNodeLocation, IDeletable {
|
|
|
138
137
|
/**
|
|
139
138
|
* Is the current block currently in the process of being disposed?
|
|
140
139
|
*/
|
|
141
|
-
|
|
140
|
+
protected disposing: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Has this block been fully initialized? E.g. all fields initailized.
|
|
143
|
+
*
|
|
144
|
+
* @internal
|
|
145
|
+
*/
|
|
146
|
+
initialized: boolean;
|
|
142
147
|
private readonly xy_;
|
|
143
148
|
isInFlyout: boolean;
|
|
144
149
|
isInMutator: boolean;
|
|
@@ -147,7 +152,8 @@ export declare class Block implements IASTNodeLocation, IDeletable {
|
|
|
147
152
|
protected isInsertionMarker_: boolean;
|
|
148
153
|
/** Name of the type of hat. */
|
|
149
154
|
hat?: string;
|
|
150
|
-
|
|
155
|
+
/** Is this block a BlockSVG? */
|
|
156
|
+
readonly rendered: boolean;
|
|
151
157
|
/**
|
|
152
158
|
* String for block help, or function that returns a URL. Null for no help.
|
|
153
159
|
*/
|
|
@@ -181,7 +187,7 @@ export declare class Block implements IASTNodeLocation, IDeletable {
|
|
|
181
187
|
* statement with the previous statement. Otherwise, dispose of all
|
|
182
188
|
* children of this block.
|
|
183
189
|
*/
|
|
184
|
-
dispose(healStack
|
|
190
|
+
dispose(healStack?: boolean): void;
|
|
185
191
|
/**
|
|
186
192
|
* Disposes of this block without doing things required by the top block.
|
|
187
193
|
* E.g. does not fire events, unplug the block, etc.
|
|
@@ -621,17 +627,44 @@ export declare class Block implements IASTNodeLocation, IDeletable {
|
|
|
621
627
|
*/
|
|
622
628
|
getOutputShape(): number | null;
|
|
623
629
|
/**
|
|
624
|
-
* Get whether this block is enabled or not.
|
|
630
|
+
* Get whether this block is enabled or not. A block is considered enabled
|
|
631
|
+
* if there aren't any reasons why it would be disabled. A block may still
|
|
632
|
+
* be disabled for other reasons even if the user attempts to manually
|
|
633
|
+
* enable it, such as when the block is in an invalid location.
|
|
625
634
|
*
|
|
626
635
|
* @returns True if enabled.
|
|
627
636
|
*/
|
|
628
637
|
isEnabled(): boolean;
|
|
629
|
-
/**
|
|
630
|
-
|
|
638
|
+
/** @deprecated v11 - Get whether the block is manually disabled. */
|
|
639
|
+
private get disabled();
|
|
640
|
+
/** @deprecated v11 - Set whether the block is manually disabled. */
|
|
641
|
+
private set disabled(value);
|
|
642
|
+
/**
|
|
643
|
+
* @deprecated v11 - Set whether the block is manually enabled or disabled.
|
|
644
|
+
* The user can toggle whether a block is disabled from a context menu
|
|
645
|
+
* option. A block may still be disabled for other reasons even if the user
|
|
646
|
+
* attempts to manually enable it, such as when the block is in an invalid
|
|
647
|
+
* location. This method is deprecated and setDisabledReason should be used
|
|
648
|
+
* instead.
|
|
631
649
|
*
|
|
632
650
|
* @param enabled True if enabled.
|
|
633
651
|
*/
|
|
634
652
|
setEnabled(enabled: boolean): void;
|
|
653
|
+
/**
|
|
654
|
+
* Add or remove a reason why the block might be disabled. If a block has
|
|
655
|
+
* any reasons to be disabled, then the block itself will be considered
|
|
656
|
+
* disabled. A block could be disabled for multiple independent reasons
|
|
657
|
+
* simultaneously, such as when the user manually disables it, or the block
|
|
658
|
+
* is invalid.
|
|
659
|
+
*
|
|
660
|
+
* @param disabled If true, then the block should be considered disabled for
|
|
661
|
+
* at least the provided reason, otherwise the block is no longer disabled
|
|
662
|
+
* for that reason.
|
|
663
|
+
* @param reason A language-neutral identifier for a reason why the block
|
|
664
|
+
* could be disabled. Call this method again with the same identifier to
|
|
665
|
+
* update whether the block is currently disabled for this reason.
|
|
666
|
+
*/
|
|
667
|
+
setDisabledReason(disabled: boolean, reason: string): void;
|
|
635
668
|
/**
|
|
636
669
|
* Get whether the block is disabled or not due to parents.
|
|
637
670
|
* The block's own disabled property is not considered.
|
|
@@ -639,6 +672,21 @@ export declare class Block implements IASTNodeLocation, IDeletable {
|
|
|
639
672
|
* @returns True if disabled.
|
|
640
673
|
*/
|
|
641
674
|
getInheritedDisabled(): boolean;
|
|
675
|
+
/**
|
|
676
|
+
* Get whether the block is currently disabled for the provided reason.
|
|
677
|
+
*
|
|
678
|
+
* @param reason A language-neutral identifier for a reason why the block
|
|
679
|
+
* could be disabled.
|
|
680
|
+
* @returns Whether the block is disabled for the provided reason.
|
|
681
|
+
*/
|
|
682
|
+
hasDisabledReason(reason: string): boolean;
|
|
683
|
+
/**
|
|
684
|
+
* Get a set of reasons why the block is currently disabled, if any. If the
|
|
685
|
+
* block is enabled, this set will be empty.
|
|
686
|
+
*
|
|
687
|
+
* @returns The set of reasons why the block is disabled, if any.
|
|
688
|
+
*/
|
|
689
|
+
getDisabledReasons(): ReadonlySet<string>;
|
|
642
690
|
/**
|
|
643
691
|
* Get whether the block is collapsed or not.
|
|
644
692
|
*
|
package/core/block_svg.d.ts
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import './events/events_selected.js';
|
|
12
12
|
import { Block } from './block.js';
|
|
13
|
-
import { CommentIcon } from './icons/comment_icon.js';
|
|
14
13
|
import type { Connection } from './connection.js';
|
|
15
14
|
import { ConnectionType } from './connection_type.js';
|
|
16
15
|
import { ContextMenuOption, LegacyContextMenuOption } from './contextmenu_registry.js';
|
|
@@ -19,7 +18,7 @@ import type { Input } from './inputs/input.js';
|
|
|
19
18
|
import type { IASTNodeLocationSvg } from './interfaces/i_ast_node_location_svg.js';
|
|
20
19
|
import type { IBoundedElement } from './interfaces/i_bounded_element.js';
|
|
21
20
|
import type { ICopyable } from './interfaces/i_copyable.js';
|
|
22
|
-
import type { IDraggable } from './interfaces/i_draggable.js';
|
|
21
|
+
import type { IDragStrategy, IDraggable } from './interfaces/i_draggable.js';
|
|
23
22
|
import { IIcon } from './interfaces/i_icon.js';
|
|
24
23
|
import { MutatorIcon } from './icons/mutator_icon.js';
|
|
25
24
|
import { RenderedConnection } from './rendered_connection.js';
|
|
@@ -27,16 +26,17 @@ import type { IPathObject } from './renderers/common/i_path_object.js';
|
|
|
27
26
|
import type { BlockStyle } from './theme.js';
|
|
28
27
|
import { Coordinate } from './utils/coordinate.js';
|
|
29
28
|
import { Rect } from './utils/rect.js';
|
|
30
|
-
import { WarningIcon } from './icons/warning_icon.js';
|
|
31
29
|
import type { Workspace } from './workspace.js';
|
|
32
30
|
import type { WorkspaceSvg } from './workspace_svg.js';
|
|
33
31
|
import { IconType } from './icons/icon_types.js';
|
|
34
32
|
import { BlockCopyData } from './clipboard/block_paster.js';
|
|
33
|
+
import { IDeletable } from './blockly.js';
|
|
34
|
+
import { FlyoutItemInfo } from './utils/toolbox.js';
|
|
35
35
|
/**
|
|
36
36
|
* Class for a block's SVG representation.
|
|
37
37
|
* Not normally called directly, workspace.newBlock() is preferred.
|
|
38
38
|
*/
|
|
39
|
-
export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBoundedElement, ICopyable<BlockCopyData>, IDraggable {
|
|
39
|
+
export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBoundedElement, ICopyable<BlockCopyData>, IDraggable, IDeletable {
|
|
40
40
|
/**
|
|
41
41
|
* Constant for identifying rows that are to be rendered inline.
|
|
42
42
|
* Don't collide with Blockly.inputTypes.
|
|
@@ -68,17 +68,12 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
68
68
|
private warningTextDb;
|
|
69
69
|
/** Block's mutator icon (if any). */
|
|
70
70
|
mutator: MutatorIcon | null;
|
|
71
|
-
/**
|
|
72
|
-
* Block's warning icon (if any).
|
|
73
|
-
*
|
|
74
|
-
* @deprecated Use `setWarningText` to modify warnings on this block.
|
|
75
|
-
*/
|
|
76
|
-
warning: WarningIcon | null;
|
|
77
71
|
private svgGroup_;
|
|
78
72
|
style: BlockStyle;
|
|
79
73
|
/** @internal */
|
|
80
74
|
pathObject: IPathObject;
|
|
81
|
-
|
|
75
|
+
/** Is this block a BlockSVG? */
|
|
76
|
+
readonly rendered = true;
|
|
82
77
|
private visuallyDisabled;
|
|
83
78
|
/**
|
|
84
79
|
* Is this block currently rendering? Used to stop recursive render calls
|
|
@@ -92,11 +87,6 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
92
87
|
nextConnection: RenderedConnection;
|
|
93
88
|
previousConnection: RenderedConnection;
|
|
94
89
|
private translation;
|
|
95
|
-
/**
|
|
96
|
-
* The ID of the setTimeout callback for bumping neighbours, or 0 if no bump
|
|
97
|
-
* is currently scheduled.
|
|
98
|
-
*/
|
|
99
|
-
private bumpNeighboursPid;
|
|
100
90
|
/** Whether this block is currently being dragged. */
|
|
101
91
|
private dragging;
|
|
102
92
|
/**
|
|
@@ -107,6 +97,7 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
107
97
|
* @internal
|
|
108
98
|
*/
|
|
109
99
|
relativeCoords: Coordinate;
|
|
100
|
+
private dragStrategy;
|
|
110
101
|
/**
|
|
111
102
|
* @param workspace The block's workspace.
|
|
112
103
|
* @param prototypeName Name of the language object containing type-specific
|
|
@@ -132,15 +123,9 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
132
123
|
* @returns #RRGGBB string.
|
|
133
124
|
*/
|
|
134
125
|
getColourTertiary(): string | undefined;
|
|
135
|
-
/**
|
|
136
|
-
* Selects this block. Highlights the block visually and fires a select event
|
|
137
|
-
* if the block is not already selected.
|
|
138
|
-
*/
|
|
126
|
+
/** Selects this block. Highlights the block visually. */
|
|
139
127
|
select(): void;
|
|
140
|
-
/**
|
|
141
|
-
* Unselects this block. Unhighlights the block and fires a select (false)
|
|
142
|
-
* event if the block is currently selected.
|
|
143
|
-
*/
|
|
128
|
+
/** Unselects this block. Unhighlights the blockv visually. */
|
|
144
129
|
unselect(): void;
|
|
145
130
|
/**
|
|
146
131
|
* Sets the parent of this block to be a new block or null.
|
|
@@ -253,7 +238,7 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
253
238
|
* @param e Mouse event.
|
|
254
239
|
* @internal
|
|
255
240
|
*/
|
|
256
|
-
showContextMenu(e:
|
|
241
|
+
showContextMenu(e: PointerEvent): void;
|
|
257
242
|
/**
|
|
258
243
|
* Updates the locations of any parts of the block that need to know where
|
|
259
244
|
* they are (e.g. connections, icons).
|
|
@@ -349,14 +334,6 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
349
334
|
* @internal
|
|
350
335
|
*/
|
|
351
336
|
updateDisabled(): void;
|
|
352
|
-
/**
|
|
353
|
-
* Get the comment icon attached to this block, or null if the block has no
|
|
354
|
-
* comment.
|
|
355
|
-
*
|
|
356
|
-
* @returns The comment icon attached to this block, or null.
|
|
357
|
-
* @deprecated Use getIcon. To be remove in v11.
|
|
358
|
-
*/
|
|
359
|
-
getCommentIcon(): CommentIcon | null;
|
|
360
337
|
/**
|
|
361
338
|
* Set this block's warning text.
|
|
362
339
|
*
|
|
@@ -379,11 +356,31 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
379
356
|
private createIconPointerDownListener;
|
|
380
357
|
removeIcon(type: IconType<IIcon>): boolean;
|
|
381
358
|
/**
|
|
382
|
-
* Set whether the block is enabled or
|
|
359
|
+
* @deprecated v11 - Set whether the block is manually enabled or disabled.
|
|
360
|
+
* The user can toggle whether a block is disabled from a context menu
|
|
361
|
+
* option. A block may still be disabled for other reasons even if the user
|
|
362
|
+
* attempts to manually enable it, such as when the block is in an invalid
|
|
363
|
+
* location. This method is deprecated and setDisabledReason should be used
|
|
364
|
+
* instead.
|
|
383
365
|
*
|
|
384
366
|
* @param enabled True if enabled.
|
|
385
367
|
*/
|
|
386
368
|
setEnabled(enabled: boolean): void;
|
|
369
|
+
/**
|
|
370
|
+
* Add or remove a reason why the block might be disabled. If a block has
|
|
371
|
+
* any reasons to be disabled, then the block itself will be considered
|
|
372
|
+
* disabled. A block could be disabled for multiple independent reasons
|
|
373
|
+
* simultaneously, such as when the user manually disables it, or the block
|
|
374
|
+
* is invalid.
|
|
375
|
+
*
|
|
376
|
+
* @param disabled If true, then the block should be considered disabled for
|
|
377
|
+
* at least the provided reason, otherwise the block is no longer disabled
|
|
378
|
+
* for that reason.
|
|
379
|
+
* @param reason A language-neutral identifier for a reason why the block
|
|
380
|
+
* could be disabled. Call this method again with the same identifier to
|
|
381
|
+
* update whether the block is currently disabled for this reason.
|
|
382
|
+
*/
|
|
383
|
+
setDisabledReason(disabled: boolean, reason: string): void;
|
|
387
384
|
/**
|
|
388
385
|
* Set whether the block is highlighted or not. Block highlighting is
|
|
389
386
|
* often used to visually mark blocks currently being executed.
|
|
@@ -506,8 +503,7 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
506
503
|
* Returns connections originating from this block.
|
|
507
504
|
*
|
|
508
505
|
* @param all If true, return all connections even hidden ones.
|
|
509
|
-
* Otherwise, for a
|
|
510
|
-
* collapsed block don't return inputs connections.
|
|
506
|
+
* Otherwise, for a collapsed block don't return inputs connections.
|
|
511
507
|
* @returns Array of connections.
|
|
512
508
|
* @internal
|
|
513
509
|
*/
|
|
@@ -562,14 +558,8 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
562
558
|
*/
|
|
563
559
|
bumpNeighbours(): void;
|
|
564
560
|
/**
|
|
565
|
-
*
|
|
566
|
-
|
|
567
|
-
private bumpNeighboursInternal;
|
|
568
|
-
/**
|
|
569
|
-
* Schedule snapping to grid and bumping neighbours to occur after a brief
|
|
570
|
-
* delay.
|
|
571
|
-
*
|
|
572
|
-
* @internal
|
|
561
|
+
* Snap to grid, and then bump neighbouring blocks away at the end of the next
|
|
562
|
+
* render.
|
|
573
563
|
*/
|
|
574
564
|
scheduleSnapAndBump(): void;
|
|
575
565
|
/**
|
|
@@ -674,5 +664,21 @@ export declare class BlockSvg extends Block implements IASTNodeLocationSvg, IBou
|
|
|
674
664
|
* @internal
|
|
675
665
|
*/
|
|
676
666
|
highlightShapeForInput(conn: RenderedConnection, add: boolean): void;
|
|
667
|
+
/** Sets the drag strategy for this block. */
|
|
668
|
+
setDragStrategy(dragStrategy: IDragStrategy): void;
|
|
669
|
+
/** Returns whether this block is movable or not. */
|
|
670
|
+
isMovable(): boolean;
|
|
671
|
+
/** Starts a drag on the block. */
|
|
672
|
+
startDrag(e?: PointerEvent): void;
|
|
673
|
+
/** Drags the block to the given location. */
|
|
674
|
+
drag(newLoc: Coordinate, e?: PointerEvent): void;
|
|
675
|
+
/** Ends the drag on the block. */
|
|
676
|
+
endDrag(e?: PointerEvent): void;
|
|
677
|
+
/** Moves the block back to where it was at the start of a drag. */
|
|
678
|
+
revertDrag(): void;
|
|
679
|
+
/**
|
|
680
|
+
* Returns a representation of this block that can be displayed in a flyout.
|
|
681
|
+
*/
|
|
682
|
+
toFlyoutInfo(): FlyoutItemInfo[];
|
|
677
683
|
}
|
|
678
684
|
//# sourceMappingURL=block_svg.d.ts.map
|
package/core/blockly.d.ts
CHANGED
|
@@ -9,14 +9,11 @@ import './events/events_ui_base.js';
|
|
|
9
9
|
import './events/events_var_create.js';
|
|
10
10
|
import { Block } from './block.js';
|
|
11
11
|
import * as blockAnimations from './block_animations.js';
|
|
12
|
-
import { BlockDragger } from './block_dragger.js';
|
|
13
12
|
import { BlockSvg } from './block_svg.js';
|
|
14
13
|
import { BlocklyOptions } from './blockly_options.js';
|
|
15
14
|
import { Blocks } from './blocks.js';
|
|
16
15
|
import * as browserEvents from './browser_events.js';
|
|
17
|
-
import { Bubble } from './bubbles/bubble.js';
|
|
18
16
|
import * as bubbles from './bubbles.js';
|
|
19
|
-
import { BubbleDragger } from './bubble_dragger.js';
|
|
20
17
|
import * as bumpObjects from './bump_objects.js';
|
|
21
18
|
import * as clipboard from './clipboard.js';
|
|
22
19
|
import * as common from './common.js';
|
|
@@ -29,22 +26,21 @@ import { ConnectionType } from './connection_type.js';
|
|
|
29
26
|
import * as ContextMenu from './contextmenu.js';
|
|
30
27
|
import * as ContextMenuItems from './contextmenu_items.js';
|
|
31
28
|
import { ContextMenuRegistry } from './contextmenu_registry.js';
|
|
29
|
+
import * as comments from './comments.js';
|
|
32
30
|
import * as Css from './css.js';
|
|
33
31
|
import { DeleteArea } from './delete_area.js';
|
|
34
32
|
import * as dialog from './dialog.js';
|
|
33
|
+
import * as dragging from './dragging.js';
|
|
35
34
|
import { DragTarget } from './drag_target.js';
|
|
36
35
|
import * as dropDownDiv from './dropdowndiv.js';
|
|
37
36
|
import * as Events from './events/events.js';
|
|
38
37
|
import * as Extensions from './extensions.js';
|
|
39
38
|
import { Field, FieldConfig, FieldValidator, UnattachedFieldError } from './field.js';
|
|
40
|
-
import { FieldAngle, FieldAngleConfig, FieldAngleFromJsonConfig, FieldAngleValidator } from './field_angle.js';
|
|
41
39
|
import { FieldCheckbox, FieldCheckboxConfig, FieldCheckboxFromJsonConfig, FieldCheckboxValidator } from './field_checkbox.js';
|
|
42
|
-
import { FieldColour, FieldColourConfig, FieldColourFromJsonConfig, FieldColourValidator } from './field_colour.js';
|
|
43
40
|
import { FieldDropdown, FieldDropdownConfig, FieldDropdownFromJsonConfig, FieldDropdownValidator, MenuGenerator, MenuGeneratorFunction, MenuOption } from './field_dropdown.js';
|
|
44
41
|
import { FieldImage, FieldImageConfig, FieldImageFromJsonConfig } from './field_image.js';
|
|
45
42
|
import { FieldLabel, FieldLabelConfig, FieldLabelFromJsonConfig } from './field_label.js';
|
|
46
43
|
import { FieldLabelSerializable } from './field_label_serializable.js';
|
|
47
|
-
import { FieldMultilineInput, FieldMultilineInputConfig, FieldMultilineInputFromJsonConfig, FieldMultilineInputValidator } from './field_multilineinput.js';
|
|
48
44
|
import { FieldNumber, FieldNumberConfig, FieldNumberFromJsonConfig, FieldNumberValidator } from './field_number.js';
|
|
49
45
|
import * as fieldRegistry from './field_registry.js';
|
|
50
46
|
import { FieldTextInput, FieldTextInputConfig, FieldTextInputFromJsonConfig, FieldTextInputValidator } from './field_textinput.js';
|
|
@@ -59,27 +55,27 @@ import { Gesture } from './gesture.js';
|
|
|
59
55
|
import { Grid } from './grid.js';
|
|
60
56
|
import * as icons from './icons.js';
|
|
61
57
|
import { inject } from './inject.js';
|
|
62
|
-
import { Align } from './inputs/align.js';
|
|
63
58
|
import { Input } from './inputs/input.js';
|
|
64
|
-
import { inputTypes } from './inputs/input_types.js';
|
|
65
59
|
import * as inputs from './inputs.js';
|
|
66
60
|
import { InsertionMarkerManager } from './insertion_marker_manager.js';
|
|
61
|
+
import { InsertionMarkerPreviewer } from './insertion_marker_previewer.js';
|
|
67
62
|
import { IASTNodeLocation } from './interfaces/i_ast_node_location.js';
|
|
68
63
|
import { IASTNodeLocationSvg } from './interfaces/i_ast_node_location_svg.js';
|
|
69
64
|
import { IASTNodeLocationWithBlock } from './interfaces/i_ast_node_location_with_block.js';
|
|
70
65
|
import { IAutoHideable } from './interfaces/i_autohideable.js';
|
|
71
|
-
import { IBlockDragger } from './interfaces/i_block_dragger.js';
|
|
72
66
|
import { IBoundedElement } from './interfaces/i_bounded_element.js';
|
|
73
67
|
import { IBubble } from './interfaces/i_bubble.js';
|
|
74
68
|
import { ICollapsibleToolboxItem } from './interfaces/i_collapsible_toolbox_item.js';
|
|
75
69
|
import { IComponent } from './interfaces/i_component.js';
|
|
76
70
|
import { IConnectionChecker } from './interfaces/i_connection_checker.js';
|
|
71
|
+
import { IConnectionPreviewer } from './interfaces/i_connection_previewer.js';
|
|
77
72
|
import { IContextMenu } from './interfaces/i_contextmenu.js';
|
|
78
|
-
import { ICopyable, isCopyable } from './interfaces/i_copyable.js';
|
|
79
|
-
import { IDeletable } from './interfaces/i_deletable.js';
|
|
73
|
+
import { ICopyable, isCopyable, ICopyData } from './interfaces/i_copyable.js';
|
|
74
|
+
import { IDeletable, isDeletable } from './interfaces/i_deletable.js';
|
|
80
75
|
import { IDeleteArea } from './interfaces/i_delete_area.js';
|
|
81
76
|
import { IDragTarget } from './interfaces/i_drag_target.js';
|
|
82
|
-
import {
|
|
77
|
+
import { IDragger } from './interfaces/i_dragger.js';
|
|
78
|
+
import { IDraggable, isDraggable, IDragStrategy } from './interfaces/i_draggable.js';
|
|
83
79
|
import { IFlyout } from './interfaces/i_flyout.js';
|
|
84
80
|
import { IHasBubble, hasBubble } from './interfaces/i_has_bubble.js';
|
|
85
81
|
import { IIcon, isIcon } from './interfaces/i_icon.js';
|
|
@@ -90,7 +86,8 @@ import { IObservable, isObservable } from './interfaces/i_observable.js';
|
|
|
90
86
|
import { IPaster, isPaster } from './interfaces/i_paster.js';
|
|
91
87
|
import { IPositionable } from './interfaces/i_positionable.js';
|
|
92
88
|
import { IRegistrable } from './interfaces/i_registrable.js';
|
|
93
|
-
import {
|
|
89
|
+
import { IRenderedElement, isRenderedElement } from './interfaces/i_rendered_element.js';
|
|
90
|
+
import { ISelectable, isSelectable } from './interfaces/i_selectable.js';
|
|
94
91
|
import { ISelectableToolboxItem } from './interfaces/i_selectable_toolbox_item.js';
|
|
95
92
|
import { ISerializable, isSerializable } from './interfaces/i_serializable.js';
|
|
96
93
|
import { IStyleable } from './interfaces/i_styleable.js';
|
|
@@ -103,6 +100,7 @@ import { Cursor } from './keyboard_nav/cursor.js';
|
|
|
103
100
|
import { Marker } from './keyboard_nav/marker.js';
|
|
104
101
|
import { TabNavigateCursor } from './keyboard_nav/tab_navigate_cursor.js';
|
|
105
102
|
import { MarkerManager } from './marker_manager.js';
|
|
103
|
+
import type { LayerManager } from './layer_manager.js';
|
|
106
104
|
import { Menu } from './menu.js';
|
|
107
105
|
import { MenuItem } from './menuitem.js';
|
|
108
106
|
import { MetricsManager } from './metrics_manager.js';
|
|
@@ -117,7 +115,6 @@ import * as renderManagement from './render_management.js';
|
|
|
117
115
|
import * as blockRendering from './renderers/common/block_rendering.js';
|
|
118
116
|
import * as constants from './constants.js';
|
|
119
117
|
import * as geras from './renderers/geras/geras.js';
|
|
120
|
-
import * as minimalist from './renderers/minimalist/minimalist.js';
|
|
121
118
|
import * as thrasos from './renderers/thrasos/thrasos.js';
|
|
122
119
|
import * as zelos from './renderers/zelos/zelos.js';
|
|
123
120
|
import { Scrollbar } from './scrollbar.js';
|
|
@@ -144,8 +141,6 @@ import * as VariablesDynamic from './variables_dynamic.js';
|
|
|
144
141
|
import * as WidgetDiv from './widgetdiv.js';
|
|
145
142
|
import { Workspace } from './workspace.js';
|
|
146
143
|
import { WorkspaceAudio } from './workspace_audio.js';
|
|
147
|
-
import { WorkspaceComment } from './workspace_comment.js';
|
|
148
|
-
import { WorkspaceCommentSvg } from './workspace_comment_svg.js';
|
|
149
144
|
import { WorkspaceDragger } from './workspace_dragger.js';
|
|
150
145
|
import { WorkspaceSvg } from './workspace_svg.js';
|
|
151
146
|
import * as Xml from './xml.js';
|
|
@@ -161,21 +156,6 @@ import { ZoomControls } from './zoom_controls.js';
|
|
|
161
156
|
* @define {string}
|
|
162
157
|
*/
|
|
163
158
|
export declare const VERSION = "uncompiled";
|
|
164
|
-
/**
|
|
165
|
-
* @see Blockly.Input.Align.LEFT
|
|
166
|
-
* @deprecated Use `Blockly.inputs.Align.LEFT`. To be removed in v11.
|
|
167
|
-
*/
|
|
168
|
-
export declare const ALIGN_LEFT = Align.LEFT;
|
|
169
|
-
/**
|
|
170
|
-
* @see Blockly.Input.Align.CENTRE
|
|
171
|
-
* @deprecated Use `Blockly.inputs.Align.CENTER`. To be removed in v11.
|
|
172
|
-
*/
|
|
173
|
-
export declare const ALIGN_CENTRE = Align.CENTRE;
|
|
174
|
-
/**
|
|
175
|
-
* @see Blockly.Input.Align.RIGHT
|
|
176
|
-
* @deprecated Use `Blockly.inputs.Align.RIGHT`. To be removed in v11.
|
|
177
|
-
*/
|
|
178
|
-
export declare const ALIGN_RIGHT = Align.RIGHT;
|
|
179
159
|
/**
|
|
180
160
|
* @see ConnectionType.INPUT_VALUE
|
|
181
161
|
*/
|
|
@@ -192,11 +172,6 @@ export declare const NEXT_STATEMENT = ConnectionType.NEXT_STATEMENT;
|
|
|
192
172
|
* @see ConnectionType.PREVIOUS_STATEMENT
|
|
193
173
|
*/
|
|
194
174
|
export declare const PREVIOUS_STATEMENT = ConnectionType.PREVIOUS_STATEMENT;
|
|
195
|
-
/**
|
|
196
|
-
* @see inputTypes.DUMMY_INPUT
|
|
197
|
-
* @deprecated Use `Blockly.inputs.inputTypes.DUMMY`. To be removed in v11.
|
|
198
|
-
*/
|
|
199
|
-
export declare const DUMMY_INPUT = inputTypes.DUMMY;
|
|
200
175
|
/** Aliases for toolbox positions. */
|
|
201
176
|
/**
|
|
202
177
|
* @see toolbox.Position.TOP
|
|
@@ -263,7 +238,6 @@ export declare const defineBlocksWithJsonArray: typeof common.defineBlocksWithJs
|
|
|
263
238
|
*/
|
|
264
239
|
export declare const setParentContainer: typeof common.setParentContainer;
|
|
265
240
|
export declare const COLLAPSE_CHARS = 30;
|
|
266
|
-
export declare const DRAG_STACK = true;
|
|
267
241
|
export declare const OPPOSITE_TYPE: number[];
|
|
268
242
|
export declare const RENAME_VARIABLE_ID = "RENAME_VARIABLE_ID";
|
|
269
243
|
export declare const DELETE_VARIABLE_ID = "DELETE_VARIABLE_ID";
|
|
@@ -312,7 +286,6 @@ export { constants };
|
|
|
312
286
|
export { dialog };
|
|
313
287
|
export { fieldRegistry };
|
|
314
288
|
export { geras };
|
|
315
|
-
export { minimalist };
|
|
316
289
|
export { registry };
|
|
317
290
|
export { thrasos };
|
|
318
291
|
export { uiPosition };
|
|
@@ -322,13 +295,9 @@ export { ASTNode };
|
|
|
322
295
|
export { BasicCursor };
|
|
323
296
|
export { Block };
|
|
324
297
|
export { BlocklyOptions };
|
|
325
|
-
export { BlockDragger };
|
|
326
298
|
export { BlockSvg };
|
|
327
299
|
export { Blocks };
|
|
328
300
|
export { bubbles };
|
|
329
|
-
/** @deprecated Use Blockly.bubbles.Bubble instead. To be removed in v11. */
|
|
330
|
-
export { Bubble };
|
|
331
|
-
export { BubbleDragger };
|
|
332
301
|
export { CollapsibleToolboxCategory };
|
|
333
302
|
export { ComponentManager };
|
|
334
303
|
export { Connection };
|
|
@@ -336,19 +305,18 @@ export { ConnectionType };
|
|
|
336
305
|
export { ConnectionChecker };
|
|
337
306
|
export { ConnectionDB };
|
|
338
307
|
export { ContextMenuRegistry };
|
|
308
|
+
export { comments };
|
|
339
309
|
export { Cursor };
|
|
340
310
|
export { DeleteArea };
|
|
311
|
+
export { dragging };
|
|
341
312
|
export { DragTarget };
|
|
342
313
|
export declare const DropDownDiv: typeof dropDownDiv;
|
|
343
314
|
export { Field, FieldConfig, FieldValidator, UnattachedFieldError };
|
|
344
|
-
export { FieldAngle, FieldAngleConfig, FieldAngleFromJsonConfig, FieldAngleValidator, };
|
|
345
315
|
export { FieldCheckbox, FieldCheckboxConfig, FieldCheckboxFromJsonConfig, FieldCheckboxValidator, };
|
|
346
|
-
export { FieldColour, FieldColourConfig, FieldColourFromJsonConfig, FieldColourValidator, };
|
|
347
316
|
export { FieldDropdown, FieldDropdownConfig, FieldDropdownFromJsonConfig, FieldDropdownValidator, MenuGenerator, MenuGeneratorFunction, MenuOption, };
|
|
348
317
|
export { FieldImage, FieldImageConfig, FieldImageFromJsonConfig };
|
|
349
318
|
export { FieldLabel, FieldLabelConfig, FieldLabelFromJsonConfig };
|
|
350
319
|
export { FieldLabelSerializable };
|
|
351
|
-
export { FieldMultilineInput, FieldMultilineInputConfig, FieldMultilineInputFromJsonConfig, FieldMultilineInputValidator, };
|
|
352
320
|
export { FieldNumber, FieldNumberConfig, FieldNumberFromJsonConfig, FieldNumberValidator, };
|
|
353
321
|
export { FieldTextInput, FieldTextInputConfig, FieldTextInputFromJsonConfig, FieldTextInputValidator, };
|
|
354
322
|
export { FieldVariable, FieldVariableConfig, FieldVariableFromJsonConfig, FieldVariableValidator, };
|
|
@@ -364,19 +332,20 @@ export { IASTNodeLocation };
|
|
|
364
332
|
export { IASTNodeLocationSvg };
|
|
365
333
|
export { IASTNodeLocationWithBlock };
|
|
366
334
|
export { IAutoHideable };
|
|
367
|
-
export { IBlockDragger };
|
|
368
335
|
export { IBoundedElement };
|
|
369
336
|
export { IBubble };
|
|
370
337
|
export { ICollapsibleToolboxItem };
|
|
371
338
|
export { IComponent };
|
|
372
339
|
export { IConnectionChecker };
|
|
340
|
+
export { IConnectionPreviewer };
|
|
373
341
|
export { IContextMenu };
|
|
374
342
|
export { icons };
|
|
375
|
-
export { ICopyable, isCopyable };
|
|
376
|
-
export { IDeletable };
|
|
343
|
+
export { ICopyable, isCopyable, ICopyData };
|
|
344
|
+
export { IDeletable, isDeletable };
|
|
377
345
|
export { IDeleteArea };
|
|
378
346
|
export { IDragTarget };
|
|
379
|
-
export {
|
|
347
|
+
export { IDragger };
|
|
348
|
+
export { IDraggable, isDraggable, IDragStrategy };
|
|
380
349
|
export { IFlyout };
|
|
381
350
|
export { IHasBubble, hasBubble };
|
|
382
351
|
export { IIcon, isIcon };
|
|
@@ -386,11 +355,13 @@ export { IMovable };
|
|
|
386
355
|
export { Input };
|
|
387
356
|
export { inputs };
|
|
388
357
|
export { InsertionMarkerManager };
|
|
358
|
+
export { InsertionMarkerPreviewer };
|
|
389
359
|
export { IObservable, isObservable };
|
|
390
360
|
export { IPaster, isPaster };
|
|
391
361
|
export { IPositionable };
|
|
392
362
|
export { IRegistrable };
|
|
393
|
-
export {
|
|
363
|
+
export { IRenderedElement, isRenderedElement };
|
|
364
|
+
export { ISelectable, isSelectable };
|
|
394
365
|
export { ISelectableToolboxItem };
|
|
395
366
|
export { ISerializable, isSerializable };
|
|
396
367
|
export { IStyleable };
|
|
@@ -399,6 +370,7 @@ export { IToolboxItem };
|
|
|
399
370
|
export { IVariableBackedParameterModel, isVariableBackedParameterModel };
|
|
400
371
|
export { Marker };
|
|
401
372
|
export { MarkerManager };
|
|
373
|
+
export { LayerManager };
|
|
402
374
|
export { Menu };
|
|
403
375
|
export { MenuItem };
|
|
404
376
|
export { MetricsManager };
|
|
@@ -423,16 +395,10 @@ export { VariableModel };
|
|
|
423
395
|
export { VerticalFlyout };
|
|
424
396
|
export { Workspace };
|
|
425
397
|
export { WorkspaceAudio };
|
|
426
|
-
export { WorkspaceComment };
|
|
427
|
-
export { WorkspaceCommentSvg };
|
|
428
398
|
export { WorkspaceDragger };
|
|
429
399
|
export { WorkspaceSvg };
|
|
430
400
|
export { ZoomControls };
|
|
431
401
|
export { config };
|
|
432
|
-
/** @deprecated Use Blockly.ConnectionType instead. */
|
|
433
|
-
export declare const connectionTypes: typeof ConnectionType;
|
|
434
402
|
export { inject };
|
|
435
|
-
/** @deprecated Use Blockly.inputs.inputTypes instead. To be removed in v11. */
|
|
436
|
-
export { inputTypes };
|
|
437
403
|
export { serialization };
|
|
438
404
|
//# sourceMappingURL=blockly.d.ts.map
|
package/core/bubbles/bubble.d.ts
CHANGED
|
@@ -8,13 +8,14 @@ import { Coordinate } from '../utils/coordinate.js';
|
|
|
8
8
|
import { Rect } from '../utils/rect.js';
|
|
9
9
|
import { Size } from '../utils/size.js';
|
|
10
10
|
import { WorkspaceSvg } from '../workspace_svg.js';
|
|
11
|
+
import { ISelectable } from '../blockly.js';
|
|
11
12
|
/**
|
|
12
13
|
* The abstract pop-up bubble class. This creates a UI that looks like a speech
|
|
13
14
|
* bubble, where it has a "tail" that points to the block, and a "head" that
|
|
14
15
|
* displays arbitrary svg elements.
|
|
15
16
|
*/
|
|
16
|
-
export declare abstract class Bubble implements IBubble {
|
|
17
|
-
|
|
17
|
+
export declare abstract class Bubble implements IBubble, ISelectable {
|
|
18
|
+
readonly workspace: WorkspaceSvg;
|
|
18
19
|
protected anchor: Coordinate;
|
|
19
20
|
protected ownerRect?: Rect | undefined;
|
|
20
21
|
/** The width of the border around the bubble. */
|
|
@@ -37,6 +38,7 @@ export declare abstract class Bubble implements IBubble {
|
|
|
37
38
|
static readonly TAIL_BEND = 4;
|
|
38
39
|
/** Distance between arrow point and anchor point. */
|
|
39
40
|
static readonly ANCHOR_RADIUS = 8;
|
|
41
|
+
id: string;
|
|
40
42
|
/** The SVG group containing all parts of the bubble. */
|
|
41
43
|
protected svgRoot: SVGGElement;
|
|
42
44
|
/** The SVG path for the arrow from the anchor to the bubble. */
|
|
@@ -57,6 +59,7 @@ export declare abstract class Bubble implements IBubble {
|
|
|
57
59
|
private relativeTop;
|
|
58
60
|
/** The position of the left of the bubble realtive to its anchor. */
|
|
59
61
|
private relativeLeft;
|
|
62
|
+
private dragStrategy;
|
|
60
63
|
/**
|
|
61
64
|
* @param workspace The workspace this bubble belongs to.
|
|
62
65
|
* @param anchor The anchor location of the thing this bubble is attached to.
|
|
@@ -175,5 +178,17 @@ export declare abstract class Bubble implements IBubble {
|
|
|
175
178
|
isDeletable(): boolean;
|
|
176
179
|
/** @internal */
|
|
177
180
|
showContextMenu(_e: Event): void;
|
|
181
|
+
/** Returns whether this bubble is movable or not. */
|
|
182
|
+
isMovable(): boolean;
|
|
183
|
+
/** Starts a drag on the bubble. */
|
|
184
|
+
startDrag(): void;
|
|
185
|
+
/** Drags the bubble to the given location. */
|
|
186
|
+
drag(newLoc: Coordinate): void;
|
|
187
|
+
/** Ends the drag on the bubble. */
|
|
188
|
+
endDrag(): void;
|
|
189
|
+
/** Moves the bubble back to where it was at the start of a drag. */
|
|
190
|
+
revertDrag(): void;
|
|
191
|
+
select(): void;
|
|
192
|
+
unselect(): void;
|
|
178
193
|
}
|
|
179
194
|
//# sourceMappingURL=bubble.d.ts.map
|
|
@@ -15,7 +15,7 @@ import type { WorkspaceSvg } from '../workspace_svg.js';
|
|
|
15
15
|
* Used by the mutator icon.
|
|
16
16
|
*/
|
|
17
17
|
export declare class MiniWorkspaceBubble extends Bubble {
|
|
18
|
-
|
|
18
|
+
readonly workspace: WorkspaceSvg;
|
|
19
19
|
protected anchor: Coordinate;
|
|
20
20
|
protected ownerRect?: Rect | undefined;
|
|
21
21
|
/**
|
|
@@ -12,7 +12,7 @@ import { WorkspaceSvg } from '../workspace_svg.js';
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class TextBubble extends Bubble {
|
|
14
14
|
private text;
|
|
15
|
-
|
|
15
|
+
readonly workspace: WorkspaceSvg;
|
|
16
16
|
protected anchor: Coordinate;
|
|
17
17
|
protected ownerRect?: Rect | undefined;
|
|
18
18
|
private paragraph;
|
|
@@ -13,7 +13,7 @@ import { WorkspaceSvg } from '../workspace_svg.js';
|
|
|
13
13
|
* Used by the comment icon.
|
|
14
14
|
*/
|
|
15
15
|
export declare class TextInputBubble extends Bubble {
|
|
16
|
-
|
|
16
|
+
readonly workspace: WorkspaceSvg;
|
|
17
17
|
protected anchor: Coordinate;
|
|
18
18
|
protected ownerRect?: Rect | undefined;
|
|
19
19
|
/** The root of the elements specific to the text element. */
|