@nextclaw/agent-chat-ui 0.3.9 → 0.3.10
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/index.js +21 -18
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -360,7 +360,7 @@ function ChatInputBarActions({ sendError, sendErrorDetailsLabel, isSending, canS
|
|
|
360
360
|
const sendErrorPreview = normalizedSendError ? buildSendErrorPreview(normalizedSendError) : "";
|
|
361
361
|
const resolvedSendErrorDetailsLabel = sendErrorDetailsLabel?.trim() || "Details";
|
|
362
362
|
return /* @__PURE__ */ jsxs("div", {
|
|
363
|
-
className: "flex flex-col items-end gap-1",
|
|
363
|
+
className: "flex shrink-0 flex-col items-end gap-1",
|
|
364
364
|
children: [normalizedSendError ? /* @__PURE__ */ jsxs("div", {
|
|
365
365
|
className: "flex max-w-[420px] items-start justify-end gap-2 text-right",
|
|
366
366
|
children: [/* @__PURE__ */ jsx("div", {
|
|
@@ -507,12 +507,16 @@ function ChatInputBarSkillPicker(props) {
|
|
|
507
507
|
children: /* @__PURE__ */ jsxs("button", {
|
|
508
508
|
type: "button",
|
|
509
509
|
"aria-haspopup": "listbox",
|
|
510
|
-
|
|
510
|
+
"aria-label": picker.title,
|
|
511
|
+
className: "relative inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg px-0 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900 sm:w-auto sm:gap-1.5 sm:px-3",
|
|
511
512
|
children: [
|
|
512
513
|
/* @__PURE__ */ jsx(BrainCircuit, { className: "h-4 w-4" }),
|
|
513
|
-
/* @__PURE__ */ jsx("span", {
|
|
514
|
+
/* @__PURE__ */ jsx("span", {
|
|
515
|
+
className: "hidden sm:inline",
|
|
516
|
+
children: picker.title
|
|
517
|
+
}),
|
|
514
518
|
selectedCount > 0 ? /* @__PURE__ */ jsx("span", {
|
|
515
|
-
className: "
|
|
519
|
+
className: "absolute -right-1 -top-1 flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-primary px-1 text-[10px] font-semibold leading-none text-white shadow-sm sm:static sm:ml-0.5 sm:bg-primary/10 sm:text-primary sm:shadow-none",
|
|
516
520
|
children: selectedCount
|
|
517
521
|
}) : null
|
|
518
522
|
]
|
|
@@ -637,9 +641,8 @@ function AccessoryIcon({ icon }) {
|
|
|
637
641
|
return /* @__PURE__ */ jsx(ToolbarIcon, { icon });
|
|
638
642
|
}
|
|
639
643
|
function resolveTriggerWidth(key) {
|
|
640
|
-
if (key === "model") return "min-w-
|
|
641
|
-
if (key === "session-type") return "
|
|
642
|
-
if (key === "thinking") return "min-w-[150px]";
|
|
644
|
+
if (key === "model") return "min-w-0 flex-1";
|
|
645
|
+
if (key === "session-type" || key === "thinking") return "shrink-0";
|
|
643
646
|
return "";
|
|
644
647
|
}
|
|
645
648
|
function resolveContentWidth(key) {
|
|
@@ -660,7 +663,7 @@ function ToolbarSelect({ item }) {
|
|
|
660
663
|
onValueChange: item.onValueChange,
|
|
661
664
|
disabled: item.disabled,
|
|
662
665
|
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
663
|
-
className: `h-8 w-auto rounded-lg border-0 bg-transparent px-
|
|
666
|
+
className: `h-8 w-auto rounded-lg border-0 bg-transparent px-2 text-xs font-medium text-gray-600 shadow-none hover:bg-gray-100 focus:ring-0 sm:px-3 ${resolveTriggerWidth(item.key)}`,
|
|
664
667
|
children: item.selectedLabel ? /* @__PURE__ */ jsxs("div", {
|
|
665
668
|
className: "flex min-w-0 items-center gap-2 text-left",
|
|
666
669
|
children: [/* @__PURE__ */ jsx(ToolbarIcon, { icon: item.icon }), /* @__PURE__ */ jsx("span", {
|
|
@@ -700,16 +703,16 @@ function ToolbarSelect({ item }) {
|
|
|
700
703
|
})]
|
|
701
704
|
});
|
|
702
705
|
}
|
|
703
|
-
function ChatInputBarToolbar(
|
|
706
|
+
function ChatInputBarToolbar({ actions, accessories, selects, skillPicker }) {
|
|
704
707
|
const { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } = ChatUiPrimitives;
|
|
705
708
|
return /* @__PURE__ */ jsxs("div", {
|
|
706
|
-
className: "flex items-center justify-between px-3 pb-3",
|
|
709
|
+
className: "flex items-center justify-between gap-2 px-3 pb-3",
|
|
707
710
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
708
|
-
className: "flex items-center gap-1",
|
|
711
|
+
className: "flex min-w-0 flex-1 items-center gap-1 overflow-hidden",
|
|
709
712
|
children: [
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
+
skillPicker ? /* @__PURE__ */ jsx(ChatInputBarSkillPicker, { picker: skillPicker }) : null,
|
|
714
|
+
selects.map((item) => /* @__PURE__ */ jsx(ToolbarSelect, { item }, item.key)),
|
|
715
|
+
accessories?.map((item) => {
|
|
713
716
|
const button = /* @__PURE__ */ jsxs("button", {
|
|
714
717
|
type: "button",
|
|
715
718
|
className: `inline-flex items-center rounded-lg py-1.5 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900 disabled:cursor-not-allowed disabled:text-gray-400 ${item.iconOnly ? "h-8 w-8 justify-center px-0" : "gap-1.5 px-3"}`,
|
|
@@ -734,7 +737,7 @@ function ChatInputBarToolbar(props) {
|
|
|
734
737
|
})] }) }, item.key);
|
|
735
738
|
})
|
|
736
739
|
]
|
|
737
|
-
}), /* @__PURE__ */ jsx(ChatInputBarActions, { ...
|
|
740
|
+
}), /* @__PURE__ */ jsx(ChatInputBarActions, { ...actions })]
|
|
738
741
|
});
|
|
739
742
|
}
|
|
740
743
|
function createComposerNodeId() {
|
|
@@ -1700,9 +1703,9 @@ const ChatInputBarTokenizedComposer = forwardRef(function ChatInputBarTokenizedC
|
|
|
1700
1703
|
}), [props.disabled, props.nodes]),
|
|
1701
1704
|
children: [
|
|
1702
1705
|
/* @__PURE__ */ jsx("div", {
|
|
1703
|
-
className: "px-4 py-2.5",
|
|
1706
|
+
className: "px-3 py-2 sm:px-4 sm:py-2.5",
|
|
1704
1707
|
children: /* @__PURE__ */ jsx("div", {
|
|
1705
|
-
className: "min-h-[60px]",
|
|
1708
|
+
className: "min-h-11 sm:min-h-[60px]",
|
|
1706
1709
|
children: /* @__PURE__ */ jsx(PlainTextPlugin, {
|
|
1707
1710
|
contentEditable: /* @__PURE__ */ jsx(ContentEditable, {
|
|
1708
1711
|
className: "min-h-7 max-h-[188px] w-full overflow-y-auto whitespace-pre-wrap break-words bg-transparent py-0.5 text-sm leading-6 text-gray-800 outline-none",
|
|
@@ -1740,7 +1743,7 @@ const ChatInputBarTokenizedComposer = forwardRef(function ChatInputBarTokenizedC
|
|
|
1740
1743
|
}
|
|
1741
1744
|
}),
|
|
1742
1745
|
placeholder: /* @__PURE__ */ jsx("div", {
|
|
1743
|
-
className: "pointer-events-none absolute left-
|
|
1746
|
+
className: "pointer-events-none absolute left-3 top-2 select-none text-sm leading-6 text-gray-400 sm:left-4 sm:top-2.5",
|
|
1744
1747
|
children: props.placeholder
|
|
1745
1748
|
}),
|
|
1746
1749
|
ErrorBoundary: LexicalErrorBoundary
|