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,89 +1,89 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
3
|
import { useMediaLoader as t } from "../../../hooks/useMediaLoader.js";
|
|
4
|
-
import { useAudioPlayer as
|
|
5
|
-
import { useAudioMetadata as
|
|
6
|
-
import { AudioCustomControls as
|
|
7
|
-
import
|
|
8
|
-
import { useEffect as
|
|
9
|
-
import
|
|
10
|
-
import { jsx as
|
|
4
|
+
import { useAudioPlayer as n } from "./hooks/useAudioPlayer.js";
|
|
5
|
+
import { useAudioMetadata as r } from "./hooks/useAudioMetadata.js";
|
|
6
|
+
import { AudioCustomControls as i } from "./components/AudioCustomControls.js";
|
|
7
|
+
import a from "./audio.module.js";
|
|
8
|
+
import { useEffect as o, useMemo as s } from "react";
|
|
9
|
+
import c from "classnames";
|
|
10
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
11
11
|
//#region src/components/media/Audio/Audio.tsx
|
|
12
|
-
var
|
|
13
|
-
let { t: F } = e("common"), { unknownTitle: I = "
|
|
12
|
+
var d = ({ src: d, autoPlay: f = !1, loop: ee = !1, muted: te = !1, controls: ne = !0, radius: p = "none", shadow: m = !1, border: h = !1, preload: g, caption: _, className: v, style: y, customControls: b = !1, visualizer: x = !1, showMetadata: S = !1, fadeIn: C = !1, fadeOut: w = !1, crossfade: T = !1, playbackRate: E = !1, hotkeys: D = !1, presets: O = !1, sleepTimer: k = !1, loading: A = "lazy", demoDelay: j, labels: M = {}, tracks: N, ...P }) => {
|
|
13
|
+
let { t: F } = e("common"), { unknownTitle: I = F("audio.unknown_title"), unknownArtist: L = F("audio.unknown_artist") } = M, R = s(() => d ? (Array.isArray(d) ? d : [d]).map((e) => typeof e == "string" ? { src: e } : e) : [], [d]), { containerRef: z, isLoaded: re, isIntersecting: B, notifyLoaded: V, shouldShowSkeleton: H } = t({
|
|
14
14
|
loading: A,
|
|
15
15
|
demoDelay: j,
|
|
16
16
|
src: R[0]?.src
|
|
17
|
-
}), U =
|
|
17
|
+
}), U = n({
|
|
18
18
|
playlist: R,
|
|
19
|
-
loop:
|
|
20
|
-
muted:
|
|
19
|
+
loop: ee,
|
|
20
|
+
muted: te,
|
|
21
21
|
fadeIn: C,
|
|
22
22
|
fadeOut: w,
|
|
23
23
|
crossfade: T,
|
|
24
24
|
visualizer: x,
|
|
25
25
|
hotkeys: D,
|
|
26
|
-
autoPlay:
|
|
27
|
-
}), { isPlaying: W, currentTrack: G, currentTrackIndex: K, activeAudioRef: q, nextAudioRef: J, canvasRef: Y, handleTimeUpdate: X, handleEnded: ie, setDuration: ae, playActivePlayer: oe } = U, { metaTitle: Z, metaArtist: Q, metaCover: $ } =
|
|
26
|
+
autoPlay: f
|
|
27
|
+
}), { isPlaying: W, currentTrack: G, currentTrackIndex: K, activeAudioRef: q, nextAudioRef: J, canvasRef: Y, handleTimeUpdate: X, handleEnded: ie, setDuration: ae, playActivePlayer: oe } = U, { metaTitle: Z, metaArtist: Q, metaCover: $ } = r({
|
|
28
28
|
currentTrack: G,
|
|
29
29
|
showMetadata: S
|
|
30
30
|
});
|
|
31
|
-
|
|
32
|
-
G && q.current && (q.current.src = G.src, (
|
|
31
|
+
o(() => {
|
|
32
|
+
G && q.current && (q.current.src = G.src, (f || W) && oe());
|
|
33
33
|
}, [K, G]);
|
|
34
|
-
let se = p === "none" ? null :
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
className:
|
|
34
|
+
let se = p === "none" ? null : a[`radius${p.charAt(0).toUpperCase() + p.slice(1)}`];
|
|
35
|
+
return /* @__PURE__ */ u("figure", {
|
|
36
|
+
className: c("wim-audio", a.root, v),
|
|
37
37
|
style: y,
|
|
38
38
|
"data-testid": "audio-root",
|
|
39
|
-
children: [/* @__PURE__ */
|
|
40
|
-
ref:
|
|
41
|
-
className:
|
|
39
|
+
children: [/* @__PURE__ */ u("div", {
|
|
40
|
+
ref: z,
|
|
41
|
+
className: c(a.inner, se, b && m && a.shadow, b && h && a.border, b && a.custom, C && a.fadeIn, C && re && a.isLoaded, H && a.loading),
|
|
42
42
|
"data-testid": "audio-inner",
|
|
43
43
|
children: [
|
|
44
|
-
x && b && /* @__PURE__ */
|
|
44
|
+
x && b && /* @__PURE__ */ l("canvas", {
|
|
45
45
|
ref: Y,
|
|
46
|
-
className:
|
|
46
|
+
className: a.visualizerCanvas,
|
|
47
47
|
"data-testid": "audio-canvas"
|
|
48
48
|
}),
|
|
49
|
-
b && S && (Z || Q || $) && /* @__PURE__ */
|
|
50
|
-
className:
|
|
49
|
+
b && S && (Z || Q || $) && /* @__PURE__ */ u("div", {
|
|
50
|
+
className: a.metadata,
|
|
51
51
|
style: {
|
|
52
52
|
position: "relative",
|
|
53
53
|
zIndex: 2
|
|
54
54
|
},
|
|
55
55
|
"data-testid": "audio-metadata",
|
|
56
|
-
children: [$ && /* @__PURE__ */
|
|
56
|
+
children: [$ && /* @__PURE__ */ l("img", {
|
|
57
57
|
src: $,
|
|
58
58
|
alt: F("a11y.cover_art"),
|
|
59
|
-
className:
|
|
59
|
+
className: a.cover,
|
|
60
60
|
"data-testid": "audio-cover"
|
|
61
|
-
}), /* @__PURE__ */
|
|
62
|
-
className:
|
|
63
|
-
children: [/* @__PURE__ */
|
|
64
|
-
className:
|
|
61
|
+
}), /* @__PURE__ */ u("div", {
|
|
62
|
+
className: a.info,
|
|
63
|
+
children: [/* @__PURE__ */ l("div", {
|
|
64
|
+
className: a.title,
|
|
65
65
|
"data-testid": "audio-title",
|
|
66
66
|
children: Z || I
|
|
67
|
-
}), /* @__PURE__ */
|
|
68
|
-
className:
|
|
67
|
+
}), /* @__PURE__ */ l("div", {
|
|
68
|
+
className: a.artist,
|
|
69
69
|
"data-testid": "audio-artist",
|
|
70
70
|
children: Q || L
|
|
71
71
|
})]
|
|
72
72
|
})]
|
|
73
73
|
}),
|
|
74
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ u("div", {
|
|
75
75
|
style: {
|
|
76
76
|
display: b ? "none" : "block",
|
|
77
77
|
width: "100%"
|
|
78
78
|
},
|
|
79
|
-
children: [B && /* @__PURE__ */
|
|
79
|
+
children: [B && /* @__PURE__ */ l("audio", {
|
|
80
80
|
ref: q,
|
|
81
81
|
src: G?.src,
|
|
82
|
-
className:
|
|
82
|
+
className: a.audio,
|
|
83
83
|
"data-testid": "audio-active",
|
|
84
84
|
loop: U.repeatMode === 1 && R.length === 1,
|
|
85
85
|
muted: U.isMuted,
|
|
86
|
-
controls: !b &&
|
|
86
|
+
controls: !b && ne,
|
|
87
87
|
preload: g,
|
|
88
88
|
crossOrigin: "anonymous",
|
|
89
89
|
onTimeUpdate: X,
|
|
@@ -98,8 +98,8 @@ var u = ({ src: u, autoPlay: d = !1, loop: te = !1, muted: ne = !1, controls: f
|
|
|
98
98
|
onCanPlay: (e) => {
|
|
99
99
|
V(), P.onCanPlay?.(e);
|
|
100
100
|
},
|
|
101
|
-
children: N?.map((e, t) => /* @__PURE__ */
|
|
102
|
-
}), /* @__PURE__ */
|
|
101
|
+
children: N?.map((e, t) => /* @__PURE__ */ l("track", { ...e }, t))
|
|
102
|
+
}), /* @__PURE__ */ l("audio", {
|
|
103
103
|
ref: J,
|
|
104
104
|
muted: U.isMuted,
|
|
105
105
|
preload: "auto",
|
|
@@ -107,8 +107,8 @@ var u = ({ src: u, autoPlay: d = !1, loop: te = !1, muted: ne = !1, controls: f
|
|
|
107
107
|
"data-testid": "audio-next"
|
|
108
108
|
})]
|
|
109
109
|
}),
|
|
110
|
-
b && /* @__PURE__ */
|
|
111
|
-
styles:
|
|
110
|
+
b && /* @__PURE__ */ l(i, {
|
|
111
|
+
styles: a,
|
|
112
112
|
isPlaying: W,
|
|
113
113
|
currentTime: U.currentTime,
|
|
114
114
|
duration: U.duration,
|
|
@@ -136,11 +136,11 @@ var u = ({ src: u, autoPlay: d = !1, loop: te = !1, muted: ne = !1, controls: f
|
|
|
136
136
|
labels: M
|
|
137
137
|
})
|
|
138
138
|
]
|
|
139
|
-
}), _ && /* @__PURE__ */
|
|
140
|
-
className:
|
|
139
|
+
}), _ && /* @__PURE__ */ l("figcaption", {
|
|
140
|
+
className: a.caption,
|
|
141
141
|
children: _
|
|
142
142
|
})]
|
|
143
143
|
});
|
|
144
144
|
};
|
|
145
145
|
//#endregion
|
|
146
|
-
export {
|
|
146
|
+
export { d as Audio };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../../icon/chart.cjs"),
|
|
2
|
+
const e=require("../../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../../i18n/useWimTranslation.cjs"),n=require("../../../../icon/chart.cjs"),r=require("../../../../icon/chevron-left.cjs"),i=require("../../../../icon/chevron-right.cjs"),a=require("../../../../icon/clock.cjs"),o=require("../../../../icon/mute.cjs"),s=require("../../../../icon/pause.cjs"),c=require("../../../../icon/play.cjs"),l=require("../../../../icon/repeat.cjs"),u=require("../../../../icon/shuffle.cjs"),d=require("../../../../icon/volume.cjs"),f=require("../../Icon/Icon.cjs");let p=require("react");p=e.__toESM(p,1);let m=require("classnames");m=e.__toESM(m,1);let h=require("react/jsx-runtime");function g({isPlaying:e,currentTime:p,duration:g,volume:_,isMuted:v,repeatMode:y,shuffleMode:b,currentPlaybackRate:x,isBassBoost:S,remainingSleepTime:C,playbackRate:w,presets:T,sleepTimer:E,setRepeatMode:D,setShuffleMode:O,setCurrentPlaybackRate:k,setIsBassBoost:A,setIsMuted:j,togglePlay:M,handleSeek:N,handleVolumeChange:P,playNext:F,toggleSleepTimer:ee,formatTime:I,labels:L={},styles:R}){let{t:z}=t.useWimTranslation(`common`),{seek:B=z(`a11y.seek`),mute:V=z(`a11y.mute`),unmute:H=z(`a11y.unmute`),volume:U=z(`a11y.volume`),play:W=z(`a11y.play`),pause:G=z(`a11y.pause`),next:K=z(`action.next`),prev:q=z(`action.previous`),repeatMode0:J=z(`audio.repeat_off`),repeatMode1:Y=z(`audio.repeat_single`),repeatMode2:X=z(`audio.repeat_all`),shuffle:Z=z(`audio.shuffle`),playbackSpeed:Q=z(`playback.speed`),bassBoost:$=z(`audio.bass_boost`),sleepTimer:te=`Sleep Timer (15m)`}=L,ne=y===0?J:y===1?Y:X;return(0,h.jsxs)(`div`,{className:(0,m.default)(R.customControls),children:[(0,h.jsxs)(`div`,{className:(0,m.default)(R.time),children:[(0,h.jsx)(`span`,{className:R.timeCurrent,children:I(p)}),(0,h.jsxs)(`div`,{className:(0,m.default)(R.progressContainer),children:[(0,h.jsx)(`input`,{type:`range`,min:`0`,max:g||0,value:p,step:`0.1`,onChange:N,className:(0,m.default)(R.progress),"aria-label":B}),(0,h.jsx)(`div`,{className:(0,m.default)(R.progressFill),style:{width:`${p/(g||1)*100}%`}})]}),(0,h.jsx)(`span`,{className:R.timeTotal,children:I(g)})]}),(0,h.jsxs)(`div`,{className:(0,m.default)(R.controlsRow),children:[(0,h.jsxs)(`div`,{className:(0,m.default)(R.controlsGroup),children:[(0,h.jsxs)(`button`,{type:`button`,className:(0,m.default)(R.btn,y>0&&R.active),onClick:()=>D(e=>(e+1)%3),title:ne,children:[(0,h.jsx)(f.Icon,{component:l.default,size:`sm`}),y===1&&(0,h.jsx)(`span`,{className:(0,m.default)(R.badge),children:`1`})]}),(0,h.jsx)(`button`,{type:`button`,className:(0,m.default)(R.btn,b&&R.active),onClick:()=>O(e=>!e),title:Z,children:(0,h.jsx)(f.Icon,{component:u.default,size:`sm`})}),w&&(0,h.jsxs)(`button`,{type:`button`,className:(0,m.default)(R.btn,R.btnText),onClick:()=>{let e=[.5,1,1.5,2],t=e[(e.indexOf(x)+1)%e.length];k(t)},title:Q,children:[x,`x`]})]}),(0,h.jsxs)(`div`,{className:(0,m.default)(R.controlsGroup),children:[T&&(0,h.jsx)(`button`,{type:`button`,className:(0,m.default)(R.btn,S&&R.active),onClick:()=>A(!S),title:$,children:(0,h.jsx)(f.Icon,{component:n.default,size:`sm`})}),E&&(0,h.jsxs)(`button`,{type:`button`,className:(0,m.default)(R.btn,C!==null&&R.active),onClick:ee,title:te,children:[(0,h.jsx)(f.Icon,{component:a.default,size:`sm`}),C!==null&&(0,h.jsx)(`span`,{className:(0,m.default)(R.badge),style:{fontSize:`7px`},children:Math.ceil(C/60)})]}),(0,h.jsxs)(`div`,{className:(0,m.default)(R.volumeContainer),children:[(0,h.jsx)(`button`,{type:`button`,className:(0,m.default)(R.btn),onClick:()=>j(e=>!e),"aria-label":v?H:V,children:(0,h.jsx)(f.Icon,{component:v||_===0?o.default:d.default,size:`sm`})}),(0,h.jsx)(`input`,{type:`range`,min:`0`,max:`1`,step:`0.05`,value:v?0:_,onChange:P,className:(0,m.default)(R.volume),"aria-label":U})]})]})]}),(0,h.jsx)(`div`,{className:(0,m.default)(R.controlsRow),style:{justifyContent:`center`,marginTop:`0.2rem`},children:(0,h.jsxs)(`div`,{className:(0,m.default)(R.controlsGroup),children:[(0,h.jsx)(`button`,{type:`button`,className:(0,m.default)(R.btn),onClick:()=>F(-1),title:q,children:(0,h.jsx)(f.Icon,{component:r.default,size:`sm`})}),(0,h.jsx)(`button`,{type:`button`,className:(0,m.default)(R.btn,R.btnPlay),onClick:M,title:e?G:W,"aria-label":e?G:W,children:(0,h.jsx)(f.Icon,{component:e?s.default:c.default,size:`sm`})}),(0,h.jsx)(`button`,{type:`button`,className:(0,m.default)(R.btn),onClick:()=>F(1),title:K,children:(0,h.jsx)(f.Icon,{component:i.default,size:`sm`})})]})})]})}exports.AudioCustomControls=g;
|
|
@@ -1,186 +1,187 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import e from "../../../../
|
|
3
|
-
import t from "../../../../icon/
|
|
4
|
-
import n from "../../../../icon/chevron-
|
|
5
|
-
import r from "../../../../icon/
|
|
6
|
-
import i from "../../../../icon/
|
|
7
|
-
import a from "../../../../icon/
|
|
8
|
-
import o from "../../../../icon/
|
|
2
|
+
import { useWimTranslation as e } from "../../../../i18n/useWimTranslation.js";
|
|
3
|
+
import t from "../../../../icon/chart.js";
|
|
4
|
+
import n from "../../../../icon/chevron-left.js";
|
|
5
|
+
import r from "../../../../icon/chevron-right.js";
|
|
6
|
+
import i from "../../../../icon/clock.js";
|
|
7
|
+
import a from "../../../../icon/mute.js";
|
|
8
|
+
import o from "../../../../icon/pause.js";
|
|
9
|
+
import ee from "../../../../icon/play.js";
|
|
9
10
|
import s from "../../../../icon/repeat.js";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { Icon as
|
|
11
|
+
import c from "../../../../icon/shuffle.js";
|
|
12
|
+
import l from "../../../../icon/volume.js";
|
|
13
|
+
import { Icon as u } from "../../Icon/Icon.js";
|
|
13
14
|
import "react";
|
|
14
|
-
import
|
|
15
|
-
import { jsx as
|
|
15
|
+
import d from "classnames";
|
|
16
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
16
17
|
//#region src/components/media/Audio/components/AudioCustomControls.tsx
|
|
17
|
-
function
|
|
18
|
-
let { seek:
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
className:
|
|
18
|
+
function m({ isPlaying: m, currentTime: h, duration: g, volume: _, isMuted: v, repeatMode: y, shuffleMode: b, currentPlaybackRate: x, isBassBoost: S, remainingSleepTime: C, playbackRate: w, presets: T, sleepTimer: E, setRepeatMode: D, setShuffleMode: O, setCurrentPlaybackRate: k, setIsBassBoost: A, setIsMuted: j, togglePlay: M, handleSeek: N, handleVolumeChange: P, playNext: F, toggleSleepTimer: I, formatTime: L, labels: R = {}, styles: z }) {
|
|
19
|
+
let { t: B } = e("common"), { seek: V = B("a11y.seek"), mute: H = B("a11y.mute"), unmute: U = B("a11y.unmute"), volume: W = B("a11y.volume"), play: G = B("a11y.play"), pause: K = B("a11y.pause"), next: q = B("action.next"), prev: J = B("action.previous"), repeatMode0: Y = B("audio.repeat_off"), repeatMode1: X = B("audio.repeat_single"), repeatMode2: Z = B("audio.repeat_all"), shuffle: Q = B("audio.shuffle"), playbackSpeed: $ = B("playback.speed"), bassBoost: te = B("audio.bass_boost"), sleepTimer: ne = "Sleep Timer (15m)" } = R, re = y === 0 ? Y : y === 1 ? X : Z;
|
|
20
|
+
return /* @__PURE__ */ p("div", {
|
|
21
|
+
className: d(z.customControls),
|
|
21
22
|
children: [
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
className:
|
|
23
|
+
/* @__PURE__ */ p("div", {
|
|
24
|
+
className: d(z.time),
|
|
24
25
|
children: [
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
className:
|
|
27
|
-
children:
|
|
26
|
+
/* @__PURE__ */ f("span", {
|
|
27
|
+
className: z.timeCurrent,
|
|
28
|
+
children: L(h)
|
|
28
29
|
}),
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
className:
|
|
31
|
-
children: [/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ p("div", {
|
|
31
|
+
className: d(z.progressContainer),
|
|
32
|
+
children: [/* @__PURE__ */ f("input", {
|
|
32
33
|
type: "range",
|
|
33
34
|
min: "0",
|
|
34
|
-
max:
|
|
35
|
-
value:
|
|
35
|
+
max: g || 0,
|
|
36
|
+
value: h,
|
|
36
37
|
step: "0.1",
|
|
37
|
-
onChange:
|
|
38
|
-
className:
|
|
39
|
-
"aria-label":
|
|
40
|
-
}), /* @__PURE__ */
|
|
41
|
-
className:
|
|
42
|
-
style: { width: `${
|
|
38
|
+
onChange: N,
|
|
39
|
+
className: d(z.progress),
|
|
40
|
+
"aria-label": V
|
|
41
|
+
}), /* @__PURE__ */ f("div", {
|
|
42
|
+
className: d(z.progressFill),
|
|
43
|
+
style: { width: `${h / (g || 1) * 100}%` }
|
|
43
44
|
})]
|
|
44
45
|
}),
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
className:
|
|
47
|
-
children:
|
|
46
|
+
/* @__PURE__ */ f("span", {
|
|
47
|
+
className: z.timeTotal,
|
|
48
|
+
children: L(g)
|
|
48
49
|
})
|
|
49
50
|
]
|
|
50
51
|
}),
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
className:
|
|
53
|
-
children: [/* @__PURE__ */
|
|
54
|
-
className:
|
|
52
|
+
/* @__PURE__ */ p("div", {
|
|
53
|
+
className: d(z.controlsRow),
|
|
54
|
+
children: [/* @__PURE__ */ p("div", {
|
|
55
|
+
className: d(z.controlsGroup),
|
|
55
56
|
children: [
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ p("button", {
|
|
57
58
|
type: "button",
|
|
58
|
-
className:
|
|
59
|
-
onClick: () =>
|
|
60
|
-
title:
|
|
61
|
-
children: [/* @__PURE__ */
|
|
59
|
+
className: d(z.btn, y > 0 && z.active),
|
|
60
|
+
onClick: () => D((e) => (e + 1) % 3),
|
|
61
|
+
title: re,
|
|
62
|
+
children: [/* @__PURE__ */ f(u, {
|
|
62
63
|
component: s,
|
|
63
64
|
size: "sm"
|
|
64
|
-
}),
|
|
65
|
-
className:
|
|
65
|
+
}), y === 1 && /* @__PURE__ */ f("span", {
|
|
66
|
+
className: d(z.badge),
|
|
66
67
|
children: "1"
|
|
67
68
|
})]
|
|
68
69
|
}),
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ f("button", {
|
|
70
71
|
type: "button",
|
|
71
|
-
className:
|
|
72
|
-
onClick: () =>
|
|
73
|
-
title:
|
|
74
|
-
children: /* @__PURE__ */
|
|
75
|
-
component:
|
|
72
|
+
className: d(z.btn, b && z.active),
|
|
73
|
+
onClick: () => O((e) => !e),
|
|
74
|
+
title: Q,
|
|
75
|
+
children: /* @__PURE__ */ f(u, {
|
|
76
|
+
component: c,
|
|
76
77
|
size: "sm"
|
|
77
78
|
})
|
|
78
79
|
}),
|
|
79
|
-
|
|
80
|
+
w && /* @__PURE__ */ p("button", {
|
|
80
81
|
type: "button",
|
|
81
|
-
className:
|
|
82
|
+
className: d(z.btn, z.btnText),
|
|
82
83
|
onClick: () => {
|
|
83
84
|
let e = [
|
|
84
85
|
.5,
|
|
85
86
|
1,
|
|
86
87
|
1.5,
|
|
87
88
|
2
|
|
88
|
-
], t = e[(e.indexOf(
|
|
89
|
-
|
|
89
|
+
], t = e[(e.indexOf(x) + 1) % e.length];
|
|
90
|
+
k(t);
|
|
90
91
|
},
|
|
91
|
-
title:
|
|
92
|
-
children: [
|
|
92
|
+
title: $,
|
|
93
|
+
children: [x, "x"]
|
|
93
94
|
})
|
|
94
95
|
]
|
|
95
|
-
}), /* @__PURE__ */
|
|
96
|
-
className:
|
|
96
|
+
}), /* @__PURE__ */ p("div", {
|
|
97
|
+
className: d(z.controlsGroup),
|
|
97
98
|
children: [
|
|
98
|
-
|
|
99
|
+
T && /* @__PURE__ */ f("button", {
|
|
99
100
|
type: "button",
|
|
100
|
-
className:
|
|
101
|
-
onClick: () =>
|
|
102
|
-
title:
|
|
103
|
-
children: /* @__PURE__ */
|
|
104
|
-
component:
|
|
101
|
+
className: d(z.btn, S && z.active),
|
|
102
|
+
onClick: () => A(!S),
|
|
103
|
+
title: te,
|
|
104
|
+
children: /* @__PURE__ */ f(u, {
|
|
105
|
+
component: t,
|
|
105
106
|
size: "sm"
|
|
106
107
|
})
|
|
107
108
|
}),
|
|
108
|
-
|
|
109
|
+
E && /* @__PURE__ */ p("button", {
|
|
109
110
|
type: "button",
|
|
110
|
-
className:
|
|
111
|
-
onClick:
|
|
112
|
-
title:
|
|
113
|
-
children: [/* @__PURE__ */
|
|
114
|
-
component:
|
|
111
|
+
className: d(z.btn, C !== null && z.active),
|
|
112
|
+
onClick: I,
|
|
113
|
+
title: ne,
|
|
114
|
+
children: [/* @__PURE__ */ f(u, {
|
|
115
|
+
component: i,
|
|
115
116
|
size: "sm"
|
|
116
|
-
}),
|
|
117
|
-
className:
|
|
117
|
+
}), C !== null && /* @__PURE__ */ f("span", {
|
|
118
|
+
className: d(z.badge),
|
|
118
119
|
style: { fontSize: "7px" },
|
|
119
|
-
children: Math.ceil(
|
|
120
|
+
children: Math.ceil(C / 60)
|
|
120
121
|
})]
|
|
121
122
|
}),
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
className:
|
|
124
|
-
children: [/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ p("div", {
|
|
124
|
+
className: d(z.volumeContainer),
|
|
125
|
+
children: [/* @__PURE__ */ f("button", {
|
|
125
126
|
type: "button",
|
|
126
|
-
className:
|
|
127
|
-
onClick: () =>
|
|
128
|
-
"aria-label":
|
|
129
|
-
children: /* @__PURE__ */
|
|
130
|
-
component:
|
|
127
|
+
className: d(z.btn),
|
|
128
|
+
onClick: () => j((e) => !e),
|
|
129
|
+
"aria-label": v ? U : H,
|
|
130
|
+
children: /* @__PURE__ */ f(u, {
|
|
131
|
+
component: v || _ === 0 ? a : l,
|
|
131
132
|
size: "sm"
|
|
132
133
|
})
|
|
133
|
-
}), /* @__PURE__ */
|
|
134
|
+
}), /* @__PURE__ */ f("input", {
|
|
134
135
|
type: "range",
|
|
135
136
|
min: "0",
|
|
136
137
|
max: "1",
|
|
137
138
|
step: "0.05",
|
|
138
|
-
value:
|
|
139
|
-
onChange:
|
|
140
|
-
className:
|
|
141
|
-
"aria-label":
|
|
139
|
+
value: v ? 0 : _,
|
|
140
|
+
onChange: P,
|
|
141
|
+
className: d(z.volume),
|
|
142
|
+
"aria-label": W
|
|
142
143
|
})]
|
|
143
144
|
})
|
|
144
145
|
]
|
|
145
146
|
})]
|
|
146
147
|
}),
|
|
147
|
-
/* @__PURE__ */
|
|
148
|
-
className:
|
|
148
|
+
/* @__PURE__ */ f("div", {
|
|
149
|
+
className: d(z.controlsRow),
|
|
149
150
|
style: {
|
|
150
151
|
justifyContent: "center",
|
|
151
152
|
marginTop: "0.2rem"
|
|
152
153
|
},
|
|
153
|
-
children: /* @__PURE__ */
|
|
154
|
-
className:
|
|
154
|
+
children: /* @__PURE__ */ p("div", {
|
|
155
|
+
className: d(z.controlsGroup),
|
|
155
156
|
children: [
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ f("button", {
|
|
157
158
|
type: "button",
|
|
158
|
-
className:
|
|
159
|
-
onClick: () =>
|
|
160
|
-
title:
|
|
161
|
-
children: /* @__PURE__ */
|
|
162
|
-
component:
|
|
159
|
+
className: d(z.btn),
|
|
160
|
+
onClick: () => F(-1),
|
|
161
|
+
title: J,
|
|
162
|
+
children: /* @__PURE__ */ f(u, {
|
|
163
|
+
component: n,
|
|
163
164
|
size: "sm"
|
|
164
165
|
})
|
|
165
166
|
}),
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ f("button", {
|
|
167
168
|
type: "button",
|
|
168
|
-
className:
|
|
169
|
-
onClick:
|
|
170
|
-
title:
|
|
171
|
-
"aria-label":
|
|
172
|
-
children: /* @__PURE__ */
|
|
173
|
-
component:
|
|
169
|
+
className: d(z.btn, z.btnPlay),
|
|
170
|
+
onClick: M,
|
|
171
|
+
title: m ? K : G,
|
|
172
|
+
"aria-label": m ? K : G,
|
|
173
|
+
children: /* @__PURE__ */ f(u, {
|
|
174
|
+
component: m ? o : ee,
|
|
174
175
|
size: "sm"
|
|
175
176
|
})
|
|
176
177
|
}),
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ f("button", {
|
|
178
179
|
type: "button",
|
|
179
|
-
className:
|
|
180
|
-
onClick: () =>
|
|
181
|
-
title:
|
|
182
|
-
children: /* @__PURE__ */
|
|
183
|
-
component:
|
|
180
|
+
className: d(z.btn),
|
|
181
|
+
onClick: () => F(1),
|
|
182
|
+
title: q,
|
|
183
|
+
children: /* @__PURE__ */ f(u, {
|
|
184
|
+
component: r,
|
|
184
185
|
size: "sm"
|
|
185
186
|
})
|
|
186
187
|
})
|
|
@@ -191,4 +192,4 @@ function p({ isPlaying: p, currentTime: m, duration: h, volume: g, isMuted: _, r
|
|
|
191
192
|
});
|
|
192
193
|
}
|
|
193
194
|
//#endregion
|
|
194
|
-
export {
|
|
195
|
+
export { m as AudioCustomControls };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../icon/chevron-left.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../icon/chevron-left.cjs"),r=require("../../../icon/chevron-right.cjs"),i=require("../Icon/Icon.cjs"),a=require("./image-compare.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=e=>Math.max(0,Math.min(100,e)),u=o.default.forwardRef(({before:e,after:u,beforeAlt:d=``,afterAlt:f=``,beforeLabel:p,afterLabel:m,defaultPosition:h=50,position:g,onPositionChange:_,orientation:v=`horizontal`,width:y,height:b,radius:x=`md`,labels:S,className:C,...w},T)=>{let{t:E}=t.useWimTranslation(`common`),{handleAriaLabel:D=E(`imageCompare.handle`)}=S??{},O=g!==void 0,[k,A]=(0,o.useState)(l(h)),j=l(O?g:k),M=v===`vertical`,N=(0,o.useRef)(null),P=(0,o.useRef)(!1),F=(0,o.useCallback)(e=>{N.current=e,typeof T==`function`?T(e):T&&(T.current=e)},[T]),I=(0,o.useCallback)(e=>{let t=l(e);O||A(t),_?.(t)},[O,_]),L=(0,o.useCallback)((e,t)=>{let n=N.current?.getBoundingClientRect();if(!n)return;let r=M?(t-n.top)/n.height*100:(e-n.left)/n.width*100;I(r)},[M,I]),R=e=>{P.current=!0,e.currentTarget.setPointerCapture(e.pointerId),L(e.clientX,e.clientY)},z=e=>{P.current&&L(e.clientX,e.clientY)},B=e=>{P.current=!1,e.currentTarget.releasePointerCapture?.(e.pointerId)},V=e=>{let t=e.shiftKey?10:2,n=M?`ArrowUp`:`ArrowLeft`,r=M?`ArrowDown`:`ArrowRight`;e.key===n?(e.preventDefault(),I(j-t)):e.key===r?(e.preventDefault(),I(j+t)):e.key===`Home`?(e.preventDefault(),I(0)):e.key===`End`&&(e.preventDefault(),I(100))},H=M?{clipPath:`inset(0 0 ${100-j}% 0)`}:{clipPath:`inset(0 ${100-j}% 0 0)`},U=M?{top:`${j}%`}:{left:`${j}%`};return(0,c.jsxs)(`div`,{ref:F,className:(0,s.default)(`wim-image-compare`,a.default.root,M&&a.default.vertical,a.default[`radius-${x}`],C),style:{width:y,height:b},onPointerDown:R,onPointerMove:z,onPointerUp:B,...w,children:[(0,c.jsx)(`img`,{className:a.default.image,src:u,alt:f,draggable:!1}),m&&(0,c.jsx)(`span`,{className:(0,s.default)(a.default.label,a.default.afterLabel),children:m}),(0,c.jsxs)(`div`,{className:a.default.beforeLayer,style:H,children:[(0,c.jsx)(`img`,{className:a.default.image,src:e,alt:d,draggable:!1}),p&&(0,c.jsx)(`span`,{className:(0,s.default)(a.default.label,a.default.beforeLabel),children:p})]}),(0,c.jsxs)(`div`,{className:a.default.divider,style:U,children:[(0,c.jsx)(`span`,{className:a.default.line,"aria-hidden":`true`}),(0,c.jsxs)(`button`,{type:`button`,className:a.default.handle,role:`slider`,"aria-label":D,"aria-orientation":v,"aria-valuenow":Math.round(j),"aria-valuemin":0,"aria-valuemax":100,onKeyDown:V,onPointerDown:R,children:[(0,c.jsx)(i.Icon,{component:n.default,size:`sm`,className:a.default.arrow}),(0,c.jsx)(i.Icon,{component:r.default,size:`sm`,className:a.default.arrow})]})]})]})});u.displayName=`ImageCompare`,exports.ImageCompare=u;
|