@poolse/react-ui 2.1.6 → 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 -335
- 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 +12 -12
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useMembers, useAttachmentUpload, useMe, useConversations, useUser, useConversation, usePresence, useMessages, useTyping, useRealtimeStatus, computeGroupPosition, sameDay, formatDayLabel, useReactions, useThread, useAttachmentUrl } from '@poolse/react';
|
|
3
|
-
import { forwardRef, useState, useRef, useImperativeHandle, useEffect,
|
|
3
|
+
import { forwardRef, useState, useRef, useCallback, useImperativeHandle, useEffect, useMemo, Fragment as Fragment$1 } from 'react';
|
|
4
4
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import ReactMarkdown from 'react-markdown';
|
|
6
6
|
import remarkGfm from 'remark-gfm';
|
|
@@ -401,19 +401,22 @@ var MentionInput = forwardRef(
|
|
|
401
401
|
const visibleUploads = queue.filter((it) => it.status !== "cancelled");
|
|
402
402
|
const readyCount = queue.filter((it) => it.status === "ready").length;
|
|
403
403
|
const uploading = queue.some((it) => it.status === "pending" || it.status === "uploading");
|
|
404
|
-
const addFiles = (
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
404
|
+
const addFiles = useCallback(
|
|
405
|
+
(files) => {
|
|
406
|
+
if (!attachments || files.length === 0) return;
|
|
407
|
+
void uploadAll(
|
|
408
|
+
files.map((f) => ({
|
|
409
|
+
body: f,
|
|
410
|
+
contentType: f.type || "application/octet-stream",
|
|
411
|
+
byteSize: f.size,
|
|
412
|
+
filename: f.name
|
|
413
|
+
}))
|
|
414
|
+
).catch(() => {
|
|
415
|
+
});
|
|
416
|
+
},
|
|
417
|
+
[attachments, uploadAll]
|
|
418
|
+
);
|
|
419
|
+
useImperativeHandle(ref, () => ({ addFiles }), [addFiles]);
|
|
417
420
|
const label = labelFor ?? ((id) => id);
|
|
418
421
|
const filtered = mention ? members.filter(
|
|
419
422
|
(m) => label(m.external_id).toLowerCase().includes(mention.query.toLowerCase())
|
|
@@ -678,19 +681,22 @@ var MessageComposer = forwardRef(
|
|
|
678
681
|
const visibleUploads = queue.filter((it) => it.status !== "cancelled");
|
|
679
682
|
const readyCount = queue.filter((it) => it.status === "ready").length;
|
|
680
683
|
const uploading = queue.some((it) => it.status === "pending" || it.status === "uploading");
|
|
681
|
-
const addFiles = (
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
684
|
+
const addFiles = useCallback(
|
|
685
|
+
(files) => {
|
|
686
|
+
if (!attachments || files.length === 0) return;
|
|
687
|
+
void uploadAll(
|
|
688
|
+
files.map((f) => ({
|
|
689
|
+
body: f,
|
|
690
|
+
contentType: f.type || "application/octet-stream",
|
|
691
|
+
byteSize: f.size,
|
|
692
|
+
filename: f.name
|
|
693
|
+
}))
|
|
694
|
+
).catch(() => {
|
|
695
|
+
});
|
|
696
|
+
},
|
|
697
|
+
[attachments, uploadAll]
|
|
698
|
+
);
|
|
699
|
+
useImperativeHandle(ref, () => ({ addFiles }), [addFiles]);
|
|
694
700
|
const submit = async () => {
|
|
695
701
|
const trimmed = value.trim();
|
|
696
702
|
const ready = queue.filter((it) => it.status === "ready");
|