stream-chat 9.43.0 → 9.43.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/cjs/index.browser.js +17 -13
- package/dist/cjs/index.browser.js.map +2 -2
- package/dist/cjs/index.node.js +22 -13
- package/dist/cjs/index.node.js.map +2 -2
- package/dist/esm/index.mjs +17 -13
- package/dist/esm/index.mjs.map +2 -2
- package/dist/types/client.d.ts +8 -6
- package/dist/types/messageComposer/attachmentManager.d.ts +1 -1
- package/dist/types/messageComposer/middleware/textComposer/index.d.ts +1 -0
- package/dist/types/types.d.ts +140 -19
- package/dist/types/utils.d.ts +4 -2
- package/package.json +1 -1
- package/src/client.ts +22 -17
- package/src/connection.ts +5 -4
- package/src/messageComposer/MessageComposerEffectHandlers.ts +2 -0
- package/src/messageComposer/attachmentManager.ts +1 -2
- package/src/messageComposer/middleware/textComposer/index.ts +1 -0
- package/src/types.ts +160 -19
|
@@ -182,12 +182,15 @@ __export(index_exports, {
|
|
|
182
182
|
defaultPollFieldChangeEventValidators: () => defaultPollFieldChangeEventValidators,
|
|
183
183
|
encodeBase64: () => encodeBase64,
|
|
184
184
|
ensureIsLocalAttachment: () => ensureIsLocalAttachment,
|
|
185
|
+
escapeCommandRegExp: () => escapeCommandRegExp,
|
|
185
186
|
extractPollData: () => extractPollData,
|
|
186
187
|
extractPollEnrichedData: () => extractPollEnrichedData,
|
|
187
188
|
formatMessage: () => formatMessage,
|
|
188
189
|
generateFileName: () => generateFileName,
|
|
189
190
|
getAttachmentTypeFromMimeType: () => getAttachmentTypeFromMimeType,
|
|
191
|
+
getCompleteCommandInString: () => getCompleteCommandInString,
|
|
190
192
|
getExtensionFromMimeType: () => getExtensionFromMimeType,
|
|
193
|
+
getRawCommandName: () => getRawCommandName,
|
|
191
194
|
getTokenizedSuggestionDisplayName: () => getTokenizedSuggestionDisplayName,
|
|
192
195
|
getTriggerCharWithToken: () => getTriggerCharWithToken,
|
|
193
196
|
insertItemWithTrigger: () => insertItemWithTrigger,
|
|
@@ -219,6 +222,7 @@ __export(index_exports, {
|
|
|
219
222
|
localMessageToNewMessagePayload: () => localMessageToNewMessagePayload,
|
|
220
223
|
logChatPromiseExecution: () => logChatPromiseExecution,
|
|
221
224
|
mapPollStateToResponse: () => mapPollStateToResponse,
|
|
225
|
+
notifyCommandDisabled: () => notifyCommandDisabled,
|
|
222
226
|
pollCompositionStateProcessors: () => pollCompositionStateProcessors,
|
|
223
227
|
pollStateChangeValidators: () => pollStateChangeValidators,
|
|
224
228
|
postInsights: () => postInsights,
|
|
@@ -226,6 +230,7 @@ __export(index_exports, {
|
|
|
226
230
|
readFileAsArrayBuffer: () => readFileAsArrayBuffer,
|
|
227
231
|
removeDiacritics: () => removeDiacritics,
|
|
228
232
|
replaceWordWithEntity: () => replaceWordWithEntity,
|
|
233
|
+
stripCommandFromText: () => stripCommandFromText,
|
|
229
234
|
textIsEmpty: () => textIsEmpty,
|
|
230
235
|
timeLeftMs: () => timeLeftMs
|
|
231
236
|
});
|
|
@@ -3275,7 +3280,7 @@ var _AttachmentManager = class _AttachmentManager {
|
|
|
3275
3280
|
this.setCustomUploadFn = (doUploadRequest) => {
|
|
3276
3281
|
this.composer.updateConfig({ attachments: { doUploadRequest } });
|
|
3277
3282
|
};
|
|
3278
|
-
this.cancelAttachmentUploads = (attachments) => {
|
|
3283
|
+
this.cancelAttachmentUploads = (attachments = this.attachments) => {
|
|
3279
3284
|
for (const { localMetadata } of attachments) {
|
|
3280
3285
|
this.client.uploadManager.deleteUploadRecord(localMetadata.id);
|
|
3281
3286
|
}
|
|
@@ -3293,7 +3298,6 @@ var _AttachmentManager = class _AttachmentManager {
|
|
|
3293
3298
|
};
|
|
3294
3299
|
};
|
|
3295
3300
|
this.initState = ({ message } = {}) => {
|
|
3296
|
-
this.cancelAttachmentUploads(this.attachments);
|
|
3297
3301
|
this.state.next(initState({ message }));
|
|
3298
3302
|
};
|
|
3299
3303
|
this.getSnapshot = () => {
|
|
@@ -4160,7 +4164,9 @@ var applyCommandActivationEffect = (effect, composer) => {
|
|
|
4160
4164
|
selection: { start: 0, end: 0 },
|
|
4161
4165
|
text: ""
|
|
4162
4166
|
});
|
|
4167
|
+
const attachmentsToCancel = composer.attachmentManager.attachments;
|
|
4163
4168
|
composer.attachmentManager.initState();
|
|
4169
|
+
composer.attachmentManager.cancelAttachmentUploads(attachmentsToCancel);
|
|
4164
4170
|
composer.linkPreviewsManager.initState();
|
|
4165
4171
|
composer.locationComposer.initState();
|
|
4166
4172
|
composer.pollComposer.initState();
|
|
@@ -10455,8 +10461,9 @@ var StableWSConnection = class {
|
|
|
10455
10461
|
this.onmessage = (wsID, event) => {
|
|
10456
10462
|
if (this.wsID !== wsID) return;
|
|
10457
10463
|
this._log("onmessage() - onmessage callback", { event, wsID });
|
|
10458
|
-
|
|
10459
|
-
|
|
10464
|
+
if (typeof event.data !== "string") return;
|
|
10465
|
+
const data = JSON.parse(event.data);
|
|
10466
|
+
if (!this.isResolved) {
|
|
10460
10467
|
this.isResolved = true;
|
|
10461
10468
|
if (data.error) {
|
|
10462
10469
|
this.rejectPromise?.(this._errorFromWSEvent(data, false));
|
|
@@ -10466,10 +10473,10 @@ var StableWSConnection = class {
|
|
|
10466
10473
|
this._setHealth(true);
|
|
10467
10474
|
}
|
|
10468
10475
|
this.lastEvent = /* @__PURE__ */ new Date();
|
|
10469
|
-
if (data
|
|
10476
|
+
if (data.type === "health.check") {
|
|
10470
10477
|
this.scheduleNextPing();
|
|
10471
10478
|
}
|
|
10472
|
-
this.client.
|
|
10479
|
+
this.client.dispatchEvent(data);
|
|
10473
10480
|
this.scheduleConnectionCheck();
|
|
10474
10481
|
};
|
|
10475
10482
|
this.onclose = (wsID, event) => {
|
|
@@ -13572,11 +13579,6 @@ var StreamChat = class _StreamChat {
|
|
|
13572
13579
|
method: `handleEvent;${event.type}`
|
|
13573
13580
|
});
|
|
13574
13581
|
};
|
|
13575
|
-
this.handleEvent = (messageEvent) => {
|
|
13576
|
-
const jsonString = messageEvent.data;
|
|
13577
|
-
const event = JSON.parse(jsonString);
|
|
13578
|
-
this.dispatchEvent(event);
|
|
13579
|
-
};
|
|
13580
13582
|
/**
|
|
13581
13583
|
* Updates the members, watchers and read references of the currently active channels that contain this user
|
|
13582
13584
|
*
|
|
@@ -14493,15 +14495,17 @@ var StreamChat = class _StreamChat {
|
|
|
14493
14495
|
defaultOptions.watch = false;
|
|
14494
14496
|
}
|
|
14495
14497
|
const { predefined_filter, filter_values, sort_values, ...restOptions } = options;
|
|
14498
|
+
const normalizedSort = normalizeQuerySort(sort);
|
|
14496
14499
|
const payload = predefined_filter ? {
|
|
14497
14500
|
predefined_filter,
|
|
14498
14501
|
filter_values,
|
|
14499
14502
|
sort_values,
|
|
14503
|
+
sort: normalizedSort,
|
|
14500
14504
|
...defaultOptions,
|
|
14501
14505
|
...restOptions
|
|
14502
14506
|
} : {
|
|
14503
14507
|
filter_conditions: filterConditions,
|
|
14504
|
-
sort:
|
|
14508
|
+
sort: normalizedSort,
|
|
14505
14509
|
...defaultOptions,
|
|
14506
14510
|
...restOptions
|
|
14507
14511
|
};
|
|
@@ -15664,7 +15668,7 @@ var StreamChat = class _StreamChat {
|
|
|
15664
15668
|
if (this.userAgent) {
|
|
15665
15669
|
return this.userAgent;
|
|
15666
15670
|
}
|
|
15667
|
-
const version = "9.43.
|
|
15671
|
+
const version = "9.43.2";
|
|
15668
15672
|
const clientBundle = "browser-cjs";
|
|
15669
15673
|
let userAgentString = "";
|
|
15670
15674
|
if (this.sdkIdentifier) {
|