openpencil/packages/fig/src/instance-overrides/component-props/maps.ts
Danila Poyarkov 2bd2304bcb refactor(fig): own instance interpretation
- Move component properties, symbol overrides, derived symbol data, and clone synchronization into @open-pencil/fig\n- Add the public instance-overrides subpath with package tests and packed smoke coverage\n- Remove cross-package forwarding modules and enforce direct owner imports in architecture checks
2026-07-18 02:06:34 +03:00

20 lines
720 B
TypeScript

import type { ComponentPropAssignment, ComponentPropRef, OverrideContext } from '../types'
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
}