@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.
- package/dist/Card-B7ccxsKf.cjs +2 -0
- package/dist/Card-B7ccxsKf.cjs.map +1 -0
- package/dist/Card-CXRSSrCh.cjs +2 -0
- package/dist/Card-CXRSSrCh.cjs.map +1 -0
- package/dist/Card-DaUKmwtb.js +105 -0
- package/dist/Card-DaUKmwtb.js.map +1 -0
- package/dist/Card-Q1Ee_UCB.js +693 -0
- package/dist/Card-Q1Ee_UCB.js.map +1 -0
- package/dist/{LoadingDots-nW6r0-Kg.js → LoadingDots-Ct3WmVlT.js} +18 -21
- package/dist/LoadingDots-Ct3WmVlT.js.map +1 -0
- package/dist/LoadingDots-D9GGphgM.cjs +2 -0
- package/dist/LoadingDots-D9GGphgM.cjs.map +1 -0
- package/dist/assets/index.css +1 -1
- package/dist/{index-B8gqCioX.js → index-BiBvPADG.js} +1301 -1315
- package/dist/index-BiBvPADG.js.map +1 -0
- package/dist/index-DuPa2mUh.cjs +2 -0
- package/dist/index-DuPa2mUh.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +149 -129
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/ChannelList/CustomChannelPreview.test.tsx +95 -0
- package/src/components/ChannelList/CustomChannelPreview.tsx +21 -9
- package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/LockedAttachment.stories.tsx +87 -78
- package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/LockedAttachment.test.tsx +24 -11
- package/src/components/CustomMessage/LockedAttachment/components/Media/Card.tsx +358 -0
- package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/Media/CardActions.tsx +5 -0
- package/src/components/CustomMessage/LockedAttachment/components/Media/types.ts +79 -0
- package/src/components/CustomMessage/LockedAttachment/components/Text/Card.tsx +155 -0
- package/src/components/CustomMessage/LockedAttachment/components/Text/types.ts +58 -0
- package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/CardBody.tsx +5 -4
- package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/GalleryThumbnail.tsx +2 -2
- package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/LockBadge.tsx +1 -1
- package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/PurchaseStatusBadge.tsx +0 -12
- package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/SingleThumbnail.tsx +1 -1
- package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/SkeletonTextLines.tsx +3 -13
- package/src/components/CustomMessage/LockedAttachment/components/_shared/TextShell.tsx +30 -0
- package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/usePreviewToggle.test.ts +1 -1
- package/src/components/CustomMessage/LockedAttachment/index.tsx +105 -0
- package/src/components/CustomMessage/LockedAttachment/types.ts +44 -0
- package/src/components/CustomMessage/context.tsx +1 -1
- package/src/components/CustomMessage/index.tsx +45 -50
- package/src/components/CustomMessageInput/CustomMessageInput.stories.tsx +5 -3
- package/src/index.ts +3 -5
- package/src/styles.css +8 -1
- package/src/types.ts +1 -1
- package/dist/Card-BVZM0-06.js +0 -108
- package/dist/Card-BVZM0-06.js.map +0 -1
- package/dist/Card-D0hLrOxX.js +0 -221
- package/dist/Card-D0hLrOxX.js.map +0 -1
- package/dist/Card-DIr1UnfC.cjs +0 -2
- package/dist/Card-DIr1UnfC.cjs.map +0 -1
- package/dist/Card-DeSgaRTL.cjs +0 -2
- package/dist/Card-DeSgaRTL.cjs.map +0 -1
- package/dist/Card-DnaXMVrT.cjs +0 -2
- package/dist/Card-DnaXMVrT.cjs.map +0 -1
- package/dist/Card-xv52Ug43.js +0 -61
- package/dist/Card-xv52Ug43.js.map +0 -1
- package/dist/LoadingDots-Cn2y7g7L.cjs +0 -2
- package/dist/LoadingDots-Cn2y7g7L.cjs.map +0 -1
- package/dist/LoadingDots-nW6r0-Kg.js.map +0 -1
- package/dist/TextShell-CKQOFxoH.cjs +0 -2
- package/dist/TextShell-CKQOFxoH.cjs.map +0 -1
- package/dist/TextShell-DIyj9zQ7.js +0 -40
- package/dist/TextShell-DIyj9zQ7.js.map +0 -1
- package/dist/index-B8gqCioX.js.map +0 -1
- package/dist/index-IkikzyWM.cjs +0 -2
- package/dist/index-IkikzyWM.cjs.map +0 -1
- package/dist/usePreviewToggle-B0B8cfxy.cjs +0 -2
- package/dist/usePreviewToggle-B0B8cfxy.cjs.map +0 -1
- package/dist/usePreviewToggle-DRhRTUou.js +0 -357
- package/dist/usePreviewToggle-DRhRTUou.js.map +0 -1
- package/src/components/LockedAttachment/components/Composer/Card.tsx +0 -201
- package/src/components/LockedAttachment/components/Media/Card.tsx +0 -235
- package/src/components/LockedAttachment/components/Text/Card.tsx +0 -177
- package/src/components/LockedAttachment/components/_shared/TextShell.tsx +0 -19
- package/src/components/LockedAttachment/index.tsx +0 -52
- package/src/components/LockedAttachment/types.ts +0 -75
- /package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/CardThumbnail.tsx +0 -0
- /package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/LoadingDots.tsx +0 -0
- /package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/MediaShell.tsx +0 -0
- /package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/PreviewToggle.tsx +0 -0
- /package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/PriceLockRow.tsx +0 -0
- /package/src/components/{LockedAttachment → CustomMessage/LockedAttachment}/components/_shared/usePreviewToggle.ts +0 -0
- /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
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|