diff --git a/packages/designer/src/helpers/dom.ts b/packages/designer/src/helpers/dom.ts index b2d1545b..029a30c6 100644 --- a/packages/designer/src/helpers/dom.ts +++ b/packages/designer/src/helpers/dom.ts @@ -75,6 +75,7 @@ export function getElementData( const display = getElementCSSDisplay(element); return { id: dnd.id, + codeId: dnd.index, name: dnd.component || element.tagName.toLowerCase(), filename: dnd.filename, bounding, diff --git a/packages/designer/src/sidebar/outline-panel/state-tree.tsx b/packages/designer/src/sidebar/outline-panel/state-tree.tsx index 7e176568..408512d3 100644 --- a/packages/designer/src/sidebar/outline-panel/state-tree.tsx +++ b/packages/designer/src/sidebar/outline-panel/state-tree.tsx @@ -26,7 +26,7 @@ export const StateTree = observer(() => { const [, forceUpdate] = useReducer((x) => x + 1, 0); const tangoContext = pick(sandboxQuery.window['tango'] || {}, [ 'stores', - 'refs', + 'page', 'services', 'config', ]); diff --git a/packages/designer/src/simulator/selection.tsx b/packages/designer/src/simulator/selection.tsx index d53801ef..17f9b975 100644 --- a/packages/designer/src/simulator/selection.tsx +++ b/packages/designer/src/simulator/selection.tsx @@ -159,7 +159,7 @@ function SelectionBox({ showActions, actions, data }: SelectionBoxProps) { label={ <> { workspace.selectSource.select(item); diff --git a/packages/helpers/src/types/advanced.ts b/packages/helpers/src/types/advanced.ts index d9a78894..569f4b22 100644 --- a/packages/helpers/src/types/advanced.ts +++ b/packages/helpers/src/types/advanced.ts @@ -104,7 +104,14 @@ export type ElementBoundingType = { * 选中项数据类型 */ export interface ISelectedItemData { + /** + * 节点的 data-dnd 值 + */ id?: string; + /** + * 节点的 codeId + */ + codeId?: string; /** * 组件名 */