插槽
Flamo Slot 以 W3C Web Component 为宿主语义边界:Custom Element 接收 light DOM 内容,Runtime 再把内容路由到声明过的 slot 与 outlet。核心协议不依赖 Vue、React 或其他框架对象。
Identity
Section titled “Identity”resolvedName 本次解析后的名称,例如 "icon" 或 "cell:price"slotId 组件 surface 中稳定的插槽身份outletId 同一 slot 在当前渲染位置的出口身份cell:price 这类名称只是普通动态 resolvedName 字符串,不需要发明 SlotFamily。运行态状态、DOM 节点和 ECS 引用按 slotId + outletId 隔离,避免同一插槽重复出现在列表或多画布时互相覆盖。
Figma 到 Flamo
Section titled “Figma 到 Flamo”在组件 boundary 中把可替换内容位置声明为 surface slot,并明确 fallback、context 和允许的 materialization。Figma 的 SLOT_CONTENT_ID 可作为导入兼容信息,但长期 Runtime 合同仍是 FlamoSlot、resolvedName、slotId/outletId 与 public surface。
Web Component 宿主
Section titled “Web Component 宿主”<flamo-search-panel> <span slot="empty">暂无结果</span></flamo-search-panel>宿主提供的是 light DOM;Custom Element 不保存宿主框架的 VNode 或 closure。DOM 内容进入 Canvas 时,由 HtmlSurface materializer 建立 runtime-only DOM/ECS 关联与清理逻辑,这些引用不持久化进 Artifact。
Slot content、context 或 target 变化时,Runtime 按 materialization contract 复用或重建 surface;unmount、child swap 和 parent dispose 时释放 listener、clone、HtmlSurface 与 outlet state。将 exact Artifact child 自动物化到 slot 需要明确 child spec、resolver、ownership 和 transaction,不能因为 schema 接受某个字段就假定生命周期已成立。