blockly 9.0.0-beta.1 → 9.0.0-beta.2

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.
Files changed (202) hide show
  1. package/blockly.min.js +581 -557
  2. package/blockly_compressed.js +575 -551
  3. package/blockly_compressed.js.map +1 -1
  4. package/blocks_compressed.js +6 -6
  5. package/blocks_compressed.js.map +1 -1
  6. package/core/block.d.ts +11 -0
  7. package/core/block_svg.d.ts +3 -3
  8. package/core/blockly.d.ts +2 -2
  9. package/core/events/events.d.ts +50 -24
  10. package/core/events/events_abstract.d.ts +8 -4
  11. package/core/events/events_block_base.d.ts +8 -6
  12. package/core/events/events_block_change.d.ts +14 -8
  13. package/core/events/events_block_create.d.ts +12 -6
  14. package/core/events/events_block_delete.d.ts +14 -7
  15. package/core/events/events_block_drag.d.ts +9 -3
  16. package/core/events/events_block_move.d.ts +15 -9
  17. package/core/events/events_bubble_open.d.ts +16 -5
  18. package/core/events/events_click.d.ts +15 -5
  19. package/core/events/events_comment_base.d.ts +7 -5
  20. package/core/events/events_comment_change.d.ts +9 -5
  21. package/core/events/events_comment_create.d.ts +7 -4
  22. package/core/events/events_comment_delete.d.ts +1 -13
  23. package/core/events/events_comment_move.d.ts +10 -6
  24. package/core/events/events_marker_move.d.ts +11 -4
  25. package/core/events/events_selected.d.ts +9 -4
  26. package/core/events/events_theme_change.d.ts +6 -2
  27. package/core/events/events_toolbox_item_select.d.ts +9 -4
  28. package/core/events/events_trashcan_open.d.ts +6 -2
  29. package/core/events/events_var_base.d.ts +8 -6
  30. package/core/events/events_var_create.d.ts +9 -5
  31. package/core/events/events_var_delete.d.ts +9 -5
  32. package/core/events/events_var_rename.d.ts +9 -5
  33. package/core/events/events_viewport.d.ts +9 -2
  34. package/core/events/workspace_events.d.ts +6 -5
  35. package/core/field.d.ts +0 -2
  36. package/core/gesture.d.ts +8 -9
  37. package/core/grid.d.ts +1 -1
  38. package/core/icon.d.ts +6 -2
  39. package/core/interfaces/i_component.d.ts +1 -1
  40. package/core/menu.d.ts +2 -1
  41. package/core/msg.d.ts +14 -0
  42. package/core/mutator.d.ts +1 -1
  43. package/core/rendered_connection.d.ts +1 -0
  44. package/core/renderers/common/constants.d.ts +8 -1
  45. package/core/renderers/common/drawer.d.ts +4 -3
  46. package/core/renderers/common/i_path_object.d.ts +22 -16
  47. package/core/renderers/common/info.d.ts +3 -3
  48. package/core/renderers/common/marker_svg.d.ts +7 -5
  49. package/core/renderers/common/path_object.d.ts +3 -3
  50. package/core/renderers/geras/constants.d.ts +4 -2
  51. package/core/renderers/geras/drawer.d.ts +2 -1
  52. package/core/renderers/geras/path_object.d.ts +0 -1
  53. package/core/renderers/measurables/icon.d.ts +1 -0
  54. package/core/renderers/measurables/row.d.ts +3 -3
  55. package/core/renderers/measurables/top_row.d.ts +0 -1
  56. package/core/renderers/minimalist/info.d.ts +1 -0
  57. package/core/renderers/thrasos/info.d.ts +1 -3
  58. package/core/renderers/zelos/constants.d.ts +20 -41
  59. package/core/renderers/zelos/measurables/inputs.d.ts +0 -1
  60. package/core/renderers/zelos/path_object.d.ts +1 -1
  61. package/core/theme.d.ts +27 -27
  62. package/core/toolbox/category.d.ts +18 -17
  63. package/core/toolbox/toolbox.d.ts +1 -1
  64. package/core/touch_gesture.d.ts +3 -2
  65. package/core/utils/coordinate.d.ts +1 -1
  66. package/core/utils/dom.d.ts +6 -7
  67. package/core/utils/idgenerator.d.ts +1 -1
  68. package/core/zoom_controls.d.ts +1 -1
  69. package/core-browser.js +0 -6
  70. package/core.js +0 -6
  71. package/dart.d.ts +1 -2
  72. package/javascript.d.ts +1 -2
  73. package/lua.d.ts +1 -2
  74. package/msg/ab.d.ts +8 -0
  75. package/msg/ace.d.ts +8 -0
  76. package/msg/af.d.ts +8 -0
  77. package/msg/am.d.ts +8 -0
  78. package/msg/ar.d.ts +8 -0
  79. package/msg/ast.d.ts +8 -0
  80. package/msg/az.d.ts +8 -0
  81. package/msg/ba.d.ts +8 -0
  82. package/msg/bcc.d.ts +8 -0
  83. package/msg/be-tarask.d.ts +8 -0
  84. package/msg/be.d.ts +8 -0
  85. package/msg/bg.d.ts +8 -0
  86. package/msg/bn.d.ts +8 -0
  87. package/msg/br.d.ts +8 -0
  88. package/msg/bs.d.ts +8 -0
  89. package/msg/ca.d.ts +8 -0
  90. package/msg/cdo.d.ts +8 -0
  91. package/msg/constants.d.ts +16 -0
  92. package/msg/cs.d.ts +8 -0
  93. package/msg/da.d.ts +8 -0
  94. package/msg/de.d.ts +8 -0
  95. package/msg/diq.d.ts +8 -0
  96. package/msg/dty.d.ts +8 -0
  97. package/msg/ee.d.ts +8 -0
  98. package/msg/el.d.ts +8 -0
  99. package/msg/en-gb.d.ts +8 -0
  100. package/msg/en.d.ts +8 -0
  101. package/msg/eo.d.ts +8 -0
  102. package/msg/es.d.ts +8 -0
  103. package/msg/et.d.ts +8 -0
  104. package/msg/eu.d.ts +8 -0
  105. package/msg/fa.d.ts +8 -0
  106. package/msg/fi.d.ts +8 -0
  107. package/msg/fo.d.ts +8 -0
  108. package/msg/fr.d.ts +8 -0
  109. package/msg/frr.d.ts +8 -0
  110. package/msg/gl.d.ts +8 -0
  111. package/msg/gn.d.ts +8 -0
  112. package/msg/gor.d.ts +8 -0
  113. package/msg/ha.d.ts +8 -0
  114. package/msg/hak.d.ts +8 -0
  115. package/msg/he.d.ts +8 -0
  116. package/msg/hi.d.ts +8 -0
  117. package/msg/hr.d.ts +8 -0
  118. package/msg/hrx.d.ts +8 -0
  119. package/msg/hu.d.ts +8 -0
  120. package/msg/hy.d.ts +8 -0
  121. package/msg/ia.d.ts +8 -0
  122. package/msg/id.d.ts +8 -0
  123. package/msg/ig.d.ts +8 -0
  124. package/msg/inh.d.ts +8 -0
  125. package/msg/is.d.ts +8 -0
  126. package/msg/it.d.ts +8 -0
  127. package/msg/ja.d.ts +8 -0
  128. package/msg/ka.d.ts +8 -0
  129. package/msg/kab.d.ts +8 -0
  130. package/msg/kbd-cyrl.d.ts +8 -0
  131. package/msg/km.d.ts +8 -0
  132. package/msg/kn.d.ts +8 -0
  133. package/msg/ko.d.ts +8 -0
  134. package/msg/ksh.d.ts +8 -0
  135. package/msg/ku-latn.d.ts +8 -0
  136. package/msg/ky.d.ts +8 -0
  137. package/msg/la.d.ts +8 -0
  138. package/msg/lb.d.ts +8 -0
  139. package/msg/lki.d.ts +8 -0
  140. package/msg/lo.d.ts +8 -0
  141. package/msg/lrc.d.ts +8 -0
  142. package/msg/lt.d.ts +8 -0
  143. package/msg/lv.d.ts +8 -0
  144. package/msg/mg.d.ts +8 -0
  145. package/msg/mk.d.ts +8 -0
  146. package/msg/ml.d.ts +8 -0
  147. package/msg/mnw.d.ts +8 -0
  148. package/msg/ms.d.ts +8 -0
  149. package/msg/msg.d.ts +429 -432
  150. package/msg/my.d.ts +8 -0
  151. package/msg/mzn.d.ts +8 -0
  152. package/msg/nb.d.ts +8 -0
  153. package/msg/ne.d.ts +8 -0
  154. package/msg/nl.d.ts +8 -0
  155. package/msg/oc.d.ts +8 -0
  156. package/msg/olo.d.ts +8 -0
  157. package/msg/pa.d.ts +8 -0
  158. package/msg/pl.d.ts +8 -0
  159. package/msg/pms.d.ts +8 -0
  160. package/msg/ps.d.ts +8 -0
  161. package/msg/pt-br.d.ts +8 -0
  162. package/msg/pt.d.ts +8 -0
  163. package/msg/qqq.d.ts +16 -0
  164. package/msg/ro.d.ts +8 -0
  165. package/msg/ru.d.ts +8 -0
  166. package/msg/sc.d.ts +8 -0
  167. package/msg/sco.d.ts +8 -0
  168. package/msg/sd.d.ts +8 -0
  169. package/msg/shn.d.ts +8 -0
  170. package/msg/si.d.ts +8 -0
  171. package/msg/sk.d.ts +8 -0
  172. package/msg/skr-arab.d.ts +8 -0
  173. package/msg/sl.d.ts +8 -0
  174. package/msg/smn.d.ts +8 -0
  175. package/msg/sq.d.ts +8 -0
  176. package/msg/sr-latn.d.ts +8 -0
  177. package/msg/sr.d.ts +8 -0
  178. package/msg/sv.d.ts +8 -0
  179. package/msg/sw.d.ts +8 -0
  180. package/msg/synonyms.d.ts +16 -0
  181. package/msg/ta.d.ts +8 -0
  182. package/msg/tcy.d.ts +8 -0
  183. package/msg/te.d.ts +8 -0
  184. package/msg/th.d.ts +8 -0
  185. package/msg/ti.d.ts +8 -0
  186. package/msg/tl.d.ts +8 -0
  187. package/msg/tlh.d.ts +8 -0
  188. package/msg/tr.d.ts +8 -0
  189. package/msg/ug-arab.d.ts +8 -0
  190. package/msg/uk.d.ts +8 -0
  191. package/msg/ur.d.ts +8 -0
  192. package/msg/uz.d.ts +8 -0
  193. package/msg/vi.d.ts +8 -0
  194. package/msg/xmf.d.ts +8 -0
  195. package/msg/yo.d.ts +8 -0
  196. package/msg/yue.d.ts +8 -0
  197. package/msg/zgh.d.ts +8 -0
  198. package/msg/zh-hans.d.ts +8 -0
  199. package/msg/zh-hant.d.ts +8 -0
  200. package/package.json +3 -3
  201. package/php.d.ts +1 -2
  202. package/python.d.ts +1 -2
