blockly 9.3.2 → 10.0.0-beta.0

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 (160) hide show
  1. package/README.md +9 -7
  2. package/blockly.min.js +1304 -1404
  3. package/blockly_compressed.js +1057 -1099
  4. package/blockly_compressed.js.map +1 -1
  5. package/blocks_compressed.js +120 -136
  6. package/blocks_compressed.js.map +1 -1
  7. package/core/block.d.ts +59 -32
  8. package/core/block_dragger.d.ts +2 -2
  9. package/core/block_svg.d.ts +38 -67
  10. package/core/blockly.d.ts +18 -112
  11. package/core/browser_events.d.ts +1 -2
  12. package/core/bubble_dragger.d.ts +1 -2
  13. package/core/{bubble.d.ts → bubble_old.d.ts} +3 -7
  14. package/core/bubbles/bubble.d.ts +174 -0
  15. package/core/bubbles/mini_workspace_bubble.d.ts +80 -0
  16. package/core/bubbles/text_bubble.d.ts +35 -0
  17. package/core/bubbles/textinput_bubble.d.ts +89 -0
  18. package/core/bump_objects.d.ts +6 -4
  19. package/core/connection.d.ts +19 -9
  20. package/core/connection_db.d.ts +4 -4
  21. package/core/contextmenu.d.ts +1 -2
  22. package/core/events/events.d.ts +1 -4
  23. package/core/events/events_abstract.d.ts +0 -6
  24. package/core/events/events_block_base.d.ts +0 -6
  25. package/core/events/events_block_change.d.ts +0 -6
  26. package/core/events/events_block_create.d.ts +0 -6
  27. package/core/events/events_block_delete.d.ts +0 -6
  28. package/core/events/events_block_drag.d.ts +0 -6
  29. package/core/events/events_block_move.d.ts +21 -7
  30. package/core/events/events_bubble_open.d.ts +0 -6
  31. package/core/events/events_click.d.ts +0 -6
  32. package/core/events/events_comment_base.d.ts +0 -6
  33. package/core/events/events_comment_change.d.ts +0 -6
  34. package/core/events/events_comment_create.d.ts +0 -6
  35. package/core/events/events_comment_move.d.ts +0 -6
  36. package/core/events/events_marker_move.d.ts +0 -6
  37. package/core/events/events_selected.d.ts +0 -6
  38. package/core/events/events_theme_change.d.ts +0 -6
  39. package/core/events/events_toolbox_item_select.d.ts +0 -6
  40. package/core/events/events_trashcan_open.d.ts +0 -6
  41. package/core/events/events_var_base.d.ts +0 -6
  42. package/core/events/events_var_create.d.ts +0 -6
  43. package/core/events/events_var_delete.d.ts +0 -6
  44. package/core/events/events_var_rename.d.ts +0 -6
  45. package/core/events/events_viewport.d.ts +0 -6
  46. package/core/events/utils.d.ts +1 -1
  47. package/core/events/workspace_events.d.ts +1 -16
  48. package/core/field.d.ts +31 -5
  49. package/core/field_checkbox.d.ts +1 -1
  50. package/core/field_colour.d.ts +0 -2
  51. package/core/field_dropdown.d.ts +11 -13
  52. package/core/field_image.d.ts +5 -5
  53. package/core/field_input.d.ts +9 -2
  54. package/core/field_label.d.ts +3 -1
  55. package/core/field_number.d.ts +4 -4
  56. package/core/field_variable.d.ts +5 -5
  57. package/core/flyout_base.d.ts +23 -25
  58. package/core/flyout_button.d.ts +9 -9
  59. package/core/flyout_horizontal.d.ts +1 -1
  60. package/core/flyout_vertical.d.ts +1 -1
  61. package/core/generator.d.ts +15 -2
  62. package/core/gesture.d.ts +58 -41
  63. package/core/icons/comment_icon.d.ts +108 -0
  64. package/core/icons/exceptions.d.ts +14 -0
  65. package/core/icons/icon.d.ts +38 -0
  66. package/core/icons/icon_types.d.ts +22 -0
  67. package/core/icons/mutator_icon.d.ts +90 -0
  68. package/core/icons/registry.d.ts +23 -0
  69. package/core/icons/warning_icon.d.ts +67 -0
  70. package/core/icons.d.ts +12 -0
  71. package/core/inputs/dummy_input.d.ts +20 -0
  72. package/core/{input.d.ts → inputs/input.d.ts} +20 -13
  73. package/core/{input_types.d.ts → inputs/input_types.d.ts} +2 -1
  74. package/core/inputs/statement_input.d.ts +22 -0
  75. package/core/inputs/value_input.d.ts +20 -0
  76. package/core/interfaces/i_block_dragger.d.ts +1 -1
  77. package/core/interfaces/i_bounded_element.d.ts +2 -1
  78. package/core/interfaces/i_bubble.d.ts +2 -14
  79. package/core/interfaces/i_has_bubble.d.ts +14 -0
  80. package/core/interfaces/i_icon.d.ts +75 -0
  81. package/core/interfaces/i_serializable.d.ts +24 -0
  82. package/core/keyboard_nav/ast_node.d.ts +15 -15
  83. package/core/keyboard_nav/basic_cursor.d.ts +2 -2
  84. package/core/keyboard_nav/marker.d.ts +2 -2
  85. package/core/main.d.ts +0 -10
  86. package/core/marker_manager.d.ts +0 -1
  87. package/core/names.d.ts +4 -4
  88. package/core/options.d.ts +3 -3
  89. package/core/procedures.d.ts +1 -4
  90. package/core/registry.d.ts +5 -0
  91. package/core/render_management.d.ts +9 -1
  92. package/core/rendered_connection.d.ts +7 -7
  93. package/core/renderers/common/block_rendering.d.ts +0 -10
  94. package/core/renderers/common/constants.d.ts +5 -7
  95. package/core/renderers/common/drawer.d.ts +7 -2
  96. package/core/renderers/common/info.d.ts +1 -4
  97. package/core/renderers/common/marker_svg.d.ts +4 -4
  98. package/core/renderers/common/renderer.d.ts +0 -9
  99. package/core/renderers/geras/highlighter.d.ts +1 -1
  100. package/core/renderers/geras/info.d.ts +1 -1
  101. package/core/renderers/geras/measurables/inline_input.d.ts +1 -1
  102. package/core/renderers/geras/measurables/statement_input.d.ts +1 -1
  103. package/core/renderers/geras/renderer.d.ts +1 -1
  104. package/core/renderers/measurables/external_value_input.d.ts +1 -1
  105. package/core/renderers/measurables/field.d.ts +1 -1
  106. package/core/renderers/measurables/icon.d.ts +5 -1
  107. package/core/renderers/measurables/inline_input.d.ts +1 -1
  108. package/core/renderers/measurables/input_connection.d.ts +1 -1
  109. package/core/renderers/measurables/statement_input.d.ts +1 -1
  110. package/core/renderers/zelos/constants.d.ts +2 -2
  111. package/core/renderers/zelos/info.d.ts +2 -2
  112. package/core/renderers/zelos/marker_svg.d.ts +3 -3
  113. package/core/renderers/zelos/measurables/inputs.d.ts +1 -1
  114. package/core/renderers/zelos/path_object.d.ts +3 -3
  115. package/core/scrollbar.d.ts +0 -2
  116. package/core/scrollbar_pair.d.ts +0 -2
  117. package/core/serialization/blocks.d.ts +3 -3
  118. package/core/serialization/exceptions.d.ts +11 -0
  119. package/core/shortcut_registry.d.ts +2 -2
  120. package/core/theme_manager.d.ts +0 -1
  121. package/core/touch.d.ts +0 -43
  122. package/core/trashcan.d.ts +19 -21
  123. package/core/utils/dom.d.ts +2 -2
  124. package/core/utils/object.d.ts +0 -25
  125. package/core/utils/rect.d.ts +2 -0
  126. package/core/utils/style.d.ts +0 -12
  127. package/core/utils/svg_math.d.ts +0 -8
  128. package/core/utils/xml.d.ts +15 -22
  129. package/core/utils.d.ts +0 -138
  130. package/core/widgetdiv.d.ts +5 -0
  131. package/core/workspace.d.ts +9 -3
  132. package/core/workspace_comment.d.ts +3 -3
  133. package/core/workspace_comment_svg.d.ts +31 -44
  134. package/core/workspace_dragger.d.ts +1 -4
  135. package/core/workspace_svg.d.ts +13 -50
  136. package/core/xml.d.ts +0 -12
  137. package/core-browser.js +0 -1
  138. package/core.js +0 -1
  139. package/dart_compressed.js +124 -159
  140. package/dart_compressed.js.map +1 -1
  141. package/javascript_compressed.js +127 -169
  142. package/javascript_compressed.js.map +1 -1
  143. package/lua_compressed.js +119 -142
  144. package/lua_compressed.js.map +1 -1
  145. package/msg/constants.d.ts +1 -3
  146. package/msg/msg.d.ts +1 -2
  147. package/msg/qqq.d.ts +1 -3
  148. package/msg/synonyms.d.ts +1 -3
  149. package/package.json +12 -13
  150. package/php_compressed.js +131 -161
  151. package/php_compressed.js.map +1 -1
  152. package/python_compressed.js +118 -149
  153. package/python_compressed.js.map +1 -1
  154. package/core/comment.d.ts +0 -115
  155. package/core/events/events_ui.d.ts +0 -40
  156. package/core/icon.d.ts +0 -89
  157. package/core/mutator.d.ts +0 -142
  158. package/core/renderers/common/debug.d.ts +0 -29
  159. package/core/renderers/common/debugger.d.ts +0 -117
  160. package/core/warning.d.ts +0 -53
