@mieweb/ui 0.6.1-dev.124 → 0.6.1-dev.125

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/index.cjs CHANGED
@@ -3123,6 +3123,8 @@ var MessageComposer = React48__namespace.forwardRef(
3123
3123
  onSend,
3124
3124
  onTypingStart,
3125
3125
  onTypingStop,
3126
+ value: controlledValue,
3127
+ onValueChange,
3126
3128
  placeholder = "Type a message...",
3127
3129
  maxLength = 1600,
3128
3130
  showCharacterCount = false,
@@ -3142,7 +3144,20 @@ var MessageComposer = React48__namespace.forwardRef(
3142
3144
  className
3143
3145
  }, ref) => {
3144
3146
  const textareaRef = React48__namespace.useRef(null);
3145
- const [content, setContent] = React48__namespace.useState("");
3147
+ const [internalContent, setInternalContent] = React48__namespace.useState("");
3148
+ const isControlled = controlledValue !== void 0;
3149
+ const content = isControlled ? controlledValue : internalContent;
3150
+ const setContent = React48__namespace.useCallback(
3151
+ (val) => {
3152
+ if (isControlled) {
3153
+ const newVal = typeof val === "function" ? val(controlledValue) : val;
3154
+ onValueChange?.(newVal);
3155
+ } else {
3156
+ setInternalContent(val);
3157
+ }
3158
+ },
3159
+ [isControlled, controlledValue, onValueChange]
3160
+ );
3146
3161
  const [attachments, setAttachments] = React48__namespace.useState(
3147
3162
  []
3148
3163
  );
@@ -4682,6 +4697,7 @@ function AIChat({
4682
4697
  height,
4683
4698
  composerProps,
4684
4699
  talkToText = false,
4700
+ onRecordingStart,
4685
4701
  onRecordingComplete,
4686
4702
  className,
4687
4703
  onSendMessage,
@@ -4845,6 +4861,7 @@ function AIChat({
4845
4861
  showPulse: false,
4846
4862
  showWaveform: true,
4847
4863
  disabled: isGenerating,
4864
+ onRecordingStart,
4848
4865
  onRecordingComplete
4849
4866
  }
4850
4867
  ) : void 0,