跳转到内容
flamo
开始使用

实例

Figma Instance 引用一个 Component 或 Component Set definition,同时保存自己的 properties、overrides、assignments、transform 与布局上下文。导入时应保留这条 lineage,而不是把每个实例都展开成互不相关的静态图层。

Component definition
├─ Instance A: props / overrides / assignments
└─ Instance B: props / overrides / assignments

两个实例可以共享 definition 与底层资源,但 Runtime 会为每个 FlamoInstance 建立独立 selection、node identity、脚本作用域和 child graph。修改 A 的 Variant、Text 或 Boolean property 不应改变 B 或 definition 默认值。

Adapter 需要同时解析 definition lineage、nested instance 和 shared style,再按 instance-local path 投影 override。Text/Boolean assignment 还会参与 HUG 布局;切换 Variant 后需要把已有 assignment 重新投影到目标 subtree,不能只更换视觉树而丢失实例输入。

项目 Preview 可以选择可识别的 Component / Component Set instance,并对 exact-reachable Variant 及有 consumer 的 Text/Boolean property 做 transient 调试。只有收到 applied receipt 后 UI 才能显示成功;刷新或 remount 后回到 Artifact 初值。

Figma instance-swap property 的 Preview 编辑仍应以当前能力探测为准:backend 不支持时只读并显示 reason,不能伪装切换成功。需要永久更新默认值时,使用独立的 revision-safe authoring operation。

Runtime 的 dynamic component ref / swapChild() 可以在两个 exact Flamo Component 之间原子替换,这不等于已经实现所有 Figma instance-swap authoring 语义。前者属于运行图合同,后者还涉及 Figma property、lineage 与同步 ownership。