wimui 0.51.2 → 0.52.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/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/AIResponseFeedback/airesponse-feedback.module.cjs +1 -1
- package/dist/components/ai/AIResponseFeedback/airesponse-feedback.module.js +1 -1
- 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/CodeBlock/code-block.module.cjs +1 -1
- package/dist/components/ai/CodeBlock/code-block.module.js +1 -1
- package/dist/components/ai/CodeDiffViewer/CodeDiffViewer.cjs +2 -2
- package/dist/components/ai/CodeDiffViewer/CodeDiffViewer.js +105 -104
- package/dist/components/ai/CodeDiffViewer/code-diff-viewer.module.cjs +1 -1
- package/dist/components/ai/CodeDiffViewer/code-diff-viewer.module.js +2 -2
- 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 +83 -82
- 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/Terminal/terminal.module.cjs +1 -1
- package/dist/components/ai/Terminal/terminal.module.js +1 -1
- package/dist/components/ai/ThoughtProcess/thought-process.module.cjs +1 -1
- package/dist/components/ai/ThoughtProcess/thought-process.module.js +4 -4
- package/dist/components/ai/ThreadList/ThreadList.cjs +1 -1
- package/dist/components/ai/ThreadList/ThreadList.js +58 -57
- package/dist/components/ai/ThreadList/thread-list.module.cjs +1 -1
- package/dist/components/ai/ThreadList/thread-list.module.js +1 -1
- 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/Calendar/calendar.module.cjs +1 -1
- package/dist/components/data-display/Calendar/calendar.module.js +1 -1
- 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 +62 -61
- package/dist/components/data-display/Carousel/carousel.module.cjs +1 -1
- package/dist/components/data-display/Carousel/carousel.module.js +1 -1
- 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/Comment/comment.module.cjs +1 -1
- package/dist/components/data-display/Comment/comment.module.js +1 -1
- 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/JsonViewer/json-viewer.module.cjs +1 -1
- package/dist/components/data-display/JsonViewer/json-viewer.module.js +3 -3
- 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 +62 -61
- package/dist/components/data-display/NodeGraph/node-graph.module.cjs +1 -1
- package/dist/components/data-display/NodeGraph/node-graph.module.js +1 -1
- 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/PivotTable/pivot-table.module.cjs +1 -1
- package/dist/components/data-display/PivotTable/pivot-table.module.js +1 -1
- 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 +49 -48
- 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/Tag/tag.module.cjs +1 -1
- package/dist/components/data-display/Tag/tag.module.js +1 -1
- 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/TreeDiagram/tree-diagram.module.cjs +1 -1
- package/dist/components/data-display/TreeDiagram/tree-diagram.module.js +1 -1
- 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/Banner/banner.module.cjs +1 -1
- package/dist/components/feedback/Banner/banner.module.js +2 -2
- package/dist/components/feedback/ErrorBoundary/ErrorBoundary.cjs +1 -1
- package/dist/components/feedback/ErrorBoundary/ErrorBoundary.js +35 -34
- package/dist/components/feedback/Notification/notification.module.cjs +1 -1
- package/dist/components/feedback/Notification/notification.module.js +2 -2
- 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 +98 -97
- 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/Combobox/combobox.module.cjs +1 -1
- package/dist/components/form/Combobox/combobox.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/DatePicker/date-picker.module.cjs +1 -1
- package/dist/components/form/DatePicker/date-picker.module.js +1 -1
- 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/InlineEdit/inline-edit.module.cjs +1 -1
- package/dist/components/form/InlineEdit/inline-edit.module.js +1 -1
- 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/Mentions/mentions.module.cjs +1 -1
- package/dist/components/form/Mentions/mentions.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/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/PhoneInput/phone-input.module.cjs +1 -1
- package/dist/components/form/PhoneInput/phone-input.module.js +1 -1
- 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 +30 -29
- package/dist/components/form/Rating/rating.module.cjs +1 -1
- package/dist/components/form/Rating/rating.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/RichTextEditor/rich-text-editor.module.cjs +1 -1
- package/dist/components/form/RichTextEditor/rich-text-editor.module.js +1 -1
- package/dist/components/form/SegmentedControl/SegmentedControl.cjs +1 -1
- package/dist/components/form/SegmentedControl/SegmentedControl.js +7 -7
- package/dist/components/form/SegmentedControl/segmented-control.module.cjs +1 -1
- package/dist/components/form/SegmentedControl/segmented-control.module.js +1 -1
- package/dist/components/form/Select/Select.cjs +1 -1
- package/dist/components/form/Select/Select.js +112 -111
- package/dist/components/form/Select/select.module.cjs +1 -1
- package/dist/components/form/Select/select.module.js +1 -1
- 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 +68 -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/ToggleGroup/toggle-group.module.cjs +1 -1
- package/dist/components/form/ToggleGroup/toggle-group.module.js +1 -1
- package/dist/components/form/Transfer/Transfer.cjs +1 -1
- package/dist/components/form/Transfer/Transfer.js +127 -126
- 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 +90 -89
- package/dist/components/media/Audio/components/AudioCustomControls.cjs +1 -1
- package/dist/components/media/Audio/components/AudioCustomControls.js +115 -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 +72 -71
- 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 +56 -55
- package/dist/components/media/Video/components/VideoAdvancedMenu.cjs +1 -1
- package/dist/components/media/Video/components/VideoAdvancedMenu.js +136 -135
- 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/CommandPalette/command-palette.module.cjs +1 -1
- package/dist/components/navigation/CommandPalette/command-palette.module.js +1 -1
- 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/HamburgerMenu/hamburger-menu.module.cjs +1 -1
- package/dist/components/navigation/HamburgerMenu/hamburger-menu.module.js +1 -1
- package/dist/components/navigation/Menubar/menubar.module.cjs +1 -1
- package/dist/components/navigation/Menubar/menubar.module.js +1 -1
- 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 +50 -47
- package/dist/components/navigation/TabBar/tab-bar.module.cjs +1 -1
- package/dist/components/navigation/TabBar/tab-bar.module.js +1 -1
- package/dist/components/navigation/TabNavigation/tab-navigation.module.cjs +1 -1
- package/dist/components/navigation/TabNavigation/tab-navigation.module.js +1 -1
- 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/components/typography/Spoiler/spoiler.module.cjs +1 -1
- package/dist/components/typography/Spoiler/spoiler.module.js +1 -1
- 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 +7 -3
- package/dist/llms.txt +1 -1
- package/dist/locales/en/common.json +1 -1
- package/dist/locales/ja/common.json +1 -1
- package/dist/locales/pt/common.json +1 -1
- package/dist/styles.css +1 -1
- 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 -1283
|
@@ -1,146 +1,147 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
-
import {
|
|
3
|
+
import { commonNs as t } from "../../../i18n/generated/common.js";
|
|
4
|
+
import { useMediaLoader as ee } from "../../../hooks/useMediaLoader.js";
|
|
4
5
|
import { useAudioPlayer as n } from "./hooks/useAudioPlayer.js";
|
|
5
6
|
import { useAudioMetadata as r } from "./hooks/useAudioMetadata.js";
|
|
6
7
|
import { AudioCustomControls as i } from "./components/AudioCustomControls.js";
|
|
7
8
|
import a from "./audio.module.js";
|
|
8
|
-
import { useEffect as o, useMemo as
|
|
9
|
-
import
|
|
10
|
-
import { jsx as
|
|
9
|
+
import { useEffect as o, useMemo as te } from "react";
|
|
10
|
+
import s from "classnames";
|
|
11
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
11
12
|
//#region src/components/media/Audio/Audio.tsx
|
|
12
|
-
var
|
|
13
|
-
let { t:
|
|
14
|
-
loading:
|
|
15
|
-
demoDelay:
|
|
16
|
-
src:
|
|
17
|
-
}),
|
|
18
|
-
playlist:
|
|
19
|
-
loop:
|
|
20
|
-
muted:
|
|
21
|
-
fadeIn:
|
|
22
|
-
fadeOut:
|
|
23
|
-
crossfade:
|
|
24
|
-
visualizer:
|
|
25
|
-
hotkeys:
|
|
26
|
-
autoPlay:
|
|
27
|
-
}), { isPlaying:
|
|
28
|
-
currentTrack:
|
|
29
|
-
showMetadata:
|
|
13
|
+
var u = ({ src: u, autoPlay: d = !1, loop: f = !1, muted: p = !1, controls: m = !0, radius: h = "none", shadow: g = !1, border: ne = !1, preload: _, caption: v, className: y, style: b, customControls: x = !1, visualizer: S = !1, showMetadata: C = !1, fadeIn: w = !1, fadeOut: T = !1, crossfade: E = !1, playbackRate: D = !1, hotkeys: O = !1, presets: k = !1, sleepTimer: A = !1, loading: j = "lazy", demoDelay: M, labels: N = {}, tracks: P, ...F }) => {
|
|
14
|
+
let { t: I } = e(t), { unknownTitle: L = I("audio.unknown_title"), unknownArtist: R = I("audio.unknown_artist") } = N, z = te(() => u ? (Array.isArray(u) ? u : [u]).map((e) => typeof e == "string" ? { src: e } : e) : [], [u]), { containerRef: re, isLoaded: B, isIntersecting: V, notifyLoaded: H, shouldShowSkeleton: U } = ee({
|
|
15
|
+
loading: j,
|
|
16
|
+
demoDelay: M,
|
|
17
|
+
src: z[0]?.src
|
|
18
|
+
}), W = n({
|
|
19
|
+
playlist: z,
|
|
20
|
+
loop: f,
|
|
21
|
+
muted: p,
|
|
22
|
+
fadeIn: w,
|
|
23
|
+
fadeOut: T,
|
|
24
|
+
crossfade: E,
|
|
25
|
+
visualizer: S,
|
|
26
|
+
hotkeys: O,
|
|
27
|
+
autoPlay: d
|
|
28
|
+
}), { isPlaying: G, currentTrack: K, currentTrackIndex: q, activeAudioRef: J, nextAudioRef: Y, canvasRef: X, handleTimeUpdate: ie, handleEnded: ae, setDuration: oe, playActivePlayer: se } = W, { metaTitle: Z, metaArtist: Q, metaCover: $ } = r({
|
|
29
|
+
currentTrack: K,
|
|
30
|
+
showMetadata: C
|
|
30
31
|
});
|
|
31
32
|
o(() => {
|
|
32
|
-
|
|
33
|
-
}, [
|
|
34
|
-
let
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
className:
|
|
37
|
-
style:
|
|
33
|
+
K && J.current && (J.current.src = K.src, (d || G) && se());
|
|
34
|
+
}, [q, K]);
|
|
35
|
+
let ce = h === "none" ? null : a[`radius${h.charAt(0).toUpperCase() + h.slice(1)}`];
|
|
36
|
+
return /* @__PURE__ */ l("figure", {
|
|
37
|
+
className: s("wim-audio", a.root, y),
|
|
38
|
+
style: b,
|
|
38
39
|
"data-testid": "audio-root",
|
|
39
|
-
children: [/* @__PURE__ */
|
|
40
|
-
ref:
|
|
41
|
-
className:
|
|
40
|
+
children: [/* @__PURE__ */ l("div", {
|
|
41
|
+
ref: re,
|
|
42
|
+
className: s(a.inner, ce, x && g && a.shadow, x && ne && a.border, x && a.custom, w && a.fadeIn, w && B && a.isLoaded, U && a.loading),
|
|
42
43
|
"data-testid": "audio-inner",
|
|
43
44
|
children: [
|
|
44
|
-
|
|
45
|
-
ref:
|
|
45
|
+
S && x && /* @__PURE__ */ c("canvas", {
|
|
46
|
+
ref: X,
|
|
46
47
|
className: a.visualizerCanvas,
|
|
47
48
|
"data-testid": "audio-canvas"
|
|
48
49
|
}),
|
|
49
|
-
|
|
50
|
+
x && C && (Z || Q || $) && /* @__PURE__ */ l("div", {
|
|
50
51
|
className: a.metadata,
|
|
51
52
|
style: {
|
|
52
53
|
position: "relative",
|
|
53
54
|
zIndex: 2
|
|
54
55
|
},
|
|
55
56
|
"data-testid": "audio-metadata",
|
|
56
|
-
children: [$ && /* @__PURE__ */
|
|
57
|
+
children: [$ && /* @__PURE__ */ c("img", {
|
|
57
58
|
src: $,
|
|
58
|
-
alt:
|
|
59
|
+
alt: I("a11y.cover_art"),
|
|
59
60
|
className: a.cover,
|
|
60
61
|
"data-testid": "audio-cover"
|
|
61
|
-
}), /* @__PURE__ */
|
|
62
|
+
}), /* @__PURE__ */ l("div", {
|
|
62
63
|
className: a.info,
|
|
63
|
-
children: [/* @__PURE__ */
|
|
64
|
+
children: [/* @__PURE__ */ c("div", {
|
|
64
65
|
className: a.title,
|
|
65
66
|
"data-testid": "audio-title",
|
|
66
|
-
children: Z ||
|
|
67
|
-
}), /* @__PURE__ */
|
|
67
|
+
children: Z || L
|
|
68
|
+
}), /* @__PURE__ */ c("div", {
|
|
68
69
|
className: a.artist,
|
|
69
70
|
"data-testid": "audio-artist",
|
|
70
|
-
children: Q ||
|
|
71
|
+
children: Q || R
|
|
71
72
|
})]
|
|
72
73
|
})]
|
|
73
74
|
}),
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ l("div", {
|
|
75
76
|
style: {
|
|
76
|
-
display:
|
|
77
|
+
display: x ? "none" : "block",
|
|
77
78
|
width: "100%"
|
|
78
79
|
},
|
|
79
|
-
children: [
|
|
80
|
-
ref:
|
|
81
|
-
src:
|
|
80
|
+
children: [V && /* @__PURE__ */ c("audio", {
|
|
81
|
+
ref: J,
|
|
82
|
+
src: K?.src,
|
|
82
83
|
className: a.audio,
|
|
83
84
|
"data-testid": "audio-active",
|
|
84
|
-
loop:
|
|
85
|
-
muted:
|
|
86
|
-
controls: !
|
|
87
|
-
preload:
|
|
85
|
+
loop: W.repeatMode === 1 && z.length === 1,
|
|
86
|
+
muted: W.isMuted,
|
|
87
|
+
controls: !x && m,
|
|
88
|
+
preload: _,
|
|
88
89
|
crossOrigin: "anonymous",
|
|
89
|
-
onTimeUpdate:
|
|
90
|
-
onEnded:
|
|
91
|
-
...
|
|
90
|
+
onTimeUpdate: ie,
|
|
91
|
+
onEnded: ae,
|
|
92
|
+
...F,
|
|
92
93
|
onLoadedMetadata: (e) => {
|
|
93
|
-
|
|
94
|
+
oe(e.currentTarget.duration), H(), F.onLoadedMetadata?.(e);
|
|
94
95
|
},
|
|
95
96
|
onLoadedData: (e) => {
|
|
96
|
-
|
|
97
|
+
H(), F.onLoadedData?.(e);
|
|
97
98
|
},
|
|
98
99
|
onCanPlay: (e) => {
|
|
99
|
-
|
|
100
|
+
H(), F.onCanPlay?.(e);
|
|
100
101
|
},
|
|
101
|
-
children:
|
|
102
|
-
}), /* @__PURE__ */
|
|
103
|
-
ref:
|
|
104
|
-
muted:
|
|
102
|
+
children: P?.map((e, t) => /* @__PURE__ */ c("track", { ...e }, t))
|
|
103
|
+
}), /* @__PURE__ */ c("audio", {
|
|
104
|
+
ref: Y,
|
|
105
|
+
muted: W.isMuted,
|
|
105
106
|
preload: "auto",
|
|
106
107
|
crossOrigin: "anonymous",
|
|
107
108
|
"data-testid": "audio-next"
|
|
108
109
|
})]
|
|
109
110
|
}),
|
|
110
|
-
|
|
111
|
+
x && /* @__PURE__ */ c(i, {
|
|
111
112
|
styles: a,
|
|
112
|
-
isPlaying:
|
|
113
|
-
currentTime:
|
|
114
|
-
duration:
|
|
115
|
-
volume:
|
|
116
|
-
isMuted:
|
|
117
|
-
repeatMode:
|
|
118
|
-
shuffleMode:
|
|
119
|
-
currentPlaybackRate:
|
|
120
|
-
isBassBoost:
|
|
121
|
-
remainingSleepTime:
|
|
122
|
-
playbackRate:
|
|
123
|
-
presets:
|
|
124
|
-
sleepTimer:
|
|
125
|
-
setRepeatMode:
|
|
126
|
-
setShuffleMode:
|
|
127
|
-
setCurrentPlaybackRate:
|
|
128
|
-
setIsBassBoost:
|
|
129
|
-
setIsMuted:
|
|
130
|
-
togglePlay:
|
|
131
|
-
handleSeek:
|
|
132
|
-
handleVolumeChange:
|
|
133
|
-
playNext:
|
|
134
|
-
toggleSleepTimer:
|
|
135
|
-
formatTime:
|
|
136
|
-
labels:
|
|
113
|
+
isPlaying: G,
|
|
114
|
+
currentTime: W.currentTime,
|
|
115
|
+
duration: W.duration,
|
|
116
|
+
volume: W.volume,
|
|
117
|
+
isMuted: W.isMuted,
|
|
118
|
+
repeatMode: W.repeatMode,
|
|
119
|
+
shuffleMode: W.shuffleMode,
|
|
120
|
+
currentPlaybackRate: W.currentPlaybackRate,
|
|
121
|
+
isBassBoost: W.isBassBoost,
|
|
122
|
+
remainingSleepTime: W.remainingSleepTime,
|
|
123
|
+
playbackRate: D,
|
|
124
|
+
presets: k,
|
|
125
|
+
sleepTimer: A,
|
|
126
|
+
setRepeatMode: W.setRepeatMode,
|
|
127
|
+
setShuffleMode: W.setShuffleMode,
|
|
128
|
+
setCurrentPlaybackRate: W.setCurrentPlaybackRate,
|
|
129
|
+
setIsBassBoost: W.setIsBassBoost,
|
|
130
|
+
setIsMuted: W.setIsMuted,
|
|
131
|
+
togglePlay: W.togglePlay,
|
|
132
|
+
handleSeek: W.handleSeek,
|
|
133
|
+
handleVolumeChange: W.handleVolumeChange,
|
|
134
|
+
playNext: W.playNext,
|
|
135
|
+
toggleSleepTimer: W.toggleSleepTimer,
|
|
136
|
+
formatTime: W.formatTime,
|
|
137
|
+
labels: N
|
|
137
138
|
})
|
|
138
139
|
]
|
|
139
|
-
}),
|
|
140
|
+
}), v && /* @__PURE__ */ c("figcaption", {
|
|
140
141
|
className: a.caption,
|
|
141
|
-
children:
|
|
142
|
+
children: v
|
|
142
143
|
})]
|
|
143
144
|
});
|
|
144
145
|
};
|
|
145
146
|
//#endregion
|
|
146
|
-
export {
|
|
147
|
+
export { u as Audio };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
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:
|
|
2
|
+
const e=require("../../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../../i18n/useWimTranslation.cjs"),ee=require("../../../../i18n/generated/common.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:I,formatTime:L,labels:R={},styles:z}){let{t:B}=t.useWimTranslation(ee.commonNs),{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;return(0,h.jsxs)(`div`,{className:(0,m.default)(z.customControls),children:[(0,h.jsxs)(`div`,{className:(0,m.default)(z.time),children:[(0,h.jsx)(`span`,{className:z.timeCurrent,children:L(p)}),(0,h.jsxs)(`div`,{className:(0,m.default)(z.progressContainer),children:[(0,h.jsx)(`input`,{type:`range`,min:`0`,max:g||0,value:p,step:`0.1`,onChange:N,className:(0,m.default)(z.progress),"aria-label":V}),(0,h.jsx)(`div`,{className:(0,m.default)(z.progressFill),style:{width:`${p/(g||1)*100}%`}})]}),(0,h.jsx)(`span`,{className:z.timeTotal,children:L(g)})]}),(0,h.jsxs)(`div`,{className:(0,m.default)(z.controlsRow),children:[(0,h.jsxs)(`div`,{className:(0,m.default)(z.controlsGroup),children:[(0,h.jsxs)(`button`,{type:`button`,className:(0,m.default)(z.btn,y>0&&z.active),onClick:()=>D(e=>(e+1)%3),title:re,children:[(0,h.jsx)(f.Icon,{component:l.default,size:`sm`}),y===1&&(0,h.jsx)(`span`,{className:(0,m.default)(z.badge),children:`1`})]}),(0,h.jsx)(`button`,{type:`button`,className:(0,m.default)(z.btn,b&&z.active),onClick:()=>O(e=>!e),title:Q,children:(0,h.jsx)(f.Icon,{component:u.default,size:`sm`})}),w&&(0,h.jsxs)(`button`,{type:`button`,className:(0,m.default)(z.btn,z.btnText),onClick:()=>{let e=[.5,1,1.5,2],t=e[(e.indexOf(x)+1)%e.length];k(t)},title:$,children:[x,`x`]})]}),(0,h.jsxs)(`div`,{className:(0,m.default)(z.controlsGroup),children:[T&&(0,h.jsx)(`button`,{type:`button`,className:(0,m.default)(z.btn,S&&z.active),onClick:()=>A(!S),title:te,children:(0,h.jsx)(f.Icon,{component:n.default,size:`sm`})}),E&&(0,h.jsxs)(`button`,{type:`button`,className:(0,m.default)(z.btn,C!==null&&z.active),onClick:I,title:ne,children:[(0,h.jsx)(f.Icon,{component:a.default,size:`sm`}),C!==null&&(0,h.jsx)(`span`,{className:(0,m.default)(z.badge),style:{fontSize:`7px`},children:Math.ceil(C/60)})]}),(0,h.jsxs)(`div`,{className:(0,m.default)(z.volumeContainer),children:[(0,h.jsx)(`button`,{type:`button`,className:(0,m.default)(z.btn),onClick:()=>j(e=>!e),"aria-label":v?U:H,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)(z.volume),"aria-label":W})]})]})]}),(0,h.jsx)(`div`,{className:(0,m.default)(z.controlsRow),style:{justifyContent:`center`,marginTop:`0.2rem`},children:(0,h.jsxs)(`div`,{className:(0,m.default)(z.controlsGroup),children:[(0,h.jsx)(`button`,{type:`button`,className:(0,m.default)(z.btn),onClick:()=>F(-1),title:J,children:(0,h.jsx)(f.Icon,{component:r.default,size:`sm`})}),(0,h.jsx)(`button`,{type:`button`,className:(0,m.default)(z.btn,z.btnPlay),onClick:M,title:e?K:G,"aria-label":e?K:G,children:(0,h.jsx)(f.Icon,{component:e?s.default:c.default,size:`sm`})}),(0,h.jsx)(`button`,{type:`button`,className:(0,m.default)(z.btn),onClick:()=>F(1),title:q,children:(0,h.jsx)(f.Icon,{component:i.default,size:`sm`})})]})})]})}exports.AudioCustomControls=g;
|
|
@@ -1,187 +1,188 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../../i18n/useWimTranslation.js";
|
|
3
|
-
import t from "../../../../
|
|
4
|
-
import n from "../../../../icon/
|
|
5
|
-
import r from "../../../../icon/chevron-
|
|
6
|
-
import i from "../../../../icon/
|
|
7
|
-
import a from "../../../../icon/
|
|
8
|
-
import o from "../../../../icon/
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
3
|
+
import { commonNs as t } from "../../../../i18n/generated/common.js";
|
|
4
|
+
import n from "../../../../icon/chart.js";
|
|
5
|
+
import r from "../../../../icon/chevron-left.js";
|
|
6
|
+
import i from "../../../../icon/chevron-right.js";
|
|
7
|
+
import a from "../../../../icon/clock.js";
|
|
8
|
+
import o from "../../../../icon/mute.js";
|
|
9
|
+
import s from "../../../../icon/pause.js";
|
|
10
|
+
import c from "../../../../icon/play.js";
|
|
11
|
+
import l from "../../../../icon/repeat.js";
|
|
12
|
+
import u from "../../../../icon/shuffle.js";
|
|
13
|
+
import d from "../../../../icon/volume.js";
|
|
14
|
+
import { Icon as f } from "../../Icon/Icon.js";
|
|
14
15
|
import "react";
|
|
15
|
-
import
|
|
16
|
-
import { jsx as
|
|
16
|
+
import p from "classnames";
|
|
17
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
17
18
|
//#region src/components/media/Audio/components/AudioCustomControls.tsx
|
|
18
|
-
function
|
|
19
|
-
let { t:
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
className:
|
|
19
|
+
function g({ isPlaying: g, currentTime: _, duration: v, volume: y, isMuted: b, repeatMode: x, shuffleMode: S, currentPlaybackRate: C, isBassBoost: w, remainingSleepTime: T, playbackRate: E, presets: D, sleepTimer: O, setRepeatMode: k, setShuffleMode: A, setCurrentPlaybackRate: j, setIsBassBoost: M, setIsMuted: N, togglePlay: P, handleSeek: F, handleVolumeChange: I, playNext: L, toggleSleepTimer: ee, formatTime: R, labels: z = {}, styles: B }) {
|
|
20
|
+
let { t: V } = e(t), { seek: H = V("a11y.seek"), mute: U = V("a11y.mute"), unmute: W = V("a11y.unmute"), volume: G = V("a11y.volume"), play: K = V("a11y.play"), pause: q = V("a11y.pause"), next: J = V("action.next"), prev: Y = V("action.previous"), repeatMode0: X = V("audio.repeat_off"), repeatMode1: Z = V("audio.repeat_single"), repeatMode2: Q = V("audio.repeat_all"), shuffle: $ = V("audio.shuffle"), playbackSpeed: te = V("playback.speed"), bassBoost: ne = V("audio.bass_boost"), sleepTimer: re = "Sleep Timer (15m)" } = z, ie = x === 0 ? X : x === 1 ? Z : Q;
|
|
21
|
+
return /* @__PURE__ */ h("div", {
|
|
22
|
+
className: p(B.customControls),
|
|
22
23
|
children: [
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
className:
|
|
24
|
+
/* @__PURE__ */ h("div", {
|
|
25
|
+
className: p(B.time),
|
|
25
26
|
children: [
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
className:
|
|
28
|
-
children:
|
|
27
|
+
/* @__PURE__ */ m("span", {
|
|
28
|
+
className: B.timeCurrent,
|
|
29
|
+
children: R(_)
|
|
29
30
|
}),
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
className:
|
|
32
|
-
children: [/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ h("div", {
|
|
32
|
+
className: p(B.progressContainer),
|
|
33
|
+
children: [/* @__PURE__ */ m("input", {
|
|
33
34
|
type: "range",
|
|
34
35
|
min: "0",
|
|
35
|
-
max:
|
|
36
|
-
value:
|
|
36
|
+
max: v || 0,
|
|
37
|
+
value: _,
|
|
37
38
|
step: "0.1",
|
|
38
|
-
onChange:
|
|
39
|
-
className:
|
|
40
|
-
"aria-label":
|
|
41
|
-
}), /* @__PURE__ */
|
|
42
|
-
className:
|
|
43
|
-
style: { width: `${
|
|
39
|
+
onChange: F,
|
|
40
|
+
className: p(B.progress),
|
|
41
|
+
"aria-label": H
|
|
42
|
+
}), /* @__PURE__ */ m("div", {
|
|
43
|
+
className: p(B.progressFill),
|
|
44
|
+
style: { width: `${_ / (v || 1) * 100}%` }
|
|
44
45
|
})]
|
|
45
46
|
}),
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
className:
|
|
48
|
-
children:
|
|
47
|
+
/* @__PURE__ */ m("span", {
|
|
48
|
+
className: B.timeTotal,
|
|
49
|
+
children: R(v)
|
|
49
50
|
})
|
|
50
51
|
]
|
|
51
52
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
className:
|
|
54
|
-
children: [/* @__PURE__ */
|
|
55
|
-
className:
|
|
53
|
+
/* @__PURE__ */ h("div", {
|
|
54
|
+
className: p(B.controlsRow),
|
|
55
|
+
children: [/* @__PURE__ */ h("div", {
|
|
56
|
+
className: p(B.controlsGroup),
|
|
56
57
|
children: [
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ h("button", {
|
|
58
59
|
type: "button",
|
|
59
|
-
className:
|
|
60
|
-
onClick: () =>
|
|
61
|
-
title:
|
|
62
|
-
children: [/* @__PURE__ */ f
|
|
63
|
-
component:
|
|
60
|
+
className: p(B.btn, x > 0 && B.active),
|
|
61
|
+
onClick: () => k((e) => (e + 1) % 3),
|
|
62
|
+
title: ie,
|
|
63
|
+
children: [/* @__PURE__ */ m(f, {
|
|
64
|
+
component: l,
|
|
64
65
|
size: "sm"
|
|
65
|
-
}),
|
|
66
|
-
className:
|
|
66
|
+
}), x === 1 && /* @__PURE__ */ m("span", {
|
|
67
|
+
className: p(B.badge),
|
|
67
68
|
children: "1"
|
|
68
69
|
})]
|
|
69
70
|
}),
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ m("button", {
|
|
71
72
|
type: "button",
|
|
72
|
-
className:
|
|
73
|
-
onClick: () =>
|
|
74
|
-
title:
|
|
75
|
-
children: /* @__PURE__ */ f
|
|
76
|
-
component:
|
|
73
|
+
className: p(B.btn, S && B.active),
|
|
74
|
+
onClick: () => A((e) => !e),
|
|
75
|
+
title: $,
|
|
76
|
+
children: /* @__PURE__ */ m(f, {
|
|
77
|
+
component: u,
|
|
77
78
|
size: "sm"
|
|
78
79
|
})
|
|
79
80
|
}),
|
|
80
|
-
|
|
81
|
+
E && /* @__PURE__ */ h("button", {
|
|
81
82
|
type: "button",
|
|
82
|
-
className:
|
|
83
|
+
className: p(B.btn, B.btnText),
|
|
83
84
|
onClick: () => {
|
|
84
85
|
let e = [
|
|
85
86
|
.5,
|
|
86
87
|
1,
|
|
87
88
|
1.5,
|
|
88
89
|
2
|
|
89
|
-
], t = e[(e.indexOf(
|
|
90
|
-
|
|
90
|
+
], t = e[(e.indexOf(C) + 1) % e.length];
|
|
91
|
+
j(t);
|
|
91
92
|
},
|
|
92
|
-
title:
|
|
93
|
-
children: [
|
|
93
|
+
title: te,
|
|
94
|
+
children: [C, "x"]
|
|
94
95
|
})
|
|
95
96
|
]
|
|
96
|
-
}), /* @__PURE__ */
|
|
97
|
-
className:
|
|
97
|
+
}), /* @__PURE__ */ h("div", {
|
|
98
|
+
className: p(B.controlsGroup),
|
|
98
99
|
children: [
|
|
99
|
-
|
|
100
|
+
D && /* @__PURE__ */ m("button", {
|
|
100
101
|
type: "button",
|
|
101
|
-
className:
|
|
102
|
-
onClick: () =>
|
|
103
|
-
title:
|
|
104
|
-
children: /* @__PURE__ */ f
|
|
105
|
-
component:
|
|
102
|
+
className: p(B.btn, w && B.active),
|
|
103
|
+
onClick: () => M(!w),
|
|
104
|
+
title: ne,
|
|
105
|
+
children: /* @__PURE__ */ m(f, {
|
|
106
|
+
component: n,
|
|
106
107
|
size: "sm"
|
|
107
108
|
})
|
|
108
109
|
}),
|
|
109
|
-
|
|
110
|
+
O && /* @__PURE__ */ h("button", {
|
|
110
111
|
type: "button",
|
|
111
|
-
className:
|
|
112
|
-
onClick:
|
|
113
|
-
title:
|
|
114
|
-
children: [/* @__PURE__ */ f
|
|
115
|
-
component:
|
|
112
|
+
className: p(B.btn, T !== null && B.active),
|
|
113
|
+
onClick: ee,
|
|
114
|
+
title: re,
|
|
115
|
+
children: [/* @__PURE__ */ m(f, {
|
|
116
|
+
component: a,
|
|
116
117
|
size: "sm"
|
|
117
|
-
}),
|
|
118
|
-
className:
|
|
118
|
+
}), T !== null && /* @__PURE__ */ m("span", {
|
|
119
|
+
className: p(B.badge),
|
|
119
120
|
style: { fontSize: "7px" },
|
|
120
|
-
children: Math.ceil(
|
|
121
|
+
children: Math.ceil(T / 60)
|
|
121
122
|
})]
|
|
122
123
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
className:
|
|
125
|
-
children: [/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ h("div", {
|
|
125
|
+
className: p(B.volumeContainer),
|
|
126
|
+
children: [/* @__PURE__ */ m("button", {
|
|
126
127
|
type: "button",
|
|
127
|
-
className:
|
|
128
|
-
onClick: () =>
|
|
129
|
-
"aria-label":
|
|
130
|
-
children: /* @__PURE__ */ f
|
|
131
|
-
component:
|
|
128
|
+
className: p(B.btn),
|
|
129
|
+
onClick: () => N((e) => !e),
|
|
130
|
+
"aria-label": b ? W : U,
|
|
131
|
+
children: /* @__PURE__ */ m(f, {
|
|
132
|
+
component: b || y === 0 ? o : d,
|
|
132
133
|
size: "sm"
|
|
133
134
|
})
|
|
134
|
-
}), /* @__PURE__ */
|
|
135
|
+
}), /* @__PURE__ */ m("input", {
|
|
135
136
|
type: "range",
|
|
136
137
|
min: "0",
|
|
137
138
|
max: "1",
|
|
138
139
|
step: "0.05",
|
|
139
|
-
value:
|
|
140
|
-
onChange:
|
|
141
|
-
className:
|
|
142
|
-
"aria-label":
|
|
140
|
+
value: b ? 0 : y,
|
|
141
|
+
onChange: I,
|
|
142
|
+
className: p(B.volume),
|
|
143
|
+
"aria-label": G
|
|
143
144
|
})]
|
|
144
145
|
})
|
|
145
146
|
]
|
|
146
147
|
})]
|
|
147
148
|
}),
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
className:
|
|
149
|
+
/* @__PURE__ */ m("div", {
|
|
150
|
+
className: p(B.controlsRow),
|
|
150
151
|
style: {
|
|
151
152
|
justifyContent: "center",
|
|
152
153
|
marginTop: "0.2rem"
|
|
153
154
|
},
|
|
154
|
-
children: /* @__PURE__ */
|
|
155
|
-
className:
|
|
155
|
+
children: /* @__PURE__ */ h("div", {
|
|
156
|
+
className: p(B.controlsGroup),
|
|
156
157
|
children: [
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ m("button", {
|
|
158
159
|
type: "button",
|
|
159
|
-
className:
|
|
160
|
-
onClick: () =>
|
|
161
|
-
title:
|
|
162
|
-
children: /* @__PURE__ */ f
|
|
163
|
-
component:
|
|
160
|
+
className: p(B.btn),
|
|
161
|
+
onClick: () => L(-1),
|
|
162
|
+
title: Y,
|
|
163
|
+
children: /* @__PURE__ */ m(f, {
|
|
164
|
+
component: r,
|
|
164
165
|
size: "sm"
|
|
165
166
|
})
|
|
166
167
|
}),
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ m("button", {
|
|
168
169
|
type: "button",
|
|
169
|
-
className:
|
|
170
|
-
onClick:
|
|
171
|
-
title:
|
|
172
|
-
"aria-label":
|
|
173
|
-
children: /* @__PURE__ */ f
|
|
174
|
-
component:
|
|
170
|
+
className: p(B.btn, B.btnPlay),
|
|
171
|
+
onClick: P,
|
|
172
|
+
title: g ? q : K,
|
|
173
|
+
"aria-label": g ? q : K,
|
|
174
|
+
children: /* @__PURE__ */ m(f, {
|
|
175
|
+
component: g ? s : c,
|
|
175
176
|
size: "sm"
|
|
176
177
|
})
|
|
177
178
|
}),
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ m("button", {
|
|
179
180
|
type: "button",
|
|
180
|
-
className:
|
|
181
|
-
onClick: () =>
|
|
182
|
-
title:
|
|
183
|
-
children: /* @__PURE__ */ f
|
|
184
|
-
component:
|
|
181
|
+
className: p(B.btn),
|
|
182
|
+
onClick: () => L(1),
|
|
183
|
+
title: J,
|
|
184
|
+
children: /* @__PURE__ */ m(f, {
|
|
185
|
+
component: i,
|
|
185
186
|
size: "sm"
|
|
186
187
|
})
|
|
187
188
|
})
|
|
@@ -192,4 +193,4 @@ function m({ isPlaying: m, currentTime: h, duration: g, volume: _, isMuted: v, r
|
|
|
192
193
|
});
|
|
193
194
|
}
|
|
194
195
|
//#endregion
|
|
195
|
-
export {
|
|
196
|
+
export { g as AudioCustomControls };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../icon/close.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/components.cjs"),r=require("../../../icon/close.cjs"),i=require("../Icon/Icon.cjs"),a=require("../../form/Button/Button.cjs"),o=require("../../form/Checkbox/Checkbox.cjs"),s=require("./gallery.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=(0,c.createContext)(null),f=()=>{let e=(0,c.useContext)(d);if(!e)throw Error(`Gallery subcomponents must be used within Gallery`);return e},p=c.default.forwardRef(({items:e,columns:o=3,gap:f=`md`,aspect:p=`square`,selectable:h=!1,selected:g,defaultSelected:_=[],onSelectionChange:v,onItemClick:y,renderActions:b,className:x,style:S,...C},w)=>{let{t:T}=t.useWimTranslation(n.componentsNs),E=g!==void 0,[D,O]=(0,c.useState)(()=>new Set(_)),[k,A]=(0,c.useState)(0),j=(0,c.useRef)(null),M=(0,c.useRef)(null),[N,P]=(0,c.useState)(o),F=(0,c.useCallback)(e=>{M.current=e,typeof w==`function`?w(e):w&&(w.current=e)},[w]);(0,c.useEffect)(()=>{let e=M.current;if(!e)return;let t=new ResizeObserver(e=>{let t=e[0].contentRect.width;P(t<480?1:t<576?2:o)});return t.observe(e),()=>t.disconnect()},[o]);let I=(0,c.useMemo)(()=>E?new Set(g):D,[E,g,D]),L=(0,c.useCallback)(e=>{E||O(e),v?.(Array.from(e))},[E,v]),R=(0,c.useCallback)((t,n,r)=>{let i=new Set(I);if(r&&j.current!==null){let r=Math.min(j.current,n),a=Math.max(j.current,n),o=!I.has(t);for(let t=r;t<=a;t++)o?i.add(e[t].id):i.delete(e[t].id)}else i.has(t)?i.delete(t):i.add(t),j.current=n;L(i)},[I,e,L]),z=(0,c.useCallback)(()=>{L(new Set(e.map(e=>e.id)))},[e,L]),B=(0,c.useCallback)(()=>{L(new Set)},[L]),V=(0,c.useMemo)(()=>{let t=[];for(let n=0;n<e.length;n+=N)t.push({rowItems:e.slice(n,n+N),startIndex:n});return t},[e,N]),H=Array.from(I),U=H.length>0,W={"--gallery-columns":N,...S},G=t=>{let n=N,r=e.length,i=k;switch(t.key){case`ArrowRight`:t.preventDefault(),i=Math.min(k+1,r-1);break;case`ArrowLeft`:t.preventDefault(),i=Math.max(k-1,0);break;case`ArrowDown`:t.preventDefault(),i=Math.min(k+n,r-1);break;case`ArrowUp`:t.preventDefault(),i=Math.max(k-n,0);break;case`Home`:t.preventDefault(),i=0;break;case`End`:t.preventDefault(),i=r-1;break;case`Escape`:h&&(t.preventDefault(),B());break;case`a`:case`A`:h&&(t.ctrlKey||t.metaKey)&&(t.preventDefault(),z());break;default:return}i!==k&&(A(i),t.currentTarget.querySelectorAll(`[data-gallery-item]`)[i]?.focus())};return(0,u.jsx)(d.Provider,{value:{selectable:h,selectedIds:I,lastClickedIndex:j,items:e,toggleSelect:R,focusedIndex:k,setFocusedIndex:A,selectAll:z,clearSelection:B,onItemClick:y},children:(0,u.jsxs)(`div`,{ref:F,className:(0,l.default)(`wim-gallery`,s.default.root,x),...C,children:[h&&U&&(0,u.jsxs)(`div`,{className:s.default.toolbar,role:`toolbar`,"aria-label":T(`gallery.toolbar_label`),children:[(0,u.jsx)(`span`,{className:s.default.toolbarCount,children:T(`gallery.selected_count`,{count:H.length})}),(0,u.jsxs)(`div`,{className:s.default.toolbarActions,children:[b?.({selectedIds:H,clearSelection:B}),(0,u.jsx)(a.Button,{size:`sm`,variant:`ghost`,className:s.default.toolbarClear,onClick:B,"aria-label":T(`gallery.clear_selection`),icon:(0,u.jsx)(i.Icon,{component:r.default,size:`sm`})})]})]}),(0,u.jsx)(`div`,{className:(0,l.default)(s.default.grid,s.default[`gap-${f}`],s.default[`aspect-${p}`]),style:W,role:`grid`,"aria-multiselectable":h||void 0,"aria-label":T(`gallery.grid_label`),onKeyDown:G,tabIndex:0,children:V.map(({rowItems:e,startIndex:t},n)=>(0,u.jsx)(`div`,{role:`row`,style:{display:`contents`},children:e.map((e,n)=>(0,u.jsx)(m,{item:e,index:t+n},e.id))},n))})]})})});p.displayName=`Gallery`;var m=({item:e,index:r})=>{let{selectable:i,selectedIds:a,toggleSelect:c,focusedIndex:d,setFocusedIndex:p,onItemClick:m}=f(),{t:h}=t.useWimTranslation(n.componentsNs),g=a.has(e.id),_=d===r,v=()=>{m?.(e,r),p(r)},y=t=>{t.stopPropagation(),c(e.id,r,t.shiftKey)},b=t=>{(t.key===` `||t.key===`Enter`)&&(t.preventDefault(),i&&t.key===` `?c(e.id,r,t.shiftKey):m?.(e,r))};return(0,u.jsxs)(`div`,{className:(0,l.default)(s.default.item,{[s.default.selected]:g}),role:`gridcell`,"aria-selected":i?g:void 0,tabIndex:_?0:-1,onClick:v,onKeyDown:b,onFocus:()=>p(r),"data-gallery-item":!0,children:[(0,u.jsxs)(`div`,{className:s.default.imageWrapper,children:[(0,u.jsx)(`img`,{src:e.src,alt:e.alt??e.title??``,className:s.default.image,draggable:!1}),i&&(0,u.jsx)(`div`,{className:s.default.checkboxOverlay,children:(0,u.jsx)(o.Checkbox,{checked:g,onChange:()=>{},onClick:y,"aria-label":h(g?`gallery.deselect_item`:`gallery.select_item`,{title:e.title??e.alt??String(r+1)}),tabIndex:-1,className:s.default.checkbox})}),g&&(0,u.jsx)(`div`,{className:s.default.selectedRing,"aria-hidden":!0})]}),(e.title||e.caption)&&(0,u.jsxs)(`div`,{className:s.default.caption,children:[e.title&&(0,u.jsx)(`span`,{className:s.default.captionTitle,children:e.title}),e.caption&&(0,u.jsx)(`span`,{className:s.default.captionText,children:e.caption})]})]})};exports.Gallery=p;
|