@assistant-ui/react 0.5.17 → 0.5.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/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  <a href="https://assistant-ui.com/docs">Documentation</a> ·
8
8
  <a href="https://assistant-ui.com/examples">Examples</a> ·
9
9
  <a href="https://discord.gg/S9dwgCNEFs">Discord Community</a> ·
10
- <a href="https://cal.com/simon-farshid/assistant-ui">Enterprise inquiry</a>
10
+ <a href="https://cal.com/simon-farshid/assistant-ui">Contact Sales</a>
11
11
  </p>
12
12
 
13
13
  **assistant-ui** is a set of React components for AI chat, with integrations Langchain, Vercel AI SDK, TailwindCSS, shadcn-ui, react-markdown, react-syntax-highlighter, React Hook Form and more!
package/dist/index.d.mts CHANGED
@@ -661,7 +661,7 @@ declare class ExternalStoreThreadRuntime implements ReactThreadRuntime {
661
661
  cancel: boolean;
662
662
  copy: boolean;
663
663
  };
664
- messages: any[];
664
+ messages: ThreadMessage[];
665
665
  isDisabled: boolean;
666
666
  isRunning: boolean;
667
667
  constructor(store: ExternalStoreAdapter<any>);
@@ -1130,6 +1130,7 @@ declare const MessagePrimitiveIf: FC<MessagePrimitiveIfProps>;
1130
1130
 
1131
1131
  type MessagePrimitiveContentProps = {
1132
1132
  components?: {
1133
+ Empty?: TextContentPartComponent | undefined;
1133
1134
  Text?: TextContentPartComponent | undefined;
1134
1135
  Image?: ImageContentPartComponent | undefined;
1135
1136
  UI?: UIContentPartComponent | undefined;
package/dist/index.d.ts CHANGED
@@ -661,7 +661,7 @@ declare class ExternalStoreThreadRuntime implements ReactThreadRuntime {
661
661
  cancel: boolean;
662
662
  copy: boolean;
663
663
  };
664
- messages: any[];
664
+ messages: ThreadMessage[];
665
665
  isDisabled: boolean;
666
666
  isRunning: boolean;
667
667
  constructor(store: ExternalStoreAdapter<any>);
@@ -1130,6 +1130,7 @@ declare const MessagePrimitiveIf: FC<MessagePrimitiveIfProps>;
1130
1130
 
1131
1131
  type MessagePrimitiveContentProps = {
1132
1132
  components?: {
1133
+ Empty?: TextContentPartComponent | undefined;
1133
1134
  Text?: TextContentPartComponent | undefined;
1134
1135
  Image?: ImageContentPartComponent | undefined;
1135
1136
  UI?: UIContentPartComponent | undefined;
package/dist/index.js CHANGED
@@ -1486,6 +1486,7 @@ var defaultComponents = {
1486
1486
  };
1487
1487
  var MessageContentPartComponent = ({
1488
1488
  components: {
1489
+ Empty = defaultComponents.Text,
1489
1490
  Text: Text2 = defaultComponents.Text,
1490
1491
  Image: Image2 = defaultComponents.Image,
1491
1492
  UI = defaultComponents.UI,
@@ -1502,6 +1503,7 @@ var MessageContentPartComponent = ({
1502
1503
  case "text":
1503
1504
  if (status.type === "requires-action")
1504
1505
  throw new Error("Encountered unexpected requires-action status");
1506
+ if (part === EMPTY_CONTENT) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Empty, { part, status });
1505
1507
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text2, { part, status });
1506
1508
  case "image":
1507
1509
  if (status.type === "requires-action")
@@ -3832,9 +3834,11 @@ var hasUpcomingMessage = (isRunning, messages) => {
3832
3834
  var ExternalStoreThreadRuntime = class {
3833
3835
  constructor(store) {
3834
3836
  this.store = store;
3835
- this.isDisabled = store.isDisabled ?? false;
3836
- this.isRunning = store.isRunning ?? false;
3837
- this.messages = store.messages;
3837
+ this.updateData(
3838
+ store.isDisabled ?? false,
3839
+ store.isRunning ?? false,
3840
+ store.messages
3841
+ );
3838
3842
  this.useStore = (0, import_zustand14.create)(() => ({
3839
3843
  store
3840
3844
  }));
@@ -3852,9 +3856,9 @@ var ExternalStoreThreadRuntime = class {
3852
3856
  copy: this.store.onCopy !== null
3853
3857
  };
3854
3858
  }
3855
- messages;
3856
- isDisabled;
3857
- isRunning;
3859
+ messages = [];
3860
+ isDisabled = false;
3861
+ isRunning = false;
3858
3862
  getBranches(messageId) {
3859
3863
  return this.repository.getBranches(messageId);
3860
3864
  }