docs: annotate Foundry source and deployment lifecycle in Chinese [skip ci]

This commit is contained in:
2026-11-16 17:52:11 +08:00
parent 30829eeb86
commit 1090591503
123 changed files with 1279 additions and 3 deletions
+6
View File
@@ -1,3 +1,4 @@
// 子图解散的纯文档变换:把孩子内容还原到父坐标,移除 frame,并将孩子文档清空。
package platform
import (
@@ -5,6 +6,7 @@ import (
"errors"
)
// 领域错误由 HTTP 层分别映射为所有权冲突或图预算超限。
var errGraphOwnership = errors.New("ownership_conflict")
var errGraphCapacity = errors.New("graph_limit_exceeded")
@@ -12,6 +14,7 @@ var errGraphCapacity = errors.New("graph_limit_exceeded")
// ownership changes atomically after checking every participating version.
// An empty child document is returned so the archived board does not remain a
// second live owner of the nodes restored to the parent.
// dissolveDocuments 对父子文档副本操作;节点/边 ID 冲突整体拒绝,不能改名或保留双重活跃所有者。
func dissolveDocuments(parentRaw, childRaw json.RawMessage, frameID string) (json.RawMessage, json.RawMessage, error) {
var parent, child map[string]any
if err := json.Unmarshal(parentRaw, &parent); err != nil {
@@ -50,6 +53,7 @@ func dissolveDocuments(parentRaw, childRaw json.RawMessage, frameID string) (jso
scale = value
}
}
// 位置按 frame 内容偏移与缩放映回父画布,节点固有尺寸、文本和嵌套缩放保持原值。
childKinds := map[string]string{}
for _, v := range childNodes {
n := v.(map[string]any)
@@ -73,6 +77,7 @@ func dissolveDocuments(parentRaw, childRaw json.RawMessage, frameID string) (jso
ports[p["id"].(string)] = p
}
}
// 父边经过旧 frame 端口还原到真实孩子节点;孩子内部边迁入父文档时须检查边 ID 冲突。
edges := parent["edges"].([]any)
edgeIDs := map[string]bool{}
for _, v := range edges {
@@ -128,6 +133,7 @@ func dissolveDocuments(parentRaw, childRaw json.RawMessage, frameID string) (jso
return normalized, empty, nil
}
// projectEdgePath 对绝对 knot 做缩放和平移,对端点控制及 in/out 相对向量只缩放。
func projectEdgePath(e map[string]any, scale, x, y float64) {
data, _ := e["data"].(map[string]any)
path, _ := data["path"].(map[string]any)