wip fix
This commit is contained in:
parent
27085ccd12
commit
51807aa0c7
|
|
@ -50,7 +50,7 @@ export const loadCompSnapshot = async (
|
||||||
doc.off("update", p.comp.list[id_comp].on_update);
|
doc.off("update", p.comp.list[id_comp].on_update);
|
||||||
}
|
}
|
||||||
|
|
||||||
const meta = {};
|
const meta: Record<string, IMeta> = {};
|
||||||
const tree: NodeModel<IMeta>[] = [];
|
const tree: NodeModel<IMeta>[] = [];
|
||||||
const item = mitem.toJSON() as IItem;
|
const item = mitem.toJSON() as IItem;
|
||||||
p.comp.loaded[id_comp] = {
|
p.comp.loaded[id_comp] = {
|
||||||
|
|
@ -63,6 +63,24 @@ export const loadCompSnapshot = async (
|
||||||
on: {
|
on: {
|
||||||
visit(m) {
|
visit(m) {
|
||||||
pushTreeNode(p, m, meta, tree);
|
pushTreeNode(p, m, meta, tree);
|
||||||
|
|
||||||
|
if (m.parent) {
|
||||||
|
if (m.parent.id === "root") {
|
||||||
|
if (m.item.id === item.id) {
|
||||||
|
m.mitem = mitem;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const parent = meta[m.parent.id];
|
||||||
|
|
||||||
|
if (parent.mitem) {
|
||||||
|
parent.mitem.get("childs")?.forEach((child) => {
|
||||||
|
if (child.get("id") === m.item.id) {
|
||||||
|
m.mitem = child;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
note: "load-comp",
|
note: "load-comp",
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,24 @@ export const treeRebuild = async (p: PG, arg?: { note?: string }) => {
|
||||||
async visit(m) {
|
async visit(m) {
|
||||||
if (!is_layout) {
|
if (!is_layout) {
|
||||||
pushTreeNode(p, m, meta, p.page.tree);
|
pushTreeNode(p, m, meta, p.page.tree);
|
||||||
|
|
||||||
|
if (m.parent) {
|
||||||
|
if (m.parent.id === "root") {
|
||||||
|
if (m.item.id === item.id) {
|
||||||
|
m.mitem = mitem;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const parent = meta[m.parent.id];
|
||||||
|
|
||||||
|
if (parent.mitem) {
|
||||||
|
parent.mitem.get("childs")?.forEach((child) => {
|
||||||
|
if (child.get("id") === m.item.id) {
|
||||||
|
m.mitem = child;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,14 @@ export const EdMain = () => {
|
||||||
active.hover.renderMain = local.render;
|
active.hover.renderMain = local.render;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-1 relative overflow-auto">
|
<div
|
||||||
|
className={cx(
|
||||||
|
"flex flex-1 relative overflow-auto",
|
||||||
|
css`
|
||||||
|
contain: content;
|
||||||
|
`
|
||||||
|
)}
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
className={cx(
|
className={cx(
|
||||||
"absolute inset-0 flex",
|
"absolute inset-0 flex",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue