@assistant-ui/react 0.5.17 → 0.5.19

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.mjs CHANGED
@@ -1394,6 +1394,7 @@ var defaultComponents = {
1394
1394
  };
1395
1395
  var MessageContentPartComponent = ({
1396
1396
  components: {
1397
+ Empty = defaultComponents.Text,
1397
1398
  Text: Text2 = defaultComponents.Text,
1398
1399
  Image: Image2 = defaultComponents.Image,
1399
1400
  UI = defaultComponents.UI,
@@ -1410,6 +1411,7 @@ var MessageContentPartComponent = ({
1410
1411
  case "text":
1411
1412
  if (status.type === "requires-action")
1412
1413
  throw new Error("Encountered unexpected requires-action status");
1414
+ if (part === EMPTY_CONTENT) return /* @__PURE__ */ jsx16(Empty, { part, status });
1413
1415
  return /* @__PURE__ */ jsx16(Text2, { part, status });
1414
1416
  case "image":
1415
1417
  if (status.type === "requires-action")
@@ -3749,9 +3751,11 @@ var hasUpcomingMessage = (isRunning, messages) => {
3749
3751
  var ExternalStoreThreadRuntime = class {
3750
3752
  constructor(store) {
3751
3753
  this.store = store;
3752
- this.isDisabled = store.isDisabled ?? false;
3753
- this.isRunning = store.isRunning ?? false;
3754
- this.messages = store.messages;
3754
+ this.updateData(
3755
+ store.isDisabled ?? false,
3756
+ store.isRunning ?? false,
3757
+ store.messages
3758
+ );
3755
3759
  this.useStore = create14(() => ({
3756
3760
  store
3757
3761
  }));
@@ -3769,9 +3773,9 @@ var ExternalStoreThreadRuntime = class {
3769
3773
  copy: this.store.onCopy !== null
3770
3774
  };
3771
3775
  }
3772
- messages;
3773
- isDisabled;
3774
- isRunning;
3776
+ messages = [];
3777
+ isDisabled = false;
3778
+ isRunning = false;
3775
3779
  getBranches(messageId) {
3776
3780
  return this.repository.getBranches(messageId);
3777
3781
  }