package/core/menu.d.ts CHANGED
@@ -57,8 +57,9 @@ export declare class Menu {
57
57
  * Creates the menu DOM.
58
58
  *
59
59
  * @param container Element upon which to append this menu.
60
+ * @returns The menu's root DOM element.
60
61
  */
61
- render(container: Element): void;
62
+ render(container: Element): HTMLDivElement;
62
63
  /**
63
64
  * Gets the menu's element.
64
65
  *
package/core/msg.d.ts CHANGED
@@ -7,4 +7,18 @@
7
7
  export declare const Msg: {
8
8
  [key: string]: string;
9
9
  };
10
+ /**
11
+ * Sets the locale (i.e. the localized messages/block-text/etc) to the given
12
+ * locale.
13
+ *
14
+ * This is not useful/necessary when loading from a script tag, because the
15
+ * messages are automatically cluged into the Blockly.Msg object. But we provide
16
+ * it in both the script-tag and non-script-tag contexts so that the tscompiler
17
+ * can properly create our type definition files.
18
+ *
19
+ * @param locale An object defining the messages for a given language.
20
+ */
21
+ export declare const setLocale: (locale: {
22
+ [key: string]: string;
23
+ }) => void;
10
24
  //# sourceMappingURL=msg.d.ts.map
package/core/mutator.d.ts CHANGED
@@ -45,7 +45,7 @@ export declare class Mutator extends Icon {
45
45
  */
46
46
  private updateWorkspacePid_;
47
47
  /** @param quarkNames List of names of sub-blocks for flyout. */
48
- constructor(block: BlockSvg, quarkNames: string[]);
48
+ constructor(quarkNames: string[], block?: BlockSvg);
49
49
  /**
50
50
  * Set the block this mutator is associated with.
51
51
  *
@@ -18,6 +18,7 @@ export declare class RenderedConnection extends Connection {
18
18
  private readonly dbOpposite_;
19
19
  private readonly offsetInBlock_;
20
20
  private trackedState_;
21
+ private highlightPath;
21
22
  /** Connection this connection connects to. Null if not connected. */
22
23
  targetConnection: RenderedConnection | null;
23
24
  /**
@@ -71,6 +71,13 @@ export declare type DynamicShape = {
71
71
  };
72
72
  /** An object containing sizing and type information about a shape. */
73
73
  export declare type Shape = BaseShape | DynamicShape;
74
+ /**
75
+ * Returns whether the shape is dynamic or not.
76
+ *
77
+ * @param shape The shape to check for dynamic-ness.
78
+ * @returns Whether the shape is a dynamic shape or not.
79
+ */
80
+ export declare function isDynamicShape(shape: Shape): shape is DynamicShape;
74
81
  /**
75
82
  * An object that provides constants for rendering blocks.
76
83
  *
@@ -141,7 +148,7 @@ export declare class ConstantProvider {
141
148
  EMPTY_INLINE_INPUT_HEIGHT: number;
142
149
  EXTERNAL_VALUE_INPUT_PADDING: number;
143
150
  EMPTY_STATEMENT_INPUT_HEIGHT: number;
144
- START_POINT: any;
151
+ START_POINT: string;
145
152
  /** Height of SVG path for jagged teeth at the end of collapsed blocks. */
146
153
  JAGGED_TEETH_HEIGHT: number;
147
154
  /** Width of SVG path for jagged teeth at the end of collapsed blocks. */
@@ -4,6 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { BlockSvg } from '../../block_svg.js';
7
+ import { Coordinate } from '../../utils.js';
7
8
  import type { Field } from '../measurables/field.js';
8
9
  import type { Icon } from '../measurables/icon.js';
9
10
  import type { InlineInput } from '../measurables/inline_input.js';
@@ -16,9 +17,9 @@ import type { RenderInfo } from './info.js';
16
17
  * @alias Blockly.blockRendering.Drawer
17
18
  */
18
19
  export declare class Drawer {
19
- block_: any;
20
- info_: any;
21
- topLeft_: any;
20
+ block_: BlockSvg;
21
+ info_: RenderInfo;
22
+ topLeft_: Coordinate;
22
23
  outlinePath_: string;
23
24
  inlinePath_: string;
24
25
  protected constants_: ConstantProvider;
@@ -4,7 +4,9 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { BlockStyle } from '../../theme.js';
7
+ import type { BlockSvg } from '../../block_svg.js';
7
8
  import type { ConstantProvider } from './constants.js';
9
+ import { RenderedConnection } from '../../rendered_connection.js';
8
10
  /**
9
11
  * An interface for a block's path object.
10
12
  *
@@ -13,7 +15,11 @@ import type { ConstantProvider } from './constants.js';
13
15
  * @alias Blockly.blockRendering.IPathObject
14
16
  */
15
17
  export interface IPathObject {
16
- /** The primary path of the block. */
18
+ /**
19
+ * The primary path of the block.
20
+ *
21
+ * @internal
22
+ */
17
23
  svgPath: SVGElement;
18
24
  /** The renderer's constant provider. */
19
25
  constants: ConstantProvider;
@@ -23,19 +29,19 @@ export interface IPathObject {
23
29
  * Holds the cursors SVG element when the cursor is attached to the block.
24
30
  * This is null if there is no cursor on the block.
25
31
  */
26
- cursorSvg: SVGElement;
32
+ cursorSvg: SVGElement | null;
27
33
  /**
28
34
  * Holds the markers SVG element when the marker is attached to the block.
29
35
  * This is null if there is no marker on the block.
30
36
  */
31
- markerSvg: SVGElement;
37
+ markerSvg: SVGElement | null;
32
38
  /**
33
39
  * Set the path generated by the renderer onto the respective SVG element.
34
40
  *
35
41
  * @param pathString The path.
36
42
  * @internal
37
43
  */
38
- setPath: any;
44
+ setPath(pathString: string): void;
39
45
  /**
40
46
  * Apply the stored colours to the block's path, taking into account whether
41
47
  * the paths belong to a shadow block.
@@ -43,20 +49,20 @@ export interface IPathObject {
43
49
  * @param block The source block.
44
50
  * @internal
45
51
  */
46
- applyColour: any;
52
+ applyColour(block: BlockSvg): void;
47
53
  /**
48
54
  * Update the style.
49
55
  *
50
56
  * @param blockStyle The block style to use.
51
57
  * @internal
52
58
  */
53
- setStyle: any;
59
+ setStyle(blockStyle: BlockStyle): void;
54
60
  /**
55
61
  * Flip the SVG paths in RTL.
56
62
  *
57
63
  * @internal
58
64
  */
59
- flipRTL: () => void;
65
+ flipRTL(): void;
60
66
  /**
61
67
  * Add the cursor SVG to this block's SVG group.
62
68
  *
@@ -64,7 +70,7 @@ export interface IPathObject {
64
70
  * group.
65
71
  * @internal
66
72
  */
67
- setCursorSvg: any;
73
+ setCursorSvg(cursorSvg: SVGElement): void;
68
74
  /**
69
75
  * Add the marker SVG to this block's SVG group.
70
76
  *
@@ -72,7 +78,7 @@ export interface IPathObject {
72
78
  * group.
73
79
  * @internal
74
80
  */
75
- setMarkerSvg: any;
81
+ setMarkerSvg(markerSvg: SVGElement): void;
76
82
  /**
77
83
  * Set whether the block shows a highlight or not. Block highlighting is
78
84
  * often used to visually mark blocks currently being executed.
@@ -80,14 +86,14 @@ export interface IPathObject {
80
86
  * @param highlighted True if highlighted.
81
87
  * @internal
82
88
  */
83
- updateHighlighted: any;
89
+ updateHighlighted(highlighted: boolean): void;
84
90
  /**
85
91
  * Add or remove styling showing that a block is selected.
86
92
  *
87
93
  * @param enable True if selection is enabled, false otherwise.
88
94
  * @internal
89
95
  */
90
- updateSelected: any;
96
+ updateSelected(enabled: boolean): void;
91
97
  /**
92
98
  * Add or remove styling showing that a block is dragged over a delete area.
93
99
  *
@@ -95,21 +101,21 @@ export interface IPathObject {
95
101
  * otherwise.
96
102
  * @internal
97
103
  */
98
- updateDraggingDelete: any;
104
+ updateDraggingDelete(enabled: boolean): void;
99
105
  /**
100
106
  * Add or remove styling showing that a block is an insertion marker.
101
107
  *
102
108
  * @param enable True if the block is an insertion marker, false otherwise.
103
109
  * @internal
104
110
  */
105
- updateInsertionMarker: any;
111
+ updateInsertionMarker(enabled: boolean): void;
106
112
  /**
107
113
  * Add or remove styling showing that a block is movable.
108
114
  *
109
115
  * @param enable True if the block is movable, false otherwise.
110
116
  * @internal
111
117
  */
112
- updateMovable: any;
118
+ updateMovable(enabled: boolean): void;
113
119
  /**
114
120
  * Add or remove styling that shows that if the dragging block is dropped,
115
121
  * this block will be replaced. If a shadow block, it will disappear.
@@ -118,7 +124,7 @@ export interface IPathObject {
118
124
  * @param enable True if styling should be added.
119
125
  * @internal
120
126
  */
121
- updateReplacementFade: any;
127
+ updateReplacementFade(enabled: boolean): void;
122
128
  /**
123
129
  * Add or remove styling that shows that if the dragging block is dropped,
124
130
  * this block will be connected to the input.
@@ -127,6 +133,6 @@ export interface IPathObject {
127
133
  * @param enable True if styling should be added.
128
134
  * @internal
129
135
  */
130
- updateShapeForInputHighlight: any;
136
+ updateShapeForInputHighlight(conn: RenderedConnection, enable: boolean): void;
131
137
  }
132
138
  //# sourceMappingURL=i_path_object.d.ts.map
@@ -25,9 +25,9 @@ import type { Renderer } from './renderer.js';
25
25
  * @alias Blockly.blockRendering.RenderInfo
26
26
  */
27
27
  export declare class RenderInfo {
28
- block_: any;
28
+ block_: BlockSvg;
29
29
  protected constants_: ConstantProvider;
30
- outputConnection: OutputConnection;
30
+ outputConnection: OutputConnection | null;
31
31
  isInline: boolean;
32
32
  isCollapsed: boolean;
33
33
  isInsertionMarker: boolean;
@@ -110,7 +110,7 @@ export declare class RenderInfo {
110
110
  * @param lastInput The input that follows.
111
111
  * @returns True if the next input should be rendered on a new row.
112
112
  */
113
- protected shouldStartNewRow_(input: Input, lastInput: Input): boolean;
113
+ protected shouldStartNewRow_(input: Input, lastInput?: Input): boolean;
114
114
  /** Add horizontal spacing between and around elements within each row. */
115
115
  protected addElemSpacing_(): void;
116
116
  /**
@@ -24,7 +24,7 @@ export declare class MarkerSvg {
24
24
  */
25
25
  private parent_;
26
26
  /** The current SVG element for the marker. */
27
- currentMarkerSvg: Element | null;
27
+ currentMarkerSvg: SVGElement | null;
28
28
  colour_: string;
29
29
  /** The root SVG group containing the marker. */
30
30
  protected markerSvg_: SVGGElement | null;
@@ -46,7 +46,7 @@ export declare class MarkerSvg {
46
46
  *
47
47
  * @returns The root SVG node.
48
48
  */
49
- getSvgRoot(): SVGElement;
49
+ getSvgRoot(): SVGElement | null;
50
50
  /**
51
51
  * Get the marker.
52
52
  *
@@ -188,7 +188,7 @@ export declare class MarkerSvg {
188
188
  * @param height The height of the block.
189
189
  * @param connectionShape The shape object for the connection.
190
190
  */
191
- protected positionOutput_(width: number, height: number, connectionShape: Notch | PuzzleTab): void;
191
+ protected positionOutput_(width: number, height: number, connectionShape: PuzzleTab): void;
192
192
  /**
193
193
  * Position the marker for a previous connection.
194
194
  * Displays a half rectangle with a notch in the top to represent the previous
@@ -199,7 +199,7 @@ export declare class MarkerSvg {
199
199
  * @param markerHeight The height of the marker.
200
200
  * @param connectionShape The shape object for the connection.
201
201
  */
202
- protected positionPrevious_(width: number, markerOffset: number, markerHeight: number, connectionShape: Notch | PuzzleTab): void;
202
+ protected positionPrevious_(width: number, markerOffset: number, markerHeight: number, connectionShape: Notch): void;
203
203
  /**
204
204
  * Move and show the marker at the specified coordinate in workspace units.
205
205
  * Displays a filled in rectangle.
@@ -230,7 +230,9 @@ export declare class MarkerSvg {
230
230
  *
231
231
  * @returns The object holding attributes to make the marker blink.
232
232
  */
233
- protected getBlinkProperties_(): any;
233
+ protected getBlinkProperties_(): {
234
+ [key: string]: string;
235
+ };
234
236
  /**
235
237
  * Create the marker SVG.
236
238
  *
@@ -15,7 +15,7 @@ import type { IPathObject } from './i_path_object.js';
15
15
  * @alias Blockly.blockRendering.PathObject
16
16
  */
17
17
  export declare class PathObject implements IPathObject {
18
- svgRoot: any;
18
+ svgRoot: SVGElement;
19
19
  /** @internal */
20
20
  svgPath: SVGElement;
21
21
  /**
@@ -24,14 +24,14 @@ export declare class PathObject implements IPathObject {
24
24
  *
25
25
  * @internal
26
26
  */
27
- cursorSvg: SVGElement;
27
+ cursorSvg: SVGElement | null;
28
28
  /**
29
29
  * Holds the markers svg element when the marker is attached to the block.
30
30
  * This is null if there is no marker on the block.
31
31
  *
32
32
  * @internal
33
33
  */
34
- markerSvg: SVGElement;
34
+ markerSvg: SVGElement | null;
35
35
  /** @internal */
36
36
  constants: ConstantProvider;
37
37
  /** @internal */
@@ -17,8 +17,10 @@ export declare class ConstantProvider extends BaseConstantProvider {
17
17
  * inputs inline.
18
18
  */
19
19
  MAX_BOTTOM_WIDTH: number;
20
- STATEMENT_BOTTOM_SPACER: any;
21
- /** @internal */
20
+ STATEMENT_BOTTOM_SPACER: number;
21
+ /**
22
+ * @internal
23
+ */
22
24
  constructor();
23
25
  getCSS_(selector: string): string[];
24
26
  }
@@ -7,6 +7,7 @@ import type { BlockSvg } from '../../block_svg.js';
7
7
  import { Drawer as BaseDrawer } from '../common/drawer.js';
8
8
  import type { Row } from '../measurables/row.js';
9
9
  import type { ConstantProvider } from './constants.js';
10
+ import { Highlighter } from './highlighter.js';
10
11
  import type { RenderInfo } from './info.js';
11
12
  import type { InlineInput } from './measurables/inline_input.js';
12
13
  /**
@@ -15,7 +16,7 @@ import type { InlineInput } from './measurables/inline_input.js';
15
16
  * @alias Blockly.geras.Drawer
16
17
  */
17
18
  export declare class Drawer extends BaseDrawer {
18
- highlighter_: any;
19
+ highlighter_: Highlighter;
19
20
  constants_: ConstantProvider;
20
21
  /**
21
22
  * @param block The block to render.
@@ -25,7 +25,6 @@ export declare class PathObject extends BasePathObject {
25
25
  * @internal
26
26
  */
27
27
  colourDark: string;
28
- style: any;
29
28
  /**
30
29
  * @param root The root SVG element.
31
30
  * @param style The style object to use for colouring.
@@ -15,6 +15,7 @@ import { Measurable } from './base.js';
15
15
  export declare class Icon extends Measurable {
16
16
  icon: BlocklyIcon;
17
17
  isVisible: boolean;
18
+ flipRtl: boolean;
18
19
  /**
19
20
  * An object containing information about the space an icon takes up during
20
21
  * rendering
@@ -124,7 +124,7 @@ export declare class Row {
124
124
  * @returns The last input on the row, or null.
125
125
  * @internal
126
126
  */
127
- getLastInput(): InputConnection;
127
+ getLastInput(): InputConnection | null;
128
128
  /**
129
129
  * Inspect all subcomponents and populate all size properties on the row.
130
130
  *
@@ -151,13 +151,13 @@ export declare class Row {
151
151
  * @returns The first spacer element on this row.
152
152
  * @internal
153
153
  */
154
- getFirstSpacer(): InRowSpacer;
154
+ getFirstSpacer(): InRowSpacer | null;
155
155
  /**
156
156
  * Convenience method to get the last spacer element on this row.
157
157
  *
158
158
  * @returns The last spacer element on this row.
159
159
  * @internal
160
160
  */
161
- getLastSpacer(): InRowSpacer;
161
+ getLastSpacer(): InRowSpacer | null;
162
162
  }
163
163
  //# sourceMappingURL=row.d.ts.map
@@ -32,7 +32,6 @@ export declare class TopRow extends Row {
32
32
  hasPreviousConnection: boolean;
33
33
  /** The previous connection on the block, if any. */
34
34
  connection: PreviousConnection | null;
35
- widthWithConnectedBlocks: any;
36
35
  /**
37
36
  * @param constants The rendering constants provider.
38
37
  * @internal
@@ -16,6 +16,7 @@ import type { Renderer } from './renderer.js';
16
16
  * @alias Blockly.minimalist.RenderInfo
17
17
  */
18
18
  export declare class RenderInfo extends BaseRenderInfo {
19
+ protected renderer_: Renderer;
19
20
  /**
20
21
  * @param renderer The renderer in use.
21
22
  * @param block The block to measure.
@@ -18,9 +18,7 @@ import type { Renderer } from './renderer.js';
18
18
  * @alias Blockly.thrasos.RenderInfo
19
19
  */
20
20
  export declare class RenderInfo extends BaseRenderInfo {
21
- widthWithChildren: any;
22
- height: any;
23
- startY: any;
21
+ protected renderer_: Renderer;
24
22
  /**
25
23
  * @param renderer The renderer in use.
26
24
  * @param block The block to measure.
@@ -25,31 +25,7 @@ export interface InsideCorners {
25
25
  */
26
26
  export declare class ConstantProvider extends BaseConstantProvider {
27
27
  GRID_UNIT: number;
28
- SMALL_PADDING: any;
29
- MEDIUM_PADDING: any;
30
- MEDIUM_LARGE_PADDING: any;
31
- LARGE_PADDING: any;
32
- CORNER_RADIUS: any;
33
- NOTCH_WIDTH: any;
34
- NOTCH_HEIGHT: any;
35
- NOTCH_OFFSET_LEFT: any;
36
- STATEMENT_INPUT_NOTCH_OFFSET: any;
37
- MIN_BLOCK_WIDTH: any;
38
- MIN_BLOCK_HEIGHT: any;
39
- EMPTY_STATEMENT_INPUT_HEIGHT: any;
40
- TAB_OFFSET_FROM_TOP: number;
41
- TOP_ROW_MIN_HEIGHT: any;
42
- TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT: any;
43
- BOTTOM_ROW_MIN_HEIGHT: any;
44
- BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT: any;
45
- STATEMENT_BOTTOM_SPACER: any;
46
28
  STATEMENT_INPUT_SPACER_MIN_WIDTH: number;
47
- STATEMENT_INPUT_PADDING_LEFT: any;
48
- EMPTY_INLINE_INPUT_PADDING: any;
49
- EMPTY_INLINE_INPUT_HEIGHT: any;
50
- DUMMY_INPUT_MIN_HEIGHT: any;
51
- DUMMY_INPUT_SHADOW_MIN_HEIGHT: any;
52
- CURSOR_WS_WIDTH: any;
53
29
  CURSOR_COLOUR: string;
54
30
  /**
55
31
  * Radius of the cursor for input and output connections.
@@ -68,25 +44,28 @@ export declare class ConstantProvider extends BaseConstantProvider {
68
44
  PUZZLE: number;
69
45
  NOTCH: number;
70
46
  };
71
- SHAPE_IN_SHAPE_PADDING: any;
47
+ /**
48
+ * Map of output/input shapes and the amount they should cause a block to be
49
+ * padded. Outer key is the outer shape, inner key is the inner shape.
50
+ * When a block with the outer shape contains an input block with the inner
51
+ * shape on its left or right edge, the block elements are aligned such that
52
+ * the padding specified is reached.
53
+ *
54
+ * @internal
55
+ */
56
+ SHAPE_IN_SHAPE_PADDING: {
57
+ [key: number]: {
58
+ [key: number]: number;
59
+ };
60
+ };
72
61
  FULL_BLOCK_FIELDS: boolean;
73
- FIELD_TEXT_FONTSIZE: any;
74
62
  FIELD_TEXT_FONTWEIGHT: string;
75
63
  FIELD_TEXT_FONTFAMILY: string;
76
- FIELD_BORDER_RECT_RADIUS: any;
77
- FIELD_BORDER_RECT_X_PADDING: any;
78
- FIELD_BORDER_RECT_Y_PADDING: any;
79
- FIELD_BORDER_RECT_HEIGHT: any;
80
- FIELD_DROPDOWN_BORDER_RECT_HEIGHT: any;
81
64
  FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW: boolean;
82
65
  FIELD_DROPDOWN_COLOURED_DIV: boolean;
83
66
  FIELD_DROPDOWN_SVG_ARROW: boolean;
84
- FIELD_DROPDOWN_SVG_ARROW_PADDING: any;
85
67
  FIELD_TEXTINPUT_BOX_SHADOW: boolean;
86
68
  FIELD_COLOUR_FULL_BLOCK: boolean;
87
- FIELD_COLOUR_DEFAULT_WIDTH: any;
88
- FIELD_COLOUR_DEFAULT_HEIGHT: any;
89
- FIELD_CHECKBOX_X_OFFSET: any;
90
69
  MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH: number;
91
70
  /** The selected glow colour. */
92
71
  SELECTED_GLOW_COLOUR: string;
@@ -171,18 +150,18 @@ export declare class ConstantProvider extends BaseConstantProvider {
171
150
  shapeFor(connection: RenderedConnection): Shape;
172
151
  makeNotch(): {
173
152
  type: number;
174
- width: any;
175
- height: any;
153
+ width: number;
154
+ height: number;
176
155
  pathLeft: string;
177
156
  pathRight: string;
178
157
  };
179
158
  makeInsideCorners(): {
180
- width: any;
181
- height: any;
159
+ width: number;
160
+ height: number;
182
161
  pathTop: string;
183
162
  pathBottom: string;
184
- rightWidth: any;
185
- rightHeight: any;
163
+ rightWidth: number;
164
+ rightHeight: number;
186
165
  pathTopRight: string;
187
166
  pathBottomRight: string;
188
167
  };
@@ -14,7 +14,6 @@ import { StatementInput as BaseStatementInput } from '../../../renderers/measura
14
14
  */
15
15
  export declare class StatementInput extends BaseStatementInput {
16
16
  connectedBottomNextConnection: boolean;
17
- height: any;
18
17
  /**
19
18
  * @param constants The rendering constants provider.
20
19
  * @param input The statement input to measure and store information for.
@@ -30,7 +30,7 @@ export declare class PathObject extends BasePathObject {
30
30
  * The type of block's output connection shape. This is set when a block
31
31
  * with an output connection is drawn.
32
32
  */
33
- outputShapeType: null;
33
+ outputShapeType: number | null;
34
34
  /** @internal */
35
35
  constants: ConstantProvider;
36
36
  /**
package/core/theme.d.ts CHANGED
@@ -4,15 +4,15 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  export interface ITheme {
7
- blockStyles: {
7
+ blockStyles?: {
8
8
  [key: string]: BlockStyle;
9
9
  };
10
- categoryStyles: {
10
+ categoryStyles?: {
11
11
  [key: string]: CategoryStyle;
12
12
  };
13
- componentStyles: ComponentStyle;
14
- fontStyle: FontStyle;
15
- startHats: boolean | null;
13
+ componentStyles?: ComponentStyle;
14
+ fontStyle?: FontStyle;
15
+ startHats?: boolean;
16
16
  base?: string | Theme;
17
17
  name: string;
18
18
  }
@@ -41,7 +41,7 @@ export declare class Theme implements ITheme {
41
41
  *
42
42
  * @internal
43
43
  */
44
- startHats: boolean | null;
44
+ startHats?: boolean;
45
45
  /**
46
46
  * @param name Theme name.
47
47
  * @param opt_blockStyles A map from style names (strings) to objects with
@@ -115,35 +115,35 @@ export declare class Theme implements ITheme {
115
115
  export declare namespace Theme {
116
116
  interface BlockStyle {
117
117
  colourPrimary: string;
118
- colourSecondary: string;
119
- colourTertiary: string;
118
+ colourSecondary?: string;
119
+ colourTertiary?: string;
120
120
  hat?: string;
121
121
  }
122
122
  interface CategoryStyle {
123
123
  colour: string;
124
124
  }
125
125
  interface ComponentStyle {
126
- workspaceBackgroundColour: string | null;
127
- toolboxBackgroundColour: string | null;
128
- toolboxForegroundColour: string | null;
129
- flyoutBackgroundColour: string | null;
130
- flyoutForegroundColour: string | null;
131
- flyoutOpacity: number | null;
132
- scrollbarColour: string | null;
133
- scrollbarOpacity: number | null;
134
- insertionMarkerColour: string | null;
135
- insertionMarkerOpacity: number | null;
136
- markerColour: string | null;
137
- cursorColour: string | null;
138
- selectedGlowColour: string | null;
139
- selectedGlowOpacity: number | null;
140
- replacementGlowColour: string | null;
141
- replacementGlowOpacity: number | null;
126
+ workspaceBackgroundColour?: string;
127
+ toolboxBackgroundColour?: string;
128
+ toolboxForegroundColour?: string;
129
+ flyoutBackgroundColour?: string;
130
+ flyoutForegroundColour?: string;
131
+ flyoutOpacity?: number;
132
+ scrollbarColour?: string;
133
+ scrollbarOpacity?: number;
134
+ insertionMarkerColour?: string;
135
+ insertionMarkerOpacity?: number;
136
+ markerColour?: string;
137
+ cursorColour?: string;
138
+ selectedGlowColour?: string;
139
+ selectedGlowOpacity?: number;
140
+ replacementGlowColour?: string;
141
+ replacementGlowOpacity?: number;
142
142
  }
143
143
  interface FontStyle {
144
- family: string | null;
145
- weight: string | null;
146
- size: number | null;
144
+ family?: string;
145
+ weight?: string;
146
+ size?: number;
147
147
  }
148
148
  }
149
149
  export declare type BlockStyle = Theme.BlockStyle;