mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
chore(deps): Bump prettier from 2.8.8 to 3.0.0 (#7322)
* chore(deps): Bump prettier from 2.8.8 to 3.0.0 Bumps [prettier](https://github.com/prettier/prettier) from 2.8.8 to 3.0.0. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.8...3.0.0) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * chore: Reformat using Prettier v3.0 defaults The main change is to add trailing commas to the last line of block-formatted function calls. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Christopher Allen <cpcallen+git@google.com>
This commit is contained in:
@@ -323,7 +323,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
const MetricsManagerClass = registry.getClassFromOptions(
|
||||
registry.Type.METRICS_MANAGER,
|
||||
options,
|
||||
true
|
||||
true,
|
||||
);
|
||||
/** Object in charge of calculating metrics for the workspace. */
|
||||
this.metricsManager = new MetricsManagerClass!(this);
|
||||
@@ -345,7 +345,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* Object in charge of loading, storing, and playing audio for a workspace.
|
||||
*/
|
||||
this.audioManager = new WorkspaceAudio(
|
||||
options.parentWorkspace as WorkspaceSvg
|
||||
options.parentWorkspace as WorkspaceSvg,
|
||||
);
|
||||
|
||||
/** This workspace's grid object or null. */
|
||||
@@ -359,21 +359,21 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
if (Variables && Variables.flyoutCategory) {
|
||||
this.registerToolboxCategoryCallback(
|
||||
Variables.CATEGORY_NAME,
|
||||
Variables.flyoutCategory
|
||||
Variables.flyoutCategory,
|
||||
);
|
||||
}
|
||||
|
||||
if (VariablesDynamic && VariablesDynamic.flyoutCategory) {
|
||||
this.registerToolboxCategoryCallback(
|
||||
VariablesDynamic.CATEGORY_NAME,
|
||||
VariablesDynamic.flyoutCategory
|
||||
VariablesDynamic.flyoutCategory,
|
||||
);
|
||||
}
|
||||
|
||||
if (Procedures && Procedures.flyoutCategory) {
|
||||
this.registerToolboxCategoryCallback(
|
||||
Procedures.CATEGORY_NAME,
|
||||
Procedures.flyoutCategory
|
||||
Procedures.flyoutCategory,
|
||||
);
|
||||
this.addChangeListener(Procedures.mutatorOpenListener);
|
||||
}
|
||||
@@ -388,7 +388,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
this.renderer = blockRendering.init(
|
||||
this.options.renderer || 'geras',
|
||||
this.getTheme(),
|
||||
this.options.rendererOverrides ?? undefined
|
||||
this.options.rendererOverrides ?? undefined,
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -538,7 +538,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
this.updateBlockStyles_(
|
||||
this.getAllBlocks(false).filter(function (block) {
|
||||
return !!block.getStyleName();
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Update current toolbox selection.
|
||||
@@ -554,7 +554,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
|
||||
const event = new (eventUtils.get(eventUtils.THEME_CHANGE))(
|
||||
this.getTheme().name,
|
||||
this.id
|
||||
this.id,
|
||||
);
|
||||
eventUtils.fire(event);
|
||||
}
|
||||
@@ -736,7 +736,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
this.svgBackground_ = dom.createSvgElement(
|
||||
Svg.RECT,
|
||||
{'height': '100%', 'width': '100%', 'class': opt_backgroundClass},
|
||||
this.svgGroup_
|
||||
this.svgGroup_,
|
||||
);
|
||||
|
||||
if (opt_backgroundClass === 'blocklyMainBackground' && this.grid) {
|
||||
@@ -746,19 +746,19 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
this.themeManager_.subscribe(
|
||||
this.svgBackground_,
|
||||
'workspaceBackgroundColour',
|
||||
'fill'
|
||||
'fill',
|
||||
);
|
||||
}
|
||||
}
|
||||
this.svgBlockCanvas_ = dom.createSvgElement(
|
||||
Svg.G,
|
||||
{'class': 'blocklyBlockCanvas'},
|
||||
this.svgGroup_
|
||||
this.svgGroup_,
|
||||
);
|
||||
this.svgBubbleCanvas_ = dom.createSvgElement(
|
||||
Svg.G,
|
||||
{'class': 'blocklyBubbleCanvas'},
|
||||
this.svgGroup_
|
||||
this.svgGroup_,
|
||||
);
|
||||
|
||||
if (!this.isFlyout) {
|
||||
@@ -767,7 +767,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
'pointerdown',
|
||||
this,
|
||||
this.onMouseDown_,
|
||||
false
|
||||
false,
|
||||
);
|
||||
// This no-op works around https://bugs.webkit.org/show_bug.cgi?id=226683,
|
||||
// which otherwise prevents zoom/scroll events from being observed in
|
||||
@@ -777,7 +777,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
this.svgGroup_,
|
||||
'wheel',
|
||||
this,
|
||||
this.onMouseWheel_
|
||||
this.onMouseWheel_,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -787,7 +787,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
const ToolboxClass = registry.getClassFromOptions(
|
||||
registry.Type.TOOLBOX,
|
||||
this.options,
|
||||
true
|
||||
true,
|
||||
);
|
||||
this.toolbox_ = new ToolboxClass!(this);
|
||||
}
|
||||
@@ -797,7 +797,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
this.recordDragTargets();
|
||||
const CursorClass = registry.getClassFromOptions(
|
||||
registry.Type.CURSOR,
|
||||
this.options
|
||||
this.options,
|
||||
);
|
||||
|
||||
CursorClass && this.markerManager.setCursor(new CursorClass());
|
||||
@@ -901,7 +901,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
static newTrashcan(_workspace: WorkspaceSvg): Trashcan {
|
||||
throw new Error(
|
||||
'The implementation of newTrashcan should be ' +
|
||||
'monkey-patched in by blockly.ts'
|
||||
'monkey-patched in by blockly.ts',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -940,14 +940,14 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
const HorizontalFlyout = registry.getClassFromOptions(
|
||||
registry.Type.FLYOUTS_HORIZONTAL_TOOLBOX,
|
||||
this.options,
|
||||
true
|
||||
true,
|
||||
);
|
||||
this.flyout = new HorizontalFlyout!(workspaceOptions);
|
||||
} else {
|
||||
const VerticalFlyout = registry.getClassFromOptions(
|
||||
registry.Type.FLYOUTS_VERTICAL_TOOLBOX,
|
||||
this.options,
|
||||
true
|
||||
true,
|
||||
);
|
||||
this.flyout = new VerticalFlyout!(workspaceOptions);
|
||||
}
|
||||
@@ -1030,7 +1030,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
|
||||
const positionables = this.componentManager.getComponents(
|
||||
ComponentManager.Capability.POSITIONABLE,
|
||||
true
|
||||
true,
|
||||
);
|
||||
const metrics = this.getMetricsManager().getUiMetrics();
|
||||
const savedPositions = [];
|
||||
@@ -1154,7 +1154,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
left,
|
||||
scale,
|
||||
this.id,
|
||||
this.oldScale
|
||||
this.oldScale,
|
||||
);
|
||||
this.oldScale = scale;
|
||||
this.oldTop = top;
|
||||
@@ -1299,7 +1299,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* @returns The pasted thing, or null if the paste was not successful.
|
||||
*/
|
||||
paste(
|
||||
state: AnyDuringMigration | Element | DocumentFragment
|
||||
state: AnyDuringMigration | Element | DocumentFragment,
|
||||
): ICopyable | null {
|
||||
if (!this.rendered || (!state['type'] && !state['tagName'])) {
|
||||
return null;
|
||||
@@ -1341,7 +1341,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
*/
|
||||
private pasteBlock_(
|
||||
xmlBlock: Element | null,
|
||||
jsonBlock: blocks.State | null
|
||||
jsonBlock: blocks.State | null,
|
||||
): BlockSvg {
|
||||
eventUtils.disable();
|
||||
let block: BlockSvg;
|
||||
@@ -1388,7 +1388,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
for (let i = 0, connection; (connection = connections[i]); i++) {
|
||||
const neighbour = connection.closest(
|
||||
config.snapRadius,
|
||||
new Coordinate(blockX, blockY)
|
||||
new Coordinate(blockX, blockY),
|
||||
);
|
||||
if (neighbour.connection) {
|
||||
collide = true;
|
||||
@@ -1502,7 +1502,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
override createVariable(
|
||||
name: string,
|
||||
opt_type?: string | null,
|
||||
opt_id?: string | null
|
||||
opt_id?: string | null,
|
||||
): VariableModel {
|
||||
const newVar = super.createVariable(name, opt_type, opt_id);
|
||||
this.refreshToolboxSelection();
|
||||
@@ -1513,7 +1513,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
recordDragTargets() {
|
||||
const dragTargets = this.componentManager.getComponents(
|
||||
ComponentManager.Capability.DRAG_TARGET,
|
||||
true
|
||||
true,
|
||||
);
|
||||
|
||||
this.dragTargetAreas = [];
|
||||
@@ -1541,7 +1541,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
override newBlock(prototypeName: string, opt_id?: string): BlockSvg {
|
||||
throw new Error(
|
||||
'The implementation of newBlock should be ' +
|
||||
'monkey-patched in by blockly.ts'
|
||||
'monkey-patched in by blockly.ts',
|
||||
);
|
||||
}
|
||||
/* eslint-enable */
|
||||
@@ -1585,7 +1585,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
const point = browserEvents.mouseToSvg(
|
||||
e,
|
||||
this.getParentSvg(),
|
||||
this.getInverseScreenCTM()
|
||||
this.getInverseScreenCTM(),
|
||||
);
|
||||
// Fix scale of mouse event.
|
||||
point.x /= this.scale;
|
||||
@@ -1603,7 +1603,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
const point = browserEvents.mouseToSvg(
|
||||
e,
|
||||
this.getParentSvg(),
|
||||
this.getInverseScreenCTM()
|
||||
this.getInverseScreenCTM(),
|
||||
);
|
||||
// Fix scale of mouse event.
|
||||
point.x /= this.scale;
|
||||
@@ -1716,7 +1716,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
const position = browserEvents.mouseToSvg(
|
||||
e,
|
||||
this.getParentSvg(),
|
||||
this.getInverseScreenCTM()
|
||||
this.getInverseScreenCTM(),
|
||||
);
|
||||
this.zoom(position.x, position.y, delta);
|
||||
} else {
|
||||
@@ -1813,7 +1813,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
}
|
||||
const menuOptions = ContextMenuRegistry.registry.getContextMenuOptions(
|
||||
ContextMenuRegistry.ScopeType.WORKSPACE,
|
||||
{workspace: this}
|
||||
{workspace: this},
|
||||
);
|
||||
|
||||
// Allow the developer to add or modify menuOptions.
|
||||
@@ -1955,7 +1955,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
if (!this.isMovable()) {
|
||||
console.warn(
|
||||
'Tried to move a non-movable workspace. This could result' +
|
||||
' in blocks becoming inaccessible.'
|
||||
' in blocks becoming inaccessible.',
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -2025,7 +2025,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
if (!this.isMovable()) {
|
||||
console.warn(
|
||||
'Tried to move a non-movable workspace. This could result' +
|
||||
' in blocks becoming inaccessible.'
|
||||
' in blocks becoming inaccessible.',
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -2052,7 +2052,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
if (!this.isMovable()) {
|
||||
console.warn(
|
||||
'Tried to move a non-movable workspace. This could result' +
|
||||
' in blocks becoming inaccessible.'
|
||||
' in blocks becoming inaccessible.',
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -2187,12 +2187,12 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
y = Math.min(y, -metrics.scrollTop);
|
||||
const maxXDisplacement = Math.max(
|
||||
0,
|
||||
metrics.scrollWidth - metrics.viewWidth
|
||||
metrics.scrollWidth - metrics.viewWidth,
|
||||
);
|
||||
const maxXScroll = metrics.scrollLeft + maxXDisplacement;
|
||||
const maxYDisplacement = Math.max(
|
||||
0,
|
||||
metrics.scrollHeight - metrics.viewHeight
|
||||
metrics.scrollHeight - metrics.viewHeight,
|
||||
);
|
||||
const maxYScroll = metrics.scrollTop + maxYDisplacement;
|
||||
x = Math.max(x, -maxXScroll);
|
||||
@@ -2210,7 +2210,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
this.scrollbar.set(
|
||||
-(x + metrics.scrollLeft),
|
||||
-(y + metrics.scrollTop),
|
||||
false
|
||||
false,
|
||||
);
|
||||
}
|
||||
// We have to shift the translation so that when the canvas is at 0, 0 the
|
||||
@@ -2400,7 +2400,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
*/
|
||||
registerToolboxCategoryCallback(
|
||||
key: string,
|
||||
func: (p1: WorkspaceSvg) => toolbox.FlyoutDefinition
|
||||
func: (p1: WorkspaceSvg) => toolbox.FlyoutDefinition,
|
||||
) {
|
||||
if (typeof func !== 'function') {
|
||||
throw TypeError('Toolbox category callbacks must be functions.');
|
||||
@@ -2417,7 +2417,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
* null if no function is registered.
|
||||
*/
|
||||
getToolboxCategoryCallback(
|
||||
key: string
|
||||
key: string,
|
||||
): ((p1: WorkspaceSvg) => toolbox.FlyoutDefinition) | null {
|
||||
return this.toolboxCategoryCallbacks.get(key) || null;
|
||||
}
|
||||
@@ -2528,10 +2528,10 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
hideComponents(onlyClosePopups = false) {
|
||||
const autoHideables = this.getComponentManager().getComponents(
|
||||
ComponentManager.Capability.AUTOHIDEABLE,
|
||||
true
|
||||
true,
|
||||
);
|
||||
autoHideables.forEach((autoHideable) =>
|
||||
autoHideable.autoHide(onlyClosePopups)
|
||||
autoHideable.autoHide(onlyClosePopups),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2543,7 +2543,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
|
||||
*/
|
||||
private static setTopLevelWorkspaceMetrics_(
|
||||
this: WorkspaceSvg,
|
||||
xyRatio: {x?: number; y?: number}
|
||||
xyRatio: {x?: number; y?: number},
|
||||
) {
|
||||
const metrics = this.getMetrics();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user