@@ -18,7 +18,7 @@ export declare class FieldVariable extends FieldDropdown {
18
18
  protected menuGenerator_: MenuGenerator | undefined;
19
19
  defaultVariableName: string;
20
20
  /** The type of the default variable for this field. */
21
- private defaultType_;
21
+ private defaultType;
22
22
  /**
23
23
  * All of the types of variables that will be available in this field's
24
24
  * dropdown.
@@ -26,7 +26,7 @@ export declare class FieldVariable extends FieldDropdown {
26
26
  variableTypes: string[] | null;
27
27
  protected size_: Size;
28
28
  /** The variable model associated with this field. */
29
- private variable_;
29
+ private variable;
30
30
  /**
31
31
  * Serializable fields are saved by the serializer, non-serializable fields
32
32
  * are not. Editable fields should also be serializable.
@@ -158,14 +158,14 @@ export declare class FieldVariable extends FieldDropdown {
158
158
  * @param type The type to check.
159
159
  * @returns True if the type is in the list of allowed types.
160
160
  */
161
- private typeIsAllowed_;
161
+ private typeIsAllowed;
162
162
  /**
163
163
  * Return a list of variable types to include in the dropdown.
164
164
  *
165
165
  * @returns Array of variable types.
166
166
  * @throws {Error} if variableTypes is an empty array.
167
167
  */
168
- private getVariableTypes_;
168
+ private getVariableTypes;
169
169
  /**
170
170
  * Parse the optional arguments representing the allowed variable types and
171
171
  * the default variable type.
@@ -176,7 +176,7 @@ export declare class FieldVariable extends FieldDropdown {
176
176
  * @param defaultType The type of the variable to create if this field's
177
177
  * value is not explicitly set. Defaults to ''.
178
178
  */
179
- private setTypes_;
179
+ private setTypes;
180
180
  /**
181
181
  * Refreshes the name of the variable by grabbing the name of the model.
182
182
  * Used when a variable gets renamed, but the ID stays the same. Should only
@@ -102,18 +102,18 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
102
102
  * Function that will be registered as a change listener on the workspace
103
103
  * to reflow when blocks in the flyout workspace change.
104
104
  */
105
- private reflowWrapper_;
105
+ private reflowWrapper;
106
106
  /**
107
107
  * Function that disables blocks in the flyout based on max block counts
108
108
  * allowed in the target workspace. Registered as a change listener on the
109
109
  * target workspace.
110
110
  */
111
- private filterWrapper_;
111
+ private filterWrapper;
112
112
  /**
113
113
  * List of background mats that lurk behind each block to catch clicks
114
114
  * landing in the blocks' lakes and bays.
115
115
  */
116
- private mats_;
116
+ private mats;
117
117
  /**
118
118
  * List of visible buttons.
119
119
  */
@@ -121,11 +121,11 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
121
121
  /**
122
122
  * List of event listeners.
123
123
  */
124
- private listeners_;
124
+ private listeners;
125
125
  /**
126
126
  * List of blocks that should always be disabled.
127
127
  */
128
- private permanentlyDisabled_;
128
+ private permanentlyDisabled;
129
129
  protected readonly tabWidth_: number;
130
130
  /**
131
131
  * The target workspace.
@@ -136,7 +136,7 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
136
136
  /**
137
137
  * A list of blocks that can be reused.
138
138
  */
139
- private recycledBlocks_;
139
+ private recycledBlocks;
140
140
  /**
141
141
  * Does the flyout automatically close when a block is created?
142
142
  */
@@ -148,7 +148,7 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
148
148
  /**
149
149
  * Whether the workspace containing this flyout is visible.
150
150
  */
151
- private containerVisible_;
151
+ private containerVisible;
152
152
  protected rectMap_: WeakMap<BlockSvg, SVGElement>;
153
153
  /**
154
154
  * Corner radius of the flyout background.
@@ -224,8 +224,6 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
224
224
  /**
225
225
  * Dispose of this flyout.
226
226
  * Unlink from all DOM elements to prevent memory leaks.
227
- *
228
- * @suppress {checkTypes}
229
227
  */
230
228
  dispose(): void;
231
229
  /**
@@ -277,7 +275,7 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
277
275
  * Update the display property of the flyout based whether it thinks it should
278
276
  * be visible and whether its containing workspace is visible.
279
277
  */
280
- private updateDisplay_;
278
+ private updateDisplay;
281
279
  /**
282
280
  * Update the view based on coordinates calculated in position().
283
281
  *
@@ -307,7 +305,7 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
307
305
  * of objects to show in the flyout.
308
306
  * @returns The list of contents and gaps needed to lay out the flyout.
309
307
  */
310
- private createFlyoutInfo_;
308
+ private createFlyoutInfo;
311
309
  /**
312
310
  * Gets the flyout definition for the dynamic category.
313
311
  *
@@ -315,7 +313,7 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
315
313
  * @returns The definition of the
316
314
  * flyout in one of its many forms.
317
315
  */
318
- private getDynamicCategoryContents_;
316
+ private getDynamicCategoryContents;
319
317
  /**
320
318
  * Creates a flyout button or a flyout label.
321
319
  *
@@ -324,7 +322,7 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
324
322
  * @returns The object used to display the button in the
325
323
  * flyout.
326
324
  */
327
- private createButton_;
325
+ private createButton;
328
326
  /**
329
327
  * Create a block from the xml and permanently disable any blocks that were
330
328
  * defined as disabled.
@@ -332,7 +330,7 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
332
330
  * @param blockInfo The info of the block.
333
331
  * @returns The block created from the blockInfo.
334
332
  */
335
- private createFlyoutBlock_;
333
+ private createFlyoutBlock;
336
334
  /**
337
335
  * Returns a block from the array of recycled blocks with the given type, or
338
336
  * undefined if one cannot be found.
@@ -341,7 +339,7 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
341
339
  * @returns The recycled block, or undefined if
342
340
  * one could not be recycled.
343
341
  */
344
- private getRecycledBlock_;
342
+ private getRecycledBlock;
345
343
  /**
346
344
  * Adds a gap in the flyout based on block info.
347
345
  *
@@ -350,7 +348,7 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
350
348
  * @param defaultGap The default gap between one element and the
351
349
  * next.
352
350
  */
353
- private addBlockGap_;
351
+ private addBlockGap;
354
352
  /**
355
353
  * Add the necessary gap in the flyout for a separator.
356
354
  *
@@ -360,15 +358,15 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
360
358
  * @param defaultGap The default gap between the button and next
361
359
  * element.
362
360
  */
363
- private addSeparatorGap_;
361
+ private addSeparatorGap;
364
362
  /**
365
363
  * Delete blocks, mats and buttons from a previous showing of the flyout.
366
364
  */
367
- private clearOldBlocks_;
365
+ private clearOldBlocks;
368
366
  /**
369
367
  * Empties all of the recycled blocks, properly disposing of them.
370
368
  */
371
- private emptyRecycledBlocks_;
369
+ private emptyRecycledBlocks;
372
370
  /**
373
371
  * Returns whether the given block can be recycled or not.
374
372
  *
@@ -383,7 +381,7 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
383
381
  *
384
382
  * @param block The block to recycle.
385
383
  */
386
- private recycleBlock_;
384
+ private recycleBlock;
387
385
  /**
388
386
  * Add listeners to a block that has been added to the flyout.
389
387
  *
@@ -399,13 +397,13 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
399
397
  * @param block The flyout block to copy.
400
398
  * @returns Function to call when block is clicked.
401
399
  */
402
- private blockMouseDown_;
400
+ private blockMouseDown;
403
401
  /**
404
402
  * Pointer down on the flyout background. Start a vertical scroll drag.
405
403
  *
406
404
  * @param e Pointer down event.
407
405
  */
408
- private onMouseDown_;
406
+ private onMouseDown;
409
407
  /**
410
408
  * Does this flyout allow you to create a new instance of the given block?
411
409
  * Used for deciding if a block can be "dragged out of" the flyout.
@@ -465,7 +463,7 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
465
463
  * on the workspace, an "a + b" block that has two shadow blocks would be
466
464
  * disabled.
467
465
  */
468
- private filterForCapacity_;
466
+ private filterForCapacity;
469
467
  /**
470
468
  * Reflow blocks and their mats.
471
469
  */
@@ -482,14 +480,14 @@ export declare abstract class Flyout extends DeleteArea implements IFlyout {
482
480
  * @param oldBlock The flyout block to copy.
483
481
  * @returns The new block in the main workspace.
484
482
  */
485
- private placeNewBlock_;
483
+ private placeNewBlock;
486
484
  /**
487
485
  * Positions a block on the target workspace.
488
486
  *
489
487
  * @param oldBlock The flyout block being copied.
490
488
  * @param block The block to posiiton.
491
489
  */
492
- private positionNewBlock_;
490
+ private positionNewBlock;
493
491
  }
494
492
  /**
495
493
  * A flyout content item.
@@ -19,21 +19,21 @@ export declare class FlyoutButton {
19
19
  static TEXT_MARGIN_Y: number;
20
20
  /** The radius of the flyout button's borders. */
21
21
  static BORDER_RADIUS: number;
22
- private readonly text_;
23
- private readonly position_;
24
- private readonly callbackKey_;
25
- private readonly cssClass_;
22
+ private readonly text;
23
+ private readonly position;
24
+ private readonly callbackKey;
25
+ private readonly cssClass;
26
26
  /** Mouse up event data. */
27
- private onMouseUpWrapper_;
27
+ private onMouseUpWrapper;
28
28
  info: toolbox.ButtonOrLabelInfo;
29
29
  /** The width of the button's rect. */
30
30
  width: number;
31
31
  /** The height of the button's rect. */
32
32
  height: number;
33
33
  /** The root SVG group for the button or label. */
34
- private svgGroup_;
34
+ private svgGroup;
35
35
  /** The SVG element with the text of the label or button. */
36
- private svgText_;
36
+ private svgText;
37
37
  /**
38
38
  * @param workspace The workspace in which to place this button.
39
39
  * @param targetWorkspace The flyout's target workspace.
@@ -51,7 +51,7 @@ export declare class FlyoutButton {
51
51
  /** Correctly position the flyout button and make it visible. */
52
52
  show(): void;
53
53
  /** Update SVG attributes to match internal state. */
54
- private updateTransform_;
54
+ private updateTransform;
55
55
  /**
56
56
  * Move the button to the given x, y coordinates.
57
57
  *
@@ -83,6 +83,6 @@ export declare class FlyoutButton {
83
83
  *
84
84
  * @param e Pointer up event.
85
85
  */
86
- private onMouseUp_;
86
+ private onMouseUp;
87
87
  }
