@poolse/react-ui 2.1.5 → 2.2.0
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/CHANGELOG.md +260 -260
- package/LICENSE +21 -21
- package/README.md +335 -333
- package/dist/index.cjs +32 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +33 -27
- package/dist/index.js.map +1 -1
- package/dist/styles.css +2818 -2818
- package/package.json +29 -16
package/dist/index.cjs
CHANGED
|
@@ -408,19 +408,22 @@ var MentionInput = react.forwardRef(
|
|
|
408
408
|
const visibleUploads = queue.filter((it) => it.status !== "cancelled");
|
|
409
409
|
const readyCount = queue.filter((it) => it.status === "ready").length;
|
|
410
410
|
const uploading = queue.some((it) => it.status === "pending" || it.status === "uploading");
|
|
411
|
-
const addFiles = (
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
411
|
+
const addFiles = react.useCallback(
|
|
412
|
+
(files) => {
|
|
413
|
+
if (!attachments || files.length === 0) return;
|
|
414
|
+
void uploadAll(
|
|
415
|
+
files.map((f) => ({
|
|
416
|
+
body: f,
|
|
417
|
+
contentType: f.type || "application/octet-stream",
|
|
418
|
+
byteSize: f.size,
|
|
419
|
+
filename: f.name
|
|
420
|
+
}))
|
|
421
|
+
).catch(() => {
|
|
422
|
+
});
|
|
423
|
+
},
|
|
424
|
+
[attachments, uploadAll]
|
|
425
|
+
);
|
|
426
|
+
react.useImperativeHandle(ref, () => ({ addFiles }), [addFiles]);
|
|
424
427
|
const label = labelFor ?? ((id) => id);
|
|
425
428
|
const filtered = mention ? members.filter(
|
|
426
429
|
(m) => label(m.external_id).toLowerCase().includes(mention.query.toLowerCase())
|
|
@@ -685,19 +688,22 @@ var MessageComposer = react.forwardRef(
|
|
|
685
688
|
const visibleUploads = queue.filter((it) => it.status !== "cancelled");
|
|
686
689
|
const readyCount = queue.filter((it) => it.status === "ready").length;
|
|
687
690
|
const uploading = queue.some((it) => it.status === "pending" || it.status === "uploading");
|
|
688
|
-
const addFiles = (
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
691
|
+
const addFiles = react.useCallback(
|
|
692
|
+
(files) => {
|
|
693
|
+
if (!attachments || files.length === 0) return;
|
|
694
|
+
void uploadAll(
|
|
695
|
+
files.map((f) => ({
|
|
696
|
+
body: f,
|
|
697
|
+
contentType: f.type || "application/octet-stream",
|
|
698
|
+
byteSize: f.size,
|
|
699
|
+
filename: f.name
|
|
700
|
+
}))
|
|
701
|
+
).catch(() => {
|
|
702
|
+
});
|
|
703
|
+
},
|
|
704
|
+
[attachments, uploadAll]
|
|
705
|
+
);
|
|
706
|
+
react.useImperativeHandle(ref, () => ({ addFiles }), [addFiles]);
|
|
701
707
|
const submit = async () => {
|
|
702
708
|
const trimmed = value.trim();
|
|
703
709
|
const ready = queue.filter((it) => it.status === "ready");
|