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.
Files changed (56) hide show
  1. package/dist/components/ai/ChatUI/ChatUI.cjs +1 -1
  2. package/dist/components/ai/ChatUI/ChatUI.js +10 -10
  3. package/dist/components/ai/ModelSelector/ModelSelector.cjs +1 -1
  4. package/dist/components/ai/ModelSelector/ModelSelector.js +121 -120
  5. package/dist/components/ai/ThreadList/ThreadList.cjs +1 -1
  6. package/dist/components/ai/ThreadList/ThreadList.js +63 -62
  7. package/dist/components/data-display/Accordion/accordion.module.cjs +1 -1
  8. package/dist/components/data-display/Accordion/accordion.module.js +1 -1
  9. package/dist/components/data-display/Carousel/Carousel.cjs +1 -1
  10. package/dist/components/data-display/Carousel/Carousel.js +46 -46
  11. package/dist/components/data-display/NodeGraph/NodeGraph.cjs +1 -1
  12. package/dist/components/data-display/NodeGraph/NodeGraph.js +48 -48
  13. package/dist/components/data-display/ScheduleView/ScheduleView.cjs +1 -1
  14. package/dist/components/data-display/ScheduleView/ScheduleView.js +49 -48
  15. package/dist/components/feedback/Tour/Tour.cjs +1 -1
  16. package/dist/components/feedback/Tour/Tour.js +125 -100
  17. package/dist/components/form/OtpInput/otp-input.module.cjs +1 -1
  18. package/dist/components/form/OtpInput/otp-input.module.js +1 -1
  19. package/dist/components/form/RangeSlider/RangeSlider.cjs +1 -1
  20. package/dist/components/form/RangeSlider/RangeSlider.js +116 -115
  21. package/dist/components/form/RangeSlider/range-slider.module.cjs +1 -1
  22. package/dist/components/form/RangeSlider/range-slider.module.js +1 -1
  23. package/dist/components/form/ThemeToggle/ThemeToggle.cjs +1 -1
  24. package/dist/components/form/ThemeToggle/ThemeToggle.js +66 -65
  25. package/dist/components/form/Transfer/Transfer.cjs +1 -1
  26. package/dist/components/form/Transfer/Transfer.d.ts +1 -1
  27. package/dist/components/form/Transfer/Transfer.js +104 -104
  28. package/dist/components/form/Transfer/transfer.module.cjs +1 -1
  29. package/dist/components/form/Transfer/transfer.module.js +6 -6
  30. package/dist/components/media/Audio/Audio.cjs +1 -1
  31. package/dist/components/media/Audio/Audio.js +45 -45
  32. package/dist/components/media/Audio/components/AudioCustomControls.cjs +1 -1
  33. package/dist/components/media/Audio/components/AudioCustomControls.js +113 -112
  34. package/dist/components/media/ImageCompare/ImageCompare.cjs +1 -1
  35. package/dist/components/media/ImageCompare/ImageCompare.js +73 -72
  36. package/dist/components/media/Video/Video.cjs +1 -1
  37. package/dist/components/media/Video/Video.js +36 -35
  38. package/dist/components/media/Video/components/VideoAdvancedMenu.cjs +1 -1
  39. package/dist/components/media/Video/components/VideoAdvancedMenu.js +138 -137
  40. package/dist/components/navigation/Tabs/tabs.module.cjs +1 -1
  41. package/dist/components/navigation/Tabs/tabs.module.js +1 -1
  42. package/dist/i18n/generated/keys.d.ts +1 -1
  43. package/dist/i18n/generated/resources.cjs +1 -1
  44. package/dist/i18n/generated/resources.js +192 -12
  45. package/dist/llms-full.txt +4 -4
  46. package/dist/llms.txt +1 -1
  47. package/dist/locales/en/common.json +53 -4
  48. package/dist/locales/en/components.json +3 -1
  49. package/dist/locales/ja/common.json +53 -4
  50. package/dist/locales/ja/components.json +3 -1
  51. package/dist/locales/pt/common.json +53 -4
  52. package/dist/locales/pt/components.json +3 -1
  53. package/dist/styles.css +2 -2
  54. package/dist/wimui.umd.css +1 -1
  55. package/dist/wimui.umd.js +3 -3
  56. 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 ee } from "./hooks/useAudioPlayer.js";
