@agentstage/render 0.2.0
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/dist/bridge-state-provider.d.ts +26 -0
- package/dist/bridge-state-provider.d.ts.map +1 -0
- package/dist/bridge-state-provider.js +73 -0
- package/dist/bridge-state-provider.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/json-to-tsx.d.ts +17 -0
- package/dist/json-to-tsx.d.ts.map +1 -0
- package/dist/json-to-tsx.js +60 -0
- package/dist/json-to-tsx.js.map +1 -0
- package/dist/shadcn.d.ts +211 -0
- package/dist/shadcn.d.ts.map +1 -0
- package/dist/shadcn.js +62 -0
- package/dist/shadcn.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface BridgeStore {
|
|
3
|
+
getState: () => Record<string, unknown>;
|
|
4
|
+
subscribe: (callback: (state: Record<string, unknown>) => void) => () => void;
|
|
5
|
+
setState: (updater: (prev: Record<string, unknown>) => Record<string, unknown>) => void;
|
|
6
|
+
}
|
|
7
|
+
interface Bridge {
|
|
8
|
+
store: BridgeStore;
|
|
9
|
+
connect: () => Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
interface BridgeStateContextValue {
|
|
12
|
+
state: Record<string, unknown>;
|
|
13
|
+
get: (path: string) => unknown;
|
|
14
|
+
set: (path: string, value: unknown) => void;
|
|
15
|
+
update: (updates: Record<string, unknown>) => void;
|
|
16
|
+
bridge: Bridge;
|
|
17
|
+
}
|
|
18
|
+
export interface BridgeStateProviderProps {
|
|
19
|
+
bridge: Bridge;
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export declare function BridgeStateProvider({ bridge, children }: BridgeStateProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare function useBridgeStateContext(): BridgeStateContextValue;
|
|
24
|
+
export declare function useBridgeState<T>(selector: (state: Record<string, unknown>) => T): T;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=bridge-state-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge-state-provider.d.ts","sourceRoot":"","sources":["../src/bridge-state-provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAG9E,UAAU,WAAW;IACnB,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,SAAS,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;IAC9E,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CACzF;AAED,UAAU,MAAM;IACd,KAAK,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED,UAAU,uBAAuB;IAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAC/B,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACnD,MAAM,EAAE,MAAM,CAAC;CAChB;AAID,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,mBAAmB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,wBAAwB,2CA6DjF;AAED,wBAAgB,qBAAqB,IAAI,uBAAuB,CAM/D;AAGD,wBAAgB,cAAc,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAGpF"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext, useState, useEffect } from 'react';
|
|
4
|
+
const BridgeStateContext = createContext(null);
|
|
5
|
+
export function BridgeStateProvider({ bridge, children }) {
|
|
6
|
+
const [state, setLocalState] = useState(() => bridge.store.getState());
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
bridge.connect().catch(console.error);
|
|
9
|
+
return bridge.store.subscribe((newState) => setLocalState(newState));
|
|
10
|
+
}, [bridge]);
|
|
11
|
+
const value = {
|
|
12
|
+
state,
|
|
13
|
+
get: (path) => {
|
|
14
|
+
const parts = path.split('.');
|
|
15
|
+
let current = state;
|
|
16
|
+
for (const part of parts) {
|
|
17
|
+
if (current === null || current === undefined)
|
|
18
|
+
return undefined;
|
|
19
|
+
current = current[part];
|
|
20
|
+
}
|
|
21
|
+
return current;
|
|
22
|
+
},
|
|
23
|
+
set: (path, value) => {
|
|
24
|
+
bridge.store.setState((prev) => {
|
|
25
|
+
const next = { ...prev };
|
|
26
|
+
const parts = path.split('.');
|
|
27
|
+
let current = next;
|
|
28
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
29
|
+
const part = parts[i];
|
|
30
|
+
if (!(part in current) || typeof current[part] !== 'object') {
|
|
31
|
+
current[part] = {};
|
|
32
|
+
}
|
|
33
|
+
current = current[part];
|
|
34
|
+
}
|
|
35
|
+
current[parts[parts.length - 1]] = value;
|
|
36
|
+
return next;
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
update: (updates) => {
|
|
40
|
+
bridge.store.setState((prev) => {
|
|
41
|
+
const next = { ...prev };
|
|
42
|
+
for (const [path, value] of Object.entries(updates)) {
|
|
43
|
+
const parts = path.split('.');
|
|
44
|
+
let current = next;
|
|
45
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
46
|
+
const part = parts[i];
|
|
47
|
+
if (!(part in current) || typeof current[part] !== 'object') {
|
|
48
|
+
current[part] = {};
|
|
49
|
+
}
|
|
50
|
+
current = current[part];
|
|
51
|
+
}
|
|
52
|
+
current[parts[parts.length - 1]] = value;
|
|
53
|
+
}
|
|
54
|
+
return next;
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
bridge,
|
|
58
|
+
};
|
|
59
|
+
return (_jsx(BridgeStateContext.Provider, { value: value, children: children }));
|
|
60
|
+
}
|
|
61
|
+
export function useBridgeStateContext() {
|
|
62
|
+
const context = useContext(BridgeStateContext);
|
|
63
|
+
if (!context) {
|
|
64
|
+
throw new Error('useBridgeStateContext must be used within BridgeStateProvider');
|
|
65
|
+
}
|
|
66
|
+
return context;
|
|
67
|
+
}
|
|
68
|
+
// Hook for using bridge state with selector
|
|
69
|
+
export function useBridgeState(selector) {
|
|
70
|
+
const { state } = useBridgeStateContext();
|
|
71
|
+
return selector(state);
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=bridge-state-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge-state-provider.js","sourceRoot":"","sources":["../src/bridge-state-provider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAsB9E,MAAM,kBAAkB,GAAG,aAAa,CAAiC,IAAI,CAAC,CAAC;AAO/E,MAAM,UAAU,mBAAmB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAA4B;IAChF,MAAM,CAAC,KAAK,EAAE,a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,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;gBAC3C,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC,CAAC,CAAC;QACL,CAAC;QACD,MAAM;KACP,CAAC;IAEF,OAAO,CACL,KAAC,kBAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACtC,QAAQ,GACmB,CAC/B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,MAAM,OAAO,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAC/C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;IACnF,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,4CAA4C;AAC5C,MAAM,UAAU,cAAc,CAAI,QAA+C;IAC/E,MAAM,EAAE,KAAK,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAC1C,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { defineCatalog, defineSchema, createSpecStreamCompiler, createMixedStreamParser, compileSpecStream, nestedToFlat, validateSpec, autoFixSpec, formatSpecIssues, visibility, action, check, } from '@json-render/core';
|
|
2
|
+
export type { Catalog, Schema, SchemaDefinition, Spec, UIElement, ActionDefinition, JsonPatch, VisibilityCondition, ValidationConfig, } from '@json-render/core';
|
|
3
|
+
export { Renderer, defineRegistry, useStateStore, StateProvider, useActions, useAction, useVisibility, useIsVisible, useStateValue, useStateBinding, schema, } from '@json-render/react';
|
|
4
|
+
export type { ComponentRegistry, RendererProps, BaseComponentProps, DefineRegistryResult, } from '@json-render/react';
|
|
5
|
+
export { BridgeStateProvider, useBridgeStateContext, useBridgeState } from './bridge-state-provider.js';
|
|
6
|
+
export { jsonToTsx, specToComponent } from './json-to-tsx.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,YAAY,EACZ,wBAAwB,EACxB,uBAAuB,EACvB,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,MAAM,EACN,KAAK,GACN,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,OAAO,EACP,MAAM,EACN,gBAAgB,EAChB,IAAI,EACJ,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,QAAQ,EACR,cAAc,EACd,aAAa,EACb,aAAa,EACb,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,EACZ,aAAa,EACb,eAAe,EACf,MAAM,GACP,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACV,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACxG,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Re-export everything from json-render
|
|
2
|
+
export { defineCatalog, defineSchema, createSpecStreamCompiler, createMixedStreamParser, compileSpecStream, nestedToFlat, validateSpec, autoFixSpec, formatSpecIssues, visibility, action, check, } from '@json-render/core';
|
|
3
|
+
export { Renderer, defineRegistry, useStateStore, StateProvider, useActions, useAction, useVisibility, useIsVisible, useStateValue, useStateBinding, schema, } from '@json-render/react';
|
|
4
|
+
// Agentstage specific exports
|
|
5
|
+
export { BridgeStateProvider, useBridgeStateContext, useBridgeState } from './bridge-state-provider.js';
|
|
6
|
+
export { jsonToTsx, specToComponent } from './json-to-tsx.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,OAAO,EACL,aAAa,EACb,YAAY,EACZ,wBAAwB,EACxB,uBAAuB,EACvB,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,MAAM,EACN,KAAK,GACN,MAAM,mBAAmB,CAAC;AAc3B,OAAO,EACL,QAAQ,EACR,cAAc,EACd,aAAa,EACb,aAAa,EACb,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,EACZ,aAAa,EACb,eAAe,EACf,MAAM,GACP,MAAM,oBAAoB,CAAC;AAS5B,8BAA8B;AAC9B,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACxG,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Spec } from '@json-render/core';
|
|
2
|
+
export interface TsxComponent {
|
|
3
|
+
name: string;
|
|
4
|
+
props: Record<string, unknown>;
|
|
5
|
+
children: TsxComponent[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Convert a JSON spec to TSX code string
|
|
9
|
+
*/
|
|
10
|
+
export declare function jsonToTsx(spec: Spec, options?: {
|
|
11
|
+
componentName?: string;
|
|
12
|
+
}): string;
|
|
13
|
+
/**
|
|
14
|
+
* Convert spec to a component object tree
|
|
15
|
+
*/
|
|
16
|
+
export declare function specToComponent(spec: Spec): TsxComponent | null;
|
|
17
|
+
//# sourceMappingURL=json-to-tsx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-to-tsx.d.ts","sourceRoot":"","sources":["../src/json-to-tsx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,GAAE;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,MAAM,CA+CtF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,YAAY,GAAG,IAAI,CAa/D"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a JSON spec to TSX code string
|
|
3
|
+
*/
|
|
4
|
+
export function jsonToTsx(spec, options = {}) {
|
|
5
|
+
const componentName = options.componentName || 'GeneratedComponent';
|
|
6
|
+
const imports = new Set(['React']);
|
|
7
|
+
const componentCodes = [];
|
|
8
|
+
function processElement(elementId, depth = 0) {
|
|
9
|
+
const element = spec.elements[elementId];
|
|
10
|
+
if (!element)
|
|
11
|
+
return '';
|
|
12
|
+
const { type, props, children } = element;
|
|
13
|
+
const indent = ' '.repeat(depth);
|
|
14
|
+
// Build props string
|
|
15
|
+
const propsStr = props
|
|
16
|
+
? Object.entries(props)
|
|
17
|
+
.map(([key, value]) => {
|
|
18
|
+
if (typeof value === 'string') {
|
|
19
|
+
return `${key}="${value}"`;
|
|
20
|
+
}
|
|
21
|
+
return `${key}={${JSON.stringify(value)}}`;
|
|
22
|
+
})
|
|
23
|
+
.join(' ')
|
|
24
|
+
: '';
|
|
25
|
+
// Process children
|
|
26
|
+
const childrenStr = children?.length
|
|
27
|
+
? children.map((childId) => processElement(childId, depth + 1)).join('\n')
|
|
28
|
+
: '';
|
|
29
|
+
if (childrenStr) {
|
|
30
|
+
return `${indent}<${type} ${propsStr}>\n${childrenStr}\n${indent}</${type}>`;
|
|
31
|
+
}
|
|
32
|
+
return `${indent}<${type} ${propsStr} />`;
|
|
33
|
+
}
|
|
34
|
+
const rootCode = processElement(spec.root, 1);
|
|
35
|
+
return `import React from 'react';
|
|
36
|
+
|
|
37
|
+
export function ${componentName}() {
|
|
38
|
+
return (
|
|
39
|
+
${rootCode}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Convert spec to a component object tree
|
|
46
|
+
*/
|
|
47
|
+
export function specToComponent(spec) {
|
|
48
|
+
function buildTree(elementId) {
|
|
49
|
+
const element = spec.elements[elementId];
|
|
50
|
+
if (!element)
|
|
51
|
+
return null;
|
|
52
|
+
return {
|
|
53
|
+
name: element.type,
|
|
54
|
+
props: element.props || {},
|
|
55
|
+
children: element.children?.map(buildTree).filter((c) => c !== null) || [],
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return buildTree(spec.root);
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=json-to-tsx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-to-tsx.js","sourceRoot":"","sources":["../src/json-to-tsx.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,IAAU,EAAE,UAAsC,EAAE;IAC5E,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,IAAI,oBAAoB,CAAC;IAEpE,MAAM,OAAO,GAAG,IAAI,GAAG,CAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3C,MAAM,cAAc,GAAa,EAAE,CAAC;IAEpC,SAAS,cAAc,CAAC,SAAiB,EAAE,KAAK,GAAG,CAAC;QAClD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACzC,IAAI,CAAC,OAAO;YAAE,OAAO,EAAE,CAAC;QAExB,MAAM,EAAE,IAAI,EAA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iB;QAClC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACzC,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;QAE1B,OAAO;YACL,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,EAAE;YAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAqB,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,IAAI,EAAE;SAC9F,CAAC;IACJ,CAAC;IAED,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC"}
|
package/dist/shadcn.d.ts
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { type ShadcnProps } from '@json-render/shadcn';
|
|
2
|
+
export { shadcnComponents, shadcnComponentDefinitions, ShadcnProps, } from '@json-render/shadcn';
|
|
3
|
+
export { shadcnComponentDefinitions as componentDefinitions, } from '@json-render/shadcn/catalog';
|
|
4
|
+
export declare const commonComponentNames: readonly ["Button", "Card", "Input", "Stack", "Text", "Heading", "Badge", "Separator", "Dialog", "Tabs", "Table"];
|
|
5
|
+
export type CommonComponentName = typeof commonComponentNames[number];
|
|
6
|
+
export declare function pickCommonComponents(): {
|
|
7
|
+
Button: ({ props, emit }: import("@json-render/react").BaseComponentProps<ShadcnProps<"Button">>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Card: ({ props, children }: import("@json-render/react").BaseComponentProps<ShadcnProps<"Card">>) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
Input: ({ props, bindings, emit, }: import("@json-render/react").BaseComponentProps<ShadcnProps<"Input">>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
Stack: ({ props, children }: import("@json-render/react").BaseComponentProps<ShadcnProps<"Stack">>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
Text: ({ props }: import("@json-render/react").BaseComponentProps<ShadcnProps<"Text">>) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
Heading: ({ props }: import("@json-render/react").BaseComponentProps<ShadcnProps<"Heading">>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
Badge: ({ props }: import("@json-render/react").BaseComponentProps<ShadcnProps<"Badge">>) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
Separator: ({ props }: import("@json-render/react").BaseComponentProps<ShadcnProps<"Separator">>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
Dialog: ({ props, children }: import("@json-render/react").BaseComponentProps<ShadcnProps<"Dialog">>) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
Tabs: ({ props, children, bindings, emit, }: import("@json-render/react").BaseComponentProps<ShadcnProps<"Tabs">>) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
Table: ({ props }: import("@json-render/react").BaseComponentProps<ShadcnProps<"Table">>) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
};
|
|
19
|
+
export declare function createCommonCatalog(): {
|
|
20
|
+
components: {
|
|
21
|
+
Button: {
|
|
22
|
+
props: import("zod").ZodObject<{
|
|
23
|
+
label: import("zod").ZodString;
|
|
24
|
+
variant: import("zod").ZodNullable<import("zod").ZodEnum<{
|
|
25
|
+
secondary: "secondary";
|
|
26
|
+
primary: "primary";
|
|
27
|
+
danger: "danger";
|
|
28
|
+
}>>;
|
|
29
|
+
disabled: import("zod").ZodNullable<import("zod").ZodBoolean>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
events: string[];
|
|
32
|
+
description: string;
|
|
33
|
+
example: {
|
|
34
|
+
label: string;
|
|
35
|
+
variant: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
Card: {
|
|
39
|
+
props: import("zod").ZodObject<{
|
|
40
|
+
title: import("zod").ZodNullable<import("zod").ZodString>;
|
|
41
|
+
description: import("zod").ZodNullable<import("zod").ZodString>;
|
|
42
|
+
maxWidth: import("zod").ZodNullable<import("zod").ZodEnum<{
|
|
43
|
+
sm: "sm";
|
|
44
|
+
md: "md";
|
|
45
|
+
lg: "lg";
|
|
46
|
+
full: "full";
|
|
47
|
+
}>>;
|
|
48
|
+
centered: import("zod").ZodNullable<import("zod").ZodBoolean>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
slots: string[];
|
|
51
|
+
description: string;
|
|
52
|
+
example: {
|
|
53
|
+
title: string;
|
|
54
|
+
description: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
Input: {
|
|
58
|
+
props: import("zod").ZodObject<{
|
|
59
|
+
label: import("zod").ZodString;
|
|
60
|
+
name: import("zod").ZodString;
|
|
61
|
+
type: import("zod").ZodNullable<import("zod").ZodEnum<{
|
|
62
|
+
number: "number";
|
|
63
|
+
text: "text";
|
|
64
|
+
email: "email";
|
|
65
|
+
password: "password";
|
|
66
|
+
}>>;
|
|
67
|
+
placeholder: import("zod").ZodNullable<import("zod").ZodString>;
|
|
68
|
+
value: import("zod").ZodNullable<import("zod").ZodString>;
|
|
69
|
+
checks: import("zod").ZodNullable<import("zod").ZodArray<import("zod").ZodObject<{
|
|
70
|
+
type: import("zod").ZodString;
|
|
71
|
+
message: import("zod").ZodString;
|
|
72
|
+
args: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
73
|
+
}, z.core.$strip>>>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
events: string[];
|
|
76
|
+
description: string;
|
|
77
|
+
example: {
|
|
78
|
+
label: string;
|
|
79
|
+
name: string;
|
|
80
|
+
type: string;
|
|
81
|
+
placeholder: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
Stack: {
|
|
85
|
+
props: import("zod").ZodObject<{
|
|
86
|
+
direction: import("zod").ZodNullable<import("zod").ZodEnum<{
|
|
87
|
+
horizontal: "horizontal";
|
|
88
|
+
vertical: "vertical";
|
|
89
|
+
}>>;
|
|
90
|
+
gap: import("zod").ZodNullable<import("zod").ZodEnum<{
|
|
91
|
+
sm: "sm";
|
|
92
|
+
md: "md";
|
|
93
|
+
lg: "lg";
|
|
94
|
+
none: "none";
|
|
95
|
+
}>>;
|
|
96
|
+
align: import("zod").ZodNullable<import("zod").ZodEnum<{
|
|
97
|
+
start: "start";
|
|
98
|
+
center: "center";
|
|
99
|
+
end: "end";
|
|
100
|
+
stretch: "stretch";
|
|
101
|
+
}>>;
|
|
102
|
+
justify: import("zod").ZodNullable<import("zod").ZodEnum<{
|
|
103
|
+
start: "start";
|
|
104
|
+
center: "center";
|
|
105
|
+
end: "end";
|
|
106
|
+
between: "between";
|
|
107
|
+
around: "around";
|
|
108
|
+
}>>;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
slots: string[];
|
|
111
|
+
description: string;
|
|
112
|
+
example: {
|
|
113
|
+
direction: string;
|
|
114
|
+
gap: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
Text: {
|
|
118
|
+
props: import("zod").ZodObject<{
|
|
119
|
+
text: import("zod").ZodString;
|
|
120
|
+
variant: import("zod").ZodNullable<import("zod").ZodEnum<{
|
|
121
|
+
caption: "caption";
|
|
122
|
+
body: "body";
|
|
123
|
+
muted: "muted";
|
|
124
|
+
lead: "lead";
|
|
125
|
+
code: "code";
|
|
126
|
+
}>>;
|
|
127
|
+
}, z.core.$strip>;
|
|
128
|
+
description: string;
|
|
129
|
+
example: {
|
|
130
|
+
text: string;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
Heading: {
|
|
134
|
+
props: import("zod").ZodObject<{
|
|
135
|
+
text: import("zod").ZodString;
|
|
136
|
+
level: import("zod").ZodNullable<import("zod").ZodEnum<{
|
|
137
|
+
h1: "h1";
|
|
138
|
+
h2: "h2";
|
|
139
|
+
h3: "h3";
|
|
140
|
+
h4: "h4";
|
|
141
|
+
}>>;
|
|
142
|
+
}, z.core.$strip>;
|
|
143
|
+
description: string;
|
|
144
|
+
example: {
|
|
145
|
+
text: string;
|
|
146
|
+
level: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
Badge: {
|
|
150
|
+
props: import("zod").ZodObject<{
|
|
151
|
+
text: import("zod").ZodString;
|
|
152
|
+
variant: import("zod").ZodNullable<import("zod").ZodEnum<{
|
|
153
|
+
default: "default";
|
|
154
|
+
secondary: "secondary";
|
|
155
|
+
destructive: "destructive";
|
|
156
|
+
outline: "outline";
|
|
157
|
+
}>>;
|
|
158
|
+
}, z.core.$strip>;
|
|
159
|
+
description: string;
|
|
160
|
+
example: {
|
|
161
|
+
text: string;
|
|
162
|
+
variant: string;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
Separator: {
|
|
166
|
+
props: import("zod").ZodObject<{
|
|
167
|
+
orientation: import("zod").ZodNullable<import("zod").ZodEnum<{
|
|
168
|
+
horizontal: "horizontal";
|
|
169
|
+
vertical: "vertical";
|
|
170
|
+
}>>;
|
|
171
|
+
}, z.core.$strip>;
|
|
172
|
+
description: string;
|
|
173
|
+
};
|
|
174
|
+
Dialog: {
|
|
175
|
+
props: import("zod").ZodObject<{
|
|
176
|
+
title: import("zod").ZodString;
|
|
177
|
+
description: import("zod").ZodNullable<import("zod").ZodString>;
|
|
178
|
+
openPath: import("zod").ZodString;
|
|
179
|
+
}, z.core.$strip>;
|
|
180
|
+
slots: string[];
|
|
181
|
+
description: string;
|
|
182
|
+
};
|
|
183
|
+
Tabs: {
|
|
184
|
+
props: import("zod").ZodObject<{
|
|
185
|
+
tabs: import("zod").ZodArray<import("zod").ZodObject<{
|
|
186
|
+
label: import("zod").ZodString;
|
|
187
|
+
value: import("zod").ZodString;
|
|
188
|
+
}, z.core.$strip>>;
|
|
189
|
+
defaultValue: import("zod").ZodNullable<import("zod").ZodString>;
|
|
190
|
+
value: import("zod").ZodNullable<import("zod").ZodString>;
|
|
191
|
+
}, z.core.$strip>;
|
|
192
|
+
slots: string[];
|
|
193
|
+
events: string[];
|
|
194
|
+
description: string;
|
|
195
|
+
};
|
|
196
|
+
Table: {
|
|
197
|
+
props: import("zod").ZodObject<{
|
|
198
|
+
columns: import("zod").ZodArray<import("zod").ZodString>;
|
|
199
|
+
rows: import("zod").ZodArray<import("zod").ZodArray<import("zod").ZodString>>;
|
|
200
|
+
caption: import("zod").ZodNullable<import("zod").ZodString>;
|
|
201
|
+
}, z.core.$strip>;
|
|
202
|
+
description: string;
|
|
203
|
+
example: {
|
|
204
|
+
columns: string[];
|
|
205
|
+
rows: string[][];
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
actions: {};
|
|
210
|
+
};
|
|
211
|
+
//# sourceMappingURL=shadcn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shadcn.d.ts","sourceRoot":"","sources":["../src/shadcn.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAEL,gBAAgB,EAEhB,0BAA0B,EAE1B,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,0BAA0B,IAAI,oBAAoB,GACnD,MAAM,6BAA6B,CAAC;AAGrC,eAAO,MAAM,oBAAoB,mHAYvB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC;AAGtE,wBAAgB,oBAAoB;;;;;;;;;;;;EA4BnC;AAGD,wBAAgB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BlC"}
|
package/dist/shadcn.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// Re-export everything from @json-render/shadcn
|
|
2
|
+
// This provides all 36 pre-built shadcn/ui components
|
|
3
|
+
import { shadcnComponents, shadcnComponentDefinitions, } from '@json-render/shadcn';
|
|
4
|
+
export {
|
|
5
|
+
// Component implementations (36 shadcn/ui components)
|
|
6
|
+
shadcnComponents,
|
|
7
|
+
// Component definitions for building catalogs
|
|
8
|
+
shadcnComponentDefinitions, } from '@json-render/shadcn';
|
|
9
|
+
// Re-export from catalog subpath
|
|
10
|
+
export { shadcnComponentDefinitions as componentDefinitions, } from '@json-render/shadcn/catalog';
|
|
11
|
+
// Convenience: Common component selections for agentstage apps
|
|
12
|
+
export const commonComponentNames = [
|
|
13
|
+
'Button',
|
|
14
|
+
'Card',
|
|
15
|
+
'Input',
|
|
16
|
+
'Stack',
|
|
17
|
+
'Text',
|
|
18
|
+
'Heading',
|
|
19
|
+
'Badge',
|
|
20
|
+
'Separator',
|
|
21
|
+
'Dialog',
|
|
22
|
+
'Tabs',
|
|
23
|
+
'Table',
|
|
24
|
+
];
|
|
25
|
+
// Helper to pick only common components from shadcnComponents
|
|
26
|
+
export function pickCommonComponents() {
|
|
27
|
+
const { Button, Card, Input, Stack, Text, Heading, Badge, Separator, Dialog, Tabs, Table } = shadcnComponents;
|
|
28
|
+
return {
|
|
29
|
+
Button,
|
|
30
|
+
Card,
|
|
31
|
+
Input,
|
|
32
|
+
Stack,
|
|
33
|
+
Text,
|
|
34
|
+
Heading,
|
|
35
|
+
Badge,
|
|
36
|
+
Separator,
|
|
37
|
+
Dialog,
|
|
38
|
+
Tabs,
|
|
39
|
+
Table,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
// Helper to create a minimal catalog with just common components
|
|
43
|
+
export function createCommonCatalog() {
|
|
44
|
+
const { Button, Card, Input, Stack, Text, Heading, Badge, Separator, Dialog, Tabs, Table } = shadcnComponentDefinitions;
|
|
45
|
+
return {
|
|
46
|
+
components: {
|
|
47
|
+
Button,
|
|
48
|
+
Card,
|
|
49
|
+
Input,
|
|
50
|
+
Stack,
|
|
51
|
+
Text,
|
|
52
|
+
Heading,
|
|
53
|
+
Badge,
|
|
54
|
+
Separator,
|
|
55
|
+
Dialog,
|
|
56
|
+
Tabs,
|
|
57
|
+
Table,
|
|
58
|
+
},
|
|
59
|
+
actions: {},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=shadcn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shadcn.js","sourceRoot":"","sources":["../src/shadcn.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,sDAAsD;AAEtD,OAAO,EACL,gBAAgB,EAChB,0BAA0B,GAE3B,MAAM,qBAAqB,CAAC;AAE7B,OAAO;AACL,sDAAsD;AACtD,gBAAgB;AAChB,8CAA8C;AAC9C,0BAA0B,GAG3B,MAAM,qBAAqB,CAAC;AAE7B,iCAAiC;AACjC,OAAO,EACL,0BAA0B,IAAI,oBAAoB,GACnD,MAAM,6BAA6B,CAAC;AAErC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,QAAQ;IACR,MAAM;IACN,OAAO;IACP,OAAO;IACP,MAAM;IACN,SAAS;IACT,OAAO;IACP,WAAW;IACX,QAAQ;IACR,MAAM;IACN,OAAO;CACC,CAAC;AAIX,8DAA8D;AAC9D,MAAM,UAAU,oBAAoB;IAClC,MAAM,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,EACL,IAAI,EACJ,OAAO,EACP,KAAK,EACL,SAAS,EACT,MAAM,EACN,IAAI,EACJ,KAAK,EACN,GAAG,gBAAgB,CAAC;IAErB,OAAO;QACL,MAAM;QACN,IAAI;QACJ,KAAK;QACL,KAAK;QACL,IAAI;QACJ,OAAO;QACP,KAAK;QACL,SAAS;QACT,MAAM;QACN,IAAI;QACJ,KAAK;KACN,CAAC;AACJ,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,mBAAmB;IACjC,MAAM,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,EACL,IAAI,EACJ,OAAO,EACP,KAAK,EACL,SAAS,EACT,MAAM,EACN,IAAI,EACJ,KAAK,EACN,GAAG,0BAA0B,CAAC;IAE/B,OAAO;QACL,UAAU,EAAE;YACV,MAAM;YACN,IAAI;YACJ,KAAK;YACL,KAAK;YACL,IAAI;YACJ,OAAO;YACP,KAAK;YACL,SAAS;YACT,MAAM;YACN,IAAI;YACJ,KAAK;SACN;QACD,OAAO,EAAE,EAAE;KACZ,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agentstage/render",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"dev": "tsc --watch",
|
|
13
|
+
"typecheck": "tsc --noEmit"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./bridge-state-provider": {
|
|
21
|
+
"types": "./dist/bridge-state-provider.d.ts",
|
|
22
|
+
"default": "./dist/bridge-state-provider.js"
|
|
23
|
+
},
|
|
24
|
+
"./shadcn": {
|
|
25
|
+
"types": "./dist/shadcn.d.ts",
|
|
26
|
+
"default": "./dist/shadcn.js"
|
|
27
|
+
},
|
|
28
|
+
"./json-to-tsx": {
|
|
29
|
+
"types": "./dist/json-to-tsx.d.ts",
|
|
30
|
+
"default": "./dist/json-to-tsx.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@json-render/core": "*",
|
|
35
|
+
"@json-render/react": "*",
|
|
36
|
+
"@json-render/shadcn": "*",
|
|
37
|
+
"react": ">=18",
|
|
38
|
+
"zod": "^3.22.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@json-render/core": "0.7.0",
|
|
42
|
+
"@json-render/react": "0.7.0",
|
|
43
|
+
"@json-render/shadcn": "^0.7.0",
|
|
44
|
+
"@types/node": "^20.0.0",
|
|
45
|
+
"@types/react": "^18.2.0",
|
|
46
|
+
"typescript": "^5.0.0"
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
}
|
|
51
|
+
}
|