@linktr.ee/messaging-react 3.8.1 → 3.9.0-rc-1783406511

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.
Files changed (87) hide show
  1. package/dist/Card-BG-Mg_ss.js +221 -0
  2. package/dist/Card-BG-Mg_ss.js.map +1 -0
  3. package/dist/Card-CmRzkuPw.cjs +2 -0
  4. package/dist/Card-CmRzkuPw.cjs.map +1 -0
  5. package/dist/Card-DSG-wR8t.js +96 -0
  6. package/dist/Card-DSG-wR8t.js.map +1 -0
  7. package/dist/Card-DVEuTlf_.cjs +2 -0
  8. package/dist/Card-DVEuTlf_.cjs.map +1 -0
  9. package/dist/Card-K9ky-G-t.js +108 -0
  10. package/dist/Card-K9ky-G-t.js.map +1 -0
  11. package/dist/Card-iKTcn1wg.cjs +2 -0
  12. package/dist/Card-iKTcn1wg.cjs.map +1 -0
  13. package/dist/PurchaseStatusBadge-CJH4S-8Z.js +36 -0
  14. package/dist/PurchaseStatusBadge-CJH4S-8Z.js.map +1 -0
  15. package/dist/PurchaseStatusBadge-UjDzZhLj.cjs +2 -0
  16. package/dist/PurchaseStatusBadge-UjDzZhLj.cjs.map +1 -0
  17. package/dist/TextShell-BiqF2UB0.js +32 -0
  18. package/dist/TextShell-BiqF2UB0.js.map +1 -0
  19. package/dist/TextShell-Bnzh0T75.cjs +2 -0
  20. package/dist/TextShell-Bnzh0T75.cjs.map +1 -0
  21. package/dist/assets/index.css +1 -1
  22. package/dist/{index-BCgRoF_u.js → index-DO_dYsIf.js} +1154 -1113
  23. package/dist/index-DO_dYsIf.js.map +1 -0
  24. package/dist/index-DpzmKL5U.cjs +2 -0
  25. package/dist/index-DpzmKL5U.cjs.map +1 -0
  26. package/dist/index.cjs +1 -1
  27. package/dist/index.d.ts +98 -55
  28. package/dist/index.js +1 -1
  29. package/dist/testing.d.ts +1 -0
  30. package/dist/usePreviewToggle-B5kmPELX.cjs +2 -0
  31. package/dist/usePreviewToggle-B5kmPELX.cjs.map +1 -0
  32. package/dist/usePreviewToggle-D27Xw9Xx.js +323 -0
  33. package/dist/usePreviewToggle-D27Xw9Xx.js.map +1 -0
  34. package/package.json +2 -2
  35. package/src/components/CustomMessage/CustomMessage.stories.tsx +54 -1
  36. package/src/components/CustomMessage/MessageTag.tsx +8 -0
  37. package/src/components/CustomMessage/index.tsx +61 -22
  38. package/src/components/LockedAttachment/LockedAttachment.stories.tsx +410 -333
  39. package/src/components/LockedAttachment/LockedAttachment.test.tsx +104 -0
  40. package/src/components/LockedAttachment/components/Composer/Card.tsx +97 -120
  41. package/src/components/LockedAttachment/components/Media/Card.tsx +237 -0
  42. package/src/components/LockedAttachment/components/Text/Card.tsx +177 -0
  43. package/src/components/LockedAttachment/components/_shared/CardBody.tsx +3 -3
  44. package/src/components/LockedAttachment/components/_shared/CardThumbnail.tsx +92 -0
  45. package/src/components/LockedAttachment/components/_shared/GalleryThumbnail.tsx +11 -33
  46. package/src/components/LockedAttachment/components/_shared/LoadingDots.tsx +36 -0
  47. package/src/components/LockedAttachment/components/_shared/LockBadge.tsx +21 -11
  48. package/src/components/LockedAttachment/components/_shared/{LockedCardShell.tsx → MediaShell.tsx} +5 -5
  49. package/src/components/LockedAttachment/components/_shared/PreviewToggle.tsx +58 -0
  50. package/src/components/LockedAttachment/components/_shared/PriceLockRow.tsx +21 -0
  51. package/src/components/LockedAttachment/components/_shared/PurchaseStatusBadge.tsx +87 -0
  52. package/src/components/LockedAttachment/components/_shared/{LockedThumbnail.tsx → SingleThumbnail.tsx} +5 -5
  53. package/src/components/LockedAttachment/components/_shared/SkeletonTextLines.tsx +39 -0
  54. package/src/components/LockedAttachment/components/_shared/TextShell.tsx +19 -0
  55. package/src/components/LockedAttachment/components/_shared/usePreviewToggle.test.ts +67 -0
  56. package/src/components/LockedAttachment/components/_shared/usePreviewToggle.ts +89 -0
  57. package/src/components/LockedAttachment/components/_shared/useReceivedSource.ts +83 -0
  58. package/src/components/LockedAttachment/index.tsx +17 -28
  59. package/src/components/LockedAttachment/types.ts +28 -4
  60. package/src/index.ts +2 -5
  61. package/src/stream-custom-data.ts +1 -0
  62. package/src/styles.css +5 -0
  63. package/dist/Card-BRvcFjsq.js +0 -132
  64. package/dist/Card-BRvcFjsq.js.map +0 -1
  65. package/dist/Card-BuXkok0A.cjs +0 -2
  66. package/dist/Card-BuXkok0A.cjs.map +0 -1
  67. package/dist/Card-CvNHv3me.js +0 -107
  68. package/dist/Card-CvNHv3me.js.map +0 -1
  69. package/dist/Card-DOSuQdnk.cjs +0 -2
  70. package/dist/Card-DOSuQdnk.cjs.map +0 -1
  71. package/dist/Card-NnQw99XE.cjs +0 -2
  72. package/dist/Card-NnQw99XE.cjs.map +0 -1
  73. package/dist/Card-jGOcSN1O.js +0 -163
  74. package/dist/Card-jGOcSN1O.js.map +0 -1
  75. package/dist/LockedThumbnail-EsjaAqLR.js +0 -220
  76. package/dist/LockedThumbnail-EsjaAqLR.js.map +0 -1
  77. package/dist/LockedThumbnail-uAauUd5c.cjs +0 -2
  78. package/dist/LockedThumbnail-uAauUd5c.cjs.map +0 -1
  79. package/dist/index-BCgRoF_u.js.map +0 -1
  80. package/dist/index-DRurVQ0-.cjs +0 -2
  81. package/dist/index-DRurVQ0-.cjs.map +0 -1
  82. package/src/components/LockedAttachment/components/Composer/index.ts +0 -2
  83. package/src/components/LockedAttachment/components/Received/Card.tsx +0 -191
  84. package/src/components/LockedAttachment/components/Received/index.ts +0 -2
  85. package/src/components/LockedAttachment/components/Sent/Card.tsx +0 -177
  86. package/src/components/LockedAttachment/components/Sent/index.ts +0 -2
  87. /package/src/components/LockedAttachment/components/{Received → Media}/CardActions.tsx +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Card-iKTcn1wg.cjs","sources":["../src/components/LockedAttachment/components/_shared/LoadingDots.tsx","../src/components/LockedAttachment/components/_shared/SkeletonTextLines.tsx","../src/components/LockedAttachment/components/Text/Card.tsx"],"sourcesContent":["import React from 'react'\n\nconst Dot = ({ cx, index }: { cx: string; index: number }) => (\n <circle cx={cx} cy=\"6.15\" r=\"2.4\" fill=\"currentColor\">\n <animateTransform\n attributeName=\"transform\"\n type=\"translate\"\n values=\"0 0; 0 -2.25; 0 0;\"\n dur=\"900ms\"\n begin={`${120 * index}ms`}\n repeatCount=\"indefinite\"\n />\n </circle>\n)\n\n/**\n * Three bouncing dots, inline-sized for use inside buttons/labels (e.g. the\n * Unlock CTA while a purchase is in flight). Mirrors the typing indicator's\n * animation but uses `currentColor` so it adopts the surrounding text color.\n */\nconst LoadingDots: React.FC<{ className?: string }> = ({ className }) => (\n <svg\n aria-hidden=\"true\"\n className={className}\n viewBox=\"0 0 20 12.3\"\n width=\"20\"\n height=\"13\"\n overflow=\"visible\"\n >\n <Dot cx=\"3\" index={0} />\n <Dot cx=\"10\" index={1} />\n <Dot cx=\"17\" index={2} />\n </svg>\n)\n\nexport default LoadingDots\n","import classNames from 'classnames'\nimport React from 'react'\n\nexport interface SkeletonTextLinesProps {\n /** Matches the bubble it sits in — \"dark\" for the sender's own bubble. */\n variant: 'light' | 'dark'\n /**\n * Whether the bars pulse. Pass `false` once the outcome is settled (paid,\n * failed, refunded) — a static skeleton reads as \"nothing more will\n * change\", while a pulsing one implies something is still in flight.\n */\n animate: boolean\n}\n\n/**\n * Two skeleton bars standing in for the redacted text of a paid text-only\n * message — the real content is never sent to the client until purchase, so\n * there's nothing to render yet.\n *\n * Uses explicit black/white (not `bg-current`) because Tailwind doesn't\n * support opacity modifiers on the `current` color — `bg-current/30` silently\n * produces no CSS rule at all.\n */\nconst SkeletonTextLines: React.FC<SkeletonTextLinesProps> = ({\n variant = 'dark',\n animate = true,\n}) => {\n const pulse = animate ? 'animate-pulse motion-reduce:animate-none' : ''\n const colour = variant === 'dark' ? 'bg-white/25' : 'bg-black/15'\n\n return (\n <div className=\"flex flex-col gap-2 str-chat__message-text my-1\" aria-hidden>\n <div className={classNames('h-3 w-40 rounded-full', pulse, colour)} />\n <div className={classNames('h-3 w-24 rounded-full', pulse, colour)} />\n </div>\n )\n}\n\nexport default SkeletonTextLines\n","import { LockSimpleIcon } from '@phosphor-icons/react'\nimport type React from 'react'\n\nimport type { PaymentStatus } from '../../types'\nimport LoadingDots from '../_shared/LoadingDots'\nimport PriceLockRow from '../_shared/PriceLockRow'\nimport PurchaseStatusBadge from '../_shared/PurchaseStatusBadge'\nimport SkeletonTextLines from '../_shared/SkeletonTextLines'\nimport TextShell from '../_shared/TextShell'\n\ninterface TextCardSharedProps {\n amountText?: string\n paymentStatus?: PaymentStatus\n /**\n * The message's real, revealed content — shown instead of the skeleton\n * loader once `paymentStatus` is `'paid'`. Ignored otherwise. Lets the\n * caller supply its own text renderer (e.g. Stream's `MessageText`)\n * without `LockedAttachment` depending on it.\n */\n children?: React.ReactNode\n}\n\nexport type TextCardProps =\n | (TextCardSharedProps & {\n isMine: true\n })\n | (TextCardSharedProps & {\n isMine: false\n /**\n * Called when the recipient clicks Unlock on an unpaid attachment.\n * Use this to open a checkout flow. Omit to hide the Unlock button.\n */\n onUnlockClick?: () => void\n /**\n * When true, shows a loading spinner on the Unlock button. Driven by\n * the LockedAttachmentContext (e.g. checkout in progress).\n */\n isUnlocking?: boolean\n })\n\n/**\n * The sender's ('mine') view of a paid text-only message: an outgoing chat\n * bubble showing a skeleton text loader in place of the redacted content (or\n * `children`, once paid), plus a lock/price/status row.\n */\nconst OwnTextCard: React.FC<TextCardSharedProps & { isMine: true }> = ({\n amountText,\n paymentStatus = 'pending',\n children,\n}) => {\n const isFailed = paymentStatus === 'failed'\n const isPaid = paymentStatus === 'paid'\n\n if (isPaid && children) {\n return (\n <TextShell>\n {children}\n <span className=\"sr-only\" aria-live=\"polite\">\n Sold.\n </span>\n <PriceLockRow>\n {amountText != null && (\n <span className=\"text-white/55\">{amountText}</span>\n )}\n <PurchaseStatusBadge isMine={true} paymentStatus={paymentStatus} />\n </PriceLockRow>\n </TextShell>\n )\n }\n\n const liveMessage = isFailed\n ? 'Payment failed.'\n : paymentStatus === 'refunded'\n ? 'Refunded.'\n : 'Payment pending.'\n\n return (\n <TextShell>\n <SkeletonTextLines variant=\"dark\" animate={paymentStatus === 'pending'} />\n <span className=\"sr-only\" aria-live=\"polite\">\n {liveMessage}\n </span>\n <PriceLockRow>\n {amountText != null && (\n <span className=\"text-white/55\">{amountText}</span>\n )}\n <PurchaseStatusBadge isMine={true} paymentStatus={paymentStatus} />\n </PriceLockRow>\n </TextShell>\n )\n}\n\n/**\n * The recipient's ('other') view of a paid text-only message: a plain chat\n * bubble whose content is a skeleton text loader (or `children`, once paid)\n * plus a lock/price/status row. Two pre-purchase states exist — idle and\n * unlocking (checkout in flight) — plus the revealed state once\n * `paymentStatus` is `'paid'`.\n */\nconst OtherTextCard: React.FC<\n TextCardSharedProps & {\n isMine: false\n onUnlockClick?: () => void\n isUnlocking?: boolean\n }\n> = ({\n amountText,\n paymentStatus,\n onUnlockClick,\n isUnlocking = false,\n children,\n}) => {\n const isPaid = paymentStatus === 'paid'\n\n if (isPaid && children) {\n return (\n <TextShell>\n {children}\n <PriceLockRow>\n {amountText != null && (\n <span className=\"opacity-55\">{amountText}</span>\n )}\n <PurchaseStatusBadge isMine={false} paymentStatus=\"paid\" />\n </PriceLockRow>\n </TextShell>\n )\n }\n\n const ariaLabel = isUnlocking\n ? 'Unlocking.'\n : 'Locked message available to unlock.'\n\n return (\n <TextShell>\n <div className=\"flex items-center gap-3\">\n <div className=\"flex flex-1 flex-col gap-2\">\n <SkeletonTextLines variant=\"light\" animate={isUnlocking} />\n <span className=\"sr-only\" aria-live=\"polite\">\n {ariaLabel}\n </span>\n <PriceLockRow>\n {amountText != null && (\n <span className=\"opacity-55\">{amountText}</span>\n )}\n </PriceLockRow>\n </div>\n <button\n type=\"button\"\n onClick={onUnlockClick}\n disabled={isUnlocking}\n aria-label={isUnlocking ? 'Unlocking' : 'Unlock'}\n aria-busy={isUnlocking}\n title={isUnlocking ? 'Unlocking' : 'Unlock'}\n className=\"flex size-10 shrink-0 items-center justify-center rounded-full bg-[#121110] text-white hover:bg-[#2a2928]\"\n >\n {isUnlocking ? (\n <LoadingDots />\n ) : (\n <LockSimpleIcon className=\"size-4\" weight=\"fill\" aria-hidden />\n )}\n </button>\n </div>\n </TextShell>\n )\n}\n\n/**\n * The card either party sees for a paid text-only message — a chat bubble\n * showing a skeleton text loader (or `children`, once revealed) plus a\n * lock/price/status row. `isMine` selects the sender's payment-lifecycle view\n * (pending/failed/refunded/paid + Dismiss) vs. the recipient's unlock-flow\n * view (idle/unlocking + Unlock CTA).\n */\nconst TextCard: React.FC<TextCardProps> = (props) =>\n props.isMine ? <OwnTextCard {...props} /> : <OtherTextCard {...props} />\n\nexport default TextCard\n"],"names":["Dot","cx","index","jsx","LoadingDots","className","jsxs","SkeletonTextLines","variant","animate","pulse","colour","classNames","OwnTextCard","amountText","paymentStatus","children","isFailed","TextShell","PriceLockRow","PurchaseStatusBadge","liveMessage","OtherTextCard","onUnlockClick","isUnlocking","ariaLabel","LockSimpleIcon","TextCard","props"],"mappings":"sQAEMA,EAAM,CAAC,CAAE,GAAAC,EAAI,MAAAC,KACjBC,EAAAA,IAAC,SAAA,CAAO,GAAAF,EAAQ,GAAG,OAAO,EAAE,MAAM,KAAK,eACrC,SAAAE,EAAAA,IAAC,mBAAA,CACC,cAAc,YACd,KAAK,YACL,OAAO,qBACP,IAAI,QACJ,MAAO,GAAG,IAAMD,CAAK,KACrB,YAAY,YAAA,CACd,EACF,EAQIE,EAAgD,CAAC,CAAE,UAAAC,CAAA,IACvDC,EAAAA,KAAC,MAAA,CACC,cAAY,OACZ,UAAAD,EACA,QAAQ,cACR,MAAM,KACN,OAAO,KACP,SAAS,UAET,SAAA,CAAAF,EAAAA,IAACH,EAAA,CAAI,GAAG,IAAI,MAAO,EAAG,EACtBG,EAAAA,IAACH,EAAA,CAAI,GAAG,KAAK,MAAO,EAAG,EACvBG,EAAAA,IAACH,EAAA,CAAI,GAAG,KAAK,MAAO,CAAA,CAAG,CAAA,CAAA,CACzB,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+ import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
