@layers-app/shared 0.4.1 → 0.4.3
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/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +15 -16
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +55 -59
- package/dist/components/AttachmentsGalleryModal/styles.module.css.js +24 -22
- package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.js +109 -83
- package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerList.js +62 -63
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerToolbar.js +128 -120
- package/dist/components/ColorPicker/icons.js +3 -3
- package/dist/components/ColorPicker/types.d.ts +3 -1
- package/dist/components/ColorPicker/types.d.ts.map +1 -1
- package/dist/components/ColorPicker/types.js +11 -5
- package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
- package/dist/components/CommentComposer/CommentEditorHotkeys.js +55 -45
- package/dist/components/EmojiPicker/EmojiPanel.js +6 -6
- package/dist/components/EmojiPicker/IconsPanel.js +11 -11
- package/dist/components/FilePicker/FilePicker.d.ts +3 -1
- package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePicker.js +44 -42
- package/dist/components/FilePicker/FilePickerUpload.d.ts +3 -1
- package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUpload.js +28 -28
- package/dist/components/FormViewer/helpers/steps.d.ts.map +1 -1
- package/dist/components/FormViewer/helpers/steps.js +11 -11
- package/dist/components/LanguagePicker/LanguagePicker.d.ts +13 -3
- package/dist/components/LanguagePicker/LanguagePicker.d.ts.map +1 -1
- package/dist/components/LanguagePicker/LanguagePicker.js +65 -43
- 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 +86 -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/NavbarResizer/NavbarResizer.js +1 -1
- package/dist/components/OnboardingTour/OnboardingTourFooter.d.ts +6 -1
- package/dist/components/OnboardingTour/OnboardingTourFooter.d.ts.map +1 -1
- package/dist/components/OnboardingTour/OnboardingTourFooter.js +39 -21
- package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts +4 -5
- package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts.map +1 -1
- package/dist/components/OnboardingTour/OnboardingTourWrapper.js +86 -118
- package/dist/components/OnboardingTour/index.d.ts +1 -1
- package/dist/components/OnboardingTour/index.d.ts.map +1 -1
- package/dist/components/OnboardingTour/useOnboardingTour.d.ts +4 -0
- package/dist/components/OnboardingTour/useOnboardingTour.d.ts.map +1 -1
- package/dist/components/OnboardingTour/useOnboardingTour.js +65 -36
- package/dist/components/UserAvatar/index.d.ts.map +1 -1
- package/dist/components/UserAvatar/index.js +38 -31
- package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
- package/dist/components/table/hooks/useColumnsResizing.js +1 -1
- package/dist/config/brand.d.ts +2 -0
- package/dist/config/brand.d.ts.map +1 -1
- package/dist/config/brand.js +28 -22
- package/dist/config/envConfig.d.ts +4 -0
- package/dist/config/envConfig.d.ts.map +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/index.css +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +454 -448
- 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/dist/store/featureProgress.d.ts +3 -6
- package/dist/store/featureProgress.d.ts.map +1 -1
- package/dist/store/featureProgress.js +56 -22
- package/dist/store/plansModal.d.ts.map +1 -1
- package/dist/store/plansModal.js +10 -10
- package/package.json +3 -3
- 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":"useWaveform.d.ts","sourceRoot":"","sources":["../../../../src/components/MusicPlayerBar/hooks/useWaveform.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,wBAAgB,WAAW,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,GAAG,aAAa,CA0BrE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useRef as f, useState as m, useEffect as R, useMemo as A } from "react";
|
|
2
|
+
import { DEFAULT_BAR_COUNT as _, MIN_BAR_COUNT as a, MAX_BAR_COUNT as h, BAR_GAP as l, BAR_STEP as B } from "../constants.js";
|
|
3
|
+
import { buildHeights as M } from "../helpers.js";
|
|
4
|
+
function b(e) {
|
|
5
|
+
const o = f(null), [t, s] = m(_);
|
|
6
|
+
R(() => {
|
|
7
|
+
const r = o.current;
|
|
8
|
+
if (!r) return;
|
|
9
|
+
const n = new ResizeObserver(([u]) => {
|
|
10
|
+
const i = u.contentRect.width;
|
|
11
|
+
s(
|
|
12
|
+
Math.max(
|
|
13
|
+
a,
|
|
14
|
+
Math.min(h, Math.floor((i + l) / B))
|
|
15
|
+
)
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
return n.observe(r), () => n.disconnect();
|
|
19
|
+
}, []);
|
|
20
|
+
const c = A(
|
|
21
|
+
() => M(t, e),
|
|
22
|
+
[t, e]
|
|
23
|
+
);
|
|
24
|
+
return { clipRef: o, barCount: t, heights: c };
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
b as useWaveform
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MusicPlayerBar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type MusicPlayerBarLabels = {
|
|
3
|
+
play: string;
|
|
4
|
+
pause: string;
|
|
5
|
+
mute: string;
|
|
6
|
+
unmute: string;
|
|
7
|
+
playbackSpeed: string;
|
|
8
|
+
volume: string;
|
|
9
|
+
waveformSeek: string;
|
|
10
|
+
timeDisplay: string;
|
|
11
|
+
download: string;
|
|
12
|
+
copyLink: string;
|
|
13
|
+
delete: string;
|
|
14
|
+
more: string;
|
|
15
|
+
mobileActionsTitle: string;
|
|
16
|
+
};
|
|
17
|
+
export type MusicPlayerBarProps = Readonly<{
|
|
18
|
+
src: string;
|
|
19
|
+
duration?: number;
|
|
20
|
+
playbackRates?: readonly number[];
|
|
21
|
+
initialVolume?: number;
|
|
22
|
+
waveformHeights?: number[];
|
|
23
|
+
disable?: boolean;
|
|
24
|
+
showDelete?: boolean;
|
|
25
|
+
showDownload?: boolean;
|
|
26
|
+
showCopyLink?: boolean;
|
|
27
|
+
onDelete?: () => void;
|
|
28
|
+
onDownload?: () => void;
|
|
29
|
+
onCopyLink?: () => Promise<void> | void;
|
|
30
|
+
onCopyError?: () => void;
|
|
31
|
+
extraActions?: ReactNode;
|
|
32
|
+
}>;
|
|
33
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/MusicPlayerBar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACzC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as h } from "react/jsx-runtime";
|
|
2
2
|
import { memo as b, useState as r } from "react";
|
|
3
|
-
import { useDraggable as x } from "draggable-ui";
|
|
3
|
+
import { useDraggable as x } from "@layers-app/draggable-ui";
|
|
4
4
|
import { clamp as y } from "lodash-es";
|
|
5
5
|
import M from "./NavbarResizer.module.css.js";
|
|
6
6
|
const N = b(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type OnboardingTourController } from '@
|
|
1
|
+
import { type OnboardingTourController } from '@layers-app/onboarding-tour';
|
|
2
2
|
export declare const DefaultSingleFooter: ({ controller, label, }: {
|
|
3
3
|
controller: OnboardingTourController;
|
|
4
4
|
label: string;
|
|
@@ -12,6 +12,11 @@ export declare const DefaultMultiFooter: ({ controller, stepIndex, totalSteps, l
|
|
|
12
12
|
back: string;
|
|
13
13
|
next: string;
|
|
14
14
|
done: string;
|
|
15
|
+
continue?: string;
|
|
15
16
|
};
|
|
16
17
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const DefaultTourHeader: ({ controller, title, }: {
|
|
19
|
+
controller: OnboardingTourController;
|
|
20
|
+
title: React.ReactNode;
|
|
21
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
17
22
|
//# sourceMappingURL=OnboardingTourFooter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnboardingTourFooter.d.ts","sourceRoot":"","sources":["../../../src/components/OnboardingTour/OnboardingTourFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"OnboardingTourFooter.d.ts","sourceRoot":"","sources":["../../../src/components/OnboardingTour/OnboardingTourFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAI5E,eAAO,MAAM,mBAAmB,GAAI,wBAGjC;IACD,UAAU,EAAE,wBAAwB,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC;CACf,4CAMA,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,gDAKhC;IACD,UAAU,EAAE,wBAAwB,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACH,4CAiCA,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,wBAG/B;IACD,UAAU,EAAE,wBAAwB,CAAC;IACrC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB,4CAaA,CAAC"}
|
|
@@ -1,40 +1,58 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Group as r, Button as s, Text as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { Group as r, Button as s, Text as p, ActionIcon as d } from "@mantine/core";
|
|
3
|
+
import { IconX as f } from "@tabler/icons-react";
|
|
4
|
+
const g = ({
|
|
5
|
+
controller: i,
|
|
6
|
+
label: t
|
|
7
|
+
}) => /* @__PURE__ */ e(r, { justify: "flex-end", children: /* @__PURE__ */ e(s, { size: "sm", onClick: () => i.endTour(), children: t }) }), k = ({
|
|
8
|
+
controller: i,
|
|
9
|
+
stepIndex: t,
|
|
10
|
+
totalSteps: u,
|
|
10
11
|
labels: n
|
|
11
12
|
}) => {
|
|
12
|
-
const
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
!
|
|
13
|
+
const c = t === 0, a = t === u - 1, l = c && n.continue ? n.continue : n.next;
|
|
14
|
+
return /* @__PURE__ */ o(r, { justify: "space-between", children: [
|
|
15
|
+
/* @__PURE__ */ e(p, { size: "sm", c: "gray.5", children: n.stepOf }),
|
|
16
|
+
/* @__PURE__ */ o(r, { gap: "xs", children: [
|
|
17
|
+
!c && /* @__PURE__ */ e(
|
|
17
18
|
s,
|
|
18
19
|
{
|
|
19
20
|
variant: "subtle",
|
|
20
21
|
color: "gray.5",
|
|
21
22
|
size: "sm",
|
|
22
|
-
onClick: () =>
|
|
23
|
+
onClick: () => i.prevStep(),
|
|
23
24
|
children: n.back
|
|
24
25
|
}
|
|
25
26
|
),
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ e(
|
|
27
28
|
s,
|
|
28
29
|
{
|
|
29
30
|
size: "sm",
|
|
30
|
-
onClick: () =>
|
|
31
|
-
children:
|
|
31
|
+
onClick: () => a ? i.endTour() : i.nextStep(),
|
|
32
|
+
children: a ? n.done : l
|
|
32
33
|
}
|
|
33
34
|
)
|
|
34
35
|
] })
|
|
35
36
|
] });
|
|
36
|
-
}
|
|
37
|
+
}, y = ({
|
|
38
|
+
controller: i,
|
|
39
|
+
title: t
|
|
40
|
+
}) => /* @__PURE__ */ o(r, { justify: "space-between", align: "flex-start", gap: "xs", wrap: "nowrap", children: [
|
|
41
|
+
/* @__PURE__ */ e("div", { style: { flex: 1 }, children: t }),
|
|
42
|
+
/* @__PURE__ */ e(
|
|
43
|
+
d,
|
|
44
|
+
{
|
|
45
|
+
variant: "subtle",
|
|
46
|
+
color: "gray.3",
|
|
47
|
+
size: "sm",
|
|
48
|
+
onClick: () => i.skipTour(),
|
|
49
|
+
"aria-label": "Skip tour",
|
|
50
|
+
children: /* @__PURE__ */ e(f, { size: 16 })
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
] });
|
|
37
54
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
55
|
+
k as DefaultMultiFooter,
|
|
56
|
+
g as DefaultSingleFooter,
|
|
57
|
+
y as DefaultTourHeader
|
|
40
58
|
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
import { type OnboardingTourProps, type OnboardingTourStep } from '@
|
|
3
|
-
import './OnboardingTourWrapper.css';
|
|
1
|
+
import { type MutableRefObject, type ReactNode } from 'react';
|
|
2
|
+
import { type OnboardingTourController, type OnboardingTourProps, type OnboardingTourStep } from '@layers-app/onboarding-tour';
|
|
4
3
|
export interface OnboardingTourWrapperProps extends Partial<Omit<OnboardingTourProps, 'tour' | 'started' | 'children'>> {
|
|
5
4
|
featureKey: string;
|
|
6
5
|
tour: OnboardingTourStep[];
|
|
7
6
|
children: ReactNode;
|
|
8
7
|
onComplete?: () => void;
|
|
9
8
|
dependsOn?: string;
|
|
10
|
-
|
|
9
|
+
controllerRef?: MutableRefObject<OnboardingTourController | null>;
|
|
11
10
|
}
|
|
12
|
-
export declare const OnboardingTourWrapper: ({ featureKey, tour, children, onComplete, dependsOn,
|
|
11
|
+
export declare const OnboardingTourWrapper: ({ featureKey, tour, children, onComplete, dependsOn, controllerRef, classNames, focusRevealProps: externalFocusRevealProps, onOnboardingTourEnd: externalOnEnd, onOnboardingTourSkip: externalOnClose, onOnboardingTourChange: externalOnChange, onOnboardingTourStart: externalOnStart, ...rest }: OnboardingTourWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
//# sourceMappingURL=OnboardingTourWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnboardingTourWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/OnboardingTour/OnboardingTourWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"OnboardingTourWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/OnboardingTour/OnboardingTourWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACxB,MAAM,6BAA6B,CAAC;AAcrC,MAAM,WAAW,0BACf,SAAQ,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;IAC3E,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,kBAAkB,EAAE,CAAC;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,gBAAgB,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAAC;CACnE;AA4BD,eAAO,MAAM,qBAAqB,GAAI,oSAcnC,0BAA0B,4CA4J5B,CAAC"}
|
|
@@ -1,160 +1,128 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { OnboardingTour as
|
|
5
|
-
import { Text as
|
|
6
|
-
import { DefaultSingleFooter as
|
|
7
|
-
import { useOnboardingTour as
|
|
8
|
-
/*
|
|
9
|
-
|
|
10
|
-
featureKey: n,
|
|
1
|
+
import { jsx as a, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as b, useCallback as m } from "react";
|
|
3
|
+
import { useTranslation as F } from "react-i18next";
|
|
4
|
+
import { OnboardingTour as M } from "@layers-app/onboarding-tour";
|
|
5
|
+
import { Text as v } from "@mantine/core";
|
|
6
|
+
import { DefaultSingleFooter as H, DefaultMultiFooter as N, DefaultTourHeader as W } from "./OnboardingTourFooter.js";
|
|
7
|
+
import { useOnboardingTour as q, getSavedStepIndex as A, saveStepIndex as G } from "./useOnboardingTour.js";
|
|
8
|
+
const J = (o) => typeof o == "string" ? /* @__PURE__ */ a(v, { fw: 500, size: "md", c: "white", mb: 4, children: o }) : o, L = (o) => typeof o == "string" ? /* @__PURE__ */ a(v, { size: "sm", c: "gray.3", children: o }) : o, $ = ({
|
|
9
|
+
featureKey: o,
|
|
11
10
|
tour: d,
|
|
12
|
-
children:
|
|
13
|
-
onComplete:
|
|
14
|
-
dependsOn:
|
|
15
|
-
|
|
16
|
-
classNames:
|
|
17
|
-
focusRevealProps:
|
|
18
|
-
onOnboardingTourEnd:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
children: l,
|
|
12
|
+
onComplete: p,
|
|
13
|
+
dependsOn: k,
|
|
14
|
+
controllerRef: s,
|
|
15
|
+
classNames: x = {},
|
|
16
|
+
focusRevealProps: c,
|
|
17
|
+
onOnboardingTourEnd: T,
|
|
18
|
+
onOnboardingTourSkip: S,
|
|
19
|
+
onOnboardingTourChange: h,
|
|
20
|
+
onOnboardingTourStart: O,
|
|
21
|
+
...I
|
|
22
22
|
}) => {
|
|
23
|
-
const { t:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const
|
|
23
|
+
const { t: e } = F("pages"), { started: P, complete: u } = q(o, { dependsOn: k }), y = b(
|
|
24
|
+
() => A(o),
|
|
25
|
+
[o]
|
|
26
|
+
), B = m(
|
|
27
|
+
(n) => {
|
|
28
|
+
const i = d.findIndex((r) => r.id === n.id);
|
|
29
|
+
i >= 0 && G(o, i), h?.(n);
|
|
30
|
+
},
|
|
31
|
+
[o, d, h]
|
|
32
|
+
), C = m(() => {
|
|
33
|
+
u(), p?.(), T?.();
|
|
34
|
+
}, [u, p, T]), D = m(() => {
|
|
35
|
+
u(), p?.(), S?.();
|
|
36
|
+
}, [u, p, S]), j = b(() => {
|
|
37
|
+
const n = d.length, i = n === 1;
|
|
38
|
+
return d.map((r, w) => {
|
|
39
|
+
const g = J(r.title), f = {
|
|
29
40
|
...r,
|
|
30
|
-
title:
|
|
31
|
-
|
|
41
|
+
title: void 0,
|
|
42
|
+
header: (t) => /* @__PURE__ */ a(
|
|
43
|
+
W,
|
|
44
|
+
{
|
|
45
|
+
controller: t,
|
|
46
|
+
title: typeof g == "function" ? g(t) : g
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
content: L(r.content)
|
|
32
50
|
};
|
|
33
|
-
return r.footer === void 0 && (
|
|
34
|
-
|
|
51
|
+
return r.footer === void 0 && (i ? f.footer = (t) => (s && (s.current = t), /* @__PURE__ */ a(
|
|
52
|
+
H,
|
|
35
53
|
{
|
|
36
|
-
controller:
|
|
37
|
-
label:
|
|
54
|
+
controller: t,
|
|
55
|
+
label: e("onboarding.continue")
|
|
38
56
|
}
|
|
39
|
-
) :
|
|
40
|
-
|
|
57
|
+
)) : f.footer = (t) => (s && (s.current = t), /* @__PURE__ */ a(
|
|
58
|
+
N,
|
|
41
59
|
{
|
|
42
|
-
controller:
|
|
43
|
-
stepIndex:
|
|
44
|
-
totalSteps:
|
|
60
|
+
controller: t,
|
|
61
|
+
stepIndex: w,
|
|
62
|
+
totalSteps: n,
|
|
45
63
|
labels: {
|
|
46
|
-
stepOf:
|
|
47
|
-
current:
|
|
48
|
-
total:
|
|
64
|
+
stepOf: e("onboarding.stepOf", {
|
|
65
|
+
current: w + 1,
|
|
66
|
+
total: n
|
|
49
67
|
}),
|
|
50
|
-
back:
|
|
51
|
-
next:
|
|
52
|
-
done:
|
|
68
|
+
back: e("onboarding.back"),
|
|
69
|
+
next: e("onboarding.next"),
|
|
70
|
+
done: e("onboarding.done"),
|
|
71
|
+
continue: e("onboarding.continue")
|
|
53
72
|
}
|
|
54
73
|
}
|
|
55
|
-
)),
|
|
74
|
+
))), f;
|
|
56
75
|
});
|
|
57
|
-
}, [d,
|
|
58
|
-
const
|
|
76
|
+
}, [d, e, s]), z = b(() => {
|
|
77
|
+
const n = typeof c == "object" ? c : void 0, i = n?.popoverProps ?? {}, r = i.styles ?? {};
|
|
59
78
|
return {
|
|
60
|
-
...
|
|
61
|
-
disableTargetInteraction:
|
|
62
|
-
overlayProps: {
|
|
63
|
-
blur: 0,
|
|
64
|
-
...e?.overlayProps
|
|
65
|
-
},
|
|
79
|
+
...n,
|
|
80
|
+
disableTargetInteraction: n?.disableTargetInteraction ?? !0,
|
|
66
81
|
popoverProps: {
|
|
67
82
|
position: "bottom",
|
|
68
83
|
offset: 10,
|
|
69
|
-
|
|
70
|
-
duration: 0,
|
|
71
|
-
...o.transitionProps ?? {}
|
|
72
|
-
},
|
|
73
|
-
...o,
|
|
74
|
-
classNames: {
|
|
75
|
-
...r,
|
|
76
|
-
dropdown: a
|
|
77
|
-
},
|
|
84
|
+
...i,
|
|
78
85
|
styles: {
|
|
79
|
-
...
|
|
86
|
+
...r,
|
|
80
87
|
dropdown: {
|
|
81
88
|
backgroundColor: "var(--mantine-color-dark-7)",
|
|
82
89
|
padding: 16,
|
|
83
90
|
color: "white",
|
|
84
91
|
border: "none",
|
|
85
92
|
width: 300,
|
|
86
|
-
...
|
|
93
|
+
...r.dropdown
|
|
87
94
|
},
|
|
88
95
|
arrow: {
|
|
89
96
|
backgroundColor: "var(--mantine-color-dark-7)",
|
|
90
97
|
border: "none",
|
|
91
|
-
...
|
|
98
|
+
...r.arrow
|
|
92
99
|
}
|
|
93
100
|
}
|
|
94
101
|
}
|
|
95
102
|
};
|
|
96
|
-
}, [
|
|
97
|
-
return
|
|
98
|
-
|
|
99
|
-
let e = 0;
|
|
100
|
-
const o = document.createElement("style");
|
|
101
|
-
o.setAttribute("data-onboarding-tour-popover-animation", "true"), o.textContent = `.${v}:not([${h}]) { opacity: 0 !important; pointer-events: none !important; }`, document.head.appendChild(o);
|
|
102
|
-
const r = (t) => {
|
|
103
|
-
t.removeAttribute(h), t.style.removeProperty("position"), t.style.removeProperty("top"), t.style.removeProperty("left"), t.style.removeProperty("width"), t.style.removeProperty("transform"), t.style.removeProperty("opacity"), t.style.removeProperty("pointer-events"), t.style.removeProperty("will-change"), t.style.removeProperty("transition");
|
|
104
|
-
}, s = (t) => {
|
|
105
|
-
const i = t.getBoundingClientRect();
|
|
106
|
-
if (i.width === 0 || i.height === 0) return;
|
|
107
|
-
const g = i.top, y = i.left, _ = m.current?.top ?? g, j = m.current?.left ?? y;
|
|
108
|
-
c.current && c.current !== t && r(c.current), c.current = t, t.setAttribute(h, "true"), Object.assign(t.style, {
|
|
109
|
-
position: "fixed",
|
|
110
|
-
top: `${_}px`,
|
|
111
|
-
left: `${j}px`,
|
|
112
|
-
width: `${i.width}px`,
|
|
113
|
-
transform: "none",
|
|
114
|
-
opacity: "1",
|
|
115
|
-
pointerEvents: "auto",
|
|
116
|
-
willChange: "top, left",
|
|
117
|
-
transition: "top 260ms cubic-bezier(0.2, 0, 0, 1), left 260ms cubic-bezier(0.2, 0, 0, 1)"
|
|
118
|
-
}), requestAnimationFrame(() => {
|
|
119
|
-
t.isConnected && (t.style.top = `${g}px`, t.style.left = `${y}px`);
|
|
120
|
-
}), m.current = { top: g, left: y };
|
|
121
|
-
}, a = () => {
|
|
122
|
-
const t = Array.from(
|
|
123
|
-
document.querySelectorAll(`.${v}`)
|
|
124
|
-
), i = t[t.length - 1];
|
|
125
|
-
i && s(i);
|
|
126
|
-
}, p = new MutationObserver(() => {
|
|
127
|
-
cancelAnimationFrame(e), e = requestAnimationFrame(a);
|
|
128
|
-
});
|
|
129
|
-
return a(), p.observe(document.body, { childList: !0, subtree: !0 }), () => {
|
|
130
|
-
p.disconnect(), cancelAnimationFrame(e), o.remove(), c.current && (r(c.current), c.current = null), m.current = null;
|
|
131
|
-
};
|
|
132
|
-
}, [b, T]), d.length === 0 ? /* @__PURE__ */ u(z, { children: w }) : /* @__PURE__ */ u(
|
|
133
|
-
W,
|
|
103
|
+
}, [c]);
|
|
104
|
+
return d.length === 0 ? /* @__PURE__ */ a(E, { children: l }) : /* @__PURE__ */ a(
|
|
105
|
+
M,
|
|
134
106
|
{
|
|
135
|
-
tour:
|
|
136
|
-
started:
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
},
|
|
143
|
-
onOnboardingTourEnd: E,
|
|
107
|
+
tour: j,
|
|
108
|
+
started: P,
|
|
109
|
+
initialStepIndex: y,
|
|
110
|
+
onOnboardingTourStart: O,
|
|
111
|
+
onOnboardingTourChange: B,
|
|
112
|
+
onOnboardingTourEnd: C,
|
|
113
|
+
onOnboardingTourSkip: D,
|
|
144
114
|
withPrevButton: !1,
|
|
145
115
|
withNextButton: !1,
|
|
146
116
|
withSkipButton: !1,
|
|
147
117
|
withStepper: !1,
|
|
148
118
|
maw: 300,
|
|
149
|
-
classNames:
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
...$,
|
|
154
|
-
children: w
|
|
119
|
+
classNames: x,
|
|
120
|
+
focusRevealProps: z,
|
|
121
|
+
...I,
|
|
122
|
+
children: l
|
|
155
123
|
}
|
|
156
124
|
);
|
|
157
125
|
};
|
|
158
126
|
export {
|
|
159
|
-
|
|
127
|
+
$ as OnboardingTourWrapper
|
|
160
128
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { OnboardingTourWrapper } from './OnboardingTourWrapper';
|
|
2
2
|
export type { OnboardingTourWrapperProps } from './OnboardingTourWrapper';
|
|
3
|
-
export { useOnboardingTour, isOnboardingCompleted, resetOnboarding, } from './useOnboardingTour';
|
|
3
|
+
export { useOnboardingTour, isOnboardingCompleted, resetOnboarding, getSavedStepIndex, saveStepIndex, clearSavedStep, setOnboardingUserId, } from './useOnboardingTour';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/OnboardingTour/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/OnboardingTour/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,mBAAmB,GACpB,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
export declare const setOnboardingUserId: (userId: string | null) => void;
|
|
1
2
|
export declare const isOnboardingCompleted: (featureKey: string) => boolean;
|
|
2
3
|
export declare const resetOnboarding: (featureKey: string) => void;
|
|
4
|
+
export declare const getSavedStepIndex: (featureKey: string) => number | undefined;
|
|
5
|
+
export declare const saveStepIndex: (featureKey: string, stepIndex: number) => void;
|
|
6
|
+
export declare const clearSavedStep: (featureKey: string) => void;
|
|
3
7
|
interface UseOnboardingTourOptions {
|
|
4
8
|
dependsOn?: string;
|
|
5
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOnboardingTour.d.ts","sourceRoot":"","sources":["../../../src/components/OnboardingTour/useOnboardingTour.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useOnboardingTour.d.ts","sourceRoot":"","sources":["../../../src/components/OnboardingTour/useOnboardingTour.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,mBAAmB,GAAI,QAAQ,MAAM,GAAG,IAAI,KAAG,IAE3D,CAAC;AA4CF,eAAO,MAAM,qBAAqB,GAAI,YAAY,MAAM,KAAG,OAE1D,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,YAAY,MAAM,KAAG,IAUpD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,YAAY,MAAM,KAAG,MAAM,GAAG,SAI/D,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,YAAY,MAAM,EAAE,WAAW,MAAM,KAAG,IAIrE,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,YAAY,MAAM,KAAG,IAInD,CAAC;AAEF,UAAU,wBAAwB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,uBAAuB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,iBAAiB,GAC5B,YAAY,MAAM,EAClB,UAAU,wBAAwB,KACjC,uBAyDF,CAAC"}
|
|
@@ -1,50 +1,79 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
const
|
|
1
|
+
import { useState as O, useEffect as M, useCallback as b } from "react";
|
|
2
|
+
const m = "onboarding-completed", u = "onboarding-step", E = "onboarding-completed", S = "onboarding-reset";
|
|
3
|
+
let o = null;
|
|
4
|
+
const R = (t) => {
|
|
5
|
+
o = t;
|
|
6
|
+
}, d = (t) => {
|
|
3
7
|
try {
|
|
4
|
-
return JSON.parse(localStorage.getItem(
|
|
8
|
+
return JSON.parse(localStorage.getItem(t) || "{}");
|
|
5
9
|
} catch {
|
|
6
10
|
return {};
|
|
7
11
|
}
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
}, g = () => o ? d(m)[o] ?? {} : {}, I = (t) => {
|
|
13
|
+
if (o)
|
|
14
|
+
try {
|
|
15
|
+
const e = d(m);
|
|
16
|
+
e[o] = t, localStorage.setItem(m, JSON.stringify(e));
|
|
17
|
+
} catch {
|
|
18
|
+
}
|
|
19
|
+
}, a = () => o ? d(u)[o] ?? {} : {}, w = (t) => {
|
|
20
|
+
if (o)
|
|
21
|
+
try {
|
|
22
|
+
const e = d(u);
|
|
23
|
+
e[o] = t, localStorage.setItem(u, JSON.stringify(e));
|
|
24
|
+
} catch {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
}, c = (t) => !!g()[t], L = (t) => {
|
|
28
|
+
const e = g();
|
|
29
|
+
delete e[t], I(e);
|
|
30
|
+
const n = a();
|
|
31
|
+
delete n[t], w(n), window.dispatchEvent(
|
|
32
|
+
new CustomEvent(S, { detail: t })
|
|
17
33
|
);
|
|
18
|
-
},
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
34
|
+
}, f = (t) => {
|
|
35
|
+
const n = a()[t];
|
|
36
|
+
return typeof n == "number" ? n : void 0;
|
|
37
|
+
}, A = (t, e) => {
|
|
38
|
+
const n = a();
|
|
39
|
+
n[t] = e, w(n);
|
|
40
|
+
}, _ = (t) => {
|
|
41
|
+
const e = a();
|
|
42
|
+
delete e[t], w(e);
|
|
43
|
+
}, G = (t, e) => {
|
|
44
|
+
const { dependsOn: n } = e ?? {}, [i, v] = O(
|
|
45
|
+
() => c(t)
|
|
46
|
+
), [p, r] = O(
|
|
47
|
+
() => !c(t) && (n ? c(n) : !0)
|
|
23
48
|
);
|
|
24
|
-
|
|
25
|
-
if (
|
|
26
|
-
const
|
|
27
|
-
|
|
49
|
+
M(() => {
|
|
50
|
+
if (i || !n || p) return;
|
|
51
|
+
const s = (l) => {
|
|
52
|
+
l.detail === n && !c(t) && r(!0);
|
|
28
53
|
};
|
|
29
|
-
return window.addEventListener(
|
|
30
|
-
}, [n,
|
|
31
|
-
const
|
|
32
|
-
|
|
54
|
+
return window.addEventListener(E, s), () => window.removeEventListener(E, s);
|
|
55
|
+
}, [n, i, p, t]), M(() => {
|
|
56
|
+
const s = (l) => {
|
|
57
|
+
l.detail === t && (v(!1), r(!0));
|
|
33
58
|
};
|
|
34
|
-
return window.addEventListener(
|
|
59
|
+
return window.addEventListener(S, s), () => window.removeEventListener(S, s);
|
|
35
60
|
}, [t]);
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
new CustomEvent(
|
|
61
|
+
const N = b(() => {
|
|
62
|
+
const s = g();
|
|
63
|
+
s[t] = !0, I(s), _(t), v(!0), r(!1), window.dispatchEvent(
|
|
64
|
+
new CustomEvent(E, { detail: t })
|
|
40
65
|
);
|
|
41
|
-
}, [t]), C =
|
|
42
|
-
|
|
66
|
+
}, [t]), C = b(() => {
|
|
67
|
+
r(!0);
|
|
43
68
|
}, []);
|
|
44
|
-
return { started:
|
|
69
|
+
return { started: p, completed: i, start: C, complete: N };
|
|
45
70
|
};
|
|
46
71
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
72
|
+
_ as clearSavedStep,
|
|
73
|
+
f as getSavedStepIndex,
|
|
74
|
+
c as isOnboardingCompleted,
|
|
75
|
+
L as resetOnboarding,
|
|
76
|
+
A as saveStepIndex,
|
|
77
|
+
R as setOnboardingUserId,
|
|
78
|
+
G as useOnboardingTour
|
|
50
79
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/UserAvatar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAGtF,MAAM,WAAW,eACf,SAAQ,WAAW,EACjB,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,MAAM,WAAW,CAAC;IAChE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/UserAvatar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAGtF,MAAM,WAAW,eACf,SAAQ,WAAW,EACjB,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,MAAM,WAAW,CAAC;IAChE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAmBD,eAAO,MAAM,UAAU,GAAI,0CAMxB,eAAe,4CAuCjB,CAAC"}
|