@optiaxiom/proteus 0.3.0 → 1.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/dist/esm/_virtual/_openai-shim-script.js +3 -2
- package/dist/esm/assets/src/proteus-chart/{ProteusChart.css.ts.vanilla-DNE5j3uT.css → ProteusChart.css.ts.vanilla-yGx8JdKz.css} +2 -2
- package/dist/esm/assets/src/proteus-chart/{ProteusChartTooltipContent.css.ts.vanilla-DM8u1icS.css → ProteusChartTooltipContent.css.ts.vanilla-HapBe2oo.css} +2 -2
- package/dist/esm/assets/src/proteus-document/{ProteusDocumentShell.css.ts.vanilla-DjZJuQ2A.css → ProteusDocumentShell.css.ts.vanilla-BPytQ9pT.css} +2 -2
- package/dist/esm/assets/src/proteus-image-carousel/{ProteusImageCarousel.css.ts.vanilla-CIwMJ4Cg.css → ProteusImageCarousel.css.ts.vanilla-DnlXoyv1.css} +2 -2
- package/dist/esm/assets/src/proteus-question/{ProteusQuestion.css.ts.vanilla-DiCe_bxf.css → ProteusQuestion.css.ts.vanilla-CpDgoW0l.css} +2 -2
- package/dist/esm/hooks/useEffectEvent.js +11 -10
- package/dist/esm/hooks/useObserveValue.js +24 -30
- package/dist/esm/icons/IconAngleLeft.js +13 -19
- package/dist/esm/icons/IconAngleRight.js +13 -19
- package/dist/esm/icons/IconX.js +10 -18
- package/dist/esm/icons/withIcon.js +17 -28
- package/dist/esm/index.js +22 -17
- package/dist/esm/proteus-action/ProteusAction.js +44 -39
- package/dist/esm/proteus-bridge/ProteusBridge.js +71 -85
- package/dist/esm/proteus-card-link/ProteusCardLink.js +24 -37
- package/dist/esm/proteus-chart/ProteusChart-css.js +14 -5
- package/dist/esm/proteus-chart/ProteusChart.js +86 -84
- package/dist/esm/proteus-chart/ProteusChartContext.js +3 -3
- package/dist/esm/proteus-chart/ProteusChartTooltipContent-css.js +23 -6
- package/dist/esm/proteus-chart/ProteusChartTooltipContent.js +52 -66
- package/dist/esm/proteus-data-table/ProteusDataTable.js +28 -29
- package/dist/esm/proteus-date-input/ProteusDateInput.js +23 -0
- package/dist/esm/proteus-document/ProteusDocumentContext.js +4 -3
- package/dist/esm/proteus-document/ProteusDocumentPathContext.js +6 -5
- package/dist/esm/proteus-document/ProteusDocumentRenderer.js +25 -33
- package/dist/esm/proteus-document/ProteusDocumentShell-css.js +32 -6
- package/dist/esm/proteus-document/ProteusDocumentShell.js +226 -219
- package/dist/esm/proteus-document/getProteusValue.js +28 -42
- package/dist/esm/proteus-document/resolveProteusProp.js +31 -49
- package/dist/esm/proteus-document/resolveProteusValue.js +73 -136
- package/dist/esm/proteus-document/schemas.js +42 -45
- package/dist/esm/proteus-document/useResolveProteusValues.js +10 -16
- package/dist/esm/proteus-element/ProteusElement.js +114 -180
- package/dist/esm/proteus-federated/ProteusFederated.js +51 -52
- package/dist/esm/proteus-file-icon/ProteusFileIcon.js +29 -38
- package/dist/esm/proteus-file-upload/ProteusFileUpload.js +107 -133
- package/dist/esm/proteus-image/ProteusImage.js +99 -106
- package/dist/esm/proteus-image/downloadFile.js +3 -2
- package/dist/esm/proteus-image-carousel/ProteusImageCarousel-css.js +49 -11
- package/dist/esm/proteus-image-carousel/ProteusImageCarousel.js +151 -163
- package/dist/esm/proteus-input/ProteusInput.js +19 -27
- package/dist/esm/proteus-length/ProteusLength.js +10 -0
- package/dist/esm/proteus-map/ProteusMap.js +18 -31
- package/dist/esm/proteus-map-index/ProteusMapIndex.js +11 -0
- package/dist/esm/proteus-pill-menu/ProteusPillMenu.js +65 -0
- package/dist/esm/proteus-pill-menu/useInputValueChangeInteraction.js +36 -0
- package/dist/esm/proteus-question/ProteusQuestion-css.js +40 -8
- package/dist/esm/proteus-question/ProteusQuestion.js +324 -400
- package/dist/esm/proteus-select/ProteusSelect.js +25 -40
- package/dist/esm/proteus-show/ProteusShow.js +10 -18
- package/dist/esm/proteus-switch/ProteusSwitch.js +33 -36
- package/dist/esm/proteus-textarea/ProteusTextarea.js +18 -27
- package/dist/esm/proteus-value/ProteusValue.js +4 -4
- package/dist/esm/schema/public-schema.js +4537 -0
- package/dist/esm/schema/runtime-schema.js +4460 -0
- package/dist/esm/spec.js +5 -1
- package/dist/esm/use-proteus-value/useProteusValue.js +8 -12
- package/dist/index.d.ts +516 -347
- package/dist/spec.d.ts +5 -9952
- package/package.json +5 -5
- package/dist/esm/icons/IconCalendar.js +0 -20
- package/dist/esm/schema/public-schema.json.js +0 -9041
- package/dist/esm/schema/runtime-schema.json.js +0 -8974
package/dist/index.d.ts
CHANGED
|
@@ -1,448 +1,617 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { ReactNode, ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import { BoxProps, ButtonProps, DateInputProps, Disclosure, InputProps, SelectProps, TextareaProps } from "@optiaxiom/react";
|
|
2
|
+
import { ComponentPropsWithoutRef, ComponentType, ReactNode } from "react";
|
|
4
3
|
|
|
4
|
+
//#region src/proteus-bridge/ProteusBridge.d.ts
|
|
5
5
|
type ProteusBridgeProps = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Content rendered on platforms without iframe support
|
|
8
|
+
*/
|
|
9
|
+
fallback?: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Height of the iframe in pixels
|
|
12
|
+
*/
|
|
13
|
+
height?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Resource URI identifying the MCP app to render
|
|
16
|
+
*/
|
|
17
|
+
resource: string;
|
|
18
18
|
};
|
|
19
|
-
declare function ProteusBridge({
|
|
19
|
+
declare function ProteusBridge({
|
|
20
|
+
height,
|
|
21
|
+
resource
|
|
22
|
+
}: ProteusBridgeProps): import("react/jsx-runtime").JSX.Element | null;
|
|
20
23
|
declare namespace ProteusBridge {
|
|
21
|
-
|
|
24
|
+
var displayName: string;
|
|
22
25
|
}
|
|
23
|
-
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/proteus-chart/ProteusChart.d.ts
|
|
24
28
|
type Series = {
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
dataKey: string;
|
|
30
|
+
name?: string;
|
|
27
31
|
};
|
|
28
32
|
type ProteusChartProps = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Chart data records, either inline, a ProteusValue reference, or a
|
|
35
|
+
* ProteusZip transformation
|
|
36
|
+
*/
|
|
37
|
+
data: Record<string, unknown>[];
|
|
38
|
+
/**
|
|
39
|
+
* Chart layout direction
|
|
40
|
+
*/
|
|
41
|
+
layout?: "horizontal" | "vertical";
|
|
42
|
+
/**
|
|
43
|
+
* Data series configuration
|
|
44
|
+
*/
|
|
45
|
+
series?: Series[];
|
|
46
|
+
/**
|
|
47
|
+
* Chart type
|
|
48
|
+
*/
|
|
49
|
+
type: "bar" | "line";
|
|
50
|
+
/**
|
|
51
|
+
* Key in data records for x-axis labels
|
|
52
|
+
*/
|
|
53
|
+
xAxisKey?: string;
|
|
50
54
|
};
|
|
51
|
-
declare
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
declare function ProteusChart({
|
|
56
|
+
data,
|
|
57
|
+
layout,
|
|
58
|
+
series,
|
|
59
|
+
type,
|
|
60
|
+
xAxisKey
|
|
61
|
+
}: ProteusChartProps): import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
declare namespace ProteusChart {
|
|
63
|
+
var displayName: string;
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/proteus-data-table/ProteusDataTable.d.ts
|
|
56
67
|
type ProteusDataTableProps = {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Column definitions
|
|
70
|
+
*/
|
|
71
|
+
columns?: ColumnDef[];
|
|
72
|
+
/**
|
|
73
|
+
* Column data
|
|
74
|
+
*/
|
|
75
|
+
data?: Record<string, unknown>[];
|
|
65
76
|
};
|
|
66
77
|
type ColumnDef = {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
};
|
|
75
|
-
declare const ProteusDataTable: {
|
|
76
|
-
({ columns, data }: ProteusDataTableProps): react_jsx_runtime.JSX.Element;
|
|
77
|
-
displayName: string;
|
|
78
|
+
accessorKey: string;
|
|
79
|
+
format?: string | {
|
|
80
|
+
options?: Record<string, unknown>;
|
|
81
|
+
type: string;
|
|
82
|
+
};
|
|
83
|
+
header: string;
|
|
84
|
+
size?: number;
|
|
78
85
|
};
|
|
79
|
-
|
|
86
|
+
declare function ProteusDataTable({
|
|
87
|
+
columns,
|
|
88
|
+
data
|
|
89
|
+
}: ProteusDataTableProps): import("react/jsx-runtime").JSX.Element;
|
|
90
|
+
declare namespace ProteusDataTable {
|
|
91
|
+
var displayName: string;
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/proteus-federated/ProteusFederated.d.ts
|
|
80
95
|
type ProteusFederatedProps = {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
96
|
+
/**
|
|
97
|
+
* URL to the remote's remoteEntry.js or mf-manifest.json
|
|
98
|
+
*/
|
|
99
|
+
entry: string;
|
|
100
|
+
/**
|
|
101
|
+
* The key from the remote's ModuleFederationPlugin exposes config (e.g. './App'). Defaults to '.' (root export)
|
|
102
|
+
*/
|
|
103
|
+
exposeKey?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Content rendered when the federated component fails to load
|
|
106
|
+
*/
|
|
107
|
+
fallback?: ReactNode;
|
|
93
108
|
};
|
|
94
|
-
declare function ProteusFederated({
|
|
109
|
+
declare function ProteusFederated({
|
|
110
|
+
entry,
|
|
111
|
+
exposeKey,
|
|
112
|
+
fallback
|
|
113
|
+
}: ProteusFederatedProps): import("react/jsx-runtime").JSX.Element | null;
|
|
95
114
|
declare namespace ProteusFederated {
|
|
96
|
-
|
|
115
|
+
var displayName: string;
|
|
97
116
|
}
|
|
98
|
-
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/proteus-file-upload/ProteusFileUpload.d.ts
|
|
99
119
|
type ProteusFileUploadProps = {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
/**
|
|
121
|
+
* File types to accept; array of MIME types or extensions.
|
|
122
|
+
*
|
|
123
|
+
* @example ["image/*", ".pdf"]
|
|
124
|
+
*/
|
|
125
|
+
accept?: string[];
|
|
126
|
+
/**
|
|
127
|
+
* Maximum number of files allowed. When set to `1` the field is in
|
|
128
|
+
* single-file mode; any other value (or omitted) allows multiple uploads.
|
|
129
|
+
*/
|
|
130
|
+
maxFiles?: number;
|
|
131
|
+
/**
|
|
132
|
+
* Minimum number of files required.
|
|
133
|
+
*/
|
|
134
|
+
minFiles?: number;
|
|
135
|
+
/**
|
|
136
|
+
* The name of the form control element. The resolved metadata array is
|
|
137
|
+
* written at `parentPath/name` in form data once the host's `onUpload`
|
|
138
|
+
* resolves.
|
|
139
|
+
*/
|
|
140
|
+
name?: string;
|
|
121
141
|
};
|
|
122
|
-
declare function ProteusFileUpload({
|
|
142
|
+
declare function ProteusFileUpload({
|
|
143
|
+
accept,
|
|
144
|
+
maxFiles,
|
|
145
|
+
minFiles,
|
|
146
|
+
name
|
|
147
|
+
}: ProteusFileUploadProps): import("react/jsx-runtime").JSX.Element;
|
|
123
148
|
declare namespace ProteusFileUpload {
|
|
124
|
-
|
|
149
|
+
var displayName: string;
|
|
125
150
|
}
|
|
126
|
-
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region src/proteus-image-carousel/ProteusImageCarousel.d.ts
|
|
127
153
|
type ProteusImageCarouselProps = {
|
|
154
|
+
/**
|
|
155
|
+
* Array of image data to display in the carousel.
|
|
156
|
+
*/
|
|
157
|
+
images: Array<{
|
|
158
|
+
/**
|
|
159
|
+
* Alternative text for the image.
|
|
160
|
+
*/
|
|
161
|
+
alt?: string;
|
|
128
162
|
/**
|
|
129
|
-
*
|
|
163
|
+
* The URL to the full image.
|
|
130
164
|
*/
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Alternative text for the image.
|
|
134
|
-
*/
|
|
135
|
-
alt?: string;
|
|
136
|
-
/**
|
|
137
|
-
* The URL to the full image.
|
|
138
|
-
*/
|
|
139
|
-
src: string;
|
|
140
|
-
/**
|
|
141
|
-
* The URL to the image thumbnail.
|
|
142
|
-
*/
|
|
143
|
-
thumb?: string;
|
|
144
|
-
}>;
|
|
165
|
+
src: string;
|
|
145
166
|
/**
|
|
146
|
-
*
|
|
167
|
+
* The URL to the image thumbnail.
|
|
147
168
|
*/
|
|
148
|
-
|
|
169
|
+
thumb?: string;
|
|
170
|
+
}>;
|
|
171
|
+
/**
|
|
172
|
+
* Accessible label for the carousel region.
|
|
173
|
+
*/
|
|
174
|
+
title?: string;
|
|
149
175
|
};
|
|
150
|
-
declare function ProteusImageCarousel({
|
|
176
|
+
declare function ProteusImageCarousel({
|
|
177
|
+
images,
|
|
178
|
+
title
|
|
179
|
+
}: ProteusImageCarouselProps): import("react/jsx-runtime").JSX.Element | null;
|
|
151
180
|
declare namespace ProteusImageCarousel {
|
|
152
|
-
|
|
181
|
+
var displayName: string;
|
|
153
182
|
}
|
|
154
|
-
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region src/proteus-image/ProteusImage.d.ts
|
|
155
185
|
type ProteusImageProps = BoxProps<"img">;
|
|
156
|
-
declare function ProteusImage(props: ProteusImageProps):
|
|
186
|
+
declare function ProteusImage(props: ProteusImageProps): import("react/jsx-runtime").JSX.Element;
|
|
157
187
|
declare namespace ProteusImage {
|
|
158
|
-
|
|
188
|
+
var displayName: string;
|
|
159
189
|
}
|
|
160
|
-
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region src/proteus-length/ProteusLength.d.ts
|
|
192
|
+
type ProteusLengthProps = {
|
|
193
|
+
/**
|
|
194
|
+
* JSON pointer path to the array whose length should be returned (e.g.
|
|
195
|
+
* '/urls'). Resolves to 0 when the value is missing or not an array.
|
|
196
|
+
*/
|
|
197
|
+
path: string;
|
|
198
|
+
};
|
|
199
|
+
declare function ProteusLength({
|
|
200
|
+
path
|
|
201
|
+
}: ProteusLengthProps): number;
|
|
202
|
+
declare namespace ProteusLength {
|
|
203
|
+
var displayName: string;
|
|
204
|
+
}
|
|
205
|
+
//#endregion
|
|
206
|
+
//#region src/proteus-map-index/ProteusMapIndex.d.ts
|
|
207
|
+
declare function ProteusMapIndex(): number | null;
|
|
208
|
+
declare namespace ProteusMapIndex {
|
|
209
|
+
var displayName: string;
|
|
210
|
+
}
|
|
211
|
+
//#endregion
|
|
212
|
+
//#region src/proteus-map/ProteusMap.d.ts
|
|
161
213
|
type ProteusMapProps = {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
214
|
+
children?: ReactNode;
|
|
215
|
+
/**
|
|
216
|
+
* When true, flattens the result array by one level. Only used during
|
|
217
|
+
* value resolution (e.g., onClick message); ignored during rendering.
|
|
218
|
+
*/
|
|
219
|
+
flat?: boolean;
|
|
220
|
+
/**
|
|
221
|
+
* JSON pointer path to the source array in the data (e.g., '/results')
|
|
222
|
+
*/
|
|
223
|
+
path: string;
|
|
224
|
+
/**
|
|
225
|
+
* Optional separator to render between items. Can be a string or a
|
|
226
|
+
* ReactNode for more complex separators.
|
|
227
|
+
*/
|
|
228
|
+
separator?: ReactNode;
|
|
177
229
|
};
|
|
178
|
-
declare function ProteusMap({
|
|
230
|
+
declare function ProteusMap({
|
|
231
|
+
children,
|
|
232
|
+
path,
|
|
233
|
+
separator
|
|
234
|
+
}: ProteusMapProps): import("react/jsx-runtime").JSX.Element | null;
|
|
179
235
|
declare namespace ProteusMap {
|
|
180
|
-
|
|
236
|
+
var displayName: string;
|
|
181
237
|
}
|
|
182
|
-
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/proteus-pill-menu/ProteusPillMenu.d.ts
|
|
240
|
+
type ProteusPillMenuProps = {
|
|
241
|
+
/**
|
|
242
|
+
* The data binding name for the search input value.
|
|
243
|
+
*/
|
|
244
|
+
inputName?: string;
|
|
245
|
+
/**
|
|
246
|
+
* The data binding name for this pill menu's selected values.
|
|
247
|
+
*/
|
|
248
|
+
name?: string;
|
|
249
|
+
/**
|
|
250
|
+
* Event handler triggered when the search input value changes.
|
|
251
|
+
*/
|
|
252
|
+
onInputValueChange?: ProteusEventHandler;
|
|
253
|
+
/**
|
|
254
|
+
* The available options to select from.
|
|
255
|
+
*/
|
|
256
|
+
options?: Array<{
|
|
257
|
+
/**
|
|
258
|
+
* Display label for the option
|
|
259
|
+
*/
|
|
260
|
+
label: string;
|
|
261
|
+
/**
|
|
262
|
+
* Unique value for the option
|
|
263
|
+
*/
|
|
264
|
+
value: string;
|
|
265
|
+
}>;
|
|
266
|
+
};
|
|
267
|
+
declare function ProteusPillMenu({
|
|
268
|
+
inputName,
|
|
269
|
+
name,
|
|
270
|
+
onInputValueChange,
|
|
271
|
+
options
|
|
272
|
+
}: ProteusPillMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
273
|
+
declare namespace ProteusPillMenu {
|
|
274
|
+
var displayName: string;
|
|
275
|
+
}
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region src/proteus-select/ProteusSelect.d.ts
|
|
183
278
|
type ProteusSelectProps = Omit<SelectProps, "options"> & {
|
|
279
|
+
/**
|
|
280
|
+
* The select items/options we want to render.
|
|
281
|
+
*/
|
|
282
|
+
options?: Array<{
|
|
184
283
|
/**
|
|
185
|
-
*
|
|
284
|
+
* String representation of items
|
|
186
285
|
*/
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
* Return a unique key for each item
|
|
194
|
-
*/
|
|
195
|
-
value: string;
|
|
196
|
-
}>;
|
|
286
|
+
label: string;
|
|
287
|
+
/**
|
|
288
|
+
* Return a unique key for each item
|
|
289
|
+
*/
|
|
290
|
+
value: string;
|
|
291
|
+
}>;
|
|
197
292
|
};
|
|
198
|
-
declare function ProteusSelect({
|
|
293
|
+
declare function ProteusSelect({
|
|
294
|
+
children,
|
|
295
|
+
options,
|
|
296
|
+
...props
|
|
297
|
+
}: ProteusSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
199
298
|
declare namespace ProteusSelect {
|
|
200
|
-
|
|
299
|
+
var displayName: string;
|
|
201
300
|
}
|
|
202
|
-
|
|
301
|
+
//#endregion
|
|
302
|
+
//#region src/proteus-document/resolveProteusValue.d.ts
|
|
203
303
|
type ProteusCondition = {
|
|
204
|
-
|
|
304
|
+
"!!": ComparisonValue;
|
|
205
305
|
} | {
|
|
206
|
-
|
|
306
|
+
"!": ComparisonValue;
|
|
207
307
|
} | {
|
|
208
|
-
|
|
308
|
+
"!=": ComparisonValue[];
|
|
209
309
|
} | {
|
|
210
|
-
|
|
310
|
+
"<": ComparisonValue[];
|
|
211
311
|
} | {
|
|
212
|
-
|
|
312
|
+
"<=": ComparisonValue[];
|
|
213
313
|
} | {
|
|
214
|
-
|
|
314
|
+
"==": ComparisonValue[];
|
|
215
315
|
} | {
|
|
216
|
-
|
|
316
|
+
">": ComparisonValue[];
|
|
217
317
|
} | {
|
|
218
|
-
|
|
318
|
+
">=": ComparisonValue[];
|
|
219
319
|
} | {
|
|
220
|
-
|
|
320
|
+
and: ProteusCondition[];
|
|
221
321
|
} | {
|
|
222
|
-
|
|
322
|
+
or: ProteusCondition[];
|
|
223
323
|
};
|
|
224
324
|
type ComparisonValue = boolean | null | number | string | {
|
|
225
|
-
|
|
325
|
+
$type: "Length";
|
|
326
|
+
path: string;
|
|
226
327
|
} | {
|
|
227
|
-
|
|
228
|
-
|
|
328
|
+
$type: "MapIndex";
|
|
329
|
+
} | {
|
|
330
|
+
$type: "Value";
|
|
331
|
+
path: string;
|
|
229
332
|
};
|
|
230
|
-
|
|
333
|
+
//#endregion
|
|
334
|
+
//#region src/proteus-show/ProteusShow.d.ts
|
|
231
335
|
type ProteusShowProps = {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
336
|
+
children?: ReactNode;
|
|
337
|
+
/**
|
|
338
|
+
* Single condition or array of conditions (AND logic). Each condition is an
|
|
339
|
+
* object with one operator key.
|
|
340
|
+
*/
|
|
341
|
+
when: ProteusCondition;
|
|
238
342
|
};
|
|
239
|
-
declare function ProteusShow({
|
|
343
|
+
declare function ProteusShow({
|
|
344
|
+
children,
|
|
345
|
+
when
|
|
346
|
+
}: ProteusShowProps): import("react/jsx-runtime").JSX.Element | null;
|
|
240
347
|
declare namespace ProteusShow {
|
|
241
|
-
|
|
348
|
+
var displayName: string;
|
|
242
349
|
}
|
|
243
|
-
|
|
350
|
+
//#endregion
|
|
351
|
+
//#region src/proteus-value/ProteusValue.d.ts
|
|
244
352
|
type ProteusValueProps = {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
353
|
+
/**
|
|
354
|
+
* Format to apply to cell values (e.g. 'Number', 'DateTime')
|
|
355
|
+
*/
|
|
356
|
+
formatter?: "DateTime" | "Number" | {
|
|
357
|
+
/**
|
|
358
|
+
* Options passed to the Intl formatter constructor (e.g.,
|
|
359
|
+
* Intl.DateTimeFormatOptions or Intl.NumberFormatOptions)
|
|
360
|
+
*/
|
|
361
|
+
options?: Record<string, unknown>;
|
|
362
|
+
/**
|
|
363
|
+
* Formatter type
|
|
364
|
+
*/
|
|
365
|
+
type: "DateTime" | "Number";
|
|
366
|
+
};
|
|
367
|
+
/**
|
|
368
|
+
* Path to a value in the data. Absolute paths start with '/' and resolve from
|
|
369
|
+
* the root (e.g., '/title', '/options/0/label'). Inside a Map template, paths
|
|
370
|
+
* without a leading '/' are relative to the current item (e.g., 'title'
|
|
371
|
+
* resolves to each item's 'title' field).
|
|
372
|
+
*/
|
|
373
|
+
path: string;
|
|
266
374
|
};
|
|
267
|
-
|
|
375
|
+
//#endregion
|
|
376
|
+
//#region src/proteus-document/ProteusDocumentContext.d.ts
|
|
268
377
|
type FileUploadMetadata = {
|
|
269
|
-
|
|
270
|
-
|
|
378
|
+
link: string;
|
|
379
|
+
name: string;
|
|
271
380
|
};
|
|
381
|
+
type ProteusIconMap = Record<string, ComponentType<{
|
|
382
|
+
filled?: boolean;
|
|
383
|
+
}>>;
|
|
272
384
|
type UploadFile<F extends FileUploadMetadata = FileUploadMetadata> = (file: File) => Promise<F>;
|
|
273
385
|
type UseResource = (resource: string) => {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
386
|
+
data: undefined | {
|
|
387
|
+
mimeType: string;
|
|
388
|
+
text: string;
|
|
389
|
+
};
|
|
390
|
+
isError: boolean;
|
|
279
391
|
};
|
|
280
|
-
|
|
392
|
+
//#endregion
|
|
393
|
+
//#region src/proteus-document/ProteusDocumentShell.d.ts
|
|
281
394
|
type ProteusDocumentShellProps = Pick<ComponentPropsWithoutRef<typeof Disclosure>, "defaultOpen" | "onOpenChange" | "open"> & {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
395
|
+
/**
|
|
396
|
+
* Whether block is collapsible
|
|
397
|
+
*/
|
|
398
|
+
collapsible?: boolean;
|
|
399
|
+
/**
|
|
400
|
+
* Current form data
|
|
401
|
+
*/
|
|
402
|
+
data?: Record<string, unknown>;
|
|
403
|
+
/**
|
|
404
|
+
* The Proteus document to render
|
|
405
|
+
*/
|
|
406
|
+
element: ProteusDocument$2;
|
|
407
|
+
/**
|
|
408
|
+
* Map of icon name to React component. Referenced by `{ $type: "Icon", name }` elements.
|
|
409
|
+
*/
|
|
410
|
+
icons?: ProteusIconMap;
|
|
411
|
+
/**
|
|
412
|
+
* Callback when form fields change. Receives a functional updater
|
|
413
|
+
* `(prev) => next` (the same shape React's `setState` accepts) so that
|
|
414
|
+
* rapid successive mutations compose without losing writes. Pass a
|
|
415
|
+
* `useState` setter directly, e.g. `onDataChange={setData}`.
|
|
416
|
+
*/
|
|
417
|
+
onDataChange?: (updater: (prev: Record<string, unknown>) => Record<string, unknown>) => void;
|
|
418
|
+
/**
|
|
419
|
+
* Callback when user triggers a download action; receives the resolved URL(s).
|
|
420
|
+
* When provided, the host is responsible for the actual download/zip.
|
|
421
|
+
* Falls back to built-in window.open behaviour when absent.
|
|
422
|
+
*/
|
|
423
|
+
onDownload?: (urls: string[]) => Promise<void> | void;
|
|
424
|
+
/**
|
|
425
|
+
* Callback when user clicks a Action button with interaction handler
|
|
426
|
+
*/
|
|
427
|
+
onInteraction?: (name: string, params?: Record<string, unknown>) => Promise<unknown> | unknown;
|
|
428
|
+
/**
|
|
429
|
+
* Callback when user sends a message action. The payload may be a plain
|
|
430
|
+
* string or a structured object (parts + optional files), depending on
|
|
431
|
+
* what the document declares for `Action.onClick.message`.
|
|
432
|
+
*/
|
|
433
|
+
onMessage?: (message: string | StructuredMessage) => Promise<void> | void;
|
|
434
|
+
/**
|
|
435
|
+
* Callback when user triggers a preview action.
|
|
436
|
+
* Receives the file object to preview.
|
|
437
|
+
*/
|
|
438
|
+
onPreview?: (file: unknown) => Promise<void> | void;
|
|
439
|
+
/**
|
|
440
|
+
* Callback when an analytics event is fired
|
|
441
|
+
*/
|
|
442
|
+
onTrack?: (event: string, properties: Record<string, string>) => void;
|
|
443
|
+
/**
|
|
444
|
+
* Async upload callback used by FileUpload elements. Receives a File and
|
|
445
|
+
* resolves to a metadata object the document writes into form data.
|
|
446
|
+
*/
|
|
447
|
+
onUpload?: UploadFile;
|
|
448
|
+
/**
|
|
449
|
+
* Whether form is readonly
|
|
450
|
+
*/
|
|
451
|
+
readOnly?: boolean;
|
|
452
|
+
/**
|
|
453
|
+
* If true, the renderer will throw an error if the provided document is invalid. Otherwise, it will fail silently and render nothing.
|
|
454
|
+
*/
|
|
455
|
+
strict?: boolean;
|
|
456
|
+
/**
|
|
457
|
+
* Hook to resolve a resource URI to HTML content for Bridge elements
|
|
458
|
+
*/
|
|
459
|
+
useResource?: UseResource;
|
|
340
460
|
};
|
|
341
461
|
type ProteusDocument$2 = {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
462
|
+
actions?: ReactNode;
|
|
463
|
+
appearance?: "default" | "inline" | Record<string, unknown>;
|
|
464
|
+
appIcon?: string;
|
|
465
|
+
appName?: string;
|
|
466
|
+
blocking?: boolean;
|
|
467
|
+
body: ReactNode;
|
|
468
|
+
compact?: boolean;
|
|
469
|
+
subtitle?: ReactNode;
|
|
470
|
+
title?: ReactNode;
|
|
471
|
+
titleIcon?: string;
|
|
352
472
|
};
|
|
353
|
-
declare function ProteusDocumentShell({
|
|
473
|
+
declare function ProteusDocumentShell({
|
|
474
|
+
collapsible: collapsibleProp,
|
|
475
|
+
data,
|
|
476
|
+
defaultOpen,
|
|
477
|
+
element,
|
|
478
|
+
icons,
|
|
479
|
+
onDataChange,
|
|
480
|
+
onDownload,
|
|
481
|
+
onInteraction,
|
|
482
|
+
onMessage,
|
|
483
|
+
onOpenChange,
|
|
484
|
+
onPreview,
|
|
485
|
+
onTrack,
|
|
486
|
+
onUpload,
|
|
487
|
+
open: openProp,
|
|
488
|
+
readOnly,
|
|
489
|
+
strict,
|
|
490
|
+
useResource
|
|
491
|
+
}: ProteusDocumentShellProps): import("react/jsx-runtime").JSX.Element;
|
|
354
492
|
declare namespace ProteusDocumentShell {
|
|
355
|
-
|
|
493
|
+
var displayName: string;
|
|
356
494
|
}
|
|
357
|
-
|
|
495
|
+
//#endregion
|
|
496
|
+
//#region src/proteus-document/schemas.d.ts
|
|
358
497
|
type ProteusEventHandler = {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
498
|
+
action: "download";
|
|
499
|
+
url: (ProteusValueProps & {
|
|
500
|
+
$type: "Value";
|
|
501
|
+
}) | string | string[];
|
|
502
|
+
} | {
|
|
503
|
+
action: "openLink";
|
|
504
|
+
url: (ProteusValueProps & {
|
|
505
|
+
$type: "Value";
|
|
506
|
+
}) | string;
|
|
363
507
|
} | {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
$type: "Value";
|
|
367
|
-
}) | string;
|
|
508
|
+
action: "preview";
|
|
509
|
+
file: unknown;
|
|
368
510
|
} | {
|
|
369
|
-
|
|
370
|
-
|
|
511
|
+
action: "pushValue";
|
|
512
|
+
path: string;
|
|
513
|
+
value?: unknown;
|
|
371
514
|
} | {
|
|
372
|
-
|
|
373
|
-
|
|
515
|
+
action: "removeValue";
|
|
516
|
+
path: string;
|
|
374
517
|
} | {
|
|
375
|
-
|
|
518
|
+
interaction: string;
|
|
519
|
+
params?: Record<string, unknown>;
|
|
520
|
+
} | {
|
|
521
|
+
message: string | StructuredMessage;
|
|
376
522
|
};
|
|
377
523
|
type StructuredMessage<F extends FileUploadMetadata = FileUploadMetadata> = {
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
524
|
+
files?: F[];
|
|
525
|
+
parts: Array<{
|
|
526
|
+
content: string;
|
|
527
|
+
type: "text";
|
|
528
|
+
}>;
|
|
383
529
|
};
|
|
384
530
|
type ProteusDocument$1 = ProteusDocumentShellProps["element"] & {
|
|
385
|
-
|
|
531
|
+
$type: "Document";
|
|
386
532
|
};
|
|
387
533
|
type SafeParseResult<T> = {
|
|
388
|
-
|
|
389
|
-
|
|
534
|
+
data: T;
|
|
535
|
+
success: true;
|
|
390
536
|
} | {
|
|
391
|
-
|
|
392
|
-
|
|
537
|
+
error: string[];
|
|
538
|
+
success: false;
|
|
393
539
|
};
|
|
394
|
-
declare function safeParseDocument({
|
|
395
|
-
|
|
540
|
+
declare function safeParseDocument({
|
|
541
|
+
actions,
|
|
542
|
+
body,
|
|
543
|
+
...data
|
|
544
|
+
}: Record<string, unknown>): SafeParseResult<ProteusDocument$1>;
|
|
545
|
+
//#endregion
|
|
546
|
+
//#region src/proteus-action/ProteusAction.d.ts
|
|
396
547
|
type ProteusActionProps = Omit<ButtonProps, "onClick"> & {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
548
|
+
/**
|
|
549
|
+
* Action triggered when button is clicked
|
|
550
|
+
*/
|
|
551
|
+
onClick?: ProteusEventHandler;
|
|
401
552
|
};
|
|
402
|
-
declare function ProteusAction({
|
|
553
|
+
declare function ProteusAction({
|
|
554
|
+
children,
|
|
555
|
+
onClick,
|
|
556
|
+
type,
|
|
557
|
+
...props
|
|
558
|
+
}: ProteusActionProps): import("react/jsx-runtime").JSX.Element;
|
|
403
559
|
declare namespace ProteusAction {
|
|
404
|
-
|
|
560
|
+
var displayName: string;
|
|
405
561
|
}
|
|
406
|
-
|
|
562
|
+
//#endregion
|
|
563
|
+
//#region src/proteus-date-input/ProteusDateInput.d.ts
|
|
564
|
+
declare function ProteusDateInput(props: DateInputProps): import("react/jsx-runtime").JSX.Element;
|
|
565
|
+
declare namespace ProteusDateInput {
|
|
566
|
+
var displayName: string;
|
|
567
|
+
}
|
|
568
|
+
//#endregion
|
|
569
|
+
//#region src/proteus-document/ProteusDocumentRenderer.d.ts
|
|
407
570
|
type ProteusDocumentRendererProps = Omit<ComponentPropsWithoutRef<typeof ProteusDocumentShell>, "element"> & {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
571
|
+
/**
|
|
572
|
+
* The Proteus document to render
|
|
573
|
+
*/
|
|
574
|
+
element: ProteusDocument;
|
|
575
|
+
/**
|
|
576
|
+
* If true, the renderer will throw an error if the provided document is invalid. Otherwise, it will fail silently and render nothing.
|
|
577
|
+
*/
|
|
578
|
+
strict?: boolean;
|
|
416
579
|
};
|
|
417
580
|
type ProteusDocument = {
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
581
|
+
$type: "Document";
|
|
582
|
+
actions?: unknown;
|
|
583
|
+
appearance?: "default" | "inline" | Record<string, unknown>;
|
|
584
|
+
appIcon?: string;
|
|
585
|
+
appName?: string;
|
|
586
|
+
blocking?: boolean;
|
|
587
|
+
body: unknown;
|
|
588
|
+
compact?: boolean;
|
|
589
|
+
subtitle?: unknown;
|
|
590
|
+
title?: unknown;
|
|
591
|
+
titleIcon?: string;
|
|
429
592
|
};
|
|
430
|
-
declare function ProteusDocumentRenderer({
|
|
593
|
+
declare function ProteusDocumentRenderer({
|
|
594
|
+
element: elementProp,
|
|
595
|
+
strict,
|
|
596
|
+
...props
|
|
597
|
+
}: ProteusDocumentRendererProps): import("react/jsx-runtime").JSX.Element | null;
|
|
431
598
|
declare namespace ProteusDocumentRenderer {
|
|
432
|
-
|
|
599
|
+
var displayName: string;
|
|
433
600
|
}
|
|
434
|
-
|
|
435
|
-
|
|
601
|
+
//#endregion
|
|
602
|
+
//#region src/proteus-input/ProteusInput.d.ts
|
|
603
|
+
declare function ProteusInput(props: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
436
604
|
declare namespace ProteusInput {
|
|
437
|
-
|
|
605
|
+
var displayName: string;
|
|
438
606
|
}
|
|
439
|
-
|
|
440
|
-
|
|
607
|
+
//#endregion
|
|
608
|
+
//#region src/proteus-textarea/ProteusTextarea.d.ts
|
|
609
|
+
declare function ProteusTextarea(props: TextareaProps): import("react/jsx-runtime").JSX.Element;
|
|
441
610
|
declare namespace ProteusTextarea {
|
|
442
|
-
|
|
611
|
+
var displayName: string;
|
|
443
612
|
}
|
|
444
|
-
|
|
613
|
+
//#endregion
|
|
614
|
+
//#region src/use-proteus-value/useProteusValue.d.ts
|
|
445
615
|
declare function useProteusValue(element: ProteusValueProps): any;
|
|
446
|
-
|
|
447
|
-
export { ProteusAction, ProteusBridge, ProteusChart, ProteusDataTable, ProteusDocumentRenderer, ProteusDocumentShell, ProteusFederated, ProteusFileUpload, ProteusImage, ProteusImageCarousel, ProteusInput, ProteusMap, ProteusSelect, ProteusShow, ProteusTextarea, safeParseDocument, useProteusValue };
|
|
448
|
-
export type { FileUploadMetadata, ProteusDocumentRendererProps, ProteusDocumentShellProps, ProteusFileUploadProps, StructuredMessage, UploadFile };
|
|
616
|
+
//#endregion
|
|
617
|
+
export { type FileUploadMetadata, ProteusAction, ProteusBridge, ProteusChart, ProteusDataTable, ProteusDateInput, ProteusDocumentRenderer, ProteusDocumentRendererProps, ProteusDocumentShell, ProteusDocumentShellProps, ProteusFederated, ProteusFileUpload, ProteusFileUploadProps, ProteusImage, ProteusImageCarousel, ProteusInput, ProteusLength, ProteusMap, ProteusMapIndex, ProteusPillMenu, ProteusPillMenuProps, ProteusSelect, ProteusShow, ProteusTextarea, type StructuredMessage, type UploadFile, safeParseDocument, useProteusValue };
|