* Evaluate an ElementNode's props with schema awareness. Used by evaluate() * when schema context is available and a Comp produces an ElementNode that * needs its own props evaluated with reactive schema detection.
( el: ElementNode, context: EvaluationContext, schemaCtx: SchemaContext, )
| 253 | * needs its own props evaluated with reactive schema detection. |
| 254 | */ |
| 255 | function evaluateElementInline( |
| 256 | el: ElementNode, |
| 257 | context: EvaluationContext, |
| 258 | schemaCtx: SchemaContext, |
| 259 | ): ElementNode { |
| 260 | if (el.hasDynamicProps === false) return el; |
| 261 | const def = schemaCtx.library.components[el.typeName]; |
| 262 | const evaluated: Record<string, unknown> = {}; |
| 263 | |
| 264 | for (const [key, value] of Object.entries(el.props)) { |
| 265 | const propSchema = def?.props?.shape?.[key]; |
| 266 | evaluated[key] = evaluatePropInline(value, context, schemaCtx, propSchema); |
| 267 | } |
| 268 | return { ...el, props: evaluated }; |
| 269 | } |
| 270 | |
| 271 | /** |
| 272 | * Evaluate a single prop value with schema awareness. |
no test coverage detected