stream-chat 9.6.0 → 9.6.1
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 +27 -16
- package/dist/cjs/index.browser.cjs.map +3 -3
- package/dist/cjs/index.node.cjs +30 -19
- package/dist/cjs/index.node.cjs.map +3 -3
- package/dist/esm/index.js +27 -16
- package/dist/esm/index.js.map +3 -3
- package/dist/types/utils/WithSubscriptions.d.ts +7 -2
- package/package.json +1 -1
- package/src/messageComposer/messageComposer.ts +16 -18
- package/src/utils/WithSubscriptions.ts +16 -2
package/dist/esm/index.js
CHANGED
|
@@ -8322,6 +8322,7 @@ var TextComposer = class {
|
|
|
8322
8322
|
var _WithSubscriptions = class _WithSubscriptions {
|
|
8323
8323
|
constructor() {
|
|
8324
8324
|
this.unsubscribeFunctions = /* @__PURE__ */ new Set();
|
|
8325
|
+
this.refCount = 0;
|
|
8325
8326
|
}
|
|
8326
8327
|
/**
|
|
8327
8328
|
* Returns a boolean, provides information of whether `registerSubscriptions`
|
|
@@ -8333,6 +8334,12 @@ var _WithSubscriptions = class _WithSubscriptions {
|
|
|
8333
8334
|
addUnsubscribeFunction(unsubscribeFunction) {
|
|
8334
8335
|
this.unsubscribeFunctions.add(unsubscribeFunction);
|
|
8335
8336
|
}
|
|
8337
|
+
/**
|
|
8338
|
+
* Increments `refCount` by one and returns new value.
|
|
8339
|
+
*/
|
|
8340
|
+
incrementRefCount() {
|
|
8341
|
+
return ++this.refCount;
|
|
8342
|
+
}
|
|
8336
8343
|
/**
|
|
8337
8344
|
* If you re-declare `unregisterSubscriptions` method within your class
|
|
8338
8345
|
* make sure to run the original too.
|
|
@@ -8349,8 +8356,13 @@ var _WithSubscriptions = class _WithSubscriptions {
|
|
|
8349
8356
|
* ```
|
|
8350
8357
|
*/
|
|
8351
8358
|
unregisterSubscriptions() {
|
|
8359
|
+
if (this.refCount > 1) {
|
|
8360
|
+
this.refCount--;
|
|
8361
|
+
return _WithSubscriptions.symbol;
|
|
8362
|
+
}
|
|
8352
8363
|
this.unsubscribeFunctions.forEach((unsubscribe) => unsubscribe());
|
|
8353
8364
|
this.unsubscribeFunctions.clear();
|
|
8365
|
+
this.refCount = 0;
|
|
8354
8366
|
return _WithSubscriptions.symbol;
|
|
8355
8367
|
}
|
|
8356
8368
|
};
|
|
@@ -8836,7 +8848,6 @@ var initState5 = (composition) => {
|
|
|
8836
8848
|
showReplyInChannel: false
|
|
8837
8849
|
};
|
|
8838
8850
|
};
|
|
8839
|
-
var noop4 = () => void 0;
|
|
8840
8851
|
var _MessageComposer = class _MessageComposer extends WithSubscriptions {
|
|
8841
8852
|
// todo: mediaRecorder: MediaRecorderController;
|
|
8842
8853
|
constructor({
|
|
@@ -8863,20 +8874,20 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
|
|
|
8863
8874
|
};
|
|
8864
8875
|
this.initEditingAuditState = (composition) => initEditingAuditState(composition);
|
|
8865
8876
|
this.registerSubscriptions = () => {
|
|
8866
|
-
if (this.hasSubscriptions) {
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
|
|
8870
|
-
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8874
|
-
|
|
8875
|
-
|
|
8876
|
-
|
|
8877
|
-
|
|
8878
|
-
this.
|
|
8879
|
-
return this.unregisterSubscriptions
|
|
8877
|
+
if (!this.hasSubscriptions) {
|
|
8878
|
+
this.addUnsubscribeFunction(this.subscribeMessageComposerSetupStateChange());
|
|
8879
|
+
this.addUnsubscribeFunction(this.subscribeMessageUpdated());
|
|
8880
|
+
this.addUnsubscribeFunction(this.subscribeMessageDeleted());
|
|
8881
|
+
this.addUnsubscribeFunction(this.subscribeTextComposerStateChanged());
|
|
8882
|
+
this.addUnsubscribeFunction(this.subscribeAttachmentManagerStateChanged());
|
|
8883
|
+
this.addUnsubscribeFunction(this.subscribeLinkPreviewsManagerStateChanged());
|
|
8884
|
+
this.addUnsubscribeFunction(this.subscribePollComposerStateChanged());
|
|
8885
|
+
this.addUnsubscribeFunction(this.subscribeCustomDataManagerStateChanged());
|
|
8886
|
+
this.addUnsubscribeFunction(this.subscribeMessageComposerStateChanged());
|
|
8887
|
+
this.addUnsubscribeFunction(this.subscribeMessageComposerConfigStateChanged());
|
|
8888
|
+
}
|
|
8889
|
+
this.incrementRefCount();
|
|
8890
|
+
return () => this.unregisterSubscriptions();
|
|
8880
8891
|
};
|
|
8881
8892
|
this.subscribeMessageUpdated = () => {
|
|
8882
8893
|
const eventTypes = [
|
|
@@ -16118,7 +16129,7 @@ var StreamChat = class _StreamChat {
|
|
|
16118
16129
|
if (this.userAgent) {
|
|
16119
16130
|
return this.userAgent;
|
|
16120
16131
|
}
|
|
16121
|
-
const version = "9.6.
|
|
16132
|
+
const version = "9.6.1";
|
|
16122
16133
|
const clientBundle = "browser-esm";
|
|
16123
16134
|
let userAgentString = "";
|
|
16124
16135
|
if (this.sdkIdentifier) {
|