@poolse/react-ui 0.2.0-alpha.2 → 0.2.0-alpha.4
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 +16 -0
- package/dist/index.cjs +30 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +30 -1
- package/dist/index.js.map +1 -1
- package/dist/styles.css +48 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,22 @@ All notable changes to `@poolse/react-ui` are documented here. Format follows
|
|
|
6
6
|
|
|
7
7
|
## [0.2.0] — 2026-06-01
|
|
8
8
|
|
|
9
|
+
### Added — thread pill + copy action
|
|
10
|
+
|
|
11
|
+
- `<MessageRow>` renders a subtle "💬 N replies" pill below any message
|
|
12
|
+
whose `reply_count > 0`. Clicking the pill opens the thread side-pane
|
|
13
|
+
via the existing `onOpenThread` callback. Hidden in `<ThreadView>`
|
|
14
|
+
(threads-within-threads aren't supported in 0.2).
|
|
15
|
+
- `<MessageActions>` gains an optional `onCopy` action. `<MessageRow>`
|
|
16
|
+
wires it to `navigator.clipboard.writeText(message.body)` whenever
|
|
17
|
+
the message has a non-empty body.
|
|
18
|
+
|
|
19
|
+
### Changed — better error visibility
|
|
20
|
+
|
|
21
|
+
- `<MemberList>` now renders `error.message` under the "Failed to load
|
|
22
|
+
members." headline so callers see the actual cause without opening
|
|
23
|
+
DevTools.
|
|
24
|
+
|
|
9
25
|
### Added — new components
|
|
10
26
|
|
|
11
27
|
- `<MessageActions>` — hover-triggered popover with react / reply
|
package/dist/index.cjs
CHANGED
|
@@ -768,6 +768,7 @@ function ReactionPicker({
|
|
|
768
768
|
function MessageActions({
|
|
769
769
|
onReact,
|
|
770
770
|
onReply,
|
|
771
|
+
onCopy,
|
|
771
772
|
onEdit,
|
|
772
773
|
onDelete,
|
|
773
774
|
children
|
|
@@ -796,6 +797,7 @@ function MessageActions({
|
|
|
796
797
|
) })
|
|
797
798
|
] }),
|
|
798
799
|
onReply && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { label: "Reply in thread", icon: "reply", onClick: onReply }),
|
|
800
|
+
onCopy && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { label: "Copy", icon: "copy", onClick: onCopy }),
|
|
799
801
|
onEdit && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { label: "Edit", icon: "edit", onClick: onEdit }),
|
|
800
802
|
onDelete && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { label: "Delete", icon: "trash", danger: true, onClick: onDelete }),
|
|
801
803
|
children
|
|
@@ -839,6 +841,8 @@ function MessageRow({
|
|
|
839
841
|
const showReactions = reactions && !msg.deleted_at;
|
|
840
842
|
const showAttachments = attachments && Array.isArray(msg.attachments) && msg.attachments.length > 0;
|
|
841
843
|
const showActions = actions && !msg.deleted_at && !editing;
|
|
844
|
+
const replyCount = msg.reply_count ?? 0;
|
|
845
|
+
const showThreadPill = threads && !msg.deleted_at && !msg.thread_root_id && replyCount > 0;
|
|
842
846
|
const handleSave = onSaveEdit ?? (async () => void 0);
|
|
843
847
|
const handleCancel = onCancelEdit ?? (() => void 0);
|
|
844
848
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `poolse-message-row ${isSelf ? "poolse-message-row--right" : ""}`, children: [
|
|
@@ -863,6 +867,23 @@ function MessageRow({
|
|
|
863
867
|
onRemove: (e) => void reactionsHook.removeReaction(e)
|
|
864
868
|
}
|
|
865
869
|
) }),
|
|
870
|
+
showThreadPill && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
871
|
+
"button",
|
|
872
|
+
{
|
|
873
|
+
type: "button",
|
|
874
|
+
className: `poolse-thread-pill ${isSelf ? "poolse-thread-pill--right" : "poolse-thread-pill--left"}`,
|
|
875
|
+
onClick: onOpenThread,
|
|
876
|
+
"aria-label": `View ${replyCount} ${replyCount === 1 ? "reply" : "replies"}`,
|
|
877
|
+
children: [
|
|
878
|
+
/* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "messages", size: 12, label: null }),
|
|
879
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
880
|
+
replyCount,
|
|
881
|
+
" ",
|
|
882
|
+
replyCount === 1 ? "reply" : "replies"
|
|
883
|
+
] })
|
|
884
|
+
]
|
|
885
|
+
}
|
|
886
|
+
),
|
|
866
887
|
showActions && /* @__PURE__ */ jsxRuntime.jsx(
|
|
867
888
|
"div",
|
|
868
889
|
{
|
|
@@ -876,6 +897,11 @@ function MessageRow({
|
|
|
876
897
|
}
|
|
877
898
|
} : {},
|
|
878
899
|
...threads && onOpenThread ? { onReply: onOpenThread } : {},
|
|
900
|
+
...msg.body ? {
|
|
901
|
+
onCopy: () => {
|
|
902
|
+
void navigator?.clipboard?.writeText(msg.body ?? "").catch(() => void 0);
|
|
903
|
+
}
|
|
904
|
+
} : {},
|
|
879
905
|
...isSelf && onStartEdit ? { onEdit: onStartEdit } : {},
|
|
880
906
|
...isSelf && onDelete ? { onDelete } : {}
|
|
881
907
|
}
|
|
@@ -1336,7 +1362,10 @@ function MemberList({
|
|
|
1336
1362
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "poolse-list poolse-list--placeholder", children: "Loading members\u2026" });
|
|
1337
1363
|
}
|
|
1338
1364
|
if (error) {
|
|
1339
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
1365
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "poolse-list poolse-list--placeholder poolse-list--error", children: [
|
|
1366
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: "Failed to load members." }),
|
|
1367
|
+
error.message && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "poolse-list__error-detail", children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: error.message }) })
|
|
1368
|
+
] });
|
|
1340
1369
|
}
|
|
1341
1370
|
if (members.length === 0) {
|
|
1342
1371
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "poolse-list poolse-list--placeholder", children: emptyState ?? "No members yet." });
|