teodor-new-chat-ui 4.3.481 → 4.3.482

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.
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import type { ChatMessage, DefaultMessage } from "@/types";
7
7
  import type { MessageComponentProps } from "../message/MessageComponent";
8
- import type { ToolRendererMap, ToolArtifactRendererMap } from "../message/tool/ToolComponent";
8
+ import type { ToolRendererMap, ToolArtifactRendererMap } from "../message/ToolComponent";
9
9
  export interface ChatInterfaceProps {
10
10
  className?: string;
11
11
  placeholder?: string;
@@ -49,4 +49,4 @@ export interface ChatInterfaceProps {
49
49
  defaultMessage?: string | null;
50
50
  }
51
51
  export declare function ChatInterface({ className, placeholder, autoFocus, maxHeight, streamingDebounceMs, streamingThrottleMs, followNewMessages, enableFileUpload, enableExcelUpload, enableMessageEditing, showToolMessages, toolRenderers, toolArtifactRenderers, payloadExtras, customStyles, messageCustomStyles, onMessageSent, onExcelUploadSuccess, onError, defaultMessage, }: ChatInterfaceProps): import("react/jsx-runtime").JSX.Element;
52
- export type { ToolRendererMap, ToolArtifactRendererMap, ToolArtifactRendererContext, } from "../message/tool/ToolComponent";
52
+ export type { ToolRendererMap, ToolArtifactRendererMap, ToolArtifactRendererContext, } from "../message/ToolComponent";
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import type { ChatMessage, DefaultMessage, PendingInterrupt } from "@/types";
5
5
  import type { CheckpointMeta, EditMeta } from "@/features/checkpoint/types";
6
- import type { ToolRendererMap, ToolArtifactRendererMap } from "./tool/ToolComponent";
6
+ import type { ToolRendererMap, ToolArtifactRendererMap } from "./ToolComponent";
7
7
  export interface MessageComponentProps {
8
8
  message: ChatMessage | DefaultMessage;
9
9
  messageIndex: number;
@@ -3,7 +3,7 @@ import type { EditMeta, TimelineCheckpoint } from "@/features/checkpoint/types";
3
3
  import type { CheckpointIndex } from "@/features/checkpoint/utils/checkpointIndex";
4
4
  import React from "react";
5
5
  import type { MessageComponentProps } from "./MessageComponent";
6
- import type { ToolRendererMap, ToolArtifactRendererMap } from "./tool/ToolComponent";
6
+ import type { ToolRendererMap, ToolArtifactRendererMap } from "./ToolComponent";
7
7
  export interface MessageListProps {
8
8
  messages: (ChatMessage | DefaultMessage)[];
9
9
  isStreaming: boolean;
@@ -3,7 +3,7 @@ import type { EditMeta } from "@/features/checkpoint/types";
3
3
  import { type CheckpointIndex } from "@/features/checkpoint/utils/checkpointIndex";
4
4
  import type { MessageComponentProps } from "./MessageComponent";
5
5
  import React from "react";
6
- import type { ToolRendererMap, ToolArtifactRendererMap } from "./tool/ToolComponent";
6
+ import type { ToolRendererMap, ToolArtifactRendererMap } from "./ToolComponent";
7
7
  export declare const getMessageDomKey: (message: ChatMessage | DefaultMessage | undefined, index: number) => string;
8
8
  export interface MessageRowProps {
9
9
  message: ChatMessage | DefaultMessage;
@@ -1,4 +1,4 @@
1
- export { PlotArtifact } from "./tool/renderers/ArtifactTypes/PlotArtifact";
1
+ export { PlotArtifact } from "./renderers/tool/artifacts/ArtifactTypes/PlotArtifact";
2
2
  export { useFilePreview, useParsedMessageContent } from "./hooks";
3
3
  export { MarkdownContent } from "./markdown";
4
4
  export type { MarkdownContentProps } from "./markdown";
@@ -10,4 +10,4 @@ export { getMessageDomKey, MessageRow } from "./MessageRow";
10
10
  export type { MessageRowProps } from "./MessageRow";
11
11
  export { FileViewerModal } from "./modals";
12
12
  export { ArtifactRenderer, InterruptPartRenderer, SimpleJsonView, StreamProgress, ThinkingIndicator, ToolComponent, UserTextContent } from "./renderers";
13
- export type { ToolRenderer, ToolRendererMap, ToolRendererContext, ToolArtifactRenderer, ToolArtifactRendererMap, ToolArtifactRendererContext, } from "./tool/ToolComponent";
13
+ export type { ToolRenderer, ToolRendererMap, ToolRendererContext, ToolArtifactRenderer, ToolArtifactRendererMap, ToolArtifactRendererContext, } from "./ToolComponent";
@@ -1,6 +1,6 @@
1
1
  import { MouseEvent as ReactMouseEvent } from "react";
2
2
  import type { ChatMessage, DefaultMessage, MessagePart } from "@/types";
3
- import type { ToolRendererMap, ToolArtifactRendererMap } from "../tool/ToolComponent";
3
+ import type { ToolRendererMap, ToolArtifactRendererMap } from "../ToolComponent";
4
4
  export interface MessageContentProps {
5
5
  message: ChatMessage | DefaultMessage;
6
6
  isToolMessage: boolean;
@@ -1,9 +1,9 @@
1
- export { ArtifactRenderer } from "../tool/renderers/ArtifactRenderer";
2
- export { InterruptPartRenderer } from "../tool/renderers/InterruptPartRenderer";
3
- export { SimpleJsonView } from "../tool/renderers/SimpleJsonView";
4
- export { StreamProgress } from "../tool/renderers/StreamProgress";
1
+ export { ArtifactRenderer } from "./tool/artifacts/ArtifactRenderer";
2
+ export { SimpleJsonView } from "./tool/content/SimpleJsonView";
3
+ export { StreamProgress } from "./tool/content/StreamProgress";
4
+ export { InterruptPartRenderer } from "./user/InterruptPartRenderer";
5
5
  export { ThinkingIndicator } from "./shared/ThinkingIndicator";
6
- export { UserTextContent } from "./shared/UserTextContent";
7
- export { ToolComponent } from "../tool/ToolComponent";
6
+ export { UserTextContent } from "./user/UserTextContent";
7
+ export { ToolComponent } from "../ToolComponent";
8
8
  export { MessageContent } from "./MessageContent";
9
9
  export { MessageHeader } from "./MessageHeader";
package/dist/index.esm.js CHANGED
@@ -14148,6 +14148,51 @@ function cE({ artifact: e, idx: t = 0 }) {
14148
14148
  /* @__PURE__ */ u.jsx("code", { className: "font-mono", children: e.type || "unknown" })
14149
14149
  ] }) }) : null;
14150
14150
  }