5
- import { useAudioMetadata as n } from "./hooks/useAudioMetadata.js";
6
- import { AudioCustomControls as r } from "./components/AudioCustomControls.js";
7
- import i from "./audio.module.js";
8
- import { useEffect as a, useMemo as o } from "react";
9
- import s from "classnames";
10
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
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 u = ({ src: u, autoPlay: d = !1, loop: te = !1, muted: ne = !1, controls: f = !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 = "Unknown Title", unknownArtist: L = "Unknown Artist" } = M, R = o(() => u ? (Array.isArray(u) ? u : [u]).map((e) => typeof e == "string" ? { src: e } : e) : [], [u]), { containerRef: re, isLoaded: z, isIntersecting: B, notifyLoaded: V, shouldShowSkeleton: H } = t({
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 = ee({
17
+ }), U = n({
18
18
  playlist: R,
19
- loop: te,
20
- muted: ne,
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: d
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: $ } = n({
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
- a(() => {
32
- G && q.current && (q.current.src = G.src, (d || W) && oe());
31
+ o(() => {
32
+ G && q.current && (q.current.src = G.src, (f || W) && oe());
33
33
  }, [K, G]);
34
- let se = p === "none" ? null : i[`radius${p.charAt(0).toUpperCase() + p.slice(1)}`];
35
- return /* @__PURE__ */ l("figure", {
36
- className: s("wim-audio", i.root, v),
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__ */ l("div", {
40
- ref: re,
41
- className: s(i.inner, se, b && m && i.shadow, b && h && i.border, b && i.custom, C && i.fadeIn, C && z && i.isLoaded, H && i.loading),
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__ */ c("canvas", {
44
+ x && b && /* @__PURE__ */ l("canvas", {
45
45
  ref: Y,
46
- className: i.visualizerCanvas,
46
+ className: a.visualizerCanvas,
47
47
  "data-testid": "audio-canvas"
48
48
  }),
49
- b && S && (Z || Q || $) && /* @__PURE__ */ l("div", {
50
- className: i.metadata,
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__ */ c("img", {
56
+ children: [$ && /* @__PURE__ */ l("img", {
57
57
  src: $,
58
58
  alt: F("a11y.cover_art"),
59
- className: i.cover,
59
+ className: a.cover,
60
60
  "data-testid": "audio-cover"
61
- }), /* @__PURE__ */ l("div", {
62
- className: i.info,
63
- children: [/* @__PURE__ */ c("div", {
64
- className: i.title,
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__ */ c("div", {
68
- className: i.artist,
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__ */ l("div", {
74
+ /* @__PURE__ */ u("div", {
75
75
  style: {
76
76
  display: b ? "none" : "block",
77
77
  width: "100%"
78
78
  },
79
- children: [B && /* @__PURE__ */ c("audio", {
79
+ children: [B && /* @__PURE__ */ l("audio", {
80
80
  ref: q,
81
81
  src: G?.src,
82
- className: i.audio,
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 && f,
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__ */ c("track", { ...e }, t))
102
- }), /* @__PURE__ */ c("audio", {
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__ */ c(r, {
111
- styles: i,
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__ */ c("figcaption", {
140
- className: i.caption,
139
+ }), _ && /* @__PURE__ */ l("figcaption", {
140
+ className: a.caption,
141
141
  children: _
142
142
  })]
143
143
  });
144
144
  };
145
145
  //#endregion
146
- export { u as Audio };
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"),n=require("../../../../icon/chevron-left.cjs"),r=require("../../../../icon/chevron-right.cjs"),i=require("../../../../icon/clock.cjs"),a=require("../../../../icon/mute.cjs"),o=require("../../../../icon/pause.cjs"),s=require("../../../../icon/play.cjs"),c=require("../../../../icon/repeat.cjs"),l=require("../../../../icon/shuffle.cjs"),u=require("../../../../icon/volume.cjs"),d=require("../../Icon/Icon.cjs");let f=require("react");f=e.__toESM(f,1);let p=require("classnames");p=e.__toESM(p,1);let m=require("react/jsx-runtime");function h({isPlaying:e,currentTime:f,duration:h,volume:g,isMuted:_,repeatMode:v,shuffleMode:y,currentPlaybackRate:b,isBassBoost:x,remainingSleepTime:S,playbackRate:C,presets:w,sleepTimer:T,setRepeatMode:E,setShuffleMode:D,setCurrentPlaybackRate:O,setIsBassBoost:k,setIsMuted:A,togglePlay:j,handleSeek:M,handleVolumeChange:N,playNext:P,toggleSleepTimer:ee,formatTime:F,labels:I={},styles:L}){let{seek:R=`Seek`,mute:z=`Mute`,unmute:B=`Unmute`,volume:V=`Volume`,play:H=`Play`,pause:U=`Pause`,next:W=`Next`,prev:G=`Previous`,repeatMode0:K=`Repeat Off`,repeatMode1:q=`Repeat One`,repeatMode2:J=`Repeat All`,shuffle:Y=`Shuffle`,playbackSpeed:X=`Playback Speed`,bassBoost:Z=`Bass Boost`,sleepTimer:Q=`Sleep Timer (15m)`}=I,$=v===0?K:v===1?q:J;return(0,m.jsxs)(`div`,{className:(0,p.default)(L.customControls),children:[(0,m.jsxs)(`div`,{className:(0,p.default)(L.time),children:[(0,m.jsx)(`span`,{className:L.timeCurrent,children:F(f)}),(0,m.jsxs)(`div`,{className:(0,p.default)(L.progressContainer),children:[(0,m.jsx)(`input`,{type:`range`,min:`0`,max:h||0,value:f,step:`0.1`,onChange:M,className:(0,p.default)(L.progress),"aria-label":R}),(0,m.jsx)(`div`,{className:(0,p.default)(L.progressFill),style:{width:`${f/(h||1)*100}%`}})]}),(0,m.jsx)(`span`,{className:L.timeTotal,children:F(h)})]}),(0,m.jsxs)(`div`,{className:(0,p.default)(L.controlsRow),children:[(0,m.jsxs)(`div`,{className:(0,p.default)(L.controlsGroup),children:[(0,m.jsxs)(`button`,{type:`button`,className:(0,p.default)(L.btn,v>0&&L.active),onClick:()=>E(e=>(e+1)%3),title:$,children:[(0,m.jsx)(d.Icon,{component:c.default,size:`sm`}),v===1&&(0,m.jsx)(`span`,{className:(0,p.default)(L.badge),children:`1`})]}),(0,m.jsx)(`button`,{type:`button`,className:(0,p.default)(L.btn,y&&L.active),onClick:()=>D(e=>!e),title:Y,children:(0,m.jsx)(d.Icon,{component:l.default,size:`sm`})}),C&&(0,m.jsxs)(`button`,{type:`button`,className:(0,p.default)(L.btn,L.btnText),onClick:()=>{let e=[.5,1,1.5,2],t=e[(e.indexOf(b)+1)%e.length];O(t)},title:X,children:[b,`x`]})]}),(0,m.jsxs)(`div`,{className:(0,p.default)(L.controlsGroup),children:[w&&(0,m.jsx)(`button`,{type:`button`,className:(0,p.default)(L.btn,x&&L.active),onClick:()=>k(!x),title:Z,children:(0,m.jsx)(d.Icon,{component:t.default,size:`sm`})}),T&&(0,m.jsxs)(`button`,{type:`button`,className:(0,p.default)(L.btn,S!==null&&L.active),onClick:ee,title:Q,children:[(0,m.jsx)(d.Icon,{component:i.default,size:`sm`}),S!==null&&(0,m.jsx)(`span`,{className:(0,p.default)(L.badge),style:{fontSize:`7px`},children:Math.ceil(S/60)})]}),(0,m.jsxs)(`div`,{className:(0,p.default)(L.volumeContainer),children:[(0,m.jsx)(`button`,{type:`button`,className:(0,p.default)(L.btn),onClick:()=>A(e=>!e),"aria-label":_?B:z,children:(0,m.jsx)(d.Icon,{component:_||g===0?a.default:u.default,size:`sm`})}),(0,m.jsx)(`input`,{type:`range`,min:`0`,max:`1`,step:`0.05`,value:_?0:g,onChange:N,className:(0,p.default)(L.volume),"aria-label":V})]})]})]}),(0,m.jsx)(`div`,{className:(0,p.default)(L.controlsRow),style:{justifyContent:`center`,marginTop:`0.2rem`},children:(0,m.jsxs)(`div`,{className:(0,p.default)(L.controlsGroup),children:[(0,m.jsx)(`button`,{type:`button`,className:(0,p.default)(L.btn),onClick:()=>P(-1),title:G,children:(0,m.jsx)(d.Icon,{component:n.default,size:`sm`})}),(0,m.jsx)(`button`,{type:`button`,className:(0,p.default)(L.btn,L.btnPlay),onClick:j,title:e?U:H,"aria-label":e?U:H,children:(0,m.jsx)(d.Icon,{component:e?o.default:s.default,size:`sm`})}),(0,m.jsx)(`button`,{type:`button`,className:(0,p.default)(L.btn),onClick:()=>P(1),title:W,children:(0,m.jsx)(d.Icon,{component:r.default,size:`sm`})})]})})]})}exports.AudioCustomControls=h;
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 "../../../../icon/chart.js";
3
- import t from "../../../../icon/chevron-left.js";
4
- import n from "../../../../icon/chevron-right.js";
5
- import r from "../../../../icon/clock.js";
6
- import i from "../../../../icon/mute.js";
7
- import a from "../../../../icon/pause.js";
8
- import o from "../../../../icon/play.js";
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 ee from "../../../../icon/shuffle.js";
11
- import c from "../../../../icon/volume.js";
12
- import { Icon as l } from "../../Icon/Icon.js";
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 u from "classnames";
15
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
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 p({ isPlaying: p, currentTime: m, duration: h, volume: g, isMuted: _, repeatMode: v, shuffleMode: y, currentPlaybackRate: b, isBassBoost: x, remainingSleepTime: S, playbackRate: C, presets: w, sleepTimer: T, setRepeatMode: E, setShuffleMode: D, setCurrentPlaybackRate: O, setIsBassBoost: k, setIsMuted: A, togglePlay: j, handleSeek: M, handleVolumeChange: N, playNext: P, toggleSleepTimer: F, formatTime: I, labels: L = {}, styles: R }) {
18
- let { seek: z = "Seek", mute: B = "Mute", unmute: V = "Unmute", volume: H = "Volume", play: U = "Play", pause: W = "Pause", next: G = "Next", prev: K = "Previous", repeatMode0: q = "Repeat Off", repeatMode1: J = "Repeat One", repeatMode2: Y = "Repeat All", shuffle: X = "Shuffle", playbackSpeed: Z = "Playback Speed", bassBoost: Q = "Bass Boost", sleepTimer: $ = "Sleep Timer (15m)" } = L, te = v === 0 ? q : v === 1 ? J : Y;
19
- return /* @__PURE__ */ f("div", {
20
- className: u(R.customControls),
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__ */ f("div", {
23
- className: u(R.time),
23
+ /* @__PURE__ */ p("div", {
24
+ className: d(z.time),
24
25
  children: [
25
- /* @__PURE__ */ d("span", {
26
- className: R.timeCurrent,
27
- children: I(m)
26
+ /* @__PURE__ */ f("span", {
27
+ className: z.timeCurrent,
28
+ children: L(h)
28
29
  }),
29
- /* @__PURE__ */ f("div", {
30
- className: u(R.progressContainer),
31
- children: [/* @__PURE__ */ d("input", {
30
+ /* @__PURE__ */ p("div", {
31
+ className: d(z.progressContainer),
32
+ children: [/* @__PURE__ */ f("input", {
32
33
  type: "range",
33
34
  min: "0",
34
- max: h || 0,
35
- value: m,
35
+ max: g || 0,
36
+ value: h,
36
37
  step: "0.1",
37
- onChange: M,
38
- className: u(R.progress),
39
- "aria-label": z
40
- }), /* @__PURE__ */ d("div", {
41
- className: u(R.progressFill),
42
- style: { width: `${m / (h || 1) * 100}%` }
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__ */ d("span", {
46
- className: R.timeTotal,
47
- children: I(h)
46
+ /* @__PURE__ */ f("span", {
47
+ className: z.timeTotal,
48
+ children: L(g)
48
49
  })
49
50
  ]
50
51
  }),
51
- /* @__PURE__ */ f("div", {
52
- className: u(R.controlsRow),
53
- children: [/* @__PURE__ */ f("div", {
54
- className: u(R.controlsGroup),
52
+ /* @__PURE__ */ p("div", {
53
+ className: d(z.controlsRow),
54
+ children: [/* @__PURE__ */ p("div", {
55
+ className: d(z.controlsGroup),
55
56
  children: [
56
- /* @__PURE__ */ f("button", {
57
+ /* @__PURE__ */ p("button", {
57
58
  type: "button",
58
- className: u(R.btn, v > 0 && R.active),
59
- onClick: () => E((e) => (e + 1) % 3),
60
- title: te,
61
- children: [/* @__PURE__ */ d(l, {
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
- }), v === 1 && /* @__PURE__ */ d("span", {
65
- className: u(R.badge),
65
+ }), y === 1 && /* @__PURE__ */ f("span", {
66
+ className: d(z.badge),
66
67
  children: "1"
67
68
  })]
68
69
  }),
69
- /* @__PURE__ */ d("button", {
70
+ /* @__PURE__ */ f("button", {
70
71
  type: "button",
71
- className: u(R.btn, y && R.active),
72
- onClick: () => D((e) => !e),
73
- title: X,
74
- children: /* @__PURE__ */ d(l, {
75
- component: ee,
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
- C && /* @__PURE__ */ f("button", {
80
+ w && /* @__PURE__ */ p("button", {
80
81
  type: "button",
81
- className: u(R.btn, R.btnText),
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(b) + 1) % e.length];
89
- O(t);
89
+ ], t = e[(e.indexOf(x) + 1) % e.length];
90
+ k(t);
90
91
  },
91
- title: Z,
92
- children: [b, "x"]
92
+ title: $,
93
+ children: [x, "x"]
93
94
  })
94
95
  ]
95
- }), /* @__PURE__ */ f("div", {
96
- className: u(R.controlsGroup),
96
+ }), /* @__PURE__ */ p("div", {
97
+ className: d(z.controlsGroup),
97
98
  children: [
98
- w && /* @__PURE__ */ d("button", {
99
+ T && /* @__PURE__ */ f("button", {
99
100
  type: "button",
100
- className: u(R.btn, x && R.active),
101
- onClick: () => k(!x),
102
- title: Q,
103
- children: /* @__PURE__ */ d(l, {
104
- component: e,
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
- T && /* @__PURE__ */ f("button", {
109
+ E && /* @__PURE__ */ p("button", {
109
110
  type: "button",
110
- className: u(R.btn, S !== null && R.active),
111
- onClick: F,
112
- title: $,
113
- children: [/* @__PURE__ */ d(l, {
114
- component: r,
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
- }), S !== null && /* @__PURE__ */ d("span", {
117
- className: u(R.badge),
117
+ }), C !== null && /* @__PURE__ */ f("span", {
118
+ className: d(z.badge),
118
119
  style: { fontSize: "7px" },
119
- children: Math.ceil(S / 60)
120
+ children: Math.ceil(C / 60)
120
121
  })]
121
122
  }),
122
- /* @__PURE__ */ f("div", {
123
- className: u(R.volumeContainer),
124
- children: [/* @__PURE__ */ d("button", {
123
+ /* @__PURE__ */ p("div", {
124
+ className: d(z.volumeContainer),
125
+ children: [/* @__PURE__ */ f("button", {
125
126
  type: "button",
126
- className: u(R.btn),
127
- onClick: () => A((e) => !e),
128
- "aria-label": _ ? V : B,
129
- children: /* @__PURE__ */ d(l, {
130
- component: _ || g === 0 ? i : c,
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__ */ d("input", {
134
+ }), /* @__PURE__ */ f("input", {
134
135
  type: "range",
135
136
  min: "0",
136
137
  max: "1",
137
138
  step: "0.05",
138
- value: _ ? 0 : g,
139
- onChange: N,
140
- className: u(R.volume),
141
- "aria-label": H
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__ */ d("div", {
148
- className: u(R.controlsRow),
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__ */ f("div", {
154
- className: u(R.controlsGroup),
154
+ children: /* @__PURE__ */ p("div", {
155
+ className: d(z.controlsGroup),
155
156
  children: [
156
- /* @__PURE__ */ d("button", {
157
+ /* @__PURE__ */ f("button", {
157
158
  type: "button",
158
- className: u(R.btn),
159
- onClick: () => P(-1),
160
- title: K,
161
- children: /* @__PURE__ */ d(l, {
162
- component: t,
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__ */ d("button", {
167
+ /* @__PURE__ */ f("button", {
167
168
  type: "button",
168
- className: u(R.btn, R.btnPlay),
169
- onClick: j,
170
- title: p ? W : U,
171
- "aria-label": p ? W : U,
172
- children: /* @__PURE__ */ d(l, {
173
- component: p ? a : o,
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__ */ d("button", {
178
+ /* @__PURE__ */ f("button", {
178
179
  type: "button",
179
- className: u(R.btn),
180
- onClick: () => P(1),
181
- title: G,
182
- children: /* @__PURE__ */ d(l, {
183
- component: n,
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 { p as AudioCustomControls };
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"),n=require("../../../icon/chevron-right.cjs"),r=require("../Icon/Icon.cjs"),i=require("./image-compare.module.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("classnames");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=e=>Math.max(0,Math.min(100,e)),l=a.default.forwardRef(({before:e,after:l,beforeAlt:u=``,afterAlt:d=``,beforeLabel:f,afterLabel:p,defaultPosition:m=50,position:h,onPositionChange:g,orientation:_=`horizontal`,width:v,height:y,radius:b=`md`,labels:x,className:S,...C},w)=>{let{handleAriaLabel:T=`Drag to compare`}=x??{},E=h!==void 0,[D,O]=(0,a.useState)(c(m)),k=c(E?h:D),A=_===`vertical`,j=(0,a.useRef)(null),M=(0,a.useRef)(!1),N=(0,a.useCallback)(e=>{j.current=e,typeof w==`function`?w(e):w&&(w.current=e)},[w]),P=(0,a.useCallback)(e=>{let t=c(e);E||O(t),g?.(t)},[E,g]),F=(0,a.useCallback)((e,t)=>{let n=j.current?.getBoundingClientRect();if(!n)return;let r=A?(t-n.top)/n.height*100:(e-n.left)/n.width*100;P(r)},[A,P]),I=e=>{M.current=!0,e.currentTarget.setPointerCapture(e.pointerId),F(e.clientX,e.clientY)},L=e=>{M.current&&F(e.clientX,e.clientY)},R=e=>{M.current=!1,e.currentTarget.releasePointerCapture?.(e.pointerId)},z=e=>{let t=e.shiftKey?10:2,n=A?`ArrowUp`:`ArrowLeft`,r=A?`ArrowDown`:`ArrowRight`;e.key===n?(e.preventDefault(),P(k-t)):e.key===r?(e.preventDefault(),P(k+t)):e.key===`Home`?(e.preventDefault(),P(0)):e.key===`End`&&(e.preventDefault(),P(100))},B=A?{clipPath:`inset(0 0 ${100-k}% 0)`}:{clipPath:`inset(0 ${100-k}% 0 0)`},V=A?{top:`${k}%`}:{left:`${k}%`};return(0,s.jsxs)(`div`,{ref:N,className:(0,o.default)(`wim-image-compare`,i.default.root,A&&i.default.vertical,i.default[`radius-${b}`],S),style:{width:v,height:y},onPointerDown:I,onPointerMove:L,onPointerUp:R,...C,children:[(0,s.jsx)(`img`,{className:i.default.image,src:l,alt:d,draggable:!1}),p&&(0,s.jsx)(`span`,{className:(0,o.default)(i.default.label,i.default.afterLabel),children:p}),(0,s.jsxs)(`div`,{className:i.default.beforeLayer,style:B,children:[(0,s.jsx)(`img`,{className:i.default.image,src:e,alt:u,draggable:!1}),f&&(0,s.jsx)(`span`,{className:(0,o.default)(i.default.label,i.default.beforeLabel),children:f})]}),(0,s.jsxs)(`div`,{className:i.default.divider,style:V,children:[(0,s.jsx)(`span`,{className:i.default.line,"aria-hidden":`true`}),(0,s.jsxs)(`button`,{type:`button`,className:i.default.handle,role:`slider`,"aria-label":T,"aria-orientation":_,"aria-valuenow":Math.round(k),"aria-valuemin":0,"aria-valuemax":100,onKeyDown:z,onPointerDown:I,children:[(0,s.jsx)(r.Icon,{component:t.default,size:`sm`,className:i.default.arrow}),(0,s.jsx)(r.Icon,{component:n.default,size:`sm`,className:i.default.arrow})]})]})]})});l.displayName=`ImageCompare`,exports.ImageCompare=l;
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;