0.4.0 convex及界面修改
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
export const ASSETS_CHANGED_EVENT = "wolai:assets-changed";
|
||||
export const DOCUMENTS_CHANGED_EVENT = "wolai:documents-changed";
|
||||
export const ASSETS_RESTORED_EVENT = "wolai:assets-restored";
|
||||
|
||||
type AssetsChangedPayload = {
|
||||
docId?: string;
|
||||
@@ -12,6 +13,11 @@ type AssetsChangedPayload = {
|
||||
mindmapAssetIds?: string[];
|
||||
};
|
||||
|
||||
type AssetsRestoredPayload =
|
||||
| { docId: string; kind: "media"; assetId: string; asset?: unknown }
|
||||
| { docId: string; kind: "mindmap"; mindmapId: string }
|
||||
| { docId: string; kind: "table"; tableId: string };
|
||||
|
||||
export function emitAssetsChanged(
|
||||
docId?: string,
|
||||
asset?: unknown,
|
||||
@@ -24,6 +30,11 @@ export function emitAssetsChanged(
|
||||
window.dispatchEvent(new CustomEvent(ASSETS_CHANGED_EVENT, { detail }));
|
||||
}
|
||||
|
||||
export function emitAssetsRestored(payload: AssetsRestoredPayload) {
|
||||
if (typeof window === "undefined") return;
|
||||
window.dispatchEvent(new CustomEvent(ASSETS_RESTORED_EVENT, { detail: payload }));
|
||||
}
|
||||
|
||||
export function emitDocumentsChanged(docId?: string) {
|
||||
if (typeof window === "undefined") return;
|
||||
window.dispatchEvent(new CustomEvent(DOCUMENTS_CHANGED_EVENT, { detail: { docId } }));
|
||||
|
||||
Reference in New Issue
Block a user