@nexface/chat 0.1.21-alpha.1 → 0.1.21-alpha.3
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/client.js +10 -6
- package/dist/default-chat.js +153 -141
- package/dist/styles.css +4 -0
- package/dist/ui/thread-list.aui.d.ts +2 -2
- package/dist/ui/thread-list.aui.js +6 -2
- package/package.json +3 -3
package/dist/client.js
CHANGED
|
@@ -875,13 +875,15 @@ class ChatClientImplementation {
|
|
|
875
875
|
}
|
|
876
876
|
}
|
|
877
877
|
catch (error) {
|
|
878
|
-
const
|
|
878
|
+
const executionOutcomeUnknown = (inFlight && !serverCannotWrite) ||
|
|
879
879
|
completedBrowserCall ||
|
|
880
880
|
this.#executingBrowserCall !== undefined;
|
|
881
|
-
|
|
881
|
+
const recoveryStateUnknown = executionOutcomeUnknown || (inFlight && !signal.aborted);
|
|
882
|
+
if ((this.#appendOnly && (recoveryStateUnknown || this.#cancelled)) ||
|
|
883
|
+
(error instanceof ClientError && error.code === "CHAT_RECOVERY_UNAVAILABLE")) {
|
|
882
884
|
this.#recoveryUnavailable = true;
|
|
883
885
|
}
|
|
884
|
-
else if (
|
|
886
|
+
else if (recoveryStateUnknown) {
|
|
885
887
|
this.#cancelledInterrupt = undefined;
|
|
886
888
|
}
|
|
887
889
|
else if (interruptId) {
|
|
@@ -915,12 +917,14 @@ class ChatClientImplementation {
|
|
|
915
917
|
});
|
|
916
918
|
}
|
|
917
919
|
}
|
|
918
|
-
if (
|
|
920
|
+
if (executionOutcomeUnknown && !this.#recoveryUnavailable) {
|
|
919
921
|
this.#messages.push({
|
|
920
922
|
id: id(),
|
|
921
923
|
role: "assistant",
|
|
922
|
-
content:
|
|
923
|
-
|
|
924
|
+
content: signal.aborted
|
|
925
|
+
? "The previous run was stopped and its execution outcome is unknown. Check the result before repeating any action."
|
|
926
|
+
: "Check the previous action results before repeating any action.",
|
|
927
|
+
metadata: { nexface: { state: signal.aborted ? "cancelled" : "error" } },
|
|
924
928
|
});
|
|
925
929
|
}
|
|
926
930
|
throw error;
|
package/dist/default-chat.js
CHANGED
|
@@ -28876,13 +28876,69 @@ function DropdownMenuItem3({
|
|
|
28876
28876
|
);
|
|
28877
28877
|
}
|
|
28878
28878
|
|
|
28879
|
-
// src/ui/
|
|
28879
|
+
// src/ui/tooltip.tsx
|
|
28880
|
+
import * as React5 from "react";
|
|
28880
28881
|
import { jsx as jsx68, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
28882
|
+
function TooltipProvider2({
|
|
28883
|
+
delayDuration = 0,
|
|
28884
|
+
...props
|
|
28885
|
+
}) {
|
|
28886
|
+
return /* @__PURE__ */ jsx68(
|
|
28887
|
+
dist_exports12.Provider,
|
|
28888
|
+
{
|
|
28889
|
+
"data-slot": "tooltip-provider",
|
|
28890
|
+
delayDuration,
|
|
28891
|
+
...props
|
|
28892
|
+
}
|
|
28893
|
+
);
|
|
28894
|
+
}
|
|
28895
|
+
function Tooltip2({ ...props }) {
|
|
28896
|
+
return /* @__PURE__ */ jsx68(dist_exports12.Root, { "data-slot": "tooltip", ...props });
|
|
28897
|
+
}
|
|
28898
|
+
var TooltipTrigger3 = React5.forwardRef(function TooltipTrigger4({ ...props }, ref) {
|
|
28899
|
+
return /* @__PURE__ */ jsx68(dist_exports12.Trigger, { "data-slot": "tooltip-trigger", ref, ...props });
|
|
28900
|
+
});
|
|
28901
|
+
function TooltipContent3({
|
|
28902
|
+
className,
|
|
28903
|
+
sideOffset = 0,
|
|
28904
|
+
children,
|
|
28905
|
+
...props
|
|
28906
|
+
}) {
|
|
28907
|
+
const container = usePortalContainer();
|
|
28908
|
+
if (!container) return null;
|
|
28909
|
+
return /* @__PURE__ */ jsx68(dist_exports12.Portal, { container, children: /* @__PURE__ */ jsxs11(
|
|
28910
|
+
dist_exports12.Content,
|
|
28911
|
+
{
|
|
28912
|
+
"data-slot": "tooltip-content",
|
|
28913
|
+
sideOffset,
|
|
28914
|
+
className: cn(
|
|
28915
|
+
"z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
28916
|
+
className
|
|
28917
|
+
),
|
|
28918
|
+
...props,
|
|
28919
|
+
children: [
|
|
28920
|
+
/* @__PURE__ */ jsx68(PortalThemeSync, {}),
|
|
28921
|
+
children,
|
|
28922
|
+
/* @__PURE__ */ jsx68(
|
|
28923
|
+
dist_exports12.Arrow,
|
|
28924
|
+
{
|
|
28925
|
+
className: cn(
|
|
28926
|
+
"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"
|
|
28927
|
+
)
|
|
28928
|
+
}
|
|
28929
|
+
)
|
|
28930
|
+
]
|
|
28931
|
+
}
|
|
28932
|
+
) });
|
|
28933
|
+
}
|
|
28934
|
+
|
|
28935
|
+
// src/ui/thread-list.aui.tsx
|
|
28936
|
+
import { jsx as jsx69, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
28881
28937
|
function ThreadListRoot({
|
|
28882
28938
|
className,
|
|
28883
28939
|
...props
|
|
28884
28940
|
}) {
|
|
28885
|
-
return /* @__PURE__ */
|
|
28941
|
+
return /* @__PURE__ */ jsx69(
|
|
28886
28942
|
ThreadListPrimitiveRoot,
|
|
28887
28943
|
{
|
|
28888
28944
|
"data-slot": "aui_thread-list-root",
|
|
@@ -28892,7 +28948,7 @@ function ThreadListRoot({
|
|
|
28892
28948
|
);
|
|
28893
28949
|
}
|
|
28894
28950
|
function ThreadListNew(props) {
|
|
28895
|
-
return /* @__PURE__ */
|
|
28951
|
+
return /* @__PURE__ */ jsx69(ThreadListPrimitiveNew, { asChild: true, children: /* @__PURE__ */ jsxs12(
|
|
28896
28952
|
"button",
|
|
28897
28953
|
{
|
|
28898
28954
|
type: "button",
|
|
@@ -28902,7 +28958,7 @@ function ThreadListNew(props) {
|
|
|
28902
28958
|
),
|
|
28903
28959
|
...props,
|
|
28904
28960
|
children: [
|
|
28905
|
-
/* @__PURE__ */
|
|
28961
|
+
/* @__PURE__ */ jsx69(Plus, { className: cn("size-4 shrink-0") }),
|
|
28906
28962
|
"\u65B0\u5EFA\u4F1A\u8BDD"
|
|
28907
28963
|
]
|
|
28908
28964
|
}
|
|
@@ -28912,8 +28968,8 @@ function ThreadListSearch({
|
|
|
28912
28968
|
value,
|
|
28913
28969
|
onValueChange
|
|
28914
28970
|
}) {
|
|
28915
|
-
return /* @__PURE__ */
|
|
28916
|
-
/* @__PURE__ */
|
|
28971
|
+
return /* @__PURE__ */ jsxs12("div", { "data-slot": "aui_thread-list-search", className: cn("relative px-0.5 py-1"), children: [
|
|
28972
|
+
/* @__PURE__ */ jsx69(
|
|
28917
28973
|
Search,
|
|
28918
28974
|
{
|
|
28919
28975
|
"data-slot": "aui_thread-list-search-icon",
|
|
@@ -28922,7 +28978,7 @@ function ThreadListSearch({
|
|
|
28922
28978
|
)
|
|
28923
28979
|
}
|
|
28924
28980
|
),
|
|
28925
|
-
/* @__PURE__ */
|
|
28981
|
+
/* @__PURE__ */ jsx69(
|
|
28926
28982
|
Input,
|
|
28927
28983
|
{
|
|
28928
28984
|
type: "search",
|
|
@@ -28938,7 +28994,7 @@ function ThreadListSearch({
|
|
|
28938
28994
|
function ThreadListItem({
|
|
28939
28995
|
disabled,
|
|
28940
28996
|
menu,
|
|
28941
|
-
|
|
28997
|
+
disabledReason
|
|
28942
28998
|
}) {
|
|
28943
28999
|
const isRunning = useAuiState((s) => s.threadListItem.isRunning);
|
|
28944
29000
|
const title = useAuiState((s) => s.threadListItem.title);
|
|
@@ -28951,17 +29007,16 @@ function ThreadListItem({
|
|
|
28951
29007
|
triggerRef.current?.focus();
|
|
28952
29008
|
}
|
|
28953
29009
|
}, [isRenaming]);
|
|
28954
|
-
|
|
29010
|
+
const item = /* @__PURE__ */ jsxs12(
|
|
28955
29011
|
ThreadListItemPrimitiveRoot,
|
|
28956
29012
|
{
|
|
28957
29013
|
"data-slot": "aui_thread-list-item",
|
|
28958
|
-
title: reason,
|
|
28959
29014
|
"data-disabled": disabled || void 0,
|
|
28960
29015
|
className: cn(
|
|
28961
29016
|
"data-[disabled=true]:opacity-50 group data-active:bg-foreground/[0.06] hover:bg-foreground/[0.04] has-data-[state=open]:bg-foreground/[0.04] rounded-control relative flex h-8 shrink-0 items-center transition-colors"
|
|
28962
29017
|
),
|
|
28963
29018
|
children: [
|
|
28964
|
-
isRenaming ? /* @__PURE__ */
|
|
29019
|
+
isRenaming ? /* @__PURE__ */ jsx69(
|
|
28965
29020
|
ThreadListItemRename,
|
|
28966
29021
|
{
|
|
28967
29022
|
onDone: (focus2) => {
|
|
@@ -28969,7 +29024,7 @@ function ThreadListItem({
|
|
|
28969
29024
|
setIsRenaming(false);
|
|
28970
29025
|
}
|
|
28971
29026
|
}
|
|
28972
|
-
) : /* @__PURE__ */
|
|
29027
|
+
) : /* @__PURE__ */ jsxs12(
|
|
28973
29028
|
ThreadListItemPrimitiveTrigger,
|
|
28974
29029
|
{
|
|
28975
29030
|
ref: triggerRef,
|
|
@@ -28979,19 +29034,19 @@ function ThreadListItem({
|
|
|
28979
29034
|
"text-muted-foreground group-data-active:text-foreground hover:text-foreground flex h-full min-w-0 flex-1 items-center px-2 text-left text-[13px] transition-colors outline-none group-hover:pe-8 group-has-focus-visible:pe-8 group-has-data-[state=open]:pe-8 group-data-active:pe-8"
|
|
28980
29035
|
),
|
|
28981
29036
|
children: [
|
|
28982
|
-
isRunning && /* @__PURE__ */
|
|
29037
|
+
isRunning && /* @__PURE__ */ jsx69(
|
|
28983
29038
|
LoaderCircle,
|
|
28984
29039
|
{
|
|
28985
29040
|
"aria-hidden": true,
|
|
28986
29041
|
className: cn("text-muted-foreground me-1.5 size-3.5 shrink-0 animate-spin")
|
|
28987
29042
|
}
|
|
28988
29043
|
),
|
|
28989
|
-
/* @__PURE__ */
|
|
29044
|
+
/* @__PURE__ */ jsx69("span", { className: cn("min-w-0 flex-1 truncate"), children: /* @__PURE__ */ jsx69(ThreadListItemPrimitiveTitle, { fallback: "\u65B0\u4F1A\u8BDD" }) })
|
|
28990
29045
|
]
|
|
28991
29046
|
}
|
|
28992
29047
|
),
|
|
28993
|
-
/* @__PURE__ */
|
|
28994
|
-
/* @__PURE__ */
|
|
29048
|
+
/* @__PURE__ */ jsxs12(DropdownMenu2, { modal: false, children: [
|
|
29049
|
+
/* @__PURE__ */ jsx69(DropdownMenuTrigger3, { asChild: true, children: /* @__PURE__ */ jsx69(
|
|
28995
29050
|
"button",
|
|
28996
29051
|
{
|
|
28997
29052
|
type: "button",
|
|
@@ -28999,14 +29054,29 @@ function ThreadListItem({
|
|
|
28999
29054
|
className: cn(
|
|
29000
29055
|
"text-muted-foreground hover:text-foreground absolute end-1 top-1/2 grid size-6 -translate-y-1/2 place-items-center rounded-sm opacity-0 transition-colors group-hover:opacity-100 group-has-focus-visible:opacity-100 group-data-active:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100"
|
|
29001
29056
|
),
|
|
29002
|
-
children: /* @__PURE__ */
|
|
29057
|
+
children: /* @__PURE__ */ jsx69(Ellipsis, { className: cn("size-3.5") })
|
|
29003
29058
|
}
|
|
29004
29059
|
) }),
|
|
29005
|
-
/* @__PURE__ */
|
|
29060
|
+
/* @__PURE__ */ jsx69(DropdownMenuContent3, { side: "right", align: "start", sideOffset: 6, children: menu(() => setIsRenaming(true)) })
|
|
29006
29061
|
] })
|
|
29007
29062
|
]
|
|
29008
29063
|
}
|
|
29009
29064
|
);
|
|
29065
|
+
if (!disabledReason) return item;
|
|
29066
|
+
return /* @__PURE__ */ jsx69(TooltipProvider2, { delayDuration: 300, skipDelayDuration: 0, children: /* @__PURE__ */ jsxs12(Tooltip2, { children: [
|
|
29067
|
+
/* @__PURE__ */ jsx69(TooltipTrigger3, { asChild: true, children: item }),
|
|
29068
|
+
/* @__PURE__ */ jsx69(
|
|
29069
|
+
TooltipContent3,
|
|
29070
|
+
{
|
|
29071
|
+
side: "right",
|
|
29072
|
+
sideOffset: 8,
|
|
29073
|
+
className: cn(
|
|
29074
|
+
"max-w-[min(20rem,var(--radix-tooltip-content-available-width))] break-words"
|
|
29075
|
+
),
|
|
29076
|
+
children: disabledReason
|
|
29077
|
+
}
|
|
29078
|
+
)
|
|
29079
|
+
] }) });
|
|
29010
29080
|
}
|
|
29011
29081
|
function ThreadListItemRename({ onDone }) {
|
|
29012
29082
|
const aui = useAui();
|
|
@@ -29033,7 +29103,7 @@ function ThreadListItemRename({ onDone }) {
|
|
|
29033
29103
|
}
|
|
29034
29104
|
);
|
|
29035
29105
|
};
|
|
29036
|
-
return /* @__PURE__ */
|
|
29106
|
+
return /* @__PURE__ */ jsx69(
|
|
29037
29107
|
Input,
|
|
29038
29108
|
{
|
|
29039
29109
|
ref: inputRef,
|
|
@@ -29061,22 +29131,22 @@ function ThreadListItemRename({ onDone }) {
|
|
|
29061
29131
|
}
|
|
29062
29132
|
|
|
29063
29133
|
// src/ui/dialog.tsx
|
|
29064
|
-
import * as
|
|
29065
|
-
import { jsx as
|
|
29134
|
+
import * as React6 from "react";
|
|
29135
|
+
import { jsx as jsx70, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
29066
29136
|
function Dialog2({ ...props }) {
|
|
29067
|
-
return /* @__PURE__ */
|
|
29137
|
+
return /* @__PURE__ */ jsx70(dist_exports5.Root, { "data-slot": "dialog", ...props, modal: false });
|
|
29068
29138
|
}
|
|
29069
|
-
var DialogTrigger3 =
|
|
29070
|
-
return /* @__PURE__ */
|
|
29139
|
+
var DialogTrigger3 = React6.forwardRef(function DialogTrigger4({ ...props }, ref) {
|
|
29140
|
+
return /* @__PURE__ */ jsx70(dist_exports5.Trigger, { "data-slot": "dialog-trigger", ref, ...props });
|
|
29071
29141
|
});
|
|
29072
29142
|
function DialogPortal2({ ...props }) {
|
|
29073
29143
|
const container = useDialogContainer();
|
|
29074
29144
|
if (!container) return null;
|
|
29075
|
-
return /* @__PURE__ */
|
|
29145
|
+
return /* @__PURE__ */ jsx70(dist_exports5.Portal, { container, "data-slot": "dialog-portal", ...props });
|
|
29076
29146
|
}
|
|
29077
29147
|
function DialogBackgroundGuard() {
|
|
29078
29148
|
const container = useDialogContainer();
|
|
29079
|
-
|
|
29149
|
+
React6.useLayoutEffect(() => {
|
|
29080
29150
|
const siblings = Array.from(container?.parentElement?.children ?? []).filter(
|
|
29081
29151
|
(node2) => node2 instanceof HTMLElement && node2 !== container
|
|
29082
29152
|
);
|
|
@@ -29099,8 +29169,8 @@ function DialogContent3({
|
|
|
29099
29169
|
onEscapeKeyDown,
|
|
29100
29170
|
...props
|
|
29101
29171
|
}) {
|
|
29102
|
-
const content3 =
|
|
29103
|
-
return /* @__PURE__ */
|
|
29172
|
+
const content3 = React6.useRef(null);
|
|
29173
|
+
return /* @__PURE__ */ jsx70(DialogPortal2, { "data-slot": "dialog-portal", children: /* @__PURE__ */ jsxs13(
|
|
29104
29174
|
dist_exports5.Content,
|
|
29105
29175
|
{
|
|
29106
29176
|
ref: content3,
|
|
@@ -29116,8 +29186,8 @@ function DialogContent3({
|
|
|
29116
29186
|
},
|
|
29117
29187
|
...props,
|
|
29118
29188
|
children: [
|
|
29119
|
-
/* @__PURE__ */
|
|
29120
|
-
/* @__PURE__ */
|
|
29189
|
+
/* @__PURE__ */ jsx70(DialogBackgroundGuard, {}),
|
|
29190
|
+
/* @__PURE__ */ jsxs13(
|
|
29121
29191
|
"div",
|
|
29122
29192
|
{
|
|
29123
29193
|
className: cn(
|
|
@@ -29126,7 +29196,7 @@ function DialogContent3({
|
|
|
29126
29196
|
),
|
|
29127
29197
|
children: [
|
|
29128
29198
|
children,
|
|
29129
|
-
showCloseButton && /* @__PURE__ */
|
|
29199
|
+
showCloseButton && /* @__PURE__ */ jsxs13(
|
|
29130
29200
|
dist_exports5.Close,
|
|
29131
29201
|
{
|
|
29132
29202
|
"data-slot": "dialog-close",
|
|
@@ -29134,8 +29204,8 @@ function DialogContent3({
|
|
|
29134
29204
|
"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
29135
29205
|
),
|
|
29136
29206
|
children: [
|
|
29137
|
-
/* @__PURE__ */
|
|
29138
|
-
/* @__PURE__ */
|
|
29207
|
+
/* @__PURE__ */ jsx70(X, {}),
|
|
29208
|
+
/* @__PURE__ */ jsx70("span", { className: cn("sr-only"), children: "Close" })
|
|
29139
29209
|
]
|
|
29140
29210
|
}
|
|
29141
29211
|
)
|
|
@@ -29152,7 +29222,7 @@ function DialogFooter({
|
|
|
29152
29222
|
children,
|
|
29153
29223
|
...props
|
|
29154
29224
|
}) {
|
|
29155
|
-
return /* @__PURE__ */
|
|
29225
|
+
return /* @__PURE__ */ jsxs13(
|
|
29156
29226
|
"div",
|
|
29157
29227
|
{
|
|
29158
29228
|
"data-slot": "dialog-footer",
|
|
@@ -29160,13 +29230,13 @@ function DialogFooter({
|
|
|
29160
29230
|
...props,
|
|
29161
29231
|
children: [
|
|
29162
29232
|
children,
|
|
29163
|
-
showCloseButton && /* @__PURE__ */
|
|
29233
|
+
showCloseButton && /* @__PURE__ */ jsx70(dist_exports5.Close, { asChild: true, children: /* @__PURE__ */ jsx70(Button, { variant: "outline", children: "Close" }) })
|
|
29164
29234
|
]
|
|
29165
29235
|
}
|
|
29166
29236
|
);
|
|
29167
29237
|
}
|
|
29168
29238
|
function DialogTitle3({ className, ...props }) {
|
|
29169
|
-
return /* @__PURE__ */
|
|
29239
|
+
return /* @__PURE__ */ jsx70(
|
|
29170
29240
|
dist_exports5.Title,
|
|
29171
29241
|
{
|
|
29172
29242
|
"data-slot": "dialog-title",
|
|
@@ -29179,7 +29249,7 @@ function DialogDescription3({
|
|
|
29179
29249
|
className,
|
|
29180
29250
|
...props
|
|
29181
29251
|
}) {
|
|
29182
|
-
return /* @__PURE__ */
|
|
29252
|
+
return /* @__PURE__ */ jsx70(
|
|
29183
29253
|
dist_exports5.Description,
|
|
29184
29254
|
{
|
|
29185
29255
|
"data-slot": "dialog-description",
|
|
@@ -29190,7 +29260,7 @@ function DialogDescription3({
|
|
|
29190
29260
|
}
|
|
29191
29261
|
|
|
29192
29262
|
// src/ui/home-demo/thread.tsx
|
|
29193
|
-
import { jsx as
|
|
29263
|
+
import { jsx as jsx71, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
29194
29264
|
function Thread({
|
|
29195
29265
|
empty: isEmpty,
|
|
29196
29266
|
welcome,
|
|
@@ -29200,12 +29270,12 @@ function Thread({
|
|
|
29200
29270
|
children,
|
|
29201
29271
|
renderMessage
|
|
29202
29272
|
}) {
|
|
29203
|
-
return /* @__PURE__ */
|
|
29273
|
+
return /* @__PURE__ */ jsx71(
|
|
29204
29274
|
ThreadPrimitiveRoot,
|
|
29205
29275
|
{
|
|
29206
29276
|
className: cn("flex h-full min-h-0 min-w-0 flex-1 flex-col"),
|
|
29207
29277
|
style: { ["--nxf-thread-max-width"]: "42rem" },
|
|
29208
|
-
children: /* @__PURE__ */
|
|
29278
|
+
children: /* @__PURE__ */ jsxs14(
|
|
29209
29279
|
ThreadPrimitiveViewport,
|
|
29210
29280
|
{
|
|
29211
29281
|
turnAnchor: "top",
|
|
@@ -29222,19 +29292,19 @@ function Thread({
|
|
|
29222
29292
|
),
|
|
29223
29293
|
children: [
|
|
29224
29294
|
isEmpty ? welcome : null,
|
|
29225
|
-
/* @__PURE__ */
|
|
29295
|
+
/* @__PURE__ */ jsxs14(
|
|
29226
29296
|
"div",
|
|
29227
29297
|
{
|
|
29228
29298
|
className: cn(
|
|
29229
29299
|
"mx-auto mb-12 flex w-full max-w-(--nxf-thread-max-width) flex-col gap-y-6 empty:hidden"
|
|
29230
29300
|
),
|
|
29231
29301
|
children: [
|
|
29232
|
-
/* @__PURE__ */
|
|
29302
|
+
/* @__PURE__ */ jsx71(ThreadPrimitiveMessages, { children: renderMessage }),
|
|
29233
29303
|
children
|
|
29234
29304
|
]
|
|
29235
29305
|
}
|
|
29236
29306
|
),
|
|
29237
|
-
/* @__PURE__ */
|
|
29307
|
+
/* @__PURE__ */ jsxs14(
|
|
29238
29308
|
ThreadPrimitiveViewportFooter,
|
|
29239
29309
|
{
|
|
29240
29310
|
className: cn(
|
|
@@ -29260,29 +29330,29 @@ var typeSection = "font-display text-[1.5rem] leading-snug font-[550] tracking-[
|
|
|
29260
29330
|
var typeDeck = "text-muted-foreground max-w-[40ch] text-[15px] leading-relaxed text-pretty";
|
|
29261
29331
|
|
|
29262
29332
|
// src/ui/home-demo/greeting.tsx
|
|
29263
|
-
import { jsx as
|
|
29333
|
+
import { jsx as jsx72, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
29264
29334
|
function Greeting({
|
|
29265
29335
|
title,
|
|
29266
29336
|
description,
|
|
29267
29337
|
icon
|
|
29268
29338
|
}) {
|
|
29269
|
-
return /* @__PURE__ */
|
|
29339
|
+
return /* @__PURE__ */ jsxs15(
|
|
29270
29340
|
"div",
|
|
29271
29341
|
{
|
|
29272
29342
|
className: cn(
|
|
29273
29343
|
"animate-in fade-in slide-in-from-bottom-1 mx-auto mb-8 flex w-full max-w-(--nxf-thread-max-width) flex-col items-center text-center duration-200"
|
|
29274
29344
|
),
|
|
29275
29345
|
children: [
|
|
29276
|
-
icon != null ? /* @__PURE__ */
|
|
29277
|
-
/* @__PURE__ */
|
|
29278
|
-
description ? /* @__PURE__ */
|
|
29346
|
+
icon != null ? /* @__PURE__ */ jsx72("div", { className: cn("mb-4 flex max-w-full justify-center [&_img]:max-w-full"), children: icon }) : null,
|
|
29347
|
+
/* @__PURE__ */ jsx72("p", { className: cn(typeSection), children: title }),
|
|
29348
|
+
description ? /* @__PURE__ */ jsx72("p", { className: cn(typeDeck), children: description }) : null
|
|
29279
29349
|
]
|
|
29280
29350
|
}
|
|
29281
29351
|
);
|
|
29282
29352
|
}
|
|
29283
29353
|
|
|
29284
29354
|
// src/ui/home-demo/suggestions.tsx
|
|
29285
|
-
import { jsx as
|
|
29355
|
+
import { jsx as jsx73, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
29286
29356
|
var suggestionChipClass = "bg-background text-suggestion hover:text-foreground font-suggestion inset-ring inset-ring-black/8 dark:inset-ring-foreground/8 hover:inset-ring-foreground/25 rounded-lg inline-flex min-h-[32px] min-w-0 max-w-full items-center gap-2 px-3 py-[5px] text-sm font-medium leading-[1.57143] transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring";
|
|
29287
29357
|
function Suggestions2({
|
|
29288
29358
|
suggestions,
|
|
@@ -29295,7 +29365,7 @@ function Suggestions2({
|
|
|
29295
29365
|
// Typing hides the suggestions without unmounting them: the empty view is
|
|
29296
29366
|
// centred, so collapsing a block this tall moves the composer out from
|
|
29297
29367
|
// under the cursor. Disabled buttons also stay out of the tab order in React 18.
|
|
29298
|
-
/* @__PURE__ */
|
|
29368
|
+
/* @__PURE__ */ jsx73(
|
|
29299
29369
|
"div",
|
|
29300
29370
|
{
|
|
29301
29371
|
"aria-hidden": hidden,
|
|
@@ -29303,7 +29373,7 @@ function Suggestions2({
|
|
|
29303
29373
|
"animate-in fade-in mx-auto flex max-w-[34rem] flex-wrap items-center justify-center gap-2 transition-opacity duration-200 motion-reduce:animate-none",
|
|
29304
29374
|
hidden && "opacity-0"
|
|
29305
29375
|
),
|
|
29306
|
-
children: suggestions.map((suggestion) => /* @__PURE__ */
|
|
29376
|
+
children: suggestions.map((suggestion) => /* @__PURE__ */ jsxs16(
|
|
29307
29377
|
ThreadPrimitiveSuggestion,
|
|
29308
29378
|
{
|
|
29309
29379
|
prompt: suggestion.prompt,
|
|
@@ -29315,7 +29385,7 @@ function Suggestions2({
|
|
|
29315
29385
|
},
|
|
29316
29386
|
className: cn(suggestionChipClass),
|
|
29317
29387
|
children: [
|
|
29318
|
-
suggestion.icon != null ? /* @__PURE__ */
|
|
29388
|
+
suggestion.icon != null ? /* @__PURE__ */ jsx73(
|
|
29319
29389
|
"span",
|
|
29320
29390
|
{
|
|
29321
29391
|
"aria-hidden": "true",
|
|
@@ -29325,7 +29395,7 @@ function Suggestions2({
|
|
|
29325
29395
|
children: suggestion.icon
|
|
29326
29396
|
}
|
|
29327
29397
|
) : null,
|
|
29328
|
-
/* @__PURE__ */
|
|
29398
|
+
/* @__PURE__ */ jsx73("span", { className: cn("min-w-0 wrap-anywhere"), children: suggestion.label })
|
|
29329
29399
|
]
|
|
29330
29400
|
},
|
|
29331
29401
|
suggestion.prompt
|
|
@@ -29386,22 +29456,22 @@ function useNextMessage(chat, suggest, open) {
|
|
|
29386
29456
|
}
|
|
29387
29457
|
|
|
29388
29458
|
// src/ui/home-demo/action-bar.tsx
|
|
29389
|
-
import { jsx as
|
|
29459
|
+
import { jsx as jsx74, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
29390
29460
|
function AssistantActionBar() {
|
|
29391
|
-
return /* @__PURE__ */
|
|
29392
|
-
/* @__PURE__ */
|
|
29393
|
-
/* @__PURE__ */
|
|
29461
|
+
return /* @__PURE__ */ jsx74(ActionBarPrimitiveRoot, { autohide: "never", className: cn("flex items-center gap-1.5"), children: /* @__PURE__ */ jsxs17(ActionBarPrimitiveCopy, { "aria-label": "\u590D\u5236\u56DE\u590D", className: cn(actionButtonClass), children: [
|
|
29462
|
+
/* @__PURE__ */ jsx74(AuiIf, { condition: (s) => s.message.isCopied, children: /* @__PURE__ */ jsx74(Check, { className: cn("size-4") }) }),
|
|
29463
|
+
/* @__PURE__ */ jsx74(AuiIf, { condition: (s) => !s.message.isCopied, children: /* @__PURE__ */ jsx74(Copy, { className: cn("size-4") }) })
|
|
29394
29464
|
] }) });
|
|
29395
29465
|
}
|
|
29396
29466
|
|
|
29397
29467
|
// src/ui/home-demo/messages.tsx
|
|
29398
|
-
import { jsx as
|
|
29468
|
+
import { jsx as jsx75, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
29399
29469
|
function UserMessage({
|
|
29400
29470
|
children,
|
|
29401
29471
|
attachments,
|
|
29402
29472
|
actions
|
|
29403
29473
|
}) {
|
|
29404
|
-
return /* @__PURE__ */
|
|
29474
|
+
return /* @__PURE__ */ jsxs18(
|
|
29405
29475
|
MessagePrimitiveRoot,
|
|
29406
29476
|
{
|
|
29407
29477
|
"data-role": "user",
|
|
@@ -29410,9 +29480,9 @@ function UserMessage({
|
|
|
29410
29480
|
"animate-in fade-in slide-in-from-bottom-1 mx-auto flex w-full max-w-(--nxf-thread-max-width) flex-col items-end duration-150"
|
|
29411
29481
|
),
|
|
29412
29482
|
children: [
|
|
29413
|
-
/* @__PURE__ */
|
|
29414
|
-
/* @__PURE__ */
|
|
29415
|
-
/* @__PURE__ */
|
|
29483
|
+
/* @__PURE__ */ jsx75("div", { className: cn("w-full has-[.aui-attachment-root]:mb-2"), children: attachments }),
|
|
29484
|
+
/* @__PURE__ */ jsxs18("div", { className: cn("relative max-w-[80%]"), children: [
|
|
29485
|
+
/* @__PURE__ */ jsx75(
|
|
29416
29486
|
"div",
|
|
29417
29487
|
{
|
|
29418
29488
|
className: cn(
|
|
@@ -29421,7 +29491,7 @@ function UserMessage({
|
|
|
29421
29491
|
children
|
|
29422
29492
|
}
|
|
29423
29493
|
),
|
|
29424
|
-
/* @__PURE__ */
|
|
29494
|
+
/* @__PURE__ */ jsx75(
|
|
29425
29495
|
ActionBarPrimitiveRoot,
|
|
29426
29496
|
{
|
|
29427
29497
|
hideWhenRunning: true,
|
|
@@ -29438,7 +29508,7 @@ function UserMessage({
|
|
|
29438
29508
|
);
|
|
29439
29509
|
}
|
|
29440
29510
|
function AssistantMessage({ children }) {
|
|
29441
|
-
return /* @__PURE__ */
|
|
29511
|
+
return /* @__PURE__ */ jsxs18(
|
|
29442
29512
|
MessagePrimitiveRoot,
|
|
29443
29513
|
{
|
|
29444
29514
|
"data-role": "assistant",
|
|
@@ -29447,18 +29517,18 @@ function AssistantMessage({ children }) {
|
|
|
29447
29517
|
"animate-in fade-in slide-in-from-bottom-1 mx-auto w-full max-w-(--nxf-thread-max-width) duration-150"
|
|
29448
29518
|
),
|
|
29449
29519
|
children: [
|
|
29450
|
-
/* @__PURE__ */
|
|
29520
|
+
/* @__PURE__ */ jsxs18(
|
|
29451
29521
|
"div",
|
|
29452
29522
|
{
|
|
29453
29523
|
"data-slot": "aui_assistant-message-content",
|
|
29454
29524
|
className: cn("text-[15px] leading-relaxed wrap-break-word"),
|
|
29455
29525
|
children: [
|
|
29456
29526
|
children,
|
|
29457
|
-
/* @__PURE__ */
|
|
29527
|
+
/* @__PURE__ */ jsx75(MessageError, {})
|
|
29458
29528
|
]
|
|
29459
29529
|
}
|
|
29460
29530
|
),
|
|
29461
|
-
/* @__PURE__ */
|
|
29531
|
+
/* @__PURE__ */ jsx75("div", { className: cn("mt-2 flex items-center gap-1.5 empty:hidden"), children: /* @__PURE__ */ jsx75(AssistantActionBar, {}) })
|
|
29462
29532
|
]
|
|
29463
29533
|
}
|
|
29464
29534
|
);
|
|
@@ -29468,26 +29538,26 @@ function MessageError() {
|
|
|
29468
29538
|
(s) => s.message.status?.type === "incomplete" && s.message.status.reason === "cancelled"
|
|
29469
29539
|
);
|
|
29470
29540
|
if (cancelled)
|
|
29471
|
-
return /* @__PURE__ */
|
|
29472
|
-
return /* @__PURE__ */
|
|
29541
|
+
return /* @__PURE__ */ jsx75("p", { role: "status", className: cn("mt-2 text-[13px] text-muted-foreground"), children: "Stopped" });
|
|
29542
|
+
return /* @__PURE__ */ jsx75(MessagePrimitiveError, { children: /* @__PURE__ */ jsx75(
|
|
29473
29543
|
ErrorPrimitiveRoot,
|
|
29474
29544
|
{
|
|
29475
29545
|
role: "alert",
|
|
29476
29546
|
className: cn("mt-2 border-l-2 pl-3 text-[13px] border-destructive/60 text-destructive"),
|
|
29477
|
-
children: /* @__PURE__ */
|
|
29547
|
+
children: /* @__PURE__ */ jsx75(ErrorPrimitiveMessage, { className: cn("line-clamp-2") })
|
|
29478
29548
|
}
|
|
29479
29549
|
) });
|
|
29480
29550
|
}
|
|
29481
29551
|
|
|
29482
29552
|
// src/ui/home-demo/composer.tsx
|
|
29483
|
-
import { jsx as
|
|
29553
|
+
import { jsx as jsx76, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
29484
29554
|
function Composer({
|
|
29485
29555
|
children,
|
|
29486
29556
|
inputProps,
|
|
29487
29557
|
actions,
|
|
29488
29558
|
...props
|
|
29489
29559
|
}) {
|
|
29490
|
-
return /* @__PURE__ */
|
|
29560
|
+
return /* @__PURE__ */ jsx76(ComposerPrimitiveRoot, { className: cn("relative w-full"), ...props, children: /* @__PURE__ */ jsx76(
|
|
29491
29561
|
ComposerPrimitiveAttachmentDropzone,
|
|
29492
29562
|
{
|
|
29493
29563
|
asChild: true,
|
|
@@ -29498,7 +29568,7 @@ function Composer({
|
|
|
29498
29568
|
onDragOverCapture: (event) => {
|
|
29499
29569
|
if (inputProps.disabled) event.preventDefault();
|
|
29500
29570
|
},
|
|
29501
|
-
children: /* @__PURE__ */
|
|
29571
|
+
children: /* @__PURE__ */ jsxs19(
|
|
29502
29572
|
"div",
|
|
29503
29573
|
{
|
|
29504
29574
|
"data-slot": "aui_composer-shell",
|
|
@@ -29506,8 +29576,8 @@ function Composer({
|
|
|
29506
29576
|
"border-foreground/10 bg-muted/30 focus-within:border-foreground/25 data-[dragging=true]:border-foreground/40 rounded-thread flex flex-col border transition-colors data-[dragging=true]:border-dashed"
|
|
29507
29577
|
),
|
|
29508
29578
|
children: [
|
|
29509
|
-
/* @__PURE__ */
|
|
29510
|
-
/* @__PURE__ */
|
|
29579
|
+
/* @__PURE__ */ jsx76("div", { className: cn("has-[.aui-attachment-root]:px-3 has-[.aui-attachment-root]:pt-3"), children }),
|
|
29580
|
+
/* @__PURE__ */ jsx76(ComposerPrimitiveInput, { asChild: true, ...inputProps, children: /* @__PURE__ */ jsx76(
|
|
29511
29581
|
"textarea",
|
|
29512
29582
|
{
|
|
29513
29583
|
"data-composer-input": true,
|
|
@@ -29517,7 +29587,7 @@ function Composer({
|
|
|
29517
29587
|
)
|
|
29518
29588
|
}
|
|
29519
29589
|
) }),
|
|
29520
|
-
/* @__PURE__ */
|
|
29590
|
+
/* @__PURE__ */ jsx76("div", { className: cn("flex items-center justify-between gap-2 px-2 pb-2"), children: actions })
|
|
29521
29591
|
]
|
|
29522
29592
|
}
|
|
29523
29593
|
)
|
|
@@ -29531,13 +29601,13 @@ function EditComposer({
|
|
|
29531
29601
|
sendProps,
|
|
29532
29602
|
...props
|
|
29533
29603
|
}) {
|
|
29534
|
-
return /* @__PURE__ */
|
|
29604
|
+
return /* @__PURE__ */ jsx76(
|
|
29535
29605
|
MessagePrimitiveRoot,
|
|
29536
29606
|
{
|
|
29537
29607
|
"data-role": "user",
|
|
29538
29608
|
"data-slot": "aui_edit-composer-wrapper",
|
|
29539
29609
|
className: cn("mx-auto flex w-full max-w-(--nxf-thread-max-width) flex-col items-end"),
|
|
29540
|
-
children: /* @__PURE__ */
|
|
29610
|
+
children: /* @__PURE__ */ jsxs19(
|
|
29541
29611
|
ComposerPrimitiveRoot,
|
|
29542
29612
|
{
|
|
29543
29613
|
className: cn(
|
|
@@ -29545,7 +29615,7 @@ function EditComposer({
|
|
|
29545
29615
|
),
|
|
29546
29616
|
...props,
|
|
29547
29617
|
children: [
|
|
29548
|
-
/* @__PURE__ */
|
|
29618
|
+
/* @__PURE__ */ jsx76(ComposerPrimitiveInput, { asChild: true, ...inputProps, children: /* @__PURE__ */ jsx76(
|
|
29549
29619
|
"textarea",
|
|
29550
29620
|
{
|
|
29551
29621
|
autoFocus: true,
|
|
@@ -29556,8 +29626,8 @@ function EditComposer({
|
|
|
29556
29626
|
}
|
|
29557
29627
|
) }),
|
|
29558
29628
|
children,
|
|
29559
|
-
/* @__PURE__ */
|
|
29560
|
-
/* @__PURE__ */
|
|
29629
|
+
/* @__PURE__ */ jsxs19("div", { className: cn("flex items-center justify-end gap-1.5 px-2.5 pb-2.5"), children: [
|
|
29630
|
+
/* @__PURE__ */ jsx76(ComposerPrimitiveCancel, { asChild: true, children: /* @__PURE__ */ jsx76(
|
|
29561
29631
|
"button",
|
|
29562
29632
|
{
|
|
29563
29633
|
type: "button",
|
|
@@ -29568,7 +29638,7 @@ function EditComposer({
|
|
|
29568
29638
|
children: "\u53D6\u6D88"
|
|
29569
29639
|
}
|
|
29570
29640
|
) }),
|
|
29571
|
-
/* @__PURE__ */
|
|
29641
|
+
/* @__PURE__ */ jsx76(ComposerPrimitiveSend, { asChild: true, children: /* @__PURE__ */ jsx76(
|
|
29572
29642
|
"button",
|
|
29573
29643
|
{
|
|
29574
29644
|
type: "button",
|
|
@@ -29589,64 +29659,6 @@ function EditComposer({
|
|
|
29589
29659
|
|
|
29590
29660
|
// src/ui/tooltip-icon-button.tsx
|
|
29591
29661
|
import { forwardRef as forwardRef29 } from "react";
|
|
29592
|
-
|
|
29593
|
-
// src/ui/tooltip.tsx
|
|
29594
|
-
import * as React6 from "react";
|
|
29595
|
-
import { jsx as jsx76, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
29596
|
-
function TooltipProvider2({
|
|
29597
|
-
delayDuration = 0,
|
|
29598
|
-
...props
|
|
29599
|
-
}) {
|
|
29600
|
-
return /* @__PURE__ */ jsx76(
|
|
29601
|
-
dist_exports12.Provider,
|
|
29602
|
-
{
|
|
29603
|
-
"data-slot": "tooltip-provider",
|
|
29604
|
-
delayDuration,
|
|
29605
|
-
...props
|
|
29606
|
-
}
|
|
29607
|
-
);
|
|
29608
|
-
}
|
|
29609
|
-
function Tooltip2({ ...props }) {
|
|
29610
|
-
return /* @__PURE__ */ jsx76(dist_exports12.Root, { "data-slot": "tooltip", ...props });
|
|
29611
|
-
}
|
|
29612
|
-
var TooltipTrigger3 = React6.forwardRef(function TooltipTrigger4({ ...props }, ref) {
|
|
29613
|
-
return /* @__PURE__ */ jsx76(dist_exports12.Trigger, { "data-slot": "tooltip-trigger", ref, ...props });
|
|
29614
|
-
});
|
|
29615
|
-
function TooltipContent3({
|
|
29616
|
-
className,
|
|
29617
|
-
sideOffset = 0,
|
|
29618
|
-
children,
|
|
29619
|
-
...props
|
|
29620
|
-
}) {
|
|
29621
|
-
const container = usePortalContainer();
|
|
29622
|
-
if (!container) return null;
|
|
29623
|
-
return /* @__PURE__ */ jsx76(dist_exports12.Portal, { container, children: /* @__PURE__ */ jsxs19(
|
|
29624
|
-
dist_exports12.Content,
|
|
29625
|
-
{
|
|
29626
|
-
"data-slot": "tooltip-content",
|
|
29627
|
-
sideOffset,
|
|
29628
|
-
className: cn(
|
|
29629
|
-
"z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
29630
|
-
className
|
|
29631
|
-
),
|
|
29632
|
-
...props,
|
|
29633
|
-
children: [
|
|
29634
|
-
/* @__PURE__ */ jsx76(PortalThemeSync, {}),
|
|
29635
|
-
children,
|
|
29636
|
-
/* @__PURE__ */ jsx76(
|
|
29637
|
-
dist_exports12.Arrow,
|
|
29638
|
-
{
|
|
29639
|
-
className: cn(
|
|
29640
|
-
"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"
|
|
29641
|
-
)
|
|
29642
|
-
}
|
|
29643
|
-
)
|
|
29644
|
-
]
|
|
29645
|
-
}
|
|
29646
|
-
) });
|
|
29647
|
-
}
|
|
29648
|
-
|
|
29649
|
-
// src/ui/tooltip-icon-button.tsx
|
|
29650
29662
|
import { jsx as jsx77, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
29651
29663
|
var TooltipIconButton = forwardRef29(
|
|
29652
29664
|
({ children, tooltip, side = "bottom", className, ...rest }, ref) => {
|
|
@@ -47367,7 +47379,7 @@ function Chat({
|
|
|
47367
47379
|
ThreadListItem,
|
|
47368
47380
|
{
|
|
47369
47381
|
disabled: sessionBusy || binding.sending || isSessionOccupied(chat, session2.id),
|
|
47370
|
-
|
|
47382
|
+
disabledReason: isSessionOccupied(chat, session2.id) ? "This conversation is already open in another tab." : void 0,
|
|
47371
47383
|
menu: (beginRename) => /* @__PURE__ */ jsxs32(Fragment18, { children: [
|
|
47372
47384
|
/* @__PURE__ */ jsx100(
|
|
47373
47385
|
DropdownMenuItem3,
|
package/dist/styles.css
CHANGED
|
@@ -939,6 +939,10 @@
|
|
|
939
939
|
max-width: 85%;
|
|
940
940
|
}
|
|
941
941
|
|
|
942
|
+
.nexface-ui .nxf-max-w-\[min\(20rem\,var\(--radix-tooltip-content-available-width\)\)\] {
|
|
943
|
+
max-width: min(20rem, var(--radix-tooltip-content-available-width));
|
|
944
|
+
}
|
|
945
|
+
|
|
942
946
|
.nexface-ui .nxf-max-w-full {
|
|
943
947
|
max-width: 100%;
|
|
944
948
|
}
|
|
@@ -6,8 +6,8 @@ export declare function ThreadListSearch({ value, onValueChange, }: {
|
|
|
6
6
|
value: string;
|
|
7
7
|
onValueChange(value: string): void;
|
|
8
8
|
}): import("react").JSX.Element;
|
|
9
|
-
export declare function ThreadListItem({ disabled, menu,
|
|
9
|
+
export declare function ThreadListItem({ disabled, menu, disabledReason, }: {
|
|
10
10
|
disabled: boolean;
|
|
11
|
-
|
|
11
|
+
disabledReason?: string | undefined;
|
|
12
12
|
menu: (beginRename: () => void) => ReactNode;
|
|
13
13
|
}): import("react").JSX.Element;
|
|
@@ -6,6 +6,7 @@ import { ThreadListItemPrimitive, ThreadListPrimitive, useAui, useAuiState, } fr
|
|
|
6
6
|
import { Loader2Icon, MoreHorizontalIcon, PlusIcon, SearchIcon } from "lucide-react";
|
|
7
7
|
import { Input } from "./input.js";
|
|
8
8
|
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent } from "./dropdown-menu.js";
|
|
9
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.js";
|
|
9
10
|
import { cn } from "./utils.js";
|
|
10
11
|
export function ThreadListRoot({ className, ...props }) {
|
|
11
12
|
return (_jsx(ThreadListPrimitive.Root, { "data-slot": "aui_thread-list-root", className: cn("flex flex-col gap-0.5", className), ...props }));
|
|
@@ -16,7 +17,7 @@ export function ThreadListNew(props) {
|
|
|
16
17
|
export function ThreadListSearch({ value, onValueChange, }) {
|
|
17
18
|
return (_jsxs("div", { "data-slot": "aui_thread-list-search", className: cn("relative px-0.5 py-1"), children: [_jsx(SearchIcon, { "data-slot": "aui_thread-list-search-icon", className: cn("text-muted-foreground pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2") }), _jsx(Input, { type: "search", value: value, onChange: (event) => onValueChange(event.target.value), "aria-label": "\u641C\u7D22\u4F1A\u8BDD", placeholder: "\u641C\u7D22\u4F1A\u8BDD", className: cn("border-foreground/10 bg-background h-8 ps-8 text-[13px] md:text-[13px]") })] }));
|
|
18
19
|
}
|
|
19
|
-
export function ThreadListItem({ disabled, menu,
|
|
20
|
+
export function ThreadListItem({ disabled, menu, disabledReason, }) {
|
|
20
21
|
const isRunning = useAuiState((s) => s.threadListItem.isRunning);
|
|
21
22
|
const title = useAuiState((s) => s.threadListItem.title);
|
|
22
23
|
const [isRenaming, setIsRenaming] = useState(false);
|
|
@@ -28,10 +29,13 @@ export function ThreadListItem({ disabled, menu, title: reason, }) {
|
|
|
28
29
|
triggerRef.current?.focus();
|
|
29
30
|
}
|
|
30
31
|
}, [isRenaming]);
|
|
31
|
-
|
|
32
|
+
const item = (_jsxs(ThreadListItemPrimitive.Root, { "data-slot": "aui_thread-list-item", "data-disabled": disabled || undefined, className: cn("data-[disabled=true]:opacity-50 group data-active:bg-foreground/[0.06] hover:bg-foreground/[0.04] has-data-[state=open]:bg-foreground/[0.04] rounded-control relative flex h-8 shrink-0 items-center transition-colors"), children: [isRenaming ? (_jsx(ThreadListItemRename, { onDone: (focus) => {
|
|
32
33
|
restoreFocus.current = focus;
|
|
33
34
|
setIsRenaming(false);
|
|
34
35
|
} })) : (_jsxs(ThreadListItemPrimitive.Trigger, { ref: triggerRef, disabled: disabled, "data-slot": "aui_thread-list-item-trigger", className: cn("text-muted-foreground group-data-active:text-foreground hover:text-foreground flex h-full min-w-0 flex-1 items-center px-2 text-left text-[13px] transition-colors outline-none group-hover:pe-8 group-has-focus-visible:pe-8 group-has-data-[state=open]:pe-8 group-data-active:pe-8"), children: [isRunning && (_jsx(Loader2Icon, { "aria-hidden": true, className: cn("text-muted-foreground me-1.5 size-3.5 shrink-0 animate-spin") })), _jsx("span", { className: cn("min-w-0 flex-1 truncate"), children: _jsx(ThreadListItemPrimitive.Title, { fallback: "\u65B0\u4F1A\u8BDD" }) })] })), _jsxs(DropdownMenu, { modal: false, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("button", { type: "button", "aria-label": `管理 ${title}`, className: cn("text-muted-foreground hover:text-foreground absolute end-1 top-1/2 grid size-6 -translate-y-1/2 place-items-center rounded-sm opacity-0 transition-colors group-hover:opacity-100 group-has-focus-visible:opacity-100 group-data-active:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100"), children: _jsx(MoreHorizontalIcon, { className: cn("size-3.5") }) }) }), _jsx(DropdownMenuContent, { side: "right", align: "start", sideOffset: 6, children: menu(() => setIsRenaming(true)) })] })] }));
|
|
36
|
+
if (!disabledReason)
|
|
37
|
+
return item;
|
|
38
|
+
return (_jsx(TooltipProvider, { delayDuration: 300, skipDelayDuration: 0, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: item }), _jsx(TooltipContent, { side: "right", sideOffset: 8, className: cn("max-w-[min(20rem,var(--radix-tooltip-content-available-width))] break-words"), children: disabledReason })] }) }));
|
|
35
39
|
}
|
|
36
40
|
function ThreadListItemRename({ onDone }) {
|
|
37
41
|
const aui = useAui();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexface/chat",
|
|
3
|
-
"version": "0.1.21-alpha.
|
|
3
|
+
"version": "0.1.21-alpha.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@ag-ui/core": "0.0.59",
|
|
22
|
-
"@nexface/agent": "0.1.21-alpha.
|
|
22
|
+
"@nexface/agent": "0.1.21-alpha.3",
|
|
23
23
|
"class-variance-authority": "0.7.1",
|
|
24
24
|
"clsx": "2.1.1",
|
|
25
25
|
"fast-json-patch": "3.1.1",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"use-sync-external-store": "1.7.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@nexface/tools": "0.1.21-alpha.
|
|
31
|
+
"@nexface/tools": "0.1.21-alpha.3",
|
|
32
32
|
"react": ">=17",
|
|
33
33
|
"react-dom": ">=17"
|
|
34
34
|
},
|