diff --git a/app/web/src/nova/ed/logic/tree/assign-mitem.ts b/app/web/src/nova/ed/logic/tree/assign-mitem.ts index af0d3f67..d809bd24 100644 --- a/app/web/src/nova/ed/logic/tree/assign-mitem.ts +++ b/app/web/src/nova/ed/logic/tree/assign-mitem.ts @@ -1,8 +1,8 @@ +import { createId } from "@paralleldrive/cuid2"; import { TypedMap } from "yjs-types"; import { IItem, MItem } from "../../../../utils/types/item"; import { FMCompDef, FNCompDef } from "../../../../utils/types/meta-fn"; -import { IMeta, PG } from "../ed-global"; -import { createId } from "@paralleldrive/cuid2"; +import { IMeta } from "../ed-global"; export const assignMitem = (arg: { m: IMeta; 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 0a8f29e3..eccf614c 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 @@ -25,9 +25,23 @@ export const EdTreeAction = ({ if (!mode && item.adv?.css) mode = "css"; if (!mode && item.adv?.html) mode = "html"; + let child_jsx_has_script = false; + const child_id = item.component?.props.child.content?.id; + if (child_id) { + const meta = getMetaById(p, child_id); + const item = meta?.item; + child_jsx_has_script = true; + if (item) { + mode = ""; + if (item.adv?.js) mode = "js"; + if (!mode && item.adv?.css) mode = "css"; + if (!mode && item.adv?.html) mode = "html"; + } + } + return (