feat(kernel): complete tree-first graph tasks 074-080
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
"use client";
|
||||
|
||||
import { create } from "zustand";
|
||||
|
||||
type OnlyOfficeAiBridgeState = {
|
||||
pluginReady: boolean;
|
||||
targetOrigin: string;
|
||||
targetWindow: Window | null;
|
||||
lastReadyAt: number | null;
|
||||
captureReady: (payload: { targetOrigin: string; targetWindow: Window | null }) => void;
|
||||
reset: () => void;
|
||||
};
|
||||
|
||||
export const useOnlyOfficeAiBridgeStore = create<OnlyOfficeAiBridgeState>((set) => ({
|
||||
pluginReady: false,
|
||||
targetOrigin: "*",
|
||||
targetWindow: null,
|
||||
lastReadyAt: null,
|
||||
captureReady: ({ targetOrigin, targetWindow }) =>
|
||||
set({
|
||||
pluginReady: Boolean(targetWindow),
|
||||
targetOrigin: targetOrigin || "*",
|
||||
targetWindow,
|
||||
lastReadyAt: Date.now(),
|
||||
}),
|
||||
reset: () =>
|
||||
set({
|
||||
pluginReady: false,
|
||||
targetOrigin: "*",
|
||||
targetWindow: null,
|
||||
lastReadyAt: null,
|
||||
}),
|
||||
}));
|
||||
Reference in New Issue
Block a user