+ import { CheckCircleIcon as d } from "@phosphor-icons/react";
3
+ import s from "classnames";
4
+ import a from "react";
5
+ const h = ({
6
+ isMine: l,
7
+ paymentStatus: r,
8
+ amountText: i
9
+ }) => {
10
+ const n = l ? "text-white/55" : "text-black/55", c = l ? "text-[#34c759]" : "text-[#008236]";
11
+ return r === "paid" ? /* @__PURE__ */ t(a.Fragment, { children: [
12
+ /* @__PURE__ */ e("span", { className: s("text-xs font-medium", n), children: "•" }),
13
+ /* @__PURE__ */ e("span", { className: s("text-xs font-medium", c), children: l ? "Sold" : "Purchased" }),
14
+ /* @__PURE__ */ e(
15
+ d,
16
+ {
17
+ className: s("shrink-0 size-3.5", c),
18
+ weight: "bold",
19
+ "aria-hidden": !0
20
+ }
21
+ )
22
+ ] }) : i != null ? /* @__PURE__ */ t(a.Fragment, { children: [
23
+ /* @__PURE__ */ e("span", { className: s("text-xs font-medium", n), children: "•" }),
24
+ /* @__PURE__ */ e("span", { className: s("text-xs font-medium", n), children: i })
25
+ ] }) : r === "pending" ? /* @__PURE__ */ t(a.Fragment, { children: [
26
+ /* @__PURE__ */ e("span", { className: s("text-xs font-medium", n), children: "•" }),
27
+ /* @__PURE__ */ e("span", { className: s("text-xs font-medium", n), children: "Sent" })
28
+ ] }) : r === "failed" || r === "refunded" ? /* @__PURE__ */ t(a.Fragment, { children: [
29
+ /* @__PURE__ */ e("span", { className: s("text-xs font-medium", n), children: "•" }),
30
+ /* @__PURE__ */ e("span", { className: s("text-xs font-medium", n), children: r === "failed" ? "Payment failed" : "Refunded" })
31
+ ] }) : null;
32
+ };
33
+ export {
34
+ h as P
35
+ };
36
+ //# sourceMappingURL=PurchaseStatusBadge-CJH4S-8Z.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PurchaseStatusBadge-CJH4S-8Z.js","sources":["../src/components/LockedAttachment/components/_shared/PurchaseStatusBadge.tsx"],"sourcesContent":["import { CheckCircleIcon } from '@phosphor-icons/react'\nimport classNames from 'classnames'\nimport React from 'react'\n\nimport type { PaymentStatus } from '../../types'\n\nexport interface PurchaseStatusBadgeProps {\n /** 'own' matches the sender's dark/own-message context; 'other' matches the recipient's light/other-message context. */\n isMine: boolean\n /** 'paid' renders the \"Sold\"/\"Purchased\" + checkmark variant; otherwise falls back to plain amount text, or nothing. */\n paymentStatus?: PaymentStatus\n amountText?: string\n}\n\n/**\n * Bullet + amount/label + checkmark row for a paid attachment or message.\n * Shared by `LockedAttachment.Media`/`.Text`'s status badges.\n */\nconst PurchaseStatusBadge: React.FC<PurchaseStatusBadgeProps> = ({\n isMine,\n paymentStatus,\n amountText,\n}) => {\n const labelColour = isMine ? 'text-white/55' : 'text-black/55'\n const successColour = isMine ? 'text-[#34c759]' : 'text-[#008236]'\n \n if (paymentStatus === 'paid') {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n &bull;\n </span>\n <span className={classNames('text-xs font-medium', successColour)}>\n {isMine ? 'Sold' : 'Purchased'}\n </span>\n <CheckCircleIcon\n className={classNames('shrink-0 size-3.5', successColour)}\n weight=\"bold\"\n aria-hidden\n />\n </React.Fragment>\n )\n }\n\n if (amountText != null) {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n &bull;\n </span>\n <span className={classNames('text-xs font-medium', labelColour)}>\n {amountText}\n </span>\n </React.Fragment>\n )\n }\n\n if (paymentStatus === 'pending') {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n &bull;\n </span>\n <span className={classNames('text-xs font-medium', labelColour)}>\n Sent\n </span>\n </React.Fragment>\n )\n }\n\n if (paymentStatus === 'failed' || paymentStatus === 'refunded') {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n &bull;\n </span>\n <span className={classNames('text-xs font-medium', labelColour)}>\n {paymentStatus === 'failed' ? 'Payment failed' : 'Refunded'}\n </span>\n </React.Fragment>\n )\n }\n\n return null\n}\n\nexport default PurchaseStatusBadge\n"],"names":["PurchaseStatusBadge","isMine","paymentStatus","amountText","labelColour","successColour","jsxs","React","jsx","classNames","CheckCircleIcon"],"mappings":";;;;AAkBA,MAAMA,IAA0D,CAAC;AAAA,EAC/D,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AACF,MAAM;AACJ,QAAMC,IAAcH,IAAS,kBAAkB,iBACzCI,IAAgBJ,IAAS,mBAAmB;AAElD,SAAIC,MAAkB,SAElB,gBAAAI,EAACC,EAAM,UAAN,EACC,UAAA;AAAA,IAAA,gBAAAC,EAAC,UAAK,WAAWC,EAAW,uBAAuBL,CAAW,GAAG,UAAA,KAEjE;AAAA,IACA,gBAAAI,EAAC,UAAK,WAAWC,EAAW,uBAAuBJ,CAAa,GAC7D,UAAAJ,IAAS,SAAS,YAAA,CACrB;AAAA,IACA,gBAAAO;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,WAAWD,EAAW,qBAAqBJ,CAAa;AAAA,QACxD,QAAO;AAAA,QACP,eAAW;AAAA,MAAA;AAAA,IAAA;AAAA,EACb,GACF,IAIAF,KAAc,OAEd,gBAAAG,EAACC,EAAM,UAAN,EACC,UAAA;AAAA,IAAA,gBAAAC,EAAC,UAAK,WAAWC,EAAW,uBAAuBL,CAAW,GAAG,UAAA,KAEjE;AAAA,sBACC,QAAA,EAAK,WAAWK,EAAW,uBAAuBL,CAAW,GAC3D,UAAAD,EAAA,CACH;AAAA,EAAA,GACF,IAIAD,MAAkB,YAElB,gBAAAI,EAACC,EAAM,UAAN,EACC,UAAA;AAAA,IAAA,gBAAAC,EAAC,UAAK,WAAWC,EAAW,uBAAuBL,CAAW,GAAG,UAAA,KAEjE;AAAA,sBACC,QAAA,EAAK,WAAWK,EAAW,uBAAuBL,CAAW,GAAG,UAAA,OAAA,CAEjE;AAAA,EAAA,GACF,IAIAF,MAAkB,YAAYA,MAAkB,aAEhD,gBAAAI,EAACC,EAAM,UAAN,EACC,UAAA;AAAA,IAAA,gBAAAC,EAAC,UAAK,WAAWC,EAAW,uBAAuBL,CAAW,GAAG,UAAA,KAEjE;AAAA,IACA,gBAAAI,EAAC,QAAA,EAAK,WAAWC,EAAW,uBAAuBL,CAAW,GAC3D,UAAAF,MAAkB,WAAW,mBAAmB,WAAA,CACnD;AAAA,EAAA,GACF,IAIG;AACT;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const e=require("react/jsx-runtime"),l=require("@phosphor-icons/react"),s=require("classnames"),r=require("react"),d=({isMine:c,paymentStatus:t,amountText:a})=>{const n=c?"text-white/55":"text-black/55",i=c?"text-[#34c759]":"text-[#008236]";return t==="paid"?e.jsxs(r.Fragment,{children:[e.jsx("span",{className:s("text-xs font-medium",n),children:"•"}),e.jsx("span",{className:s("text-xs font-medium",i),children:c?"Sold":"Purchased"}),e.jsx(l.CheckCircleIcon,{className:s("shrink-0 size-3.5",i),weight:"bold","aria-hidden":!0})]}):a!=null?e.jsxs(r.Fragment,{children:[e.jsx("span",{className:s("text-xs font-medium",n),children:"•"}),e.jsx("span",{className:s("text-xs font-medium",n),children:a})]}):t==="pending"?e.jsxs(r.Fragment,{children:[e.jsx("span",{className:s("text-xs font-medium",n),children:"•"}),e.jsx("span",{className:s("text-xs font-medium",n),children:"Sent"})]}):t==="failed"||t==="refunded"?e.jsxs(r.Fragment,{children:[e.jsx("span",{className:s("text-xs font-medium",n),children:"•"}),e.jsx("span",{className:s("text-xs font-medium",n),children:t==="failed"?"Payment failed":"Refunded"})]}):null};exports.PurchaseStatusBadge=d;
2
+ //# sourceMappingURL=PurchaseStatusBadge-UjDzZhLj.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PurchaseStatusBadge-UjDzZhLj.cjs","sources":["../src/components/LockedAttachment/components/_shared/PurchaseStatusBadge.tsx"],"sourcesContent":["import { CheckCircleIcon } from '@phosphor-icons/react'\nimport classNames from 'classnames'\nimport React from 'react'\n\nimport type { PaymentStatus } from '../../types'\n\nexport interface PurchaseStatusBadgeProps {\n /** 'own' matches the sender's dark/own-message context; 'other' matches the recipient's light/other-message context. */\n isMine: boolean\n /** 'paid' renders the \"Sold\"/\"Purchased\" + checkmark variant; otherwise falls back to plain amount text, or nothing. */\n paymentStatus?: PaymentStatus\n amountText?: string\n}\n\n/**\n * Bullet + amount/label + checkmark row for a paid attachment or message.\n * Shared by `LockedAttachment.Media`/`.Text`'s status badges.\n */\nconst PurchaseStatusBadge: React.FC<PurchaseStatusBadgeProps> = ({\n isMine,\n paymentStatus,\n amountText,\n}) => {\n const labelColour = isMine ? 'text-white/55' : 'text-black/55'\n const successColour = isMine ? 'text-[#34c759]' : 'text-[#008236]'\n \n if (paymentStatus === 'paid') {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n &bull;\n </span>\n <span className={classNames('text-xs font-medium', successColour)}>\n {isMine ? 'Sold' : 'Purchased'}\n </span>\n <CheckCircleIcon\n className={classNames('shrink-0 size-3.5', successColour)}\n weight=\"bold\"\n aria-hidden\n />\n </React.Fragment>\n )\n }\n\n if (amountText != null) {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n &bull;\n </span>\n <span className={classNames('text-xs font-medium', labelColour)}>\n {amountText}\n </span>\n </React.Fragment>\n )\n }\n\n if (paymentStatus === 'pending') {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n &bull;\n </span>\n <span className={classNames('text-xs font-medium', labelColour)}>\n Sent\n </span>\n </React.Fragment>\n )\n }\n\n if (paymentStatus === 'failed' || paymentStatus === 'refunded') {\n return (\n <React.Fragment>\n <span className={classNames('text-xs font-medium', labelColour)}>\n &bull;\n </span>\n <span className={classNames('text-xs font-medium', labelColour)}>\n {paymentStatus === 'failed' ? 'Payment failed' : 'Refunded'}\n </span>\n </React.Fragment>\n )\n }\n\n return null\n}\n\nexport default PurchaseStatusBadge\n"],"names":["PurchaseStatusBadge","isMine","paymentStatus","amountText","labelColour","successColour","jsxs","React","jsx","classNames","CheckCircle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@phosphor-icons/react";
3
+ import i from "classnames";
4
+ const r = ({ children: e }) => /* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-xs font-medium", children: [
5
+ /* @__PURE__ */ s(
6
+ c,
7
+ {
8
+ className: "size-3.5 shrink-0 opacity-55",
9
+ weight: "fill",
10
+ "aria-hidden": !0
11
+ }
12
+ ),
13
+ e
14
+ ] }), x = ({
15
+ children: e,
16
+ className: t
17
+ }) => /* @__PURE__ */ s(
18
+ "div",
19
+ {
20
+ className: i(
21
+ "str-chat__message-bubble message-locked-attachment-text",
22
+ "px-4 py-3 flex flex-col gap-1",
23
+ t
24
+ ),
25
+ children: e
26
+ }
27
+ );
28
+ export {
29
+ r as P,
30
+ x as T
31
+ };
32
+ //# sourceMappingURL=TextShell-BiqF2UB0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextShell-BiqF2UB0.js","sources":["../src/components/LockedAttachment/components/_shared/PriceLockRow.tsx","../src/components/LockedAttachment/components/_shared/TextShell.tsx"],"sourcesContent":["import { LockSimpleIcon } from '@phosphor-icons/react'\nimport type React from 'react'\n\n/**\n * The lock-icon + amount/status row shared by every LockedAttachment text-mode\n * card. Only the wrapper and the leading lock icon are shared — the amount and\n * any trailing status live in `children`, since they genuinely differ per card\n * (placeholder fallback vs. paid badge vs. bare amount).\n */\nconst PriceLockRow: React.FC<React.PropsWithChildren> = ({ children }) => (\n <div className=\"flex items-center gap-1 text-xs font-medium\">\n <LockSimpleIcon\n className=\"size-3.5 shrink-0 opacity-55\"\n weight=\"fill\"\n aria-hidden\n />\n {children}\n </div>\n)\n\nexport default PriceLockRow\n","import classNames from 'classnames'\nimport React from 'react'\n\nconst TextShell: React.FC<React.PropsWithChildren<{ className?: string }>> = ({\n children,\n className,\n}) => (\n <div\n className={classNames(\n 'str-chat__message-bubble message-locked-attachment-text',\n 'px-4 py-3 flex flex-col gap-1',\n className\n )}\n >\n {children}\n </div>\n)\n\nexport default TextShell\n"],"names":["PriceLockRow","children","jsxs","jsx","LockSimpleIcon","TextShell","className","classNames"],"mappings":";;;AASA,MAAMA,IAAkD,CAAC,EAAE,UAAAC,QACzD,gBAAAC,EAAC,OAAA,EAAI,WAAU,+CACb,UAAA;AAAA,EAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,QAAO;AAAA,MACP,eAAW;AAAA,IAAA;AAAA,EAAA;AAAA,EAEZH;AAAA,EAAA,CACH,GCdII,IAAuE,CAAC;AAAA,EAC5E,UAAAJ;AAAA,EACA,WAAAK;AACF,MACE,gBAAAH;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWI;AAAA,MACT;AAAA,MACA;AAAA,MACAD;AAAA,IAAA;AAAA,IAGD,UAAAL;AAAA,EAAA;AACH;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const s=require("react/jsx-runtime"),c=require("@phosphor-icons/react"),i=require("classnames"),a=({children:e})=>s.jsxs("div",{className:"flex items-center gap-1 text-xs font-medium",children:[s.jsx(c.LockSimpleIcon,{className:"size-3.5 shrink-0 opacity-55",weight:"fill","aria-hidden":!0}),e]}),l=({children:e,className:t})=>s.jsx("div",{className:i("str-chat__message-bubble message-locked-attachment-text","px-4 py-3 flex flex-col gap-1",t),children:e});exports.PriceLockRow=a;exports.TextShell=l;
2
+ //# sourceMappingURL=TextShell-Bnzh0T75.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextShell-Bnzh0T75.cjs","sources":["../src/components/LockedAttachment/components/_shared/PriceLockRow.tsx","../src/components/LockedAttachment/components/_shared/TextShell.tsx"],"sourcesContent":["import { LockSimpleIcon } from '@phosphor-icons/react'\nimport type React from 'react'\n\n/**\n * The lock-icon + amount/status row shared by every LockedAttachment text-mode\n * card. Only the wrapper and the leading lock icon are shared — the amount and\n * any trailing status live in `children`, since they genuinely differ per card\n * (placeholder fallback vs. paid badge vs. bare amount).\n */\nconst PriceLockRow: React.FC<React.PropsWithChildren> = ({ children }) => (\n <div className=\"flex items-center gap-1 text-xs font-medium\">\n <LockSimpleIcon\n className=\"size-3.5 shrink-0 opacity-55\"\n weight=\"fill\"\n aria-hidden\n />\n {children}\n </div>\n)\n\nexport default PriceLockRow\n","import classNames from 'classnames'\nimport React from 'react'\n\nconst TextShell: React.FC<React.PropsWithChildren<{ className?: string }>> = ({\n children,\n className,\n}) => (\n <div\n className={classNames(\n 'str-chat__message-bubble message-locked-attachment-text',\n 'px-4 py-3 flex flex-col gap-1',\n className\n )}\n >\n {children}\n </div>\n)\n\nexport default TextShell\n"],"names":["PriceLockRow","children","jsxs","jsx","LockSimpleIcon","TextShell","className","classNames"],"mappings":"6GASMA,EAAkD,CAAC,CAAE,SAAAC,KACzDC,EAAAA,KAAC,MAAA,CAAI,UAAU,8CACb,SAAA,CAAAC,EAAAA,IAACC,EAAAA,eAAA,CACC,UAAU,+BACV,OAAO,OACP,cAAW,EAAA,CAAA,EAEZH,CAAA,CAAA,CACH,ECdII,EAAuE,CAAC,CAC5E,SAAAJ,EACA,UAAAK,CACF,IACEH,EAAAA,IAAC,MAAA,CACC,UAAWI,EACT,0DACA,gCACAD,CAAA,EAGD,SAAAL,CAAA,CACH"}