summaryrefslogtreecommitdiff
path: root/apps/web/src/core
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2026-04-29 00:37:56 +0200
committerMaze Winther <mazewinther@gmail.com>2026-05-02 03:27:23 +0200
commita9b9cf6bf50f08723896659634f2e6afc17bcd42 (patch)
tree9175b49ff21f4326872ac9e541d2765cc7994ebc /apps/web/src/core
parentd6622dc6b3523a5658cd512b44f15f7a66fd540c (diff)
downloadopencut-a9b9cf6bf50f08723896659634f2e6afc17bcd42.tar.gz
chore: switch from biome to eslint + prettier; fix ton of lint issues
Diffstat (limited to 'apps/web/src/core')
-rw-r--r--apps/web/src/core/index.ts2
-rw-r--r--apps/web/src/core/managers/media-manager.ts12
-rw-r--r--apps/web/src/core/managers/save-manager.ts13
-rw-r--r--apps/web/src/core/managers/scenes-manager.ts11
-rw-r--r--apps/web/src/core/managers/timeline-manager.ts7
5 files changed, 32 insertions, 13 deletions
diff --git a/apps/web/src/core/index.ts b/apps/web/src/core/index.ts
index 3e55e1d6..0977666f 100644
--- a/apps/web/src/core/index.ts
+++ b/apps/web/src/core/index.ts
@@ -39,7 +39,7 @@ export class EditorCore {
this.project = new ProjectManager(this);
this.media = new MediaManager(this);
this.renderer = new RendererManager(this);
- this.save = new SaveManager(this);
+ this.save = new SaveManager({ editor: this });
this.audio = new AudioManager(this);
this.selection = new SelectionManager(this);
this.clipboard = new ClipboardManager(this);
diff --git a/apps/web/src/core/managers/media-manager.ts b/apps/web/src/core/managers/media-manager.ts
index 553d1557..69da6e80 100644
--- a/apps/web/src/core/managers/media-manager.ts
+++ b/apps/web/src/core/managers/media-manager.ts
@@ -68,9 +68,17 @@ export class MediaManager {
const command =
uniqueIds.length === 1
- ? new RemoveMediaAssetCommand(projectId, uniqueIds[0])
+ ? new RemoveMediaAssetCommand({
+ projectId,
+ assetId: uniqueIds[0],
+ })
: new BatchCommand(
- uniqueIds.map((id) => new RemoveMediaAssetCommand(projectId, id)),
+ uniqueIds.map((id) =>
+ new RemoveMediaAssetCommand({
+ projectId,
+ assetId: id,
+ }),
+ ),
);
this.editor.command.execute({ command });
diff --git a/apps/web/src/core/managers/save-manager.ts b/apps/web/src/core/managers/save-manager.ts
index b3c894d4..8cb2275a 100644
--- a/apps/web/src/core/managers/save-manager.ts
+++ b/apps/web/src/core/managers/save-manager.ts
@@ -12,13 +12,18 @@ export class SaveManager {
private saveTimer: ReturnType<typeof setTimeout> | null = null;
private unsubscribeHandlers: Array<() => void> = [];
- constructor(
- private editor: EditorCore,
- { debounceMs = 800 }: SaveManagerOptions = {},
- ) {
+ constructor({
+ editor,
+ debounceMs = 800,
+ }: {
+ editor: EditorCore;
+ } & SaveManagerOptions) {
+ this.editor = editor;
this.debounceMs = debounceMs;
}
+ private editor: EditorCore;
+
start(): void {
if (this.unsubscribeHandlers.length > 0) return;
diff --git a/apps/web/src/core/managers/scenes-manager.ts b/apps/web/src/core/managers/scenes-manager.ts
index c9558a6d..a4c364ce 100644
--- a/apps/web/src/core/managers/scenes-manager.ts
+++ b/apps/web/src/core/managers/scenes-manager.ts
@@ -41,7 +41,7 @@ export class ScenesManager {
throw new Error("No active project");
}
- const command = new CreateSceneCommand(name, isMain);
+ const command = new CreateSceneCommand({ name, isMain });
this.editor.command.execute({ command });
return command.getSceneId();
}
@@ -77,7 +77,10 @@ export class ScenesManager {
throw new Error("No active project");
}
- const command = new RenameSceneCommand(sceneId, name);
+ const command = new RenameSceneCommand({
+ sceneId,
+ newName: name,
+ });
this.editor.command.execute({ command });
}
@@ -138,7 +141,7 @@ export class ScenesManager {
time: MediaTime;
updates: Partial<Omit<Bookmark, "time">>;
}): Promise<void> {
- const command = new UpdateBookmarkCommand(time, updates);
+ const command = new UpdateBookmarkCommand({ time, updates });
this.editor.command.execute({ command });
}
@@ -149,7 +152,7 @@ export class ScenesManager {
fromTime: MediaTime;
toTime: MediaTime;
}): Promise<void> {
- const command = new MoveBookmarkCommand(fromTime, toTime);
+ const command = new MoveBookmarkCommand({ fromTime, toTime });
this.editor.command.execute({ command });
}
diff --git a/apps/web/src/core/managers/timeline-manager.ts b/apps/web/src/core/managers/timeline-manager.ts
index 8fbfdb08..91a4eeef 100644
--- a/apps/web/src/core/managers/timeline-manager.ts
+++ b/apps/web/src/core/managers/timeline-manager.ts
@@ -73,7 +73,7 @@ export class TimelineManager {
constructor(private editor: EditorCore) {}
addTrack({ type, index }: { type: TrackType; index?: number }): string {
- const command = new AddTrackCommand(type, index);
+ const command = new AddTrackCommand({ type, index });
this.editor.command.execute({ command });
return command.getTrackId();
}
@@ -751,7 +751,10 @@ export class TimelineManager {
}
const afterTracks =
this.previewTracks ?? this.applyPreviewOverlay(committedTracks);
- const command = new TracksSnapshotCommand(committedTracks, afterTracks);
+ const command = new TracksSnapshotCommand({
+ before: committedTracks,
+ after: afterTracks,
+ });
this.editor.command.push({ command });
this.previewOverlay.clear();
this.previewTracks = null;