@uipath/apollo-wind 2.91.0 → 2.92.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/ui/index.cjs +26 -26
- package/dist/components/ui/quick-form-field/index.d.ts +1 -1
- package/dist/components/ui/quick-form-field/quick-form-field.cjs +3 -2
- package/dist/components/ui/quick-form-field/quick-form-field.d.ts +2 -1
- package/dist/components/ui/quick-form-field/quick-form-field.js +3 -2
- package/dist/components/ui/quick-form-field/types.d.ts +11 -0
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -36,10 +36,10 @@ var __webpack_modules__ = {
|
|
|
36
36
|
"@/components/ui/button" (module) {
|
|
37
37
|
module.exports = require("./button.cjs");
|
|
38
38
|
},
|
|
39
|
-
"
|
|
39
|
+
"@/components/ui/calendar" (module) {
|
|
40
40
|
module.exports = require("./calendar.cjs");
|
|
41
41
|
},
|
|
42
|
-
"
|
|
42
|
+
"@/components/ui/card" (module) {
|
|
43
43
|
module.exports = require("./card.cjs");
|
|
44
44
|
},
|
|
45
45
|
"./chart" (module) {
|
|
@@ -57,10 +57,10 @@ var __webpack_modules__ = {
|
|
|
57
57
|
"./citation" (module) {
|
|
58
58
|
module.exports = require("./citation.cjs");
|
|
59
59
|
},
|
|
60
|
-
"
|
|
60
|
+
"@/components/ui/code-block" (module) {
|
|
61
61
|
module.exports = require("./code-block.cjs");
|
|
62
62
|
},
|
|
63
|
-
"
|
|
63
|
+
"./collapsible" (module) {
|
|
64
64
|
module.exports = require("./collapsible.cjs");
|
|
65
65
|
},
|
|
66
66
|
"./combobox" (module) {
|
|
@@ -93,13 +93,13 @@ var __webpack_modules__ = {
|
|
|
93
93
|
"./drawer" (module) {
|
|
94
94
|
module.exports = require("./drawer.cjs");
|
|
95
95
|
},
|
|
96
|
-
"
|
|
96
|
+
"./dropdown-menu" (module) {
|
|
97
97
|
module.exports = require("./dropdown-menu.cjs");
|
|
98
98
|
},
|
|
99
99
|
"./dropzone-overlay" (module) {
|
|
100
100
|
module.exports = require("./dropzone-overlay.cjs");
|
|
101
101
|
},
|
|
102
|
-
"
|
|
102
|
+
"./editable-cell" (module) {
|
|
103
103
|
module.exports = require("./editable-cell.cjs");
|
|
104
104
|
},
|
|
105
105
|
"./editable-text" (module) {
|
|
@@ -126,19 +126,19 @@ var __webpack_modules__ = {
|
|
|
126
126
|
"@/components/ui/hover-card" (module) {
|
|
127
127
|
module.exports = require("./hover-card.cjs");
|
|
128
128
|
},
|
|
129
|
-
"
|
|
129
|
+
"@/components/ui/info-tooltip" (module) {
|
|
130
130
|
module.exports = require("./info-tooltip.cjs");
|
|
131
131
|
},
|
|
132
132
|
"@/components/ui/input-group" (module) {
|
|
133
133
|
module.exports = require("./input-group.cjs");
|
|
134
134
|
},
|
|
135
|
-
"
|
|
135
|
+
"./input" (module) {
|
|
136
136
|
module.exports = require("./input.cjs");
|
|
137
137
|
},
|
|
138
138
|
"./json-tree-view" (module) {
|
|
139
139
|
module.exports = require("./json-tree-view/index.cjs");
|
|
140
140
|
},
|
|
141
|
-
"
|
|
141
|
+
"@/components/ui/label" (module) {
|
|
142
142
|
module.exports = require("./label.cjs");
|
|
143
143
|
},
|
|
144
144
|
"@/components/ui/layout" (module) {
|
|
@@ -213,7 +213,7 @@ var __webpack_modules__ = {
|
|
|
213
213
|
"./reference-chip-colors" (module) {
|
|
214
214
|
module.exports = require("./reference-chip-colors.cjs");
|
|
215
215
|
},
|
|
216
|
-
"
|
|
216
|
+
"./reference-chip" (module) {
|
|
217
217
|
module.exports = require("./reference-chip.cjs");
|
|
218
218
|
},
|
|
219
219
|
"./resizable" (module) {
|
|
@@ -264,13 +264,13 @@ var __webpack_modules__ = {
|
|
|
264
264
|
"./switch" (module) {
|
|
265
265
|
module.exports = require("./switch.cjs");
|
|
266
266
|
},
|
|
267
|
-
"
|
|
267
|
+
"./table" (module) {
|
|
268
268
|
module.exports = require("./table.cjs");
|
|
269
269
|
},
|
|
270
270
|
"./tabs" (module) {
|
|
271
271
|
module.exports = require("./tabs.cjs");
|
|
272
272
|
},
|
|
273
|
-
"
|
|
273
|
+
"@/components/ui/textarea" (module) {
|
|
274
274
|
module.exports = require("./textarea.cjs");
|
|
275
275
|
},
|
|
276
276
|
"./thinking-indicator" (module) {
|
|
@@ -291,7 +291,7 @@ var __webpack_modules__ = {
|
|
|
291
291
|
"./tree-view" (module) {
|
|
292
292
|
module.exports = require("./tree-view.cjs");
|
|
293
293
|
},
|
|
294
|
-
"
|
|
294
|
+
"./variable-picker" (module) {
|
|
295
295
|
module.exports = require("./variable-picker/index.cjs");
|
|
296
296
|
},
|
|
297
297
|
"./variable-value-control" (module) {
|
|
@@ -467,7 +467,7 @@ var __webpack_exports__ = {};
|
|
|
467
467
|
"ReferenceChip"
|
|
468
468
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_button_group__rspack_import_11[__rspack_import_key];
|
|
469
469
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
470
|
-
var _calendar__rspack_import_12 = __webpack_require__("
|
|
470
|
+
var _calendar__rspack_import_12 = __webpack_require__("@/components/ui/calendar");
|
|
471
471
|
var __rspack_reexport = {};
|
|
472
472
|
for(const __rspack_import_key in _calendar__rspack_import_12)if ([
|
|
473
473
|
"getReferenceChipColors",
|
|
@@ -477,7 +477,7 @@ var __webpack_exports__ = {};
|
|
|
477
477
|
"ReferenceChip"
|
|
478
478
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_calendar__rspack_import_12[__rspack_import_key];
|
|
479
479
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
480
|
-
var _card__rspack_import_13 = __webpack_require__("
|
|
480
|
+
var _card__rspack_import_13 = __webpack_require__("@/components/ui/card");
|
|
481
481
|
var __rspack_reexport = {};
|
|
482
482
|
for(const __rspack_import_key in _card__rspack_import_13)if ([
|
|
483
483
|
"getReferenceChipColors",
|
|
@@ -537,7 +537,7 @@ var __webpack_exports__ = {};
|
|
|
537
537
|
"ReferenceChip"
|
|
538
538
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_citation__rspack_import_18[__rspack_import_key];
|
|
539
539
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
540
|
-
var _code_block__rspack_import_19 = __webpack_require__("
|
|
540
|
+
var _code_block__rspack_import_19 = __webpack_require__("@/components/ui/code-block");
|
|
541
541
|
var __rspack_reexport = {};
|
|
542
542
|
for(const __rspack_import_key in _code_block__rspack_import_19)if ([
|
|
543
543
|
"getReferenceChipColors",
|
|
@@ -547,7 +547,7 @@ var __webpack_exports__ = {};
|
|
|
547
547
|
"ReferenceChip"
|
|
548
548
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_code_block__rspack_import_19[__rspack_import_key];
|
|
549
549
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
550
|
-
var _collapsible__rspack_import_20 = __webpack_require__("
|
|
550
|
+
var _collapsible__rspack_import_20 = __webpack_require__("./collapsible");
|
|
551
551
|
var __rspack_reexport = {};
|
|
552
552
|
for(const __rspack_import_key in _collapsible__rspack_import_20)if ([
|
|
553
553
|
"getReferenceChipColors",
|
|
@@ -657,7 +657,7 @@ var __webpack_exports__ = {};
|
|
|
657
657
|
"ReferenceChip"
|
|
658
658
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_drawer__rspack_import_30[__rspack_import_key];
|
|
659
659
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
660
|
-
var _dropdown_menu__rspack_import_31 = __webpack_require__("
|
|
660
|
+
var _dropdown_menu__rspack_import_31 = __webpack_require__("./dropdown-menu");
|
|
661
661
|
var __rspack_reexport = {};
|
|
662
662
|
for(const __rspack_import_key in _dropdown_menu__rspack_import_31)if ([
|
|
663
663
|
"getReferenceChipColors",
|
|
@@ -677,7 +677,7 @@ var __webpack_exports__ = {};
|
|
|
677
677
|
"ReferenceChip"
|
|
678
678
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_dropzone_overlay__rspack_import_32[__rspack_import_key];
|
|
679
679
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
680
|
-
var _editable_cell__rspack_import_33 = __webpack_require__("
|
|
680
|
+
var _editable_cell__rspack_import_33 = __webpack_require__("./editable-cell");
|
|
681
681
|
var __rspack_reexport = {};
|
|
682
682
|
for(const __rspack_import_key in _editable_cell__rspack_import_33)if ([
|
|
683
683
|
"getReferenceChipColors",
|
|
@@ -767,7 +767,7 @@ var __webpack_exports__ = {};
|
|
|
767
767
|
"ReferenceChip"
|
|
768
768
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_hover_card__rspack_import_41[__rspack_import_key];
|
|
769
769
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
770
|
-
var _info_tooltip__rspack_import_42 = __webpack_require__("
|
|
770
|
+
var _info_tooltip__rspack_import_42 = __webpack_require__("@/components/ui/info-tooltip");
|
|
771
771
|
var __rspack_reexport = {};
|
|
772
772
|
for(const __rspack_import_key in _info_tooltip__rspack_import_42)if ([
|
|
773
773
|
"getReferenceChipColors",
|
|
@@ -777,7 +777,7 @@ var __webpack_exports__ = {};
|
|
|
777
777
|
"ReferenceChip"
|
|
778
778
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_info_tooltip__rspack_import_42[__rspack_import_key];
|
|
779
779
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
780
|
-
var _input__rspack_import_43 = __webpack_require__("
|
|
780
|
+
var _input__rspack_import_43 = __webpack_require__("./input");
|
|
781
781
|
var __rspack_reexport = {};
|
|
782
782
|
for(const __rspack_import_key in _input__rspack_import_43)if ([
|
|
783
783
|
"getReferenceChipColors",
|
|
@@ -807,7 +807,7 @@ var __webpack_exports__ = {};
|
|
|
807
807
|
"ReferenceChip"
|
|
808
808
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_json_tree_view__rspack_import_45[__rspack_import_key];
|
|
809
809
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
810
|
-
var _label__rspack_import_46 = __webpack_require__("
|
|
810
|
+
var _label__rspack_import_46 = __webpack_require__("@/components/ui/label");
|
|
811
811
|
var __rspack_reexport = {};
|
|
812
812
|
for(const __rspack_import_key in _label__rspack_import_46)if ([
|
|
813
813
|
"getReferenceChipColors",
|
|
@@ -1047,7 +1047,7 @@ var __webpack_exports__ = {};
|
|
|
1047
1047
|
"ReferenceChip"
|
|
1048
1048
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_radio_group__rspack_import_69[__rspack_import_key];
|
|
1049
1049
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
1050
|
-
var _reference_chip__rspack_import_70 = __webpack_require__("
|
|
1050
|
+
var _reference_chip__rspack_import_70 = __webpack_require__("./reference-chip");
|
|
1051
1051
|
var _reference_chip_colors__rspack_import_71 = __webpack_require__("./reference-chip-colors");
|
|
1052
1052
|
var _resizable__rspack_import_72 = __webpack_require__("./resizable");
|
|
1053
1053
|
var __rspack_reexport = {};
|
|
@@ -1209,7 +1209,7 @@ var __webpack_exports__ = {};
|
|
|
1209
1209
|
"ReferenceChip"
|
|
1210
1210
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_switch__rspack_import_87[__rspack_import_key];
|
|
1211
1211
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
1212
|
-
var _table__rspack_import_88 = __webpack_require__("
|
|
1212
|
+
var _table__rspack_import_88 = __webpack_require__("./table");
|
|
1213
1213
|
var __rspack_reexport = {};
|
|
1214
1214
|
for(const __rspack_import_key in _table__rspack_import_88)if ([
|
|
1215
1215
|
"getReferenceChipColors",
|
|
@@ -1229,7 +1229,7 @@ var __webpack_exports__ = {};
|
|
|
1229
1229
|
"ReferenceChip"
|
|
1230
1230
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_tabs__rspack_import_89[__rspack_import_key];
|
|
1231
1231
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
1232
|
-
var _textarea__rspack_import_90 = __webpack_require__("
|
|
1232
|
+
var _textarea__rspack_import_90 = __webpack_require__("@/components/ui/textarea");
|
|
1233
1233
|
var __rspack_reexport = {};
|
|
1234
1234
|
for(const __rspack_import_key in _textarea__rspack_import_90)if ([
|
|
1235
1235
|
"getReferenceChipColors",
|
|
@@ -1291,7 +1291,7 @@ var __webpack_exports__ = {};
|
|
|
1291
1291
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
1292
1292
|
var _tree_view__rspack_import_96 = __webpack_require__("./tree-view");
|
|
1293
1293
|
var _tree_view__rspack_import_96_default = /*#__PURE__*/ __webpack_require__.n(_tree_view__rspack_import_96);
|
|
1294
|
-
var _variable_picker__rspack_import_97 = __webpack_require__("
|
|
1294
|
+
var _variable_picker__rspack_import_97 = __webpack_require__("./variable-picker");
|
|
1295
1295
|
var __rspack_reexport = {};
|
|
1296
1296
|
for(const __rspack_import_key in _variable_picker__rspack_import_97)if ([
|
|
1297
1297
|
"getReferenceChipColors",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { QuickFormField } from './quick-form-field';
|
|
2
|
-
export type { QuickFieldType, QuickFormFieldControlProps, QuickFormFieldMode, QuickFormFieldModeSwitchConfirm, QuickFormFieldMoreActions, QuickFormFieldOption, QuickFormFieldProps, QuickFormFieldStrings, VariableInsertContext, } from './types';
|
|
2
|
+
export type { QuickFieldType, QuickFormFieldControlLayout, QuickFormFieldControlProps, QuickFormFieldMode, QuickFormFieldModeSwitchConfirm, QuickFormFieldMoreActions, QuickFormFieldOption, QuickFormFieldProps, QuickFormFieldStrings, VariableInsertContext, } from './types';
|
|
3
3
|
export { DEFAULT_QUICK_FORM_FIELD_STRINGS, FIELD_TYPE_META, FIELD_TYPE_ORDER } from './types';
|
|
@@ -54,7 +54,7 @@ const DEFAULT_VALUE_MODES = [
|
|
|
54
54
|
'literal',
|
|
55
55
|
'expression'
|
|
56
56
|
];
|
|
57
|
-
function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true, onLockedChange, showLock = true, disabled = false, leadingAddon, trailingAddon, more, mode = 'literal', onModeChange, valueModes = DEFAULT_VALUE_MODES, confirmModeChange, renderExpressionEditor, renderModeControl, fieldType = 'string', fieldTypes, onFieldTypeChange, required, onRequiredChange, label, onLabelChange, isEditingLabel, onIsEditingLabelChange, labelAddon, tooltip, strings: stringOverrides, placeholder, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, showFieldActions = true, options = external_utils_cjs_namespaceObject.DEFAULT_SELECT_OPTIONS, onGenerateWithAi, onInsertVariable, variables = [], id, className }) {
|
|
57
|
+
function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true, onLockedChange, showLock = true, disabled = false, leadingAddon, trailingAddon, more, mode = 'literal', onModeChange, valueModes = DEFAULT_VALUE_MODES, confirmModeChange, renderExpressionEditor, renderModeControl, renderedControlLayout, fieldType = 'string', fieldTypes, onFieldTypeChange, required, onRequiredChange, label, onLabelChange, isEditingLabel, onIsEditingLabelChange, labelAddon, tooltip, strings: stringOverrides, placeholder, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, showFieldActions = true, options = external_utils_cjs_namespaceObject.DEFAULT_SELECT_OPTIONS, onGenerateWithAi, onInsertVariable, variables = [], id, className }) {
|
|
58
58
|
const strings = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
59
59
|
...external_types_cjs_namespaceObject.DEFAULT_QUICK_FORM_FIELD_STRINGS,
|
|
60
60
|
...stringOverrides
|
|
@@ -159,6 +159,7 @@ function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true,
|
|
|
159
159
|
const modeControl = renderModeControl?.(mode, controlProps) ?? null;
|
|
160
160
|
const builtInVariable = null === modeControl && 'variable' === mode;
|
|
161
161
|
const builtInPrompt = null === modeControl && 'prompt' === mode;
|
|
162
|
+
const rendersOwnControl = null !== modeControl || 'expression' === mode && !!renderExpressionEditor;
|
|
162
163
|
const modeOnMount = (0, external_react_namespaceObject.useRef)(mode);
|
|
163
164
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
164
165
|
if (modeOnMount.current === mode) return;
|
|
@@ -425,7 +426,7 @@ function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true,
|
|
|
425
426
|
errorId: validationId,
|
|
426
427
|
disabled: disabled,
|
|
427
428
|
variant: builtInPrompt ? 'agent' : void 0,
|
|
428
|
-
layout: builtInPrompt || 'literal' === mode && ('file' === fieldType || 'textarea' === fieldType) ? 'grow' : 'row',
|
|
429
|
+
layout: builtInPrompt || 'literal' === mode && ('file' === fieldType || 'textarea' === fieldType) || rendersOwnControl && renderedControlLayout?.[mode] === 'grow' ? 'grow' : 'row',
|
|
429
430
|
children: [
|
|
430
431
|
(showLock || void 0 !== leadingAddon) && null !== leadingAddon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
431
432
|
align: "inline-start",
|
|
@@ -13,6 +13,7 @@ import type { QuickFormFieldProps } from './types';
|
|
|
13
13
|
* - Every mode has a built-in control: `variable` is a picker over
|
|
14
14
|
* `variables`, `prompt` an agent textarea. `valueModes` chooses which the
|
|
15
15
|
* menu offers, and `renderModeControl` replaces the control for any mode.
|
|
16
|
+
* `renderedControlLayout` lets a rendered control taller than a row grow the box.
|
|
16
17
|
* - `confirmModeChange` asks before a switch the consumer knows is lossy.
|
|
17
18
|
* - `locked` is configuration the author sets, so the value stays editable;
|
|
18
19
|
* `disabled` is what stops the author editing the field.
|
|
@@ -29,4 +30,4 @@ import type { QuickFormFieldProps } from './types';
|
|
|
29
30
|
* AI-assist button renders only with `onGenerateWithAi`, and file uploads
|
|
30
31
|
* aren't persisted anywhere.
|
|
31
32
|
*/
|
|
32
|
-
export declare function QuickFormField({ value, onValueChange, onValueBlur, locked, onLockedChange, showLock, disabled, leadingAddon, trailingAddon, more, mode, onModeChange, valueModes, confirmModeChange, renderExpressionEditor, renderModeControl, fieldType, fieldTypes, onFieldTypeChange, required, onRequiredChange, label, onLabelChange, isEditingLabel, onIsEditingLabelChange, labelAddon, tooltip, strings: stringOverrides, placeholder, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, showFieldActions, options, onGenerateWithAi, onInsertVariable, variables, id, className, }: QuickFormFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare function QuickFormField({ value, onValueChange, onValueBlur, locked, onLockedChange, showLock, disabled, leadingAddon, trailingAddon, more, mode, onModeChange, valueModes, confirmModeChange, renderExpressionEditor, renderModeControl, renderedControlLayout, fieldType, fieldTypes, onFieldTypeChange, required, onRequiredChange, label, onLabelChange, isEditingLabel, onIsEditingLabelChange, labelAddon, tooltip, strings: stringOverrides, placeholder, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, showFieldActions, options, onGenerateWithAi, onInsertVariable, variables, id, className, }: QuickFormFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -26,7 +26,7 @@ const DEFAULT_VALUE_MODES = [
|
|
|
26
26
|
'literal',
|
|
27
27
|
'expression'
|
|
28
28
|
];
|
|
29
|
-
function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true, onLockedChange, showLock = true, disabled = false, leadingAddon, trailingAddon, more, mode = 'literal', onModeChange, valueModes = DEFAULT_VALUE_MODES, confirmModeChange, renderExpressionEditor, renderModeControl, fieldType = 'string', fieldTypes, onFieldTypeChange, required, onRequiredChange, label, onLabelChange, isEditingLabel, onIsEditingLabelChange, labelAddon, tooltip, strings: stringOverrides, placeholder, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, showFieldActions = true, options = DEFAULT_SELECT_OPTIONS, onGenerateWithAi, onInsertVariable, variables = [], id, className }) {
|
|
29
|
+
function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true, onLockedChange, showLock = true, disabled = false, leadingAddon, trailingAddon, more, mode = 'literal', onModeChange, valueModes = DEFAULT_VALUE_MODES, confirmModeChange, renderExpressionEditor, renderModeControl, renderedControlLayout, fieldType = 'string', fieldTypes, onFieldTypeChange, required, onRequiredChange, label, onLabelChange, isEditingLabel, onIsEditingLabelChange, labelAddon, tooltip, strings: stringOverrides, placeholder, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, showFieldActions = true, options = DEFAULT_SELECT_OPTIONS, onGenerateWithAi, onInsertVariable, variables = [], id, className }) {
|
|
30
30
|
const strings = useMemo(()=>({
|
|
31
31
|
...DEFAULT_QUICK_FORM_FIELD_STRINGS,
|
|
32
32
|
...stringOverrides
|
|
@@ -131,6 +131,7 @@ function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true,
|
|
|
131
131
|
const modeControl = renderModeControl?.(mode, controlProps) ?? null;
|
|
132
132
|
const builtInVariable = null === modeControl && 'variable' === mode;
|
|
133
133
|
const builtInPrompt = null === modeControl && 'prompt' === mode;
|
|
134
|
+
const rendersOwnControl = null !== modeControl || 'expression' === mode && !!renderExpressionEditor;
|
|
134
135
|
const modeOnMount = useRef(mode);
|
|
135
136
|
useEffect(()=>{
|
|
136
137
|
if (modeOnMount.current === mode) return;
|
|
@@ -397,7 +398,7 @@ function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true,
|
|
|
397
398
|
errorId: validationId,
|
|
398
399
|
disabled: disabled,
|
|
399
400
|
variant: builtInPrompt ? 'agent' : void 0,
|
|
400
|
-
layout: builtInPrompt || 'literal' === mode && ('file' === fieldType || 'textarea' === fieldType) ? 'grow' : 'row',
|
|
401
|
+
layout: builtInPrompt || 'literal' === mode && ('file' === fieldType || 'textarea' === fieldType) || rendersOwnControl && renderedControlLayout?.[mode] === 'grow' ? 'grow' : 'row',
|
|
401
402
|
children: [
|
|
402
403
|
(showLock || void 0 !== leadingAddon) && null !== leadingAddon && /*#__PURE__*/ jsx(InputGroupAddon, {
|
|
403
404
|
align: "inline-start",
|
|
@@ -128,6 +128,8 @@ export interface VariableInsertContext {
|
|
|
128
128
|
end: number;
|
|
129
129
|
} | null;
|
|
130
130
|
}
|
|
131
|
+
/** How the value box sizes around a consumer-rendered control. See `renderedControlLayout`. */
|
|
132
|
+
export type QuickFormFieldControlLayout = 'row' | 'grow';
|
|
131
133
|
/** What a consumer-rendered value control receives from `renderModeControl` or `renderExpressionEditor`. */
|
|
132
134
|
export interface QuickFormFieldControlProps {
|
|
133
135
|
id: string;
|
|
@@ -204,6 +206,15 @@ export interface QuickFormFieldProps {
|
|
|
204
206
|
* returns something for `expression`.
|
|
205
207
|
*/
|
|
206
208
|
renderExpressionEditor?: (props: QuickFormFieldControlProps) => ReactNode;
|
|
209
|
+
/**
|
|
210
|
+
* How the value box sizes around a control you render, per mode: one from
|
|
211
|
+
* `renderModeControl`, or from `renderExpressionEditor` in `expression`.
|
|
212
|
+
* `grow` lets a control taller than one row, such as a multi-line editor,
|
|
213
|
+
* grow the box, with the addons staying on its first line. Only the consumer
|
|
214
|
+
* knows whether its control grows. Unlisted modes and the built-in controls
|
|
215
|
+
* keep their own sizing.
|
|
216
|
+
*/
|
|
217
|
+
renderedControlLayout?: Partial<Record<QuickFormFieldMode, QuickFormFieldControlLayout>>;
|
|
207
218
|
/**
|
|
208
219
|
* Renders the value control for a given mode, replacing the built-in one,
|
|
209
220
|
* such as a surface that authors its own choices in `literal` mode.
|
package/dist/index.d.ts
CHANGED
|
@@ -149,7 +149,7 @@ export type { PromptSuggestionItem, PromptSuggestionsDensity, PromptSuggestionsO
|
|
|
149
149
|
export { DEFAULT_PROMPT_SUGGESTIONS_STRINGS, PromptSuggestions, promptSuggestionsListVariants, promptSuggestionVariants, } from './components/ui/prompt-suggestions';
|
|
150
150
|
export type { PromptValueControlProps } from './components/ui/prompt-value-control';
|
|
151
151
|
export { PromptValueControl } from './components/ui/prompt-value-control';
|
|
152
|
-
export type { QuickFieldType, QuickFormFieldControlProps, QuickFormFieldMode, QuickFormFieldModeSwitchConfirm, QuickFormFieldMoreActions, QuickFormFieldOption, QuickFormFieldProps, QuickFormFieldStrings, VariableInsertContext, } from './components/ui/quick-form-field';
|
|
152
|
+
export type { QuickFieldType, QuickFormFieldControlLayout, QuickFormFieldControlProps, QuickFormFieldMode, QuickFormFieldModeSwitchConfirm, QuickFormFieldMoreActions, QuickFormFieldOption, QuickFormFieldProps, QuickFormFieldStrings, VariableInsertContext, } from './components/ui/quick-form-field';
|
|
153
153
|
export { DEFAULT_QUICK_FORM_FIELD_STRINGS, FIELD_TYPE_META, FIELD_TYPE_ORDER, QuickFormField, } from './components/ui/quick-form-field';
|
|
154
154
|
export { RadioGroup, RadioGroupItem } from './components/ui/radio-group';
|
|
155
155
|
export { ReferenceChip, type ReferenceChipProps } from './components/ui/reference-chip';
|