@astral/ui 4.82.0 → 4.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_mocks/LoggerMock/LoggerMock.d.ts +16 -0
- package/_mocks/LoggerMock/LoggerMock.js +18 -0
- package/_mocks/LoggerMock/index.d.ts +1 -0
- package/_mocks/LoggerMock/index.js +1 -0
- package/components/ConfigProvider/ConfigProvider.d.ts +7 -1
- package/components/ConfigProvider/ConfigProvider.js +14 -8
- package/components/ConfirmDialog/ConfirmDialog.js +3 -1
- package/components/ConfirmDialog/constants.d.ts +4 -0
- package/components/ConfirmDialog/constants.js +5 -0
- package/components/ConfirmDialog/index.d.ts +1 -0
- package/components/ConfirmDialog/index.js +1 -0
- package/components/ConfirmDialog/public.d.ts +1 -0
- package/components/ConfirmDialog/public.js +1 -0
- package/components/ConfirmDialog/types.d.ts +1 -1
- package/components/DashboardLayout/Header/useLogic/useLogic.d.ts +1 -1
- package/components/NewPopover/NewPopover.d.ts +1 -1
- package/components/NewPopover/NewPopover.js +14 -5
- package/components/NewPopover/constants.d.ts +7 -0
- package/components/NewPopover/constants.js +11 -0
- package/components/NewPopover/styles.d.ts +4 -0
- package/components/NewPopover/styles.js +100 -4
- package/components/NewPopover/types.d.ts +13 -0
- package/components/NewPopover/useLogic/useLogic.d.ts +7 -3
- package/components/NewPopover/useLogic/useLogic.js +15 -1
- package/components/Onboarding/Onboarding.d.ts +35 -0
- package/components/Onboarding/Onboarding.js +56 -0
- package/components/Onboarding/constants.d.ts +34 -0
- package/components/Onboarding/constants.js +34 -0
- package/components/Onboarding/core/ActiveStepStore/ActiveStepStore.d.ts +50 -0
- package/components/Onboarding/core/ActiveStepStore/ActiveStepStore.js +63 -0
- package/components/Onboarding/core/ActiveStepStore/index.d.ts +1 -0
- package/components/Onboarding/core/ActiveStepStore/index.js +1 -0
- package/components/Onboarding/core/ExitController/ExitController.d.ts +48 -0
- package/components/Onboarding/core/ExitController/ExitController.js +59 -0
- package/components/Onboarding/core/ExitController/index.d.ts +1 -0
- package/components/Onboarding/core/ExitController/index.js +1 -0
- package/components/Onboarding/core/OnboardingTour/OnboardingTour.d.ts +103 -0
- package/components/Onboarding/core/OnboardingTour/OnboardingTour.js +283 -0
- package/components/Onboarding/core/OnboardingTour/index.d.ts +1 -0
- package/components/Onboarding/core/OnboardingTour/index.js +1 -0
- package/components/Onboarding/core/ProgressStorage/ProgressStorage.d.ts +24 -0
- package/components/Onboarding/core/ProgressStorage/ProgressStorage.js +62 -0
- package/components/Onboarding/core/ProgressStorage/index.d.ts +1 -0
- package/components/Onboarding/core/ProgressStorage/index.js +1 -0
- package/components/Onboarding/core/StepNavigator/StepNavigator.d.ts +28 -0
- package/components/Onboarding/core/StepNavigator/StepNavigator.js +73 -0
- package/components/Onboarding/core/StepNavigator/index.d.ts +1 -0
- package/components/Onboarding/core/StepNavigator/index.js +1 -0
- package/components/Onboarding/core/StepResolver/StepResolver.d.ts +19 -0
- package/components/Onboarding/core/StepResolver/StepResolver.js +49 -0
- package/components/Onboarding/core/StepResolver/index.d.ts +1 -0
- package/components/Onboarding/core/StepResolver/index.js +1 -0
- package/components/Onboarding/core/StepsController/StepsController.d.ts +16 -0
- package/components/Onboarding/core/StepsController/StepsController.js +35 -0
- package/components/Onboarding/core/StepsController/index.d.ts +1 -0
- package/components/Onboarding/core/StepsController/index.js +1 -0
- package/components/Onboarding/faker.d.ts +27 -0
- package/components/Onboarding/faker.js +79 -0
- package/components/Onboarding/index.d.ts +5 -0
- package/components/Onboarding/index.js +3 -0
- package/components/Onboarding/public.d.ts +5 -0
- package/components/Onboarding/public.js +3 -0
- package/components/Onboarding/services/LocalStorageSaveStrategy/LocalStorageSaveStrategy.d.ts +20 -0
- package/components/Onboarding/services/LocalStorageSaveStrategy/LocalStorageSaveStrategy.js +24 -0
- package/components/Onboarding/services/LocalStorageSaveStrategy/index.d.ts +1 -0
- package/components/Onboarding/services/LocalStorageSaveStrategy/index.js +1 -0
- package/components/Onboarding/types/config.d.ts +18 -0
- package/components/Onboarding/types/config.js +1 -0
- package/components/Onboarding/types/index.d.ts +4 -0
- package/components/Onboarding/types/index.js +4 -0
- package/components/Onboarding/types/progress.d.ts +28 -0
- package/components/Onboarding/types/progress.js +1 -0
- package/components/Onboarding/types/step.d.ts +144 -0
- package/components/Onboarding/types/step.js +1 -0
- package/components/Onboarding/types/tour.d.ts +168 -0
- package/components/Onboarding/types/tour.js +1 -0
- package/components/Onboarding/ui/ConfirmExit/ConfirmExit.d.ts +10 -0
- package/components/Onboarding/ui/ConfirmExit/ConfirmExit.js +6 -0
- package/components/Onboarding/ui/ConfirmExit/index.d.ts +2 -0
- package/components/Onboarding/ui/ConfirmExit/index.js +1 -0
- package/components/Onboarding/ui/ConfirmExit/styles.d.ts +30 -0
- package/components/Onboarding/ui/ConfirmExit/styles.js +11 -0
- package/components/Onboarding/ui/OnboardingContainer/OnboardingContainer.d.ts +12 -0
- package/components/Onboarding/ui/OnboardingContainer/OnboardingContainer.js +15 -0
- package/components/Onboarding/ui/OnboardingContainer/OnboardingErrorBoundary/OnboardingErrorBoundary.d.ts +22 -0
- package/components/Onboarding/ui/OnboardingContainer/OnboardingErrorBoundary/OnboardingErrorBoundary.js +20 -0
- package/components/Onboarding/ui/OnboardingContainer/OnboardingErrorBoundary/index.d.ts +2 -0
- package/components/Onboarding/ui/OnboardingContainer/OnboardingErrorBoundary/index.js +1 -0
- package/components/Onboarding/ui/OnboardingContainer/index.d.ts +1 -0
- package/components/Onboarding/ui/OnboardingContainer/index.js +1 -0
- package/components/Onboarding/ui/OnboardingContainer/useLogic/index.d.ts +1 -0
- package/components/Onboarding/ui/OnboardingContainer/useLogic/index.js +1 -0
- package/components/Onboarding/ui/OnboardingContainer/useLogic/useLogic.d.ts +10 -0
- package/components/Onboarding/ui/OnboardingContainer/useLogic/useLogic.js +14 -0
- package/components/Onboarding/ui/Overlay/Overlay.d.ts +29 -0
- package/components/Onboarding/ui/Overlay/Overlay.js +24 -0
- package/components/Onboarding/ui/Overlay/constants.d.ts +7 -0
- package/components/Onboarding/ui/Overlay/constants.js +8 -0
- package/components/Onboarding/ui/Overlay/index.d.ts +2 -0
- package/components/Onboarding/ui/Overlay/index.js +1 -0
- package/components/Onboarding/ui/Overlay/styles.d.ts +22 -0
- package/components/Onboarding/ui/Overlay/styles.js +57 -0
- package/components/Onboarding/ui/Overlay/useLogic/index.d.ts +1 -0
- package/components/Onboarding/ui/Overlay/useLogic/index.js +1 -0
- package/components/Onboarding/ui/Overlay/useLogic/useLogic.d.ts +13 -0
- package/components/Onboarding/ui/Overlay/useLogic/useLogic.js +10 -0
- package/components/Onboarding/ui/StepStrategy/StepStrategy.d.ts +6 -0
- package/components/Onboarding/ui/StepStrategy/StepStrategy.js +17 -0
- package/components/Onboarding/ui/StepStrategy/index.d.ts +1 -0
- package/components/Onboarding/ui/StepStrategy/index.js +1 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/HighlightStep.d.ts +6 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/HighlightStep.js +19 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/index.d.ts +2 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/index.js +1 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/styles.d.ts +25 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/styles.js +56 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/useLogic/index.d.ts +1 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/useLogic/index.js +1 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/useLogic/useLogic.d.ts +12 -0
- package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/useLogic/useLogic.js +37 -0
- package/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/StandaloneStep.d.ts +6 -0
- package/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/StandaloneStep.js +11 -0
- package/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/index.d.ts +2 -0
- package/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/index.js +1 -0
- package/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/styles.d.ts +13 -0
- package/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/styles.js +9 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/ProgressDots.d.ts +6 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/ProgressDots.js +15 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/constants.d.ts +4 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/constants.js +5 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/index.d.ts +2 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/index.js +1 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/styles.d.ts +9 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/styles.js +34 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/StepFooter.d.ts +9 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/StepFooter.js +18 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/constants.d.ts +4 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/constants.js +4 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/index.d.ts +2 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/index.js +1 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/styles.d.ts +21 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/styles.js +28 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/useLogic/index.d.ts +1 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/useLogic/index.js +1 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/useLogic/useLogic.d.ts +16 -0
- package/components/Onboarding/ui/StepStrategy/steps/StepFooter/useLogic/useLogic.js +22 -0
- package/components/Onboarding/ui/StepStrategy/steps/types.d.ts +16 -0
- package/components/Onboarding/ui/StepStrategy/steps/types.js +1 -0
- package/components/Onboarding/ui/StepStrategy/useLogic/index.d.ts +1 -0
- package/components/Onboarding/ui/StepStrategy/useLogic/index.js +1 -0
- package/components/Onboarding/ui/StepStrategy/useLogic/useLogic.d.ts +47 -0
- package/components/Onboarding/ui/StepStrategy/useLogic/useLogic.js +51 -0
- package/components/Onboarding/ui/hooks/useActiveStep/index.d.ts +1 -0
- package/components/Onboarding/ui/hooks/useActiveStep/index.js +1 -0
- package/components/Onboarding/ui/hooks/useActiveStep/useActiveStep.d.ts +6 -0
- package/components/Onboarding/ui/hooks/useActiveStep/useActiveStep.js +7 -0
- package/components/Onboarding/ui/hooks/useDelayedActiveStep/index.d.ts +1 -0
- package/components/Onboarding/ui/hooks/useDelayedActiveStep/index.js +1 -0
- package/components/Onboarding/ui/hooks/useDelayedActiveStep/useDelayedActiveStep.d.ts +15 -0
- package/components/Onboarding/ui/hooks/useDelayedActiveStep/useDelayedActiveStep.js +19 -0
- package/components/Onboarding/ui/hooks/useFocusTrap/index.d.ts +1 -0
- package/components/Onboarding/ui/hooks/useFocusTrap/index.js +1 -0
- package/components/Onboarding/ui/hooks/useFocusTrap/useFocusTrap.d.ts +6 -0
- package/components/Onboarding/ui/hooks/useFocusTrap/useFocusTrap.js +33 -0
- package/components/Onboarding/ui/hooks/useKeyboardNav/index.d.ts +1 -0
- package/components/Onboarding/ui/hooks/useKeyboardNav/index.js +1 -0
- package/components/Onboarding/ui/hooks/useKeyboardNav/useKeyboardNav.d.ts +11 -0
- package/components/Onboarding/ui/hooks/useKeyboardNav/useKeyboardNav.js +62 -0
- package/components/Onboarding/ui/hooks/useStepTransition/index.d.ts +1 -0
- package/components/Onboarding/ui/hooks/useStepTransition/index.js +1 -0
- package/components/Onboarding/ui/hooks/useStepTransition/useStepTransition.d.ts +30 -0
- package/components/Onboarding/ui/hooks/useStepTransition/useStepTransition.js +46 -0
- package/components/Onboarding/ui/hooks/useTargetAnchor/index.d.ts +1 -0
- package/components/Onboarding/ui/hooks/useTargetAnchor/index.js +1 -0
- package/components/Onboarding/ui/hooks/useTargetAnchor/useTargetAnchor.d.ts +37 -0
- package/components/Onboarding/ui/hooks/useTargetAnchor/useTargetAnchor.js +56 -0
- package/components/Onboarding/ui/hooks/useTrackedRect/index.d.ts +1 -0
- package/components/Onboarding/ui/hooks/useTrackedRect/index.js +1 -0
- package/components/Onboarding/ui/hooks/useTrackedRect/useTrackedRect.d.ts +5 -0
- package/components/Onboarding/ui/hooks/useTrackedRect/useTrackedRect.js +43 -0
- package/components/Onboarding/ui/hooks/useViewportSize/index.d.ts +1 -0
- package/components/Onboarding/ui/hooks/useViewportSize/index.js +1 -0
- package/components/Onboarding/ui/hooks/useViewportSize/useViewportSize.d.ts +5 -0
- package/components/Onboarding/ui/hooks/useViewportSize/useViewportSize.js +14 -0
- package/components/Onboarding/ui/styles.d.ts +5 -0
- package/components/Onboarding/ui/styles.js +15 -0
- package/components/Onboarding/utils/createVirtualAnchor/createVirtualAnchor.d.ts +12 -0
- package/components/Onboarding/utils/createVirtualAnchor/createVirtualAnchor.js +6 -0
- package/components/Onboarding/utils/createVirtualAnchor/index.d.ts +1 -0
- package/components/Onboarding/utils/createVirtualAnchor/index.js +1 -0
- package/components/Onboarding/utils/geometry/index.d.ts +4 -0
- package/components/Onboarding/utils/geometry/index.js +4 -0
- package/components/Onboarding/utils/geometry/overlayPath/index.d.ts +1 -0
- package/components/Onboarding/utils/geometry/overlayPath/index.js +1 -0
- package/components/Onboarding/utils/geometry/overlayPath/overlayPath.d.ts +6 -0
- package/components/Onboarding/utils/geometry/overlayPath/overlayPath.js +29 -0
- package/components/Onboarding/utils/geometry/parseOffset/index.d.ts +1 -0
- package/components/Onboarding/utils/geometry/parseOffset/index.js +1 -0
- package/components/Onboarding/utils/geometry/parseOffset/parseOffset.d.ts +4 -0
- package/components/Onboarding/utils/geometry/parseOffset/parseOffset.js +5 -0
- package/components/Onboarding/utils/geometry/rect/index.d.ts +2 -0
- package/components/Onboarding/utils/geometry/rect/index.js +1 -0
- package/components/Onboarding/utils/geometry/rect/rect.d.ts +34 -0
- package/components/Onboarding/utils/geometry/rect/rect.js +60 -0
- package/components/Onboarding/utils/geometry/viewport/index.d.ts +2 -0
- package/components/Onboarding/utils/geometry/viewport/index.js +1 -0
- package/components/Onboarding/utils/geometry/viewport/viewport.d.ts +14 -0
- package/components/Onboarding/utils/geometry/viewport/viewport.js +10 -0
- package/components/Onboarding/utils/getScrollParents/getScrollParents.d.ts +7 -0
- package/components/Onboarding/utils/getScrollParents/getScrollParents.js +24 -0
- package/components/Onboarding/utils/getScrollParents/index.d.ts +1 -0
- package/components/Onboarding/utils/getScrollParents/index.js +1 -0
- package/components/Onboarding/utils/getTargetElement/getTargetElement.d.ts +4 -0
- package/components/Onboarding/utils/getTargetElement/getTargetElement.js +9 -0
- package/components/Onboarding/utils/getTargetElement/index.d.ts +1 -0
- package/components/Onboarding/utils/getTargetElement/index.js +1 -0
- package/components/Onboarding/utils/observeRemoval/index.d.ts +1 -0
- package/components/Onboarding/utils/observeRemoval/index.js +1 -0
- package/components/Onboarding/utils/observeRemoval/observeRemoval.d.ts +4 -0
- package/components/Onboarding/utils/observeRemoval/observeRemoval.js +13 -0
- package/components/Onboarding/utils/scrollIntoView/index.d.ts +1 -0
- package/components/Onboarding/utils/scrollIntoView/index.js +1 -0
- package/components/Onboarding/utils/scrollIntoView/scrollIntoView.d.ts +13 -0
- package/components/Onboarding/utils/scrollIntoView/scrollIntoView.js +85 -0
- package/components/Onboarding/utils/waitForElement/index.d.ts +2 -0
- package/components/Onboarding/utils/waitForElement/index.js +1 -0
- package/components/Onboarding/utils/waitForElement/waitForElement.d.ts +21 -0
- package/components/Onboarding/utils/waitForElement/waitForElement.js +45 -0
- package/components/Onboarding/validation/index.d.ts +1 -0
- package/components/Onboarding/validation/index.js +1 -0
- package/components/Onboarding/validation/validateTourConfig/index.d.ts +1 -0
- package/components/Onboarding/validation/validateTourConfig/index.js +1 -0
- package/components/Onboarding/validation/validateTourConfig/validateTourConfig.d.ts +12 -0
- package/components/Onboarding/validation/validateTourConfig/validateTourConfig.js +52 -0
- package/node/_mocks/LoggerMock/LoggerMock.d.ts +16 -0
- package/node/_mocks/LoggerMock/LoggerMock.js +23 -0
- package/node/_mocks/LoggerMock/index.d.ts +1 -0
- package/node/_mocks/LoggerMock/index.js +17 -0
- package/node/components/ConfigProvider/ConfigProvider.d.ts +7 -1
- package/node/components/ConfigProvider/ConfigProvider.js +13 -7
- package/node/components/ConfirmDialog/ConfirmDialog.js +3 -1
- package/node/components/ConfirmDialog/constants.d.ts +4 -0
- package/node/components/ConfirmDialog/constants.js +8 -0
- package/node/components/ConfirmDialog/index.d.ts +1 -0
- package/node/components/ConfirmDialog/index.js +3 -0
- package/node/components/ConfirmDialog/public.d.ts +1 -0
- package/node/components/ConfirmDialog/public.js +3 -0
- package/node/components/ConfirmDialog/types.d.ts +1 -1
- package/node/components/DashboardLayout/Header/useLogic/useLogic.d.ts +1 -1
- package/node/components/NewPopover/NewPopover.d.ts +1 -1
- package/node/components/NewPopover/NewPopover.js +12 -3
- package/node/components/NewPopover/constants.d.ts +7 -0
- package/node/components/NewPopover/constants.js +12 -1
- package/node/components/NewPopover/styles.d.ts +4 -0
- package/node/components/NewPopover/styles.js +101 -5
- package/node/components/NewPopover/types.d.ts +13 -0
- package/node/components/NewPopover/useLogic/useLogic.d.ts +7 -3
- package/node/components/NewPopover/useLogic/useLogic.js +15 -1
- package/node/components/Onboarding/Onboarding.d.ts +35 -0
- package/node/components/Onboarding/Onboarding.js +61 -0
- package/node/components/Onboarding/constants.d.ts +34 -0
- package/node/components/Onboarding/constants.js +37 -0
- package/node/components/Onboarding/core/ActiveStepStore/ActiveStepStore.d.ts +50 -0
- package/node/components/Onboarding/core/ActiveStepStore/ActiveStepStore.js +67 -0
- package/node/components/Onboarding/core/ActiveStepStore/index.d.ts +1 -0
- package/node/components/Onboarding/core/ActiveStepStore/index.js +17 -0
- package/node/components/Onboarding/core/ExitController/ExitController.d.ts +48 -0
- package/node/components/Onboarding/core/ExitController/ExitController.js +63 -0
- package/node/components/Onboarding/core/ExitController/index.d.ts +1 -0
- package/node/components/Onboarding/core/ExitController/index.js +17 -0
- package/node/components/Onboarding/core/OnboardingTour/OnboardingTour.d.ts +103 -0
- package/node/components/Onboarding/core/OnboardingTour/OnboardingTour.js +287 -0
- package/node/components/Onboarding/core/OnboardingTour/index.d.ts +1 -0
- package/node/components/Onboarding/core/OnboardingTour/index.js +5 -0
- package/node/components/Onboarding/core/ProgressStorage/ProgressStorage.d.ts +24 -0
- package/node/components/Onboarding/core/ProgressStorage/ProgressStorage.js +66 -0
- package/node/components/Onboarding/core/ProgressStorage/index.d.ts +1 -0
- package/node/components/Onboarding/core/ProgressStorage/index.js +17 -0
- package/node/components/Onboarding/core/StepNavigator/StepNavigator.d.ts +28 -0
- package/node/components/Onboarding/core/StepNavigator/StepNavigator.js +77 -0
- package/node/components/Onboarding/core/StepNavigator/index.d.ts +1 -0
- package/node/components/Onboarding/core/StepNavigator/index.js +17 -0
- package/node/components/Onboarding/core/StepResolver/StepResolver.d.ts +19 -0
- package/node/components/Onboarding/core/StepResolver/StepResolver.js +53 -0
- package/node/components/Onboarding/core/StepResolver/index.d.ts +1 -0
- package/node/components/Onboarding/core/StepResolver/index.js +17 -0
- package/node/components/Onboarding/core/StepsController/StepsController.d.ts +16 -0
- package/node/components/Onboarding/core/StepsController/StepsController.js +39 -0
- package/node/components/Onboarding/core/StepsController/index.d.ts +1 -0
- package/node/components/Onboarding/core/StepsController/index.js +17 -0
- package/node/components/Onboarding/faker.d.ts +27 -0
- package/node/components/Onboarding/faker.js +88 -0
- package/node/components/Onboarding/index.d.ts +5 -0
- package/node/components/Onboarding/index.js +9 -0
- package/node/components/Onboarding/public.d.ts +5 -0
- package/node/components/Onboarding/public.js +9 -0
- package/node/components/Onboarding/services/LocalStorageSaveStrategy/LocalStorageSaveStrategy.d.ts +20 -0
- package/node/components/Onboarding/services/LocalStorageSaveStrategy/LocalStorageSaveStrategy.js +29 -0
- package/node/components/Onboarding/services/LocalStorageSaveStrategy/index.d.ts +1 -0
- package/node/components/Onboarding/services/LocalStorageSaveStrategy/index.js +17 -0
- package/node/components/Onboarding/types/config.d.ts +18 -0
- package/node/components/Onboarding/types/config.js +2 -0
- package/node/components/Onboarding/types/index.d.ts +4 -0
- package/node/components/Onboarding/types/index.js +20 -0
- package/node/components/Onboarding/types/progress.d.ts +28 -0
- package/node/components/Onboarding/types/progress.js +2 -0
- package/node/components/Onboarding/types/step.d.ts +144 -0
- package/node/components/Onboarding/types/step.js +2 -0
- package/node/components/Onboarding/types/tour.d.ts +168 -0
- package/node/components/Onboarding/types/tour.js +2 -0
- package/node/components/Onboarding/ui/ConfirmExit/ConfirmExit.d.ts +10 -0
- package/node/components/Onboarding/ui/ConfirmExit/ConfirmExit.js +10 -0
- package/node/components/Onboarding/ui/ConfirmExit/index.d.ts +2 -0
- package/node/components/Onboarding/ui/ConfirmExit/index.js +5 -0
- package/node/components/Onboarding/ui/ConfirmExit/styles.d.ts +30 -0
- package/node/components/Onboarding/ui/ConfirmExit/styles.js +14 -0
- package/node/components/Onboarding/ui/OnboardingContainer/OnboardingContainer.d.ts +12 -0
- package/node/components/Onboarding/ui/OnboardingContainer/OnboardingContainer.js +19 -0
- package/node/components/Onboarding/ui/OnboardingContainer/OnboardingErrorBoundary/OnboardingErrorBoundary.d.ts +22 -0
- package/node/components/Onboarding/ui/OnboardingContainer/OnboardingErrorBoundary/OnboardingErrorBoundary.js +24 -0
- package/node/components/Onboarding/ui/OnboardingContainer/OnboardingErrorBoundary/index.d.ts +2 -0
- package/node/components/Onboarding/ui/OnboardingContainer/OnboardingErrorBoundary/index.js +5 -0
- package/node/components/Onboarding/ui/OnboardingContainer/index.d.ts +1 -0
- package/node/components/Onboarding/ui/OnboardingContainer/index.js +5 -0
- package/node/components/Onboarding/ui/OnboardingContainer/useLogic/index.d.ts +1 -0
- package/node/components/Onboarding/ui/OnboardingContainer/useLogic/index.js +5 -0
- package/node/components/Onboarding/ui/OnboardingContainer/useLogic/useLogic.d.ts +10 -0
- package/node/components/Onboarding/ui/OnboardingContainer/useLogic/useLogic.js +18 -0
- package/node/components/Onboarding/ui/Overlay/Overlay.d.ts +29 -0
- package/node/components/Onboarding/ui/Overlay/Overlay.js +28 -0
- package/node/components/Onboarding/ui/Overlay/constants.d.ts +7 -0
- package/node/components/Onboarding/ui/Overlay/constants.js +11 -0
- package/node/components/Onboarding/ui/Overlay/index.d.ts +2 -0
- package/node/components/Onboarding/ui/Overlay/index.js +5 -0
- package/node/components/Onboarding/ui/Overlay/styles.d.ts +22 -0
- package/node/components/Onboarding/ui/Overlay/styles.js +60 -0
- package/node/components/Onboarding/ui/Overlay/useLogic/index.d.ts +1 -0
- package/node/components/Onboarding/ui/Overlay/useLogic/index.js +5 -0
- package/node/components/Onboarding/ui/Overlay/useLogic/useLogic.d.ts +13 -0
- package/node/components/Onboarding/ui/Overlay/useLogic/useLogic.js +14 -0
- package/node/components/Onboarding/ui/StepStrategy/StepStrategy.d.ts +6 -0
- package/node/components/Onboarding/ui/StepStrategy/StepStrategy.js +21 -0
- package/node/components/Onboarding/ui/StepStrategy/index.d.ts +1 -0
- package/node/components/Onboarding/ui/StepStrategy/index.js +17 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/HighlightStep.d.ts +6 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/HighlightStep.js +23 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/index.d.ts +2 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/index.js +5 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/styles.d.ts +25 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/styles.js +59 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/useLogic/index.d.ts +1 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/useLogic/index.js +5 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/useLogic/useLogic.d.ts +12 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/useLogic/useLogic.js +41 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/StandaloneStep.d.ts +6 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/StandaloneStep.js +15 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/index.d.ts +2 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/index.js +5 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/styles.d.ts +13 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/styles.js +12 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/ProgressDots.d.ts +6 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/ProgressDots.js +19 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/constants.d.ts +4 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/constants.js +8 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/index.d.ts +2 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/index.js +5 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/styles.d.ts +9 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/ProgressDots/styles.js +37 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/StepFooter.d.ts +9 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/StepFooter.js +22 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/constants.d.ts +4 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/constants.js +7 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/index.d.ts +2 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/index.js +5 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/styles.d.ts +21 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/styles.js +31 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/useLogic/index.d.ts +1 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/useLogic/index.js +5 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/useLogic/useLogic.d.ts +16 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/StepFooter/useLogic/useLogic.js +26 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/types.d.ts +16 -0
- package/node/components/Onboarding/ui/StepStrategy/steps/types.js +2 -0
- package/node/components/Onboarding/ui/StepStrategy/useLogic/index.d.ts +1 -0
- package/node/components/Onboarding/ui/StepStrategy/useLogic/index.js +5 -0
- package/node/components/Onboarding/ui/StepStrategy/useLogic/useLogic.d.ts +47 -0
- package/node/components/Onboarding/ui/StepStrategy/useLogic/useLogic.js +55 -0
- package/node/components/Onboarding/ui/hooks/useActiveStep/index.d.ts +1 -0
- package/node/components/Onboarding/ui/hooks/useActiveStep/index.js +5 -0
- package/node/components/Onboarding/ui/hooks/useActiveStep/useActiveStep.d.ts +6 -0
- package/node/components/Onboarding/ui/hooks/useActiveStep/useActiveStep.js +11 -0
- package/node/components/Onboarding/ui/hooks/useDelayedActiveStep/index.d.ts +1 -0
- package/node/components/Onboarding/ui/hooks/useDelayedActiveStep/index.js +17 -0
- package/node/components/Onboarding/ui/hooks/useDelayedActiveStep/useDelayedActiveStep.d.ts +15 -0
- package/node/components/Onboarding/ui/hooks/useDelayedActiveStep/useDelayedActiveStep.js +23 -0
- package/node/components/Onboarding/ui/hooks/useFocusTrap/index.d.ts +1 -0
- package/node/components/Onboarding/ui/hooks/useFocusTrap/index.js +5 -0
- package/node/components/Onboarding/ui/hooks/useFocusTrap/useFocusTrap.d.ts +6 -0
- package/node/components/Onboarding/ui/hooks/useFocusTrap/useFocusTrap.js +37 -0
- package/node/components/Onboarding/ui/hooks/useKeyboardNav/index.d.ts +1 -0
- package/node/components/Onboarding/ui/hooks/useKeyboardNav/index.js +5 -0
- package/node/components/Onboarding/ui/hooks/useKeyboardNav/useKeyboardNav.d.ts +11 -0
- package/node/components/Onboarding/ui/hooks/useKeyboardNav/useKeyboardNav.js +66 -0
- package/node/components/Onboarding/ui/hooks/useStepTransition/index.d.ts +1 -0
- package/node/components/Onboarding/ui/hooks/useStepTransition/index.js +5 -0
- package/node/components/Onboarding/ui/hooks/useStepTransition/useStepTransition.d.ts +30 -0
- package/node/components/Onboarding/ui/hooks/useStepTransition/useStepTransition.js +50 -0
- package/node/components/Onboarding/ui/hooks/useTargetAnchor/index.d.ts +1 -0
- package/node/components/Onboarding/ui/hooks/useTargetAnchor/index.js +17 -0
- package/node/components/Onboarding/ui/hooks/useTargetAnchor/useTargetAnchor.d.ts +37 -0
- package/node/components/Onboarding/ui/hooks/useTargetAnchor/useTargetAnchor.js +60 -0
- package/node/components/Onboarding/ui/hooks/useTrackedRect/index.d.ts +1 -0
- package/node/components/Onboarding/ui/hooks/useTrackedRect/index.js +5 -0
- package/node/components/Onboarding/ui/hooks/useTrackedRect/useTrackedRect.d.ts +5 -0
- package/node/components/Onboarding/ui/hooks/useTrackedRect/useTrackedRect.js +47 -0
- package/node/components/Onboarding/ui/hooks/useViewportSize/index.d.ts +1 -0
- package/node/components/Onboarding/ui/hooks/useViewportSize/index.js +5 -0
- package/node/components/Onboarding/ui/hooks/useViewportSize/useViewportSize.d.ts +5 -0
- package/node/components/Onboarding/ui/hooks/useViewportSize/useViewportSize.js +18 -0
- package/node/components/Onboarding/ui/styles.d.ts +5 -0
- package/node/components/Onboarding/ui/styles.js +19 -0
- package/node/components/Onboarding/utils/createVirtualAnchor/createVirtualAnchor.d.ts +12 -0
- package/node/components/Onboarding/utils/createVirtualAnchor/createVirtualAnchor.js +10 -0
- package/node/components/Onboarding/utils/createVirtualAnchor/index.d.ts +1 -0
- package/node/components/Onboarding/utils/createVirtualAnchor/index.js +17 -0
- package/node/components/Onboarding/utils/geometry/index.d.ts +4 -0
- package/node/components/Onboarding/utils/geometry/index.js +20 -0
- package/node/components/Onboarding/utils/geometry/overlayPath/index.d.ts +1 -0
- package/node/components/Onboarding/utils/geometry/overlayPath/index.js +5 -0
- package/node/components/Onboarding/utils/geometry/overlayPath/overlayPath.d.ts +6 -0
- package/node/components/Onboarding/utils/geometry/overlayPath/overlayPath.js +33 -0
- package/node/components/Onboarding/utils/geometry/parseOffset/index.d.ts +1 -0
- package/node/components/Onboarding/utils/geometry/parseOffset/index.js +5 -0
- package/node/components/Onboarding/utils/geometry/parseOffset/parseOffset.d.ts +4 -0
- package/node/components/Onboarding/utils/geometry/parseOffset/parseOffset.js +9 -0
- package/node/components/Onboarding/utils/geometry/rect/index.d.ts +2 -0
- package/node/components/Onboarding/utils/geometry/rect/index.js +9 -0
- package/node/components/Onboarding/utils/geometry/rect/rect.d.ts +34 -0
- package/node/components/Onboarding/utils/geometry/rect/rect.js +69 -0
- package/node/components/Onboarding/utils/geometry/viewport/index.d.ts +2 -0
- package/node/components/Onboarding/utils/geometry/viewport/index.js +5 -0
- package/node/components/Onboarding/utils/geometry/viewport/viewport.d.ts +14 -0
- package/node/components/Onboarding/utils/geometry/viewport/viewport.js +14 -0
- package/node/components/Onboarding/utils/getScrollParents/getScrollParents.d.ts +7 -0
- package/node/components/Onboarding/utils/getScrollParents/getScrollParents.js +28 -0
- package/node/components/Onboarding/utils/getScrollParents/index.d.ts +1 -0
- package/node/components/Onboarding/utils/getScrollParents/index.js +5 -0
- package/node/components/Onboarding/utils/getTargetElement/getTargetElement.d.ts +4 -0
- package/node/components/Onboarding/utils/getTargetElement/getTargetElement.js +13 -0
- package/node/components/Onboarding/utils/getTargetElement/index.d.ts +1 -0
- package/node/components/Onboarding/utils/getTargetElement/index.js +5 -0
- package/node/components/Onboarding/utils/observeRemoval/index.d.ts +1 -0
- package/node/components/Onboarding/utils/observeRemoval/index.js +17 -0
- package/node/components/Onboarding/utils/observeRemoval/observeRemoval.d.ts +4 -0
- package/node/components/Onboarding/utils/observeRemoval/observeRemoval.js +17 -0
- package/node/components/Onboarding/utils/scrollIntoView/index.d.ts +1 -0
- package/node/components/Onboarding/utils/scrollIntoView/index.js +5 -0
- package/node/components/Onboarding/utils/scrollIntoView/scrollIntoView.d.ts +13 -0
- package/node/components/Onboarding/utils/scrollIntoView/scrollIntoView.js +89 -0
- package/node/components/Onboarding/utils/waitForElement/index.d.ts +2 -0
- package/node/components/Onboarding/utils/waitForElement/index.js +5 -0
- package/node/components/Onboarding/utils/waitForElement/waitForElement.d.ts +21 -0
- package/node/components/Onboarding/utils/waitForElement/waitForElement.js +49 -0
- package/node/components/Onboarding/validation/index.d.ts +1 -0
- package/node/components/Onboarding/validation/index.js +6 -0
- package/node/components/Onboarding/validation/validateTourConfig/index.d.ts +1 -0
- package/node/components/Onboarding/validation/validateTourConfig/index.js +6 -0
- package/node/components/Onboarding/validation/validateTourConfig/validateTourConfig.d.ts +12 -0
- package/node/components/Onboarding/validation/validateTourConfig/validateTourConfig.js +80 -0
- package/node/services/Logger/Logger.d.ts +45 -0
- package/node/services/Logger/Logger.js +72 -0
- package/node/services/Logger/index.d.ts +10 -0
- package/node/services/Logger/index.js +17 -0
- package/package.json +3 -2
- package/services/Logger/Logger.d.ts +45 -0
- package/services/Logger/Logger.js +68 -0
- package/services/Logger/index.d.ts +10 -0
- package/services/Logger/index.js +12 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type ActiveStepState } from '../../types';
|
|
2
|
+
type Listener = VoidFunction;
|
|
3
|
+
/**
|
|
4
|
+
* Ссылка на тур, которую держит store: по ней он опознаёт владельца слота
|
|
5
|
+
* (сравнение по идентичности экземпляра, а не по имени) и может закрыть тур.
|
|
6
|
+
*/
|
|
7
|
+
export type TourHandle = {
|
|
8
|
+
/**
|
|
9
|
+
* Закрытие тура штатным путём (используется `Onboarding.closeActiveTour`).
|
|
10
|
+
*/
|
|
11
|
+
close: () => void;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Store активного шага, связывающий туры с `<OnboardingContainer/>`.
|
|
15
|
+
*/
|
|
16
|
+
export declare class ActiveStepStore {
|
|
17
|
+
private activeStep;
|
|
18
|
+
private activeTour;
|
|
19
|
+
private readonly listeners;
|
|
20
|
+
subscribe: (listener: Listener) => () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Состояние активного шага (null — тур не показан).
|
|
23
|
+
*/
|
|
24
|
+
getActiveStep: () => ActiveStepState | null;
|
|
25
|
+
/**
|
|
26
|
+
* Публикует шаг тура и делает этот тур владельцем слота.
|
|
27
|
+
*/
|
|
28
|
+
setActiveStep: (step: ActiveStepState, tour: TourHandle) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Владеет ли слотом сейчас именно тур (пустой store — `false`).
|
|
31
|
+
*/
|
|
32
|
+
isActiveTour: (tour: TourHandle) => boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Показан ли сейчас шаг тура. Имена шагов могут совпадать
|
|
35
|
+
* в разных турах, поэтому проверяется и тур, и имя.
|
|
36
|
+
*/
|
|
37
|
+
isActiveStep: (tour: TourHandle, stepName: string) => boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Освобождает слот, если тур сейчас его владелец.
|
|
40
|
+
*/
|
|
41
|
+
release: (tour: TourHandle) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Закрытие активного тура обычным путём.
|
|
44
|
+
* Внешний триггер: размонтирование онбординга, смена юзера.
|
|
45
|
+
*/
|
|
46
|
+
closeActiveTour: () => void;
|
|
47
|
+
private clear;
|
|
48
|
+
private emit;
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store активного шага, связывающий туры с `<OnboardingContainer/>`.
|
|
3
|
+
*/
|
|
4
|
+
export class ActiveStepStore {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.activeStep = null;
|
|
7
|
+
this.activeTour = null;
|
|
8
|
+
this.listeners = new Set();
|
|
9
|
+
this.subscribe = (listener) => {
|
|
10
|
+
this.listeners.add(listener);
|
|
11
|
+
return () => {
|
|
12
|
+
this.listeners.delete(listener);
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Состояние активного шага (null — тур не показан).
|
|
17
|
+
*/
|
|
18
|
+
this.getActiveStep = () => this.activeStep;
|
|
19
|
+
/**
|
|
20
|
+
* Публикует шаг тура и делает этот тур владельцем слота.
|
|
21
|
+
*/
|
|
22
|
+
this.setActiveStep = (step, tour) => {
|
|
23
|
+
this.activeStep = step;
|
|
24
|
+
this.activeTour = tour;
|
|
25
|
+
this.emit();
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Владеет ли слотом сейчас именно тур (пустой store — `false`).
|
|
29
|
+
*/
|
|
30
|
+
this.isActiveTour = (tour) => this.activeTour === tour;
|
|
31
|
+
/**
|
|
32
|
+
* Показан ли сейчас шаг тура. Имена шагов могут совпадать
|
|
33
|
+
* в разных турах, поэтому проверяется и тур, и имя.
|
|
34
|
+
*/
|
|
35
|
+
this.isActiveStep = (tour, stepName) => this.isActiveTour(tour) && this.activeStep?.step.name === stepName;
|
|
36
|
+
/**
|
|
37
|
+
* Освобождает слот, если тур сейчас его владелец.
|
|
38
|
+
*/
|
|
39
|
+
this.release = (tour) => {
|
|
40
|
+
if (this.isActiveTour(tour)) {
|
|
41
|
+
this.clear();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Закрытие активного тура обычным путём.
|
|
46
|
+
* Внешний триггер: размонтирование онбординга, смена юзера.
|
|
47
|
+
*/
|
|
48
|
+
this.closeActiveTour = () => {
|
|
49
|
+
this.activeTour?.close();
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
clear() {
|
|
53
|
+
if (this.activeStep === null) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
this.activeStep = null;
|
|
57
|
+
this.activeTour = null;
|
|
58
|
+
this.emit();
|
|
59
|
+
}
|
|
60
|
+
emit() {
|
|
61
|
+
this.listeners.forEach((listener) => listener());
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ActiveStepStore';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ActiveStepStore';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type Logger } from '../../../../services/Logger';
|
|
2
|
+
export type ExitControllerParams = {
|
|
3
|
+
/**
|
|
4
|
+
* Фактическое закрытие тура. Вызывается только после подтверждения в
|
|
5
|
+
* ConfirmExit, поэтому всегда означает пользовательский выход (тур помечается
|
|
6
|
+
* прерванным).
|
|
7
|
+
*/
|
|
8
|
+
close: () => void;
|
|
9
|
+
/**
|
|
10
|
+
* Уведомить о смене состояния (перерисовать активный шаг) — например, чтобы
|
|
11
|
+
* показать/скрыть ConfirmExit.
|
|
12
|
+
*/
|
|
13
|
+
onChange: () => void;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Единая точка выхода из тура.
|
|
17
|
+
*
|
|
18
|
+
* Все пути закрытия (Esc, клик по overlay, крестик, клик мимо) идут через
|
|
19
|
+
* requestClose и всегда требуют подтверждение
|
|
20
|
+
* (ConfirmExit); закрытие происходит только по confirm.
|
|
21
|
+
*/
|
|
22
|
+
export declare class ExitController {
|
|
23
|
+
private readonly params;
|
|
24
|
+
private readonly logger;
|
|
25
|
+
private confirming;
|
|
26
|
+
constructor(params: ExitControllerParams, logger: Logger);
|
|
27
|
+
/**
|
|
28
|
+
* Идёт ли запрос подтверждения выхода.
|
|
29
|
+
*/
|
|
30
|
+
get isConfirming(): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Запрос на закрытие — показывает ConfirmExit. Повторные вызовы во время
|
|
33
|
+
* подтверждения игнорируются.
|
|
34
|
+
*/
|
|
35
|
+
requestClose: () => void;
|
|
36
|
+
/**
|
|
37
|
+
* Подтверждение выхода из ConfirmExit.
|
|
38
|
+
*/
|
|
39
|
+
confirm: () => void;
|
|
40
|
+
/**
|
|
41
|
+
* Отмена выхода — продолжаем тур.
|
|
42
|
+
*/
|
|
43
|
+
cancel: () => void;
|
|
44
|
+
/**
|
|
45
|
+
* Сброс состояния (при старте/закрытии тура).
|
|
46
|
+
*/
|
|
47
|
+
reset: () => void;
|
|
48
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Единая точка выхода из тура.
|
|
3
|
+
*
|
|
4
|
+
* Все пути закрытия (Esc, клик по overlay, крестик, клик мимо) идут через
|
|
5
|
+
* requestClose и всегда требуют подтверждение
|
|
6
|
+
* (ConfirmExit); закрытие происходит только по confirm.
|
|
7
|
+
*/
|
|
8
|
+
export class ExitController {
|
|
9
|
+
constructor(params, logger) {
|
|
10
|
+
this.params = params;
|
|
11
|
+
this.logger = logger;
|
|
12
|
+
this.confirming = false;
|
|
13
|
+
/**
|
|
14
|
+
* Запрос на закрытие — показывает ConfirmExit. Повторные вызовы во время
|
|
15
|
+
* подтверждения игнорируются.
|
|
16
|
+
*/
|
|
17
|
+
this.requestClose = () => {
|
|
18
|
+
if (this.confirming) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
this.logger.debug('Запрошен выход из тура, показано подтверждение');
|
|
22
|
+
this.confirming = true;
|
|
23
|
+
this.params.onChange();
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Подтверждение выхода из ConfirmExit.
|
|
27
|
+
*/
|
|
28
|
+
this.confirm = () => {
|
|
29
|
+
if (!this.confirming) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this.confirming = false;
|
|
33
|
+
this.params.close();
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Отмена выхода — продолжаем тур.
|
|
37
|
+
*/
|
|
38
|
+
this.cancel = () => {
|
|
39
|
+
if (!this.confirming) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this.logger.debug('Выход из тура отменён');
|
|
43
|
+
this.confirming = false;
|
|
44
|
+
this.params.onChange();
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Сброс состояния (при старте/закрытии тура).
|
|
48
|
+
*/
|
|
49
|
+
this.reset = () => {
|
|
50
|
+
this.confirming = false;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Идёт ли запрос подтверждения выхода.
|
|
55
|
+
*/
|
|
56
|
+
get isConfirming() {
|
|
57
|
+
return this.confirming;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ExitController';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ExitController';
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { type Logger } from '../../../../services/Logger';
|
|
2
|
+
import { type ErrorService } from '../../../services/ErrorService';
|
|
3
|
+
import { type OnboardingTourConfig, type Step, type StepHandles, type TourProgress } from '../../types';
|
|
4
|
+
import { type ActiveStepStore } from '../ActiveStepStore';
|
|
5
|
+
import { type ProgressStorage } from '../ProgressStorage';
|
|
6
|
+
/**
|
|
7
|
+
* Управляющий объект одного тура: связывает навигацию (StepNavigator), разрешение
|
|
8
|
+
* значений шага (StepResolver), рантайм-переопределения (StepsController),
|
|
9
|
+
* выход (ExitController) и сохранение прогресса (ProgressStorage), публикуя
|
|
10
|
+
* состояние активного шага в store своего экземпляра онбординга.
|
|
11
|
+
*/
|
|
12
|
+
export declare class OnboardingTour<TSteps extends readonly Step[] = readonly Step[]> {
|
|
13
|
+
private readonly config;
|
|
14
|
+
private readonly progressStorage;
|
|
15
|
+
private readonly activeStepStore;
|
|
16
|
+
private readonly errorService;
|
|
17
|
+
private readonly logger;
|
|
18
|
+
private readonly navigator;
|
|
19
|
+
private readonly resolver;
|
|
20
|
+
private readonly stepsController;
|
|
21
|
+
private readonly exitController;
|
|
22
|
+
private status;
|
|
23
|
+
/**
|
|
24
|
+
* Типобезопасный доступ к шагам по их именам.
|
|
25
|
+
*/
|
|
26
|
+
readonly steps: StepHandles<TSteps>;
|
|
27
|
+
constructor(config: OnboardingTourConfig<TSteps>, progressStorage: ProgressStorage, activeStepStore: ActiveStepStore, errorService: ErrorService, logger: Logger);
|
|
28
|
+
/**
|
|
29
|
+
* Запуск тура с первого шага.
|
|
30
|
+
*/
|
|
31
|
+
start: () => Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Снимает паузу шага с `waitForResume`
|
|
34
|
+
*/
|
|
35
|
+
resume: () => void;
|
|
36
|
+
/**
|
|
37
|
+
* Показ тура из сохранённого прогресса по запросу пользователя
|
|
38
|
+
*/
|
|
39
|
+
restore: () => Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Переход к следующему шагу. На последнем шаге завершает тур.
|
|
42
|
+
*/
|
|
43
|
+
next: () => void;
|
|
44
|
+
/**
|
|
45
|
+
* Переход к предыдущему шагу.
|
|
46
|
+
*/
|
|
47
|
+
prev: () => void;
|
|
48
|
+
/**
|
|
49
|
+
* Переход к шагу по его позиции среди видимых шагов.
|
|
50
|
+
*/
|
|
51
|
+
goToPosition: (position: number) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Завершение тура: помечаем пройденным (`isCompleted`) и закрываем.
|
|
54
|
+
*/
|
|
55
|
+
finish: () => void;
|
|
56
|
+
/**
|
|
57
|
+
* Программное закрытие тура.
|
|
58
|
+
* В отличие от навигации работает в любом состоянии: закрывает и тур,
|
|
59
|
+
* ожидающий `resume()`.
|
|
60
|
+
*/
|
|
61
|
+
close: () => void;
|
|
62
|
+
/**
|
|
63
|
+
* Запрос выхода.
|
|
64
|
+
*/
|
|
65
|
+
private requestClose;
|
|
66
|
+
/**
|
|
67
|
+
* Сбрасывает сохранённый прогресс тура
|
|
68
|
+
* После сброса `start()` снова покажет тур с первого шага.
|
|
69
|
+
*/
|
|
70
|
+
resetProgress: () => Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Возвращает сохранённый прогресс тура
|
|
73
|
+
*/
|
|
74
|
+
getState: () => Promise<TourProgress | null>;
|
|
75
|
+
/**
|
|
76
|
+
* Разрешена ли навигация сейчас: тур показан на экране и владеет активным
|
|
77
|
+
* шагом store
|
|
78
|
+
*/
|
|
79
|
+
private canNavigate;
|
|
80
|
+
/**
|
|
81
|
+
* Единая точка закрытия тура
|
|
82
|
+
*/
|
|
83
|
+
private exit;
|
|
84
|
+
/**
|
|
85
|
+
* Переход к текущему шагу. Шаг с `waitForResume` ставит тур в ожидание
|
|
86
|
+
* и не отрисовывается до явного `resume()`.
|
|
87
|
+
*/
|
|
88
|
+
private enterCurrentStep;
|
|
89
|
+
/**
|
|
90
|
+
* Очищает store, только если активный шаг принадлежит именно этому туру.
|
|
91
|
+
*/
|
|
92
|
+
private releaseStep;
|
|
93
|
+
private handleError;
|
|
94
|
+
/**
|
|
95
|
+
* Публикует состояние текущего шага в store.
|
|
96
|
+
*/
|
|
97
|
+
private publishStep;
|
|
98
|
+
private buildActiveStep;
|
|
99
|
+
/**
|
|
100
|
+
* Перерисовывает шаг после изменения его override-содержимого
|
|
101
|
+
*/
|
|
102
|
+
private refreshStep;
|
|
103
|
+
}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { ExitController } from '../ExitController';
|
|
2
|
+
import { StepNavigator } from '../StepNavigator';
|
|
3
|
+
import { StepResolver } from '../StepResolver';
|
|
4
|
+
import { StepsController } from '../StepsController';
|
|
5
|
+
/**
|
|
6
|
+
* Управляющий объект одного тура: связывает навигацию (StepNavigator), разрешение
|
|
7
|
+
* значений шага (StepResolver), рантайм-переопределения (StepsController),
|
|
8
|
+
* выход (ExitController) и сохранение прогресса (ProgressStorage), публикуя
|
|
9
|
+
* состояние активного шага в store своего экземпляра онбординга.
|
|
10
|
+
*/
|
|
11
|
+
export class OnboardingTour {
|
|
12
|
+
constructor(config, progressStorage, activeStepStore, errorService, logger) {
|
|
13
|
+
this.config = config;
|
|
14
|
+
this.progressStorage = progressStorage;
|
|
15
|
+
this.activeStepStore = activeStepStore;
|
|
16
|
+
this.errorService = errorService;
|
|
17
|
+
this.logger = logger;
|
|
18
|
+
this.status = 'idle';
|
|
19
|
+
/**
|
|
20
|
+
* Запуск тура с первого шага.
|
|
21
|
+
*/
|
|
22
|
+
this.start = async () => {
|
|
23
|
+
const persisted = await this.progressStorage.load();
|
|
24
|
+
if (persisted?.isDismissed) {
|
|
25
|
+
this.logger.info('Тур пропущен: ранее закрыт пользователем');
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
this.logger.info('Тур запущен');
|
|
29
|
+
this.exitController.reset();
|
|
30
|
+
this.navigator.reset();
|
|
31
|
+
this.enterCurrentStep();
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Снимает паузу шага с `waitForResume`
|
|
35
|
+
*/
|
|
36
|
+
this.resume = () => {
|
|
37
|
+
if (this.status !== 'waiting-resume') {
|
|
38
|
+
this.logger.debug('resume проигнорирован: тур не на паузе');
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
this.logger.debug('Тур возобновлён после паузы');
|
|
42
|
+
this.status = 'running';
|
|
43
|
+
this.publishStep();
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Показ тура из сохранённого прогресса по запросу пользователя
|
|
47
|
+
*/
|
|
48
|
+
this.restore = async () => {
|
|
49
|
+
const persisted = await this.progressStorage.load();
|
|
50
|
+
this.logger.info('Тур восстановлен');
|
|
51
|
+
this.exitController.reset();
|
|
52
|
+
this.navigator.reset();
|
|
53
|
+
// Пройденный тур переигрываем с начала; иначе продолжаем с сохранённого шага.
|
|
54
|
+
if (persisted && !persisted.isCompleted) {
|
|
55
|
+
this.navigator.goToStep(persisted.lastStepName);
|
|
56
|
+
}
|
|
57
|
+
this.enterCurrentStep();
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Переход к следующему шагу. На последнем шаге завершает тур.
|
|
61
|
+
*/
|
|
62
|
+
this.next = () => {
|
|
63
|
+
if (!this.canNavigate()) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (this.navigator.hasNext) {
|
|
67
|
+
// Обратный вызов шага — только при реальном переходе (на последнем next = finish).
|
|
68
|
+
this.navigator.current.onNextClick?.();
|
|
69
|
+
this.navigator.next();
|
|
70
|
+
this.progressStorage.save({
|
|
71
|
+
lastStepName: this.navigator.current.name,
|
|
72
|
+
isCompleted: false,
|
|
73
|
+
isDismissed: false,
|
|
74
|
+
});
|
|
75
|
+
this.enterCurrentStep();
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
this.finish();
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Переход к предыдущему шагу.
|
|
83
|
+
*/
|
|
84
|
+
this.prev = () => {
|
|
85
|
+
if (!this.canNavigate()) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (this.navigator.hasPrev) {
|
|
89
|
+
// Обратный вызов шага — только при реальном переходе.
|
|
90
|
+
this.navigator.current.onPrevClick?.();
|
|
91
|
+
this.navigator.prev();
|
|
92
|
+
this.progressStorage.save({
|
|
93
|
+
lastStepName: this.navigator.current.name,
|
|
94
|
+
isCompleted: false,
|
|
95
|
+
isDismissed: false,
|
|
96
|
+
});
|
|
97
|
+
this.enterCurrentStep();
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Переход к шагу по его позиции среди видимых шагов.
|
|
102
|
+
*/
|
|
103
|
+
this.goToPosition = (position) => {
|
|
104
|
+
if (!this.canNavigate()) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const previous = this.navigator.position;
|
|
108
|
+
this.navigator.goToPosition(position);
|
|
109
|
+
if (this.navigator.position === previous) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
this.progressStorage.save({
|
|
113
|
+
lastStepName: this.navigator.current.name,
|
|
114
|
+
isCompleted: false,
|
|
115
|
+
isDismissed: false,
|
|
116
|
+
});
|
|
117
|
+
this.enterCurrentStep();
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Завершение тура: помечаем пройденным (`isCompleted`) и закрываем.
|
|
121
|
+
*/
|
|
122
|
+
this.finish = () => {
|
|
123
|
+
if (!this.canNavigate()) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
this.progressStorage.save({
|
|
127
|
+
lastStepName: this.navigator.current.name,
|
|
128
|
+
isCompleted: true,
|
|
129
|
+
isDismissed: true,
|
|
130
|
+
});
|
|
131
|
+
this.exit('completed');
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Программное закрытие тура.
|
|
135
|
+
* В отличие от навигации работает в любом состоянии: закрывает и тур,
|
|
136
|
+
* ожидающий `resume()`.
|
|
137
|
+
*/
|
|
138
|
+
this.close = () => {
|
|
139
|
+
this.exit('closed');
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Запрос выхода.
|
|
143
|
+
*/
|
|
144
|
+
this.requestClose = () => {
|
|
145
|
+
if (!this.navigator.hasNext) {
|
|
146
|
+
this.finish();
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
this.exitController.requestClose();
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Сбрасывает сохранённый прогресс тура
|
|
153
|
+
* После сброса `start()` снова покажет тур с первого шага.
|
|
154
|
+
*/
|
|
155
|
+
this.resetProgress = async () => {
|
|
156
|
+
await this.progressStorage.reset();
|
|
157
|
+
this.logger.debug('Прогресс тура сброшен');
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Возвращает сохранённый прогресс тура
|
|
161
|
+
*/
|
|
162
|
+
this.getState = () => this.progressStorage.load();
|
|
163
|
+
/**
|
|
164
|
+
* Единая точка закрытия тура
|
|
165
|
+
*/
|
|
166
|
+
this.exit = (reason) => {
|
|
167
|
+
if (this.status === 'idle') {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (reason === 'dismissed') {
|
|
171
|
+
this.progressStorage.save({
|
|
172
|
+
lastStepName: this.navigator.current.name,
|
|
173
|
+
isCompleted: false,
|
|
174
|
+
isDismissed: true,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
this.logger.info('Тур закрыт', { reason });
|
|
178
|
+
this.status = 'idle';
|
|
179
|
+
this.exitController.reset();
|
|
180
|
+
this.releaseStep();
|
|
181
|
+
this.config.onClose?.(reason);
|
|
182
|
+
};
|
|
183
|
+
this.handleError = (error) => {
|
|
184
|
+
this.logger.error('Ошибка тура', error);
|
|
185
|
+
this.errorService.captureException(error, {
|
|
186
|
+
place: 'Onboarding',
|
|
187
|
+
tourName: this.config.name,
|
|
188
|
+
step: this.navigator.current?.name,
|
|
189
|
+
});
|
|
190
|
+
this.config.onError?.(error);
|
|
191
|
+
this.exit('closed');
|
|
192
|
+
};
|
|
193
|
+
this.navigator = new StepNavigator(config.steps);
|
|
194
|
+
this.resolver = new StepResolver(config);
|
|
195
|
+
this.stepsController = new StepsController(config.steps, (stepName) => this.refreshStep(stepName));
|
|
196
|
+
this.steps = this.stepsController.handles;
|
|
197
|
+
const exitParams = {
|
|
198
|
+
close: () => this.exit('dismissed'),
|
|
199
|
+
onChange: () => this.publishStep(),
|
|
200
|
+
};
|
|
201
|
+
this.exitController = new ExitController(exitParams, this.logger);
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Разрешена ли навигация сейчас: тур показан на экране и владеет активным
|
|
205
|
+
* шагом store
|
|
206
|
+
*/
|
|
207
|
+
canNavigate() {
|
|
208
|
+
const isNavigable = this.status === 'running' && this.activeStepStore.isActiveTour(this);
|
|
209
|
+
if (!isNavigable) {
|
|
210
|
+
this.logger.debug('Навигация проигнорирована: тур неактивен');
|
|
211
|
+
}
|
|
212
|
+
return isNavigable;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Переход к текущему шагу. Шаг с `waitForResume` ставит тур в ожидание
|
|
216
|
+
* и не отрисовывается до явного `resume()`.
|
|
217
|
+
*/
|
|
218
|
+
enterCurrentStep() {
|
|
219
|
+
// Показывать нечего: у тура нет ни одного видимого (не-пропущенного) шага.
|
|
220
|
+
if (this.navigator.total === 0) {
|
|
221
|
+
this.logger.warn('Нет ни одного видимого шага, тур не показан');
|
|
222
|
+
this.status = 'idle';
|
|
223
|
+
this.releaseStep();
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
const step = this.navigator.current;
|
|
227
|
+
if (step.waitForResume) {
|
|
228
|
+
this.logger.debug('Ожидание resume', { step: step.name });
|
|
229
|
+
this.status = 'waiting-resume';
|
|
230
|
+
this.releaseStep();
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
this.logger.debug('Показан шаг', {
|
|
234
|
+
step: step.name,
|
|
235
|
+
position: this.navigator.position,
|
|
236
|
+
total: this.navigator.total,
|
|
237
|
+
});
|
|
238
|
+
this.status = 'running';
|
|
239
|
+
this.publishStep();
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Очищает store, только если активный шаг принадлежит именно этому туру.
|
|
243
|
+
*/
|
|
244
|
+
releaseStep() {
|
|
245
|
+
this.activeStepStore.release(this);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Публикует состояние текущего шага в store.
|
|
249
|
+
*/
|
|
250
|
+
publishStep() {
|
|
251
|
+
const current = this.navigator.current;
|
|
252
|
+
const step = this.resolver.resolve(current, this.stepsController.getOverride(current.name));
|
|
253
|
+
this.activeStepStore.setActiveStep(this.buildActiveStep(step), this);
|
|
254
|
+
}
|
|
255
|
+
buildActiveStep(step) {
|
|
256
|
+
return {
|
|
257
|
+
...this.resolver.resolvePresentation(),
|
|
258
|
+
tourName: this.config.name,
|
|
259
|
+
step,
|
|
260
|
+
position: this.navigator.position,
|
|
261
|
+
total: this.navigator.total,
|
|
262
|
+
hasNext: this.navigator.hasNext,
|
|
263
|
+
hasPrev: this.navigator.hasPrev,
|
|
264
|
+
isInteractive: this.resolver.resolveIsInteractive(step),
|
|
265
|
+
isConfirming: this.exitController.isConfirming,
|
|
266
|
+
onNext: this.next,
|
|
267
|
+
onPrev: this.prev,
|
|
268
|
+
onSelectStep: this.goToPosition,
|
|
269
|
+
requestClose: this.requestClose,
|
|
270
|
+
onConfirmExit: this.exitController.confirm,
|
|
271
|
+
onCancelExit: this.exitController.cancel,
|
|
272
|
+
onError: this.handleError,
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Перерисовывает шаг после изменения его override-содержимого
|
|
277
|
+
*/
|
|
278
|
+
refreshStep(stepName) {
|
|
279
|
+
if (this.activeStepStore.isActiveStep(this, stepName)) {
|
|
280
|
+
this.publishStep();
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { OnboardingTour } from './OnboardingTour';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { OnboardingTour } from './OnboardingTour';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Logger } from '../../../../services/Logger';
|
|
2
|
+
import { type SaveStrategy, type TourProgress } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Обёртка над переданной SaveStrategy, изолирующая тур от исключений хранилища
|
|
5
|
+
*
|
|
6
|
+
* Записи выполняются строго последовательно : при async-стратегии это
|
|
7
|
+
* не даёт конкурентным вызовам переставиться местами — быстрый next/next,
|
|
8
|
+
* save→reset или save→skip сохранят порядок.
|
|
9
|
+
* `load()` ждёт текущее сохранение, поэтому читает уже применённое состояние.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ProgressStorage {
|
|
12
|
+
private readonly strategy;
|
|
13
|
+
private readonly logger;
|
|
14
|
+
private saving;
|
|
15
|
+
constructor(strategy: SaveStrategy, logger: Logger);
|
|
16
|
+
load(): Promise<TourProgress | null>;
|
|
17
|
+
save(state: TourProgress): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Полный сброс прогресса. Если стратегия умеет `remove` — запись удаляется;
|
|
20
|
+
* иначе поверх пишется пустое состояние.
|
|
21
|
+
*/
|
|
22
|
+
reset(): Promise<void>;
|
|
23
|
+
private enqueue;
|
|
24
|
+
}
|