@linktr.ee/messaging-react 3.9.0-rc-1783472582 → 3.9.0-rc-1783575293

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 (85) hide show
  1. package/dist/Card-B7ccxsKf.cjs +2 -0
  2. package/dist/Card-B7ccxsKf.cjs.map +1 -0
  3. package/dist/Card-CXRSSrCh.cjs +2 -0
  4. package/dist/Card-CXRSSrCh.cjs.map +1 -0
  5. package/dist/Card-DaUKmwtb.js +105 -0
  6. package/dist/Card-DaUKmwtb.js.map +1 -0
  7. package/dist/Card-Q1Ee_UCB.js +693 -0
  8. package/dist/Card-Q1Ee_UCB.js.map +1 -0
  9. package/dist/{LoadingDots-nW6r0-Kg.js → LoadingDots-Ct3WmVlT.js} +18 -21
  10. package/dist/LoadingDots-Ct3WmVlT.js.map +1 -0
  11. package/dist/LoadingDots-D9GGphgM.cjs +2 -0
  12. package/dist/LoadingDots-D9GGphgM.cjs.map +1 -0
  13. package/dist/assets/index.css +1 -1
  14. package/dist/{index-B8gqCioX.js → index-BiBvPADG.js} +1301 -1315
  15. package/dist/index-BiBvPADG.js.map +1 -0
  16. package/dist/index-DuPa2mUh.cjs +2 -0
  17. package/dist/index-DuPa2mUh.cjs.map +1 -0
  18. package/dist/index.cjs +1 -1
  19. package/dist/index.d.ts +149 -129
  20. package/dist/index.js +1 -1
  21. package/package.json +2 -2
  22. package/src/components/ChannelList/CustomChannelPreview.test.tsx +95 -0
  23. package/src/components/ChannelList/CustomChannelPreview.tsx +21 -9
  24. package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/LockedAttachment.stories.tsx +87 -78
  25. package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/LockedAttachment.test.tsx +24 -11
  26. package/src/components/CustomMessage/LockedAttachment/components/Media/Card.tsx +358 -0
  27. package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/Media/CardActions.tsx +5 -0
  28. package/src/components/CustomMessage/LockedAttachment/components/Media/types.ts +79 -0
  29. package/src/components/CustomMessage/LockedAttachment/components/Text/Card.tsx +155 -0
  30. package/src/components/CustomMessage/LockedAttachment/components/Text/types.ts +58 -0
  31. package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/CardBody.tsx +5 -4
  32. package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/GalleryThumbnail.tsx +2 -2
  33. package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/LockBadge.tsx +1 -1
  34. package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/PurchaseStatusBadge.tsx +0 -12
  35. package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/SingleThumbnail.tsx +1 -1
  36. package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/SkeletonTextLines.tsx +3 -13
  37. package/src/components/CustomMessage/LockedAttachment/components/_shared/TextShell.tsx +30 -0
  38. package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/usePreviewToggle.test.ts +1 -1
  39. package/src/components/CustomMessage/LockedAttachment/index.tsx +105 -0
  40. package/src/components/CustomMessage/LockedAttachment/types.ts +44 -0
  41. package/src/components/CustomMessage/context.tsx +1 -1
  42. package/src/components/CustomMessage/index.tsx +45 -50
  43. package/src/components/CustomMessageInput/CustomMessageInput.stories.tsx +5 -3
  44. package/src/index.ts +3 -5
  45. package/src/styles.css +8 -1
  46. package/src/types.ts +1 -1
  47. package/dist/Card-BVZM0-06.js +0 -108
  48. package/dist/Card-BVZM0-06.js.map +0 -1
  49. package/dist/Card-D0hLrOxX.js +0 -221
  50. package/dist/Card-D0hLrOxX.js.map +0 -1
  51. package/dist/Card-DIr1UnfC.cjs +0 -2
  52. package/dist/Card-DIr1UnfC.cjs.map +0 -1
  53. package/dist/Card-DeSgaRTL.cjs +0 -2
  54. package/dist/Card-DeSgaRTL.cjs.map +0 -1
  55. package/dist/Card-DnaXMVrT.cjs +0 -2
  56. package/dist/Card-DnaXMVrT.cjs.map +0 -1
  57. package/dist/Card-xv52Ug43.js +0 -61
  58. package/dist/Card-xv52Ug43.js.map +0 -1
  59. package/dist/LoadingDots-Cn2y7g7L.cjs +0 -2
  60. package/dist/LoadingDots-Cn2y7g7L.cjs.map +0 -1
  61. package/dist/LoadingDots-nW6r0-Kg.js.map +0 -1
  62. package/dist/TextShell-CKQOFxoH.cjs +0 -2
  63. package/dist/TextShell-CKQOFxoH.cjs.map +0 -1
  64. package/dist/TextShell-DIyj9zQ7.js +0 -40
  65. package/dist/TextShell-DIyj9zQ7.js.map +0 -1
  66. package/dist/index-B8gqCioX.js.map +0 -1
  67. package/dist/index-IkikzyWM.cjs +0 -2
  68. package/dist/index-IkikzyWM.cjs.map +0 -1
  69. package/dist/usePreviewToggle-B0B8cfxy.cjs +0 -2
  70. package/dist/usePreviewToggle-B0B8cfxy.cjs.map +0 -1
  71. package/dist/usePreviewToggle-DRhRTUou.js +0 -357
  72. package/dist/usePreviewToggle-DRhRTUou.js.map +0 -1
  73. package/src/components/LockedAttachment/components/Composer/Card.tsx +0 -201
  74. package/src/components/LockedAttachment/components/Media/Card.tsx +0 -235
  75. package/src/components/LockedAttachment/components/Text/Card.tsx +0 -177
  76. package/src/components/LockedAttachment/components/_shared/TextShell.tsx +0 -19
  77. package/src/components/LockedAttachment/index.tsx +0 -52
  78. package/src/components/LockedAttachment/types.ts +0 -75
  79. /package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/CardThumbnail.tsx +0 -0
  80. /package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/LoadingDots.tsx +0 -0
  81. /package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/MediaShell.tsx +0 -0
  82. /package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/PreviewToggle.tsx +0 -0
  83. /package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/PriceLockRow.tsx +0 -0
  84. /package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/usePreviewToggle.ts +0 -0
  85. /package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/useReceivedSource.ts +0 -0
