ngx-json-render 0.7.8 → 0.8.1
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 +98 -4
- package/fesm2022/ngx-json-render-devtools.mjs +262 -0
- package/fesm2022/ngx-json-render-devtools.mjs.map +1 -0
- package/fesm2022/ngx-json-render-mcp.mjs +132 -0
- package/fesm2022/ngx-json-render-mcp.mjs.map +1 -0
- package/fesm2022/ngx-json-render-schema.mjs +107 -0
- package/fesm2022/ngx-json-render-schema.mjs.map +1 -0
- package/fesm2022/ngx-json-render.mjs +51 -95
- package/fesm2022/ngx-json-render.mjs.map +1 -1
- package/package.json +28 -2
- package/schematics/ng-add/index.cjs +1 -1
- package/types/ngx-json-render-devtools.d.ts +67 -0
- package/types/ngx-json-render-mcp.d.ts +93 -0
- package/types/ngx-json-render-schema.d.ts +74 -0
- package/types/ngx-json-render.d.ts +33 -72
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-json-render",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Angular renderer for json-render — stream AI-generated JSON specs into real Angular components with signals.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -25,7 +25,21 @@
|
|
|
25
25
|
"@angular/common": ">=19.0.0",
|
|
26
26
|
"@angular/core": ">=19.0.0",
|
|
27
27
|
"@json-render/core": ">=0.20.0 <0.22.0",
|
|
28
|
-
"zod": "^4.0.0"
|
|
28
|
+
"zod": "^4.0.0",
|
|
29
|
+
"@modelcontextprotocol/ext-apps": "^1.7.5",
|
|
30
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
31
|
+
"@json-render/devtools": ">=0.20.0 <0.22.0"
|
|
32
|
+
},
|
|
33
|
+
"peerDependenciesMeta": {
|
|
34
|
+
"@modelcontextprotocol/ext-apps": {
|
|
35
|
+
"optional": true
|
|
36
|
+
},
|
|
37
|
+
"@modelcontextprotocol/sdk": {
|
|
38
|
+
"optional": true
|
|
39
|
+
},
|
|
40
|
+
"@json-render/devtools": {
|
|
41
|
+
"optional": true
|
|
42
|
+
}
|
|
29
43
|
},
|
|
30
44
|
"dependencies": {
|
|
31
45
|
"tslib": "^2.3.0"
|
|
@@ -45,6 +59,18 @@
|
|
|
45
59
|
"types": "./types/ngx-json-render.d.ts",
|
|
46
60
|
"default": "./fesm2022/ngx-json-render.mjs"
|
|
47
61
|
},
|
|
62
|
+
"./devtools": {
|
|
63
|
+
"types": "./types/ngx-json-render-devtools.d.ts",
|
|
64
|
+
"default": "./fesm2022/ngx-json-render-devtools.mjs"
|
|
65
|
+
},
|
|
66
|
+
"./mcp": {
|
|
67
|
+
"types": "./types/ngx-json-render-mcp.d.ts",
|
|
68
|
+
"default": "./fesm2022/ngx-json-render-mcp.mjs"
|
|
69
|
+
},
|
|
70
|
+
"./schema": {
|
|
71
|
+
"types": "./types/ngx-json-render-schema.d.ts",
|
|
72
|
+
"default": "./fesm2022/ngx-json-render-schema.mjs"
|
|
73
|
+
},
|
|
48
74
|
"./testing": {
|
|
49
75
|
"types": "./types/ngx-json-render-testing.d.ts",
|
|
50
76
|
"default": "./fesm2022/ngx-json-render-testing.mjs"
|
|
@@ -32,7 +32,7 @@ function ngAdd() {
|
|
|
32
32
|
'ngx-json-render is ready. Next: describe your components in a catalog,',
|
|
33
33
|
`register them, and render a spec with <json-render> — see ${README}`,
|
|
34
34
|
'No components of your own yet? `ng add ngx-json-render-material` adds',
|
|
35
|
-
'
|
|
35
|
+
'29 ready-made Angular Material ones.',
|
|
36
36
|
].join('\n'));
|
|
37
37
|
return (0, schematics_1.chain)(rules);
|
|
38
38
|
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as _json_render_core from '@json-render/core';
|
|
2
|
+
import { Spec, Catalog } from '@json-render/core';
|
|
3
|
+
import * as _angular_core from '@angular/core';
|
|
4
|
+
import { PanelPosition, DevtoolsEvent } from '@json-render/devtools';
|
|
5
|
+
export { DevtoolsEvent, PanelPosition } from '@json-render/devtools';
|
|
6
|
+
import { JsonRenderer, ChatUIReturn } from 'ngx-json-render';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A floating json-render devtools panel for an Angular app — the counterpart
|
|
10
|
+
* of `<JsonRenderDevtools />` in `@json-render/devtools-react`, `-vue`,
|
|
11
|
+
* `-svelte` and `-solid`, with the same tabs (Spec, State, Actions, Stream,
|
|
12
|
+
* Catalog) and the same element picker.
|
|
13
|
+
*
|
|
14
|
+
* Angular has no provider above `<json-render>` to read the renderer from, so
|
|
15
|
+
* the renderer is passed in by template reference. Streams need no wiring:
|
|
16
|
+
* every `injectUIStream` and `injectChatUI` generation in the app reaches the
|
|
17
|
+
* Stream tab.
|
|
18
|
+
*
|
|
19
|
+
* Renders nothing outside dev mode, and loads the panel itself
|
|
20
|
+
* (`@json-render/devtools`) with a dynamic `import()`, so a production build
|
|
21
|
+
* never fetches it.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```html
|
|
25
|
+
* <json-render #renderer [spec]="ui.spec()" [registry]="registry" />
|
|
26
|
+
* <json-render-devtools [renderer]="renderer" [catalog]="catalog" />
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
declare class JsonRenderDevtools {
|
|
30
|
+
/** The renderer to inspect: its spec, state store and catalog. */
|
|
31
|
+
readonly renderer: _angular_core.InputSignal<JsonRenderer | null>;
|
|
32
|
+
/** Spec to show instead of the renderer's. */
|
|
33
|
+
readonly spec: _angular_core.InputSignal<Spec | null | undefined>;
|
|
34
|
+
/** Catalog for the Catalog tab, if the renderer was not given one. */
|
|
35
|
+
readonly catalog: _angular_core.InputSignal<Catalog<_json_render_core.SchemaDefinition<_json_render_core.SchemaType<string, unknown>, _json_render_core.SchemaType<string, unknown>>, unknown> | null | undefined>;
|
|
36
|
+
/**
|
|
37
|
+
* A chat from `injectChatUI`: every assistant reply with a spec becomes a
|
|
38
|
+
* generation in the Spec tab's switcher.
|
|
39
|
+
*/
|
|
40
|
+
readonly chat: _angular_core.InputSignal<ChatUIReturn | null>;
|
|
41
|
+
readonly initialOpen: _angular_core.InputSignal<boolean>;
|
|
42
|
+
readonly position: _angular_core.InputSignal<PanelPosition>;
|
|
43
|
+
/** Toggle shortcut; `false` disables it. */
|
|
44
|
+
readonly hotkey: _angular_core.InputSignal<string | false>;
|
|
45
|
+
/** Events kept in the ring buffer. Read once, at creation. */
|
|
46
|
+
readonly bufferSize: _angular_core.InputSignal<number>;
|
|
47
|
+
/** Pad the page while the panel is open instead of overlaying it. */
|
|
48
|
+
readonly reserveSpace: _angular_core.InputSignal<boolean>;
|
|
49
|
+
/** Let the viewer flip the panel between bottom and right dock. */
|
|
50
|
+
readonly allowDockToggle: _angular_core.InputSignal<boolean>;
|
|
51
|
+
/** Every event the panel records, for an app's own logging. */
|
|
52
|
+
readonly event: _angular_core.OutputEmitterRef<DevtoolsEvent>;
|
|
53
|
+
private readonly destroyRef;
|
|
54
|
+
private events;
|
|
55
|
+
private panel;
|
|
56
|
+
private destroyed;
|
|
57
|
+
constructor();
|
|
58
|
+
private currentSpec;
|
|
59
|
+
private currentCatalog;
|
|
60
|
+
private generations;
|
|
61
|
+
private stateStore;
|
|
62
|
+
private mount;
|
|
63
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<JsonRenderDevtools, never>;
|
|
64
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<JsonRenderDevtools, "json-render-devtools", never, { "renderer": { "alias": "renderer"; "required": false; "isSignal": true; }; "spec": { "alias": "spec"; "required": false; "isSignal": true; }; "catalog": { "alias": "catalog"; "required": false; "isSignal": true; }; "chat": { "alias": "chat"; "required": false; "isSignal": true; }; "initialOpen": { "alias": "initialOpen"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "hotkey": { "alias": "hotkey"; "required": false; "isSignal": true; }; "bufferSize": { "alias": "bufferSize"; "required": false; "isSignal": true; }; "reserveSpace": { "alias": "reserveSpace"; "required": false; "isSignal": true; }; "allowDockToggle": { "alias": "allowDockToggle"; "required": false; "isSignal": true; }; }, { "event": "event"; }, never, never, true, never>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { JsonRenderDevtools };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
import { Spec } from '@json-render/core';
|
|
3
|
+
import { App } from '@modelcontextprotocol/ext-apps';
|
|
4
|
+
import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
5
|
+
|
|
6
|
+
/** Options for {@link injectJsonRenderApp}. */
|
|
7
|
+
interface JsonRenderAppOptions {
|
|
8
|
+
/** App name sent to the host during initialization. Defaults to `"json-render"`. */
|
|
9
|
+
name?: string;
|
|
10
|
+
/** App version sent to the host. Defaults to `"1.0.0"`. */
|
|
11
|
+
version?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Render the spec while the model is still writing the tool call, from the
|
|
14
|
+
* host's `toolinputpartial` notifications. The host "heals" the truncated
|
|
15
|
+
* JSON, so each partial spec is valid but may end in a half-written
|
|
16
|
+
* element; the renderer skips children that do not exist yet. Defaults to
|
|
17
|
+
* `true`. `useJsonRenderApp` in `@json-render/mcp/app` has no equivalent —
|
|
18
|
+
* it waits for the tool result.
|
|
19
|
+
*/
|
|
20
|
+
streamPartialInput?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Transport to the host. Omit it inside a real MCP Apps iframe: `App`
|
|
23
|
+
* then talks to `window.parent` over `postMessage`. Tests pass one end of
|
|
24
|
+
* an in-memory pair here and an `AppBridge` on the other.
|
|
25
|
+
*/
|
|
26
|
+
transport?: Transport;
|
|
27
|
+
/**
|
|
28
|
+
* Report the page's size to the host as it changes, so the iframe grows
|
|
29
|
+
* with the rendered UI. Defaults to `true`; needs `ResizeObserver`.
|
|
30
|
+
*/
|
|
31
|
+
autoResize?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* What {@link injectJsonRenderApp} returns — the fields of
|
|
35
|
+
* `UseJsonRenderAppReturn` from `@json-render/mcp/app`, as signals.
|
|
36
|
+
*/
|
|
37
|
+
interface JsonRenderApp {
|
|
38
|
+
/** The current spec; `null` until the first tool input or result. */
|
|
39
|
+
readonly spec: Signal<Spec | null>;
|
|
40
|
+
/** Whether the app is still connecting to the host. */
|
|
41
|
+
readonly connecting: Signal<boolean>;
|
|
42
|
+
/** Whether the app is connected to the host. */
|
|
43
|
+
readonly connected: Signal<boolean>;
|
|
44
|
+
/** Connection error, if any. */
|
|
45
|
+
readonly error: Signal<Error | null>;
|
|
46
|
+
/** Whether the spec is still arriving: pass it to `<json-render [loading]>`. */
|
|
47
|
+
readonly loading: Signal<boolean>;
|
|
48
|
+
/** The underlying MCP Apps `App`. */
|
|
49
|
+
readonly app: App;
|
|
50
|
+
/**
|
|
51
|
+
* Call a tool on the MCP server and replace the spec with its result —
|
|
52
|
+
* for refresh and drill-down interactions.
|
|
53
|
+
*/
|
|
54
|
+
callServerTool(name: string, args?: Record<string, unknown>): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Post a user message to the host's chat, so the model answers what the
|
|
57
|
+
* user did in the view. `data`, if given, follows the text as a JSON block.
|
|
58
|
+
* Rejects when the host does not accept messages from views or turns this
|
|
59
|
+
* one down, so an action's `onError` runs.
|
|
60
|
+
*/
|
|
61
|
+
sendMessage(text: string, data?: Record<string, unknown>): Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
/** The text of a {@link JsonRenderApp.sendMessage} message. */
|
|
64
|
+
declare function messageText(text: string, data?: Record<string, unknown>): string;
|
|
65
|
+
interface ToolResultLike {
|
|
66
|
+
content?: {
|
|
67
|
+
type: string;
|
|
68
|
+
text?: string;
|
|
69
|
+
}[];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Read a spec out of a tool result. Same rule as `@json-render/mcp/app`: the
|
|
73
|
+
* first text block, parsed as JSON, either a bare spec or `{ spec }`.
|
|
74
|
+
*/
|
|
75
|
+
declare function parseSpecFromToolResult(result: ToolResultLike): Spec | null;
|
|
76
|
+
/**
|
|
77
|
+
* Connect an Angular app running inside an MCP Apps iframe to its host and
|
|
78
|
+
* keep the json-render spec the model sent in a signal. The Angular
|
|
79
|
+
* counterpart of `useJsonRenderApp` from `@json-render/mcp/app`; the server
|
|
80
|
+
* side is `createMcpApp` from `@json-render/mcp`, unchanged.
|
|
81
|
+
*
|
|
82
|
+
* Call it in an injection context. The connection closes when the injector
|
|
83
|
+
* that created it is destroyed.
|
|
84
|
+
*
|
|
85
|
+
* ```ts
|
|
86
|
+
* readonly mcp = injectJsonRenderApp();
|
|
87
|
+
* // <json-render [spec]="mcp.spec()" [loading]="mcp.loading()" [registry]="registry" />
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
declare function injectJsonRenderApp(options?: JsonRenderAppOptions): JsonRenderApp;
|
|
91
|
+
|
|
92
|
+
export { injectJsonRenderApp, messageText, parseSpecFromToolResult };
|
|
93
|
+
export type { JsonRenderApp, JsonRenderAppOptions };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as _json_render_core from '@json-render/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The schema for ngx-json-render.
|
|
5
|
+
*
|
|
6
|
+
* Defines:
|
|
7
|
+
* - Spec: A flat tree of elements with keys, types, props, and children references
|
|
8
|
+
* - Catalog: Components with props schemas, and optional actions
|
|
9
|
+
*
|
|
10
|
+
* This is the same spec grammar the other json-render renderers use, so
|
|
11
|
+
* catalogs and specs are portable across frameworks.
|
|
12
|
+
*/
|
|
13
|
+
declare const schema: _json_render_core.Schema<{
|
|
14
|
+
spec: _json_render_core.SchemaType<"object", {
|
|
15
|
+
/** Root element key */
|
|
16
|
+
root: _json_render_core.SchemaType<"string", unknown>;
|
|
17
|
+
/** Flat map of elements by key */
|
|
18
|
+
elements: _json_render_core.SchemaType<"record", _json_render_core.SchemaType<"object", {
|
|
19
|
+
/** Component type from catalog */
|
|
20
|
+
type: _json_render_core.SchemaType<"ref", string>;
|
|
21
|
+
/** Component props */
|
|
22
|
+
props: _json_render_core.SchemaType<"propsOf", string>;
|
|
23
|
+
/** Child element keys (flat reference) */
|
|
24
|
+
children: _json_render_core.SchemaType<"array", _json_render_core.SchemaType<"string", unknown>>;
|
|
25
|
+
/** Visibility condition */
|
|
26
|
+
visible: {
|
|
27
|
+
optional: true;
|
|
28
|
+
kind: "any";
|
|
29
|
+
inner?: unknown;
|
|
30
|
+
};
|
|
31
|
+
/** Repeat children from a state array */
|
|
32
|
+
repeat: {
|
|
33
|
+
optional: true;
|
|
34
|
+
kind: "any";
|
|
35
|
+
inner?: unknown;
|
|
36
|
+
};
|
|
37
|
+
}>>;
|
|
38
|
+
}>;
|
|
39
|
+
catalog: _json_render_core.SchemaType<"object", {
|
|
40
|
+
/** Component definitions */
|
|
41
|
+
components: _json_render_core.SchemaType<"map", {
|
|
42
|
+
/** Zod schema for component props */
|
|
43
|
+
props: _json_render_core.SchemaType<"zod", unknown>;
|
|
44
|
+
/** Slots for this component. Use ['default'] for children, or named slots like ['header', 'footer'] */
|
|
45
|
+
slots: _json_render_core.SchemaType<"array", _json_render_core.SchemaType<"string", unknown>>;
|
|
46
|
+
/** Description for AI generation hints */
|
|
47
|
+
description: _json_render_core.SchemaType<"string", unknown>;
|
|
48
|
+
/** Example prop values used in prompt examples (auto-generated from Zod schema if omitted) */
|
|
49
|
+
example: _json_render_core.SchemaType<"any", unknown>;
|
|
50
|
+
}>;
|
|
51
|
+
/** Action definitions (optional) */
|
|
52
|
+
actions: _json_render_core.SchemaType<"map", {
|
|
53
|
+
/** Zod schema for action params */
|
|
54
|
+
params: _json_render_core.SchemaType<"zod", unknown>;
|
|
55
|
+
/** Description for AI generation hints */
|
|
56
|
+
description: _json_render_core.SchemaType<"string", unknown>;
|
|
57
|
+
}>;
|
|
58
|
+
}>;
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* Type for the Angular schema
|
|
62
|
+
*/
|
|
63
|
+
type AngularSchema = typeof schema;
|
|
64
|
+
/**
|
|
65
|
+
* Infer the spec type from a catalog
|
|
66
|
+
*/
|
|
67
|
+
type AngularSpec<TCatalog> = typeof schema extends {
|
|
68
|
+
createCatalog: (catalog: TCatalog) => {
|
|
69
|
+
_specType: infer S;
|
|
70
|
+
};
|
|
71
|
+
} ? S : never;
|
|
72
|
+
|
|
73
|
+
export { schema };
|
|
74
|
+
export type { AngularSchema, AngularSpec };
|
|
@@ -4,6 +4,7 @@ export { ActionBinding, ActionHandler, InferActionParams, InferCatalogComponents
|
|
|
4
4
|
import * as _angular_core from '@angular/core';
|
|
5
5
|
import { Signal, Type, Injector, InjectionToken } from '@angular/core';
|
|
6
6
|
import * as ngx_json_render from 'ngx-json-render';
|
|
7
|
+
export { AngularSchema, AngularSpec, schema } from 'ngx-json-render/schema';
|
|
7
8
|
|
|
8
9
|
interface PendingConfirmation {
|
|
9
10
|
action: ResolvedAction;
|
|
@@ -1089,6 +1090,36 @@ declare function createStoreSetState(store: Pick<StateStore, 'getSnapshot' | 'up
|
|
|
1089
1090
|
*/
|
|
1090
1091
|
declare function applyPatch(spec: Spec, patch: JsonPatch): Spec;
|
|
1091
1092
|
|
|
1093
|
+
/** Token usage as the AI SDK reports it in its usage line. */
|
|
1094
|
+
interface StreamObserverUsage {
|
|
1095
|
+
promptTokens: number;
|
|
1096
|
+
completionTokens: number;
|
|
1097
|
+
totalTokens: number;
|
|
1098
|
+
}
|
|
1099
|
+
/**
|
|
1100
|
+
* Hooks into every `injectUIStream` and `injectChatUI` generation in the app,
|
|
1101
|
+
* the counterpart of `registerActionObserver` in `@json-render/core`. This is
|
|
1102
|
+
* what `ngx-json-render/devtools` fills its Stream tab from, so it is private
|
|
1103
|
+
* API: the `ɵ` prefix says it may change in any release.
|
|
1104
|
+
*/
|
|
1105
|
+
interface StreamObserver {
|
|
1106
|
+
/** A generation started. */
|
|
1107
|
+
onStart?(): void;
|
|
1108
|
+
/** A patch was applied to the spec, in arrival order. */
|
|
1109
|
+
onPatch?(patch: JsonPatch): void;
|
|
1110
|
+
/** A line of prose arrived (`injectChatUI` only). */
|
|
1111
|
+
onText?(text: string): void;
|
|
1112
|
+
/** The usage line arrived (`injectUIStream` only). */
|
|
1113
|
+
onUsage?(usage: StreamObserverUsage): void;
|
|
1114
|
+
/** The generation ended; `ok` is false on an error, true on a stop. */
|
|
1115
|
+
onEnd?(ok: boolean): void;
|
|
1116
|
+
}
|
|
1117
|
+
/**
|
|
1118
|
+
* Register an observer for every stream in the app. Returns the function that
|
|
1119
|
+
* removes it. Private API for `ngx-json-render/devtools`.
|
|
1120
|
+
*/
|
|
1121
|
+
declare function ɵregisterStreamObserver(observer: StreamObserver): () => void;
|
|
1122
|
+
|
|
1092
1123
|
/**
|
|
1093
1124
|
* Convert a flat element list to a Spec.
|
|
1094
1125
|
* Input elements use key/parentKey to establish identity and relationships.
|
|
@@ -1345,81 +1376,11 @@ interface ChatUIReturn {
|
|
|
1345
1376
|
*/
|
|
1346
1377
|
declare function injectChatUI(options: ChatUIOptions): ChatUIReturn;
|
|
1347
1378
|
|
|
1348
|
-
/**
|
|
1349
|
-
* The schema for ngx-json-render.
|
|
1350
|
-
*
|
|
1351
|
-
* Defines:
|
|
1352
|
-
* - Spec: A flat tree of elements with keys, types, props, and children references
|
|
1353
|
-
* - Catalog: Components with props schemas, and optional actions
|
|
1354
|
-
*
|
|
1355
|
-
* This is the same spec grammar the other json-render renderers use, so
|
|
1356
|
-
* catalogs and specs are portable across frameworks.
|
|
1357
|
-
*/
|
|
1358
|
-
declare const schema: _json_render_core.Schema<{
|
|
1359
|
-
spec: _json_render_core.SchemaType<"object", {
|
|
1360
|
-
/** Root element key */
|
|
1361
|
-
root: _json_render_core.SchemaType<"string", unknown>;
|
|
1362
|
-
/** Flat map of elements by key */
|
|
1363
|
-
elements: _json_render_core.SchemaType<"record", _json_render_core.SchemaType<"object", {
|
|
1364
|
-
/** Component type from catalog */
|
|
1365
|
-
type: _json_render_core.SchemaType<"ref", string>;
|
|
1366
|
-
/** Component props */
|
|
1367
|
-
props: _json_render_core.SchemaType<"propsOf", string>;
|
|
1368
|
-
/** Child element keys (flat reference) */
|
|
1369
|
-
children: _json_render_core.SchemaType<"array", _json_render_core.SchemaType<"string", unknown>>;
|
|
1370
|
-
/** Visibility condition */
|
|
1371
|
-
visible: {
|
|
1372
|
-
optional: true;
|
|
1373
|
-
kind: "any";
|
|
1374
|
-
inner?: unknown;
|
|
1375
|
-
};
|
|
1376
|
-
/** Repeat children from a state array */
|
|
1377
|
-
repeat: {
|
|
1378
|
-
optional: true;
|
|
1379
|
-
kind: "any";
|
|
1380
|
-
inner?: unknown;
|
|
1381
|
-
};
|
|
1382
|
-
}>>;
|
|
1383
|
-
}>;
|
|
1384
|
-
catalog: _json_render_core.SchemaType<"object", {
|
|
1385
|
-
/** Component definitions */
|
|
1386
|
-
components: _json_render_core.SchemaType<"map", {
|
|
1387
|
-
/** Zod schema for component props */
|
|
1388
|
-
props: _json_render_core.SchemaType<"zod", unknown>;
|
|
1389
|
-
/** Slots for this component. Use ['default'] for children, or named slots like ['header', 'footer'] */
|
|
1390
|
-
slots: _json_render_core.SchemaType<"array", _json_render_core.SchemaType<"string", unknown>>;
|
|
1391
|
-
/** Description for AI generation hints */
|
|
1392
|
-
description: _json_render_core.SchemaType<"string", unknown>;
|
|
1393
|
-
/** Example prop values used in prompt examples (auto-generated from Zod schema if omitted) */
|
|
1394
|
-
example: _json_render_core.SchemaType<"any", unknown>;
|
|
1395
|
-
}>;
|
|
1396
|
-
/** Action definitions (optional) */
|
|
1397
|
-
actions: _json_render_core.SchemaType<"map", {
|
|
1398
|
-
/** Zod schema for action params */
|
|
1399
|
-
params: _json_render_core.SchemaType<"zod", unknown>;
|
|
1400
|
-
/** Description for AI generation hints */
|
|
1401
|
-
description: _json_render_core.SchemaType<"string", unknown>;
|
|
1402
|
-
}>;
|
|
1403
|
-
}>;
|
|
1404
|
-
}>;
|
|
1405
|
-
/**
|
|
1406
|
-
* Type for the Angular schema
|
|
1407
|
-
*/
|
|
1408
|
-
type AngularSchema = typeof schema;
|
|
1409
|
-
/**
|
|
1410
|
-
* Infer the spec type from a catalog
|
|
1411
|
-
*/
|
|
1412
|
-
type AngularSpec<TCatalog> = typeof schema extends {
|
|
1413
|
-
createCatalog: (catalog: TCatalog) => {
|
|
1414
|
-
_specType: infer S;
|
|
1415
|
-
};
|
|
1416
|
-
} ? S : never;
|
|
1417
|
-
|
|
1418
1379
|
/**
|
|
1419
1380
|
* Reactive mirror of the json-render devtools-active flag. When active, the
|
|
1420
1381
|
* renderer wraps each element with a `data-jr-key` attribute for the picker.
|
|
1421
1382
|
*/
|
|
1422
1383
|
declare function injectDevtoolsActive(): Signal<boolean>;
|
|
1423
1384
|
|
|
1424
|
-
export { CONFIRM_CONTEXT, ELEMENT_KEY, JR_CONFIRM_DIALOG, JR_CONFIRM_LABELS, JrChildren, JrConfirmDialog, JrElement, JrRepeatScope, JsonRenderActionsService, JsonRenderRootContext, JsonRenderStateService, JsonRenderValidationService, JsonRenderer, RENDER_CONTEXT, REPEAT_SCOPE, applyPatch, buildSpecFromParts, checkSpec, createStoreSetState, defineRegistry, flatToTree, formatSpecCheckIssues, getTextFromParts, injectAction, injectActions, injectBoundProp, injectChatUI, injectConfirmContext, injectDevtoolsActive, injectElementKey, injectFieldValidation, injectRenderContext, injectRepeatScope, injectStateBinding, injectStateStore, injectStateValue, injectUIStream, injectValidation, isActionCancelled, jsonRenderMessage,
|
|
1425
|
-
export type { ActionFn, Actions,
|
|
1385
|
+
export { CONFIRM_CONTEXT, ELEMENT_KEY, JR_CONFIRM_DIALOG, JR_CONFIRM_LABELS, JrChildren, JrConfirmDialog, JrElement, JrRepeatScope, JsonRenderActionsService, JsonRenderRootContext, JsonRenderStateService, JsonRenderValidationService, JsonRenderer, RENDER_CONTEXT, REPEAT_SCOPE, applyPatch, buildSpecFromParts, checkSpec, createStoreSetState, defineRegistry, flatToTree, formatSpecCheckIssues, getTextFromParts, injectAction, injectActions, injectBoundProp, injectChatUI, injectConfirmContext, injectDevtoolsActive, injectElementKey, injectFieldValidation, injectRenderContext, injectRepeatScope, injectStateBinding, injectStateStore, injectStateValue, injectUIStream, injectValidation, isActionCancelled, jsonRenderMessage, ɵregisterStreamObserver };
|
|
1386
|
+
export type { ActionFn, Actions, CatalogHasActions, ChatMessage, ChatUIOptions, ChatUIReturn, ComponentRegistry, Components, ConfirmContext, ConfirmLabels, DataPart, DefineRegistryResult, EventHandle, FieldValidationState, PendingConfirmation, RegistryEntry, RenderContext, RenderLimits, RepeatScope, SetState, SpecCatalog, SpecCheck, SpecCheckIssue, SpecCheckIssueCode, SpecCheckOptions, SpecValidationMode, StateChange, StreamObserver, StreamObserverUsage, TokenUsage, UIStreamOptions, UIStreamReturn, UIStreamSendOptions };
|