diff --git a/src/modules/lesson-preparation/hooks/selection-slice.ts b/src/modules/lesson-preparation/hooks/selection-slice.ts index 8ac0e41..9f508b0 100644 --- a/src/modules/lesson-preparation/hooks/selection-slice.ts +++ b/src/modules/lesson-preparation/hooks/selection-slice.ts @@ -2,8 +2,12 @@ import type { StateCreator } from "zustand"; import type { EditorState } from "./use-lesson-plan-editor"; export interface SelectionSlice { + /** 当前在右栏详情面板显示的节点 ID */ selectedNodeId: string | null; + /** 纸上选中文本时,待锚定的目标节点 ID(用户从右键菜单选择节点后设置) */ + anchorNodeForSelection: string | null; selectNode: (id: string | null) => void; + setAnchorNodeForSelection: (id: string | null) => void; } export const createSelectionSlice: StateCreator< @@ -13,5 +17,7 @@ export const createSelectionSlice: StateCreator< SelectionSlice > = (set) => ({ selectedNodeId: null, + anchorNodeForSelection: null, selectNode: (id) => set({ selectedNodeId: id }), + setAnchorNodeForSelection: (id) => set({ anchorNodeForSelection: id }), });