diff --git a/app/srv/ws/sync/actions/comp_new.ts b/app/srv/ws/sync/actions/comp_new.ts index 89408ad1..4f71c8cd 100644 --- a/app/srv/ws/sync/actions/comp_new.ts +++ b/app/srv/ws/sync/actions/comp_new.ts @@ -65,7 +65,7 @@ export const comp_new: SAction["comp"]["new"] = async function ( } else if (comp_id) { const doc = docs.comp[comp_id].doc; doc.transact(() => { - const root = doc.getMap("map").get("item"); + const root = doc.getMap("map").get("root"); if (root) { root.get("childs")?.forEach((e) => { walk(e); 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 7857e62c..63d690b7 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 @@ -71,10 +71,10 @@ export const EdTreeName = ({ p.render(); }} /> - ) : ( + ) : (
-
{node.id} - {item.originalId}
+ {/*
{node.id} - {item.originalId}
*/}
)} diff --git a/app/web/src/nova/view/render/meta/script/comp-propval.tsx b/app/web/src/nova/view/render/meta/script/comp-propval.tsx index 0059b37d..8d136e70 100644 --- a/app/web/src/nova/view/render/meta/script/comp-propval.tsx +++ b/app/web/src/nova/view/render/meta/script/comp-propval.tsx @@ -39,6 +39,7 @@ export const compPropVal = ( const prop = props[name] || _prop; let value: any = null; + if (prop.valueBuilt) { const fn = new Function( ...Object.keys(args), @@ -60,9 +61,7 @@ export const compPropVal = ( prop.value ); } - } - - if (prop.meta?.type === "content-element") { + } else if (prop.meta?.type === "content-element") { if (!(typeof value === "object" && !!value && value._jsx)) { const id = `${meta.item.id}-${name}`; if (!jsxProps[id]) { diff --git a/app/web/src/utils/script/mount.tsx b/app/web/src/utils/script/mount.tsx index 00837282..d907a05c 100644 --- a/app/web/src/utils/script/mount.tsx +++ b/app/web/src/utils/script/mount.tsx @@ -68,7 +68,7 @@ export const jsMount = async (editor: MonacoEditor, monaco: Monaco, p?: PG) => { let meta = p.page.meta[id]; if (active.comp_id) { meta = p.comp.list[active.comp_id].meta[id]; - if (!meta) return false; + return false; } active.instance.comp_id = active.comp_id; @@ -81,6 +81,23 @@ export const jsMount = async (editor: MonacoEditor, monaco: Monaco, p?: PG) => { } active.comp_id = comp_id; } else { + if (active.comp_id) { + let meta = p.comp.list[active.comp_id].meta[id]; + + if (!meta) { + const _id = p.comp.list[active.comp_id].doc + .getMap("map") + .get("root") + ?.get("id"); + + if (_id) { + active.item_id = _id; + p.render(); + } + } + return false; + } + active.item_id = id; } p.render();