@poolse/react-ui 0.2.0-alpha.6 → 1.0.0-beta.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 +22 -0
- package/dist/index.cjs +116 -79
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +116 -79
- package/dist/index.js.map +1 -1
- package/dist/styles.css +35 -16
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,30 @@ All notable changes to `@poolse/react-ui` are documented here. Format follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
|
|
5
5
|
[semver](https://semver.org).
|
|
6
6
|
|
|
7
|
+
## [1.0.0-beta.0] — 2026-06-01
|
|
8
|
+
|
|
9
|
+
First beta of the stable component surface. Promotes the full 0.2.x
|
|
10
|
+
UI kit (ConversationView with reactions / mentions / attachments /
|
|
11
|
+
threads / quotations / readReceipts flags, MessageRow with thread
|
|
12
|
+
pill + quote card, MessageComposer / MentionInput with the quote
|
|
13
|
+
chip, MessageBubble with the WhatsApp-style QuotedCard + fallback
|
|
14
|
+
placeholder, ConversationList with unread badges) to a stable
|
|
15
|
+
namespace. No breaking changes relative to `0.2.0-alpha.7`.
|
|
16
|
+
|
|
7
17
|
## [0.2.0] — 2026-06-01
|
|
8
18
|
|
|
19
|
+
### Changed — quote card polish
|
|
20
|
+
|
|
21
|
+
- WhatsApp-style quote card visuals: compact padding, 4px Pulse Coral
|
|
22
|
+
accent stripe flush with the bubble edge, body text at 0.62 opacity
|
|
23
|
+
so the eye lands on the actual message. Self-bubble variant tints
|
|
24
|
+
with a dark overlay; other-bubble variant tints slightly darker than
|
|
25
|
+
the surface for visual "depth."
|
|
26
|
+
- Optimistic quote preview: when you quote-reply, the card renders
|
|
27
|
+
immediately on the locally-inserted bubble (looked up from the
|
|
28
|
+
in-memory message list) instead of flashing in once the realtime
|
|
29
|
+
echo arrives ~100ms later.
|
|
30
|
+
|
|
9
31
|
### Added — quote replies (WhatsApp-style)
|
|
10
32
|
|
|
11
33
|
- `<ConversationView quotations?>` (default `true`) — new feature
|
package/dist/index.cjs
CHANGED
|
@@ -451,10 +451,7 @@ function MessageComposer({
|
|
|
451
451
|
if (!trimmed || sending) return;
|
|
452
452
|
setSending(true);
|
|
453
453
|
try {
|
|
454
|
-
await onSend(
|
|
455
|
-
trimmed,
|
|
456
|
-
replyingTo ? { quoted_message_id: replyingTo.id } : void 0
|
|
457
|
-
);
|
|
454
|
+
await onSend(trimmed, replyingTo ? { quoted_message_id: replyingTo.id } : void 0);
|
|
458
455
|
setValue("");
|
|
459
456
|
} finally {
|
|
460
457
|
setSending(false);
|
|
@@ -657,8 +654,9 @@ function MessageBubble({
|
|
|
657
654
|
hour: "2-digit",
|
|
658
655
|
minute: "2-digit"
|
|
659
656
|
}) : "";
|
|
657
|
+
const showQuoteCard = message.quoted_message !== void 0 && message.quoted_message !== null ? "full" : message.quoted_message_id ? "placeholder" : null;
|
|
660
658
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, children: [
|
|
661
|
-
|
|
659
|
+
showQuoteCard === "full" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
662
660
|
QuotedCard,
|
|
663
661
|
{
|
|
664
662
|
quoted: message.quoted_message,
|
|
@@ -667,6 +665,7 @@ function MessageBubble({
|
|
|
667
665
|
...onQuotedClick ? { onClick: onQuotedClick } : {}
|
|
668
666
|
}
|
|
669
667
|
),
|
|
668
|
+
showQuoteCard === "placeholder" && /* @__PURE__ */ jsxRuntime.jsx(QuotedPlaceholder, { isSelf, quotedMessageId: message.quoted_message_id }),
|
|
670
669
|
message.deleted_at ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "poolse-message__body--deleted", children: "[deleted]" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: message.body ?? "" }),
|
|
671
670
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "poolse-message__meta", children: [
|
|
672
671
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: time }),
|
|
@@ -682,6 +681,22 @@ function MessageBubble({
|
|
|
682
681
|
] })
|
|
683
682
|
] });
|
|
684
683
|
}
|
|
684
|
+
function QuotedPlaceholder({
|
|
685
|
+
isSelf,
|
|
686
|
+
quotedMessageId: _quotedMessageId
|
|
687
|
+
}) {
|
|
688
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
689
|
+
"div",
|
|
690
|
+
{
|
|
691
|
+
className: `poolse-quote poolse-quote--placeholder ${isSelf ? "poolse-quote--self" : "poolse-quote--other"}`,
|
|
692
|
+
"aria-label": "Quoted message",
|
|
693
|
+
children: [
|
|
694
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "poolse-quote__sender", children: "Replying to a message" }),
|
|
695
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "poolse-quote__body", children: "Loading preview\u2026" })
|
|
696
|
+
]
|
|
697
|
+
}
|
|
698
|
+
);
|
|
699
|
+
}
|
|
685
700
|
function QuotedCard({
|
|
686
701
|
quoted,
|
|
687
702
|
isSelf,
|
|
@@ -968,80 +983,87 @@ function MessageRow({
|
|
|
968
983
|
const showThreadPill = threads && !msg.deleted_at && !msg.thread_root_id && replyCount > 0;
|
|
969
984
|
const handleSave = onSaveEdit ?? (async () => void 0);
|
|
970
985
|
const handleCancel = onCancelEdit ?? (() => void 0);
|
|
971
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
{
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
onSave: handleSave,
|
|
980
|
-
onCancel: handleCancel
|
|
981
|
-
}
|
|
982
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
983
|
-
MessageBubble,
|
|
984
|
-
{
|
|
985
|
-
message: msg,
|
|
986
|
-
currentUserId: meId,
|
|
987
|
-
...readState ? { readState } : {},
|
|
988
|
-
...labelFor ? { labelFor } : {},
|
|
989
|
-
...onQuotedClick ? { onQuotedClick } : {}
|
|
990
|
-
}
|
|
991
|
-
),
|
|
992
|
-
showAttachments && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `poolse-message-row__attachments ${isSelf ? "is-self" : ""}`, children: msg.attachments.map((att) => /* @__PURE__ */ jsxRuntime.jsx(AttachmentPreview, { attachment: att }, att.id)) }),
|
|
993
|
-
showReactions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `poolse-message-row__reactions ${isSelf ? "is-self" : ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
994
|
-
InlineReactions,
|
|
995
|
-
{
|
|
996
|
-
reactions: reactionsHook.reactions,
|
|
997
|
-
currentUserId: meId,
|
|
998
|
-
onAdd: (e) => void reactionsHook.addReaction(e),
|
|
999
|
-
onRemove: (e) => void reactionsHook.removeReaction(e)
|
|
1000
|
-
}
|
|
1001
|
-
) }),
|
|
1002
|
-
showThreadPill && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1003
|
-
"button",
|
|
1004
|
-
{
|
|
1005
|
-
type: "button",
|
|
1006
|
-
className: `poolse-thread-pill ${isSelf ? "poolse-thread-pill--right" : "poolse-thread-pill--left"}`,
|
|
1007
|
-
onClick: onOpenThread,
|
|
1008
|
-
"aria-label": `View ${replyCount} ${replyCount === 1 ? "reply" : "replies"}`,
|
|
1009
|
-
children: [
|
|
1010
|
-
/* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "messages", size: 12, label: null }),
|
|
1011
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
1012
|
-
replyCount,
|
|
1013
|
-
" ",
|
|
1014
|
-
replyCount === 1 ? "reply" : "replies"
|
|
1015
|
-
] })
|
|
1016
|
-
]
|
|
1017
|
-
}
|
|
1018
|
-
),
|
|
1019
|
-
showActions && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1020
|
-
"div",
|
|
1021
|
-
{
|
|
1022
|
-
className: `poolse-message-row__actions ${isSelf ? "poolse-message-row__actions--right" : "poolse-message-row__actions--left"}`,
|
|
1023
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1024
|
-
MessageActions,
|
|
986
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
987
|
+
"div",
|
|
988
|
+
{
|
|
989
|
+
className: `poolse-message-row ${isSelf ? "poolse-message-row--right" : ""}`,
|
|
990
|
+
"data-message-id": msg.id,
|
|
991
|
+
children: [
|
|
992
|
+
editing ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
993
|
+
EditableMessageBubble,
|
|
1025
994
|
{
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
995
|
+
message: msg,
|
|
996
|
+
currentUserId: meId,
|
|
997
|
+
...readState ? { readState } : {},
|
|
998
|
+
editing: true,
|
|
999
|
+
onSave: handleSave,
|
|
1000
|
+
onCancel: handleCancel
|
|
1001
|
+
}
|
|
1002
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1003
|
+
MessageBubble,
|
|
1004
|
+
{
|
|
1005
|
+
message: msg,
|
|
1006
|
+
currentUserId: meId,
|
|
1007
|
+
...readState ? { readState } : {},
|
|
1008
|
+
...labelFor ? { labelFor } : {},
|
|
1009
|
+
...onQuotedClick ? { onQuotedClick } : {}
|
|
1010
|
+
}
|
|
1011
|
+
),
|
|
1012
|
+
showAttachments && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `poolse-message-row__attachments ${isSelf ? "is-self" : ""}`, children: msg.attachments.map((att) => /* @__PURE__ */ jsxRuntime.jsx(AttachmentPreview, { attachment: att }, att.id)) }),
|
|
1013
|
+
showReactions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `poolse-message-row__reactions ${isSelf ? "is-self" : ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1014
|
+
InlineReactions,
|
|
1015
|
+
{
|
|
1016
|
+
reactions: reactionsHook.reactions,
|
|
1017
|
+
currentUserId: meId,
|
|
1018
|
+
onAdd: (e) => void reactionsHook.addReaction(e),
|
|
1019
|
+
onRemove: (e) => void reactionsHook.removeReaction(e)
|
|
1020
|
+
}
|
|
1021
|
+
) }),
|
|
1022
|
+
showThreadPill && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1023
|
+
"button",
|
|
1024
|
+
{
|
|
1025
|
+
type: "button",
|
|
1026
|
+
className: `poolse-thread-pill ${isSelf ? "poolse-thread-pill--right" : "poolse-thread-pill--left"}`,
|
|
1027
|
+
onClick: onOpenThread,
|
|
1028
|
+
"aria-label": `View ${replyCount} ${replyCount === 1 ? "reply" : "replies"}`,
|
|
1029
|
+
children: [
|
|
1030
|
+
/* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "messages", size: 12, label: null }),
|
|
1031
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
1032
|
+
replyCount,
|
|
1033
|
+
" ",
|
|
1034
|
+
replyCount === 1 ? "reply" : "replies"
|
|
1035
|
+
] })
|
|
1036
|
+
]
|
|
1037
|
+
}
|
|
1038
|
+
),
|
|
1039
|
+
showActions && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1040
|
+
"div",
|
|
1041
|
+
{
|
|
1042
|
+
className: `poolse-message-row__actions ${isSelf ? "poolse-message-row__actions--right" : "poolse-message-row__actions--left"}`,
|
|
1043
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1044
|
+
MessageActions,
|
|
1045
|
+
{
|
|
1046
|
+
...reactions ? {
|
|
1047
|
+
onReact: (emoji) => {
|
|
1048
|
+
void reactionsHook.addReaction(emoji);
|
|
1049
|
+
}
|
|
1050
|
+
} : {},
|
|
1051
|
+
...threads && onOpenThread ? { onReply: onOpenThread } : {},
|
|
1052
|
+
...quotations && onQuote ? { onQuote } : {},
|
|
1053
|
+
...msg.body ? {
|
|
1054
|
+
onCopy: () => {
|
|
1055
|
+
void navigator?.clipboard?.writeText(msg.body ?? "").catch(() => void 0);
|
|
1056
|
+
}
|
|
1057
|
+
} : {},
|
|
1058
|
+
...isSelf && onStartEdit ? { onEdit: onStartEdit } : {},
|
|
1059
|
+
...isSelf && onDelete ? { onDelete } : {}
|
|
1036
1060
|
}
|
|
1037
|
-
|
|
1038
|
-
...isSelf && onStartEdit ? { onEdit: onStartEdit } : {},
|
|
1039
|
-
...isSelf && onDelete ? { onDelete } : {}
|
|
1061
|
+
)
|
|
1040
1062
|
}
|
|
1041
1063
|
)
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1064
|
+
]
|
|
1065
|
+
}
|
|
1066
|
+
);
|
|
1045
1067
|
}
|
|
1046
1068
|
function InlineReactions({
|
|
1047
1069
|
reactions,
|
|
@@ -1331,12 +1353,26 @@ function ConversationView({
|
|
|
1331
1353
|
if (renderMessage) {
|
|
1332
1354
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Fragment, { children: renderMessage(msg, me?.id ?? null) }, msg.id);
|
|
1333
1355
|
}
|
|
1356
|
+
const enriched = quotations && msg.quoted_message_id && !msg.quoted_message ? (() => {
|
|
1357
|
+
const original = messages.find((m) => m.id === msg.quoted_message_id);
|
|
1358
|
+
if (!original) return msg;
|
|
1359
|
+
return {
|
|
1360
|
+
...msg,
|
|
1361
|
+
quoted_message: {
|
|
1362
|
+
id: original.id,
|
|
1363
|
+
sender_id: original.sender_id,
|
|
1364
|
+
body: original.body,
|
|
1365
|
+
deleted_at: original.deleted_at,
|
|
1366
|
+
inserted_at: original.inserted_at
|
|
1367
|
+
}
|
|
1368
|
+
};
|
|
1369
|
+
})() : msg;
|
|
1334
1370
|
const isSelf = me !== null && msg.sender_id === me.id;
|
|
1335
1371
|
const readState = readReceipts && isSelf && maxReadByOthers !== null ? maxReadByOthers >= msg.sequence ? "read" : "sent" : void 0;
|
|
1336
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1372
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1337
1373
|
MessageRow,
|
|
1338
1374
|
{
|
|
1339
|
-
msg,
|
|
1375
|
+
msg: enriched,
|
|
1340
1376
|
meId: me?.id ?? null,
|
|
1341
1377
|
reactions,
|
|
1342
1378
|
attachments,
|
|
@@ -1356,8 +1392,9 @@ function ConversationView({
|
|
|
1356
1392
|
onOpenThread: () => setThreadRootId(msg.id),
|
|
1357
1393
|
onQuote: () => setReplyingTo(msg),
|
|
1358
1394
|
onQuotedClick: scrollToOriginal
|
|
1359
|
-
}
|
|
1360
|
-
|
|
1395
|
+
},
|
|
1396
|
+
msg.id
|
|
1397
|
+
);
|
|
1361
1398
|
}),
|
|
1362
1399
|
error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "poolse-conversation__empty", children: [
|
|
1363
1400
|
"Failed to load: ",
|