@assistant-ui/react 0.5.49 → 0.5.51

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.mjs CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  toLanguageModelMessages,
11
11
  toLanguageModelTools,
12
12
  toolResultStream
13
- } from "./chunk-TZO3D3VQ.mjs";
13
+ } from "./chunk-ZQNZLTZL.mjs";
14
14
  import {
15
15
  __export
16
16
  } from "./chunk-BJPOCE4O.mjs";
@@ -2869,9 +2869,9 @@ var createActionButton = (displayName, useActionButton, forwardProps = []) => {
2869
2869
  Primitive3.button,
2870
2870
  {
2871
2871
  type: "button",
2872
- disabled: !callback,
2873
2872
  ...primitiveProps,
2874
2873
  ref: forwardedRef,
2874
+ disabled: primitiveProps.disabled || !callback,
2875
2875
  onClick: composeEventHandlers(primitiveProps.onClick, () => {
2876
2876
  callback?.();
2877
2877
  })
@@ -4049,6 +4049,8 @@ var useMessageContext2 = (messageIndex) => {
4049
4049
  throw new Error(
4050
4050
  "Tried to edit a non-user message. Editing is only supported for user messages. This is likely an internal bug in assistant-ui."
4051
4051
  );
4052
+ const previousText = getThreadMessageText(message);
4053
+ if (previousText === text) return;
4052
4054
  const nonTextParts = message.content.filter(
4053
4055
  (part) => part.type !== "text" && part.type !== "ui"
4054
4056
  );