@threadplane/render 0.0.46 → 0.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,24 @@
1
1
  # @threadplane/render
2
2
 
3
- Generative UI for Angular. Agents emit structured JSON specs; this library renders them into Angular components you already own. Supports the Vercel `json-render` and Google A2UI v1-compatible protocols out of the box.
3
+ `@json-render/core`-backed Angular render engine maps JSON specs to Angular components via a registry, used internally by `@threadplane/chat` for generative-UI rendering.
4
4
 
5
- Part of [Threadplane](https://github.com/cacheplane/angular-agent-framework). MIT licensed.
5
+ <p>
6
+ <a href="https://www.npmjs.com/package/@threadplane/render">
7
+ <img alt="npm version" src="https://img.shields.io/npm/v/@threadplane%2Frender?color=6C8EFF&labelColor=080B14&style=flat-square" />
8
+ </a>
9
+ <a href="https://angular.dev">
10
+ <img alt="Angular 20+" src="https://img.shields.io/badge/Angular-20%2B%20%7C%2021-6C8EFF?labelColor=080B14&style=flat-square" />
11
+ </a>
12
+ <a href="../../LICENSE">
13
+ <img alt="MIT" src="https://img.shields.io/badge/License-MIT-6C8EFF?labelColor=080B14&style=flat-square" />
14
+ </a>
15
+ </p>
16
+
17
+ ## What it does
18
+
19
+ - Renders a JSON spec tree to Angular components via a named view registry (`<render-spec>`) or a single node (`<render-element>`).
20
+ - Registry composition utilities (`views`, `withViews`, `withoutViews`) let you build, extend, and trim registries without mutation.
21
+ - Signal-based state store (`signalStateStore`) and per-component fallback support keep UI consistent during streaming.
6
22
 
7
23
  ## Install
8
24
 
@@ -10,21 +26,65 @@ Part of [Threadplane](https://github.com/cacheplane/angular-agent-framework). MI
10
26
  npm install @threadplane/render
11
27
  ```
12
28
 
13
- ## What it does
29
+ **Peer dependencies:** `@angular/core ^20.0.0 || ^21.0.0`, `@angular/common ^20.0.0 || ^21.0.0`, `@json-render/core ^0.16.0`
30
+
31
+ ## Quick start
32
+
33
+ **1. Define your view registry and provide it.**
34
+
35
+ ```typescript
36
+ // app.config.ts
37
+ import { ApplicationConfig } from '@angular/core';
38
+ import { provideRender, provideViews, views, toRenderRegistry } from '@threadplane/render';
39
+ import { CardComponent } from './card.component';
40
+ import { HeroComponent } from './hero.component';
41
+
42
+ const myRegistry = toRenderRegistry(
43
+ views({ card: CardComponent, hero: HeroComponent })
44
+ );
45
+
46
+ export const appConfig: ApplicationConfig = {
47
+ providers: [
48
+ provideRender({ registry: myRegistry }),
49
+ ],
50
+ };
51
+ ```
52
+
53
+ **2. Render a spec in your component.**
54
+
55
+ ```typescript
56
+ import { Component, signal } from '@angular/core';
57
+ import { RenderSpecComponent } from '@threadplane/render';
58
+ import type { Spec } from '@json-render/core';
59
+
60
+ @Component({
61
+ selector: 'app-agent-ui',
62
+ imports: [RenderSpecComponent],
63
+ template: `<render-spec [spec]="spec()" />`,
64
+ })
65
+ export class AgentUiComponent {
66
+ spec = signal<Spec | null>(null);
67
+
68
+ onAgentMessage(incoming: Spec) {
69
+ this.spec.set(incoming);
70
+ }
71
+ }
72
+ ```
73
+
74
+ ## Capabilities
75
+
76
+ **View registry composition** — `views(map)` creates a frozen registry; `withViews(base, additions)` adds NEW keys without touching existing entries — use it to extend a registry with previously-unhandled node types; `overrideViews(base, overrides)` replaces matching keys so overrides win over base — use it to swap an existing renderer; `withoutViews(base, ...keys)` prunes entries. Convert to an `AngularRegistry` with `toRenderRegistry` and supply it app-wide via `provideRender({ registry })`, or pass one directly as the `[registry]` input on `<render-spec>` / `<render-element>`.
77
+
78
+ **Signal state store** — `signalStateStore(initialState?)` provides a `StateStore` backed by Angular Signals, suitable for two-way bindings declared in a spec.
79
+
80
+ **DI providers** — `provideRender(config)` registers `RenderConfig` (registry, store, functions, handlers) as environment-scoped defaults read by the render components; `provideViews(registry)` publishes a `ViewRegistry` under the `VIEW_REGISTRY` token. `<render-spec>` and `<render-element>` resolve their registry in priority order: the `[registry]` template input, then `RENDER_CONFIG.registry` (from `provideRender(...)`), then `VIEW_REGISTRY` (from `provideViews(...)`), then the existing empty fallback.
14
81
 
15
- - **Spec-driven rendering** — agents return JSON; you map each node type to one of your Angular components via a registry
16
- - **Two protocols supported** — Vercel `json-render` and Google A2UI v1-compatible
17
- - **Per-component fallback API** — when a spec node has no registered component, you control what renders (and surface it to your observability layer)
18
- - **Readiness gate** — holds renders until the surface is real, so users never see mystery partial UI
19
- - **Streaming partial renders** — works with `@cacheplane/partial-json` to render progressive JSON as it streams
82
+ **Fallback** — `DefaultFallbackComponent` renders when no component is registered for a spec node; individual entries in a `ViewRegistry` can supply their own `fallback` component via `RenderViewEntry`.
20
83
 
21
- ## Documentation
84
+ ## Reliability
22
85
 
23
- - [Quickstart](https://threadplane.ai/docs/render/getting-started/quickstart)
24
- - [Component registry](https://threadplane.ai/docs/render/guides/registry)
25
- - [Fallback patterns](https://threadplane.ai/docs/render/guides/fallback)
26
- - [A2UI v1-compatible protocol](https://threadplane.ai/docs/render/a2ui/overview)
86
+ Powers `@threadplane/chat` generative-UI rendering in production. Patch-only `0.0.x` releases. Validated by the CI job "Library — lint / test / build" on every commit.
27
87
 
28
88
  ## License
29
89
 
30
- MIT — free for any use. See [LICENSE](../../LICENSE).
90
+ MIT. See [LICENSE](../../LICENSE).
@@ -561,6 +561,51 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImpor
561
561
  }]
562
562
  }], ctorParameters: () => [], propDecorators: { elementKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "elementKey", required: true }] }], spec: [{ type: i0.Input, args: [{ isSignal: true, alias: "spec", required: true }] }] } });
563
563
 
564
+ // SPDX-License-Identifier: MIT
565
+ const VIEW_REGISTRY = new InjectionToken('VIEW_REGISTRY');
566
+ function provideViews(registry) {
567
+ return makeEnvironmentProviders([
568
+ { provide: VIEW_REGISTRY, useValue: registry },
569
+ ]);
570
+ }
571
+
572
+ /**
573
+ * Creates a view registry from a name → component map.
574
+ */
575
+ function views(map) {
576
+ return Object.freeze({ ...map });
577
+ }
578
+ /**
579
+ * Adds views to a registry without overwriting existing entries.
580
+ * New keys are added; keys that already exist in `base` are preserved.
581
+ */
582
+ function withViews(base, additions) {
583
+ return Object.freeze({ ...additions, ...base });
584
+ }
585
+ /**
586
+ * Replaces views in a registry. Keys in `overrides` win over `base`.
587
+ * Use this to swap an existing renderer; use `withViews` to add NEW
588
+ * node types without touching existing entries.
589
+ */
590
+ function overrideViews(base, overrides) {
591
+ return Object.freeze({ ...base, ...overrides });
592
+ }
593
+ /**
594
+ * Removes views from a registry by name.
595
+ */
596
+ function withoutViews(base, ...names) {
597
+ const result = { ...base };
598
+ for (const name of names)
599
+ delete result[name];
600
+ return Object.freeze(result);
601
+ }
602
+ /**
603
+ * Converts a ViewRegistry to an AngularRegistry for use with RenderSpecComponent.
604
+ */
605
+ function toRenderRegistry(registry) {
606
+ return defineAngularRegistry(registry);
607
+ }
608
+
564
609
  // SPDX-License-Identifier: MIT
565
610
  /**
566
611
  * Top-level entry point for rendering a json-render spec.
@@ -586,6 +631,7 @@ class RenderSpecComponent {
586
631
  loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
587
632
  events = output();
588
633
  config = inject(RENDER_CONFIG, { optional: true });
634
+ viewRegistry = inject(VIEW_REGISTRY, { optional: true });
589
635
  destroyRef = inject(DestroyRef);
590
636
  lifecycle = inject(RenderLifecycleService, { optional: true });
591
637
  /** Internal store, lazily created once and reused across spec changes. */
@@ -606,7 +652,7 @@ class RenderSpecComponent {
606
652
  return configStore;
607
653
  return this.getOrCreateInternalStore();
608
654
  }, ...(ngDevMode ? [{ debugName: "resolvedStore" }] : []));
609
- /** Resolved registry: input > config. */
655
+ /** Resolved registry: input > config > VIEW_REGISTRY token > empty fallback. */
610
656
  resolvedRegistry = computed(() => {
611
657
  const inputRegistry = this.registry();
612
658
  if (inputRegistry)
@@ -614,6 +660,8 @@ class RenderSpecComponent {
614
660
  const configRegistry = this.config?.registry;
615
661
  if (configRegistry)
616
662
  return configRegistry;
663
+ if (this.viewRegistry)
664
+ return toRenderRegistry(this.viewRegistry);
617
665
  // Fallback: empty registry
618
666
  return { get: () => undefined, getFallback: () => undefined, names: () => [] };
619
667
  }, ...(ngDevMode ? [{ debugName: "resolvedRegistry" }] : []));
@@ -731,43 +779,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImpor
731
779
  }]
732
780
  }], ctorParameters: () => [], propDecorators: { spec: [{ type: i0.Input, args: [{ isSignal: true, alias: "spec", required: false }] }], registry: [{ type: i0.Input, args: [{ isSignal: true, alias: "registry", required: false }] }], store: [{ type: i0.Input, args: [{ isSignal: true, alias: "store", required: false }] }], functions: [{ type: i0.Input, args: [{ isSignal: true, alias: "functions", required: false }] }], handlers: [{ type: i0.Input, args: [{ isSignal: true, alias: "handlers", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], events: [{ type: i0.Output, args: ["events"] }] } });
733
781
 
734
- /**
735
- * Creates a view registry from a name → component map.
736
- */
737
- function views(map) {
738
- return Object.freeze({ ...map });
739
- }
740
- /**
741
- * Adds views to a registry without overwriting existing entries.
742
- * New keys are added; keys that already exist in `base` are preserved.
743
- */
744
- function withViews(base, additions) {
745
- return Object.freeze({ ...additions, ...base });
746
- }
747
- /**
748
- * Removes views from a registry by name.
749
- */
750
- function withoutViews(base, ...names) {
751
- const result = { ...base };
752
- for (const name of names)
753
- delete result[name];
754
- return Object.freeze(result);
755
- }
756
- /**
757
- * Converts a ViewRegistry to an AngularRegistry for use with RenderSpecComponent.
758
- */
759
- function toRenderRegistry(registry) {
760
- return defineAngularRegistry(registry);
761
- }
762
-
763
- // SPDX-License-Identifier: MIT
764
- const VIEW_REGISTRY = new InjectionToken('VIEW_REGISTRY');
765
- function provideViews(registry) {
766
- return makeEnvironmentProviders([
767
- { provide: VIEW_REGISTRY, useValue: registry },
768
- ]);
769
- }
770
-
771
782
  // SPDX-License-Identifier: MIT
772
783
  // Contexts
773
784
 
@@ -775,5 +786,5 @@ function provideViews(registry) {
775
786
  * Generated bundle index. Do not edit.
776
787
  */
777
788
 
778
- export { DefaultFallbackComponent, RENDER_CONFIG, RENDER_CONTEXT, RENDER_LIFECYCLE, REPEAT_SCOPE, RenderElementComponent, RenderSpecComponent, VIEW_REGISTRY, defineAngularRegistry, provideRender, provideViews, signalStateStore, toRenderRegistry, views, withViews, withoutViews };
789
+ export { DefaultFallbackComponent, RENDER_CONFIG, RENDER_CONTEXT, RENDER_LIFECYCLE, REPEAT_SCOPE, RenderElementComponent, RenderSpecComponent, VIEW_REGISTRY, defineAngularRegistry, overrideViews, provideRender, provideViews, signalStateStore, toRenderRegistry, views, withViews, withoutViews };
779
790
  //# sourceMappingURL=threadplane-render.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"threadplane-render.mjs","sources":["../../../../libs/render/src/lib/contexts/render-context.ts","../../../../libs/render/src/lib/contexts/repeat-scope.ts","../../../../libs/render/src/lib/default-fallback.component.ts","../../../../libs/render/src/lib/define-angular-registry.ts","../../../../libs/render/src/lib/signal-state-store.ts","../../../../libs/render/src/lib/lifecycle.ts","../../../../libs/render/src/lib/render-lifecycle.service.ts","../../../../libs/render/src/lib/provide-render.ts","../../../../libs/render/src/lib/internals/prop-signal.ts","../../../../libs/render/src/lib/render-element.component.ts","../../../../libs/render/src/lib/render-spec.component.ts","../../../../libs/render/src/lib/views.ts","../../../../libs/render/src/lib/provide-views.ts","../../../../libs/render/src/public-api.ts","../../../../libs/render/src/threadplane-render.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\nimport { InjectionToken } from '@angular/core';\nimport type { StateStore, ComputedFunction } from '@json-render/core';\nimport type { AngularRegistry } from '../render.types';\nimport type { RenderEvent } from '../render-event';\n\nexport interface RenderContext {\n registry: AngularRegistry;\n store: StateStore;\n functions?: Record<string, ComputedFunction>;\n handlers?: Record<string, (params: Record<string, unknown>) => unknown | Promise<unknown>>;\n emitEvent?: (event: RenderEvent) => void;\n loading?: boolean;\n}\n\nexport const RENDER_CONTEXT = new InjectionToken<RenderContext>('RENDER_CONTEXT');\n","// SPDX-License-Identifier: MIT\nimport { InjectionToken } from '@angular/core';\n\nexport interface RepeatScope {\n item: unknown;\n index: number;\n basePath: string;\n}\n\nexport const REPEAT_SCOPE = new InjectionToken<RepeatScope>('REPEAT_SCOPE');\n","// SPDX-License-Identifier: MIT\nimport { Component, ChangeDetectionStrategy } from '@angular/core';\n\n@Component({\n selector: 'render-default-fallback',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n styles: [`\n :host { display: block; width: 100%; }\n .render-default-fallback {\n border: 1px solid var(--ngaf-chat-separator, #303540);\n border-radius: 10px;\n padding: 14px;\n background: var(--ngaf-chat-surface-alt, #1a1d23);\n }\n .render-default-fallback__label {\n font-size: 12px;\n color: var(--ngaf-chat-text-muted, #9aa0aa);\n margin-bottom: 10px;\n display: flex;\n align-items: center;\n gap: 6px;\n }\n .render-default-fallback__rows {\n display: flex; flex-direction: column; gap: 8px;\n }\n .render-default-fallback__row {\n height: 10px; border-radius: 5px;\n background: linear-gradient(\n 90deg,\n var(--ngaf-chat-separator, #303540) 0%,\n color-mix(in srgb, var(--ngaf-chat-separator, #303540) 70%, transparent) 50%,\n var(--ngaf-chat-separator, #303540) 100%\n );\n background-size: 200% 100%;\n animation: render-default-fallback-shimmer 1.4s ease-in-out infinite;\n }\n .render-default-fallback__row:nth-child(1) { width: 70%; }\n .render-default-fallback__row:nth-child(2) { width: 90%; }\n .render-default-fallback__row:nth-child(3) { width: 50%; }\n @keyframes render-default-fallback-shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n `],\n template: `\n <div class=\"render-default-fallback\" role=\"status\" aria-live=\"polite\">\n <div class=\"render-default-fallback__label\">\n <span aria-hidden=\"true\">✨</span>\n <span>Building UI…</span>\n </div>\n <div class=\"render-default-fallback__rows\">\n <div class=\"render-default-fallback__row\"></div>\n <div class=\"render-default-fallback__row\"></div>\n <div class=\"render-default-fallback__row\"></div>\n </div>\n </div>\n `,\n})\nexport class DefaultFallbackComponent {}\n","// SPDX-License-Identifier: MIT\nimport { Type } from '@angular/core';\nimport type { AngularRegistry, RenderViewEntry } from './render.types';\nimport { DefaultFallbackComponent } from './default-fallback.component';\n\ntype RegistryInput = Record<string, Type<unknown> | RenderViewEntry>;\n\ninterface NormalizedEntry {\n component: Type<unknown>;\n fallback: Type<unknown>;\n}\n\nfunction normalize(entry: Type<unknown> | RenderViewEntry): NormalizedEntry {\n // Bare Type — register with the default fallback.\n if (typeof entry === 'function') {\n return { component: entry, fallback: DefaultFallbackComponent };\n }\n // Object form — preserve component; use configured fallback or default.\n return {\n component: entry.component,\n fallback: entry.fallback ?? DefaultFallbackComponent,\n };\n}\n\nexport function defineAngularRegistry(componentMap: RegistryInput): AngularRegistry {\n const map = new Map<string, NormalizedEntry>();\n for (const [name, entry] of Object.entries(componentMap)) {\n map.set(name, normalize(entry));\n }\n return {\n get: (name: string) => map.get(name)?.component,\n getFallback: (name: string) => map.get(name)?.fallback,\n names: () => [...map.keys()],\n };\n}\n","// SPDX-License-Identifier: MIT\nimport { signal } from '@angular/core';\nimport type { StateStore, StateModel } from '@json-render/core';\n\nfunction parsePointer(path: string): string[] {\n if (!path || path === '/') return [];\n return path.split('/').filter((_, i) => i > 0).map(s => s.replace(/~1/g, '/').replace(/~0/g, '~'));\n}\n\nfunction getByPath(obj: unknown, segments: string[]): unknown {\n let current: unknown = obj;\n for (const seg of segments) {\n if (current == null || typeof current !== 'object') return undefined;\n current = (current as Record<string, unknown>)[seg];\n }\n return current;\n}\n\nfunction setByPath(obj: unknown, segments: string[], value: unknown): unknown {\n if (segments.length === 0) return value;\n const [head, ...rest] = segments;\n\n if (Array.isArray(obj)) {\n const index = Number(head);\n const clone = [...obj];\n clone[index] = setByPath(clone[index], rest, value);\n return clone;\n }\n\n const record = (obj != null && typeof obj === 'object')\n ? { ...obj as Record<string, unknown> }\n : {} as Record<string, unknown>;\n record[head] = setByPath(record[head], rest, value);\n return record;\n}\n\nexport function signalStateStore(initialState: StateModel = {}): StateStore {\n const state = signal<StateModel>(initialState);\n const listeners = new Set<() => void>();\n\n function notify(): void {\n for (const listener of listeners) listener();\n }\n\n return {\n get(path: string): unknown {\n return getByPath(state(), parsePointer(path));\n },\n set(path: string, value: unknown): void {\n const segments = parsePointer(path);\n const current = getByPath(state(), segments);\n if (current === value) return;\n state.set(setByPath(state(), segments, value) as StateModel);\n notify();\n },\n update(updates: Record<string, unknown>): void {\n let current = state();\n let changed = false;\n for (const [path, value] of Object.entries(updates)) {\n const segments = parsePointer(path);\n const existing = getByPath(current, segments);\n if (existing !== value) {\n current = setByPath(current, segments, value) as StateModel;\n changed = true;\n }\n }\n if (changed) {\n state.set(current);\n notify();\n }\n },\n getSnapshot(): StateModel {\n return state();\n },\n subscribe(listener: () => void): () => void {\n listeners.add(listener);\n return () => listeners.delete(listener);\n },\n };\n}\n","// SPDX-License-Identifier: MIT\nimport { InjectionToken, Signal } from '@angular/core';\n\nexport interface RenderLifecycle {\n /** First mount event in this render context. Sticky — does not reset. */\n readonly firstMountAt: Signal<{ kind: 'spec' | 'element'; elementType?: string; at: number } | null>;\n /** Total mount count since render context started. */\n readonly mountCount: Signal<number>;\n /** Epoch ms of the most recent mount event. */\n readonly lastMountAt: Signal<number | null>;\n /** Epoch ms of the most recent state-change event. */\n readonly lastStateChangeAt: Signal<number | null>;\n /** Most recent handler invocation. */\n readonly lastHandlerInvokedAt: Signal<{ action: string; at: number } | null>;\n}\n\nexport const RENDER_LIFECYCLE = new InjectionToken<RenderLifecycle>('RENDER_LIFECYCLE');\n","// SPDX-License-Identifier: MIT\nimport { Injectable, signal } from '@angular/core';\nimport type { RenderLifecycle } from './lifecycle';\n\n/**\n * Provided by `provideRender()` — opt-in. Scope follows the consumer's\n * `provideRender` call (root-scoped by default, sub-tree if `provideRender`\n * is in a sub-injector).\n */\n@Injectable()\nexport class RenderLifecycleService implements RenderLifecycle {\n private _firstMountAt = signal<{ kind: 'spec' | 'element'; elementType?: string; at: number } | null>(null);\n private _mountCount = signal(0);\n private _lastMountAt = signal<number | null>(null);\n private _lastStateChangeAt = signal<number | null>(null);\n private _lastHandlerInvokedAt = signal<{ action: string; at: number } | null>(null);\n\n readonly firstMountAt = this._firstMountAt.asReadonly();\n readonly mountCount = this._mountCount.asReadonly();\n readonly lastMountAt = this._lastMountAt.asReadonly();\n readonly lastStateChangeAt = this._lastStateChangeAt.asReadonly();\n readonly lastHandlerInvokedAt = this._lastHandlerInvokedAt.asReadonly();\n\n notifyLifecycle(event: { kind: 'spec' | 'element'; type: 'mounted' | 'destroyed'; elementType?: string }): void {\n if (event.type === 'mounted') {\n const now = Date.now();\n if (this._firstMountAt() === null) {\n this._firstMountAt.set({ kind: event.kind, elementType: event.elementType, at: now });\n }\n this._mountCount.update((c) => c + 1);\n this._lastMountAt.set(now);\n }\n }\n\n notifyStateChange(): void {\n this._lastStateChangeAt.set(Date.now());\n }\n\n notifyHandlerInvoked(action: string): void {\n this._lastHandlerInvokedAt.set({ action, at: Date.now() });\n }\n}\n","// SPDX-License-Identifier: MIT\nimport { InjectionToken, makeEnvironmentProviders } from '@angular/core';\nimport type { RenderConfig } from './render.types';\nimport { RENDER_LIFECYCLE } from './lifecycle';\nimport { RenderLifecycleService } from './render-lifecycle.service';\n\nexport const RENDER_CONFIG = new InjectionToken<RenderConfig>('RENDER_CONFIG');\n\nexport function provideRender(config: RenderConfig) {\n return makeEnvironmentProviders([\n { provide: RENDER_CONFIG, useValue: config },\n RenderLifecycleService,\n { provide: RENDER_LIFECYCLE, useExisting: RenderLifecycleService },\n ]);\n}\n","// SPDX-License-Identifier: MIT\nimport type { StateStore, ComputedFunction, PropResolutionContext } from '@json-render/core';\nimport type { RepeatScope } from '../contexts/repeat-scope';\n\nexport function buildPropResolutionContext(\n store: StateStore,\n repeatScope?: RepeatScope,\n functions?: Record<string, ComputedFunction>,\n): PropResolutionContext {\n const ctx: PropResolutionContext = {\n stateModel: store.getSnapshot(),\n };\n if (repeatScope) {\n ctx.repeatItem = repeatScope.item;\n ctx.repeatIndex = repeatScope.index;\n ctx.repeatBasePath = repeatScope.basePath;\n }\n if (functions) {\n ctx.functions = functions;\n }\n return ctx;\n}\n","// SPDX-License-Identifier: MIT\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n effect,\n inject,\n Injector,\n input,\n OnInit,\n reflectComponentType,\n runInInjectionContext,\n signal,\n type Signal,\n type Type,\n} from '@angular/core';\nimport { NgComponentOutlet } from '@angular/common';\nimport {\n evaluateVisibility,\n resolveBindings,\n resolveElementProps,\n} from '@json-render/core';\nimport type { Spec, UIElement } from '@json-render/core';\n\nimport { RENDER_CONTEXT } from './contexts/render-context';\nimport { REPEAT_SCOPE } from './contexts/repeat-scope';\nimport type { RepeatScope } from './contexts/repeat-scope';\nimport { buildPropResolutionContext } from './internals/prop-signal';\nimport type { AngularComponentRenderer } from './render.types';\n\n/** Magic prefix on `emit()` strings that catalog components use to\n * write back to the data model (binding `path` and the new value). The\n * render-element's emitFn intercepts this and writes via the state\n * store, sidestepping the normal `el.on[event]` handler binding which\n * the catalog components have no way to declare for arbitrary paths. */\nconst A2UI_DATAMODEL_PREFIX = 'a2ui:datamodel:';\n\n/** Cache of declared input names per component class. NgComponentOutlet\n * passes every key in its `inputs` prop to the target; Angular dev mode\n * raises NG0303 for any input the component doesn't declare. We strip\n * undeclared keys before mounting so simple view components (`StatCard`,\n * `Container`, etc.) don't get spammed with framework-only inputs\n * (`bindings`, `emit`, `loading`, `childKeys`, `spec`) they ignore. */\n/** `null` means reflection failed (likely uncompiled / non-component) — in\n * that case we pass inputs through unmodified rather than swallow them.\n * An empty Set means the component genuinely declares zero inputs (e.g. a\n * pure presentational fallback) and ALL keys should be dropped. */\nconst declaredInputsCache = new WeakMap<Type<unknown>, Set<string> | null>();\nfunction getDeclaredInputs(cls: Type<unknown>): Set<string> | null {\n if (declaredInputsCache.has(cls)) return declaredInputsCache.get(cls)!;\n const meta = reflectComponentType(cls);\n const result = meta ? new Set<string>(meta.inputs.map(i => i.templateName)) : null;\n declaredInputsCache.set(cls, result);\n return result;\n}\nfunction filterInputsForClass(\n cls: Type<unknown> | null,\n inputs: Record<string, unknown>,\n): Record<string, unknown> {\n if (!cls) return inputs;\n const declared = getDeclaredInputs(cls);\n if (declared === null) return inputs;\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(inputs)) {\n if (declared.has(k)) out[k] = v;\n }\n return out;\n}\n\n/** Best-effort string→typed coercion for datamodel writes. Catalog\n * components emit raw string values; the underlying state may have\n * been declared as number/boolean/array, and consumers reading the\n * resolved props expect the correct type. */\nfunction coerceValue(raw: string): unknown {\n if (raw === '') return '';\n if (raw === 'true') return true;\n if (raw === 'false') return false;\n // JSON-array passthrough (MultipleChoice emits stringified arrays)\n if (raw.startsWith('[') && raw.endsWith(']')) {\n try { return JSON.parse(raw); } catch { /* fall through */ }\n }\n // Numeric — only if the entire string parses cleanly as a number\n if (/^-?\\d+(?:\\.\\d+)?$/.test(raw)) {\n const n = Number(raw);\n if (!Number.isNaN(n)) return n;\n }\n return raw;\n}\n\n/**\n * Recursive element renderer.\n *\n * For each element key it:\n * 1. Looks up the UIElement from spec.elements\n * 2. Resolves the component class from the registry\n * 3. Evaluates visibility\n * 4. Resolves prop expressions and bindings\n * 5. Renders via NgComponentOutlet with resolved inputs\n *\n * For elements with `repeat`, it iterates over the state array,\n * creating a child Injector with RepeatScope for each item.\n */\n@Component({\n selector: 'render-element',\n standalone: true,\n imports: [NgComponentOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (!element()?.repeat) {\n @if (visible()) {\n <ng-container\n *ngComponentOutlet=\"mountClass(); inputs: filteredResolvedInputs(); injector: parentInjector\"\n />\n }\n } @else {\n @for (repeatInjector of repeatInjectors(); track $index) {\n <ng-container\n *ngComponentOutlet=\"mountClass(); inputs: filteredRepeatInputs()[$index]; injector: repeatInjector\"\n />\n }\n }\n `,\n})\nexport class RenderElementComponent implements OnInit {\n readonly elementKey = input.required<string>();\n readonly spec = input.required<Spec>();\n\n private readonly ctx = inject(RENDER_CONTEXT);\n private readonly repeatScope = inject(REPEAT_SCOPE, { optional: true });\n readonly parentInjector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n this.destroyRef.onDestroy(() => {\n const el = this.element();\n if (el && (el as any)['lifecycle'] && this.ctx.emitEvent) {\n this.ctx.emitEvent({\n type: 'lifecycle',\n event: 'destroyed',\n scope: 'element',\n elementKey: this.elementKey(),\n elementType: el.type,\n });\n }\n });\n\n // Latch mountedReal=true once the real component is selected. Lives in\n // an effect (not the computed) because Angular forbids signal writes\n // inside computed — they're for derivation only. Effects are the\n // idiomatic place for \"signal change → signal write\" side effects.\n effect(() => {\n if (this.mountedReal()) return;\n const el = this.element();\n if (!el) return;\n // Only latch when notReady is false AND a real component is registered.\n if (!this.notReady() && this.ctx.registry.get(el.type)) {\n this.mountedReal.set(true);\n }\n });\n }\n\n ngOnInit(): void {\n const el = this.element();\n if (el && (el as any)['lifecycle'] && this.ctx.emitEvent) {\n this.ctx.emitEvent({\n type: 'lifecycle',\n event: 'mounted',\n scope: 'element',\n elementKey: this.elementKey(),\n elementType: el.type,\n });\n }\n }\n\n /** The UIElement definition from the spec. Only propagates when reference changes. */\n readonly element: Signal<UIElement | undefined> = computed(\n () => this.spec()?.elements?.[this.elementKey()],\n { equal: Object.is },\n );\n\n /** The Angular component class for this element type. */\n readonly componentClass = computed<AngularComponentRenderer | null>(() => {\n const el = this.element();\n if (!el) return null;\n return this.ctx.registry.get(el.type) ?? null;\n });\n\n /** Prop resolution context built from store + repeat scope. */\n private readonly propCtx = computed(() =>\n buildPropResolutionContext(\n this.ctx.store,\n this.repeatScope ?? undefined,\n this.ctx.functions,\n ),\n );\n\n /** Once real mounts, never revert to fallback even if a state-bound\n * prop later becomes undefined. Per-instance monotonic gate. */\n private readonly mountedReal = signal<boolean>(false);\n\n /** True when ANY resolved prop value is undefined (i.e. a state\n * binding points at a path the store hasn't populated). Framework-\n * injected keys (bindings, emit, loading, childKeys, spec) are\n * excluded — only consumer-resolved props matter for readiness. */\n readonly notReady = computed<boolean>(() => {\n if (this.mountedReal()) return false;\n const el = this.element();\n if (!el || !el.props) return false;\n const resolved = resolveElementProps(el.props, this.propCtx());\n for (const v of Object.values(resolved)) {\n if (v === undefined) return true;\n }\n return false;\n });\n\n /** Picks fallback or real based on notReady. The mountedReal latch is\n * driven by a constructor effect (not this computed) — Angular forbids\n * signal writes inside computed. */\n readonly mountClass = computed<AngularComponentRenderer | null>(() => {\n const el = this.element();\n if (!el) return null;\n const real = this.ctx.registry.get(el.type) ?? null;\n if (this.notReady()) {\n return this.ctx.registry.getFallback(el.type) ?? null;\n }\n return real;\n });\n\n /** Whether the element is visible (non-repeat path). */\n readonly visible = computed(() => {\n const el = this.element();\n if (!el) return false;\n if (this.mountClass() === null) return false;\n return evaluateVisibility(el.visible, this.propCtx());\n });\n\n /** Emit function that delegates to context handlers AND handles the\n * canonical `a2ui:datamodel:<path>:<value>` write-back protocol that\n * input components (TextField, MultipleChoice, CheckBox, Slider,\n * DateTimeInput) emit when the user changes their value. The render\n * lib's state store is the single source of truth for in-surface UI\n * state; writing through it triggers re-render with the new value\n * and re-evaluates any path-bound props (validation, computed\n * visibility, etc.).\n *\n * The string format is `a2ui:datamodel:<path>:<value>` where:\n * - `<path>` is a JSON-Pointer-style path (e.g. `/name`, `/form/email`)\n * - `<value>` is the raw value rendered as a string. We attempt to\n * coerce numeric and boolean literals back to their typed form\n * so downstream consumers see correct types; arrays come through\n * as JSON-stringified payloads (catalog components emit them via\n * `JSON.stringify`).\n */\n private readonly emitFn = (event: string) => {\n if (event.startsWith(A2UI_DATAMODEL_PREFIX)) {\n this.applyDatamodelWrite(event);\n return;\n }\n const el = this.element();\n if (!el?.on) return;\n const binding = el.on[event];\n if (!binding) return;\n const bindings = Array.isArray(binding) ? binding : [binding];\n for (const b of bindings) {\n const handler = this.ctx.handlers?.[b.action];\n if (handler) {\n runInInjectionContext(this.parentInjector, () =>\n handler(b.params as Record<string, unknown> ?? {}),\n );\n }\n }\n };\n\n private applyDatamodelWrite(event: string): void {\n // Strip the prefix, then split path and value at the last `:` —\n // path may itself contain `:` characters (rare but legal in\n // JSON-Pointer per RFC 6901), and values can certainly contain\n // them (URLs, time strings). Catalog components emit\n // `a2ui:datamodel:<path>:<value>` where path is the binding's\n // path-ref (usually starts with `/`); split the LAST `:` because\n // the value is the only field guaranteed to come last.\n const rest = event.slice(A2UI_DATAMODEL_PREFIX.length);\n const lastColon = rest.lastIndexOf(':');\n if (lastColon === -1) return;\n const path = rest.slice(0, lastColon);\n const rawValue = rest.slice(lastColon + 1);\n if (!path) return;\n const store = this.ctx.store;\n if (!store) return;\n store.set(path, coerceValue(rawValue));\n }\n\n /** Resolved inputs for non-repeat elements. */\n readonly resolvedInputs = computed(() => {\n const el = this.element();\n if (!el) return {};\n const ctx = this.propCtx();\n const resolved = resolveElementProps(el.props ?? {}, ctx);\n const bindings = resolveBindings(el.props ?? {}, ctx);\n return {\n ...resolved,\n bindings,\n emit: this.emitFn,\n loading: this.ctx.loading ?? false,\n childKeys: el.children ?? [],\n spec: this.spec(),\n };\n });\n\n /** `resolvedInputs` filtered down to keys the target component actually\n * declares — silences NG0303 dev-mode warnings from framework-only\n * inputs (bindings/emit/loading/childKeys/spec) passed to simple view\n * components that don't declare them. */\n readonly filteredResolvedInputs = computed(() =>\n filterInputsForClass(this.mountClass() as Type<unknown> | null, this.resolvedInputs()),\n );\n\n // --- Repeat support ---\n\n /** Items from the state array for repeat elements. */\n private readonly repeatItems = computed<unknown[]>(() => {\n const el = this.element();\n if (!el?.repeat) return [];\n const items = this.ctx.store.get(el.repeat.statePath);\n return Array.isArray(items) ? items : [];\n });\n\n /** One RepeatScope per repeat item, shared between injectors and inputs. */\n private readonly repeatScopes = computed(() => {\n const el = this.element();\n if (!el?.repeat) return [];\n return this.repeatItems().map((item, index) => ({\n item,\n index,\n basePath: `${el.repeat!.statePath}/${index}`,\n } satisfies RepeatScope));\n });\n\n /** One child Injector per repeat item, providing RepeatScope. */\n readonly repeatInjectors = computed(() => {\n return this.repeatScopes().map(scope =>\n Injector.create({\n providers: [{ provide: REPEAT_SCOPE, useValue: scope }],\n parent: this.parentInjector,\n }),\n );\n });\n\n /** Resolved inputs for each repeat item. */\n readonly repeatInputs = computed(() => {\n const el = this.element();\n if (!el?.repeat) return [];\n return this.repeatScopes().map(scope => {\n const ctx = buildPropResolutionContext(\n this.ctx.store,\n scope,\n this.ctx.functions,\n );\n const resolved = resolveElementProps(el.props ?? {}, ctx);\n const bindings = resolveBindings(el.props ?? {}, ctx);\n return {\n ...resolved,\n bindings,\n emit: this.emitFn,\n loading: this.ctx.loading ?? false,\n childKeys: el.children ?? [],\n spec: this.spec(),\n };\n });\n });\n\n /** `repeatInputs` filtered per-item to declared component inputs. */\n readonly filteredRepeatInputs = computed(() => {\n const cls = this.mountClass() as Type<unknown> | null;\n return this.repeatInputs().map(inputs => filterInputsForClass(cls, inputs));\n });\n}\n","// SPDX-License-Identifier: MIT\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n effect,\n inject,\n input,\n OnInit,\n output,\n} from '@angular/core';\nimport type { ComputedFunction, Spec, StateStore } from '@json-render/core';\n\nimport { RenderElementComponent } from './render-element.component';\nimport { RENDER_CONFIG } from './provide-render';\nimport { RENDER_CONTEXT } from './contexts/render-context';\nimport type { RenderContext } from './contexts/render-context';\nimport type { AngularRegistry } from './render.types';\nimport { signalStateStore } from './signal-state-store';\nimport type { RenderEvent } from './render-event';\nimport { RenderLifecycleService } from './render-lifecycle.service';\n\n/**\n * Top-level entry point for rendering a json-render spec.\n *\n * Accepts the spec, registry, store, functions, handlers, and loading\n * as inputs. Provides `RENDER_CONTEXT` to child `RenderElementComponent`\n * instances via `viewProviders`.\n *\n * Falls back to `RENDER_CONFIG` (from `provideRender()`) for registry\n * and store defaults when inputs are not provided.\n *\n * @example\n * ```html\n * <render-spec [spec]=\"spec()\" [registry]=\"registry\" [store]=\"store\" />\n * ```\n */\n@Component({\n selector: 'render-spec',\n standalone: true,\n imports: [RenderElementComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n viewProviders: [\n {\n provide: RENDER_CONTEXT,\n useFactory: () => inject(RenderSpecComponent)._context(),\n },\n ],\n template: `\n @if (spec()?.root; as rootKey) {\n <render-element [elementKey]=\"rootKey\" [spec]=\"spec()!\" />\n }\n `,\n})\nexport class RenderSpecComponent implements OnInit {\n readonly spec = input<Spec | null>(null);\n readonly registry = input<AngularRegistry | undefined>(undefined);\n readonly store = input<StateStore | undefined>(undefined);\n readonly functions = input<Record<string, ComputedFunction> | undefined>(undefined);\n readonly handlers = input<Record<string, (params: Record<string, unknown>) => unknown | Promise<unknown>> | undefined>(undefined);\n readonly loading = input<boolean>(false);\n readonly events = output<RenderEvent>();\n\n private readonly config = inject(RENDER_CONFIG, { optional: true });\n private readonly destroyRef = inject(DestroyRef);\n private readonly lifecycle = inject(RenderLifecycleService, { optional: true });\n\n /** Internal store, lazily created once and reused across spec changes. */\n private _internalStore: StateStore | undefined;\n\n private getOrCreateInternalStore(): StateStore {\n if (!this._internalStore) {\n this._internalStore = signalStateStore(this.spec()?.state ?? {});\n }\n return this._internalStore;\n }\n\n /** Resolved store: input > config > internal (from spec.state). */\n private readonly resolvedStore = computed<StateStore>(() => {\n const inputStore = this.store();\n if (inputStore) return inputStore;\n const configStore = this.config?.store;\n if (configStore) return configStore;\n return this.getOrCreateInternalStore();\n });\n\n /** Resolved registry: input > config. */\n private readonly resolvedRegistry = computed<AngularRegistry>(() => {\n const inputRegistry = this.registry();\n if (inputRegistry) return inputRegistry;\n const configRegistry = this.config?.registry;\n if (configRegistry) return configRegistry;\n // Fallback: empty registry\n return { get: () => undefined, getFallback: () => undefined, names: () => [] };\n });\n\n /** Wraps input handlers to emit RenderHandlerEvent after execution. */\n private readonly wrappedHandlers = computed(() => {\n const inputHandlers = this.handlers() ?? this.config?.handlers;\n if (!inputHandlers) return undefined;\n const wrapped: Record<string, (params: Record<string, unknown>) => unknown | Promise<unknown>> = {};\n for (const [name, handler] of Object.entries(inputHandlers)) {\n wrapped[name] = (params: Record<string, unknown>) => {\n const result = handler(params);\n if (result instanceof Promise) {\n result.then(\n (r) => {\n this.emitTapped({ type: 'handler', action: name, params, result: r });\n },\n () => {\n this.emitTapped({ type: 'handler', action: name, params, result: undefined });\n },\n );\n } else {\n this.emitTapped({ type: 'handler', action: name, params, result });\n }\n return result;\n };\n }\n return wrapped;\n });\n\n /** Emits a RenderEvent through the events output and notifies the\n * lifecycle service (single tap point — all events flow through here). */\n private readonly emitTapped = (event: RenderEvent): void => {\n this.events.emit(event);\n if (!this.lifecycle) return;\n switch (event.type) {\n case 'lifecycle':\n this.lifecycle.notifyLifecycle({\n kind: event.scope,\n type: event.event,\n elementType: event.elementType,\n });\n break;\n case 'stateChange':\n this.lifecycle.notifyStateChange();\n break;\n case 'handler':\n this.lifecycle.notifyHandlerInvoked(event.action);\n break;\n }\n };\n\n /** Emits a RenderEvent through the events output. */\n private readonly emitEvent = (event: RenderEvent) => {\n this.emitTapped(event);\n };\n\n /** The RenderContext provided to children via viewProviders. */\n readonly _context = computed<RenderContext>(() => ({\n registry: this.resolvedRegistry(),\n store: this.resolvedStore(),\n functions: this.functions() ?? this.config?.functions,\n handlers: this.wrappedHandlers(),\n emitEvent: this.emitEvent,\n loading: this.loading(),\n }));\n\n constructor() {\n // Subscribe to store changes and emit state change events\n effect(() => {\n const store = this.resolvedStore();\n const unsub = store.subscribe(() => {\n const snapshot = store.getSnapshot() as Record<string, unknown>;\n this.emitTapped({\n type: 'stateChange',\n path: '/',\n value: snapshot,\n snapshot,\n });\n });\n this.destroyRef.onDestroy(unsub);\n });\n\n this.destroyRef.onDestroy(() => {\n this.emitTapped({ type: 'lifecycle', event: 'destroyed', scope: 'spec' });\n });\n }\n\n ngOnInit(): void {\n this.emitTapped({ type: 'lifecycle', event: 'mounted', scope: 'spec' });\n }\n}\n","// SPDX-License-Identifier: MIT\nimport { Type } from '@angular/core';\nimport type { AngularRegistry, RenderViewEntry } from './render.types';\nimport { defineAngularRegistry } from './define-angular-registry';\n\n/**\n * A registry of view components available for generative UI rendering.\n * Each entry is either a bare component Type (legacy shape) or a\n * `RenderViewEntry` { component, fallback? }.\n */\nexport type ViewRegistry = Readonly<Record<string, Type<unknown> | RenderViewEntry>>;\n\n/**\n * Creates a view registry from a name → component map.\n */\nexport function views(map: Record<string, Type<unknown> | RenderViewEntry>): ViewRegistry {\n return Object.freeze({ ...map });\n}\n\n/**\n * Adds views to a registry without overwriting existing entries.\n * New keys are added; keys that already exist in `base` are preserved.\n */\nexport function withViews(\n base: ViewRegistry,\n additions: Record<string, Type<unknown> | RenderViewEntry>,\n): ViewRegistry {\n return Object.freeze({ ...additions, ...base });\n}\n\n/**\n * Removes views from a registry by name.\n */\nexport function withoutViews(\n base: ViewRegistry,\n ...names: string[]\n): ViewRegistry {\n const result = { ...base };\n for (const name of names) delete result[name];\n return Object.freeze(result);\n}\n\n/**\n * Converts a ViewRegistry to an AngularRegistry for use with RenderSpecComponent.\n */\nexport function toRenderRegistry(registry: ViewRegistry): AngularRegistry {\n return defineAngularRegistry(registry);\n}\n","// SPDX-License-Identifier: MIT\nimport { InjectionToken, makeEnvironmentProviders } from '@angular/core';\nimport type { ViewRegistry } from './views';\n\nexport const VIEW_REGISTRY = new InjectionToken<ViewRegistry>('VIEW_REGISTRY');\n\nexport function provideViews(registry: ViewRegistry) {\n return makeEnvironmentProviders([\n { provide: VIEW_REGISTRY, useValue: registry },\n ]);\n}\n","// SPDX-License-Identifier: MIT\n\n// Types\nexport type {\n AngularComponentInputs,\n AngularComponentRenderer,\n AngularRegistry,\n RenderConfig,\n} from './lib/render.types';\n\n// Contexts\nexport { RENDER_CONTEXT } from './lib/contexts/render-context';\nexport type { RenderContext } from './lib/contexts/render-context';\nexport { REPEAT_SCOPE } from './lib/contexts/repeat-scope';\nexport type { RepeatScope } from './lib/contexts/repeat-scope';\n\n// Registry\nexport { defineAngularRegistry } from './lib/define-angular-registry';\n\n// State\nexport { signalStateStore } from './lib/signal-state-store';\n\n// Provider\nexport { provideRender, RENDER_CONFIG } from './lib/provide-render';\n\n// Components\nexport { RenderElementComponent } from './lib/render-element.component';\nexport { RenderSpecComponent } from './lib/render-spec.component';\n\n// Views\nexport { views, withViews, withoutViews, toRenderRegistry } from './lib/views';\nexport type { ViewRegistry } from './lib/views';\nexport { provideViews, VIEW_REGISTRY } from './lib/provide-views';\n\n// Events\nexport type {\n RenderEvent,\n RenderHandlerEvent,\n RenderStateChangeEvent,\n RenderLifecycleEvent,\n} from './lib/render-event';\n\n// Lifecycle\nexport { RENDER_LIFECYCLE } from './lib/lifecycle';\nexport type { RenderLifecycle } from './lib/lifecycle';\n\n// Fallback\nexport { DefaultFallbackComponent } from './lib/default-fallback.component';\nexport type { RenderViewEntry } from './lib/render.types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;MAea,cAAc,GAAG,IAAI,cAAc,CAAgB,gBAAgB;;ACfhF;MASa,YAAY,GAAG,IAAI,cAAc,CAAc,cAAc;;ACT1E;MA2Da,wBAAwB,CAAA;uGAAxB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAxB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAdzB;;;;;;;;;;;;AAYT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,ggCAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,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CAAA;AACF,iBAAA;;;AC1CD;;AAEG;AACG,SAAU,KAAK,CAAC,GAAoD,EAAA;IACxE,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC;AAClC;AAEA;;;AAGG;AACG,SAAU,SAAS,CACvB,IAAkB,EAClB,SAA0D,EAAA;AAE1D,IAAA,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,SAAS,EAAE,GAAG,IAAI,EAAE,CAAC;AACjD;AAEA;;AAEG;SACa,YAAY,CAC1B,IAAkB,EAClB,GAAG,KAAe,EAAA;AAElB,IAAA,MAAM,MAAM,GAAG,EAAE,GAAG,IAAI,EAAE;IAC1B,KAAK,MAAM,IAAI,IAAI,KAAK;AAAE,QAAA,OAAO,MAAM,CAAC,IAAI,CAAC;AAC7C,IAAA,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;AAC9B;AAEA;;AAEG;AACG,SAAU,gBAAgB,CAAC,QAAsB,EAAA;AACrD,IAAA,OAAO,qBAAqB,CAAC,QAAQ,CAAC;AACxC;;AC/CA;MAIa,aAAa,GAAG,IAAI,cAAc,CAAe,eAAe;AAEvE,SAAU,YAAY,CAAC,QAAsB,EAAA;AACjD,IAAA,OAAO,wBAAwB,CAAC;AAC9B,QAAA,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE;AAC/C,KAAA,CAAC;AACJ;;ACVA;AAUA;;ACVA;;AAEG;;;;"}
1
+ {"version":3,"file":"threadplane-render.mjs","sources":["../../../../libs/render/src/lib/contexts/render-context.ts","../../../../libs/render/src/lib/contexts/repeat-scope.ts","../../../../libs/render/src/lib/default-fallback.component.ts","../../../../libs/render/src/lib/define-angular-registry.ts","../../../../libs/render/src/lib/signal-state-store.ts","../../../../libs/render/src/lib/lifecycle.ts","../../../../libs/render/src/lib/render-lifecycle.service.ts","../../../../libs/render/src/lib/provide-render.ts","../../../../libs/render/src/lib/internals/prop-signal.ts","../../../../libs/render/src/lib/render-element.component.ts","../../../../libs/render/src/lib/provide-views.ts","../../../../libs/render/src/lib/views.ts","../../../../libs/render/src/lib/render-spec.component.ts","../../../../libs/render/src/public-api.ts","../../../../libs/render/src/threadplane-render.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\nimport { InjectionToken } from '@angular/core';\nimport type { StateStore, ComputedFunction } from '@json-render/core';\nimport type { AngularRegistry } from '../render.types';\nimport type { RenderEvent } from '../render-event';\n\nexport interface RenderContext {\n registry: AngularRegistry;\n store: StateStore;\n functions?: Record<string, ComputedFunction>;\n handlers?: Record<string, (params: Record<string, unknown>) => unknown | Promise<unknown>>;\n emitEvent?: (event: RenderEvent) => void;\n loading?: boolean;\n}\n\nexport const RENDER_CONTEXT = new InjectionToken<RenderContext>('RENDER_CONTEXT');\n","// SPDX-License-Identifier: MIT\nimport { InjectionToken } from '@angular/core';\n\nexport interface RepeatScope {\n item: unknown;\n index: number;\n basePath: string;\n}\n\nexport const REPEAT_SCOPE = new InjectionToken<RepeatScope>('REPEAT_SCOPE');\n","// SPDX-License-Identifier: MIT\nimport { Component, ChangeDetectionStrategy } from '@angular/core';\n\n@Component({\n selector: 'render-default-fallback',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n styles: [`\n :host { display: block; width: 100%; }\n .render-default-fallback {\n border: 1px solid var(--ngaf-chat-separator, #303540);\n border-radius: 10px;\n padding: 14px;\n background: var(--ngaf-chat-surface-alt, #1a1d23);\n }\n .render-default-fallback__label {\n font-size: 12px;\n color: var(--ngaf-chat-text-muted, #9aa0aa);\n margin-bottom: 10px;\n display: flex;\n align-items: center;\n gap: 6px;\n }\n .render-default-fallback__rows {\n display: flex; flex-direction: column; gap: 8px;\n }\n .render-default-fallback__row {\n height: 10px; border-radius: 5px;\n background: linear-gradient(\n 90deg,\n var(--ngaf-chat-separator, #303540) 0%,\n color-mix(in srgb, var(--ngaf-chat-separator, #303540) 70%, transparent) 50%,\n var(--ngaf-chat-separator, #303540) 100%\n );\n background-size: 200% 100%;\n animation: render-default-fallback-shimmer 1.4s ease-in-out infinite;\n }\n .render-default-fallback__row:nth-child(1) { width: 70%; }\n .render-default-fallback__row:nth-child(2) { width: 90%; }\n .render-default-fallback__row:nth-child(3) { width: 50%; }\n @keyframes render-default-fallback-shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n `],\n template: `\n <div class=\"render-default-fallback\" role=\"status\" aria-live=\"polite\">\n <div class=\"render-default-fallback__label\">\n <span aria-hidden=\"true\">✨</span>\n <span>Building UI…</span>\n </div>\n <div class=\"render-default-fallback__rows\">\n <div class=\"render-default-fallback__row\"></div>\n <div class=\"render-default-fallback__row\"></div>\n <div class=\"render-default-fallback__row\"></div>\n </div>\n </div>\n `,\n})\nexport class DefaultFallbackComponent {}\n","// SPDX-License-Identifier: MIT\nimport { Type } from '@angular/core';\nimport type { AngularRegistry, RenderViewEntry } from './render.types';\nimport { DefaultFallbackComponent } from './default-fallback.component';\n\ntype RegistryInput = Record<string, Type<unknown> | RenderViewEntry>;\n\ninterface NormalizedEntry {\n component: Type<unknown>;\n fallback: Type<unknown>;\n}\n\nfunction normalize(entry: Type<unknown> | RenderViewEntry): NormalizedEntry {\n // Bare Type — register with the default fallback.\n if (typeof entry === 'function') {\n return { component: entry, fallback: DefaultFallbackComponent };\n }\n // Object form — preserve component; use configured fallback or default.\n return {\n component: entry.component,\n fallback: entry.fallback ?? DefaultFallbackComponent,\n };\n}\n\nexport function defineAngularRegistry(componentMap: RegistryInput): AngularRegistry {\n const map = new Map<string, NormalizedEntry>();\n for (const [name, entry] of Object.entries(componentMap)) {\n map.set(name, normalize(entry));\n }\n return {\n get: (name: string) => map.get(name)?.component,\n getFallback: (name: string) => map.get(name)?.fallback,\n names: () => [...map.keys()],\n };\n}\n","// SPDX-License-Identifier: MIT\nimport { signal } from '@angular/core';\nimport type { StateStore, StateModel } from '@json-render/core';\n\nfunction parsePointer(path: string): string[] {\n if (!path || path === '/') return [];\n return path.split('/').filter((_, i) => i > 0).map(s => s.replace(/~1/g, '/').replace(/~0/g, '~'));\n}\n\nfunction getByPath(obj: unknown, segments: string[]): unknown {\n let current: unknown = obj;\n for (const seg of segments) {\n if (current == null || typeof current !== 'object') return undefined;\n current = (current as Record<string, unknown>)[seg];\n }\n return current;\n}\n\nfunction setByPath(obj: unknown, segments: string[], value: unknown): unknown {\n if (segments.length === 0) return value;\n const [head, ...rest] = segments;\n\n if (Array.isArray(obj)) {\n const index = Number(head);\n const clone = [...obj];\n clone[index] = setByPath(clone[index], rest, value);\n return clone;\n }\n\n const record = (obj != null && typeof obj === 'object')\n ? { ...obj as Record<string, unknown> }\n : {} as Record<string, unknown>;\n record[head] = setByPath(record[head], rest, value);\n return record;\n}\n\nexport function signalStateStore(initialState: StateModel = {}): StateStore {\n const state = signal<StateModel>(initialState);\n const listeners = new Set<() => void>();\n\n function notify(): void {\n for (const listener of listeners) listener();\n }\n\n return {\n get(path: string): unknown {\n return getByPath(state(), parsePointer(path));\n },\n set(path: string, value: unknown): void {\n const segments = parsePointer(path);\n const current = getByPath(state(), segments);\n if (current === value) return;\n state.set(setByPath(state(), segments, value) as StateModel);\n notify();\n },\n update(updates: Record<string, unknown>): void {\n let current = state();\n let changed = false;\n for (const [path, value] of Object.entries(updates)) {\n const segments = parsePointer(path);\n const existing = getByPath(current, segments);\n if (existing !== value) {\n current = setByPath(current, segments, value) as StateModel;\n changed = true;\n }\n }\n if (changed) {\n state.set(current);\n notify();\n }\n },\n getSnapshot(): StateModel {\n return state();\n },\n subscribe(listener: () => void): () => void {\n listeners.add(listener);\n return () => listeners.delete(listener);\n },\n };\n}\n","// SPDX-License-Identifier: MIT\nimport { InjectionToken, Signal } from '@angular/core';\n\nexport interface RenderLifecycle {\n /** First mount event in this render context. Sticky — does not reset. */\n readonly firstMountAt: Signal<{ kind: 'spec' | 'element'; elementType?: string; at: number } | null>;\n /** Total mount count since render context started. */\n readonly mountCount: Signal<number>;\n /** Epoch ms of the most recent mount event. */\n readonly lastMountAt: Signal<number | null>;\n /** Epoch ms of the most recent state-change event. */\n readonly lastStateChangeAt: Signal<number | null>;\n /** Most recent handler invocation. */\n readonly lastHandlerInvokedAt: Signal<{ action: string; at: number } | null>;\n}\n\nexport const RENDER_LIFECYCLE = new InjectionToken<RenderLifecycle>('RENDER_LIFECYCLE');\n","// SPDX-License-Identifier: MIT\nimport { Injectable, signal } from '@angular/core';\nimport type { RenderLifecycle } from './lifecycle';\n\n/**\n * Provided by `provideRender()` — opt-in. Scope follows the consumer's\n * `provideRender` call (root-scoped by default, sub-tree if `provideRender`\n * is in a sub-injector).\n */\n@Injectable()\nexport class RenderLifecycleService implements RenderLifecycle {\n private _firstMountAt = signal<{ kind: 'spec' | 'element'; elementType?: string; at: number } | null>(null);\n private _mountCount = signal(0);\n private _lastMountAt = signal<number | null>(null);\n private _lastStateChangeAt = signal<number | null>(null);\n private _lastHandlerInvokedAt = signal<{ action: string; at: number } | null>(null);\n\n readonly firstMountAt = this._firstMountAt.asReadonly();\n readonly mountCount = this._mountCount.asReadonly();\n readonly lastMountAt = this._lastMountAt.asReadonly();\n readonly lastStateChangeAt = this._lastStateChangeAt.asReadonly();\n readonly lastHandlerInvokedAt = this._lastHandlerInvokedAt.asReadonly();\n\n notifyLifecycle(event: { kind: 'spec' | 'element'; type: 'mounted' | 'destroyed'; elementType?: string }): void {\n if (event.type === 'mounted') {\n const now = Date.now();\n if (this._firstMountAt() === null) {\n this._firstMountAt.set({ kind: event.kind, elementType: event.elementType, at: now });\n }\n this._mountCount.update((c) => c + 1);\n this._lastMountAt.set(now);\n }\n }\n\n notifyStateChange(): void {\n this._lastStateChangeAt.set(Date.now());\n }\n\n notifyHandlerInvoked(action: string): void {\n this._lastHandlerInvokedAt.set({ action, at: Date.now() });\n }\n}\n","// SPDX-License-Identifier: MIT\nimport { InjectionToken, makeEnvironmentProviders } from '@angular/core';\nimport type { RenderConfig } from './render.types';\nimport { RENDER_LIFECYCLE } from './lifecycle';\nimport { RenderLifecycleService } from './render-lifecycle.service';\n\nexport const RENDER_CONFIG = new InjectionToken<RenderConfig>('RENDER_CONFIG');\n\nexport function provideRender(config: RenderConfig) {\n return makeEnvironmentProviders([\n { provide: RENDER_CONFIG, useValue: config },\n RenderLifecycleService,\n { provide: RENDER_LIFECYCLE, useExisting: RenderLifecycleService },\n ]);\n}\n","// SPDX-License-Identifier: MIT\nimport type { StateStore, ComputedFunction, PropResolutionContext } from '@json-render/core';\nimport type { RepeatScope } from '../contexts/repeat-scope';\n\nexport function buildPropResolutionContext(\n store: StateStore,\n repeatScope?: RepeatScope,\n functions?: Record<string, ComputedFunction>,\n): PropResolutionContext {\n const ctx: PropResolutionContext = {\n stateModel: store.getSnapshot(),\n };\n if (repeatScope) {\n ctx.repeatItem = repeatScope.item;\n ctx.repeatIndex = repeatScope.index;\n ctx.repeatBasePath = repeatScope.basePath;\n }\n if (functions) {\n ctx.functions = functions;\n }\n return ctx;\n}\n","// SPDX-License-Identifier: MIT\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n effect,\n inject,\n Injector,\n input,\n OnInit,\n reflectComponentType,\n runInInjectionContext,\n signal,\n type Signal,\n type Type,\n} from '@angular/core';\nimport { NgComponentOutlet } from '@angular/common';\nimport {\n evaluateVisibility,\n resolveBindings,\n resolveElementProps,\n} from '@json-render/core';\nimport type { Spec, UIElement } from '@json-render/core';\n\nimport { RENDER_CONTEXT } from './contexts/render-context';\nimport { REPEAT_SCOPE } from './contexts/repeat-scope';\nimport type { RepeatScope } from './contexts/repeat-scope';\nimport { buildPropResolutionContext } from './internals/prop-signal';\nimport type { AngularComponentRenderer } from './render.types';\n\n/** Magic prefix on `emit()` strings that catalog components use to\n * write back to the data model (binding `path` and the new value). The\n * render-element's emitFn intercepts this and writes via the state\n * store, sidestepping the normal `el.on[event]` handler binding which\n * the catalog components have no way to declare for arbitrary paths. */\nconst A2UI_DATAMODEL_PREFIX = 'a2ui:datamodel:';\n\n/** Cache of declared input names per component class. NgComponentOutlet\n * passes every key in its `inputs` prop to the target; Angular dev mode\n * raises NG0303 for any input the component doesn't declare. We strip\n * undeclared keys before mounting so simple view components (`StatCard`,\n * `Container`, etc.) don't get spammed with framework-only inputs\n * (`bindings`, `emit`, `loading`, `childKeys`, `spec`) they ignore. */\n/** `null` means reflection failed (likely uncompiled / non-component) — in\n * that case we pass inputs through unmodified rather than swallow them.\n * An empty Set means the component genuinely declares zero inputs (e.g. a\n * pure presentational fallback) and ALL keys should be dropped. */\nconst declaredInputsCache = new WeakMap<Type<unknown>, Set<string> | null>();\nfunction getDeclaredInputs(cls: Type<unknown>): Set<string> | null {\n if (declaredInputsCache.has(cls)) return declaredInputsCache.get(cls)!;\n const meta = reflectComponentType(cls);\n const result = meta ? new Set<string>(meta.inputs.map(i => i.templateName)) : null;\n declaredInputsCache.set(cls, result);\n return result;\n}\nfunction filterInputsForClass(\n cls: Type<unknown> | null,\n inputs: Record<string, unknown>,\n): Record<string, unknown> {\n if (!cls) return inputs;\n const declared = getDeclaredInputs(cls);\n if (declared === null) return inputs;\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(inputs)) {\n if (declared.has(k)) out[k] = v;\n }\n return out;\n}\n\n/** Best-effort string→typed coercion for datamodel writes. Catalog\n * components emit raw string values; the underlying state may have\n * been declared as number/boolean/array, and consumers reading the\n * resolved props expect the correct type. */\nfunction coerceValue(raw: string): unknown {\n if (raw === '') return '';\n if (raw === 'true') return true;\n if (raw === 'false') return false;\n // JSON-array passthrough (MultipleChoice emits stringified arrays)\n if (raw.startsWith('[') && raw.endsWith(']')) {\n try { return JSON.parse(raw); } catch { /* fall through */ }\n }\n // Numeric — only if the entire string parses cleanly as a number\n if (/^-?\\d+(?:\\.\\d+)?$/.test(raw)) {\n const n = Number(raw);\n if (!Number.isNaN(n)) return n;\n }\n return raw;\n}\n\n/**\n * Recursive element renderer.\n *\n * For each element key it:\n * 1. Looks up the UIElement from spec.elements\n * 2. Resolves the component class from the registry\n * 3. Evaluates visibility\n * 4. Resolves prop expressions and bindings\n * 5. Renders via NgComponentOutlet with resolved inputs\n *\n * For elements with `repeat`, it iterates over the state array,\n * creating a child Injector with RepeatScope for each item.\n */\n@Component({\n selector: 'render-element',\n standalone: true,\n imports: [NgComponentOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (!element()?.repeat) {\n @if (visible()) {\n <ng-container\n *ngComponentOutlet=\"mountClass(); inputs: filteredResolvedInputs(); injector: parentInjector\"\n />\n }\n } @else {\n @for (repeatInjector of repeatInjectors(); track $index) {\n <ng-container\n *ngComponentOutlet=\"mountClass(); inputs: filteredRepeatInputs()[$index]; injector: repeatInjector\"\n />\n }\n }\n `,\n})\nexport class RenderElementComponent implements OnInit {\n readonly elementKey = input.required<string>();\n readonly spec = input.required<Spec>();\n\n private readonly ctx = inject(RENDER_CONTEXT);\n private readonly repeatScope = inject(REPEAT_SCOPE, { optional: true });\n readonly parentInjector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n this.destroyRef.onDestroy(() => {\n const el = this.element();\n if (el && (el as any)['lifecycle'] && this.ctx.emitEvent) {\n this.ctx.emitEvent({\n type: 'lifecycle',\n event: 'destroyed',\n scope: 'element',\n elementKey: this.elementKey(),\n elementType: el.type,\n });\n }\n });\n\n // Latch mountedReal=true once the real component is selected. Lives in\n // an effect (not the computed) because Angular forbids signal writes\n // inside computed — they're for derivation only. Effects are the\n // idiomatic place for \"signal change → signal write\" side effects.\n effect(() => {\n if (this.mountedReal()) return;\n const el = this.element();\n if (!el) return;\n // Only latch when notReady is false AND a real component is registered.\n if (!this.notReady() && this.ctx.registry.get(el.type)) {\n this.mountedReal.set(true);\n }\n });\n }\n\n ngOnInit(): void {\n const el = this.element();\n if (el && (el as any)['lifecycle'] && this.ctx.emitEvent) {\n this.ctx.emitEvent({\n type: 'lifecycle',\n event: 'mounted',\n scope: 'element',\n elementKey: this.elementKey(),\n elementType: el.type,\n });\n }\n }\n\n /** The UIElement definition from the spec. Only propagates when reference changes. */\n readonly element: Signal<UIElement | undefined> = computed(\n () => this.spec()?.elements?.[this.elementKey()],\n { equal: Object.is },\n );\n\n /** The Angular component class for this element type. */\n readonly componentClass = computed<AngularComponentRenderer | null>(() => {\n const el = this.element();\n if (!el) return null;\n return this.ctx.registry.get(el.type) ?? null;\n });\n\n /** Prop resolution context built from store + repeat scope. */\n private readonly propCtx = computed(() =>\n buildPropResolutionContext(\n this.ctx.store,\n this.repeatScope ?? undefined,\n this.ctx.functions,\n ),\n );\n\n /** Once real mounts, never revert to fallback even if a state-bound\n * prop later becomes undefined. Per-instance monotonic gate. */\n private readonly mountedReal = signal<boolean>(false);\n\n /** True when ANY resolved prop value is undefined (i.e. a state\n * binding points at a path the store hasn't populated). Framework-\n * injected keys (bindings, emit, loading, childKeys, spec) are\n * excluded — only consumer-resolved props matter for readiness. */\n readonly notReady = computed<boolean>(() => {\n if (this.mountedReal()) return false;\n const el = this.element();\n if (!el || !el.props) return false;\n const resolved = resolveElementProps(el.props, this.propCtx());\n for (const v of Object.values(resolved)) {\n if (v === undefined) return true;\n }\n return false;\n });\n\n /** Picks fallback or real based on notReady. The mountedReal latch is\n * driven by a constructor effect (not this computed) — Angular forbids\n * signal writes inside computed. */\n readonly mountClass = computed<AngularComponentRenderer | null>(() => {\n const el = this.element();\n if (!el) return null;\n const real = this.ctx.registry.get(el.type) ?? null;\n if (this.notReady()) {\n return this.ctx.registry.getFallback(el.type) ?? null;\n }\n return real;\n });\n\n /** Whether the element is visible (non-repeat path). */\n readonly visible = computed(() => {\n const el = this.element();\n if (!el) return false;\n if (this.mountClass() === null) return false;\n return evaluateVisibility(el.visible, this.propCtx());\n });\n\n /** Emit function that delegates to context handlers AND handles the\n * canonical `a2ui:datamodel:<path>:<value>` write-back protocol that\n * input components (TextField, MultipleChoice, CheckBox, Slider,\n * DateTimeInput) emit when the user changes their value. The render\n * lib's state store is the single source of truth for in-surface UI\n * state; writing through it triggers re-render with the new value\n * and re-evaluates any path-bound props (validation, computed\n * visibility, etc.).\n *\n * The string format is `a2ui:datamodel:<path>:<value>` where:\n * - `<path>` is a JSON-Pointer-style path (e.g. `/name`, `/form/email`)\n * - `<value>` is the raw value rendered as a string. We attempt to\n * coerce numeric and boolean literals back to their typed form\n * so downstream consumers see correct types; arrays come through\n * as JSON-stringified payloads (catalog components emit them via\n * `JSON.stringify`).\n */\n private readonly emitFn = (event: string) => {\n if (event.startsWith(A2UI_DATAMODEL_PREFIX)) {\n this.applyDatamodelWrite(event);\n return;\n }\n const el = this.element();\n if (!el?.on) return;\n const binding = el.on[event];\n if (!binding) return;\n const bindings = Array.isArray(binding) ? binding : [binding];\n for (const b of bindings) {\n const handler = this.ctx.handlers?.[b.action];\n if (handler) {\n runInInjectionContext(this.parentInjector, () =>\n handler(b.params as Record<string, unknown> ?? {}),\n );\n }\n }\n };\n\n private applyDatamodelWrite(event: string): void {\n // Strip the prefix, then split path and value at the last `:` —\n // path may itself contain `:` characters (rare but legal in\n // JSON-Pointer per RFC 6901), and values can certainly contain\n // them (URLs, time strings). Catalog components emit\n // `a2ui:datamodel:<path>:<value>` where path is the binding's\n // path-ref (usually starts with `/`); split the LAST `:` because\n // the value is the only field guaranteed to come last.\n const rest = event.slice(A2UI_DATAMODEL_PREFIX.length);\n const lastColon = rest.lastIndexOf(':');\n if (lastColon === -1) return;\n const path = rest.slice(0, lastColon);\n const rawValue = rest.slice(lastColon + 1);\n if (!path) return;\n const store = this.ctx.store;\n if (!store) return;\n store.set(path, coerceValue(rawValue));\n }\n\n /** Resolved inputs for non-repeat elements. */\n readonly resolvedInputs = computed(() => {\n const el = this.element();\n if (!el) return {};\n const ctx = this.propCtx();\n const resolved = resolveElementProps(el.props ?? {}, ctx);\n const bindings = resolveBindings(el.props ?? {}, ctx);\n return {\n ...resolved,\n bindings,\n emit: this.emitFn,\n loading: this.ctx.loading ?? false,\n childKeys: el.children ?? [],\n spec: this.spec(),\n };\n });\n\n /** `resolvedInputs` filtered down to keys the target component actually\n * declares — silences NG0303 dev-mode warnings from framework-only\n * inputs (bindings/emit/loading/childKeys/spec) passed to simple view\n * components that don't declare them. */\n readonly filteredResolvedInputs = computed(() =>\n filterInputsForClass(this.mountClass() as Type<unknown> | null, this.resolvedInputs()),\n );\n\n // --- Repeat support ---\n\n /** Items from the state array for repeat elements. */\n private readonly repeatItems = computed<unknown[]>(() => {\n const el = this.element();\n if (!el?.repeat) return [];\n const items = this.ctx.store.get(el.repeat.statePath);\n return Array.isArray(items) ? items : [];\n });\n\n /** One RepeatScope per repeat item, shared between injectors and inputs. */\n private readonly repeatScopes = computed(() => {\n const el = this.element();\n if (!el?.repeat) return [];\n return this.repeatItems().map((item, index) => ({\n item,\n index,\n basePath: `${el.repeat!.statePath}/${index}`,\n } satisfies RepeatScope));\n });\n\n /** One child Injector per repeat item, providing RepeatScope. */\n readonly repeatInjectors = computed(() => {\n return this.repeatScopes().map(scope =>\n Injector.create({\n providers: [{ provide: REPEAT_SCOPE, useValue: scope }],\n parent: this.parentInjector,\n }),\n );\n });\n\n /** Resolved inputs for each repeat item. */\n readonly repeatInputs = computed(() => {\n const el = this.element();\n if (!el?.repeat) return [];\n return this.repeatScopes().map(scope => {\n const ctx = buildPropResolutionContext(\n this.ctx.store,\n scope,\n this.ctx.functions,\n );\n const resolved = resolveElementProps(el.props ?? {}, ctx);\n const bindings = resolveBindings(el.props ?? {}, ctx);\n return {\n ...resolved,\n bindings,\n emit: this.emitFn,\n loading: this.ctx.loading ?? false,\n childKeys: el.children ?? [],\n spec: this.spec(),\n };\n });\n });\n\n /** `repeatInputs` filtered per-item to declared component inputs. */\n readonly filteredRepeatInputs = computed(() => {\n const cls = this.mountClass() as Type<unknown> | null;\n return this.repeatInputs().map(inputs => filterInputsForClass(cls, inputs));\n });\n}\n","// SPDX-License-Identifier: MIT\nimport { InjectionToken, makeEnvironmentProviders } from '@angular/core';\nimport type { ViewRegistry } from './views';\n\nexport const VIEW_REGISTRY = new InjectionToken<ViewRegistry>('VIEW_REGISTRY');\n\nexport function provideViews(registry: ViewRegistry) {\n return makeEnvironmentProviders([\n { provide: VIEW_REGISTRY, useValue: registry },\n ]);\n}\n","// SPDX-License-Identifier: MIT\nimport { Type } from '@angular/core';\nimport type { AngularRegistry, RenderViewEntry } from './render.types';\nimport { defineAngularRegistry } from './define-angular-registry';\n\n/**\n * A registry of view components available for generative UI rendering.\n * Each entry is either a bare component Type (legacy shape) or a\n * `RenderViewEntry` { component, fallback? }.\n */\nexport type ViewRegistry = Readonly<Record<string, Type<unknown> | RenderViewEntry>>;\n\n/**\n * Creates a view registry from a name → component map.\n */\nexport function views(map: Record<string, Type<unknown> | RenderViewEntry>): ViewRegistry {\n return Object.freeze({ ...map });\n}\n\n/**\n * Adds views to a registry without overwriting existing entries.\n * New keys are added; keys that already exist in `base` are preserved.\n */\nexport function withViews(\n base: ViewRegistry,\n additions: Record<string, Type<unknown> | RenderViewEntry>,\n): ViewRegistry {\n return Object.freeze({ ...additions, ...base });\n}\n\n/**\n * Replaces views in a registry. Keys in `overrides` win over `base`.\n * Use this to swap an existing renderer; use `withViews` to add NEW\n * node types without touching existing entries.\n */\nexport function overrideViews(\n base: ViewRegistry,\n overrides: Record<string, Type<unknown> | RenderViewEntry>,\n): ViewRegistry {\n return Object.freeze({ ...base, ...overrides });\n}\n\n/**\n * Removes views from a registry by name.\n */\nexport function withoutViews(\n base: ViewRegistry,\n ...names: string[]\n): ViewRegistry {\n const result = { ...base };\n for (const name of names) delete result[name];\n return Object.freeze(result);\n}\n\n/**\n * Converts a ViewRegistry to an AngularRegistry for use with RenderSpecComponent.\n */\nexport function toRenderRegistry(registry: ViewRegistry): AngularRegistry {\n return defineAngularRegistry(registry);\n}\n","// SPDX-License-Identifier: MIT\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n effect,\n inject,\n input,\n OnInit,\n output,\n} from '@angular/core';\nimport type { ComputedFunction, Spec, StateStore } from '@json-render/core';\n\nimport { RenderElementComponent } from './render-element.component';\nimport { RENDER_CONFIG } from './provide-render';\nimport { VIEW_REGISTRY } from './provide-views';\nimport { toRenderRegistry } from './views';\nimport { RENDER_CONTEXT } from './contexts/render-context';\nimport type { RenderContext } from './contexts/render-context';\nimport type { AngularRegistry } from './render.types';\nimport { signalStateStore } from './signal-state-store';\nimport type { RenderEvent } from './render-event';\nimport { RenderLifecycleService } from './render-lifecycle.service';\n\n/**\n * Top-level entry point for rendering a json-render spec.\n *\n * Accepts the spec, registry, store, functions, handlers, and loading\n * as inputs. Provides `RENDER_CONTEXT` to child `RenderElementComponent`\n * instances via `viewProviders`.\n *\n * Falls back to `RENDER_CONFIG` (from `provideRender()`) for registry\n * and store defaults when inputs are not provided.\n *\n * @example\n * ```html\n * <render-spec [spec]=\"spec()\" [registry]=\"registry\" [store]=\"store\" />\n * ```\n */\n@Component({\n selector: 'render-spec',\n standalone: true,\n imports: [RenderElementComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n viewProviders: [\n {\n provide: RENDER_CONTEXT,\n useFactory: () => inject(RenderSpecComponent)._context(),\n },\n ],\n template: `\n @if (spec()?.root; as rootKey) {\n <render-element [elementKey]=\"rootKey\" [spec]=\"spec()!\" />\n }\n `,\n})\nexport class RenderSpecComponent implements OnInit {\n readonly spec = input<Spec | null>(null);\n readonly registry = input<AngularRegistry | undefined>(undefined);\n readonly store = input<StateStore | undefined>(undefined);\n readonly functions = input<Record<string, ComputedFunction> | undefined>(undefined);\n readonly handlers = input<Record<string, (params: Record<string, unknown>) => unknown | Promise<unknown>> | undefined>(undefined);\n readonly loading = input<boolean>(false);\n readonly events = output<RenderEvent>();\n\n private readonly config = inject(RENDER_CONFIG, { optional: true });\n private readonly viewRegistry = inject(VIEW_REGISTRY, { optional: true });\n private readonly destroyRef = inject(DestroyRef);\n private readonly lifecycle = inject(RenderLifecycleService, { optional: true });\n\n /** Internal store, lazily created once and reused across spec changes. */\n private _internalStore: StateStore | undefined;\n\n private getOrCreateInternalStore(): StateStore {\n if (!this._internalStore) {\n this._internalStore = signalStateStore(this.spec()?.state ?? {});\n }\n return this._internalStore;\n }\n\n /** Resolved store: input > config > internal (from spec.state). */\n private readonly resolvedStore = computed<StateStore>(() => {\n const inputStore = this.store();\n if (inputStore) return inputStore;\n const configStore = this.config?.store;\n if (configStore) return configStore;\n return this.getOrCreateInternalStore();\n });\n\n /** Resolved registry: input > config > VIEW_REGISTRY token > empty fallback. */\n private readonly resolvedRegistry = computed<AngularRegistry>(() => {\n const inputRegistry = this.registry();\n if (inputRegistry) return inputRegistry;\n const configRegistry = this.config?.registry;\n if (configRegistry) return configRegistry;\n if (this.viewRegistry) return toRenderRegistry(this.viewRegistry);\n // Fallback: empty registry\n return { get: () => undefined, getFallback: () => undefined, names: () => [] };\n });\n\n /** Wraps input handlers to emit RenderHandlerEvent after execution. */\n private readonly wrappedHandlers = computed(() => {\n const inputHandlers = this.handlers() ?? this.config?.handlers;\n if (!inputHandlers) return undefined;\n const wrapped: Record<string, (params: Record<string, unknown>) => unknown | Promise<unknown>> = {};\n for (const [name, handler] of Object.entries(inputHandlers)) {\n wrapped[name] = (params: Record<string, unknown>) => {\n const result = handler(params);\n if (result instanceof Promise) {\n result.then(\n (r) => {\n this.emitTapped({ type: 'handler', action: name, params, result: r });\n },\n () => {\n this.emitTapped({ type: 'handler', action: name, params, result: undefined });\n },\n );\n } else {\n this.emitTapped({ type: 'handler', action: name, params, result });\n }\n return result;\n };\n }\n return wrapped;\n });\n\n /** Emits a RenderEvent through the events output and notifies the\n * lifecycle service (single tap point — all events flow through here). */\n private readonly emitTapped = (event: RenderEvent): void => {\n this.events.emit(event);\n if (!this.lifecycle) return;\n switch (event.type) {\n case 'lifecycle':\n this.lifecycle.notifyLifecycle({\n kind: event.scope,\n type: event.event,\n elementType: event.elementType,\n });\n break;\n case 'stateChange':\n this.lifecycle.notifyStateChange();\n break;\n case 'handler':\n this.lifecycle.notifyHandlerInvoked(event.action);\n break;\n }\n };\n\n /** Emits a RenderEvent through the events output. */\n private readonly emitEvent = (event: RenderEvent) => {\n this.emitTapped(event);\n };\n\n /** The RenderContext provided to children via viewProviders. */\n readonly _context = computed<RenderContext>(() => ({\n registry: this.resolvedRegistry(),\n store: this.resolvedStore(),\n functions: this.functions() ?? this.config?.functions,\n handlers: this.wrappedHandlers(),\n emitEvent: this.emitEvent,\n loading: this.loading(),\n }));\n\n constructor() {\n // Subscribe to store changes and emit state change events\n effect(() => {\n const store = this.resolvedStore();\n const unsub = store.subscribe(() => {\n const snapshot = store.getSnapshot() as Record<string, unknown>;\n this.emitTapped({\n type: 'stateChange',\n path: '/',\n value: snapshot,\n snapshot,\n });\n });\n this.destroyRef.onDestroy(unsub);\n });\n\n this.destroyRef.onDestroy(() => {\n this.emitTapped({ type: 'lifecycle', event: 'destroyed', scope: 'spec' });\n });\n }\n\n ngOnInit(): void {\n this.emitTapped({ type: 'lifecycle', event: 'mounted', scope: 'spec' });\n }\n}\n","// SPDX-License-Identifier: MIT\n\n// Types\nexport type {\n AngularComponentInputs,\n AngularComponentRenderer,\n AngularRegistry,\n RenderConfig,\n} from './lib/render.types';\n\n// Contexts\nexport { RENDER_CONTEXT } from './lib/contexts/render-context';\nexport type { RenderContext } from './lib/contexts/render-context';\nexport { REPEAT_SCOPE } from './lib/contexts/repeat-scope';\nexport type { RepeatScope } from './lib/contexts/repeat-scope';\n\n// Registry\nexport { defineAngularRegistry } from './lib/define-angular-registry';\n\n// State\nexport { signalStateStore } from './lib/signal-state-store';\n\n// Provider\nexport { provideRender, RENDER_CONFIG } from './lib/provide-render';\n\n// Components\nexport { RenderElementComponent } from './lib/render-element.component';\nexport { RenderSpecComponent } from './lib/render-spec.component';\n\n// Views\nexport { views, withViews, overrideViews, withoutViews, toRenderRegistry } from './lib/views';\nexport type { ViewRegistry } from './lib/views';\nexport { provideViews, VIEW_REGISTRY } from './lib/provide-views';\n\n// Events\nexport type {\n RenderEvent,\n RenderHandlerEvent,\n RenderStateChangeEvent,\n RenderLifecycleEvent,\n} from './lib/render-event';\n\n// Lifecycle\nexport { RENDER_LIFECYCLE } from './lib/lifecycle';\nexport type { RenderLifecycle } from './lib/lifecycle';\n\n// Fallback\nexport { DefaultFallbackComponent } from './lib/default-fallback.component';\nexport type { RenderViewEntry } from './lib/render.types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;MAea,cAAc,GAAG,IAAI,cAAc,CAAgB,gBAAgB;;ACfhF;MASa,YAAY,GAAG,IAAI,cAAc,CAAc,cAAc;;ACT1E;MA2Da,wBAAwB,CAAA;uGAAxB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAxB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAdzB;;;;;;;;;;;;AAYT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,ggCAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAEU,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAxDpC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,yBAAyB,cACvB,IAAI,EAAA,eAAA,EACC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAuCrC;;;;;;;;;;;;AAYT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,ggCAAA,CAAA,EAAA;;;AC7CH,SAAS,SAAS,CAAC,KAAsC,EAAA;;AAEvD,IAAA,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;QAC/B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,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,WAAA,EAAA,IAAA,EAZS,sBAAsB,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,CAAA,YAAA,EAAA,MAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAEjB;AACb,YAAA;AACE,gBAAA,OAAO,EAAE,cAAc;gBACvB,UAAU,EAAE,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC,QAAQ,EAAE;AACzD,aAAA;AACF,SAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAOU,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAjB/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,sBAAsB,CAAC;oBACjC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,aAAa,EAAE;AACb,wBAAA;AACE,4BAAA,OAAO,EAAE,cAAc;4BACvB,UAAU,EAAE,MAAM,MAAM,CAAA,mBAAA,CAAqB,CAAC,QAAQ,EAAE;AACzD,yBAAA;AACF,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;AAIT,EAAA,CAAA;AACF,iBAAA;;;ACxDD;AAUA;;ACVA;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadplane/render",
3
- "version": "0.0.46",
3
+ "version": "0.0.49",
4
4
  "peerDependencies": {
5
5
  "@angular/core": "^20.0.0 || ^21.0.0",
6
6
  "@angular/common": "^20.0.0 || ^21.0.0",
@@ -205,6 +205,7 @@ declare class RenderSpecComponent implements OnInit {
205
205
  readonly loading: _angular_core.InputSignal<boolean>;
206
206
  readonly events: _angular_core.OutputEmitterRef<RenderEvent>;
207
207
  private readonly config;
208
+ private readonly viewRegistry;
208
209
  private readonly destroyRef;
209
210
  private readonly lifecycle;
210
211
  /** Internal store, lazily created once and reused across spec changes. */
@@ -212,7 +213,7 @@ declare class RenderSpecComponent implements OnInit {
212
213
  private getOrCreateInternalStore;
213
214
  /** Resolved store: input > config > internal (from spec.state). */
214
215
  private readonly resolvedStore;
215
- /** Resolved registry: input > config. */
216
+ /** Resolved registry: input > config > VIEW_REGISTRY token > empty fallback. */
216
217
  private readonly resolvedRegistry;
217
218
  /** Wraps input handlers to emit RenderHandlerEvent after execution. */
218
219
  private readonly wrappedHandlers;
@@ -244,6 +245,12 @@ declare function views(map: Record<string, Type<unknown> | RenderViewEntry>): Vi
244
245
  * New keys are added; keys that already exist in `base` are preserved.
245
246
  */
246
247
  declare function withViews(base: ViewRegistry, additions: Record<string, Type<unknown> | RenderViewEntry>): ViewRegistry;
248
+ /**
249
+ * Replaces views in a registry. Keys in `overrides` win over `base`.
250
+ * Use this to swap an existing renderer; use `withViews` to add NEW
251
+ * node types without touching existing entries.
252
+ */
253
+ declare function overrideViews(base: ViewRegistry, overrides: Record<string, Type<unknown> | RenderViewEntry>): ViewRegistry;
247
254
  /**
248
255
  * Removes views from a registry by name.
249
256
  */
@@ -282,5 +289,5 @@ declare class DefaultFallbackComponent {
282
289
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<DefaultFallbackComponent, "render-default-fallback", never, {}, {}, never, never, true, never>;
283
290
  }
284
291
 
285
- export { DefaultFallbackComponent, RENDER_CONFIG, RENDER_CONTEXT, RENDER_LIFECYCLE, REPEAT_SCOPE, RenderElementComponent, RenderSpecComponent, VIEW_REGISTRY, defineAngularRegistry, provideRender, provideViews, signalStateStore, toRenderRegistry, views, withViews, withoutViews };
292
+ export { DefaultFallbackComponent, RENDER_CONFIG, RENDER_CONTEXT, RENDER_LIFECYCLE, REPEAT_SCOPE, RenderElementComponent, RenderSpecComponent, VIEW_REGISTRY, defineAngularRegistry, overrideViews, provideRender, provideViews, signalStateStore, toRenderRegistry, views, withViews, withoutViews };
286
293
  export type { AngularComponentInputs, AngularComponentRenderer, AngularRegistry, RenderConfig, RenderContext, RenderEvent, RenderHandlerEvent, RenderLifecycle, RenderLifecycleEvent, RenderStateChangeEvent, RenderViewEntry, RepeatScope, ViewRegistry };