@arronqzy/vue-view 0.1.23 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -3
- package/package.json +7 -7
- package/src/index.ts +53 -1
- package/src/panel/VueViewOnlinePreview.vue +25 -0
- package/src/panel/VueViewPanel.vue +62 -2
- package/src/panel/hooks/useWorkspaceProjects.ts +209 -67
- package/src/panel/library/abuilder-storage.ts +168 -0
- package/src/panel/library/abuilder-view-handle.ts +100 -0
- package/src/panel/library/blueprint-library-sync.ts +22 -0
- package/src/panel/library/capture-preview-snapshot.ts +800 -0
- package/src/panel/library/event-subscription.ts +79 -5
- package/src/panel/library/preview-snapshot.ts +252 -0
- package/src/panel/library/workspace-project-sync.ts +7 -1
- package/src/panel/library/workspace-storage.ts +70 -3
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { appStorageKey } from "@arronqzy/blueprint-dsl";
|
|
2
|
+
|
|
3
|
+
const CHANNEL = "arronqzy-blueprint-library-changed";
|
|
4
|
+
|
|
5
|
+
export function broadcastBlueprintLibraryChanged(nameSpace?: string | null): void {
|
|
6
|
+
if (typeof BroadcastChannel === "undefined") return;
|
|
7
|
+
const channel = new BroadcastChannel(appStorageKey(CHANNEL, nameSpace));
|
|
8
|
+
channel.postMessage({ type: "changed" });
|
|
9
|
+
channel.close();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function subscribeBlueprintLibraryChanged(
|
|
13
|
+
onChange: () => void,
|
|
14
|
+
nameSpace?: string | null
|
|
15
|
+
): () => void {
|
|
16
|
+
if (typeof BroadcastChannel === "undefined") {
|
|
17
|
+
return () => {};
|
|
18
|
+
}
|
|
19
|
+
const channel = new BroadcastChannel(appStorageKey(CHANNEL, nameSpace));
|
|
20
|
+
channel.onmessage = () => onChange();
|
|
21
|
+
return () => channel.close();
|
|
22
|
+
}
|