diff --git a/app/web/src/nova/ed/panel/side/style/side-all.tsx b/app/web/src/nova/ed/panel/side/style/side-all.tsx index 6790c998..e88b9478 100644 --- a/app/web/src/nova/ed/panel/side/style/side-all.tsx +++ b/app/web/src/nova/ed/panel/side/style/side-all.tsx @@ -16,10 +16,18 @@ import { SideLabel } from "./ui/SideLabel"; export const EdStyleAll = () => { const p = useGlobal(EDGlobal, "EDITOR"); - const meta = active.comp_id + let meta = active.comp_id ? p.comp.list[active.comp_id].meta[active.item_id] : p.page.meta[active.item_id]; + if ( + meta.item.component?.props?.child && + meta.item.component?.props?.child?.content?.id && + meta.item.component?.useStyle + ) { + meta = p.page.meta[meta.item.component.props.child.content.id]; + } + let item = meta?.item; let is_inherit = false; if (item?.component?.id) { diff --git a/app/web/src/nova/ed/panel/tree/node/item/action.tsx b/app/web/src/nova/ed/panel/tree/node/item/action.tsx index 43ae8777..0f0820ba 100644 --- a/app/web/src/nova/ed/panel/tree/node/item/action.tsx +++ b/app/web/src/nova/ed/panel/tree/node/item/action.tsx @@ -100,7 +100,7 @@ export const EdTreeAction = ({ )} onClick={(e) => { if ( - item.component?.props.child.content?.id && + item.component?.props?.child?.content?.id && child_jsx_has_script ) { e.stopPropagation(); diff --git a/app/web/src/nova/ed/panel/tree/node/item/name.tsx b/app/web/src/nova/ed/panel/tree/node/item/name.tsx index 5c71545f..b6b4d669 100644 --- a/app/web/src/nova/ed/panel/tree/node/item/name.tsx +++ b/app/web/src/nova/ed/panel/tree/node/item/name.tsx @@ -238,7 +238,7 @@ const GenerateJSX: FC<{ meta: IMeta }> = ({ meta }) => { } if (mitem) { - const genJSX = fillID(findDefaultJSX(p, mitem)); + const genJSX = findDefaultJSX(p, mitem); const ijson = mitem.toJSON() as IItem; mitem.doc?.transact(() => { @@ -307,5 +307,5 @@ export const findDefaultJSX = (p: PG, mitem: MItem): IItem => { } } - return resetJSXProp; + return fillID(resetJSXProp) as any; }; diff --git a/app/web/src/nova/ed/panel/tree/node/on-drop.tsx b/app/web/src/nova/ed/panel/tree/node/on-drop.tsx index 98b7b5c8..71513be9 100644 --- a/app/web/src/nova/ed/panel/tree/node/on-drop.tsx +++ b/app/web/src/nova/ed/panel/tree/node/on-drop.tsx @@ -61,7 +61,7 @@ export const nodeOnDrop: ( treeRebuild(p); p.render(); } else { - const child_id = toMeta.item.component?.props.child.content?.id; + const child_id = toMeta.item.component?.props?.child?.content?.id; if (child_id) { const child_meta = getMetaById(p, child_id); if (child_meta) {