88
88
  //# sourceMappingURL=flyout_button.d.ts.map
@@ -44,7 +44,7 @@ export declare class HorizontalFlyout extends Flyout {
44
44
  * @param width The width of the flyout, not including the rounded corners.
45
45
  * @param height The height of the flyout, not including rounded corners.
46
46
  */
47
- private setBackgroundPath_;
47
+ private setBackgroundPath;
48
48
  /** Scroll the flyout to the top. */
49
49
  scrollToStart(): void;
50
50
  /**
@@ -45,7 +45,7 @@ export declare class VerticalFlyout extends Flyout {
45
45
  * @param width The width of the flyout, not including the rounded corners.
46
46
  * @param height The height of the flyout, not including rounded corners.
47
47
  */
48
- private setBackgroundPath_;
48
+ private setBackgroundPath;
49
49
  /** Scroll the flyout to the top. */
50
50
  scrollToStart(): void;
51
51
  /**
@@ -7,12 +7,25 @@ import type { Block } from './block.js';
7
7
  import { Names } from './names.js';
8
8
  import type { Workspace } from './workspace.js';
9
9
  /**
10
- * Class for a code generator that translates the blocks into a language.
10
+ * Type declaration for per-block-type generator functions.
11
11
  *
12
- * @unrestricted
12
+ * @see {@link https://developers.google.com/blockly/guides/create-custom-blocks/generating-code}
13
+ * @param block The Block instance to generate code for.
14
+ * @param genearator The CodeGenerator calling the function.
15
+ * @returns A string containing the generated code (for statement blocks),
16
+ * or a [code, precedence] tuple (for value/expression blocks), or
17
+ * null if no code should be emitted for block.
18
+ */
19
+ export type BlockGenerator = (block: Block, generator: CodeGenerator) => [string, number] | string | null;
20
+ /**
21
+ * Class for a code generator that translates the blocks into a language.
13
22
  */
14
23
  export declare class CodeGenerator {
15
24
  name_: string;
25
+ /** A dictionary of block generator functions keyed by block type. */
26
+ forBlock: {
27
+ [type: string]: BlockGenerator;
28
+ };
16
29
  /**
17
30
  * This is used as a placeholder in functions defined using
18
31
  * CodeGenerator.provideFunction_. It must not be legal code that could
package/core/gesture.d.ts CHANGED
@@ -13,6 +13,7 @@ import type { IFlyout } from './interfaces/i_flyout.js';
13
13
  import { Coordinate } from './utils/coordinate.js';
14
14
  import { WorkspaceDragger } from './workspace_dragger.js';
15
15
  import type { WorkspaceSvg } from './workspace_svg.js';
16
+ import type { IIcon } from './interfaces/i_icon.js';
16
17
  /**
17
18
  * Class for one gesture.
18
19
  */
@@ -23,30 +24,35 @@ export declare class Gesture {
23
24
  * pixels, with (0, 0) at the top left of the browser window (pointer event
24
25
  * clientX/Y).
25
26
  */
26
- private mouseDownXY_;
27
- private currentDragDeltaXY_;
27
+ private mouseDownXY;
28
+ private currentDragDeltaXY;
28
29
  /**
29
30
  * The bubble that the gesture started on, or null if it did not start on a
30
31
  * bubble.
31
32
  */
32
- private startBubble_;
33
+ private startBubble;
33
34
  /**
34
35
  * The field that the gesture started on, or null if it did not start on a
35
36
  * field.
36
37
  */
37
- private startField_;
38
+ private startField;
39
+ /**
40
+ * The icon that the gesture started on, or null if it did not start on an
41
+ * icon.
42
+ */
43
+ private startIcon;
38
44
  /**
39
45
  * The block that the gesture started on, or null if it did not start on a
40
46
  * block.
41
47
  */
42
- private startBlock_;
48
+ private startBlock;
43
49
  /**
44
50
  * The block that this gesture targets. If the gesture started on a
45
51
  * shadow block, this is the first non-shadow parent of the block. If the
46
52
  * gesture started in the flyout, this is the root block of the block group
47
53
  * that was clicked or dragged.
48
54
  */
49
- private targetBlock_;
55
+ private targetBlock;
50
56
  /**
51
57
  * The workspace that the gesture started on. There may be multiple
52
58
  * workspaces on a page; this is more accurate than using
@@ -58,7 +64,7 @@ export declare class Gesture {
58
64
  * A gesture that exceeds the drag radius is a drag even if it ends exactly
59
65
  * at its start point.
60
66
  */
61
- private hasExceededDragRadius_;
67
+ private hasExceededDragRadius;
62
68
  /**
63
69
  * Array holding info needed to unbind events.
64
70
  * Used for disposing.
@@ -66,25 +72,25 @@ export declare class Gesture {
66
72
  */
67
73
  private boundEvents;
68
74
  /** The object tracking a bubble drag, or null if none is in progress. */
69
- private bubbleDragger_;
75
+ private bubbleDragger;
70
76
  /** The object tracking a block drag, or null if none is in progress. */
71
- private blockDragger_;
77
+ private blockDragger;
72
78
  /**
73
79
  * The object tracking a workspace or flyout workspace drag, or null if none
74
80
  * is in progress.
75
81
  */
76
- private workspaceDragger_;
82
+ private workspaceDragger;
77
83
  /** The flyout a gesture started in, if any. */
78
- private flyout_;
84
+ private flyout;
79
85
  /** Boolean for sanity-checking that some code is only called once. */
80
- private calledUpdateIsDragging_;
86
+ private calledUpdateIsDragging;
81
87
  /** Boolean for sanity-checking that some code is only called once. */
82
- private hasStarted_;
88
+ private gestureHasStarted;
83
89
  /** Boolean used internally to break a cycle in disposal. */
84
90
  protected isEnding_: boolean;
85
- private healStack_;
91
+ private healStack;
86
92
  /** The event that most recently updated this gesture. */
87
- private mostRecentEvent_;
93
+ private mostRecentEvent;
88
94
  /** Boolean for whether or not this gesture is a multi-touch gesture. */
89
95
  private isMultiTouch_;
90
96
  /** A map of cached points used for tracking multi-touch gestures. */
@@ -95,11 +101,11 @@ export declare class Gesture {
95
101
  * Scales between 0 and 1 mean the most recent zoom was a zoom out.
96
102
  * Scales above 1.0 mean the most recent zoom was a zoom in.
97
103
  */
98
- private previousScale_;
104
+ private previousScale;
99
105
  /** The starting distance between two touch points. */
100
- private startDistance_;
106
+ private startDistance;
101
107
  /** Boolean for whether or not the workspace supports pinch-zoom. */
102
- private isPinchZoomEnabled_;
108
+ private isPinchZoomEnabled;
103
109
  /**
104
110
  * The owner of the dropdownDiv when this gesture first starts.
105
111
  * Needed because we'll close the dropdown before fields get to
@@ -124,7 +130,7 @@ export declare class Gesture {
124
130
  *
125
131
  * @param e The most recent pointer event.
126
132
  */
127
- private updateFromEvent_;
133
+ private updateFromEvent;
128
134
  /**
129
135
  * DO MATH to set currentDragDeltaXY_ based on the most recent pointer
130
136
  * position.
@@ -133,7 +139,7 @@ export declare class Gesture {
133
139
  * with (0, 0) at the window's top left corner.
134
140
  * @returns True if the drag just exceeded the drag radius for the first time.
135
141
  */
136
- private updateDragDelta_;
142
+ private updateDragDelta;
137
143
  /**
138
144
  * Update this gesture to record whether a block is being dragged from the
139
145
  * flyout.
@@ -145,7 +151,7 @@ export declare class Gesture {
145
151
  *
146
152
  * @returns True if a block is being dragged from the flyout.
147
153
  */
148
- private updateIsDraggingFromFlyout_;
154
+ private updateIsDraggingFromFlyout;
149
155
  /**
150
156
  * Update this gesture to record whether a bubble is being dragged.
151
157
  * This function should be called on a pointermove event the first time
@@ -155,7 +161,7 @@ export declare class Gesture {
155
161
  *
156
162
  * @returns True if a bubble is being dragged.
157
163
  */
158
- private updateIsDraggingBubble_;
164
+ private updateIsDraggingBubble;
159
165
  /**
160
166
  * Check whether to start a block drag. If a block should be dragged, either
161
167
  * from the flyout or in the workspace, create the necessary BlockDragger and
@@ -169,7 +175,7 @@ export declare class Gesture {
169
175
  *
170
176
  * @returns True if a block is being dragged.
171
177
  */
172
- private updateIsDraggingBlock_;
178
+ private updateIsDraggingBlock;
173
179
  /**
174
180
  * Check whether to start a workspace drag. If a workspace is being dragged,
175
181
  * create the necessary WorkspaceDragger and start the drag.
@@ -179,18 +185,18 @@ export declare class Gesture {
179
185
  * gesture. If a workspace is being dragged this function creates the
180
186
  * necessary WorkspaceDragger and starts the drag.
181
187
  */
182
- private updateIsDraggingWorkspace_;
188
+ private updateIsDraggingWorkspace;
183
189
  /**
184
190
  * Update this gesture to record whether anything is being dragged.
185
191
  * This function should be called on a pointermove event the first time
186
192
  * the drag radius is exceeded. It should be called no more than once per
187
193
  * gesture.
188
194
  */
189
- private updateIsDragging_;
195
+ private updateIsDragging;
190
196
  /** Create a block dragger and start dragging the selected block. */
191
- private startDraggingBlock_;
197
+ private startDraggingBlock;
192
198
  /** Create a bubble dragger and start dragging the selected bubble. */
193
- private startDraggingBubble_;
199
+ private startDraggingBubble;
194
200
  /**
195
201
  * Start a gesture: update the workspace to indicate that a gesture is in
196
202
  * progress and bind pointermove and pointerup handlers.
@@ -248,7 +254,7 @@ export declare class Gesture {
248
254
  *
249
255
  * @param e A pointermove event.
250
256
  */
251
- private handlePinch_;
257
+ private handlePinch;
252
258
  /**
253
259
  * Handle a pointerup event and end the gesture.
254
260
  *
@@ -298,7 +304,7 @@ export declare class Gesture {
298
304
  *
299
305
  * @param ws The workspace that a user clicks on.
300
306
  */
301
- private fireWorkspaceClick_;
307
+ private fireWorkspaceClick;
302
308
  /**
303
309
  * Handle a pointerdown event on a flyout.
304
310
  *
@@ -324,23 +330,25 @@ export declare class Gesture {
324
330
  */
325
331
  handleBubbleStart(e: PointerEvent, bubble: IBubble): void;
326
332
  /** Execute a bubble click. */
327
- private doBubbleClick_;
333
+ private doBubbleClick;
328
334
  /** Execute a field click. */
329
- private doFieldClick_;
335
+ private doFieldClick;
336
+ /** Execute an icon click. */
337
+ private doIconClick;
330
338
  /** Execute a block click. */
331
- private doBlockClick_;
339
+ private doBlockClick;
332
340
  /**
333
341
  * Execute a workspace click. When in accessibility mode shift clicking will
334
342
  * move the cursor.
335
343
  *
336
344
  * @param _e A pointerup event.
337
345
  */
338
- private doWorkspaceClick_;
346
+ private doWorkspaceClick;
339
347
  /**
340
348
  * Move the dragged/clicked block to the front of the workspace so that it is
341
349
  * not occluded by other blocks.
342
350
  */
343
- private bringBlockToFront_;
351
+ private bringBlockToFront;
344
352
  /**
345
353
  * Record the field that a gesture started on.
346
354
  *
@@ -348,6 +356,13 @@ export declare class Gesture {
348
356
  * @internal
349
357
  */
350
358
  setStartField<T>(field: Field<T>): void;
359
+ /**
360
+ * Record the icon that a gesture started on.
361
+ *
362
+ * @param icon The icon the gesture started on.
363
+ * @internal
364
+ */
365
+ setStartIcon(icon: IIcon): void;
351
366
  /**
352
367
  * Record the bubble that a gesture started on
353
368
  *
@@ -370,47 +385,49 @@ export declare class Gesture {
370
385
  *
371
386
  * @param block The block the gesture targets.
372
387
  */
373
- private setTargetBlock_;
388
+ private setTargetBlock;
374
389
  /**
375
390
  * Record the workspace that a gesture started on.
376
391
  *
377
392
  * @param ws The workspace the gesture started on.
378
393
  */
379
- private setStartWorkspace_;
394
+ private setStartWorkspace;
380
395
  /**
381
396
  * Record the flyout that a gesture started on.
382
397
  *
383
398
  * @param flyout The flyout the gesture started on.
384
399
  */
385
- private setStartFlyout_;
400
+ private setStartFlyout;
386
401
  /**
387
402
  * Whether this gesture is a click on a bubble. This should only be called
388
403
  * when ending a gesture (pointerup).
389
404
  *
390
405
  * @returns Whether this gesture was a click on a bubble.
391
406
  */
392
- private isBubbleClick_;
407
+ private isBubbleClick;
393
408
  /**
394
409
  * Whether this gesture is a click on a block. This should only be called
395
410
  * when ending a gesture (pointerup).
396
411
  *
397
412
  * @returns Whether this gesture was a click on a block.
398
413
  */
399
- private isBlockClick_;
414
+ private isBlockClick;
400
415
  /**
401
416
  * Whether this gesture is a click on a field. This should only be called
402
417
  * when ending a gesture (pointerup).
403
418
  *
404
419
  * @returns Whether this gesture was a click on a field.
405
420
  */
406
- private isFieldClick_;
421
+ private isFieldClick;
422
+ /** @returns Whether this gesture is a click on an icon. */
423
+ private isIconClick;
407
424
  /**
408
425
  * Whether this gesture is a click on a workspace. This should only be called
409
426
  * when ending a gesture (pointerup).
410
427
  *
411
428
  * @returns Whether this gesture was a click on a workspace.
412
429
  */
413
- private isWorkspaceClick_;
430
+ private isWorkspaceClick;
414
431
  /**
415
432
  * Whether this gesture is a drag of either a workspace or block.
416
433
  * This function is called externally to block actions that cannot be taken