Support explicit empty slot drop zones in shared editor
Quality / quality (ubuntu-latest) (push) Failing after 22s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
Clintchiz committed 2026-09-05 16:28:11 +05:30
1 parent 7110e1a7f1
commit 0f8d10eb91
7 files changed
+100 -11

No files matched your search

+10
View File
@@ -107,6 +107,16 @@ export function mountBlockEditor(root: HTMLElement, options: MountEditorOptions)
});
},
});
for (const element of root.querySelectorAll<HTMLElement>("[data-block-slot-target][data-block-parent]")) {
const parentId = element.dataset.blockParent!;
const slot = element.dataset.blockSlotTarget!;
const hasChildren = [...root.querySelectorAll<HTMLElement>("[data-block-id][data-block-parent][data-block-slot]")]
.some(child => child.dataset.blockParent === parentId && child.dataset.blockSlot === slot);
if (hasChildren) continue;
const group = JSON.stringify([parentId, slot]);
groups.set(group, { parentId, slot });
cleanups.push(manager.registerDropZone({ id: `wrn-slot:${group}`, group, index: 0, element }));
}
for (const element of root.querySelectorAll<HTMLElement>(
"[data-block-id][data-block-parent][data-block-slot]",
)) {