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.
- package/dist/components/Attachment/index.d.ts +1 -0
- package/dist/components/Attachment/index.js +1 -0
- package/dist/components/Chat/hooks/useChat.js +1 -1
- package/dist/components/Dialog/FormDialog.js +16 -12
- package/dist/components/Poll/PollHeader.js +4 -2
- package/dist/css/v2/index.css +1 -1
- package/dist/css/v2/index.layout.css +1 -1
- package/dist/index.browser.cjs +43 -31
- package/dist/index.browser.cjs.map +3 -3
- package/dist/index.node.cjs +44 -31
- package/dist/index.node.cjs.map +3 -3
- package/dist/scss/v2/AttachmentPreviewList/AttachmentPreviewList-layout.scss +1 -1
- package/dist/scss/v2/Dialog/Dialog-layout.scss +1 -1
- package/dist/scss/v2/Message/Message-layout.scss +6 -0
- package/package.json +2 -2
package/dist/index.node.cjs
CHANGED
|
@@ -20686,6 +20686,7 @@ __export(src_exports, {
|
|
|
20686
20686
|
useAIState: () => useAIState,
|
|
20687
20687
|
useActionHandler: () => useActionHandler,
|
|
20688
20688
|
useActiveThread: () => useActiveThread,
|
|
20689
|
+
useAudioController: () => useAudioController,
|
|
20689
20690
|
useChannelActionContext: () => useChannelActionContext,
|
|
20690
20691
|
useChannelDeletedListener: () => useChannelDeletedListener,
|
|
20691
20692
|
useChannelEditMessageHandler: () => useEditMessageHandler,
|
|
@@ -50249,12 +50250,13 @@ var PollHeader = () => {
|
|
|
50249
50250
|
const { enforce_unique_vote, is_closed, max_votes_allowed, name: name2, options } = useStateStore(poll.state, pollStateSelector);
|
|
50250
50251
|
const selectionInstructions = (0, import_react148.useMemo)(() => {
|
|
50251
50252
|
if (is_closed) return t2("Vote ended");
|
|
50252
|
-
if (enforce_unique_vote) return t2("Select one");
|
|
50253
|
+
if (enforce_unique_vote || options.length === 1) return t2("Select one");
|
|
50253
50254
|
if (max_votes_allowed)
|
|
50254
50255
|
return t2("Select up to {{count}}", {
|
|
50255
50256
|
count: max_votes_allowed > options.length ? options.length : max_votes_allowed
|
|
50256
50257
|
});
|
|
50257
|
-
return t2("Select one or more");
|
|
50258
|
+
if (options.length > 1) return t2("Select one or more");
|
|
50259
|
+
return "";
|
|
50258
50260
|
}, [is_closed, enforce_unique_vote, max_votes_allowed, options.length, t2]);
|
|
50259
50261
|
if (!name2) return;
|
|
50260
50262
|
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));
|
|
@@ -50334,36 +50336,46 @@ var FormDialog = ({
|
|
|
50334
50336
|
await onSubmit(value);
|
|
50335
50337
|
close();
|
|
50336
50338
|
};
|
|
50337
|
-
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(
|
|
50338
|
-
"
|
|
50339
|
-
{
|
|
50340
|
-
className: (0, import_clsx36.default)(
|
|
50341
|
-
`str-chat__dialog__title str-chat__dialog__title--${id}`
|
|
50342
|
-
),
|
|
50343
|
-
htmlFor: id
|
|
50344
|
-
},
|
|
50345
|
-
fieldConfig.label
|
|
50346
|
-
), import_react150.default.createElement(fieldConfig.element, {
|
|
50347
|
-
id,
|
|
50348
|
-
...fieldConfig.props,
|
|
50349
|
-
onChange: handleChange,
|
|
50350
|
-
value: value[id]
|
|
50351
|
-
}), /* @__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(
|
|
50352
|
-
"button",
|
|
50353
|
-
{
|
|
50354
|
-
className: "str-chat__dialog__controls-button str-chat__dialog__controls-button--cancel",
|
|
50355
|
-
onClick: close
|
|
50356
|
-
},
|
|
50357
|
-
t2("Cancel")
|
|
50358
|
-
), /* @__PURE__ */ import_react150.default.createElement(
|
|
50359
|
-
"button",
|
|
50339
|
+
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(
|
|
50340
|
+
"form",
|
|
50360
50341
|
{
|
|
50361
|
-
|
|
50362
|
-
|
|
50363
|
-
|
|
50364
|
-
|
|
50342
|
+
autoComplete: "off",
|
|
50343
|
+
onSubmit: (e2) => {
|
|
50344
|
+
e2.preventDefault();
|
|
50345
|
+
handleSubmit();
|
|
50346
|
+
}
|
|
50365
50347
|
},
|
|
50366
|
-
|
|
50348
|
+
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(
|
|
50349
|
+
"label",
|
|
50350
|
+
{
|
|
50351
|
+
className: (0, import_clsx36.default)(
|
|
50352
|
+
`str-chat__dialog__title str-chat__dialog__title--${id}`
|
|
50353
|
+
),
|
|
50354
|
+
htmlFor: id
|
|
50355
|
+
},
|
|
50356
|
+
fieldConfig.label
|
|
50357
|
+
), import_react150.default.createElement(fieldConfig.element, {
|
|
50358
|
+
id,
|
|
50359
|
+
...fieldConfig.props,
|
|
50360
|
+
onChange: handleChange,
|
|
50361
|
+
value: value[id]
|
|
50362
|
+
}), /* @__PURE__ */ import_react150.default.createElement(FieldError, { text: fieldErrors[id]?.message }))),
|
|
50363
|
+
/* @__PURE__ */ import_react150.default.createElement("div", { className: "str-chat__dialog__controls" }, /* @__PURE__ */ import_react150.default.createElement(
|
|
50364
|
+
"button",
|
|
50365
|
+
{
|
|
50366
|
+
className: "str-chat__dialog__controls-button str-chat__dialog__controls-button--cancel",
|
|
50367
|
+
onClick: close
|
|
50368
|
+
},
|
|
50369
|
+
t2("Cancel")
|
|
50370
|
+
), /* @__PURE__ */ import_react150.default.createElement(
|
|
50371
|
+
"button",
|
|
50372
|
+
{
|
|
50373
|
+
className: "str-chat__dialog__controls-button str-chat__dialog__controls-button--submit",
|
|
50374
|
+
disabled: Object.keys(fieldErrors).length > 0 || shouldDisableSubmitButton?.(value),
|
|
50375
|
+
type: "submit"
|
|
50376
|
+
},
|
|
50377
|
+
t2("Send")
|
|
50378
|
+
))
|
|
50367
50379
|
)));
|
|
50368
50380
|
};
|
|
50369
50381
|
|
|
@@ -57795,7 +57807,7 @@ var useChat = ({
|
|
|
57795
57807
|
};
|
|
57796
57808
|
(0, import_react262.useEffect)(() => {
|
|
57797
57809
|
if (!client) return;
|
|
57798
|
-
const version = "12.15.
|
|
57810
|
+
const version = "12.15.5";
|
|
57799
57811
|
const userAgent = client.getUserAgent();
|
|
57800
57812
|
if (!userAgent.includes("stream-chat-react")) {
|
|
57801
57813
|
client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);
|
|
@@ -58531,6 +58543,7 @@ var Window = import_react272.default.memo(UnMemoizedWindow);
|
|
|
58531
58543
|
useAIState,
|
|
58532
58544
|
useActionHandler,
|
|
58533
58545
|
useActiveThread,
|
|
58546
|
+
useAudioController,
|
|
58534
58547
|
useChannelActionContext,
|
|
58535
58548
|
useChannelDeletedListener,
|
|
58536
58549
|
useChannelEditMessageHandler,
|