wimui 0.51.1 → 0.52.0
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/FeedbackCloseButton.cjs +1 -1
- package/dist/components/_internal/FeedbackCloseButton.js +14 -13
- package/dist/components/_internal/FieldLabelContent.cjs +1 -1
- package/dist/components/_internal/FieldLabelContent.js +18 -17
- package/dist/components/ai/AIResponseFeedback/AIResponseFeedback.cjs +1 -1
- package/dist/components/ai/AIResponseFeedback/AIResponseFeedback.js +46 -45
- package/dist/components/ai/AgentStatus/AgentStatus.cjs +1 -1
- package/dist/components/ai/AgentStatus/AgentStatus.js +24 -23
- package/dist/components/ai/ArtifactsOverlay/ArtifactsOverlay.cjs +1 -1
- package/dist/components/ai/ArtifactsOverlay/ArtifactsOverlay.js +47 -45
- package/dist/components/ai/ChatUI/ChatUI.cjs +1 -1
- package/dist/components/ai/ChatUI/ChatUI.js +82 -81
- package/dist/components/ai/CodeBlock/CodeBlock.cjs +3 -3
- package/dist/components/ai/CodeBlock/CodeBlock.js +53 -52
- package/dist/components/ai/CodeDiffViewer/CodeDiffViewer.cjs +2 -2
- package/dist/components/ai/CodeDiffViewer/CodeDiffViewer.js +105 -104
- package/dist/components/ai/MarkdownRenderer/MarkdownRenderer.cjs +1 -1
- package/dist/components/ai/MarkdownRenderer/MarkdownRenderer.js +60 -59
- package/dist/components/ai/ModelSelector/ModelSelector.cjs +1 -1
- package/dist/components/ai/ModelSelector/ModelSelector.js +122 -120
- package/dist/components/ai/ModelSelector/model-selector.module.cjs +1 -1
- package/dist/components/ai/ModelSelector/model-selector.module.js +1 -1
- package/dist/components/ai/PromptInput/PromptInput.cjs +1 -1
- package/dist/components/ai/PromptInput/PromptInput.js +76 -75
- package/dist/components/ai/SourceCitation/SourceCitation.cjs +1 -1
- package/dist/components/ai/SourceCitation/SourceCitation.js +39 -38
- package/dist/components/ai/Terminal/Terminal.cjs +2 -2
- package/dist/components/ai/Terminal/Terminal.js +65 -64
- package/dist/components/ai/ThreadList/ThreadList.cjs +1 -1
- package/dist/components/ai/ThreadList/ThreadList.js +64 -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/Barcode/Barcode.cjs +1 -1
- package/dist/components/data-display/Barcode/Barcode.js +76 -75
- package/dist/components/data-display/Calendar/Calendar.cjs +1 -1
- package/dist/components/data-display/Calendar/Calendar.js +75 -74
- package/dist/components/data-display/CalendarHeatmap/CalendarHeatmap.cjs +1 -1
- package/dist/components/data-display/CalendarHeatmap/CalendarHeatmap.js +54 -52
- package/dist/components/data-display/Carousel/Carousel.cjs +1 -1
- package/dist/components/data-display/Carousel/Carousel.js +24 -23
- package/dist/components/data-display/Chip/Chip.cjs +1 -1
- package/dist/components/data-display/Chip/Chip.js +36 -35
- package/dist/components/data-display/Comment/Comment.cjs +1 -1
- package/dist/components/data-display/Comment/Comment.js +58 -57
- package/dist/components/data-display/Countdown/Countdown.cjs +1 -1
- package/dist/components/data-display/Countdown/Countdown.js +56 -55
- package/dist/components/data-display/DataGrid/DataGrid.cjs +1 -1
- package/dist/components/data-display/DataGrid/DataGrid.js +128 -127
- package/dist/components/data-display/JsonViewer/JsonViewer.cjs +1 -1
- package/dist/components/data-display/JsonViewer/JsonViewer.js +153 -152
- package/dist/components/data-display/Kanban/Kanban.cjs +1 -1
- package/dist/components/data-display/Kanban/Kanban.js +95 -94
- package/dist/components/data-display/NodeGraph/NodeGraph.cjs +1 -1
- package/dist/components/data-display/NodeGraph/NodeGraph.js +67 -66
- package/dist/components/data-display/PivotTable/PivotTable.cjs +1 -1
- package/dist/components/data-display/PivotTable/PivotTable.js +153 -152
- package/dist/components/data-display/Presence/Presence.cjs +1 -1
- package/dist/components/data-display/Presence/Presence.js +28 -27
- 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/Reaction/Reaction.cjs +1 -1
- package/dist/components/data-display/Reaction/Reaction.js +31 -30
- package/dist/components/data-display/ScheduleView/ScheduleView.cjs +1 -1
- package/dist/components/data-display/ScheduleView/ScheduleView.js +52 -50
- package/dist/components/data-display/SortableList/SortableList.cjs +1 -1
- package/dist/components/data-display/SortableList/SortableList.js +44 -43
- package/dist/components/data-display/Tag/Tag.cjs +1 -1
- package/dist/components/data-display/Tag/Tag.js +29 -28
- package/dist/components/data-display/TreeDiagram/TreeDiagram.cjs +1 -1
- package/dist/components/data-display/TreeDiagram/TreeDiagram.js +85 -84
- package/dist/components/data-display/TreeView/TreeView.cjs +1 -1
- package/dist/components/data-display/TreeView/TreeView.js +123 -122
- package/dist/components/feedback/Autosave/Autosave.cjs +1 -1
- package/dist/components/feedback/Autosave/Autosave.js +32 -31
- package/dist/components/feedback/ErrorBoundary/ErrorBoundary.cjs +1 -1
- package/dist/components/feedback/ErrorBoundary/ErrorBoundary.js +35 -34
- package/dist/components/feedback/ScrollProgress/ScrollProgress.cjs +1 -1
- package/dist/components/feedback/ScrollProgress/ScrollProgress.js +21 -20
- package/dist/components/feedback/Tour/Tour.cjs +1 -1
- package/dist/components/feedback/Tour/Tour.js +127 -101
- package/dist/components/form/Button/Button.cjs +1 -1
- package/dist/components/form/Button/Button.js +55 -54
- package/dist/components/form/ColorInput/ColorInput.cjs +1 -1
- package/dist/components/form/ColorInput/ColorInput.js +30 -29
- package/dist/components/form/ColorPicker/color-picker.module.cjs +1 -1
- package/dist/components/form/ColorPicker/color-picker.module.js +1 -1
- package/dist/components/form/CopyButton/CopyButton.cjs +1 -1
- package/dist/components/form/CopyButton/CopyButton.js +27 -26
- package/dist/components/form/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/form/DatePicker/DatePicker.js +47 -46
- package/dist/components/form/DateRangePicker/DateRangePicker.cjs +1 -1
- package/dist/components/form/DateRangePicker/DateRangePicker.js +36 -35
- package/dist/components/form/Dropzone/Dropzone.cjs +1 -1
- package/dist/components/form/Dropzone/Dropzone.js +56 -55
- package/dist/components/form/FileUpload/FileUpload.cjs +1 -1
- package/dist/components/form/FileUpload/FileUpload.js +47 -46
- package/dist/components/form/FloatButton/FloatButton.cjs +1 -1
- package/dist/components/form/FloatButton/FloatButton.d.ts +4 -1
- package/dist/components/form/FloatButton/FloatButton.js +6 -6
- package/dist/components/form/ImageCropper/ImageCropper.cjs +1 -1
- package/dist/components/form/ImageCropper/ImageCropper.js +101 -99
- package/dist/components/form/InlineEdit/InlineEdit.cjs +1 -1
- package/dist/components/form/InlineEdit/InlineEdit.js +66 -65
- package/dist/components/form/Input/Input.cjs +1 -1
- package/dist/components/form/Input/Input.js +45 -44
- package/dist/components/form/InputBase/InputBase.cjs +1 -1
- package/dist/components/form/InputBase/InputBase.js +51 -50
- package/dist/components/form/InputBase/input-base.module.cjs +1 -1
- package/dist/components/form/InputBase/input-base.module.js +1 -1
- package/dist/components/form/MultiSelect/multiselect.module.cjs +1 -1
- package/dist/components/form/MultiSelect/multiselect.module.js +1 -1
- 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/PasswordStrength/PasswordStrength.cjs +1 -1
- package/dist/components/form/PasswordStrength/PasswordStrength.js +27 -26
- package/dist/components/form/PhoneInput/PhoneInput.cjs +1 -1
- package/dist/components/form/PhoneInput/PhoneInput.js +10 -10
- package/dist/components/form/QueryBuilder/QueryBuilder.cjs +1 -1
- package/dist/components/form/QueryBuilder/QueryBuilder.js +90 -89
- package/dist/components/form/RangeSlider/RangeSlider.cjs +1 -1
- package/dist/components/form/RangeSlider/RangeSlider.js +121 -119
- 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/RichTextEditor/RichTextEditor.cjs +1 -1
- package/dist/components/form/RichTextEditor/RichTextEditor.js +223 -222
- package/dist/components/form/SegmentedControl/SegmentedControl.cjs +1 -1
- package/dist/components/form/SegmentedControl/SegmentedControl.js +7 -7
- package/dist/components/form/Select/Select.cjs +1 -1
- package/dist/components/form/Select/Select.js +112 -111
- package/dist/components/form/SignaturePad/SignaturePad.cjs +1 -1
- package/dist/components/form/SignaturePad/SignaturePad.js +86 -79
- package/dist/components/form/SmartSearchInput/SmartSearchInput.cjs +1 -1
- package/dist/components/form/SmartSearchInput/SmartSearchInput.js +63 -62
- package/dist/components/form/TagInput/TagInput.cjs +1 -1
- package/dist/components/form/TagInput/TagInput.js +68 -67
- package/dist/components/form/ThemeToggle/ThemeToggle.cjs +1 -1
- package/dist/components/form/ThemeToggle/ThemeToggle.js +69 -67
- package/dist/components/form/ThemeToggle/theme-toggle.module.cjs +1 -1
- package/dist/components/form/ThemeToggle/theme-toggle.module.js +1 -1
- package/dist/components/form/ToggleGroup/ToggleGroup.cjs +1 -1
- package/dist/components/form/ToggleGroup/ToggleGroup.js +6 -6
- 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 +155 -154
- package/dist/components/form/Transfer/transfer.module.cjs +1 -1
- package/dist/components/form/Transfer/transfer.module.js +6 -6
- package/dist/components/form/TreeSelect/TreeSelect.cjs +1 -1
- package/dist/components/form/TreeSelect/TreeSelect.js +6 -6
- package/dist/components/layout/Dashboard/Dashboard.cjs +1 -1
- package/dist/components/layout/Dashboard/Dashboard.js +90 -89
- package/dist/components/layout/Navbar/Navbar.cjs +1 -1
- package/dist/components/layout/Navbar/Navbar.d.ts +1 -1
- package/dist/components/layout/Navbar/Navbar.js +1 -1
- package/dist/components/layout/Sidebar/Sidebar.d.ts +1 -1
- package/dist/components/layout/Splitter/Splitter.cjs +1 -1
- package/dist/components/layout/Splitter/Splitter.js +40 -39
- package/dist/components/layout/Toolbar/Toolbar.cjs +1 -1
- package/dist/components/layout/Toolbar/Toolbar.js +66 -39
- package/dist/components/media/Audio/Audio.cjs +1 -1
- package/dist/components/media/Audio/Audio.js +91 -90
- package/dist/components/media/Audio/components/AudioCustomControls.cjs +1 -1
- package/dist/components/media/Audio/components/AudioCustomControls.js +116 -114
- package/dist/components/media/Gallery/Gallery.cjs +1 -1
- package/dist/components/media/Gallery/Gallery.js +132 -131
- package/dist/components/media/ImageCompare/ImageCompare.cjs +1 -1
- package/dist/components/media/ImageCompare/ImageCompare.js +75 -73
- package/dist/components/media/Lightbox/Lightbox.cjs +1 -1
- package/dist/components/media/Lightbox/Lightbox.js +128 -127
- package/dist/components/media/Video/Video.cjs +1 -1
- package/dist/components/media/Video/Video.js +73 -71
- package/dist/components/media/Video/components/VideoAdvancedMenu.cjs +1 -1
- package/dist/components/media/Video/components/VideoAdvancedMenu.js +140 -138
- package/dist/components/media/Video/components/VideoControls.cjs +1 -1
- package/dist/components/media/Video/components/VideoControls.js +103 -102
- package/dist/components/navigation/BackTop/BackTop.cjs +1 -1
- package/dist/components/navigation/BackTop/BackTop.js +37 -36
- package/dist/components/navigation/Breadcrumb/Breadcrumb.cjs +1 -1
- package/dist/components/navigation/Breadcrumb/Breadcrumb.js +41 -40
- package/dist/components/navigation/CommandPalette/CommandPalette.cjs +1 -1
- package/dist/components/navigation/CommandPalette/CommandPalette.js +100 -99
- package/dist/components/navigation/HamburgerMenu/HamburgerMenu.cjs +1 -1
- package/dist/components/navigation/HamburgerMenu/HamburgerMenu.d.ts +6 -0
- package/dist/components/navigation/HamburgerMenu/HamburgerMenu.js +32 -22
- package/dist/components/navigation/Pagination/Pagination.cjs +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +39 -38
- package/dist/components/navigation/SpeedDial/SpeedDial.cjs +1 -1
- package/dist/components/navigation/SpeedDial/SpeedDial.js +44 -43
- package/dist/components/navigation/Tabs/tabs.module.cjs +1 -1
- package/dist/components/navigation/Tabs/tabs.module.js +1 -1
- package/dist/components/overlay/ContextMenu/ContextMenu.cjs +1 -1
- package/dist/components/overlay/ContextMenu/ContextMenu.js +4 -4
- package/dist/components/overlay/Popover/Popover.cjs +1 -1
- package/dist/components/overlay/Popover/Popover.js +63 -62
- package/dist/components/typography/Spoiler/Spoiler.cjs +1 -1
- package/dist/components/typography/Spoiler/Spoiler.js +38 -37
- package/dist/i18n/generated/common.cjs +2 -0
- package/dist/i18n/generated/common.d.ts +3 -0
- package/dist/i18n/generated/common.js +570 -0
- package/dist/i18n/generated/components.cjs +2 -0
- package/dist/i18n/generated/components.d.ts +3 -0
- package/dist/i18n/generated/components.js +399 -0
- package/dist/i18n/generated/data-display.cjs +2 -0
- package/dist/i18n/generated/data-display.d.ts +3 -0
- package/dist/i18n/generated/data-display.js +12 -0
- package/dist/i18n/generated/form.cjs +2 -0
- package/dist/i18n/generated/form.d.ts +3 -0
- package/dist/i18n/generated/form.js +321 -0
- package/dist/i18n/generated/keys.d.ts +5 -1
- package/dist/i18n/generated/locales.cjs +2 -0
- package/dist/i18n/generated/locales.d.ts +1 -0
- package/dist/i18n/generated/locales.js +9 -0
- package/dist/i18n/instance.cjs +1 -1
- package/dist/i18n/instance.d.ts +18 -3
- package/dist/i18n/instance.js +24 -26
- package/dist/i18n/useWimTranslation.cjs +1 -1
- package/dist/i18n/useWimTranslation.d.ts +7 -8
- package/dist/i18n/useWimTranslation.js +6 -5
- package/dist/llms-full.txt +10 -6
- 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 +5 -5
- package/package.json +10 -10
- package/dist/i18n/generated/resources.cjs +0 -2
- package/dist/i18n/generated/resources.d.ts +0 -4
- package/dist/i18n/generated/resources.js +0 -1103
|
@@ -2,183 +2,184 @@
|
|
|
2
2
|
import { Root as e, Slottable as t } from "../../../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
3
3
|
import { useWimTranslation as n } from "../../../i18n/useWimTranslation.js";
|
|
4
4
|
import { OverlayBase as r } from "../../_internal/OverlayBase.js";
|
|
5
|
-
import i from "../../../
|
|
6
|
-
import a from "../../../icon/chevron-
|
|
7
|
-
import o from "../../../icon/
|
|
8
|
-
import s from "../../../icon/
|
|
9
|
-
import c from "../../../icon/
|
|
10
|
-
import
|
|
11
|
-
import u from "
|
|
12
|
-
import
|
|
13
|
-
import g from "
|
|
14
|
-
import
|
|
5
|
+
import { componentsNs as i } from "../../../i18n/generated/components.js";
|
|
6
|
+
import a from "../../../icon/chevron-left.js";
|
|
7
|
+
import o from "../../../icon/chevron-right.js";
|
|
8
|
+
import s from "../../../icon/close.js";
|
|
9
|
+
import c from "../../../icon/minus.js";
|
|
10
|
+
import l from "../../../icon/plus.js";
|
|
11
|
+
import { Icon as u } from "../Icon/Icon.js";
|
|
12
|
+
import d from "./lightbox.module.js";
|
|
13
|
+
import { createContext as f, useCallback as p, useContext as m, useEffect as h, useState as g } from "react";
|
|
14
|
+
import _ from "classnames";
|
|
15
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
15
16
|
//#region src/components/media/Lightbox/Lightbox.tsx
|
|
16
|
-
var
|
|
17
|
-
let e =
|
|
17
|
+
var b = f(void 0), x = () => {
|
|
18
|
+
let e = m(b);
|
|
18
19
|
if (!e) throw Error("Lightbox components must be used within Lightbox");
|
|
19
20
|
return e;
|
|
20
|
-
},
|
|
21
|
-
let [a, o] =
|
|
21
|
+
}, S = ({ children: e, open: t, onOpenChange: n, defaultOpen: r = !1, defaultIndex: i = 0 }) => {
|
|
22
|
+
let [a, o] = g(r), [s, c] = g(i), [l, u] = g([]), d = t !== void 0, f = d ? t : a, m = p((e) => {
|
|
22
23
|
d || o(e), n?.(e);
|
|
23
|
-
}, [d, n]),
|
|
24
|
+
}, [d, n]), h = p((e) => {
|
|
24
25
|
let t = -1;
|
|
25
26
|
return u((n) => (t = n.length, [...n, e])), t;
|
|
26
|
-
}, []),
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
}, []), _ = p((e) => {}, []);
|
|
28
|
+
return /* @__PURE__ */ v(b.Provider, {
|
|
28
29
|
value: {
|
|
29
|
-
open:
|
|
30
|
+
open: f,
|
|
30
31
|
setOpen: m,
|
|
31
32
|
currentIndex: s,
|
|
32
33
|
setCurrentIndex: c,
|
|
33
34
|
items: l,
|
|
34
35
|
setItems: u,
|
|
35
|
-
registerItem:
|
|
36
|
-
unregisterItem:
|
|
36
|
+
registerItem: h,
|
|
37
|
+
unregisterItem: _
|
|
37
38
|
},
|
|
38
39
|
children: e
|
|
39
40
|
});
|
|
40
|
-
},
|
|
41
|
-
let { setOpen:
|
|
42
|
-
if (
|
|
43
|
-
else if (
|
|
44
|
-
let e =
|
|
45
|
-
if (e !== -1)
|
|
41
|
+
}, C = ({ children: r, className: a, onClick: o, asChild: s = !1, index: c, src: l, alt: u, caption: f, ...p }) => {
|
|
42
|
+
let { setOpen: m, setCurrentIndex: h, items: g, setItems: y } = x(), { t: b } = n(i), S = (e) => {
|
|
43
|
+
if (o?.(e), c !== void 0) h(c);
|
|
44
|
+
else if (l) {
|
|
45
|
+
let e = g.findIndex((e) => e.src === l);
|
|
46
|
+
if (e !== -1) h(e);
|
|
46
47
|
else {
|
|
47
|
-
let e =
|
|
48
|
-
|
|
49
|
-
src:
|
|
50
|
-
alt:
|
|
51
|
-
caption:
|
|
52
|
-
}]),
|
|
48
|
+
let e = g.length;
|
|
49
|
+
y((e) => [...e, {
|
|
50
|
+
src: l,
|
|
51
|
+
alt: u,
|
|
52
|
+
caption: f
|
|
53
|
+
}]), h(e);
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
return /* @__PURE__ */
|
|
56
|
+
m(!0);
|
|
57
|
+
}, C = s ? e : "button", w = c === void 0 ? void 0 : g[c]?.alt, T = p["aria-label"] !== void 0 || p["aria-labelledby"] !== void 0, E = u ?? w, D = T ? void 0 : E ? b("lightbox.open_named", { name: E }) : b("lightbox.open");
|
|
58
|
+
return /* @__PURE__ */ v(C, {
|
|
58
59
|
type: "button",
|
|
59
|
-
className:
|
|
60
|
-
onClick:
|
|
61
|
-
"aria-label":
|
|
62
|
-
...
|
|
63
|
-
children: /* @__PURE__ */
|
|
60
|
+
className: _(d.trigger, a),
|
|
61
|
+
onClick: S,
|
|
62
|
+
"aria-label": D,
|
|
63
|
+
...p,
|
|
64
|
+
children: /* @__PURE__ */ v(t, { children: r })
|
|
64
65
|
});
|
|
65
|
-
},
|
|
66
|
-
let { open:
|
|
67
|
-
|
|
66
|
+
}, w = ({ className: e, showCloseButton: t = !0, showNavigation: f = !0, showCounter: m = !0, closeOnOverlayClick: b = !0, ...S }) => {
|
|
67
|
+
let { open: C, setOpen: w, currentIndex: T, setCurrentIndex: E, items: D } = x(), { t: O } = n(i), [k, A] = g(1), j = p(() => {
|
|
68
|
+
E((T - 1 + D.length) % D.length), A(1);
|
|
68
69
|
}, [
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
]),
|
|
73
|
-
|
|
70
|
+
T,
|
|
71
|
+
D.length,
|
|
72
|
+
E
|
|
73
|
+
]), M = p(() => {
|
|
74
|
+
E((T + 1) % D.length), A(1);
|
|
74
75
|
}, [
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
]),
|
|
79
|
-
|
|
76
|
+
T,
|
|
77
|
+
D.length,
|
|
78
|
+
E
|
|
79
|
+
]), N = () => {
|
|
80
|
+
A((e) => e === 1 ? 2 : 1);
|
|
80
81
|
};
|
|
81
|
-
|
|
82
|
-
if (!
|
|
82
|
+
h(() => {
|
|
83
|
+
if (!C) return;
|
|
83
84
|
let e = (e) => {
|
|
84
|
-
e.key === "ArrowLeft" &&
|
|
85
|
+
e.key === "ArrowLeft" && j(), e.key === "ArrowRight" && M(), e.key === "Escape" && w(!1);
|
|
85
86
|
};
|
|
86
87
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
87
88
|
}, [
|
|
88
|
-
|
|
89
|
-
A,
|
|
89
|
+
C,
|
|
90
90
|
j,
|
|
91
|
-
|
|
91
|
+
M,
|
|
92
|
+
w
|
|
92
93
|
]);
|
|
93
|
-
let
|
|
94
|
-
return
|
|
95
|
-
...
|
|
96
|
-
open:
|
|
97
|
-
onOpenChange:
|
|
98
|
-
closeOnOverlayClick:
|
|
99
|
-
overlayClassName:
|
|
100
|
-
className:
|
|
101
|
-
"aria-label":
|
|
94
|
+
let P = D[T];
|
|
95
|
+
return P ? /* @__PURE__ */ v(r, {
|
|
96
|
+
...S,
|
|
97
|
+
open: C,
|
|
98
|
+
onOpenChange: w,
|
|
99
|
+
closeOnOverlayClick: b,
|
|
100
|
+
overlayClassName: d.overlay,
|
|
101
|
+
className: _("wim-lightbox", d.contentRoot, e),
|
|
102
|
+
"aria-label": S["aria-labelledby"] ? void 0 : S["aria-label"] ?? (P.title || P.alt || O("lightbox.dialog")),
|
|
102
103
|
transitionProps: {
|
|
103
104
|
preset: "fade",
|
|
104
|
-
enter:
|
|
105
|
-
enterFrom:
|
|
106
|
-
enterTo:
|
|
105
|
+
enter: d.contentEnter,
|
|
106
|
+
enterFrom: d.contentEnterFrom,
|
|
107
|
+
enterTo: d.contentEnterTo
|
|
107
108
|
},
|
|
108
|
-
children: /* @__PURE__ */
|
|
109
|
-
className:
|
|
109
|
+
children: /* @__PURE__ */ y("div", {
|
|
110
|
+
className: d.container,
|
|
110
111
|
children: [
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
-
className:
|
|
113
|
-
children: [
|
|
114
|
-
className:
|
|
115
|
-
children:
|
|
116
|
-
current:
|
|
117
|
-
total:
|
|
112
|
+
/* @__PURE__ */ y("div", {
|
|
113
|
+
className: d.header,
|
|
114
|
+
children: [m && D.length > 1 && /* @__PURE__ */ v("div", {
|
|
115
|
+
className: d.counter,
|
|
116
|
+
children: O("lightbox.counter", {
|
|
117
|
+
current: T + 1,
|
|
118
|
+
total: D.length
|
|
118
119
|
})
|
|
119
|
-
}), /* @__PURE__ */
|
|
120
|
-
className:
|
|
121
|
-
children: [/* @__PURE__ */
|
|
122
|
-
className:
|
|
123
|
-
onClick:
|
|
124
|
-
"aria-label":
|
|
125
|
-
children:
|
|
126
|
-
}), t && /* @__PURE__ */
|
|
127
|
-
className:
|
|
128
|
-
onClick: () =>
|
|
129
|
-
"aria-label":
|
|
130
|
-
children: /* @__PURE__ */
|
|
120
|
+
}), /* @__PURE__ */ y("div", {
|
|
121
|
+
className: d.controls,
|
|
122
|
+
children: [/* @__PURE__ */ v("button", {
|
|
123
|
+
className: d.iconButton,
|
|
124
|
+
onClick: N,
|
|
125
|
+
"aria-label": O(k > 1 ? "lightbox.zoom_out" : "lightbox.zoom_in"),
|
|
126
|
+
children: k > 1 ? /* @__PURE__ */ v(u, { component: c }) : /* @__PURE__ */ v(u, { component: l })
|
|
127
|
+
}), t && /* @__PURE__ */ v("button", {
|
|
128
|
+
className: d.iconButton,
|
|
129
|
+
onClick: () => w(!1),
|
|
130
|
+
"aria-label": O("lightbox.close"),
|
|
131
|
+
children: /* @__PURE__ */ v(u, { component: s })
|
|
131
132
|
})]
|
|
132
133
|
})]
|
|
133
134
|
}),
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
className:
|
|
135
|
+
/* @__PURE__ */ y("div", {
|
|
136
|
+
className: d.viewport,
|
|
136
137
|
children: [
|
|
137
|
-
|
|
138
|
-
className:
|
|
139
|
-
onClick:
|
|
140
|
-
"aria-label":
|
|
141
|
-
children: /* @__PURE__ */
|
|
138
|
+
f && D.length > 1 && /* @__PURE__ */ v("button", {
|
|
139
|
+
className: _(d.navButton, d.prev),
|
|
140
|
+
onClick: j,
|
|
141
|
+
"aria-label": O("lightbox.previous"),
|
|
142
|
+
children: /* @__PURE__ */ v(u, { component: a })
|
|
142
143
|
}),
|
|
143
|
-
/* @__PURE__ */
|
|
144
|
-
className:
|
|
145
|
-
style: { transform: `scale(${
|
|
146
|
-
children: /* @__PURE__ */
|
|
147
|
-
src:
|
|
148
|
-
alt:
|
|
149
|
-
className:
|
|
144
|
+
/* @__PURE__ */ v("div", {
|
|
145
|
+
className: d.mediaWrapper,
|
|
146
|
+
style: { transform: `scale(${k})` },
|
|
147
|
+
children: /* @__PURE__ */ v("img", {
|
|
148
|
+
src: P.src,
|
|
149
|
+
alt: P.alt || "",
|
|
150
|
+
className: d.image
|
|
150
151
|
})
|
|
151
152
|
}),
|
|
152
|
-
|
|
153
|
-
className:
|
|
154
|
-
onClick:
|
|
155
|
-
"aria-label":
|
|
156
|
-
children: /* @__PURE__ */
|
|
153
|
+
f && D.length > 1 && /* @__PURE__ */ v("button", {
|
|
154
|
+
className: _(d.navButton, d.next),
|
|
155
|
+
onClick: M,
|
|
156
|
+
"aria-label": O("lightbox.next"),
|
|
157
|
+
children: /* @__PURE__ */ v(u, { component: o })
|
|
157
158
|
})
|
|
158
159
|
]
|
|
159
160
|
}),
|
|
160
|
-
(
|
|
161
|
-
className:
|
|
162
|
-
children: [
|
|
163
|
-
className:
|
|
164
|
-
children:
|
|
165
|
-
}),
|
|
166
|
-
className:
|
|
167
|
-
children:
|
|
161
|
+
(P.title || P.caption) && /* @__PURE__ */ y("div", {
|
|
162
|
+
className: d.footer,
|
|
163
|
+
children: [P.title && /* @__PURE__ */ v("h3", {
|
|
164
|
+
className: d.title,
|
|
165
|
+
children: P.title
|
|
166
|
+
}), P.caption && /* @__PURE__ */ v("p", {
|
|
167
|
+
className: d.caption,
|
|
168
|
+
children: P.caption
|
|
168
169
|
})]
|
|
169
170
|
})
|
|
170
171
|
]
|
|
171
172
|
})
|
|
172
173
|
}) : null;
|
|
173
|
-
},
|
|
174
|
-
let { setItems: n } =
|
|
175
|
-
return
|
|
174
|
+
}, T = ({ items: e, children: t }) => {
|
|
175
|
+
let { setItems: n } = x();
|
|
176
|
+
return h(() => {
|
|
176
177
|
n(e);
|
|
177
|
-
}, [e, n]), /* @__PURE__ */
|
|
178
|
-
className:
|
|
178
|
+
}, [e, n]), /* @__PURE__ */ v("div", {
|
|
179
|
+
className: d.gallery,
|
|
179
180
|
children: t
|
|
180
181
|
});
|
|
181
|
-
},
|
|
182
|
-
|
|
182
|
+
}, E = S;
|
|
183
|
+
E.Trigger = C, E.Content = w, E.Gallery = T, E.displayName = "Lightbox", C.displayName = "Lightbox.Trigger", w.displayName = "Lightbox.Content", T.displayName = "Lightbox.Gallery";
|
|
183
184
|
//#endregion
|
|
184
|
-
export {
|
|
185
|
+
export { S as Lightbox, w as LightboxContent, T as LightboxGallery, E as LightboxRoot, E as default, C as LightboxTrigger, x as useLightbox };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../Icon/Icon.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/common.cjs"),r=require("../Icon/Icon.cjs"),ee=require("../../../hooks/useMediaLoader.cjs"),i=require("./hooks/useVideoPlayer.cjs"),a=require("./components/VideoAdvancedMenu.cjs"),o=require("./components/VideoControls.cjs"),s=require("./video.module.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("classnames");l=e.__toESM(l,1);let u=require("react/jsx-runtime");var d=({src:e,width:d,height:te,autoPlay:f=!1,loop:p=!1,muted:m=!1,controls:h=!0,poster:g,radius:_=`none`,shadow:v=!1,border:y=!1,fit:b=`cover`,preload:x,caption:S,className:C,style:ne,customControls:w=!1,advancedControls:T=!1,videoId:E,resumePlayback:D=!1,playlist:O,autoPlayNext:k=!1,qualities:A,loading:j=`lazy`,fadeIn:M=!1,demoDelay:N,labels:P={},tracks:F,...I})=>{let{t:L}=t.useWimTranslation(n.commonNs),{videoAriaLabel:R=L(`video.label`),seconds:z=`s`}=P,{containerRef:B,isLoaded:V,isIntersecting:H,notifyLoaded:U,shouldShowSkeleton:W}=ee.useMediaLoader({loading:j,src:A?.[0]?.src||O?.[0]?.src||e,demoDelay:N}),G=i.useVideoPlayer({src:e,autoPlay:f,loop:p,muted:m,fit:b,videoId:E,resumePlayback:D,playlist:O,autoPlayNext:k,qualities:A,customControls:w,advancedControls:T,poster:g,containerRef:B}),{videoRef:K,isPlaying:q,activeSrc:J,activePoster:Y,showNativeControls:X,skipIndicator:Z,activeMenu:Q,setActiveMenu:$}=G;c.default.useEffect(()=>{let e=K.current;e&&(m?e.setAttribute(`muted`,``):e.removeAttribute(`muted`))},[m,K,J,H]);let re={width:`100%`,height:te||`auto`,objectFit:G.activeFit,...ne},ie=_===`none`?null:s.default[`radius${_.charAt(0).toUpperCase()+_.slice(1)}`];return(0,u.jsxs)(`figure`,{className:(0,l.default)(`wim-video`,s.default.root,C),style:{width:`100%`},"aria-label":R,"data-testid":`video-root`,children:[(0,u.jsxs)(`div`,{className:(0,l.default)(s.default.inner,ie,v&&s.default.shadow,y&&s.default.border,(w||T)&&s.default.custom,M&&s.default.fadeIn,M&&V&&s.default.isLoaded,W&&s.default.loading),ref:B,"data-testid":`video-inner`,children:[H&&(0,u.jsx)(`video`,{ref:K,src:J,className:s.default.video,style:re,autoPlay:f&&V,loop:p&&(!O||O.length<=1),muted:m,controls:X&&h,poster:Y,preload:x,playsInline:!0,onTimeUpdate:G.handleTimeUpdate,onLoadedMetadata:G.handleLoadedMetadata,onLoadedData:U,onEnded:G.handleEnded,onPlay:()=>{},onPause:()=>{},onClick:G.handleVideoClick,"data-testid":`video-element`,...I,children:F?.map((e,t)=>(0,u.jsx)(`track`,{...e},t))}),Z.show&&(0,u.jsxs)(`div`,{className:s.default.skipIndicator,children:[(0,u.jsx)(r.Icon,{name:Z.direction===`forward`?`ChevronRightIcon`:`ChevronLeftIcon`,size:`lg`}),(0,u.jsx)(r.Icon,{name:Z.direction===`forward`?`ChevronRightIcon`:`ChevronLeftIcon`,size:`lg`}),(0,u.jsx)(r.Icon,{name:Z.direction===`forward`?`ChevronRightIcon`:`ChevronLeftIcon`,size:`lg`}),(0,u.jsxs)(`span`,{children:[`10`,z]})]}),(w||T)&&(0,u.jsxs)(`div`,{role:`none`,className:s.default.customControls,onClick:()=>Q&&$(null),children:[T&&(0,u.jsx)(a.VideoAdvancedMenu,{styles:s.default,activeMenu:Q,setActiveMenu:$,qualities:A,currentQualityIndex:G.currentQualityIndex,handleQualityChange:G.handleQualityChange,playbackRate:G.playbackRate,setPlaybackRate:G.setPlaybackRate,activeFit:G.activeFit,setActiveFit:G.setActiveFit,playlist:O,currentPlayIndex:G.currentPlayIndex,playPlaylistItem:G.playPlaylistItem,labels:P}),(0,u.jsx)(o.VideoControls,{styles:s.default,playlist:O,advancedControls:T,currentPlayIndex:G.currentPlayIndex,setCurrentPlayIndex:G.setCurrentPlayIndex,skip:G.skip,isPlaying:q,togglePlay:G.togglePlay,currentTime:G.currentTime,duration:G.duration,handleSeek:G.handleSeek,volume:G.volume,isMuted:G.isMuted,toggleMute:G.toggleMute,handleVolumeChange:G.handleVolumeChange,activeMenu:Q,setActiveMenu:$,togglePiP:G.togglePiP,isFullscreen:G.isFullscreen,toggleFullscreen:G.toggleFullscreen,formatTime:G.formatTime,labels:P})]})]}),S&&(0,u.jsx)(`figcaption`,{className:s.default.caption,"data-testid":`video-caption`,children:S})]})};exports.Video=d;
|
|
@@ -1,71 +1,73 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
2
|
+
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
+
import { commonNs as t } from "../../../i18n/generated/common.js";
|
|
4
|
+
import { Icon as n } from "../Icon/Icon.js";
|
|
5
|
+
import { useMediaLoader as ee } from "../../../hooks/useMediaLoader.js";
|
|
6
|
+
import { useVideoPlayer as r } from "./hooks/useVideoPlayer.js";
|
|
7
|
+
import { VideoAdvancedMenu as i } from "./components/VideoAdvancedMenu.js";
|
|
8
|
+
import { VideoControls as a } from "./components/VideoControls.js";
|
|
9
|
+
import o from "./video.module.js";
|
|
10
|
+
import s from "react";
|
|
11
|
+
import c from "classnames";
|
|
12
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
11
13
|
//#region src/components/media/Video/Video.tsx
|
|
12
|
-
var
|
|
13
|
-
let { videoAriaLabel: R = "
|
|
14
|
-
loading:
|
|
15
|
-
src:
|
|
16
|
-
demoDelay:
|
|
17
|
-
}), G =
|
|
18
|
-
src:
|
|
19
|
-
autoPlay:
|
|
20
|
-
loop:
|
|
21
|
-
muted:
|
|
22
|
-
fit:
|
|
23
|
-
videoId:
|
|
24
|
-
resumePlayback:
|
|
25
|
-
playlist:
|
|
26
|
-
autoPlayNext:
|
|
27
|
-
qualities:
|
|
28
|
-
customControls:
|
|
29
|
-
advancedControls:
|
|
30
|
-
poster:
|
|
14
|
+
var d = ({ src: d, width: te, height: f, autoPlay: p = !1, loop: m = !1, muted: h = !1, controls: ne = !0, poster: re, radius: g = "none", shadow: _ = !1, border: v = !1, fit: y = "cover", preload: b, caption: x, className: S, style: C, customControls: w = !1, advancedControls: T = !1, videoId: E, resumePlayback: D = !1, playlist: O, autoPlayNext: k = !1, qualities: A, loading: j = "lazy", fadeIn: M = !1, demoDelay: N, labels: P = {}, tracks: F, ...I }) => {
|
|
15
|
+
let { t: L } = e(t), { videoAriaLabel: R = L("video.label"), seconds: z = "s" } = P, { containerRef: B, isLoaded: V, isIntersecting: H, notifyLoaded: U, shouldShowSkeleton: W } = ee({
|
|
16
|
+
loading: j,
|
|
17
|
+
src: A?.[0]?.src || O?.[0]?.src || d,
|
|
18
|
+
demoDelay: N
|
|
19
|
+
}), G = r({
|
|
20
|
+
src: d,
|
|
21
|
+
autoPlay: p,
|
|
22
|
+
loop: m,
|
|
23
|
+
muted: h,
|
|
24
|
+
fit: y,
|
|
25
|
+
videoId: E,
|
|
26
|
+
resumePlayback: D,
|
|
27
|
+
playlist: O,
|
|
28
|
+
autoPlayNext: k,
|
|
29
|
+
qualities: A,
|
|
30
|
+
customControls: w,
|
|
31
|
+
advancedControls: T,
|
|
32
|
+
poster: re,
|
|
31
33
|
containerRef: B
|
|
32
34
|
}), { videoRef: K, isPlaying: q, activeSrc: J, activePoster: Y, showNativeControls: X, skipIndicator: Z, activeMenu: Q, setActiveMenu: $ } = G;
|
|
33
|
-
|
|
35
|
+
s.useEffect(() => {
|
|
34
36
|
let e = K.current;
|
|
35
|
-
e && (
|
|
37
|
+
e && (h ? e.setAttribute("muted", "") : e.removeAttribute("muted"));
|
|
36
38
|
}, [
|
|
37
|
-
|
|
39
|
+
h,
|
|
38
40
|
K,
|
|
39
41
|
J,
|
|
40
42
|
H
|
|
41
43
|
]);
|
|
42
|
-
let
|
|
44
|
+
let ie = {
|
|
43
45
|
width: "100%",
|
|
44
|
-
height:
|
|
46
|
+
height: f || "auto",
|
|
45
47
|
objectFit: G.activeFit,
|
|
46
|
-
...
|
|
47
|
-
},
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
-
className:
|
|
48
|
+
...C
|
|
49
|
+
}, ae = g === "none" ? null : o[`radius${g.charAt(0).toUpperCase() + g.slice(1)}`];
|
|
50
|
+
return /* @__PURE__ */ u("figure", {
|
|
51
|
+
className: c("wim-video", o.root, S),
|
|
50
52
|
style: { width: "100%" },
|
|
51
53
|
"aria-label": R,
|
|
52
54
|
"data-testid": "video-root",
|
|
53
|
-
children: [/* @__PURE__ */
|
|
54
|
-
className:
|
|
55
|
+
children: [/* @__PURE__ */ u("div", {
|
|
56
|
+
className: c(o.inner, ae, _ && o.shadow, v && o.border, (w || T) && o.custom, M && o.fadeIn, M && V && o.isLoaded, W && o.loading),
|
|
55
57
|
ref: B,
|
|
56
58
|
"data-testid": "video-inner",
|
|
57
59
|
children: [
|
|
58
|
-
H && /* @__PURE__ */
|
|
60
|
+
H && /* @__PURE__ */ l("video", {
|
|
59
61
|
ref: K,
|
|
60
62
|
src: J,
|
|
61
|
-
className:
|
|
62
|
-
style:
|
|
63
|
-
autoPlay:
|
|
64
|
-
loop:
|
|
65
|
-
muted:
|
|
66
|
-
controls: X &&
|
|
63
|
+
className: o.video,
|
|
64
|
+
style: ie,
|
|
65
|
+
autoPlay: p && V,
|
|
66
|
+
loop: m && (!O || O.length <= 1),
|
|
67
|
+
muted: h,
|
|
68
|
+
controls: X && ne,
|
|
67
69
|
poster: Y,
|
|
68
|
-
preload:
|
|
70
|
+
preload: b,
|
|
69
71
|
playsInline: !0,
|
|
70
72
|
onTimeUpdate: G.handleTimeUpdate,
|
|
71
73
|
onLoadedMetadata: G.handleLoadedMetadata,
|
|
@@ -75,50 +77,50 @@ var u = ({ src: u, width: ee, height: d, autoPlay: f = !1, loop: p = !1, muted:
|
|
|
75
77
|
onPause: () => {},
|
|
76
78
|
onClick: G.handleVideoClick,
|
|
77
79
|
"data-testid": "video-element",
|
|
78
|
-
...
|
|
79
|
-
children:
|
|
80
|
+
...I,
|
|
81
|
+
children: F?.map((e, t) => /* @__PURE__ */ l("track", { ...e }, t))
|
|
80
82
|
}),
|
|
81
|
-
Z.show && /* @__PURE__ */
|
|
82
|
-
className:
|
|
83
|
+
Z.show && /* @__PURE__ */ u("div", {
|
|
84
|
+
className: o.skipIndicator,
|
|
83
85
|
children: [
|
|
84
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ l(n, {
|
|
85
87
|
name: Z.direction === "forward" ? "ChevronRightIcon" : "ChevronLeftIcon",
|
|
86
88
|
size: "lg"
|
|
87
89
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ l(n, {
|
|
89
91
|
name: Z.direction === "forward" ? "ChevronRightIcon" : "ChevronLeftIcon",
|
|
90
92
|
size: "lg"
|
|
91
93
|
}),
|
|
92
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ l(n, {
|
|
93
95
|
name: Z.direction === "forward" ? "ChevronRightIcon" : "ChevronLeftIcon",
|
|
94
96
|
size: "lg"
|
|
95
97
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ u("span", { children: ["10", z] })
|
|
97
99
|
]
|
|
98
100
|
}),
|
|
99
|
-
(
|
|
101
|
+
(w || T) && /* @__PURE__ */ u("div", {
|
|
100
102
|
role: "none",
|
|
101
|
-
className:
|
|
103
|
+
className: o.customControls,
|
|
102
104
|
onClick: () => Q && $(null),
|
|
103
|
-
children: [
|
|
104
|
-
styles:
|
|
105
|
+
children: [T && /* @__PURE__ */ l(i, {
|
|
106
|
+
styles: o,
|
|
105
107
|
activeMenu: Q,
|
|
106
108
|
setActiveMenu: $,
|
|
107
|
-
qualities:
|
|
109
|
+
qualities: A,
|
|
108
110
|
currentQualityIndex: G.currentQualityIndex,
|
|
109
111
|
handleQualityChange: G.handleQualityChange,
|
|
110
112
|
playbackRate: G.playbackRate,
|
|
111
113
|
setPlaybackRate: G.setPlaybackRate,
|
|
112
114
|
activeFit: G.activeFit,
|
|
113
115
|
setActiveFit: G.setActiveFit,
|
|
114
|
-
playlist:
|
|
116
|
+
playlist: O,
|
|
115
117
|
currentPlayIndex: G.currentPlayIndex,
|
|
116
118
|
playPlaylistItem: G.playPlaylistItem,
|
|
117
|
-
labels:
|
|
118
|
-
}), /* @__PURE__ */
|
|
119
|
-
styles:
|
|
120
|
-
playlist:
|
|
121
|
-
advancedControls:
|
|
119
|
+
labels: P
|
|
120
|
+
}), /* @__PURE__ */ l(a, {
|
|
121
|
+
styles: o,
|
|
122
|
+
playlist: O,
|
|
123
|
+
advancedControls: T,
|
|
122
124
|
currentPlayIndex: G.currentPlayIndex,
|
|
123
125
|
setCurrentPlayIndex: G.setCurrentPlayIndex,
|
|
124
126
|
skip: G.skip,
|
|
@@ -137,16 +139,16 @@ var u = ({ src: u, width: ee, height: d, autoPlay: f = !1, loop: p = !1, muted:
|
|
|
137
139
|
isFullscreen: G.isFullscreen,
|
|
138
140
|
toggleFullscreen: G.toggleFullscreen,
|
|
139
141
|
formatTime: G.formatTime,
|
|
140
|
-
labels:
|
|
142
|
+
labels: P
|
|
141
143
|
})]
|
|
142
144
|
})
|
|
143
145
|
]
|
|
144
|
-
}),
|
|
145
|
-
className:
|
|
146
|
+
}), x && /* @__PURE__ */ l("figcaption", {
|
|
147
|
+
className: o.caption,
|
|
146
148
|
"data-testid": "video-caption",
|
|
147
|
-
children:
|
|
149
|
+
children: x
|
|
148
150
|
})]
|
|
149
151
|
});
|
|
150
152
|
};
|
|
151
153
|
//#endregion
|
|
152
|
-
export {
|
|
154
|
+
export { d as Video };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../../icon/check.cjs"),
|
|
2
|
+
const e=require("../../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../../i18n/useWimTranslation.cjs"),n=require("../../../../i18n/generated/common.cjs"),r=require("../../../../icon/check.cjs"),i=require("../../../../icon/chevron-left.cjs"),a=require("../../../../icon/chevron-right.cjs"),o=require("../../../../icon/close.cjs"),s=require("../../../../icon/play.cjs"),c=require("../../Icon/Icon.cjs");let l=require("react");l=e.__toESM(l,1);let u=require("react/jsx-runtime");var d=[.25,.5,.75,1,1.25,1.5,1.75,2],f=[`contain`,`cover`,`fill`,`scale-down`,`none`];function p({activeMenu:e,setActiveMenu:l,qualities:p,currentQualityIndex:m,handleQualityChange:h,playbackRate:g,setPlaybackRate:_,activeFit:v,setActiveFit:y,playlist:b,currentPlayIndex:x,playPlaylistItem:S,labels:C={},styles:w}){let{t:T}=t.useWimTranslation(n.commonNs),{settings:E=T(`a11y.settings`),quality:D=T(`quality`),playbackRate:O=T(`playback.speed`),aspectRatio:k=T(`aspect.ratio`),standard:A=T(`standard`),playlist:j=T(`a11y.playlist`),contain:M=T(`video.fit_contain`),cover:N=T(`video.fit_cover`),fill:P=T(`video.fit_fill`),scaleDown:F=T(`video.fit_scale_down`),none:I=T(`common.none`)}=C;if(!e)return null;let L=e=>{switch(e){case`contain`:return M;case`cover`:return N;case`fill`:return P;case`scale-down`:return F;case`none`:return I;default:return e}};return(0,u.jsxs)(u.Fragment,{children:[e===`main`&&(0,u.jsxs)(`div`,{className:w.advancedMenu,onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Escape`&&l(null)},role:`menu`,tabIndex:-1,children:[(0,u.jsx)(`div`,{className:w.menuTitle,children:(0,u.jsx)(`span`,{children:E})}),(0,u.jsxs)(`div`,{className:w.menuItems,children:[p&&p.length>0&&(0,u.jsxs)(`button`,{className:w.menuBtn,onClick:()=>l(`quality`),children:[(0,u.jsx)(`span`,{children:D}),(0,u.jsxs)(`span`,{style:{opacity:.7},children:[p[m].label,` `,(0,u.jsx)(c.Icon,{component:a.default,size:`sm`})]})]}),(0,u.jsxs)(`button`,{className:w.menuBtn,onClick:()=>l(`rate`),children:[(0,u.jsx)(`span`,{children:O}),(0,u.jsxs)(`span`,{style:{opacity:.7},children:[g,`x `,(0,u.jsx)(c.Icon,{component:a.default,size:`sm`})]})]}),(0,u.jsxs)(`button`,{className:w.menuBtn,onClick:()=>l(`fit`),children:[(0,u.jsx)(`span`,{children:k}),(0,u.jsxs)(`span`,{style:{opacity:.7},children:[L(v),` `,(0,u.jsx)(c.Icon,{component:a.default,size:`sm`})]})]})]})]}),e===`quality`&&(0,u.jsxs)(`div`,{className:w.advancedMenu,onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Escape`&&l(`main`)},role:`menu`,tabIndex:-1,children:[(0,u.jsxs)(`div`,{className:w.menuTitle,children:[(0,u.jsx)(`button`,{onClick:()=>l(`main`),className:w.btn,children:(0,u.jsx)(c.Icon,{component:i.default,size:`sm`})}),(0,u.jsx)(`span`,{children:D})]}),(0,u.jsx)(`div`,{className:w.menuItems,children:p?.map((e,t)=>(0,u.jsxs)(`button`,{className:w.menuBtn,"data-active":m===t,onClick:()=>h(t),children:[m===t&&(0,u.jsx)(c.Icon,{component:r.default,size:`sm`}),(0,u.jsx)(`span`,{style:{marginLeft:m===t?0:24},children:e.label})]},t))})]}),e===`rate`&&(0,u.jsxs)(`div`,{className:w.advancedMenu,onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Escape`&&l(`main`)},role:`menu`,tabIndex:-1,children:[(0,u.jsxs)(`div`,{className:w.menuTitle,children:[(0,u.jsx)(`button`,{onClick:()=>l(`main`),className:w.btn,children:(0,u.jsx)(c.Icon,{component:i.default,size:`sm`})}),(0,u.jsx)(`span`,{children:O})]}),(0,u.jsx)(`div`,{className:w.menuItems,children:d.map(e=>(0,u.jsxs)(`button`,{className:w.menuBtn,"data-active":g===e,onClick:()=>{_(e),l(`main`)},children:[g===e&&(0,u.jsx)(c.Icon,{component:r.default,size:`sm`}),(0,u.jsx)(`span`,{style:{marginLeft:g===e?0:24},children:e===1?A:`${e}x`})]},e))})]}),e===`fit`&&(0,u.jsxs)(`div`,{className:w.advancedMenu,onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Escape`&&l(`main`)},role:`menu`,tabIndex:-1,children:[(0,u.jsxs)(`div`,{className:w.menuTitle,children:[(0,u.jsx)(`button`,{onClick:()=>l(`main`),className:w.btn,children:(0,u.jsx)(c.Icon,{component:i.default,size:`sm`})}),(0,u.jsx)(`span`,{children:k})]}),(0,u.jsx)(`div`,{className:w.menuItems,children:f.map(e=>(0,u.jsxs)(`button`,{className:w.menuBtn,"data-active":v===e,onClick:()=>{y(e),l(`main`)},children:[v===e&&(0,u.jsx)(c.Icon,{component:r.default,size:`sm`}),(0,u.jsx)(`span`,{style:{marginLeft:v===e?0:24},children:L(e)})]},e))})]}),e===`playlist`&&(0,u.jsxs)(`div`,{className:w.advancedMenu,onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Escape`&&l(null)},style:{bottom:60,right:16,width:250},role:`menu`,tabIndex:-1,children:[(0,u.jsxs)(`div`,{className:w.menuTitle,children:[(0,u.jsx)(`span`,{children:j}),(0,u.jsx)(`button`,{onClick:()=>l(null),style:{marginLeft:`auto`},className:w.btn,children:(0,u.jsx)(c.Icon,{component:o.default,size:`sm`})})]}),(0,u.jsx)(`div`,{className:w.menuItems,children:b?.map((e,t)=>(0,u.jsx)(`button`,{className:w.menuBtn,"data-active":x===t,onClick:()=>S(t),style:{flexDirection:`column`,alignItems:`flex-start`,gap:4},children:(0,u.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[x===t?(0,u.jsx)(c.Icon,{component:s.default,size:`sm`}):(0,u.jsx)(`div`,{style:{width:20}}),(0,u.jsx)(`span`,{children:e.title||`Track ${t+1}`})]})},t))})]})]})}exports.VideoAdvancedMenu=p;
|