From 4d127a038bf768eded68aae3cfa5c1b12241bdac Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Fri, 27 Mar 2026 00:55:15 +0100 Subject: chore: normalize line endings --- apps/web/src/core/managers/selection-manager.ts | 146 ++++++++++++------------ 1 file changed, 73 insertions(+), 73 deletions(-) (limited to 'apps/web/src/core/managers/selection-manager.ts') diff --git a/apps/web/src/core/managers/selection-manager.ts b/apps/web/src/core/managers/selection-manager.ts index 2062cfb0..9bafc6d7 100644 --- a/apps/web/src/core/managers/selection-manager.ts +++ b/apps/web/src/core/managers/selection-manager.ts @@ -1,73 +1,73 @@ -import type { EditorCore } from "@/core"; -import type { SelectedKeyframeRef } from "@/lib/animation/types"; -import type { ElementRef } from "@/lib/timeline/types"; - -export class SelectionManager { - private selectedElements: ElementRef[] = []; - private selectedKeyframes: SelectedKeyframeRef[] = []; - private keyframeSelectionAnchor: SelectedKeyframeRef | null = null; - private listeners = new Set<() => void>(); - - constructor(editor: EditorCore) { - void editor; - } - - getSelectedElements(): ElementRef[] { - return this.selectedElements; - } - - getSelectedKeyframes(): SelectedKeyframeRef[] { - return this.selectedKeyframes; - } - - getKeyframeSelectionAnchor(): SelectedKeyframeRef | null { - return this.keyframeSelectionAnchor; - } - - setSelectedElements({ elements }: { elements: ElementRef[] }): void { - this.selectedElements = elements; - this.selectedKeyframes = []; - this.keyframeSelectionAnchor = null; - this.notify(); - } - - setSelectedKeyframes({ - keyframes, - anchorKeyframe, - }: { - keyframes: SelectedKeyframeRef[]; - anchorKeyframe?: SelectedKeyframeRef | null; - }): void { - this.selectedKeyframes = keyframes; - if (anchorKeyframe !== undefined) { - this.keyframeSelectionAnchor = anchorKeyframe; - } else if (keyframes.length === 0) { - this.keyframeSelectionAnchor = null; - } - this.notify(); - } - - clearSelection(): void { - this.selectedElements = []; - this.selectedKeyframes = []; - this.keyframeSelectionAnchor = null; - this.notify(); - } - - clearKeyframeSelection(): void { - this.selectedKeyframes = []; - this.keyframeSelectionAnchor = null; - this.notify(); - } - - subscribe(listener: () => void): () => void { - this.listeners.add(listener); - return () => this.listeners.delete(listener); - } - - private notify(): void { - this.listeners.forEach((fn) => { - fn(); - }); - } -} +import type { EditorCore } from "@/core"; +import type { SelectedKeyframeRef } from "@/lib/animation/types"; +import type { ElementRef } from "@/lib/timeline/types"; + +export class SelectionManager { + private selectedElements: ElementRef[] = []; + private selectedKeyframes: SelectedKeyframeRef[] = []; + private keyframeSelectionAnchor: SelectedKeyframeRef | null = null; + private listeners = new Set<() => void>(); + + constructor(editor: EditorCore) { + void editor; + } + + getSelectedElements(): ElementRef[] { + return this.selectedElements; + } + + getSelectedKeyframes(): SelectedKeyframeRef[] { + return this.selectedKeyframes; + } + + getKeyframeSelectionAnchor(): SelectedKeyframeRef | null { + return this.keyframeSelectionAnchor; + } + + setSelectedElements({ elements }: { elements: ElementRef[] }): void { + this.selectedElements = elements; + this.selectedKeyframes = []; + this.keyframeSelectionAnchor = null; + this.notify(); + } + + setSelectedKeyframes({ + keyframes, + anchorKeyframe, + }: { + keyframes: SelectedKeyframeRef[]; + anchorKeyframe?: SelectedKeyframeRef | null; + }): void { + this.selectedKeyframes = keyframes; + if (anchorKeyframe !== undefined) { + this.keyframeSelectionAnchor = anchorKeyframe; + } else if (keyframes.length === 0) { + this.keyframeSelectionAnchor = null; + } + this.notify(); + } + + clearSelection(): void { + this.selectedElements = []; + this.selectedKeyframes = []; + this.keyframeSelectionAnchor = null; + this.notify(); + } + + clearKeyframeSelection(): void { + this.selectedKeyframes = []; + this.keyframeSelectionAnchor = null; + this.notify(); + } + + subscribe(listener: () => void): () => void { + this.listeners.add(listener); + return () => this.listeners.delete(listener); + } + + private notify(): void { + this.listeners.forEach((fn) => { + fn(); + }); + } +} -- cgit v1.3.1