@poolse/react-native 3.10.2 → 3.10.3

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.d.cts CHANGED
@@ -210,6 +210,14 @@ interface MessageComposerProps {
210
210
  formattingToolbar?: boolean | readonly FormatKind[];
211
211
  /** Slash commands to suggest when the message starts with `/` (IN3). */
212
212
  commands?: readonly SlashCommand[];
213
+ /**
214
+ * Shows a mic in the send button's place while there is nothing to send
215
+ * (no text, no ready files, not editing); pressing it calls this, e.g. to
216
+ * start recording a voice message.
217
+ */
218
+ onMic?: () => void;
219
+ /** Drawn instead of the input row while set, e.g. a voice recording's bar. */
220
+ recordingBar?: ReactNode;
213
221
  }
214
222
  /**
215
223
  * `ConversationView` / `ThreadView`'s `beforeSend`: sees the message about
package/dist/index.d.ts CHANGED
@@ -210,6 +210,14 @@ interface MessageComposerProps {
210
210
  formattingToolbar?: boolean | readonly FormatKind[];
211
211
  /** Slash commands to suggest when the message starts with `/` (IN3). */
212
212
  commands?: readonly SlashCommand[];
213
+ /**
214
+ * Shows a mic in the send button's place while there is nothing to send
215
+ * (no text, no ready files, not editing); pressing it calls this, e.g. to
216
+ * start recording a voice message.
217
+ */
218
+ onMic?: () => void;
219
+ /** Drawn instead of the input row while set, e.g. a voice recording's bar. */
220
+ recordingBar?: ReactNode;
213
221
  }
214
222
  /**
215
223
  * `ConversationView` / `ThreadView`'s `beforeSend`: sees the message about
package/dist/index.js CHANGED
@@ -3232,7 +3232,9 @@ var MessageComposer = forwardRef(
3232
3232
  emojiPicker = true,
3233
3233
  accessory,
3234
3234
  formattingToolbar = false,
3235
- commands
3235
+ commands,
3236
+ onMic,
3237
+ recordingBar
3236
3238
  }, ref) {
3237
3239
  const theme = useTheme();
3238
3240
  const inputRef = useRef(null);
@@ -3427,7 +3429,7 @@ var MessageComposer = forwardRef(
3427
3429
  ...Array.isArray(formattingToolbar) ? { actions: formattingToolbar } : {}
3428
3430
  }
3429
3431
  ) : null,
3430
- /* @__PURE__ */ jsxs(View, { style: styles15.row, children: [
3432
+ recordingBar ? recordingBar : /* @__PURE__ */ jsxs(View, { style: styles15.row, children: [
3431
3433
  attachments && onAttachPress ? /* @__PURE__ */ jsx(
3432
3434
  Pressable,
3433
3435
  {
@@ -3481,7 +3483,18 @@ var MessageComposer = forwardRef(
3481
3483
  ]
3482
3484
  }
3483
3485
  ),
3484
- /* @__PURE__ */ jsx(
3486
+ onMic && !isEditing && value.trim().length === 0 && readyAttachmentIds.length === 0 && !isUploading ? /* @__PURE__ */ jsx(
3487
+ Pressable,
3488
+ {
3489
+ onPress: onMic,
3490
+ disabled,
3491
+ hitSlop: 8,
3492
+ style: [styles15.sendBtn, { backgroundColor: theme.colors.accent }],
3493
+ accessibilityRole: "button",
3494
+ accessibilityLabel: "Record a voice message",
3495
+ children: /* @__PURE__ */ jsx(PoolseIcon, { name: "mic", size: 18, color: theme.colors.accentText, label: null })
3496
+ }
3497
+ ) : /* @__PURE__ */ jsx(
3485
3498
  Pressable,
3486
3499
  {
3487
3500
  onPress: handleSend,