stream-chat 9.18.0 → 9.19.0
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/cjs/index.browser.cjs +22 -14
- package/dist/cjs/index.browser.cjs.map +2 -2
- package/dist/cjs/index.node.cjs +22 -14
- package/dist/cjs/index.node.cjs.map +2 -2
- package/dist/esm/index.js +22 -14
- package/dist/esm/index.js.map +2 -2
- package/dist/types/client.d.ts +2 -0
- package/dist/types/types.d.ts +1 -0
- package/dist/types/utils.d.ts +1 -0
- package/package.json +1 -1
- package/src/channel.ts +10 -2
- package/src/messageComposer/textComposer.ts +3 -6
- package/src/search/BaseSearchSource.ts +1 -1
- package/src/types.ts +1 -0
- package/src/utils.ts +8 -8
|
@@ -2754,16 +2754,16 @@ function formatMessage(message) {
|
|
|
2754
2754
|
if (!msg) return null;
|
|
2755
2755
|
return {
|
|
2756
2756
|
...msg,
|
|
2757
|
-
created_at:
|
|
2758
|
-
deleted_at:
|
|
2759
|
-
pinned_at:
|
|
2757
|
+
created_at: msg.created_at ? new Date(msg.created_at) : /* @__PURE__ */ new Date(),
|
|
2758
|
+
deleted_at: msg.deleted_at ? new Date(msg.deleted_at) : null,
|
|
2759
|
+
pinned_at: msg.pinned_at ? new Date(msg.pinned_at) : null,
|
|
2760
2760
|
reaction_groups: maybeGetReactionGroupsFallback(
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2761
|
+
msg.reaction_groups,
|
|
2762
|
+
msg.reaction_counts,
|
|
2763
|
+
msg.reaction_scores
|
|
2764
2764
|
),
|
|
2765
|
-
status:
|
|
2766
|
-
updated_at:
|
|
2765
|
+
status: msg.status || "received",
|
|
2766
|
+
updated_at: msg.updated_at ? new Date(msg.updated_at) : /* @__PURE__ */ new Date()
|
|
2767
2767
|
};
|
|
2768
2768
|
};
|
|
2769
2769
|
return {
|
|
@@ -6850,7 +6850,7 @@ var BaseSearchSourceBase = class {
|
|
|
6850
6850
|
updatePaginationStateFromQuery(result) {
|
|
6851
6851
|
const { items, next } = result;
|
|
6852
6852
|
const stateUpdate = {};
|
|
6853
|
-
if (
|
|
6853
|
+
if (Object.prototype.hasOwnProperty.call(result, "next")) {
|
|
6854
6854
|
stateUpdate.next = next;
|
|
6855
6855
|
stateUpdate.hasNext = !!next;
|
|
6856
6856
|
} else {
|
|
@@ -8038,8 +8038,8 @@ var TextComposer = class {
|
|
|
8038
8038
|
0,
|
|
8039
8039
|
typeof maxLengthOnEdit === "number" ? maxLengthOnEdit : textBeforeTrim.length
|
|
8040
8040
|
);
|
|
8041
|
-
const expectedCursorPosition =
|
|
8042
|
-
const cursorPosition = expectedCursorPosition
|
|
8041
|
+
const expectedCursorPosition = finalSelection.start + text.length;
|
|
8042
|
+
const cursorPosition = Math.min(expectedCursorPosition, finalText.length);
|
|
8043
8043
|
await this.handleChange({
|
|
8044
8044
|
text: finalText,
|
|
8045
8045
|
selection: {
|
|
@@ -10950,13 +10950,21 @@ var Channel = class {
|
|
|
10950
10950
|
}
|
|
10951
10951
|
break;
|
|
10952
10952
|
case "channel.hidden":
|
|
10953
|
-
channel.data = {
|
|
10953
|
+
channel.data = {
|
|
10954
|
+
...channel.data,
|
|
10955
|
+
blocked: !!event.channel?.blocked,
|
|
10956
|
+
hidden: true
|
|
10957
|
+
};
|
|
10954
10958
|
if (event.clear_history) {
|
|
10955
10959
|
channelState.clearMessages();
|
|
10956
10960
|
}
|
|
10957
10961
|
break;
|
|
10958
10962
|
case "channel.visible":
|
|
10959
|
-
channel.data = {
|
|
10963
|
+
channel.data = {
|
|
10964
|
+
...channel.data,
|
|
10965
|
+
blocked: !!event.channel?.blocked,
|
|
10966
|
+
hidden: false
|
|
10967
|
+
};
|
|
10960
10968
|
this.getClient().offlineDb?.handleChannelVisibilityEvent({ event });
|
|
10961
10969
|
break;
|
|
10962
10970
|
case "user.banned":
|
|
@@ -16212,7 +16220,7 @@ var StreamChat = class _StreamChat {
|
|
|
16212
16220
|
if (this.userAgent) {
|
|
16213
16221
|
return this.userAgent;
|
|
16214
16222
|
}
|
|
16215
|
-
const version = "9.
|
|
16223
|
+
const version = "9.19.0";
|
|
16216
16224
|
const clientBundle = "browser-cjs";
|
|
16217
16225
|
let userAgentString = "";
|
|
16218
16226
|
if (this.sdkIdentifier) {
|