stream-chat 10.0.0-rc.28 → 10.0.0-rc.29

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.
@@ -109,6 +109,7 @@ __export(src_exports, {
109
109
  OfflineDBSyncManager: () => OfflineDBSyncManager,
110
110
  OfflineError: () => OfflineError,
111
111
  POLL_COMPOSER_VALIDATION_CODE: () => POLL_COMPOSER_VALIDATION_CODE,
112
+ POLL_ONLY_COMPOSITION_MIDDLEWARE_ID: () => POLL_ONLY_COMPOSITION_MIDDLEWARE_ID,
112
113
  PinnedMessagePaginator: () => PinnedMessagePaginator,
113
114
  Poll: () => Poll,
114
115
  PollComposer: () => PollComposer,
@@ -170,6 +171,7 @@ __export(src_exports, {
170
171
  createMentionsMiddleware: () => createMentionsMiddleware,
171
172
  createMessageComposerStateCompositionMiddleware: () => createMessageComposerStateCompositionMiddleware,
172
173
  createPollComposerStateMiddleware: () => createPollComposerStateMiddleware,
174
+ createPollOnlyCompositionMiddleware: () => createPollOnlyCompositionMiddleware,
173
175
  createPostUploadAttachmentEnrichmentMiddleware: () => createPostUploadAttachmentEnrichmentMiddleware,
174
176
  createPriorityOwnershipResolver: () => createPriorityOwnershipResolver,
175
177
  createSharedLocationCompositionMiddleware: () => createSharedLocationCompositionMiddleware,
@@ -11647,8 +11649,9 @@ var pollLocalMessageNullifiedFields = {
11647
11649
  quoted_message: void 0,
11648
11650
  text: ""
11649
11651
  };
11652
+ var POLL_ONLY_COMPOSITION_MIDDLEWARE_ID = "stream-io/message-composer-middleware/poll-only";
11650
11653
  var createPollOnlyCompositionMiddleware = (composer) => ({
11651
- id: "stream-io/message-composer-middleware/poll-only",
11654
+ id: POLL_ONLY_COMPOSITION_MIDDLEWARE_ID,
11652
11655
  handlers: {
11653
11656
  compose: ({
11654
11657
  state,
@@ -12889,7 +12892,10 @@ var DEFAULT_COMPOSER_CONFIG = deepFreezeConfig({
12889
12892
  linkPreviews: DEFAULT_LINK_PREVIEW_MANAGER_CONFIG,
12890
12893
  location: DEFAULT_LOCATION_COMPOSER_CONFIG,
12891
12894
  polls: DEFAULT_POLL_COMPOSER_CONFIG,
12892
- retainCompositionOnSubmit: (composer) => !!composer.pollId,
12895
+ // Matches when the poll-only middleware sends the poll alone: never for an edit or a thread reply.
12896
+ retainCompositionOnSubmit: (composer) => !!composer.pollId && !composer.editedMessage && !composer.threadId && composer.compositionMiddlewareExecutor.installedMiddleware.some(
12897
+ ({ id }) => id === POLL_ONLY_COMPOSITION_MIDDLEWARE_ID
12898
+ ),
12893
12899
  text: DEFAULT_TEXT_COMPOSER_CONFIG
12894
12900
  });
12895
12901
 
@@ -25129,7 +25135,7 @@ var StreamChat = class _StreamChat extends ChatApi {
25129
25135
  return this.userAgent;
25130
25136
  }
25131
25137
  if (!this.cachedUserAgent) {
25132
- const version = "10.0.0-rc.28";
25138
+ const version = "10.0.0-rc.29";
25133
25139
  const { name: sdkName, version: sdkVersion } = this.sdkIdentifier ?? {};
25134
25140
  const { name: appName, version: appVersion } = this.appIdentifier ?? {};
25135
25141
  const { os, model: deviceModel } = this.deviceIdentifier ?? {};
@@ -26344,7 +26350,7 @@ var MESSAGE_COMPOSER_FIELDS = {
26344
26350
  kind: "group"
26345
26351
  },
26346
26352
  retainCompositionOnSubmit: {
26347
- description: "Decides whether submitting keeps the composer's contents instead of clearing them. Retains for a poll message by default.",
26353
+ description: "Decides whether submitting keeps the composer's contents instead of clearing them. Retains for a poll message by default, while the composition chain sends polls alone.",
26348
26354
  kind: "value",
26349
26355
  type: "function"
26350
26356
  },