2026-07-17 23:06:34 +00:00
|
|
|
import type { ComponentPropAssignment, ComponentPropRef, OverrideContext } from '../types'
|
2026-05-17 21:17:41 +00:00
|
|
|
|
|
|
|
|
export function collectPropRefsMap(ctx: OverrideContext): Map<string, ComponentPropRef[]> {
|
|
|
|
|
const result = new Map<string, ComponentPropRef[]>()
|
|
|
|
|
for (const [figmaId, nc] of ctx.changeMap) {
|
|
|
|
|
if (nc.componentPropRefs?.length) result.set(figmaId, nc.componentPropRefs)
|
|
|
|
|
}
|
|
|
|
|
return result
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function collectAssignmentsMap(
|
|
|
|
|
ctx: OverrideContext
|
|
|
|
|
): Map<string, ComponentPropAssignment[]> {
|
|
|
|
|
const result = new Map<string, ComponentPropAssignment[]>()
|
|
|
|
|
for (const [figmaId, nc] of ctx.changeMap) {
|
|
|
|
|
if (nc.componentPropAssignments?.length) result.set(figmaId, nc.componentPropAssignments)
|
|
|
|
|
}
|
|
|
|
|
return result
|
|
|
|
|
}
|