14151
+ const uE = "prose prose-sm max-w-none break-words dark:prose-invert prose-headings:break-words prose-p:break-words prose-li:break-words prose-td:break-words prose-th:break-words prose-a:break-all prose-code:break-words prose-blockquote:break-words";
14152
+ function pi({ data: e }) {
14153
+ return Array.isArray(e) ? e.every((n) => n === null || ["string", "number", "boolean"].includes(typeof n)) ? /* @__PURE__ */ u.jsx("div", { className: uE, children: /* @__PURE__ */ u.jsx("ul", { className: "list-disc pl-5", children: e.map((n, r) => /* @__PURE__ */ u.jsx("li", { children: String(n) }, r)) }) }) : /* @__PURE__ */ u.jsx("pre", { className: "font-mono text-xs bg-background/50 rounded border p-2 whitespace-pre-wrap break-words", children: Ar(e) }) : /* @__PURE__ */ u.jsx("pre", { className: "font-mono text-xs bg-background/50 rounded border p-2 whitespace-pre-wrap break-words", children: Ar(e) });
14154
+ }
14155
+ function dE({ message: e, isStreaming: t = !1 }) {
14156
+ const n = e.name ?? "tool", r = Be(() => {
14157
+ const i = e.additionalKwargs ?? {};
14158
+ return Array.isArray(i.toolProgress) ? [...i.toolProgress] : [];
14159
+ }, [e]), s = r.some(
14160
+ (i) => i.type === "tool.start" || i.type === "tool.call" || i.type === "message.start"
14161
+ ) ? `Running ${n}…` : void 0;
14162
+ return t || r.length > 0 ? /* @__PURE__ */ u.jsxs("div", { className: "space-y-2", children: [
14163
+ /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-xs uppercase tracking-wide text-muted-foreground", children: [
14164
+ t && /* @__PURE__ */ u.jsx(ds, { className: "h-3 w-3 animate-spin" }),
14165
+ /* @__PURE__ */ u.jsx("span", { children: s ?? `Running ${n}…` })
14166
+ ] }),
14167
+ r.length > 0 && /* @__PURE__ */ u.jsx("div", { className: "space-y-2 text-xs text-muted-foreground", children: r.map((i, l) => {
14168
+ var c;
14169
+ return /* @__PURE__ */ u.jsxs(
14170
+ "div",
14171
+ {
14172
+ className: "rounded border border-current/10 bg-muted/60 p-2 text-[11px] leading-snug",
14173
+ children: [
14174
+ /* @__PURE__ */ u.jsxs("div", { className: "mb-1 flex items-center justify-between text-[8px] uppercase tracking-wide text-muted-foreground", children: [
14175
+ /* @__PURE__ */ u.jsx("span", { children: ((c = i.type) == null ? void 0 : c.replace(/\./g, " ")) ?? "progress" }),
14176
+ /* @__PURE__ */ u.jsx("span", { children: i.idx ?? l + 1 })
14177
+ ] }),
14178
+ i.content && /* @__PURE__ */ u.jsx("p", { className: "mt-1 text-[12px] text-foreground/90", children: i.content }),
14179
+ /* @__PURE__ */ u.jsxs("div", { className: "mt-1 flex flex-wrap gap-2 text-[10px] opacity-70", children: [
14180
+ typeof i.factsFound == "number" && /* @__PURE__ */ u.jsxs("span", { children: [
14181
+ "Facts found: ",
14182
+ i.factsFound
14183
+ ] }),
14184
+ typeof i.isSufficient == "boolean" && /* @__PURE__ */ u.jsxs("span", { children: [
14185
+ "Research ",
14186
+ i.isSufficient ? "sufficient" : "needs more data"
14187
+ ] })
14188
+ ] })
14189
+ ]
14190
+ },
14191
+ `tool-progress-${n}-${l}`
14192
+ );
14193
+ }) })
14194
+ ] }) : null;
14195
+ }
14151
14196
  const ph = h.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
