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,131 +1,132 @@
|
|
|
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/
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import s from "
|
|
10
|
-
import c
|
|
11
|
-
import m from "
|
|
12
|
-
import
|
|
3
|
+
import { componentsNs as t } from "../../../i18n/generated/components.js";
|
|
4
|
+
import n from "../../../icon/close.js";
|
|
5
|
+
import r from "../../../icon/edit.js";
|
|
6
|
+
import i from "../../../icon/plus.js";
|
|
7
|
+
import { Icon as a } from "../../media/Icon/Icon.js";
|
|
8
|
+
import { Card as o } from "../../data-display/Card/Card.js";
|
|
9
|
+
import { Button as s } from "../../form/Button/Button.js";
|
|
10
|
+
import c from "./dashboard.module.js";
|
|
11
|
+
import l, { createContext as u, useCallback as d, useContext as f, useMemo as p, useState as m } from "react";
|
|
12
|
+
import h from "classnames";
|
|
13
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
13
14
|
//#region src/components/layout/Dashboard/Dashboard.tsx
|
|
14
|
-
var
|
|
15
|
-
let e =
|
|
15
|
+
var v = u(null), y = () => {
|
|
16
|
+
let e = f(v);
|
|
16
17
|
if (!e) throw Error("Dashboard subcomponents must be used within Dashboard");
|
|
17
18
|
return e;
|
|
18
|
-
},
|
|
19
|
-
let { t:
|
|
20
|
-
let e = !
|
|
21
|
-
|
|
19
|
+
}, b = l.forwardRef(({ widgets: n, editable: o, defaultEditable: l = !1, onEditChange: u, onRemove: f, onAdd: y, columns: b = 3, gap: S = "md", showEditToggle: C, titleLevel: w = 3, label: T, className: E, style: D, children: O, ...k }, A) => {
|
|
20
|
+
let { t: j } = e(t), M = o !== void 0, [N, P] = m(l), F = M ? o : N, I = d(() => {
|
|
21
|
+
let e = !F;
|
|
22
|
+
M || P(e), u?.(e);
|
|
22
23
|
}, [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
]),
|
|
27
|
-
"--dashboard-columns":
|
|
28
|
-
...
|
|
29
|
-
},
|
|
30
|
-
editable:
|
|
31
|
-
onRemove:
|
|
32
|
-
titleLevel:
|
|
24
|
+
F,
|
|
25
|
+
M,
|
|
26
|
+
u
|
|
27
|
+
]), L = {
|
|
28
|
+
"--dashboard-columns": b,
|
|
29
|
+
...D
|
|
30
|
+
}, R = C ?? (o !== void 0 || l || f !== void 0 || y !== void 0), z = p(() => ({
|
|
31
|
+
editable: F ?? !1,
|
|
32
|
+
onRemove: f,
|
|
33
|
+
titleLevel: w
|
|
33
34
|
}), [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
F,
|
|
36
|
+
f,
|
|
37
|
+
w
|
|
37
38
|
]);
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
value:
|
|
40
|
-
children: /* @__PURE__ */
|
|
41
|
-
ref:
|
|
42
|
-
className:
|
|
39
|
+
return /* @__PURE__ */ g(v.Provider, {
|
|
40
|
+
value: z,
|
|
41
|
+
children: /* @__PURE__ */ _("div", {
|
|
42
|
+
ref: A,
|
|
43
|
+
className: h("wim-dashboard", c.root, E),
|
|
43
44
|
role: "group",
|
|
44
|
-
"aria-label":
|
|
45
|
-
...
|
|
46
|
-
children: [(
|
|
47
|
-
className:
|
|
48
|
-
children: [
|
|
49
|
-
className:
|
|
50
|
-
children:
|
|
51
|
-
}),
|
|
45
|
+
"aria-label": T ?? j("dashboard_widget.label"),
|
|
46
|
+
...k,
|
|
47
|
+
children: [(T || R) && /* @__PURE__ */ _("div", {
|
|
48
|
+
className: c.header,
|
|
49
|
+
children: [T && /* @__PURE__ */ g("h2", {
|
|
50
|
+
className: c.heading,
|
|
51
|
+
children: T
|
|
52
|
+
}), R && /* @__PURE__ */ g(s, {
|
|
52
53
|
size: "sm",
|
|
53
|
-
variant:
|
|
54
|
+
variant: F ? "solid" : "outline",
|
|
54
55
|
intent: "default",
|
|
55
56
|
className: void 0,
|
|
56
|
-
onClick:
|
|
57
|
-
"aria-pressed":
|
|
58
|
-
"aria-label":
|
|
59
|
-
icon: /* @__PURE__ */
|
|
60
|
-
component:
|
|
57
|
+
onClick: I,
|
|
58
|
+
"aria-pressed": F,
|
|
59
|
+
"aria-label": j(F ? "dashboard_widget.exit_edit" : "dashboard_widget.enter_edit"),
|
|
60
|
+
icon: /* @__PURE__ */ g(a, {
|
|
61
|
+
component: r,
|
|
61
62
|
size: "sm"
|
|
62
63
|
}),
|
|
63
|
-
children:
|
|
64
|
+
children: j(F ? "dashboard_widget.exit_edit" : "dashboard_widget.enter_edit")
|
|
64
65
|
})]
|
|
65
|
-
}), /* @__PURE__ */
|
|
66
|
-
className:
|
|
67
|
-
style:
|
|
66
|
+
}), /* @__PURE__ */ _("div", {
|
|
67
|
+
className: h(c.grid, c[`gap-${S}`]),
|
|
68
|
+
style: L,
|
|
68
69
|
role: "region",
|
|
69
|
-
"aria-label":
|
|
70
|
-
children: [
|
|
70
|
+
"aria-label": j("dashboard_widget.grid_label"),
|
|
71
|
+
children: [n ? n.map((e) => /* @__PURE__ */ g(x, { widget: e }, e.id)) : O, F && y && /* @__PURE__ */ g(s, {
|
|
71
72
|
asChild: !0,
|
|
72
|
-
className:
|
|
73
|
-
onClick:
|
|
74
|
-
"aria-label":
|
|
75
|
-
children: /* @__PURE__ */
|
|
73
|
+
className: c.addButton,
|
|
74
|
+
onClick: y,
|
|
75
|
+
"aria-label": j("dashboard_widget.add_widget"),
|
|
76
|
+
children: /* @__PURE__ */ _("button", {
|
|
76
77
|
type: "button",
|
|
77
|
-
children: [/* @__PURE__ */
|
|
78
|
-
component:
|
|
78
|
+
children: [/* @__PURE__ */ g(a, {
|
|
79
|
+
component: i,
|
|
79
80
|
size: "md"
|
|
80
|
-
}), /* @__PURE__ */
|
|
81
|
+
}), /* @__PURE__ */ g("span", { children: j("dashboard_widget.add_widget") })]
|
|
81
82
|
})
|
|
82
83
|
})]
|
|
83
84
|
})]
|
|
84
85
|
})
|
|
85
86
|
});
|
|
86
87
|
});
|
|
87
|
-
|
|
88
|
-
var
|
|
89
|
-
let { editable:
|
|
90
|
-
return /* @__PURE__ */
|
|
88
|
+
b.displayName = "Dashboard";
|
|
89
|
+
var x = ({ widget: r, className: i, ...l }) => {
|
|
90
|
+
let { editable: u, onRemove: d, titleLevel: f } = y(), p = `h${f}`, { t: m } = e(t), { id: v, title: b, description: x, content: S, span: C = 1, rowSpan: w = 1 } = r;
|
|
91
|
+
return /* @__PURE__ */ _(o, {
|
|
91
92
|
variant: "outline",
|
|
92
93
|
padding: "md",
|
|
93
94
|
radius: "md",
|
|
94
|
-
className:
|
|
95
|
+
className: h(c.widget, c[`span-${C}`], c[`row-${w}`], { [c.editMode]: u }, i),
|
|
95
96
|
style: {
|
|
96
|
-
"--widget-span":
|
|
97
|
-
"--widget-row-span":
|
|
97
|
+
"--widget-span": C,
|
|
98
|
+
"--widget-row-span": w
|
|
98
99
|
},
|
|
99
|
-
...
|
|
100
|
-
children: [/* @__PURE__ */
|
|
101
|
-
className:
|
|
102
|
-
children: [/* @__PURE__ */
|
|
103
|
-
className:
|
|
104
|
-
children: [/* @__PURE__ */
|
|
105
|
-
className:
|
|
106
|
-
children: y
|
|
107
|
-
}), b && /* @__PURE__ */ h("p", {
|
|
108
|
-
className: s.widgetDescription,
|
|
100
|
+
...l,
|
|
101
|
+
children: [/* @__PURE__ */ _("div", {
|
|
102
|
+
className: c.widgetHeader,
|
|
103
|
+
children: [/* @__PURE__ */ _("div", {
|
|
104
|
+
className: c.widgetMeta,
|
|
105
|
+
children: [/* @__PURE__ */ g(p, {
|
|
106
|
+
className: c.widgetTitle,
|
|
109
107
|
children: b
|
|
108
|
+
}), x && /* @__PURE__ */ g("p", {
|
|
109
|
+
className: c.widgetDescription,
|
|
110
|
+
children: x
|
|
110
111
|
})]
|
|
111
|
-
}),
|
|
112
|
+
}), u && d && /* @__PURE__ */ g(s, {
|
|
112
113
|
size: "sm",
|
|
113
114
|
variant: "ghost",
|
|
114
115
|
intent: "danger",
|
|
115
|
-
className:
|
|
116
|
-
onClick: () =>
|
|
117
|
-
"aria-label":
|
|
118
|
-
icon: /* @__PURE__ */
|
|
119
|
-
component:
|
|
116
|
+
className: c.removeButton,
|
|
117
|
+
onClick: () => d(v),
|
|
118
|
+
"aria-label": m("dashboard_widget.remove_widget", { title: b }),
|
|
119
|
+
icon: /* @__PURE__ */ g(a, {
|
|
120
|
+
component: n,
|
|
120
121
|
size: "sm"
|
|
121
122
|
})
|
|
122
123
|
})]
|
|
123
|
-
}), /* @__PURE__ */
|
|
124
|
-
className:
|
|
125
|
-
children:
|
|
124
|
+
}), /* @__PURE__ */ g("div", {
|
|
125
|
+
className: c.widgetContent,
|
|
126
|
+
children: S
|
|
126
127
|
})]
|
|
127
128
|
});
|
|
128
129
|
};
|
|
129
|
-
|
|
130
|
+
x.displayName = "DashboardWidgetCard";
|
|
130
131
|
//#endregion
|
|
131
|
-
export {
|
|
132
|
+
export { b as Dashboard, x as DashboardWidgetCard };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../navigation/HamburgerMenu/HamburgerMenu.cjs"),n=require("../../overlay/Drawer/Drawer.cjs"),r=require("./navbar.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=(0,i.createContext)(void 0),c=i.default.forwardRef(({className:e,children:t,fixed:n,sticky:c,transparent:l,glass:u,bordered:d,fluid:f,defaultMenuOpen:p=!1,isMenuOpen:m,onMenuOpenChange:h,...g},_)=>{let[v,y]=(0,i.useState)(p),b=m??v;return(0,o.jsx)(s.Provider,{value:{isMenuOpen:b,setIsMenuOpen:e=>{y(e),h?.(e)}},children:(0,o.jsx)(`nav`,{ref:_,className:(0,a.default)(`wim-navbar`,r.default.root,n&&r.default.fixed,c&&r.default.sticky,l&&r.default.transparent,u&&r.default.glass,d&&r.default.bordered,e),...g,children:(0,o.jsx)(`div`,{className:(0,a.default)(r.default.container,f&&r.default.fluid),children:t})})})});c.displayName=`Navbar`;var l=i.default.forwardRef(({className:e,children:t,...n},i)=>(0,o.jsx)(`div`,{ref:i,className:(0,a.default)(r.default.brand,e),...n,children:t}));l.displayName=`Navbar.Brand`;var u=i.default.forwardRef(({className:e,children:t,justify:n=`end`,hiddenOnMobile:i,...s},c)=>(0,o.jsx)(`div`,{ref:c,className:(0,a.default)(r.default.content,r.default[n],i&&r.default.hiddenMobile,e),...s,children:t}));u.displayName=`Navbar.Content`;var d=i.default.forwardRef(({className:e,children:t,active:n,...i},s)=>(0,o.jsx)(`div`,{ref:s,className:(0,a.default)(r.default.item,n&&r.default.active,e),...i,children:t}));d.displayName=`Navbar.Item`;var f=i.default.forwardRef(({className:e,children:t,active:n,...i},s)=>(0,o.jsx)(`a`,{ref:s,className:(0,a.default)(r.default.link,n&&r.default.active,e),...i,children:t}));f.displayName=`Navbar.Link`;var p=i.default.forwardRef(({className:e,...n},a)=>{let c=(0,i.useContext)(s);if(!c)throw Error(`NavbarToggle must be used within a Navbar`);let{isMenuOpen:l,setIsMenuOpen:u}=c;return(0,o.jsx)(`div`,{className:r.default.toggle,children:(0,o.jsx)(t.HamburgerMenu,{ref:a,open:l,
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../navigation/HamburgerMenu/HamburgerMenu.cjs"),n=require("../../overlay/Drawer/Drawer.cjs"),r=require("./navbar.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=(0,i.createContext)(void 0),c=i.default.forwardRef(({className:e,children:t,fixed:n,sticky:c,transparent:l,glass:u,bordered:d,fluid:f,defaultMenuOpen:p=!1,isMenuOpen:m,onMenuOpenChange:h,...g},_)=>{let[v,y]=(0,i.useState)(p),b=m??v;return(0,o.jsx)(s.Provider,{value:{isMenuOpen:b,setIsMenuOpen:e=>{y(e),h?.(e)}},children:(0,o.jsx)(`nav`,{ref:_,className:(0,a.default)(`wim-navbar`,r.default.root,n&&r.default.fixed,c&&r.default.sticky,l&&r.default.transparent,u&&r.default.glass,d&&r.default.bordered,e),...g,children:(0,o.jsx)(`div`,{className:(0,a.default)(r.default.container,f&&r.default.fluid),children:t})})})});c.displayName=`Navbar`;var l=i.default.forwardRef(({className:e,children:t,...n},i)=>(0,o.jsx)(`div`,{ref:i,className:(0,a.default)(r.default.brand,e),...n,children:t}));l.displayName=`Navbar.Brand`;var u=i.default.forwardRef(({className:e,children:t,justify:n=`end`,hiddenOnMobile:i,...s},c)=>(0,o.jsx)(`div`,{ref:c,className:(0,a.default)(r.default.content,r.default[n],i&&r.default.hiddenMobile,e),...s,children:t}));u.displayName=`Navbar.Content`;var d=i.default.forwardRef(({className:e,children:t,active:n,...i},s)=>(0,o.jsx)(`div`,{ref:s,className:(0,a.default)(r.default.item,n&&r.default.active,e),...i,children:t}));d.displayName=`Navbar.Item`;var f=i.default.forwardRef(({className:e,children:t,active:n,...i},s)=>(0,o.jsx)(`a`,{ref:s,className:(0,a.default)(r.default.link,n&&r.default.active,e),...i,children:t}));f.displayName=`Navbar.Link`;var p=i.default.forwardRef(({className:e,...n},a)=>{let c=(0,i.useContext)(s);if(!c)throw Error(`NavbarToggle must be used within a Navbar`);let{isMenuOpen:l,setIsMenuOpen:u}=c;return(0,o.jsx)(`div`,{className:r.default.toggle,children:(0,o.jsx)(t.HamburgerMenu,{ref:a,open:l,onOpenChange:u,className:e,...n})})});p.displayName=`Navbar.Toggle`;var m=i.default.forwardRef(({className:e,children:t,position:c=`top`,...l},u)=>{let d=(0,i.useContext)(s);if(!d)throw Error(`NavbarMenu must be used within a Navbar`);let{isMenuOpen:f,setIsMenuOpen:p}=d;return(0,o.jsx)(n.Drawer,{open:f,onOpenChange:p,side:c,children:(0,o.jsx)(n.DrawerContent,{className:(0,a.default)(r.default.menu,e),children:t})})});m.displayName=`Navbar.Menu`;var h=i.default.forwardRef(({className:e,children:t,active:n,...c},l)=>{let{setIsMenuOpen:u}=(0,i.useContext)(s)||{};return(0,o.jsx)(`div`,{ref:l,className:(0,a.default)(r.default.menuItem,n&&r.default.active,e),onClick:e=>{u?.(!1),c.onClick?.(e)},role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.currentTarget.click()},...c,children:t})});h.displayName=`Navbar.MenuItem`;var g=Object.assign(c,{Brand:l,Content:u,Item:d,Link:f,Toggle:p,Menu:m,MenuItem:h});exports.Navbar=g,exports.default=g,exports.NavbarBrand=l,exports.NavbarContent=u,exports.NavbarItem=d,exports.NavbarLink=f,exports.NavbarMenu=m,exports.NavbarMenuItem=h,exports.NavbarToggle=p;
|
|
@@ -35,7 +35,7 @@ export interface NavbarLinkProps extends React.ComponentPropsWithoutRef<"a"> {
|
|
|
35
35
|
active?: boolean;
|
|
36
36
|
}
|
|
37
37
|
export declare const NavbarLink: React.ForwardRefExoticComponent<NavbarLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
38
|
-
export type NavbarToggleProps = Omit<React.ComponentPropsWithoutRef<typeof HamburgerMenu>, "open" | "onClick">;
|
|
38
|
+
export type NavbarToggleProps = Omit<React.ComponentPropsWithoutRef<typeof HamburgerMenu>, "open" | "onClick" | "onOpenChange">;
|
|
39
39
|
export declare const NavbarToggle: React.ForwardRefExoticComponent<NavbarToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
40
40
|
export interface NavbarMenuProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
41
41
|
position?: "right" | "left" | "top" | "bottom";
|
|
@@ -24,7 +24,7 @@ export interface SidebarProps extends React.ComponentPropsWithoutRef<"aside"> {
|
|
|
24
24
|
* ```tsx
|
|
25
25
|
* const [open, setOpen] = useState(false);
|
|
26
26
|
*
|
|
27
|
-
* <HamburgerMenu visibleBelow="md" open={open}
|
|
27
|
+
* <HamburgerMenu visibleBelow="md" open={open} onOpenChange={setOpen} />
|
|
28
28
|
* <Sidebar mobileOpen={open} onOverlayClick={() => setOpen(false)}>…</Sidebar>
|
|
29
29
|
* ```
|
|
30
30
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("./splitter.module.cjs");let
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/common.cjs"),r=require("./splitter.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=(0,i.createContext)(null),c=()=>{let e=(0,i.useContext)(s);if(!e)throw Error(`Splitter components must be used within Splitter`);return e},l=({orientation:e=`horizontal`,className:t,children:n,...c})=>{let l=(0,i.useRef)(null),f=(0,i.useMemo)(()=>i.default.Children.toArray(n),[n]),p=(0,i.useMemo)(()=>f.filter(e=>e.type===u),[f]),[m,h]=(0,i.useState)([]),[g,_]=(0,i.useState)(0);if(p.length!==g){_(p.length);let e=p.map(e=>e.props.defaultSize??100/(p.length||1)),t=e.reduce((e,t)=>e+t,0)||1;h(e.map(e=>e/t*100))}let[v,y]=(0,i.useState)(null),b=(0,i.useCallback)((e,t)=>{y(e),t.preventDefault()},[]),x=(0,i.useCallback)(t=>{if(v===null||!l.current)return;let n=l.current.getBoundingClientRect(),r=e===`horizontal`?n.width:n.height,i=e===`horizontal`?n.left:n.top,a=((`touches`in t?e===`horizontal`?t.touches[0].clientX:t.touches[0].clientY:e===`horizontal`?t.clientX:t.clientY)-i)/r*100;h(e=>{let t=[...e],n=0;for(let t=0;t<v;t++)n+=e[t];let r=e[v]+e[v+1],i=a-n,o=p[v],s=p[v+1],c=o.props.minSize??0,l=o.props.maxSize??100,u=s.props.minSize??0,d=s.props.maxSize??100;i=Math.max(c,Math.min(i,l));let f=r-i;return f<u?(f=u,i=r-f):f>d&&(f=d,i=r-f),t[v]=i,t[v+1]=f,t})},[v,e,p]),S=(0,i.useCallback)(()=>{y(null)},[]);(0,i.useEffect)(()=>{if(v!==null)return window.addEventListener(`mousemove`,x),window.addEventListener(`mouseup`,S),window.addEventListener(`touchmove`,x,{passive:!1}),window.addEventListener(`touchend`,S),()=>{window.removeEventListener(`mousemove`,x),window.removeEventListener(`mouseup`,S),window.removeEventListener(`touchmove`,x),window.removeEventListener(`touchend`,S)}},[v,x,S]);let C=0,w=0,T=f.map(e=>{if(e.type===u){let t=C++;return i.default.cloneElement(e,{size:m[t]})}if(e.type===d){let t=w++,n=Math.round(m.slice(0,t+1).reduce((e,t)=>e+t,0));return i.default.cloneElement(e,{index:t,active:v===t,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100})}return e});return(0,o.jsx)(s.Provider,{value:{orientation:e,onResizeStart:b},children:(0,o.jsx)(`div`,{ref:l,className:(0,a.default)(`wim-splitter`,r.default.root,r.default[e],v!==null&&r.default.resizing,t),"data-testid":`splitter-root`,...c,children:T})})},u=({defaultSize:e,minSize:t,maxSize:n,size:i,style:s,className:c,children:l,...u})=>(0,o.jsx)(`div`,{className:(0,a.default)(r.default.panel,c),"data-testid":`splitter-panel`,style:{...s,flex:i===void 0?`1 1 0%`:`0 0 ${i}%`},tabIndex:0,...u,children:l});u.displayName=`Splitter.Panel`;var d=({index:e,active:i,className:s,ariaLabel:l,...u})=>{let{t:d}=t.useWimTranslation(n.commonNs),f=l??d(`a11y.resize_panel`),{onResizeStart:p,orientation:m}=c();return(0,o.jsx)(`div`,{role:`separator`,"aria-orientation":m,"aria-label":f,tabIndex:0,className:(0,a.default)(r.default.handle,i&&r.default.active,s),"data-testid":`splitter-handle`,onMouseDown:t=>e!==void 0&&p(e,t),onTouchStart:t=>e!==void 0&&p(e,t),onKeyDown:e=>{(e.key===`ArrowLeft`||e.key===`ArrowUp`||e.key===`ArrowRight`||e.key===`ArrowDown`)&&e.preventDefault()},...u})};d.displayName=`Splitter.Handle`,l.displayName=`Splitter`;var f=l;f.Panel=u,f.Handle=d,exports.Splitter=f,exports.default=f;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
-
import t from "
|
|
4
|
-
import n
|
|
5
|
-
import u from "
|
|
6
|
-
import
|
|
3
|
+
import { commonNs as t } from "../../../i18n/generated/common.js";
|
|
4
|
+
import n from "./splitter.module.js";
|
|
5
|
+
import r, { createContext as i, useCallback as a, useContext as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
6
|
+
import d from "classnames";
|
|
7
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
7
8
|
//#region src/components/layout/Splitter/Splitter.tsx
|
|
8
|
-
var
|
|
9
|
-
let e =
|
|
9
|
+
var p = i(null), m = () => {
|
|
10
|
+
let e = o(p);
|
|
10
11
|
if (!e) throw Error("Splitter components must be used within Splitter");
|
|
11
12
|
return e;
|
|
12
|
-
},
|
|
13
|
-
let m =
|
|
13
|
+
}, h = ({ orientation: e = "horizontal", className: t, children: i, ...o }) => {
|
|
14
|
+
let m = l(null), h = c(() => r.Children.toArray(i), [i]), v = c(() => h.filter((e) => e.type === g), [h]), [y, b] = u([]), [x, S] = u(0);
|
|
14
15
|
if (v.length !== x) {
|
|
15
16
|
S(v.length);
|
|
16
17
|
let e = v.map((e) => e.props.defaultSize ?? 100 / (v.length || 1)), t = e.reduce((e, t) => e + t, 0) || 1;
|
|
17
18
|
b(e.map((e) => e / t * 100));
|
|
18
19
|
}
|
|
19
|
-
let [C, w] =
|
|
20
|
+
let [C, w] = u(null), T = a((e, t) => {
|
|
20
21
|
w(e), t.preventDefault();
|
|
21
|
-
}, []), E =
|
|
22
|
+
}, []), E = a((t) => {
|
|
22
23
|
if (C === null || !m.current) return;
|
|
23
24
|
let n = m.current.getBoundingClientRect(), r = e === "horizontal" ? n.width : n.height, i = e === "horizontal" ? n.left : n.top, a = (("touches" in t ? e === "horizontal" ? t.touches[0].clientX : t.touches[0].clientY : e === "horizontal" ? t.clientX : t.clientY) - i) / r * 100;
|
|
24
25
|
b((e) => {
|
|
@@ -33,10 +34,10 @@ var f = r(null), p = () => {
|
|
|
33
34
|
C,
|
|
34
35
|
e,
|
|
35
36
|
v
|
|
36
|
-
]), D =
|
|
37
|
+
]), D = a(() => {
|
|
37
38
|
w(null);
|
|
38
39
|
}, []);
|
|
39
|
-
|
|
40
|
+
s(() => {
|
|
40
41
|
if (C !== null) return window.addEventListener("mousemove", E), window.addEventListener("mouseup", D), window.addEventListener("touchmove", E, { passive: !1 }), window.addEventListener("touchend", D), () => {
|
|
41
42
|
window.removeEventListener("mousemove", E), window.removeEventListener("mouseup", D), window.removeEventListener("touchmove", E), window.removeEventListener("touchend", D);
|
|
42
43
|
};
|
|
@@ -45,38 +46,38 @@ var f = r(null), p = () => {
|
|
|
45
46
|
E,
|
|
46
47
|
D
|
|
47
48
|
]);
|
|
48
|
-
let O = 0, k = 0, A =
|
|
49
|
-
if (e.type ===
|
|
49
|
+
let O = 0, k = 0, A = h.map((e) => {
|
|
50
|
+
if (e.type === g) {
|
|
50
51
|
let t = O++;
|
|
51
|
-
return
|
|
52
|
+
return r.cloneElement(e, { size: y[t] });
|
|
52
53
|
}
|
|
53
|
-
if (e.type ===
|
|
54
|
-
let t = k++,
|
|
55
|
-
return
|
|
54
|
+
if (e.type === _) {
|
|
55
|
+
let t = k++, n = Math.round(y.slice(0, t + 1).reduce((e, t) => e + t, 0));
|
|
56
|
+
return r.cloneElement(e, {
|
|
56
57
|
index: t,
|
|
57
58
|
active: C === t,
|
|
58
|
-
"aria-valuenow":
|
|
59
|
+
"aria-valuenow": n,
|
|
59
60
|
"aria-valuemin": 0,
|
|
60
61
|
"aria-valuemax": 100
|
|
61
62
|
});
|
|
62
63
|
}
|
|
63
64
|
return e;
|
|
64
65
|
});
|
|
65
|
-
return /* @__PURE__ */
|
|
66
|
+
return /* @__PURE__ */ f(p.Provider, {
|
|
66
67
|
value: {
|
|
67
68
|
orientation: e,
|
|
68
69
|
onResizeStart: T
|
|
69
70
|
},
|
|
70
|
-
children: /* @__PURE__ */
|
|
71
|
+
children: /* @__PURE__ */ f("div", {
|
|
71
72
|
ref: m,
|
|
72
|
-
className:
|
|
73
|
+
className: d("wim-splitter", n.root, n[e], C !== null && n.resizing, t),
|
|
73
74
|
"data-testid": "splitter-root",
|
|
74
|
-
...
|
|
75
|
+
...o,
|
|
75
76
|
children: A
|
|
76
77
|
})
|
|
77
78
|
});
|
|
78
|
-
},
|
|
79
|
-
className:
|
|
79
|
+
}, g = ({ defaultSize: e, minSize: t, maxSize: r, size: i, style: a, className: o, children: s, ...c }) => /* @__PURE__ */ f("div", {
|
|
80
|
+
className: d(n.panel, o),
|
|
80
81
|
"data-testid": "splitter-panel",
|
|
81
82
|
style: {
|
|
82
83
|
...a,
|
|
@@ -86,26 +87,26 @@ var f = r(null), p = () => {
|
|
|
86
87
|
...c,
|
|
87
88
|
children: s
|
|
88
89
|
});
|
|
89
|
-
|
|
90
|
-
var
|
|
91
|
-
let { t:
|
|
92
|
-
return /* @__PURE__ */
|
|
90
|
+
g.displayName = "Splitter.Panel";
|
|
91
|
+
var _ = ({ index: r, active: i, className: a, ariaLabel: o, ...s }) => {
|
|
92
|
+
let { t: c } = e(t), l = o ?? c("a11y.resize_panel"), { onResizeStart: u, orientation: p } = m();
|
|
93
|
+
return /* @__PURE__ */ f("div", {
|
|
93
94
|
role: "separator",
|
|
94
|
-
"aria-orientation":
|
|
95
|
-
"aria-label":
|
|
95
|
+
"aria-orientation": p,
|
|
96
|
+
"aria-label": l,
|
|
96
97
|
tabIndex: 0,
|
|
97
|
-
className:
|
|
98
|
+
className: d(n.handle, i && n.active, a),
|
|
98
99
|
"data-testid": "splitter-handle",
|
|
99
|
-
onMouseDown: (e) =>
|
|
100
|
-
onTouchStart: (e) =>
|
|
100
|
+
onMouseDown: (e) => r !== void 0 && u(r, e),
|
|
101
|
+
onTouchStart: (e) => r !== void 0 && u(r, e),
|
|
101
102
|
onKeyDown: (e) => {
|
|
102
103
|
(e.key === "ArrowLeft" || e.key === "ArrowUp" || e.key === "ArrowRight" || e.key === "ArrowDown") && e.preventDefault();
|
|
103
104
|
},
|
|
104
|
-
...
|
|
105
|
+
...s
|
|
105
106
|
});
|
|
106
107
|
};
|
|
107
|
-
|
|
108
|
-
var
|
|
109
|
-
|
|
108
|
+
_.displayName = "Splitter.Handle", h.displayName = "Splitter";
|
|
109
|
+
var v = h;
|
|
110
|
+
v.Panel = g, v.Handle = _;
|
|
110
111
|
//#endregion
|
|
111
|
-
export {
|
|
112
|
+
export { v as Splitter, v as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("./toolbar.module.cjs");let
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../hooks/useMergedRef.cjs"),r=require("./toolbar.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]`,c=`data-wim-toolbar-roving`,l=/^(button|checkbox|radio|submit|reset|image|file|color)$/,u=e=>e.tagName===`TEXTAREA`||e.tagName===`SELECT`||e.isContentEditable||e.tagName===`INPUT`&&!l.test(e.type),d=e=>Array.from(e.querySelectorAll(s)).filter(e=>!u(e)&&!e.closest(`[aria-hidden="true"]`)&&(e.getAttribute(`tabindex`)!==`-1`||e.hasAttribute(c))),f=i.default.forwardRef(({asChild:e=!1,size:s=`md`,orientation:l=`horizontal`,className:u,children:f,onKeyDownCapture:p,onFocus:m,...h},g)=>{let _=(0,i.useRef)(null),v=n.useMergedRef(g,_),y=(0,i.useRef)(null),b=(0,i.useRef)(null),x=(0,i.useCallback)(()=>{let e=_.current;if(!e)return;let t=d(e),n=document.activeElement,r=n&&t.includes(n)?n:y.current&&t.includes(y.current)?y.current:t[0];y.current=r??null;for(let e of t)e===r?e.hasAttribute(c)&&(e.removeAttribute(c),e.setAttribute(`tabindex`,`0`)):e.getAttribute(`tabindex`)!==`-1`&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(c,``));b.current?.takeRecords()},[]);return(0,i.useLayoutEffect)(x),(0,i.useEffect)(()=>{let e=_.current;if(!e)return;let t=new MutationObserver(()=>x());return t.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`disabled`,`tabindex`,`aria-hidden`]}),b.current=t,()=>{t.disconnect(),b.current=null}},[x]),(0,o.jsx)(e?t.Root:`div`,{ref:v,role:`toolbar`,"aria-orientation":l,"data-size":s,"data-orientation":l,className:(0,a.default)(`wim-toolbar`,r.default.root,r.default[`size-${s}`],r.default[l],u),onKeyDownCapture:e=>{if(p?.(e),e.defaultPrevented)return;let t=_.current;if(!t)return;let n=d(t);if(n.length===0)return;let r=n.indexOf(document.activeElement);if(r<0)return;let i=l===`horizontal`,a=i?`ArrowRight`:`ArrowDown`,o=i?`ArrowLeft`:`ArrowUp`,s=r;if(e.key===a)e.preventDefault(),s=(r+1)%n.length;else if(e.key===o)e.preventDefault(),s=(r-1+n.length)%n.length;else if(e.key===`Home`)e.preventDefault(),s=0;else if(e.key===`End`)e.preventDefault(),s=n.length-1;else return;e.stopPropagation(),n[s]?.focus()},onFocus:e=>{m?.(e);let t=_.current,n=e.target;t&&n!==y.current&&d(t).includes(n)&&(y.current=n,x())},...h,children:f})});f.displayName=`Toolbar`;var p=i.default.forwardRef(({asChild:e=!1,className:n,children:i,...s},c)=>(0,o.jsx)(e?t.Root:`div`,{ref:c,role:`group`,className:(0,a.default)(r.default.group,n),...s,children:i}));p.displayName=`Toolbar.Group`;var m=i.default.forwardRef(({className:e,...t},n)=>(0,o.jsx)(`div`,{ref:n,role:`separator`,"aria-hidden":`true`,className:(0,a.default)(r.default.separator,e),...t}));m.displayName=`Toolbar.Separator`;var h=f;h.Group=p,h.Separator=m,exports.Toolbar=h,exports.default=h,exports.ToolbarGroup=p,exports.ToolbarSeparator=m;
|
|
@@ -1,59 +1,86 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Root as e } from "../../../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
3
|
-
import t from "
|
|
4
|
-
import n
|
|
5
|
-
import a from "
|
|
6
|
-
import
|
|
3
|
+
import { useMergedRef as t } from "../../../hooks/useMergedRef.js";
|
|
4
|
+
import n from "./toolbar.module.js";
|
|
5
|
+
import r, { useCallback as i, useEffect as a, useLayoutEffect as o, useRef as s } from "react";
|
|
6
|
+
import c from "classnames";
|
|
7
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
7
8
|
//#region src/components/layout/Toolbar/Toolbar.tsx
|
|
8
|
-
var
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
var u = "button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]", d = "data-wim-toolbar-roving", f = /^(button|checkbox|radio|submit|reset|image|file|color)$/, p = (e) => e.tagName === "TEXTAREA" || e.tagName === "SELECT" || e.isContentEditable || e.tagName === "INPUT" && !f.test(e.type), m = (e) => Array.from(e.querySelectorAll(u)).filter((e) => !p(e) && !e.closest("[aria-hidden=\"true\"]") && (e.getAttribute("tabindex") !== "-1" || e.hasAttribute(d))), h = r.forwardRef(({ asChild: r = !1, size: u = "md", orientation: f = "horizontal", className: p, children: h, onKeyDownCapture: g, onFocus: _, ...v }, y) => {
|
|
10
|
+
let b = s(null), x = t(y, b), S = s(null), C = s(null), w = i(() => {
|
|
11
|
+
let e = b.current;
|
|
12
|
+
if (!e) return;
|
|
13
|
+
let t = m(e), n = document.activeElement, r = n && t.includes(n) ? n : S.current && t.includes(S.current) ? S.current : t[0];
|
|
14
|
+
S.current = r ?? null;
|
|
15
|
+
for (let e of t) e === r ? e.hasAttribute(d) && (e.removeAttribute(d), e.setAttribute("tabindex", "0")) : e.getAttribute("tabindex") !== "-1" && (e.setAttribute("tabindex", "-1"), e.setAttribute(d, ""));
|
|
16
|
+
C.current?.takeRecords();
|
|
17
|
+
}, []);
|
|
18
|
+
return o(w), a(() => {
|
|
19
|
+
let e = b.current;
|
|
20
|
+
if (!e) return;
|
|
21
|
+
let t = new MutationObserver(() => w());
|
|
22
|
+
return t.observe(e, {
|
|
23
|
+
subtree: !0,
|
|
24
|
+
childList: !0,
|
|
25
|
+
attributes: !0,
|
|
26
|
+
attributeFilter: [
|
|
27
|
+
"disabled",
|
|
28
|
+
"tabindex",
|
|
29
|
+
"aria-hidden"
|
|
30
|
+
]
|
|
31
|
+
}), C.current = t, () => {
|
|
32
|
+
t.disconnect(), C.current = null;
|
|
33
|
+
};
|
|
34
|
+
}, [w]), /* @__PURE__ */ l(r ? e : "div", {
|
|
35
|
+
ref: x,
|
|
14
36
|
role: "toolbar",
|
|
15
|
-
"aria-orientation":
|
|
16
|
-
"data-size":
|
|
17
|
-
"data-orientation":
|
|
18
|
-
className:
|
|
19
|
-
|
|
20
|
-
if (
|
|
21
|
-
let t =
|
|
37
|
+
"aria-orientation": f,
|
|
38
|
+
"data-size": u,
|
|
39
|
+
"data-orientation": f,
|
|
40
|
+
className: c("wim-toolbar", n.root, n[`size-${u}`], n[f], p),
|
|
41
|
+
onKeyDownCapture: (e) => {
|
|
42
|
+
if (g?.(e), e.defaultPrevented) return;
|
|
43
|
+
let t = b.current;
|
|
22
44
|
if (!t) return;
|
|
23
|
-
let n =
|
|
45
|
+
let n = m(t);
|
|
24
46
|
if (n.length === 0) return;
|
|
25
47
|
let r = n.indexOf(document.activeElement);
|
|
26
48
|
if (r < 0) return;
|
|
27
|
-
let i =
|
|
28
|
-
if (e.key === a) e.preventDefault(),
|
|
29
|
-
else if (e.key === o) e.preventDefault(),
|
|
30
|
-
else if (e.key === "Home") e.preventDefault(),
|
|
31
|
-
else if (e.key === "End") e.preventDefault(),
|
|
49
|
+
let i = f === "horizontal", a = i ? "ArrowRight" : "ArrowDown", o = i ? "ArrowLeft" : "ArrowUp", s = r;
|
|
50
|
+
if (e.key === a) e.preventDefault(), s = (r + 1) % n.length;
|
|
51
|
+
else if (e.key === o) e.preventDefault(), s = (r - 1 + n.length) % n.length;
|
|
52
|
+
else if (e.key === "Home") e.preventDefault(), s = 0;
|
|
53
|
+
else if (e.key === "End") e.preventDefault(), s = n.length - 1;
|
|
32
54
|
else return;
|
|
33
|
-
n[
|
|
55
|
+
e.stopPropagation(), n[s]?.focus();
|
|
34
56
|
},
|
|
35
|
-
|
|
36
|
-
|
|
57
|
+
onFocus: (e) => {
|
|
58
|
+
_?.(e);
|
|
59
|
+
let t = b.current, n = e.target;
|
|
60
|
+
t && n !== S.current && m(t).includes(n) && (S.current = n, w());
|
|
61
|
+
},
|
|
62
|
+
...v,
|
|
63
|
+
children: h
|
|
37
64
|
});
|
|
38
65
|
});
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
ref:
|
|
66
|
+
h.displayName = "Toolbar";
|
|
67
|
+
var g = r.forwardRef(({ asChild: t = !1, className: r, children: i, ...a }, o) => /* @__PURE__ */ l(t ? e : "div", {
|
|
68
|
+
ref: o,
|
|
42
69
|
role: "group",
|
|
43
|
-
className:
|
|
44
|
-
...
|
|
70
|
+
className: c(n.group, r),
|
|
71
|
+
...a,
|
|
45
72
|
children: i
|
|
46
73
|
}));
|
|
47
|
-
|
|
48
|
-
var
|
|
74
|
+
g.displayName = "Toolbar.Group";
|
|
75
|
+
var _ = r.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ l("div", {
|
|
49
76
|
ref: r,
|
|
50
77
|
role: "separator",
|
|
51
78
|
"aria-hidden": "true",
|
|
52
|
-
className:
|
|
53
|
-
...
|
|
79
|
+
className: c(n.separator, e),
|
|
80
|
+
...t
|
|
54
81
|
}));
|
|
55
|
-
|
|
56
|
-
var
|
|
57
|
-
|
|
82
|
+
_.displayName = "Toolbar.Separator";
|
|
83
|
+
var v = h;
|
|
84
|
+
v.Group = g, v.Separator = _;
|
|
58
85
|
//#endregion
|
|
59
|
-
export {
|
|
86
|
+
export { v as Toolbar, v as default, g as ToolbarGroup, _ as ToolbarSeparator };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../hooks/useMediaLoader.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/common.cjs"),r=require("../../../hooks/useMediaLoader.cjs"),i=require("./hooks/useAudioPlayer.cjs"),ee=require("./hooks/useAudioMetadata.cjs"),te=require("./components/AudioCustomControls.cjs"),a=require("./audio.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=({src:e,autoPlay:l=!1,loop:ne=!1,muted:u=!1,controls:d=!0,radius:f=`none`,shadow:p=!1,border:m=!1,preload:h,caption:g,className:_,style:v,customControls:y=!1,visualizer:b=!1,showMetadata:x=!1,fadeIn:S=!1,fadeOut:C=!1,crossfade:w=!1,playbackRate:T=!1,hotkeys:E=!1,presets:D=!1,sleepTimer:O=!1,loading:k=`lazy`,demoDelay:A,labels:j={},tracks:M,...N})=>{let{t:P}=t.useWimTranslation(n.commonNs),{unknownTitle:F=P(`audio.unknown_title`),unknownArtist:I=P(`audio.unknown_artist`)}=j,L=(0,o.useMemo)(()=>e?(Array.isArray(e)?e:[e]).map(e=>typeof e==`string`?{src:e}:e):[],[e]),{containerRef:R,isLoaded:re,isIntersecting:z,notifyLoaded:B,shouldShowSkeleton:V}=r.useMediaLoader({loading:k,demoDelay:A,src:L[0]?.src}),H=i.useAudioPlayer({playlist:L,loop:ne,muted:u,fadeIn:S,fadeOut:C,crossfade:w,visualizer:b,hotkeys:E,autoPlay:l}),{isPlaying:U,currentTrack:W,currentTrackIndex:G,activeAudioRef:K,nextAudioRef:q,canvasRef:J,handleTimeUpdate:Y,handleEnded:X,setDuration:ie,playActivePlayer:ae}=H,{metaTitle:Z,metaArtist:Q,metaCover:$}=ee.useAudioMetadata({currentTrack:W,showMetadata:x});(0,o.useEffect)(()=>{W&&K.current&&(K.current.src=W.src,(l||U)&&ae())},[G,W]);let oe=f===`none`?null:a.default[`radius${f.charAt(0).toUpperCase()+f.slice(1)}`];return(0,c.jsxs)(`figure`,{className:(0,s.default)(`wim-audio`,a.default.root,_),style:v,"data-testid":`audio-root`,children:[(0,c.jsxs)(`div`,{ref:R,className:(0,s.default)(a.default.inner,oe,y&&p&&a.default.shadow,y&&m&&a.default.border,y&&a.default.custom,S&&a.default.fadeIn,S&&re&&a.default.isLoaded,V&&a.default.loading),"data-testid":`audio-inner`,children:[b&&y&&(0,c.jsx)(`canvas`,{ref:J,className:a.default.visualizerCanvas,"data-testid":`audio-canvas`}),y&&x&&(Z||Q||$)&&(0,c.jsxs)(`div`,{className:a.default.metadata,style:{position:`relative`,zIndex:2},"data-testid":`audio-metadata`,children:[$&&(0,c.jsx)(`img`,{src:$,alt:P(`a11y.cover_art`),className:a.default.cover,"data-testid":`audio-cover`}),(0,c.jsxs)(`div`,{className:a.default.info,children:[(0,c.jsx)(`div`,{className:a.default.title,"data-testid":`audio-title`,children:Z||F}),(0,c.jsx)(`div`,{className:a.default.artist,"data-testid":`audio-artist`,children:Q||I})]})]}),(0,c.jsxs)(`div`,{style:{display:y?`none`:`block`,width:`100%`},children:[z&&(0,c.jsx)(`audio`,{ref:K,src:W?.src,className:a.default.audio,"data-testid":`audio-active`,loop:H.repeatMode===1&&L.length===1,muted:H.isMuted,controls:!y&&d,preload:h,crossOrigin:`anonymous`,onTimeUpdate:Y,onEnded:X,...N,onLoadedMetadata:e=>{ie(e.currentTarget.duration),B(),N.onLoadedMetadata?.(e)},onLoadedData:e=>{B(),N.onLoadedData?.(e)},onCanPlay:e=>{B(),N.onCanPlay?.(e)},children:M?.map((e,t)=>(0,c.jsx)(`track`,{...e},t))}),(0,c.jsx)(`audio`,{ref:q,muted:H.isMuted,preload:`auto`,crossOrigin:`anonymous`,"data-testid":`audio-next`})]}),y&&(0,c.jsx)(te.AudioCustomControls,{styles:a.default,isPlaying:U,currentTime:H.currentTime,duration:H.duration,volume:H.volume,isMuted:H.isMuted,repeatMode:H.repeatMode,shuffleMode:H.shuffleMode,currentPlaybackRate:H.currentPlaybackRate,isBassBoost:H.isBassBoost,remainingSleepTime:H.remainingSleepTime,playbackRate:T,presets:D,sleepTimer:O,setRepeatMode:H.setRepeatMode,setShuffleMode:H.setShuffleMode,setCurrentPlaybackRate:H.setCurrentPlaybackRate,setIsBassBoost:H.setIsBassBoost,setIsMuted:H.setIsMuted,togglePlay:H.togglePlay,handleSeek:H.handleSeek,handleVolumeChange:H.handleVolumeChange,playNext:H.playNext,toggleSleepTimer:H.toggleSleepTimer,formatTime:H.formatTime,labels:j})]}),g&&(0,c.jsx)(`figcaption`,{className:a.default.caption,children:g})]})};exports.Audio=l;
|