@linktr.ee/messaging-react 1.26.1 → 1.27.0
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/Creator-B6M8dB0U.js +87 -0
- package/dist/Creator-B6M8dB0U.js.map +1 -0
- package/dist/MediaPlayer-DsjlYGGH.js +539 -0
- package/dist/MediaPlayer-DsjlYGGH.js.map +1 -0
- package/dist/Preview-DqAv16NS.js +87 -0
- package/dist/Preview-DqAv16NS.js.map +1 -0
- package/dist/Visitor-CpmFZRGO.js +175 -0
- package/dist/Visitor-CpmFZRGO.js.map +1 -0
- package/dist/dash.all.min-Duv4lvGS.js +18858 -0
- package/dist/dash.all.min-Duv4lvGS.js.map +1 -0
- package/dist/hls-Bogc7CBn.js +21710 -0
- package/dist/hls-Bogc7CBn.js.map +1 -0
- package/dist/index-Da-xN4Yq.js +16142 -0
- package/dist/index-Da-xN4Yq.js.map +1 -0
- package/dist/index-Dj9rqWcU.js +69 -0
- package/dist/index-Dj9rqWcU.js.map +1 -0
- package/dist/index.d.ts +73 -10
- package/dist/index.js +979 -934
- package/dist/index.js.map +1 -1
- package/dist/mixin-B6jYfIcp.js +808 -0
- package/dist/mixin-B6jYfIcp.js.map +1 -0
- package/dist/react-BxlQMOfz.js +419 -0
- package/dist/react-BxlQMOfz.js.map +1 -0
- package/dist/react-COAP-MIW.js +377 -0
- package/dist/react-COAP-MIW.js.map +1 -0
- package/dist/react-Cn4WlMcl.js +3108 -0
- package/dist/react-Cn4WlMcl.js.map +1 -0
- package/dist/react-CwTJArKY.js +459 -0
- package/dist/react-CwTJArKY.js.map +1 -0
- package/dist/react-DkfS_atT.js +373 -0
- package/dist/react-DkfS_atT.js.map +1 -0
- package/dist/react-Pea5fum1.js +286 -0
- package/dist/react-Pea5fum1.js.map +1 -0
- package/dist/react-RiBbsUDd.js +534 -0
- package/dist/react-RiBbsUDd.js.map +1 -0
- package/dist/react-dS1WBxxz.js +238 -0
- package/dist/react-dS1WBxxz.js.map +1 -0
- package/package.json +2 -1
- package/src/components/ChannelView.tsx +12 -2
- package/src/components/CustomMessage/CustomMessage.stories.tsx +173 -41
- package/src/components/CustomMessage/MessageTag.tsx +5 -0
- package/src/components/CustomMessage/index.tsx +43 -4
- package/src/components/LockedAttachment/LockedAttachment.stories.tsx +249 -0
- package/src/components/LockedAttachment/components/Creator.tsx +171 -0
- package/src/components/LockedAttachment/components/MediaPlayer.tsx +299 -0
- package/src/components/LockedAttachment/components/Visitor.tsx +293 -0
- package/src/components/LockedAttachment/index.tsx +39 -0
- package/src/components/LockedAttachment/types.ts +18 -0
- package/src/components/LockedAttachment/utils/icons.ts +52 -0
- package/src/components/LockedAttachment/utils/mimeType.test.ts +97 -0
- package/src/components/LockedAttachment/utils/mimeType.ts +35 -0
- package/src/components/ParticipantPicker/index.tsx +8 -1
- package/src/hooks/useParticipants.ts +3 -2
- package/src/index.ts +4 -0
- package/src/stories/decorators/storyUser.tsx +37 -0
- package/src/stream-custom-data.ts +9 -3
- package/src/types.ts +21 -1
- package/src/utils/isDevBuild.ts +10 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var o = Object.defineProperty;
|
|
2
|
+
var g = (n, a, c) => a in n ? o(n, a, { enumerable: !0, configurable: !0, writable: !0, value: c }) : n[a] = c;
|
|
3
|
+
var l = (n, a, c) => g(n, typeof a != "symbol" ? a + "" : a, c);
|
|
4
|
+
function R(n) {
|
|
5
|
+
return class extends n {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
l(this, "_playedRanges", []);
|
|
9
|
+
l(this, "_currentPlayedRange", null);
|
|
10
|
+
l(this, "_RANGE_EPSILON", 0.5);
|
|
11
|
+
l(this, "_seeking", !1);
|
|
12
|
+
}
|
|
13
|
+
connectedCallback() {
|
|
14
|
+
super.connectedCallback && super.connectedCallback(), this.addEventListener("play", () => this.onPlaybackStart({ time: this.currentTime })), this.addEventListener("pause", () => this.onPlaybackStop({ time: this.currentTime })), this.addEventListener("ended", () => this.onPlaybackStop({ time: this.currentTime })), this.addEventListener("seeking", () => this.onSeeking()), this.addEventListener("seeked", () => this.onSeeked({ time: this.currentTime }));
|
|
15
|
+
}
|
|
16
|
+
onPlaybackStart(e = {}) {
|
|
17
|
+
this._seeking = !1;
|
|
18
|
+
const { time: t } = e, s = typeof t == "number" ? t : this.currentTime;
|
|
19
|
+
this._currentPlayedRange || (this._currentPlayedRange = { start: s, end: s });
|
|
20
|
+
}
|
|
21
|
+
onSeeking() {
|
|
22
|
+
this._seeking = !0, this._commitCurrentRange();
|
|
23
|
+
}
|
|
24
|
+
onSeeked(e = {}) {
|
|
25
|
+
this._seeking = !1;
|
|
26
|
+
const { time: t } = e, s = typeof t == "number" ? t : this.currentTime;
|
|
27
|
+
this._currentPlayedRange = { start: s, end: s };
|
|
28
|
+
}
|
|
29
|
+
onPlaybackStop(e = {}) {
|
|
30
|
+
const { time: t } = e, s = typeof t == "number" ? t : this.currentTime;
|
|
31
|
+
this._commitCurrentRange(s);
|
|
32
|
+
}
|
|
33
|
+
_commitCurrentRange(e) {
|
|
34
|
+
if (!this._currentPlayedRange) return;
|
|
35
|
+
typeof e == "number" && (this._currentPlayedRange.end = e);
|
|
36
|
+
const { start: t, end: s } = this._currentPlayedRange;
|
|
37
|
+
this._currentPlayedRange = null, this.addPlayedRange(t, s);
|
|
38
|
+
}
|
|
39
|
+
addPlayedRange(e, t) {
|
|
40
|
+
if (e >= t) return;
|
|
41
|
+
const s = this._RANGE_EPSILON, h = [...this._playedRanges, { start: e, end: t }];
|
|
42
|
+
h.sort((i, r) => i.start - r.start);
|
|
43
|
+
const d = [];
|
|
44
|
+
for (const i of h) {
|
|
45
|
+
if (!d.length) {
|
|
46
|
+
d.push({ ...i });
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const r = d[d.length - 1];
|
|
50
|
+
i.start <= r.end + s ? (r.start = Math.min(r.start, i.start), r.end = Math.max(r.end, i.end)) : d.push({ ...i });
|
|
51
|
+
}
|
|
52
|
+
this._playedRanges = d;
|
|
53
|
+
}
|
|
54
|
+
get played() {
|
|
55
|
+
const e = this.currentTime;
|
|
56
|
+
return !this.paused && !this._currentPlayedRange && typeof e == "number" && (this._currentPlayedRange = { start: e, end: e }), this._currentPlayedRange && typeof e == "number" && (e > this._currentPlayedRange.end && (this._currentPlayedRange.end = e), this.addPlayedRange(this._currentPlayedRange.start, this._currentPlayedRange.end)), this._playedRanges.length ? u(this._playedRanges.map((t) => [t.start, t.end])) : u([[0, 0]]);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function u(n) {
|
|
61
|
+
return Object.defineProperties(n, {
|
|
62
|
+
start: { value: (a) => n[a][0] },
|
|
63
|
+
end: { value: (a) => n[a][1] }
|
|
64
|
+
}), n;
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
R as M
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=index-Dj9rqWcU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-Dj9rqWcU.js","sources":["../../../node_modules/media-played-ranges-mixin/dist/index.js"],"sourcesContent":["function MediaPlayedRangesMixin(Base) {\n return class MediaPlayedRanges extends Base {\n _playedRanges = [];\n _currentPlayedRange = null;\n _RANGE_EPSILON = 0.5;\n _seeking = false;\n connectedCallback() {\n if (super.connectedCallback) super.connectedCallback();\n this.addEventListener(\"play\", () => this.onPlaybackStart({ time: this.currentTime }));\n this.addEventListener(\"pause\", () => this.onPlaybackStop({ time: this.currentTime }));\n this.addEventListener(\"ended\", () => this.onPlaybackStop({ time: this.currentTime }));\n this.addEventListener(\"seeking\", () => this.onSeeking());\n this.addEventListener(\"seeked\", () => this.onSeeked({ time: this.currentTime }));\n }\n onPlaybackStart(param = {}) {\n this._seeking = false;\n const { time } = param;\n const t = typeof time === \"number\" ? time : this.currentTime;\n if (!this._currentPlayedRange) {\n this._currentPlayedRange = { start: t, end: t };\n }\n }\n onSeeking() {\n this._seeking = true;\n this._commitCurrentRange();\n }\n onSeeked(param = {}) {\n this._seeking = false;\n const { time } = param;\n const t = typeof time === \"number\" ? time : this.currentTime;\n this._currentPlayedRange = { start: t, end: t };\n }\n onPlaybackStop(param = {}) {\n const { time } = param;\n const t = typeof time === \"number\" ? time : this.currentTime;\n this._commitCurrentRange(t);\n }\n _commitCurrentRange(time) {\n if (!this._currentPlayedRange) return;\n if (typeof time === \"number\") {\n this._currentPlayedRange.end = time;\n }\n const { start, end } = this._currentPlayedRange;\n this._currentPlayedRange = null;\n this.addPlayedRange(start, end);\n }\n addPlayedRange(start, end) {\n if (start >= end) return;\n const EPS = this._RANGE_EPSILON;\n const allRanges = [...this._playedRanges, { start, end }];\n allRanges.sort((a, b) => a.start - b.start);\n const merged = [];\n for (const range of allRanges) {\n if (!merged.length) {\n merged.push({ ...range });\n continue;\n }\n const last = merged[merged.length - 1];\n if (range.start <= last.end + EPS) {\n last.start = Math.min(last.start, range.start);\n last.end = Math.max(last.end, range.end);\n } else {\n merged.push({ ...range });\n }\n }\n this._playedRanges = merged;\n }\n get played() {\n const time = this.currentTime;\n if (!this.paused && !this._currentPlayedRange && typeof time === \"number\") {\n this._currentPlayedRange = { start: time, end: time };\n }\n if (this._currentPlayedRange && typeof time === \"number\") {\n if (time > this._currentPlayedRange.end) {\n this._currentPlayedRange.end = time;\n }\n this.addPlayedRange(this._currentPlayedRange.start, this._currentPlayedRange.end);\n }\n if (!this._playedRanges.length) {\n return createTimeRangesObj([[0, 0]]);\n }\n return createTimeRangesObj(this._playedRanges.map((r) => [r.start, r.end]));\n }\n };\n}\nfunction createTimeRangesObj(ranges) {\n Object.defineProperties(ranges, {\n start: { value: (i) => ranges[i][0] },\n end: { value: (i) => ranges[i][1] }\n });\n return ranges;\n}\nexport {\n MediaPlayedRangesMixin\n};\n"],"names":["MediaPlayedRangesMixin","Base","__publicField","param","time","t","start","end","EPS","allRanges","a","b","merged","range","last","createTimeRangesObj","r","ranges","i"],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,oBAAoB,OAAO,KAAK,oBAAoB,GAAG,IAE7E,KAAK,cAAc,SAGjBW,EAAoB,KAAK,cAAc,IAAI,CAACC,MAAM,CAACA,EAAE,OAAOA,EAAE,GAAG,CAAC,CAAC,IAFjED,EAAoB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAAA,IAGvC;AAAA,EACJ;AACA;AACA,SAASA,EAAoBE,GAAQ;AACnC,gBAAO,iBAAiBA,GAAQ;AAAA,IAC9B,OAAO,EAAE,OAAO,CAACC,MAAMD,EAAOC,CAAC,EAAE,CAAC,EAAC;AAAA,IACnC,KAAK,EAAE,OAAO,CAACA,MAAMD,EAAOC,CAAC,EAAE,CAAC,EAAC;AAAA,EACrC,CAAG,GACMD;AACT;","x_google_ignoreList":[0]}
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export declare interface ActionButtonProps extends default_2.ButtonHTMLAttribute
|
|
|
20
20
|
|
|
21
21
|
declare type AgeSafetySystemType = 'SYSTEM_AGE_SAFETY_BLOCKED';
|
|
22
22
|
|
|
23
|
+
export declare type AttachmentSourceType = 'image' | 'audio' | 'video' | 'document';
|
|
24
|
+
|
|
23
25
|
/**
|
|
24
26
|
* Avatar component that displays a user image or colored initial fallback
|
|
25
27
|
*/
|
|
@@ -109,7 +111,7 @@ export declare const ChannelView: default_2.NamedExoticComponent<ChannelViewProp
|
|
|
109
111
|
* Props that MessagingShell passes through to ChannelView.
|
|
110
112
|
* ChannelViewProps is the source of truth for these props.
|
|
111
113
|
*/
|
|
112
|
-
declare type ChannelViewPassthroughProps = Pick<ChannelViewProps, 'renderMessageInputActions' | 'renderConversationFooter' | 'CustomChannelEmptyState' | 'onDeleteConversationClick' | 'onBlockParticipantClick' | 'onReportParticipantClick' | 'dmAgentEnabled' | 'messageMetadata' | 'onMessageSent' | 'showStarButton' | 'chatbotVotingEnabled' | 'renderChannelBanner' | 'customProfileContent' | 'customChannelActions' | 'renderMessage'>;
|
|
114
|
+
declare type ChannelViewPassthroughProps = Pick<ChannelViewProps, 'renderMessageInputActions' | 'renderConversationFooter' | 'CustomChannelEmptyState' | 'onDeleteConversationClick' | 'onBlockParticipantClick' | 'onReportParticipantClick' | 'dmAgentEnabled' | 'messageMetadata' | 'onMessageSent' | 'showStarButton' | 'chatbotVotingEnabled' | 'renderChannelBanner' | 'customProfileContent' | 'customChannelActions' | 'renderMessage' | 'onAttachmentUnlock' | 'onAttachmentDownload'>;
|
|
113
115
|
|
|
114
116
|
/**
|
|
115
117
|
* ChannelView component props
|
|
@@ -155,7 +157,7 @@ export declare interface ChannelViewProps {
|
|
|
155
157
|
* @example
|
|
156
158
|
* messageMetadata={{ custom_type: 'MESSAGE_PAID', listing_id: '...' }}
|
|
157
159
|
*/
|
|
158
|
-
messageMetadata?:
|
|
160
|
+
messageMetadata?: Partial<MessageMetadata>;
|
|
159
161
|
/**
|
|
160
162
|
* Callback fired after a message is successfully sent.
|
|
161
163
|
* Receives the full API response including message.id.
|
|
@@ -214,6 +216,23 @@ export declare interface ChannelViewProps {
|
|
|
214
216
|
* )}
|
|
215
217
|
*/
|
|
216
218
|
renderMessage?: (messageNode: React.ReactElement, message: LocalMessage) => React.ReactNode;
|
|
219
|
+
/**
|
|
220
|
+
* Called when the visitor clicks Unlock on a locked attachment message.
|
|
221
|
+
* Receives the message and channel. Show checkout, confirm payment, fetch
|
|
222
|
+
* the unlocked URL. `attachment_source` must NOT be stored on the Stream message metadata.
|
|
223
|
+
* The card shows a loading state for the full duration of the promise.
|
|
224
|
+
*/
|
|
225
|
+
onAttachmentUnlock?: (message: LocalMessage, channel: Channel) => Promise<LockedAttachmentSource>;
|
|
226
|
+
/**
|
|
227
|
+
* Called when the visitor clicks Download on an unlocked attachment message.
|
|
228
|
+
*/
|
|
229
|
+
onAttachmentDownload?: (message: LocalMessage, channel: Channel) => void;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
declare interface CreatorCardProps extends LockedAttachmentBaseProps {
|
|
233
|
+
title?: string;
|
|
234
|
+
placeholderTitle?: string;
|
|
235
|
+
placeholderAmountText?: string;
|
|
217
236
|
}
|
|
218
237
|
|
|
219
238
|
declare type DmAgentSystemType = 'SYSTEM_DM_AGENT_PAUSED' | 'SYSTEM_DM_AGENT_RESUMED';
|
|
@@ -253,18 +272,44 @@ export declare interface FaqListProps {
|
|
|
253
272
|
*/
|
|
254
273
|
export declare const formatRelativeTime: (date: Date) => string;
|
|
255
274
|
|
|
256
|
-
declare
|
|
275
|
+
export declare const LockedAttachment: (props: LockedAttachmentProps) => JSX_2.Element;
|
|
276
|
+
|
|
277
|
+
/** Shared fields for creator and visitor locked-attachment cards (internal). */
|
|
278
|
+
declare interface LockedAttachmentBaseProps {
|
|
279
|
+
mimeType?: string;
|
|
280
|
+
/** Blurred preview image shown in the locked/collapsed state. */
|
|
281
|
+
thumbnail?: string;
|
|
282
|
+
/** Clean poster image passed to the media player. Falls back to thumbnail. */
|
|
283
|
+
poster?: string;
|
|
284
|
+
/** Unlocked media URL. Undefined while locked or pending unlock. */
|
|
285
|
+
source?: string;
|
|
286
|
+
detail?: string;
|
|
287
|
+
amountText?: string;
|
|
288
|
+
paymentStatus?: PaymentStatus;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export declare type LockedAttachmentProps = ({
|
|
292
|
+
isCreator: true;
|
|
293
|
+
} & CreatorCardProps) | ({
|
|
294
|
+
isCreator?: false;
|
|
295
|
+
} & VisitorCardProps);
|
|
296
|
+
|
|
297
|
+
export declare interface LockedAttachmentSource {
|
|
298
|
+
source: string;
|
|
299
|
+
poster?: string;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
declare type MessageCustomType = 'MESSAGE_TIP' | 'MESSAGE_PAID' | 'MESSAGE_CHATBOT' | 'MESSAGE_ATTACHMENT' | AgeSafetySystemType | DmAgentSystemType;
|
|
257
303
|
|
|
258
|
-
/**
|
|
259
|
-
* Message metadata for paid messaging and chatbot flows.
|
|
260
|
-
* Used to identify message types and payment status.
|
|
261
|
-
*/
|
|
262
304
|
export declare interface MessageMetadata {
|
|
263
305
|
custom_type?: MessageCustomType;
|
|
264
|
-
amount_text?: string;
|
|
265
|
-
payment_status?: string;
|
|
266
|
-
payment_intent_id?: string;
|
|
267
306
|
listing_id?: string;
|
|
307
|
+
amount_text?: string;
|
|
308
|
+
payment_status?: PaymentStatus;
|
|
309
|
+
attachment_title?: string;
|
|
310
|
+
attachment_mime_type?: string;
|
|
311
|
+
attachment_thumbnail?: string;
|
|
312
|
+
attachment_detail?: string;
|
|
268
313
|
}
|
|
269
314
|
|
|
270
315
|
export declare const MessageVoteButtons: default_2.FC<MessageVoteButtonsProps>;
|
|
@@ -431,6 +476,12 @@ export declare interface ParticipantSource {
|
|
|
431
476
|
loading?: boolean;
|
|
432
477
|
}
|
|
433
478
|
|
|
479
|
+
/**
|
|
480
|
+
* Message metadata for paid messaging and chatbot flows.
|
|
481
|
+
* Used to identify message types and payment status.
|
|
482
|
+
*/
|
|
483
|
+
declare type PaymentStatus = 'pending' | 'paid' | 'failed' | 'refunded';
|
|
484
|
+
|
|
434
485
|
/**
|
|
435
486
|
* Hook that wraps Stream Chat reactions to provide toggle-style
|
|
436
487
|
* upvote/downvote behavior on a message.
|
|
@@ -470,6 +521,18 @@ export declare const useParticipants: (participantSource: ParticipantSource, opt
|
|
|
470
521
|
refresh: () => void;
|
|
471
522
|
};
|
|
472
523
|
|
|
524
|
+
declare interface VisitorCardProps extends LockedAttachmentBaseProps {
|
|
525
|
+
title?: string;
|
|
526
|
+
/**
|
|
527
|
+
* Called when the visitor clicks Unlock. Return the resolved source and optional poster.
|
|
528
|
+
* The component manages loading state and sets source/poster internally on resolution.
|
|
529
|
+
* Omit to hide the Unlock button.
|
|
530
|
+
*/
|
|
531
|
+
onUnlock?: () => Promise<LockedAttachmentSource>;
|
|
532
|
+
/** Called when the visitor clicks Download on an unlocked card. */
|
|
533
|
+
onDownload?: () => void;
|
|
534
|
+
}
|
|
535
|
+
|
|
473
536
|
export declare type VoteSelection = 'up' | 'down' | null;
|
|
474
537
|
|
|
475
538
|
export { }
|