blockly 11.2.0 → 12.0.0-beta.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.
Files changed (104) hide show
  1. package/blockly.min.js +783 -767
  2. package/blockly.mjs +6 -1
  3. package/blockly_compressed.js +768 -752
  4. package/blockly_compressed.js.map +1 -1
  5. package/blocks_compressed.js +15 -15
  6. package/blocks_compressed.js.map +1 -1
  7. package/core/block.d.ts +11 -6
  8. package/core/block_flyout_inflater.d.ts +95 -0
  9. package/core/block_svg.d.ts +26 -2
  10. package/core/blockly.d.ts +11 -3
  11. package/core/bubbles/textinput_bubble.d.ts +9 -0
  12. package/core/button_flyout_inflater.d.ts +42 -0
  13. package/core/clipboard.d.ts +2 -2
  14. package/core/comments/comment_view.d.ts +4 -0
  15. package/core/comments/rendered_workspace_comment.d.ts +2 -0
  16. package/core/connection.d.ts +1 -1
  17. package/core/dropdowndiv.d.ts +1 -1
  18. package/core/events/events.d.ts +1 -0
  19. package/core/events/events_var_base.d.ts +2 -2
  20. package/core/events/events_var_create.d.ts +7 -2
  21. package/core/events/events_var_delete.d.ts +2 -4
  22. package/core/events/events_var_rename.d.ts +2 -4
  23. package/core/events/events_var_type_change.d.ts +55 -0
  24. package/core/events/type.d.ts +2 -0
  25. package/core/field.d.ts +0 -13
  26. package/core/field_checkbox.d.ts +0 -4
  27. package/core/field_dropdown.d.ts +0 -2
  28. package/core/field_input.d.ts +0 -2
  29. package/core/field_number.d.ts +6 -0
  30. package/core/field_textinput.d.ts +1 -0
  31. package/core/field_variable.d.ts +9 -2
  32. package/core/flyout_base.d.ts +45 -181
  33. package/core/flyout_button.d.ts +25 -6
  34. package/core/flyout_horizontal.d.ts +4 -4
  35. package/core/flyout_item.d.ts +32 -0
  36. package/core/flyout_separator.d.ts +45 -0
  37. package/core/flyout_vertical.d.ts +5 -5
  38. package/core/grid.d.ts +4 -1
  39. package/core/icons/comment_icon.d.ts +15 -0
  40. package/core/interfaces/i_comment_icon.d.ts +3 -0
  41. package/core/interfaces/i_flyout.d.ts +1 -1
  42. package/core/interfaces/i_flyout_inflater.d.ts +48 -0
  43. package/core/interfaces/i_metrics_manager.d.ts +1 -1
  44. package/core/interfaces/i_rendered_element.d.ts +1 -4
  45. package/core/interfaces/i_toolbox.d.ts +8 -1
  46. package/core/interfaces/i_variable_backed_parameter_model.d.ts +2 -2
  47. package/core/interfaces/i_variable_map.d.ts +48 -0
  48. package/core/interfaces/i_variable_model.d.ts +36 -0
  49. package/core/label_flyout_inflater.d.ts +42 -0
  50. package/core/menu.d.ts +1 -3
  51. package/core/menuitem.d.ts +0 -7
  52. package/core/metrics_manager.d.ts +1 -1
  53. package/core/names.d.ts +8 -2
  54. package/core/procedures.d.ts +7 -4
  55. package/core/registry.d.ts +6 -0
  56. package/core/renderers/common/constants.d.ts +6 -1
  57. package/core/renderers/common/i_path_object.d.ts +13 -13
  58. package/core/renderers/common/renderer.d.ts +13 -18
  59. package/core/renderers/geras/renderer.d.ts +1 -1
  60. package/core/renderers/measurables/in_row_spacer.d.ts +1 -0
  61. package/core/renderers/measurables/jagged_edge.d.ts +1 -0
  62. package/core/renderers/measurables/next_connection.d.ts +1 -0
  63. package/core/renderers/measurables/previous_connection.d.ts +1 -0
  64. package/core/renderers/measurables/round_corner.d.ts +1 -0
  65. package/core/renderers/measurables/square_corner.d.ts +1 -0
  66. package/core/renderers/measurables/statement_input.d.ts +1 -0
  67. package/core/renderers/measurables/types.d.ts +49 -24
  68. package/core/renderers/zelos/constants.d.ts +8 -2
  69. package/core/renderers/zelos/renderer.d.ts +0 -7
  70. package/core/separator_flyout_inflater.d.ts +57 -0
  71. package/core/serialization/variables.d.ts +3 -10
  72. package/core/toolbox/toolbox.d.ts +2 -5
  73. package/core/variable_map.d.ts +27 -29
  74. package/core/variable_model.d.ts +37 -11
  75. package/core/variables.d.ts +56 -12
  76. package/core/variables_dynamic.d.ts +7 -5
  77. package/core/widgetdiv.d.ts +2 -2
  78. package/core/workspace.d.ts +21 -19
  79. package/core/workspace_svg.d.ts +34 -6
  80. package/core/xml.d.ts +2 -2
  81. package/index.mjs +6 -1
  82. package/media/1x1.gif +0 -0
  83. package/media/click.mp3 +0 -0
  84. package/media/click.ogg +0 -0
  85. package/media/click.wav +0 -0
  86. package/media/delete.mp3 +0 -0
  87. package/media/delete.ogg +0 -0
  88. package/media/delete.wav +0 -0
  89. package/media/disconnect.mp3 +0 -0
  90. package/media/disconnect.ogg +0 -0
  91. package/media/disconnect.wav +0 -0
  92. package/media/handclosed.cur +0 -0
  93. package/media/handdelete.cur +0 -0
  94. package/media/handopen.cur +0 -0
  95. package/media/pilcrow.png +0 -0
  96. package/media/quote0.png +0 -0
  97. package/media/quote1.png +0 -0
  98. package/media/sprites.png +0 -0
  99. package/package.json +1 -1
  100. package/php_compressed.js +1 -1
  101. package/php_compressed.js.map +1 -1
  102. package/python_compressed.js +1 -1
  103. package/python_compressed.js.map +1 -1
  104. package/core/insertion_marker_manager.d.ts +0 -249
