Add favicon and update configuration files
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
<title>WebEditor3D</title>
|
<title>WebEditor3D</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { defineConfig, devices } from "@playwright/test";
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
testDir: "./tests/e2e",
|
testDir: "./tests/e2e",
|
||||||
|
testMatch: ["**/*.e2e.ts"],
|
||||||
timeout: 30_000,
|
timeout: 30_000,
|
||||||
expect: {
|
expect: {
|
||||||
timeout: 5_000
|
timeout: 5_000
|
||||||
|
|||||||
6
public/favicon.svg
Normal file
6
public/favicon.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||||
|
<rect width="64" height="64" rx="14" fill="#181d24" />
|
||||||
|
<path d="M14 20 32 12l18 8v24l-18 8-18-8Z" fill="#cf7b42" />
|
||||||
|
<path d="M32 12v40" stroke="#181d24" stroke-width="4" />
|
||||||
|
<path d="M14 20l18 8 18-8" stroke="#181d24" stroke-width="4" fill="none" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 325 B |
@@ -37,6 +37,7 @@ export class EditorStore {
|
|||||||
private readonly storage: KeyValueStorage | null;
|
private readonly storage: KeyValueStorage | null;
|
||||||
private readonly storageKey: string;
|
private readonly storageKey: string;
|
||||||
private lastCommandLabel: string | null = null;
|
private lastCommandLabel: string | null = null;
|
||||||
|
private snapshot: EditorStoreState;
|
||||||
|
|
||||||
private readonly commandContext: CommandContext = {
|
private readonly commandContext: CommandContext = {
|
||||||
getDocument: () => this.document,
|
getDocument: () => this.document,
|
||||||
@@ -57,6 +58,7 @@ export class EditorStore {
|
|||||||
this.document = options.initialDocument ?? createEmptySceneDocument();
|
this.document = options.initialDocument ?? createEmptySceneDocument();
|
||||||
this.storage = options.storage ?? null;
|
this.storage = options.storage ?? null;
|
||||||
this.storageKey = options.storageKey ?? DEFAULT_SCENE_DRAFT_STORAGE_KEY;
|
this.storageKey = options.storageKey ?? DEFAULT_SCENE_DRAFT_STORAGE_KEY;
|
||||||
|
this.snapshot = this.createSnapshot();
|
||||||
}
|
}
|
||||||
|
|
||||||
subscribe = (listener: EditorStoreListener) => {
|
subscribe = (listener: EditorStoreListener) => {
|
||||||
@@ -67,14 +69,7 @@ export class EditorStore {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
getState = (): EditorStoreState => ({
|
getState = (): EditorStoreState => this.snapshot;
|
||||||
document: this.document,
|
|
||||||
selection: this.selection,
|
|
||||||
toolMode: this.toolMode,
|
|
||||||
canUndo: this.history.canUndo(),
|
|
||||||
canRedo: this.history.canRedo(),
|
|
||||||
lastCommandLabel: this.lastCommandLabel
|
|
||||||
});
|
|
||||||
|
|
||||||
setToolMode(toolMode: ToolMode) {
|
setToolMode(toolMode: ToolMode) {
|
||||||
if (this.toolMode === toolMode) {
|
if (this.toolMode === toolMode) {
|
||||||
@@ -168,10 +163,23 @@ export class EditorStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private emit() {
|
private emit() {
|
||||||
|
this.snapshot = this.createSnapshot();
|
||||||
|
|
||||||
for (const listener of this.listeners) {
|
for (const listener of this.listeners) {
|
||||||
listener();
|
listener();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private createSnapshot(): EditorStoreState {
|
||||||
|
return {
|
||||||
|
document: this.document,
|
||||||
|
selection: this.selection,
|
||||||
|
toolMode: this.toolMode,
|
||||||
|
canUndo: this.history.canUndo(),
|
||||||
|
canRedo: this.history.canRedo(),
|
||||||
|
lastCommandLabel: this.lastCommandLabel
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createEditorStore(options?: EditorStoreOptions): EditorStore {
|
export function createEditorStore(options?: EditorStoreOptions): EditorStore {
|
||||||
|
|||||||
Reference in New Issue
Block a user