@poolse/react-ui 1.0.2 → 1.0.3

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/dist/index.cjs CHANGED
@@ -905,7 +905,8 @@ function MessageBubble({
905
905
  groupPosition = "standalone",
906
906
  maxBodyLength = 0,
907
907
  markdown = false,
908
- showSenderName = false
908
+ showSenderName = false,
909
+ actionsTrigger
909
910
  }) {
910
911
  const isSelf = currentUserId !== null && message.sender_id === currentUserId;
911
912
  const [expanded, setExpanded] = react.useState(false);
@@ -931,6 +932,7 @@ function MessageBubble({
931
932
  }) : "";
932
933
  const showQuoteCard = message.quoted_message !== void 0 && message.quoted_message !== null ? "full" : message.quoted_message_id ? "placeholder" : null;
933
934
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, children: [
935
+ actionsTrigger,
934
936
  renderSenderName && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "poolse-message__sender", style: { color: senderColorHex }, children: senderName }),
935
937
  showQuoteCard === "full" && /* @__PURE__ */ jsxRuntime.jsx(
936
938
  QuotedCard,
@@ -1372,6 +1374,7 @@ function MessageRow({
1372
1374
  ].filter(Boolean).join(" "),
1373
1375
  "data-message-id": msg.id,
1374
1376
  "data-actions-open": actionsOpen || void 0,
1377
+ "data-avatar": showAvatar && !isSelf ? true : void 0,
1375
1378
  onClick: onRowClick,
1376
1379
  children: [
1377
1380
  editing ? /* @__PURE__ */ jsxRuntime.jsx(
@@ -1403,7 +1406,23 @@ function MessageRow({
1403
1406
  showSenderName,
1404
1407
  ...readState ? { readState } : {},
1405
1408
  ...labelFor ? { labelFor } : {},
1406
- ...onQuotedClick ? { onQuotedClick } : {}
1409
+ ...onQuotedClick ? { onQuotedClick } : {},
1410
+ ...showActions ? {
1411
+ actionsTrigger: /* @__PURE__ */ jsxRuntime.jsx(
1412
+ "button",
1413
+ {
1414
+ type: "button",
1415
+ className: "poolse-message__chevron",
1416
+ "aria-label": "Show message actions",
1417
+ "aria-expanded": actionsOpen,
1418
+ onClick: (e) => {
1419
+ e.stopPropagation();
1420
+ setActionsOpen((o) => !o);
1421
+ },
1422
+ children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "chevron-down", size: 14, label: null })
1423
+ }
1424
+ )
1425
+ } : {}
1407
1426
  }
1408
1427
  )
1409
1428
  }
@@ -1581,7 +1600,18 @@ function ThreadView({
1581
1600
  );
1582
1601
  }
1583
1602
  function defaultRenderReply(msg, currentUserId) {
1584
- return /* @__PURE__ */ jsxRuntime.jsx(MessageBubble, { message: msg, currentUserId });
1603
+ return /* @__PURE__ */ jsxRuntime.jsx(
1604
+ MessageRow,
1605
+ {
1606
+ msg,
1607
+ meId: currentUserId,
1608
+ reactions: true,
1609
+ attachments: true,
1610
+ actions: true,
1611
+ threads: false,
1612
+ quotations: false
1613
+ }
1614
+ );
1585
1615
  }
1586
1616
  function TypingIndicator({ typing, labelFor }) {
1587
1617
  const ids = Array.from(typing);