@uipath/apollo-wind 2.63.0 → 2.64.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/components/forms/aria-ids.cjs +38 -0
- package/dist/components/forms/aria-ids.d.ts +2 -0
- package/dist/components/forms/aria-ids.js +4 -0
- package/dist/components/forms/demo-mocks.cjs +0 -448
- package/dist/components/forms/demo-mocks.js +0 -448
- package/dist/components/forms/field-control.cjs +21 -17
- package/dist/components/forms/field-control.d.ts +3 -1
- package/dist/components/forms/field-control.js +21 -17
- package/dist/components/forms/field-renderer.cjs +65 -37
- package/dist/components/forms/field-renderer.js +66 -38
- package/dist/components/forms/form-designer.cjs +204 -3
- package/dist/components/forms/form-designer.js +204 -3
- package/dist/components/forms/form-examples.cjs +3 -190
- package/dist/components/forms/form-examples.d.ts +0 -10
- package/dist/components/forms/form-examples.js +3 -184
- package/dist/components/forms/form-schema.d.ts +6 -0
- package/dist/components/forms/metadata-form.cjs +9 -1
- package/dist/components/forms/metadata-form.d.ts +8 -1
- package/dist/components/forms/metadata-form.js +9 -1
- package/dist/components/forms/mode-aware-field.cjs +11 -6
- package/dist/components/forms/mode-aware-field.d.ts +2 -0
- package/dist/components/forms/mode-aware-field.js +11 -6
- package/dist/components/forms/string-list-field.cjs +5 -4
- package/dist/components/forms/string-list-field.d.ts +4 -2
- package/dist/components/forms/string-list-field.js +5 -4
- package/dist/components/ui/index.cjs +24 -24
- package/dist/components/ui/json-tree-view/JsonTree.types.d.ts +13 -0
- package/dist/components/ui/json-tree-view/JsonTreeRow.cjs +2 -1
- package/dist/components/ui/json-tree-view/JsonTreeRow.js +2 -1
- package/dist/components/ui/json-tree-view/JsonTypeBadge.cjs +43 -6
- package/dist/components/ui/json-tree-view/JsonTypeBadge.d.ts +6 -3
- package/dist/components/ui/json-tree-view/JsonTypeBadge.js +44 -7
- package/dist/components/ui/json-tree-view/index.d.ts +1 -1
- package/dist/components/ui/json-tree-view/strings.cjs +1 -0
- package/dist/components/ui/json-tree-view/strings.d.ts +10 -2
- package/dist/components/ui/json-tree-view/strings.js +1 -0
- package/dist/components/ui/prompt-value-control.cjs +3 -1
- package/dist/components/ui/prompt-value-control.d.ts +5 -0
- package/dist/components/ui/prompt-value-control.js +3 -1
- package/dist/components/ui/variable-value-control.cjs +3 -1
- package/dist/components/ui/variable-value-control.d.ts +5 -0
- package/dist/components/ui/variable-value-control.js +3 -1
- package/dist/index.d.ts +1 -1
- package/dist/styles.css +21 -0
- package/package.json +1 -1
- package/dist/templates/Forms/form-builder-example.d.ts +0 -1
|
@@ -10,6 +10,7 @@ import { Input } from "../ui/input.js";
|
|
|
10
10
|
import { InputGroup, InputGroupAddon } from "../ui/input-group.js";
|
|
11
11
|
import { PromptValueControl } from "../ui/prompt-value-control.js";
|
|
12
12
|
import { VariableValueControl } from "../ui/variable-value-control.js";
|
|
13
|
+
import { joinIds } from "./aria-ids.js";
|
|
13
14
|
import { DEFAULT_FIELD_ACTION_REGISTRY, resolveFieldActions, resolveVariables } from "./field-actions.js";
|
|
14
15
|
import { FIELD_CONTROL_GEOMETRY, FieldControl } from "./field-control.js";
|
|
15
16
|
import { DEFAULT_METADATA_FORM_STRINGS } from "./form-strings.js";
|
|
@@ -67,7 +68,7 @@ const TEXT_GEOMETRY = {
|
|
|
67
68
|
labelTarget: 'control',
|
|
68
69
|
insertable: true
|
|
69
70
|
};
|
|
70
|
-
function FieldAnatomy({ field, context, customComponents, disabled, required, options, formField, error }) {
|
|
71
|
+
function FieldAnatomy({ field, context, customComponents, disabled, required, options, formField, error, describedBy }) {
|
|
71
72
|
const form = useFormContext();
|
|
72
73
|
const registry = context.valueModes ?? DEFAULT_VALUE_MODE_REGISTRY;
|
|
73
74
|
const actionRegistry = context.fieldActions ?? DEFAULT_FIELD_ACTION_REGISTRY;
|
|
@@ -76,6 +77,7 @@ function FieldAnatomy({ field, context, customComponents, disabled, required, op
|
|
|
76
77
|
const { name } = field;
|
|
77
78
|
const errorId = `${name}-error`;
|
|
78
79
|
const labelId = `${name}-label`;
|
|
80
|
+
const controlDescribedBy = joinIds(error && errorId, describedBy);
|
|
79
81
|
const formVariables = context.variables;
|
|
80
82
|
const variables = useCallback(()=>resolveVariables(formVariables, field), [
|
|
81
83
|
formVariables,
|
|
@@ -235,6 +237,7 @@ function FieldAnatomy({ field, context, customComponents, disabled, required, op
|
|
|
235
237
|
required,
|
|
236
238
|
error,
|
|
237
239
|
errorId,
|
|
240
|
+
describedBy,
|
|
238
241
|
valueModeProps: ()=>({
|
|
239
242
|
value: inner,
|
|
240
243
|
onChange: (next)=>writeInner(next),
|
|
@@ -258,7 +261,7 @@ function FieldAnatomy({ field, context, customComponents, disabled, required, op
|
|
|
258
261
|
controlProps: {
|
|
259
262
|
'data-slot': 'input-group-control',
|
|
260
263
|
'aria-invalid': error ? true : void 0,
|
|
261
|
-
'aria-describedby':
|
|
264
|
+
'aria-describedby': controlDescribedBy,
|
|
262
265
|
'aria-errormessage': error ? errorId : void 0
|
|
263
266
|
}
|
|
264
267
|
})
|
|
@@ -492,7 +495,7 @@ function resolveControl(input) {
|
|
|
492
495
|
source: 'fallback'
|
|
493
496
|
};
|
|
494
497
|
}
|
|
495
|
-
function FallbackControl({ field, binding, disabled, error, errorId }) {
|
|
498
|
+
function FallbackControl({ field, binding, disabled, error, errorId, describedBy }) {
|
|
496
499
|
const { value } = binding;
|
|
497
500
|
return /*#__PURE__*/ jsx(Input, {
|
|
498
501
|
id: field.name,
|
|
@@ -504,7 +507,7 @@ function FallbackControl({ field, binding, disabled, error, errorId }) {
|
|
|
504
507
|
placeholder: field.placeholder,
|
|
505
508
|
disabled: disabled,
|
|
506
509
|
"aria-invalid": error ? true : void 0,
|
|
507
|
-
"aria-describedby": error
|
|
510
|
+
"aria-describedby": joinIds(error && errorId, describedBy),
|
|
508
511
|
"aria-errormessage": error ? errorId : void 0
|
|
509
512
|
});
|
|
510
513
|
}
|
|
@@ -533,7 +536,8 @@ function builtInLiteral(input) {
|
|
|
533
536
|
required: required,
|
|
534
537
|
error: error,
|
|
535
538
|
controlRef: input.controlRef,
|
|
536
|
-
labelId: input.labelId
|
|
539
|
+
labelId: input.labelId,
|
|
540
|
+
"aria-describedby": joinIds(field.componentProps?.['aria-describedby'], input.describedBy)
|
|
537
541
|
}),
|
|
538
542
|
geometry: registrationGeometry(registration),
|
|
539
543
|
source: 'custom'
|
|
@@ -546,7 +550,8 @@ function builtInLiteral(input) {
|
|
|
546
550
|
options: options,
|
|
547
551
|
disabled: disabled,
|
|
548
552
|
invalid: !!error,
|
|
549
|
-
strings: strings.boolean
|
|
553
|
+
strings: strings.boolean,
|
|
554
|
+
describedBy: input.describedBy
|
|
550
555
|
}),
|
|
551
556
|
geometry: FIELD_CONTROL_GEOMETRY[field.type] ?? unfittedGeometry(field),
|
|
552
557
|
source: 'field-type'
|
|
@@ -37,7 +37,7 @@ const textarea_cjs_namespaceObject = require("../ui/textarea.cjs");
|
|
|
37
37
|
function formatTemplate(template, values) {
|
|
38
38
|
return template.replace(/\{\{(\w+)\}\}/g, (match, token)=>token in values ? String(values[token]) : match);
|
|
39
39
|
}
|
|
40
|
-
function StringListField({ field, value, onChange, onBlur, error, disabled = false, required = false, inputRef }) {
|
|
40
|
+
function StringListField({ field, value, onChange, onBlur, error, disabled = false, required = false, inputRef, ariaDescribedBy = error ? `${field.name}-error` : void 0 }) {
|
|
41
41
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(form_field_cjs_namespaceObject.FormField, {
|
|
42
42
|
"data-slot": "string-list-field",
|
|
43
43
|
children: [
|
|
@@ -54,7 +54,8 @@ function StringListField({ field, value, onChange, onBlur, error, disabled = fal
|
|
|
54
54
|
onBlur: onBlur,
|
|
55
55
|
invalid: !!error,
|
|
56
56
|
disabled: disabled,
|
|
57
|
-
inputRef: inputRef
|
|
57
|
+
inputRef: inputRef,
|
|
58
|
+
ariaDescribedBy: ariaDescribedBy
|
|
58
59
|
}),
|
|
59
60
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(form_field_cjs_namespaceObject.FormFieldDescription, {
|
|
60
61
|
children: field.description
|
|
@@ -66,7 +67,7 @@ function StringListField({ field, value, onChange, onBlur, error, disabled = fal
|
|
|
66
67
|
]
|
|
67
68
|
});
|
|
68
69
|
}
|
|
69
|
-
function StringListControl({ field, value, onChange, onBlur, invalid = false, disabled = false, inputRef }) {
|
|
70
|
+
function StringListControl({ field, value, onChange, onBlur, invalid = false, disabled = false, inputRef, ariaDescribedBy = invalid ? `${field.name}-error` : void 0 }) {
|
|
70
71
|
const items = value ?? [];
|
|
71
72
|
const maxItems = field.maxItems ?? 1 / 0;
|
|
72
73
|
const canAdd = !disabled && items.length < maxItems;
|
|
@@ -126,7 +127,7 @@ function StringListControl({ field, value, onChange, onBlur, invalid = false, di
|
|
|
126
127
|
disabled: disabled,
|
|
127
128
|
"aria-label": `${field.label} ${index + 1}`,
|
|
128
129
|
"aria-invalid": invalid || void 0,
|
|
129
|
-
"aria-describedby":
|
|
130
|
+
"aria-describedby": ariaDescribedBy,
|
|
130
131
|
"aria-errormessage": invalid ? `${field.name}-error` : void 0,
|
|
131
132
|
className: "flex-1"
|
|
132
133
|
}),
|
|
@@ -18,6 +18,8 @@ export interface StringListFieldProps {
|
|
|
18
18
|
* indication of where it is.
|
|
19
19
|
*/
|
|
20
20
|
inputRef?: React.Ref<HTMLTextAreaElement>;
|
|
21
|
+
/** Every row's aria-describedby. Defaults to the error message's id while there is an error. */
|
|
22
|
+
ariaDescribedBy?: string;
|
|
21
23
|
}
|
|
22
24
|
/**
|
|
23
25
|
* Repeated multiline rows with Add / Remove — the `string-list` field type.
|
|
@@ -26,10 +28,10 @@ export interface StringListFieldProps {
|
|
|
26
28
|
* the info trigger is a Radix tooltip, which throws without one. Inside `MetadataForm` this
|
|
27
29
|
* is handled for you — it mounts a provider for schemas that use tooltip metadata.
|
|
28
30
|
*/
|
|
29
|
-
export declare function StringListField({ field, value, onChange, onBlur, error, disabled, required, inputRef, }: StringListFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare function StringListField({ field, value, onChange, onBlur, error, disabled, required, inputRef, ariaDescribedBy, }: StringListFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
30
32
|
export interface StringListControlProps extends Omit<StringListFieldProps, 'error' | 'required'> {
|
|
31
33
|
/** Marks every row invalid and points it at the `${field.name}-error` message. */
|
|
32
34
|
invalid?: boolean;
|
|
33
35
|
}
|
|
34
36
|
/** The rows and Add button of a string list, without its label, description or error. */
|
|
35
|
-
export declare function StringListControl({ field, value, onChange, onBlur, invalid, disabled, inputRef, }: StringListControlProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare function StringListControl({ field, value, onChange, onBlur, invalid, disabled, inputRef, ariaDescribedBy, }: StringListControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,7 +7,7 @@ import { Textarea } from "../ui/textarea.js";
|
|
|
7
7
|
function formatTemplate(template, values) {
|
|
8
8
|
return template.replace(/\{\{(\w+)\}\}/g, (match, token)=>token in values ? String(values[token]) : match);
|
|
9
9
|
}
|
|
10
|
-
function StringListField({ field, value, onChange, onBlur, error, disabled = false, required = false, inputRef }) {
|
|
10
|
+
function StringListField({ field, value, onChange, onBlur, error, disabled = false, required = false, inputRef, ariaDescribedBy = error ? `${field.name}-error` : void 0 }) {
|
|
11
11
|
return /*#__PURE__*/ jsxs(FormField, {
|
|
12
12
|
"data-slot": "string-list-field",
|
|
13
13
|
children: [
|
|
@@ -24,7 +24,8 @@ function StringListField({ field, value, onChange, onBlur, error, disabled = fal
|
|
|
24
24
|
onBlur: onBlur,
|
|
25
25
|
invalid: !!error,
|
|
26
26
|
disabled: disabled,
|
|
27
|
-
inputRef: inputRef
|
|
27
|
+
inputRef: inputRef,
|
|
28
|
+
ariaDescribedBy: ariaDescribedBy
|
|
28
29
|
}),
|
|
29
30
|
/*#__PURE__*/ jsx(FormFieldDescription, {
|
|
30
31
|
children: field.description
|
|
@@ -36,7 +37,7 @@ function StringListField({ field, value, onChange, onBlur, error, disabled = fal
|
|
|
36
37
|
]
|
|
37
38
|
});
|
|
38
39
|
}
|
|
39
|
-
function StringListControl({ field, value, onChange, onBlur, invalid = false, disabled = false, inputRef }) {
|
|
40
|
+
function StringListControl({ field, value, onChange, onBlur, invalid = false, disabled = false, inputRef, ariaDescribedBy = invalid ? `${field.name}-error` : void 0 }) {
|
|
40
41
|
const items = value ?? [];
|
|
41
42
|
const maxItems = field.maxItems ?? 1 / 0;
|
|
42
43
|
const canAdd = !disabled && items.length < maxItems;
|
|
@@ -96,7 +97,7 @@ function StringListControl({ field, value, onChange, onBlur, invalid = false, di
|
|
|
96
97
|
disabled: disabled,
|
|
97
98
|
"aria-label": `${field.label} ${index + 1}`,
|
|
98
99
|
"aria-invalid": invalid || void 0,
|
|
99
|
-
"aria-describedby":
|
|
100
|
+
"aria-describedby": ariaDescribedBy,
|
|
100
101
|
"aria-errormessage": invalid ? `${field.name}-error` : void 0,
|
|
101
102
|
className: "flex-1"
|
|
102
103
|
}),
|
|
@@ -42,7 +42,7 @@ var __webpack_modules__ = {
|
|
|
42
42
|
"@/components/ui/checkbox" (module) {
|
|
43
43
|
module.exports = require("./checkbox.cjs");
|
|
44
44
|
},
|
|
45
|
-
"
|
|
45
|
+
"@/components/ui/collapsible" (module) {
|
|
46
46
|
module.exports = require("./collapsible.cjs");
|
|
47
47
|
},
|
|
48
48
|
"./combobox" (module) {
|
|
@@ -51,7 +51,7 @@ var __webpack_modules__ = {
|
|
|
51
51
|
"@/components/ui/command" (module) {
|
|
52
52
|
module.exports = require("./command.cjs");
|
|
53
53
|
},
|
|
54
|
-
"
|
|
54
|
+
"@/components/ui/context-menu" (module) {
|
|
55
55
|
module.exports = require("./context-menu.cjs");
|
|
56
56
|
},
|
|
57
57
|
"./data-table" (module) {
|
|
@@ -69,10 +69,10 @@ var __webpack_modules__ = {
|
|
|
69
69
|
"./drawer" (module) {
|
|
70
70
|
module.exports = require("./drawer.cjs");
|
|
71
71
|
},
|
|
72
|
-
"
|
|
72
|
+
"@/components/ui/dropdown-menu" (module) {
|
|
73
73
|
module.exports = require("./dropdown-menu.cjs");
|
|
74
74
|
},
|
|
75
|
-
"
|
|
75
|
+
"@/components/ui/editable-cell" (module) {
|
|
76
76
|
module.exports = require("./editable-cell.cjs");
|
|
77
77
|
},
|
|
78
78
|
"./empty-state" (module) {
|
|
@@ -90,10 +90,10 @@ var __webpack_modules__ = {
|
|
|
90
90
|
"./form-field" (module) {
|
|
91
91
|
module.exports = require("./form-field.cjs");
|
|
92
92
|
},
|
|
93
|
-
"
|
|
93
|
+
"./hover-card" (module) {
|
|
94
94
|
module.exports = require("./hover-card.cjs");
|
|
95
95
|
},
|
|
96
|
-
"
|
|
96
|
+
"@/components/ui/info-tooltip" (module) {
|
|
97
97
|
module.exports = require("./info-tooltip.cjs");
|
|
98
98
|
},
|
|
99
99
|
"@/components/ui/input-group" (module) {
|
|
@@ -108,7 +108,7 @@ var __webpack_modules__ = {
|
|
|
108
108
|
"@/components/ui/label" (module) {
|
|
109
109
|
module.exports = require("./label.cjs");
|
|
110
110
|
},
|
|
111
|
-
"
|
|
111
|
+
"@/components/ui/layout" (module) {
|
|
112
112
|
module.exports = require("./layout/index.cjs");
|
|
113
113
|
},
|
|
114
114
|
"./lockable-value-field" (module) {
|
|
@@ -183,28 +183,28 @@ var __webpack_modules__ = {
|
|
|
183
183
|
"./switch" (module) {
|
|
184
184
|
module.exports = require("./switch.cjs");
|
|
185
185
|
},
|
|
186
|
-
"
|
|
186
|
+
"@/components/ui/table" (module) {
|
|
187
187
|
module.exports = require("./table.cjs");
|
|
188
188
|
},
|
|
189
189
|
"./tabs" (module) {
|
|
190
190
|
module.exports = require("./tabs.cjs");
|
|
191
191
|
},
|
|
192
|
-
"
|
|
192
|
+
"@/components/ui/textarea" (module) {
|
|
193
193
|
module.exports = require("./textarea.cjs");
|
|
194
194
|
},
|
|
195
195
|
"./toggle-group" (module) {
|
|
196
196
|
module.exports = require("./toggle-group.cjs");
|
|
197
197
|
},
|
|
198
|
-
"
|
|
198
|
+
"@/components/ui/toggle" (module) {
|
|
199
199
|
module.exports = require("./toggle.cjs");
|
|
200
200
|
},
|
|
201
|
-
"
|
|
201
|
+
"@/components/ui/tooltip" (module) {
|
|
202
202
|
module.exports = require("./tooltip.cjs");
|
|
203
203
|
},
|
|
204
204
|
"./tree-view" (module) {
|
|
205
205
|
module.exports = require("./tree-view.cjs");
|
|
206
206
|
},
|
|
207
|
-
"
|
|
207
|
+
"@/components/ui/variable-picker" (module) {
|
|
208
208
|
module.exports = require("./variable-picker/index.cjs");
|
|
209
209
|
},
|
|
210
210
|
"./variable-value-control" (module) {
|
|
@@ -370,7 +370,7 @@ var __webpack_exports__ = {};
|
|
|
370
370
|
"TreeView"
|
|
371
371
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_checkbox__rspack_import_13[__rspack_import_key];
|
|
372
372
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
373
|
-
var _collapsible__rspack_import_14 = __webpack_require__("
|
|
373
|
+
var _collapsible__rspack_import_14 = __webpack_require__("@/components/ui/collapsible");
|
|
374
374
|
var __rspack_reexport = {};
|
|
375
375
|
for(const __rspack_import_key in _collapsible__rspack_import_14)if ([
|
|
376
376
|
"default",
|
|
@@ -394,7 +394,7 @@ var __webpack_exports__ = {};
|
|
|
394
394
|
"TreeView"
|
|
395
395
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_command__rspack_import_16[__rspack_import_key];
|
|
396
396
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
397
|
-
var _context_menu__rspack_import_17 = __webpack_require__("
|
|
397
|
+
var _context_menu__rspack_import_17 = __webpack_require__("@/components/ui/context-menu");
|
|
398
398
|
var __rspack_reexport = {};
|
|
399
399
|
for(const __rspack_import_key in _context_menu__rspack_import_17)if ([
|
|
400
400
|
"default",
|
|
@@ -442,7 +442,7 @@ var __webpack_exports__ = {};
|
|
|
442
442
|
"TreeView"
|
|
443
443
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_drawer__rspack_import_22[__rspack_import_key];
|
|
444
444
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
445
|
-
var _dropdown_menu__rspack_import_23 = __webpack_require__("
|
|
445
|
+
var _dropdown_menu__rspack_import_23 = __webpack_require__("@/components/ui/dropdown-menu");
|
|
446
446
|
var __rspack_reexport = {};
|
|
447
447
|
for(const __rspack_import_key in _dropdown_menu__rspack_import_23)if ([
|
|
448
448
|
"default",
|
|
@@ -450,7 +450,7 @@ var __webpack_exports__ = {};
|
|
|
450
450
|
"TreeView"
|
|
451
451
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_dropdown_menu__rspack_import_23[__rspack_import_key];
|
|
452
452
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
453
|
-
var _editable_cell__rspack_import_24 = __webpack_require__("
|
|
453
|
+
var _editable_cell__rspack_import_24 = __webpack_require__("@/components/ui/editable-cell");
|
|
454
454
|
var __rspack_reexport = {};
|
|
455
455
|
for(const __rspack_import_key in _editable_cell__rspack_import_24)if ([
|
|
456
456
|
"default",
|
|
@@ -498,7 +498,7 @@ var __webpack_exports__ = {};
|
|
|
498
498
|
"TreeView"
|
|
499
499
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_form_field__rspack_import_29[__rspack_import_key];
|
|
500
500
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
501
|
-
var _hover_card__rspack_import_30 = __webpack_require__("
|
|
501
|
+
var _hover_card__rspack_import_30 = __webpack_require__("./hover-card");
|
|
502
502
|
var __rspack_reexport = {};
|
|
503
503
|
for(const __rspack_import_key in _hover_card__rspack_import_30)if ([
|
|
504
504
|
"default",
|
|
@@ -506,7 +506,7 @@ var __webpack_exports__ = {};
|
|
|
506
506
|
"TreeView"
|
|
507
507
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_hover_card__rspack_import_30[__rspack_import_key];
|
|
508
508
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
509
|
-
var _info_tooltip__rspack_import_31 = __webpack_require__("
|
|
509
|
+
var _info_tooltip__rspack_import_31 = __webpack_require__("@/components/ui/info-tooltip");
|
|
510
510
|
var __rspack_reexport = {};
|
|
511
511
|
for(const __rspack_import_key in _info_tooltip__rspack_import_31)if ([
|
|
512
512
|
"default",
|
|
@@ -546,7 +546,7 @@ var __webpack_exports__ = {};
|
|
|
546
546
|
"TreeView"
|
|
547
547
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_label__rspack_import_35[__rspack_import_key];
|
|
548
548
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
549
|
-
var _layout__rspack_import_36 = __webpack_require__("
|
|
549
|
+
var _layout__rspack_import_36 = __webpack_require__("@/components/ui/layout");
|
|
550
550
|
var __rspack_reexport = {};
|
|
551
551
|
for(const __rspack_import_key in _layout__rspack_import_36)if ([
|
|
552
552
|
"default",
|
|
@@ -746,7 +746,7 @@ var __webpack_exports__ = {};
|
|
|
746
746
|
"TreeView"
|
|
747
747
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_switch__rspack_import_60[__rspack_import_key];
|
|
748
748
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
749
|
-
var _table__rspack_import_61 = __webpack_require__("
|
|
749
|
+
var _table__rspack_import_61 = __webpack_require__("@/components/ui/table");
|
|
750
750
|
var __rspack_reexport = {};
|
|
751
751
|
for(const __rspack_import_key in _table__rspack_import_61)if ([
|
|
752
752
|
"default",
|
|
@@ -762,7 +762,7 @@ var __webpack_exports__ = {};
|
|
|
762
762
|
"TreeView"
|
|
763
763
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_tabs__rspack_import_62[__rspack_import_key];
|
|
764
764
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
765
|
-
var _textarea__rspack_import_63 = __webpack_require__("
|
|
765
|
+
var _textarea__rspack_import_63 = __webpack_require__("@/components/ui/textarea");
|
|
766
766
|
var __rspack_reexport = {};
|
|
767
767
|
for(const __rspack_import_key in _textarea__rspack_import_63)if ([
|
|
768
768
|
"default",
|
|
@@ -770,7 +770,7 @@ var __webpack_exports__ = {};
|
|
|
770
770
|
"TreeView"
|
|
771
771
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_textarea__rspack_import_63[__rspack_import_key];
|
|
772
772
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
773
|
-
var _toggle__rspack_import_64 = __webpack_require__("
|
|
773
|
+
var _toggle__rspack_import_64 = __webpack_require__("@/components/ui/toggle");
|
|
774
774
|
var __rspack_reexport = {};
|
|
775
775
|
for(const __rspack_import_key in _toggle__rspack_import_64)if ([
|
|
776
776
|
"default",
|
|
@@ -786,7 +786,7 @@ var __webpack_exports__ = {};
|
|
|
786
786
|
"TreeView"
|
|
787
787
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_toggle_group__rspack_import_65[__rspack_import_key];
|
|
788
788
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
789
|
-
var _tooltip__rspack_import_66 = __webpack_require__("
|
|
789
|
+
var _tooltip__rspack_import_66 = __webpack_require__("@/components/ui/tooltip");
|
|
790
790
|
var __rspack_reexport = {};
|
|
791
791
|
for(const __rspack_import_key in _tooltip__rspack_import_66)if ([
|
|
792
792
|
"default",
|
|
@@ -796,7 +796,7 @@ var __webpack_exports__ = {};
|
|
|
796
796
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
797
797
|
var _tree_view__rspack_import_67 = __webpack_require__("./tree-view");
|
|
798
798
|
var _tree_view__rspack_import_67_default = /*#__PURE__*/ __webpack_require__.n(_tree_view__rspack_import_67);
|
|
799
|
-
var _variable_picker__rspack_import_68 = __webpack_require__("
|
|
799
|
+
var _variable_picker__rspack_import_68 = __webpack_require__("@/components/ui/variable-picker");
|
|
800
800
|
var __rspack_reexport = {};
|
|
801
801
|
for(const __rspack_import_key in _variable_picker__rspack_import_68)if ([
|
|
802
802
|
"default",
|
|
@@ -104,6 +104,19 @@ export interface NodeDecorationBadge {
|
|
|
104
104
|
* neutral default, e.g. `'border-info/30 bg-info/10 text-info'`.
|
|
105
105
|
*/
|
|
106
106
|
className?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Marks the node as a reference to another variable. The badge gets a
|
|
109
|
+
* corner tab with an arrow, and its tooltip names the reference.
|
|
110
|
+
*/
|
|
111
|
+
reference?: NodeBadgeReference;
|
|
112
|
+
}
|
|
113
|
+
/** A reference marker on a row's type badge. */
|
|
114
|
+
export interface NodeBadgeReference {
|
|
115
|
+
/**
|
|
116
|
+
* Where the value comes from, shown under the tooltip title
|
|
117
|
+
* (e.g. `'Live from Read customer · output.email'`).
|
|
118
|
+
*/
|
|
119
|
+
source?: string;
|
|
107
120
|
}
|
|
108
121
|
/** Consumer-provided visual annotation for a tree node. */
|
|
109
122
|
export interface NodeDecoration {
|
|
@@ -151,7 +151,8 @@ function JsonTreeRow({ node, depth }) {
|
|
|
151
151
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_JsonTypeBadge_cjs_namespaceObject.JsonTypeBadge, {
|
|
152
152
|
type: node.type,
|
|
153
153
|
icon: decoration?.badge?.icon ?? deriveTypeIcon?.(node),
|
|
154
|
-
className: decoration?.badge?.className
|
|
154
|
+
className: decoration?.badge?.className,
|
|
155
|
+
reference: decoration?.badge?.reference
|
|
155
156
|
}),
|
|
156
157
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_NodeKey_cjs_namespaceObject.NodeKey, {
|
|
157
158
|
node: node,
|
|
@@ -121,7 +121,8 @@ function JsonTreeRow({ node, depth }) {
|
|
|
121
121
|
/*#__PURE__*/ jsx(JsonTypeBadge, {
|
|
122
122
|
type: node.type,
|
|
123
123
|
icon: decoration?.badge?.icon ?? deriveTypeIcon?.(node),
|
|
124
|
-
className: decoration?.badge?.className
|
|
124
|
+
className: decoration?.badge?.className,
|
|
125
|
+
reference: decoration?.badge?.reference
|
|
125
126
|
}),
|
|
126
127
|
/*#__PURE__*/ jsx(NodeKey, {
|
|
127
128
|
node: node,
|
|
@@ -27,9 +27,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
JsonTypeBadge: ()=>JsonTypeBadge
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
-
const index_cjs_namespaceObject = require("../../../lib/index.cjs");
|
|
31
30
|
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
31
|
+
const index_cjs_namespaceObject = require("../../../lib/index.cjs");
|
|
32
32
|
const external_JsonTreeTooltip_cjs_namespaceObject = require("./JsonTreeTooltip.cjs");
|
|
33
|
+
const external_strings_cjs_namespaceObject = require("./strings.cjs");
|
|
33
34
|
const TYPE_ICON = {
|
|
34
35
|
string: external_lucide_react_namespaceObject.Type,
|
|
35
36
|
number: external_lucide_react_namespaceObject.Hash,
|
|
@@ -46,18 +47,54 @@ const TYPE_LABEL = {
|
|
|
46
47
|
array: 'Array',
|
|
47
48
|
null: 'Null'
|
|
48
49
|
};
|
|
49
|
-
function JsonTypeBadge({ type, icon, className, tooltip }) {
|
|
50
|
+
function JsonTypeBadge({ type, icon, className, tooltip, reference }) {
|
|
51
|
+
const strings = (0, external_strings_cjs_namespaceObject.useJsonTreeViewStrings)();
|
|
50
52
|
const DefaultIcon = TYPE_ICON[type];
|
|
51
|
-
|
|
53
|
+
const box = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
54
|
+
className: (0, index_cjs_namespaceObject.cn)('inline-flex h-4.5 min-w-4.5 shrink-0 items-center justify-center rounded border border-border bg-surface-overlay px-0.5 text-foreground-muted [&_svg]:size-2.75', className),
|
|
55
|
+
children: icon ?? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DefaultIcon, {})
|
|
56
|
+
});
|
|
57
|
+
if (!reference) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_JsonTreeTooltip_cjs_namespaceObject.JsonTreeTooltip, {
|
|
52
58
|
content: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
53
59
|
className: "break-all font-mono text-xs font-semibold leading-4",
|
|
54
60
|
children: tooltip ?? TYPE_LABEL[type]
|
|
55
61
|
}),
|
|
56
62
|
placement: "top",
|
|
57
63
|
delay: true,
|
|
58
|
-
children:
|
|
59
|
-
|
|
60
|
-
|
|
64
|
+
children: box
|
|
65
|
+
});
|
|
66
|
+
const title = strings.referenceType(TYPE_LABEL[type]);
|
|
67
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_JsonTreeTooltip_cjs_namespaceObject.JsonTreeTooltip, {
|
|
68
|
+
content: tooltip ?? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
69
|
+
className: "flex flex-col gap-0.5 leading-4",
|
|
70
|
+
children: [
|
|
71
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
72
|
+
className: "text-xs font-semibold",
|
|
73
|
+
children: title
|
|
74
|
+
}),
|
|
75
|
+
reference.source && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
76
|
+
className: "break-all text-xs text-foreground-muted",
|
|
77
|
+
children: reference.source
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
}),
|
|
81
|
+
placement: "top",
|
|
82
|
+
delay: true,
|
|
83
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
84
|
+
className: "relative inline-flex shrink-0 rounded outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
85
|
+
role: "img",
|
|
86
|
+
tabIndex: 0,
|
|
87
|
+
"aria-label": reference.source ? `${title}, ${reference.source}` : title,
|
|
88
|
+
children: [
|
|
89
|
+
box,
|
|
90
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
91
|
+
className: "absolute -right-1 -bottom-1 grid size-3 place-items-center rounded-[3px] border border-border bg-surface-overlay text-foreground-muted",
|
|
92
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ArrowUpRight, {
|
|
93
|
+
className: "size-2.5",
|
|
94
|
+
strokeWidth: 3
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
]
|
|
61
98
|
})
|
|
62
99
|
});
|
|
63
100
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { JsonTreeNodeType } from './JsonTree.types';
|
|
2
|
+
import type { JsonTreeNodeType, NodeBadgeReference } from './JsonTree.types';
|
|
3
3
|
export interface JsonTypeBadgeProps {
|
|
4
4
|
type: JsonTreeNodeType;
|
|
5
5
|
/** Replaces the default type icon (e.g. a paperclip for file nodes). */
|
|
@@ -8,10 +8,13 @@ export interface JsonTypeBadgeProps {
|
|
|
8
8
|
className?: string;
|
|
9
9
|
/** Tooltip content on hover. Defaults to the capitalized type name. */
|
|
10
10
|
tooltip?: ReactNode;
|
|
11
|
+
/** Marks the value as a reference: adds a corner tab with an arrow. */
|
|
12
|
+
reference?: NodeBadgeReference;
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
15
|
* Compact badge for a JSON value type. Deliberately neutral: the value text
|
|
14
16
|
* carries the color coding, the badge only carries the type icon. Hovering it
|
|
15
|
-
* shows the type name (override via `tooltip`).
|
|
17
|
+
* shows the type name (override via `tooltip`). A `reference` adds a corner
|
|
18
|
+
* tab with an arrow; it has no hover state of its own, only the tooltip.
|
|
16
19
|
*/
|
|
17
|
-
export declare function JsonTypeBadge({ type, icon, className, tooltip }: JsonTypeBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function JsonTypeBadge({ type, icon, className, tooltip, reference }: JsonTypeBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ArrowUpRight, Braces, Brackets, CircleSlash2, Hash, ToggleLeft, Type } from "lucide-react";
|
|
2
3
|
import { cn } from "../../../lib/index.js";
|
|
3
|
-
import { Braces, Brackets, CircleSlash2, Hash, ToggleLeft, Type } from "lucide-react";
|
|
4
4
|
import { JsonTreeTooltip } from "./JsonTreeTooltip.js";
|
|
5
|
+
import { useJsonTreeViewStrings } from "./strings.js";
|
|
5
6
|
const TYPE_ICON = {
|
|
6
7
|
string: Type,
|
|
7
8
|
number: Hash,
|
|
@@ -18,18 +19,54 @@ const TYPE_LABEL = {
|
|
|
18
19
|
array: 'Array',
|
|
19
20
|
null: 'Null'
|
|
20
21
|
};
|
|
21
|
-
function JsonTypeBadge({ type, icon, className, tooltip }) {
|
|
22
|
+
function JsonTypeBadge({ type, icon, className, tooltip, reference }) {
|
|
23
|
+
const strings = useJsonTreeViewStrings();
|
|
22
24
|
const DefaultIcon = TYPE_ICON[type];
|
|
23
|
-
|
|
25
|
+
const box = /*#__PURE__*/ jsx("span", {
|
|
26
|
+
className: cn('inline-flex h-4.5 min-w-4.5 shrink-0 items-center justify-center rounded border border-border bg-surface-overlay px-0.5 text-foreground-muted [&_svg]:size-2.75', className),
|
|
27
|
+
children: icon ?? /*#__PURE__*/ jsx(DefaultIcon, {})
|
|
28
|
+
});
|
|
29
|
+
if (!reference) return /*#__PURE__*/ jsx(JsonTreeTooltip, {
|
|
24
30
|
content: /*#__PURE__*/ jsx("span", {
|
|
25
31
|
className: "break-all font-mono text-xs font-semibold leading-4",
|
|
26
32
|
children: tooltip ?? TYPE_LABEL[type]
|
|
27
33
|
}),
|
|
28
34
|
placement: "top",
|
|
29
35
|
delay: true,
|
|
30
|
-
children:
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
children: box
|
|
37
|
+
});
|
|
38
|
+
const title = strings.referenceType(TYPE_LABEL[type]);
|
|
39
|
+
return /*#__PURE__*/ jsx(JsonTreeTooltip, {
|
|
40
|
+
content: tooltip ?? /*#__PURE__*/ jsxs("span", {
|
|
41
|
+
className: "flex flex-col gap-0.5 leading-4",
|
|
42
|
+
children: [
|
|
43
|
+
/*#__PURE__*/ jsx("span", {
|
|
44
|
+
className: "text-xs font-semibold",
|
|
45
|
+
children: title
|
|
46
|
+
}),
|
|
47
|
+
reference.source && /*#__PURE__*/ jsx("span", {
|
|
48
|
+
className: "break-all text-xs text-foreground-muted",
|
|
49
|
+
children: reference.source
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
}),
|
|
53
|
+
placement: "top",
|
|
54
|
+
delay: true,
|
|
55
|
+
children: /*#__PURE__*/ jsxs("span", {
|
|
56
|
+
className: "relative inline-flex shrink-0 rounded outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
57
|
+
role: "img",
|
|
58
|
+
tabIndex: 0,
|
|
59
|
+
"aria-label": reference.source ? `${title}, ${reference.source}` : title,
|
|
60
|
+
children: [
|
|
61
|
+
box,
|
|
62
|
+
/*#__PURE__*/ jsx("span", {
|
|
63
|
+
className: "absolute -right-1 -bottom-1 grid size-3 place-items-center rounded-[3px] border border-border bg-surface-overlay text-foreground-muted",
|
|
64
|
+
children: /*#__PURE__*/ jsx(ArrowUpRight, {
|
|
65
|
+
className: "size-2.5",
|
|
66
|
+
strokeWidth: 3
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
]
|
|
33
70
|
})
|
|
34
71
|
});
|
|
35
72
|
}
|
|
@@ -7,4 +7,4 @@ export * from './JsonTree';
|
|
|
7
7
|
export * from './JsonTree.types';
|
|
8
8
|
export * from './JsonTreeToolbar';
|
|
9
9
|
export * from './JsonTypeBadge';
|
|
10
|
-
export { DEFAULT_JSON_TREE_VIEW_STRINGS, type JsonTreeViewStrings, JsonTreeViewProvider, type JsonTreeViewProviderProps, useJsonTreeViewStrings, } from './strings';
|
|
10
|
+
export { DEFAULT_JSON_TREE_VIEW_STRINGS, type JsonTreeViewStrings, JsonTreeViewProvider, type JsonTreeViewProviderProps, type ResolvedJsonTreeViewStrings, useJsonTreeViewStrings, } from './strings';
|
|
@@ -41,6 +41,7 @@ const DEFAULT_JSON_TREE_VIEW_STRINGS = {
|
|
|
41
41
|
itemCount: (count)=>1 === count ? '1 item' : `${count} items`,
|
|
42
42
|
keyCount: (count)=>1 === count ? '1 key' : `${count} keys`,
|
|
43
43
|
requiredMarker: 'required',
|
|
44
|
+
referenceType: (typeLabel)=>`${typeLabel} · reference`,
|
|
44
45
|
pathCopied: 'Path copied',
|
|
45
46
|
copyPathHint: 'Click to copy this path',
|
|
46
47
|
copyPathFor: (path)=>`Copy path for ${path}`,
|
|
@@ -16,6 +16,12 @@ export interface JsonTreeViewStrings {
|
|
|
16
16
|
keyCount: (count: number) => string;
|
|
17
17
|
/** Screen-reader text for the required-field marker. */
|
|
18
18
|
requiredMarker: string;
|
|
19
|
+
/**
|
|
20
|
+
* Type badge tooltip title for a reference, given the type name (e.g. "String").
|
|
21
|
+
* Optional so catalogs written before it was added still type-check; falls
|
|
22
|
+
* back to the English default.
|
|
23
|
+
*/
|
|
24
|
+
referenceType?: (typeLabel: string) => string;
|
|
19
25
|
pathCopied: string;
|
|
20
26
|
copyPathHint: string;
|
|
21
27
|
copyPathFor: (path: string) => string;
|
|
@@ -48,7 +54,9 @@ export interface JsonTreeViewStrings {
|
|
|
48
54
|
expandAll: string;
|
|
49
55
|
collapseAll: string;
|
|
50
56
|
}
|
|
51
|
-
|
|
57
|
+
/** Strings with every optional key filled in, as the tree parts read them. */
|
|
58
|
+
export type ResolvedJsonTreeViewStrings = Required<JsonTreeViewStrings>;
|
|
59
|
+
export declare const DEFAULT_JSON_TREE_VIEW_STRINGS: ResolvedJsonTreeViewStrings;
|
|
52
60
|
export interface JsonTreeViewProviderProps {
|
|
53
61
|
/** Overrides merged over any outer provider's strings, then the English defaults. */
|
|
54
62
|
strings?: Partial<JsonTreeViewStrings>;
|
|
@@ -61,5 +69,5 @@ export interface JsonTreeViewProviderProps {
|
|
|
61
69
|
* including the toolbar and editors when they are rendered on their own.
|
|
62
70
|
*/
|
|
63
71
|
export declare function JsonTreeViewProvider({ strings, tooltipContentClassName, children, }: JsonTreeViewProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
64
|
-
export declare function useJsonTreeViewStrings():
|
|
72
|
+
export declare function useJsonTreeViewStrings(): ResolvedJsonTreeViewStrings;
|
|
65
73
|
export declare function useJsonTreeViewTooltipClassName(): string | undefined;
|
|
@@ -10,6 +10,7 @@ const DEFAULT_JSON_TREE_VIEW_STRINGS = {
|
|
|
10
10
|
itemCount: (count)=>1 === count ? '1 item' : `${count} items`,
|
|
11
11
|
keyCount: (count)=>1 === count ? '1 key' : `${count} keys`,
|
|
12
12
|
requiredMarker: 'required',
|
|
13
|
+
referenceType: (typeLabel)=>`${typeLabel} · reference`,
|
|
13
14
|
pathCopied: 'Path copied',
|
|
14
15
|
copyPathHint: 'Click to copy this path',
|
|
15
16
|
copyPathFor: (path)=>`Copy path for ${path}`,
|