refactor: asset viewer (#25059)

This commit is contained in:
Jason Rasmussen
2026-01-05 16:02:01 -05:00
committed by GitHub
parent 9d4a12dfd4
commit 984f06ac40
10 changed files with 104 additions and 108 deletions
@@ -0,0 +1,43 @@
import { PersistedLocalStorage } from '$lib/utils/persisted';
const isShowDetailPanel = new PersistedLocalStorage<boolean>('asset-viewer-state', false);
export class AssetViewerManager {
#isShowActivityPanel = $state(false);
get isShowActivityPanel() {
return this.#isShowActivityPanel;
}
private set isShowActivityPanel(value: boolean) {
this.#isShowActivityPanel = value;
}
get isShowDetailPanel() {
return isShowDetailPanel.current;
}
private set isShowDetailPanel(value: boolean) {
isShowDetailPanel.current = value;
}
toggleActivityPanel() {
this.closeDetailPanel();
this.isShowActivityPanel = !this.isShowActivityPanel;
}
closeActivityPanel() {
this.isShowActivityPanel = false;
}
toggleDetailPanel() {
this.closeActivityPanel();
this.isShowDetailPanel = !this.isShowDetailPanel;
}
closeDetailPanel() {
this.isShowDetailPanel = false;
}
}
export const assetViewerManager = new AssetViewerManager();