From ce22f428688206089379406a5a44e309e5692ccf Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Thu, 15 Aug 2024 03:16:14 +0100 Subject: [PATCH] chore: Organise imports (#8527) * chore(deps): Add pretter-plugin-organize-imports * chore: Remove insignificant blank lines in import sections Since prettier-plugin-organize-imports sorts imports within sections separated by blank lines, but preserves the section divisions, remove any blank lines that are not dividing imports into meaningful sections. Do not remove blank lines separating side-effect-only imports from main imports. * chore: Remove unneded eslint-disable directives * chore: Organise imports --- .prettierrc.js | 2 + blocks/blocks.ts | 2 +- blocks/lists.ts | 16 +- blocks/logic.ts | 14 +- blocks/loops.ts | 16 +- blocks/math.ts | 6 +- blocks/procedures.ts | 34 +- blocks/text.ts | 22 +- blocks/variables.ts | 16 +- blocks/variables_dynamic.ts | 18 +- core/block.ts | 22 +- core/block_svg.ts | 18 +- core/blockly.ts | 327 +++++++++--------- core/blockly_options.ts | 4 +- core/bubbles.ts | 4 +- core/bubbles/bubble.ts | 6 +- core/bubbles/mini_workspace_bubble.ts | 8 +- core/bubbles/text_bubble.ts | 2 +- core/bubbles/textinput_bubble.ts | 8 +- core/clipboard.ts | 6 +- core/clipboard/block_paster.ts | 8 +- core/clipboard/workspace_comment_paster.ts | 10 +- core/comments.ts | 2 +- core/comments/comment_view.ts | 12 +- core/comments/rendered_workspace_comment.ts | 36 +- core/comments/workspace_comment.ts | 10 +- core/common.ts | 3 +- core/contextmenu.ts | 6 +- core/contextmenu_items.ts | 4 +- core/delete_area.ts | 2 +- core/dragging.ts | 4 +- core/dragging/block_drag_strategy.ts | 26 +- core/dragging/bubble_drag_strategy.ts | 6 +- core/dragging/comment_drag_strategy.ts | 8 +- core/dragging/dragger.ts | 16 +- core/dropdowndiv.ts | 2 +- core/events/events.ts | 130 +++---- core/events/events_abstract.ts | 1 - core/events/events_block_base.ts | 1 - core/events/events_block_change.ts | 3 +- core/events/events_block_create.ts | 3 +- core/events/events_block_delete.ts | 3 +- core/events/events_block_drag.ts | 2 +- .../events_block_field_intermediate_change.ts | 1 - core/events/events_block_move.ts | 3 +- core/events/events_bubble_open.ts | 4 +- core/events/events_click.ts | 3 +- core/events/events_comment_base.ts | 2 +- core/events/events_comment_change.ts | 5 +- core/events/events_comment_collapse.ts | 4 +- core/events/events_comment_create.ts | 4 +- core/events/events_comment_delete.ts | 8 +- core/events/events_comment_drag.ts | 2 +- core/events/events_comment_move.ts | 5 +- core/events/events_comment_resize.ts | 5 +- core/events/events_marker_move.ts | 1 - core/events/events_selected.ts | 3 +- core/events/events_theme_change.ts | 2 +- core/events/events_toolbox_item_select.ts | 2 +- core/events/events_trashcan_open.ts | 3 +- core/events/events_var_base.ts | 3 +- core/events/events_var_create.ts | 3 +- core/events/events_var_delete.ts | 3 +- core/events/events_var_rename.ts | 3 +- core/events/events_viewport.ts | 2 +- core/events/utils.ts | 1 - core/field.ts | 2 +- core/field_checkbox.ts | 2 +- core/field_dropdown.ts | 2 +- core/field_input.ts | 6 +- core/field_label.ts | 2 +- core/field_number.ts | 2 +- core/flyout_base.ts | 10 +- core/flyout_button.ts | 2 +- core/gesture.ts | 10 +- core/grid.ts | 4 +- core/icons.ts | 16 +- core/icons/comment_icon.ts | 16 +- core/icons/icon.ts | 2 +- core/icons/mutator_icon.ts | 14 +- core/icons/warning_icon.ts | 12 +- core/inputs.ts | 8 +- core/inputs/input.ts | 2 +- core/insertion_marker_manager.ts | 6 +- core/insertion_marker_previewer.ts | 12 +- .../i_ast_node_location_with_block.ts | 2 +- core/interfaces/i_bounded_element.ts | 3 +- core/interfaces/i_bubble.ts | 2 +- core/interfaces/i_comment_icon.ts | 4 +- core/interfaces/i_connection_checker.ts | 3 +- core/interfaces/i_drag_target.ts | 6 +- core/interfaces/i_flyout.ts | 6 +- core/interfaces/i_keyboard_accessible.ts | 3 +- core/interfaces/i_metrics_manager.ts | 7 +- core/interfaces/i_positionable.ts | 4 +- core/interfaces/i_procedure_block.ts | 3 +- core/interfaces/i_selectable_toolbox_item.ts | 2 +- core/interfaces/i_serializer.ts | 3 - core/interfaces/i_toolbox.ts | 6 +- core/keyboard_nav/ast_node.ts | 4 +- core/keyboard_nav/basic_cursor.ts | 1 - core/keyboard_nav/cursor.ts | 1 - core/keyboard_nav/marker.ts | 2 - core/keyboard_nav/tab_navigate_cursor.ts | 1 - core/layer_manager.ts | 6 +- core/observable_procedure_map.ts | 2 +- core/procedures.ts | 24 +- core/registry.ts | 12 +- core/render_management.ts | 2 +- core/renderers/common/block_rendering.ts | 71 ++-- core/renderers/common/drawer.ts | 5 +- core/renderers/common/i_path_object.ts | 4 +- core/renderers/common/info.ts | 13 +- core/renderers/common/marker_svg.ts | 3 +- core/renderers/common/path_object.ts | 1 - core/renderers/common/renderer.ts | 3 +- core/renderers/geras/drawer.ts | 1 - core/renderers/geras/highlighter.ts | 1 - core/renderers/geras/info.ts | 9 +- .../geras/measurables/inline_input.ts | 1 - .../geras/measurables/statement_input.ts | 1 - core/renderers/geras/path_object.ts | 1 - core/renderers/geras/renderer.ts | 1 - core/renderers/measurables/base.ts | 1 - core/renderers/measurables/bottom_row.ts | 1 - core/renderers/measurables/connection.ts | 2 - .../measurables/external_value_input.ts | 2 - core/renderers/measurables/field.ts | 2 - core/renderers/measurables/hat.ts | 1 - core/renderers/measurables/icon.ts | 2 - core/renderers/measurables/in_row_spacer.ts | 1 - core/renderers/measurables/inline_input.ts | 2 - .../renderers/measurables/input_connection.ts | 1 - core/renderers/measurables/input_row.ts | 1 - core/renderers/measurables/jagged_edge.ts | 1 - core/renderers/measurables/next_connection.ts | 1 - .../measurables/output_connection.ts | 1 - .../measurables/previous_connection.ts | 1 - core/renderers/measurables/round_corner.ts | 1 - core/renderers/measurables/row.ts | 1 - core/renderers/measurables/spacer_row.ts | 1 - core/renderers/measurables/square_corner.ts | 1 - core/renderers/measurables/statement_input.ts | 2 - core/renderers/measurables/top_row.ts | 1 - core/renderers/thrasos/info.ts | 1 - core/renderers/thrasos/renderer.ts | 1 - core/renderers/zelos/constants.ts | 2 +- core/renderers/zelos/drawer.ts | 1 - core/renderers/zelos/info.ts | 11 +- core/renderers/zelos/marker_svg.ts | 1 - core/renderers/zelos/measurables/inputs.ts | 1 - core/renderers/zelos/path_object.ts | 1 - core/renderers/zelos/renderer.ts | 3 +- core/serialization.ts | 8 +- core/serialization/blocks.ts | 7 +- core/serialization/procedures.ts | 2 +- core/serialization/variables.ts | 1 - core/serialization/workspace_comments.ts | 8 +- core/serialization/workspaces.ts | 1 - core/shortcut_items.ts | 8 +- core/toolbox/category.ts | 11 +- core/toolbox/collapsible_category.ts | 1 - core/toolbox/separator.ts | 1 - core/toolbox/toolbox.ts | 5 +- core/trashcan.ts | 5 +- core/utils/parsing.ts | 1 - core/utils/svg_math.ts | 1 - core/variables.ts | 2 +- core/variables_dynamic.ts | 2 +- core/widgetdiv.ts | 2 +- core/workspace.ts | 8 +- core/workspace_svg.ts | 14 +- core/xml.ts | 8 +- generators/dart/dart_generator.ts | 6 +- generators/dart/lists.ts | 4 +- generators/dart/loops.ts | 6 +- generators/dart/procedures.ts | 2 +- generators/dart/text.ts | 2 +- generators/javascript/javascript_generator.ts | 6 +- generators/javascript/lists.ts | 4 +- generators/javascript/loops.ts | 6 +- generators/javascript/procedures.ts | 2 +- generators/javascript/text.ts | 2 +- generators/lua.ts | 2 +- generators/lua/lists.ts | 4 +- generators/lua/loops.ts | 6 +- generators/lua/lua_generator.ts | 4 +- generators/lua/procedures.ts | 2 +- generators/lua/text.ts | 2 +- generators/php.ts | 2 +- generators/php/lists.ts | 6 +- generators/php/logic.ts | 2 +- generators/php/loops.ts | 6 +- generators/php/math.ts | 2 +- generators/php/php_generator.ts | 4 +- generators/php/procedures.ts | 6 +- generators/php/text.ts | 4 +- generators/php/variables.ts | 2 +- generators/python.ts | 2 +- generators/python/lists.ts | 6 +- generators/python/loops.ts | 6 +- generators/python/procedures.ts | 6 +- generators/python/python_generator.ts | 6 +- generators/python/text.ts | 6 +- package-lock.json | 22 ++ package.json | 1 + .../browser/test/basic_block_factory_test.mjs | 2 +- tests/browser/test/basic_block_test.mjs | 7 +- tests/browser/test/basic_playground_test.mjs | 8 +- tests/browser/test/block_undo_test.mjs | 6 +- tests/browser/test/delete_blocks_test.mjs | 10 +- tests/browser/test/extensive_test.mjs | 8 +- tests/browser/test/field_edits_test.mjs | 8 +- tests/browser/test/mutator_test.mjs | 10 +- tests/browser/test/procedure_test.mjs | 10 +- tests/browser/test/test_setup.mjs | 2 +- tests/browser/test/toolbox_drag_test.mjs | 8 +- tests/browser/test/workspace_comment_test.mjs | 3 +- tests/migration/validate-renamings.mjs | 5 +- tests/mocha/astnode_test.js | 2 +- tests/mocha/block_json_test.js | 2 +- tests/mocha/block_test.js | 16 +- tests/mocha/blocks/lists_test.js | 4 +- tests/mocha/blocks/logic_ternary_test.js | 2 +- tests/mocha/blocks/loops_test.js | 2 +- tests/mocha/blocks/procedures_test.js | 6 +- tests/mocha/blocks/variables_test.js | 10 +- tests/mocha/clipboard_test.js | 8 +- tests/mocha/comment_test.js | 2 +- tests/mocha/connection_checker_test.js | 2 +- tests/mocha/connection_db_test.js | 2 +- tests/mocha/connection_test.js | 10 +- tests/mocha/contextmenu_test.js | 7 +- tests/mocha/cursor_test.js | 2 +- tests/mocha/event_block_change_test.js | 2 +- tests/mocha/event_block_create_test.js | 4 +- tests/mocha/event_test.js | 6 +- tests/mocha/field_checkbox_test.js | 4 +- tests/mocha/field_colour_test.js | 10 +- tests/mocha/field_dropdown_test.js | 10 +- tests/mocha/field_image_test.js | 2 +- tests/mocha/field_label_serializable_test.js | 10 +- tests/mocha/field_label_test.js | 4 +- tests/mocha/field_number_test.js | 6 +- tests/mocha/field_registry_test.js | 3 +- tests/mocha/field_test.js | 3 +- tests/mocha/field_textinput_test.js | 10 +- tests/mocha/field_variable_test.js | 10 +- tests/mocha/flyout_test.js | 8 - tests/mocha/generator_test.js | 2 +- tests/mocha/gesture_test.js | 6 +- tests/mocha/icon_test.js | 4 +- tests/mocha/insertion_marker_manager_test.js | 8 +- tests/mocha/jso_deserialization_test.js | 11 +- tests/mocha/jso_serialization_test.js | 14 +- tests/mocha/keydown_test.js | 2 +- tests/mocha/mutator_test.js | 8 +- tests/mocha/procedure_map_test.js | 7 +- tests/mocha/registry_test.js | 2 +- tests/mocha/serializer_test.js | 2 +- tests/mocha/shortcut_registry_test.js | 2 +- tests/mocha/test_helpers/procedures.js | 2 +- tests/mocha/test_helpers/workspace.js | 4 +- tests/mocha/theme_test.js | 2 +- tests/mocha/trashcan_test.js | 12 +- tests/mocha/variable_map_test.js | 12 +- tests/mocha/workspace_comment_test.js | 8 +- tests/mocha/workspace_svg_test.js | 6 +- tests/mocha/workspace_test.js | 2 - tests/mocha/zoom_controls_test.js | 2 +- tests/node/run_node_test.mjs | 2 +- tests/typescript/src/generators.ts | 4 +- tests/typescript/src/generators/php.ts | 2 +- tests/typescript/src/generators/python.ts | 2 +- 274 files changed, 945 insertions(+), 1008 deletions(-) diff --git a/.prettierrc.js b/.prettierrc.js index bbfb466399d..84a85c1159e 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -10,4 +10,6 @@ module.exports = { bracketSpacing: false, // Put HTML tag closing brackets on same line as last attribute. bracketSameLine: true, + // Organise imports using a plugin. + 'plugins': ['prettier-plugin-organize-imports'], }; diff --git a/blocks/blocks.ts b/blocks/blocks.ts index a9874e54df1..dc6ca386cd2 100644 --- a/blocks/blocks.ts +++ b/blocks/blocks.ts @@ -6,6 +6,7 @@ // Former goog.module ID: Blockly.libraryBlocks +import type {BlockDefinition} from '../core/blocks.js'; import * as lists from './lists.js'; import * as logic from './logic.js'; import * as loops from './loops.js'; @@ -14,7 +15,6 @@ import * as procedures from './procedures.js'; import * as texts from './text.js'; import * as variables from './variables.js'; import * as variablesDynamic from './variables_dynamic.js'; -import type {BlockDefinition} from '../core/blocks.js'; export { lists, diff --git a/blocks/lists.ts b/blocks/lists.ts index 3b468dc9d21..28ff17b3dfe 100644 --- a/blocks/lists.ts +++ b/blocks/lists.ts @@ -6,22 +6,22 @@ // Former goog.module ID: Blockly.libraryBlocks.lists -import * as fieldRegistry from '../core/field_registry.js'; -import * as xmlUtils from '../core/utils/xml.js'; -import {Align} from '../core/inputs/align.js'; import type {Block} from '../core/block.js'; -import type {Connection} from '../core/connection.js'; import type {BlockSvg} from '../core/block_svg.js'; -import type {FieldDropdown} from '../core/field_dropdown.js'; -import {Msg} from '../core/msg.js'; -import {MutatorIcon} from '../core/icons/mutator_icon.js'; -import type {Workspace} from '../core/workspace.js'; import { createBlockDefinitionsFromJsonArray, defineBlocks, } from '../core/common.js'; +import type {Connection} from '../core/connection.js'; import '../core/field_dropdown.js'; +import type {FieldDropdown} from '../core/field_dropdown.js'; +import * as fieldRegistry from '../core/field_registry.js'; +import {MutatorIcon} from '../core/icons/mutator_icon.js'; +import {Align} from '../core/inputs/align.js'; import {ValueInput} from '../core/inputs/value_input.js'; +import {Msg} from '../core/msg.js'; +import * as xmlUtils from '../core/utils/xml.js'; +import type {Workspace} from '../core/workspace.js'; /** * A dictionary of the block definitions provided by this module. diff --git a/blocks/logic.ts b/blocks/logic.ts index 3e5b807ebcf..d2a7405fffa 100644 --- a/blocks/logic.ts +++ b/blocks/logic.ts @@ -6,22 +6,22 @@ // Former goog.module ID: Blockly.libraryBlocks.logic -import * as Events from '../core/events/events.js'; -import * as Extensions from '../core/extensions.js'; -import * as xmlUtils from '../core/utils/xml.js'; -import type {Abstract as AbstractEvent} from '../core/events/events_abstract.js'; import type {Block} from '../core/block.js'; import type {BlockSvg} from '../core/block_svg.js'; -import type {Connection} from '../core/connection.js'; -import {Msg} from '../core/msg.js'; -import type {Workspace} from '../core/workspace.js'; import { createBlockDefinitionsFromJsonArray, defineBlocks, } from '../core/common.js'; +import type {Connection} from '../core/connection.js'; +import * as Events from '../core/events/events.js'; +import type {Abstract as AbstractEvent} from '../core/events/events_abstract.js'; +import * as Extensions from '../core/extensions.js'; import '../core/field_dropdown.js'; import '../core/field_label.js'; import '../core/icons/mutator_icon.js'; +import {Msg} from '../core/msg.js'; +import * as xmlUtils from '../core/utils/xml.js'; +import type {Workspace} from '../core/workspace.js'; /** * A dictionary of the block definitions provided by this module. diff --git a/blocks/loops.ts b/blocks/loops.ts index c7cb710d770..dd5a8116211 100644 --- a/blocks/loops.ts +++ b/blocks/loops.ts @@ -6,27 +6,27 @@ // Former goog.module ID: Blockly.libraryBlocks.loops -import type {Abstract as AbstractEvent} from '../core/events/events_abstract.js'; import type {Block} from '../core/block.js'; +import { + createBlockDefinitionsFromJsonArray, + defineBlocks, +} from '../core/common.js'; import * as ContextMenu from '../core/contextmenu.js'; import type { ContextMenuOption, LegacyContextMenuOption, } from '../core/contextmenu_registry.js'; import * as Events from '../core/events/events.js'; -import * as Extensions from '../core/extensions.js'; -import {Msg} from '../core/msg.js'; -import { - createBlockDefinitionsFromJsonArray, - defineBlocks, -} from '../core/common.js'; +import type {Abstract as AbstractEvent} from '../core/events/events_abstract.js'; import * as eventUtils from '../core/events/utils.js'; +import * as Extensions from '../core/extensions.js'; import '../core/field_dropdown.js'; import '../core/field_label.js'; import '../core/field_number.js'; import '../core/field_variable.js'; -import '../core/icons/warning_icon.js'; import {FieldVariable} from '../core/field_variable.js'; +import '../core/icons/warning_icon.js'; +import {Msg} from '../core/msg.js'; import {WorkspaceSvg} from '../core/workspace_svg.js'; /** diff --git a/blocks/math.ts b/blocks/math.ts index c96aef3c23b..e5aef5fbb6e 100644 --- a/blocks/math.ts +++ b/blocks/math.ts @@ -6,18 +6,18 @@ // Former goog.module ID: Blockly.libraryBlocks.math -import * as Extensions from '../core/extensions.js'; -import type {FieldDropdown} from '../core/field_dropdown.js'; -import * as xmlUtils from '../core/utils/xml.js'; import type {Block} from '../core/block.js'; import { createBlockDefinitionsFromJsonArray, defineBlocks, } from '../core/common.js'; +import * as Extensions from '../core/extensions.js'; import '../core/field_dropdown.js'; +import type {FieldDropdown} from '../core/field_dropdown.js'; import '../core/field_label.js'; import '../core/field_number.js'; import '../core/field_variable.js'; +import * as xmlUtils from '../core/utils/xml.js'; /** * A dictionary of the block definitions provided by this module. diff --git a/blocks/procedures.ts b/blocks/procedures.ts index e2b7ba18f9a..bf9a9206b96 100644 --- a/blocks/procedures.ts +++ b/blocks/procedures.ts @@ -6,40 +6,40 @@ // Former goog.module ID: Blockly.libraryBlocks.procedures -import * as ContextMenu from '../core/contextmenu.js'; -import * as Events from '../core/events/events.js'; -import * as Procedures from '../core/procedures.js'; -import * as Variables from '../core/variables.js'; -import * as Xml from '../core/xml.js'; -import * as fieldRegistry from '../core/field_registry.js'; -import * as xmlUtils from '../core/utils/xml.js'; -import type {Abstract as AbstractEvent} from '../core/events/events_abstract.js'; -import {Align} from '../core/inputs/align.js'; import type {Block} from '../core/block.js'; import type {BlockSvg} from '../core/block_svg.js'; -import type {BlockCreate} from '../core/events/events_block_create.js'; -import type {BlockChange} from '../core/events/events_block_change.js'; import type {BlockDefinition} from '../core/blocks.js'; +import * as common from '../core/common.js'; +import {defineBlocks} from '../core/common.js'; +import {config} from '../core/config.js'; import type {Connection} from '../core/connection.js'; +import * as ContextMenu from '../core/contextmenu.js'; import type { ContextMenuOption, LegacyContextMenuOption, } from '../core/contextmenu_registry.js'; +import * as Events from '../core/events/events.js'; +import type {Abstract as AbstractEvent} from '../core/events/events_abstract.js'; +import type {BlockChange} from '../core/events/events_block_change.js'; +import type {BlockCreate} from '../core/events/events_block_create.js'; import * as eventUtils from '../core/events/utils.js'; import {FieldCheckbox} from '../core/field_checkbox.js'; import {FieldLabel} from '../core/field_label.js'; +import * as fieldRegistry from '../core/field_registry.js'; import {FieldTextInput} from '../core/field_textinput.js'; -import {Msg} from '../core/msg.js'; +import '../core/icons/comment_icon.js'; import {MutatorIcon as Mutator} from '../core/icons/mutator_icon.js'; +import '../core/icons/warning_icon.js'; +import {Align} from '../core/inputs/align.js'; +import {Msg} from '../core/msg.js'; import {Names} from '../core/names.js'; +import * as Procedures from '../core/procedures.js'; +import * as xmlUtils from '../core/utils/xml.js'; import type {VariableModel} from '../core/variable_model.js'; +import * as Variables from '../core/variables.js'; import type {Workspace} from '../core/workspace.js'; import type {WorkspaceSvg} from '../core/workspace_svg.js'; -import {config} from '../core/config.js'; -import {defineBlocks} from '../core/common.js'; -import '../core/icons/comment_icon.js'; -import '../core/icons/warning_icon.js'; -import * as common from '../core/common.js'; +import * as Xml from '../core/xml.js'; /** A dictionary of the block definitions provided by this module. */ export const blocks: {[key: string]: BlockDefinition} = {}; diff --git a/blocks/text.ts b/blocks/text.ts index 450e3008772..5ab63183641 100644 --- a/blocks/text.ts +++ b/blocks/text.ts @@ -6,25 +6,25 @@ // Former goog.module ID: Blockly.libraryBlocks.texts -import * as Extensions from '../core/extensions.js'; -import * as fieldRegistry from '../core/field_registry.js'; -import * as xmlUtils from '../core/utils/xml.js'; -import {Align} from '../core/inputs/align.js'; import type {Block} from '../core/block.js'; import type {BlockSvg} from '../core/block_svg.js'; -import {Connection} from '../core/connection.js'; -import {FieldImage} from '../core/field_image.js'; -import {FieldDropdown} from '../core/field_dropdown.js'; -import {FieldTextInput} from '../core/field_textinput.js'; -import {Msg} from '../core/msg.js'; -import {MutatorIcon} from '../core/icons/mutator_icon.js'; -import type {Workspace} from '../core/workspace.js'; import { createBlockDefinitionsFromJsonArray, defineBlocks, } from '../core/common.js'; +import {Connection} from '../core/connection.js'; +import * as Extensions from '../core/extensions.js'; +import {FieldDropdown} from '../core/field_dropdown.js'; +import {FieldImage} from '../core/field_image.js'; +import * as fieldRegistry from '../core/field_registry.js'; +import {FieldTextInput} from '../core/field_textinput.js'; import '../core/field_variable.js'; +import {MutatorIcon} from '../core/icons/mutator_icon.js'; +import {Align} from '../core/inputs/align.js'; import {ValueInput} from '../core/inputs/value_input.js'; +import {Msg} from '../core/msg.js'; +import * as xmlUtils from '../core/utils/xml.js'; +import type {Workspace} from '../core/workspace.js'; /** * A dictionary of the block definitions provided by this module. diff --git a/blocks/variables.ts b/blocks/variables.ts index 8ac038fb2ce..0ec9112a3d6 100644 --- a/blocks/variables.ts +++ b/blocks/variables.ts @@ -6,22 +6,22 @@ // Former goog.module ID: Blockly.libraryBlocks.variables -import * as ContextMenu from '../core/contextmenu.js'; -import * as Extensions from '../core/extensions.js'; -import * as Variables from '../core/variables.js'; import type {Block} from '../core/block.js'; +import { + createBlockDefinitionsFromJsonArray, + defineBlocks, +} from '../core/common.js'; +import * as ContextMenu from '../core/contextmenu.js'; import type { ContextMenuOption, LegacyContextMenuOption, } from '../core/contextmenu_registry.js'; +import * as Extensions from '../core/extensions.js'; +import '../core/field_label.js'; import {FieldVariable} from '../core/field_variable.js'; import {Msg} from '../core/msg.js'; +import * as Variables from '../core/variables.js'; import type {WorkspaceSvg} from '../core/workspace_svg.js'; -import { - createBlockDefinitionsFromJsonArray, - defineBlocks, -} from '../core/common.js'; -import '../core/field_label.js'; /** * A dictionary of the block definitions provided by this module. diff --git a/blocks/variables_dynamic.ts b/blocks/variables_dynamic.ts index e74cae423ab..8e4ce290e09 100644 --- a/blocks/variables_dynamic.ts +++ b/blocks/variables_dynamic.ts @@ -6,23 +6,23 @@ // Former goog.module ID: Blockly.libraryBlocks.variablesDynamic -import * as ContextMenu from '../core/contextmenu.js'; -import * as Extensions from '../core/extensions.js'; -import * as Variables from '../core/variables.js'; -import {Abstract as AbstractEvent} from '../core/events/events_abstract.js'; import type {Block} from '../core/block.js'; +import { + createBlockDefinitionsFromJsonArray, + defineBlocks, +} from '../core/common.js'; +import * as ContextMenu from '../core/contextmenu.js'; import type { ContextMenuOption, LegacyContextMenuOption, } from '../core/contextmenu_registry.js'; +import {Abstract as AbstractEvent} from '../core/events/events_abstract.js'; +import * as Extensions from '../core/extensions.js'; +import '../core/field_label.js'; import {FieldVariable} from '../core/field_variable.js'; import {Msg} from '../core/msg.js'; +import * as Variables from '../core/variables.js'; import type {WorkspaceSvg} from '../core/workspace_svg.js'; -import { - createBlockDefinitionsFromJsonArray, - defineBlocks, -} from '../core/common.js'; -import '../core/field_label.js'; /** * A dictionary of the block definitions provided by this module. diff --git a/core/block.ts b/core/block.ts index dad2fd6e917..7875ac6a496 100644 --- a/core/block.ts +++ b/core/block.ts @@ -23,35 +23,35 @@ import * as common from './common.js'; import {Connection} from './connection.js'; import {ConnectionType} from './connection_type.js'; import * as constants from './constants.js'; -import {DuplicateIconType} from './icons/exceptions.js'; import type {Abstract} from './events/events_abstract.js'; import type {BlockChange} from './events/events_block_change.js'; import type {BlockMove} from './events/events_block_move.js'; -import * as deprecation from './utils/deprecation.js'; import * as eventUtils from './events/utils.js'; import * as Extensions from './extensions.js'; import type {Field} from './field.js'; import * as fieldRegistry from './field_registry.js'; -import {Input} from './inputs/input.js'; +import {DuplicateIconType} from './icons/exceptions.js'; +import {IconType} from './icons/icon_types.js'; +import type {MutatorIcon} from './icons/mutator_icon.js'; import {Align} from './inputs/align.js'; +import {DummyInput} from './inputs/dummy_input.js'; +import {EndRowInput} from './inputs/end_row_input.js'; +import {Input} from './inputs/input.js'; +import {StatementInput} from './inputs/statement_input.js'; +import {ValueInput} from './inputs/value_input.js'; import type {IASTNodeLocation} from './interfaces/i_ast_node_location.js'; -import {type IIcon} from './interfaces/i_icon.js'; import {isCommentIcon} from './interfaces/i_comment_icon.js'; -import type {MutatorIcon} from './icons/mutator_icon.js'; +import {type IIcon} from './interfaces/i_icon.js'; +import * as registry from './registry.js'; import * as Tooltip from './tooltip.js'; import * as arrayUtils from './utils/array.js'; import {Coordinate} from './utils/coordinate.js'; +import * as deprecation from './utils/deprecation.js'; import * as idGenerator from './utils/idgenerator.js'; import * as parsing from './utils/parsing.js'; -import * as registry from './registry.js'; import {Size} from './utils/size.js'; import type {VariableModel} from './variable_model.js'; import type {Workspace} from './workspace.js'; -import {DummyInput} from './inputs/dummy_input.js'; -import {EndRowInput} from './inputs/end_row_input.js'; -import {ValueInput} from './inputs/value_input.js'; -import {StatementInput} from './inputs/statement_input.js'; -import {IconType} from './icons/icon_types.js'; /** * Class for one block. diff --git a/core/block_svg.ts b/core/block_svg.ts index 275451a610c..e3a60315ee2 100644 --- a/core/block_svg.ts +++ b/core/block_svg.ts @@ -16,7 +16,9 @@ import './events/events_selected.js'; import {Block} from './block.js'; import * as blockAnimations from './block_animations.js'; +import {IDeletable} from './blockly.js'; import * as browserEvents from './browser_events.js'; +import {BlockCopyData, BlockPaster} from './clipboard/block_paster.js'; import * as common from './common.js'; import {config} from './config.js'; import type {Connection} from './connection.js'; @@ -28,11 +30,14 @@ import { ContextMenuRegistry, LegacyContextMenuOption, } from './contextmenu_registry.js'; +import {BlockDragStrategy} from './dragging/block_drag_strategy.js'; import type {BlockMove} from './events/events_block_move.js'; -import * as deprecation from './utils/deprecation.js'; import * as eventUtils from './events/utils.js'; import type {Field} from './field.js'; import {FieldLabel} from './field_label.js'; +import {IconType} from './icons/icon_types.js'; +import {MutatorIcon} from './icons/mutator_icon.js'; +import {WarningIcon} from './icons/warning_icon.js'; import type {Input} from './inputs/input.js'; import type {IASTNodeLocationSvg} from './interfaces/i_ast_node_location_svg.js'; import type {IBoundedElement} from './interfaces/i_bounded_element.js'; @@ -44,26 +49,21 @@ import {ASTNode} from './keyboard_nav/ast_node.js'; import {TabNavigateCursor} from './keyboard_nav/tab_navigate_cursor.js'; import {MarkerManager} from './marker_manager.js'; import {Msg} from './msg.js'; -import {MutatorIcon} from './icons/mutator_icon.js'; +import * as renderManagement from './render_management.js'; import {RenderedConnection} from './rendered_connection.js'; import type {IPathObject} from './renderers/common/i_path_object.js'; import * as blocks from './serialization/blocks.js'; import type {BlockStyle} from './theme.js'; import * as Tooltip from './tooltip.js'; import {Coordinate} from './utils/coordinate.js'; +import * as deprecation from './utils/deprecation.js'; import * as dom from './utils/dom.js'; import {Rect} from './utils/rect.js'; import {Svg} from './utils/svg.js'; import * as svgMath from './utils/svg_math.js'; -import {WarningIcon} from './icons/warning_icon.js'; +import {FlyoutItemInfo} from './utils/toolbox.js'; import type {Workspace} from './workspace.js'; import type {WorkspaceSvg} from './workspace_svg.js'; -import * as renderManagement from './render_management.js'; -import {IconType} from './icons/icon_types.js'; -import {BlockCopyData, BlockPaster} from './clipboard/block_paster.js'; -import {BlockDragStrategy} from './dragging/block_drag_strategy.js'; -import {IDeletable} from './blockly.js'; -import {FlyoutItemInfo} from './utils/toolbox.js'; /** * Class for a block's SVG representation. diff --git a/core/blockly.ts b/core/blockly.ts index 77362c0b4b1..01490dbb694 100644 --- a/core/blockly.ts +++ b/core/blockly.ts @@ -22,8 +22,10 @@ import {BlocklyOptions} from './blockly_options.js'; import {Blocks} from './blocks.js'; import * as browserEvents from './browser_events.js'; import * as bubbles from './bubbles.js'; +import {MiniWorkspaceBubble} from './bubbles/mini_workspace_bubble.js'; import * as bumpObjects from './bump_objects.js'; import * as clipboard from './clipboard.js'; +import * as comments from './comments.js'; import * as common from './common.js'; import {ComponentManager} from './component_manager.js'; import {config} from './config.js'; @@ -31,15 +33,15 @@ import {Connection} from './connection.js'; import {ConnectionChecker} from './connection_checker.js'; import {ConnectionDB} from './connection_db.js'; import {ConnectionType} from './connection_type.js'; +import * as constants from './constants.js'; import * as ContextMenu from './contextmenu.js'; import * as ContextMenuItems from './contextmenu_items.js'; import {ContextMenuRegistry} from './contextmenu_registry.js'; -import * as comments from './comments.js'; import * as Css from './css.js'; import {DeleteArea} from './delete_area.js'; import * as dialog from './dialog.js'; -import * as dragging from './dragging.js'; import {DragTarget} from './drag_target.js'; +import * as dragging from './dragging.js'; import * as dropDownDiv from './dropdowndiv.js'; import * as Events from './events/events.js'; import * as Extensions from './extensions.js'; @@ -104,8 +106,8 @@ import {Gesture} from './gesture.js'; import {Grid} from './grid.js'; import * as icons from './icons.js'; import {inject} from './inject.js'; -import {Input} from './inputs/input.js'; import * as inputs from './inputs.js'; +import {Input} from './inputs/input.js'; import {InsertionMarkerManager} from './insertion_marker_manager.js'; import {InsertionMarkerPreviewer} from './insertion_marker_previewer.js'; import {IASTNodeLocation} from './interfaces/i_ast_node_location.js'; @@ -119,16 +121,16 @@ import {IComponent} from './interfaces/i_component.js'; import {IConnectionChecker} from './interfaces/i_connection_checker.js'; import {IConnectionPreviewer} from './interfaces/i_connection_previewer.js'; import {IContextMenu} from './interfaces/i_contextmenu.js'; -import {ICopyable, isCopyable, ICopyData} from './interfaces/i_copyable.js'; +import {ICopyData, ICopyable, isCopyable} from './interfaces/i_copyable.js'; import {IDeletable, isDeletable} from './interfaces/i_deletable.js'; import {IDeleteArea} from './interfaces/i_delete_area.js'; import {IDragTarget} from './interfaces/i_drag_target.js'; -import {IDragger} from './interfaces/i_dragger.js'; import { + IDragStrategy, IDraggable, isDraggable, - IDragStrategy, } from './interfaces/i_draggable.js'; +import {IDragger} from './interfaces/i_dragger.js'; import {IFlyout} from './interfaces/i_flyout.js'; import {IHasBubble, hasBubble} from './interfaces/i_has_bubble.js'; import {IIcon, isIcon} from './interfaces/i_icon.js'; @@ -159,23 +161,21 @@ import {BasicCursor} from './keyboard_nav/basic_cursor.js'; import {Cursor} from './keyboard_nav/cursor.js'; import {Marker} from './keyboard_nav/marker.js'; import {TabNavigateCursor} from './keyboard_nav/tab_navigate_cursor.js'; -import {MarkerManager} from './marker_manager.js'; import type {LayerManager} from './layer_manager.js'; import * as layers from './layers.js'; +import {MarkerManager} from './marker_manager.js'; import {Menu} from './menu.js'; import {MenuItem} from './menuitem.js'; import {MetricsManager} from './metrics_manager.js'; import {Msg, setLocale} from './msg.js'; -import {MiniWorkspaceBubble} from './bubbles/mini_workspace_bubble.js'; import {Names} from './names.js'; import {Options} from './options.js'; import * as uiPosition from './positionable_helpers.js'; import * as Procedures from './procedures.js'; import * as registry from './registry.js'; -import {RenderedConnection} from './rendered_connection.js'; import * as renderManagement from './render_management.js'; +import {RenderedConnection} from './rendered_connection.js'; import * as blockRendering from './renderers/common/block_rendering.js'; -import * as constants from './constants.js'; import * as geras from './renderers/geras/geras.js'; import * as thrasos from './renderers/thrasos/thrasos.js'; import * as zelos from './renderers/zelos/zelos.js'; @@ -418,172 +418,187 @@ Names.prototype.populateProcedures = function ( // clang-format on // Re-export submodules that no longer declareLegacyNamespace. -export {browserEvents}; -export {ContextMenu}; -export {ContextMenuItems}; -export {Css}; -export {Events}; -export {Extensions}; -export {Procedures}; -export {Procedures as procedures}; -export {ShortcutItems}; -export {Themes}; -export {Tooltip}; -export {Touch}; -export {Variables}; -export {VariablesDynamic}; -export {WidgetDiv}; -export {Xml}; -export {blockAnimations}; -export {blockRendering}; -export {bumpObjects}; -export {clipboard}; -export {common}; -export {constants}; -export {dialog}; -export {fieldRegistry}; -export {geras}; -export {registry}; -export {thrasos}; -export {uiPosition}; -export {utils}; -export {zelos}; -export {ASTNode}; -export {BasicCursor}; -export {Block}; -export {BlocklyOptions}; -export {BlockSvg}; -export {Blocks}; -export {bubbles}; -export {CollapsibleToolboxCategory}; -export {ComponentManager}; -export {Connection}; -export {ConnectionType}; -export {ConnectionChecker}; -export {ConnectionDB}; -export {ContextMenuRegistry}; -export {comments}; -export {Cursor}; -export {DeleteArea}; -export {dragging}; -export {DragTarget}; +export { + ASTNode, + BasicCursor, + Block, + BlockSvg, + BlocklyOptions, + Blocks, + CollapsibleToolboxCategory, + ComponentManager, + Connection, + ConnectionChecker, + ConnectionDB, + ConnectionType, + ContextMenu, + ContextMenuItems, + ContextMenuRegistry, + Css, + Cursor, + DeleteArea, + DragTarget, + Events, + Extensions, + Procedures, + ShortcutItems, + Themes, + Tooltip, + Touch, + Variables, + VariablesDynamic, + WidgetDiv, + Xml, + blockAnimations, + blockRendering, + browserEvents, + bubbles, + bumpObjects, + clipboard, + comments, + common, + constants, + dialog, + dragging, + fieldRegistry, + geras, + Procedures as procedures, + registry, + thrasos, + uiPosition, + utils, + zelos, +}; export const DropDownDiv = dropDownDiv; -export {Field, FieldConfig, FieldValidator, UnattachedFieldError}; export { + CodeGenerator, + Field, FieldCheckbox, FieldCheckboxConfig, FieldCheckboxFromJsonConfig, FieldCheckboxValidator, -}; -export { + FieldConfig, FieldDropdown, FieldDropdownConfig, FieldDropdownFromJsonConfig, FieldDropdownValidator, - MenuGenerator, - MenuGeneratorFunction, - MenuOption, -}; -export {FieldImage, FieldImageConfig, FieldImageFromJsonConfig}; -export {FieldLabel, FieldLabelConfig, FieldLabelFromJsonConfig}; -export {FieldLabelSerializable}; -export { + FieldImage, + FieldImageConfig, + FieldImageFromJsonConfig, + FieldLabel, + FieldLabelConfig, + FieldLabelFromJsonConfig, + FieldLabelSerializable, FieldNumber, FieldNumberConfig, FieldNumberFromJsonConfig, FieldNumberValidator, -}; -export { FieldTextInput, FieldTextInputConfig, FieldTextInputFromJsonConfig, FieldTextInputValidator, -}; -export { + FieldValidator, FieldVariable, FieldVariableConfig, FieldVariableFromJsonConfig, FieldVariableValidator, + Flyout, + FlyoutButton, + FlyoutMetricsManager, + CodeGenerator as Generator, + Gesture, + Grid, + HorizontalFlyout, + IASTNodeLocation, + IASTNodeLocationSvg, + IASTNodeLocationWithBlock, + IAutoHideable, + IBoundedElement, + IBubble, + ICollapsibleToolboxItem, + IComponent, + IConnectionChecker, + IConnectionPreviewer, + IContextMenu, + ICopyData, + ICopyable, + IDeletable, + IDeleteArea, + IDragStrategy, + IDragTarget, + IDraggable, + IDragger, + IFlyout, + IHasBubble, + IIcon, + IKeyboardAccessible, + IMetricsManager, + IMovable, + IObservable, + IPaster, + IPositionable, + IRegistrable, + IRenderedElement, + ISelectable, + ISelectableToolboxItem, + ISerializable, + IStyleable, + IToolbox, + IToolboxItem, + IVariableBackedParameterModel, + Input, + InsertionMarkerManager, + InsertionMarkerPreviewer, + LayerManager, + Marker, + MarkerManager, + Menu, + MenuGenerator, + MenuGeneratorFunction, + MenuItem, + MenuOption, + MetricsManager, + Msg, + Names, + Options, + RenderedConnection, + Scrollbar, + ScrollbarPair, + ShortcutRegistry, + TabNavigateCursor, + Theme, + ThemeManager, + Toolbox, + ToolboxCategory, + ToolboxItem, + ToolboxSeparator, + Trashcan, + UnattachedFieldError, + VariableMap, + VariableModel, + VerticalFlyout, + Workspace, + WorkspaceAudio, + WorkspaceDragger, + WorkspaceSvg, + ZoomControls, + config, + hasBubble, + icons, + inject, + inputs, + isCopyable, + isDeletable, + isDraggable, + isIcon, + isObservable, + isPaster, + isRenderedElement, + isSelectable, + isSerializable, + isVariableBackedParameterModel, + layers, + renderManagement, + serialization, + setLocale, }; -export {Flyout}; -export {FlyoutButton}; -export {FlyoutMetricsManager}; -export {CodeGenerator}; -export {CodeGenerator as Generator}; // Deprecated name, October 2022. -export {Gesture}; -export {Grid}; -export {HorizontalFlyout}; -export {IASTNodeLocation}; -export {IASTNodeLocationSvg}; -export {IASTNodeLocationWithBlock}; -export {IAutoHideable}; -export {IBoundedElement}; -export {IBubble}; -export {ICollapsibleToolboxItem}; -export {IComponent}; -export {IConnectionChecker}; -export {IConnectionPreviewer}; -export {IContextMenu}; -export {icons}; -export {ICopyable, isCopyable, ICopyData}; -export {IDeletable, isDeletable}; -export {IDeleteArea}; -export {IDragTarget}; -export {IDragger}; -export {IDraggable, isDraggable, IDragStrategy}; -export {IFlyout}; -export {IHasBubble, hasBubble}; -export {IIcon, isIcon}; -export {IKeyboardAccessible}; -export {IMetricsManager}; -export {IMovable}; -export {Input}; -export {inputs}; -export {InsertionMarkerManager}; -export {InsertionMarkerPreviewer}; -export {IObservable, isObservable}; -export {IPaster, isPaster}; -export {IPositionable}; -export {IRegistrable}; -export {IRenderedElement, isRenderedElement}; -export {ISelectable, isSelectable}; -export {ISelectableToolboxItem}; -export {ISerializable, isSerializable}; -export {IStyleable}; -export {IToolbox}; -export {IToolboxItem}; -export {IVariableBackedParameterModel, isVariableBackedParameterModel}; -export {Marker}; -export {MarkerManager}; -export {LayerManager}; -export {Menu}; -export {MenuItem}; -export {MetricsManager}; -export {Msg, setLocale}; -export {Names}; -export {Options}; -export {RenderedConnection}; -export {renderManagement}; -export {Scrollbar}; -export {ScrollbarPair}; -export {ShortcutRegistry}; -export {TabNavigateCursor}; -export {Theme}; -export {ThemeManager}; -export {Toolbox}; -export {ToolboxCategory}; -export {ToolboxItem}; -export {ToolboxSeparator}; -export {Trashcan}; -export {VariableMap}; -export {VariableModel}; -export {VerticalFlyout}; -export {Workspace}; -export {WorkspaceAudio}; -export {WorkspaceDragger}; -export {WorkspaceSvg}; -export {ZoomControls}; -export {config}; -export {inject}; -export {serialization}; -export {layers}; diff --git a/core/blockly_options.ts b/core/blockly_options.ts index e3ed0b91296..dd18dbfee5d 100644 --- a/core/blockly_options.ts +++ b/core/blockly_options.ts @@ -6,9 +6,9 @@ // Former goog.module ID: Blockly.BlocklyOptions -import type {Theme, ITheme} from './theme.js'; -import type {WorkspaceSvg} from './workspace_svg.js'; +import type {ITheme, Theme} from './theme.js'; import type {ToolboxDefinition} from './utils/toolbox.js'; +import type {WorkspaceSvg} from './workspace_svg.js'; /** * Blockly options. diff --git a/core/bubbles.ts b/core/bubbles.ts index 0c61741f92d..a49c2ae3581 100644 --- a/core/bubbles.ts +++ b/core/bubbles.ts @@ -5,8 +5,8 @@ */ import {Bubble} from './bubbles/bubble.js'; +import {MiniWorkspaceBubble} from './bubbles/mini_workspace_bubble.js'; import {TextBubble} from './bubbles/text_bubble.js'; import {TextInputBubble} from './bubbles/textinput_bubble.js'; -import {MiniWorkspaceBubble} from './bubbles/mini_workspace_bubble.js'; -export {Bubble, TextBubble, TextInputBubble, MiniWorkspaceBubble}; +export {Bubble, MiniWorkspaceBubble, TextBubble, TextInputBubble}; diff --git a/core/bubbles/bubble.ts b/core/bubbles/bubble.ts index e86f5a85673..bac94dbc8a0 100644 --- a/core/bubbles/bubble.ts +++ b/core/bubbles/bubble.ts @@ -4,21 +4,21 @@ * SPDX-License-Identifier: Apache-2.0 */ +import {ISelectable} from '../blockly.js'; import * as browserEvents from '../browser_events.js'; +import * as common from '../common.js'; import {BubbleDragStrategy} from '../dragging/bubble_drag_strategy.js'; import {IBubble} from '../interfaces/i_bubble.js'; import {ContainerRegion} from '../metrics_manager.js'; import {Scrollbar} from '../scrollbar.js'; import {Coordinate} from '../utils/coordinate.js'; import * as dom from '../utils/dom.js'; +import * as idGenerator from '../utils/idgenerator.js'; import * as math from '../utils/math.js'; import {Rect} from '../utils/rect.js'; import {Size} from '../utils/size.js'; import {Svg} from '../utils/svg.js'; import {WorkspaceSvg} from '../workspace_svg.js'; -import * as common from '../common.js'; -import {ISelectable} from '../blockly.js'; -import * as idGenerator from '../utils/idgenerator.js'; /** * The abstract pop-up bubble class. This creates a UI that looks like a speech diff --git a/core/bubbles/mini_workspace_bubble.ts b/core/bubbles/mini_workspace_bubble.ts index 74317d57bc1..f4ad96c8c00 100644 --- a/core/bubbles/mini_workspace_bubble.ts +++ b/core/bubbles/mini_workspace_bubble.ts @@ -4,16 +4,16 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {Abstract as AbstractEvent} from '../events/events_abstract.js'; import type {BlocklyOptions} from '../blockly_options.js'; -import {Bubble} from './bubble.js'; +import {Abstract as AbstractEvent} from '../events/events_abstract.js'; +import {Options} from '../options.js'; import {Coordinate} from '../utils/coordinate.js'; import * as dom from '../utils/dom.js'; -import {Options} from '../options.js'; -import {Svg} from '../utils/svg.js'; import type {Rect} from '../utils/rect.js'; import {Size} from '../utils/size.js'; +import {Svg} from '../utils/svg.js'; import type {WorkspaceSvg} from '../workspace_svg.js'; +import {Bubble} from './bubble.js'; /** * A bubble that contains a mini-workspace which can hold arbitrary blocks. diff --git a/core/bubbles/text_bubble.ts b/core/bubbles/text_bubble.ts index 020ab4f2ec1..7ac5fa02965 100644 --- a/core/bubbles/text_bubble.ts +++ b/core/bubbles/text_bubble.ts @@ -4,13 +4,13 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {Bubble} from './bubble.js'; import {Coordinate} from '../utils/coordinate.js'; import * as dom from '../utils/dom.js'; import {Rect} from '../utils/rect.js'; import {Size} from '../utils/size.js'; import {Svg} from '../utils/svg.js'; import {WorkspaceSvg} from '../workspace_svg.js'; +import {Bubble} from './bubble.js'; /** * A bubble that displays non-editable text. Used by the warning icon. diff --git a/core/bubbles/textinput_bubble.ts b/core/bubbles/textinput_bubble.ts index d7d1f5ae7db..675dbb5398e 100644 --- a/core/bubbles/textinput_bubble.ts +++ b/core/bubbles/textinput_bubble.ts @@ -4,16 +4,16 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {Bubble} from './bubble.js'; -import {Coordinate} from '../utils/coordinate.js'; import * as Css from '../css.js'; +import * as touch from '../touch.js'; +import {browserEvents} from '../utils.js'; +import {Coordinate} from '../utils/coordinate.js'; import * as dom from '../utils/dom.js'; import {Rect} from '../utils/rect.js'; import {Size} from '../utils/size.js'; import {Svg} from '../utils/svg.js'; -import * as touch from '../touch.js'; import {WorkspaceSvg} from '../workspace_svg.js'; -import {browserEvents} from '../utils.js'; +import {Bubble} from './bubble.js'; /** * A bubble that displays editable text. It can also be resized by the user. diff --git a/core/clipboard.ts b/core/clipboard.ts index ed574d11287..62e23fd24a3 100644 --- a/core/clipboard.ts +++ b/core/clipboard.ts @@ -6,12 +6,12 @@ // Former goog.module ID: Blockly.clipboard -import type {ICopyData, ICopyable} from './interfaces/i_copyable.js'; import {BlockPaster} from './clipboard/block_paster.js'; -import * as globalRegistry from './registry.js'; -import {WorkspaceSvg} from './workspace_svg.js'; import * as registry from './clipboard/registry.js'; +import type {ICopyData, ICopyable} from './interfaces/i_copyable.js'; +import * as globalRegistry from './registry.js'; import {Coordinate} from './utils/coordinate.js'; +import {WorkspaceSvg} from './workspace_svg.js'; /** Metadata about the object that is currently on the clipboard. */ let stashedCopyData: ICopyData | null = null; diff --git a/core/clipboard/block_paster.ts b/core/clipboard/block_paster.ts index f82adf2b385..04c55c5b062 100644 --- a/core/clipboard/block_paster.ts +++ b/core/clipboard/block_paster.ts @@ -5,15 +5,15 @@ */ import {BlockSvg} from '../block_svg.js'; -import * as registry from './registry.js'; +import * as common from '../common.js'; +import {config} from '../config.js'; +import * as eventUtils from '../events/utils.js'; import {ICopyData} from '../interfaces/i_copyable.js'; import {IPaster} from '../interfaces/i_paster.js'; import {State, append} from '../serialization/blocks.js'; import {Coordinate} from '../utils/coordinate.js'; import {WorkspaceSvg} from '../workspace_svg.js'; -import * as eventUtils from '../events/utils.js'; -import {config} from '../config.js'; -import * as common from '../common.js'; +import * as registry from './registry.js'; export class BlockPaster implements IPaster { static TYPE = 'block'; diff --git a/core/clipboard/workspace_comment_paster.ts b/core/clipboard/workspace_comment_paster.ts index c7e5eed68b0..173949a2b39 100644 --- a/core/clipboard/workspace_comment_paster.ts +++ b/core/clipboard/workspace_comment_paster.ts @@ -4,15 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {IPaster} from '../interfaces/i_paster.js'; +import {RenderedWorkspaceComment} from '../comments/rendered_workspace_comment.js'; +import * as common from '../common.js'; +import * as eventUtils from '../events/utils.js'; import {ICopyData} from '../interfaces/i_copyable.js'; +import {IPaster} from '../interfaces/i_paster.js'; +import * as commentSerialiation from '../serialization/workspace_comments.js'; import {Coordinate} from '../utils/coordinate.js'; import {WorkspaceSvg} from '../workspace_svg.js'; import * as registry from './registry.js'; -import * as commentSerialiation from '../serialization/workspace_comments.js'; -import * as eventUtils from '../events/utils.js'; -import * as common from '../common.js'; -import {RenderedWorkspaceComment} from '../comments/rendered_workspace_comment.js'; export class WorkspaceCommentPaster implements IPaster diff --git a/core/comments.ts b/core/comments.ts index 368db0e7783..ee85919873a 100644 --- a/core/comments.ts +++ b/core/comments.ts @@ -5,5 +5,5 @@ */ export {CommentView} from './comments/comment_view.js'; -export {WorkspaceComment} from './comments/workspace_comment.js'; export {RenderedWorkspaceComment} from './comments/rendered_workspace_comment.js'; +export {WorkspaceComment} from './comments/workspace_comment.js'; diff --git a/core/comments/comment_view.ts b/core/comments/comment_view.ts index bda2b9762a8..bf615163c72 100644 --- a/core/comments/comment_view.ts +++ b/core/comments/comment_view.ts @@ -4,16 +4,16 @@ * SPDX-License-Identifier: Apache-2.0 */ +import * as browserEvents from '../browser_events.js'; +import * as css from '../css.js'; import {IRenderedElement} from '../interfaces/i_rendered_element.js'; -import {WorkspaceSvg} from '../workspace_svg.js'; -import * as dom from '../utils/dom.js'; -import {Svg} from '../utils/svg.js'; import * as layers from '../layers.js'; -import * as css from '../css.js'; +import * as touch from '../touch.js'; import {Coordinate} from '../utils/coordinate.js'; +import * as dom from '../utils/dom.js'; import {Size} from '../utils/size.js'; -import * as browserEvents from '../browser_events.js'; -import * as touch from '../touch.js'; +import {Svg} from '../utils/svg.js'; +import {WorkspaceSvg} from '../workspace_svg.js'; export class CommentView implements IRenderedElement { /** The root group element of the comment view. */ diff --git a/core/comments/rendered_workspace_comment.ts b/core/comments/rendered_workspace_comment.ts index 7cc6438087c..ff21335741b 100644 --- a/core/comments/rendered_workspace_comment.ts +++ b/core/comments/rendered_workspace_comment.ts @@ -4,31 +4,31 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {WorkspaceComment} from './workspace_comment.js'; -import {WorkspaceSvg} from '../workspace_svg.js'; -import {CommentView} from './comment_view.js'; -import {Coordinate} from '../utils/coordinate.js'; -import {Rect} from '../utils/rect.js'; -import {Size} from '../utils/size.js'; -import {IBoundedElement} from '../interfaces/i_bounded_element.js'; -import {IRenderedElement} from '../interfaces/i_rendered_element.js'; -import * as dom from '../utils/dom.js'; -import {IDraggable} from '../interfaces/i_draggable.js'; -import {CommentDragStrategy} from '../dragging/comment_drag_strategy.js'; import * as browserEvents from '../browser_events.js'; -import * as common from '../common.js'; -import {ISelectable} from '../interfaces/i_selectable.js'; -import {IDeletable} from '../interfaces/i_deletable.js'; -import {ICopyable} from '../interfaces/i_copyable.js'; -import * as commentSerialization from '../serialization/workspace_comments.js'; import { - WorkspaceCommentPaster, WorkspaceCommentCopyData, + WorkspaceCommentPaster, } from '../clipboard/workspace_comment_paster.js'; -import {IContextMenu} from '../interfaces/i_contextmenu.js'; +import * as common from '../common.js'; import * as contextMenu from '../contextmenu.js'; import {ContextMenuRegistry} from '../contextmenu_registry.js'; +import {CommentDragStrategy} from '../dragging/comment_drag_strategy.js'; +import {IBoundedElement} from '../interfaces/i_bounded_element.js'; +import {IContextMenu} from '../interfaces/i_contextmenu.js'; +import {ICopyable} from '../interfaces/i_copyable.js'; +import {IDeletable} from '../interfaces/i_deletable.js'; +import {IDraggable} from '../interfaces/i_draggable.js'; +import {IRenderedElement} from '../interfaces/i_rendered_element.js'; +import {ISelectable} from '../interfaces/i_selectable.js'; import * as layers from '../layers.js'; +import * as commentSerialization from '../serialization/workspace_comments.js'; +import {Coordinate} from '../utils/coordinate.js'; +import * as dom from '../utils/dom.js'; +import {Rect} from '../utils/rect.js'; +import {Size} from '../utils/size.js'; +import {WorkspaceSvg} from '../workspace_svg.js'; +import {CommentView} from './comment_view.js'; +import {WorkspaceComment} from './workspace_comment.js'; export class RenderedWorkspaceComment extends WorkspaceComment diff --git a/core/comments/workspace_comment.ts b/core/comments/workspace_comment.ts index 0764b5168d2..a659bc8d98d 100644 --- a/core/comments/workspace_comment.ts +++ b/core/comments/workspace_comment.ts @@ -4,13 +4,13 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {Workspace} from '../workspace.js'; -import {Size} from '../utils/size.js'; -import {Coordinate} from '../utils/coordinate.js'; -import * as idGenerator from '../utils/idgenerator.js'; -import * as eventUtils from '../events/utils.js'; import {CommentMove} from '../events/events_comment_move.js'; import {CommentResize} from '../events/events_comment_resize.js'; +import * as eventUtils from '../events/utils.js'; +import {Coordinate} from '../utils/coordinate.js'; +import * as idGenerator from '../utils/idgenerator.js'; +import {Size} from '../utils/size.js'; +import {Workspace} from '../workspace.js'; export class WorkspaceComment { /** The unique identifier for this comment. */ diff --git a/core/common.ts b/core/common.ts index fba960a5b5a..fcd27b00d7c 100644 --- a/core/common.ts +++ b/core/common.ts @@ -6,14 +6,13 @@ // Former goog.module ID: Blockly.common -/* eslint-disable-next-line no-unused-vars */ import type {Block} from './block.js'; import {ISelectable} from './blockly.js'; import {BlockDefinition, Blocks} from './blocks.js'; import type {Connection} from './connection.js'; +import * as eventUtils from './events/utils.js'; import type {Workspace} from './workspace.js'; import type {WorkspaceSvg} from './workspace_svg.js'; -import * as eventUtils from './events/utils.js'; /** Database of all workspaces. */ const WorkspaceDB_ = Object.create(null); diff --git a/core/contextmenu.ts b/core/contextmenu.ts index e469c4335a1..8f46263580e 100644 --- a/core/contextmenu.ts +++ b/core/contextmenu.ts @@ -9,8 +9,8 @@ import type {Block} from './block.js'; import type {BlockSvg} from './block_svg.js'; import * as browserEvents from './browser_events.js'; +import * as common from './common.js'; import {config} from './config.js'; -import * as dom from './utils/dom.js'; import type { ContextMenuOption, LegacyContextMenuOption, @@ -18,14 +18,14 @@ import type { import * as eventUtils from './events/utils.js'; import {Menu} from './menu.js'; import {MenuItem} from './menuitem.js'; +import * as serializationBlocks from './serialization/blocks.js'; import * as aria from './utils/aria.js'; +import * as dom from './utils/dom.js'; import {Rect} from './utils/rect.js'; -import * as serializationBlocks from './serialization/blocks.js'; import * as svgMath from './utils/svg_math.js'; import * as WidgetDiv from './widgetdiv.js'; import type {WorkspaceSvg} from './workspace_svg.js'; import * as Xml from './xml.js'; -import * as common from './common.js'; /** * Which block is the context menu attached to? diff --git a/core/contextmenu_items.ts b/core/contextmenu_items.ts index 254906ce7ff..25ffab59b8b 100644 --- a/core/contextmenu_items.ts +++ b/core/contextmenu_items.ts @@ -9,12 +9,13 @@ import type {BlockSvg} from './block_svg.js'; import * as clipboard from './clipboard.js'; import {RenderedWorkspaceComment} from './comments/rendered_workspace_comment.js'; +import * as common from './common.js'; +import {MANUALLY_DISABLED} from './constants.js'; import { ContextMenuRegistry, RegistryItem, Scope, } from './contextmenu_registry.js'; -import {MANUALLY_DISABLED} from './constants.js'; import * as dialog from './dialog.js'; import * as Events from './events/events.js'; import * as eventUtils from './events/utils.js'; @@ -23,7 +24,6 @@ import {Msg} from './msg.js'; import {StatementInput} from './renderers/zelos/zelos.js'; import {Coordinate} from './utils/coordinate.js'; import type {WorkspaceSvg} from './workspace_svg.js'; -import * as common from './common.js'; /** * Option to undo previous action. diff --git a/core/delete_area.ts b/core/delete_area.ts index 4967927c42c..405084db9b1 100644 --- a/core/delete_area.ts +++ b/core/delete_area.ts @@ -14,9 +14,9 @@ import {BlockSvg} from './block_svg.js'; import {DragTarget} from './drag_target.js'; +import {isDeletable} from './interfaces/i_deletable.js'; import type {IDeleteArea} from './interfaces/i_delete_area.js'; import type {IDraggable} from './interfaces/i_draggable.js'; -import {isDeletable} from './interfaces/i_deletable.js'; /** * Abstract class for a component that can delete a block or bubble that is diff --git a/core/dragging.ts b/core/dragging.ts index a7e46fc27da..4ba85c49f7d 100644 --- a/core/dragging.ts +++ b/core/dragging.ts @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {Dragger} from './dragging/dragger.js'; import {BlockDragStrategy} from './dragging/block_drag_strategy.js'; import {BubbleDragStrategy} from './dragging/bubble_drag_strategy.js'; import {CommentDragStrategy} from './dragging/comment_drag_strategy.js'; +import {Dragger} from './dragging/dragger.js'; -export {Dragger, BlockDragStrategy, BubbleDragStrategy, CommentDragStrategy}; +export {BlockDragStrategy, BubbleDragStrategy, CommentDragStrategy, Dragger}; diff --git a/core/dragging/block_drag_strategy.ts b/core/dragging/block_drag_strategy.ts index 2afdba51f6b..968de39025e 100644 --- a/core/dragging/block_drag_strategy.ts +++ b/core/dragging/block_drag_strategy.ts @@ -4,24 +4,24 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {WorkspaceSvg} from '../workspace_svg.js'; -import {IDragStrategy} from '../interfaces/i_draggable.js'; -import {Coordinate} from '../utils.js'; -import * as eventUtils from '../events/utils.js'; -import {BlockSvg} from '../block_svg.js'; -import {RenderedConnection} from '../rendered_connection.js'; -import * as dom from '../utils/dom.js'; +import type {Block} from '../block.js'; import * as blockAnimation from '../block_animations.js'; -import {ConnectionType} from '../connection_type.js'; +import {BlockSvg} from '../block_svg.js'; import * as bumpObjects from '../bump_objects.js'; -import * as registry from '../registry.js'; -import {IConnectionPreviewer} from '../interfaces/i_connection_previewer.js'; -import {Connection} from '../connection.js'; -import type {Block} from '../block.js'; import {config} from '../config.js'; +import {Connection} from '../connection.js'; +import {ConnectionType} from '../connection_type.js'; import type {BlockMove} from '../events/events_block_move.js'; -import {finishQueuedRenders} from '../render_management.js'; +import * as eventUtils from '../events/utils.js'; +import {IConnectionPreviewer} from '../interfaces/i_connection_previewer.js'; +import {IDragStrategy} from '../interfaces/i_draggable.js'; import * as layers from '../layers.js'; +import * as registry from '../registry.js'; +import {finishQueuedRenders} from '../render_management.js'; +import {RenderedConnection} from '../rendered_connection.js'; +import {Coordinate} from '../utils.js'; +import * as dom from '../utils/dom.js'; +import {WorkspaceSvg} from '../workspace_svg.js'; /** Represents a nearby valid connection. */ interface ConnectionCandidate { diff --git a/core/dragging/bubble_drag_strategy.ts b/core/dragging/bubble_drag_strategy.ts index 05465a80447..c2a5c58f4a2 100644 --- a/core/dragging/bubble_drag_strategy.ts +++ b/core/dragging/bubble_drag_strategy.ts @@ -4,11 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {IDragStrategy} from '../interfaces/i_draggable.js'; -import {Coordinate} from '../utils.js'; -import * as eventUtils from '../events/utils.js'; import {IBubble, WorkspaceSvg} from '../blockly.js'; +import * as eventUtils from '../events/utils.js'; +import {IDragStrategy} from '../interfaces/i_draggable.js'; import * as layers from '../layers.js'; +import {Coordinate} from '../utils.js'; export class BubbleDragStrategy implements IDragStrategy { private startLoc: Coordinate | null = null; diff --git a/core/dragging/comment_drag_strategy.ts b/core/dragging/comment_drag_strategy.ts index 2197d37f252..4053638c22a 100644 --- a/core/dragging/comment_drag_strategy.ts +++ b/core/dragging/comment_drag_strategy.ts @@ -4,13 +4,13 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {IDragStrategy} from '../interfaces/i_draggable.js'; -import {Coordinate} from '../utils.js'; +import {RenderedWorkspaceComment} from '../comments.js'; +import {CommentMove} from '../events/events_comment_move.js'; import * as eventUtils from '../events/utils.js'; +import {IDragStrategy} from '../interfaces/i_draggable.js'; import * as layers from '../layers.js'; -import {RenderedWorkspaceComment} from '../comments.js'; +import {Coordinate} from '../utils.js'; import {WorkspaceSvg} from '../workspace_svg.js'; -import {CommentMove} from '../events/events_comment_move.js'; export class CommentDragStrategy implements IDragStrategy { private startLoc: Coordinate | null = null; diff --git a/core/dragging/dragger.ts b/core/dragging/dragger.ts index 66d447a6fca..8a9ac87c6a9 100644 --- a/core/dragging/dragger.ts +++ b/core/dragging/dragger.ts @@ -4,18 +4,18 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {IDragTarget} from '../interfaces/i_drag_target.js'; +import * as blockAnimations from '../block_animations.js'; +import {BlockSvg} from '../block_svg.js'; +import {ComponentManager} from '../component_manager.js'; +import * as eventUtils from '../events/utils.js'; import {IDeletable, isDeletable} from '../interfaces/i_deletable.js'; -import {IDragger} from '../interfaces/i_dragger.js'; +import {IDeleteArea} from '../interfaces/i_delete_area.js'; +import {IDragTarget} from '../interfaces/i_drag_target.js'; import {IDraggable} from '../interfaces/i_draggable.js'; +import {IDragger} from '../interfaces/i_dragger.js'; +import * as registry from '../registry.js'; import {Coordinate} from '../utils/coordinate.js'; import {WorkspaceSvg} from '../workspace_svg.js'; -import {ComponentManager} from '../component_manager.js'; -import {IDeleteArea} from '../interfaces/i_delete_area.js'; -import * as registry from '../registry.js'; -import * as eventUtils from '../events/utils.js'; -import * as blockAnimations from '../block_animations.js'; -import {BlockSvg} from '../block_svg.js'; export class Dragger implements IDragger { protected startLoc: Coordinate; diff --git a/core/dropdowndiv.ts b/core/dropdowndiv.ts index 5b531912a61..f9af02ac9f7 100644 --- a/core/dropdowndiv.ts +++ b/core/dropdowndiv.ts @@ -14,8 +14,8 @@ import type {BlockSvg} from './block_svg.js'; import * as common from './common.js'; -import * as dom from './utils/dom.js'; import type {Field} from './field.js'; +import * as dom from './utils/dom.js'; import * as math from './utils/math.js'; import {Rect} from './utils/rect.js'; import type {Size} from './utils/size.js'; diff --git a/core/events/events.ts b/core/events/events.ts index b31cf7dc788..97dc8cba4dc 100644 --- a/core/events/events.ts +++ b/core/events/events.ts @@ -21,15 +21,15 @@ import {BubbleOpen, BubbleOpenJson, BubbleType} from './events_bubble_open.js'; import {Click, ClickJson, ClickTarget} from './events_click.js'; import {CommentBase, CommentBaseJson} from './events_comment_base.js'; import {CommentChange, CommentChangeJson} from './events_comment_change.js'; -import {CommentCreate, CommentCreateJson} from './events_comment_create.js'; -import {CommentDelete} from './events_comment_delete.js'; -import {CommentMove, CommentMoveJson} from './events_comment_move.js'; -import {CommentResize, CommentResizeJson} from './events_comment_resize.js'; -import {CommentDrag, CommentDragJson} from './events_comment_drag.js'; import { CommentCollapse, CommentCollapseJson, } from './events_comment_collapse.js'; +import {CommentCreate, CommentCreateJson} from './events_comment_create.js'; +import {CommentDelete} from './events_comment_delete.js'; +import {CommentDrag, CommentDragJson} from './events_comment_drag.js'; +import {CommentMove, CommentMoveJson} from './events_comment_move.js'; +import {CommentResize, CommentResizeJson} from './events_comment_resize.js'; import {MarkerMove, MarkerMoveJson} from './events_marker_move.js'; import {Selected, SelectedJson} from './events_selected.js'; import {ThemeChange, ThemeChangeJson} from './events_theme_change.js'; @@ -48,65 +48,67 @@ import * as eventUtils from './utils.js'; import {FinishedLoading} from './workspace_events.js'; // Events. -export {Abstract}; -export {AbstractEventJson}; -export {BubbleOpen}; -export {BubbleOpenJson}; -export {BubbleType}; -export {BlockBase}; -export {BlockBaseJson}; -export {BlockChange}; -export {BlockChangeJson}; -export {BlockCreate}; -export {BlockCreateJson}; -export {BlockDelete}; -export {BlockDeleteJson}; -export {BlockDrag}; -export {BlockDragJson}; -export {BlockFieldIntermediateChange}; -export {BlockFieldIntermediateChangeJson}; -export {BlockMove}; -export {BlockMoveJson}; -export {Click}; -export {ClickJson}; -export {ClickTarget}; -export {CommentBase}; -export {CommentBaseJson}; -export {CommentChange}; -export {CommentChangeJson}; -export {CommentCreate}; -export {CommentCreateJson}; -export {CommentDelete}; -export {CommentMove}; -export {CommentMoveJson}; -export {CommentResize}; -export {CommentResizeJson}; -export {CommentDrag}; -export {CommentDragJson}; -export {CommentCollapse}; -export {CommentCollapseJson}; -export {FinishedLoading}; -export {MarkerMove}; -export {MarkerMoveJson}; -export {Selected}; -export {SelectedJson}; -export {ThemeChange}; -export {ThemeChangeJson}; -export {ToolboxItemSelect}; -export {ToolboxItemSelectJson}; -export {TrashcanOpen}; -export {TrashcanOpenJson}; -export {UiBase}; -export {VarBase}; -export {VarBaseJson}; -export {VarCreate}; -export {VarCreateJson}; -export {VarDelete}; -export {VarDeleteJson}; -export {VarRename}; -export {VarRenameJson}; -export {ViewportChange}; -export {ViewportChangeJson}; +export { + Abstract, + AbstractEventJson, + BlockBase, + BlockBaseJson, + BlockChange, + BlockChangeJson, + BlockCreate, + BlockCreateJson, + BlockDelete, + BlockDeleteJson, + BlockDrag, + BlockDragJson, + BlockFieldIntermediateChange, + BlockFieldIntermediateChangeJson, + BlockMove, + BlockMoveJson, + BubbleOpen, + BubbleOpenJson, + BubbleType, + Click, + ClickJson, + ClickTarget, + CommentBase, + CommentBaseJson, + CommentChange, + CommentChangeJson, + CommentCollapse, + CommentCollapseJson, + CommentCreate, + CommentCreateJson, + CommentDelete, + CommentDrag, + CommentDragJson, + CommentMove, + CommentMoveJson, + CommentResize, + CommentResizeJson, + FinishedLoading, + MarkerMove, + MarkerMoveJson, + Selected, + SelectedJson, + ThemeChange, + ThemeChangeJson, + ToolboxItemSelect, + ToolboxItemSelectJson, + TrashcanOpen, + TrashcanOpenJson, + UiBase, + VarBase, + VarBaseJson, + VarCreate, + VarCreateJson, + VarDelete, + VarDeleteJson, + VarRename, + VarRenameJson, + ViewportChange, + ViewportChangeJson, +}; // Event types. export const BLOCK_CHANGE = eventUtils.BLOCK_CHANGE; diff --git a/core/events/events_abstract.ts b/core/events/events_abstract.ts index 7f06d48e92a..b63c742b5a4 100644 --- a/core/events/events_abstract.ts +++ b/core/events/events_abstract.ts @@ -14,7 +14,6 @@ import * as common from '../common.js'; import type {Workspace} from '../workspace.js'; - import * as eventUtils from './utils.js'; /** diff --git a/core/events/events_block_base.ts b/core/events/events_block_base.ts index 350985428a3..d15b8e439ed 100644 --- a/core/events/events_block_base.ts +++ b/core/events/events_block_base.ts @@ -13,7 +13,6 @@ import type {Block} from '../block.js'; import type {Workspace} from '../workspace.js'; - import { Abstract as AbstractEvent, AbstractEventJson, diff --git a/core/events/events_block_change.ts b/core/events/events_block_change.ts index 570b7f58e2c..103dc34273e 100644 --- a/core/events/events_block_change.ts +++ b/core/events/events_block_change.ts @@ -13,14 +13,13 @@ import type {Block} from '../block.js'; import type {BlockSvg} from '../block_svg.js'; +import {MANUALLY_DISABLED} from '../constants.js'; import {IconType} from '../icons/icon_types.js'; import {hasBubble} from '../interfaces/i_has_bubble.js'; -import {MANUALLY_DISABLED} from '../constants.js'; import * as registry from '../registry.js'; import * as utilsXml from '../utils/xml.js'; import {Workspace} from '../workspace.js'; import * as Xml from '../xml.js'; - import {BlockBase, BlockBaseJson} from './events_block_base.js'; import * as eventUtils from './utils.js'; diff --git a/core/events/events_block_create.ts b/core/events/events_block_create.ts index cbabc9332de..6f14a811760 100644 --- a/core/events/events_block_create.ts +++ b/core/events/events_block_create.ts @@ -15,11 +15,10 @@ import type {Block} from '../block.js'; import * as registry from '../registry.js'; import * as blocks from '../serialization/blocks.js'; import * as utilsXml from '../utils/xml.js'; +import {Workspace} from '../workspace.js'; import * as Xml from '../xml.js'; - import {BlockBase, BlockBaseJson} from './events_block_base.js'; import * as eventUtils from './utils.js'; -import {Workspace} from '../workspace.js'; /** * Notifies listeners when a block (or connected stack of blocks) is diff --git a/core/events/events_block_delete.ts b/core/events/events_block_delete.ts index 3375a78dda3..e1c04f36550 100644 --- a/core/events/events_block_delete.ts +++ b/core/events/events_block_delete.ts @@ -15,11 +15,10 @@ import type {Block} from '../block.js'; import * as registry from '../registry.js'; import * as blocks from '../serialization/blocks.js'; import * as utilsXml from '../utils/xml.js'; +import {Workspace} from '../workspace.js'; import * as Xml from '../xml.js'; - import {BlockBase, BlockBaseJson} from './events_block_base.js'; import * as eventUtils from './utils.js'; -import {Workspace} from '../workspace.js'; /** * Notifies listeners when a block (or connected stack of blocks) is diff --git a/core/events/events_block_drag.ts b/core/events/events_block_drag.ts index 3729ab77756..0045d2bec6a 100644 --- a/core/events/events_block_drag.ts +++ b/core/events/events_block_drag.ts @@ -13,10 +13,10 @@ import type {Block} from '../block.js'; import * as registry from '../registry.js'; +import {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; import * as eventUtils from './utils.js'; -import {Workspace} from '../workspace.js'; /** * Notifies listeners when a block is being manually dragged/dropped. diff --git a/core/events/events_block_field_intermediate_change.ts b/core/events/events_block_field_intermediate_change.ts index 264f910a8a2..ef077a97a8b 100644 --- a/core/events/events_block_field_intermediate_change.ts +++ b/core/events/events_block_field_intermediate_change.ts @@ -15,7 +15,6 @@ import type {Block} from '../block.js'; import * as registry from '../registry.js'; import {Workspace} from '../workspace.js'; - import {BlockBase, BlockBaseJson} from './events_block_base.js'; import * as eventUtils from './utils.js'; diff --git a/core/events/events_block_move.ts b/core/events/events_block_move.ts index 6c05ab2af28..233880eef2c 100644 --- a/core/events/events_block_move.ts +++ b/core/events/events_block_move.ts @@ -15,10 +15,9 @@ import type {Block} from '../block.js'; import {ConnectionType} from '../connection_type.js'; import * as registry from '../registry.js'; import {Coordinate} from '../utils/coordinate.js'; - +import type {Workspace} from '../workspace.js'; import {BlockBase, BlockBaseJson} from './events_block_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; interface BlockLocation { parentId?: string; diff --git a/core/events/events_bubble_open.ts b/core/events/events_bubble_open.ts index 023e16a17e7..fa9b43d2591 100644 --- a/core/events/events_bubble_open.ts +++ b/core/events/events_bubble_open.ts @@ -11,12 +11,12 @@ */ // Former goog.module ID: Blockly.Events.BubbleOpen -import type {AbstractEventJson} from './events_abstract.js'; import type {BlockSvg} from '../block_svg.js'; import * as registry from '../registry.js'; +import type {Workspace} from '../workspace.js'; +import type {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Class for a bubble open event. diff --git a/core/events/events_click.ts b/core/events/events_click.ts index 1b15560695d..ada1ebc3ea0 100644 --- a/core/events/events_click.ts +++ b/core/events/events_click.ts @@ -13,11 +13,10 @@ import type {Block} from '../block.js'; import * as registry from '../registry.js'; +import {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; - import {UiBase} from './events_ui_base.js'; import * as eventUtils from './utils.js'; -import {Workspace} from '../workspace.js'; /** * Notifies listeners that some blockly element was clicked. diff --git a/core/events/events_comment_base.ts b/core/events/events_comment_base.ts index 6fbc95c4d60..afda026f2c1 100644 --- a/core/events/events_comment_base.ts +++ b/core/events/events_comment_base.ts @@ -13,6 +13,7 @@ import type {WorkspaceComment} from '../comments/workspace_comment.js'; import * as comments from '../serialization/workspace_comments.js'; +import type {Workspace} from '../workspace.js'; import { Abstract as AbstractEvent, AbstractEventJson, @@ -20,7 +21,6 @@ import { import type {CommentCreate} from './events_comment_create.js'; import type {CommentDelete} from './events_comment_delete.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Abstract class for a comment event. diff --git a/core/events/events_comment_change.ts b/core/events/events_comment_change.ts index eb39d929de9..ca807a6d28b 100644 --- a/core/events/events_comment_change.ts +++ b/core/events/events_comment_change.ts @@ -11,12 +11,11 @@ */ // Former goog.module ID: Blockly.Events.CommentChange -import * as registry from '../registry.js'; import type {WorkspaceComment} from '../comments/workspace_comment.js'; - +import * as registry from '../registry.js'; +import type {Workspace} from '../workspace.js'; import {CommentBase, CommentBaseJson} from './events_comment_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that the contents of a workspace comment has changed. diff --git a/core/events/events_comment_collapse.ts b/core/events/events_comment_collapse.ts index 6646b1df296..30147f3d85c 100644 --- a/core/events/events_comment_collapse.ts +++ b/core/events/events_comment_collapse.ts @@ -4,11 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as registry from '../registry.js'; import {WorkspaceComment} from '../comments/workspace_comment.js'; +import * as registry from '../registry.js'; +import type {Workspace} from '../workspace.js'; import {CommentBase, CommentBaseJson} from './events_comment_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; export class CommentCollapse extends CommentBase { override type = eventUtils.COMMENT_COLLAPSE; diff --git a/core/events/events_comment_create.ts b/core/events/events_comment_create.ts index 692397df683..b4ee7ad7175 100644 --- a/core/events/events_comment_create.ts +++ b/core/events/events_comment_create.ts @@ -11,14 +11,14 @@ */ // Former goog.module ID: Blockly.Events.CommentCreate -import * as registry from '../registry.js'; import type {WorkspaceComment} from '../comments/workspace_comment.js'; +import * as registry from '../registry.js'; import * as comments from '../serialization/workspace_comments.js'; import * as utilsXml from '../utils/xml.js'; +import type {Workspace} from '../workspace.js'; import * as Xml from '../xml.js'; import {CommentBase, CommentBaseJson} from './events_comment_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that a workspace comment was created. diff --git a/core/events/events_comment_delete.ts b/core/events/events_comment_delete.ts index 62f8916fb3b..a429ab82432 100644 --- a/core/events/events_comment_delete.ts +++ b/core/events/events_comment_delete.ts @@ -11,14 +11,14 @@ */ // Former goog.module ID: Blockly.Events.CommentDelete -import * as registry from '../registry.js'; import type {WorkspaceComment} from '../comments/workspace_comment.js'; +import * as registry from '../registry.js'; import * as comments from '../serialization/workspace_comments.js'; -import {CommentBase, CommentBaseJson} from './events_comment_base.js'; -import * as eventUtils from './utils.js'; import * as utilsXml from '../utils/xml.js'; -import * as Xml from '../xml.js'; import type {Workspace} from '../workspace.js'; +import * as Xml from '../xml.js'; +import {CommentBase, CommentBaseJson} from './events_comment_base.js'; +import * as eventUtils from './utils.js'; /** * Notifies listeners that a workspace comment has been deleted. diff --git a/core/events/events_comment_drag.ts b/core/events/events_comment_drag.ts index 80caeea52ff..7ca21d4dc65 100644 --- a/core/events/events_comment_drag.ts +++ b/core/events/events_comment_drag.ts @@ -10,10 +10,10 @@ import type {WorkspaceComment} from '../comments/workspace_comment.js'; import * as registry from '../registry.js'; +import {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; import * as eventUtils from './utils.js'; -import {Workspace} from '../workspace.js'; /** * Notifies listeners when a comment is being manually dragged/dropped. diff --git a/core/events/events_comment_move.ts b/core/events/events_comment_move.ts index 502ca032f4c..d50efec5a17 100644 --- a/core/events/events_comment_move.ts +++ b/core/events/events_comment_move.ts @@ -11,13 +11,12 @@ */ // Former goog.module ID: Blockly.Events.CommentMove +import type {WorkspaceComment} from '../comments/workspace_comment.js'; import * as registry from '../registry.js'; import {Coordinate} from '../utils/coordinate.js'; -import type {WorkspaceComment} from '../comments/workspace_comment.js'; - +import type {Workspace} from '../workspace.js'; import {CommentBase, CommentBaseJson} from './events_comment_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that a workspace comment has moved. diff --git a/core/events/events_comment_resize.ts b/core/events/events_comment_resize.ts index dfc785832f4..623e0c4152b 100644 --- a/core/events/events_comment_resize.ts +++ b/core/events/events_comment_resize.ts @@ -8,13 +8,12 @@ * Class for comment resize event. */ +import type {WorkspaceComment} from '../comments/workspace_comment.js'; import * as registry from '../registry.js'; import {Size} from '../utils/size.js'; -import type {WorkspaceComment} from '../comments/workspace_comment.js'; - +import type {Workspace} from '../workspace.js'; import {CommentBase, CommentBaseJson} from './events_comment_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that a workspace comment has resized. diff --git a/core/events/events_marker_move.ts b/core/events/events_marker_move.ts index f162eeca9a8..e5c7dc47dd9 100644 --- a/core/events/events_marker_move.ts +++ b/core/events/events_marker_move.ts @@ -16,7 +16,6 @@ import {ASTNode} from '../keyboard_nav/ast_node.js'; import * as registry from '../registry.js'; import type {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; - import {UiBase} from './events_ui_base.js'; import * as eventUtils from './utils.js'; diff --git a/core/events/events_selected.ts b/core/events/events_selected.ts index c320c67462b..1892dcb185b 100644 --- a/core/events/events_selected.ts +++ b/core/events/events_selected.ts @@ -12,11 +12,10 @@ // Former goog.module ID: Blockly.Events.Selected import * as registry from '../registry.js'; +import type {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; - import {UiBase} from './events_ui_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Class for a selected event. diff --git a/core/events/events_theme_change.ts b/core/events/events_theme_change.ts index c0267ac6caa..c92aa0b7e30 100644 --- a/core/events/events_theme_change.ts +++ b/core/events/events_theme_change.ts @@ -12,10 +12,10 @@ // Former goog.module ID: Blockly.Events.ThemeChange import * as registry from '../registry.js'; +import type {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that the workspace theme has changed. diff --git a/core/events/events_toolbox_item_select.ts b/core/events/events_toolbox_item_select.ts index f1810deadc2..f462addf307 100644 --- a/core/events/events_toolbox_item_select.ts +++ b/core/events/events_toolbox_item_select.ts @@ -12,10 +12,10 @@ // Former goog.module ID: Blockly.Events.ToolboxItemSelect import * as registry from '../registry.js'; +import type {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that a toolbox item has been selected. diff --git a/core/events/events_trashcan_open.ts b/core/events/events_trashcan_open.ts index 745e7459cf8..bbd5d2dd958 100644 --- a/core/events/events_trashcan_open.ts +++ b/core/events/events_trashcan_open.ts @@ -12,11 +12,10 @@ // Former goog.module ID: Blockly.Events.TrashcanOpen import * as registry from '../registry.js'; +import type {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; - import {UiBase} from './events_ui_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners when the trashcan is opening or closing. diff --git a/core/events/events_var_base.ts b/core/events/events_var_base.ts index 74537f144ff..8e359de517f 100644 --- a/core/events/events_var_base.ts +++ b/core/events/events_var_base.ts @@ -12,12 +12,11 @@ // Former goog.module ID: Blockly.Events.VarBase import type {VariableModel} from '../variable_model.js'; - +import type {Workspace} from '../workspace.js'; import { Abstract as AbstractEvent, AbstractEventJson, } from './events_abstract.js'; -import type {Workspace} from '../workspace.js'; /** * Abstract class for a variable event. diff --git a/core/events/events_var_create.ts b/core/events/events_var_create.ts index a719cad985a..6376e1a615c 100644 --- a/core/events/events_var_create.ts +++ b/core/events/events_var_create.ts @@ -13,10 +13,9 @@ import * as registry from '../registry.js'; import type {VariableModel} from '../variable_model.js'; - +import type {Workspace} from '../workspace.js'; import {VarBase, VarBaseJson} from './events_var_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that a variable model has been created. diff --git a/core/events/events_var_delete.ts b/core/events/events_var_delete.ts index fc19461d4cd..1252697916d 100644 --- a/core/events/events_var_delete.ts +++ b/core/events/events_var_delete.ts @@ -8,10 +8,9 @@ import * as registry from '../registry.js'; import type {VariableModel} from '../variable_model.js'; - +import type {Workspace} from '../workspace.js'; import {VarBase, VarBaseJson} from './events_var_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that a variable model has been deleted. diff --git a/core/events/events_var_rename.ts b/core/events/events_var_rename.ts index 3bb1e90eb56..268d6abc993 100644 --- a/core/events/events_var_rename.ts +++ b/core/events/events_var_rename.ts @@ -8,10 +8,9 @@ import * as registry from '../registry.js'; import type {VariableModel} from '../variable_model.js'; - +import type {Workspace} from '../workspace.js'; import {VarBase, VarBaseJson} from './events_var_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that a variable model was renamed. diff --git a/core/events/events_viewport.ts b/core/events/events_viewport.ts index aff236e48a2..24347709930 100644 --- a/core/events/events_viewport.ts +++ b/core/events/events_viewport.ts @@ -12,10 +12,10 @@ // Former goog.module ID: Blockly.Events.ViewportChange import * as registry from '../registry.js'; +import type {Workspace} from '../workspace.js'; import {AbstractEventJson} from './events_abstract.js'; import {UiBase} from './events_ui_base.js'; import * as eventUtils from './utils.js'; -import type {Workspace} from '../workspace.js'; /** * Notifies listeners that the workspace surface's position or scale has diff --git a/core/events/utils.ts b/core/events/utils.ts index 0bb69980e8d..2e2701cf93f 100644 --- a/core/events/utils.ts +++ b/core/events/utils.ts @@ -12,7 +12,6 @@ import * as registry from '../registry.js'; import * as idGenerator from '../utils/idgenerator.js'; import type {Workspace} from '../workspace.js'; import type {WorkspaceSvg} from '../workspace_svg.js'; - import type {Abstract} from './events_abstract.js'; import type {BlockChange} from './events_block_change.js'; import type {BlockCreate} from './events_block_create.js'; diff --git a/core/field.ts b/core/field.ts index 777b19f559e..87a27f446ad 100644 --- a/core/field.ts +++ b/core/field.ts @@ -26,6 +26,7 @@ import type {IASTNodeLocationSvg} from './interfaces/i_ast_node_location_svg.js' import type {IASTNodeLocationWithBlock} from './interfaces/i_ast_node_location_with_block.js'; import type {IKeyboardAccessible} from './interfaces/i_keyboard_accessible.js'; import type {IRegistrable} from './interfaces/i_registrable.js'; +import {ISerializable} from './interfaces/i_serializable.js'; import {MarkerManager} from './marker_manager.js'; import type {ConstantProvider} from './renderers/common/constants.js'; import type {KeyboardShortcut} from './shortcut_registry.js'; @@ -41,7 +42,6 @@ import * as userAgent from './utils/useragent.js'; import * as utilsXml from './utils/xml.js'; import * as WidgetDiv from './widgetdiv.js'; import type {WorkspaceSvg} from './workspace_svg.js'; -import {ISerializable} from './interfaces/i_serializable.js'; /** * A function that is called to validate changes to the field's value before diff --git a/core/field_checkbox.ts b/core/field_checkbox.ts index 83f460bb9d2..01d1851aa04 100644 --- a/core/field_checkbox.ts +++ b/core/field_checkbox.ts @@ -14,9 +14,9 @@ // Unused import preserved for side-effects. Remove if unneeded. import './events/events_block_change.js'; -import * as dom from './utils/dom.js'; import {Field, FieldConfig, FieldValidator} from './field.js'; import * as fieldRegistry from './field_registry.js'; +import * as dom from './utils/dom.js'; type BoolString = 'TRUE' | 'FALSE'; type CheckboxBool = BoolString | boolean; diff --git a/core/field_dropdown.ts b/core/field_dropdown.ts index 58a4b073218..71b17326d95 100644 --- a/core/field_dropdown.ts +++ b/core/field_dropdown.ts @@ -24,12 +24,12 @@ import { import * as fieldRegistry from './field_registry.js'; import {Menu} from './menu.js'; import {MenuItem} from './menuitem.js'; -import * as style from './utils/style.js'; import * as aria from './utils/aria.js'; import {Coordinate} from './utils/coordinate.js'; import * as dom from './utils/dom.js'; import * as parsing from './utils/parsing.js'; import * as utilsString from './utils/string.js'; +import * as style from './utils/style.js'; import {Svg} from './utils/svg.js'; /** diff --git a/core/field_input.ts b/core/field_input.ts index 85431cc5b33..c3641f4f801 100644 --- a/core/field_input.ts +++ b/core/field_input.ts @@ -15,10 +15,9 @@ import './events/events_block_change.js'; import {BlockSvg} from './block_svg.js'; -import * as bumpObjects from './bump_objects.js'; import * as browserEvents from './browser_events.js'; +import * as bumpObjects from './bump_objects.js'; import * as dialog from './dialog.js'; -import * as dom from './utils/dom.js'; import * as dropDownDiv from './dropdowndiv.js'; import * as eventUtils from './events/utils.js'; import { @@ -30,10 +29,11 @@ import { import {Msg} from './msg.js'; import * as aria from './utils/aria.js'; import {Coordinate} from './utils/coordinate.js'; +import * as dom from './utils/dom.js'; +import {Size} from './utils/size.js'; import * as userAgent from './utils/useragent.js'; import * as WidgetDiv from './widgetdiv.js'; import type {WorkspaceSvg} from './workspace_svg.js'; -import {Size} from './utils/size.js'; /** * Supported types for FieldInput subclasses. diff --git a/core/field_label.ts b/core/field_label.ts index 2b77b0d25ff..2b0ae1eba49 100644 --- a/core/field_label.ts +++ b/core/field_label.ts @@ -12,9 +12,9 @@ */ // Former goog.module ID: Blockly.FieldLabel -import * as dom from './utils/dom.js'; import {Field, FieldConfig} from './field.js'; import * as fieldRegistry from './field_registry.js'; +import * as dom from './utils/dom.js'; import * as parsing from './utils/parsing.js'; /** diff --git a/core/field_number.ts b/core/field_number.ts index e8e51d06007..0641b9ae32b 100644 --- a/core/field_number.ts +++ b/core/field_number.ts @@ -12,12 +12,12 @@ // Former goog.module ID: Blockly.FieldNumber import {Field} from './field.js'; -import * as fieldRegistry from './field_registry.js'; import { FieldInput, FieldInputConfig, FieldInputValidator, } from './field_input.js'; +import * as fieldRegistry from './field_registry.js'; import * as aria from './utils/aria.js'; /** diff --git a/core/flyout_base.ts b/core/flyout_base.ts index e81df427995..2a048a2c968 100644 --- a/core/flyout_base.ts +++ b/core/flyout_base.ts @@ -11,19 +11,21 @@ */ // Former goog.module ID: Blockly.Flyout -import type {Abstract as AbstractEvent} from './events/events_abstract.js'; import type {Block} from './block.js'; import {BlockSvg} from './block_svg.js'; import * as browserEvents from './browser_events.js'; import * as common from './common.js'; import {ComponentManager} from './component_manager.js'; +import {MANUALLY_DISABLED} from './constants.js'; import {DeleteArea} from './delete_area.js'; +import type {Abstract as AbstractEvent} from './events/events_abstract.js'; import * as eventUtils from './events/utils.js'; import {FlyoutButton} from './flyout_button.js'; import {FlyoutMetricsManager} from './flyout_metrics_manager.js'; +import {IAutoHideable} from './interfaces/i_autohideable.js'; import type {IFlyout} from './interfaces/i_flyout.js'; -import {MANUALLY_DISABLED} from './constants.js'; import type {Options} from './options.js'; +import * as renderManagement from './render_management.js'; import {ScrollbarPair} from './scrollbar_pair.js'; import * as blocks from './serialization/blocks.js'; import * as Tooltip from './tooltip.js'; @@ -32,12 +34,10 @@ import * as dom from './utils/dom.js'; import * as idGenerator from './utils/idgenerator.js'; import {Svg} from './utils/svg.js'; import * as toolbox from './utils/toolbox.js'; +import * as utilsXml from './utils/xml.js'; import * as Variables from './variables.js'; import {WorkspaceSvg} from './workspace_svg.js'; -import * as utilsXml from './utils/xml.js'; import * as Xml from './xml.js'; -import * as renderManagement from './render_management.js'; -import {IAutoHideable} from './interfaces/i_autohideable.js'; enum FlyoutItemType { BLOCK = 'block', diff --git a/core/flyout_button.ts b/core/flyout_button.ts index e73403d77a0..b03a8d9615c 100644 --- a/core/flyout_button.ts +++ b/core/flyout_button.ts @@ -11,6 +11,7 @@ */ // Former goog.module ID: Blockly.FlyoutButton +import type {IASTNodeLocationSvg} from './blockly.js'; import * as browserEvents from './browser_events.js'; import * as Css from './css.js'; import {Coordinate} from './utils/coordinate.js'; @@ -20,7 +21,6 @@ import * as style from './utils/style.js'; import {Svg} from './utils/svg.js'; import type * as toolbox from './utils/toolbox.js'; import type {WorkspaceSvg} from './workspace_svg.js'; -import type {IASTNodeLocationSvg} from './blockly.js'; /** * Class for a button or label in the flyout. diff --git a/core/gesture.ts b/core/gesture.ts index 0aefba47dc0..a9a04e04624 100644 --- a/core/gesture.ts +++ b/core/gesture.ts @@ -18,23 +18,23 @@ import './events/events_click.js'; import * as blockAnimations from './block_animations.js'; import type {BlockSvg} from './block_svg.js'; import * as browserEvents from './browser_events.js'; +import {RenderedWorkspaceComment} from './comments.js'; import * as common from './common.js'; import {config} from './config.js'; import * as dropDownDiv from './dropdowndiv.js'; import * as eventUtils from './events/utils.js'; import type {Field} from './field.js'; import type {IBubble} from './interfaces/i_bubble.js'; +import {IDraggable, isDraggable} from './interfaces/i_draggable.js'; +import {IDragger} from './interfaces/i_dragger.js'; import type {IFlyout} from './interfaces/i_flyout.js'; +import type {IIcon} from './interfaces/i_icon.js'; +import * as registry from './registry.js'; import * as Tooltip from './tooltip.js'; import * as Touch from './touch.js'; import {Coordinate} from './utils/coordinate.js'; import {WorkspaceDragger} from './workspace_dragger.js'; import type {WorkspaceSvg} from './workspace_svg.js'; -import type {IIcon} from './interfaces/i_icon.js'; -import {IDragger} from './interfaces/i_dragger.js'; -import * as registry from './registry.js'; -import {IDraggable, isDraggable} from './interfaces/i_draggable.js'; -import {RenderedWorkspaceComment} from './comments.js'; /** * Note: In this file "start" refers to pointerdown diff --git a/core/grid.ts b/core/grid.ts index 1a5de250e5c..e2fc054a262 100644 --- a/core/grid.ts +++ b/core/grid.ts @@ -12,10 +12,10 @@ */ // Former goog.module ID: Blockly.Grid -import * as dom from './utils/dom.js'; +import {GridOptions} from './options.js'; import {Coordinate} from './utils/coordinate.js'; +import * as dom from './utils/dom.js'; import {Svg} from './utils/svg.js'; -import {GridOptions} from './options.js'; /** * Class for a workspace's grid. diff --git a/core/icons.ts b/core/icons.ts index 61d1594b826..fcc7c98c663 100644 --- a/core/icons.ts +++ b/core/icons.ts @@ -4,21 +4,21 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {Icon} from './icons/icon.js'; import {CommentIcon, CommentState} from './icons/comment_icon.js'; -import {MutatorIcon} from './icons/mutator_icon.js'; -import {WarningIcon} from './icons/warning_icon.js'; -import {IconType} from './icons/icon_types.js'; import * as exceptions from './icons/exceptions.js'; +import {Icon} from './icons/icon.js'; +import {IconType} from './icons/icon_types.js'; +import {MutatorIcon} from './icons/mutator_icon.js'; import * as registry from './icons/registry.js'; +import {WarningIcon} from './icons/warning_icon.js'; export { - Icon, CommentIcon, CommentState, - MutatorIcon, - WarningIcon, - IconType, exceptions, + Icon, + IconType, + MutatorIcon, registry, + WarningIcon, }; diff --git a/core/icons/comment_icon.ts b/core/icons/comment_icon.ts index df54560c557..d06952b7abf 100644 --- a/core/icons/comment_icon.ts +++ b/core/icons/comment_icon.ts @@ -8,21 +8,21 @@ import type {Block} from '../block.js'; import type {BlockSvg} from '../block_svg.js'; -import {IconType} from './icon_types.js'; -import {Coordinate} from '../utils.js'; -import * as dom from '../utils/dom.js'; +import {TextBubble} from '../bubbles/text_bubble.js'; +import {TextInputBubble} from '../bubbles/textinput_bubble.js'; import * as eventUtils from '../events/utils.js'; -import {Icon} from './icon.js'; import type {IHasBubble} from '../interfaces/i_has_bubble.js'; import type {ISerializable} from '../interfaces/i_serializable.js'; +import * as renderManagement from '../render_management.js'; +import {Coordinate} from '../utils.js'; +import * as dom from '../utils/dom.js'; import {Rect} from '../utils/rect.js'; -import * as registry from './registry.js'; import {Size} from '../utils/size.js'; import {Svg} from '../utils/svg.js'; -import {TextBubble} from '../bubbles/text_bubble.js'; -import {TextInputBubble} from '../bubbles/textinput_bubble.js'; import type {WorkspaceSvg} from '../workspace_svg.js'; -import * as renderManagement from '../render_management.js'; +import {Icon} from './icon.js'; +import {IconType} from './icon_types.js'; +import * as registry from './registry.js'; /** The size of the comment icon in workspace-scale units. */ const SIZE = 17; diff --git a/core/icons/icon.ts b/core/icons/icon.ts index 6ad9532366e..30a6b538f6e 100644 --- a/core/icons/icon.ts +++ b/core/icons/icon.ts @@ -9,12 +9,12 @@ import type {BlockSvg} from '../block_svg.js'; import * as browserEvents from '../browser_events.js'; import {hasBubble} from '../interfaces/i_has_bubble.js'; import type {IIcon} from '../interfaces/i_icon.js'; +import * as tooltip from '../tooltip.js'; import {Coordinate} from '../utils/coordinate.js'; import * as dom from '../utils/dom.js'; import {Size} from '../utils/size.js'; import {Svg} from '../utils/svg.js'; import type {IconType} from './icon_types.js'; -import * as tooltip from '../tooltip.js'; /** * The abstract icon class. Icons are visual elements that live in the top-start diff --git a/core/icons/mutator_icon.ts b/core/icons/mutator_icon.ts index 7fb3fcf3b81..1aac847cae5 100644 --- a/core/icons/mutator_icon.ts +++ b/core/icons/mutator_icon.ts @@ -6,22 +6,22 @@ // Former goog.module ID: Blockly.Mutator +import type {BlockSvg} from '../block_svg.js'; +import type {BlocklyOptions} from '../blockly_options.js'; +import {MiniWorkspaceBubble} from '../bubbles/mini_workspace_bubble.js'; import type {Abstract} from '../events/events_abstract.js'; import {BlockChange} from '../events/events_block_change.js'; -import type {BlocklyOptions} from '../blockly_options.js'; -import type {BlockSvg} from '../block_svg.js'; -import {Coordinate} from '../utils/coordinate.js'; -import * as dom from '../utils/dom.js'; import * as eventUtils from '../events/utils.js'; import type {IHasBubble} from '../interfaces/i_has_bubble.js'; -import {Icon} from './icon.js'; -import {MiniWorkspaceBubble} from '../bubbles/mini_workspace_bubble.js'; +import * as renderManagement from '../render_management.js'; +import {Coordinate} from '../utils/coordinate.js'; +import * as dom from '../utils/dom.js'; import {Rect} from '../utils/rect.js'; import {Size} from '../utils/size.js'; import {Svg} from '../utils/svg.js'; import type {WorkspaceSvg} from '../workspace_svg.js'; +import {Icon} from './icon.js'; import {IconType} from './icon_types.js'; -import * as renderManagement from '../render_management.js'; /** The size of the mutator icon in workspace-scale units. */ const SIZE = 17; diff --git a/core/icons/warning_icon.ts b/core/icons/warning_icon.ts index 08f511a60b7..8450948769e 100644 --- a/core/icons/warning_icon.ts +++ b/core/icons/warning_icon.ts @@ -7,17 +7,17 @@ // Former goog.module ID: Blockly.Warning import type {BlockSvg} from '../block_svg.js'; -import {Coordinate} from '../utils/coordinate.js'; -import * as dom from '../utils/dom.js'; +import {TextBubble} from '../bubbles/text_bubble.js'; import * as eventUtils from '../events/utils.js'; -import {Icon} from './icon.js'; import type {IHasBubble} from '../interfaces/i_has_bubble.js'; -import {Rect} from '../utils/rect.js'; +import * as renderManagement from '../render_management.js'; import {Size} from '../utils.js'; +import {Coordinate} from '../utils/coordinate.js'; +import * as dom from '../utils/dom.js'; +import {Rect} from '../utils/rect.js'; import {Svg} from '../utils/svg.js'; -import {TextBubble} from '../bubbles/text_bubble.js'; +import {Icon} from './icon.js'; import {IconType} from './icon_types.js'; -import * as renderManagement from '../render_management.js'; /** The size of the warning icon in workspace-scale units. */ const SIZE = 17; diff --git a/core/inputs.ts b/core/inputs.ts index 4b7bfa89750..064d37530a5 100644 --- a/core/inputs.ts +++ b/core/inputs.ts @@ -5,19 +5,19 @@ */ import {Align} from './inputs/align.js'; -import {Input} from './inputs/input.js'; import {DummyInput} from './inputs/dummy_input.js'; import {EndRowInput} from './inputs/end_row_input.js'; +import {Input} from './inputs/input.js'; +import {inputTypes} from './inputs/input_types.js'; import {StatementInput} from './inputs/statement_input.js'; import {ValueInput} from './inputs/value_input.js'; -import {inputTypes} from './inputs/input_types.js'; export { Align, - Input, DummyInput, EndRowInput, + Input, + inputTypes, StatementInput, ValueInput, - inputTypes, }; diff --git a/core/inputs/input.ts b/core/inputs/input.ts index da7cccad588..0907bf44939 100644 --- a/core/inputs/input.ts +++ b/core/inputs/input.ts @@ -21,8 +21,8 @@ import type {ConnectionType} from '../connection_type.js'; import type {Field} from '../field.js'; import * as fieldRegistry from '../field_registry.js'; import type {RenderedConnection} from '../rendered_connection.js'; -import {inputTypes} from './input_types.js'; import {Align} from './align.js'; +import {inputTypes} from './input_types.js'; /** Class for an input with optional fields. */ export class Input { diff --git a/core/insertion_marker_manager.ts b/core/insertion_marker_manager.ts index 6f27eada774..13d63042002 100644 --- a/core/insertion_marker_manager.ts +++ b/core/insertion_marker_manager.ts @@ -11,20 +11,20 @@ */ // Former goog.module ID: Blockly.InsertionMarkerManager -import {finishQueuedRenders} from './render_management.js'; import * as blockAnimations from './block_animations.js'; import type {BlockSvg} from './block_svg.js'; import * as common from './common.js'; import {ComponentManager} from './component_manager.js'; import {config} from './config.js'; -import * as blocks from './serialization/blocks.js'; import * as eventUtils from './events/utils.js'; import type {IDeleteArea} from './interfaces/i_delete_area.js'; import type {IDragTarget} from './interfaces/i_drag_target.js'; +import * as renderManagement from './render_management.js'; +import {finishQueuedRenders} from './render_management.js'; import type {RenderedConnection} from './rendered_connection.js'; +import * as blocks from './serialization/blocks.js'; import type {Coordinate} from './utils/coordinate.js'; import type {WorkspaceSvg} from './workspace_svg.js'; -import * as renderManagement from './render_management.js'; /** Represents a nearby valid connection. */ interface CandidateConnection { diff --git a/core/insertion_marker_previewer.ts b/core/insertion_marker_previewer.ts index 3cc9f1a049f..2343b9adc76 100644 --- a/core/insertion_marker_previewer.ts +++ b/core/insertion_marker_previewer.ts @@ -5,15 +5,15 @@ */ import {BlockSvg} from './block_svg.js'; -import {IConnectionPreviewer} from './interfaces/i_connection_previewer.js'; -import {RenderedConnection} from './rendered_connection.js'; -import {WorkspaceSvg} from './workspace_svg.js'; -import * as blocks from './serialization/blocks.js'; +import {ConnectionType} from './connection_type.js'; import * as eventUtils from './events/utils.js'; -import * as renderManagement from './render_management.js'; +import {IConnectionPreviewer} from './interfaces/i_connection_previewer.js'; import * as registry from './registry.js'; +import * as renderManagement from './render_management.js'; +import {RenderedConnection} from './rendered_connection.js'; import {Renderer as ZelosRenderer} from './renderers/zelos/renderer.js'; -import {ConnectionType} from './connection_type.js'; +import * as blocks from './serialization/blocks.js'; +import {WorkspaceSvg} from './workspace_svg.js'; export class InsertionMarkerPreviewer implements IConnectionPreviewer { private readonly workspace: WorkspaceSvg; diff --git a/core/interfaces/i_ast_node_location_with_block.ts b/core/interfaces/i_ast_node_location_with_block.ts index a00603864d3..b04234fd4a8 100644 --- a/core/interfaces/i_ast_node_location_with_block.ts +++ b/core/interfaces/i_ast_node_location_with_block.ts @@ -6,8 +6,8 @@ // Former goog.module ID: Blockly.IASTNodeLocationWithBlock -import type {IASTNodeLocation} from './i_ast_node_location.js'; import type {Block} from '../block.js'; +import type {IASTNodeLocation} from './i_ast_node_location.js'; /** * An AST node location that has an associated block. diff --git a/core/interfaces/i_bounded_element.ts b/core/interfaces/i_bounded_element.ts index a32df5985ef..aac26855bd6 100644 --- a/core/interfaces/i_bounded_element.ts +++ b/core/interfaces/i_bounded_element.ts @@ -4,9 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type {Rect} from '../utils/rect.js'; // Former goog.module ID: Blockly.IBoundedElement +import type {Rect} from '../utils/rect.js'; + /** * A bounded element interface. */ diff --git a/core/interfaces/i_bubble.ts b/core/interfaces/i_bubble.ts index e27fccafd48..d31ce9c9dce 100644 --- a/core/interfaces/i_bubble.ts +++ b/core/interfaces/i_bubble.ts @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type {Coordinate} from '../utils/coordinate.js'; // Former goog.module ID: Blockly.IBubble +import type {Coordinate} from '../utils/coordinate.js'; import type {IContextMenu} from './i_contextmenu.js'; import type {IDraggable} from './i_draggable.js'; diff --git a/core/interfaces/i_comment_icon.ts b/core/interfaces/i_comment_icon.ts index 47c46daaf27..9801a8d6e11 100644 --- a/core/interfaces/i_comment_icon.ts +++ b/core/interfaces/i_comment_icon.ts @@ -4,11 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {IconType} from '../icons/icon_types.js'; import {CommentState} from '../icons/comment_icon.js'; -import {IIcon, isIcon} from './i_icon.js'; +import {IconType} from '../icons/icon_types.js'; import {Size} from '../utils/size.js'; import {IHasBubble, hasBubble} from './i_has_bubble.js'; +import {IIcon, isIcon} from './i_icon.js'; import {ISerializable, isSerializable} from './i_serializable.js'; export interface ICommentIcon extends IIcon, IHasBubble, ISerializable { diff --git a/core/interfaces/i_connection_checker.ts b/core/interfaces/i_connection_checker.ts index 8bb0fcc7393..352b719d665 100644 --- a/core/interfaces/i_connection_checker.ts +++ b/core/interfaces/i_connection_checker.ts @@ -4,9 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ +// Former goog.module ID: Blockly.IConnectionChecker + import type {Connection} from '../connection.js'; import type {RenderedConnection} from '../rendered_connection.js'; -// Former goog.module ID: Blockly.IConnectionChecker /** * Class for connection type checking logic. diff --git a/core/interfaces/i_drag_target.ts b/core/interfaces/i_drag_target.ts index 3fa060232be..395b2345123 100644 --- a/core/interfaces/i_drag_target.ts +++ b/core/interfaces/i_drag_target.ts @@ -4,13 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {Rect} from '../utils/rect.js'; - -import {IDraggable} from './i_draggable.js'; - // Former goog.module ID: Blockly.IDragTarget +import {Rect} from '../utils/rect.js'; import type {IComponent} from './i_component.js'; +import {IDraggable} from './i_draggable.js'; /** * Interface for a component with custom behaviour when a block or bubble is diff --git a/core/interfaces/i_flyout.ts b/core/interfaces/i_flyout.ts index 84067f755d2..c79be344c5a 100644 --- a/core/interfaces/i_flyout.ts +++ b/core/interfaces/i_flyout.ts @@ -6,13 +6,13 @@ // Former goog.module ID: Blockly.IFlyout -import type {WorkspaceSvg} from '../workspace_svg.js'; import type {BlockSvg} from '../block_svg.js'; +import {FlyoutItem} from '../flyout_base.js'; import type {Coordinate} from '../utils/coordinate.js'; -import type {FlyoutDefinition} from '../utils/toolbox.js'; import type {Svg} from '../utils/svg.js'; +import type {FlyoutDefinition} from '../utils/toolbox.js'; +import type {WorkspaceSvg} from '../workspace_svg.js'; import type {IRegistrable} from './i_registrable.js'; -import {FlyoutItem} from '../flyout_base.js'; /** * Interface for a flyout. diff --git a/core/interfaces/i_keyboard_accessible.ts b/core/interfaces/i_keyboard_accessible.ts index 50e85b08e9d..4d04e9d4f08 100644 --- a/core/interfaces/i_keyboard_accessible.ts +++ b/core/interfaces/i_keyboard_accessible.ts @@ -4,9 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {KeyboardShortcut} from '../shortcut_registry.js'; // Former goog.module ID: Blockly.IKeyboardAccessible +import {KeyboardShortcut} from '../shortcut_registry.js'; + /** * An interface for an object that handles keyboard shortcuts. */ diff --git a/core/interfaces/i_metrics_manager.ts b/core/interfaces/i_metrics_manager.ts index 52b9644dfb6..bb4d54da440 100644 --- a/core/interfaces/i_metrics_manager.ts +++ b/core/interfaces/i_metrics_manager.ts @@ -4,15 +4,16 @@ * SPDX-License-Identifier: Apache-2.0 */ +// Former goog.module ID: Blockly.IMetricsManager + import type { + AbsoluteMetrics, ContainerRegion, ToolboxMetrics, - AbsoluteMetrics, UiMetrics, } from '../metrics_manager.js'; -import type {Size} from '../utils/size.js'; import type {Metrics} from '../utils/metrics.js'; -// Former goog.module ID: Blockly.IMetricsManager +import type {Size} from '../utils/size.js'; /** * Interface for a metrics manager. diff --git a/core/interfaces/i_positionable.ts b/core/interfaces/i_positionable.ts index 19843d15333..4ea7dafa08d 100644 --- a/core/interfaces/i_positionable.ts +++ b/core/interfaces/i_positionable.ts @@ -4,10 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type {Rect} from '../utils/rect.js'; -import type {UiMetrics} from '../metrics_manager.js'; // Former goog.module ID: Blockly.IPositionable +import type {UiMetrics} from '../metrics_manager.js'; +import type {Rect} from '../utils/rect.js'; import type {IComponent} from './i_component.js'; /** diff --git a/core/interfaces/i_procedure_block.ts b/core/interfaces/i_procedure_block.ts index 3744eb18336..f8538052749 100644 --- a/core/interfaces/i_procedure_block.ts +++ b/core/interfaces/i_procedure_block.ts @@ -4,9 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ +// Former goog.module ID: Blockly.procedures.IProcedureBlock + import type {Block} from '../block.js'; import {IProcedureModel} from './i_procedure_model.js'; -// Former goog.module ID: Blockly.procedures.IProcedureBlock /** The interface for a block which models a procedure. */ export interface IProcedureBlock { diff --git a/core/interfaces/i_selectable_toolbox_item.ts b/core/interfaces/i_selectable_toolbox_item.ts index b3267efd058..890d4e370af 100644 --- a/core/interfaces/i_selectable_toolbox_item.ts +++ b/core/interfaces/i_selectable_toolbox_item.ts @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import type {FlyoutItemInfoArray} from '../utils/toolbox'; // Former goog.module ID: Blockly.ISelectableToolboxItem +import type {FlyoutItemInfoArray} from '../utils/toolbox'; import type {IToolboxItem} from './i_toolbox_item.js'; /** diff --git a/core/interfaces/i_serializer.ts b/core/interfaces/i_serializer.ts index a33e6b225cc..0e8302f39e0 100644 --- a/core/interfaces/i_serializer.ts +++ b/core/interfaces/i_serializer.ts @@ -22,8 +22,6 @@ export interface ISerializer { */ priority: number; - /* eslint-disable no-unused-vars, valid-jsdoc */ - /** * Saves the state of the plugin or system. * @@ -52,4 +50,3 @@ export interface ISerializer { */ clear(workspace: Workspace): void; } -/* eslint-enable no-unused-vars */ diff --git a/core/interfaces/i_toolbox.ts b/core/interfaces/i_toolbox.ts index a236d4442ae..2756099ec34 100644 --- a/core/interfaces/i_toolbox.ts +++ b/core/interfaces/i_toolbox.ts @@ -6,11 +6,11 @@ // Former goog.module ID: Blockly.IToolbox -import type {IRegistrable} from './i_registrable.js'; -import type {IToolboxItem} from './i_toolbox_item.js'; import type {ToolboxInfo} from '../utils/toolbox.js'; -import type {IFlyout} from './i_flyout.js'; import type {WorkspaceSvg} from '../workspace_svg.js'; +import type {IFlyout} from './i_flyout.js'; +import type {IRegistrable} from './i_registrable.js'; +import type {IToolboxItem} from './i_toolbox_item.js'; /** * Interface for a toolbox. diff --git a/core/keyboard_nav/ast_node.ts b/core/keyboard_nav/ast_node.ts index 7985ac6dc24..3b0efae3fb3 100644 --- a/core/keyboard_nav/ast_node.ts +++ b/core/keyboard_nav/ast_node.ts @@ -16,14 +16,14 @@ import {Block} from '../block.js'; import type {Connection} from '../connection.js'; import {ConnectionType} from '../connection_type.js'; import type {Field} from '../field.js'; +import {FlyoutItem} from '../flyout_base.js'; +import {FlyoutButton} from '../flyout_button.js'; import type {Input} from '../inputs/input.js'; import type {IASTNodeLocation} from '../interfaces/i_ast_node_location.js'; import type {IASTNodeLocationWithBlock} from '../interfaces/i_ast_node_location_with_block.js'; import {Coordinate} from '../utils/coordinate.js'; import type {Workspace} from '../workspace.js'; -import {FlyoutButton} from '../flyout_button.js'; import {WorkspaceSvg} from '../workspace_svg.js'; -import {FlyoutItem} from '../flyout_base.js'; /** * Class for an AST node. diff --git a/core/keyboard_nav/basic_cursor.ts b/core/keyboard_nav/basic_cursor.ts index 95b5e2f4d51..7526141529e 100644 --- a/core/keyboard_nav/basic_cursor.ts +++ b/core/keyboard_nav/basic_cursor.ts @@ -13,7 +13,6 @@ // Former goog.module ID: Blockly.BasicCursor import * as registry from '../registry.js'; - import {ASTNode} from './ast_node.js'; import {Cursor} from './cursor.js'; diff --git a/core/keyboard_nav/cursor.ts b/core/keyboard_nav/cursor.ts index da0a50f1cb6..92279da562d 100644 --- a/core/keyboard_nav/cursor.ts +++ b/core/keyboard_nav/cursor.ts @@ -13,7 +13,6 @@ // Former goog.module ID: Blockly.Cursor import * as registry from '../registry.js'; - import {ASTNode} from './ast_node.js'; import {Marker} from './marker.js'; diff --git a/core/keyboard_nav/marker.ts b/core/keyboard_nav/marker.ts index 9653e6b8548..e3b438e6efe 100644 --- a/core/keyboard_nav/marker.ts +++ b/core/keyboard_nav/marker.ts @@ -12,9 +12,7 @@ */ // Former goog.module ID: Blockly.Marker -/* eslint-disable-next-line no-unused-vars */ import type {MarkerSvg} from '../renderers/common/marker_svg.js'; - import type {ASTNode} from './ast_node.js'; /** diff --git a/core/keyboard_nav/tab_navigate_cursor.ts b/core/keyboard_nav/tab_navigate_cursor.ts index 20fd3dabb38..0392887a1fd 100644 --- a/core/keyboard_nav/tab_navigate_cursor.ts +++ b/core/keyboard_nav/tab_navigate_cursor.ts @@ -13,7 +13,6 @@ // Former goog.module ID: Blockly.TabNavigateCursor import type {Field} from '../field.js'; - import {ASTNode} from './ast_node.js'; import {BasicCursor} from './basic_cursor.js'; diff --git a/core/layer_manager.ts b/core/layer_manager.ts index e181e680139..e7663b1b7ee 100644 --- a/core/layer_manager.ts +++ b/core/layer_manager.ts @@ -4,12 +4,12 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {WorkspaceSvg} from './workspace_svg.js'; -import * as dom from './utils/dom.js'; -import {Svg} from './utils/svg.js'; import {IRenderedElement} from './interfaces/i_rendered_element.js'; import * as layerNums from './layers.js'; import {Coordinate} from './utils/coordinate.js'; +import * as dom from './utils/dom.js'; +import {Svg} from './utils/svg.js'; +import {WorkspaceSvg} from './workspace_svg.js'; /** @internal */ export class LayerManager { diff --git a/core/observable_procedure_map.ts b/core/observable_procedure_map.ts index e8722bcbf89..2f10107557c 100644 --- a/core/observable_procedure_map.ts +++ b/core/observable_procedure_map.ts @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +import {isObservable} from './interfaces/i_observable.js'; import {IProcedureMap} from './interfaces/i_procedure_map.js'; import type {IProcedureModel} from './interfaces/i_procedure_model.js'; -import {isObservable} from './interfaces/i_observable.js'; export class ObservableProcedureMap extends Map diff --git a/core/procedures.ts b/core/procedures.ts index 680abb8afd2..7ab62a91d29 100644 --- a/core/procedures.ts +++ b/core/procedures.ts @@ -17,27 +17,27 @@ import type {Abstract} from './events/events_abstract.js'; import type {BubbleOpen} from './events/events_bubble_open.js'; import * as eventUtils from './events/utils.js'; import {Field, UnattachedFieldError} from './field.js'; -import {Msg} from './msg.js'; -import {Names} from './names.js'; -import {IParameterModel} from './interfaces/i_parameter_model.js'; -import {IProcedureMap} from './interfaces/i_procedure_map.js'; -import {IProcedureModel} from './interfaces/i_procedure_model.js'; -import { - IProcedureBlock, - isProcedureBlock, -} from './interfaces/i_procedure_block.js'; +import {MutatorIcon} from './icons.js'; import { isLegacyProcedureCallBlock, isLegacyProcedureDefBlock, ProcedureBlock, ProcedureTuple, } from './interfaces/i_legacy_procedure_blocks.js'; +import {IParameterModel} from './interfaces/i_parameter_model.js'; +import { + IProcedureBlock, + isProcedureBlock, +} from './interfaces/i_procedure_block.js'; +import {IProcedureMap} from './interfaces/i_procedure_map.js'; +import {IProcedureModel} from './interfaces/i_procedure_model.js'; +import {Msg} from './msg.js'; +import {Names} from './names.js'; import {ObservableProcedureMap} from './observable_procedure_map.js'; import * as utilsXml from './utils/xml.js'; import * as Variables from './variables.js'; import type {Workspace} from './workspace.js'; import type {WorkspaceSvg} from './workspace_svg.js'; -import {MutatorIcon} from './icons.js'; /** * String for use in the "custom" attribute of a category in toolbox XML. @@ -500,11 +500,11 @@ export function getDefinition( } export { - ObservableProcedureMap, IParameterModel, IProcedureBlock, - isProcedureBlock, IProcedureMap, IProcedureModel, + isProcedureBlock, + ObservableProcedureMap, ProcedureTuple, }; diff --git a/core/registry.ts b/core/registry.ts index 39bb83b8780..60e8049797c 100644 --- a/core/registry.ts +++ b/core/registry.ts @@ -8,11 +8,15 @@ import type {Abstract} from './events/events_abstract.js'; import type {Field} from './field.js'; +import type {Input} from './inputs/input.js'; import type {IConnectionChecker} from './interfaces/i_connection_checker.js'; +import type {IConnectionPreviewer} from './interfaces/i_connection_previewer.js'; +import type {ICopyData, ICopyable} from './interfaces/i_copyable.js'; +import type {IDragger} from './interfaces/i_dragger.js'; import type {IFlyout} from './interfaces/i_flyout.js'; -import type {IMetricsManager} from './interfaces/i_metrics_manager.js'; import type {IIcon} from './interfaces/i_icon.js'; -import type {Input} from './inputs/input.js'; +import type {IMetricsManager} from './interfaces/i_metrics_manager.js'; +import type {IPaster} from './interfaces/i_paster.js'; import type {ISerializer} from './interfaces/i_serializer.js'; import type {IToolbox} from './interfaces/i_toolbox.js'; import type {Cursor} from './keyboard_nav/cursor.js'; @@ -20,10 +24,6 @@ import type {Options} from './options.js'; import type {Renderer} from './renderers/common/renderer.js'; import type {Theme} from './theme.js'; import type {ToolboxItem} from './toolbox/toolbox_item.js'; -import type {IPaster} from './interfaces/i_paster.js'; -import type {ICopyData, ICopyable} from './interfaces/i_copyable.js'; -import type {IConnectionPreviewer} from './interfaces/i_connection_previewer.js'; -import type {IDragger} from './interfaces/i_dragger.js'; /** * A map of maps. With the keys being the type and name of the class we are diff --git a/core/render_management.ts b/core/render_management.ts index 3e84efead24..c3fe2e342ba 100644 --- a/core/render_management.ts +++ b/core/render_management.ts @@ -5,8 +5,8 @@ */ import {BlockSvg} from './block_svg.js'; -import * as userAgent from './utils/useragent.js'; import * as eventUtils from './events/utils.js'; +import * as userAgent from './utils/useragent.js'; import type {WorkspaceSvg} from './workspace_svg.js'; /** The set of all blocks in need of rendering which don't have parents. */ diff --git a/core/renderers/common/block_rendering.ts b/core/renderers/common/block_rendering.ts index 741e2367dbc..27fbbd538c7 100644 --- a/core/renderers/common/block_rendering.ts +++ b/core/renderers/common/block_rendering.ts @@ -30,7 +30,6 @@ import {SquareCorner} from '../measurables/square_corner.js'; import {StatementInput} from '../measurables/statement_input.js'; import {TopRow} from '../measurables/top_row.js'; import {Types} from '../measurables/types.js'; - import {Drawer} from './drawer.js'; import type {IPathObject} from './i_path_object.js'; import {RenderInfo} from './info.js'; @@ -81,43 +80,45 @@ export function init( renderer.init(theme, opt_rendererOverrides); return renderer; } -export {BottomRow}; -export {Connection}; -export {Drawer}; -export {ExternalValueInput}; -export {Field}; -export {Hat}; -export {Icon}; -export {InRowSpacer}; -export {InlineInput}; -export {InputConnection}; -export {InputRow}; -export {IPathObject}; -export {JaggedEdge}; -export {MarkerSvg}; -export {Measurable}; -export {NextConnection}; -export {OutputConnection}; -export {PathObject}; -export {PreviousConnection}; -export {Renderer}; -export {RenderInfo}; -export {RoundCorner}; -export {Row}; -export {SpacerRow}; -export {SquareCorner}; -export {StatementInput}; -export {TopRow}; -export {Types}; +export { + BottomRow, + Connection, + Drawer, + ExternalValueInput, + Field, + Hat, + Icon, + InlineInput, + InputConnection, + InputRow, + InRowSpacer, + IPathObject, + JaggedEdge, + MarkerSvg, + Measurable, + NextConnection, + OutputConnection, + PathObject, + PreviousConnection, + Renderer, + RenderInfo, + RoundCorner, + Row, + SpacerRow, + SquareCorner, + StatementInput, + TopRow, + Types, +}; export { - OutsideCorners, + BaseShape, + ConstantProvider, + DynamicShape, InsideCorners, - StartHat, + JaggedTeeth, Notch, + OutsideCorners, PuzzleTab, - JaggedTeeth, - BaseShape, - DynamicShape, - ConstantProvider, + StartHat, } from './constants.js'; diff --git a/core/renderers/common/drawer.ts b/core/renderers/common/drawer.ts index 17d54eea541..59a856011f2 100644 --- a/core/renderers/common/drawer.ts +++ b/core/renderers/common/drawer.ts @@ -7,6 +7,7 @@ // Former goog.module ID: Blockly.blockRendering.Drawer import type {BlockSvg} from '../../block_svg.js'; +import {ConnectionType} from '../../connection_type.js'; import {Coordinate} from '../../utils.js'; import * as svgPaths from '../../utils/svg_paths.js'; import {Connection} from '../measurables/connection.js'; @@ -17,11 +18,9 @@ import type {InlineInput} from '../measurables/inline_input.js'; import type {PreviousConnection} from '../measurables/previous_connection.js'; import type {Row} from '../measurables/row.js'; import {Types} from '../measurables/types.js'; - -import {isDynamicShape, isNotch, isPuzzleTab} from './constants.js'; import type {ConstantProvider, Notch, PuzzleTab} from './constants.js'; +import {isDynamicShape, isNotch, isPuzzleTab} from './constants.js'; import type {RenderInfo} from './info.js'; -import {ConnectionType} from '../../connection_type.js'; /** * An object that draws a block based on the given rendering information. diff --git a/core/renderers/common/i_path_object.ts b/core/renderers/common/i_path_object.ts index 30033f18e81..3a78035e156 100644 --- a/core/renderers/common/i_path_object.ts +++ b/core/renderers/common/i_path_object.ts @@ -6,11 +6,11 @@ // Former goog.module ID: Blockly.blockRendering.IPathObject -import type {BlockStyle} from '../../theme.js'; import type {BlockSvg} from '../../block_svg.js'; -import type {ConstantProvider} from './constants.js'; import type {RenderedConnection} from '../../rendered_connection.js'; +import type {BlockStyle} from '../../theme.js'; import type {Coordinate} from '../../utils/coordinate.js'; +import type {ConstantProvider} from './constants.js'; /** * An interface for a block's path object. diff --git a/core/renderers/common/info.ts b/core/renderers/common/info.ts index 995124c1b21..ff073ace48b 100644 --- a/core/renderers/common/info.ts +++ b/core/renderers/common/info.ts @@ -7,13 +7,16 @@ // Former goog.module ID: Blockly.blockRendering.RenderInfo import type {BlockSvg} from '../../block_svg.js'; -import {Input} from '../../inputs/input.js'; import {Align} from '../../inputs/align.js'; +import {DummyInput} from '../../inputs/dummy_input.js'; +import {EndRowInput} from '../../inputs/end_row_input.js'; +import {Input} from '../../inputs/input.js'; +import {StatementInput} from '../../inputs/statement_input.js'; +import {ValueInput} from '../../inputs/value_input.js'; import type {RenderedConnection} from '../../rendered_connection.js'; import type {Measurable} from '../measurables/base.js'; import {BottomRow} from '../measurables/bottom_row.js'; -import {DummyInput} from '../../inputs/dummy_input.js'; -import {EndRowInput} from '../../inputs/end_row_input.js'; +import {Connection} from '../measurables/connection.js'; import {ExternalValueInput} from '../measurables/external_value_input.js'; import {Field} from '../measurables/field.js'; import {Hat} from '../measurables/hat.js'; @@ -30,14 +33,10 @@ import type {Row} from '../measurables/row.js'; import {SpacerRow} from '../measurables/spacer_row.js'; import {SquareCorner} from '../measurables/square_corner.js'; import {StatementInput as StatementInputMeasurable} from '../measurables/statement_input.js'; -import {StatementInput} from '../../inputs/statement_input.js'; import {TopRow} from '../measurables/top_row.js'; import {Types} from '../measurables/types.js'; -import {ValueInput} from '../../inputs/value_input.js'; - import type {ConstantProvider} from './constants.js'; import type {Renderer} from './renderer.js'; -import {Connection} from '../measurables/connection.js'; /** * An object containing all sizing information needed to draw this block. diff --git a/core/renderers/common/marker_svg.ts b/core/renderers/common/marker_svg.ts index b2005012fe3..2eaee2aeae0 100644 --- a/core/renderers/common/marker_svg.ts +++ b/core/renderers/common/marker_svg.ts @@ -14,6 +14,7 @@ import type {Connection} from '../../connection.js'; import {ConnectionType} from '../../connection_type.js'; import * as eventUtils from '../../events/utils.js'; import type {Field} from '../../field.js'; +import {FlyoutButton} from '../../flyout_button.js'; import type {IASTNodeLocationSvg} from '../../interfaces/i_ast_node_location_svg.js'; import {ASTNode} from '../../keyboard_nav/ast_node.js'; import type {Marker} from '../../keyboard_nav/marker.js'; @@ -22,9 +23,7 @@ import * as dom from '../../utils/dom.js'; import {Svg} from '../../utils/svg.js'; import * as svgPaths from '../../utils/svg_paths.js'; import type {WorkspaceSvg} from '../../workspace_svg.js'; - import type {ConstantProvider, Notch, PuzzleTab} from './constants.js'; -import {FlyoutButton} from '../../flyout_button.js'; /** The name of the CSS class for a cursor. */ const CURSOR_CLASS = 'blocklyCursor'; diff --git a/core/renderers/common/path_object.ts b/core/renderers/common/path_object.ts index d5c0850a1b8..0f46cf3a423 100644 --- a/core/renderers/common/path_object.ts +++ b/core/renderers/common/path_object.ts @@ -13,7 +13,6 @@ import type {BlockStyle} from '../../theme.js'; import {Coordinate} from '../../utils/coordinate.js'; import * as dom from '../../utils/dom.js'; import {Svg} from '../../utils/svg.js'; - import type {ConstantProvider} from './constants.js'; import type {IPathObject} from './i_path_object.js'; diff --git a/core/renderers/common/renderer.ts b/core/renderers/common/renderer.ts index 15a958db463..d3bff56a702 100644 --- a/core/renderers/common/renderer.ts +++ b/core/renderers/common/renderer.ts @@ -18,15 +18,14 @@ import type {IRegistrable} from '../../interfaces/i_registrable.js'; import type {Marker} from '../../keyboard_nav/marker.js'; import type {RenderedConnection} from '../../rendered_connection.js'; import type {BlockStyle, Theme} from '../../theme.js'; +import * as deprecation from '../../utils/deprecation.js'; import type {WorkspaceSvg} from '../../workspace_svg.js'; - import {ConstantProvider} from './constants.js'; import {Drawer} from './drawer.js'; import type {IPathObject} from './i_path_object.js'; import {RenderInfo} from './info.js'; import {MarkerSvg} from './marker_svg.js'; import {PathObject} from './path_object.js'; -import * as deprecation from '../../utils/deprecation.js'; /** * The base class for a block renderer. diff --git a/core/renderers/geras/drawer.ts b/core/renderers/geras/drawer.ts index 29bcbfab433..542b21ff93b 100644 --- a/core/renderers/geras/drawer.ts +++ b/core/renderers/geras/drawer.ts @@ -10,7 +10,6 @@ import type {BlockSvg} from '../../block_svg.js'; import * as svgPaths from '../../utils/svg_paths.js'; import {Drawer as BaseDrawer} from '../common/drawer.js'; import type {Row} from '../measurables/row.js'; - import type {ConstantProvider} from './constants.js'; import {Highlighter} from './highlighter.js'; import type {RenderInfo} from './info.js'; diff --git a/core/renderers/geras/highlighter.ts b/core/renderers/geras/highlighter.ts index 664e74fb888..efcb4e2df03 100644 --- a/core/renderers/geras/highlighter.ts +++ b/core/renderers/geras/highlighter.ts @@ -13,7 +13,6 @@ import type {Row} from '../measurables/row.js'; import {SpacerRow} from '../measurables/spacer_row.js'; import type {TopRow} from '../measurables/top_row.js'; import {Types} from '../measurables/types.js'; - import type { HighlightConstantProvider, InsideCorner, diff --git a/core/renderers/geras/info.ts b/core/renderers/geras/info.ts index 6565f226b53..b9cc1c59c8c 100644 --- a/core/renderers/geras/info.ts +++ b/core/renderers/geras/info.ts @@ -7,22 +7,21 @@ // Former goog.module ID: Blockly.geras.RenderInfo import type {BlockSvg} from '../../block_svg.js'; +import {DummyInput} from '../../inputs/dummy_input.js'; +import {EndRowInput} from '../../inputs/end_row_input.js'; import type {Input} from '../../inputs/input.js'; +import {StatementInput} from '../../inputs/statement_input.js'; +import {ValueInput} from '../../inputs/value_input.js'; import {RenderInfo as BaseRenderInfo} from '../common/info.js'; import type {Measurable} from '../measurables/base.js'; import type {BottomRow} from '../measurables/bottom_row.js'; -import {DummyInput} from '../../inputs/dummy_input.js'; -import {EndRowInput} from '../../inputs/end_row_input.js'; import {ExternalValueInput} from '../measurables/external_value_input.js'; import type {Field} from '../measurables/field.js'; import {InRowSpacer} from '../measurables/in_row_spacer.js'; import type {InputRow} from '../measurables/input_row.js'; import type {Row} from '../measurables/row.js'; -import {StatementInput} from '../../inputs/statement_input.js'; import type {TopRow} from '../measurables/top_row.js'; import {Types} from '../measurables/types.js'; -import {ValueInput} from '../../inputs/value_input.js'; - import type {ConstantProvider} from './constants.js'; import {InlineInput} from './measurables/inline_input.js'; import {StatementInput as StatementInputMeasurable} from './measurables/statement_input.js'; diff --git a/core/renderers/geras/measurables/inline_input.ts b/core/renderers/geras/measurables/inline_input.ts index 9ed85ad5253..931b9e76262 100644 --- a/core/renderers/geras/measurables/inline_input.ts +++ b/core/renderers/geras/measurables/inline_input.ts @@ -6,7 +6,6 @@ // Former goog.module ID: Blockly.geras.InlineInput -/* eslint-disable-next-line no-unused-vars */ import type {Input} from '../../../inputs/input.js'; import type {ConstantProvider as BaseConstantProvider} from '../../../renderers/common/constants.js'; import {InlineInput as BaseInlineInput} from '../../../renderers/measurables/inline_input.js'; diff --git a/core/renderers/geras/measurables/statement_input.ts b/core/renderers/geras/measurables/statement_input.ts index 5ce3f854a45..c6eba8dc024 100644 --- a/core/renderers/geras/measurables/statement_input.ts +++ b/core/renderers/geras/measurables/statement_input.ts @@ -6,7 +6,6 @@ // Former goog.module ID: Blockly.geras.StatementInput -/* eslint-disable-next-line no-unused-vars */ import type {Input} from '../../../inputs/input.js'; import type {ConstantProvider as BaseConstantProvider} from '../../../renderers/common/constants.js'; import {StatementInput as BaseStatementInput} from '../../../renderers/measurables/statement_input.js'; diff --git a/core/renderers/geras/path_object.ts b/core/renderers/geras/path_object.ts index 6b058e5a752..c1d689535af 100644 --- a/core/renderers/geras/path_object.ts +++ b/core/renderers/geras/path_object.ts @@ -12,7 +12,6 @@ import * as colour from '../../utils/colour.js'; import * as dom from '../../utils/dom.js'; import {Svg} from '../../utils/svg.js'; import {PathObject as BasePathObject} from '../common/path_object.js'; - import type {ConstantProvider} from './constants.js'; /** diff --git a/core/renderers/geras/renderer.ts b/core/renderers/geras/renderer.ts index 06062e9bc30..aba8fc3eab1 100644 --- a/core/renderers/geras/renderer.ts +++ b/core/renderers/geras/renderer.ts @@ -11,7 +11,6 @@ import type {BlockStyle, Theme} from '../../theme.js'; import * as blockRendering from '../common/block_rendering.js'; import type {RenderInfo as BaseRenderInfo} from '../common/info.js'; import {Renderer as BaseRenderer} from '../common/renderer.js'; - import {ConstantProvider} from './constants.js'; import {Drawer} from './drawer.js'; import {HighlightConstantProvider} from './highlight_constants.js'; diff --git a/core/renderers/measurables/base.ts b/core/renderers/measurables/base.ts index e429a3a3ef5..15f4f36837e 100644 --- a/core/renderers/measurables/base.ts +++ b/core/renderers/measurables/base.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.blockRendering.Measurable import type {ConstantProvider} from '../common/constants.js'; - import {Types} from './types.js'; /** diff --git a/core/renderers/measurables/bottom_row.ts b/core/renderers/measurables/bottom_row.ts index 66cbbd34ecd..2506610e7eb 100644 --- a/core/renderers/measurables/bottom_row.ts +++ b/core/renderers/measurables/bottom_row.ts @@ -8,7 +8,6 @@ import type {BlockSvg} from '../../block_svg.js'; import type {ConstantProvider} from '../common/constants.js'; - import type {NextConnection} from './next_connection.js'; import {Row} from './row.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/connection.ts b/core/renderers/measurables/connection.ts index 5744eaab448..c5a3e4ce0d2 100644 --- a/core/renderers/measurables/connection.ts +++ b/core/renderers/measurables/connection.ts @@ -6,10 +6,8 @@ // Former goog.module ID: Blockly.blockRendering.Connection -/* eslint-disable-next-line no-unused-vars */ import type {RenderedConnection} from '../../rendered_connection.js'; import type {ConstantProvider, Shape} from '../common/constants.js'; - import {Measurable} from './base.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/external_value_input.ts b/core/renderers/measurables/external_value_input.ts index 9b9dac15f80..4dea7541336 100644 --- a/core/renderers/measurables/external_value_input.ts +++ b/core/renderers/measurables/external_value_input.ts @@ -6,10 +6,8 @@ // Former goog.module ID: Blockly.blockRendering.ExternalValueInput -/* eslint-disable-next-line no-unused-vars */ import type {Input} from '../../inputs/input.js'; import type {ConstantProvider} from '../common/constants.js'; - import {InputConnection} from './input_connection.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/field.ts b/core/renderers/measurables/field.ts index 8d6c4d60b75..2c080d2e39d 100644 --- a/core/renderers/measurables/field.ts +++ b/core/renderers/measurables/field.ts @@ -6,11 +6,9 @@ // Former goog.module ID: Blockly.blockRendering.Field -/* eslint-disable-next-line no-unused-vars */ import type {Field as BlocklyField} from '../../field.js'; import type {Input} from '../../inputs/input.js'; import type {ConstantProvider} from '../common/constants.js'; - import {Measurable} from './base.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/hat.ts b/core/renderers/measurables/hat.ts index 2a0a5058652..477a2095b93 100644 --- a/core/renderers/measurables/hat.ts +++ b/core/renderers/measurables/hat.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.blockRendering.Hat import type {ConstantProvider} from '../common/constants.js'; - import {Measurable} from './base.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/icon.ts b/core/renderers/measurables/icon.ts index 98e3f722d00..424cc67bee8 100644 --- a/core/renderers/measurables/icon.ts +++ b/core/renderers/measurables/icon.ts @@ -6,10 +6,8 @@ // Former goog.module ID: Blockly.blockRendering.Icon -/* eslint-disable-next-line no-unused-vars */ import type {IIcon as BlocklyIcon} from '../../interfaces/i_icon.js'; import type {ConstantProvider} from '../common/constants.js'; - import {Measurable} from './base.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/in_row_spacer.ts b/core/renderers/measurables/in_row_spacer.ts index 19b9efa67e2..ec64e71a23a 100644 --- a/core/renderers/measurables/in_row_spacer.ts +++ b/core/renderers/measurables/in_row_spacer.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.blockRendering.InRowSpacer import type {ConstantProvider} from '../common/constants.js'; - import {Measurable} from './base.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/inline_input.ts b/core/renderers/measurables/inline_input.ts index 9738ddfc24e..307daef8d56 100644 --- a/core/renderers/measurables/inline_input.ts +++ b/core/renderers/measurables/inline_input.ts @@ -6,10 +6,8 @@ // Former goog.module ID: Blockly.blockRendering.InlineInput -/* eslint-disable-next-line no-unused-vars */ import type {Input} from '../../inputs/input.js'; import type {ConstantProvider} from '../common/constants.js'; - import {InputConnection} from './input_connection.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/input_connection.ts b/core/renderers/measurables/input_connection.ts index 69ac82d2172..e4e265b4edd 100644 --- a/core/renderers/measurables/input_connection.ts +++ b/core/renderers/measurables/input_connection.ts @@ -10,7 +10,6 @@ import type {BlockSvg} from '../../block_svg.js'; import type {Input} from '../../inputs/input.js'; import type {RenderedConnection} from '../../rendered_connection.js'; import type {ConstantProvider} from '../common/constants.js'; - import {Connection} from './connection.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/input_row.ts b/core/renderers/measurables/input_row.ts index 229975cfe98..a9924246f38 100644 --- a/core/renderers/measurables/input_row.ts +++ b/core/renderers/measurables/input_row.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.blockRendering.InputRow import type {ConstantProvider} from '../common/constants.js'; - import {ExternalValueInput} from './external_value_input.js'; import {InputConnection} from './input_connection.js'; import {Row} from './row.js'; diff --git a/core/renderers/measurables/jagged_edge.ts b/core/renderers/measurables/jagged_edge.ts index a7711dc283b..daca2512118 100644 --- a/core/renderers/measurables/jagged_edge.ts +++ b/core/renderers/measurables/jagged_edge.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.blockRendering.JaggedEdge import type {ConstantProvider} from '../common/constants.js'; - import {Measurable} from './base.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/next_connection.ts b/core/renderers/measurables/next_connection.ts index 50ac75ad25a..ea22001ed53 100644 --- a/core/renderers/measurables/next_connection.ts +++ b/core/renderers/measurables/next_connection.ts @@ -8,7 +8,6 @@ import type {RenderedConnection} from '../../rendered_connection.js'; import type {ConstantProvider} from '../common/constants.js'; - import {Connection} from './connection.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/output_connection.ts b/core/renderers/measurables/output_connection.ts index 4a3f995f415..1fa07494945 100644 --- a/core/renderers/measurables/output_connection.ts +++ b/core/renderers/measurables/output_connection.ts @@ -8,7 +8,6 @@ import type {RenderedConnection} from '../../rendered_connection.js'; import type {ConstantProvider} from '../common/constants.js'; - import {Connection} from './connection.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/previous_connection.ts b/core/renderers/measurables/previous_connection.ts index 44ebeebfaa5..1314eb6a45d 100644 --- a/core/renderers/measurables/previous_connection.ts +++ b/core/renderers/measurables/previous_connection.ts @@ -8,7 +8,6 @@ import type {RenderedConnection} from '../../rendered_connection.js'; import type {ConstantProvider} from '../common/constants.js'; - import {Connection} from './connection.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/round_corner.ts b/core/renderers/measurables/round_corner.ts index 37fc0fb988d..60bbed70784 100644 --- a/core/renderers/measurables/round_corner.ts +++ b/core/renderers/measurables/round_corner.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.blockRendering.RoundCorner import type {ConstantProvider} from '../common/constants.js'; - import {Measurable} from './base.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/row.ts b/core/renderers/measurables/row.ts index 4208c84b775..613ec6ace74 100644 --- a/core/renderers/measurables/row.ts +++ b/core/renderers/measurables/row.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.blockRendering.Row import type {ConstantProvider} from '../common/constants.js'; - import type {Measurable} from './base.js'; import type {InRowSpacer} from './in_row_spacer.js'; import type {InputConnection} from './input_connection.js'; diff --git a/core/renderers/measurables/spacer_row.ts b/core/renderers/measurables/spacer_row.ts index 6fae98d877d..0e49d30883d 100644 --- a/core/renderers/measurables/spacer_row.ts +++ b/core/renderers/measurables/spacer_row.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.blockRendering.SpacerRow import type {ConstantProvider} from '../common/constants.js'; - import {InRowSpacer} from './in_row_spacer.js'; import {Row} from './row.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/square_corner.ts b/core/renderers/measurables/square_corner.ts index 560f37b65fc..29749ac057d 100644 --- a/core/renderers/measurables/square_corner.ts +++ b/core/renderers/measurables/square_corner.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.blockRendering.SquareCorner import type {ConstantProvider} from '../common/constants.js'; - import {Measurable} from './base.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/statement_input.ts b/core/renderers/measurables/statement_input.ts index cdc7c6680de..91fe5b64a45 100644 --- a/core/renderers/measurables/statement_input.ts +++ b/core/renderers/measurables/statement_input.ts @@ -6,10 +6,8 @@ // Former goog.module ID: Blockly.blockRendering.StatementInput -/* eslint-disable-next-line no-unused-vars */ import type {Input} from '../../inputs/input.js'; import type {ConstantProvider} from '../common/constants.js'; - import {InputConnection} from './input_connection.js'; import {Types} from './types.js'; diff --git a/core/renderers/measurables/top_row.ts b/core/renderers/measurables/top_row.ts index b1490860611..b87ce4ad753 100644 --- a/core/renderers/measurables/top_row.ts +++ b/core/renderers/measurables/top_row.ts @@ -8,7 +8,6 @@ import type {BlockSvg} from '../../block_svg.js'; import type {ConstantProvider} from '../common/constants.js'; - import {Hat} from './hat.js'; import type {PreviousConnection} from './previous_connection.js'; import {Row} from './row.js'; diff --git a/core/renderers/thrasos/info.ts b/core/renderers/thrasos/info.ts index 789897209a9..23772a9af0e 100644 --- a/core/renderers/thrasos/info.ts +++ b/core/renderers/thrasos/info.ts @@ -15,7 +15,6 @@ import {InRowSpacer} from '../measurables/in_row_spacer.js'; import type {Row} from '../measurables/row.js'; import type {TopRow} from '../measurables/top_row.js'; import {Types} from '../measurables/types.js'; - import type {Renderer} from './renderer.js'; /** diff --git a/core/renderers/thrasos/renderer.ts b/core/renderers/thrasos/renderer.ts index 513cadc7892..d12eaf941ab 100644 --- a/core/renderers/thrasos/renderer.ts +++ b/core/renderers/thrasos/renderer.ts @@ -9,7 +9,6 @@ import type {BlockSvg} from '../../block_svg.js'; import * as blockRendering from '../common/block_rendering.js'; import {Renderer as BaseRenderer} from '../common/renderer.js'; - import {RenderInfo} from './info.js'; /** diff --git a/core/renderers/zelos/constants.ts b/core/renderers/zelos/constants.ts index c50e66510a0..66ba6c95877 100644 --- a/core/renderers/zelos/constants.ts +++ b/core/renderers/zelos/constants.ts @@ -13,8 +13,8 @@ import * as utilsColour from '../../utils/colour.js'; import * as dom from '../../utils/dom.js'; import {Svg} from '../../utils/svg.js'; import * as svgPaths from '../../utils/svg_paths.js'; -import {ConstantProvider as BaseConstantProvider} from '../common/constants.js'; import type {Shape} from '../common/constants.js'; +import {ConstantProvider as BaseConstantProvider} from '../common/constants.js'; /** An object containing sizing and path information about inside corners. */ export interface InsideCorners { diff --git a/core/renderers/zelos/drawer.ts b/core/renderers/zelos/drawer.ts index 009247aeae4..e5b91c1e607 100644 --- a/core/renderers/zelos/drawer.ts +++ b/core/renderers/zelos/drawer.ts @@ -17,7 +17,6 @@ import {OutputConnection} from '../measurables/output_connection.js'; import type {Row} from '../measurables/row.js'; import type {SpacerRow} from '../measurables/spacer_row.js'; import {Types} from '../measurables/types.js'; - import type {InsideCorners} from './constants.js'; import type {RenderInfo} from './info.js'; import type {StatementInput} from './measurables/inputs.js'; diff --git a/core/renderers/zelos/info.ts b/core/renderers/zelos/info.ts index 623f0a3b085..dd3702fe5d1 100644 --- a/core/renderers/zelos/info.ts +++ b/core/renderers/zelos/info.ts @@ -7,24 +7,23 @@ // Former goog.module ID: Blockly.zelos.RenderInfo import type {BlockSvg} from '../../block_svg.js'; -import {DummyInput} from '../../inputs/dummy_input.js'; -import {EndRowInput} from '../../inputs/end_row_input.js'; import {FieldImage} from '../../field_image.js'; import {FieldLabel} from '../../field_label.js'; import {FieldTextInput} from '../../field_textinput.js'; -import {Input} from '../../inputs/input.js'; import {Align} from '../../inputs/align.js'; +import {DummyInput} from '../../inputs/dummy_input.js'; +import {EndRowInput} from '../../inputs/end_row_input.js'; +import {Input} from '../../inputs/input.js'; +import {StatementInput} from '../../inputs/statement_input.js'; +import {ValueInput} from '../../inputs/value_input.js'; import {RenderInfo as BaseRenderInfo} from '../common/info.js'; import type {Measurable} from '../measurables/base.js'; import {Field} from '../measurables/field.js'; import {InRowSpacer} from '../measurables/in_row_spacer.js'; import {InputConnection} from '../measurables/input_connection.js'; -import {StatementInput} from '../../inputs/statement_input.js'; import type {Row} from '../measurables/row.js'; import type {SpacerRow} from '../measurables/spacer_row.js'; import {Types} from '../measurables/types.js'; -import {ValueInput} from '../../inputs/value_input.js'; - import type {ConstantProvider, InsideCorners} from './constants.js'; import {BottomRow} from './measurables/bottom_row.js'; import {StatementInput as StatementInputMeasurable} from './measurables/inputs.js'; diff --git a/core/renderers/zelos/marker_svg.ts b/core/renderers/zelos/marker_svg.ts index 4805e264b6c..395ece0b0be 100644 --- a/core/renderers/zelos/marker_svg.ts +++ b/core/renderers/zelos/marker_svg.ts @@ -15,7 +15,6 @@ import {Svg} from '../../utils/svg.js'; import type {WorkspaceSvg} from '../../workspace_svg.js'; import type {ConstantProvider as BaseConstantProvider} from '../common/constants.js'; import {MarkerSvg as BaseMarkerSvg} from '../common/marker_svg.js'; - import type {ConstantProvider as ZelosConstantProvider} from './constants.js'; /** diff --git a/core/renderers/zelos/measurables/inputs.ts b/core/renderers/zelos/measurables/inputs.ts index d405574e0b7..98dd9f33e5d 100644 --- a/core/renderers/zelos/measurables/inputs.ts +++ b/core/renderers/zelos/measurables/inputs.ts @@ -6,7 +6,6 @@ // Former goog.module ID: Blockly.zelos.StatementInput -/* eslint-disable-next-line no-unused-vars */ import type {Input} from '../../../inputs/input.js'; import type {ConstantProvider} from '../../../renderers/common/constants.js'; import {StatementInput as BaseStatementInput} from '../../../renderers/measurables/statement_input.js'; diff --git a/core/renderers/zelos/path_object.ts b/core/renderers/zelos/path_object.ts index fdc6ab8a626..060190ee1b0 100644 --- a/core/renderers/zelos/path_object.ts +++ b/core/renderers/zelos/path_object.ts @@ -12,7 +12,6 @@ import type {BlockStyle} from '../../theme.js'; import * as dom from '../../utils/dom.js'; import {Svg} from '../../utils/svg.js'; import {PathObject as BasePathObject} from '../common/path_object.js'; - import type {ConstantProvider} from './constants.js'; /** diff --git a/core/renderers/zelos/renderer.ts b/core/renderers/zelos/renderer.ts index 354a3f35adf..b48600a0b4d 100644 --- a/core/renderers/zelos/renderer.ts +++ b/core/renderers/zelos/renderer.ts @@ -12,17 +12,16 @@ import {InsertionMarkerManager} from '../../insertion_marker_manager.js'; import type {Marker} from '../../keyboard_nav/marker.js'; import type {RenderedConnection} from '../../rendered_connection.js'; import type {BlockStyle} from '../../theme.js'; +import * as deprecation from '../../utils/deprecation.js'; import type {WorkspaceSvg} from '../../workspace_svg.js'; import * as blockRendering from '../common/block_rendering.js'; import type {RenderInfo as BaseRenderInfo} from '../common/info.js'; import {Renderer as BaseRenderer} from '../common/renderer.js'; - import {ConstantProvider} from './constants.js'; import {Drawer} from './drawer.js'; import {RenderInfo} from './info.js'; import {MarkerSvg} from './marker_svg.js'; import {PathObject} from './path_object.js'; -import * as deprecation from '../../utils/deprecation.js'; /** * The zelos renderer. This renderer emulates Scratch-style and MakeCode-style diff --git a/core/serialization.ts b/core/serialization.ts index 8e159bb2b0b..3eb232a5479 100644 --- a/core/serialization.ts +++ b/core/serialization.ts @@ -9,24 +9,24 @@ */ // Former goog.module ID: Blockly.serialization +import {ISerializer} from './interfaces/i_serializer.js'; import * as blocks from './serialization/blocks.js'; import * as exceptions from './serialization/exceptions.js'; import * as priorities from './serialization/priorities.js'; import * as procedures from './serialization/procedures.js'; import * as registry from './serialization/registry.js'; import * as variables from './serialization/variables.js'; -import * as workspaces from './serialization/workspaces.js'; import * as workspaceComments from './serialization/workspace_comments.js'; -import {ISerializer} from './interfaces/i_serializer.js'; +import * as workspaces from './serialization/workspaces.js'; export { blocks, exceptions, + ISerializer, priorities, procedures, registry, variables, - workspaces, workspaceComments, - ISerializer, + workspaces, }; diff --git a/core/serialization/blocks.ts b/core/serialization/blocks.ts index dbb58cffb2a..47960258fc8 100644 --- a/core/serialization/blocks.ts +++ b/core/serialization/blocks.ts @@ -15,11 +15,12 @@ import {inputTypes} from '../inputs/input_types.js'; import {isSerializable} from '../interfaces/i_serializable.js'; import type {ISerializer} from '../interfaces/i_serializer.js'; import * as registry from '../registry.js'; +import * as renderManagement from '../render_management.js'; import * as utilsXml from '../utils/xml.js'; +import {VariableModel} from '../variable_model.js'; +import * as Variables from '../variables.js'; import type {Workspace} from '../workspace.js'; import * as Xml from '../xml.js'; -import * as renderManagement from '../render_management.js'; - import { BadConnectionCheck, MissingBlockType, @@ -29,8 +30,6 @@ import { } from './exceptions.js'; import * as priorities from './priorities.js'; import * as serializationRegistry from './registry.js'; -import * as Variables from '../variables.js'; -import {VariableModel} from '../variable_model.js'; // TODO(#5160): Remove this once lint is fixed. /* eslint-disable no-use-before-define */ diff --git a/core/serialization/procedures.ts b/core/serialization/procedures.ts index c51a38c825f..5e2dd0d2858 100644 --- a/core/serialization/procedures.ts +++ b/core/serialization/procedures.ts @@ -7,8 +7,8 @@ import {IParameterModel} from '../interfaces/i_parameter_model.js'; import {IProcedureModel} from '../interfaces/i_procedure_model.js'; import type {ISerializer} from '../interfaces/i_serializer.js'; -import * as priorities from './priorities.js'; import type {Workspace} from '../workspace.js'; +import * as priorities from './priorities.js'; /** Represents the state of a procedure model. */ export interface State { diff --git a/core/serialization/variables.ts b/core/serialization/variables.ts index 69c6cda8c1b..b714401eb2f 100644 --- a/core/serialization/variables.ts +++ b/core/serialization/variables.ts @@ -8,7 +8,6 @@ import type {ISerializer} from '../interfaces/i_serializer.js'; import type {Workspace} from '../workspace.js'; - import * as priorities from './priorities.js'; import * as serializationRegistry from './registry.js'; diff --git a/core/serialization/workspace_comments.ts b/core/serialization/workspace_comments.ts index 525274e58e4..61d1127b39c 100644 --- a/core/serialization/workspace_comments.ts +++ b/core/serialization/workspace_comments.ts @@ -4,14 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {ISerializer} from '../interfaces/i_serializer.js'; -import {Workspace} from '../workspace.js'; -import * as priorities from './priorities.js'; import type {WorkspaceComment} from '../comments/workspace_comment.js'; import * as eventUtils from '../events/utils.js'; +import {ISerializer} from '../interfaces/i_serializer.js'; import {Coordinate} from '../utils/coordinate.js'; -import * as serializationRegistry from './registry.js'; import {Size} from '../utils/size.js'; +import {Workspace} from '../workspace.js'; +import * as priorities from './priorities.js'; +import * as serializationRegistry from './registry.js'; export interface State { id?: string; diff --git a/core/serialization/workspaces.ts b/core/serialization/workspaces.ts index 871060196c7..7206e371583 100644 --- a/core/serialization/workspaces.ts +++ b/core/serialization/workspaces.ts @@ -10,7 +10,6 @@ import * as eventUtils from '../events/utils.js'; import type {ISerializer} from '../interfaces/i_serializer.js'; import * as registry from '../registry.js'; import * as dom from '../utils/dom.js'; -// eslint-disable-next-line no-unused-vars import type {Workspace} from '../workspace.js'; import {WorkspaceSvg} from '../workspace_svg.js'; diff --git a/core/shortcut_items.ts b/core/shortcut_items.ts index 6a7e29d26b2..3a32b687fe8 100644 --- a/core/shortcut_items.ts +++ b/core/shortcut_items.ts @@ -9,16 +9,16 @@ import {BlockSvg} from './block_svg.js'; import * as clipboard from './clipboard.js'; import * as common from './common.js'; +import * as eventUtils from './events/utils.js'; import {Gesture} from './gesture.js'; import {ICopyData, isCopyable} from './interfaces/i_copyable.js'; import {isDeletable} from './interfaces/i_deletable.js'; -import {KeyboardShortcut, ShortcutRegistry} from './shortcut_registry.js'; -import {KeyCodes} from './utils/keycodes.js'; -import type {WorkspaceSvg} from './workspace_svg.js'; import {isDraggable} from './interfaces/i_draggable.js'; -import * as eventUtils from './events/utils.js'; +import {KeyboardShortcut, ShortcutRegistry} from './shortcut_registry.js'; import {Coordinate} from './utils/coordinate.js'; +import {KeyCodes} from './utils/keycodes.js'; import {Rect} from './utils/rect.js'; +import type {WorkspaceSvg} from './workspace_svg.js'; /** * Object holding the names of the default shortcut items. diff --git a/core/toolbox/category.ts b/core/toolbox/category.ts index 9fc2f8a6fc2..5bdeca223ff 100644 --- a/core/toolbox/category.ts +++ b/core/toolbox/category.ts @@ -16,6 +16,11 @@ import type {ICollapsibleToolboxItem} from '../interfaces/i_collapsible_toolbox_ import type {ISelectableToolboxItem} from '../interfaces/i_selectable_toolbox_item.js'; import type {IToolbox} from '../interfaces/i_toolbox.js'; import type {IToolboxItem} from '../interfaces/i_toolbox_item.js'; +import * as registry from '../registry.js'; +import * as aria from '../utils/aria.js'; +import * as colourUtils from '../utils/colour.js'; +import * as dom from '../utils/dom.js'; +import * as parsing from '../utils/parsing.js'; import type { CategoryInfo, DynamicCategoryInfo, @@ -24,13 +29,7 @@ import type { FlyoutItemInfoArray, StaticCategoryInfo, } from '../utils/toolbox.js'; -import * as registry from '../registry.js'; -import * as aria from '../utils/aria.js'; -import * as colourUtils from '../utils/colour.js'; -import * as dom from '../utils/dom.js'; -import * as parsing from '../utils/parsing.js'; import * as toolbox from '../utils/toolbox.js'; - import {ToolboxItem} from './toolbox_item.js'; /** diff --git a/core/toolbox/collapsible_category.ts b/core/toolbox/collapsible_category.ts index faea8edcb80..e51db4f6860 100644 --- a/core/toolbox/collapsible_category.ts +++ b/core/toolbox/collapsible_category.ts @@ -18,7 +18,6 @@ import * as registry from '../registry.js'; import * as aria from '../utils/aria.js'; import * as dom from '../utils/dom.js'; import * as toolbox from '../utils/toolbox.js'; - import {ToolboxCategory} from './category.js'; import {ToolboxSeparator} from './separator.js'; diff --git a/core/toolbox/separator.ts b/core/toolbox/separator.ts index ec003daf686..5e899054acc 100644 --- a/core/toolbox/separator.ts +++ b/core/toolbox/separator.ts @@ -16,7 +16,6 @@ import type {IToolbox} from '../interfaces/i_toolbox.js'; import * as registry from '../registry.js'; import * as dom from '../utils/dom.js'; import type * as toolbox from '../utils/toolbox.js'; - import {ToolboxItem} from './toolbox_item.js'; /** diff --git a/core/toolbox/toolbox.ts b/core/toolbox/toolbox.ts index 578a62b0e97..4e0f7720777 100644 --- a/core/toolbox/toolbox.ts +++ b/core/toolbox/toolbox.ts @@ -12,8 +12,6 @@ // Former goog.module ID: Blockly.Toolbox // Unused import preserved for side-effects. Remove if unneeded. -import '../events/events_toolbox_item_select.js'; - import {BlockSvg} from '../block_svg.js'; import type {BlocklyOptions} from '../blockly_options.js'; import * as browserEvents from '../browser_events.js'; @@ -21,9 +19,11 @@ import * as common from '../common.js'; import {ComponentManager} from '../component_manager.js'; import * as Css from '../css.js'; import {DeleteArea} from '../delete_area.js'; +import '../events/events_toolbox_item_select.js'; import * as eventUtils from '../events/utils.js'; import type {IAutoHideable} from '../interfaces/i_autohideable.js'; import type {ICollapsibleToolboxItem} from '../interfaces/i_collapsible_toolbox_item.js'; +import {isDeletable} from '../interfaces/i_deletable.js'; import type {IDraggable} from '../interfaces/i_draggable.js'; import type {IFlyout} from '../interfaces/i_flyout.js'; import type {IKeyboardAccessible} from '../interfaces/i_keyboard_accessible.js'; @@ -43,7 +43,6 @@ import * as toolbox from '../utils/toolbox.js'; import type {WorkspaceSvg} from '../workspace_svg.js'; import type {ToolboxCategory} from './category.js'; import {CollapsibleToolboxCategory} from './collapsible_category.js'; -import {isDeletable} from '../interfaces/i_deletable.js'; /** * Class for a Toolbox. diff --git a/core/trashcan.ts b/core/trashcan.ts index d4629dcaeab..4083a429451 100644 --- a/core/trashcan.ts +++ b/core/trashcan.ts @@ -12,14 +12,13 @@ // Former goog.module ID: Blockly.Trashcan // Unused import preserved for side-effects. Remove if unneeded. -import './events/events_trashcan_open.js'; - import type {BlocklyOptions} from './blockly_options.js'; import * as browserEvents from './browser_events.js'; import {ComponentManager} from './component_manager.js'; import {DeleteArea} from './delete_area.js'; import type {Abstract} from './events/events_abstract.js'; import type {BlockDelete} from './events/events_block_delete.js'; +import './events/events_trashcan_open.js'; import * as eventUtils from './events/utils.js'; import type {IAutoHideable} from './interfaces/i_autohideable.js'; import type {IDraggable} from './interfaces/i_draggable.js'; @@ -35,8 +34,8 @@ import * as dom from './utils/dom.js'; import {Rect} from './utils/rect.js'; import {Size} from './utils/size.js'; import {Svg} from './utils/svg.js'; -import {BlockInfo} from './utils/toolbox.js'; import * as toolbox from './utils/toolbox.js'; +import {BlockInfo} from './utils/toolbox.js'; import type {WorkspaceSvg} from './workspace_svg.js'; /** diff --git a/core/utils/parsing.ts b/core/utils/parsing.ts index 9950b80e642..3f70f5693f9 100644 --- a/core/utils/parsing.ts +++ b/core/utils/parsing.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.utils.parsing import {Msg} from '../msg.js'; - import * as colourUtils from './colour.js'; /** diff --git a/core/utils/svg_math.ts b/core/utils/svg_math.ts index 0444787add7..c29d6ae6999 100644 --- a/core/utils/svg_math.ts +++ b/core/utils/svg_math.ts @@ -7,7 +7,6 @@ // Former goog.module ID: Blockly.utils.svgMath import type {WorkspaceSvg} from '../workspace_svg.js'; - import {Coordinate} from './coordinate.js'; import {Rect} from './rect.js'; import * as style from './style.js'; diff --git a/core/variables.ts b/core/variables.ts index dee53a72bc8..b69893a9f08 100644 --- a/core/variables.ts +++ b/core/variables.ts @@ -8,9 +8,9 @@ import {Blocks} from './blocks.js'; import * as dialog from './dialog.js'; +import {isLegacyProcedureDefBlock} from './interfaces/i_legacy_procedure_blocks.js'; import {isVariableBackedParameterModel} from './interfaces/i_variable_backed_parameter_model.js'; import {Msg} from './msg.js'; -import {isLegacyProcedureDefBlock} from './interfaces/i_legacy_procedure_blocks.js'; import * as utilsXml from './utils/xml.js'; import {VariableModel} from './variable_model.js'; import type {Workspace} from './workspace.js'; diff --git a/core/variables_dynamic.ts b/core/variables_dynamic.ts index 6c44575490f..9788962c7b2 100644 --- a/core/variables_dynamic.ts +++ b/core/variables_dynamic.ts @@ -7,13 +7,13 @@ // Former goog.module ID: Blockly.VariablesDynamic import {Blocks} from './blocks.js'; +import type {FlyoutButton} from './flyout_button.js'; import {Msg} from './msg.js'; import * as xml from './utils/xml.js'; import {VariableModel} from './variable_model.js'; import * as Variables from './variables.js'; import type {Workspace} from './workspace.js'; import type {WorkspaceSvg} from './workspace_svg.js'; -import type {FlyoutButton} from './flyout_button.js'; /** * String for use in the "custom" attribute of a category in toolbox XML. diff --git a/core/widgetdiv.ts b/core/widgetdiv.ts index b28ec6367d1..897698611e0 100644 --- a/core/widgetdiv.ts +++ b/core/widgetdiv.ts @@ -7,8 +7,8 @@ // Former goog.module ID: Blockly.WidgetDiv import * as common from './common.js'; -import * as dom from './utils/dom.js'; import {Field} from './field.js'; +import * as dom from './utils/dom.js'; import type {Rect} from './utils/rect.js'; import type {Size} from './utils/size.js'; import type {WorkspaceSvg} from './workspace_svg.js'; diff --git a/core/workspace.ts b/core/workspace.ts index d092cbc82e7..bf734243f07 100644 --- a/core/workspace.ts +++ b/core/workspace.ts @@ -16,12 +16,15 @@ import './connection_checker.js'; import type {Block} from './block.js'; import type {BlocklyOptions} from './blockly_options.js'; +import {WorkspaceComment} from './comments/workspace_comment.js'; +import * as common from './common.js'; import type {ConnectionDB} from './connection_db.js'; import type {Abstract} from './events/events_abstract.js'; -import * as common from './common.js'; import * as eventUtils from './events/utils.js'; import type {IASTNodeLocation} from './interfaces/i_ast_node_location.js'; import type {IConnectionChecker} from './interfaces/i_connection_checker.js'; +import {IProcedureMap} from './interfaces/i_procedure_map.js'; +import {ObservableProcedureMap} from './observable_procedure_map.js'; import {Options} from './options.js'; import * as registry from './registry.js'; import * as arrayUtils from './utils/array.js'; @@ -30,9 +33,6 @@ import * as math from './utils/math.js'; import type * as toolbox from './utils/toolbox.js'; import {VariableMap} from './variable_map.js'; import type {VariableModel} from './variable_model.js'; -import {WorkspaceComment} from './comments/workspace_comment.js'; -import {IProcedureMap} from './interfaces/i_procedure_map.js'; -import {ObservableProcedureMap} from './observable_procedure_map.js'; /** * Class for a workspace. This is a data structure that contains blocks. diff --git a/core/workspace_svg.ts b/core/workspace_svg.ts index 82a08b2375d..6bf5fa5a591 100644 --- a/core/workspace_svg.ts +++ b/core/workspace_svg.ts @@ -22,11 +22,16 @@ import type {Block} from './block.js'; import type {BlockSvg} from './block_svg.js'; import type {BlocklyOptions} from './blockly_options.js'; import * as browserEvents from './browser_events.js'; +import {RenderedWorkspaceComment} from './comments/rendered_workspace_comment.js'; +import {WorkspaceComment} from './comments/workspace_comment.js'; import * as common from './common.js'; import {ComponentManager} from './component_manager.js'; import {ConnectionDB} from './connection_db.js'; import * as ContextMenu from './contextmenu.js'; -import {ContextMenuRegistry} from './contextmenu_registry.js'; +import { + ContextMenuOption, + ContextMenuRegistry, +} from './contextmenu_registry.js'; import * as dropDownDiv from './dropdowndiv.js'; import * as eventUtils from './events/utils.js'; import type {FlyoutButton} from './flyout_button.js'; @@ -40,10 +45,12 @@ import type {IMetricsManager} from './interfaces/i_metrics_manager.js'; import type {IToolbox} from './interfaces/i_toolbox.js'; import type {Cursor} from './keyboard_nav/cursor.js'; import type {Marker} from './keyboard_nav/marker.js'; +import {LayerManager} from './layer_manager.js'; import {MarkerManager} from './marker_manager.js'; import {Options} from './options.js'; import * as Procedures from './procedures.js'; import * as registry from './registry.js'; +import * as renderManagement from './render_management.js'; import * as blockRendering from './renderers/common/block_rendering.js'; import type {Renderer} from './renderers/common/renderer.js'; import type {ScrollbarPair} from './scrollbar_pair.js'; @@ -68,12 +75,7 @@ import * as VariablesDynamic from './variables_dynamic.js'; import * as WidgetDiv from './widgetdiv.js'; import {Workspace} from './workspace.js'; import {WorkspaceAudio} from './workspace_audio.js'; -import {WorkspaceComment} from './comments/workspace_comment.js'; import {ZoomControls} from './zoom_controls.js'; -import {ContextMenuOption} from './contextmenu_registry.js'; -import * as renderManagement from './render_management.js'; -import {LayerManager} from './layer_manager.js'; -import {RenderedWorkspaceComment} from './comments/rendered_workspace_comment.js'; /** Margin around the top/bottom/left/right after a zoomToFit call. */ const ZOOM_TO_FIT_MARGIN = 20; diff --git a/core/xml.ts b/core/xml.ts index bad381c5d85..5e344c3db91 100644 --- a/core/xml.ts +++ b/core/xml.ts @@ -8,12 +8,16 @@ import type {Block} from './block.js'; import type {BlockSvg} from './block_svg.js'; +import {RenderedWorkspaceComment} from './comments/rendered_workspace_comment.js'; +import {WorkspaceComment} from './comments/workspace_comment.js'; import type {Connection} from './connection.js'; import {MANUALLY_DISABLED} from './constants.js'; import * as eventUtils from './events/utils.js'; import type {Field} from './field.js'; import {IconType} from './icons/icon_types.js'; import {inputTypes} from './inputs/input_types.js'; +import * as renderManagement from './render_management.js'; +import {Coordinate} from './utils/coordinate.js'; import * as dom from './utils/dom.js'; import {Size} from './utils/size.js'; import * as utilsXml from './utils/xml.js'; @@ -21,10 +25,6 @@ import type {VariableModel} from './variable_model.js'; import * as Variables from './variables.js'; import type {Workspace} from './workspace.js'; import {WorkspaceSvg} from './workspace_svg.js'; -import * as renderManagement from './render_management.js'; -import {WorkspaceComment} from './comments/workspace_comment.js'; -import {RenderedWorkspaceComment} from './comments/rendered_workspace_comment.js'; -import {Coordinate} from './utils/coordinate.js'; /** * Encode a block tree as XML. diff --git a/generators/dart/dart_generator.ts b/generators/dart/dart_generator.ts index 222bbd41d7c..20feeda6f41 100644 --- a/generators/dart/dart_generator.ts +++ b/generators/dart/dart_generator.ts @@ -11,13 +11,13 @@ // Former goog.module ID: Blockly.Dart -import * as Variables from '../../core/variables.js'; -import * as stringUtils from '../../core/utils/string.js'; import type {Block} from '../../core/block.js'; import {CodeGenerator} from '../../core/generator.js'; +import {inputTypes} from '../../core/inputs/input_types.js'; import {Names, NameType} from '../../core/names.js'; +import * as stringUtils from '../../core/utils/string.js'; +import * as Variables from '../../core/variables.js'; import type {Workspace} from '../../core/workspace.js'; -import {inputTypes} from '../../core/inputs/input_types.js'; /** * Order of operation ENUMs. diff --git a/generators/dart/lists.ts b/generators/dart/lists.ts index 4aaf3990592..176b88dc438 100644 --- a/generators/dart/lists.ts +++ b/generators/dart/lists.ts @@ -10,10 +10,10 @@ // Former goog.module ID: Blockly.Dart.lists -import type {Block} from '../../core/block.js'; import type {CreateWithBlock} from '../../blocks/lists.js'; -import type {DartGenerator} from './dart_generator.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; +import type {DartGenerator} from './dart_generator.js'; import {Order} from './dart_generator.js'; // RESERVED WORDS: 'Math' diff --git a/generators/dart/loops.ts b/generators/dart/loops.ts index a6b6bb18048..f2e6efab026 100644 --- a/generators/dart/loops.ts +++ b/generators/dart/loops.ts @@ -10,11 +10,11 @@ // Former goog.module ID: Blockly.Dart.loops -import * as stringUtils from '../../core/utils/string.js'; -import type {Block} from '../../core/block.js'; import type {ControlFlowInLoopBlock} from '../../blocks/loops.js'; -import type {DartGenerator} from './dart_generator.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; +import * as stringUtils from '../../core/utils/string.js'; +import type {DartGenerator} from './dart_generator.js'; import {Order} from './dart_generator.js'; export function controls_repeat_ext(block: Block, generator: DartGenerator) { diff --git a/generators/dart/procedures.ts b/generators/dart/procedures.ts index 0ecf6d21008..8890e713c90 100644 --- a/generators/dart/procedures.ts +++ b/generators/dart/procedures.ts @@ -10,8 +10,8 @@ // Former goog.module ID: Blockly.Dart.procedures -import type {Block} from '../../core/block.js'; import type {IfReturnBlock} from '../../blocks/procedures.js'; +import type {Block} from '../../core/block.js'; import type {DartGenerator} from './dart_generator.js'; import {Order} from './dart_generator.js'; diff --git a/generators/dart/text.ts b/generators/dart/text.ts index c141eaad0fa..c189c32cf5a 100644 --- a/generators/dart/text.ts +++ b/generators/dart/text.ts @@ -10,9 +10,9 @@ // Former goog.module ID: Blockly.Dart.texts +import type {JoinMutatorBlock} from '../../blocks/text.js'; import type {Block} from '../../core/block.js'; import type {DartGenerator} from './dart_generator.js'; -import type {JoinMutatorBlock} from '../../blocks/text.js'; import {Order} from './dart_generator.js'; // RESERVED WORDS: 'Html,Math' diff --git a/generators/javascript/javascript_generator.ts b/generators/javascript/javascript_generator.ts index 592563f919d..a247ed5dd74 100644 --- a/generators/javascript/javascript_generator.ts +++ b/generators/javascript/javascript_generator.ts @@ -11,13 +11,13 @@ // Former goog.module ID: Blockly.JavaScript -import * as Variables from '../../core/variables.js'; -import * as stringUtils from '../../core/utils/string.js'; import type {Block} from '../../core/block.js'; import {CodeGenerator} from '../../core/generator.js'; +import {inputTypes} from '../../core/inputs/input_types.js'; import {Names, NameType} from '../../core/names.js'; +import * as stringUtils from '../../core/utils/string.js'; +import * as Variables from '../../core/variables.js'; import type {Workspace} from '../../core/workspace.js'; -import {inputTypes} from '../../core/inputs/input_types.js'; /** * Order of operation ENUMs. diff --git a/generators/javascript/lists.ts b/generators/javascript/lists.ts index bbed5231b56..7fd1887fb2e 100644 --- a/generators/javascript/lists.ts +++ b/generators/javascript/lists.ts @@ -10,10 +10,10 @@ // Former goog.module ID: Blockly.JavaScript.lists -import type {Block} from '../../core/block.js'; import type {CreateWithBlock} from '../../blocks/lists.js'; -import type {JavascriptGenerator} from './javascript_generator.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; +import type {JavascriptGenerator} from './javascript_generator.js'; import {Order} from './javascript_generator.js'; export function lists_create_empty( diff --git a/generators/javascript/loops.ts b/generators/javascript/loops.ts index 555e43ff1a9..2bc56158259 100644 --- a/generators/javascript/loops.ts +++ b/generators/javascript/loops.ts @@ -10,11 +10,11 @@ // Former goog.module ID: Blockly.JavaScript.loops -import * as stringUtils from '../../core/utils/string.js'; -import type {Block} from '../../core/block.js'; import type {ControlFlowInLoopBlock} from '../../blocks/loops.js'; -import type {JavascriptGenerator} from './javascript_generator.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; +import * as stringUtils from '../../core/utils/string.js'; +import type {JavascriptGenerator} from './javascript_generator.js'; import {Order} from './javascript_generator.js'; export function controls_repeat_ext( diff --git a/generators/javascript/procedures.ts b/generators/javascript/procedures.ts index e0a055217cf..d4a2e203451 100644 --- a/generators/javascript/procedures.ts +++ b/generators/javascript/procedures.ts @@ -10,8 +10,8 @@ // Former goog.module ID: Blockly.JavaScript.procedures -import type {Block} from '../../core/block.js'; import type {IfReturnBlock} from '../../blocks/procedures.js'; +import type {Block} from '../../core/block.js'; import type {JavascriptGenerator} from './javascript_generator.js'; import {Order} from './javascript_generator.js'; diff --git a/generators/javascript/text.ts b/generators/javascript/text.ts index d31bdcf4b95..f991bb28a65 100644 --- a/generators/javascript/text.ts +++ b/generators/javascript/text.ts @@ -10,9 +10,9 @@ // Former goog.module ID: Blockly.JavaScript.texts +import type {JoinMutatorBlock} from '../../blocks/text.js'; import type {Block} from '../../core/block.js'; import type {JavascriptGenerator} from './javascript_generator.js'; -import type {JoinMutatorBlock} from '../../blocks/text.js'; import {Order} from './javascript_generator.js'; /** diff --git a/generators/lua.ts b/generators/lua.ts index 0cf81fb961f..35ac570af14 100644 --- a/generators/lua.ts +++ b/generators/lua.ts @@ -11,10 +11,10 @@ // Former goog.module ID: Blockly.Lua.all -import {LuaGenerator} from './lua/lua_generator.js'; import * as lists from './lua/lists.js'; import * as logic from './lua/logic.js'; import * as loops from './lua/loops.js'; +import {LuaGenerator} from './lua/lua_generator.js'; import * as math from './lua/math.js'; import * as procedures from './lua/procedures.js'; import * as text from './lua/text.js'; diff --git a/generators/lua/lists.ts b/generators/lua/lists.ts index 901ed88a671..f1f90cc4aed 100644 --- a/generators/lua/lists.ts +++ b/generators/lua/lists.ts @@ -10,10 +10,10 @@ // Former goog.module ID: Blockly.Lua.lists -import type {Block} from '../../core/block.js'; import type {CreateWithBlock} from '../../blocks/lists.js'; -import type {LuaGenerator} from './lua_generator.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; +import type {LuaGenerator} from './lua_generator.js'; import {Order} from './lua_generator.js'; export function lists_create_empty( diff --git a/generators/lua/loops.ts b/generators/lua/loops.ts index 01474cd81c5..2c09f6279f6 100644 --- a/generators/lua/loops.ts +++ b/generators/lua/loops.ts @@ -10,11 +10,11 @@ // Former goog.module ID: Blockly.Lua.loops -import * as stringUtils from '../../core/utils/string.js'; -import type {Block} from '../../core/block.js'; import type {ControlFlowInLoopBlock} from '../../blocks/loops.js'; -import type {LuaGenerator} from './lua_generator.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; +import * as stringUtils from '../../core/utils/string.js'; +import type {LuaGenerator} from './lua_generator.js'; import {Order} from './lua_generator.js'; /** diff --git a/generators/lua/lua_generator.ts b/generators/lua/lua_generator.ts index 76517c77d38..b753ff2c6d2 100644 --- a/generators/lua/lua_generator.ts +++ b/generators/lua/lua_generator.ts @@ -13,12 +13,12 @@ // Former goog.module ID: Blockly.Lua -import * as stringUtils from '../../core/utils/string.js'; import type {Block} from '../../core/block.js'; import {CodeGenerator} from '../../core/generator.js'; +import {inputTypes} from '../../core/inputs/input_types.js'; import {Names} from '../../core/names.js'; +import * as stringUtils from '../../core/utils/string.js'; import type {Workspace} from '../../core/workspace.js'; -import {inputTypes} from '../../core/inputs/input_types.js'; /** * Order of operation ENUMs. diff --git a/generators/lua/procedures.ts b/generators/lua/procedures.ts index 79dc58aa252..bd78ef7a619 100644 --- a/generators/lua/procedures.ts +++ b/generators/lua/procedures.ts @@ -10,8 +10,8 @@ // Former goog.module ID: Blockly.Lua.procedures -import type {Block} from '../../core/block.js'; import type {IfReturnBlock} from '../../blocks/procedures.js'; +import type {Block} from '../../core/block.js'; import type {LuaGenerator} from './lua_generator.js'; import {Order} from './lua_generator.js'; diff --git a/generators/lua/text.ts b/generators/lua/text.ts index 1c4a79a8e96..47d9a2033e4 100644 --- a/generators/lua/text.ts +++ b/generators/lua/text.ts @@ -10,8 +10,8 @@ // Former goog.module ID: Blockly.Lua.texts -import type {Block} from '../../core/block.js'; import type {JoinMutatorBlock} from '../../blocks/text.js'; +import type {Block} from '../../core/block.js'; import type {LuaGenerator} from './lua_generator.js'; import {Order} from './lua_generator.js'; diff --git a/generators/php.ts b/generators/php.ts index 30a08086670..69f6cda74de 100644 --- a/generators/php.ts +++ b/generators/php.ts @@ -12,11 +12,11 @@ // Former goog.module ID: Blockly.PHP.all -import {PhpGenerator} from './php/php_generator.js'; import * as lists from './php/lists.js'; import * as logic from './php/logic.js'; import * as loops from './php/loops.js'; import * as math from './php/math.js'; +import {PhpGenerator} from './php/php_generator.js'; import * as procedures from './php/procedures.js'; import * as text from './php/text.js'; import * as variables from './php/variables.js'; diff --git a/generators/php/lists.ts b/generators/php/lists.ts index 7ca2639b7f2..009d7ccc807 100644 --- a/generators/php/lists.ts +++ b/generators/php/lists.ts @@ -21,12 +21,12 @@ // Former goog.module ID: Blockly.generator.lists -import * as stringUtils from '../../core/utils/string.js'; -import type {Block} from '../../core/block.js'; import type {CreateWithBlock} from '../../blocks/lists.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; -import {Order} from './php_generator.js'; +import * as stringUtils from '../../core/utils/string.js'; import type {PhpGenerator} from './php_generator.js'; +import {Order} from './php_generator.js'; export function lists_create_empty( block: Block, diff --git a/generators/php/logic.ts b/generators/php/logic.ts index 8aaa5c89213..731fe570867 100644 --- a/generators/php/logic.ts +++ b/generators/php/logic.ts @@ -11,8 +11,8 @@ // Former goog.module ID: Blockly.PHP.logic import type {Block} from '../../core/block.js'; -import {Order} from './php_generator.js'; import type {PhpGenerator} from './php_generator.js'; +import {Order} from './php_generator.js'; export function controls_if(block: Block, generator: PhpGenerator) { // If/elseif/else condition. diff --git a/generators/php/loops.ts b/generators/php/loops.ts index ae87dbb294b..991cbaf4e9b 100644 --- a/generators/php/loops.ts +++ b/generators/php/loops.ts @@ -10,12 +10,12 @@ // Former goog.module ID: Blockly.PHP.loops -import * as stringUtils from '../../core/utils/string.js'; -import type {Block} from '../../core/block.js'; import type {ControlFlowInLoopBlock} from '../../blocks/loops.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; -import {Order} from './php_generator.js'; +import * as stringUtils from '../../core/utils/string.js'; import type {PhpGenerator} from './php_generator.js'; +import {Order} from './php_generator.js'; export function controls_repeat_ext(block: Block, generator: PhpGenerator) { // Repeat n times. diff --git a/generators/php/math.ts b/generators/php/math.ts index 6218bf4d114..2026af0641e 100644 --- a/generators/php/math.ts +++ b/generators/php/math.ts @@ -11,8 +11,8 @@ // Former goog.module ID: Blockly.PHP.math import type {Block} from '../../core/block.js'; -import {Order} from './php_generator.js'; import type {PhpGenerator} from './php_generator.js'; +import {Order} from './php_generator.js'; export function math_number( block: Block, diff --git a/generators/php/php_generator.ts b/generators/php/php_generator.ts index ecdfb76fd01..8ac23c057bd 100644 --- a/generators/php/php_generator.ts +++ b/generators/php/php_generator.ts @@ -11,12 +11,12 @@ // Former goog.module ID: Blockly.PHP -import * as stringUtils from '../../core/utils/string.js'; import type {Block} from '../../core/block.js'; import {CodeGenerator} from '../../core/generator.js'; +import {inputTypes} from '../../core/inputs/input_types.js'; import {Names} from '../../core/names.js'; +import * as stringUtils from '../../core/utils/string.js'; import type {Workspace} from '../../core/workspace.js'; -import {inputTypes} from '../../core/inputs/input_types.js'; /** * Order of operation ENUMs. diff --git a/generators/php/procedures.ts b/generators/php/procedures.ts index acf84aea658..bad6c1443aa 100644 --- a/generators/php/procedures.ts +++ b/generators/php/procedures.ts @@ -10,12 +10,12 @@ // Former goog.module ID: Blockly.PHP.procedures -import * as Variables from '../../core/variables.js'; -import type {Block} from '../../core/block.js'; import type {IfReturnBlock} from '../../blocks/procedures.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; -import {Order} from './php_generator.js'; +import * as Variables from '../../core/variables.js'; import type {PhpGenerator} from './php_generator.js'; +import {Order} from './php_generator.js'; export function procedures_defreturn(block: Block, generator: PhpGenerator) { // Define a procedure with a return value. diff --git a/generators/php/text.ts b/generators/php/text.ts index 811e0251fb3..f50c7694602 100644 --- a/generators/php/text.ts +++ b/generators/php/text.ts @@ -10,10 +10,10 @@ // Former goog.module ID: Blockly.PHP.texts -import type {Block} from '../../core/block.js'; import type {JoinMutatorBlock} from '../../blocks/text.js'; -import {Order} from './php_generator.js'; +import type {Block} from '../../core/block.js'; import type {PhpGenerator} from './php_generator.js'; +import {Order} from './php_generator.js'; export function text(block: Block, generator: PhpGenerator): [string, Order] { // Text value. diff --git a/generators/php/variables.ts b/generators/php/variables.ts index 4aacc293b6d..2275719da81 100644 --- a/generators/php/variables.ts +++ b/generators/php/variables.ts @@ -11,8 +11,8 @@ // Former goog.module ID: Blockly.PHP.variables import type {Block} from '../../core/block.js'; -import {Order} from './php_generator.js'; import type {PhpGenerator} from './php_generator.js'; +import {Order} from './php_generator.js'; export function variables_get( block: Block, diff --git a/generators/python.ts b/generators/python.ts index d7b505763d7..6d57229e39d 100644 --- a/generators/python.ts +++ b/generators/python.ts @@ -12,12 +12,12 @@ // Former goog.module ID: Blockly.Python.all -import {PythonGenerator} from './python/python_generator.js'; import * as lists from './python/lists.js'; import * as logic from './python/logic.js'; import * as loops from './python/loops.js'; import * as math from './python/math.js'; import * as procedures from './python/procedures.js'; +import {PythonGenerator} from './python/python_generator.js'; import * as text from './python/text.js'; import * as variables from './python/variables.js'; import * as variablesDynamic from './python/variables_dynamic.js'; diff --git a/generators/python/lists.ts b/generators/python/lists.ts index 6e412c23fa3..79cfe9dd863 100644 --- a/generators/python/lists.ts +++ b/generators/python/lists.ts @@ -10,12 +10,12 @@ // Former goog.module ID: Blockly.Python.lists -import * as stringUtils from '../../core/utils/string.js'; -import type {Block} from '../../core/block.js'; import type {CreateWithBlock} from '../../blocks/lists.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; -import {Order} from './python_generator.js'; +import * as stringUtils from '../../core/utils/string.js'; import type {PythonGenerator} from './python_generator.js'; +import {Order} from './python_generator.js'; export function lists_create_empty( block: Block, diff --git a/generators/python/loops.ts b/generators/python/loops.ts index 7ca7a5582e5..84aa613c638 100644 --- a/generators/python/loops.ts +++ b/generators/python/loops.ts @@ -10,11 +10,11 @@ // Former goog.module ID: Blockly.Python.loops -import * as stringUtils from '../../core/utils/string.js'; -import type {Block} from '../../core/block.js'; import type {ControlFlowInLoopBlock} from '../../blocks/loops.js'; -import type {PythonGenerator} from './python_generator.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; +import * as stringUtils from '../../core/utils/string.js'; +import type {PythonGenerator} from './python_generator.js'; import {Order} from './python_generator.js'; export function controls_repeat_ext(block: Block, generator: PythonGenerator) { diff --git a/generators/python/procedures.ts b/generators/python/procedures.ts index 51d2ee9a31b..32eae97b9e0 100644 --- a/generators/python/procedures.ts +++ b/generators/python/procedures.ts @@ -10,12 +10,12 @@ // Former goog.module ID: Blockly.Python.procedures -import * as Variables from '../../core/variables.js'; -import type {Block} from '../../core/block.js'; import type {IfReturnBlock} from '../../blocks/procedures.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; -import {Order} from './python_generator.js'; +import * as Variables from '../../core/variables.js'; import type {PythonGenerator} from './python_generator.js'; +import {Order} from './python_generator.js'; export function procedures_defreturn(block: Block, generator: PythonGenerator) { // Define a procedure with a return value. diff --git a/generators/python/python_generator.ts b/generators/python/python_generator.ts index bf7b87496ee..f96312e6dac 100644 --- a/generators/python/python_generator.ts +++ b/generators/python/python_generator.ts @@ -11,13 +11,13 @@ // Former goog.module ID: Blockly.Python -import * as stringUtils from '../../core/utils/string.js'; -import * as Variables from '../../core/variables.js'; import type {Block} from '../../core/block.js'; import {CodeGenerator} from '../../core/generator.js'; +import {inputTypes} from '../../core/inputs/input_types.js'; import {Names} from '../../core/names.js'; +import * as stringUtils from '../../core/utils/string.js'; +import * as Variables from '../../core/variables.js'; import type {Workspace} from '../../core/workspace.js'; -import {inputTypes} from '../../core/inputs/input_types.js'; /** * Order of operation ENUMs. diff --git a/generators/python/text.ts b/generators/python/text.ts index e9154da83fe..1ccf6b200a3 100644 --- a/generators/python/text.ts +++ b/generators/python/text.ts @@ -10,12 +10,12 @@ // Former goog.module ID: Blockly.Python.texts -import * as stringUtils from '../../core/utils/string.js'; -import type {Block} from '../../core/block.js'; import type {JoinMutatorBlock} from '../../blocks/text.js'; +import type {Block} from '../../core/block.js'; import {NameType} from '../../core/names.js'; -import {Order} from './python_generator.js'; +import * as stringUtils from '../../core/utils/string.js'; import type {PythonGenerator} from './python_generator.js'; +import {Order} from './python_generator.js'; export function text( block: Block, diff --git a/package-lock.json b/package-lock.json index 227a270315e..788993d05d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,6 +48,7 @@ "mocha": "^10.0.0", "patch-package": "^8.0.0", "prettier": "^3.3.3", + "prettier-plugin-organize-imports": "^4.0.0", "readline-sync": "^1.4.10", "rimraf": "^5.0.0", "typescript": "^5.3.3", @@ -7565,6 +7566,27 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/prettier-plugin-organize-imports": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.0.0.tgz", + "integrity": "sha512-vnKSdgv9aOlqKeEFGhf9SCBsTyzDSyScy1k7E0R1Uo4L0cTcOV7c1XQaT7jfXIOc/p08WLBfN2QUQA9zDSZMxA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@vue/language-plugin-pug": "^2.0.24", + "prettier": ">=2.0", + "typescript": ">=2.9", + "vue-tsc": "^2.0.24" + }, + "peerDependenciesMeta": { + "@vue/language-plugin-pug": { + "optional": true + }, + "vue-tsc": { + "optional": true + } + } + }, "node_modules/process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", diff --git a/package.json b/package.json index 3fc0a69e1df..fa7ab7163fd 100644 --- a/package.json +++ b/package.json @@ -135,6 +135,7 @@ "mocha": "^10.0.0", "patch-package": "^8.0.0", "prettier": "^3.3.3", + "prettier-plugin-organize-imports": "^4.0.0", "readline-sync": "^1.4.10", "rimraf": "^5.0.0", "typescript": "^5.3.3", diff --git a/tests/browser/test/basic_block_factory_test.mjs b/tests/browser/test/basic_block_factory_test.mjs index e20892471a5..a9f3cc3f37d 100644 --- a/tests/browser/test/basic_block_factory_test.mjs +++ b/tests/browser/test/basic_block_factory_test.mjs @@ -9,7 +9,7 @@ */ import * as chai from 'chai'; -import {testSetup, testFileLocations} from './test_setup.mjs'; +import {testFileLocations, testSetup} from './test_setup.mjs'; suite('Testing Connecting Blocks', function (done) { // Setting timeout to unlimited as the webdriver takes a longer time to run than most mocha test diff --git a/tests/browser/test/basic_block_test.mjs b/tests/browser/test/basic_block_test.mjs index 515cf5668b4..326e20ecfd4 100644 --- a/tests/browser/test/basic_block_test.mjs +++ b/tests/browser/test/basic_block_test.mjs @@ -11,12 +11,11 @@ import * as chai from 'chai'; import { - testSetup, - testFileLocations, - getAllBlocks, dragNthBlockFromFlyout, + getAllBlocks, + testFileLocations, + testSetup, } from './test_setup.mjs'; -import {Key} from 'webdriverio'; suite('Basic block tests', function (done) { // Setting timeout to unlimited as the webdriver takes a longer time diff --git a/tests/browser/test/basic_playground_test.mjs b/tests/browser/test/basic_playground_test.mjs index 11ad7a368c1..55ff58e4b05 100644 --- a/tests/browser/test/basic_playground_test.mjs +++ b/tests/browser/test/basic_playground_test.mjs @@ -10,13 +10,13 @@ import * as chai from 'chai'; import { - testSetup, - testFileLocations, - dragNthBlockFromFlyout, - dragBlockTypeFromFlyout, connect, contextMenuSelect, + dragBlockTypeFromFlyout, + dragNthBlockFromFlyout, PAUSE_TIME, + testFileLocations, + testSetup, } from './test_setup.mjs'; async function getIsCollapsed(browser, blockId) { diff --git a/tests/browser/test/block_undo_test.mjs b/tests/browser/test/block_undo_test.mjs index 1c96422dc24..0d9f256c280 100644 --- a/tests/browser/test/block_undo_test.mjs +++ b/tests/browser/test/block_undo_test.mjs @@ -11,11 +11,11 @@ import * as chai from 'chai'; import {Key} from 'webdriverio'; import { - testSetup, - testFileLocations, dragBlockTypeFromFlyout, - screenDirection, getAllBlocks, + screenDirection, + testFileLocations, + testSetup, } from './test_setup.mjs'; suite('Testing undo block movement', function (done) { diff --git a/tests/browser/test/delete_blocks_test.mjs b/tests/browser/test/delete_blocks_test.mjs index 1e560dccee4..27e17054d56 100644 --- a/tests/browser/test/delete_blocks_test.mjs +++ b/tests/browser/test/delete_blocks_test.mjs @@ -5,16 +5,16 @@ */ import * as chai from 'chai'; +import {Key} from 'webdriverio'; import { - testSetup, - testFileLocations, - getAllBlocks, - getBlockElementById, clickBlock, contextMenuSelect, + getAllBlocks, + getBlockElementById, PAUSE_TIME, + testFileLocations, + testSetup, } from './test_setup.mjs'; -import {Key} from 'webdriverio'; const firstBlockId = 'root_block'; const startBlocks = { diff --git a/tests/browser/test/extensive_test.mjs b/tests/browser/test/extensive_test.mjs index 2b1245d2a3e..786be0ade53 100644 --- a/tests/browser/test/extensive_test.mjs +++ b/tests/browser/test/extensive_test.mjs @@ -9,14 +9,14 @@ */ import * as chai from 'chai'; +import {Key} from 'webdriverio'; import { - testSetup, - testFileLocations, - getBlockElementById, getAllBlocks, + getBlockElementById, PAUSE_TIME, + testFileLocations, + testSetup, } from './test_setup.mjs'; -import {Key} from 'webdriverio'; suite('This tests loading Large Configuration and Deletion', function (done) { // Setting timeout to unlimited as the webdriver takes a longer time to run than most mocha test diff --git a/tests/browser/test/field_edits_test.mjs b/tests/browser/test/field_edits_test.mjs index a4dbbb823b6..bd4da0019ef 100644 --- a/tests/browser/test/field_edits_test.mjs +++ b/tests/browser/test/field_edits_test.mjs @@ -9,14 +9,14 @@ */ import * as chai from 'chai'; +import {Key} from 'webdriverio'; import { - testSetup, - testFileLocations, + clickWorkspace, dragBlockTypeFromFlyout, screenDirection, - clickWorkspace, + testFileLocations, + testSetup, } from './test_setup.mjs'; -import {Key} from 'webdriverio'; suite('Testing Field Edits', function (done) { // Setting timeout to unlimited as the webdriver takes a longer time to run than most mocha test diff --git a/tests/browser/test/mutator_test.mjs b/tests/browser/test/mutator_test.mjs index 46bc2abbef5..6d077b9fd92 100644 --- a/tests/browser/test/mutator_test.mjs +++ b/tests/browser/test/mutator_test.mjs @@ -6,15 +6,15 @@ import * as chai from 'chai'; import { - testSetup, - testFileLocations, + PAUSE_TIME, connect, + dragBlockFromMutatorFlyout, dragBlockTypeFromFlyout, - screenDirection, - PAUSE_TIME, getBlockElementById, - dragBlockFromMutatorFlyout, openMutatorForBlock, + screenDirection, + testFileLocations, + testSetup, } from './test_setup.mjs'; suite('Mutating a block', function (done) { diff --git a/tests/browser/test/procedure_test.mjs b/tests/browser/test/procedure_test.mjs index 4c0e0897c39..34368c73241 100644 --- a/tests/browser/test/procedure_test.mjs +++ b/tests/browser/test/procedure_test.mjs @@ -10,13 +10,13 @@ import * as chai from 'chai'; import { - testSetup, - testFileLocations, - getSelectedBlockElement, - getNthBlockOfCategory, - getBlockTypeFromCategory, connect, + getBlockTypeFromCategory, + getNthBlockOfCategory, + getSelectedBlockElement, PAUSE_TIME, + testFileLocations, + testSetup, } from './test_setup.mjs'; suite('Testing Connecting Blocks', function (done) { diff --git a/tests/browser/test/test_setup.mjs b/tests/browser/test/test_setup.mjs index 3888815df2d..523a5d851fc 100644 --- a/tests/browser/test/test_setup.mjs +++ b/tests/browser/test/test_setup.mjs @@ -16,9 +16,9 @@ * identifiers that Selenium can use to find those elements. */ -import * as webdriverio from 'webdriverio'; import * as path from 'path'; import {fileURLToPath} from 'url'; +import * as webdriverio from 'webdriverio'; import {posixPath} from '../../../scripts/helpers.js'; let driver = null; diff --git a/tests/browser/test/toolbox_drag_test.mjs b/tests/browser/test/toolbox_drag_test.mjs index 47a3520426a..742872d9339 100644 --- a/tests/browser/test/toolbox_drag_test.mjs +++ b/tests/browser/test/toolbox_drag_test.mjs @@ -10,12 +10,12 @@ import * as chai from 'chai'; import { - testSetup, - testFileLocations, getCategory, - scrollFlyout, - screenDirection, PAUSE_TIME, + screenDirection, + scrollFlyout, + testFileLocations, + testSetup, } from './test_setup.mjs'; // Categories in the basic toolbox. diff --git a/tests/browser/test/workspace_comment_test.mjs b/tests/browser/test/workspace_comment_test.mjs index 0a7b12bf719..5719948d0e9 100644 --- a/tests/browser/test/workspace_comment_test.mjs +++ b/tests/browser/test/workspace_comment_test.mjs @@ -6,8 +6,7 @@ import * as chai from 'chai'; import * as sinon from 'sinon'; -import {Key} from 'webdriverio'; -import {testSetup, testFileLocations} from './test_setup.mjs'; +import {testFileLocations, testSetup} from './test_setup.mjs'; suite('Workspace comments', function () { // Setting timeout to unlimited as the webdriver takes a longer time diff --git a/tests/migration/validate-renamings.mjs b/tests/migration/validate-renamings.mjs index 439e216c813..d9c66ef9ce1 100755 --- a/tests/migration/validate-renamings.mjs +++ b/tests/migration/validate-renamings.mjs @@ -11,11 +11,10 @@ * (renamings-schema.json). */ -import JSON5 from 'json5'; -import {readFile} from 'fs/promises'; -import {posixPath} from '../../scripts/helpers.js'; import {validate} from '@hyperjump/json-schema/draft-2020-12'; import {BASIC} from '@hyperjump/json-schema/experimental'; +import {readFile} from 'fs/promises'; +import JSON5 from 'json5'; /** @type {URL} Renaming schema filename. */ const SCHEMA_URL = new URL('renamings.schema.json', import.meta.url); diff --git a/tests/mocha/astnode_test.js b/tests/mocha/astnode_test.js index 4c449b7fa81..7ffe8efb90a 100644 --- a/tests/mocha/astnode_test.js +++ b/tests/mocha/astnode_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import {ASTNode} from '../../build/src/core/keyboard_nav/ast_node.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/block_json_test.js b/tests/mocha/block_json_test.js index 9d6dfb738f0..6f286fa30eb 100644 --- a/tests/mocha/block_json_test.js +++ b/tests/mocha/block_json_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import {Align} from '../../build/src/core/inputs/align.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/block_test.js b/tests/mocha/block_test.js index dd070f86cbb..1b685a445b5 100644 --- a/tests/mocha/block_test.js +++ b/tests/mocha/block_test.js @@ -4,23 +4,21 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import {ConnectionType} from '../../build/src/core/connection_type.js'; -import {createDeprecationWarningStub} from './test_helpers/warnings.js'; -import {createRenderedBlock} from './test_helpers/block_definitions.js'; import * as eventUtils from '../../build/src/core/events/utils.js'; import {EndRowInput} from '../../build/src/core/inputs/end_row_input.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import {createRenderedBlock} from './test_helpers/block_definitions.js'; +import { + createChangeListenerSpy, + createMockEvent, +} from './test_helpers/events.js'; +import {MockBubbleIcon, MockIcon} from './test_helpers/icon_mocks.js'; import { sharedTestSetup, sharedTestTeardown, workspaceTeardown, } from './test_helpers/setup_teardown.js'; -import { - createChangeListenerSpy, - createMockEvent, -} from './test_helpers/events.js'; -import {MockIcon, MockBubbleIcon} from './test_helpers/icon_mocks.js'; -import {IconType} from '../../build/src/core/icons/icon_types.js'; suite('Blocks', function () { setup(function () { diff --git a/tests/mocha/blocks/lists_test.js b/tests/mocha/blocks/lists_test.js index cecf3c808cc..0c7a92bf65a 100644 --- a/tests/mocha/blocks/lists_test.js +++ b/tests/mocha/blocks/lists_test.js @@ -4,14 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ +import {ConnectionType} from '../../../build/src/core/connection_type.js'; import {assert} from '../../../node_modules/chai/chai.js'; +import {defineStatementBlock} from '../test_helpers/block_definitions.js'; import {runSerializationTestSuite} from '../test_helpers/serialization.js'; import { sharedTestSetup, sharedTestTeardown, } from '../test_helpers/setup_teardown.js'; -import {ConnectionType} from '../../../build/src/core/connection_type.js'; -import {defineStatementBlock} from '../test_helpers/block_definitions.js'; suite('Lists', function () { setup(function () { diff --git a/tests/mocha/blocks/logic_ternary_test.js b/tests/mocha/blocks/logic_ternary_test.js index 6661bd5d4fc..e6e3326ecb3 100644 --- a/tests/mocha/blocks/logic_ternary_test.js +++ b/tests/mocha/blocks/logic_ternary_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../../node_modules/chai/chai.js'; import * as eventUtils from '../../../build/src/core/events/utils.js'; +import {assert} from '../../../node_modules/chai/chai.js'; import {runSerializationTestSuite} from '../test_helpers/serialization.js'; import { sharedTestSetup, diff --git a/tests/mocha/blocks/loops_test.js b/tests/mocha/blocks/loops_test.js index 8f4897e0088..f8d74916c29 100644 --- a/tests/mocha/blocks/loops_test.js +++ b/tests/mocha/blocks/loops_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../../node_modules/chai/chai.js'; import * as Blockly from '../../../build/src/core/blockly.js'; +import {assert} from '../../../node_modules/chai/chai.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/blocks/procedures_test.js b/tests/mocha/blocks/procedures_test.js index 600aefa6aa9..84dbf1746ab 100644 --- a/tests/mocha/blocks/procedures_test.js +++ b/tests/mocha/blocks/procedures_test.js @@ -4,13 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../../node_modules/chai/chai.js'; import * as Blockly from '../../../build/src/core/blockly.js'; +import {assert} from '../../../node_modules/chai/chai.js'; +import {defineRowBlock} from '../test_helpers/block_definitions.js'; import { assertCallBlockStructure, assertDefBlockStructure, - createProcDefBlock, createProcCallBlock, + createProcDefBlock, MockProcedureModel, } from '../test_helpers/procedures.js'; import {runSerializationTestSuite} from '../test_helpers/serialization.js'; @@ -20,7 +21,6 @@ import { sharedTestTeardown, workspaceTeardown, } from '../test_helpers/setup_teardown.js'; -import {defineRowBlock} from '../test_helpers/block_definitions.js'; suite('Procedures', function () { setup(function () { diff --git a/tests/mocha/blocks/variables_test.js b/tests/mocha/blocks/variables_test.js index ea45d59c355..d12691dd476 100644 --- a/tests/mocha/blocks/variables_test.js +++ b/tests/mocha/blocks/variables_test.js @@ -4,16 +4,16 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../../node_modules/chai/chai.js'; -import { - sharedTestSetup, - sharedTestTeardown, -} from '../test_helpers/setup_teardown.js'; import {nameUsedWithConflictingParam} from '../../../build/src/core/variables.js'; +import {assert} from '../../../node_modules/chai/chai.js'; import { MockParameterModelWithVar, MockProcedureModel, } from '../test_helpers/procedures.js'; +import { + sharedTestSetup, + sharedTestTeardown, +} from '../test_helpers/setup_teardown.js'; suite('Variables', function () { setup(function () { diff --git a/tests/mocha/clipboard_test.js b/tests/mocha/clipboard_test.js index 37145de07f9..6526984213f 100644 --- a/tests/mocha/clipboard_test.js +++ b/tests/mocha/clipboard_test.js @@ -5,14 +5,14 @@ */ import {assert} from '../../node_modules/chai/chai.js'; -import { - sharedTestSetup, - sharedTestTeardown, -} from './test_helpers/setup_teardown.js'; import { assertEventFired, createChangeListenerSpy, } from './test_helpers/events.js'; +import { + sharedTestSetup, + sharedTestTeardown, +} from './test_helpers/setup_teardown.js'; suite('Clipboard', function () { setup(function () { diff --git a/tests/mocha/comment_test.js b/tests/mocha/comment_test.js index d4091b9c2d3..3662a870f47 100644 --- a/tests/mocha/comment_test.js +++ b/tests/mocha/comment_test.js @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +import * as eventUtils from '../../build/src/core/events/utils.js'; import {assert} from '../../node_modules/chai/chai.js'; import {assertEventFired} from './test_helpers/events.js'; -import * as eventUtils from '../../build/src/core/events/utils.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/connection_checker_test.js b/tests/mocha/connection_checker_test.js index 20f85623a43..f7aa33ba896 100644 --- a/tests/mocha/connection_checker_test.js +++ b/tests/mocha/connection_checker_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import {ConnectionType} from '../../build/src/core/connection_type.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/connection_db_test.js b/tests/mocha/connection_db_test.js index 11eeecf31db..e7f397d545f 100644 --- a/tests/mocha/connection_db_test.js +++ b/tests/mocha/connection_db_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import {ConnectionType} from '../../build/src/core/connection_type.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/connection_test.js b/tests/mocha/connection_test.js index 040f59f401b..cefea1784e7 100644 --- a/tests/mocha/connection_test.js +++ b/tests/mocha/connection_test.js @@ -5,17 +5,17 @@ */ import {assert} from '../../node_modules/chai/chai.js'; +import { + defineRowBlock, + defineStackBlock, + defineStatementBlock, +} from './test_helpers/block_definitions.js'; import { createGenUidStubWithReturns, sharedTestSetup, sharedTestTeardown, workspaceTeardown, } from './test_helpers/setup_teardown.js'; -import { - defineRowBlock, - defineStatementBlock, - defineStackBlock, -} from './test_helpers/block_definitions.js'; suite('Connection', function () { setup(function () { diff --git a/tests/mocha/contextmenu_test.js b/tests/mocha/contextmenu_test.js index b730b250db1..fe6d4be997e 100644 --- a/tests/mocha/contextmenu_test.js +++ b/tests/mocha/contextmenu_test.js @@ -4,16 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ +import {callbackFactory} from '../../build/src/core/contextmenu.js'; +import * as xmlUtils from '../../build/src/core/utils/xml.js'; +import * as Variables from '../../build/src/core/variables.js'; import {assert} from '../../node_modules/chai/chai.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; -import {callbackFactory} from '../../build/src/core/contextmenu.js'; -import * as xmlUtils from '../../build/src/core/utils/xml.js'; -import * as Variables from '../../build/src/core/variables.js'; - suite('Context Menu', function () { setup(function () { sharedTestSetup.call(this); diff --git a/tests/mocha/cursor_test.js b/tests/mocha/cursor_test.js index fcb763304bd..bb5026d7ac3 100644 --- a/tests/mocha/cursor_test.js +++ b/tests/mocha/cursor_test.js @@ -4,12 +4,12 @@ * SPDX-License-Identifier: Apache-2.0 */ +import {ASTNode} from '../../build/src/core/keyboard_nav/ast_node.js'; import {assert} from '../../node_modules/chai/chai.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; -import {ASTNode} from '../../build/src/core/keyboard_nav/ast_node.js'; suite('Cursor', function () { setup(function () { diff --git a/tests/mocha/event_block_change_test.js b/tests/mocha/event_block_change_test.js index a4de1eddbe6..7de0a23b607 100644 --- a/tests/mocha/event_block_change_test.js +++ b/tests/mocha/event_block_change_test.js @@ -5,11 +5,11 @@ */ import {assert} from '../../node_modules/chai/chai.js'; +import {defineMutatorBlocks} from './test_helpers/block_definitions.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; -import {defineMutatorBlocks} from './test_helpers/block_definitions.js'; suite('Block Change Event', function () { setup(function () { diff --git a/tests/mocha/event_block_create_test.js b/tests/mocha/event_block_create_test.js index 4ca6fb22a5a..94d9c72b366 100644 --- a/tests/mocha/event_block_create_test.js +++ b/tests/mocha/event_block_create_test.js @@ -4,14 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ +import * as eventUtils from '../../build/src/core/events/utils.js'; import {assert} from '../../node_modules/chai/chai.js'; +import {defineRowBlock} from './test_helpers/block_definitions.js'; import {assertEventFired} from './test_helpers/events.js'; -import * as eventUtils from '../../build/src/core/events/utils.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; -import {defineRowBlock} from './test_helpers/block_definitions.js'; suite('Block Create Event', function () { setup(function () { diff --git a/tests/mocha/event_test.js b/tests/mocha/event_test.js index 0a4e96d2b93..75b52bede8b 100644 --- a/tests/mocha/event_test.js +++ b/tests/mocha/event_test.js @@ -4,22 +4,22 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import * as eventUtils from '../../build/src/core/events/utils.js'; import {ASTNode} from '../../build/src/core/keyboard_nav/ast_node.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { assertEventEquals, assertNthCallEventArgEquals, createChangeListenerSpy, } from './test_helpers/events.js'; -import {assertVariableValues} from './test_helpers/variables.js'; import { createGenUidStubWithReturns, sharedTestSetup, sharedTestTeardown, workspaceTeardown, } from './test_helpers/setup_teardown.js'; -import * as eventUtils from '../../build/src/core/events/utils.js'; +import {assertVariableValues} from './test_helpers/variables.js'; suite('Events', function () { setup(function () { diff --git a/tests/mocha/field_checkbox_test.js b/tests/mocha/field_checkbox_test.js index 1db3c9a4b1b..08190fed823 100644 --- a/tests/mocha/field_checkbox_test.js +++ b/tests/mocha/field_checkbox_test.js @@ -4,8 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import {defineRowBlock} from './test_helpers/block_definitions.js'; import { assertFieldValue, runConstructorSuiteTests, @@ -17,7 +18,6 @@ import { sharedTestTeardown, workspaceTeardown, } from './test_helpers/setup_teardown.js'; -import {defineRowBlock} from './test_helpers/block_definitions.js'; suite('Checkbox Fields', function () { setup(function () { diff --git a/tests/mocha/field_colour_test.js b/tests/mocha/field_colour_test.js index ed30be5527a..262f978f29d 100644 --- a/tests/mocha/field_colour_test.js +++ b/tests/mocha/field_colour_test.js @@ -4,18 +4,18 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import { + createTestBlock, + defineRowBlock, +} from './test_helpers/block_definitions.js'; import { assertFieldValue, runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests, } from './test_helpers/fields.js'; -import { - createTestBlock, - defineRowBlock, -} from './test_helpers/block_definitions.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/field_dropdown_test.js b/tests/mocha/field_dropdown_test.js index c0261bc65e0..61deaf47f39 100644 --- a/tests/mocha/field_dropdown_test.js +++ b/tests/mocha/field_dropdown_test.js @@ -4,18 +4,18 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import { + createTestBlock, + defineRowBlock, +} from './test_helpers/block_definitions.js'; import { assertFieldValue, runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests, } from './test_helpers/fields.js'; -import { - createTestBlock, - defineRowBlock, -} from './test_helpers/block_definitions.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/field_image_test.js b/tests/mocha/field_image_test.js index ed1ec5596b5..89dd5fcc91b 100644 --- a/tests/mocha/field_image_test.js +++ b/tests/mocha/field_image_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { assertFieldValue, runConstructorSuiteTests, diff --git a/tests/mocha/field_label_serializable_test.js b/tests/mocha/field_label_serializable_test.js index f6502db08ac..a831713412c 100644 --- a/tests/mocha/field_label_serializable_test.js +++ b/tests/mocha/field_label_serializable_test.js @@ -4,8 +4,12 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import { + createTestBlock, + defineRowBlock, +} from './test_helpers/block_definitions.js'; import { assertFieldValue, runConstructorSuiteTests, @@ -17,10 +21,6 @@ import { sharedTestTeardown, workspaceTeardown, } from './test_helpers/setup_teardown.js'; -import { - createTestBlock, - defineRowBlock, -} from './test_helpers/block_definitions.js'; suite('Label Serializable Fields', function () { setup(function () { diff --git a/tests/mocha/field_label_test.js b/tests/mocha/field_label_test.js index 43883ebf8e8..cf5b4904493 100644 --- a/tests/mocha/field_label_test.js +++ b/tests/mocha/field_label_test.js @@ -4,8 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import {createTestBlock} from './test_helpers/block_definitions.js'; import { assertFieldValue, runConstructorSuiteTests, @@ -16,7 +17,6 @@ import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; -import {createTestBlock} from './test_helpers/block_definitions.js'; suite('Label Fields', function () { setup(function () { diff --git a/tests/mocha/field_number_test.js b/tests/mocha/field_number_test.js index fb671204627..3e0d8ca3861 100644 --- a/tests/mocha/field_number_test.js +++ b/tests/mocha/field_number_test.js @@ -4,21 +4,21 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import {defineRowBlock} from './test_helpers/block_definitions.js'; +import {runTestCases} from './test_helpers/common.js'; import { assertFieldValue, runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests, } from './test_helpers/fields.js'; -import {defineRowBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, sharedTestTeardown, workspaceTeardown, } from './test_helpers/setup_teardown.js'; -import {runTestCases} from './test_helpers/common.js'; suite('Number Fields', function () { setup(function () { diff --git a/tests/mocha/field_registry_test.js b/tests/mocha/field_registry_test.js index c6ec26967e2..26b33c16c3d 100644 --- a/tests/mocha/field_registry_test.js +++ b/tests/mocha/field_registry_test.js @@ -4,9 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; -import {createDeprecationWarningStub} from './test_helpers/warnings.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/field_test.js b/tests/mocha/field_test.js index dfc79803383..70970b9bfb3 100644 --- a/tests/mocha/field_test.js +++ b/tests/mocha/field_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { addBlockTypeToCleanup, addMessageToCleanup, @@ -13,7 +13,6 @@ import { sharedTestTeardown, workspaceTeardown, } from './test_helpers/setup_teardown.js'; -import {createDeprecationWarningStub} from './test_helpers/warnings.js'; suite('Abstract Fields', function () { setup(function () { diff --git a/tests/mocha/field_textinput_test.js b/tests/mocha/field_textinput_test.js index 7b0da1b4cca..3b755a54357 100644 --- a/tests/mocha/field_textinput_test.js +++ b/tests/mocha/field_textinput_test.js @@ -4,18 +4,18 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import { + createTestBlock, + defineRowBlock, +} from './test_helpers/block_definitions.js'; import { assertFieldValue, runConstructorSuiteTests, runFromJsonSuiteTests, runSetValueTests, } from './test_helpers/fields.js'; -import { - createTestBlock, - defineRowBlock, -} from './test_helpers/block_definitions.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/field_variable_test.js b/tests/mocha/field_variable_test.js index 63dd644c393..78dad10bac3 100644 --- a/tests/mocha/field_variable_test.js +++ b/tests/mocha/field_variable_test.js @@ -4,8 +4,12 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; +import { + createTestBlock, + defineRowBlock, +} from './test_helpers/block_definitions.js'; import { assertFieldValue, runConstructorSuiteTests, @@ -18,10 +22,6 @@ import { sharedTestTeardown, workspaceTeardown, } from './test_helpers/setup_teardown.js'; -import { - createTestBlock, - defineRowBlock, -} from './test_helpers/block_definitions.js'; suite('Variable Fields', function () { const FAKE_VARIABLE_NAME = 'default_name'; diff --git a/tests/mocha/flyout_test.js b/tests/mocha/flyout_test.js index 522efbdc6e4..9be45458c51 100644 --- a/tests/mocha/flyout_test.js +++ b/tests/mocha/flyout_test.js @@ -10,16 +10,8 @@ import { sharedTestTeardown, workspaceTeardown, } from './test_helpers/setup_teardown.js'; -import {defineStackBlock} from './test_helpers/block_definitions.js'; import { - getBasicToolbox, - getChildItem, - getCollapsibleItem, - getDeeplyNestedJSON, - getInjectedToolbox, - getNonCollapsibleItem, getProperSimpleJson, - getSeparator, getSimpleJson, getXmlArray, } from './test_helpers/toolbox_definitions.js'; diff --git a/tests/mocha/generator_test.js b/tests/mocha/generator_test.js index efaa924de66..527448eacc9 100644 --- a/tests/mocha/generator_test.js +++ b/tests/mocha/generator_test.js @@ -4,13 +4,13 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; import {DartGenerator} from '../../build/src/generators/dart/dart_generator.js'; import {JavascriptGenerator} from '../../build/src/generators/javascript/javascript_generator.js'; import {LuaGenerator} from '../../build/src/generators/lua/lua_generator.js'; import {PhpGenerator} from '../../build/src/generators/php/php_generator.js'; import {PythonGenerator} from '../../build/src/generators/python/python_generator.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/gesture_test.js b/tests/mocha/gesture_test.js index 122e96b8b4c..be807a54a45 100644 --- a/tests/mocha/gesture_test.js +++ b/tests/mocha/gesture_test.js @@ -4,15 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ +import * as eventUtils from '../../build/src/core/events/utils.js'; import {assert} from '../../node_modules/chai/chai.js'; -import {assertEventFired, assertEventNotFired} from './test_helpers/events.js'; import {defineBasicBlockWithField} from './test_helpers/block_definitions.js'; -import {dispatchPointerEvent} from './test_helpers/user_input.js'; -import * as eventUtils from '../../build/src/core/events/utils.js'; +import {assertEventFired, assertEventNotFired} from './test_helpers/events.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; +import {dispatchPointerEvent} from './test_helpers/user_input.js'; suite('Gesture', function () { function testGestureIsFieldClick(block, isFieldClick, eventsFireStub) { diff --git a/tests/mocha/icon_test.js b/tests/mocha/icon_test.js index dd5668b24c8..5855fcfc576 100644 --- a/tests/mocha/icon_test.js +++ b/tests/mocha/icon_test.js @@ -5,12 +5,12 @@ */ import {assert} from '../../node_modules/chai/chai.js'; +import {defineEmptyBlock} from './test_helpers/block_definitions.js'; +import {MockIcon, MockSerializableIcon} from './test_helpers/icon_mocks.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; -import {defineEmptyBlock} from './test_helpers/block_definitions.js'; -import {MockIcon, MockSerializableIcon} from './test_helpers/icon_mocks.js'; suite('Icon', function () { setup(function () { diff --git a/tests/mocha/insertion_marker_manager_test.js b/tests/mocha/insertion_marker_manager_test.js index e6992109fa7..3fae888df38 100644 --- a/tests/mocha/insertion_marker_manager_test.js +++ b/tests/mocha/insertion_marker_manager_test.js @@ -5,15 +5,15 @@ */ import {assert} from '../../node_modules/chai/chai.js'; -import { - sharedTestSetup, - sharedTestTeardown, -} from './test_helpers/setup_teardown.js'; import { defineRowBlock, defineRowToStackBlock, defineStackBlock, } from './test_helpers/block_definitions.js'; +import { + sharedTestSetup, + sharedTestTeardown, +} from './test_helpers/setup_teardown.js'; suite('Insertion marker manager', function () { setup(function () { diff --git a/tests/mocha/jso_deserialization_test.js b/tests/mocha/jso_deserialization_test.js index 7bd902a2307..432f0a8313b 100644 --- a/tests/mocha/jso_deserialization_test.js +++ b/tests/mocha/jso_deserialization_test.js @@ -4,18 +4,17 @@ * SPDX-License-Identifier: Apache-2.0 */ +import * as eventUtils from '../../build/src/core/events/utils.js'; import {assert} from '../../node_modules/chai/chai.js'; -import { - sharedTestSetup, - sharedTestTeardown, - workspaceTeardown, -} from './test_helpers/setup_teardown.js'; import {assertEventFired} from './test_helpers/events.js'; -import * as eventUtils from '../../build/src/core/events/utils.js'; import { MockParameterModel, MockProcedureModel, } from './test_helpers/procedures.js'; +import { + sharedTestSetup, + sharedTestTeardown, +} from './test_helpers/setup_teardown.js'; suite('JSO Deserialization', function () { setup(function () { diff --git a/tests/mocha/jso_serialization_test.js b/tests/mocha/jso_serialization_test.js index 8494dc3bcdd..7e68edb989b 100644 --- a/tests/mocha/jso_serialization_test.js +++ b/tests/mocha/jso_serialization_test.js @@ -4,14 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; -import { - createGenUidStubWithReturns, - sharedTestSetup, - sharedTestTeardown, - workspaceTeardown, -} from './test_helpers/setup_teardown.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { defineRowBlock, defineStackBlock, @@ -21,6 +15,12 @@ import { MockParameterModel, MockProcedureModel, } from './test_helpers/procedures.js'; +import { + createGenUidStubWithReturns, + sharedTestSetup, + sharedTestTeardown, + workspaceTeardown, +} from './test_helpers/setup_teardown.js'; suite('JSO Serialization', function () { setup(function () { diff --git a/tests/mocha/keydown_test.js b/tests/mocha/keydown_test.js index 077aff55efc..da8129b484a 100644 --- a/tests/mocha/keydown_test.js +++ b/tests/mocha/keydown_test.js @@ -5,12 +5,12 @@ */ import * as Blockly from '../../build/src/core/blockly.js'; -import {createKeyDownEvent} from './test_helpers/user_input.js'; import {defineStackBlock} from './test_helpers/block_definitions.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; +import {createKeyDownEvent} from './test_helpers/user_input.js'; suite('Key Down', function () { setup(function () { diff --git a/tests/mocha/mutator_test.js b/tests/mocha/mutator_test.js index 7fa47fd82a6..fb6d8caf09b 100644 --- a/tests/mocha/mutator_test.js +++ b/tests/mocha/mutator_test.js @@ -5,15 +5,15 @@ */ import {assert} from '../../node_modules/chai/chai.js'; -import { - sharedTestSetup, - sharedTestTeardown, -} from './test_helpers/setup_teardown.js'; import { createRenderedBlock, defineMutatorBlocks, } from './test_helpers/block_definitions.js'; import {assertEventFired, assertEventNotFired} from './test_helpers/events.js'; +import { + sharedTestSetup, + sharedTestTeardown, +} from './test_helpers/setup_teardown.js'; suite('Mutator', function () { setup(function () { diff --git a/tests/mocha/procedure_map_test.js b/tests/mocha/procedure_map_test.js index 69166fdb722..eebd5a9f326 100644 --- a/tests/mocha/procedure_map_test.js +++ b/tests/mocha/procedure_map_test.js @@ -5,16 +5,11 @@ */ import {assert} from '../../node_modules/chai/chai.js'; +import {MockProcedureModel} from './test_helpers/procedures.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; -import { - assertEventFiredShallow, - assertEventNotFired, - createChangeListenerSpy, -} from './test_helpers/events.js'; -import {MockProcedureModel} from './test_helpers/procedures.js'; suite('Procedure Map', function () { setup(function () { diff --git a/tests/mocha/registry_test.js b/tests/mocha/registry_test.js index c1bbf442a4c..6bcb8b5b077 100644 --- a/tests/mocha/registry_test.js +++ b/tests/mocha/registry_test.js @@ -5,11 +5,11 @@ */ import {assert} from '../../node_modules/chai/chai.js'; -import {assertWarnings} from './test_helpers/warnings.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; +import {assertWarnings} from './test_helpers/warnings.js'; suite('Registry', function () { const TestClass = function () {}; diff --git a/tests/mocha/serializer_test.js b/tests/mocha/serializer_test.js index 55760831128..0cc073e7b97 100644 --- a/tests/mocha/serializer_test.js +++ b/tests/mocha/serializer_test.js @@ -4,8 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../node_modules/chai/chai.js'; import * as Blockly from '../../build/src/core/blockly.js'; +import {assert} from '../../node_modules/chai/chai.js'; import { TestCase, TestSuite, diff --git a/tests/mocha/shortcut_registry_test.js b/tests/mocha/shortcut_registry_test.js index 4c64f1e693e..cfd98a302d2 100644 --- a/tests/mocha/shortcut_registry_test.js +++ b/tests/mocha/shortcut_registry_test.js @@ -5,11 +5,11 @@ */ import {assert} from '../../node_modules/chai/chai.js'; -import {createKeyDownEvent} from './test_helpers/user_input.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; +import {createKeyDownEvent} from './test_helpers/user_input.js'; suite('Keyboard Shortcut Registry Test', function () { setup(function () { diff --git a/tests/mocha/test_helpers/procedures.js b/tests/mocha/test_helpers/procedures.js index 82075ff279c..ecf8c13adcc 100644 --- a/tests/mocha/test_helpers/procedures.js +++ b/tests/mocha/test_helpers/procedures.js @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assert} from '../../../node_modules/chai/chai.js'; import {ConnectionType} from '../../../build/src/core/connection_type.js'; import {VariableModel} from '../../../build/src/core/variable_model.js'; +import {assert} from '../../../node_modules/chai/chai.js'; /** * Asserts that the procedure definition or call block has the expected var diff --git a/tests/mocha/test_helpers/workspace.js b/tests/mocha/test_helpers/workspace.js index e312e1188da..40b2574fca1 100644 --- a/tests/mocha/test_helpers/workspace.js +++ b/tests/mocha/test_helpers/workspace.js @@ -4,11 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ +import * as eventUtils from '../../../build/src/core/events/utils.js'; import {assert} from '../../../node_modules/chai/chai.js'; +import {workspaceTeardown} from './setup_teardown.js'; import {assertVariableValues} from './variables.js'; import {assertWarnings} from './warnings.js'; -import * as eventUtils from '../../../build/src/core/events/utils.js'; -import {workspaceTeardown} from './setup_teardown.js'; export function testAWorkspace() { setup(function () { diff --git a/tests/mocha/theme_test.js b/tests/mocha/theme_test.js index 57aec45a2f0..e94bc5e5022 100644 --- a/tests/mocha/theme_test.js +++ b/tests/mocha/theme_test.js @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +import * as eventUtils from '../../build/src/core/events/utils.js'; import {assert} from '../../node_modules/chai/chai.js'; import {assertEventFired} from './test_helpers/events.js'; -import * as eventUtils from '../../build/src/core/events/utils.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/mocha/trashcan_test.js b/tests/mocha/trashcan_test.js index 798f604ff48..7ba6240949b 100644 --- a/tests/mocha/trashcan_test.js +++ b/tests/mocha/trashcan_test.js @@ -4,12 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +import * as eventUtils from '../../build/src/core/events/utils.js'; import {assert} from '../../node_modules/chai/chai.js'; -import {assertEventFired, assertEventNotFired} from './test_helpers/events.js'; -import { - sharedTestSetup, - sharedTestTeardown, -} from './test_helpers/setup_teardown.js'; import { defineBasicBlockWithField, defineMutatorBlocks, @@ -17,7 +13,11 @@ import { defineStackBlock, defineStatementBlock, } from './test_helpers/block_definitions.js'; -import * as eventUtils from '../../build/src/core/events/utils.js'; +import {assertEventFired, assertEventNotFired} from './test_helpers/events.js'; +import { + sharedTestSetup, + sharedTestTeardown, +} from './test_helpers/setup_teardown.js'; import {simulateClick} from './test_helpers/user_input.js'; suite('Trashcan', function () { diff --git a/tests/mocha/variable_map_test.js b/tests/mocha/variable_map_test.js index c3d75e8a521..51f710c9921 100644 --- a/tests/mocha/variable_map_test.js +++ b/tests/mocha/variable_map_test.js @@ -5,17 +5,17 @@ */ import {assert} from '../../node_modules/chai/chai.js'; -import {assertVariableValues} from './test_helpers/variables.js'; -import { - createGenUidStubWithReturns, - sharedTestSetup, - sharedTestTeardown, -} from './test_helpers/setup_teardown.js'; import { assertEventFired, assertEventNotFired, createChangeListenerSpy, } from './test_helpers/events.js'; +import { + createGenUidStubWithReturns, + sharedTestSetup, + sharedTestTeardown, +} from './test_helpers/setup_teardown.js'; +import {assertVariableValues} from './test_helpers/variables.js'; suite('Variable Map', function () { setup(function () { diff --git a/tests/mocha/workspace_comment_test.js b/tests/mocha/workspace_comment_test.js index ece1819e434..6e3fa9607a0 100644 --- a/tests/mocha/workspace_comment_test.js +++ b/tests/mocha/workspace_comment_test.js @@ -4,14 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ +import { + assertEventFired, + createChangeListenerSpy, +} from './test_helpers/events.js'; import { sharedTestSetup, sharedTestTeardown, } from './test_helpers/setup_teardown.js'; -import { - createChangeListenerSpy, - assertEventFired, -} from './test_helpers/events.js'; suite('Workspace comment', function () { setup(function () { diff --git a/tests/mocha/workspace_svg_test.js b/tests/mocha/workspace_svg_test.js index 93f8f715806..7439ccc5d6d 100644 --- a/tests/mocha/workspace_svg_test.js +++ b/tests/mocha/workspace_svg_test.js @@ -4,19 +4,17 @@ * SPDX-License-Identifier: Apache-2.0 */ +import * as eventUtils from '../../build/src/core/events/utils.js'; import {assert} from '../../node_modules/chai/chai.js'; +import {defineStackBlock} from './test_helpers/block_definitions.js'; import { assertEventFired, assertEventNotFired, createChangeListenerSpy, } from './test_helpers/events.js'; -import {assertVariableValues} from './test_helpers/variables.js'; -import {defineStackBlock} from './test_helpers/block_definitions.js'; -import * as eventUtils from '../../build/src/core/events/utils.js'; import { sharedTestSetup, sharedTestTeardown, - workspaceTeardown, } from './test_helpers/setup_teardown.js'; import {testAWorkspace} from './test_helpers/workspace.js'; diff --git a/tests/mocha/workspace_test.js b/tests/mocha/workspace_test.js index 58829a77aae..a517d796c79 100644 --- a/tests/mocha/workspace_test.js +++ b/tests/mocha/workspace_test.js @@ -4,11 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -import {assertVariableValues} from './test_helpers/variables.js'; import { sharedTestSetup, sharedTestTeardown, - workspaceTeardown, } from './test_helpers/setup_teardown.js'; import {testAWorkspace} from './test_helpers/workspace.js'; diff --git a/tests/mocha/zoom_controls_test.js b/tests/mocha/zoom_controls_test.js index dce8acfe608..8751420c812 100644 --- a/tests/mocha/zoom_controls_test.js +++ b/tests/mocha/zoom_controls_test.js @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +import * as eventUtils from '../../build/src/core/events/utils.js'; import {assert} from '../../node_modules/chai/chai.js'; import {assertEventFired, assertEventNotFired} from './test_helpers/events.js'; -import * as eventUtils from '../../build/src/core/events/utils.js'; import { sharedTestSetup, sharedTestTeardown, diff --git a/tests/node/run_node_test.mjs b/tests/node/run_node_test.mjs index f7a01098f52..ee95fd5282f 100644 --- a/tests/node/run_node_test.mjs +++ b/tests/node/run_node_test.mjs @@ -22,9 +22,9 @@ console.log(process.cwd()); // copied when packaged), resulting in require() looking for the // compressed bundles in the wrong place. -import {assert} from 'chai'; import * as Blockly from 'blockly-test'; import {javascriptGenerator} from 'blockly-test/javascript'; +import {assert} from 'chai'; const xmlText = '\n' + diff --git a/tests/typescript/src/generators.ts b/tests/typescript/src/generators.ts index 61506e11a08..d1358335def 100644 --- a/tests/typescript/src/generators.ts +++ b/tests/typescript/src/generators.ts @@ -7,11 +7,11 @@ /* eslint-disable */ import * as Blockly from 'blockly-test/core'; +import {DartGenerator} from 'blockly-test/dart'; import {JavascriptGenerator} from 'blockly-test/javascript'; -import {PhpGenerator, phpGenerator, Order} from 'blockly-test/php'; import {LuaGenerator} from 'blockly-test/lua'; +import {Order, PhpGenerator, phpGenerator} from 'blockly-test/php'; import {PythonGenerator} from 'blockly-test/python'; -import {DartGenerator} from 'blockly-test/dart'; JavascriptGenerator; PhpGenerator; diff --git a/tests/typescript/src/generators/php.ts b/tests/typescript/src/generators/php.ts index cb9241b4374..5b66d3d71e2 100644 --- a/tests/typescript/src/generators/php.ts +++ b/tests/typescript/src/generators/php.ts @@ -10,7 +10,7 @@ import * as Blockly from 'blockly-test/core'; * Test: should be able to import a generator instance, class, and * Order enum. */ -import {phpGenerator, PhpGenerator, Order} from 'blockly-test/php'; +import {Order, phpGenerator, PhpGenerator} from 'blockly-test/php'; /** * Test: should be able to create a simple block generator function, diff --git a/tests/typescript/src/generators/python.ts b/tests/typescript/src/generators/python.ts index aa1c19c38d6..572e992e4c6 100644 --- a/tests/typescript/src/generators/python.ts +++ b/tests/typescript/src/generators/python.ts @@ -10,7 +10,7 @@ import * as Blockly from 'blockly-test/core'; * Test: should be able to import a generator instance, class, and * Order enum. */ -import {pythonGenerator, PythonGenerator, Order} from 'blockly-test/python'; +import {Order, pythonGenerator, PythonGenerator} from 'blockly-test/python'; /** * Test: should be able to create a simple block generator function,