@mieweb/ui 0.8.0-dev.17 → 0.8.0-dev.19
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/{chunk-V3YV2FYF.js → chunk-PDS7OM73.js} +28 -3
- package/dist/chunk-PDS7OM73.js.map +1 -0
- package/dist/{chunk-YERA6RNG.cjs → chunk-VIE7UI2R.cjs} +28 -3
- package/dist/chunk-VIE7UI2R.cjs.map +1 -0
- package/dist/index.cjs +305 -255
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -5
- package/dist/index.d.ts +34 -5
- package/dist/index.js +303 -253
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind-preset.cjs +4 -4
- package/dist/tailwind-preset.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-V3YV2FYF.js.map +0 -1
- package/dist/chunk-YERA6RNG.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -64,7 +64,7 @@ var chunk7AECNMYV_cjs = require('./chunk-7AECNMYV.cjs');
|
|
|
64
64
|
var chunkN5O47VGS_cjs = require('./chunk-N5O47VGS.cjs');
|
|
65
65
|
var chunkX4LBUPJO_cjs = require('./chunk-X4LBUPJO.cjs');
|
|
66
66
|
var chunkIUDY6S7I_cjs = require('./chunk-IUDY6S7I.cjs');
|
|
67
|
-
var
|
|
67
|
+
var chunkVIE7UI2R_cjs = require('./chunk-VIE7UI2R.cjs');
|
|
68
68
|
var chunkVROIMIHB_cjs = require('./chunk-VROIMIHB.cjs');
|
|
69
69
|
var chunkNYJIXR4Y_cjs = require('./chunk-NYJIXR4Y.cjs');
|
|
70
70
|
var chunk64SSWBJN_cjs = require('./chunk-64SSWBJN.cjs');
|
|
@@ -12504,6 +12504,9 @@ var ChatComposer = React13__namespace.forwardRef(function ChatComposer2({
|
|
|
12504
12504
|
autoFocus = false,
|
|
12505
12505
|
maxLength,
|
|
12506
12506
|
showCharacterCount = false,
|
|
12507
|
+
canSendWhenEmpty = false,
|
|
12508
|
+
maxHeight = MAX_INPUT_HEIGHT,
|
|
12509
|
+
textareaProps,
|
|
12507
12510
|
addMenuItems,
|
|
12508
12511
|
allowAttachments = true,
|
|
12509
12512
|
acceptedFileTypes,
|
|
@@ -12549,7 +12552,7 @@ var ChatComposer = React13__namespace.forwardRef(function ChatComposer2({
|
|
|
12549
12552
|
const hasText = value.trim().length > 0;
|
|
12550
12553
|
const hasContent = hasText || attachments.length > 0;
|
|
12551
12554
|
const isOverLimit = maxLength !== void 0 && value.length > maxLength;
|
|
12552
|
-
const canSend = hasContent && onSend !== void 0 && !disabled && !isSending && !isStreaming && !isOverLimit;
|
|
12555
|
+
const canSend = (hasContent || canSendWhenEmpty) && onSend !== void 0 && !disabled && !isSending && !isStreaming && !isOverLimit;
|
|
12553
12556
|
const setValue = React13__namespace.useCallback(
|
|
12554
12557
|
(next) => {
|
|
12555
12558
|
if (!isControlled) setInternalValue(next);
|
|
@@ -12557,12 +12560,21 @@ var ChatComposer = React13__namespace.forwardRef(function ChatComposer2({
|
|
|
12557
12560
|
},
|
|
12558
12561
|
[isControlled, onValueChange]
|
|
12559
12562
|
);
|
|
12560
|
-
React13__namespace.
|
|
12563
|
+
const resizeTextarea = React13__namespace.useCallback(() => {
|
|
12561
12564
|
const textarea = textareaRef.current;
|
|
12562
12565
|
if (!textarea) return;
|
|
12563
12566
|
textarea.style.height = "auto";
|
|
12564
|
-
|
|
12565
|
-
|
|
12567
|
+
if (textarea.scrollHeight === 0) return;
|
|
12568
|
+
textarea.style.height = `${textarea.scrollHeight}px`;
|
|
12569
|
+
}, []);
|
|
12570
|
+
React13__namespace.useLayoutEffect(resizeTextarea, [resizeTextarea, value]);
|
|
12571
|
+
React13__namespace.useEffect(() => {
|
|
12572
|
+
const textarea = textareaRef.current;
|
|
12573
|
+
if (!textarea || typeof ResizeObserver === "undefined") return;
|
|
12574
|
+
const observer = new ResizeObserver(resizeTextarea);
|
|
12575
|
+
observer.observe(textarea);
|
|
12576
|
+
return () => observer.disconnect();
|
|
12577
|
+
}, [resizeTextarea]);
|
|
12566
12578
|
const addFiles = React13__namespace.useCallback(
|
|
12567
12579
|
(files) => {
|
|
12568
12580
|
if (!allowAttachments || files.length === 0) return;
|
|
@@ -12648,7 +12660,8 @@ var ChatComposer = React13__namespace.forwardRef(function ChatComposer2({
|
|
|
12648
12660
|
ref,
|
|
12649
12661
|
() => ({
|
|
12650
12662
|
addFiles,
|
|
12651
|
-
focus: () => textareaRef.current?.focus()
|
|
12663
|
+
focus: () => textareaRef.current?.focus(),
|
|
12664
|
+
getTextarea: () => textareaRef.current
|
|
12652
12665
|
}),
|
|
12653
12666
|
[addFiles]
|
|
12654
12667
|
);
|
|
@@ -12702,274 +12715,311 @@ var ChatComposer = React13__namespace.forwardRef(function ChatComposer2({
|
|
|
12702
12715
|
const micVisible = (showMic || onMicClick !== void 0 || micSlot !== void 0) && (micBehavior === "always" || !hasContent);
|
|
12703
12716
|
const showSelectorRow = showAgentSelector || showModelSelector;
|
|
12704
12717
|
const selectedAgentOption = agents.find((agent) => agent.id === selectedAgent) ?? null;
|
|
12705
|
-
|
|
12706
|
-
"
|
|
12707
|
-
|
|
12708
|
-
|
|
12709
|
-
|
|
12710
|
-
|
|
12711
|
-
|
|
12712
|
-
|
|
12713
|
-
|
|
12714
|
-
|
|
12715
|
-
|
|
12716
|
-
|
|
12717
|
-
|
|
12718
|
+
const cells = {
|
|
12719
|
+
input: "col-span-3 col-start-1 row-start-1 px-1 pt-1 md:col-span-1 md:col-start-2 md:self-end md:px-0 md:py-1.5",
|
|
12720
|
+
textarea: "px-2 pt-2 pb-1 md:py-1.5",
|
|
12721
|
+
add: "col-start-1 row-start-2 pb-2 ps-2 md:row-start-1 md:self-end md:p-1.5 md:pe-0.5",
|
|
12722
|
+
actions: "col-start-3 row-start-2 flex items-center gap-1 pb-2 pe-2 md:row-start-1 md:self-end md:gap-0.5 md:p-1.5 md:ps-0.5"
|
|
12723
|
+
};
|
|
12724
|
+
const composerCard = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12725
|
+
attachments.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12726
|
+
"div",
|
|
12727
|
+
{
|
|
12728
|
+
"data-slot": "chat-composer-attachments",
|
|
12729
|
+
className: "flex flex-wrap gap-2 px-3 pt-3",
|
|
12730
|
+
children: attachments.map((attachment) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
12731
|
+
chunkJWB4UA4J_cjs.AttachmentPreviewItem,
|
|
12718
12732
|
{
|
|
12719
|
-
|
|
12720
|
-
|
|
12721
|
-
|
|
12722
|
-
|
|
12733
|
+
attachment: { ...attachment, state: "pending" },
|
|
12734
|
+
onRemove: () => removeAttachment(attachment.id),
|
|
12735
|
+
disabled
|
|
12736
|
+
},
|
|
12737
|
+
attachment.id
|
|
12738
|
+
))
|
|
12739
|
+
}
|
|
12740
|
+
),
|
|
12741
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-[auto_minmax(0,1fr)_auto]", children: [
|
|
12742
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cells.input, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12743
|
+
"textarea",
|
|
12744
|
+
{
|
|
12745
|
+
...textareaProps,
|
|
12746
|
+
ref: textareaRef,
|
|
12747
|
+
"data-slot": "chat-composer-input",
|
|
12748
|
+
value,
|
|
12749
|
+
onChange: (event) => {
|
|
12750
|
+
textareaProps?.onChange?.(event);
|
|
12751
|
+
setValue(event.target.value);
|
|
12752
|
+
},
|
|
12753
|
+
onKeyDown: (event) => {
|
|
12754
|
+
textareaProps?.onKeyDown?.(event);
|
|
12755
|
+
if (event.defaultPrevented) return;
|
|
12756
|
+
handleKeyDown(event);
|
|
12757
|
+
},
|
|
12758
|
+
onPaste: (event) => {
|
|
12759
|
+
textareaProps?.onPaste?.(event);
|
|
12760
|
+
if (event.defaultPrevented) return;
|
|
12761
|
+
handlePaste(event);
|
|
12762
|
+
},
|
|
12763
|
+
placeholder,
|
|
12764
|
+
disabled,
|
|
12765
|
+
autoFocus,
|
|
12766
|
+
rows: 1,
|
|
12767
|
+
"aria-label": inputLabel,
|
|
12768
|
+
style: {
|
|
12769
|
+
...textareaProps?.style,
|
|
12770
|
+
maxHeight: typeof maxHeight === "number" ? `${maxHeight}px` : maxHeight
|
|
12771
|
+
},
|
|
12772
|
+
className: chunkS5RVSXDV_cjs.cn(
|
|
12773
|
+
"block w-full resize-none bg-transparent",
|
|
12774
|
+
"rounded-lg text-sm",
|
|
12775
|
+
cells.textarea,
|
|
12776
|
+
"text-neutral-900 placeholder:text-neutral-400 dark:text-white dark:placeholder:text-neutral-500",
|
|
12777
|
+
// Ring the input itself on focus rather than the whole shell.
|
|
12778
|
+
"focus:ring-primary-500 focus:ring-1 focus:outline-none",
|
|
12779
|
+
"disabled:cursor-not-allowed",
|
|
12780
|
+
textareaProps?.className
|
|
12781
|
+
)
|
|
12782
|
+
}
|
|
12783
|
+
) }),
|
|
12784
|
+
showAddMenu && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cells.add, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12785
|
+
chunkBT7SXNZU_cjs.Dropdown,
|
|
12786
|
+
{
|
|
12787
|
+
placement: "top-start",
|
|
12788
|
+
open: addMenuOpen,
|
|
12789
|
+
onOpenChange: setAddMenuOpen,
|
|
12790
|
+
trigger: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12791
|
+
"button",
|
|
12792
|
+
{
|
|
12793
|
+
type: "button",
|
|
12794
|
+
"data-slot": "chat-composer-add-button",
|
|
12795
|
+
"aria-label": addMenuLabel,
|
|
12796
|
+
disabled,
|
|
12797
|
+
className: iconButtonClasses,
|
|
12798
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.Plus, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
12799
|
+
}
|
|
12800
|
+
),
|
|
12801
|
+
children: [
|
|
12802
|
+
allowAttachments && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12803
|
+
chunkBT7SXNZU_cjs.DropdownItem,
|
|
12723
12804
|
{
|
|
12724
|
-
|
|
12725
|
-
|
|
12726
|
-
|
|
12805
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.Paperclip, { className: "h-4 w-4", "aria-hidden": "true" }),
|
|
12806
|
+
onClick: () => {
|
|
12807
|
+
setAddMenuOpen(false);
|
|
12808
|
+
fileInputRef.current?.click();
|
|
12809
|
+
},
|
|
12810
|
+
children: attachFilesLabel
|
|
12811
|
+
}
|
|
12812
|
+
),
|
|
12813
|
+
allowAttachments && addMenuItems && addMenuItems.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(chunkBT7SXNZU_cjs.DropdownSeparator, {}),
|
|
12814
|
+
addMenuItems?.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
12815
|
+
chunkBT7SXNZU_cjs.DropdownItem,
|
|
12816
|
+
{
|
|
12817
|
+
icon: item.icon,
|
|
12818
|
+
disabled: item.disabled,
|
|
12819
|
+
variant: item.variant,
|
|
12820
|
+
checked: item.checked,
|
|
12821
|
+
onClick: () => {
|
|
12822
|
+
setAddMenuOpen(false);
|
|
12823
|
+
item.onSelect?.();
|
|
12824
|
+
},
|
|
12825
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: item.label })
|
|
12727
12826
|
},
|
|
12728
|
-
|
|
12827
|
+
item.id
|
|
12729
12828
|
))
|
|
12829
|
+
]
|
|
12830
|
+
}
|
|
12831
|
+
) }),
|
|
12832
|
+
allowAttachments && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12833
|
+
"input",
|
|
12834
|
+
{
|
|
12835
|
+
ref: fileInputRef,
|
|
12836
|
+
type: "file",
|
|
12837
|
+
multiple: true,
|
|
12838
|
+
accept: acceptedFileTypes?.join(","),
|
|
12839
|
+
onChange: handleFileInputChange,
|
|
12840
|
+
className: "hidden",
|
|
12841
|
+
"aria-hidden": "true",
|
|
12842
|
+
tabIndex: -1
|
|
12843
|
+
}
|
|
12844
|
+
),
|
|
12845
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cells.actions, children: [
|
|
12846
|
+
showCharacterCount && maxLength !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12847
|
+
"span",
|
|
12848
|
+
{
|
|
12849
|
+
"data-slot": "chat-composer-char-count",
|
|
12850
|
+
"aria-live": "polite",
|
|
12851
|
+
className: chunkS5RVSXDV_cjs.cn(
|
|
12852
|
+
"pe-1 text-xs tabular-nums",
|
|
12853
|
+
isOverLimit ? "font-medium text-red-700 dark:text-red-400" : "text-neutral-500 dark:text-neutral-400"
|
|
12854
|
+
),
|
|
12855
|
+
children: [
|
|
12856
|
+
value.length,
|
|
12857
|
+
"/",
|
|
12858
|
+
maxLength
|
|
12859
|
+
]
|
|
12730
12860
|
}
|
|
12731
12861
|
),
|
|
12732
|
-
|
|
12733
|
-
|
|
12862
|
+
micVisible && (micSlot != null ? (
|
|
12863
|
+
// Normalize slot content (e.g. a RecordButton) to the 32px
|
|
12864
|
+
// control row: taller content overflow-centers instead of
|
|
12865
|
+
// inflating the pill and pushing the other cells apart. A div
|
|
12866
|
+
// so block-level slot content stays valid HTML.
|
|
12867
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12868
|
+
"div",
|
|
12869
|
+
{
|
|
12870
|
+
"data-slot": "chat-composer-mic-slot",
|
|
12871
|
+
className: "flex h-8 shrink-0 items-center",
|
|
12872
|
+
children: micSlot
|
|
12873
|
+
}
|
|
12874
|
+
)
|
|
12875
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
12876
|
+
"button",
|
|
12734
12877
|
{
|
|
12735
|
-
|
|
12736
|
-
"data-slot": "chat-composer-
|
|
12737
|
-
|
|
12738
|
-
onChange: (event) => setValue(event.target.value),
|
|
12739
|
-
onKeyDown: handleKeyDown,
|
|
12740
|
-
onPaste: handlePaste,
|
|
12741
|
-
placeholder,
|
|
12878
|
+
type: "button",
|
|
12879
|
+
"data-slot": "chat-composer-mic-button",
|
|
12880
|
+
"aria-label": micLabel,
|
|
12742
12881
|
disabled,
|
|
12743
|
-
|
|
12744
|
-
|
|
12745
|
-
"aria-
|
|
12882
|
+
onClick: onMicClick,
|
|
12883
|
+
className: iconButtonClasses,
|
|
12884
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.Mic, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
12885
|
+
}
|
|
12886
|
+
)),
|
|
12887
|
+
isStreaming && onStop ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
12888
|
+
"button",
|
|
12889
|
+
{
|
|
12890
|
+
type: "button",
|
|
12891
|
+
"data-slot": "chat-composer-stop-button",
|
|
12892
|
+
"aria-label": stopLabel,
|
|
12893
|
+
disabled,
|
|
12894
|
+
onClick: onStop,
|
|
12746
12895
|
className: chunkS5RVSXDV_cjs.cn(
|
|
12747
|
-
|
|
12748
|
-
"
|
|
12749
|
-
|
|
12750
|
-
|
|
12751
|
-
|
|
12752
|
-
|
|
12896
|
+
iconButtonClasses,
|
|
12897
|
+
"text-neutral-700 dark:text-neutral-200"
|
|
12898
|
+
),
|
|
12899
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12900
|
+
chunkL7L5S2HO_cjs.Square,
|
|
12901
|
+
{
|
|
12902
|
+
className: "h-3.5 w-3.5 fill-current",
|
|
12903
|
+
"aria-hidden": "true"
|
|
12904
|
+
}
|
|
12753
12905
|
)
|
|
12754
12906
|
}
|
|
12755
|
-
)
|
|
12756
|
-
|
|
12757
|
-
"div",
|
|
12907
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
12908
|
+
"button",
|
|
12758
12909
|
{
|
|
12759
|
-
|
|
12760
|
-
|
|
12761
|
-
|
|
12762
|
-
|
|
12763
|
-
|
|
12764
|
-
|
|
12765
|
-
|
|
12766
|
-
|
|
12767
|
-
|
|
12768
|
-
|
|
12769
|
-
|
|
12770
|
-
|
|
12771
|
-
|
|
12772
|
-
|
|
12773
|
-
|
|
12774
|
-
|
|
12775
|
-
|
|
12776
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.Plus, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
12777
|
-
}
|
|
12778
|
-
),
|
|
12779
|
-
children: [
|
|
12780
|
-
allowAttachments && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12781
|
-
chunkBT7SXNZU_cjs.DropdownItem,
|
|
12782
|
-
{
|
|
12783
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.Paperclip, { className: "h-4 w-4", "aria-hidden": "true" }),
|
|
12784
|
-
onClick: () => {
|
|
12785
|
-
setAddMenuOpen(false);
|
|
12786
|
-
fileInputRef.current?.click();
|
|
12787
|
-
},
|
|
12788
|
-
children: attachFilesLabel
|
|
12789
|
-
}
|
|
12790
|
-
),
|
|
12791
|
-
allowAttachments && addMenuItems && addMenuItems.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(chunkBT7SXNZU_cjs.DropdownSeparator, {}),
|
|
12792
|
-
addMenuItems?.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
12793
|
-
chunkBT7SXNZU_cjs.DropdownItem,
|
|
12794
|
-
{
|
|
12795
|
-
icon: item.icon,
|
|
12796
|
-
disabled: item.disabled,
|
|
12797
|
-
variant: item.variant,
|
|
12798
|
-
checked: item.checked,
|
|
12799
|
-
onClick: () => {
|
|
12800
|
-
setAddMenuOpen(false);
|
|
12801
|
-
item.onSelect?.();
|
|
12802
|
-
},
|
|
12803
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: item.label })
|
|
12804
|
-
},
|
|
12805
|
-
item.id
|
|
12806
|
-
))
|
|
12807
|
-
]
|
|
12808
|
-
}
|
|
12809
|
-
),
|
|
12810
|
-
allowAttachments && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12811
|
-
"input",
|
|
12812
|
-
{
|
|
12813
|
-
ref: fileInputRef,
|
|
12814
|
-
type: "file",
|
|
12815
|
-
multiple: true,
|
|
12816
|
-
accept: acceptedFileTypes?.join(","),
|
|
12817
|
-
onChange: handleFileInputChange,
|
|
12818
|
-
className: "hidden",
|
|
12819
|
-
"aria-hidden": "true",
|
|
12820
|
-
tabIndex: -1
|
|
12821
|
-
}
|
|
12822
|
-
),
|
|
12823
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ms-auto flex items-center gap-1", children: [
|
|
12824
|
-
showCharacterCount && maxLength !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12825
|
-
"span",
|
|
12826
|
-
{
|
|
12827
|
-
"data-slot": "chat-composer-char-count",
|
|
12828
|
-
"aria-live": "polite",
|
|
12829
|
-
className: chunkS5RVSXDV_cjs.cn(
|
|
12830
|
-
"pe-1 text-xs tabular-nums",
|
|
12831
|
-
isOverLimit ? "font-medium text-red-700 dark:text-red-400" : "text-neutral-500 dark:text-neutral-400"
|
|
12832
|
-
),
|
|
12833
|
-
children: [
|
|
12834
|
-
value.length,
|
|
12835
|
-
"/",
|
|
12836
|
-
maxLength
|
|
12837
|
-
]
|
|
12838
|
-
}
|
|
12839
|
-
),
|
|
12840
|
-
micVisible && (micSlot ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
12841
|
-
"button",
|
|
12842
|
-
{
|
|
12843
|
-
type: "button",
|
|
12844
|
-
"data-slot": "chat-composer-mic-button",
|
|
12845
|
-
"aria-label": micLabel,
|
|
12846
|
-
disabled,
|
|
12847
|
-
onClick: onMicClick,
|
|
12848
|
-
className: iconButtonClasses,
|
|
12849
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.Mic, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
12850
|
-
}
|
|
12851
|
-
)),
|
|
12852
|
-
isStreaming && onStop ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
12853
|
-
"button",
|
|
12854
|
-
{
|
|
12855
|
-
type: "button",
|
|
12856
|
-
"data-slot": "chat-composer-stop-button",
|
|
12857
|
-
"aria-label": stopLabel,
|
|
12858
|
-
disabled,
|
|
12859
|
-
onClick: onStop,
|
|
12860
|
-
className: chunkS5RVSXDV_cjs.cn(
|
|
12861
|
-
iconButtonClasses,
|
|
12862
|
-
"text-neutral-700 dark:text-neutral-200"
|
|
12863
|
-
),
|
|
12864
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12865
|
-
chunkL7L5S2HO_cjs.Square,
|
|
12866
|
-
{
|
|
12867
|
-
className: "h-3.5 w-3.5 fill-current",
|
|
12868
|
-
"aria-hidden": "true"
|
|
12869
|
-
}
|
|
12870
|
-
)
|
|
12871
|
-
}
|
|
12872
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
12873
|
-
"button",
|
|
12874
|
-
{
|
|
12875
|
-
type: "button",
|
|
12876
|
-
"data-slot": "chat-composer-send-button",
|
|
12877
|
-
"aria-label": isSending ? sendingLabel : sendLabel,
|
|
12878
|
-
"aria-busy": isSending || void 0,
|
|
12879
|
-
disabled: !canSend,
|
|
12880
|
-
onClick: handleSend,
|
|
12881
|
-
className: chunkS5RVSXDV_cjs.cn(
|
|
12882
|
-
iconButtonClasses,
|
|
12883
|
-
canSend && "bg-primary-800 hover:bg-primary-700 dark:bg-primary-600 dark:hover:bg-primary-500 text-white hover:text-white dark:hover:text-white"
|
|
12884
|
-
),
|
|
12885
|
-
children: isSending ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
12886
|
-
chunkL7L5S2HO_cjs.Loader2,
|
|
12887
|
-
{
|
|
12888
|
-
className: "h-4 w-4 animate-spin",
|
|
12889
|
-
"aria-hidden": "true"
|
|
12890
|
-
}
|
|
12891
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.ArrowUp, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
12892
|
-
}
|
|
12893
|
-
)
|
|
12894
|
-
] })
|
|
12895
|
-
]
|
|
12910
|
+
type: "button",
|
|
12911
|
+
"data-slot": "chat-composer-send-button",
|
|
12912
|
+
"aria-label": isSending ? sendingLabel : sendLabel,
|
|
12913
|
+
"aria-busy": isSending || void 0,
|
|
12914
|
+
disabled: !canSend,
|
|
12915
|
+
onClick: handleSend,
|
|
12916
|
+
className: chunkS5RVSXDV_cjs.cn(
|
|
12917
|
+
iconButtonClasses,
|
|
12918
|
+
canSend && "bg-primary-800 hover:bg-primary-700 dark:bg-primary-600 dark:hover:bg-primary-500 text-white hover:text-white dark:hover:text-white"
|
|
12919
|
+
),
|
|
12920
|
+
children: isSending ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
12921
|
+
chunkL7L5S2HO_cjs.Loader2,
|
|
12922
|
+
{
|
|
12923
|
+
className: "h-4 w-4 animate-spin",
|
|
12924
|
+
"aria-hidden": "true"
|
|
12925
|
+
}
|
|
12926
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.ArrowUp, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
12896
12927
|
}
|
|
12897
|
-
)
|
|
12898
|
-
|
|
12899
|
-
|
|
12928
|
+
)
|
|
12929
|
+
] })
|
|
12930
|
+
] })
|
|
12931
|
+
] });
|
|
12932
|
+
const selectorsRow = showSelectorRow && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12933
|
+
"div",
|
|
12934
|
+
{
|
|
12935
|
+
"data-slot": "chat-composer-selectors",
|
|
12936
|
+
className: "flex items-center justify-between gap-2 px-2 pt-1",
|
|
12937
|
+
children: [
|
|
12938
|
+
showAgentSelector ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
12939
|
+
chunkBT7SXNZU_cjs.Dropdown,
|
|
12900
12940
|
{
|
|
12901
|
-
|
|
12902
|
-
|
|
12903
|
-
|
|
12904
|
-
|
|
12905
|
-
|
|
12906
|
-
|
|
12907
|
-
|
|
12908
|
-
|
|
12909
|
-
|
|
12910
|
-
|
|
12911
|
-
|
|
12941
|
+
placement: "top-start",
|
|
12942
|
+
open: agentMenuOpen,
|
|
12943
|
+
onOpenChange: setAgentMenuOpen,
|
|
12944
|
+
trigger: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12945
|
+
"button",
|
|
12946
|
+
{
|
|
12947
|
+
type: "button",
|
|
12948
|
+
"data-slot": "chat-composer-agent-trigger",
|
|
12949
|
+
"aria-label": selectedAgentOption ? `${agentSelectorLabel}: ${selectedAgentOption.label}` : agentSelectorLabel,
|
|
12950
|
+
disabled,
|
|
12951
|
+
className: selectorTriggerClasses,
|
|
12952
|
+
children: [
|
|
12953
|
+
selectedAgentOption?.icon ?? /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.Bot, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
12954
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: selectedAgentOption?.label ?? agentSelectorLabel }),
|
|
12955
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.ChevronUp, { className: "h-3 w-3 shrink-0", "aria-hidden": "true" })
|
|
12956
|
+
]
|
|
12957
|
+
}
|
|
12958
|
+
),
|
|
12959
|
+
children: agents.map((agent) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
12960
|
+
chunkBT7SXNZU_cjs.DropdownItem,
|
|
12961
|
+
{
|
|
12962
|
+
icon: agent.icon,
|
|
12963
|
+
role: "menuitemradio",
|
|
12964
|
+
"aria-checked": agent.id === selectedAgent,
|
|
12965
|
+
onClick: () => {
|
|
12966
|
+
setAgentMenuOpen(false);
|
|
12967
|
+
onAgentChange?.(agent.id);
|
|
12968
|
+
},
|
|
12969
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex w-full items-center justify-between gap-2", children: [
|
|
12970
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0", children: [
|
|
12971
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate", children: agent.label }),
|
|
12972
|
+
agent.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-xs text-neutral-500 dark:text-neutral-400", children: agent.description })
|
|
12973
|
+
] }),
|
|
12974
|
+
agent.id === selectedAgent && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12975
|
+
chunkL7L5S2HO_cjs.Check,
|
|
12912
12976
|
{
|
|
12913
|
-
|
|
12914
|
-
"
|
|
12915
|
-
"aria-label": selectedAgentOption ? `${agentSelectorLabel}: ${selectedAgentOption.label}` : agentSelectorLabel,
|
|
12916
|
-
disabled,
|
|
12917
|
-
className: selectorTriggerClasses,
|
|
12918
|
-
children: [
|
|
12919
|
-
selectedAgentOption?.icon ?? /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.Bot, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
12920
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: selectedAgentOption?.label ?? agentSelectorLabel }),
|
|
12921
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12922
|
-
chunkL7L5S2HO_cjs.ChevronUp,
|
|
12923
|
-
{
|
|
12924
|
-
className: "h-3 w-3 shrink-0",
|
|
12925
|
-
"aria-hidden": "true"
|
|
12926
|
-
}
|
|
12927
|
-
)
|
|
12928
|
-
]
|
|
12977
|
+
className: "text-primary-600 dark:text-primary-400 h-4 w-4 shrink-0",
|
|
12978
|
+
"aria-hidden": "true"
|
|
12929
12979
|
}
|
|
12930
|
-
)
|
|
12931
|
-
|
|
12932
|
-
|
|
12933
|
-
|
|
12934
|
-
|
|
12935
|
-
|
|
12936
|
-
|
|
12937
|
-
|
|
12938
|
-
|
|
12939
|
-
|
|
12940
|
-
|
|
12941
|
-
|
|
12942
|
-
|
|
12943
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate", children: agent.label }),
|
|
12944
|
-
agent.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-xs text-neutral-500 dark:text-neutral-400", children: agent.description })
|
|
12945
|
-
] }),
|
|
12946
|
-
agent.id === selectedAgent && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12947
|
-
chunkL7L5S2HO_cjs.Check,
|
|
12948
|
-
{
|
|
12949
|
-
className: "text-primary-600 dark:text-primary-400 h-4 w-4 shrink-0",
|
|
12950
|
-
"aria-hidden": "true"
|
|
12951
|
-
}
|
|
12952
|
-
)
|
|
12953
|
-
] })
|
|
12954
|
-
},
|
|
12955
|
-
agent.id
|
|
12956
|
-
))
|
|
12957
|
-
}
|
|
12958
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true" }),
|
|
12959
|
-
showModelSelector && modelSelectorProps && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12960
|
-
ComposerModelSelector,
|
|
12961
|
-
{
|
|
12962
|
-
variant: "ghost",
|
|
12963
|
-
...modelSelectorProps,
|
|
12964
|
-
disabled: disabled || modelSelectorProps.disabled
|
|
12965
|
-
}
|
|
12966
|
-
)
|
|
12967
|
-
]
|
|
12980
|
+
)
|
|
12981
|
+
] })
|
|
12982
|
+
},
|
|
12983
|
+
agent.id
|
|
12984
|
+
))
|
|
12985
|
+
}
|
|
12986
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true" }),
|
|
12987
|
+
showModelSelector && modelSelectorProps && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12988
|
+
ComposerModelSelector,
|
|
12989
|
+
{
|
|
12990
|
+
variant: "ghost",
|
|
12991
|
+
...modelSelectorProps,
|
|
12992
|
+
disabled: disabled || modelSelectorProps.disabled
|
|
12968
12993
|
}
|
|
12969
12994
|
)
|
|
12970
12995
|
]
|
|
12971
12996
|
}
|
|
12972
12997
|
);
|
|
12998
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12999
|
+
"div",
|
|
13000
|
+
{
|
|
13001
|
+
"data-slot": "chat-composer",
|
|
13002
|
+
className: chunkS5RVSXDV_cjs.cn(
|
|
13003
|
+
"flex w-full flex-col",
|
|
13004
|
+
disabled && "opacity-60",
|
|
13005
|
+
className
|
|
13006
|
+
),
|
|
13007
|
+
children: [
|
|
13008
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13009
|
+
"div",
|
|
13010
|
+
{
|
|
13011
|
+
"data-slot": "chat-composer-card",
|
|
13012
|
+
className: chunkS5RVSXDV_cjs.cn(
|
|
13013
|
+
"rounded-2xl border border-neutral-200 bg-white shadow-sm",
|
|
13014
|
+
"dark:border-[#2e2e30] dark:bg-[#1c1c1e]"
|
|
13015
|
+
),
|
|
13016
|
+
children: composerCard
|
|
13017
|
+
}
|
|
13018
|
+
),
|
|
13019
|
+
selectorsRow
|
|
13020
|
+
]
|
|
13021
|
+
}
|
|
13022
|
+
);
|
|
12973
13023
|
});
|
|
12974
13024
|
ChatComposer.displayName = "ChatComposer";
|
|
12975
13025
|
var MODE_META = {
|
|
@@ -46010,11 +46060,11 @@ Object.defineProperty(exports, "CollapsibleTrigger", {
|
|
|
46010
46060
|
});
|
|
46011
46061
|
Object.defineProperty(exports, "miewebUIPreset", {
|
|
46012
46062
|
enumerable: true,
|
|
46013
|
-
get: function () { return
|
|
46063
|
+
get: function () { return chunkVIE7UI2R_cjs.miewebUIPreset; }
|
|
46014
46064
|
});
|
|
46015
46065
|
Object.defineProperty(exports, "miewebUISafelist", {
|
|
46016
46066
|
enumerable: true,
|
|
46017
|
-
get: function () { return
|
|
46067
|
+
get: function () { return chunkVIE7UI2R_cjs.miewebUISafelist; }
|
|
46018
46068
|
});
|
|
46019
46069
|
Object.defineProperty(exports, "Accordion", {
|
|
46020
46070
|
enumerable: true,
|