From 0f4e58d7e1573455772e3eea76ddec2af6a0eb1b Mon Sep 17 00:00:00 2001 From: SpecialX <47072643+wangxiner55@users.noreply.github.com> Date: Sat, 4 Jul 2026 11:15:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(lesson-preparation):=20selection-slice=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20anchorNodeForSelection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/lesson-preparation/hooks/selection-slice.ts | 6 ++++++ 1 file changed, 6 insertions(+) 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 }), });