stream-chat-react 13.6.0 → 13.6.2
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/components/Chat/hooks/useChat.js +1 -1
- package/dist/components/Message/utils.js +2 -2
- package/dist/components/TextareaComposer/TextareaComposer.js +20 -19
- package/dist/experimental/index.browser.cjs.map +1 -1
- package/dist/experimental/index.node.cjs.map +1 -1
- package/dist/index.browser.cjs +16 -16
- package/dist/index.browser.cjs.map +3 -3
- package/dist/index.node.cjs +16 -16
- package/dist/index.node.cjs.map +3 -3
- package/package.json +3 -3
package/dist/index.node.cjs
CHANGED
|
@@ -18116,13 +18116,13 @@ var getMessageActions = (actions, {
|
|
|
18116
18116
|
if (canReact && messageActions.indexOf(MESSAGE_ACTIONS.react) > -1) {
|
|
18117
18117
|
messageActionsAfterPermission.push(MESSAGE_ACTIONS.react);
|
|
18118
18118
|
}
|
|
18119
|
-
if (channelConfig?.["user_message_reminders"] && messageActions.indexOf(MESSAGE_ACTIONS.remindMe)) {
|
|
18119
|
+
if (channelConfig?.["user_message_reminders"] && messageActions.indexOf(MESSAGE_ACTIONS.remindMe) > -1) {
|
|
18120
18120
|
messageActionsAfterPermission.push(MESSAGE_ACTIONS.remindMe);
|
|
18121
18121
|
}
|
|
18122
18122
|
if (canReply && messageActions.indexOf(MESSAGE_ACTIONS.reply) > -1) {
|
|
18123
18123
|
messageActionsAfterPermission.push(MESSAGE_ACTIONS.reply);
|
|
18124
18124
|
}
|
|
18125
|
-
if (channelConfig?.["user_message_reminders"] && messageActions.indexOf(MESSAGE_ACTIONS.saveForLater)) {
|
|
18125
|
+
if (channelConfig?.["user_message_reminders"] && messageActions.indexOf(MESSAGE_ACTIONS.saveForLater) > -1) {
|
|
18126
18126
|
messageActionsAfterPermission.push(MESSAGE_ACTIONS.saveForLater);
|
|
18127
18127
|
}
|
|
18128
18128
|
return messageActionsAfterPermission;
|
|
@@ -35279,7 +35279,6 @@ var TextareaComposer = ({
|
|
|
35279
35279
|
event.preventDefault();
|
|
35280
35280
|
}
|
|
35281
35281
|
handleSubmit();
|
|
35282
|
-
textareaRef.current.selectionEnd = 0;
|
|
35283
35282
|
}
|
|
35284
35283
|
},
|
|
35285
35284
|
[
|
|
@@ -35302,7 +35301,7 @@ var TextareaComposer = ({
|
|
|
35302
35301
|
},
|
|
35303
35302
|
[onScroll, textComposer]
|
|
35304
35303
|
);
|
|
35305
|
-
const
|
|
35304
|
+
const setSelection = (0, import_react255.useCallback)(
|
|
35306
35305
|
(e) => {
|
|
35307
35306
|
onSelect?.(e);
|
|
35308
35307
|
textComposer.setSelection({
|
|
@@ -35312,12 +35311,6 @@ var TextareaComposer = ({
|
|
|
35312
35311
|
},
|
|
35313
35312
|
[onSelect, textComposer]
|
|
35314
35313
|
);
|
|
35315
|
-
(0, import_react255.useEffect)(() => {
|
|
35316
|
-
if (textareaRef.current && !isComposing) {
|
|
35317
|
-
textareaRef.current.selectionStart = selection.start;
|
|
35318
|
-
textareaRef.current.selectionEnd = selection.end;
|
|
35319
|
-
}
|
|
35320
|
-
}, [text7, textareaRef, selection.start, selection.end, isComposing]);
|
|
35321
35314
|
(0, import_react255.useEffect)(() => {
|
|
35322
35315
|
if (textComposer.suggestions) {
|
|
35323
35316
|
setFocusedItemIndex(0);
|
|
@@ -35328,11 +35321,18 @@ var TextareaComposer = ({
|
|
|
35328
35321
|
if (!textareaRef.current || textareaIsFocused || !focus) return;
|
|
35329
35322
|
textareaRef.current.focus();
|
|
35330
35323
|
}, [attachments, focus, quotedMessage, textareaRef]);
|
|
35331
|
-
(0, import_react255.
|
|
35324
|
+
(0, import_react255.useLayoutEffect)(() => {
|
|
35332
35325
|
const textarea = textareaRef.current;
|
|
35333
|
-
if (!textarea) return;
|
|
35334
|
-
textarea.value
|
|
35335
|
-
|
|
35326
|
+
if (!textarea || isComposing) return;
|
|
35327
|
+
if (textarea.value !== text7) {
|
|
35328
|
+
textarea.value = text7;
|
|
35329
|
+
}
|
|
35330
|
+
const length = textarea.value.length;
|
|
35331
|
+
const start2 = Math.max(0, Math.min(selection.start, length));
|
|
35332
|
+
const end = Math.max(start2, Math.min(selection.end, length));
|
|
35333
|
+
if (textarea.selectionStart === start2 && textarea.selectionEnd === end) return;
|
|
35334
|
+
textarea.setSelectionRange(start2, end, "forward");
|
|
35335
|
+
}, [text7, selection.start, selection.end, isComposing, textareaRef]);
|
|
35336
35336
|
return /* @__PURE__ */ import_react255.default.createElement(
|
|
35337
35337
|
"div",
|
|
35338
35338
|
{
|
|
@@ -35367,7 +35367,7 @@ var TextareaComposer = ({
|
|
|
35367
35367
|
onKeyDown: keyDownHandler,
|
|
35368
35368
|
onPaste,
|
|
35369
35369
|
onScroll: scrollHandler,
|
|
35370
|
-
onSelect:
|
|
35370
|
+
onSelect: setSelection,
|
|
35371
35371
|
placeholder: placeholder || t("Type your message"),
|
|
35372
35372
|
ref: (ref) => {
|
|
35373
35373
|
textareaRef.current = ref;
|
|
@@ -37987,7 +37987,7 @@ var useChat = ({
|
|
|
37987
37987
|
};
|
|
37988
37988
|
(0, import_react282.useEffect)(() => {
|
|
37989
37989
|
if (!client) return;
|
|
37990
|
-
const version = "13.6.
|
|
37990
|
+
const version = "13.6.2";
|
|
37991
37991
|
const userAgent = client.getUserAgent();
|
|
37992
37992
|
if (!userAgent.includes("stream-chat-react")) {
|
|
37993
37993
|
client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);
|