@niscorp/nova 0.1.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/ACTION_DOCS.md +552 -0
- package/ADAPTER.md +170 -0
- package/DESIGN.md +719 -0
- package/I18N_DOCS.md +224 -0
- package/LAYOUT_DOCS.md +505 -0
- package/LICENSE +202 -0
- package/REACT_DOCS.md +562 -0
- package/README.md +379 -0
- package/SHELL_DOCS.md +615 -0
- package/TERMINAL_DOCS.md +124 -0
- package/dist/adapters/dom/components/index.cjs +473 -0
- package/dist/adapters/dom/components/index.cjs.map +1 -0
- package/dist/adapters/dom/components/index.d.cts +48 -0
- package/dist/adapters/dom/components/index.d.ts +48 -0
- package/dist/adapters/dom/components/index.js +420 -0
- package/dist/adapters/dom/components/index.js.map +1 -0
- package/dist/adapters/dom/index.cjs +171 -0
- package/dist/adapters/dom/index.cjs.map +1 -0
- package/dist/adapters/dom/index.d.cts +29 -0
- package/dist/adapters/dom/index.d.ts +29 -0
- package/dist/adapters/dom/index.js +15 -0
- package/dist/adapters/dom/index.js.map +1 -0
- package/dist/adapters/dom/server.cjs +129 -0
- package/dist/adapters/dom/server.cjs.map +1 -0
- package/dist/adapters/dom/server.d.cts +15 -0
- package/dist/adapters/dom/server.d.ts +15 -0
- package/dist/adapters/dom/server.js +37 -0
- package/dist/adapters/dom/server.js.map +1 -0
- package/dist/adapters/ink/index.d.ts +75 -0
- package/dist/adapters/ink/index.js +472 -0
- package/dist/adapters/ink/index.js.map +1 -0
- package/dist/adapters/react/components/index.cjs +552 -0
- package/dist/adapters/react/components/index.cjs.map +1 -0
- package/dist/adapters/react/components/index.d.cts +30 -0
- package/dist/adapters/react/components/index.d.ts +30 -0
- package/dist/adapters/react/components/index.js +12 -0
- package/dist/adapters/react/components/index.js.map +1 -0
- package/dist/adapters/react/index.cjs +1526 -0
- package/dist/adapters/react/index.cjs.map +1 -0
- package/dist/adapters/react/index.d.cts +149 -0
- package/dist/adapters/react/index.d.ts +149 -0
- package/dist/adapters/react/index.js +12 -0
- package/dist/adapters/react/index.js.map +1 -0
- package/dist/adapters/tty/components/index.cjs +255 -0
- package/dist/adapters/tty/components/index.cjs.map +1 -0
- package/dist/adapters/tty/components/index.d.cts +40 -0
- package/dist/adapters/tty/components/index.d.ts +40 -0
- package/dist/adapters/tty/components/index.js +187 -0
- package/dist/adapters/tty/components/index.js.map +1 -0
- package/dist/adapters/tty/index.cjs +76 -0
- package/dist/adapters/tty/index.cjs.map +1 -0
- package/dist/adapters/tty/index.d.cts +47 -0
- package/dist/adapters/tty/index.d.ts +47 -0
- package/dist/adapters/tty/index.js +76 -0
- package/dist/adapters/tty/index.js.map +1 -0
- package/dist/adapters/vue/components/index.cjs +619 -0
- package/dist/adapters/vue/components/index.cjs.map +1 -0
- package/dist/adapters/vue/components/index.d.cts +224 -0
- package/dist/adapters/vue/components/index.d.ts +224 -0
- package/dist/adapters/vue/components/index.js +12 -0
- package/dist/adapters/vue/components/index.js.map +1 -0
- package/dist/adapters/vue/index.cjs +747 -0
- package/dist/adapters/vue/index.cjs.map +1 -0
- package/dist/adapters/vue/index.d.cts +98 -0
- package/dist/adapters/vue/index.d.ts +98 -0
- package/dist/adapters/vue/index.js +127 -0
- package/dist/adapters/vue/index.js.map +1 -0
- package/dist/agent/index.cjs +178 -0
- package/dist/agent/index.cjs.map +1 -0
- package/dist/agent/index.d.cts +28 -0
- package/dist/agent/index.d.ts +28 -0
- package/dist/agent/index.js +30 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/chunk-2MNLEL45.js +47 -0
- package/dist/chunk-2MNLEL45.js.map +1 -0
- package/dist/chunk-3HGE3VWK.js +753 -0
- package/dist/chunk-3HGE3VWK.js.map +1 -0
- package/dist/chunk-4ZID7UX5.js +549 -0
- package/dist/chunk-4ZID7UX5.js.map +1 -0
- package/dist/chunk-7B3RDENH.js +1982 -0
- package/dist/chunk-7B3RDENH.js.map +1 -0
- package/dist/chunk-7S5BNPUS.js +54 -0
- package/dist/chunk-7S5BNPUS.js.map +1 -0
- package/dist/chunk-7TS3YVQR.js +114 -0
- package/dist/chunk-7TS3YVQR.js.map +1 -0
- package/dist/chunk-EG2RUXJN.js +266 -0
- package/dist/chunk-EG2RUXJN.js.map +1 -0
- package/dist/chunk-GVBBL36G.js +429 -0
- package/dist/chunk-GVBBL36G.js.map +1 -0
- package/dist/chunk-I5D2R5UA.js +753 -0
- package/dist/chunk-I5D2R5UA.js.map +1 -0
- package/dist/chunk-IGLCWXQ3.js +304 -0
- package/dist/chunk-IGLCWXQ3.js.map +1 -0
- package/dist/chunk-JI7ZRESP.js +64 -0
- package/dist/chunk-JI7ZRESP.js.map +1 -0
- package/dist/chunk-L5223LLX.js +31 -0
- package/dist/chunk-L5223LLX.js.map +1 -0
- package/dist/chunk-LA3BSEMX.js +1905 -0
- package/dist/chunk-LA3BSEMX.js.map +1 -0
- package/dist/chunk-OAMC6R6E.js +121 -0
- package/dist/chunk-OAMC6R6E.js.map +1 -0
- package/dist/chunk-OGD5CCMZ.js +62 -0
- package/dist/chunk-OGD5CCMZ.js.map +1 -0
- package/dist/chunk-PF4OJTYU.js +199 -0
- package/dist/chunk-PF4OJTYU.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +9 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/chunk-RBU5PHN4.js +8 -0
- package/dist/chunk-RBU5PHN4.js.map +1 -0
- package/dist/chunk-RQB4PRPV.js +285 -0
- package/dist/chunk-RQB4PRPV.js.map +1 -0
- package/dist/chunk-V32EVEVM.js +464 -0
- package/dist/chunk-V32EVEVM.js.map +1 -0
- package/dist/chunk-ZITHBBF3.js +85 -0
- package/dist/chunk-ZITHBBF3.js.map +1 -0
- package/dist/devtools/index.cjs +1088 -0
- package/dist/devtools/index.cjs.map +1 -0
- package/dist/devtools/index.d.cts +33 -0
- package/dist/devtools/index.d.ts +33 -0
- package/dist/devtools/index.js +399 -0
- package/dist/devtools/index.js.map +1 -0
- package/dist/effects-CndX9K7D.d.cts +123 -0
- package/dist/effects-CndX9K7D.d.ts +123 -0
- package/dist/endpoints-CD-6Jl-H.d.ts +36 -0
- package/dist/endpoints-Dem-EdRx.d.cts +36 -0
- package/dist/i18n/index.cjs +299 -0
- package/dist/i18n/index.cjs.map +1 -0
- package/dist/i18n/index.d.cts +28 -0
- package/dist/i18n/index.d.ts +28 -0
- package/dist/i18n/index.js +180 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/index-CNfzSBe2.d.ts +93 -0
- package/dist/index-caZoXSwr.d.cts +93 -0
- package/dist/index.cjs +3723 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +144 -0
- package/dist/index.d.ts +144 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/index.cjs +635 -0
- package/dist/migrations/index.cjs.map +1 -0
- package/dist/migrations/index.d.cts +97 -0
- package/dist/migrations/index.d.ts +97 -0
- package/dist/migrations/index.js +50 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/palette-CP0wd3bE.d.ts +15 -0
- package/dist/palette-lm0bU9i5.d.cts +15 -0
- package/dist/primitive-props-BH_EJWIe.d.cts +100 -0
- package/dist/primitive-props-BH_EJWIe.d.ts +100 -0
- package/dist/primitive-props-CGoJvmcH.d.cts +100 -0
- package/dist/primitive-props-CGoJvmcH.d.ts +100 -0
- package/dist/reflect/index.cjs +998 -0
- package/dist/reflect/index.cjs.map +1 -0
- package/dist/reflect/index.d.cts +125 -0
- package/dist/reflect/index.d.ts +125 -0
- package/dist/reflect/index.js +13 -0
- package/dist/reflect/index.js.map +1 -0
- package/dist/schemas-DPdeFlCT.d.cts +38 -0
- package/dist/schemas-DPdeFlCT.d.ts +38 -0
- package/dist/schemas-pMyyuXV7.d.cts +47 -0
- package/dist/schemas-pMyyuXV7.d.ts +47 -0
- package/dist/types-Boh9ckdG.d.ts +194 -0
- package/dist/types-Brc7v_pS.d.ts +198 -0
- package/dist/types-ByNSwtUV.d.cts +20 -0
- package/dist/types-DdltMfw7.d.ts +20 -0
- package/dist/types-De0KpxfI.d.cts +198 -0
- package/dist/types-DhHL0twe.d.ts +20 -0
- package/dist/types-Dv6JLmgo.d.cts +194 -0
- package/dist/types-Q80YtOQt.d.cts +20 -0
- package/package.json +237 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { N as NovaComponent, a as NovaDispatch, b as NovaPublish } from '../../types-ByNSwtUV.cjs';
|
|
2
|
+
export { c as NovaComponentProps, d as NovaModelBinding } from '../../types-ByNSwtUV.cjs';
|
|
3
|
+
import { FC, ReactNode, ComponentType, Component, ErrorInfo } from 'react';
|
|
4
|
+
import { A as ActionDefinition } from '../../index-caZoXSwr.cjs';
|
|
5
|
+
import { C as ComponentRegistry, b as RenderNode, r as RegistrationInput, L as LayoutStore, a as RenderOnError, R as RenderContext } from '../../types-De0KpxfI.cjs';
|
|
6
|
+
import { a as Shell, q as StateSnapshot, d as CanvasState, b as ActionStatus } from '../../types-Dv6JLmgo.cjs';
|
|
7
|
+
import { L as LayoutNode } from '../../schemas-DPdeFlCT.cjs';
|
|
8
|
+
import '../../schemas-pMyyuXV7.cjs';
|
|
9
|
+
import 'zod';
|
|
10
|
+
import '../../effects-CndX9K7D.cjs';
|
|
11
|
+
|
|
12
|
+
type SlotWrapperProps = {
|
|
13
|
+
canvasId?: string;
|
|
14
|
+
instanceId?: string;
|
|
15
|
+
action?: ActionDefinition;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
};
|
|
18
|
+
type SlotWrapper = FC<SlotWrapperProps>;
|
|
19
|
+
type NovaRenderContextValue = {
|
|
20
|
+
registry: ComponentRegistry<NovaComponent>;
|
|
21
|
+
dispatch: NovaDispatch;
|
|
22
|
+
publish: NovaPublish;
|
|
23
|
+
slotWrapper?: SlotWrapper;
|
|
24
|
+
fallback?: NovaComponent;
|
|
25
|
+
textWrapper?: ComponentType<{
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
}>;
|
|
28
|
+
errorMarker?: ComponentType<{
|
|
29
|
+
code: string;
|
|
30
|
+
message: string;
|
|
31
|
+
}>;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
type NovaRenderProviderProps = {
|
|
35
|
+
registry: ComponentRegistry<NovaComponent>;
|
|
36
|
+
dispatch?: NovaDispatch;
|
|
37
|
+
publish?: NovaPublish;
|
|
38
|
+
slotWrapper?: SlotWrapper;
|
|
39
|
+
fallback?: NovaComponent;
|
|
40
|
+
textWrapper?: ComponentType<{
|
|
41
|
+
children?: ReactNode;
|
|
42
|
+
}>;
|
|
43
|
+
errorMarker?: ComponentType<{
|
|
44
|
+
code: string;
|
|
45
|
+
message: string;
|
|
46
|
+
}>;
|
|
47
|
+
children?: ReactNode;
|
|
48
|
+
};
|
|
49
|
+
declare const NovaRenderProvider: FC<NovaRenderProviderProps>;
|
|
50
|
+
type NovaShellProviderProps = {
|
|
51
|
+
shell: Shell;
|
|
52
|
+
registry?: ComponentRegistry<NovaComponent>;
|
|
53
|
+
slotWrapper?: SlotWrapper;
|
|
54
|
+
children?: ReactNode;
|
|
55
|
+
};
|
|
56
|
+
declare const NovaShellProvider: FC<NovaShellProviderProps>;
|
|
57
|
+
|
|
58
|
+
type RenderTreeProps = {
|
|
59
|
+
nodes: RenderNode[];
|
|
60
|
+
};
|
|
61
|
+
declare const RenderTree: FC<RenderTreeProps>;
|
|
62
|
+
|
|
63
|
+
type RenderNodeViewProps = {
|
|
64
|
+
node: RenderNode;
|
|
65
|
+
};
|
|
66
|
+
declare const RenderNodeView: FC<RenderNodeViewProps>;
|
|
67
|
+
|
|
68
|
+
type ErrorMarkerProps = {
|
|
69
|
+
code: string;
|
|
70
|
+
message: string;
|
|
71
|
+
};
|
|
72
|
+
declare const ErrorMarker: FC<ErrorMarkerProps>;
|
|
73
|
+
|
|
74
|
+
type NovaErrorBoundaryProps = {
|
|
75
|
+
children?: ReactNode;
|
|
76
|
+
fallback?: (error: Error) => ReactNode;
|
|
77
|
+
onError?: (error: Error, info: ErrorInfo) => void;
|
|
78
|
+
};
|
|
79
|
+
type NovaErrorBoundaryState = {
|
|
80
|
+
error: Error | undefined;
|
|
81
|
+
};
|
|
82
|
+
declare class NovaErrorBoundary extends Component<NovaErrorBoundaryProps, NovaErrorBoundaryState> {
|
|
83
|
+
state: NovaErrorBoundaryState;
|
|
84
|
+
static getDerivedStateFromError(error: Error): NovaErrorBoundaryState;
|
|
85
|
+
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
86
|
+
render(): ReactNode;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
type NovaLayoutProps = {
|
|
90
|
+
layout: LayoutNode | string;
|
|
91
|
+
data?: Record<string, unknown>;
|
|
92
|
+
components?: Record<string, RegistrationInput<NovaComponent>>;
|
|
93
|
+
registry?: ComponentRegistry<NovaComponent>;
|
|
94
|
+
store?: LayoutStore;
|
|
95
|
+
builtins?: boolean;
|
|
96
|
+
strict?: boolean;
|
|
97
|
+
onError?: RenderOnError;
|
|
98
|
+
phrases?: RenderContext['phrases'];
|
|
99
|
+
phraseKeys?: RenderContext['phraseKeys'];
|
|
100
|
+
onPhraseMiss?: RenderContext['onPhraseMiss'];
|
|
101
|
+
children?: ReactNode;
|
|
102
|
+
};
|
|
103
|
+
declare const NovaLayout: FC<NovaLayoutProps>;
|
|
104
|
+
type NovaShellProps = {
|
|
105
|
+
shell: Shell;
|
|
106
|
+
registry?: ComponentRegistry<NovaComponent>;
|
|
107
|
+
slotWrapper?: SlotWrapper;
|
|
108
|
+
builtins?: boolean;
|
|
109
|
+
};
|
|
110
|
+
declare const NovaShell: FC<NovaShellProps>;
|
|
111
|
+
type NovaCanvasProps = {
|
|
112
|
+
id: string;
|
|
113
|
+
shell?: Shell;
|
|
114
|
+
registry?: ComponentRegistry<NovaComponent>;
|
|
115
|
+
builtins?: boolean;
|
|
116
|
+
};
|
|
117
|
+
declare const NovaCanvas: FC<NovaCanvasProps>;
|
|
118
|
+
declare const Nova: {
|
|
119
|
+
readonly Layout: FC<NovaLayoutProps>;
|
|
120
|
+
readonly Shell: FC<NovaShellProps>;
|
|
121
|
+
readonly Canvas: FC<NovaCanvasProps>;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
declare const useShell: () => Shell;
|
|
125
|
+
|
|
126
|
+
declare const useShellState: () => StateSnapshot;
|
|
127
|
+
|
|
128
|
+
declare const useCanvas: (canvasId: string) => CanvasState;
|
|
129
|
+
|
|
130
|
+
type DataSnapshot = Record<string, unknown> | undefined;
|
|
131
|
+
declare const useActionData: (instanceId: string) => DataSnapshot;
|
|
132
|
+
|
|
133
|
+
declare const useActionStatus: (instanceId: string) => ActionStatus | undefined;
|
|
134
|
+
|
|
135
|
+
declare const useRenderTree: (instanceId: string) => RenderNode[];
|
|
136
|
+
|
|
137
|
+
declare const useShellRenderTree: () => RenderNode[];
|
|
138
|
+
|
|
139
|
+
declare const useCanvasRenderTree: (canvasId: string | undefined) => RenderNode[];
|
|
140
|
+
|
|
141
|
+
declare const useNovaDispatch: () => NovaDispatch;
|
|
142
|
+
|
|
143
|
+
declare const useNovaPublish: () => NovaPublish;
|
|
144
|
+
|
|
145
|
+
declare const useNovaRegistry: () => ComponentRegistry<NovaComponent>;
|
|
146
|
+
|
|
147
|
+
declare const useSlotWrapper: () => SlotWrapper | undefined;
|
|
148
|
+
|
|
149
|
+
export { ErrorMarker, type ErrorMarkerProps, Nova, NovaCanvas, type NovaCanvasProps, NovaComponent, NovaDispatch, NovaErrorBoundary, type NovaErrorBoundaryProps, NovaLayout, type NovaLayoutProps, NovaPublish, type NovaRenderContextValue, NovaRenderProvider, type NovaRenderProviderProps, NovaShell, type NovaShellProps, NovaShellProvider, type NovaShellProviderProps, RenderNodeView, type RenderNodeViewProps, RenderTree, type RenderTreeProps, type SlotWrapper, type SlotWrapperProps, useActionData, useActionStatus, useCanvas, useCanvasRenderTree, useNovaDispatch, useNovaPublish, useNovaRegistry, useRenderTree, useShell, useShellRenderTree, useShellState, useSlotWrapper };
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { N as NovaComponent, a as NovaDispatch, b as NovaPublish } from '../../types-DdltMfw7.js';
|
|
2
|
+
export { c as NovaComponentProps, d as NovaModelBinding } from '../../types-DdltMfw7.js';
|
|
3
|
+
import { FC, ReactNode, ComponentType, Component, ErrorInfo } from 'react';
|
|
4
|
+
import { A as ActionDefinition } from '../../index-CNfzSBe2.js';
|
|
5
|
+
import { C as ComponentRegistry, b as RenderNode, r as RegistrationInput, L as LayoutStore, a as RenderOnError, R as RenderContext } from '../../types-Brc7v_pS.js';
|
|
6
|
+
import { a as Shell, q as StateSnapshot, d as CanvasState, b as ActionStatus } from '../../types-Boh9ckdG.js';
|
|
7
|
+
import { L as LayoutNode } from '../../schemas-DPdeFlCT.js';
|
|
8
|
+
import '../../schemas-pMyyuXV7.js';
|
|
9
|
+
import 'zod';
|
|
10
|
+
import '../../effects-CndX9K7D.js';
|
|
11
|
+
|
|
12
|
+
type SlotWrapperProps = {
|
|
13
|
+
canvasId?: string;
|
|
14
|
+
instanceId?: string;
|
|
15
|
+
action?: ActionDefinition;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
};
|
|
18
|
+
type SlotWrapper = FC<SlotWrapperProps>;
|
|
19
|
+
type NovaRenderContextValue = {
|
|
20
|
+
registry: ComponentRegistry<NovaComponent>;
|
|
21
|
+
dispatch: NovaDispatch;
|
|
22
|
+
publish: NovaPublish;
|
|
23
|
+
slotWrapper?: SlotWrapper;
|
|
24
|
+
fallback?: NovaComponent;
|
|
25
|
+
textWrapper?: ComponentType<{
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
}>;
|
|
28
|
+
errorMarker?: ComponentType<{
|
|
29
|
+
code: string;
|
|
30
|
+
message: string;
|
|
31
|
+
}>;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
type NovaRenderProviderProps = {
|
|
35
|
+
registry: ComponentRegistry<NovaComponent>;
|
|
36
|
+
dispatch?: NovaDispatch;
|
|
37
|
+
publish?: NovaPublish;
|
|
38
|
+
slotWrapper?: SlotWrapper;
|
|
39
|
+
fallback?: NovaComponent;
|
|
40
|
+
textWrapper?: ComponentType<{
|
|
41
|
+
children?: ReactNode;
|
|
42
|
+
}>;
|
|
43
|
+
errorMarker?: ComponentType<{
|
|
44
|
+
code: string;
|
|
45
|
+
message: string;
|
|
46
|
+
}>;
|
|
47
|
+
children?: ReactNode;
|
|
48
|
+
};
|
|
49
|
+
declare const NovaRenderProvider: FC<NovaRenderProviderProps>;
|
|
50
|
+
type NovaShellProviderProps = {
|
|
51
|
+
shell: Shell;
|
|
52
|
+
registry?: ComponentRegistry<NovaComponent>;
|
|
53
|
+
slotWrapper?: SlotWrapper;
|
|
54
|
+
children?: ReactNode;
|
|
55
|
+
};
|
|
56
|
+
declare const NovaShellProvider: FC<NovaShellProviderProps>;
|
|
57
|
+
|
|
58
|
+
type RenderTreeProps = {
|
|
59
|
+
nodes: RenderNode[];
|
|
60
|
+
};
|
|
61
|
+
declare const RenderTree: FC<RenderTreeProps>;
|
|
62
|
+
|
|
63
|
+
type RenderNodeViewProps = {
|
|
64
|
+
node: RenderNode;
|
|
65
|
+
};
|
|
66
|
+
declare const RenderNodeView: FC<RenderNodeViewProps>;
|
|
67
|
+
|
|
68
|
+
type ErrorMarkerProps = {
|
|
69
|
+
code: string;
|
|
70
|
+
message: string;
|
|
71
|
+
};
|
|
72
|
+
declare const ErrorMarker: FC<ErrorMarkerProps>;
|
|
73
|
+
|
|
74
|
+
type NovaErrorBoundaryProps = {
|
|
75
|
+
children?: ReactNode;
|
|
76
|
+
fallback?: (error: Error) => ReactNode;
|
|
77
|
+
onError?: (error: Error, info: ErrorInfo) => void;
|
|
78
|
+
};
|
|
79
|
+
type NovaErrorBoundaryState = {
|
|
80
|
+
error: Error | undefined;
|
|
81
|
+
};
|
|
82
|
+
declare class NovaErrorBoundary extends Component<NovaErrorBoundaryProps, NovaErrorBoundaryState> {
|
|
83
|
+
state: NovaErrorBoundaryState;
|
|
84
|
+
static getDerivedStateFromError(error: Error): NovaErrorBoundaryState;
|
|
85
|
+
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
86
|
+
render(): ReactNode;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
type NovaLayoutProps = {
|
|
90
|
+
layout: LayoutNode | string;
|
|
91
|
+
data?: Record<string, unknown>;
|
|
92
|
+
components?: Record<string, RegistrationInput<NovaComponent>>;
|
|
93
|
+
registry?: ComponentRegistry<NovaComponent>;
|
|
94
|
+
store?: LayoutStore;
|
|
95
|
+
builtins?: boolean;
|
|
96
|
+
strict?: boolean;
|
|
97
|
+
onError?: RenderOnError;
|
|
98
|
+
phrases?: RenderContext['phrases'];
|
|
99
|
+
phraseKeys?: RenderContext['phraseKeys'];
|
|
100
|
+
onPhraseMiss?: RenderContext['onPhraseMiss'];
|
|
101
|
+
children?: ReactNode;
|
|
102
|
+
};
|
|
103
|
+
declare const NovaLayout: FC<NovaLayoutProps>;
|
|
104
|
+
type NovaShellProps = {
|
|
105
|
+
shell: Shell;
|
|
106
|
+
registry?: ComponentRegistry<NovaComponent>;
|
|
107
|
+
slotWrapper?: SlotWrapper;
|
|
108
|
+
builtins?: boolean;
|
|
109
|
+
};
|
|
110
|
+
declare const NovaShell: FC<NovaShellProps>;
|
|
111
|
+
type NovaCanvasProps = {
|
|
112
|
+
id: string;
|
|
113
|
+
shell?: Shell;
|
|
114
|
+
registry?: ComponentRegistry<NovaComponent>;
|
|
115
|
+
builtins?: boolean;
|
|
116
|
+
};
|
|
117
|
+
declare const NovaCanvas: FC<NovaCanvasProps>;
|
|
118
|
+
declare const Nova: {
|
|
119
|
+
readonly Layout: FC<NovaLayoutProps>;
|
|
120
|
+
readonly Shell: FC<NovaShellProps>;
|
|
121
|
+
readonly Canvas: FC<NovaCanvasProps>;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
declare const useShell: () => Shell;
|
|
125
|
+
|
|
126
|
+
declare const useShellState: () => StateSnapshot;
|
|
127
|
+
|
|
128
|
+
declare const useCanvas: (canvasId: string) => CanvasState;
|
|
129
|
+
|
|
130
|
+
type DataSnapshot = Record<string, unknown> | undefined;
|
|
131
|
+
declare const useActionData: (instanceId: string) => DataSnapshot;
|
|
132
|
+
|
|
133
|
+
declare const useActionStatus: (instanceId: string) => ActionStatus | undefined;
|
|
134
|
+
|
|
135
|
+
declare const useRenderTree: (instanceId: string) => RenderNode[];
|
|
136
|
+
|
|
137
|
+
declare const useShellRenderTree: () => RenderNode[];
|
|
138
|
+
|
|
139
|
+
declare const useCanvasRenderTree: (canvasId: string | undefined) => RenderNode[];
|
|
140
|
+
|
|
141
|
+
declare const useNovaDispatch: () => NovaDispatch;
|
|
142
|
+
|
|
143
|
+
declare const useNovaPublish: () => NovaPublish;
|
|
144
|
+
|
|
145
|
+
declare const useNovaRegistry: () => ComponentRegistry<NovaComponent>;
|
|
146
|
+
|
|
147
|
+
declare const useSlotWrapper: () => SlotWrapper | undefined;
|
|
148
|
+
|
|
149
|
+
export { ErrorMarker, type ErrorMarkerProps, Nova, NovaCanvas, type NovaCanvasProps, NovaComponent, NovaDispatch, NovaErrorBoundary, type NovaErrorBoundaryProps, NovaLayout, type NovaLayoutProps, NovaPublish, type NovaRenderContextValue, NovaRenderProvider, type NovaRenderProviderProps, NovaShell, type NovaShellProps, NovaShellProvider, type NovaShellProviderProps, RenderNodeView, type RenderNodeViewProps, RenderTree, type RenderTreeProps, type SlotWrapper, type SlotWrapperProps, useActionData, useActionStatus, useCanvas, useCanvasRenderTree, useNovaDispatch, useNovaPublish, useNovaRegistry, useRenderTree, useShell, useShellRenderTree, useShellState, useSlotWrapper };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { ErrorMarker, Nova, NovaCanvas, NovaErrorBoundary, NovaLayout, NovaRenderProvider, NovaShell, NovaShellProvider, RenderNodeView, RenderTree, useActionData, useActionStatus, useCanvas, useCanvasRenderTree, useNovaDispatch, useNovaPublish, useNovaRegistry, useRenderTree, useShell, useShellRenderTree, useShellState, useSlotWrapper } from '../../chunk-3HGE3VWK.js';
|
|
2
|
+
import '../../chunk-7S5BNPUS.js';
|
|
3
|
+
import '../../chunk-ZITHBBF3.js';
|
|
4
|
+
import '../../chunk-V32EVEVM.js';
|
|
5
|
+
import '../../chunk-7TS3YVQR.js';
|
|
6
|
+
import '../../chunk-PF4OJTYU.js';
|
|
7
|
+
import '../../chunk-JI7ZRESP.js';
|
|
8
|
+
import '../../chunk-RBU5PHN4.js';
|
|
9
|
+
import '../../chunk-2MNLEL45.js';
|
|
10
|
+
import '../../chunk-PZ5AY32C.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/layout/registry.ts
|
|
4
|
+
var hasOwn = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
5
|
+
var isComponentMeta = (value) => {
|
|
6
|
+
if (typeof value !== "object" || value === null) return false;
|
|
7
|
+
return true;
|
|
8
|
+
};
|
|
9
|
+
var extractStaticMeta = (component) => {
|
|
10
|
+
if (typeof component !== "function" && (typeof component !== "object" || component === null)) {
|
|
11
|
+
return void 0;
|
|
12
|
+
}
|
|
13
|
+
const host = component;
|
|
14
|
+
if (!hasOwn(host, "meta")) return void 0;
|
|
15
|
+
const candidate = host.meta;
|
|
16
|
+
if (!isComponentMeta(candidate)) return void 0;
|
|
17
|
+
return candidate;
|
|
18
|
+
};
|
|
19
|
+
var isEntryShape = (value) => {
|
|
20
|
+
if (typeof value !== "object" || value === null) return false;
|
|
21
|
+
return hasOwn(value, "component");
|
|
22
|
+
};
|
|
23
|
+
var createComponentRegistry = () => {
|
|
24
|
+
const entries = /* @__PURE__ */ new Map();
|
|
25
|
+
const register = (name, component, meta) => {
|
|
26
|
+
const staticMeta = extractStaticMeta(component);
|
|
27
|
+
const merged = { ...staticMeta ?? {}, ...meta ?? {} };
|
|
28
|
+
entries.set(name, { component, meta: merged });
|
|
29
|
+
};
|
|
30
|
+
const registerAll = (batch) => {
|
|
31
|
+
for (const name of Object.keys(batch)) {
|
|
32
|
+
const input = batch[name];
|
|
33
|
+
if (input === void 0) continue;
|
|
34
|
+
if (isEntryShape(input)) {
|
|
35
|
+
register(name, input.component, input.meta);
|
|
36
|
+
} else {
|
|
37
|
+
register(name, input);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const get = (name) => entries.get(name);
|
|
42
|
+
const has = (name) => entries.has(name);
|
|
43
|
+
const list = () => Array.from(entries.keys());
|
|
44
|
+
return { register, registerAll, get, has, list };
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// src/adapters/tty/components/props.ts
|
|
48
|
+
var num = (props, key) => {
|
|
49
|
+
const value = props[key];
|
|
50
|
+
return typeof value === "number" ? value : void 0;
|
|
51
|
+
};
|
|
52
|
+
var str = (props, key) => {
|
|
53
|
+
const value = props[key];
|
|
54
|
+
return typeof value === "string" ? value : void 0;
|
|
55
|
+
};
|
|
56
|
+
var bool = (props, key) => props[key] === true;
|
|
57
|
+
var ICON = {
|
|
58
|
+
plus: "+",
|
|
59
|
+
bell: "\u{1F514}",
|
|
60
|
+
sparkles: "\u2728",
|
|
61
|
+
more: "\u22EF",
|
|
62
|
+
search: "\u{1F50D}",
|
|
63
|
+
check: "\u2713",
|
|
64
|
+
close: "\u2715",
|
|
65
|
+
settings: "\u2699"
|
|
66
|
+
};
|
|
67
|
+
var iconGlyph = (name) => ICON[name] ?? name;
|
|
68
|
+
var stack = (children) => ({ lines: children.flatMap((child) => child.lines) });
|
|
69
|
+
var inline = (children, separator = " ") => {
|
|
70
|
+
const flat = children.filter((child) => child.lines.length > 0);
|
|
71
|
+
if (flat.every((child) => child.lines.length === 1)) {
|
|
72
|
+
const line = flat.map((child) => child.lines[0]).join(separator).trim();
|
|
73
|
+
return { lines: line === "" ? [] : [line] };
|
|
74
|
+
}
|
|
75
|
+
return stack(flat);
|
|
76
|
+
};
|
|
77
|
+
var inlineText = (children) => inline(children, " ").lines.join(" ").trim();
|
|
78
|
+
var truncate = (text, width) => text.length <= width ? text : `${text.slice(0, Math.max(0, width - 1))}\u2026`;
|
|
79
|
+
var pad = (text, width) => truncate(text, width).padEnd(width);
|
|
80
|
+
var indent = (block, prefix = " ") => ({ lines: block.lines.map((line) => `${prefix}${line}`) });
|
|
81
|
+
|
|
82
|
+
// src/adapters/tty/components/components.ts
|
|
83
|
+
var Box = ({ children }) => stack(children);
|
|
84
|
+
var Stack = ({ children }) => stack(children);
|
|
85
|
+
var Row = ({ children }) => inline(children);
|
|
86
|
+
var Grid = ({ children }) => inline(children);
|
|
87
|
+
var Text = ({ props, children }) => {
|
|
88
|
+
const block = inline(children, " ");
|
|
89
|
+
return bool(props, "upper") ? { lines: block.lines.map((line) => line.toUpperCase()) } : block;
|
|
90
|
+
};
|
|
91
|
+
var Button = ({ props, children }) => {
|
|
92
|
+
const label = inlineText(children);
|
|
93
|
+
const icon = str(props, "icon");
|
|
94
|
+
const text = label !== "" ? label : icon !== void 0 ? icon : "";
|
|
95
|
+
return { lines: [`(${text})`] };
|
|
96
|
+
};
|
|
97
|
+
var Input = ({ props }) => {
|
|
98
|
+
const raw = props["value"];
|
|
99
|
+
const value = typeof raw === "string" || typeof raw === "number" ? String(raw) : "";
|
|
100
|
+
const shown = str(props, "type") === "password" ? "\u2022".repeat(value.length) : value;
|
|
101
|
+
const placeholder = str(props, "placeholder") ?? "";
|
|
102
|
+
return { lines: [`\u27E8${shown !== "" ? shown : placeholder}\u27E9`] };
|
|
103
|
+
};
|
|
104
|
+
var Textarea = ({ props }) => {
|
|
105
|
+
const raw = props["value"];
|
|
106
|
+
const value = typeof raw === "string" || typeof raw === "number" ? String(raw) : "";
|
|
107
|
+
if (value === "") return { lines: [`\u27E8${str(props, "placeholder") ?? ""}\u27E9`] };
|
|
108
|
+
return { lines: value.split("\n").map((line) => `\u27E8 ${line}`) };
|
|
109
|
+
};
|
|
110
|
+
var Checkbox = ({ props }) => ({
|
|
111
|
+
lines: [bool(props, "value") || bool(props, "checked") ? "\u2611" : "\u2610"]
|
|
112
|
+
});
|
|
113
|
+
var Badge = ({ children }) => {
|
|
114
|
+
const text = inlineText(children);
|
|
115
|
+
return { lines: text === "" ? [] : [`\u2039${text}\u203A`] };
|
|
116
|
+
};
|
|
117
|
+
var at = (row, key) => {
|
|
118
|
+
let cursor = row;
|
|
119
|
+
for (const segment of key.split(".")) {
|
|
120
|
+
if (cursor === null || typeof cursor !== "object") return void 0;
|
|
121
|
+
cursor = Reflect.get(cursor, segment);
|
|
122
|
+
}
|
|
123
|
+
return cursor;
|
|
124
|
+
};
|
|
125
|
+
var cellText = (value) => value === null || value === void 0 ? "" : String(value);
|
|
126
|
+
var columnsOf = (props) => {
|
|
127
|
+
const value = props["columns"];
|
|
128
|
+
if (!Array.isArray(value)) return [];
|
|
129
|
+
const out = [];
|
|
130
|
+
for (const item of value) if (item !== null && typeof item === "object") out.push(item);
|
|
131
|
+
return out;
|
|
132
|
+
};
|
|
133
|
+
var cellKey = (column) => typeof column.cell?.key === "string" ? column.cell.key : "";
|
|
134
|
+
var CELL_CAP = 28;
|
|
135
|
+
var Table = ({ props, register }) => {
|
|
136
|
+
const columns = columnsOf(props);
|
|
137
|
+
const rows = Array.isArray(props["rows"]) ? props["rows"] : [];
|
|
138
|
+
const rowKey = str(props, "rowKey") ?? "id";
|
|
139
|
+
const clickKey = str(props, "clickKey") ?? rowKey;
|
|
140
|
+
const rowRef = str(props, "rowRef");
|
|
141
|
+
if (rows.length === 0) return { lines: [str(props, "empty") ?? "Nothing here."] };
|
|
142
|
+
const header = columns.map((column) => typeof column.label === "string" ? column.label : "");
|
|
143
|
+
const body = rows.map((row) => columns.map((column) => truncate(cellText(at(row, cellKey(column))), CELL_CAP)));
|
|
144
|
+
const widths = header.map((label, i) => Math.max(truncate(label, CELL_CAP).length, ...body.map((cells) => cells[i]?.length ?? 0)));
|
|
145
|
+
const markers = rowRef === void 0 ? rows.map(() => "") : rows.map((row, i) => `[${register({ kind: "row", ref: rowRef, label: body[i]?.[0] ?? rowRef, value: at(row, clickKey) })}] `);
|
|
146
|
+
const markerWidth = Math.max(0, ...markers.map((marker) => marker.length));
|
|
147
|
+
const layout = (marker, cells) => (marker.padStart(markerWidth) + cells.map((cell, i) => pad(cell, widths[i] ?? 0)).join(" ")).trimEnd();
|
|
148
|
+
return {
|
|
149
|
+
lines: [
|
|
150
|
+
layout("".padStart(markerWidth), header.map((label, i) => pad(label, widths[i] ?? 0))),
|
|
151
|
+
layout("".padStart(markerWidth), widths.map((width) => "\u2500".repeat(width))),
|
|
152
|
+
...body.map((cells, i) => layout(markers[i] ?? "", cells))
|
|
153
|
+
]
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
var Panel = ({ props, children, register }) => {
|
|
157
|
+
const title = str(props, "title");
|
|
158
|
+
const lines = [];
|
|
159
|
+
if (title !== void 0) {
|
|
160
|
+
const parts = [];
|
|
161
|
+
const backRef = str(props, "backRef");
|
|
162
|
+
if (backRef !== void 0) parts.push(`[${register({ kind: "click", ref: backRef, label: "\u2190 back" })}] \u2190`);
|
|
163
|
+
parts.push(title);
|
|
164
|
+
const closeRef = str(props, "closeRef");
|
|
165
|
+
if (closeRef !== void 0) parts.push(`[${register({ kind: "click", ref: closeRef, label: "\u2715 close" })}] \u2715`);
|
|
166
|
+
const head = `\u250C\u2500 ${parts.join(" ")} `;
|
|
167
|
+
lines.push(head + "\u2500".repeat(Math.max(0, 48 - head.length)));
|
|
168
|
+
}
|
|
169
|
+
lines.push(...indent(stack(children), title === void 0 ? "" : "\u2502 ").lines);
|
|
170
|
+
return { lines };
|
|
171
|
+
};
|
|
172
|
+
var DEPTH_CAP = 4;
|
|
173
|
+
var ENTRY_CAP = 20;
|
|
174
|
+
var jsonLines = (value, key, depth) => {
|
|
175
|
+
const pfx = " ".repeat(depth);
|
|
176
|
+
if (value !== null && typeof value === "object") {
|
|
177
|
+
const entries = Array.isArray(value) ? value.map((item, i) => [String(i), item]) : Object.entries(value);
|
|
178
|
+
const shape = Array.isArray(value) ? `[${entries.length}]` : `{${entries.length}}`;
|
|
179
|
+
const summary = key === void 0 ? shape : `${key} ${shape}`;
|
|
180
|
+
if (depth >= DEPTH_CAP) return [`${pfx}${summary} \u2026`];
|
|
181
|
+
const shown = entries.slice(0, ENTRY_CAP);
|
|
182
|
+
return [
|
|
183
|
+
`${pfx}${summary}`,
|
|
184
|
+
...shown.flatMap(([childKey, childValue]) => jsonLines(childValue, childKey, depth + 1)),
|
|
185
|
+
...entries.length > ENTRY_CAP ? [`${" ".repeat(depth + 1)}\u2026 +${entries.length - ENTRY_CAP} more`] : []
|
|
186
|
+
];
|
|
187
|
+
}
|
|
188
|
+
return [`${pfx}${key === void 0 ? "" : `${key}: `}${JSON.stringify(value)}`];
|
|
189
|
+
};
|
|
190
|
+
var JsonTree = ({ props }) => ({ lines: jsonLines(props["value"], str(props, "label"), 0) });
|
|
191
|
+
var ActionSlot = ({ children }) => stack(children);
|
|
192
|
+
var fallback = ({ props, children }) => {
|
|
193
|
+
const block = stack(children);
|
|
194
|
+
if (block.lines.length > 0) return block;
|
|
195
|
+
const label = str(props, "label") ?? str(props, "title");
|
|
196
|
+
if (label === void 0) return { lines: [] };
|
|
197
|
+
const count = props["count"];
|
|
198
|
+
const suffix = typeof count === "number" || typeof count === "string" && count !== "" ? ` (${String(count)})` : "";
|
|
199
|
+
return { lines: [`${label}${suffix}`] };
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
// src/adapters/tty/components/registry.ts
|
|
203
|
+
var defaultRegistry = () => {
|
|
204
|
+
const registry = createComponentRegistry();
|
|
205
|
+
registry.registerAll({
|
|
206
|
+
Box,
|
|
207
|
+
Row,
|
|
208
|
+
Stack,
|
|
209
|
+
Grid,
|
|
210
|
+
Text,
|
|
211
|
+
Button,
|
|
212
|
+
Input,
|
|
213
|
+
Select: Input,
|
|
214
|
+
Textarea,
|
|
215
|
+
Checkbox,
|
|
216
|
+
Switch: Checkbox,
|
|
217
|
+
Table,
|
|
218
|
+
Badge,
|
|
219
|
+
// introspection primitives (used by nova/devtools; useful anywhere)
|
|
220
|
+
Panel,
|
|
221
|
+
JsonTree,
|
|
222
|
+
// the per-instance boundary from a flattened shell tree — pass-through
|
|
223
|
+
ActionSlot
|
|
224
|
+
});
|
|
225
|
+
return registry;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
exports.ActionSlot = ActionSlot;
|
|
229
|
+
exports.Badge = Badge;
|
|
230
|
+
exports.Box = Box;
|
|
231
|
+
exports.Button = Button;
|
|
232
|
+
exports.Checkbox = Checkbox;
|
|
233
|
+
exports.Grid = Grid;
|
|
234
|
+
exports.Input = Input;
|
|
235
|
+
exports.JsonTree = JsonTree;
|
|
236
|
+
exports.Panel = Panel;
|
|
237
|
+
exports.Row = Row;
|
|
238
|
+
exports.Stack = Stack;
|
|
239
|
+
exports.Table = Table;
|
|
240
|
+
exports.Text = Text;
|
|
241
|
+
exports.Textarea = Textarea;
|
|
242
|
+
exports.bool = bool;
|
|
243
|
+
exports.defaultRegistry = defaultRegistry;
|
|
244
|
+
exports.fallback = fallback;
|
|
245
|
+
exports.iconGlyph = iconGlyph;
|
|
246
|
+
exports.indent = indent;
|
|
247
|
+
exports.inline = inline;
|
|
248
|
+
exports.inlineText = inlineText;
|
|
249
|
+
exports.num = num;
|
|
250
|
+
exports.pad = pad;
|
|
251
|
+
exports.stack = stack;
|
|
252
|
+
exports.str = str;
|
|
253
|
+
exports.truncate = truncate;
|
|
254
|
+
//# sourceMappingURL=index.cjs.map
|
|
255
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/layout/registry.ts","../../../../src/adapters/tty/components/props.ts","../../../../src/adapters/tty/components/components.ts","../../../../src/adap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CAAA;AAC5B,EAAA,IAAI,KAAA,CAAM,KAAA,CAAM,MAAA,GAAS,CAAA,EAAG,OAAO,KAAA;AACnC,EAAA,MAAM,QAAQ,GAAA,CAAI,KAAA,EAAO,OAAO,CAAA,IAAK,GAAA,CAAI,OAAO,OAAO,CAAA;AACvD,EAAA,IAAI,UAAU,MAAA,EAAW,OAAO,EAAE,KAAA,EAAO,EAAC,EAAE;AAC5C,EAAA,MAAM,KAAA,GAAQ,MAAM,OAAO,CAAA;AAC3B,EAAA,MAAM,MAAA,GAAS,OAAO,KAAA,KAAU,QAAA,IAAa,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU,EAAA,GAAM,CAAA,EAAA,EAAK,MAAA,CAAO,KAAK,CAAC,CAAA,CAAA,CAAA,GAAM,EAAA;AAClH,EAAA,OAAO,EAAE,OAAO,CAAC,CAAA,EAAG,KAAK,CAAA,EAAG,MAAM,EAAE,CAAA,EAAE;AACxC;;;ACxKO,IAAM,kBAAkB,MAAuC;AACpE,EAAA,MAAM,WAAW,uBAAA,EAAsC;AACvD,EAAA,QAAA,CAAS,WAAA,CAAY;AAAA,IACnB,GAAA;AAAA,IACA,GAAA;AAAA,IACA,KAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,MAAA;AAAA,IACA,KAAA;AAAA,IACA,MAAA,EAAQ,KAAA;AAAA,IACR,QAAA;AAAA,IACA,QAAA;AAAA,IACA,MAAA,EAAQ,QAAA;AAAA,IACR,KAAA;AAAA,IACA,KAAA;AAAA;AAAA,IAEA,KAAA;AAAA,IACA,QAAA;AAAA;AAAA,IAEA;AAAA,GACD,CAAA;AACD,EAAA,OAAO,QAAA;AACT","file":"index.cjs","sourcesContent":["import type {\n ComponentEntry,\n ComponentMeta,\n ComponentRegistry,\n RegistrationInput,\n} from './types';\n\n// ═══════════════════════════════════════════════════════════\n// Component registry\n//\n// Stores `{component, meta}` entries keyed by name. Components\n// can carry a static `.meta` property; `registerAll` picks it up\n// automatically. Explicit meta passed to `register`/`registerAll`\n// wins over a component's static meta.\n// ═══════════════════════════════════════════════════════════\n\nconst hasOwn = (value: object, key: string): boolean =>\n Object.prototype.hasOwnProperty.call(value, key);\n\nconst isComponentMeta = (value: unknown): value is ComponentMeta => {\n if (typeof value !== 'object' || value === null) return false;\n // Meta is an open bag with optional fields; any plain object qualifies.\n return true;\n};\n\nconst extractStaticMeta = <TComponent>(component: TComponent): ComponentMeta | undefined => {\n if (typeof component !== 'function' && (typeof component !== 'object' || component === null)) {\n return undefined;\n }\n const host: object = component;\n if (!hasOwn(host, 'meta')) return undefined;\n const candidate = (host as { meta: unknown }).meta;\n if (!isComponentMeta(candidate)) return undefined;\n return candidate;\n};\n\nconst isEntryShape = <TComponent>(\n value: RegistrationInput<TComponent>,\n): value is { component: TComponent; meta?: ComponentMeta } => {\n if (typeof value !== 'object' || value === null) return false;\n return hasOwn(value, 'component');\n};\n\nexport const createComponentRegistry = <TComponent = unknown>(): ComponentRegistry<TComponent> => {\n const entries = new Map<string, ComponentEntry<TComponent>>();\n\n const register = (name: string, component: TComponent, meta?: ComponentMeta): void => {\n const staticMeta = extractStaticMeta(component);\n const merged: ComponentMeta = { ...(staticMeta ?? {}), ...(meta ?? {}) };\n entries.set(name, { component, meta: merged });\n };\n\n const registerAll = (batch: Record<string, RegistrationInput<TComponent>>): void => {\n for (const name of Object.keys(batch)) {\n const input = batch[name];\n if (input === undefined) continue;\n if (isEntryShape<TComponent>(input)) {\n register(name, input.component, input.meta);\n } else {\n register(name, input);\n }\n }\n };\n\n const get = (name: string): ComponentEntry<TComponent> | undefined => entries.get(name);\n\n const has = (name: string): boolean => entries.has(name);\n\n const list = (): string[] => Array.from(entries.keys());\n\n return { register, registerAll, get, has, list };\n};\n","// ═══════════════════════════════════════════════════════════\n// Prop readers + line arithmetic for the TTY kit. The readers mirror the DOM\n// kit's (narrow `unknown` with `typeof`, no casts); the line helpers are what\n// a terminal has instead of CSS — stack, inline-join, pad, truncate.\n// ═══════════════════════════════════════════════════════════\n\nimport type { TtyBlock } from '../index';\n\nexport type Props = Record<string, unknown>;\n\nexport const num = (props: Props, key: string): number | undefined => {\n const value = props[key];\n return typeof value === 'number' ? value : undefined;\n};\n\nexport const str = (props: Props, key: string): string | undefined => {\n const value = props[key];\n return typeof value === 'string' ? value : undefined;\n};\n\nexport const bool = (props: Props, key: string): boolean => props[key] === true;\n\n// A handful of icon names → a glyph, so icon-only buttons show something.\nconst ICON: Record<string, string> = {\n plus: '+', bell: '\\u{1F514}', sparkles: '✨', more: '⋯', search: '\\u{1F50D}', check: '✓', close: '✕', settings: '⚙',\n};\nexport const iconGlyph = (name: string): string => ICON[name] ?? name;\n\n// Stack child blocks vertically — the terminal's default flow.\nexport const stack = (children: TtyBlock[]): TtyBlock => ({ lines: children.flatMap((child) => child.lines) });\n\n// Join children on one line when every child IS one line ('a b c');\n// a multi-line child degrades the row to a stack — columns are not worth\n// faking with padding at this altitude.\nexport const inline = (children: TtyBlock[], separator = ' '): TtyBlock => {\n const flat = children.filter((child) => child.lines.length > 0);\n if (flat.every((child) => child.lines.length === 1)) {\n const line = flat.map((child) => child.lines[0]).join(separator).trim();\n return { lines: line === '' ? [] : [line] };\n }\n return stack(flat);\n};\n\n// The inline TEXT of children, for leaves that want a string (Button label).\nexport const inlineText = (children: TtyBlock[]): string => inline(children, ' ').lines.join(' ').trim();\n\nexport const truncate = (text: string, width: number): string =>\n text.length <= width ? text : `${text.slice(0, Math.max(0, width - 1))}…`;\n\nexport const pad = (text: string, width: number): string => truncate(text, width).padEnd(width);\n\nexport const indent = (block: TtyBlock, prefix = ' '): TtyBlock => ({ lines: block.lines.map((line) => `${prefix}${line}`) });\n","import type { TtyBlock, TtyComponent } from '../index';\nimport { str, bool, stack, inline, inlineText, truncate, pad, indent } from './props';\n\n// ═══════════════════════════════════════════════════════════\n// The TTY reference kit — the same domain-blind vocabulary as the DOM kit\n// (same names, same props), interpreted for a line terminal. Interpretation\n// is the target's freedom: a Row joins single-line children inline, a Table\n// aligns padded columns, an Input prints `⟨value⟩`. What a terminal can't do\n// it doesn't fake — layout weights, colors, and drag are simply absent.\n// Unmapped names fall back to their children (fallback), so any app's tree\n// still renders its content.\n// ═══════════════════════════════════════════════════════════\n\n// ── containers: the terminal's only axis is vertical, so Box and Stack\n// stack; Row and Grid join inline while their children are single lines.\nexport const Box: TtyComponent = ({ children }) => stack(children);\nexport const Stack: TtyComponent = ({ children }) => stack(children);\nexport const Row: TtyComponent = ({ children }) => inline(children);\nexport const Grid: TtyComponent = ({ children }) => inline(children);\n\nexport const Text: TtyComponent = ({ props, children }) => {\n const block = inline(children, ' ');\n return bool(props, 'upper') ? { lines: block.lines.map((line) => line.toUpperCase()) } : block;\n};\n\n// A button is its label in parens — the renderer's `[n]` marker makes it\n// actionable; this just makes it legible.\nexport const Button: TtyComponent = ({ props, children }) => {\n const label = inlineText(children);\n const icon = str(props, 'icon');\n const text = label !== '' ? label : icon !== undefined ? icon : '';\n return { lines: [`(${text})`] };\n};\n\nexport const Input: TtyComponent = ({ props }) => {\n const raw = props['value'];\n const value = typeof raw === 'string' || typeof raw === 'number' ? String(raw) : '';\n const shown = str(props, 'type') === 'password' ? '•'.repeat(value.length) : value;\n const placeholder = str(props, 'placeholder') ?? '';\n return { lines: [`⟨${shown !== '' ? shown : placeholder}⟩`] };\n};\n\nexport const Textarea: TtyComponent = ({ props }) => {\n const raw = props['value'];\n const value = typeof raw === 'string' || typeof raw === 'number' ? String(raw) : '';\n if (value === '') return { lines: [`⟨${str(props, 'placeholder') ?? ''}⟩`] };\n return { lines: value.split('\\n').map((line) => `⟨ ${line}`) };\n};\n\nexport const Checkbox: TtyComponent = ({ props }) => ({\n lines: [bool(props, 'value') || bool(props, 'checked') ? '☑' : '☐'],\n});\n\nexport const Badge: TtyComponent = ({ children }) => {\n const text = inlineText(children);\n return { lines: text === '' ? [] : [`‹${text}›`] };\n};\n\n// ── the data-driven table: padded columns, a `[n]` marker per row when\n// `rowRef` is set (the marker column keeps the grid aligned).\n\n// Dotted-path field access, same as the DOM kit. Exported for the ink kit,\n// which shares the table's data contract but renders focusable rows.\nexport const at = (row: unknown, key: string): unknown => {\n let cursor: unknown = row;\n for (const segment of key.split('.')) {\n if (cursor === null || typeof cursor !== 'object') return undefined;\n cursor = Reflect.get(cursor, segment);\n }\n return cursor;\n};\nexport const cellText = (value: unknown): string => (value === null || value === undefined ? '' : String(value));\n\ntype Column = { label?: unknown; cell?: { key?: unknown } };\n\nexport const columnsOf = (props: Record<string, unknown>): Column[] => {\n const value = props['columns'];\n if (!Array.isArray(value)) return [];\n const out: Column[] = [];\n for (const item of value) if (item !== null && typeof item === 'object') out.push(item);\n return out;\n};\nexport const cellKey = (column: Column): string => (typeof column.cell?.key === 'string' ? column.cell.key : '');\n\nconst CELL_CAP = 28;\n\nexport const Table: TtyComponent = ({ props, register }) => {\n const columns = columnsOf(props);\n const rows = Array.isArray(props['rows']) ? props['rows'] : [];\n const rowKey = str(props, 'rowKey') ?? 'id';\n const clickKey = str(props, 'clickKey') ?? rowKey;\n const rowRef = str(props, 'rowRef');\n\n if (rows.length === 0) return { lines: [str(props, 'empty') ?? 'Nothing here.'] };\n\n const header = columns.map((column) => (typeof column.label === 'string' ? column.label : ''));\n const body = rows.map((row) => columns.map((column) => truncate(cellText(at(row, cellKey(column))), CELL_CAP)));\n const widths = header.map((label, i) => Math.max(truncate(label, CELL_CAP).length, ...body.map((cells) => cells[i]?.length ?? 0)));\n\n // Register every row first so the marker column width is known before any\n // line is laid out — markers pad to the widest ('[9] ' vs '[12] ').\n const markers = rowRef === undefined\n ? rows.map(() => '')\n : rows.map((row, i) => `[${register({ kind: 'row', ref: rowRef, label: body[i]?.[0] ?? rowRef, value: at(row, clickKey) })}] `);\n const markerWidth = Math.max(0, ...markers.map((marker) => marker.length));\n\n const layout = (marker: string, cells: string[]): string =>\n (marker.padStart(markerWidth) + cells.map((cell, i) => pad(cell, widths[i] ?? 0)).join(' ')).trimEnd();\n\n return {\n lines: [\n layout(''.padStart(markerWidth), header.map((label, i) => pad(label, widths[i] ?? 0))),\n layout(''.padStart(markerWidth), widths.map((width) => '─'.repeat(width))),\n ...body.map((cells, i) => layout(markers[i] ?? '', cells)),\n ],\n };\n};\n\n// Panel — a framed block with an optional title rule; `backRef`/`closeRef`\n// register as `←`/`✕` interactives in the header, same prop-ref convention\n// as Table's rowRef.\nexport const Panel: TtyComponent = ({ props, children, register }) => {\n const title = str(props, 'title');\n const lines: string[] = [];\n if (title !== undefined) {\n const parts: string[] = [];\n const backRef = str(props, 'backRef');\n if (backRef !== undefined) parts.push(`[${register({ kind: 'click', ref: backRef, label: '← back' })}] ←`);\n parts.push(title);\n const closeRef = str(props, 'closeRef');\n if (closeRef !== undefined) parts.push(`[${register({ kind: 'click', ref: closeRef, label: '✕ close' })}] ✕`);\n const head = `┌─ ${parts.join(' ')} `;\n lines.push(head + '─'.repeat(Math.max(0, 48 - head.length)));\n }\n lines.push(...indent(stack(children), title === undefined ? '' : '│ ').lines);\n return { lines };\n};\n\n// JsonTree — the value printed as an indented tree, depth- and width-capped\n// so a devtools state dump stays readable instead of scrolling forever.\nconst DEPTH_CAP = 4;\nconst ENTRY_CAP = 20;\n\nconst jsonLines = (value: unknown, key: string | undefined, depth: number): string[] => {\n const pfx = ' '.repeat(depth);\n if (value !== null && typeof value === 'object') {\n const entries = Array.isArray(value) ? value.map((item, i): [string, unknown] => [String(i), item] ) : Object.entries(value);\n const shape = Array.isArray(value) ? `[${entries.length}]` : `{${entries.length}}`;\n // container summary is `key {N}` — colon is for leaves, same as the DOM kit\n const summary = key === undefined ? shape : `${key} ${shape}`;\n if (depth >= DEPTH_CAP) return [`${pfx}${summary} …`];\n const shown = entries.slice(0, ENTRY_CAP);\n return [\n `${pfx}${summary}`,\n ...shown.flatMap(([childKey, childValue]) => jsonLines(childValue, childKey, depth + 1)),\n ...(entries.length > ENTRY_CAP ? [`${' '.repeat(depth + 1)}… +${entries.length - ENTRY_CAP} more`] : []),\n ];\n }\n return [`${pfx}${key === undefined ? '' : `${key}: `}${JSON.stringify(value)}`];\n};\n\nexport const JsonTree: TtyComponent = ({ props }) => ({ lines: jsonLines(props['value'], str(props, 'label'), 0) });\n\n// The per-instance boundary marker a flattened shell tree carries — the TTY\n// target has no wrapper concept, so it passes the content straight through.\nexport const ActionSlot: TtyComponent = ({ children }) => stack(children);\n\n// Unmapped primitives (an app's own NavItem, KanbanBoard, …) render their\n// children — content shows, and a `ref` still gets its marker from the\n// renderer. When a prop-driven component carries NO children, surface its\n// primary text prop (label / title) plus a `count` — a legible degrade, not\n// a full port; what the terminal can't do, it doesn't fake.\nexport const fallback: TtyComponent = ({ props, children }) => {\n const block = stack(children);\n if (block.lines.length > 0) return block;\n const label = str(props, 'label') ?? str(props, 'title');\n if (label === undefined) return { lines: [] };\n const count = props['count'];\n const suffix = typeof count === 'number' || (typeof count === 'string' && count !== '') ? ` (${String(count)})` : '';\n return { lines: [`${label}${suffix}`] };\n};\n\nexport type { TtyBlock };\n","import { createComponentRegistry } from '@layout/registry';\nimport type { ComponentRegistry } from '@layout/types';\nimport type { TtyComponent } from '../index';\nimport { ActionSlot, Badge, Box, Row, Stack, Grid, Text, Button, Input, Checkbox, Textarea, Table, Panel, JsonTree } from './components';\n\n// ═══════════════════════════════════════════════════════════\n// The default registry — the same domain-blind vocabulary as the DOM kit\n// (plus Badge, which the devtools dock leans on), registered for the line\n// terminal. An app's own component names fall back to their children (see\n// the renderer's `fallback`).\n// ═══════════════════════════════════════════════════════════\n\nexport const defaultRegistry = (): ComponentRegistry<TtyComponent> => {\n const registry = createComponentRegistry<TtyComponent>();\n registry.registerAll({\n Box,\n Row,\n Stack,\n Grid,\n Text,\n Button,\n Input,\n Select: Input,\n Textarea,\n Checkbox,\n Switch: Checkbox,\n Table,\n Badge,\n // introspection primitives (used by nova/devtools; useful anywhere)\n Panel,\n JsonTree,\n // the per-instance boundary from a flattened shell tree — pass-through\n ActionSlot,\n });\n return registry;\n};\n"]}
|