@layers-app/shared 0.4.2 → 0.4.4
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/AnimatedFigurePage/AnimatedFigurePage.module.css.js +13 -13
- package/dist/components/AppContainer/AppContainer.module.css.js +1 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +15 -16
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +1 -1
- package/dist/components/AppShell/AppShell.module.css.js +5 -5
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
- package/dist/components/AttachmentsGalleryModal/styles.module.css.js +7 -7
- package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +1 -1
- package/dist/components/BouncingLogo/BouncingLogo.module.css.js +8 -8
- package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
- package/dist/components/ColorPicker/ColorPicker.module.css.js +24 -24
- package/dist/components/CommentComposer/CommentComposer.module.css.js +1 -1
- package/dist/components/CommentComposer/index.d.ts.map +1 -1
- package/dist/components/CommentComposer/index.js +53 -54
- package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
- package/dist/components/Copyright/Copyright.module.css.js +1 -1
- package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.js +6 -6
- package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
- package/dist/components/EmojiPicker/IconsPanel.js +11 -11
- package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
- package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
- package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
- package/dist/components/FilePicker/FilePicker.module.css.js +10 -10
- package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
- package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
- package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
- package/dist/components/FormViewer/helpers/steps.d.ts.map +1 -1
- package/dist/components/FormViewer/helpers/steps.js +11 -11
- package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
- package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +11 -11
- package/dist/components/LanguagePicker/LanguagePicker.module.css.js +1 -1
- package/dist/components/Loaders/styles.module.css.js +6 -6
- package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
- package/dist/components/MusicPlayerBar/MusicPlayerBar.d.ts +3 -0
- package/dist/components/MusicPlayerBar/MusicPlayerBar.d.ts.map +1 -0
- package/dist/components/MusicPlayerBar/MusicPlayerBar.js +239 -0
- package/dist/components/MusicPlayerBar/MusicPlayerBar.module.css.js +49 -0
- package/dist/components/MusicPlayerBar/components/HiddenAudio.d.ts +10 -0
- package/dist/components/MusicPlayerBar/components/HiddenAudio.d.ts.map +1 -0
- package/dist/components/MusicPlayerBar/components/HiddenAudio.js +35 -0
- package/dist/components/MusicPlayerBar/components/HoverActions.d.ts +20 -0
- package/dist/components/MusicPlayerBar/components/HoverActions.d.ts.map +1 -0
- package/dist/components/MusicPlayerBar/components/HoverActions.js +88 -0
- package/dist/components/MusicPlayerBar/components/MobileActionsDrawer.d.ts +18 -0
- package/dist/components/MusicPlayerBar/components/MobileActionsDrawer.d.ts.map +1 -0
- package/dist/components/MusicPlayerBar/components/MobileActionsDrawer.js +91 -0
- package/dist/components/MusicPlayerBar/components/MobileSpeedDrawer.d.ts +11 -0
- package/dist/components/MusicPlayerBar/components/MobileSpeedDrawer.d.ts.map +1 -0
- package/dist/components/MusicPlayerBar/components/MobileSpeedDrawer.js +38 -0
- package/dist/components/MusicPlayerBar/components/MobileTailControls.d.ts +11 -0
- package/dist/components/MusicPlayerBar/components/MobileTailControls.d.ts.map +1 -0
- package/dist/components/MusicPlayerBar/components/MobileTailControls.js +50 -0
- package/dist/components/MusicPlayerBar/components/PlayButton.d.ts +9 -0
- package/dist/components/MusicPlayerBar/components/PlayButton.d.ts.map +1 -0
- package/dist/components/MusicPlayerBar/components/PlayButton.js +28 -0
- package/dist/components/MusicPlayerBar/components/SpeedPopover.d.ts +11 -0
- package/dist/components/MusicPlayerBar/components/SpeedPopover.d.ts.map +1 -0
- package/dist/components/MusicPlayerBar/components/SpeedPopover.js +90 -0
- package/dist/components/MusicPlayerBar/components/Timer.d.ts +8 -0
- package/dist/components/MusicPlayerBar/components/Timer.d.ts.map +1 -0
- package/dist/components/MusicPlayerBar/components/Timer.js +25 -0
- package/dist/components/MusicPlayerBar/components/VolumePopover.d.ts +15 -0
- package/dist/components/MusicPlayerBar/components/VolumePopover.d.ts.map +1 -0
- package/dist/components/MusicPlayerBar/components/VolumePopover.js +88 -0
- package/dist/components/MusicPlayerBar/components/Waveform.d.ts +12 -0
- package/dist/components/MusicPlayerBar/components/Waveform.d.ts.map +1 -0
- package/dist/components/MusicPlayerBar/components/Waveform.js +47 -0
- package/dist/components/MusicPlayerBar/constants.d.ts +19 -0
- package/dist/components/MusicPlayerBar/constants.d.ts.map +1 -0
- package/dist/components/MusicPlayerBar/constants.js +21 -0
- package/dist/components/MusicPlayerBar/helpers.d.ts +11 -0
- package/dist/components/MusicPlayerBar/helpers.d.ts.map +1 -0
- package/dist/components/MusicPlayerBar/helpers.js +44 -0
- package/dist/components/MusicPlayerBar/hooks/useAudioPlayback.d.ts +23 -0
- package/dist/components/MusicPlayerBar/hooks/useAudioPlayback.d.ts.map +1 -0
- package/dist/components/MusicPlayerBar/hooks/useAudioPlayback.js +49 -0
- package/dist/components/MusicPlayerBar/hooks/useCopyFeedback.d.ts +6 -0
- package/dist/components/MusicPlayerBar/hooks/useCopyFeedback.d.ts.map +1 -0
- package/dist/components/MusicPlayerBar/hooks/useCopyFeedback.js +17 -0
- package/dist/components/MusicPlayerBar/hooks/useHoverPopover.d.ts +9 -0
- package/dist/components/MusicPlayerBar/hooks/useHoverPopover.d.ts.map +1 -0
- package/dist/components/MusicPlayerBar/hooks/useHoverPopover.js +18 -0
- package/dist/components/MusicPlayerBar/hooks/useMusicPlayerLabels.d.ts +3 -0
- package/dist/components/MusicPlayerBar/hooks/useMusicPlayerLabels.d.ts.map +1 -0
- package/dist/components/MusicPlayerBar/hooks/useMusicPlayerLabels.js +26 -0
- package/dist/components/MusicPlayerBar/hooks/useWaveform.d.ts +7 -0
- package/dist/components/MusicPlayerBar/hooks/useWaveform.d.ts.map +1 -0
- package/dist/components/MusicPlayerBar/hooks/useWaveform.js +28 -0
- package/dist/components/MusicPlayerBar/index.d.ts +3 -0
- package/dist/components/MusicPlayerBar/index.d.ts.map +1 -0
- package/dist/components/MusicPlayerBar/types.d.ts +33 -0
- package/dist/components/MusicPlayerBar/types.d.ts.map +1 -0
- package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
- package/dist/components/NavbarResizer/NavbarResizer.js +1 -1
- package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
- package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
- package/dist/components/Notification/Notification.module.css.js +1 -1
- package/dist/components/OnboardingTour/OnboardingTourFooter.js +1 -1
- package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
- package/dist/components/SettingsSection/styles.module.css.js +1 -1
- package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
- package/dist/components/TreeIndent/TreeIndent.module.css.js +4 -4
- package/dist/components/table/FrontTable.d.ts.map +1 -1
- package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
- package/dist/components/table/hooks/useColumnsResizing.js +1 -1
- package/dist/helpers/isNoAccessError.d.ts +2 -0
- package/dist/helpers/isNoAccessError.d.ts.map +1 -0
- package/dist/helpers/isNoAccessError.js +7 -0
- package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
- package/dist/helpers/showNotifications.module.css.js +1 -1
- package/dist/hooks/useOfficePreviewAvailable.d.ts +2 -0
- package/dist/hooks/useOfficePreviewAvailable.d.ts.map +1 -0
- package/dist/hooks/useOfficePreviewAvailable.js +20 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +307 -305
- package/dist/lang/locales/ui_en.json.js +6 -4
- package/dist/lang/locales/ui_es.json.js +8 -6
- package/dist/lang/locales/ui_ru.json.js +9 -7
- package/docs/README.md +499 -499
- package/package.json +75 -75
- package/dist/assets/images/person.png.js +0 -4
- package/dist/assets/images/person2.png.js +0 -4
- package/dist/assets/images/person3.png.js +0 -4
- package/dist/assets/images/person4.png.js +0 -4
- package/dist/components/OnBoarding/OnBoardingPage.d.ts +0 -2
- package/dist/components/OnBoarding/OnBoardingPage.d.ts.map +0 -1
- package/dist/components/OnBoarding/OnBoardingPage.js +0 -80
- package/dist/components/OnBoarding/ProjectBoard.d.ts +0 -5
- package/dist/components/OnBoarding/ProjectBoard.d.ts.map +0 -1
- package/dist/components/OnBoarding/ProjectBoard.js +0 -141
- package/dist/components/OnBoarding/StepsNavBar.d.ts +0 -5
- package/dist/components/OnBoarding/StepsNavBar.d.ts.map +0 -1
- package/dist/components/OnBoarding/StepsNavBar.js +0 -21
- package/dist/components/OnBoarding/index.d.ts +0 -2
- package/dist/components/OnBoarding/index.d.ts.map +0 -1
- package/dist/components/OnBoarding/steps/AddTasks/AddTasksNav.d.ts +0 -3
- package/dist/components/OnBoarding/steps/AddTasks/AddTasksNav.d.ts.map +0 -1
- package/dist/components/OnBoarding/steps/AddTasks/AddTasksNav.js +0 -42
- package/dist/components/OnBoarding/steps/AddTasks/TasksListBoard.d.ts +0 -3
- package/dist/components/OnBoarding/steps/AddTasks/TasksListBoard.d.ts.map +0 -1
- package/dist/components/OnBoarding/steps/AddTasks/TasksListBoard.js +0 -51
- package/dist/components/OnBoarding/steps/CreateFirstProject.d.ts +0 -3
- package/dist/components/OnBoarding/steps/CreateFirstProject.d.ts.map +0 -1
- package/dist/components/OnBoarding/steps/CreateFirstProject.js +0 -45
- package/dist/components/OnBoarding/steps/DefineStatuses/DefineStatusesNav.d.ts +0 -3
- package/dist/components/OnBoarding/steps/DefineStatuses/DefineStatusesNav.d.ts.map +0 -1
- package/dist/components/OnBoarding/steps/DefineStatuses/DefineStatusesNav.js +0 -42
- package/dist/components/OnBoarding/steps/DefineStatuses/StatusBadge.d.ts +0 -9
- package/dist/components/OnBoarding/steps/DefineStatuses/StatusBadge.d.ts.map +0 -1
- package/dist/components/OnBoarding/steps/DefineStatuses/StatusBadge.js +0 -22
- package/dist/components/OnBoarding/steps/DefineStatuses/StatusesListBoard.d.ts +0 -3
- package/dist/components/OnBoarding/steps/DefineStatuses/StatusesListBoard.d.ts.map +0 -1
- package/dist/components/OnBoarding/steps/DefineStatuses/StatusesListBoard.js +0 -217
- package/dist/components/OnBoarding/steps/DifferentLayouts/DifferentLayoutsBoard.d.ts +0 -3
- package/dist/components/OnBoarding/steps/DifferentLayouts/DifferentLayoutsBoard.d.ts.map +0 -1
- package/dist/components/OnBoarding/steps/DifferentLayouts/DifferentLayoutsBoard.js +0 -16
- package/dist/components/OnBoarding/steps/DifferentLayouts/DifferentLayoutsNav.d.ts +0 -3
- package/dist/components/OnBoarding/steps/DifferentLayouts/DifferentLayoutsNav.d.ts.map +0 -1
- package/dist/components/OnBoarding/steps/DifferentLayouts/DifferentLayoutsNav.js +0 -56
- package/dist/components/OnBoarding/steps/DifferentLayouts/KanbanLayout.d.ts +0 -3
- package/dist/components/OnBoarding/steps/DifferentLayouts/KanbanLayout.d.ts.map +0 -1
- package/dist/components/OnBoarding/steps/DifferentLayouts/KanbanLayout.js +0 -272
- package/dist/components/OnBoarding/steps/DifferentLayouts/styles.module.css.js +0 -9
- package/dist/components/OnBoarding/steps/InviteUsers/BoardModal.d.ts +0 -3
- package/dist/components/OnBoarding/steps/InviteUsers/BoardModal.d.ts.map +0 -1
- package/dist/components/OnBoarding/steps/InviteUsers/BoardModal.js +0 -86
- package/dist/components/OnBoarding/steps/InviteUsers/InviteUsers.d.ts +0 -3
- package/dist/components/OnBoarding/steps/InviteUsers/InviteUsers.d.ts.map +0 -1
- package/dist/components/OnBoarding/steps/InviteUsers/InviteUsers.js +0 -26
- package/dist/components/OnBoarding/steps/SelectCategory/CategorySelect.d.ts +0 -9
- package/dist/components/OnBoarding/steps/SelectCategory/CategorySelect.d.ts.map +0 -1
- package/dist/components/OnBoarding/steps/SelectCategory/CategorySelect.js +0 -61
- package/dist/components/OnBoarding/steps/SelectCategory/SelectCategoryNav.d.ts +0 -3
- package/dist/components/OnBoarding/steps/SelectCategory/SelectCategoryNav.d.ts.map +0 -1
- package/dist/components/OnBoarding/steps/SelectCategory/SelectCategoryNav.js +0 -42
- package/dist/components/OnBoarding/steps/StartedStep.d.ts +0 -3
- package/dist/components/OnBoarding/steps/StartedStep.d.ts.map +0 -1
- package/dist/components/OnBoarding/steps/StartedStep.js +0 -71
- package/dist/components/OnBoarding/steps/Wrapper.d.ts +0 -15
- package/dist/components/OnBoarding/steps/Wrapper.d.ts.map +0 -1
- package/dist/components/OnBoarding/steps/Wrapper.js +0 -49
- package/dist/components/OnBoarding/steps/styles.module.css.js +0 -17
- package/dist/components/OnBoarding/styles.module.css.js +0 -15
- package/dist/store/onboarding.d.ts +0 -30
- package/dist/store/onboarding.d.ts.map +0 -1
- package/dist/store/onboarding.js +0 -53
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MobileTailControls.d.ts","sourceRoot":"","sources":["../../../../src/components/MusicPlayerBar/components/MobileTailControls.tsx"],"names":[],"mappings":"AAMA,KAAK,KAAK,GAAG;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,mBAAmB,EAAE,MAAM,IAAI,CAAC;CACjC,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,EACjC,WAAW,EACX,QAAQ,EACR,UAAU,EACV,SAAS,EACT,iBAAiB,EACjB,mBAAmB,GACpB,EAAE,KAAK,2CA4BP"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { MoreHorizontalIcon as s } from "@hugeicons/core-free-icons";
|
|
3
|
+
import { HugeiconsIcon as m } from "@hugeicons/react";
|
|
4
|
+
import { UnstyledButton as p, ActionIcon as d } from "@mantine/core";
|
|
5
|
+
import i from "../MusicPlayerBar.module.css.js";
|
|
6
|
+
function y({
|
|
7
|
+
currentRate: t,
|
|
8
|
+
showMore: e,
|
|
9
|
+
speedLabel: l,
|
|
10
|
+
moreLabel: n,
|
|
11
|
+
onOpenSpeedDrawer: a,
|
|
12
|
+
onOpenActionsDrawer: c
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ o("div", { className: i.tail, children: [
|
|
15
|
+
/* @__PURE__ */ o(
|
|
16
|
+
p,
|
|
17
|
+
{
|
|
18
|
+
type: "button",
|
|
19
|
+
className: i.speedTrigger,
|
|
20
|
+
"aria-label": l,
|
|
21
|
+
onClick: a,
|
|
22
|
+
children: [
|
|
23
|
+
t,
|
|
24
|
+
"x"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
),
|
|
28
|
+
e && /* @__PURE__ */ r(
|
|
29
|
+
d,
|
|
30
|
+
{
|
|
31
|
+
variant: "subtle",
|
|
32
|
+
color: "gray",
|
|
33
|
+
size: 28,
|
|
34
|
+
"aria-label": n,
|
|
35
|
+
onClick: c,
|
|
36
|
+
children: /* @__PURE__ */ r(
|
|
37
|
+
m,
|
|
38
|
+
{
|
|
39
|
+
icon: s,
|
|
40
|
+
size: 20,
|
|
41
|
+
color: "var(--mantine-color-gray-text)"
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
] });
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
y as MobileTailControls
|
|
50
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
playing: boolean;
|
|
3
|
+
onToggle: () => void;
|
|
4
|
+
playLabel: string;
|
|
5
|
+
pauseLabel: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function PlayButton({ playing, onToggle, playLabel, pauseLabel }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=PlayButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlayButton.d.ts","sourceRoot":"","sources":["../../../../src/components/MusicPlayerBar/components/PlayButton.tsx"],"names":[],"mappings":"AAMA,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,KAAK,2CAgB7E"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { PauseIcon as c, PlayIcon as e } from "@hugeicons/core-free-icons";
|
|
3
|
+
import { HugeiconsIcon as m } from "@hugeicons/react";
|
|
4
|
+
import { ActionIcon as a } from "@mantine/core";
|
|
5
|
+
import l from "../MusicPlayerBar.module.css.js";
|
|
6
|
+
function y({ playing: o, onToggle: i, playLabel: n, pauseLabel: t }) {
|
|
7
|
+
return /* @__PURE__ */ r(
|
|
8
|
+
a,
|
|
9
|
+
{
|
|
10
|
+
size: 28,
|
|
11
|
+
radius: 8,
|
|
12
|
+
onClick: i,
|
|
13
|
+
className: l.playBtn,
|
|
14
|
+
"aria-label": o ? t : n,
|
|
15
|
+
children: /* @__PURE__ */ r(
|
|
16
|
+
m,
|
|
17
|
+
{
|
|
18
|
+
icon: o ? c : e,
|
|
19
|
+
size: 16,
|
|
20
|
+
color: "var(--mantine-color-white)"
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
y as PlayButton
|
|
28
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HoverPopover } from '../hooks/useHoverPopover';
|
|
2
|
+
type Props = {
|
|
3
|
+
popover: HoverPopover;
|
|
4
|
+
rates: readonly number[];
|
|
5
|
+
currentIndex: number;
|
|
6
|
+
label: string;
|
|
7
|
+
onSelect: (index: number) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function SpeedPopover({ popover, rates, currentIndex, label, onSelect, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=SpeedPopover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpeedPopover.d.ts","sourceRoot":"","sources":["../../../../src/components/MusicPlayerBar/components/SpeedPopover.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAI7D,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,KAAK,EACL,YAAY,EACZ,KAAK,EACL,QAAQ,GACT,EAAE,KAAK,2CAuEP"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsxs as r, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Popover as t, UnstyledButton as p, Stack as u, Text as m, Box as x } from "@mantine/core";
|
|
3
|
+
import o from "../MusicPlayerBar.module.css.js";
|
|
4
|
+
function C({
|
|
5
|
+
popover: e,
|
|
6
|
+
rates: l,
|
|
7
|
+
currentIndex: i,
|
|
8
|
+
label: a,
|
|
9
|
+
onSelect: f
|
|
10
|
+
}) {
|
|
11
|
+
const h = l[i] ?? 1;
|
|
12
|
+
return /* @__PURE__ */ r(
|
|
13
|
+
t,
|
|
14
|
+
{
|
|
15
|
+
opened: e.opened,
|
|
16
|
+
position: "top-end",
|
|
17
|
+
offset: 6,
|
|
18
|
+
withinPortal: !0,
|
|
19
|
+
trapFocus: !1,
|
|
20
|
+
returnFocus: !1,
|
|
21
|
+
classNames: { dropdown: o.speedDropdown },
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ n(t.Target, { children: /* @__PURE__ */ r(
|
|
24
|
+
p,
|
|
25
|
+
{
|
|
26
|
+
onMouseEnter: e.open,
|
|
27
|
+
onMouseLeave: e.close,
|
|
28
|
+
className: o.speedTrigger,
|
|
29
|
+
"aria-label": a,
|
|
30
|
+
"aria-haspopup": "listbox",
|
|
31
|
+
"aria-expanded": e.opened,
|
|
32
|
+
children: [
|
|
33
|
+
h,
|
|
34
|
+
"x"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
) }),
|
|
38
|
+
/* @__PURE__ */ n(t.Dropdown, { children: /* @__PURE__ */ r(
|
|
39
|
+
u,
|
|
40
|
+
{
|
|
41
|
+
gap: 6,
|
|
42
|
+
onMouseEnter: e.cancelClose,
|
|
43
|
+
onMouseLeave: e.close,
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ n(m, { className: o.speedLabel, children: a }),
|
|
46
|
+
/* @__PURE__ */ n(
|
|
47
|
+
x,
|
|
48
|
+
{
|
|
49
|
+
role: "listbox",
|
|
50
|
+
"aria-label": a,
|
|
51
|
+
style: { display: "flex", alignItems: "center", gap: 2 },
|
|
52
|
+
children: l.map((c, d) => {
|
|
53
|
+
const s = d === i;
|
|
54
|
+
return /* @__PURE__ */ n(
|
|
55
|
+
p,
|
|
56
|
+
{
|
|
57
|
+
role: "option",
|
|
58
|
+
"aria-selected": s,
|
|
59
|
+
onClick: () => {
|
|
60
|
+
f(d), e.setOpened(!1);
|
|
61
|
+
},
|
|
62
|
+
className: `${o.speedChip} ${s ? o.speedChipActive : ""}`,
|
|
63
|
+
children: /* @__PURE__ */ r(
|
|
64
|
+
m,
|
|
65
|
+
{
|
|
66
|
+
fz: 14,
|
|
67
|
+
fw: s ? 600 : 400,
|
|
68
|
+
c: s ? "var(--mantine-primary-color-filled)" : "var(--mantine-color-text)",
|
|
69
|
+
children: [
|
|
70
|
+
c,
|
|
71
|
+
"x"
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
},
|
|
76
|
+
c
|
|
77
|
+
);
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
) })
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
C as SpeedPopover
|
|
90
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Timer.d.ts","sourceRoot":"","sources":["../../../../src/components/MusicPlayerBar/components/Timer.tsx"],"names":[],"mappings":"AAMA,KAAK,KAAK,GAAG;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,KAAK,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,KAAK,2CAa5D"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsxs as e } from "react/jsx-runtime";
|
|
2
|
+
import { Text as i } from "@mantine/core";
|
|
3
|
+
import { formatTime as r } from "../helpers.js";
|
|
4
|
+
import a from "../MusicPlayerBar.module.css.js";
|
|
5
|
+
function c({ currentTime: m, duration: t, label: o }) {
|
|
6
|
+
return /* @__PURE__ */ e(
|
|
7
|
+
i,
|
|
8
|
+
{
|
|
9
|
+
component: "time",
|
|
10
|
+
fz: 14,
|
|
11
|
+
lh: "20px",
|
|
12
|
+
c: "var(--mantine-color-text)",
|
|
13
|
+
className: a.timer,
|
|
14
|
+
"aria-label": o,
|
|
15
|
+
children: [
|
|
16
|
+
r(m),
|
|
17
|
+
" / ",
|
|
18
|
+
r(t)
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
c as Timer
|
|
25
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { HoverPopover } from '../hooks/useHoverPopover';
|
|
2
|
+
type Props = {
|
|
3
|
+
popover: HoverPopover;
|
|
4
|
+
volume: number;
|
|
5
|
+
muted: boolean;
|
|
6
|
+
isTouchTablet: boolean;
|
|
7
|
+
muteLabel: string;
|
|
8
|
+
unmuteLabel: string;
|
|
9
|
+
volumeLabel: string;
|
|
10
|
+
onToggleMute: () => void;
|
|
11
|
+
onVolumeChange: (value: number) => void;
|
|
12
|
+
};
|
|
13
|
+
export declare function VolumePopover({ popover, volume, muted, isTouchTablet, muteLabel, unmuteLabel, volumeLabel, onToggleMute, onVolumeChange, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=VolumePopover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VolumePopover.d.ts","sourceRoot":"","sources":["../../../../src/components/MusicPlayerBar/components/VolumePopover.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAI7D,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,MAAM,EACN,KAAK,EACL,aAAa,EACb,SAAS,EACT,WAAW,EACX,WAAW,EACX,YAAY,EACZ,cAAc,GACf,EAAE,KAAK,2CAmEP"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsxs as h, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { HugeiconsIcon as v } from "@hugeicons/react";
|
|
3
|
+
import { Popover as l, ActionIcon as w, Slider as g } from "@mantine/core";
|
|
4
|
+
import { pickVolumeIcon as x } from "../helpers.js";
|
|
5
|
+
import s from "../MusicPlayerBar.module.css.js";
|
|
6
|
+
function b({
|
|
7
|
+
popover: e,
|
|
8
|
+
volume: n,
|
|
9
|
+
muted: r,
|
|
10
|
+
isTouchTablet: i,
|
|
11
|
+
muteLabel: a,
|
|
12
|
+
unmuteLabel: t,
|
|
13
|
+
volumeLabel: c,
|
|
14
|
+
onToggleMute: d,
|
|
15
|
+
onVolumeChange: m
|
|
16
|
+
}) {
|
|
17
|
+
const u = x(n, r), f = r ? 0 : n, p = r || n === 0 ? t : a;
|
|
18
|
+
return /* @__PURE__ */ h(
|
|
19
|
+
l,
|
|
20
|
+
{
|
|
21
|
+
opened: e.opened,
|
|
22
|
+
onChange: e.setOpened,
|
|
23
|
+
position: "top",
|
|
24
|
+
offset: 0,
|
|
25
|
+
withinPortal: !0,
|
|
26
|
+
trapFocus: !1,
|
|
27
|
+
returnFocus: !1,
|
|
28
|
+
classNames: { dropdown: s.volumePopoverDropdown },
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ o(l.Target, { children: /* @__PURE__ */ o(
|
|
31
|
+
w,
|
|
32
|
+
{
|
|
33
|
+
variant: "subtle",
|
|
34
|
+
color: "gray",
|
|
35
|
+
size: 28,
|
|
36
|
+
"aria-label": p,
|
|
37
|
+
onMouseEnter: i ? void 0 : e.open,
|
|
38
|
+
onMouseLeave: i ? void 0 : e.close,
|
|
39
|
+
onClick: () => {
|
|
40
|
+
if (i && !e.opened) {
|
|
41
|
+
e.setOpened(!0);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
d();
|
|
45
|
+
},
|
|
46
|
+
children: /* @__PURE__ */ o(
|
|
47
|
+
v,
|
|
48
|
+
{
|
|
49
|
+
icon: u,
|
|
50
|
+
size: 20,
|
|
51
|
+
color: "var(--mantine-color-dimmed)"
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
) }),
|
|
56
|
+
/* @__PURE__ */ o(l.Dropdown, { children: /* @__PURE__ */ o(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
className: s.volumeDropdown,
|
|
60
|
+
onMouseEnter: e.cancelClose,
|
|
61
|
+
onMouseLeave: e.close,
|
|
62
|
+
children: e.opened && /* @__PURE__ */ o(
|
|
63
|
+
g,
|
|
64
|
+
{
|
|
65
|
+
min: 0,
|
|
66
|
+
max: 1,
|
|
67
|
+
step: 0.01,
|
|
68
|
+
value: f,
|
|
69
|
+
onChange: m,
|
|
70
|
+
label: null,
|
|
71
|
+
orientation: "vertical",
|
|
72
|
+
h: 57,
|
|
73
|
+
w: 10,
|
|
74
|
+
size: 2,
|
|
75
|
+
"data-testid": "music-volume-slider",
|
|
76
|
+
className: s.volumeSlider,
|
|
77
|
+
"aria-label": c
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
) })
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
export {
|
|
87
|
+
b as VolumePopover
|
|
88
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
clipRef: React.MutableRefObject<HTMLDivElement | null>;
|
|
3
|
+
heights: number[];
|
|
4
|
+
activeBar: number;
|
|
5
|
+
currentTime: number;
|
|
6
|
+
duration: number;
|
|
7
|
+
label: string;
|
|
8
|
+
onSeek: (ratio: number) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare function Waveform({ clipRef, heights, activeBar, currentTime, duration, label, onSeek, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=Waveform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Waveform.d.ts","sourceRoot":"","sources":["../../../../src/components/MusicPlayerBar/components/Waveform.tsx"],"names":[],"mappings":"AAIA,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACvD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,CAAC;AAEF,wBAAgB,QAAQ,CAAC,EACvB,OAAO,EACP,OAAO,EACP,SAAS,EACT,WAAW,EACX,QAAQ,EACR,KAAK,EACL,MAAM,GACP,EAAE,KAAK,2CAsCP"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as h } from "react";
|
|
3
|
+
import e from "../MusicPlayerBar.module.css.js";
|
|
4
|
+
function x({
|
|
5
|
+
clipRef: l,
|
|
6
|
+
heights: s,
|
|
7
|
+
activeBar: c,
|
|
8
|
+
currentTime: n,
|
|
9
|
+
duration: i,
|
|
10
|
+
label: o,
|
|
11
|
+
onSeek: m
|
|
12
|
+
}) {
|
|
13
|
+
const v = h(
|
|
14
|
+
(t) => {
|
|
15
|
+
const a = t.currentTarget.getBoundingClientRect(), f = Math.max(
|
|
16
|
+
0,
|
|
17
|
+
Math.min((t.clientX - a.left) / a.width, 1)
|
|
18
|
+
);
|
|
19
|
+
m(f);
|
|
20
|
+
},
|
|
21
|
+
[m]
|
|
22
|
+
), d = Number.isFinite(i) && i > 0 ? Math.round(i) : 0;
|
|
23
|
+
return /* @__PURE__ */ r("div", { ref: l, className: e.waveformClip, children: /* @__PURE__ */ r(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
"data-testid": "music-waveform",
|
|
27
|
+
className: e.waveform,
|
|
28
|
+
onClick: v,
|
|
29
|
+
role: "slider",
|
|
30
|
+
"aria-label": o,
|
|
31
|
+
"aria-valuenow": Math.round(n),
|
|
32
|
+
"aria-valuemin": 0,
|
|
33
|
+
"aria-valuemax": d,
|
|
34
|
+
children: s.map((t, a) => /* @__PURE__ */ r(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
className: `${e.stem} ${a < c ? e.stemActive : e.stemInactive}`,
|
|
38
|
+
style: { height: t }
|
|
39
|
+
},
|
|
40
|
+
a
|
|
41
|
+
))
|
|
42
|
+
}
|
|
43
|
+
) });
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
x as Waveform
|
|
47
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const DEFAULT_RATES: readonly [0.5, 0.7, 1, 1.2, 1.5, 1.7, 2];
|
|
2
|
+
export declare const BAR_WIDTH = 3;
|
|
3
|
+
export declare const BAR_GAP = 3;
|
|
4
|
+
export declare const BAR_STEP: number;
|
|
5
|
+
export declare const STEM_MIN_HEIGHT = 6;
|
|
6
|
+
export declare const STEM_MAX_HEIGHT = 28;
|
|
7
|
+
export declare const MIN_BAR_COUNT = 4;
|
|
8
|
+
export declare const MAX_BAR_COUNT = 200;
|
|
9
|
+
export declare const DEFAULT_BAR_COUNT = 40;
|
|
10
|
+
export declare const POLL_INTERVAL_MS = 200;
|
|
11
|
+
export declare const LINK_COPIED_TIMEOUT_MS = 1000;
|
|
12
|
+
export declare const SPEED_POPOVER_OPEN_DELAY_MS = 120;
|
|
13
|
+
export declare const SPEED_POPOVER_CLOSE_DELAY_MS = 220;
|
|
14
|
+
export declare const VOLUME_POPOVER_OPEN_DELAY_MS = 120;
|
|
15
|
+
export declare const VOLUME_POPOVER_CLOSE_DELAY_MS = 480;
|
|
16
|
+
export declare const TOUCH_DEVICE_QUERY = "(hover: none) and (pointer: coarse)";
|
|
17
|
+
export declare const TOUCH_TABLET_QUERY = "(hover: none) and (pointer: coarse) and (min-width: 769px)";
|
|
18
|
+
export declare const HOVER_CAPABLE_QUERY = "(hover: hover)";
|
|
19
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/MusicPlayerBar/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,0CAA2C,CAAC;AAEtE,eAAO,MAAM,SAAS,IAAI,CAAC;AAC3B,eAAO,MAAM,OAAO,IAAI,CAAC;AACzB,eAAO,MAAM,QAAQ,QAAsB,CAAC;AAE5C,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,aAAa,MAAM,CAAC;AACjC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,eAAO,MAAM,gBAAgB,MAAM,CAAC;AACpC,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAC/C,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAChD,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAChD,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD,eAAO,MAAM,kBAAkB,wCAAwC,CAAC;AACxE,eAAO,MAAM,kBAAkB,+DAC+B,CAAC;AAC/D,eAAO,MAAM,mBAAmB,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const o = [0.5, 0.7, 1, 1.2, 1.5, 1.7, 2], _ = 3, E = 3, n = _ + E, O = 6, t = 28, c = 4, s = 200, A = 40, T = 200, P = 1e3, L = 120, R = 220, M = 120, S = 480, U = "(hover: none) and (pointer: coarse)", e = "(hover: none) and (pointer: coarse) and (min-width: 769px)", D = "(hover: hover)";
|
|
2
|
+
export {
|
|
3
|
+
E as BAR_GAP,
|
|
4
|
+
n as BAR_STEP,
|
|
5
|
+
_ as BAR_WIDTH,
|
|
6
|
+
A as DEFAULT_BAR_COUNT,
|
|
7
|
+
o as DEFAULT_RATES,
|
|
8
|
+
D as HOVER_CAPABLE_QUERY,
|
|
9
|
+
P as LINK_COPIED_TIMEOUT_MS,
|
|
10
|
+
s as MAX_BAR_COUNT,
|
|
11
|
+
c as MIN_BAR_COUNT,
|
|
12
|
+
T as POLL_INTERVAL_MS,
|
|
13
|
+
R as SPEED_POPOVER_CLOSE_DELAY_MS,
|
|
14
|
+
L as SPEED_POPOVER_OPEN_DELAY_MS,
|
|
15
|
+
t as STEM_MAX_HEIGHT,
|
|
16
|
+
O as STEM_MIN_HEIGHT,
|
|
17
|
+
U as TOUCH_DEVICE_QUERY,
|
|
18
|
+
e as TOUCH_TABLET_QUERY,
|
|
19
|
+
S as VOLUME_POPOVER_CLOSE_DELAY_MS,
|
|
20
|
+
M as VOLUME_POPOVER_OPEN_DELAY_MS
|
|
21
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function formatTime(seconds: number): string;
|
|
2
|
+
export declare function pseudoHeight(i: number, min?: number, max?: number): number;
|
|
3
|
+
export declare function buildHeights(n: number, source?: number[]): number[];
|
|
4
|
+
export declare function resolveDownloadFileName(src: string): string;
|
|
5
|
+
export declare function downloadByUrl(src: string, suggestedName: string): void;
|
|
6
|
+
export declare function pickVolumeIcon(volume: number, muted: boolean): [string, {
|
|
7
|
+
[key: string]: string | number;
|
|
8
|
+
}][] | readonly (readonly [string, {
|
|
9
|
+
readonly [key: string]: string | number;
|
|
10
|
+
}])[];
|
|
11
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/components/MusicPlayerBar/helpers.ts"],"names":[],"mappings":"AAQA,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAMlD;AAED,wBAAgB,YAAY,CAC1B,CAAC,EAAE,MAAM,EACT,GAAG,SAAkB,EACrB,GAAG,SAAkB,GACpB,MAAM,CAIR;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAenE;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAa3D;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,CAQtE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;;;;MAI5D"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { VolumeOffIcon as f, VolumeLowIcon as m, VolumeHighIcon as u } from "@hugeicons/core-free-icons";
|
|
2
|
+
import { STEM_MIN_HEIGHT as c, STEM_MAX_HEIGHT as p } from "./constants.js";
|
|
3
|
+
function d(t) {
|
|
4
|
+
if (!Number.isFinite(t) || t < 0) return "0:00";
|
|
5
|
+
const n = Math.floor(t), o = Math.floor(n / 60), r = n % 60;
|
|
6
|
+
return `${o}:${r.toString().padStart(2, "0")}`;
|
|
7
|
+
}
|
|
8
|
+
function i(t, n = c, o = p) {
|
|
9
|
+
return Math.round(
|
|
10
|
+
Math.abs(Math.sin(t * 2.3 + 1.7) * Math.cos(t * 0.9)) * (o - n) + n
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
function M(t, n) {
|
|
14
|
+
return n?.length ? n.length === t ? n : Array.from({ length: t }, (o, r) => {
|
|
15
|
+
const l = n.length > 1 ? r / Math.max(t - 1, 1) * (n.length - 1) : 0, e = Math.floor(l), a = Math.min(e + 1, n.length - 1), h = l - e;
|
|
16
|
+
return Math.round(
|
|
17
|
+
(n[e] ?? i(e)) * (1 - h) + (n[a] ?? i(a)) * h
|
|
18
|
+
);
|
|
19
|
+
}) : Array.from({ length: t }, (o, r) => i(r));
|
|
20
|
+
}
|
|
21
|
+
function w(t) {
|
|
22
|
+
try {
|
|
23
|
+
const r = ((t.startsWith("http://") || t.startsWith("https://") ? new URL(t) : new URL(t, window.location.href)).searchParams.get("originalFileName") || t).split("/").pop()?.split("?")[0]?.trim();
|
|
24
|
+
return r && r.length > 0 ? r : "file";
|
|
25
|
+
} catch {
|
|
26
|
+
const n = t.split("/").pop()?.split("?")[0]?.trim();
|
|
27
|
+
return n && n.length > 0 ? n : "file";
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function H(t, n) {
|
|
31
|
+
const o = document.createElement("a");
|
|
32
|
+
o.href = t, o.download = n, o.rel = "noopener noreferrer", document.body.appendChild(o), o.click(), o.remove();
|
|
33
|
+
}
|
|
34
|
+
function I(t, n) {
|
|
35
|
+
return n || t === 0 ? f : t <= 0.5 ? m : u;
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
M as buildHeights,
|
|
39
|
+
H as downloadByUrl,
|
|
40
|
+
d as formatTime,
|
|
41
|
+
I as pickVolumeIcon,
|
|
42
|
+
i as pseudoHeight,
|
|
43
|
+
w as resolveDownloadFileName
|
|
44
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type AudioPlaybackState = {
|
|
2
|
+
audioRef: React.MutableRefObject<HTMLAudioElement | null>;
|
|
3
|
+
playing: boolean;
|
|
4
|
+
currentTime: number;
|
|
5
|
+
duration: number;
|
|
6
|
+
rateIndex: number;
|
|
7
|
+
volume: number;
|
|
8
|
+
muted: boolean;
|
|
9
|
+
setCurrentTime: (value: number) => void;
|
|
10
|
+
togglePlay: () => void;
|
|
11
|
+
setPlaying: (value: boolean) => void;
|
|
12
|
+
toggleMuted: () => void;
|
|
13
|
+
selectRate: (index: number) => void;
|
|
14
|
+
handleVolumeChange: (value: number) => void;
|
|
15
|
+
handleLoadedMetadata: () => void;
|
|
16
|
+
handleEnded: () => void;
|
|
17
|
+
};
|
|
18
|
+
export declare function useAudioPlayback(params: {
|
|
19
|
+
durationProp?: number;
|
|
20
|
+
initialVolume: number;
|
|
21
|
+
playbackRates: readonly number[];
|
|
22
|
+
}): AudioPlaybackState;
|
|
23
|
+
//# sourceMappingURL=useAudioPlayback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAudioPlayback.d.ts","sourceRoot":"","sources":["../../../../src/components/MusicPlayerBar/hooks/useAudioPlayback.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,KAAK,CAAC,gBAAgB,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAC1D,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,UAAU,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC,GAAG,kBAAkB,CAoFrB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useRef as C, useState as r, useEffect as u, useCallback as o } from "react";
|
|
2
|
+
import { useInterval as E } from "@mantine/hooks";
|
|
3
|
+
import { POLL_INTERVAL_MS as N } from "../constants.js";
|
|
4
|
+
function S(P) {
|
|
5
|
+
const { durationProp: n, initialVolume: R, playbackRates: l } = P, t = C(null), [s, a] = r(!1), [b, m] = r(0), [h, p] = r(() => n ?? 0), [i, k] = r(() => {
|
|
6
|
+
const e = l.indexOf(1);
|
|
7
|
+
return e >= 0 ? e : 0;
|
|
8
|
+
}), [f, x] = r(R), [c, g] = r(!1);
|
|
9
|
+
u(() => {
|
|
10
|
+
n != null && Number.isFinite(n) && n > 0 && p(n);
|
|
11
|
+
}, [n]);
|
|
12
|
+
const { start: y, stop: d } = E(() => {
|
|
13
|
+
t.current && m(t.current.currentTime);
|
|
14
|
+
}, N);
|
|
15
|
+
u(() => (s ? y() : d(), () => d()), [s, y, d]), u(() => {
|
|
16
|
+
const e = t.current;
|
|
17
|
+
e && (s ? e.play().catch(() => a(!1)) : e.pause());
|
|
18
|
+
}, [s]), u(() => {
|
|
19
|
+
t.current && (t.current.playbackRate = l[i] ?? 1);
|
|
20
|
+
}, [i, l]), u(() => {
|
|
21
|
+
t.current && (t.current.muted = c, t.current.volume = c ? 0 : f);
|
|
22
|
+
}, [c, f]);
|
|
23
|
+
const I = o(() => {
|
|
24
|
+
const e = t.current?.duration;
|
|
25
|
+
Number.isFinite(e) && (e ?? 0) > 0 && p(e ?? 0);
|
|
26
|
+
}, []), L = o(() => a(!1), []), M = o(() => a((e) => !e), []), T = o(() => g((e) => !e), []), V = o((e) => k(e), []), v = o((e) => {
|
|
27
|
+
x(e), e > 0 && g(!1);
|
|
28
|
+
}, []);
|
|
29
|
+
return {
|
|
30
|
+
audioRef: t,
|
|
31
|
+
playing: s,
|
|
32
|
+
currentTime: b,
|
|
33
|
+
duration: h,
|
|
34
|
+
rateIndex: i,
|
|
35
|
+
volume: f,
|
|
36
|
+
muted: c,
|
|
37
|
+
setCurrentTime: m,
|
|
38
|
+
togglePlay: M,
|
|
39
|
+
setPlaying: a,
|
|
40
|
+
toggleMuted: T,
|
|
41
|
+
selectRate: V,
|
|
42
|
+
handleVolumeChange: v,
|
|
43
|
+
handleLoadedMetadata: I,
|
|
44
|
+
handleEnded: L
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
S as useAudioPlayback
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCopyFeedback.d.ts","sourceRoot":"","sources":["../../../../src/components/MusicPlayerBar/hooks/useCopyFeedback.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,wBAAgB,eAAe,IAAI,YAAY,CAoB9C"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useState as n, useRef as o, useEffect as c, useCallback as l } from "react";
|
|
2
|
+
import { LINK_COPIED_TIMEOUT_MS as i } from "../constants.js";
|
|
3
|
+
function a() {
|
|
4
|
+
const [r, t] = n(!1), e = o(null);
|
|
5
|
+
c(() => () => {
|
|
6
|
+
e.current !== null && clearTimeout(e.current);
|
|
7
|
+
}, []);
|
|
8
|
+
const u = l(() => {
|
|
9
|
+
e.current !== null && clearTimeout(e.current), t(!0), e.current = setTimeout(() => {
|
|
10
|
+
t(!1), e.current = null;
|
|
11
|
+
}, i);
|
|
12
|
+
}, []);
|
|
13
|
+
return { linkCopied: r, markCopied: u };
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
a as useCopyFeedback
|
|
17
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type HoverPopover = {
|
|
2
|
+
opened: boolean;
|
|
3
|
+
setOpened: (value: boolean) => void;
|
|
4
|
+
open: () => void;
|
|
5
|
+
close: () => void;
|
|
6
|
+
cancelClose: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare function useHoverPopover(openDelay: number, closeDelay: number): HoverPopover;
|
|
9
|
+
//# sourceMappingURL=useHoverPopover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHoverPopover.d.ts","sourceRoot":"","sources":["../../../../src/components/MusicPlayerBar/hooks/useHoverPopover.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AAEF,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,YAAY,CA2Bd"}
|