@poolse/react-ui 0.2.0-alpha.7 → 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 +10 -0
- package/dist/index.cjs +100 -74
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +100 -74
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ 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
|
|
|
9
19
|
### Changed — quote card polish
|
package/dist/index.cjs
CHANGED
|
@@ -654,8 +654,9 @@ function MessageBubble({
|
|
|
654
654
|
hour: "2-digit",
|
|
655
655
|
minute: "2-digit"
|
|
656
656
|
}) : "";
|
|
657
|
+
const showQuoteCard = message.quoted_message !== void 0 && message.quoted_message !== null ? "full" : message.quoted_message_id ? "placeholder" : null;
|
|
657
658
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, children: [
|
|
658
|
-
|
|
659
|
+
showQuoteCard === "full" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
659
660
|
QuotedCard,
|
|
660
661
|
{
|
|
661
662
|
quoted: message.quoted_message,
|
|
@@ -664,6 +665,7 @@ function MessageBubble({
|
|
|
664
665
|
...onQuotedClick ? { onClick: onQuotedClick } : {}
|
|
665
666
|
}
|
|
666
667
|
),
|
|
668
|
+
showQuoteCard === "placeholder" && /* @__PURE__ */ jsxRuntime.jsx(QuotedPlaceholder, { isSelf, quotedMessageId: message.quoted_message_id }),
|
|
667
669
|
message.deleted_at ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "poolse-message__body--deleted", children: "[deleted]" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: message.body ?? "" }),
|
|
668
670
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "poolse-message__meta", children: [
|
|
669
671
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: time }),
|
|
@@ -679,6 +681,22 @@ function MessageBubble({
|
|
|
679
681
|
] })
|
|
680
682
|
] });
|
|
681
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
|
+
}
|
|
682
700
|
function QuotedCard({
|
|
683
701
|
quoted,
|
|
684
702
|
isSelf,
|
|
@@ -965,80 +983,87 @@ function MessageRow({
|
|
|
965
983
|
const showThreadPill = threads && !msg.deleted_at && !msg.thread_root_id && replyCount > 0;
|
|
966
984
|
const handleSave = onSaveEdit ?? (async () => void 0);
|
|
967
985
|
const handleCancel = onCancelEdit ?? (() => void 0);
|
|
968
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
{
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
onSave: handleSave,
|
|
977
|
-
onCancel: handleCancel
|
|
978
|
-
}
|
|
979
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
980
|
-
MessageBubble,
|
|
981
|
-
{
|
|
982
|
-
message: msg,
|
|
983
|
-
currentUserId: meId,
|
|
984
|
-
...readState ? { readState } : {},
|
|
985
|
-
...labelFor ? { labelFor } : {},
|
|
986
|
-
...onQuotedClick ? { onQuotedClick } : {}
|
|
987
|
-
}
|
|
988
|
-
),
|
|
989
|
-
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)) }),
|
|
990
|
-
showReactions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `poolse-message-row__reactions ${isSelf ? "is-self" : ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
991
|
-
InlineReactions,
|
|
992
|
-
{
|
|
993
|
-
reactions: reactionsHook.reactions,
|
|
994
|
-
currentUserId: meId,
|
|
995
|
-
onAdd: (e) => void reactionsHook.addReaction(e),
|
|
996
|
-
onRemove: (e) => void reactionsHook.removeReaction(e)
|
|
997
|
-
}
|
|
998
|
-
) }),
|
|
999
|
-
showThreadPill && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1000
|
-
"button",
|
|
1001
|
-
{
|
|
1002
|
-
type: "button",
|
|
1003
|
-
className: `poolse-thread-pill ${isSelf ? "poolse-thread-pill--right" : "poolse-thread-pill--left"}`,
|
|
1004
|
-
onClick: onOpenThread,
|
|
1005
|
-
"aria-label": `View ${replyCount} ${replyCount === 1 ? "reply" : "replies"}`,
|
|
1006
|
-
children: [
|
|
1007
|
-
/* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "messages", size: 12, label: null }),
|
|
1008
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
1009
|
-
replyCount,
|
|
1010
|
-
" ",
|
|
1011
|
-
replyCount === 1 ? "reply" : "replies"
|
|
1012
|
-
] })
|
|
1013
|
-
]
|
|
1014
|
-
}
|
|
1015
|
-
),
|
|
1016
|
-
showActions && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1017
|
-
"div",
|
|
1018
|
-
{
|
|
1019
|
-
className: `poolse-message-row__actions ${isSelf ? "poolse-message-row__actions--right" : "poolse-message-row__actions--left"}`,
|
|
1020
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1021
|
-
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,
|
|
1022
994
|
{
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
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 } : {}
|
|
1033
1060
|
}
|
|
1034
|
-
|
|
1035
|
-
...isSelf && onStartEdit ? { onEdit: onStartEdit } : {},
|
|
1036
|
-
...isSelf && onDelete ? { onDelete } : {}
|
|
1061
|
+
)
|
|
1037
1062
|
}
|
|
1038
1063
|
)
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1064
|
+
]
|
|
1065
|
+
}
|
|
1066
|
+
);
|
|
1042
1067
|
}
|
|
1043
1068
|
function InlineReactions({
|
|
1044
1069
|
reactions,
|
|
@@ -1344,7 +1369,7 @@ function ConversationView({
|
|
|
1344
1369
|
})() : msg;
|
|
1345
1370
|
const isSelf = me !== null && msg.sender_id === me.id;
|
|
1346
1371
|
const readState = readReceipts && isSelf && maxReadByOthers !== null ? maxReadByOthers >= msg.sequence ? "read" : "sent" : void 0;
|
|
1347
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1372
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1348
1373
|
MessageRow,
|
|
1349
1374
|
{
|
|
1350
1375
|
msg: enriched,
|
|
@@ -1367,8 +1392,9 @@ function ConversationView({
|
|
|
1367
1392
|
onOpenThread: () => setThreadRootId(msg.id),
|
|
1368
1393
|
onQuote: () => setReplyingTo(msg),
|
|
1369
1394
|
onQuotedClick: scrollToOriginal
|
|
1370
|
-
}
|
|
1371
|
-
|
|
1395
|
+
},
|
|
1396
|
+
msg.id
|
|
1397
|
+
);
|
|
1372
1398
|
}),
|
|
1373
1399
|
error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "poolse-conversation__empty", children: [
|
|
1374
1400
|
"Failed to load: ",
|