feat(viewer): add Vue-based HUD, ops strip, and history window
This commit is contained in:
@@ -9,10 +9,10 @@ import {
|
||||
refreshHistoryWindows,
|
||||
updateHistoryWindowDrag,
|
||||
} from "./viewerHistoryManager";
|
||||
import type { HistoryWindowState, Selectable, WorldState } from "./viewerTypes";
|
||||
import type { HistoryWindowState } from "./viewerHudState";
|
||||
import type { Selectable, WorldState } from "./viewerTypes";
|
||||
|
||||
export interface ViewerHistoryWindowContext {
|
||||
historyLayerEl: HTMLDivElement;
|
||||
historyWindows: HistoryWindowState[];
|
||||
getWorld: () => WorldState | undefined;
|
||||
getHistoryWindowCounter: () => number;
|
||||
@@ -33,7 +33,6 @@ export class ViewerHistoryWindowController {
|
||||
openHistoryWindow(target: Selectable) {
|
||||
const nextCounter = openHistoryWindow(
|
||||
this.context.historyWindows,
|
||||
this.context.historyLayerEl,
|
||||
target,
|
||||
this.context.getHistoryWindowCounter() + 1,
|
||||
(windowState) => this.bringHistoryWindowToFront(windowState),
|
||||
@@ -155,14 +154,14 @@ export class ViewerHistoryWindowController {
|
||||
|
||||
try {
|
||||
await copyTextToClipboard(windowState.text);
|
||||
windowState.copyButtonEl.textContent = "Copied";
|
||||
windowState.copyLabel = "Copied";
|
||||
window.setTimeout(() => {
|
||||
windowState.copyButtonEl.textContent = "Copy";
|
||||
windowState.copyLabel = "Copy";
|
||||
}, 1200);
|
||||
} catch {
|
||||
windowState.copyButtonEl.textContent = "Failed";
|
||||
windowState.copyLabel = "Failed";
|
||||
window.setTimeout(() => {
|
||||
windowState.copyButtonEl.textContent = "Copy";
|
||||
windowState.copyLabel = "Copy";
|
||||
}, 1200);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user