@linktr.ee/messaging-react 1.28.0-rc-1776225927 → 1.28.0-rc-1776231821
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-D38dWn2X.js → Creator-BFpHsh2u.js} +23 -23
- package/dist/Creator-BFpHsh2u.js.map +1 -0
- package/dist/MediaPlayer-DXz4IBLx.js +313 -0
- package/dist/MediaPlayer-DXz4IBLx.js.map +1 -0
- package/dist/{Visitor-BG-9-3HU.js → Visitor-C1Fcrgd6.js} +5 -5
- package/dist/Visitor-C1Fcrgd6.js.map +1 -0
- package/dist/assets/index.css +1 -1
- package/dist/index.d.ts +8 -12
- package/dist/index.js +27 -35
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
- package/src/components/CustomMessage/index.tsx +0 -1
- package/src/components/LockedAttachment/components/Creator.tsx +2 -8
- package/src/components/LockedAttachment/components/MediaPlayer.tsx +50 -28
- package/src/components/LockedAttachment/components/Visitor.tsx +3 -6
- package/src/components/LockedAttachment/index.tsx +7 -7
- package/src/components/LockedAttachment/types.ts +0 -3
- package/dist/Creator-D38dWn2X.js.map +0 -1
- package/dist/MediaPlayer-DE9MC6k6.js +0 -599
- package/dist/MediaPlayer-DE9MC6k6.js.map +0 -1
- package/dist/Preview-DqAv16NS.js +0 -87
- package/dist/Preview-DqAv16NS.js.map +0 -1
- package/dist/Visitor-BG-9-3HU.js.map +0 -1
- package/dist/dash.all.min-Duv4lvGS.js +0 -18858
- package/dist/dash.all.min-Duv4lvGS.js.map +0 -1
- package/dist/hls-Bogc7CBn.js +0 -21710
- package/dist/hls-Bogc7CBn.js.map +0 -1
- package/dist/index-Da-xN4Yq.js +0 -16142
- package/dist/index-Da-xN4Yq.js.map +0 -1
- package/dist/index-Dj9rqWcU.js +0 -69
- package/dist/index-Dj9rqWcU.js.map +0 -1
- package/dist/mixin-B6jYfIcp.js +0 -808
- package/dist/mixin-B6jYfIcp.js.map +0 -1
- package/dist/react-BxlQMOfz.js +0 -419
- package/dist/react-BxlQMOfz.js.map +0 -1
- package/dist/react-COAP-MIW.js +0 -377
- package/dist/react-COAP-MIW.js.map +0 -1
- package/dist/react-Cn4WlMcl.js +0 -3108
- package/dist/react-Cn4WlMcl.js.map +0 -1
- package/dist/react-CwTJArKY.js +0 -459
- package/dist/react-CwTJArKY.js.map +0 -1
- package/dist/react-DkfS_atT.js +0 -373
- package/dist/react-DkfS_atT.js.map +0 -1
- package/dist/react-Pea5fum1.js +0 -286
- package/dist/react-Pea5fum1.js.map +0 -1
- package/dist/react-RiBbsUDd.js +0 -534
- package/dist/react-RiBbsUDd.js.map +0 -1
- package/dist/react-dS1WBxxz.js +0 -238
- package/dist/react-dS1WBxxz.js.map +0 -1
|
@@ -2,7 +2,7 @@ import { jsxs as f, jsx as e, Fragment as j } from "react/jsx-runtime";
|
|
|
2
2
|
import { XIcon as F, CheckCircleIcon as R, PauseIcon as S, PlayIcon as X, EyeSlashIcon as M, EyeIcon as D } from "@phosphor-icons/react";
|
|
3
3
|
import N from "classnames";
|
|
4
4
|
import { useState as C, useRef as P, useEffect as x, useCallback as E } from "react";
|
|
5
|
-
import { g as q, r as z, M as B } from "./MediaPlayer-
|
|
5
|
+
import { g as q, r as z, M as B } from "./MediaPlayer-DXz4IBLx.js";
|
|
6
6
|
const L = (u) => {
|
|
7
7
|
const { onClose: n } = u;
|
|
8
8
|
return /* @__PURE__ */ e(
|
|
@@ -45,10 +45,10 @@ const L = (u) => {
|
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
47
|
}, K = (u) => {
|
|
48
|
-
const { source: n, thumbnail: s, mimeType: o } = u, [l,
|
|
48
|
+
const { source: n, thumbnail: s, mimeType: o } = u, [l, r] = C(!1), [i, d] = C(0), [h, g] = C(!1), b = P(null), w = P(null), m = P(null);
|
|
49
49
|
x(() => {
|
|
50
50
|
const t = b.current;
|
|
51
|
-
t && (l ? t.play().catch(() =>
|
|
51
|
+
t && (l ? t.play().catch(() => r(!1)) : t.pause());
|
|
52
52
|
}, [l]), x(() => {
|
|
53
53
|
if (!l) {
|
|
54
54
|
m.current !== null && cancelAnimationFrame(m.current);
|
|
@@ -62,7 +62,7 @@ const L = (u) => {
|
|
|
62
62
|
m.current !== null && cancelAnimationFrame(m.current);
|
|
63
63
|
};
|
|
64
64
|
}, [l, h]), x(() => {
|
|
65
|
-
|
|
65
|
+
r(!1), d(0);
|
|
66
66
|
}, [n]);
|
|
67
67
|
const p = E(
|
|
68
68
|
(t) => {
|
|
@@ -89,7 +89,7 @@ const L = (u) => {
|
|
|
89
89
|
window.removeEventListener("mousemove", t), window.removeEventListener("mouseup", a), window.removeEventListener("touchmove", t), window.removeEventListener("touchend", a);
|
|
90
90
|
};
|
|
91
91
|
}, [h, p, c]);
|
|
92
|
-
const v = E(() =>
|
|
92
|
+
const v = E(() => r((t) => !t), []);
|
|
93
93
|
return /* @__PURE__ */ f("div", { className: "relative", children: [
|
|
94
94
|
n && /* @__PURE__ */ e(
|
|
95
95
|
"audio",
|
|
@@ -98,7 +98,7 @@ const L = (u) => {
|
|
|
98
98
|
src: n,
|
|
99
99
|
loop: !0,
|
|
100
100
|
onEnded: () => {
|
|
101
|
-
|
|
101
|
+
r(!1), d(0);
|
|
102
102
|
},
|
|
103
103
|
children: /* @__PURE__ */ e("track", { kind: "captions" })
|
|
104
104
|
}
|
|
@@ -118,7 +118,7 @@ const L = (u) => {
|
|
|
118
118
|
ref: w,
|
|
119
119
|
role: "slider",
|
|
120
120
|
"aria-label": "Playback position",
|
|
121
|
-
"aria-valuenow": Math.round(
|
|
121
|
+
"aria-valuenow": Math.round(i * 100),
|
|
122
122
|
"aria-valuemin": 0,
|
|
123
123
|
"aria-valuemax": 100,
|
|
124
124
|
tabIndex: 0,
|
|
@@ -135,22 +135,22 @@ const L = (u) => {
|
|
|
135
135
|
},
|
|
136
136
|
onClick: (t) => t.stopPropagation(),
|
|
137
137
|
onKeyDown: (t) => {
|
|
138
|
-
t.key === "ArrowRight" && c(Math.min(1,
|
|
138
|
+
t.key === "ArrowRight" && c(Math.min(1, i + 0.05)), t.key === "ArrowLeft" && c(Math.max(0, i - 0.05));
|
|
139
139
|
},
|
|
140
140
|
children: /* @__PURE__ */ e("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ e(
|
|
141
141
|
"div",
|
|
142
142
|
{
|
|
143
143
|
className: "h-full rounded-full bg-white",
|
|
144
|
-
style: { width: `${Math.round(
|
|
144
|
+
style: { width: `${Math.round(i * 100)}%` }
|
|
145
145
|
}
|
|
146
146
|
) })
|
|
147
147
|
}
|
|
148
148
|
) })
|
|
149
149
|
] });
|
|
150
150
|
}, O = (u) => {
|
|
151
|
-
const { source: n, thumbnail: s, mimeType: o } = u, [l,
|
|
151
|
+
const { source: n, thumbnail: s, mimeType: o } = u, [l, r] = C(!1), i = () => r(!1);
|
|
152
152
|
return x(() => {
|
|
153
|
-
|
|
153
|
+
r(!1);
|
|
154
154
|
}, [n]), n ? /* @__PURE__ */ f(
|
|
155
155
|
"div",
|
|
156
156
|
{
|
|
@@ -168,7 +168,7 @@ const L = (u) => {
|
|
|
168
168
|
loop: !0,
|
|
169
169
|
controls: !1,
|
|
170
170
|
showProgress: !0,
|
|
171
|
-
onContainerClick:
|
|
171
|
+
onContainerClick: i,
|
|
172
172
|
muted: !0
|
|
173
173
|
}
|
|
174
174
|
),
|
|
@@ -177,7 +177,7 @@ const L = (u) => {
|
|
|
177
177
|
{
|
|
178
178
|
type: "button",
|
|
179
179
|
className: "absolute inset-0 block cursor-pointer border-0 p-0 text-left appearance-none",
|
|
180
|
-
onClick: () =>
|
|
180
|
+
onClick: () => r(!0),
|
|
181
181
|
"aria-label": "Expand video preview",
|
|
182
182
|
children: [
|
|
183
183
|
s ? /* @__PURE__ */ e(
|
|
@@ -195,15 +195,15 @@ const L = (u) => {
|
|
|
195
195
|
]
|
|
196
196
|
}
|
|
197
197
|
),
|
|
198
|
-
l && /* @__PURE__ */ e(L, { onClose:
|
|
198
|
+
l && /* @__PURE__ */ e(L, { onClose: i })
|
|
199
199
|
]
|
|
200
200
|
}
|
|
201
201
|
) : /* @__PURE__ */ e(T, { thumbnail: s, mimeType: o });
|
|
202
202
|
}, U = (u) => {
|
|
203
|
-
const { source: n, thumbnail: s, mimeType: o, title: l } = u, [
|
|
203
|
+
const { source: n, thumbnail: s, mimeType: o, title: l } = u, [r, i] = C(!1), d = () => i(!1);
|
|
204
204
|
return x(() => {
|
|
205
|
-
|
|
206
|
-
}, [n]),
|
|
205
|
+
i(!1);
|
|
206
|
+
}, [n]), r && n ? /* @__PURE__ */ f("div", { className: "relative", children: [
|
|
207
207
|
/* @__PURE__ */ e(
|
|
208
208
|
"button",
|
|
209
209
|
{
|
|
@@ -221,7 +221,7 @@ const L = (u) => {
|
|
|
221
221
|
thumbnail: s,
|
|
222
222
|
mimeType: o,
|
|
223
223
|
overlayIcon: n ? M : void 0,
|
|
224
|
-
onClick: n ? () =>
|
|
224
|
+
onClick: n ? () => i(!0) : void 0
|
|
225
225
|
}
|
|
226
226
|
);
|
|
227
227
|
}, Q = (u) => {
|
|
@@ -230,14 +230,14 @@ const L = (u) => {
|
|
|
230
230
|
mimeType: s = "application/octet-stream",
|
|
231
231
|
thumbnail: o,
|
|
232
232
|
source: l,
|
|
233
|
-
detail:
|
|
234
|
-
amountText:
|
|
233
|
+
detail: r,
|
|
234
|
+
amountText: i,
|
|
235
235
|
placeholderTitle: d = "Attachment title",
|
|
236
236
|
placeholderAmountText: h,
|
|
237
237
|
paymentStatus: g,
|
|
238
238
|
onDismiss: b,
|
|
239
239
|
isPreview: w = !1
|
|
240
|
-
} = u, m = q(s), p =
|
|
240
|
+
} = u, m = q(s), p = i ?? h, c = !i && !!h;
|
|
241
241
|
let v;
|
|
242
242
|
return w && m === "audio" ? v = /* @__PURE__ */ e(K, { source: l, thumbnail: o, mimeType: s }) : w && m === "video" ? v = /* @__PURE__ */ e(O, { source: l, thumbnail: o, mimeType: s }) : w && m === "image" ? v = /* @__PURE__ */ e(
|
|
243
243
|
U,
|
|
@@ -275,7 +275,7 @@ const L = (u) => {
|
|
|
275
275
|
className: "size-5 shrink-0 text-black/55",
|
|
276
276
|
weight: "regular"
|
|
277
277
|
}),
|
|
278
|
-
|
|
278
|
+
r && /* @__PURE__ */ e("span", { className: "text-xs font-medium text-black/55", children: r }),
|
|
279
279
|
g === "paid" ? /* @__PURE__ */ f(j, { children: [
|
|
280
280
|
/* @__PURE__ */ e("span", { className: "text-xs font-medium text-black/55", children: "•" }),
|
|
281
281
|
/* @__PURE__ */ e("span", { className: "text-xs font-medium text-[#008236]", children: "Purchased" }),
|
|
@@ -315,4 +315,4 @@ const L = (u) => {
|
|
|
315
315
|
export {
|
|
316
316
|
Q as default
|
|
317
317
|
};
|
|
318
|
-
//# sourceMappingURL=Creator-
|
|
318
|
+
//# sourceMappingURL=Creator-BFpHsh2u.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Creator-BFpHsh2u.js","sources":["../src/components/LockedAttachment/components/Creator.tsx"],"sourcesContent":["import {\n CheckCircleIcon,\n EyeIcon,\n EyeSlashIcon,\n PauseIcon,\n PlayIcon,\n XIcon,\n} from '@phosphor-icons/react'\nimport classNames from 'classnames'\nimport React, { useCallback, useEffect, useRef, useState } from 'react'\n\nimport type { LockedAttachmentBaseProps } from '../types'\nimport { renderTypeIcon } from '../utils/icons'\nimport { getSourceType } from '../utils/mimeType'\n\nimport MediaPlayer from './MediaPlayer'\n\nexport interface CreatorCardProps extends LockedAttachmentBaseProps {\n isPreview?: boolean\n placeholderTitle?: string\n placeholderAmountText?: string\n onDismiss?: () => void\n}\n\ninterface CloseButtonProps {\n onClose: () => void\n}\n\nconst CloseButton: React.FC<CloseButtonProps> = (props) => {\n const { onClose } = props\n return (\n <button\n type=\"button\"\n onClick={onClose}\n className=\"absolute left-3 top-3 z-40 flex size-8 items-center justify-center rounded-full bg-black/60 text-white\"\n aria-label=\"Close preview\"\n >\n <EyeIcon className=\"size-4\" weight=\"fill\" />\n </button>\n )\n}\n\ninterface CollapsedThumbnailProps {\n thumbnail?: string\n mimeType: string\n overlayIcon?: React.ElementType\n onClick?: () => void\n}\n\nconst CollapsedThumbnail: React.FC<CollapsedThumbnailProps> = (props) => {\n const { thumbnail, mimeType, overlayIcon: OverlayIcon, onClick } = props\n return (\n <button\n type=\"button\"\n disabled={!onClick}\n className={classNames(\n 'relative aspect-video block w-full overflow-hidden border-0 bg-black/5 p-0 text-left appearance-none',\n { 'cursor-pointer': !!onClick, 'cursor-default': !onClick }\n )}\n onClick={onClick}\n aria-label={OverlayIcon ? 'Toggle preview' : undefined}\n >\n {thumbnail ? (\n <img\n src={thumbnail}\n alt=\"\"\n className=\"absolute inset-0 h-full w-full object-cover\"\n />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n {renderTypeIcon(mimeType, {\n className: 'size-12 text-black/20',\n weight: 'regular',\n })}\n </div>\n )}\n {OverlayIcon && (\n <div className=\"pointer-events-none absolute left-3 top-3 flex size-8 items-center justify-center rounded-full bg-black/60 text-white\">\n <OverlayIcon className=\"size-4\" weight=\"fill\" />\n </div>\n )}\n </button>\n )\n}\n\n\ninterface AudioPreviewProps {\n source?: string\n thumbnail?: string\n mimeType: string\n}\n\nconst AudioPreview: React.FC<AudioPreviewProps> = (props) => {\n const { source, thumbnail, mimeType } = props\n const [playing, setPlaying] = useState(false)\n const [played, setPlayed] = useState(0)\n const [seeking, setSeeking] = useState(false)\n const audioRef = useRef<HTMLAudioElement>(null)\n const trackRef = useRef<HTMLDivElement>(null)\n const rafRef = useRef<number | null>(null)\n\n useEffect(() => {\n const el = audioRef.current\n if (!el) return\n if (playing) {\n void el.play().catch(() => setPlaying(false))\n } else {\n el.pause()\n }\n }, [playing])\n\n useEffect(() => {\n if (!playing) {\n if (rafRef.current !== null) cancelAnimationFrame(rafRef.current)\n return\n }\n const tick = () => {\n const el = audioRef.current\n if (el && el.duration && !seeking) setPlayed(el.currentTime / el.duration)\n rafRef.current = requestAnimationFrame(tick)\n }\n rafRef.current = requestAnimationFrame(tick)\n return () => {\n if (rafRef.current !== null) cancelAnimationFrame(rafRef.current)\n }\n }, [playing, seeking])\n\n useEffect(() => {\n setPlaying(false)\n setPlayed(0)\n }, [source])\n\n const getFraction = useCallback(\n (e: MouseEvent | TouchEvent | React.MouseEvent | React.TouchEvent) => {\n const track = trackRef.current\n if (!track) return 0\n const clientX =\n 'touches' in e\n ? (e.touches[0]?.clientX ?? e.changedTouches[0]?.clientX ?? 0)\n : e.clientX\n const rect = track.getBoundingClientRect()\n return Math.max(0, Math.min(1, (clientX - rect.left) / rect.width))\n },\n []\n )\n\n const seekTo = useCallback((fraction: number) => {\n const el = audioRef.current\n if (el && el.duration) el.currentTime = fraction * el.duration\n }, [])\n\n useEffect(() => {\n if (!seeking) return\n const onMove = (e: MouseEvent | TouchEvent) => {\n const f = getFraction(e)\n setPlayed(f)\n seekTo(f)\n }\n const onUp = (e: MouseEvent | TouchEvent) => {\n setSeeking(false)\n seekTo(getFraction(e))\n }\n window.addEventListener('mousemove', onMove)\n window.addEventListener('mouseup', onUp)\n window.addEventListener('touchmove', onMove, { passive: true })\n window.addEventListener('touchend', onUp)\n return () => {\n window.removeEventListener('mousemove', onMove)\n window.removeEventListener('mouseup', onUp)\n window.removeEventListener('touchmove', onMove)\n window.removeEventListener('touchend', onUp)\n }\n }, [seeking, getFraction, seekTo])\n\n const toggle = useCallback(() => setPlaying((p) => !p), [])\n\n return (\n <div className=\"relative\">\n {source && (\n <audio\n ref={audioRef}\n src={source}\n loop\n onEnded={() => {\n setPlaying(false)\n setPlayed(0)\n }}\n >\n <track kind=\"captions\" />\n </audio>\n )}\n <CollapsedThumbnail\n thumbnail={thumbnail}\n mimeType={mimeType}\n overlayIcon={source ? (playing ? PauseIcon : PlayIcon) : undefined}\n onClick={source ? toggle : undefined}\n />\n {source && (\n <div className=\"absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent\">\n <div\n ref={trackRef}\n role=\"slider\"\n aria-label=\"Playback position\"\n aria-valuenow={Math.round(played * 100)}\n aria-valuemin={0}\n aria-valuemax={100}\n tabIndex={0}\n className=\"relative flex h-4 w-full cursor-pointer items-center\"\n onMouseDown={(e) => {\n e.stopPropagation()\n setSeeking(true)\n const f = getFraction(e)\n setPlayed(f)\n seekTo(f)\n }}\n onTouchStart={(e) => {\n e.stopPropagation()\n setSeeking(true)\n const f = getFraction(e)\n setPlayed(f)\n seekTo(f)\n }}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => {\n if (e.key === 'ArrowRight') seekTo(Math.min(1, played + 0.05))\n if (e.key === 'ArrowLeft') seekTo(Math.max(0, played - 0.05))\n }}\n >\n <div className=\"w-full overflow-hidden rounded-full bg-white/30 h-1\">\n <div\n className=\"h-full rounded-full bg-white\"\n style={{ width: `${Math.round(played * 100)}%` }}\n />\n </div>\n </div>\n </div>\n )}\n </div>\n )\n}\n\ninterface VideoPreviewProps {\n source?: string\n thumbnail?: string\n mimeType: string\n}\n\nconst VideoPreview: React.FC<VideoPreviewProps> = (props) => {\n const { source, thumbnail, mimeType } = props\n const [expanded, setExpanded] = useState(false)\n const collapse = () => setExpanded(false)\n\n useEffect(() => {\n setExpanded(false)\n }, [source])\n\n if (!source) {\n return <CollapsedThumbnail thumbnail={thumbnail} mimeType={mimeType} />\n }\n\n return (\n <div\n className={classNames('relative overflow-hidden', {\n 'aspect-video': !expanded,\n })}\n >\n <MediaPlayer\n source={source}\n mimeType={mimeType}\n poster={thumbnail}\n playing={expanded}\n loop\n controls={false}\n showProgress\n onContainerClick={collapse}\n muted\n />\n {!expanded && (\n <button\n type=\"button\"\n className=\"absolute inset-0 block cursor-pointer border-0 p-0 text-left appearance-none\"\n onClick={() => setExpanded(true)}\n aria-label=\"Expand video preview\"\n >\n {thumbnail ? (\n <img\n src={thumbnail}\n alt=\"\"\n className=\"absolute inset-0 h-full w-full object-cover\"\n />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n {renderTypeIcon(mimeType, {\n className: 'size-12 text-black/20',\n weight: 'regular',\n })}\n </div>\n )}\n <div className=\"pointer-events-none absolute left-3 top-3 flex size-8 items-center justify-center rounded-full bg-black/60 text-white\">\n <EyeSlashIcon className=\"size-4\" weight=\"fill\" />\n </div>\n </button>\n )}\n {expanded && <CloseButton onClose={collapse} />}\n </div>\n )\n}\n\ninterface ImagePreviewProps {\n source?: string\n thumbnail?: string\n mimeType: string\n title?: string\n}\n\nconst ImagePreview: React.FC<ImagePreviewProps> = (props) => {\n const { source, thumbnail, mimeType, title } = props\n const [expanded, setExpanded] = useState(false)\n const collapse = () => setExpanded(false)\n\n useEffect(() => {\n setExpanded(false)\n }, [source])\n\n if (expanded && source) {\n return (\n <div className=\"relative\">\n <button\n type=\"button\"\n className=\"block w-full cursor-pointer border-0 p-0 text-left appearance-none\"\n onClick={collapse}\n aria-label=\"Close preview\"\n >\n <img src={source} alt={title ?? ''} className=\"block w-full\" />\n </button>\n <CloseButton onClose={collapse} />\n </div>\n )\n }\n\n return (\n <CollapsedThumbnail\n thumbnail={thumbnail}\n mimeType={mimeType}\n overlayIcon={source ? EyeSlashIcon : undefined}\n onClick={source ? () => setExpanded(true) : undefined}\n />\n )\n}\n\n\nconst CreatorCard: React.FC<CreatorCardProps> = (props) => {\n const {\n title,\n mimeType = 'application/octet-stream',\n thumbnail,\n source,\n detail,\n amountText,\n placeholderTitle = 'Attachment title',\n placeholderAmountText,\n paymentStatus,\n onDismiss,\n isPreview = false,\n } = props\n const sourceType = getSourceType(mimeType)\n const displayAmountText = amountText ?? placeholderAmountText\n const isPlaceholderAmount = !amountText && !!placeholderAmountText\n\n let mediaPreview: React.ReactNode\n if (isPreview && sourceType === 'audio') {\n mediaPreview = (\n <AudioPreview source={source} thumbnail={thumbnail} mimeType={mimeType} />\n )\n } else if (isPreview && sourceType === 'video') {\n mediaPreview = (\n <VideoPreview source={source} thumbnail={thumbnail} mimeType={mimeType} />\n )\n } else if (isPreview && sourceType === 'image') {\n mediaPreview = (\n <ImagePreview\n source={source}\n thumbnail={thumbnail}\n mimeType={mimeType}\n title={title}\n />\n )\n } else {\n mediaPreview = (\n <CollapsedThumbnail thumbnail={thumbnail} mimeType={mimeType} />\n )\n }\n\n return (\n <div className=\"relative w-[280px] select-none overflow-hidden rounded-3xl bg-white shadow-card\">\n {onDismiss && (\n <button\n type=\"button\"\n onClick={onDismiss}\n className=\"absolute right-3 top-3 z-50 flex size-8 items-center justify-center rounded-full bg-black/60 text-white\"\n aria-label=\"Dismiss attachment\"\n >\n <XIcon className=\"size-4\" weight=\"bold\" />\n </button>\n )}\n {mediaPreview}\n <div className=\"px-4 pb-3 pt-3\">\n <p\n className={classNames('mb-1.5 truncate text-base font-medium', {\n 'text-black/30': !title,\n 'text-black': !!title,\n })}\n >\n {title || placeholderTitle}\n </p>\n <div className=\"flex items-center gap-1\">\n {renderTypeIcon(mimeType, {\n className: 'size-5 shrink-0 text-black/55',\n weight: 'regular',\n })}\n {detail && (\n <span className=\"text-xs font-medium text-black/55\">{detail}</span>\n )}\n {paymentStatus === 'paid' ? (\n <>\n <span className=\"text-xs font-medium text-black/55\">•</span>\n <span className=\"text-xs font-medium text-[#008236]\">\n Purchased\n </span>\n <CheckCircleIcon\n className=\"size-4 text-[#008236]\"\n weight=\"bold\"\n />\n </>\n ) : (\n displayAmountText && (\n <>\n <span\n className={classNames('text-xs font-medium', {\n 'text-black/30': isPlaceholderAmount,\n 'text-black/55': !isPlaceholderAmount,\n })}\n >\n •\n </span>\n <span\n className={classNames('text-xs font-medium', {\n 'text-black/30': isPlaceholderAmount,\n 'text-black/55': !isPlaceholderAmount,\n })}\n >\n {displayAmountText}\n </span>\n </>\n )\n )}\n </div>\n </div>\n </div>\n )\n}\n\nexport default CreatorCard\n"],"names":["CloseButton","props","onClose","jsx","EyeIcon","CollapsedThumbnail","thumbnail","mimeType","OverlayIcon","onClick","jsxs","classNames","AudioPreview","source","playing","setPlaying","useState","played","setPlayed","seeking","setSeeking","audioRef","useRef","trackRef","rafRef","useEffect","el","tick","getFraction","useCallback","e","track","clientX","_a","_b","rect","seekTo","fraction","onMove","f","onUp","toggle","p","PauseIcon","PlayIcon","VideoPreview","expanded","setExpanded","collapse","MediaPlayer","EyeSlashIcon","ImagePreview","title","CreatorCard","detail","amountText","placeholderTitle","placeholderAmountText","paymentStatus","onDismiss","isPreview","sourceType","getSourceType","displayAmountText","isPlaceholderAmount","mediaPreview","XIcon","renderTypeIcon","Fragment","CheckCircleIcon"],"mappings":";;;;;AA4BA,MAAMA,IAA0C,CAACC,MAAU;AACzD,QAAM,EAAE,SAAAC,MAAYD;AACpB,SACE,gBAAAE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,SAASD;AAAA,MACT,WAAU;AAAA,MACV,cAAW;AAAA,MAEX,UAAA,gBAAAC,EAACC,GAAA,EAAQ,WAAU,UAAS,QAAO,OAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAGhD,GASMC,IAAwD,CAACJ,MAAU;AACvE,QAAM,EAAE,WAAAK,GAAW,UAAAC,GAAU,aAAaC,GAAa,SAAAC,MAAYR;AACnE,SACE,gBAAAS;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,UAAU,CAACD;AAAA,MACX,WAAWE;AAAA,QACT;AAAA,QACA,EAAE,kBAAkB,CAAC,CAACF,GAAS,kBAAkB,CAACA,EAAA;AAAA,MAAQ;AAAA,MAE5D,SAAAA;AAAA,MACA,cAAYD,IAAc,mBAAmB;AAAA,MAE5C,UAAA;AAAA,QAAAF,IACC,gBAAAH;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,KAAKG;AAAA,YACL,KAAI;AAAA,YACJ,WAAU;AAAA,UAAA;AAAA,QAAA,IAGZ,gBAAAH,EAAC,OAAA,EAAI,WAAU,qDACZ,YAAeI,GAAU;AAAA,UACxB,WAAW;AAAA,UACX,QAAQ;AAAA,QAAA,CAC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,cACC,WAAWQ,EAAW,uBAAuB;AAAA,gBAC3C,iBAAiBqD;AAAA,gBACjB,iBAAiB,CAACA;AAAA,cAAA,CACnB;AAAA,cAEA,UAAAD;AAAA,YAAA;AAAA,UAAA;AAAA,QACH,EAAA,CACF;AAAA,MAAA,EAAA,CAGN;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import { jsxs as L, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { FileIcon as $, ImageIcon as V, SpeakerHighIcon as G, VideoCameraIcon as Y, FileMdIcon as Z, FileTextIcon as J, FileZipIcon as Q, FilePptIcon as ee, FileCsvIcon as te, FileXlsIcon as ne, FileDocIcon as ae, FilePdfIcon as re, CircleNotchIcon as ie, PlayIcon as W, PauseIcon as oe } from "@phosphor-icons/react";
|
|
3
|
+
import se, { useState as c, useRef as M, useEffect as x, useCallback as z } from "react";
|
|
4
|
+
const le = [
|
|
5
|
+
[/pdf/, "pdf"],
|
|
6
|
+
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
7
|
+
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
8
|
+
[/csv/, "csv"],
|
|
9
|
+
[/presentationml|ms-powerpoint|\.ppt/, "ppt"],
|
|
10
|
+
[/zip|x-rar|x-7z|x-tar|x-gzip/, "zip"],
|
|
11
|
+
[/plain|rtf/, "text"],
|
|
12
|
+
[/markdown/, "markdown"]
|
|
13
|
+
];
|
|
14
|
+
function H(a) {
|
|
15
|
+
return a.startsWith("video/") ? "video" : a.startsWith("audio/") ? "audio" : a.startsWith("image/") ? "image" : "document";
|
|
16
|
+
}
|
|
17
|
+
function ce(a) {
|
|
18
|
+
const r = le.find(
|
|
19
|
+
([i]) => i.test(a)
|
|
20
|
+
);
|
|
21
|
+
return r ? r[1] : "generic";
|
|
22
|
+
}
|
|
23
|
+
const ue = {
|
|
24
|
+
video: Y,
|
|
25
|
+
audio: G,
|
|
26
|
+
image: V,
|
|
27
|
+
document: $
|
|
28
|
+
}, de = {
|
|
29
|
+
pdf: re,
|
|
30
|
+
doc: ae,
|
|
31
|
+
xls: ne,
|
|
32
|
+
csv: te,
|
|
33
|
+
ppt: ee,
|
|
34
|
+
zip: Q,
|
|
35
|
+
text: J,
|
|
36
|
+
markdown: Z,
|
|
37
|
+
generic: $
|
|
38
|
+
};
|
|
39
|
+
function fe(a) {
|
|
40
|
+
const r = H(a);
|
|
41
|
+
return r !== "document" ? ue[r] : de[ce(a)];
|
|
42
|
+
}
|
|
43
|
+
function me(a, r) {
|
|
44
|
+
return se.createElement(fe(a), r);
|
|
45
|
+
}
|
|
46
|
+
const he = (a, r) => a === "audio" && !r ? "bg-black/5" : "bg-black";
|
|
47
|
+
function pe(a) {
|
|
48
|
+
var r, i;
|
|
49
|
+
return "touches" in a ? ((r = a.touches[0]) == null ? void 0 : r.clientX) ?? ((i = a.changedTouches[0]) == null ? void 0 : i.clientX) ?? 0 : a.clientX;
|
|
50
|
+
}
|
|
51
|
+
const be = ({
|
|
52
|
+
source: a,
|
|
53
|
+
mimeType: r,
|
|
54
|
+
poster: i,
|
|
55
|
+
autoPlay: _ = !1,
|
|
56
|
+
playing: u,
|
|
57
|
+
loop: k = !1,
|
|
58
|
+
controls: v = !0,
|
|
59
|
+
showProgress: X = !1,
|
|
60
|
+
onContainerClick: N,
|
|
61
|
+
muted: C = !1
|
|
62
|
+
}) => {
|
|
63
|
+
const D = H(r), [d, o] = c(_), R = M(u);
|
|
64
|
+
x(() => {
|
|
65
|
+
u !== void 0 && u !== R.current && (R.current = u, o(u));
|
|
66
|
+
}, [u]);
|
|
67
|
+
const [w, g] = c(0), [f, A] = c(!1), [S, j] = c(!1), [T, q] = c(null), [K, m] = c(!1), [I, b] = c(!1), h = M(null), F = M(null), s = M(null);
|
|
68
|
+
x(() => {
|
|
69
|
+
b(!1);
|
|
70
|
+
}, [a]), x(() => {
|
|
71
|
+
if (!d) {
|
|
72
|
+
s.current !== null && (cancelAnimationFrame(s.current), s.current = null);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const e = () => {
|
|
76
|
+
const t = h.current;
|
|
77
|
+
t && t.duration && !f && g(t.currentTime / t.duration), s.current = requestAnimationFrame(e);
|
|
78
|
+
};
|
|
79
|
+
return s.current = requestAnimationFrame(e), () => {
|
|
80
|
+
s.current !== null && cancelAnimationFrame(s.current);
|
|
81
|
+
};
|
|
82
|
+
}, [d, f]), x(() => {
|
|
83
|
+
const e = h.current;
|
|
84
|
+
e && (d ? e.play().catch((t) => {
|
|
85
|
+
o(!1), b(!0);
|
|
86
|
+
}) : e.pause());
|
|
87
|
+
}, [d]);
|
|
88
|
+
const O = z(() => {
|
|
89
|
+
b(!1), o(!0);
|
|
90
|
+
}, []), P = z(
|
|
91
|
+
(e) => {
|
|
92
|
+
const t = F.current;
|
|
93
|
+
if (!t) return 0;
|
|
94
|
+
const p = t.getBoundingClientRect();
|
|
95
|
+
return Math.max(
|
|
96
|
+
0,
|
|
97
|
+
Math.min(1, (pe(e) - p.left) / p.width)
|
|
98
|
+
);
|
|
99
|
+
},
|
|
100
|
+
[]
|
|
101
|
+
), l = z((e) => {
|
|
102
|
+
const t = h.current;
|
|
103
|
+
t && t.duration && (t.currentTime = e * t.duration);
|
|
104
|
+
}, []), E = (e) => {
|
|
105
|
+
e.stopPropagation(), A(!0);
|
|
106
|
+
const t = P(e);
|
|
107
|
+
g(t), l(t);
|
|
108
|
+
};
|
|
109
|
+
x(() => {
|
|
110
|
+
if (!f) return;
|
|
111
|
+
const e = (p) => g(P(p)), t = (p) => {
|
|
112
|
+
A(!1), l(P(p));
|
|
113
|
+
};
|
|
114
|
+
return window.addEventListener("mousemove", e), window.addEventListener("mouseup", t), window.addEventListener("touchmove", e, { passive: !0 }), window.addEventListener("touchend", t), () => {
|
|
115
|
+
window.removeEventListener("mousemove", e), window.removeEventListener("mouseup", t), window.removeEventListener("touchmove", e), window.removeEventListener("touchend", t);
|
|
116
|
+
};
|
|
117
|
+
}, [f, P, l]);
|
|
118
|
+
const B = T ? { aspectRatio: String(T) } : void 0, U = T ? "" : " aspect-video", y = Math.round(w * 100);
|
|
119
|
+
return /* @__PURE__ */ L(
|
|
120
|
+
"div",
|
|
121
|
+
{
|
|
122
|
+
role: "button",
|
|
123
|
+
tabIndex: 0,
|
|
124
|
+
className: `relative cursor-pointer overflow-hidden ${he(D, i)}${U}`,
|
|
125
|
+
style: B,
|
|
126
|
+
onClick: () => {
|
|
127
|
+
if (!I) {
|
|
128
|
+
if (N) {
|
|
129
|
+
N();
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
v && o((e) => !e);
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
onKeyDown: (e) => {
|
|
136
|
+
if (!(e.key !== "Enter" && e.key !== " ") && (e.preventDefault(), !I)) {
|
|
137
|
+
if (N) {
|
|
138
|
+
N();
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
v && o((t) => !t);
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
children: [
|
|
145
|
+
i && /* @__PURE__ */ n(
|
|
146
|
+
"img",
|
|
147
|
+
{
|
|
148
|
+
src: i,
|
|
149
|
+
alt: "",
|
|
150
|
+
className: "absolute inset-0 h-full w-full object-cover"
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
!i && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: me(r, {
|
|
154
|
+
className: "size-12 text-black/20",
|
|
155
|
+
weight: "regular"
|
|
156
|
+
}) }),
|
|
157
|
+
/* @__PURE__ */ n("div", { className: "absolute inset-0", children: D === "audio" ? /* @__PURE__ */ n(
|
|
158
|
+
"audio",
|
|
159
|
+
{
|
|
160
|
+
ref: h,
|
|
161
|
+
src: a,
|
|
162
|
+
loop: k,
|
|
163
|
+
muted: C,
|
|
164
|
+
style: { width: "100%", height: "100%" },
|
|
165
|
+
onLoadStart: () => m(!0),
|
|
166
|
+
onCanPlay: () => m(!1),
|
|
167
|
+
onWaiting: () => m(!0),
|
|
168
|
+
onPlay: () => b(!1),
|
|
169
|
+
onEnded: () => {
|
|
170
|
+
k || (o(!1), g(0));
|
|
171
|
+
},
|
|
172
|
+
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
173
|
+
}
|
|
174
|
+
) : /* @__PURE__ */ n(
|
|
175
|
+
"video",
|
|
176
|
+
{
|
|
177
|
+
ref: h,
|
|
178
|
+
src: a,
|
|
179
|
+
poster: i,
|
|
180
|
+
loop: k,
|
|
181
|
+
muted: C,
|
|
182
|
+
playsInline: !0,
|
|
183
|
+
style: { width: "100%", height: "100%" },
|
|
184
|
+
onLoadStart: () => m(!0),
|
|
185
|
+
onCanPlay: () => m(!1),
|
|
186
|
+
onWaiting: () => m(!0),
|
|
187
|
+
onPlay: () => b(!1),
|
|
188
|
+
onLoadedMetadata: () => {
|
|
189
|
+
const e = h.current;
|
|
190
|
+
e instanceof HTMLVideoElement && e.videoWidth && e.videoHeight && q(e.videoWidth / e.videoHeight);
|
|
191
|
+
},
|
|
192
|
+
onEnded: () => {
|
|
193
|
+
k || (o(!1), g(0));
|
|
194
|
+
},
|
|
195
|
+
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
196
|
+
}
|
|
197
|
+
) }),
|
|
198
|
+
K && !I && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
199
|
+
ie,
|
|
200
|
+
{
|
|
201
|
+
className: "size-8 animate-spin text-white/80",
|
|
202
|
+
weight: "bold"
|
|
203
|
+
}
|
|
204
|
+
) }),
|
|
205
|
+
I && !v && /* @__PURE__ */ n(
|
|
206
|
+
"div",
|
|
207
|
+
{
|
|
208
|
+
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
209
|
+
role: "button",
|
|
210
|
+
tabIndex: 0,
|
|
211
|
+
"aria-label": "Play preview",
|
|
212
|
+
onClick: (e) => {
|
|
213
|
+
e.stopPropagation(), O();
|
|
214
|
+
},
|
|
215
|
+
onKeyDown: (e) => {
|
|
216
|
+
e.key !== "Enter" && e.key !== " " || (e.preventDefault(), e.stopPropagation(), O());
|
|
217
|
+
},
|
|
218
|
+
children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(W, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
219
|
+
}
|
|
220
|
+
),
|
|
221
|
+
X && !v && /* @__PURE__ */ n("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ n(
|
|
222
|
+
"div",
|
|
223
|
+
{
|
|
224
|
+
role: "slider",
|
|
225
|
+
"aria-label": "Playback position",
|
|
226
|
+
"aria-valuenow": y,
|
|
227
|
+
"aria-valuemin": 0,
|
|
228
|
+
"aria-valuemax": 100,
|
|
229
|
+
tabIndex: 0,
|
|
230
|
+
ref: F,
|
|
231
|
+
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
232
|
+
onMouseDown: E,
|
|
233
|
+
onTouchStart: E,
|
|
234
|
+
onClick: (e) => e.stopPropagation(),
|
|
235
|
+
onKeyDown: (e) => {
|
|
236
|
+
e.key === "ArrowRight" && l(Math.min(1, w + 0.05)), e.key === "ArrowLeft" && l(Math.max(0, w - 0.05));
|
|
237
|
+
},
|
|
238
|
+
children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
|
|
239
|
+
"div",
|
|
240
|
+
{
|
|
241
|
+
className: "h-full rounded-full bg-white",
|
|
242
|
+
style: { width: `${y}%` }
|
|
243
|
+
}
|
|
244
|
+
) })
|
|
245
|
+
}
|
|
246
|
+
) }),
|
|
247
|
+
v && /* @__PURE__ */ L("div", { className: "absolute inset-x-0 bottom-0 flex items-center gap-2 bg-gradient-to-t from-black/60 to-transparent px-3 pb-2.5 pt-6 transition-all duration-200", children: [
|
|
248
|
+
/* @__PURE__ */ n(
|
|
249
|
+
"button",
|
|
250
|
+
{
|
|
251
|
+
type: "button",
|
|
252
|
+
onClick: (e) => {
|
|
253
|
+
e.stopPropagation(), o((t) => !t);
|
|
254
|
+
},
|
|
255
|
+
className: "shrink-0 text-white",
|
|
256
|
+
"aria-label": d ? "Pause" : "Play",
|
|
257
|
+
children: d ? /* @__PURE__ */ n(oe, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(W, { className: "size-5 translate-x-px", weight: "fill" })
|
|
258
|
+
}
|
|
259
|
+
),
|
|
260
|
+
/* @__PURE__ */ L(
|
|
261
|
+
"div",
|
|
262
|
+
{
|
|
263
|
+
role: "slider",
|
|
264
|
+
"aria-label": "Playback position",
|
|
265
|
+
"aria-valuenow": y,
|
|
266
|
+
"aria-valuemin": 0,
|
|
267
|
+
"aria-valuemax": 100,
|
|
268
|
+
tabIndex: 0,
|
|
269
|
+
ref: F,
|
|
270
|
+
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
271
|
+
onMouseDown: E,
|
|
272
|
+
onTouchStart: E,
|
|
273
|
+
onClick: (e) => e.stopPropagation(),
|
|
274
|
+
onMouseEnter: () => j(!0),
|
|
275
|
+
onMouseLeave: () => j(!1),
|
|
276
|
+
onKeyDown: (e) => {
|
|
277
|
+
e.key === "ArrowRight" && l(Math.min(1, w + 0.05)), e.key === "ArrowLeft" && l(Math.max(0, w - 0.05));
|
|
278
|
+
},
|
|
279
|
+
children: [
|
|
280
|
+
/* @__PURE__ */ n(
|
|
281
|
+
"div",
|
|
282
|
+
{
|
|
283
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${S || f ? "h-1.5" : "h-1"}`,
|
|
284
|
+
children: /* @__PURE__ */ n(
|
|
285
|
+
"div",
|
|
286
|
+
{
|
|
287
|
+
className: "h-full rounded-full bg-white",
|
|
288
|
+
style: { width: `${y}%` }
|
|
289
|
+
}
|
|
290
|
+
)
|
|
291
|
+
}
|
|
292
|
+
),
|
|
293
|
+
/* @__PURE__ */ n(
|
|
294
|
+
"div",
|
|
295
|
+
{
|
|
296
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${S || f ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
297
|
+
style: { left: `${y}%` }
|
|
298
|
+
}
|
|
299
|
+
)
|
|
300
|
+
]
|
|
301
|
+
}
|
|
302
|
+
)
|
|
303
|
+
] })
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
);
|
|
307
|
+
};
|
|
308
|
+
export {
|
|
309
|
+
be as M,
|
|
310
|
+
H as g,
|
|
311
|
+
me as r
|
|
312
|
+
};
|
|
313
|
+
//# sourceMappingURL=MediaPlayer-DXz4IBLx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MediaPlayer-DXz4IBLx.js","sources":["../src/components/LockedAttachment/utils/mimeType.ts","../src/components/LockedAttachment/utils/icons.ts","../src/components/LockedAttachment/components/MediaPlayer.tsx"],"sourcesContent":["export type AttachmentSourceType = 'image' | 'audio' | 'video' | 'document'\n\nexport type DocumentIconType =\n | 'pdf'\n | 'doc'\n | 'xls'\n | 'csv'\n | 'ppt'\n | 'zip'\n | 'text'\n | 'markdown'\n | 'generic'\n\nconst DOCUMENT_ICON_PATTERNS: Array<[RegExp, DocumentIconType]> = [\n [/pdf/, 'pdf'],\n [/wordprocessingml|msword|\\.doc/, 'doc'],\n [/spreadsheetml|ms-excel|\\.xls/, 'xls'],\n [/csv/, 'csv'],\n [/presentationml|ms-powerpoint|\\.ppt/, 'ppt'],\n [/zip|x-rar|x-7z|x-tar|x-gzip/, 'zip'],\n [/plain|rtf/, 'text'],\n [/markdown/, 'markdown'],\n]\n\nexport function getSourceType(mimeType: string): AttachmentSourceType {\n if (mimeType.startsWith('video/')) return 'video'\n if (mimeType.startsWith('audio/')) return 'audio'\n if (mimeType.startsWith('image/')) return 'image'\n return 'document'\n}\n\nexport function getDocumentIconType(mimeType: string): DocumentIconType {\n const match = DOCUMENT_ICON_PATTERNS.find(([pattern]) =>\n pattern.test(mimeType)\n )\n return match ? match[1] : 'generic'\n}\n","import {\n FileIcon,\n FileCsvIcon,\n FileDocIcon,\n FileMdIcon,\n FilePdfIcon,\n FilePptIcon,\n FileTextIcon,\n FileXlsIcon,\n FileZipIcon,\n ImageIcon,\n SpeakerHighIcon,\n VideoCameraIcon,\n IconProps,\n} from '@phosphor-icons/react'\nimport React from 'react'\n\nimport { getDocumentIconType, getSourceType } from './mimeType'\nimport type { AttachmentSourceType } from './mimeType'\n\nexport const MEDIA_TYPE_ICON: Record<AttachmentSourceType, React.ElementType> =\n {\n video: VideoCameraIcon,\n audio: SpeakerHighIcon,\n image: ImageIcon,\n document: FileIcon,\n }\n\nconst DOCUMENT_ICON_COMPONENT = {\n pdf: FilePdfIcon,\n doc: FileDocIcon,\n xls: FileXlsIcon,\n csv: FileCsvIcon,\n ppt: FilePptIcon,\n zip: FileZipIcon,\n text: FileTextIcon,\n markdown: FileMdIcon,\n generic: FileIcon,\n} as const\n\nexport function getTypeIcon(mimeType: string): React.ElementType {\n const sourceType = getSourceType(mimeType)\n if (sourceType !== 'document') return MEDIA_TYPE_ICON[sourceType]\n return DOCUMENT_ICON_COMPONENT[getDocumentIconType(mimeType)]\n}\n\n/** Use instead of `<TypeIcon />` where TypeIcon = getTypeIcon(mime) to satisfy react-hooks/static-components. */\nexport function renderTypeIcon(\n mimeType: string,\n props: IconProps\n): React.ReactElement {\n return React.createElement(getTypeIcon(mimeType), props)\n}\n","import { CircleNotchIcon, PauseIcon, PlayIcon } from '@phosphor-icons/react'\nimport React, { useCallback, useEffect, useRef, useState } from 'react'\n\nimport { isDevBuild } from '../../../utils/isDevBuild'\nimport { renderTypeIcon } from '../utils/icons'\nimport { getSourceType, type AttachmentSourceType } from '../utils/mimeType'\n\nconst getPlayerBg = (sourceType: AttachmentSourceType, poster?: string) =>\n sourceType === 'audio' && !poster ? 'bg-black/5' : 'bg-black'\n\nfunction getClientXFromEvent(\n e: MouseEvent | TouchEvent | React.MouseEvent | React.TouchEvent\n): number {\n if ('touches' in e) {\n return e.touches[0]?.clientX ?? e.changedTouches[0]?.clientX ?? 0\n }\n return e.clientX\n}\n\nexport interface MediaPlayerProps {\n source: string\n mimeType: string\n poster?: string\n autoPlay?: boolean\n /** Controlled playing state. When provided, syncs to internal play/pause. */\n playing?: boolean\n loop?: boolean\n controls?: boolean\n showProgress?: boolean\n onContainerClick?: () => void\n /** When true, requests muted playback (helps autoplay policies on video). */\n muted?: boolean\n}\n\nconst MediaPlayer: React.FC<MediaPlayerProps> = ({\n source,\n mimeType,\n poster,\n autoPlay = false,\n playing: playingProp,\n loop = false,\n controls = true,\n showProgress = false,\n onContainerClick,\n muted = false,\n}) => {\n const sourceType = getSourceType(mimeType)\n const [playing, setPlaying] = useState(autoPlay)\n\n // Sync controlled playing prop to internal state\n const prevPlayingPropRef = useRef(playingProp)\n useEffect(() => {\n if (\n playingProp !== undefined &&\n playingProp !== prevPlayingPropRef.current\n ) {\n prevPlayingPropRef.current = playingProp\n setPlaying(playingProp)\n }\n }, [playingProp])\n const [played, setPlayed] = useState(0)\n const [seeking, setSeeking] = useState(false)\n const [scrubberHovered, setScrubberHovered] = useState(false)\n const [videoAspect, setVideoAspect] = useState<number | null>(null)\n const [buffering, setBuffering] = useState(false)\n /** Set when autoplay/play() was rejected so user can start via gesture (no controls UI). */\n const [manualPlayRequired, setManualPlayRequired] = useState(false)\n const playerRef = useRef<HTMLMediaElement>(null)\n const trackRef = useRef<HTMLDivElement>(null)\n const rafRef = useRef<number | null>(null)\n\n useEffect(() => {\n setManualPlayRequired(false)\n }, [source])\n\n useEffect(() => {\n if (!playing) {\n if (rafRef.current !== null) {\n cancelAnimationFrame(rafRef.current)\n rafRef.current = null\n }\n return\n }\n const tick = () => {\n const el = playerRef.current\n if (el && el.duration && !seeking) setPlayed(el.currentTime / el.duration)\n rafRef.current = requestAnimationFrame(tick)\n }\n rafRef.current = requestAnimationFrame(tick)\n return () => {\n if (rafRef.current !== null) cancelAnimationFrame(rafRef.current)\n }\n }, [playing, seeking])\n\n // ReactPlayer v3 uses native HTML media elements and does not support a\n // declarative `playing` prop — playback must be driven imperatively.\n useEffect(() => {\n const el = playerRef.current\n if (!el) return\n if (playing) {\n void el.play().catch((err) => {\n setPlaying(false)\n setManualPlayRequired(true)\n if (isDevBuild()) {\n console.debug('[MediaPlayer] play() failed', err)\n }\n })\n } else {\n el.pause()\n }\n }, [playing])\n\n const startPlaybackFromGesture = useCallback(() => {\n setManualPlayRequired(false)\n setPlaying(true)\n }, [])\n\n const getFraction = useCallback(\n (e: MouseEvent | TouchEvent | React.MouseEvent | React.TouchEvent) => {\n const track = trackRef.current\n if (!track) return 0\n const rect = track.getBoundingClientRect()\n return Math.max(\n 0,\n Math.min(1, (getClientXFromEvent(e) - rect.left) / rect.width)\n )\n },\n []\n )\n\n const seekTo = useCallback((fraction: number) => {\n const el = playerRef.current\n if (el && el.duration) el.currentTime = fraction * el.duration\n }, [])\n\n const handleTrackPointerDown = (\n e: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>\n ) => {\n e.stopPropagation()\n setSeeking(true)\n const fraction = getFraction(e)\n setPlayed(fraction)\n seekTo(fraction)\n }\n\n useEffect(() => {\n if (!seeking) return\n const onMove = (e: MouseEvent | TouchEvent) => setPlayed(getFraction(e))\n const onUp = (e: MouseEvent | TouchEvent) => {\n setSeeking(false)\n seekTo(getFraction(e))\n }\n window.addEventListener('mousemove', onMove)\n window.addEventListener('mouseup', onUp)\n window.addEventListener('touchmove', onMove, { passive: true })\n window.addEventListener('touchend', onUp)\n return () => {\n window.removeEventListener('mousemove', onMove)\n window.removeEventListener('mouseup', onUp)\n window.removeEventListener('touchmove', onMove)\n window.removeEventListener('touchend', onUp)\n }\n }, [seeking, getFraction, seekTo])\n\n // Use natural aspect ratio once metadata loads, fall back to 16:9 before then.\n const aspectStyle = videoAspect\n ? { aspectRatio: String(videoAspect) }\n : undefined\n const aspectClass = !videoAspect ? ' aspect-video' : ''\n const scrubberPercent = Math.round(played * 100)\n\n return (\n <div\n role=\"button\"\n tabIndex={0}\n className={`relative cursor-pointer overflow-hidden ${getPlayerBg(sourceType, poster)}${aspectClass}`}\n style={aspectStyle}\n onClick={() => {\n if (manualPlayRequired) return\n if (onContainerClick) {\n onContainerClick()\n return\n }\n if (controls) setPlaying((p) => !p)\n }}\n onKeyDown={(e) => {\n if (e.key !== 'Enter' && e.key !== ' ') return\n e.preventDefault()\n if (manualPlayRequired) return\n if (onContainerClick) {\n onContainerClick()\n return\n }\n if (controls) setPlaying((p) => !p)\n }}\n >\n {poster && (\n <img\n src={poster}\n alt=\"\"\n className=\"absolute inset-0 h-full w-full object-cover\"\n />\n )}\n {!poster && (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n {renderTypeIcon(mimeType, {\n className: 'size-12 text-black/20',\n weight: 'regular',\n })}\n </div>\n )}\n <div className=\"absolute inset-0\">\n {sourceType === 'audio' ? (\n <audio\n ref={playerRef as React.RefObject<HTMLAudioElement>}\n src={source}\n loop={loop}\n muted={muted}\n style={{ width: '100%', height: '100%' }}\n onLoadStart={() => setBuffering(true)}\n onCanPlay={() => setBuffering(false)}\n onWaiting={() => setBuffering(true)}\n onPlay={() => setManualPlayRequired(false)}\n onEnded={() => {\n if (!loop) {\n setPlaying(false)\n setPlayed(0)\n }\n }}\n >\n <track kind=\"captions\" />\n </audio>\n ) : (\n <video\n ref={playerRef as React.RefObject<HTMLVideoElement>}\n src={source}\n poster={poster}\n loop={loop}\n muted={muted}\n playsInline\n style={{ width: '100%', height: '100%' }}\n onLoadStart={() => setBuffering(true)}\n onCanPlay={() => setBuffering(false)}\n onWaiting={() => setBuffering(true)}\n onPlay={() => setManualPlayRequired(false)}\n onLoadedMetadata={() => {\n const el = playerRef.current\n if (el instanceof HTMLVideoElement && el.videoWidth && el.videoHeight) {\n setVideoAspect(el.videoWidth / el.videoHeight)\n }\n }}\n onEnded={() => {\n if (!loop) {\n setPlaying(false)\n setPlayed(0)\n }\n }}\n >\n <track kind=\"captions\" />\n </video>\n )}\n </div>\n\n {buffering && !manualPlayRequired && (\n <div className=\"absolute inset-0 z-10 flex items-center justify-center\">\n <CircleNotchIcon\n className=\"size-8 animate-spin text-white/80\"\n weight=\"bold\"\n />\n </div>\n )}\n\n {manualPlayRequired && !controls && (\n <div\n className=\"absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35\"\n role=\"button\"\n tabIndex={0}\n aria-label=\"Play preview\"\n onClick={(e) => {\n e.stopPropagation()\n startPlaybackFromGesture()\n }}\n onKeyDown={(e) => {\n if (e.key !== 'Enter' && e.key !== ' ') return\n e.preventDefault()\n e.stopPropagation()\n startPlaybackFromGesture()\n }}\n >\n <span className=\"flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm\">\n <PlayIcon className=\"size-9 translate-x-0.5\" weight=\"fill\" />\n </span>\n </div>\n )}\n\n {showProgress && !controls && (\n <div className=\"absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent\">\n <div\n role=\"slider\"\n aria-label=\"Playback position\"\n aria-valuenow={scrubberPercent}\n aria-valuemin={0}\n aria-valuemax={100}\n tabIndex={0}\n ref={trackRef}\n className=\"relative flex h-4 w-full cursor-pointer items-center\"\n onMouseDown={handleTrackPointerDown}\n onTouchStart={handleTrackPointerDown}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => {\n if (e.key === 'ArrowRight') seekTo(Math.min(1, played + 0.05))\n if (e.key === 'ArrowLeft') seekTo(Math.max(0, played - 0.05))\n }}\n >\n <div className=\"w-full overflow-hidden rounded-full bg-white/30 h-1\">\n <div\n className=\"h-full rounded-full bg-white\"\n style={{ width: `${scrubberPercent}%` }}\n />\n </div>\n </div>\n </div>\n )}\n\n {controls && (\n <div className=\"absolute inset-x-0 bottom-0 flex items-center gap-2 bg-gradient-to-t from-black/60 to-transparent px-3 pb-2.5 pt-6 transition-all duration-200\">\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n setPlaying((p) => !p)\n }}\n className=\"shrink-0 text-white\"\n aria-label={playing ? 'Pause' : 'Play'}\n >\n {playing ? (\n <PauseIcon className=\"size-5\" weight=\"fill\" />\n ) : (\n <PlayIcon className=\"size-5 translate-x-px\" weight=\"fill\" />\n )}\n </button>\n\n <div\n role=\"slider\"\n aria-label=\"Playback position\"\n aria-valuenow={scrubberPercent}\n aria-valuemin={0}\n aria-valuemax={100}\n tabIndex={0}\n ref={trackRef}\n className=\"relative flex h-4 w-full cursor-pointer items-center\"\n onMouseDown={handleTrackPointerDown}\n onTouchStart={handleTrackPointerDown}\n onClick={(e) => e.stopPropagation()}\n onMouseEnter={() => setScrubberHovered(true)}\n onMouseLeave={() => setScrubberHovered(false)}\n onKeyDown={(e) => {\n if (e.key === 'ArrowRight') seekTo(Math.min(1, played + 0.05))\n if (e.key === 'ArrowLeft') seekTo(Math.max(0, played - 0.05))\n }}\n >\n <div\n className={`w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${scrubberHovered || seeking ? 'h-1.5' : 'h-1'}`}\n >\n <div\n className=\"h-full rounded-full bg-white\"\n style={{ width: `${scrubberPercent}%` }}\n />\n </div>\n <div\n className={`absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${scrubberHovered || seeking ? 'scale-100 opacity-100' : 'scale-0 opacity-0'}`}\n style={{ left: `${scrubberPercent}%` }}\n />\n </div>\n </div>\n )}\n </div>\n )\n}\n\nexport default MediaPlayer\n"],"names":["DOCUMENT_ICON_PATTERNS","getSourceType","mimeType","getDocumentIconType","match","pattern","MEDIA_TYPE_ICON","VideoCameraIcon","SpeakerHighIcon","ImageIcon","FileIcon","DOCUMENT_ICON_COMPONENT","FilePdfIcon","FileDocIcon","FileXlsIcon","FileCsvIcon","FilePptIcon","FileZipIcon","FileTextIcon","FileMdIcon","getTypeIcon","sourceType","renderTypeIcon","props","React","getPlayerBg","poster","getClientXFromEvent","e","_a","_b","MediaPlayer","source","autoPlay","playingProp","loop","controls","showProgress","onContainerClick","muted","playing","setPlaying","useState","prevPlayingPropRef","useRef","useEffect","played","setPlayed","seeking","setSeeking","scrubberHovered","setScrubberHovered","videoAspect","setVideoAspect","buffering","setBuffering","manualPlayRequired","setManualPlayRequired","playerRef","trackRef","rafRef","tick","el","err","startPlaybackFromGesture","useCallback","getFraction","track","rect","seekTo","fraction","handleTrackPointerDown","onMove","onUp","aspectStyle","aspectClass","scrubberPercent","jsxs","p","jsx","CircleNotchIcon","PlayIcon","PauseIcon"],"mappings":";;;AAaA,MAAMA,KAA4D;AAAA,EAChE,CAAC,OAAO,KAAK;AAAA,EACb,CAAC,iCAAiC,KAAK;AAAA,EACvC,CAAC,gCAAgC,KAAK;AAAA,EACtC,CAAC,OAAO,KAAK;AAAA,EACb,CAAC,sCAAsC,KAAK;AAAA,EAC5C,CAAC,+BAA+B,KAAK;AAAA,EACrC,CAAC,aAAa,MAAM;AAAA,EACpB,CAAC,YAAY,UAAU;AACzB;AAEO,SAASC,EAAcC,GAAwC;AACpE,SAAIA,EAAS,WAAW,QAAQ,IAAU,UACtCA,EAAS,WAAW,QAAQ,IAAU,UACtCA,EAAS,WAAW,QAAQ,IAAU,UACnC;AACT;AAEO,SAASC,GAAoBD,GAAoC;AACtE,QAAME,IAAQJ,GAAuB;AAAA,IAAK,CAAC,CAACK,CAAO,MACjDA,EAAQ,KAAKH,CAAQ;AAAA,EAAA;AAEvB,SAAOE,IAAQA,EAAM,CAAC,IAAI;AAC5B;AChBO,MAAME,KACX;AAAA,EACE,OAAOC;AAAA,EACP,OAAOC;AAAA,EACP,OAAOC;AAAA,EACP,UAAUC;AACZ,GAEIC,KAA0B;AAAA,EAC9B,KAAKC;AAAA,EACL,KAAKC;AAAA,EACL,KAAKC;AAAA,EACL,KAAKC;AAAA,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,OAAO,EAAE,MAAM,GAAG4B,CAAe,IAAA;AAAA,kBAAI;AAAA,gBAAA;AAAA,cACvC;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e, Fragment as b } from "react/jsx-runtime";
|
|
2
|
-
import { CheckCircleIcon as T, LockOpenIcon as v,
|
|
2
|
+
import { CheckCircleIcon as T, LockOpenIcon as v, DownloadSimpleIcon as P, LockSimpleIcon as C } from "@phosphor-icons/react";
|
|
3
3
|
import { useState as x, useEffect as L } from "react";
|
|
4
|
-
import { g as D, r as g, M as U } from "./MediaPlayer-
|
|
5
|
-
const h = (s) => s === "paid" ? v :
|
|
4
|
+
import { g as D, r as g, M as U } from "./MediaPlayer-DXz4IBLx.js";
|
|
5
|
+
const h = (s) => s === "paid" ? v : C, z = (s) => {
|
|
6
6
|
const { icon: t } = s;
|
|
7
7
|
return /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-black/30", children: /* @__PURE__ */ e("div", { className: "absolute left-3 top-3 flex size-8 items-center justify-center rounded-full bg-black/60", children: /* @__PURE__ */ e(t, { className: "size-4 text-white", weight: "fill" }) }) });
|
|
8
8
|
}, I = (s) => {
|
|
@@ -94,7 +94,7 @@ const h = (s) => s === "paid" ? v : P, z = (s) => {
|
|
|
94
94
|
onClick: o,
|
|
95
95
|
className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none !text-white",
|
|
96
96
|
children: [
|
|
97
|
-
/* @__PURE__ */ e(
|
|
97
|
+
/* @__PURE__ */ e(P, { className: "size-4", weight: "bold" }),
|
|
98
98
|
"Download"
|
|
99
99
|
]
|
|
100
100
|
}
|
|
@@ -196,4 +196,4 @@ const h = (s) => s === "paid" ? v : P, z = (s) => {
|
|
|
196
196
|
export {
|
|
197
197
|
$ as default
|
|
198
198
|
};
|
|
199
|
-
//# sourceMappingURL=Visitor-
|
|
199
|
+
//# sourceMappingURL=Visitor-C1Fcrgd6.js.map
|