@oneplatformdev/ui 0.1.99-beta.278 → 0.1.99-beta.280
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropzoneSinglePickPreview.d.ts","sourceRoot":"","sources":["../../src/Dropzone/DropzoneSinglePickPreview.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAOrD,OAAO,wCAAwC,CAAC;AAChD,OAAO,iDAAiD,CAAC;AACzD,OAAO,yDAAyD,CAAC;AACjE,OAAO,iCAAiC,CAAC;AAGzC,eAAO,MAAM,mBAAmB,GAAI,UAAU,MAAM,GAAG,IAAI,GAAG,IAAI,KAAG,MAYpE,CAAC;AAqCF,UAAU,sBAAsB;IAC9B,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC1D,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAClE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,yBAAyB,GAAI,kEAMvC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"DropzoneSinglePickPreview.d.ts","sourceRoot":"","sources":["../../src/Dropzone/DropzoneSinglePickPreview.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAOrD,OAAO,wCAAwC,CAAC;AAChD,OAAO,iDAAiD,CAAC;AACzD,OAAO,yDAAyD,CAAC;AACjE,OAAO,iCAAiC,CAAC;AAGzC,eAAO,MAAM,mBAAmB,GAAI,UAAU,MAAM,GAAG,IAAI,GAAG,IAAI,KAAG,MAYpE,CAAC;AAqCF,UAAU,sBAAsB;IAC9B,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC1D,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAClE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,yBAAyB,GAAI,kEAMvC,sBAAsB,4CAqLxB,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { isVideoUrl as
|
|
4
|
-
import { X as
|
|
5
|
-
import { MediaPlayer as
|
|
6
|
-
import { DefaultVideoLayout as
|
|
7
|
-
import { Button as
|
|
1
|
+
import { jsxs as a, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useState as x, useMemo as i, useRef as F, useEffect as I } from "react";
|
|
3
|
+
import { isVideoUrl as C, isFile as R } from "./DropzoneUtils.js";
|
|
4
|
+
import { X as U, FileIcon as M, Video as V, PencilIcon as B, Trash2 as D } from "lucide-react";
|
|
5
|
+
import { MediaPlayer as O, MediaProvider as T, Poster as W } from "@vidstack/react";
|
|
6
|
+
import { DefaultVideoLayout as Y, defaultLayoutIcons as $ } from "@vidstack/react/player/layouts/default";
|
|
7
|
+
import { Button as q } from "../Button/Button.js";
|
|
8
8
|
import "@vidstack/react/player/styles/base.css";
|
|
9
9
|
import "@vidstack/react/player/styles/default/theme.css";
|
|
10
10
|
import "@vidstack/react/player/styles/default/layouts/video.css";
|
|
11
11
|
/* empty css */
|
|
12
|
-
import { ButtonIcon as
|
|
13
|
-
const
|
|
12
|
+
import { ButtonIcon as A } from "../ButtonIcon/ButtonIcon.js";
|
|
13
|
+
const J = (e) => {
|
|
14
14
|
if (!e) return "";
|
|
15
15
|
switch (!0) {
|
|
16
16
|
case (typeof e == "string" && !!e.trim() && e !== "null"):
|
|
@@ -22,112 +22,143 @@ const R = (e) => {
|
|
|
22
22
|
default:
|
|
23
23
|
return "";
|
|
24
24
|
}
|
|
25
|
-
},
|
|
25
|
+
}, X = (e) => {
|
|
26
26
|
if (!e) return !1;
|
|
27
27
|
try {
|
|
28
|
-
const
|
|
29
|
-
return
|
|
28
|
+
const c = new URL(e).hostname.toLowerCase();
|
|
29
|
+
return c.includes("youtube.com") || c.includes("youtu.be");
|
|
30
30
|
} catch {
|
|
31
31
|
return !1;
|
|
32
32
|
}
|
|
33
|
-
},
|
|
33
|
+
}, G = (e) => {
|
|
34
34
|
try {
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
return
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
const
|
|
41
|
-
return l >= 0 &&
|
|
35
|
+
const s = new URL(e);
|
|
36
|
+
if (s.hostname.toLowerCase().includes("youtu.be"))
|
|
37
|
+
return s.pathname.replace("/", "").trim();
|
|
38
|
+
const h = s.searchParams.get("v");
|
|
39
|
+
if (h) return h.trim();
|
|
40
|
+
const f = s.pathname.split("/").filter(Boolean), l = f.findIndex((m) => m === "embed");
|
|
41
|
+
return l >= 0 && f[l + 1] ? f[l + 1].trim() : "";
|
|
42
42
|
} catch {
|
|
43
43
|
return "";
|
|
44
44
|
}
|
|
45
|
-
},
|
|
45
|
+
}, ie = ({
|
|
46
46
|
item: e,
|
|
47
|
-
disabled:
|
|
48
|
-
onRemoveClick:
|
|
49
|
-
onReplaceClick:
|
|
50
|
-
labelReplace:
|
|
47
|
+
disabled: s,
|
|
48
|
+
onRemoveClick: c,
|
|
49
|
+
onReplaceClick: h,
|
|
50
|
+
labelReplace: f = "Замінити"
|
|
51
51
|
}) => {
|
|
52
|
-
const [l,
|
|
53
|
-
() => typeof e == "string" &&
|
|
52
|
+
const [l, m] = x(""), n = R(e), g = n ? e.name : e, t = i(
|
|
53
|
+
() => typeof e == "string" && X(e),
|
|
54
54
|
[e]
|
|
55
|
-
),
|
|
56
|
-
() => typeof e == "string" && !
|
|
57
|
-
[e,
|
|
58
|
-
),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
), p = i(
|
|
56
|
+
() => typeof e == "string" && !t && C(e),
|
|
57
|
+
[e, t]
|
|
58
|
+
), u = i(
|
|
59
|
+
() => t && typeof e == "string" ? G(e) : "",
|
|
60
|
+
[t, e]
|
|
61
|
+
), w = i(() => !t || typeof e != "string" ? "" : u ? `youtube/${u}` : e, [t, e, u]), y = i(
|
|
62
|
+
() => u ? `https://img.youtube.com/vi/${u}/hqdefault.jpg` : void 0,
|
|
63
|
+
[u]
|
|
64
|
+
), [j, v] = x(!1), [z, N] = x(!0), P = F(null), k = F(null);
|
|
65
|
+
I(() => {
|
|
66
|
+
v(!1), N(!0);
|
|
67
|
+
}, [w]);
|
|
68
|
+
const S = i(() => n && e.type?.includes("image") || typeof e == "string" && !t && !p, [e, n, t, p]), d = i(() => n && e.type?.includes("video") || t || p, [e, n, t, p]), E = i(() => n ? `${(e.size / (1024 * 1024)).toFixed(0)} MB` : "", [e, n]);
|
|
69
|
+
return I(() => {
|
|
70
|
+
if (S || d) {
|
|
71
|
+
const r = J(e);
|
|
72
|
+
if (m(r), n && r)
|
|
73
|
+
return () => URL.revokeObjectURL(r);
|
|
68
74
|
} else
|
|
69
|
-
|
|
70
|
-
}, [e,
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
m("");
|
|
76
|
+
}, [e, n, S, d]), /* @__PURE__ */ a("div", { className: "relative w-full overflow-hidden", children: [
|
|
77
|
+
d && l ? /* @__PURE__ */ o("div", { className: "w-full rounded-lg overflow-hidden bg-black", onClick: (r) => r.stopPropagation(), children: /* @__PURE__ */ o("div", { className: "aspect-video", children: /* @__PURE__ */ a(
|
|
78
|
+
O,
|
|
73
79
|
{
|
|
74
|
-
|
|
75
|
-
|
|
80
|
+
ref: P,
|
|
81
|
+
title: n ? e.name : t ? void 0 : typeof e == "string" ? e : void 0,
|
|
82
|
+
src: t ? w : { src: l, type: n ? e.type : void 0 },
|
|
83
|
+
poster: t ? y : void 0,
|
|
84
|
+
className: `h-full w-full bg-black text-white ${t && j ? "dropzone-youtube-player" : ""}`,
|
|
76
85
|
playsInline: !0,
|
|
86
|
+
onPlay: () => {
|
|
87
|
+
N(!1), t && v(!0);
|
|
88
|
+
},
|
|
89
|
+
onVolumeChange: (r) => {
|
|
90
|
+
if (!t) return;
|
|
91
|
+
const b = r.volume === 0 || r.muted;
|
|
92
|
+
if (k.current === b) return;
|
|
93
|
+
k.current = b;
|
|
94
|
+
const L = P.current?.el?.querySelector("iframe");
|
|
95
|
+
L?.contentWindow && L.contentWindow.postMessage(
|
|
96
|
+
JSON.stringify({ event: "command", func: b ? "mute" : "unMute", args: [] }),
|
|
97
|
+
"*"
|
|
98
|
+
);
|
|
99
|
+
},
|
|
77
100
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ o(T, {}),
|
|
102
|
+
z && t && y && /* @__PURE__ */ o(
|
|
103
|
+
W,
|
|
104
|
+
{
|
|
105
|
+
className: "absolute inset-0 h-full w-full object-cover",
|
|
106
|
+
src: y,
|
|
107
|
+
alt: typeof e == "string" ? e : ""
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
/* @__PURE__ */ o(Y, { icons: $ })
|
|
80
111
|
]
|
|
81
112
|
}
|
|
82
|
-
) }) : !
|
|
83
|
-
!
|
|
84
|
-
/* @__PURE__ */
|
|
113
|
+
) }) }) : !d && l ? /* @__PURE__ */ a("div", { className: "relative w-full h-64 sm:h-80 md:h-96 overflow-hidden outline-[#E4E4E7] outline-2 outline-dashed -outline-offset-1 rounded-lg", children: [
|
|
114
|
+
!s && /* @__PURE__ */ o("div", { className: "absolute top-2 right-2 cursor-pointer bg-white/70 rounded-[4px] p-1 shadow-sm", onClick: c, children: /* @__PURE__ */ o(U, { size: 16, strokeWidth: 2, color: "black" }) }),
|
|
115
|
+
/* @__PURE__ */ o(
|
|
85
116
|
"img",
|
|
86
117
|
{
|
|
87
118
|
src: l,
|
|
88
|
-
alt:
|
|
119
|
+
alt: g?.toString(),
|
|
89
120
|
className: "w-full h-full object-cover rounded-lg"
|
|
90
121
|
}
|
|
91
122
|
)
|
|
92
|
-
] }) :
|
|
93
|
-
!
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */
|
|
123
|
+
] }) : d ? null : /* @__PURE__ */ a("div", { className: "relative w-full h-64 sm:h-80 md:h-96 overflow-hidden outline-[#E4E4E7] outline-2 outline-dashed -outline-offset-1 rounded-lg", children: [
|
|
124
|
+
!s && /* @__PURE__ */ o("div", { className: "absolute top-2 right-2 cursor-pointer bg-white/70 rounded-[4px] p-1 shadow-sm", onClick: c, children: /* @__PURE__ */ o(U, { size: 16, strokeWidth: 2, color: "black" }) }),
|
|
125
|
+
/* @__PURE__ */ a("div", { className: "w-full h-full flex flex-col items-center justify-center text-gray-600", children: [
|
|
126
|
+
/* @__PURE__ */ o(M, { size: 28 }),
|
|
127
|
+
/* @__PURE__ */ o("span", { className: "text-sm mt-2 break-all px-2 text-center", children: g?.toString() })
|
|
97
128
|
] })
|
|
98
129
|
] }),
|
|
99
|
-
|
|
130
|
+
d && !t && /* @__PURE__ */ a(
|
|
100
131
|
"div",
|
|
101
132
|
{
|
|
102
133
|
className: "mt-2 w-full h-auto min-h-14 rounded-[8px] border border-[#E8E9EB] bg-[#FCFCFC] p-2 flex items-center gap-4",
|
|
103
|
-
onClick: (
|
|
134
|
+
onClick: (r) => r.stopPropagation(),
|
|
104
135
|
children: [
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ o("div", { className: "size-10 rounded-[8px] bg-[#9368FF1F] flex items-center justify-center shrink-0", children: /* @__PURE__ */ o(V, { className: "size-6 text-[#06080D]" }) }),
|
|
137
|
+
/* @__PURE__ */ a("div", { className: "flex flex-col items-start text-left gap-1 min-w-0 flex-1 justify-start", children: [
|
|
138
|
+
/* @__PURE__ */ o("span", { className: "w-full text-[14px] font-semibold leading-[125%] text-[#06080D] truncate text-left", children: g?.toString() }),
|
|
139
|
+
/* @__PURE__ */ o("span", { className: "w-full text-[12px] font-medium leading-[120%] text-[#363B4E] text-left", children: E })
|
|
109
140
|
] }),
|
|
110
|
-
!
|
|
111
|
-
|
|
141
|
+
!s && /* @__PURE__ */ o(
|
|
142
|
+
q,
|
|
112
143
|
{
|
|
113
144
|
type: "button",
|
|
114
145
|
color: "secondary",
|
|
115
|
-
startAdornment:
|
|
146
|
+
startAdornment: B,
|
|
116
147
|
size: "md",
|
|
117
|
-
onClick: (
|
|
118
|
-
|
|
148
|
+
onClick: (r) => {
|
|
149
|
+
r.stopPropagation(), h?.(r);
|
|
119
150
|
},
|
|
120
|
-
children:
|
|
151
|
+
children: f
|
|
121
152
|
}
|
|
122
153
|
),
|
|
123
|
-
!
|
|
124
|
-
|
|
154
|
+
!s && /* @__PURE__ */ o(
|
|
155
|
+
A,
|
|
125
156
|
{
|
|
126
|
-
icon:
|
|
157
|
+
icon: D,
|
|
127
158
|
variant: "outlined",
|
|
128
159
|
size: "md",
|
|
129
160
|
color: "secondary",
|
|
130
|
-
onClick:
|
|
161
|
+
onClick: c
|
|
131
162
|
}
|
|
132
163
|
)
|
|
133
164
|
]
|
|
@@ -136,7 +167,7 @@ const R = (e) => {
|
|
|
136
167
|
] });
|
|
137
168
|
};
|
|
138
169
|
export {
|
|
139
|
-
|
|
140
|
-
|
|
170
|
+
ie as DropzoneSinglePickPreview,
|
|
171
|
+
J as transformImageToSrc
|
|
141
172
|
};
|
|
142
173
|
//# sourceMappingURL=DropzoneSinglePickPreview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropzoneSinglePickPreview.js","sources":["../../src/Dropzone/DropzoneSinglePickPreview.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react';\r\nimport { DropzoneValueItem } from './Dropzone.types';\r\nimport { isFile, isVideoUrl } from './DropzoneUtils';\r\nimport { FileIcon, PencilIcon, Trash2, Video, X } from 'lucide-react';\r\nimport { MediaPlayer, MediaProvider } from '@vidstack/react';\r\nimport { defaultLayoutIcons, DefaultVideoLayout } from '@vidstack/react/player/layouts/default';\r\nimport { Button } from '../Button/Button';\r\n\r\nimport '@vidstack/react/player/styles/base.css';\r\nimport '@vidstack/react/player/styles/default/theme.css';\r\nimport '@vidstack/react/player/styles/default/layouts/video.css';\r\nimport './DropzoneSinglePickPreview.css';\r\nimport { ButtonIcon } from \"../ButtonIcon\";\r\n\r\nexport const transformImageToSrc = (preview?: string | File | null): string => {\r\n if (!preview) return '';\r\n switch (true) {\r\n case typeof preview === 'string' && !!preview.trim() && preview !== 'null':\r\n return preview;\r\n case preview instanceof File:\r\n return URL.createObjectURL(preview);\r\n case preview instanceof FileList:\r\n return preview[0] ? URL.createObjectURL(preview[0]) : '';\r\n default:\r\n return '';\r\n }\r\n};\r\n\r\nconst isYoutubeUrl = (value?: string | null) => {\r\n if (!value) return false;\r\n try {\r\n const url = new URL(value);\r\n const hostname = url.hostname.toLowerCase();\r\n return hostname.includes('youtube.com') || hostname.includes('youtu.be');\r\n } catch {\r\n return false;\r\n }\r\n};\r\n\r\nconst extractYoutubeId = (value: string) => {\r\n try {\r\n const url = new URL(value);\r\n const hostname = url.hostname.toLowerCase();\r\n\r\n if (hostname.includes('youtu.be')) {\r\n return url.pathname.replace('/', '').trim();\r\n }\r\n\r\n const searchId = url.searchParams.get('v');\r\n if (searchId) return searchId.trim();\r\n\r\n const pathParts = url.pathname.split('/').filter(Boolean);\r\n const embedIndex = pathParts.findIndex((part) => part === 'embed');\r\n if (embedIndex >= 0 && pathParts[embedIndex + 1]) {\r\n return pathParts[embedIndex + 1].trim();\r\n }\r\n\r\n return '';\r\n } catch {\r\n return '';\r\n }\r\n};\r\n\r\ninterface SinglePickPreviewProps {\r\n item: DropzoneValueItem;\r\n disabled?: boolean;\r\n onRemoveClick: (e: React.MouseEvent<HTMLElement>) => void;\r\n onReplaceClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;\r\n labelUploaded?: string;\r\n labelReplace?: string;\r\n}\r\n\r\nexport const DropzoneSinglePickPreview = ({\r\n item,\r\n disabled,\r\n onRemoveClick,\r\n onReplaceClick,\r\n labelReplace = 'Замінити',\r\n}: SinglePickPreviewProps) => {\r\n const [previewUrl, setPreviewUrl] = useState('');\r\n const isFileType = isFile(item);\r\n const fileName = isFileType ? item.name : item;\r\n\r\n const isYoutubeVideo = useMemo(\r\n () => typeof item === 'string' && isYoutubeUrl(item),\r\n [item]\r\n );\r\n const isRemoteVideo = useMemo(\r\n () => typeof item === 'string' && !isYoutubeVideo && isVideoUrl(item),\r\n [item, isYoutubeVideo]\r\n );\r\n const youtubeSource = useMemo(() => {\r\n if (!isYoutubeVideo || typeof item !== 'string') return '';\r\n const id = extractYoutubeId(item);\r\n return id ? `youtube/${id}` : item;\r\n }, [isYoutubeVideo, item]);\r\n\r\n const showImage = useMemo(() => {\r\n return (isFileType && item.type?.includes('image')) || (typeof item === 'string' && !isYoutubeVideo && !isRemoteVideo);\r\n }, [item, isFileType, isYoutubeVideo, isRemoteVideo]);\r\n\r\n const showVideo = useMemo(() => {\r\n return (isFileType && item.type?.includes('video')) || isYoutubeVideo || isRemoteVideo;\r\n }, [item, isFileType, isYoutubeVideo, isRemoteVideo]);\r\n\r\n const fileSize = useMemo(() => {\r\n if (!isFileType) return '';\r\n return `${(item.size / (1024 * 1024)).toFixed(0)} MB`;\r\n }, [item, isFileType]);\r\n\r\n useEffect(() => {\r\n if (showImage || showVideo) {\r\n const nextPreview = transformImageToSrc(item);\r\n setPreviewUrl(nextPreview);\r\n\r\n if (isFileType && nextPreview) {\r\n return () => URL.revokeObjectURL(nextPreview);\r\n }\r\n } else {\r\n setPreviewUrl('');\r\n }\r\n\r\n return undefined;\r\n }, [item, isFileType, showImage, showVideo]);\r\n\r\n return (\r\n <div className=\"relative w-full overflow-hidden\">\r\n {showVideo && previewUrl ? (\r\n <div className=\"w-full h-64 sm:h-80 md:h-96 rounded-lg overflow-hidden bg-black\" onClick={(event) => event.stopPropagation()}>\r\n <MediaPlayer\r\n src={isYoutubeVideo ? youtubeSource : { src: previewUrl, type: isFileType ? (item as File).type : undefined }}\r\n className={`h-full w-full bg-black text-white ${\r\n isYoutubeVideo ? 'dropzone-youtube-player' : ''\r\n }`}\r\n playsInline\r\n >\r\n <MediaProvider />\r\n <DefaultVideoLayout icons={defaultLayoutIcons} />\r\n </MediaPlayer>\r\n </div>\r\n ) : !showVideo && previewUrl ? (\r\n <div className=\"relative w-full h-64 sm:h-80 md:h-96 overflow-hidden outline-[#E4E4E7] outline-2 outline-dashed -outline-offset-1 rounded-lg\">\r\n {!disabled && (\r\n <div className=\"absolute top-2 right-2 cursor-pointer bg-white/70 rounded-[4px] p-1 shadow-sm\" onClick={onRemoveClick} >\r\n <X size={16} strokeWidth={2} color=\"black\" />\r\n </div>\r\n )}\r\n <img\r\n src={previewUrl}\r\n alt={fileName?.toString()}\r\n className=\"w-full h-full object-cover rounded-lg\"\r\n />\r\n </div>\r\n ) : !showVideo ? (\r\n <div className=\"relative w-full h-64 sm:h-80 md:h-96 overflow-hidden outline-[#E4E4E7] outline-2 outline-dashed -outline-offset-1 rounded-lg\">\r\n {!disabled && (\r\n <div className=\"absolute top-2 right-2 cursor-pointer bg-white/70 rounded-[4px] p-1 shadow-sm\" onClick={onRemoveClick} >\r\n <X size={16} strokeWidth={2} color=\"black\" />\r\n </div>\r\n )}\r\n <div className=\"w-full h-full flex flex-col items-center justify-center text-gray-600\">\r\n <FileIcon size={28} />\r\n <span className=\"text-sm mt-2 break-all px-2 text-center\">\r\n {fileName?.toString()}\r\n </span>\r\n </div>\r\n </div>\r\n ) : null}\r\n\r\n {showVideo && !isYoutubeVideo && (\r\n <div\r\n className=\"mt-2 w-full h-auto min-h-14 rounded-[8px] border border-[#E8E9EB] bg-[#FCFCFC] p-2 flex items-center gap-4\"\r\n onClick={(event) => event.stopPropagation()}\r\n >\r\n <div className=\"size-10 rounded-[8px] bg-[#9368FF1F] flex items-center justify-center shrink-0\">\r\n <Video className=\"size-6 text-[#06080D]\" />\r\n </div>\r\n\r\n <div className=\"flex flex-col items-start text-left gap-1 min-w-0 flex-1 justify-start\">\r\n <span className=\"w-full text-[14px] font-semibold leading-[125%] text-[#06080D] truncate text-left\">\r\n {fileName?.toString()}\r\n </span>\r\n <span className=\"w-full text-[12px] font-medium leading-[120%] text-[#363B4E] text-left\">\r\n {fileSize}\r\n </span>\r\n </div>\r\n\r\n {!disabled && (\r\n <Button\r\n type=\"button\"\r\n color=\"secondary\"\r\n startAdornment={PencilIcon}\r\n size=\"md\"\r\n onClick={(event) => {\r\n event.stopPropagation();\r\n onReplaceClick?.(event);\r\n }}\r\n >\r\n {labelReplace}\r\n </Button>\r\n )}\r\n\r\n {!disabled && (\r\n <ButtonIcon\r\n icon={Trash2}\r\n variant=\"outlined\"\r\n size=\"md\"\r\n color=\"secondary\"\r\n onClick={onRemoveClick}\r\n />\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n );\r\n};\r\n"],"names":["transformImageToSrc","preview","isYoutubeUrl","value","hostname","extractYoutubeId","url","searchId","pathParts","embedIndex","part","DropzoneSinglePickPreview","item","disabled","onRemoveClick","onReplaceClick","labelReplace","previewUrl","setPreviewUrl","useState","isFileType","isFile","fileName","isYoutubeVideo","useMemo","isRemoteVideo","isVideoUrl","youtubeSource","id","showImage","showVideo","fileSize","useEffect","nextPreview","jsxs","jsx","event","MediaPlayer","MediaProvider","DefaultVideoLayout","defaultLayoutIcons","X","FileIcon","Video","Button","PencilIcon","ButtonIcon","Trash2"],"mappings":";;;;;;;;;;;;AAcO,MAAMA,IAAsB,CAACC,MAA2C;AAC7E,MAAI,CAACA,EAAS,QAAO;AACrB,UAAQ,IAAA;AAAA,IACN,MAAK,OAAOA,KAAY,YAAY,CAAC,CAACA,EAAQ,KAAA,KAAUA,MAAY;AAClE,aAAOA;AAAA,IACT,KAAKA,aAAmB;AACtB,aAAO,IAAI,gBAAgBA,CAAO;AAAA,IACpC,KAAKA,aAAmB;AACtB,aAAOA,EAAQ,CAAC,IAAI,IAAI,gBAAgBA,EAAQ,CAAC,CAAC,IAAI;AAAA,IACxD;AACE,aAAO;AAAA,EAAA;AAEb,GAEMC,IAAe,CAACC,MAA0B;AAC9C,MAAI,CAACA,EAAO,QAAO;AACnB,MAAI;AAEF,UAAMC,IADM,IAAI,IAAID,CAAK,EACJ,SAAS,YAAA;AAC9B,WAAOC,EAAS,SAAS,aAAa,KAAKA,EAAS,SAAS,UAAU;AAAA,EACzE,QAAQ;AACN,WAAO;AAAA,EACT;AACF,GAEMC,IAAmB,CAACF,MAAkB;AAC1C,MAAI;AACF,UAAMG,IAAM,IAAI,IAAIH,CAAK;AAGzB,QAFiBG,EAAI,SAAS,YAAA,EAEjB,SAAS,UAAU;AAC9B,aAAOA,EAAI,SAAS,QAAQ,KAAK,EAAE,EAAE,KAAA;AAGvC,UAAMC,IAAWD,EAAI,aAAa,IAAI,GAAG;AACzC,QAAIC,EAAU,QAAOA,EAAS,KAAA;AAE9B,UAAMC,IAAYF,EAAI,SAAS,MAAM,GAAG,EAAE,OAAO,OAAO,GAClDG,IAAaD,EAAU,UAAU,CAACE,MAASA,MAAS,OAAO;AACjE,WAAID,KAAc,KAAKD,EAAUC,IAAa,CAAC,IACtCD,EAAUC,IAAa,CAAC,EAAE,KAAA,IAG5B;AAAA,EACT,QAAQ;AACN,WAAO;AA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../../src/Dropzone/DropzoneSinglePickPreview.tsx"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from 'react';\r\nimport { DropzoneValueItem } from './Dropzone.types';\r\nimport { isFile, isVideoUrl } from './DropzoneUtils';\r\nimport { FileIcon, PencilIcon, Trash2, Video, X } from 'lucide-react';\r\nimport { MediaPlayer, type MediaPlayerInstance, MediaProvider, Poster } from '@vidstack/react';\r\nimport { defaultLayoutIcons, DefaultVideoLayout } from '@vidstack/react/player/layouts/default';\r\nimport { Button } from '../Button/Button';\r\n\r\nimport '@vidstack/react/player/styles/base.css';\r\nimport '@vidstack/react/player/styles/default/theme.css';\r\nimport '@vidstack/react/player/styles/default/layouts/video.css';\r\nimport './DropzoneSinglePickPreview.css';\r\nimport { ButtonIcon } from \"../ButtonIcon\";\r\n\r\nexport const transformImageToSrc = (preview?: string | File | null): string => {\r\n if (!preview) return '';\r\n switch (true) {\r\n case typeof preview === 'string' && !!preview.trim() && preview !== 'null':\r\n return preview;\r\n case preview instanceof File:\r\n return URL.createObjectURL(preview);\r\n case preview instanceof FileList:\r\n return preview[0] ? URL.createObjectURL(preview[0]) : '';\r\n default:\r\n return '';\r\n }\r\n};\r\n\r\nconst isYoutubeUrl = (value?: string | null) => {\r\n if (!value) return false;\r\n try {\r\n const url = new URL(value);\r\n const hostname = url.hostname.toLowerCase();\r\n return hostname.includes('youtube.com') || hostname.includes('youtu.be');\r\n } catch {\r\n return false;\r\n }\r\n};\r\n\r\nconst extractYoutubeId = (value: string) => {\r\n try {\r\n const url = new URL(value);\r\n const hostname = url.hostname.toLowerCase();\r\n\r\n if (hostname.includes('youtu.be')) {\r\n return url.pathname.replace('/', '').trim();\r\n }\r\n\r\n const searchId = url.searchParams.get('v');\r\n if (searchId) return searchId.trim();\r\n\r\n const pathParts = url.pathname.split('/').filter(Boolean);\r\n const embedIndex = pathParts.findIndex((part) => part === 'embed');\r\n if (embedIndex >= 0 && pathParts[embedIndex + 1]) {\r\n return pathParts[embedIndex + 1].trim();\r\n }\r\n\r\n return '';\r\n } catch {\r\n return '';\r\n }\r\n};\r\n\r\ninterface SinglePickPreviewProps {\r\n item: DropzoneValueItem;\r\n disabled?: boolean;\r\n onRemoveClick: (e: React.MouseEvent<HTMLElement>) => void;\r\n onReplaceClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;\r\n labelUploaded?: string;\r\n labelReplace?: string;\r\n}\r\n\r\nexport const DropzoneSinglePickPreview = ({\r\n item,\r\n disabled,\r\n onRemoveClick,\r\n onReplaceClick,\r\n labelReplace = 'Замінити',\r\n}: SinglePickPreviewProps) => {\r\n const [previewUrl, setPreviewUrl] = useState('');\r\n const isFileType = isFile(item);\r\n const fileName = isFileType ? item.name : item;\r\n\r\n const isYoutubeVideo = useMemo(\r\n () => typeof item === 'string' && isYoutubeUrl(item),\r\n [item]\r\n );\r\n const isRemoteVideo = useMemo(\r\n () => typeof item === 'string' && !isYoutubeVideo && isVideoUrl(item),\r\n [item, isYoutubeVideo]\r\n );\r\n const youtubeId = useMemo(\r\n () => (isYoutubeVideo && typeof item === 'string' ? extractYoutubeId(item) : ''),\r\n [isYoutubeVideo, item]\r\n );\r\n const youtubeSource = useMemo(() => {\r\n if (!isYoutubeVideo || typeof item !== 'string') return '';\r\n return youtubeId ? `youtube/${youtubeId}` : item;\r\n }, [isYoutubeVideo, item, youtubeId]);\r\n const youtubeThumbnail = useMemo(\r\n () => (youtubeId ? `https://img.youtube.com/vi/${youtubeId}/hqdefault.jpg` : undefined),\r\n [youtubeId]\r\n );\r\n const [youtubeStarted, setYoutubeStarted] = useState(false);\r\n const [showPoster, setShowPoster] = useState(true);\r\n const mediaPlayerRef = useRef<MediaPlayerInstance>(null);\r\n const lastMuteStateRef = useRef<boolean | null>(null);\r\n\r\n useEffect(() => {\r\n setYoutubeStarted(false);\r\n setShowPoster(true);\r\n }, [youtubeSource]);\r\n\r\n const showImage = useMemo(() => {\r\n return (isFileType && item.type?.includes('image')) || (typeof item === 'string' && !isYoutubeVideo && !isRemoteVideo);\r\n }, [item, isFileType, isYoutubeVideo, isRemoteVideo]);\r\n\r\n const showVideo = useMemo(() => {\r\n return (isFileType && item.type?.includes('video')) || isYoutubeVideo || isRemoteVideo;\r\n }, [item, isFileType, isYoutubeVideo, isRemoteVideo]);\r\n\r\n const fileSize = useMemo(() => {\r\n if (!isFileType) return '';\r\n return `${(item.size / (1024 * 1024)).toFixed(0)} MB`;\r\n }, [item, isFileType]);\r\n\r\n useEffect(() => {\r\n if (showImage || showVideo) {\r\n const nextPreview = transformImageToSrc(item);\r\n setPreviewUrl(nextPreview);\r\n\r\n if (isFileType && nextPreview) {\r\n return () => URL.revokeObjectURL(nextPreview);\r\n }\r\n } else {\r\n setPreviewUrl('');\r\n }\r\n\r\n return undefined;\r\n }, [item, isFileType, showImage, showVideo]);\r\n\r\n return (\r\n <div className=\"relative w-full overflow-hidden\">\r\n {showVideo && previewUrl ? (\r\n <div className=\"w-full rounded-lg overflow-hidden bg-black\" onClick={(event) => event.stopPropagation()}>\r\n <div className=\"aspect-video\">\r\n <MediaPlayer\r\n ref={mediaPlayerRef}\r\n title={isFileType ? (item as File).name : isYoutubeVideo ? undefined : (typeof item === 'string' ? item : undefined)}\r\n src={isYoutubeVideo ? youtubeSource : { src: previewUrl, type: isFileType ? (item as File).type : undefined }}\r\n poster={isYoutubeVideo ? youtubeThumbnail : undefined}\r\n className={`h-full w-full bg-black text-white ${\r\n isYoutubeVideo && youtubeStarted ? 'dropzone-youtube-player' : ''\r\n }`}\r\n playsInline\r\n onPlay={() => {\r\n setShowPoster(false);\r\n if (isYoutubeVideo) setYoutubeStarted(true);\r\n }}\r\n onVolumeChange={(detail) => {\r\n if (!isYoutubeVideo) return;\r\n const shouldMute = detail.volume === 0 || detail.muted;\r\n if (lastMuteStateRef.current === shouldMute) return;\r\n lastMuteStateRef.current = shouldMute;\r\n const iframe = mediaPlayerRef.current?.el?.querySelector('iframe') as HTMLIFrameElement | null;\r\n if (!iframe?.contentWindow) return;\r\n iframe.contentWindow.postMessage(\r\n JSON.stringify({ event: 'command', func: shouldMute ? 'mute' : 'unMute', args: [] }),\r\n '*'\r\n );\r\n }}\r\n >\r\n <MediaProvider />\r\n {showPoster && isYoutubeVideo && youtubeThumbnail && (\r\n <Poster\r\n className=\"absolute inset-0 h-full w-full object-cover\"\r\n src={youtubeThumbnail}\r\n alt={typeof item === 'string' ? item : ''}\r\n />\r\n )}\r\n <DefaultVideoLayout icons={defaultLayoutIcons} />\r\n </MediaPlayer>\r\n </div>\r\n </div>\r\n ) : !showVideo && previewUrl ? (\r\n <div className=\"relative w-full h-64 sm:h-80 md:h-96 overflow-hidden outline-[#E4E4E7] outline-2 outline-dashed -outline-offset-1 rounded-lg\">\r\n {!disabled && (\r\n <div className=\"absolute top-2 right-2 cursor-pointer bg-white/70 rounded-[4px] p-1 shadow-sm\" onClick={onRemoveClick} >\r\n <X size={16} strokeWidth={2} color=\"black\" />\r\n </div>\r\n )}\r\n <img\r\n src={previewUrl}\r\n alt={fileName?.toString()}\r\n className=\"w-full h-full object-cover rounded-lg\"\r\n />\r\n </div>\r\n ) : !showVideo ? (\r\n <div className=\"relative w-full h-64 sm:h-80 md:h-96 overflow-hidden outline-[#E4E4E7] outline-2 outline-dashed -outline-offset-1 rounded-lg\">\r\n {!disabled && (\r\n <div className=\"absolute top-2 right-2 cursor-pointer bg-white/70 rounded-[4px] p-1 shadow-sm\" onClick={onRemoveClick} >\r\n <X size={16} strokeWidth={2} color=\"black\" />\r\n </div>\r\n )}\r\n <div className=\"w-full h-full flex flex-col items-center justify-center text-gray-600\">\r\n <FileIcon size={28} />\r\n <span className=\"text-sm mt-2 break-all px-2 text-center\">\r\n {fileName?.toString()}\r\n </span>\r\n </div>\r\n </div>\r\n ) : null}\r\n\r\n {showVideo && !isYoutubeVideo && (\r\n <div\r\n className=\"mt-2 w-full h-auto min-h-14 rounded-[8px] border border-[#E8E9EB] bg-[#FCFCFC] p-2 flex items-center gap-4\"\r\n onClick={(event) => event.stopPropagation()}\r\n >\r\n <div className=\"size-10 rounded-[8px] bg-[#9368FF1F] flex items-center justify-center shrink-0\">\r\n <Video className=\"size-6 text-[#06080D]\" />\r\n </div>\r\n\r\n <div className=\"flex flex-col items-start text-left gap-1 min-w-0 flex-1 justify-start\">\r\n <span className=\"w-full text-[14px] font-semibold leading-[125%] text-[#06080D] truncate text-left\">\r\n {fileName?.toString()}\r\n </span>\r\n <span className=\"w-full text-[12px] font-medium leading-[120%] text-[#363B4E] text-left\">\r\n {fileSize}\r\n </span>\r\n </div>\r\n\r\n {!disabled && (\r\n <Button\r\n type=\"button\"\r\n color=\"secondary\"\r\n startAdornment={PencilIcon}\r\n size=\"md\"\r\n onClick={(event) => {\r\n event.stopPropagation();\r\n onReplaceClick?.(event);\r\n }}\r\n >\r\n {labelReplace}\r\n </Button>\r\n )}\r\n\r\n {!disabled && (\r\n <ButtonIcon\r\n icon={Trash2}\r\n variant=\"outlined\"\r\n size=\"md\"\r\n color=\"secondary\"\r\n onClick={onRemoveClick}\r\n />\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n );\r\n};\r\n"],"names":["transformImageToSrc","preview","isYoutubeUrl","value","hostname","extractYoutubeId","url","searchId","pathParts","embedIndex","part","DropzoneSinglePickPreview","item","disabled","onRemoveClick","onReplaceClick","labelReplace","previewUrl","setPreviewUrl","useState","isFileType","isFile","fileName","isYoutubeVideo","useMemo","isRemoteVideo","isVideoUrl","youtubeId","youtubeSource","youtubeThumbnail","youtubeStarted","setYoutubeStarted","showPoster","setShowPoster","mediaPlayerRef","useRef","lastMuteStateRef","useEffect","showImage","showVideo","fileSize","nextPreview","jsxs","jsx","event","MediaPlayer","detail","shouldMute","iframe","MediaProvider","Poster","DefaultVideoLayout","defaultLayoutIcons","X","FileIcon","Video","Button","PencilIcon","ButtonIcon","Trash2"],"mappings":";;;;;;;;;;;;AAcO,MAAMA,IAAsB,CAACC,MAA2C;AAC7E,MAAI,CAACA,EAAS,QAAO;AACrB,UAAQ,IAAA;AAAA,IACN,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AAU,2CACb,UAAAhC,GAAU,WAAS,CACtB;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,IAGDiB,KAAa,CAAChB,KACb,gBAAAmB;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,SAAS,CAACE,MAAUA,EAAM,gBAAA;AAAA,QAE1B,UAAA;AAAA,UAAA,gBAAAD,EAAC,SAAI,WAAU,kFACb,4BAACY,GAAA,EAAM,WAAU,yBAAwB,EAAA,CAC3C;AAAA,UAEA,gBAAAb,EAAC,OAAA,EAAI,WAAU,0EACb,UAAA;AAAA,YAAA,gBAAAC,EAAC,QAAA,EAAK,WAAU,qFACb,UAAArB,GAAU,YACb;AAAA,YACA,gBAAAqB,EAAC,QAAA,EAAK,WAAU,0EACb,UAAAH,EAAA,CACH;AAAA,UAAA,GACF;AAAA,UAEC,CAAC3B,KACA,gBAAA8B;AAAA,YAACa;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,OAAM;AAAA,cACN,gBAAgBC;AAAA,cAChB,MAAK;AAAA,cACL,SAAS,CAACb,MAAU;AAClB,gBAAAA,EAAM,gBAAA,GACN7B,IAAiB6B,CAAK;AAAA,cACxB;AAAA,cAEC,UAAA5B;AAAA,YAAA;AAAA,UAAA;AAAA,UAIJ,CAACH,KACA,gBAAA8B;AAAA,YAACe;AAAA,YAAA;AAAA,cACC,MAAMC;AAAA,cACN,SAAQ;AAAA,cACR,MAAK;AAAA,cACL,OAAM;AAAA,cACN,SAAS7C;AAAA,YAAA;AAAA,UAAA;AAAA,QACX;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ,GAEJ;AAEJ;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneplatformdev/ui",
|
|
3
|
-
"version": "0.1.99-beta.
|
|
3
|
+
"version": "0.1.99-beta.280",
|
|
4
4
|
"description": "UI component library for OnePlatform",
|
|
5
5
|
"author": "One Platform Development Team",
|
|
6
6
|
"keywords": [
|
|
@@ -109,9 +109,9 @@
|
|
|
109
109
|
"recharts": "^3.2.0",
|
|
110
110
|
"sonner": "^2.0.7",
|
|
111
111
|
"vaul": "^1.1.2",
|
|
112
|
-
"@oneplatformdev/tokens": "^0.1.99-beta.
|
|
113
|
-
"@oneplatformdev/
|
|
114
|
-
"@oneplatformdev/
|
|
112
|
+
"@oneplatformdev/tokens": "^0.1.99-beta.280",
|
|
113
|
+
"@oneplatformdev/hooks": "^0.1.99-beta.280",
|
|
114
|
+
"@oneplatformdev/utils": "^0.1.99-beta.280"
|
|
115
115
|
},
|
|
116
116
|
"scripts": {
|
|
117
117
|
"chromatic": "chromatic"
|