@@ -1,75 +0,0 @@
1
- import type { Channel, LocalMessage } from 'stream-chat'
2
-
3
- import type { PaymentStatus } from '../../stream-custom-data'
4
-
5
- export interface LockedAttachmentBaseProps {
6
- title?: string
7
- /** Dimmed fallback shown in the title slot when `title` is unset (no attachment metadata yet — still drafting). */
8
- placeholderTitle?: string
9
- mimeType?: string
10
- thumbnailUrl?: string
11
- detail?: string
12
- amountText?: string
13
- /**
14
- * When provided with 2+ items, the card renders as a mixed-media carousel
15
- * (e.g. a couple of photos + a video) instead of a single thumbnail. Each
16
- * item brings its own thumbnail and optional source so that
17
- * `LockedAttachment.Composer` / `.Media` can share the same carousel
18
- * chrome.
19
- */
20
- gallery?: LockedAttachmentGalleryItem[]
21
- /**
22
- * "text" renders the card as a locked/plain chat bubble showing the
23
- * message's own text (skeleton-blurred until purchased) instead of a media
24
- * thumbnail card — for a paid text-only message. Media-only props
25
- * (`mimeType`, `thumbnailUrl`, `title`, `detail`, `gallery`) are ignored in
26
- * this mode. Defaults to `"media"`.
27
- */
28
- contentType?: 'text' | 'media'
29
- }
30
-
31
- export interface LockedAttachmentGalleryItem {
32
- /** MIME type of this carousel item — drives the per-item play / lock affordance. */
33
- mimeType: string
34
- /** Poster image used for both the locked (blurred) and unlocked preview state. */
35
- thumbnailUrl?: string
36
- /** Underlying source (image or video URL) — shown only when unlocked. */
37
- sourceUrl?: string
38
- }
39
-
40
- export interface LockedAttachmentSource {
41
- /** Proxied URL used by the media player for in-app playback. */
42
- sourceUrl: string
43
- /** URL opened when the visitor clicks Download — may be a file or a web destination. */
44
- redeemUrl?: string
45
- /** Thumbnail URL from the fetched asset — overrides the metadata thumbnail when present. */
46
- thumbnailUrl?: string
47
- }
48
-
49
- export type { PaymentStatus }
50
-
51
- /**
52
- * Lazily fetches the underlying source (URL/thumbnail) for a locked
53
- * attachment. Returns `void` to signal "no source available" — the card
54
- * stays locked. Shared by `ComposerCardProps`/`MediaCardProps.onFetchSource`.
55
- */
56
- export type FetchSourceHandler = () => Promise<LockedAttachmentSource | void>
57
-
58
- export interface LockedAttachmentContextValue {
59
- isUnlocking: (id: string) => boolean
60
- onUnlockClick?: (message: LocalMessage, channel: Channel) => void
61
- onDownloadClick?: (message: LocalMessage, channel: Channel) => void
62
- /**
63
- * Reveal the locked media's underlying source (URL/thumbnail). Not used
64
- * for a paid text message — the backend writes the real text directly onto
65
- * the message on purchase and `message.text` alone drives that reveal.
66
- */
67
- onFetchSource?: (
68
- message: LocalMessage,
69
- channel: Channel
70
- ) => Promise<LockedAttachmentSource | void>
71
- }
72
-
73
- export const defaultLockedAttachmentContextValue: LockedAttachmentContextValue = {
74
- isUnlocking: () => false,
75
- }