14152
14197
  "div",
14153
14198
  {
@@ -14201,7 +14246,7 @@ const vh = h.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
14201
14246
  }
14202
14247
  ));
14203
14248
  vh.displayName = "CardFooter";
14204
- function uE({
14249
+ function fE({
14205
14250
  interruptPart: e,
14206
14251
  onApprove: t,
14207
14252
  onReject: n,
@@ -14259,51 +14304,6 @@ function uE({
14259
14304
  }
14260
14305
  );
14261
14306
  }
14262
- const dE = "prose prose-sm max-w-none break-words dark:prose-invert prose-headings:break-words prose-p:break-words prose-li:break-words prose-td:break-words prose-th:break-words prose-a:break-all prose-code:break-words prose-blockquote:break-words";
14263
- function pi({ data: e }) {
14264
- return Array.isArray(e) ? e.every((n) => n === null || ["string", "number", "boolean"].includes(typeof n)) ? /* @__PURE__ */ u.jsx("div", { className: dE, children: /* @__PURE__ */ u.jsx("ul", { className: "list-disc pl-5", children: e.map((n, r) => /* @__PURE__ */ u.jsx("li", { children: String(n) }, r)) }) }) : /* @__PURE__ */ u.jsx("pre", { className: "font-mono text-xs bg-background/50 rounded border p-2 whitespace-pre-wrap break-words", children: Ar(e) }) : /* @__PURE__ */ u.jsx("pre", { className: "font-mono text-xs bg-background/50 rounded border p-2 whitespace-pre-wrap break-words", children: Ar(e) });
14265
- }
14266
- function fE({ message: e, isStreaming: t = !1 }) {
14267
- const n = e.name ?? "tool", r = Be(() => {
14268
- const i = e.additionalKwargs ?? {};
14269
- return Array.isArray(i.toolProgress) ? [...i.toolProgress] : [];
14270
- }, [e]), s = r.some(
14271
- (i) => i.type === "tool.start" || i.type === "tool.call" || i.type === "message.start"
14272
- ) ? `Running ${n}…` : void 0;
14273
- return t || r.length > 0 ? /* @__PURE__ */ u.jsxs("div", { className: "space-y-2", children: [
14274
- /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-xs uppercase tracking-wide text-muted-foreground", children: [
14275
- t && /* @__PURE__ */ u.jsx(ds, { className: "h-3 w-3 animate-spin" }),
14276
- /* @__PURE__ */ u.jsx("span", { children: s ?? `Running ${n}…` })
14277
- ] }),
14278
- r.length > 0 && /* @__PURE__ */ u.jsx("div", { className: "space-y-2 text-xs text-muted-foreground", children: r.map((i, l) => {
14279
- var c;
14280
- return /* @__PURE__ */ u.jsxs(
14281
- "div",
14282
- {
14283
- className: "rounded border border-current/10 bg-muted/60 p-2 text-[11px] leading-snug",
14284
- children: [
14285
- /* @__PURE__ */ u.jsxs("div", { className: "mb-1 flex items-center justify-between text-[8px] uppercase tracking-wide text-muted-foreground", children: [
14286
- /* @__PURE__ */ u.jsx("span", { children: ((c = i.type) == null ? void 0 : c.replace(/\./g, " ")) ?? "progress" }),
14287
- /* @__PURE__ */ u.jsx("span", { children: i.idx ?? l + 1 })
14288
- ] }),
14289
- i.content && /* @__PURE__ */ u.jsx("p", { className: "mt-1 text-[12px] text-foreground/90", children: i.content }),
14290
- /* @__PURE__ */ u.jsxs("div", { className: "mt-1 flex flex-wrap gap-2 text-[10px] opacity-70", children: [
14291
- typeof i.factsFound == "number" && /* @__PURE__ */ u.jsxs("span", { children: [
14292
- "Facts found: ",
14293
- i.factsFound
14294
- ] }),
14295
- typeof i.isSufficient == "boolean" && /* @__PURE__ */ u.jsxs("span", { children: [
14296
- "Research ",
14297
- i.isSufficient ? "sufficient" : "needs more data"
14298
- ] })
14299
- ] })
14300
- ]
14301
- },
14302
- `tool-progress-${n}-${l}`
14303
- );
14304
- }) })
14305
- ] }) : null;
14306
- }
14307
14307
  function pE({ className: e }) {
14308
14308
  const [t, n] = pe(0);
14309
14309
  return tt(() => {
@@ -14620,7 +14620,7 @@ function yE({
14620
14620
  })) ?? null;
14621
14621
  return /* @__PURE__ */ u.jsxs("div", { className: "space-y-2", children: [
14622
14622
  a && (w ?? /* @__PURE__ */ u.jsx(cE, { artifact: a, idx: 0 })),
14623
- /* @__PURE__ */ u.jsx(fE, { message: e, isStreaming: n }),
14623
+ /* @__PURE__ */ u.jsx(dE, { message: e, isStreaming: n }),
14624
14624
  t === "expanded" && /* @__PURE__ */ u.jsx(u.Fragment, { children: x ?? f() })
14625
14625
  ] });
14626
14626
  }
@@ -14852,7 +14852,7 @@ function CE({
14852
14852
  (P == null ? void 0 : P.id) ?? (P == null ? void 0 : P.interrupt_id)
14853
14853
  ), K = !!(_ && D && D === _), J = K ? L ?? (P == null ? void 0 : P.value) : P == null ? void 0 : P.value, oe = D ? { ...P, id: D, interrupt_id: D } : P;
14854
14854
  return /* @__PURE__ */ u.jsx(
14855
- uE,
14855
+ fE,
14856
14856
  {
14857
14857
  interruptPart: oe,
14858
14858
  onApprove: x,
@@ -19922,7 +19922,7 @@ export {
19922
19922
  WC as FileViewerModal,
19923
19923
  Xv as HISTORY_TIMEOUT_MS,
19924
19924
  Zh as Input,
19925
- uE as InterruptPartRenderer,
19925
+ fE as InterruptPartRenderer,
19926
19926
  Ek as Label,
19927
19927
  Rr as MarkdownContent,
19928
19928
  _l as MessageComponent,
@@ -19947,7 +19947,7 @@ export {
19947
19947
  I1 as SimpleChat,
19948
19948
  pi as SimpleJsonView,
19949
19949
  W1 as Sonner,
19950
- fE as StreamProgress,
19950
+ dE as StreamProgress,
19951
19951
  gR as Switch,
19952
19952
  ip as Textarea,
19953
19953
  pE as ThinkingIndicator,