wimui 0.63.0 → 0.63.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/_internal/OverlayBase.cjs +1 -1
- package/dist/components/_internal/OverlayBase.js +31 -30
- package/dist/components/_internal/composeEventHandlers.cjs +2 -0
- package/dist/components/_internal/composeEventHandlers.d.ts +25 -0
- package/dist/components/_internal/composeEventHandlers.js +8 -0
- package/dist/components/_internal/observeMove.cjs +1 -1
- package/dist/components/_internal/observeMove.js +3 -1
- package/dist/components/ai/ChatUI/ChatUI.cjs +1 -1
- package/dist/components/ai/ChatUI/ChatUI.js +83 -82
- package/dist/components/data-display/Accordion/Accordion.cjs +1 -1
- package/dist/components/data-display/Accordion/Accordion.js +79 -78
- package/dist/components/data-display/PullToRefresh/PullToRefresh.cjs +1 -1
- package/dist/components/data-display/PullToRefresh/PullToRefresh.js +73 -72
- package/dist/components/data-display/SortableList/SortableList.cjs +1 -1
- package/dist/components/data-display/SortableList/SortableList.js +54 -53
- package/dist/components/data-display/SwipeAction/SwipeAction.cjs +1 -1
- package/dist/components/data-display/SwipeAction/SwipeAction.js +77 -76
- package/dist/components/form/Cascader/Cascader.cjs +1 -1
- package/dist/components/form/Cascader/Cascader.js +99 -98
- package/dist/components/form/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/form/DatePicker/DatePicker.js +53 -52
- package/dist/components/form/RangeSlider/RangeSlider.cjs +1 -1
- package/dist/components/form/RangeSlider/RangeSlider.js +109 -108
- package/dist/components/form/Rating/Rating.cjs +1 -1
- package/dist/components/form/Rating/Rating.js +75 -74
- package/dist/components/form/Slider/Slider.cjs +1 -1
- package/dist/components/form/Slider/Slider.js +58 -57
- package/dist/components/form/SmartSearchInput/SmartSearchInput.cjs +1 -1
- package/dist/components/form/SmartSearchInput/SmartSearchInput.js +65 -64
- package/dist/components/form/TimePicker/TimePicker.cjs +1 -1
- package/dist/components/form/TimePicker/TimePicker.js +31 -30
- package/dist/components/layout/AppShell/AppShell.cjs +1 -1
- package/dist/components/layout/AppShell/AppShell.js +4 -1
- package/dist/components/layout/InteractiveArea/InteractiveArea.cjs +1 -1
- package/dist/components/layout/InteractiveArea/InteractiveArea.js +1 -1
- package/dist/components/layout/Navbar/Navbar.cjs +1 -1
- package/dist/components/layout/Navbar/Navbar.js +68 -67
- package/dist/components/layout/Sidebar/Sidebar.cjs +1 -1
- package/dist/components/layout/Sidebar/Sidebar.js +4 -1
- package/dist/components/layout/Splitter/Splitter.cjs +1 -1
- package/dist/components/layout/Splitter/Splitter.js +47 -46
- package/dist/components/layout/Transition/Transition.cjs +1 -1
- package/dist/components/layout/Transition/Transition.js +25 -24
- package/dist/components/media/Audio/Audio.cjs +1 -1
- package/dist/components/media/Audio/Audio.js +39 -38
- package/dist/components/media/Image/Image.cjs +2 -2
- package/dist/components/media/Image/Image.js +96 -95
- package/dist/components/media/ImageCompare/ImageCompare.cjs +1 -1
- package/dist/components/media/ImageCompare/ImageCompare.js +75 -74
- package/dist/components/media/Video/Video.cjs +1 -1
- package/dist/components/media/Video/Video.js +114 -113
- package/dist/components/navigation/Anchor/Anchor.cjs +1 -1
- package/dist/components/navigation/Anchor/Anchor.js +77 -72
- package/dist/components/navigation/SpeedDial/SpeedDial.cjs +1 -1
- package/dist/components/navigation/SpeedDial/SpeedDial.js +47 -46
- package/dist/components/navigation/Tabs/Tabs.cjs +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +87 -86
- package/dist/components/overlay/Popover/Popover.cjs +1 -1
- package/dist/components/overlay/Popover/Popover.js +1 -1
- package/dist/llms-full.txt +1 -1
- package/dist/llms.txt +1 -1
- package/dist/wimui.umd.js +5 -5
- package/package.json +4 -1
|
@@ -1,104 +1,105 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
3
|
import { commonNs as t } from "../../../i18n/generated/common.js";
|
|
4
|
-
import n from "
|
|
5
|
-
import r from "../../../icon/chevron-
|
|
6
|
-
import
|
|
7
|
-
import a from "
|
|
8
|
-
import o
|
|
9
|
-
import u from "
|
|
10
|
-
import
|
|
4
|
+
import { composeEventHandlers as n } from "../../_internal/composeEventHandlers.js";
|
|
5
|
+
import r from "../../../icon/chevron-left.js";
|
|
6
|
+
import i from "../../../icon/chevron-right.js";
|
|
7
|
+
import { Icon as a } from "../Icon/Icon.js";
|
|
8
|
+
import o from "./image-compare.module.js";
|
|
9
|
+
import s, { useCallback as c, useRef as l, useState as u } from "react";
|
|
10
|
+
import d from "classnames";
|
|
11
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
11
12
|
//#region src/components/media/ImageCompare/ImageCompare.tsx
|
|
12
|
-
var
|
|
13
|
-
let { t:
|
|
14
|
-
|
|
15
|
-
}, [
|
|
16
|
-
let t =
|
|
17
|
-
|
|
18
|
-
}, [
|
|
19
|
-
let n =
|
|
13
|
+
var m = (e) => Math.max(0, Math.min(100, e)), h = s.forwardRef(({ before: s, after: h, beforeAlt: g = "", afterAlt: _ = "", beforeLabel: v, afterLabel: y, defaultPosition: b = 50, position: x, onPositionChange: S, orientation: C = "horizontal", width: w, height: T, radius: E = "md", labels: D, className: O, "aria-label": k, "aria-labelledby": A, "aria-describedby": j, ...M }, N) => {
|
|
14
|
+
let { t: P } = e(t), { handleAriaLabel: F = P("imageCompare.handle") } = D ?? {}, I = x !== void 0, [L, R] = u(m(b)), z = m(I ? x : L), B = C === "vertical", V = l(null), H = l(!1), U = c((e) => {
|
|
15
|
+
V.current = e, typeof N == "function" ? N(e) : N && (N.current = e);
|
|
16
|
+
}, [N]), W = c((e) => {
|
|
17
|
+
let t = m(e);
|
|
18
|
+
I || R(t), S?.(t);
|
|
19
|
+
}, [I, S]), G = c((e, t) => {
|
|
20
|
+
let n = V.current?.getBoundingClientRect();
|
|
20
21
|
if (!n) return;
|
|
21
|
-
let r =
|
|
22
|
-
|
|
23
|
-
}, [
|
|
24
|
-
|
|
25
|
-
}, K = (e) => {
|
|
26
|
-
V.current && W(e.clientX, e.clientY);
|
|
22
|
+
let r = B ? (t - n.top) / n.height * 100 : (e - n.left) / n.width * 100;
|
|
23
|
+
W(r);
|
|
24
|
+
}, [B, W]), K = (e) => {
|
|
25
|
+
H.current = !0, e.currentTarget.setPointerCapture(e.pointerId), G(e.clientX, e.clientY);
|
|
27
26
|
}, q = (e) => {
|
|
28
|
-
|
|
27
|
+
H.current && G(e.clientX, e.clientY);
|
|
29
28
|
}, J = (e) => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
H.current = !1, e.currentTarget.releasePointerCapture?.(e.pointerId);
|
|
30
|
+
}, Y = (e) => {
|
|
31
|
+
let t = e.shiftKey ? 10 : 2, n = B ? "ArrowUp" : "ArrowLeft", r = B ? "ArrowDown" : "ArrowRight";
|
|
32
|
+
e.key === n ? (e.preventDefault(), W(z - t)) : e.key === r ? (e.preventDefault(), W(z + t)) : e.key === "Home" ? (e.preventDefault(), W(0)) : e.key === "End" && (e.preventDefault(), W(100));
|
|
33
|
+
}, X = B ? { clipPath: `inset(0 0 ${100 - z}% 0)` } : { clipPath: `inset(0 ${100 - z}% 0 0)` }, Z = B ? { top: `${z}%` } : { left: `${z}%` };
|
|
34
|
+
return /* @__PURE__ */ p("div", {
|
|
35
|
+
ref: U,
|
|
36
|
+
className: d("wim-image-compare", o.root, B && o.vertical, o[`radius-${E}`], O),
|
|
37
|
+
...M,
|
|
38
|
+
onPointerDown: n(M.onPointerDown, K),
|
|
39
|
+
onPointerMove: n(M.onPointerMove, q),
|
|
40
|
+
onPointerUp: n(M.onPointerUp, J),
|
|
40
41
|
style: {
|
|
41
|
-
width:
|
|
42
|
-
height:
|
|
43
|
-
...
|
|
42
|
+
width: w,
|
|
43
|
+
height: T,
|
|
44
|
+
...M.style
|
|
44
45
|
},
|
|
45
46
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
className:
|
|
48
|
-
src:
|
|
49
|
-
alt:
|
|
47
|
+
/* @__PURE__ */ f("img", {
|
|
48
|
+
className: o.image,
|
|
49
|
+
src: h,
|
|
50
|
+
alt: _,
|
|
50
51
|
draggable: !1
|
|
51
52
|
}),
|
|
52
|
-
|
|
53
|
-
className:
|
|
54
|
-
children:
|
|
53
|
+
y && /* @__PURE__ */ f("span", {
|
|
54
|
+
className: d(o.label, o.afterLabel),
|
|
55
|
+
children: y
|
|
55
56
|
}),
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
className:
|
|
58
|
-
style:
|
|
59
|
-
children: [/* @__PURE__ */
|
|
60
|
-
className:
|
|
61
|
-
src:
|
|
62
|
-
alt:
|
|
57
|
+
/* @__PURE__ */ p("div", {
|
|
58
|
+
className: o.beforeLayer,
|
|
59
|
+
style: X,
|
|
60
|
+
children: [/* @__PURE__ */ f("img", {
|
|
61
|
+
className: o.image,
|
|
62
|
+
src: s,
|
|
63
|
+
alt: g,
|
|
63
64
|
draggable: !1
|
|
64
|
-
}),
|
|
65
|
-
className:
|
|
66
|
-
children:
|
|
65
|
+
}), v && /* @__PURE__ */ f("span", {
|
|
66
|
+
className: d(o.label, o.beforeLabel),
|
|
67
|
+
children: v
|
|
67
68
|
})]
|
|
68
69
|
}),
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
className:
|
|
71
|
-
style:
|
|
72
|
-
children: [/* @__PURE__ */
|
|
73
|
-
className:
|
|
70
|
+
/* @__PURE__ */ p("div", {
|
|
71
|
+
className: o.divider,
|
|
72
|
+
style: Z,
|
|
73
|
+
children: [/* @__PURE__ */ f("span", {
|
|
74
|
+
className: o.line,
|
|
74
75
|
"aria-hidden": "true"
|
|
75
|
-
}), /* @__PURE__ */
|
|
76
|
+
}), /* @__PURE__ */ p("button", {
|
|
76
77
|
type: "button",
|
|
77
|
-
className:
|
|
78
|
+
className: o.handle,
|
|
78
79
|
role: "slider",
|
|
79
|
-
"aria-label":
|
|
80
|
-
"aria-labelledby":
|
|
81
|
-
"aria-describedby":
|
|
82
|
-
"aria-orientation":
|
|
83
|
-
"aria-valuenow": Math.round(
|
|
80
|
+
"aria-label": A ? void 0 : k ?? F,
|
|
81
|
+
"aria-labelledby": A,
|
|
82
|
+
"aria-describedby": j,
|
|
83
|
+
"aria-orientation": C,
|
|
84
|
+
"aria-valuenow": Math.round(z),
|
|
84
85
|
"aria-valuemin": 0,
|
|
85
86
|
"aria-valuemax": 100,
|
|
86
|
-
onKeyDown:
|
|
87
|
-
onPointerDown:
|
|
88
|
-
children: [/* @__PURE__ */
|
|
89
|
-
component: n,
|
|
90
|
-
size: "sm",
|
|
91
|
-
className: a.arrow
|
|
92
|
-
}), /* @__PURE__ */ d(i, {
|
|
87
|
+
onKeyDown: Y,
|
|
88
|
+
onPointerDown: K,
|
|
89
|
+
children: [/* @__PURE__ */ f(a, {
|
|
93
90
|
component: r,
|
|
94
91
|
size: "sm",
|
|
95
|
-
className:
|
|
92
|
+
className: o.arrow
|
|
93
|
+
}), /* @__PURE__ */ f(a, {
|
|
94
|
+
component: i,
|
|
95
|
+
size: "sm",
|
|
96
|
+
className: o.arrow
|
|
96
97
|
})]
|
|
97
98
|
})]
|
|
98
99
|
})
|
|
99
100
|
]
|
|
100
101
|
});
|
|
101
102
|
});
|
|
102
|
-
|
|
103
|
+
h.displayName = "ImageCompare";
|
|
103
104
|
//#endregion
|
|
104
|
-
export {
|
|
105
|
+
export { h as ImageCompare };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/common.cjs"),r=require("../Icon/Icon.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/common.cjs"),r=require("../../_internal/composeEventHandlers.cjs"),i=require("../Icon/Icon.cjs"),a=require("../../../hooks/useMediaLoader.cjs"),ee=require("./hooks/useVideoPlayer.cjs"),o=require("./components/VideoAdvancedMenu.cjs"),s=require("./components/VideoControls.cjs"),c=require("./video.module.cjs");let l=require("react");l=e.__toESM(l,1);let u=require("classnames");u=e.__toESM(u,1);let d=require("react/jsx-runtime");var f=({src:e,width:f,height:p,autoPlay:m=!1,loop:h=!1,muted:g=!1,controls:_=!0,poster:te,radius:v=`none`,shadow:ne=!1,border:y=!1,fit:b=`cover`,preload:x,caption:S,className:C,style:w,customControls:T=!1,advancedControls:E=!1,videoId:D,resumePlayback:O=!1,playlist:k,autoPlayNext:A=!1,qualities:j,loading:M=`lazy`,fadeIn:N=!1,demoDelay:P,labels:F={},tracks:I,...L})=>{let{t:R}=t.useWimTranslation(n.commonNs),{videoAriaLabel:z=R(`video.label`),seconds:B=`s`}=F,{containerRef:V,isLoaded:H,isIntersecting:U,notifyLoaded:W,shouldShowSkeleton:G}=a.useMediaLoader({loading:M,src:j?.[0]?.src||k?.[0]?.src||e,demoDelay:P}),K=ee.useVideoPlayer({src:e,autoPlay:m,loop:h,muted:g,fit:b,videoId:D,resumePlayback:O,playlist:k,autoPlayNext:A,qualities:j,customControls:T,advancedControls:E,poster:te,containerRef:V}),{videoRef:q,isPlaying:J,activeSrc:Y,activePoster:X,showNativeControls:re,skipIndicator:Z,activeMenu:Q,setActiveMenu:$}=K;l.default.useEffect(()=>{let e=q.current;e&&(g?e.setAttribute(`muted`,``):e.removeAttribute(`muted`))},[g,q,Y,U]);let ie={width:`100%`,height:p||`auto`,objectFit:K.activeFit,...w},ae=v===`none`?null:c.default[`radius${v.charAt(0).toUpperCase()+v.slice(1)}`];return(0,d.jsxs)(`figure`,{className:(0,u.default)(`wim-video`,c.default.root,C),style:{width:`100%`},"aria-label":z,"data-testid":`video-root`,children:[(0,d.jsxs)(`div`,{className:(0,u.default)(c.default.inner,ae,ne&&c.default.shadow,y&&c.default.border,(T||E)&&c.default.custom,N&&c.default.fadeIn,N&&H&&c.default.isLoaded,G&&c.default.loading),ref:V,"data-testid":`video-inner`,children:[U&&(0,d.jsx)(`video`,{ref:q,src:Y,className:c.default.video,style:ie,autoPlay:m&&H,loop:h&&(!k||k.length<=1),muted:g,controls:re&&_,poster:X,preload:x,playsInline:!0,"data-testid":`video-element`,...L,onTimeUpdate:r.composeEventHandlers(L.onTimeUpdate,K.handleTimeUpdate),onLoadedMetadata:r.composeEventHandlers(L.onLoadedMetadata,K.handleLoadedMetadata),onLoadedData:r.composeEventHandlers(L.onLoadedData,W),onEnded:r.composeEventHandlers(L.onEnded,K.handleEnded),onPlay:r.composeEventHandlers(L.onPlay,()=>{}),onPause:r.composeEventHandlers(L.onPause,()=>{}),onClick:r.composeEventHandlers(L.onClick,K.handleVideoClick),children:I?.map((e,t)=>(0,d.jsx)(`track`,{...e},t))}),Z.show&&(0,d.jsxs)(`div`,{className:c.default.skipIndicator,children:[(0,d.jsx)(i.Icon,{name:Z.direction===`forward`?`ChevronRightIcon`:`ChevronLeftIcon`,size:`lg`}),(0,d.jsx)(i.Icon,{name:Z.direction===`forward`?`ChevronRightIcon`:`ChevronLeftIcon`,size:`lg`}),(0,d.jsx)(i.Icon,{name:Z.direction===`forward`?`ChevronRightIcon`:`ChevronLeftIcon`,size:`lg`}),(0,d.jsxs)(`span`,{children:[`10`,B]})]}),(T||E)&&(0,d.jsxs)(`div`,{role:`none`,className:c.default.customControls,onClick:()=>Q&&$(null),children:[E&&(0,d.jsx)(o.VideoAdvancedMenu,{styles:c.default,activeMenu:Q,setActiveMenu:$,qualities:j,currentQualityIndex:K.currentQualityIndex,handleQualityChange:K.handleQualityChange,playbackRate:K.playbackRate,setPlaybackRate:K.setPlaybackRate,activeFit:K.activeFit,setActiveFit:K.setActiveFit,playlist:k,currentPlayIndex:K.currentPlayIndex,playPlaylistItem:K.playPlaylistItem,labels:F}),(0,d.jsx)(s.VideoControls,{styles:c.default,playlist:k,advancedControls:E,currentPlayIndex:K.currentPlayIndex,setCurrentPlayIndex:K.setCurrentPlayIndex,skip:K.skip,isPlaying:J,togglePlay:K.togglePlay,currentTime:K.currentTime,duration:K.duration,handleSeek:K.handleSeek,volume:K.volume,isMuted:K.isMuted,toggleMute:K.toggleMute,handleVolumeChange:K.handleVolumeChange,activeMenu:Q,setActiveMenu:$,togglePiP:K.togglePiP,isFullscreen:K.isFullscreen,toggleFullscreen:K.toggleFullscreen,formatTime:K.formatTime,labels:F})]})]}),S&&(0,d.jsx)(`figcaption`,{className:c.default.caption,"data-testid":`video-caption`,children:S})]})};exports.Video=f;
|
|
@@ -1,154 +1,155 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
3
|
import { commonNs as t } from "../../../i18n/generated/common.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
4
|
+
import { composeEventHandlers as n } from "../../_internal/composeEventHandlers.js";
|
|
5
|
+
import { Icon as r } from "../Icon/Icon.js";
|
|
6
|
+
import { useMediaLoader as i } from "../../../hooks/useMediaLoader.js";
|
|
7
|
+
import { useVideoPlayer as a } from "./hooks/useVideoPlayer.js";
|
|
8
|
+
import { VideoAdvancedMenu as o } from "./components/VideoAdvancedMenu.js";
|
|
9
|
+
import { VideoControls as s } from "./components/VideoControls.js";
|
|
10
|
+
import c from "./video.module.js";
|
|
11
|
+
import l from "react";
|
|
12
|
+
import u from "classnames";
|
|
13
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
13
14
|
//#region src/components/media/Video/Video.tsx
|
|
14
|
-
var
|
|
15
|
-
let { t:
|
|
16
|
-
loading:
|
|
17
|
-
src:
|
|
18
|
-
demoDelay:
|
|
19
|
-
}),
|
|
20
|
-
src:
|
|
21
|
-
autoPlay:
|
|
22
|
-
loop:
|
|
23
|
-
muted:
|
|
24
|
-
fit:
|
|
25
|
-
videoId:
|
|
26
|
-
resumePlayback:
|
|
27
|
-
playlist:
|
|
28
|
-
autoPlayNext:
|
|
29
|
-
qualities:
|
|
30
|
-
customControls:
|
|
31
|
-
advancedControls:
|
|
32
|
-
poster:
|
|
33
|
-
containerRef:
|
|
34
|
-
}), { videoRef:
|
|
35
|
-
|
|
36
|
-
let e =
|
|
37
|
-
e && (
|
|
15
|
+
var p = ({ src: p, width: ee, height: te, autoPlay: m = !1, loop: h = !1, muted: g = !1, controls: _ = !0, poster: v, radius: y = "none", shadow: b = !1, border: x = !1, fit: S = "cover", preload: C, caption: w, className: T, style: ne, customControls: E = !1, advancedControls: D = !1, videoId: O, resumePlayback: k = !1, playlist: A, autoPlayNext: j = !1, qualities: M, loading: N = "lazy", fadeIn: P = !1, demoDelay: F, labels: I = {}, tracks: L, ...R }) => {
|
|
16
|
+
let { t: z } = e(t), { videoAriaLabel: B = z("video.label"), seconds: V = "s" } = I, { containerRef: H, isLoaded: U, isIntersecting: W, notifyLoaded: G, shouldShowSkeleton: K } = i({
|
|
17
|
+
loading: N,
|
|
18
|
+
src: M?.[0]?.src || A?.[0]?.src || p,
|
|
19
|
+
demoDelay: F
|
|
20
|
+
}), q = a({
|
|
21
|
+
src: p,
|
|
22
|
+
autoPlay: m,
|
|
23
|
+
loop: h,
|
|
24
|
+
muted: g,
|
|
25
|
+
fit: S,
|
|
26
|
+
videoId: O,
|
|
27
|
+
resumePlayback: k,
|
|
28
|
+
playlist: A,
|
|
29
|
+
autoPlayNext: j,
|
|
30
|
+
qualities: M,
|
|
31
|
+
customControls: E,
|
|
32
|
+
advancedControls: D,
|
|
33
|
+
poster: v,
|
|
34
|
+
containerRef: H
|
|
35
|
+
}), { videoRef: J, isPlaying: Y, activeSrc: X, activePoster: re, showNativeControls: ie, skipIndicator: Z, activeMenu: Q, setActiveMenu: $ } = q;
|
|
36
|
+
l.useEffect(() => {
|
|
37
|
+
let e = J.current;
|
|
38
|
+
e && (g ? e.setAttribute("muted", "") : e.removeAttribute("muted"));
|
|
38
39
|
}, [
|
|
39
|
-
|
|
40
|
-
K,
|
|
40
|
+
g,
|
|
41
41
|
J,
|
|
42
|
-
|
|
42
|
+
X,
|
|
43
|
+
W
|
|
43
44
|
]);
|
|
44
|
-
let
|
|
45
|
+
let ae = {
|
|
45
46
|
width: "100%",
|
|
46
|
-
height:
|
|
47
|
-
objectFit:
|
|
48
|
-
...
|
|
49
|
-
},
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
-
className:
|
|
47
|
+
height: te || "auto",
|
|
48
|
+
objectFit: q.activeFit,
|
|
49
|
+
...ne
|
|
50
|
+
}, oe = y === "none" ? null : c[`radius${y.charAt(0).toUpperCase() + y.slice(1)}`];
|
|
51
|
+
return /* @__PURE__ */ f("figure", {
|
|
52
|
+
className: u("wim-video", c.root, T),
|
|
52
53
|
style: { width: "100%" },
|
|
53
|
-
"aria-label":
|
|
54
|
+
"aria-label": B,
|
|
54
55
|
"data-testid": "video-root",
|
|
55
|
-
children: [/* @__PURE__ */
|
|
56
|
-
className: c
|
|
57
|
-
ref:
|
|
56
|
+
children: [/* @__PURE__ */ f("div", {
|
|
57
|
+
className: u(c.inner, oe, b && c.shadow, x && c.border, (E || D) && c.custom, P && c.fadeIn, P && U && c.isLoaded, K && c.loading),
|
|
58
|
+
ref: H,
|
|
58
59
|
"data-testid": "video-inner",
|
|
59
60
|
children: [
|
|
60
|
-
|
|
61
|
-
ref:
|
|
62
|
-
src:
|
|
63
|
-
className:
|
|
64
|
-
style:
|
|
65
|
-
autoPlay:
|
|
66
|
-
loop:
|
|
67
|
-
muted:
|
|
68
|
-
controls:
|
|
69
|
-
poster:
|
|
70
|
-
preload:
|
|
61
|
+
W && /* @__PURE__ */ d("video", {
|
|
62
|
+
ref: J,
|
|
63
|
+
src: X,
|
|
64
|
+
className: c.video,
|
|
65
|
+
style: ae,
|
|
66
|
+
autoPlay: m && U,
|
|
67
|
+
loop: h && (!A || A.length <= 1),
|
|
68
|
+
muted: g,
|
|
69
|
+
controls: ie && _,
|
|
70
|
+
poster: re,
|
|
71
|
+
preload: C,
|
|
71
72
|
playsInline: !0,
|
|
72
|
-
onTimeUpdate: G.handleTimeUpdate,
|
|
73
|
-
onLoadedMetadata: G.handleLoadedMetadata,
|
|
74
|
-
onLoadedData: U,
|
|
75
|
-
onEnded: G.handleEnded,
|
|
76
|
-
onPlay: () => {},
|
|
77
|
-
onPause: () => {},
|
|
78
|
-
onClick: G.handleVideoClick,
|
|
79
73
|
"data-testid": "video-element",
|
|
80
|
-
...
|
|
81
|
-
|
|
74
|
+
...R,
|
|
75
|
+
onTimeUpdate: n(R.onTimeUpdate, q.handleTimeUpdate),
|
|
76
|
+
onLoadedMetadata: n(R.onLoadedMetadata, q.handleLoadedMetadata),
|
|
77
|
+
onLoadedData: n(R.onLoadedData, G),
|
|
78
|
+
onEnded: n(R.onEnded, q.handleEnded),
|
|
79
|
+
onPlay: n(R.onPlay, () => {}),
|
|
80
|
+
onPause: n(R.onPause, () => {}),
|
|
81
|
+
onClick: n(R.onClick, q.handleVideoClick),
|
|
82
|
+
children: L?.map((e, t) => /* @__PURE__ */ d("track", { ...e }, t))
|
|
82
83
|
}),
|
|
83
|
-
Z.show && /* @__PURE__ */
|
|
84
|
-
className:
|
|
84
|
+
Z.show && /* @__PURE__ */ f("div", {
|
|
85
|
+
className: c.skipIndicator,
|
|
85
86
|
children: [
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ d(r, {
|
|
87
88
|
name: Z.direction === "forward" ? "ChevronRightIcon" : "ChevronLeftIcon",
|
|
88
89
|
size: "lg"
|
|
89
90
|
}),
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ d(r, {
|
|
91
92
|
name: Z.direction === "forward" ? "ChevronRightIcon" : "ChevronLeftIcon",
|
|
92
93
|
size: "lg"
|
|
93
94
|
}),
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ d(r, {
|
|
95
96
|
name: Z.direction === "forward" ? "ChevronRightIcon" : "ChevronLeftIcon",
|
|
96
97
|
size: "lg"
|
|
97
98
|
}),
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ f("span", { children: ["10", V] })
|
|
99
100
|
]
|
|
100
101
|
}),
|
|
101
|
-
(
|
|
102
|
+
(E || D) && /* @__PURE__ */ f("div", {
|
|
102
103
|
role: "none",
|
|
103
|
-
className:
|
|
104
|
+
className: c.customControls,
|
|
104
105
|
onClick: () => Q && $(null),
|
|
105
|
-
children: [
|
|
106
|
-
styles:
|
|
106
|
+
children: [D && /* @__PURE__ */ d(o, {
|
|
107
|
+
styles: c,
|
|
107
108
|
activeMenu: Q,
|
|
108
109
|
setActiveMenu: $,
|
|
109
|
-
qualities:
|
|
110
|
-
currentQualityIndex:
|
|
111
|
-
handleQualityChange:
|
|
112
|
-
playbackRate:
|
|
113
|
-
setPlaybackRate:
|
|
114
|
-
activeFit:
|
|
115
|
-
setActiveFit:
|
|
116
|
-
playlist:
|
|
117
|
-
currentPlayIndex:
|
|
118
|
-
playPlaylistItem:
|
|
119
|
-
labels:
|
|
120
|
-
}), /* @__PURE__ */
|
|
121
|
-
styles:
|
|
122
|
-
playlist:
|
|
123
|
-
advancedControls:
|
|
124
|
-
currentPlayIndex:
|
|
125
|
-
setCurrentPlayIndex:
|
|
126
|
-
skip:
|
|
127
|
-
isPlaying:
|
|
128
|
-
togglePlay:
|
|
129
|
-
currentTime:
|
|
130
|
-
duration:
|
|
131
|
-
handleSeek:
|
|
132
|
-
volume:
|
|
133
|
-
isMuted:
|
|
134
|
-
toggleMute:
|
|
135
|
-
handleVolumeChange:
|
|
110
|
+
qualities: M,
|
|
111
|
+
currentQualityIndex: q.currentQualityIndex,
|
|
112
|
+
handleQualityChange: q.handleQualityChange,
|
|
113
|
+
playbackRate: q.playbackRate,
|
|
114
|
+
setPlaybackRate: q.setPlaybackRate,
|
|
115
|
+
activeFit: q.activeFit,
|
|
116
|
+
setActiveFit: q.setActiveFit,
|
|
117
|
+
playlist: A,
|
|
118
|
+
currentPlayIndex: q.currentPlayIndex,
|
|
119
|
+
playPlaylistItem: q.playPlaylistItem,
|
|
120
|
+
labels: I
|
|
121
|
+
}), /* @__PURE__ */ d(s, {
|
|
122
|
+
styles: c,
|
|
123
|
+
playlist: A,
|
|
124
|
+
advancedControls: D,
|
|
125
|
+
currentPlayIndex: q.currentPlayIndex,
|
|
126
|
+
setCurrentPlayIndex: q.setCurrentPlayIndex,
|
|
127
|
+
skip: q.skip,
|
|
128
|
+
isPlaying: Y,
|
|
129
|
+
togglePlay: q.togglePlay,
|
|
130
|
+
currentTime: q.currentTime,
|
|
131
|
+
duration: q.duration,
|
|
132
|
+
handleSeek: q.handleSeek,
|
|
133
|
+
volume: q.volume,
|
|
134
|
+
isMuted: q.isMuted,
|
|
135
|
+
toggleMute: q.toggleMute,
|
|
136
|
+
handleVolumeChange: q.handleVolumeChange,
|
|
136
137
|
activeMenu: Q,
|
|
137
138
|
setActiveMenu: $,
|
|
138
|
-
togglePiP:
|
|
139
|
-
isFullscreen:
|
|
140
|
-
toggleFullscreen:
|
|
141
|
-
formatTime:
|
|
142
|
-
labels:
|
|
139
|
+
togglePiP: q.togglePiP,
|
|
140
|
+
isFullscreen: q.isFullscreen,
|
|
141
|
+
toggleFullscreen: q.toggleFullscreen,
|
|
142
|
+
formatTime: q.formatTime,
|
|
143
|
+
labels: I
|
|
143
144
|
})]
|
|
144
145
|
})
|
|
145
146
|
]
|
|
146
|
-
}),
|
|
147
|
-
className:
|
|
147
|
+
}), w && /* @__PURE__ */ d("figcaption", {
|
|
148
|
+
className: c.caption,
|
|
148
149
|
"data-testid": "video-caption",
|
|
149
|
-
children:
|
|
150
|
+
children: w
|
|
150
151
|
})]
|
|
151
152
|
});
|
|
152
153
|
};
|
|
153
154
|
//#endregion
|
|
154
|
-
export {
|
|
155
|
+
export { p as Video };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("./anchor.module.cjs");let
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../_internal/observeMove.cjs"),n=require("./anchor.module.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("classnames");i=e.__toESM(i,1);let a=require("react/jsx-runtime");var o=({items:e=[],bounds:o=5,offset:s=0,direction:c=`vertical`,className:l,style:u,"aria-label":d,"aria-labelledby":f})=>{let[p,m]=(0,r.useState)(``),[h,g]=(0,r.useState)({}),_=(0,r.useRef)(null),v=(e,t)=>{e.preventDefault();let n=t.replace(`#`,``),r=document.getElementById(n);r&&(window.scrollTo({top:r.offsetTop-s,behavior:`smooth`}),m(t))};(0,r.useLayoutEffect)(()=>{let n=()=>{let t=(e,n)=>{let r=[];return e.forEach(e=>{r.push({href:e.href,parentHref:n}),e.children&&(r=r.concat(t(e.children,n||e.href)))}),r},n=t(e),r=``,i=window.scrollY||document.documentElement.scrollTop,a=document.documentElement.scrollHeight,l=document.documentElement.clientHeight;if(i>0&&Math.ceil(i+l)>=a&&n.length>0){let e=n[n.length-1];r=c===`horizontal`&&e.parentHref?e.parentHref:e.href}else for(let e of n){let t=e.href.replace(`#`,``),n=document.getElementById(t);if(n){if(n.getBoundingClientRect().top<=s+o)r=c===`horizontal`&&e.parentHref?e.parentHref:e.href;else break}}r&&r!==p&&m(r)};window.addEventListener(`scroll`,n),window.addEventListener(`resize`,n);let r=e=>e.flatMap(e=>[e.href,...e.children?r(e.children):[]]),i=r(e).map(e=>document.getElementById(e.replace(`#`,``))).filter(e=>e!==null).map(e=>t.observeMove(e,n));return n(),()=>{window.removeEventListener(`scroll`,n),window.removeEventListener(`resize`,n),i.forEach(e=>e())}},[e,s,o,p,c]);let y=(0,r.useCallback)(()=>{if(!p||!_.current)return;let e=_.current.querySelector(`a[href="${p}"]`);if(e){let t=_.current.getBoundingClientRect();if(c===`vertical`){let n=e.getBoundingClientRect();g({top:n.top-t.top,height:n.height,opacity:1})}else{let r=_.current.querySelector(`.${n.default.list}`);if(r){let n=e.getBoundingClientRect(),i=r.getBoundingClientRect(),a=n.left-i.left+r.scrollLeft,o=a-i.width/2+n.width/2,s=r.scrollWidth-i.width,c=Math.max(0,Math.min(o,s)),l=a-c+(i.left-t.left);g({left:l,width:n.width,opacity:1}),r.scrollTo({left:c,behavior:`smooth`})}else{let t=e.getBoundingClientRect();g({left:t.left-_.current.getBoundingClientRect().left,width:t.width,opacity:1})}}}else g({opacity:0})},[p,c]);(0,r.useLayoutEffect)(()=>{y()},[y]),(0,r.useEffect)(()=>{let e=_.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>y());return t.observe(e),e.querySelectorAll(`a`).forEach(e=>t.observe(e)),()=>t.disconnect()},[y,e]);let b=e=>(0,a.jsx)(`ul`,{className:(0,i.default)(n.default.list,n.default[c]),children:e.map(e=>(0,a.jsxs)(`li`,{className:(0,i.default)(n.default.item,p===e.href&&n.default.active),children:[(0,a.jsx)(`a`,{href:e.href,className:n.default.link,"aria-current":p===e.href?`location`:void 0,onClick:t=>v(t,e.href),title:typeof e.title==`string`?e.title:void 0,children:e.title}),e.children&&c===`vertical`&&b(e.children)]},e.key))});return(0,a.jsxs)(`div`,{className:(0,i.default)(`wim-anchor`,n.default.root,n.default[c],l),style:u,ref:_,role:d||f?`navigation`:void 0,"aria-label":f?void 0:d,"aria-labelledby":f,children:[(0,a.jsx)(`div`,{className:n.default.ink,children:(0,a.jsx)(`span`,{className:n.default.inkBall,style:h})}),b(e)]})};exports.Anchor=o,exports.default=o;
|