wimui 0.51.1 → 0.51.2
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/components/ai/ChatUI/ChatUI.cjs +1 -1
- package/dist/components/ai/ChatUI/ChatUI.js +10 -10
- package/dist/components/ai/ModelSelector/ModelSelector.cjs +1 -1
- package/dist/components/ai/ModelSelector/ModelSelector.js +121 -120
- package/dist/components/ai/ThreadList/ThreadList.cjs +1 -1
- package/dist/components/ai/ThreadList/ThreadList.js +63 -62
- package/dist/components/data-display/Accordion/accordion.module.cjs +1 -1
- package/dist/components/data-display/Accordion/accordion.module.js +1 -1
- package/dist/components/data-display/Carousel/Carousel.cjs +1 -1
- package/dist/components/data-display/Carousel/Carousel.js +46 -46
- package/dist/components/data-display/NodeGraph/NodeGraph.cjs +1 -1
- package/dist/components/data-display/NodeGraph/NodeGraph.js +48 -48
- package/dist/components/data-display/ScheduleView/ScheduleView.cjs +1 -1
- package/dist/components/data-display/ScheduleView/ScheduleView.js +49 -48
- package/dist/components/feedback/Tour/Tour.cjs +1 -1
- package/dist/components/feedback/Tour/Tour.js +125 -100
- package/dist/components/form/OtpInput/otp-input.module.cjs +1 -1
- package/dist/components/form/OtpInput/otp-input.module.js +1 -1
- package/dist/components/form/RangeSlider/RangeSlider.cjs +1 -1
- package/dist/components/form/RangeSlider/RangeSlider.js +116 -115
- package/dist/components/form/RangeSlider/range-slider.module.cjs +1 -1
- package/dist/components/form/RangeSlider/range-slider.module.js +1 -1
- package/dist/components/form/ThemeToggle/ThemeToggle.cjs +1 -1
- package/dist/components/form/ThemeToggle/ThemeToggle.js +66 -65
- package/dist/components/form/Transfer/Transfer.cjs +1 -1
- package/dist/components/form/Transfer/Transfer.d.ts +1 -1
- package/dist/components/form/Transfer/Transfer.js +104 -104
- package/dist/components/form/Transfer/transfer.module.cjs +1 -1
- package/dist/components/form/Transfer/transfer.module.js +6 -6
- package/dist/components/media/Audio/Audio.cjs +1 -1
- package/dist/components/media/Audio/Audio.js +45 -45
- package/dist/components/media/Audio/components/AudioCustomControls.cjs +1 -1
- package/dist/components/media/Audio/components/AudioCustomControls.js +113 -112
- package/dist/components/media/ImageCompare/ImageCompare.cjs +1 -1
- package/dist/components/media/ImageCompare/ImageCompare.js +73 -72
- package/dist/components/media/Video/Video.cjs +1 -1
- package/dist/components/media/Video/Video.js +36 -35
- package/dist/components/media/Video/components/VideoAdvancedMenu.cjs +1 -1
- package/dist/components/media/Video/components/VideoAdvancedMenu.js +138 -137
- package/dist/components/navigation/Tabs/tabs.module.cjs +1 -1
- package/dist/components/navigation/Tabs/tabs.module.js +1 -1
- package/dist/i18n/generated/keys.d.ts +1 -1
- package/dist/i18n/generated/resources.cjs +1 -1
- package/dist/i18n/generated/resources.js +192 -12
- package/dist/llms-full.txt +4 -4
- package/dist/llms.txt +1 -1
- package/dist/locales/en/common.json +53 -4
- package/dist/locales/en/components.json +3 -1
- package/dist/locales/ja/common.json +53 -4
- package/dist/locales/ja/components.json +3 -1
- package/dist/locales/pt/common.json +53 -4
- package/dist/locales/pt/components.json +3 -1
- package/dist/styles.css +2 -2
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +3 -3
- package/package.json +7 -7
|
@@ -1,99 +1,100 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import e from "../../../
|
|
3
|
-
import t from "../../../icon/chevron-
|
|
4
|
-
import
|
|
5
|
-
import r from "
|
|
6
|
-
import i
|
|
7
|
-
import c from "
|
|
8
|
-
import
|
|
2
|
+
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
+
import t from "../../../icon/chevron-left.js";
|
|
4
|
+
import n from "../../../icon/chevron-right.js";
|
|
5
|
+
import { Icon as r } from "../Icon/Icon.js";
|
|
6
|
+
import i from "./image-compare.module.js";
|
|
7
|
+
import a, { useCallback as o, useRef as s, useState as c } from "react";
|
|
8
|
+
import l from "classnames";
|
|
9
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
9
10
|
//#region src/components/media/ImageCompare/ImageCompare.tsx
|
|
10
|
-
var
|
|
11
|
-
let {
|
|
12
|
-
|
|
13
|
-
}, [
|
|
14
|
-
let t =
|
|
15
|
-
|
|
16
|
-
}, [
|
|
17
|
-
let n =
|
|
11
|
+
var f = (e) => Math.max(0, Math.min(100, e)), p = a.forwardRef(({ before: a, after: p, beforeAlt: m = "", afterAlt: h = "", beforeLabel: g, afterLabel: _, defaultPosition: v = 50, position: y, onPositionChange: b, orientation: x = "horizontal", width: S, height: C, radius: w = "md", labels: T, className: E, ...D }, O) => {
|
|
12
|
+
let { t: k } = e("common"), { handleAriaLabel: A = k("imageCompare.handle") } = T ?? {}, j = y !== void 0, [M, N] = c(f(v)), P = f(j ? y : M), F = x === "vertical", I = s(null), L = s(!1), R = o((e) => {
|
|
13
|
+
I.current = e, typeof O == "function" ? O(e) : O && (O.current = e);
|
|
14
|
+
}, [O]), z = o((e) => {
|
|
15
|
+
let t = f(e);
|
|
16
|
+
j || N(t), b?.(t);
|
|
17
|
+
}, [j, b]), B = o((e, t) => {
|
|
18
|
+
let n = I.current?.getBoundingClientRect();
|
|
18
19
|
if (!n) return;
|
|
19
|
-
let r =
|
|
20
|
-
|
|
21
|
-
}, [
|
|
22
|
-
|
|
23
|
-
}, B = (e) => {
|
|
24
|
-
F.current && R(e.clientX, e.clientY);
|
|
25
|
-
}, V = (e) => {
|
|
26
|
-
F.current = !1, e.currentTarget.releasePointerCapture?.(e.pointerId);
|
|
20
|
+
let r = F ? (t - n.top) / n.height * 100 : (e - n.left) / n.width * 100;
|
|
21
|
+
z(r);
|
|
22
|
+
}, [F, z]), V = (e) => {
|
|
23
|
+
L.current = !0, e.currentTarget.setPointerCapture(e.pointerId), B(e.clientX, e.clientY);
|
|
27
24
|
}, H = (e) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
L.current && B(e.clientX, e.clientY);
|
|
26
|
+
}, U = (e) => {
|
|
27
|
+
L.current = !1, e.currentTarget.releasePointerCapture?.(e.pointerId);
|
|
28
|
+
}, W = (e) => {
|
|
29
|
+
let t = e.shiftKey ? 10 : 2, n = F ? "ArrowUp" : "ArrowLeft", r = F ? "ArrowDown" : "ArrowRight";
|
|
30
|
+
e.key === n ? (e.preventDefault(), z(P - t)) : e.key === r ? (e.preventDefault(), z(P + t)) : e.key === "Home" ? (e.preventDefault(), z(0)) : e.key === "End" && (e.preventDefault(), z(100));
|
|
31
|
+
}, G = F ? { clipPath: `inset(0 0 ${100 - P}% 0)` } : { clipPath: `inset(0 ${100 - P}% 0 0)` }, K = F ? { top: `${P}%` } : { left: `${P}%` };
|
|
32
|
+
return /* @__PURE__ */ d("div", {
|
|
33
|
+
ref: R,
|
|
34
|
+
className: l("wim-image-compare", i.root, F && i.vertical, i[`radius-${w}`], E),
|
|
34
35
|
style: {
|
|
35
|
-
width:
|
|
36
|
-
height:
|
|
36
|
+
width: S,
|
|
37
|
+
height: C
|
|
37
38
|
},
|
|
38
|
-
onPointerDown:
|
|
39
|
-
onPointerMove:
|
|
40
|
-
onPointerUp:
|
|
41
|
-
...
|
|
39
|
+
onPointerDown: V,
|
|
40
|
+
onPointerMove: H,
|
|
41
|
+
onPointerUp: U,
|
|
42
|
+
...D,
|
|
42
43
|
children: [
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
className:
|
|
45
|
-
src:
|
|
46
|
-
alt:
|
|
44
|
+
/* @__PURE__ */ u("img", {
|
|
45
|
+
className: i.image,
|
|
46
|
+
src: p,
|
|
47
|
+
alt: h,
|
|
47
48
|
draggable: !1
|
|
48
49
|
}),
|
|
49
|
-
|
|
50
|
-
className:
|
|
51
|
-
children:
|
|
50
|
+
_ && /* @__PURE__ */ u("span", {
|
|
51
|
+
className: l(i.label, i.afterLabel),
|
|
52
|
+
children: _
|
|
52
53
|
}),
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
className:
|
|
55
|
-
style:
|
|
56
|
-
children: [/* @__PURE__ */
|
|
57
|
-
className:
|
|
58
|
-
src:
|
|
59
|
-
alt:
|
|
54
|
+
/* @__PURE__ */ d("div", {
|
|
55
|
+
className: i.beforeLayer,
|
|
56
|
+
style: G,
|
|
57
|
+
children: [/* @__PURE__ */ u("img", {
|
|
58
|
+
className: i.image,
|
|
59
|
+
src: a,
|
|
60
|
+
alt: m,
|
|
60
61
|
draggable: !1
|
|
61
|
-
}),
|
|
62
|
-
className:
|
|
63
|
-
children:
|
|
62
|
+
}), g && /* @__PURE__ */ u("span", {
|
|
63
|
+
className: l(i.label, i.beforeLabel),
|
|
64
|
+
children: g
|
|
64
65
|
})]
|
|
65
66
|
}),
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
className:
|
|
68
|
-
style:
|
|
69
|
-
children: [/* @__PURE__ */
|
|
70
|
-
className:
|
|
67
|
+
/* @__PURE__ */ d("div", {
|
|
68
|
+
className: i.divider,
|
|
69
|
+
style: K,
|
|
70
|
+
children: [/* @__PURE__ */ u("span", {
|
|
71
|
+
className: i.line,
|
|
71
72
|
"aria-hidden": "true"
|
|
72
|
-
}), /* @__PURE__ */
|
|
73
|
+
}), /* @__PURE__ */ d("button", {
|
|
73
74
|
type: "button",
|
|
74
|
-
className:
|
|
75
|
+
className: i.handle,
|
|
75
76
|
role: "slider",
|
|
76
|
-
"aria-label":
|
|
77
|
-
"aria-orientation":
|
|
78
|
-
"aria-valuenow": Math.round(
|
|
77
|
+
"aria-label": A,
|
|
78
|
+
"aria-orientation": x,
|
|
79
|
+
"aria-valuenow": Math.round(P),
|
|
79
80
|
"aria-valuemin": 0,
|
|
80
81
|
"aria-valuemax": 100,
|
|
81
|
-
onKeyDown:
|
|
82
|
-
onPointerDown:
|
|
83
|
-
children: [/* @__PURE__ */
|
|
84
|
-
component: e,
|
|
85
|
-
size: "sm",
|
|
86
|
-
className: r.arrow
|
|
87
|
-
}), /* @__PURE__ */ l(n, {
|
|
82
|
+
onKeyDown: W,
|
|
83
|
+
onPointerDown: V,
|
|
84
|
+
children: [/* @__PURE__ */ u(r, {
|
|
88
85
|
component: t,
|
|
89
86
|
size: "sm",
|
|
90
|
-
className:
|
|
87
|
+
className: i.arrow
|
|
88
|
+
}), /* @__PURE__ */ u(r, {
|
|
89
|
+
component: n,
|
|
90
|
+
size: "sm",
|
|
91
|
+
className: i.arrow
|
|
91
92
|
})]
|
|
92
93
|
})]
|
|
93
94
|
})
|
|
94
95
|
]
|
|
95
96
|
});
|
|
96
97
|
});
|
|
97
|
-
|
|
98
|
+
p.displayName = "ImageCompare";
|
|
98
99
|
//#endregion
|
|
99
|
-
export {
|
|
100
|
+
export { p as ImageCompare };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../Icon/Icon.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../Icon/Icon.cjs"),ee=require("../../../hooks/useMediaLoader.cjs"),r=require("./hooks/useVideoPlayer.cjs"),i=require("./components/VideoAdvancedMenu.cjs"),a=require("./components/VideoControls.cjs"),o=require("./video.module.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("classnames");c=e.__toESM(c,1);let l=require("react/jsx-runtime");var u=({src:e,width:u,height:te,autoPlay:d=!1,loop:f=!1,muted:p=!1,controls:m=!0,poster:h,radius:g=`none`,shadow:_=!1,border:v=!1,fit:y=`cover`,preload:b,caption:x,className:S,style:C,customControls:w=!1,advancedControls:T=!1,videoId:E,resumePlayback:D=!1,playlist:O,autoPlayNext:k=!1,qualities:A,loading:j=`lazy`,fadeIn:M=!1,demoDelay:N,labels:P={},tracks:F,...I})=>{let{t:L}=t.useWimTranslation(`common`),{videoAriaLabel:R=L(`video.label`),seconds:z=`s`}=P,{containerRef:B,isLoaded:V,isIntersecting:H,notifyLoaded:U,shouldShowSkeleton:W}=ee.useMediaLoader({loading:j,src:A?.[0]?.src||O?.[0]?.src||e,demoDelay:N}),G=r.useVideoPlayer({src:e,autoPlay:d,loop:f,muted:p,fit:y,videoId:E,resumePlayback:D,playlist:O,autoPlayNext:k,qualities:A,customControls:w,advancedControls:T,poster:h,containerRef:B}),{videoRef:K,isPlaying:q,activeSrc:J,activePoster:Y,showNativeControls:X,skipIndicator:Z,activeMenu:Q,setActiveMenu:$}=G;s.default.useEffect(()=>{let e=K.current;e&&(p?e.setAttribute(`muted`,``):e.removeAttribute(`muted`))},[p,K,J,H]);let ne={width:`100%`,height:te||`auto`,objectFit:G.activeFit,...C},re=g===`none`?null:o.default[`radius${g.charAt(0).toUpperCase()+g.slice(1)}`];return(0,l.jsxs)(`figure`,{className:(0,c.default)(`wim-video`,o.default.root,S),style:{width:`100%`},"aria-label":R,"data-testid":`video-root`,children:[(0,l.jsxs)(`div`,{className:(0,c.default)(o.default.inner,re,_&&o.default.shadow,v&&o.default.border,(w||T)&&o.default.custom,M&&o.default.fadeIn,M&&V&&o.default.isLoaded,W&&o.default.loading),ref:B,"data-testid":`video-inner`,children:[H&&(0,l.jsx)(`video`,{ref:K,src:J,className:o.default.video,style:ne,autoPlay:d&&V,loop:f&&(!O||O.length<=1),muted:p,controls:X&&m,poster:Y,preload:b,playsInline:!0,onTimeUpdate:G.handleTimeUpdate,onLoadedMetadata:G.handleLoadedMetadata,onLoadedData:U,onEnded:G.handleEnded,onPlay:()=>{},onPause:()=>{},onClick:G.handleVideoClick,"data-testid":`video-element`,...I,children:F?.map((e,t)=>(0,l.jsx)(`track`,{...e},t))}),Z.show&&(0,l.jsxs)(`div`,{className:o.default.skipIndicator,children:[(0,l.jsx)(n.Icon,{name:Z.direction===`forward`?`ChevronRightIcon`:`ChevronLeftIcon`,size:`lg`}),(0,l.jsx)(n.Icon,{name:Z.direction===`forward`?`ChevronRightIcon`:`ChevronLeftIcon`,size:`lg`}),(0,l.jsx)(n.Icon,{name:Z.direction===`forward`?`ChevronRightIcon`:`ChevronLeftIcon`,size:`lg`}),(0,l.jsxs)(`span`,{children:[`10`,z]})]}),(w||T)&&(0,l.jsxs)(`div`,{role:`none`,className:o.default.customControls,onClick:()=>Q&&$(null),children:[T&&(0,l.jsx)(i.VideoAdvancedMenu,{styles:o.default,activeMenu:Q,setActiveMenu:$,qualities:A,currentQualityIndex:G.currentQualityIndex,handleQualityChange:G.handleQualityChange,playbackRate:G.playbackRate,setPlaybackRate:G.setPlaybackRate,activeFit:G.activeFit,setActiveFit:G.setActiveFit,playlist:O,currentPlayIndex:G.currentPlayIndex,playPlaylistItem:G.playPlaylistItem,labels:P}),(0,l.jsx)(a.VideoControls,{styles:o.default,playlist:O,advancedControls:T,currentPlayIndex:G.currentPlayIndex,setCurrentPlayIndex:G.setCurrentPlayIndex,skip:G.skip,isPlaying:q,togglePlay:G.togglePlay,currentTime:G.currentTime,duration:G.duration,handleSeek:G.handleSeek,volume:G.volume,isMuted:G.isMuted,toggleMute:G.toggleMute,handleVolumeChange:G.handleVolumeChange,activeMenu:Q,setActiveMenu:$,togglePiP:G.togglePiP,isFullscreen:G.isFullscreen,toggleFullscreen:G.toggleFullscreen,formatTime:G.formatTime,labels:P})]})]}),x&&(0,l.jsx)(`figcaption`,{className:o.default.caption,"data-testid":`video-caption`,children:x})]})};exports.Video=u;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
+
import { Icon as t } from "../Icon/Icon.js";
|
|
4
|
+
import { useMediaLoader as n } from "../../../hooks/useMediaLoader.js";
|
|
5
|
+
import { useVideoPlayer as ee } from "./hooks/useVideoPlayer.js";
|
|
5
6
|
import { VideoAdvancedMenu as r } from "./components/VideoAdvancedMenu.js";
|
|
6
7
|
import { VideoControls as i } from "./components/VideoControls.js";
|
|
7
8
|
import a from "./video.module.js";
|
|
@@ -9,24 +10,24 @@ import o from "react";
|
|
|
9
10
|
import s from "classnames";
|
|
10
11
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
11
12
|
//#region src/components/media/Video/Video.tsx
|
|
12
|
-
var u = ({ src: u, width:
|
|
13
|
-
let { videoAriaLabel: R = "
|
|
14
|
-
loading:
|
|
15
|
-
src:
|
|
16
|
-
demoDelay:
|
|
17
|
-
}), G =
|
|
13
|
+
var u = ({ src: u, width: te, height: d, autoPlay: f = !1, loop: p = !1, muted: m = !1, controls: h = !0, poster: g, radius: _ = "none", shadow: v = !1, border: y = !1, fit: b = "cover", preload: x, caption: S, className: C, style: ne, customControls: w = !1, advancedControls: T = !1, videoId: E, resumePlayback: D = !1, playlist: O, autoPlayNext: k = !1, qualities: A, loading: j = "lazy", fadeIn: M = !1, demoDelay: N, labels: P = {}, tracks: F, ...I }) => {
|
|
14
|
+
let { t: L } = e("common"), { videoAriaLabel: R = L("video.label"), seconds: z = "s" } = P, { containerRef: B, isLoaded: V, isIntersecting: H, notifyLoaded: U, shouldShowSkeleton: W } = n({
|
|
15
|
+
loading: j,
|
|
16
|
+
src: A?.[0]?.src || O?.[0]?.src || u,
|
|
17
|
+
demoDelay: N
|
|
18
|
+
}), G = ee({
|
|
18
19
|
src: u,
|
|
19
20
|
autoPlay: f,
|
|
20
21
|
loop: p,
|
|
21
22
|
muted: m,
|
|
22
23
|
fit: b,
|
|
23
|
-
videoId:
|
|
24
|
-
resumePlayback:
|
|
25
|
-
playlist:
|
|
26
|
-
autoPlayNext:
|
|
27
|
-
qualities:
|
|
28
|
-
customControls:
|
|
29
|
-
advancedControls:
|
|
24
|
+
videoId: E,
|
|
25
|
+
resumePlayback: D,
|
|
26
|
+
playlist: O,
|
|
27
|
+
autoPlayNext: k,
|
|
28
|
+
qualities: A,
|
|
29
|
+
customControls: w,
|
|
30
|
+
advancedControls: T,
|
|
30
31
|
poster: g,
|
|
31
32
|
containerRef: B
|
|
32
33
|
}), { videoRef: K, isPlaying: q, activeSrc: J, activePoster: Y, showNativeControls: X, skipIndicator: Z, activeMenu: Q, setActiveMenu: $ } = G;
|
|
@@ -39,19 +40,19 @@ var u = ({ src: u, width: ee, height: d, autoPlay: f = !1, loop: p = !1, muted:
|
|
|
39
40
|
J,
|
|
40
41
|
H
|
|
41
42
|
]);
|
|
42
|
-
let
|
|
43
|
+
let re = {
|
|
43
44
|
width: "100%",
|
|
44
45
|
height: d || "auto",
|
|
45
46
|
objectFit: G.activeFit,
|
|
46
|
-
...
|
|
47
|
-
},
|
|
47
|
+
...ne
|
|
48
|
+
}, ie = _ === "none" ? null : a[`radius${_.charAt(0).toUpperCase() + _.slice(1)}`];
|
|
48
49
|
return /* @__PURE__ */ l("figure", {
|
|
49
50
|
className: s("wim-video", a.root, C),
|
|
50
51
|
style: { width: "100%" },
|
|
51
52
|
"aria-label": R,
|
|
52
53
|
"data-testid": "video-root",
|
|
53
54
|
children: [/* @__PURE__ */ l("div", {
|
|
54
|
-
className: s(a.inner,
|
|
55
|
+
className: s(a.inner, ie, v && a.shadow, y && a.border, (w || T) && a.custom, M && a.fadeIn, M && V && a.isLoaded, W && a.loading),
|
|
55
56
|
ref: B,
|
|
56
57
|
"data-testid": "video-inner",
|
|
57
58
|
children: [
|
|
@@ -59,9 +60,9 @@ var u = ({ src: u, width: ee, height: d, autoPlay: f = !1, loop: p = !1, muted:
|
|
|
59
60
|
ref: K,
|
|
60
61
|
src: J,
|
|
61
62
|
className: a.video,
|
|
62
|
-
style:
|
|
63
|
+
style: re,
|
|
63
64
|
autoPlay: f && V,
|
|
64
|
-
loop: p && (!
|
|
65
|
+
loop: p && (!O || O.length <= 1),
|
|
65
66
|
muted: m,
|
|
66
67
|
controls: X && h,
|
|
67
68
|
poster: Y,
|
|
@@ -75,50 +76,50 @@ var u = ({ src: u, width: ee, height: d, autoPlay: f = !1, loop: p = !1, muted:
|
|
|
75
76
|
onPause: () => {},
|
|
76
77
|
onClick: G.handleVideoClick,
|
|
77
78
|
"data-testid": "video-element",
|
|
78
|
-
...
|
|
79
|
-
children:
|
|
79
|
+
...I,
|
|
80
|
+
children: F?.map((e, t) => /* @__PURE__ */ c("track", { ...e }, t))
|
|
80
81
|
}),
|
|
81
82
|
Z.show && /* @__PURE__ */ l("div", {
|
|
82
83
|
className: a.skipIndicator,
|
|
83
84
|
children: [
|
|
84
|
-
/* @__PURE__ */ c(
|
|
85
|
+
/* @__PURE__ */ c(t, {
|
|
85
86
|
name: Z.direction === "forward" ? "ChevronRightIcon" : "ChevronLeftIcon",
|
|
86
87
|
size: "lg"
|
|
87
88
|
}),
|
|
88
|
-
/* @__PURE__ */ c(
|
|
89
|
+
/* @__PURE__ */ c(t, {
|
|
89
90
|
name: Z.direction === "forward" ? "ChevronRightIcon" : "ChevronLeftIcon",
|
|
90
91
|
size: "lg"
|
|
91
92
|
}),
|
|
92
|
-
/* @__PURE__ */ c(
|
|
93
|
+
/* @__PURE__ */ c(t, {
|
|
93
94
|
name: Z.direction === "forward" ? "ChevronRightIcon" : "ChevronLeftIcon",
|
|
94
95
|
size: "lg"
|
|
95
96
|
}),
|
|
96
97
|
/* @__PURE__ */ l("span", { children: ["10", z] })
|
|
97
98
|
]
|
|
98
99
|
}),
|
|
99
|
-
(
|
|
100
|
+
(w || T) && /* @__PURE__ */ l("div", {
|
|
100
101
|
role: "none",
|
|
101
102
|
className: a.customControls,
|
|
102
103
|
onClick: () => Q && $(null),
|
|
103
|
-
children: [
|
|
104
|
+
children: [T && /* @__PURE__ */ c(r, {
|
|
104
105
|
styles: a,
|
|
105
106
|
activeMenu: Q,
|
|
106
107
|
setActiveMenu: $,
|
|
107
|
-
qualities:
|
|
108
|
+
qualities: A,
|
|
108
109
|
currentQualityIndex: G.currentQualityIndex,
|
|
109
110
|
handleQualityChange: G.handleQualityChange,
|
|
110
111
|
playbackRate: G.playbackRate,
|
|
111
112
|
setPlaybackRate: G.setPlaybackRate,
|
|
112
113
|
activeFit: G.activeFit,
|
|
113
114
|
setActiveFit: G.setActiveFit,
|
|
114
|
-
playlist:
|
|
115
|
+
playlist: O,
|
|
115
116
|
currentPlayIndex: G.currentPlayIndex,
|
|
116
117
|
playPlaylistItem: G.playPlaylistItem,
|
|
117
|
-
labels:
|
|
118
|
+
labels: P
|
|
118
119
|
}), /* @__PURE__ */ c(i, {
|
|
119
120
|
styles: a,
|
|
120
|
-
playlist:
|
|
121
|
-
advancedControls:
|
|
121
|
+
playlist: O,
|
|
122
|
+
advancedControls: T,
|
|
122
123
|
currentPlayIndex: G.currentPlayIndex,
|
|
123
124
|
setCurrentPlayIndex: G.setCurrentPlayIndex,
|
|
124
125
|
skip: G.skip,
|
|
@@ -137,7 +138,7 @@ var u = ({ src: u, width: ee, height: d, autoPlay: f = !1, loop: p = !1, muted:
|
|
|
137
138
|
isFullscreen: G.isFullscreen,
|
|
138
139
|
toggleFullscreen: G.toggleFullscreen,
|
|
139
140
|
formatTime: G.formatTime,
|
|
140
|
-
labels:
|
|
141
|
+
labels: P
|
|
141
142
|
})]
|
|
142
143
|
})
|
|
143
144
|
]
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../../icon/check.cjs"),
|
|
2
|
+
const e=require("../../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../../i18n/useWimTranslation.cjs"),n=require("../../../../icon/check.cjs"),r=require("../../../../icon/chevron-left.cjs"),i=require("../../../../icon/chevron-right.cjs"),a=require("../../../../icon/close.cjs"),o=require("../../../../icon/play.cjs"),s=require("../../Icon/Icon.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("react/jsx-runtime");var u=[.25,.5,.75,1,1.25,1.5,1.75,2],d=[`contain`,`cover`,`fill`,`scale-down`,`none`];function f({activeMenu:e,setActiveMenu:c,qualities:f,currentQualityIndex:p,handleQualityChange:m,playbackRate:h,setPlaybackRate:g,activeFit:_,setActiveFit:v,playlist:y,currentPlayIndex:b,playPlaylistItem:x,labels:S={},styles:C}){let{t:w}=t.useWimTranslation(`common`),{settings:T=w(`a11y.settings`),quality:E=w(`quality`),playbackRate:D=w(`playback.speed`),aspectRatio:O=w(`aspect.ratio`),standard:k=w(`standard`),playlist:A=w(`a11y.playlist`),contain:j=w(`video.fit_contain`),cover:M=w(`video.fit_cover`),fill:N=w(`video.fit_fill`),scaleDown:P=w(`video.fit_scale_down`),none:F=w(`common.none`)}=S;if(!e)return null;let I=e=>{switch(e){case`contain`:return j;case`cover`:return M;case`fill`:return N;case`scale-down`:return P;case`none`:return F;default:return e}};return(0,l.jsxs)(l.Fragment,{children:[e===`main`&&(0,l.jsxs)(`div`,{className:C.advancedMenu,onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Escape`&&c(null)},role:`menu`,tabIndex:-1,children:[(0,l.jsx)(`div`,{className:C.menuTitle,children:(0,l.jsx)(`span`,{children:T})}),(0,l.jsxs)(`div`,{className:C.menuItems,children:[f&&f.length>0&&(0,l.jsxs)(`button`,{className:C.menuBtn,onClick:()=>c(`quality`),children:[(0,l.jsx)(`span`,{children:E}),(0,l.jsxs)(`span`,{style:{opacity:.7},children:[f[p].label,` `,(0,l.jsx)(s.Icon,{component:i.default,size:`sm`})]})]}),(0,l.jsxs)(`button`,{className:C.menuBtn,onClick:()=>c(`rate`),children:[(0,l.jsx)(`span`,{children:D}),(0,l.jsxs)(`span`,{style:{opacity:.7},children:[h,`x `,(0,l.jsx)(s.Icon,{component:i.default,size:`sm`})]})]}),(0,l.jsxs)(`button`,{className:C.menuBtn,onClick:()=>c(`fit`),children:[(0,l.jsx)(`span`,{children:O}),(0,l.jsxs)(`span`,{style:{opacity:.7},children:[I(_),` `,(0,l.jsx)(s.Icon,{component:i.default,size:`sm`})]})]})]})]}),e===`quality`&&(0,l.jsxs)(`div`,{className:C.advancedMenu,onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Escape`&&c(`main`)},role:`menu`,tabIndex:-1,children:[(0,l.jsxs)(`div`,{className:C.menuTitle,children:[(0,l.jsx)(`button`,{onClick:()=>c(`main`),className:C.btn,children:(0,l.jsx)(s.Icon,{component:r.default,size:`sm`})}),(0,l.jsx)(`span`,{children:E})]}),(0,l.jsx)(`div`,{className:C.menuItems,children:f?.map((e,t)=>(0,l.jsxs)(`button`,{className:C.menuBtn,"data-active":p===t,onClick:()=>m(t),children:[p===t&&(0,l.jsx)(s.Icon,{component:n.default,size:`sm`}),(0,l.jsx)(`span`,{style:{marginLeft:p===t?0:24},children:e.label})]},t))})]}),e===`rate`&&(0,l.jsxs)(`div`,{className:C.advancedMenu,onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Escape`&&c(`main`)},role:`menu`,tabIndex:-1,children:[(0,l.jsxs)(`div`,{className:C.menuTitle,children:[(0,l.jsx)(`button`,{onClick:()=>c(`main`),className:C.btn,children:(0,l.jsx)(s.Icon,{component:r.default,size:`sm`})}),(0,l.jsx)(`span`,{children:D})]}),(0,l.jsx)(`div`,{className:C.menuItems,children:u.map(e=>(0,l.jsxs)(`button`,{className:C.menuBtn,"data-active":h===e,onClick:()=>{g(e),c(`main`)},children:[h===e&&(0,l.jsx)(s.Icon,{component:n.default,size:`sm`}),(0,l.jsx)(`span`,{style:{marginLeft:h===e?0:24},children:e===1?k:`${e}x`})]},e))})]}),e===`fit`&&(0,l.jsxs)(`div`,{className:C.advancedMenu,onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Escape`&&c(`main`)},role:`menu`,tabIndex:-1,children:[(0,l.jsxs)(`div`,{className:C.menuTitle,children:[(0,l.jsx)(`button`,{onClick:()=>c(`main`),className:C.btn,children:(0,l.jsx)(s.Icon,{component:r.default,size:`sm`})}),(0,l.jsx)(`span`,{children:O})]}),(0,l.jsx)(`div`,{className:C.menuItems,children:d.map(e=>(0,l.jsxs)(`button`,{className:C.menuBtn,"data-active":_===e,onClick:()=>{v(e),c(`main`)},children:[_===e&&(0,l.jsx)(s.Icon,{component:n.default,size:`sm`}),(0,l.jsx)(`span`,{style:{marginLeft:_===e?0:24},children:I(e)})]},e))})]}),e===`playlist`&&(0,l.jsxs)(`div`,{className:C.advancedMenu,onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Escape`&&c(null)},style:{bottom:60,right:16,width:250},role:`menu`,tabIndex:-1,children:[(0,l.jsxs)(`div`,{className:C.menuTitle,children:[(0,l.jsx)(`span`,{children:A}),(0,l.jsx)(`button`,{onClick:()=>c(null),style:{marginLeft:`auto`},className:C.btn,children:(0,l.jsx)(s.Icon,{component:a.default,size:`sm`})})]}),(0,l.jsx)(`div`,{className:C.menuItems,children:y?.map((e,t)=>(0,l.jsx)(`button`,{className:C.menuBtn,"data-active":b===t,onClick:()=>x(t),style:{flexDirection:`column`,alignItems:`flex-start`,gap:4},children:(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[b===t?(0,l.jsx)(s.Icon,{component:o.default,size:`sm`}):(0,l.jsx)(`div`,{style:{width:20}}),(0,l.jsx)(`span`,{children:e.title||`Track ${t+1}`})]})},t))})]})]})}exports.VideoAdvancedMenu=f;
|