stream-chat-react 12.15.3 → 12.15.5

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.
@@ -17876,6 +17876,7 @@ __export(src_exports, {
17876
17876
  useAIState: () => useAIState,
17877
17877
  useActionHandler: () => useActionHandler,
17878
17878
  useActiveThread: () => useActiveThread,
17879
+ useAudioController: () => useAudioController,
17879
17880
  useChannelActionContext: () => useChannelActionContext,
17880
17881
  useChannelDeletedListener: () => useChannelDeletedListener,
17881
17882
  useChannelEditMessageHandler: () => useEditMessageHandler,
@@ -45569,12 +45570,13 @@ var PollHeader = () => {
45569
45570
  const { enforce_unique_vote, is_closed, max_votes_allowed, name: name2, options } = useStateStore(poll.state, pollStateSelector);
45570
45571
  const selectionInstructions = (0, import_react148.useMemo)(() => {
45571
45572
  if (is_closed) return t2("Vote ended");
45572
- if (enforce_unique_vote) return t2("Select one");
45573
+ if (enforce_unique_vote || options.length === 1) return t2("Select one");
45573
45574
  if (max_votes_allowed)
45574
45575
  return t2("Select up to {{count}}", {
45575
45576
  count: max_votes_allowed > options.length ? options.length : max_votes_allowed
45576
45577
  });
45577
- return t2("Select one or more");
45578
+ if (options.length > 1) return t2("Select one or more");
45579
+ return "";
45578
45580
  }, [is_closed, enforce_unique_vote, max_votes_allowed, options.length, t2]);
45579
45581
  if (!name2) return;
45580
45582
  return /* @__PURE__ */ import_react148.default.createElement("div", { className: "str-chat__poll-header" }, /* @__PURE__ */ import_react148.default.createElement("div", { className: "str-chat__poll-title" }, name2), /* @__PURE__ */ import_react148.default.createElement("div", { className: "str-chat__poll-subtitle" }, selectionInstructions));
@@ -45654,36 +45656,46 @@ var FormDialog = ({
45654
45656
  await onSubmit(value);
45655
45657
  close();
45656
45658
  };
45657
- return /* @__PURE__ */ import_react150.default.createElement("div", { className: (0, import_clsx36.default)("str-chat__dialog str-chat__dialog--form", className) }, /* @__PURE__ */ import_react150.default.createElement("div", { className: "str-chat__dialog__body" }, title && /* @__PURE__ */ import_react150.default.createElement("div", { className: "str-chat__dialog__title" }, title), /* @__PURE__ */ import_react150.default.createElement("form", { autoComplete: "off" }, Object.entries(fields).map(([id, fieldConfig]) => /* @__PURE__ */ import_react150.default.createElement("div", { className: "str-chat__dialog__field", key: `dialog-field-${id}` }, fieldConfig.label && /* @__PURE__ */ import_react150.default.createElement(
45658
- "label",
45659
- {
45660
- className: (0, import_clsx36.default)(
45661
- `str-chat__dialog__title str-chat__dialog__title--${id}`
45662
- ),
45663
- htmlFor: id
45664
- },
45665
- fieldConfig.label
45666
- ), import_react150.default.createElement(fieldConfig.element, {
45667
- id,
45668
- ...fieldConfig.props,
45669
- onChange: handleChange,
45670
- value: value[id]
45671
- }), /* @__PURE__ */ import_react150.default.createElement(FieldError, { text: fieldErrors[id]?.message }))))), /* @__PURE__ */ import_react150.default.createElement("div", { className: "str-chat__dialog__controls" }, /* @__PURE__ */ import_react150.default.createElement(
45672
- "button",
45673
- {
45674
- className: "str-chat__dialog__controls-button str-chat__dialog__controls-button--cancel",
45675
- onClick: close
45676
- },
45677
- t2("Cancel")
45678
- ), /* @__PURE__ */ import_react150.default.createElement(
45679
- "button",
45659
+ return /* @__PURE__ */ import_react150.default.createElement("div", { className: (0, import_clsx36.default)("str-chat__dialog str-chat__dialog--form", className) }, /* @__PURE__ */ import_react150.default.createElement("div", { className: "str-chat__dialog__body" }, title && /* @__PURE__ */ import_react150.default.createElement("div", { className: "str-chat__dialog__title" }, title), /* @__PURE__ */ import_react150.default.createElement(
45660
+ "form",
45680
45661
  {
45681
- className: "str-chat__dialog__controls-button str-chat__dialog__controls-button--submit",
45682
- disabled: Object.keys(fieldErrors).length > 0 || shouldDisableSubmitButton?.(value),
45683
- onClick: handleSubmit,
45684
- type: "submit"
45662
+ autoComplete: "off",
45663
+ onSubmit: (e2) => {
45664
+ e2.preventDefault();
45665
+ handleSubmit();
45666
+ }
45685
45667
  },
45686
- t2("Send")
45668
+ Object.entries(fields).map(([id, fieldConfig]) => /* @__PURE__ */ import_react150.default.createElement("div", { className: "str-chat__dialog__field", key: `dialog-field-${id}` }, fieldConfig.label && /* @__PURE__ */ import_react150.default.createElement(
45669
+ "label",
45670
+ {
45671
+ className: (0, import_clsx36.default)(
45672
+ `str-chat__dialog__title str-chat__dialog__title--${id}`
45673
+ ),
45674
+ htmlFor: id
45675
+ },
45676
+ fieldConfig.label
45677
+ ), import_react150.default.createElement(fieldConfig.element, {
45678
+ id,
45679
+ ...fieldConfig.props,
45680
+ onChange: handleChange,
45681
+ value: value[id]
45682
+ }), /* @__PURE__ */ import_react150.default.createElement(FieldError, { text: fieldErrors[id]?.message }))),
45683
+ /* @__PURE__ */ import_react150.default.createElement("div", { className: "str-chat__dialog__controls" }, /* @__PURE__ */ import_react150.default.createElement(
45684
+ "button",
45685
+ {
45686
+ className: "str-chat__dialog__controls-button str-chat__dialog__controls-button--cancel",
45687
+ onClick: close
45688
+ },
45689
+ t2("Cancel")
45690
+ ), /* @__PURE__ */ import_react150.default.createElement(
45691
+ "button",
45692
+ {
45693
+ className: "str-chat__dialog__controls-button str-chat__dialog__controls-button--submit",
45694
+ disabled: Object.keys(fieldErrors).length > 0 || shouldDisableSubmitButton?.(value),
45695
+ type: "submit"
45696
+ },
45697
+ t2("Send")
45698
+ ))
45687
45699
  )));
45688
45700
  };
45689
45701
 
@@ -53115,7 +53127,7 @@ var useChat = ({
53115
53127
  };
53116
53128
  (0, import_react263.useEffect)(() => {
53117
53129
  if (!client) return;
53118
- const version = "12.15.3";
53130
+ const version = "12.15.5";
53119
53131
  const userAgent = client.getUserAgent();
53120
53132
  if (!userAgent.includes("stream-chat-react")) {
53121
53133
  client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);