blockly 10.0.0-beta.0 → 10.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blockly.min.js +462 -479
- package/blockly_compressed.js +275 -294
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js +73 -80
- package/blocks_compressed.js.map +1 -1
- package/core/blockly.d.ts +21 -16
- package/core/bubbles/bubble.d.ts +5 -0
- package/core/bubbles/mini_workspace_bubble.d.ts +4 -0
- package/core/bubbles/text_bubble.d.ts +3 -0
- package/core/bubbles/textinput_bubble.d.ts +4 -0
- package/core/bubbles.d.ts +11 -0
- package/core/events/events.d.ts +4 -0
- package/core/events/events_block_field_intermediate_change.d.ts +58 -0
- package/core/events/utils.d.ts +5 -0
- package/core/field.d.ts +4 -1
- package/core/field_input.d.ts +10 -1
- package/core/icons/comment_icon.d.ts +3 -0
- package/core/icons/exceptions.d.ts +3 -0
- package/core/icons/icon.d.ts +12 -0
- package/core/icons/icon_types.d.ts +3 -0
- package/core/icons/mutator_icon.d.ts +10 -1
- package/core/icons/warning_icon.d.ts +6 -0
- package/core/icons.d.ts +6 -4
- package/core/inputs/align.d.ts +14 -0
- package/core/inputs/input.d.ts +6 -3
- package/core/inputs.d.ts +13 -0
- package/core/main.d.ts +3 -0
- package/core/renderers/minimalist/constants.d.ts +7 -0
- package/core/renderers/minimalist/drawer.d.ts +6 -0
- package/core/renderers/minimalist/info.d.ts +5 -0
- package/core/renderers/minimalist/renderer.d.ts +5 -0
- package/dart_compressed.js +97 -90
- package/dart_compressed.js.map +1 -1
- package/javascript_compressed.js +108 -100
- package/javascript_compressed.js.map +1 -1
- package/lua_compressed.js +81 -78
- package/lua_compressed.js.map +1 -1
- package/msg/ab.js +6 -5
- package/msg/ace.js +6 -5
- package/msg/af.js +6 -5
- package/msg/am.js +6 -5
- package/msg/ar.js +6 -5
- package/msg/ast.js +6 -5
- package/msg/az.js +6 -5
- package/msg/ba.js +6 -5
- package/msg/bcc.js +6 -5
- package/msg/be-tarask.js +6 -5
- package/msg/be.js +7 -6
- package/msg/bg.js +13 -12
- package/msg/bn.js +6 -5
- package/msg/br.js +13 -12
- package/msg/bs.js +6 -5
- package/msg/ca.js +6 -5
- package/msg/cdo.js +6 -5
- package/msg/cs.js +6 -5
- package/msg/da.js +6 -5
- package/msg/de.js +6 -5
- package/msg/diq.js +6 -5
- package/msg/dty.js +6 -5
- package/msg/ee.js +6 -5
- package/msg/el.js +6 -5
- package/msg/en-gb.js +6 -5
- package/msg/en.js +6 -5
- package/msg/eo.js +6 -5
- package/msg/es.js +6 -5
- package/msg/et.js +6 -5
- package/msg/eu.js +6 -5
- package/msg/fa.js +6 -5
- package/msg/fi.js +6 -5
- package/msg/fo.js +6 -5
- package/msg/fr.js +7 -6
- package/msg/frr.js +6 -5
- package/msg/gl.js +6 -5
- package/msg/gn.js +6 -5
- package/msg/gor.js +6 -5
- package/msg/ha.js +6 -5
- package/msg/hak.js +6 -5
- package/msg/he.js +6 -5
- package/msg/hi.js +7 -6
- package/msg/hr.js +6 -5
- package/msg/hrx.js +6 -5
- package/msg/hu.js +6 -5
- package/msg/hy.js +6 -5
- package/msg/ia.js +6 -5
- package/msg/id.js +6 -5
- package/msg/ig.js +6 -5
- package/msg/inh.js +7 -6
- package/msg/is.js +6 -5
- package/msg/it.js +6 -5
- package/msg/ja.js +7 -6
- package/msg/ka.js +6 -5
- package/msg/kab.js +6 -5
- package/msg/kbd-cyrl.js +6 -5
- package/msg/km.js +6 -5
- package/msg/kn.js +15 -14
- package/msg/ko.js +6 -5
- package/msg/ksh.js +6 -5
- package/msg/ku-latn.js +6 -5
- package/msg/ky.js +9 -8
- package/msg/la.js +6 -5
- package/msg/lb.js +7 -6
- package/msg/lki.js +6 -5
- package/msg/lo.js +6 -5
- package/msg/lrc.js +6 -5
- package/msg/lt.js +28 -27
- package/msg/lv.js +6 -5
- package/msg/mg.js +6 -5
- package/msg/mk.js +6 -5
- package/msg/ml.js +6 -5
- package/msg/mnw.js +6 -5
- package/msg/ms.js +6 -5
- package/msg/my.js +6 -5
- package/msg/mzn.js +6 -5
- package/msg/nb.js +9 -8
- package/msg/ne.js +6 -5
- package/msg/nl.js +6 -5
- package/msg/oc.js +6 -5
- package/msg/olo.js +6 -5
- package/msg/pa.js +6 -5
- package/msg/pl.js +6 -5
- package/msg/pms.js +6 -5
- package/msg/ps.js +6 -5
- package/msg/pt-br.js +6 -5
- package/msg/pt.js +6 -5
- package/msg/ro.js +6 -5
- package/msg/ru.js +6 -5
- package/msg/sc.js +6 -5
- package/msg/sco.js +6 -5
- package/msg/sd.js +6 -5
- package/msg/shn.js +6 -5
- package/msg/si.js +6 -5
- package/msg/sk.js +6 -5
- package/msg/skr-arab.js +17 -16
- package/msg/sl.js +6 -5
- package/msg/smn.js +6 -5
- package/msg/sq.js +6 -5
- package/msg/sr-latn.js +6 -5
- package/msg/sr.js +6 -5
- package/msg/sv.js +6 -5
- package/msg/sw.js +6 -5
- package/msg/ta.js +6 -5
- package/msg/tcy.js +6 -5
- package/msg/tdd.js +6 -5
- package/msg/te.js +6 -5
- package/msg/th.js +6 -5
- package/msg/ti.js +6 -5
- package/msg/tl.js +6 -5
- package/msg/tlh.js +6 -5
- package/msg/tr.js +6 -5
- package/msg/ug-arab.js +6 -5
- package/msg/uk.js +6 -5
- package/msg/ur.js +6 -5
- package/msg/uz.js +6 -5
- package/msg/vi.js +6 -5
- package/msg/xmf.js +16 -15
- package/msg/yo.js +6 -5
- package/msg/yue.js +6 -5
- package/msg/zgh.js +6 -5
- package/msg/zh-hans.js +13 -12
- package/msg/zh-hant.js +6 -5
- package/package.json +1 -2
- package/php_compressed.js +100 -95
- package/php_compressed.js.map +1 -1
- package/python_compressed.js +92 -89
- package/python_compressed.js.map +1 -1
- package/core/bubble_old.d.ts +0 -303
package/core/blockly.d.ts
CHANGED
|
@@ -14,7 +14,8 @@ import { BlockSvg } from './block_svg.js';
|
|
|
14
14
|
import { BlocklyOptions } from './blockly_options.js';
|
|
15
15
|
import { Blocks } from './blocks.js';
|
|
16
16
|
import * as browserEvents from './browser_events.js';
|
|
17
|
-
import { Bubble } from './
|
|
17
|
+
import { Bubble } from './bubbles/bubble.js';
|
|
18
|
+
import * as bubbles from './bubbles.js';
|
|
18
19
|
import { BubbleDragger } from './bubble_dragger.js';
|
|
19
20
|
import * as bumpObjects from './bump_objects.js';
|
|
20
21
|
import * as clipboard from './clipboard.js';
|
|
@@ -56,14 +57,12 @@ import { VerticalFlyout } from './flyout_vertical.js';
|
|
|
56
57
|
import { CodeGenerator } from './generator.js';
|
|
57
58
|
import { Gesture } from './gesture.js';
|
|
58
59
|
import { Grid } from './grid.js';
|
|
59
|
-
import { Icon } from './icons/icon.js';
|
|
60
60
|
import * as icons from './icons.js';
|
|
61
61
|
import { inject } from './inject.js';
|
|
62
|
+
import { Align } from './inputs/align.js';
|
|
62
63
|
import { Input } from './inputs/input.js';
|
|
63
64
|
import { inputTypes } from './inputs/input_types.js';
|
|
64
|
-
import
|
|
65
|
-
import { StatementInput } from './inputs/statement_input.js';
|
|
66
|
-
import { ValueInput } from './inputs/value_input.js';
|
|
65
|
+
import * as inputs from './inputs.js';
|
|
67
66
|
import { InsertionMarkerManager } from './insertion_marker_manager.js';
|
|
68
67
|
import { IASTNodeLocation } from './interfaces/i_ast_node_location.js';
|
|
69
68
|
import { IASTNodeLocationSvg } from './interfaces/i_ast_node_location_svg.js';
|
|
@@ -82,6 +81,8 @@ import { IDeleteArea } from './interfaces/i_delete_area.js';
|
|
|
82
81
|
import { IDragTarget } from './interfaces/i_drag_target.js';
|
|
83
82
|
import { IDraggable } from './interfaces/i_draggable.js';
|
|
84
83
|
import { IFlyout } from './interfaces/i_flyout.js';
|
|
84
|
+
import { IHasBubble, hasBubble } from './interfaces/i_has_bubble.js';
|
|
85
|
+
import { IIcon, isIcon } from './interfaces/i_icon.js';
|
|
85
86
|
import { IKeyboardAccessible } from './interfaces/i_keyboard_accessible.js';
|
|
86
87
|
import { IMetricsManager } from './interfaces/i_metrics_manager.js';
|
|
87
88
|
import { IMovable } from './interfaces/i_movable.js';
|
|
@@ -90,6 +91,7 @@ import { IPositionable } from './interfaces/i_positionable.js';
|
|
|
90
91
|
import { IRegistrable } from './interfaces/i_registrable.js';
|
|
91
92
|
import { ISelectable } from './interfaces/i_selectable.js';
|
|
92
93
|
import { ISelectableToolboxItem } from './interfaces/i_selectable_toolbox_item.js';
|
|
94
|
+
import { ISerializable, isSerializable } from './interfaces/i_serializable.js';
|
|
93
95
|
import { IStyleable } from './interfaces/i_styleable.js';
|
|
94
96
|
import { IToolbox } from './interfaces/i_toolbox.js';
|
|
95
97
|
import { IToolboxItem } from './interfaces/i_toolbox_item.js';
|
|
@@ -160,16 +162,19 @@ import { ZoomControls } from './zoom_controls.js';
|
|
|
160
162
|
export declare const VERSION = "uncompiled";
|
|
161
163
|
/**
|
|
162
164
|
* @see Blockly.Input.Align.LEFT
|
|
165
|
+
* @deprecated Use `Blockly.inputs.Align.LEFT`. To be removed in v11.
|
|
163
166
|
*/
|
|
164
|
-
export declare const ALIGN_LEFT =
|
|
167
|
+
export declare const ALIGN_LEFT = Align.LEFT;
|
|
165
168
|
/**
|
|
166
169
|
* @see Blockly.Input.Align.CENTRE
|
|
170
|
+
* @deprecated Use `Blockly.inputs.Align.CENTER`. To be removed in v11.
|
|
167
171
|
*/
|
|
168
|
-
export declare const ALIGN_CENTRE =
|
|
172
|
+
export declare const ALIGN_CENTRE = Align.CENTRE;
|
|
169
173
|
/**
|
|
170
174
|
* @see Blockly.Input.Align.RIGHT
|
|
175
|
+
* @deprecated Use `Blockly.inputs.Align.RIGHT`. To be removed in v11.
|
|
171
176
|
*/
|
|
172
|
-
export declare const ALIGN_RIGHT =
|
|
177
|
+
export declare const ALIGN_RIGHT = Align.RIGHT;
|
|
173
178
|
/**
|
|
174
179
|
* @see ConnectionType.INPUT_VALUE
|
|
175
180
|
*/
|
|
@@ -188,6 +193,7 @@ export declare const NEXT_STATEMENT = ConnectionType.NEXT_STATEMENT;
|
|
|
188
193
|
export declare const PREVIOUS_STATEMENT = ConnectionType.PREVIOUS_STATEMENT;
|
|
189
194
|
/**
|
|
190
195
|
* @see inputTypes.DUMMY_INPUT
|
|
196
|
+
* @deprecated Use `Blockly.inputs.inputTypes.DUMMY`. To be removed in v11.
|
|
191
197
|
*/
|
|
192
198
|
export declare const DUMMY_INPUT = inputTypes.DUMMY;
|
|
193
199
|
/** Aliases for toolbox positions. */
|
|
@@ -318,6 +324,8 @@ export { BlocklyOptions };
|
|
|
318
324
|
export { BlockDragger };
|
|
319
325
|
export { BlockSvg };
|
|
320
326
|
export { Blocks };
|
|
327
|
+
export { bubbles };
|
|
328
|
+
/** @deprecated Use Blockly.bubbles.Bubble instead. To be removed in v11. */
|
|
321
329
|
export { Bubble };
|
|
322
330
|
export { BubbleDragger };
|
|
323
331
|
export { CollapsibleToolboxCategory };
|
|
@@ -362,7 +370,6 @@ export { ICollapsibleToolboxItem };
|
|
|
362
370
|
export { IComponent };
|
|
363
371
|
export { IConnectionChecker };
|
|
364
372
|
export { IContextMenu };
|
|
365
|
-
export { Icon };
|
|
366
373
|
export { icons };
|
|
367
374
|
export { ICopyable };
|
|
368
375
|
export { IDeletable };
|
|
@@ -370,23 +377,20 @@ export { IDeleteArea };
|
|
|
370
377
|
export { IDragTarget };
|
|
371
378
|
export { IDraggable };
|
|
372
379
|
export { IFlyout };
|
|
380
|
+
export { IHasBubble, hasBubble };
|
|
381
|
+
export { IIcon, isIcon };
|
|
373
382
|
export { IKeyboardAccessible };
|
|
374
383
|
export { IMetricsManager };
|
|
375
384
|
export { IMovable };
|
|
376
385
|
export { Input };
|
|
377
|
-
export
|
|
378
|
-
Input: typeof Input;
|
|
379
|
-
inputTypes: typeof inputTypes;
|
|
380
|
-
DummyInput: typeof DummyInput;
|
|
381
|
-
StatementInput: typeof StatementInput;
|
|
382
|
-
ValueInput: typeof ValueInput;
|
|
383
|
-
};
|
|
386
|
+
export { inputs };
|
|
384
387
|
export { InsertionMarkerManager };
|
|
385
388
|
export { IObservable, isObservable };
|
|
386
389
|
export { IPositionable };
|
|
387
390
|
export { IRegistrable };
|
|
388
391
|
export { ISelectable };
|
|
389
392
|
export { ISelectableToolboxItem };
|
|
393
|
+
export { ISerializable, isSerializable };
|
|
390
394
|
export { IStyleable };
|
|
391
395
|
export { IToolbox };
|
|
392
396
|
export { IToolboxItem };
|
|
@@ -426,6 +430,7 @@ export { config };
|
|
|
426
430
|
/** @deprecated Use Blockly.ConnectionType instead. */
|
|
427
431
|
export declare const connectionTypes: typeof ConnectionType;
|
|
428
432
|
export { inject };
|
|
433
|
+
/** @deprecated Use Blockly.inputs.inputTypes instead. To be removed in v11. */
|
|
429
434
|
export { inputTypes };
|
|
430
435
|
export { serialization };
|
|
431
436
|
//# sourceMappingURL=blockly.d.ts.map
|
package/core/bubbles/bubble.d.ts
CHANGED
|
@@ -8,6 +8,11 @@ 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
|
+
/**
|
|
12
|
+
* The abstract pop-up bubble class. This creates a UI that looks like a speech
|
|
13
|
+
* bubble, where it has a "tail" that points to the block, and a "head" that
|
|
14
|
+
* displays arbitrary svg elements.
|
|
15
|
+
*/
|
|
11
16
|
export declare abstract class Bubble implements IBubble {
|
|
12
17
|
protected readonly workspace: WorkspaceSvg;
|
|
13
18
|
protected anchor: Coordinate;
|
|
@@ -10,6 +10,10 @@ import { Coordinate } from '../utils/coordinate.js';
|
|
|
10
10
|
import { Options } from '../options.js';
|
|
11
11
|
import type { Rect } from '../utils/rect.js';
|
|
12
12
|
import type { WorkspaceSvg } from '../workspace_svg.js';
|
|
13
|
+
/**
|
|
14
|
+
* A bubble that contains a mini-workspace which can hold arbitrary blocks.
|
|
15
|
+
* Used by the mutator icon.
|
|
16
|
+
*/
|
|
13
17
|
export declare class MiniWorkspaceBubble extends Bubble {
|
|
14
18
|
protected readonly workspace: WorkspaceSvg;
|
|
15
19
|
protected anchor: Coordinate;
|
|
@@ -7,6 +7,9 @@ import { Bubble } from './bubble.js';
|
|
|
7
7
|
import { Coordinate } from '../utils/coordinate.js';
|
|
8
8
|
import { Rect } from '../utils/rect.js';
|
|
9
9
|
import { WorkspaceSvg } from '../workspace_svg.js';
|
|
10
|
+
/**
|
|
11
|
+
* A bubble that displays non-editable text. Used by the warning icon.
|
|
12
|
+
*/
|
|
10
13
|
export declare class TextBubble extends Bubble {
|
|
11
14
|
private text;
|
|
12
15
|
protected readonly workspace: WorkspaceSvg;
|
|
@@ -8,6 +8,10 @@ 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
|
+
/**
|
|
12
|
+
* A bubble that displays editable text. It can also be resized by the user.
|
|
13
|
+
* Used by the comment icon.
|
|
14
|
+
*/
|
|
11
15
|
export declare class TextInputBubble extends Bubble {
|
|
12
16
|
protected readonly workspace: WorkspaceSvg;
|
|
13
17
|
protected anchor: Coordinate;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Bubble } from './bubbles/bubble.js';
|
|
7
|
+
import { TextBubble } from './bubbles/text_bubble.js';
|
|
8
|
+
import { TextInputBubble } from './bubbles/textinput_bubble.js';
|
|
9
|
+
import { MiniWorkspaceBubble } from './bubbles/mini_workspace_bubble.js';
|
|
10
|
+
export { Bubble, TextBubble, TextInputBubble, MiniWorkspaceBubble };
|
|
11
|
+
//# sourceMappingURL=bubbles.d.ts.map
|
package/core/events/events.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { BlockChange, BlockChangeJson } from './events_block_change.js';
|
|
|
9
9
|
import { BlockCreate, BlockCreateJson } from './events_block_create.js';
|
|
10
10
|
import { BlockDelete, BlockDeleteJson } from './events_block_delete.js';
|
|
11
11
|
import { BlockDrag, BlockDragJson } from './events_block_drag.js';
|
|
12
|
+
import { BlockFieldIntermediateChange, BlockFieldIntermediateChangeJson } from './events_block_field_intermediate_change.js';
|
|
12
13
|
import { BlockMove, BlockMoveJson } from './events_block_move.js';
|
|
13
14
|
import { BubbleOpen, BubbleOpenJson, BubbleType } from './events_bubble_open.js';
|
|
14
15
|
import { Click, ClickJson, ClickTarget } from './events_click.js';
|
|
@@ -45,6 +46,8 @@ export { BlockDelete };
|
|
|
45
46
|
export { BlockDeleteJson };
|
|
46
47
|
export { BlockDrag };
|
|
47
48
|
export { BlockDragJson };
|
|
49
|
+
export { BlockFieldIntermediateChange };
|
|
50
|
+
export { BlockFieldIntermediateChangeJson };
|
|
48
51
|
export { BlockMove };
|
|
49
52
|
export { BlockMoveJson };
|
|
50
53
|
export { Click };
|
|
@@ -86,6 +89,7 @@ export declare const BLOCK_CREATE = "create";
|
|
|
86
89
|
export declare const BLOCK_DELETE = "delete";
|
|
87
90
|
export declare const BLOCK_DRAG = "drag";
|
|
88
91
|
export declare const BLOCK_MOVE = "move";
|
|
92
|
+
export declare const BLOCK_FIELD_INTERMEDIATE_CHANGE = "block_field_intermediate_change";
|
|
89
93
|
export declare const BUBBLE_OPEN = "bubble_open";
|
|
90
94
|
export type BumpEvent = eventUtils.BumpEvent;
|
|
91
95
|
export declare const BUMP_EVENTS: string[];
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { Block } from '../block.js';
|
|
7
|
+
import { Workspace } from '../workspace.js';
|
|
8
|
+
import { BlockBase, BlockBaseJson } from './events_block_base.js';
|
|
9
|
+
/**
|
|
10
|
+
* Notifies listeners when the value of a block's field has changed but the
|
|
11
|
+
* change is not yet complete, and is expected to be followed by a block change
|
|
12
|
+
* event.
|
|
13
|
+
*/
|
|
14
|
+
export declare class BlockFieldIntermediateChange extends BlockBase {
|
|
15
|
+
type: string;
|
|
16
|
+
recordUndo: boolean;
|
|
17
|
+
/** The name of the field that changed. */
|
|
18
|
+
name?: string;
|
|
19
|
+
/** The original value of the element. */
|
|
20
|
+
oldValue: unknown;
|
|
21
|
+
/** The new value of the element. */
|
|
22
|
+
newValue: unknown;
|
|
23
|
+
/**
|
|
24
|
+
* @param opt_block The changed block. Undefined for a blank event.
|
|
25
|
+
* @param opt_name Name of the field affected.
|
|
26
|
+
* @param opt_oldValue Previous value of element.
|
|
27
|
+
* @param opt_newValue New value of element.
|
|
28
|
+
*/
|
|
29
|
+
constructor(opt_block?: Block, opt_name?: string, opt_oldValue?: unknown, opt_newValue?: unknown);
|
|
30
|
+
/**
|
|
31
|
+
* Encode the event as JSON.
|
|
32
|
+
*
|
|
33
|
+
* @returns JSON representation.
|
|
34
|
+
*/
|
|
35
|
+
toJson(): BlockFieldIntermediateChangeJson;
|
|
36
|
+
/**
|
|
37
|
+
* Deserializes the JSON event.
|
|
38
|
+
*
|
|
39
|
+
* @param event The event to append new properties to. Should be a subclass
|
|
40
|
+
* of BlockFieldIntermediateChange, but we can't specify that due to the
|
|
41
|
+
* fact that parameters to static methods in subclasses must be supertypes
|
|
42
|
+
* of parameters to static methods in superclasses.
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
static fromJson(json: BlockFieldIntermediateChangeJson, workspace: Workspace, event?: any): BlockFieldIntermediateChange;
|
|
46
|
+
/**
|
|
47
|
+
* Does this event record any change of state?
|
|
48
|
+
*
|
|
49
|
+
* @returns False if something changed.
|
|
50
|
+
*/
|
|
51
|
+
isNull(): boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface BlockFieldIntermediateChangeJson extends BlockBaseJson {
|
|
54
|
+
name: string;
|
|
55
|
+
newValue: unknown;
|
|
56
|
+
oldValue: unknown;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=events_block_field_intermediate_change.d.ts.map
|
package/core/events/utils.d.ts
CHANGED
|
@@ -46,6 +46,11 @@ export declare const CHANGE = "change";
|
|
|
46
46
|
* Name of event that changes a block.
|
|
47
47
|
*/
|
|
48
48
|
export declare const BLOCK_CHANGE = "change";
|
|
49
|
+
/**
|
|
50
|
+
* Name of event representing an in-progress change to a field of a block, which
|
|
51
|
+
* is expected to be followed by a block change event.
|
|
52
|
+
*/
|
|
53
|
+
export declare const BLOCK_FIELD_INTERMEDIATE_CHANGE = "block_field_intermediate_change";
|
|
49
54
|
/**
|
|
50
55
|
* Name of event that moves a block. Will be deprecated for BLOCK_MOVE.
|
|
51
56
|
*/
|
package/core/field.d.ts
CHANGED
|
@@ -519,9 +519,12 @@ export declare abstract class Field<T = any> implements IASTNodeLocationSvg, IAS
|
|
|
519
519
|
* than this method.
|
|
520
520
|
*
|
|
521
521
|
* @param newValue New value.
|
|
522
|
+
* @param fireChangeEvent Whether to fire a change event. Defaults to true.
|
|
523
|
+
* Should usually be true unless the change will be reported some other
|
|
524
|
+
* way, e.g. an intermediate field change event.
|
|
522
525
|
* @sealed
|
|
523
526
|
*/
|
|
524
|
-
setValue(newValue: any): void;
|
|
527
|
+
setValue(newValue: any, fireChangeEvent?: boolean): void;
|
|
525
528
|
/**
|
|
526
529
|
* Process the result of validation.
|
|
527
530
|
*
|
package/core/field_input.d.ts
CHANGED
|
@@ -34,6 +34,12 @@ export declare abstract class FieldInput<T extends InputTypes> extends Field<str
|
|
|
34
34
|
* True if the value currently displayed in the field's editory UI is valid.
|
|
35
35
|
*/
|
|
36
36
|
protected isTextValid_: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* The intial value of the field when the user opened an editor to change its
|
|
39
|
+
* value. When the editor is disposed, an event will be fired that uses this
|
|
40
|
+
* as the event's oldValue.
|
|
41
|
+
*/
|
|
42
|
+
protected valueWhenEditorWasOpened_: string | T | null;
|
|
37
43
|
/** Key down event data. */
|
|
38
44
|
private onKeyDownWrapper_;
|
|
39
45
|
/** Key input event data. */
|
|
@@ -171,8 +177,11 @@ export declare abstract class FieldInput<T extends InputTypes> extends Field<str
|
|
|
171
177
|
* value whilst editing.
|
|
172
178
|
*
|
|
173
179
|
* @param newValue New value.
|
|
180
|
+
* @param fireChangeEvent Whether to fire a change event. Defaults to true.
|
|
181
|
+
* Should usually be true unless the change will be reported some other
|
|
182
|
+
* way, e.g. an intermediate field change event.
|
|
174
183
|
*/
|
|
175
|
-
protected setEditorValue_(newValue: any): void;
|
|
184
|
+
protected setEditorValue_(newValue: any, fireChangeEvent?: boolean): void;
|
|
176
185
|
/** Resize the editor to fit the text. */
|
|
177
186
|
protected resizeEditor_(): void;
|
|
178
187
|
/**
|
|
@@ -10,6 +10,9 @@ import { Icon } from './icon.js';
|
|
|
10
10
|
import type { IHasBubble } from '../interfaces/i_has_bubble.js';
|
|
11
11
|
import type { ISerializable } from '../interfaces/i_serializable.js';
|
|
12
12
|
import { Size } from '../utils/size.js';
|
|
13
|
+
/**
|
|
14
|
+
* An icon which allows the user to add comment text to a block.
|
|
15
|
+
*/
|
|
13
16
|
export declare class CommentIcon extends Icon implements IHasBubble, ISerializable {
|
|
14
17
|
protected readonly sourceBlock: Block;
|
|
15
18
|
/** The type string used to identify this icon. */
|
package/core/icons/icon.d.ts
CHANGED
|
@@ -8,6 +8,12 @@ import type { IIcon } from '../interfaces/i_icon.js';
|
|
|
8
8
|
import { Coordinate } from '../utils/coordinate.js';
|
|
9
9
|
import { Size } from '../utils/size.js';
|
|
10
10
|
import type { IconType } from './icon_types.js';
|
|
11
|
+
/**
|
|
12
|
+
* The abstract icon class. Icons are visual elements that live in the top-start
|
|
13
|
+
* corner of the block. Usually they provide more "meta" information about a
|
|
14
|
+
* block (such as warnings or comments) as opposed to fields, which provide
|
|
15
|
+
* "actual" information, related to how a block functions.
|
|
16
|
+
*/
|
|
11
17
|
export declare abstract class Icon implements IIcon {
|
|
12
18
|
protected sourceBlock: Block;
|
|
13
19
|
/**
|
|
@@ -34,5 +40,11 @@ export declare abstract class Icon implements IIcon {
|
|
|
34
40
|
private updateSvgRootOffset;
|
|
35
41
|
onLocationChange(blockOrigin: Coordinate): void;
|
|
36
42
|
onClick(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Sets the visibility of the icon's bubble if one exists.
|
|
45
|
+
*
|
|
46
|
+
* @deprecated Use `setBubbleVisible` instead. To be removed in v11.
|
|
47
|
+
*/
|
|
48
|
+
setVisible(visibility: boolean): void;
|
|
37
49
|
}
|
|
38
50
|
//# sourceMappingURL=icon.d.ts.map
|
|
@@ -7,6 +7,9 @@ import { IIcon } from '../interfaces/i_icon.js';
|
|
|
7
7
|
import { CommentIcon } from './comment_icon.js';
|
|
8
8
|
import { MutatorIcon } from './mutator_icon.js';
|
|
9
9
|
import { WarningIcon } from './warning_icon.js';
|
|
10
|
+
/**
|
|
11
|
+
* Defines the type of an icon, so that it can be retrieved from block.getIcon
|
|
12
|
+
*/
|
|
10
13
|
export declare class IconType<_T extends IIcon> {
|
|
11
14
|
private readonly name;
|
|
12
15
|
/** @param name The name of the registry type. */
|
|
@@ -13,6 +13,12 @@ import { Icon } from './icon.js';
|
|
|
13
13
|
import { Size } from '../utils/size.js';
|
|
14
14
|
import type { WorkspaceSvg } from '../workspace_svg.js';
|
|
15
15
|
import { IconType } from './icon_types.js';
|
|
16
|
+
/**
|
|
17
|
+
* An icon that allows the user to change the shape of the block.
|
|
18
|
+
*
|
|
19
|
+
* For example, it could be used to add additional fields or inputs to
|
|
20
|
+
* the block.
|
|
21
|
+
*/
|
|
16
22
|
export declare class MutatorIcon extends Icon implements IHasBubble {
|
|
17
23
|
private readonly flyoutBlockTypes;
|
|
18
24
|
protected readonly sourceBlock: BlockSvg;
|
|
@@ -71,7 +77,10 @@ export declare class MutatorIcon extends Icon implements IHasBubble {
|
|
|
71
77
|
static isIgnorableMutatorEvent(e: Abstract): boolean;
|
|
72
78
|
/** Recomposes the source block based on changes to the mini workspace. */
|
|
73
79
|
private recomposeSourceBlock;
|
|
74
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* @returns The workspace of the mini workspace bubble, if the bubble is
|
|
82
|
+
* currently open.
|
|
83
|
+
*/
|
|
75
84
|
getWorkspace(): WorkspaceSvg | undefined;
|
|
76
85
|
/**
|
|
77
86
|
* Reconnects the given connection to the mutated input on the given block.
|
|
@@ -9,6 +9,12 @@ import { Icon } from './icon.js';
|
|
|
9
9
|
import type { IHasBubble } from '../interfaces/i_has_bubble.js';
|
|
10
10
|
import { Size } from '../utils.js';
|
|
11
11
|
import { IconType } from './icon_types.js';
|
|
12
|
+
/**
|
|
13
|
+
* An icon that warns the user that something is wrong with their block.
|
|
14
|
+
*
|
|
15
|
+
* For example, this could be used to warn them about incorrect field values,
|
|
16
|
+
* or incorrect placement of the block (putting it somewhere it doesn't belong).
|
|
17
|
+
*/
|
|
12
18
|
export declare class WarningIcon extends Icon implements IHasBubble {
|
|
13
19
|
protected readonly sourceBlock: BlockSvg;
|
|
14
20
|
/** The type string used to identify this icon. */
|
package/core/icons.d.ts
CHANGED
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
* Copyright 2023 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import * as registry from './icons/registry.js';
|
|
6
|
+
import { Icon } from './icons/icon.js';
|
|
7
|
+
import { CommentIcon, CommentState } from './icons/comment_icon.js';
|
|
9
8
|
import { MutatorIcon } from './icons/mutator_icon.js';
|
|
9
|
+
import { WarningIcon } from './icons/warning_icon.js';
|
|
10
10
|
import { IconType } from './icons/icon_types.js';
|
|
11
|
-
|
|
11
|
+
import * as exceptions from './icons/exceptions.js';
|
|
12
|
+
import * as registry from './icons/registry.js';
|
|
13
|
+
export { Icon, CommentIcon, CommentState, MutatorIcon, WarningIcon, IconType, exceptions, registry, };
|
|
12
14
|
//# sourceMappingURL=icons.d.ts.map
|
package/core/inputs/input.d.ts
CHANGED
|
@@ -10,9 +10,7 @@ import type { Connection } from '../connection.js';
|
|
|
10
10
|
import type { ConnectionType } from '../connection_type.js';
|
|
11
11
|
import type { Field } from '../field.js';
|
|
12
12
|
import { inputTypes } from './input_types.js';
|
|
13
|
-
/**
|
|
14
|
-
* Class for an input with an optional field.
|
|
15
|
-
*/
|
|
13
|
+
/** Class for an input with optional fields. */
|
|
16
14
|
export declare class Input {
|
|
17
15
|
name: string;
|
|
18
16
|
private sourceBlock;
|
|
@@ -136,6 +134,7 @@ export declare namespace Input {
|
|
|
136
134
|
/**
|
|
137
135
|
* Enum for alignment of inputs.
|
|
138
136
|
*
|
|
137
|
+
* @deprecated Use Blockly.inputs.Align. To be removed in v11.
|
|
139
138
|
*/
|
|
140
139
|
enum Align {
|
|
141
140
|
LEFT = -1,
|
|
@@ -143,6 +142,10 @@ export declare namespace Input {
|
|
|
143
142
|
RIGHT = 1
|
|
144
143
|
}
|
|
145
144
|
}
|
|
145
|
+
/** @deprecated Use Blockly.inputs.Align. To be removed in v11. */
|
|
146
|
+
/** @suppress {deprecated} */
|
|
146
147
|
export type Align = Input.Align;
|
|
148
|
+
/** @deprecated Use Blockly.inputs.Align. To be removed in v11. */
|
|
149
|
+
/** @suppress {deprecated} */
|
|
147
150
|
export declare const Align: typeof Input.Align;
|
|
148
151
|
//# sourceMappingURL=input.d.ts.map
|
package/core/inputs.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Align } from './inputs/align.js';
|
|
7
|
+
import { Input } from './inputs/input.js';
|
|
8
|
+
import { DummyInput } from './inputs/dummy_input.js';
|
|
9
|
+
import { StatementInput } from './inputs/statement_input.js';
|
|
10
|
+
import { ValueInput } from './inputs/value_input.js';
|
|
11
|
+
import { inputTypes } from './inputs/input_types.js';
|
|
12
|
+
export { Align, Input, DummyInput, StatementInput, ValueInput, inputTypes };
|
|
13
|
+
//# sourceMappingURL=inputs.d.ts.map
|
package/core/main.d.ts
CHANGED
|
@@ -7,8 +7,15 @@ import { ConstantProvider as BaseConstantProvider } from '../common/constants.js
|
|
|
7
7
|
/**
|
|
8
8
|
* An object that provides constants for rendering blocks in the minimalist
|
|
9
9
|
* renderer.
|
|
10
|
+
*
|
|
11
|
+
* @deprecated Use Blockly.blockRendering.ConstantProvider instead.
|
|
12
|
+
* To be removed in v11.
|
|
10
13
|
*/
|
|
11
14
|
export declare class ConstantProvider extends BaseConstantProvider {
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use Blockly.blockRendering.ConstantProvider instead.
|
|
17
|
+
* To be removed in v11.
|
|
18
|
+
*/
|
|
12
19
|
constructor();
|
|
13
20
|
}
|
|
14
21
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -8,12 +8,18 @@ import { Drawer as BaseDrawer } from '../common/drawer.js';
|
|
|
8
8
|
import type { RenderInfo } from './info.js';
|
|
9
9
|
/**
|
|
10
10
|
* An object that draws a block based on the given rendering information.
|
|
11
|
+
*
|
|
12
|
+
* @deprecated Use Blockly.blockRendering.Drawer instead.
|
|
13
|
+
* To be removed in v11.
|
|
11
14
|
*/
|
|
12
15
|
export declare class Drawer extends BaseDrawer {
|
|
13
16
|
/**
|
|
14
17
|
* @param block The block to render.
|
|
15
18
|
* @param info An object containing all information needed to render this
|
|
16
19
|
* block.
|
|
20
|
+
*
|
|
21
|
+
* @deprecated Use Blockly.blockRendering.Drawer instead.
|
|
22
|
+
* To be removed in v11.
|
|
17
23
|
*/
|
|
18
24
|
constructor(block: BlockSvg, info: RenderInfo);
|
|
19
25
|
}
|
|
@@ -12,12 +12,17 @@ import type { Renderer } from './renderer.js';
|
|
|
12
12
|
* This measure pass does not propagate changes to the block (although fields
|
|
13
13
|
* may choose to rerender when getSize() is called). However, calling it
|
|
14
14
|
* repeatedly may be expensive.
|
|
15
|
+
*
|
|
16
|
+
* @deprecated Use Blockly.blockRendering.RenderInfo instead. To be removed
|
|
17
|
+
* in v11.
|
|
15
18
|
*/
|
|
16
19
|
export declare class RenderInfo extends BaseRenderInfo {
|
|
17
20
|
protected renderer_: Renderer;
|
|
18
21
|
/**
|
|
19
22
|
* @param renderer The renderer in use.
|
|
20
23
|
* @param block The block to measure.
|
|
24
|
+
* @deprecated Use Blockly.blockRendering.RenderInfo instead. To be removed
|
|
25
|
+
* in v11.
|
|
21
26
|
*/
|
|
22
27
|
constructor(renderer: Renderer, block: BlockSvg);
|
|
23
28
|
/**
|
|
@@ -11,10 +11,15 @@ import { Drawer } from './drawer.js';
|
|
|
11
11
|
import { RenderInfo } from './info.js';
|
|
12
12
|
/**
|
|
13
13
|
* The minimalist renderer.
|
|
14
|
+
*
|
|
15
|
+
* @deprecated Use Blockly.blockRendering.Renderer instead. To be removed
|
|
16
|
+
* in v11.
|
|
14
17
|
*/
|
|
15
18
|
export declare class Renderer extends BaseRenderer {
|
|
16
19
|
/**
|
|
17
20
|
* @param name The renderer name.
|
|
21
|
+
* @deprecated Use Blockly.blockRendering.Renderer instead. To be removed
|
|
22
|
+
* in v11.
|
|
18
23
|
*/
|
|
19
24
|
constructor(name: string);
|
|
20
25
|
/**
|