@@ -1,249 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import type { BlockSvg } from './block_svg.js';
7
- import type { IDragTarget } from './interfaces/i_drag_target.js';
8
- import type { Coordinate } from './utils/coordinate.js';
9
- /**
10
- * Class that controls updates to connections during drags. It is primarily
11
- * responsible for finding the closest eligible connection and highlighting or
12
- * unhighlighting it as needed during a drag.
13
- *
14
- * @deprecated v10 - Use an IConnectionPreviewer instead.
15
- */
16
- export declare class InsertionMarkerManager {
17
- /**
18
- * The top block in the stack being dragged.
19
- * Does not change during a drag.
20
- */
21
- private readonly topBlock;
22
- /**
23
- * The workspace on which these connections are being dragged.
24
- * Does not change during a drag.
25
- */
26
- private readonly workspace;
27
- /**
28
- * The last connection on the stack, if it's not the last connection on the
29
- * first block.
30
- * Set in initAvailableConnections, if at all.
31
- */
32
- private lastOnStack;
33
- /**
34
- * The insertion marker corresponding to the last block in the stack, if
35
- * that's not the same as the first block in the stack.
36
- * Set in initAvailableConnections, if at all
37
- */
38
- private lastMarker;
39
- /**
40
- * The insertion marker that shows up between blocks to show where a block
41
- * would go if dropped immediately.
42
- */
43
- private firstMarker;
44
- /**
45
- * Information about the connection that would be made if the dragging block
46
- * were released immediately. Updated on every mouse move.
47
- */
48
- private activeCandidate;
49
- /**
50
- * Whether the block would be deleted if it were dropped immediately.
51
- * Updated on every mouse move.
52
- *
53
- * @internal
54
- */
55
- wouldDeleteBlock: boolean;
56
- /**
57
- * Connection on the insertion marker block that corresponds to
58
- * the active candidate's local connection on the currently dragged block.
59
- */
60
- private markerConnection;
61
- /** The block that currently has an input being highlighted, or null. */
62
- private highlightedBlock;
63
- /** The block being faded to indicate replacement, or null. */
64
- private fadedBlock;
65
- /**
66
- * The connections on the dragging blocks that are available to connect to
67
- * other blocks. This includes all open connections on the top block, as
68
- * well as the last connection on the block stack.
69
- */
70
- private availableConnections;
71
- /** @param block The top block in the stack being dragged. */
72
- constructor(block: BlockSvg);
73
- /**
74
- * Sever all links from this object.
75
- *
76
- * @internal
77
- */
78
- dispose(): void;
79
- /**
80
- * Update the available connections for the top block. These connections can
81
- * change if a block is unplugged and the stack is healed.
82
- *
83
- * @internal
84
- */
85
- updateAvailableConnections(): void;
86
- /**
87
- * Return whether the block would be connected if dropped immediately, based
88
- * on information from the most recent move event.
89
- *
90
- * @returns True if the block would be connected if dropped immediately.
91
- * @internal
92
- */
93
- wouldConnectBlock(): boolean;
94
- /**
95
- * Connect to the closest connection and render the results.
96
- * This should be called at the end of a drag.
97
- *
98
- * @internal
99
- */
100
- applyConnections(): void;
101
- /**
102
- * Update connections based on the most recent move location.
103
- *
104
- * @param dxy Position relative to drag start, in workspace units.
105
- * @param dragTarget The drag target that the block is currently over.
106
- * @internal
107
- */
108
- update(dxy: Coordinate, dragTarget: IDragTarget | null): void;
109
- /**
110
- * Create an insertion marker that represents the given block.
111
- *
112
- * @param sourceBlock The block that the insertion marker will represent.
113
- * @returns The insertion marker that represents the given block.
114
- */
115
- private createMarkerBlock;
116
- /**
117
- * Populate the list of available connections on this block stack. If the
118
- * stack has more than one block, this function will also update lastOnStack.
119
- *
120
- * @returns A list of available connections.
121
- */
122
- private initAvailableConnections;
123
- /**
124
- * Whether the previews (insertion marker and replacement marker) should be
125
- * updated based on the closest candidate and the current drag distance.
126
- *
127
- * @param newCandidate A new candidate connection that may replace the current
128
- * best candidate.
129
- * @param dxy Position relative to drag start, in workspace units.
130
- * @returns Whether the preview should be updated.
131
- */
132
- private shouldUpdatePreviews;
133
- /**
134
- * Find the nearest valid connection, which may be the same as the current
135
- * closest connection.
136
- *
137
- * @param dxy Position relative to drag start, in workspace units.
138
- * @returns An object containing a local connection, a closest connection, and
139
- * a radius.
140
- */
141
- private getCandidate;
142
- /**
143
- * Decide the radius at which to start searching for the closest connection.
144
- *
145
- * @returns The radius at which to start the search for the closest
146
- * connection.
147
- */
148
- private getStartRadius;
149
- /**
150
- * Whether ending the drag would delete the block.
151
- *
152
- * @param newCandidate Whether there is a candidate connection that the
153
- * block could connect to if the drag ended immediately.
154
- * @param dragTarget The drag target that the block is currently over.
155
- * @returns Whether dropping the block immediately would delete the block.
156
- */
157
- private shouldDelete;
158
- /**
159
- * Show an insertion marker or replacement highlighting during a drag, if
160
- * needed.
161
- * At the beginning of this function, this.activeConnection should be null.
162
- *
163
- * @param newCandidate A new candidate connection that may replace the current
164
- * best candidate.
165
- */
166
- private maybeShowPreview;
167
- /**
168
- * A preview should be shown. This function figures out if it should be a
169
- * block highlight or an insertion marker, and shows the appropriate one.
170
- *
171
- * @param activeCandidate The connection that will be made if the drag ends
172
- * immediately.
173
- */
174
- private showPreview;
175
- /**
176
- * Hide an insertion marker or replacement highlighting during a drag, if
177
- * needed.
178
- * At the end of this function, this.activeCandidate will be null.
179
- *
180
- * @param newCandidate A new candidate connection that may replace the current
181
- * best candidate.
182
- */
183
- private maybeHidePreview;
184
- /**
185
- * A preview should be hidden. Loop through all possible preview modes
186
- * and hide everything.
187
- */
188
- private hidePreview;
189
- /**
190
- * Shows an insertion marker connected to the appropriate blocks (based on
191
- * manager state).
192
- *
193
- * @param activeCandidate The connection that will be made if the drag ends
194
- * immediately.
195
- */
196
- private showInsertionMarker;
197
- /**
198
- * Disconnects and hides the current insertion marker. Should return the
199
- * blocks to their original state.
200
- */
201
- private hideInsertionMarker;
202
- /**
203
- * Shows an outline around the input the closest connection belongs to.
204
- *
205
- * @param activeCandidate The connection that will be made if the drag ends
206
- * immediately.
207
- */
208
- private showInsertionInputOutline;
209
- /** Hides any visible input outlines. */
210
- private hideInsertionInputOutline;
211
- /**
212
- * Shows a replacement fade affect on the closest connection's target block
213
- * (the block that is currently connected to it).
214
- *
215
- * @param activeCandidate The connection that will be made if the drag ends
216
- * immediately.
217
- */
218
- private showReplacementFade;
219
- /**
220
- * Hides/Removes any visible fade affects.
221
- */
222
- private hideReplacementFade;
223
- /**
224
- * Get a list of the insertion markers that currently exist. Drags have 0, 1,
225
- * or 2 insertion markers.
226
- *
227
- * @returns A possibly empty list of insertion marker blocks.
228
- * @internal
229
- */
230
- getInsertionMarkers(): BlockSvg[];
231
- /**
232
- * Safely disposes of an insertion marker.
233
- */
234
- private disposeInsertionMarker;
235
- }
236
- export declare namespace InsertionMarkerManager {
237
- /**
238
- * An enum describing different kinds of previews the InsertionMarkerManager
239
- * could display.
240
- */
241
- enum PREVIEW_TYPE {
242
- INSERTION_MARKER = 0,
243
- INPUT_OUTLINE = 1,
244
- REPLACEMENT_FADE = 2
245
- }
246
- }
247
- export type PreviewType = InsertionMarkerManager.PREVIEW_TYPE;
248
- export declare const PreviewType: typeof InsertionMarkerManager.PREVIEW_TYPE;
249
- //# sourceMappingURL=insertion_marker_manager.d.ts.map