@uipath/apollo-wind 2.56.0 → 2.57.1
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/alert-dialog.cjs +7 -6
- package/dist/components/ui/alert-dialog.js +7 -6
- package/dist/components/ui/code-editors.shared.cjs +323 -0
- package/dist/components/ui/code-editors.shared.d.ts +936 -0
- package/dist/components/ui/code-editors.shared.js +264 -0
- package/dist/components/ui/combobox.cjs +33 -15
- package/dist/components/ui/combobox.js +33 -15
- package/dist/components/ui/date-picker.cjs +62 -26
- package/dist/components/ui/date-picker.js +62 -26
- package/dist/components/ui/datetime-picker.cjs +29 -12
- package/dist/components/ui/datetime-picker.js +29 -12
- package/dist/components/ui/dialog.cjs +2 -1
- package/dist/components/ui/dialog.js +2 -1
- package/dist/components/ui/dropdown-menu.cjs +12 -8
- package/dist/components/ui/dropdown-menu.js +12 -8
- package/dist/components/ui/field-actions/ai-assist-action.cjs +121 -0
- package/dist/components/ui/field-actions/ai-assist-action.d.ts +21 -0
- package/dist/components/ui/field-actions/ai-assist-action.js +84 -0
- package/dist/components/ui/field-actions/collapse.cjs +44 -0
- package/dist/components/ui/field-actions/collapse.d.ts +6 -0
- package/dist/components/ui/field-actions/collapse.js +4 -0
- package/dist/components/ui/field-actions/index.cjs +46 -0
- package/dist/components/ui/field-actions/index.d.ts +2 -0
- package/dist/components/ui/field-actions/index.js +3 -0
- package/dist/components/ui/field-actions/insert-variable-action.cjs +94 -0
- package/dist/components/ui/field-actions/insert-variable-action.d.ts +22 -0
- package/dist/components/ui/field-actions/insert-variable-action.js +57 -0
- package/dist/components/ui/field-addons/index.cjs +50 -0
- package/dist/components/ui/field-addons/index.d.ts +3 -0
- package/dist/components/ui/field-addons/index.js +4 -0
- package/dist/components/ui/field-addons/value-mode-indicator.cjs +57 -0
- package/dist/components/ui/field-addons/value-mode-indicator.d.ts +13 -0
- package/dist/components/ui/field-addons/value-mode-indicator.js +23 -0
- package/dist/components/ui/field-addons/value-mode-menu.cjs +149 -0
- package/dist/components/ui/field-addons/value-mode-menu.d.ts +69 -0
- package/dist/components/ui/field-addons/value-mode-menu.js +112 -0
- package/dist/components/ui/field-addons/value-mode-strings.cjs +69 -0
- package/dist/components/ui/field-addons/value-mode-strings.d.ts +32 -0
- package/dist/components/ui/field-addons/value-mode-strings.js +29 -0
- package/dist/components/ui/form-field.cjs +42 -5
- package/dist/components/ui/form-field.d.ts +21 -1
- package/dist/components/ui/form-field.js +36 -2
- package/dist/components/ui/index.cjs +150 -130
- package/dist/components/ui/index.d.ts +2 -0
- package/dist/components/ui/index.js +2 -0
- package/dist/components/ui/input-group-context.cjs +91 -0
- package/dist/components/ui/input-group-context.d.ts +69 -0
- package/dist/components/ui/input-group-context.js +42 -0
- package/dist/components/ui/input-group.cjs +303 -56
- package/dist/components/ui/input-group.d.ts +70 -3
- package/dist/components/ui/input-group.js +285 -56
- package/dist/components/ui/input.cjs +28 -17
- package/dist/components/ui/input.js +28 -17
- package/dist/components/ui/lockable-value-field/components/field-header.cjs +16 -114
- package/dist/components/ui/lockable-value-field/components/field-header.js +14 -112
- package/dist/components/ui/lockable-value-field/lockable-value-field.cjs +4 -12
- package/dist/components/ui/lockable-value-field/lockable-value-field.js +4 -12
- package/dist/components/ui/multi-select.cjs +82 -58
- package/dist/components/ui/multi-select.js +84 -60
- package/dist/components/ui/popover.cjs +13 -9
- package/dist/components/ui/popover.js +13 -9
- package/dist/components/ui/select.cjs +89 -27
- package/dist/components/ui/select.d.ts +4 -0
- package/dist/components/ui/select.js +90 -28
- package/dist/components/ui/textarea.cjs +16 -11
- package/dist/components/ui/textarea.js +16 -11
- package/dist/index.cjs +61 -11
- package/dist/index.d.ts +8 -4
- package/dist/index.js +5 -3
- package/dist/lib/dialog-surface.cjs +36 -0
- package/dist/lib/dialog-surface.d.ts +1 -0
- package/dist/lib/dialog-surface.js +2 -0
- package/dist/styles.css +249 -14
- package/package.json +1 -1
- package/dist/components/ui/lockable-value-field/components/mode-menu-item.cjs +0 -63
- package/dist/components/ui/lockable-value-field/components/mode-menu-item.d.ts +0 -9
- package/dist/components/ui/lockable-value-field/components/mode-menu-item.js +0 -29
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Sparkles } from "lucide-react";
|
|
3
|
+
import { useId, useState } from "react";
|
|
4
|
+
import { Button } from "../button.js";
|
|
5
|
+
import { Label } from "../label.js";
|
|
6
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../popover.js";
|
|
7
|
+
import { Textarea } from "../textarea.js";
|
|
8
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../tooltip.js";
|
|
9
|
+
const DEFAULT_AI_ASSIST_ACTION_STRINGS = {
|
|
10
|
+
trigger: 'AI assist',
|
|
11
|
+
tooltip: 'Generate with AI',
|
|
12
|
+
prompt: 'Describe what you want',
|
|
13
|
+
promptPlaceholder: 'Display a value from the previous step',
|
|
14
|
+
generate: 'Generate'
|
|
15
|
+
};
|
|
16
|
+
function AiAssistAction({ onGenerate, hint, strings }) {
|
|
17
|
+
const promptId = useId();
|
|
18
|
+
const [prompt, setPrompt] = useState('');
|
|
19
|
+
const text = {
|
|
20
|
+
...DEFAULT_AI_ASSIST_ACTION_STRINGS,
|
|
21
|
+
...strings
|
|
22
|
+
};
|
|
23
|
+
return /*#__PURE__*/ jsxs(Popover, {
|
|
24
|
+
children: [
|
|
25
|
+
/*#__PURE__*/ jsxs(Tooltip, {
|
|
26
|
+
children: [
|
|
27
|
+
/*#__PURE__*/ jsx(TooltipTrigger, {
|
|
28
|
+
asChild: true,
|
|
29
|
+
children: /*#__PURE__*/ jsx(PopoverTrigger, {
|
|
30
|
+
asChild: true,
|
|
31
|
+
children: /*#__PURE__*/ jsx("button", {
|
|
32
|
+
type: "button",
|
|
33
|
+
"aria-label": text.trigger,
|
|
34
|
+
className: "grid size-7 place-items-center rounded-lg text-foreground-subtle transition hover:bg-surface-overlay hover:text-foreground",
|
|
35
|
+
children: /*#__PURE__*/ jsx(Sparkles, {
|
|
36
|
+
size: 12
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
})
|
|
40
|
+
}),
|
|
41
|
+
/*#__PURE__*/ jsx(TooltipContent, {
|
|
42
|
+
children: text.tooltip
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
}),
|
|
46
|
+
/*#__PURE__*/ jsxs(PopoverContent, {
|
|
47
|
+
align: "end",
|
|
48
|
+
className: "space-y-3",
|
|
49
|
+
children: [
|
|
50
|
+
/*#__PURE__*/ jsxs("div", {
|
|
51
|
+
className: "space-y-1.5",
|
|
52
|
+
children: [
|
|
53
|
+
/*#__PURE__*/ jsx(Label, {
|
|
54
|
+
htmlFor: promptId,
|
|
55
|
+
className: "text-xs font-medium text-foreground-muted",
|
|
56
|
+
children: text.prompt
|
|
57
|
+
}),
|
|
58
|
+
/*#__PURE__*/ jsx(Textarea, {
|
|
59
|
+
id: promptId,
|
|
60
|
+
rows: 3,
|
|
61
|
+
value: prompt,
|
|
62
|
+
onChange: (e)=>setPrompt(e.target.value),
|
|
63
|
+
placeholder: text.promptPlaceholder,
|
|
64
|
+
className: "resize-none text-sm"
|
|
65
|
+
})
|
|
66
|
+
]
|
|
67
|
+
}),
|
|
68
|
+
hint && /*#__PURE__*/ jsx("span", {
|
|
69
|
+
className: "block text-[11px] text-foreground-subtle",
|
|
70
|
+
children: hint
|
|
71
|
+
}),
|
|
72
|
+
/*#__PURE__*/ jsx(Button, {
|
|
73
|
+
size: "sm",
|
|
74
|
+
className: "w-full",
|
|
75
|
+
disabled: !onGenerate,
|
|
76
|
+
onClick: ()=>onGenerate?.(prompt),
|
|
77
|
+
children: text.generate
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
})
|
|
81
|
+
]
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
export { AiAssistAction, DEFAULT_AI_ASSIST_ACTION_STRINGS };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
COLLAPSED_HIDDEN: ()=>COLLAPSED_HIDDEN,
|
|
28
|
+
COLLAPSED_ICON_PADDING: ()=>COLLAPSED_ICON_PADDING,
|
|
29
|
+
COLLAPSED_ONLY: ()=>COLLAPSED_ONLY
|
|
30
|
+
});
|
|
31
|
+
const COLLAPSED_HIDDEN = '@max-[259px]:hidden';
|
|
32
|
+
const COLLAPSED_ICON_PADDING = '@max-[259px]:px-1.5';
|
|
33
|
+
const COLLAPSED_ONLY = 'hidden @max-[259px]:block';
|
|
34
|
+
exports.COLLAPSED_HIDDEN = __webpack_exports__.COLLAPSED_HIDDEN;
|
|
35
|
+
exports.COLLAPSED_ICON_PADDING = __webpack_exports__.COLLAPSED_ICON_PADDING;
|
|
36
|
+
exports.COLLAPSED_ONLY = __webpack_exports__.COLLAPSED_ONLY;
|
|
37
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
38
|
+
"COLLAPSED_HIDDEN",
|
|
39
|
+
"COLLAPSED_ICON_PADDING",
|
|
40
|
+
"COLLAPSED_ONLY"
|
|
41
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
42
|
+
Object.defineProperty(exports, '__esModule', {
|
|
43
|
+
value: true
|
|
44
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Hidden once collapsed, such as an action's text. */
|
|
2
|
+
export declare const COLLAPSED_HIDDEN = "@max-[259px]:hidden";
|
|
3
|
+
/** The tighter padding of an action collapsed to its icon. */
|
|
4
|
+
export declare const COLLAPSED_ICON_PADDING = "@max-[259px]:px-1.5";
|
|
5
|
+
/** Shown only once collapsed. */
|
|
6
|
+
export declare const COLLAPSED_ONLY = "hidden @max-[259px]:block";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
AiAssistAction: ()=>external_ai_assist_action_cjs_namespaceObject.AiAssistAction,
|
|
28
|
+
DEFAULT_AI_ASSIST_ACTION_STRINGS: ()=>external_ai_assist_action_cjs_namespaceObject.DEFAULT_AI_ASSIST_ACTION_STRINGS,
|
|
29
|
+
DEFAULT_INSERT_VARIABLE_ACTION_STRINGS: ()=>external_insert_variable_action_cjs_namespaceObject.DEFAULT_INSERT_VARIABLE_ACTION_STRINGS,
|
|
30
|
+
InsertVariableAction: ()=>external_insert_variable_action_cjs_namespaceObject.InsertVariableAction
|
|
31
|
+
});
|
|
32
|
+
const external_ai_assist_action_cjs_namespaceObject = require("./ai-assist-action.cjs");
|
|
33
|
+
const external_insert_variable_action_cjs_namespaceObject = require("./insert-variable-action.cjs");
|
|
34
|
+
exports.AiAssistAction = __webpack_exports__.AiAssistAction;
|
|
35
|
+
exports.DEFAULT_AI_ASSIST_ACTION_STRINGS = __webpack_exports__.DEFAULT_AI_ASSIST_ACTION_STRINGS;
|
|
36
|
+
exports.DEFAULT_INSERT_VARIABLE_ACTION_STRINGS = __webpack_exports__.DEFAULT_INSERT_VARIABLE_ACTION_STRINGS;
|
|
37
|
+
exports.InsertVariableAction = __webpack_exports__.InsertVariableAction;
|
|
38
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
39
|
+
"AiAssistAction",
|
|
40
|
+
"DEFAULT_AI_ASSIST_ACTION_STRINGS",
|
|
41
|
+
"DEFAULT_INSERT_VARIABLE_ACTION_STRINGS",
|
|
42
|
+
"InsertVariableAction"
|
|
43
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
44
|
+
Object.defineProperty(exports, '__esModule', {
|
|
45
|
+
value: true
|
|
46
|
+
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { AiAssistAction, type AiAssistActionProps, type AiAssistActionStrings, DEFAULT_AI_ASSIST_ACTION_STRINGS, } from './ai-assist-action';
|
|
2
|
+
export { DEFAULT_INSERT_VARIABLE_ACTION_STRINGS, InsertVariableAction, type InsertVariableActionProps, type InsertVariableActionStrings, } from './insert-variable-action';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AiAssistAction, DEFAULT_AI_ASSIST_ACTION_STRINGS } from "./ai-assist-action.js";
|
|
2
|
+
import { DEFAULT_INSERT_VARIABLE_ACTION_STRINGS, InsertVariableAction } from "./insert-variable-action.js";
|
|
3
|
+
export { AiAssistAction, DEFAULT_AI_ASSIST_ACTION_STRINGS, DEFAULT_INSERT_VARIABLE_ACTION_STRINGS, InsertVariableAction };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
DEFAULT_INSERT_VARIABLE_ACTION_STRINGS: ()=>DEFAULT_INSERT_VARIABLE_ACTION_STRINGS,
|
|
28
|
+
InsertVariableAction: ()=>InsertVariableAction
|
|
29
|
+
});
|
|
30
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
32
|
+
const index_cjs_namespaceObject = require("../variable-picker/index.cjs");
|
|
33
|
+
const external_lib_index_cjs_namespaceObject = require("../../../lib/index.cjs");
|
|
34
|
+
const external_collapse_cjs_namespaceObject = require("./collapse.cjs");
|
|
35
|
+
const DEFAULT_INSERT_VARIABLE_ACTION_STRINGS = {
|
|
36
|
+
label: 'Insert',
|
|
37
|
+
ariaLabel: 'Insert variable'
|
|
38
|
+
};
|
|
39
|
+
function InsertVariableAction({ variables, onInsert, disabled, compact, strings }) {
|
|
40
|
+
const text = {
|
|
41
|
+
...DEFAULT_INSERT_VARIABLE_ACTION_STRINGS,
|
|
42
|
+
...strings
|
|
43
|
+
};
|
|
44
|
+
const inert = disabled || 0 === variables.length || !onInsert;
|
|
45
|
+
const collapsedTextClass = (0, external_lib_index_cjs_namespaceObject.cn)(external_collapse_cjs_namespaceObject.COLLAPSED_HIDDEN, compact && '!hidden');
|
|
46
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.VariablePicker, {
|
|
47
|
+
disabled: inert,
|
|
48
|
+
items: [
|
|
49
|
+
{
|
|
50
|
+
id: 'vars',
|
|
51
|
+
label: '$vars',
|
|
52
|
+
type: 'object',
|
|
53
|
+
children: variables.map((variable)=>({
|
|
54
|
+
id: variable.value,
|
|
55
|
+
label: variable.label,
|
|
56
|
+
value: variable.value,
|
|
57
|
+
type: 'string'
|
|
58
|
+
}))
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
onSelect: (variable)=>{
|
|
62
|
+
if (variable.value) onInsert?.(variable.value);
|
|
63
|
+
},
|
|
64
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("button", {
|
|
65
|
+
type: "button",
|
|
66
|
+
"aria-label": text.ariaLabel,
|
|
67
|
+
title: text.ariaLabel,
|
|
68
|
+
disabled: inert,
|
|
69
|
+
className: (0, external_lib_index_cjs_namespaceObject.cn)('flex h-7 items-center gap-1 rounded-lg px-2 text-[11px] text-foreground-subtle transition hover:bg-surface-overlay hover:text-foreground disabled:pointer-events-none disabled:opacity-50', external_collapse_cjs_namespaceObject.COLLAPSED_ICON_PADDING, compact && '!px-1.5'),
|
|
70
|
+
children: [
|
|
71
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Braces, {
|
|
72
|
+
size: 12
|
|
73
|
+
}),
|
|
74
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
75
|
+
className: collapsedTextClass,
|
|
76
|
+
children: text.label
|
|
77
|
+
}),
|
|
78
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDown, {
|
|
79
|
+
size: 9,
|
|
80
|
+
className: collapsedTextClass
|
|
81
|
+
})
|
|
82
|
+
]
|
|
83
|
+
})
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
exports.DEFAULT_INSERT_VARIABLE_ACTION_STRINGS = __webpack_exports__.DEFAULT_INSERT_VARIABLE_ACTION_STRINGS;
|
|
87
|
+
exports.InsertVariableAction = __webpack_exports__.InsertVariableAction;
|
|
88
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
89
|
+
"DEFAULT_INSERT_VARIABLE_ACTION_STRINGS",
|
|
90
|
+
"InsertVariableAction"
|
|
91
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
92
|
+
Object.defineProperty(exports, '__esModule', {
|
|
93
|
+
value: true
|
|
94
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface InsertVariableActionStrings {
|
|
2
|
+
/** Visible text, hidden when the action collapses to its icon. */
|
|
3
|
+
label: string;
|
|
4
|
+
/** Accessible name and hover title. */
|
|
5
|
+
ariaLabel: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const DEFAULT_INSERT_VARIABLE_ACTION_STRINGS: InsertVariableActionStrings;
|
|
8
|
+
export interface InsertVariableActionProps {
|
|
9
|
+
variables: {
|
|
10
|
+
label: string;
|
|
11
|
+
value: string;
|
|
12
|
+
}[];
|
|
13
|
+
/** Called with the picked variable's value. Omitted, the action is disabled. */
|
|
14
|
+
onInsert?: (value: string) => void;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Icon only. Below a 260px `@container` the action also collapses to its icon by itself. */
|
|
17
|
+
compact?: boolean;
|
|
18
|
+
/** Overrides for any subset of the English strings. */
|
|
19
|
+
strings?: Partial<InsertVariableActionStrings>;
|
|
20
|
+
}
|
|
21
|
+
/** The Insert-variable header action: opens a variable picker and reports the pick. */
|
|
22
|
+
export declare function InsertVariableAction({ variables, onInsert, disabled, compact, strings, }: InsertVariableActionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Braces, ChevronDown } from "lucide-react";
|
|
3
|
+
import { VariablePicker } from "../variable-picker/index.js";
|
|
4
|
+
import { cn } from "../../../lib/index.js";
|
|
5
|
+
import { COLLAPSED_HIDDEN, COLLAPSED_ICON_PADDING } from "./collapse.js";
|
|
6
|
+
const DEFAULT_INSERT_VARIABLE_ACTION_STRINGS = {
|
|
7
|
+
label: 'Insert',
|
|
8
|
+
ariaLabel: 'Insert variable'
|
|
9
|
+
};
|
|
10
|
+
function InsertVariableAction({ variables, onInsert, disabled, compact, strings }) {
|
|
11
|
+
const text = {
|
|
12
|
+
...DEFAULT_INSERT_VARIABLE_ACTION_STRINGS,
|
|
13
|
+
...strings
|
|
14
|
+
};
|
|
15
|
+
const inert = disabled || 0 === variables.length || !onInsert;
|
|
16
|
+
const collapsedTextClass = cn(COLLAPSED_HIDDEN, compact && '!hidden');
|
|
17
|
+
return /*#__PURE__*/ jsx(VariablePicker, {
|
|
18
|
+
disabled: inert,
|
|
19
|
+
items: [
|
|
20
|
+
{
|
|
21
|
+
id: 'vars',
|
|
22
|
+
label: '$vars',
|
|
23
|
+
type: 'object',
|
|
24
|
+
children: variables.map((variable)=>({
|
|
25
|
+
id: variable.value,
|
|
26
|
+
label: variable.label,
|
|
27
|
+
value: variable.value,
|
|
28
|
+
type: 'string'
|
|
29
|
+
}))
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
onSelect: (variable)=>{
|
|
33
|
+
if (variable.value) onInsert?.(variable.value);
|
|
34
|
+
},
|
|
35
|
+
children: /*#__PURE__*/ jsxs("button", {
|
|
36
|
+
type: "button",
|
|
37
|
+
"aria-label": text.ariaLabel,
|
|
38
|
+
title: text.ariaLabel,
|
|
39
|
+
disabled: inert,
|
|
40
|
+
className: cn('flex h-7 items-center gap-1 rounded-lg px-2 text-[11px] text-foreground-subtle transition hover:bg-surface-overlay hover:text-foreground disabled:pointer-events-none disabled:opacity-50', COLLAPSED_ICON_PADDING, compact && '!px-1.5'),
|
|
41
|
+
children: [
|
|
42
|
+
/*#__PURE__*/ jsx(Braces, {
|
|
43
|
+
size: 12
|
|
44
|
+
}),
|
|
45
|
+
/*#__PURE__*/ jsx("span", {
|
|
46
|
+
className: collapsedTextClass,
|
|
47
|
+
children: text.label
|
|
48
|
+
}),
|
|
49
|
+
/*#__PURE__*/ jsx(ChevronDown, {
|
|
50
|
+
size: 9,
|
|
51
|
+
className: collapsedTextClass
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
export { DEFAULT_INSERT_VARIABLE_ACTION_STRINGS, InsertVariableAction };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
useValueModeStrings: ()=>external_value_mode_strings_cjs_namespaceObject.useValueModeStrings,
|
|
28
|
+
DEFAULT_VALUE_MODE_STRINGS: ()=>external_value_mode_strings_cjs_namespaceObject.DEFAULT_VALUE_MODE_STRINGS,
|
|
29
|
+
ValueModeIndicator: ()=>external_value_mode_indicator_cjs_namespaceObject.ValueModeIndicator,
|
|
30
|
+
ValueModeMenu: ()=>external_value_mode_menu_cjs_namespaceObject.ValueModeMenu,
|
|
31
|
+
ValueModeStringsProvider: ()=>external_value_mode_strings_cjs_namespaceObject.ValueModeStringsProvider
|
|
32
|
+
});
|
|
33
|
+
const external_value_mode_indicator_cjs_namespaceObject = require("./value-mode-indicator.cjs");
|
|
34
|
+
const external_value_mode_menu_cjs_namespaceObject = require("./value-mode-menu.cjs");
|
|
35
|
+
const external_value_mode_strings_cjs_namespaceObject = require("./value-mode-strings.cjs");
|
|
36
|
+
exports.DEFAULT_VALUE_MODE_STRINGS = __webpack_exports__.DEFAULT_VALUE_MODE_STRINGS;
|
|
37
|
+
exports.ValueModeIndicator = __webpack_exports__.ValueModeIndicator;
|
|
38
|
+
exports.ValueModeMenu = __webpack_exports__.ValueModeMenu;
|
|
39
|
+
exports.ValueModeStringsProvider = __webpack_exports__.ValueModeStringsProvider;
|
|
40
|
+
exports.useValueModeStrings = __webpack_exports__.useValueModeStrings;
|
|
41
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
42
|
+
"DEFAULT_VALUE_MODE_STRINGS",
|
|
43
|
+
"ValueModeIndicator",
|
|
44
|
+
"ValueModeMenu",
|
|
45
|
+
"ValueModeStringsProvider",
|
|
46
|
+
"useValueModeStrings"
|
|
47
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
48
|
+
Object.defineProperty(exports, '__esModule', {
|
|
49
|
+
value: true
|
|
50
|
+
});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ValueModeIndicator, type ValueModeIndicatorProps } from './value-mode-indicator';
|
|
2
|
+
export { ValueModeMenu, type ValueModeMenuAction, type ValueModeMenuProps, type ValueModeOption, } from './value-mode-menu';
|
|
3
|
+
export { DEFAULT_VALUE_MODE_STRINGS, useValueModeStrings, type ValueMode, type ValueModeStrings, ValueModeStringsProvider, type ValueModeStringsProviderProps, } from './value-mode-strings';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ValueModeIndicator } from "./value-mode-indicator.js";
|
|
2
|
+
import { ValueModeMenu } from "./value-mode-menu.js";
|
|
3
|
+
import { DEFAULT_VALUE_MODE_STRINGS, ValueModeStringsProvider, useValueModeStrings } from "./value-mode-strings.js";
|
|
4
|
+
export { DEFAULT_VALUE_MODE_STRINGS, ValueModeIndicator, ValueModeMenu, ValueModeStringsProvider, useValueModeStrings };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
ValueModeIndicator: ()=>ValueModeIndicator
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const external_react_namespaceObject = require("react");
|
|
31
|
+
const index_cjs_namespaceObject = require("../../../lib/index.cjs");
|
|
32
|
+
const external_value_mode_strings_cjs_namespaceObject = require("./value-mode-strings.cjs");
|
|
33
|
+
const ValueModeIndicator = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ mode, disabled, className, ...props }, ref)=>{
|
|
34
|
+
const strings = (0, external_value_mode_strings_cjs_namespaceObject.useValueModeStrings)();
|
|
35
|
+
if ('expression' !== mode) return null;
|
|
36
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
37
|
+
ref: ref,
|
|
38
|
+
"data-slot": "value-mode-indicator",
|
|
39
|
+
role: "img",
|
|
40
|
+
"aria-label": strings.expressionIndicator,
|
|
41
|
+
title: strings.expressionIndicator,
|
|
42
|
+
className: (0, index_cjs_namespaceObject.cn)('flex items-center justify-center px-2 font-mono text-sm font-medium text-muted-foreground', disabled && 'opacity-50', className),
|
|
43
|
+
...props,
|
|
44
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
45
|
+
"aria-hidden": "true",
|
|
46
|
+
children: "="
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
ValueModeIndicator.displayName = 'ValueModeIndicator';
|
|
51
|
+
exports.ValueModeIndicator = __webpack_exports__.ValueModeIndicator;
|
|
52
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
53
|
+
"ValueModeIndicator"
|
|
54
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
55
|
+
Object.defineProperty(exports, '__esModule', {
|
|
56
|
+
value: true
|
|
57
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ValueMode } from './value-mode-strings';
|
|
3
|
+
export interface ValueModeIndicatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
mode: ValueMode;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The `=` ahead of an expression value. Renders nothing in literal mode: its absence is the signal
|
|
9
|
+
* that the value is plain text. `className` takes alignment overrides, such as nudging the glyph
|
|
10
|
+
* onto the first line of a growable editor.
|
|
11
|
+
*/
|
|
12
|
+
declare const ValueModeIndicator: React.ForwardRefExoticComponent<ValueModeIndicatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export { ValueModeIndicator };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { cn } from "../../../lib/index.js";
|
|
4
|
+
import { useValueModeStrings } from "./value-mode-strings.js";
|
|
5
|
+
const ValueModeIndicator = /*#__PURE__*/ forwardRef(({ mode, disabled, className, ...props }, ref)=>{
|
|
6
|
+
const strings = useValueModeStrings();
|
|
7
|
+
if ('expression' !== mode) return null;
|
|
8
|
+
return /*#__PURE__*/ jsx("div", {
|
|
9
|
+
ref: ref,
|
|
10
|
+
"data-slot": "value-mode-indicator",
|
|
11
|
+
role: "img",
|
|
12
|
+
"aria-label": strings.expressionIndicator,
|
|
13
|
+
title: strings.expressionIndicator,
|
|
14
|
+
className: cn('flex items-center justify-center px-2 font-mono text-sm font-medium text-muted-foreground', disabled && 'opacity-50', className),
|
|
15
|
+
...props,
|
|
16
|
+
children: /*#__PURE__*/ jsx("span", {
|
|
17
|
+
"aria-hidden": "true",
|
|
18
|
+
children: "="
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
ValueModeIndicator.displayName = 'ValueModeIndicator';
|
|
23
|
+
export { ValueModeIndicator };
|