组件
Figma Component 可以成为 Flamo component boundary,但“Figma 中存在一个 Component 节点”与“已经发布成可跨项目解析的 Flamo Component”仍是两个阶段。
从设计边界到发布单元
Section titled “从设计边界到发布单元”Figma Component / explicit flamo boundary -> nodeArtifacts[boundary].surface -> Artifact Export -> verify / package / promote -> exact Flamo Component Ref导入阶段保留 definition 节点、布局、公开 component properties 和来源 identity。Artifact authoring 再明确 boundary、Export、tagName 与 surface;发布管线补上 dependency lock、Artifact hash、surface hash、Runtime ABI 和 package evidence。
公开 surface
Section titled “公开 surface”- Figma Text / Boolean / Variant 等 property 可进入 typed props; -交互输出进入 events,而不是让宿主监听内部节点;
- 需要命令式能力时显式声明 methods;
- 可替换内容入口声明为 slots;
- 内部 child 默认私有,只有明确的 public child ref 才能被外部访问。
surface 是 Flamo/W3C 合同,不应携带 Figma Plugin closure、运行时 entity 或宿主框架组件对象。
设计更新后的处理
Section titled “设计更新后的处理”再次从 Figma 同步时,scene 与来源数据可以更新,但用户维护的 node-scoped scripts、surface、exports 和其他明确 ownership 不应被旧输入覆盖。发布新版本前重新验证 public surface 与生成的 .d.ts、Custom Elements Manifest 和浏览器 manifest 一致。
Copyright (c) 2025-present [email protected]