diff --git a/packages/editor/src/editor/Canvas.tsx b/packages/editor/src/editor/Canvas.tsx index b376ef1..fbe2b98 100644 --- a/packages/editor/src/editor/Canvas.tsx +++ b/packages/editor/src/editor/Canvas.tsx @@ -436,18 +436,18 @@ function NodeView(props: { boxSizing: 'border-box', padding: `${node.props.paddingY ?? 0}px ${node.props.paddingX ?? 0}px`, overflow: 'hidden', + }} + > + - { if (!node.props.link) return; const head = node.props.linkHead ?? 'http://'; diff --git a/packages/editor/src/editor/EditorApp.tsx b/packages/editor/src/editor/EditorApp.tsx index 7b0fb15..272793f 100644 --- a/packages/editor/src/editor/EditorApp.tsx +++ b/packages/editor/src/editor/EditorApp.tsx @@ -14,6 +14,7 @@ import { bindEditorHotkeys } from './hotkeys'; import { Canvas } from './Canvas'; import { ContextMenu, type ContextMenuState } from './ContextMenu'; import { Inspector } from './Inspector'; +import { selectionKeyOf } from './selection'; import { createInitialState, editorReducer, exportScreenJSON } from './store'; const { Header, Sider, Content } = Layout; @@ -86,10 +87,7 @@ export function EditorApp() { const closeContextMenu = useCallback(() => setCtxMenu(null), []); - const selectionKeyOf = useCallback((ids: string[]) => { - // Keep stable regardless of ordering. - return [...ids].sort().join('|'); - }, []); + // selectionKeyOf imported from ./selection const ctxMenuSyncedRef = useRef(false); @@ -103,7 +101,7 @@ export function EditorApp() { } dispatch(action); }, - [ctxMenu, dispatch, selectionKeyOf, state.selection.ids], + [ctxMenu, dispatch, state.selection.ids], ); useEffect(() => {