@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,47 @@
|
|
|
1
|
+
import { type ActiveStepState } from '../../../types';
|
|
2
|
+
import { type VirtualAnchor } from '../../../utils/createVirtualAnchor';
|
|
3
|
+
import { type Rect } from '../../../utils/geometry';
|
|
4
|
+
/**
|
|
5
|
+
* Геометрия подсветки, общая для overlay и popover.
|
|
6
|
+
*/
|
|
7
|
+
export type OverlayGeometry = {
|
|
8
|
+
/**
|
|
9
|
+
* Область hole (null для standalone или пока элемент не найден).
|
|
10
|
+
*/
|
|
11
|
+
hole: Rect | null;
|
|
12
|
+
/**
|
|
13
|
+
* Якорь popover (null пока нет hole).
|
|
14
|
+
*/
|
|
15
|
+
anchorEl: VirtualAnchor | null;
|
|
16
|
+
/**
|
|
17
|
+
* Подсвечиваемый элемент (null для standalone или пока не найден).
|
|
18
|
+
*/
|
|
19
|
+
element: HTMLElement | null;
|
|
20
|
+
/**
|
|
21
|
+
* Hole движется между элементами.
|
|
22
|
+
*/
|
|
23
|
+
isTransitioning: boolean;
|
|
24
|
+
};
|
|
25
|
+
export type UseLogicResult = {
|
|
26
|
+
geometry: OverlayGeometry;
|
|
27
|
+
/**
|
|
28
|
+
* Показывать ли overlay.
|
|
29
|
+
*/
|
|
30
|
+
shouldShowOverlay: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Overlay виден.
|
|
33
|
+
*/
|
|
34
|
+
isVisible: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Hole анимируется.
|
|
37
|
+
*/
|
|
38
|
+
isHoleMoving: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Клик по overlay — запрос выхода.
|
|
41
|
+
*/
|
|
42
|
+
onOverlayClose: () => void;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Логика стратегии: держит единый overlay на весь тур.
|
|
46
|
+
*/
|
|
47
|
+
export declare const useLogic: (activeStep: ActiveStepState, isClosing: boolean) => UseLogicResult;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useCallback, useMemo, useRef } from 'react';
|
|
2
|
+
import { useTheme } from '../../../../theme/hooks/useTheme';
|
|
3
|
+
import { createVirtualAnchor, } from '../../../utils/createVirtualAnchor';
|
|
4
|
+
import { inflateRect, parseOffset } from '../../../utils/geometry';
|
|
5
|
+
import { useStepTransition } from '../../hooks/useStepTransition';
|
|
6
|
+
import { useTargetAnchor } from '../../hooks/useTargetAnchor';
|
|
7
|
+
/**
|
|
8
|
+
* Логика стратегии: держит единый overlay на весь тур.
|
|
9
|
+
*/
|
|
10
|
+
export const useLogic = (activeStep, isClosing) => {
|
|
11
|
+
const { step, onError } = activeStep;
|
|
12
|
+
const theme = useTheme();
|
|
13
|
+
const isHighlight = step.type === 'highlight';
|
|
14
|
+
const { element, rect } = useTargetAnchor(step.name, {
|
|
15
|
+
onError,
|
|
16
|
+
// Трекинг только для highlight-шага.
|
|
17
|
+
shouldTrack: isHighlight,
|
|
18
|
+
scrollOnEnter: true,
|
|
19
|
+
timeout: step.waitForTimeout,
|
|
20
|
+
});
|
|
21
|
+
const padding = parseOffset(step.highlightOffset);
|
|
22
|
+
const hole = useMemo(() => (rect ? inflateRect(rect, padding) : null), [rect, padding]);
|
|
23
|
+
const anchorEl = useMemo(() => (hole ? createVirtualAnchor(hole) : null), [hole]);
|
|
24
|
+
const { isPopoverHidden, isHoleMoving } = useStepTransition(step.name, {
|
|
25
|
+
// Popover скрыт пока hole движется.
|
|
26
|
+
popoverHiddenMs: theme.transitions.duration.short,
|
|
27
|
+
holeMovingMs: theme.transitions.duration.short,
|
|
28
|
+
hasHole: isHighlight,
|
|
29
|
+
});
|
|
30
|
+
const onOverlayClose = useCallback(() => {
|
|
31
|
+
activeStep.requestClose();
|
|
32
|
+
}, [activeStep]);
|
|
33
|
+
// Overlay залипает на весь тур после первого показа (без моргания).
|
|
34
|
+
const wantsOverlay = hole !== null || !isHighlight;
|
|
35
|
+
const hasShownOverlayRef = useRef(false);
|
|
36
|
+
if (wantsOverlay) {
|
|
37
|
+
hasShownOverlayRef.current = true;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
geometry: {
|
|
41
|
+
hole,
|
|
42
|
+
anchorEl,
|
|
43
|
+
element,
|
|
44
|
+
isTransitioning: isPopoverHidden,
|
|
45
|
+
},
|
|
46
|
+
shouldShowOverlay: hasShownOverlayRef.current,
|
|
47
|
+
isVisible: !isClosing,
|
|
48
|
+
isHoleMoving,
|
|
49
|
+
onOverlayClose,
|
|
50
|
+
};
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useActiveStep } from './useActiveStep';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useActiveStep } from './useActiveStep';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ActiveStepStore } from '../../../core/ActiveStepStore';
|
|
2
|
+
import { type ActiveStepState } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Подписка на активный шаг из store экземпляра.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useActiveStep: (store: ActiveStepStore) => ActiveStepState | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// TODO После ухода с React 17 — заменить импорт на `react` и убрать use-sync-external-store.
|
|
2
|
+
// https://track.astral.ru/soft/browse/UIKIT-3285
|
|
3
|
+
import { useSyncExternalStore } from 'use-sync-external-store/shim';
|
|
4
|
+
/**
|
|
5
|
+
* Подписка на активный шаг из store экземпляра.
|
|
6
|
+
*/
|
|
7
|
+
export const useActiveStep = (store) => useSyncExternalStore(store.subscribe, store.getActiveStep, store.getActiveStep);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useDelayedActiveStep';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useDelayedActiveStep';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ActiveStepState } from '../../../types';
|
|
2
|
+
export type DelayedActiveStep = {
|
|
3
|
+
/**
|
|
4
|
+
* Шаг, удержанный на экране на время закрытия.
|
|
5
|
+
*/
|
|
6
|
+
active: ActiveStepState | null;
|
|
7
|
+
/**
|
|
8
|
+
* Анимация закрытия в процессе.
|
|
9
|
+
*/
|
|
10
|
+
isClosing: boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Откладывает обнуление шага на время закрытия анимаций.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useDelayedActiveStep: (active: ActiveStepState | null, exitDurationMs: number) => DelayedActiveStep;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Откладывает обнуление шага на время закрытия анимаций.
|
|
4
|
+
*/
|
|
5
|
+
export const useDelayedActiveStep = (active, exitDurationMs) => {
|
|
6
|
+
const [displayedStep, setDisplayedStep] = useState(active);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (active) {
|
|
9
|
+
setDisplayedStep(active);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const timer = setTimeout(() => setDisplayedStep(null), exitDurationMs);
|
|
13
|
+
return () => clearTimeout(timer);
|
|
14
|
+
}, [active, exitDurationMs]);
|
|
15
|
+
return {
|
|
16
|
+
active: displayedStep,
|
|
17
|
+
isClosing: displayedStep !== null && active === null,
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useFocusTrap } from './useFocusTrap';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useFocusTrap } from './useFocusTrap';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createFocusTrap } from 'focus-trap';
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Мульти-контейнерный фокус-трап для highlight-шага.
|
|
5
|
+
* @param nodes контейнеры
|
|
6
|
+
* @param isActive включение трапа
|
|
7
|
+
*/
|
|
8
|
+
export const useFocusTrap = (nodes, isActive = true) => {
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const containers = nodes.filter((node) => node !== null);
|
|
11
|
+
if (!isActive || containers.length === 0) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const trap = createFocusTrap(containers, {
|
|
15
|
+
escapeDeactivates: false,
|
|
16
|
+
clickOutsideDeactivates: false,
|
|
17
|
+
allowOutsideClick: true,
|
|
18
|
+
returnFocusOnDeactivate: false,
|
|
19
|
+
fallbackFocus: containers[0],
|
|
20
|
+
initialFocus: () => containers[0],
|
|
21
|
+
});
|
|
22
|
+
try {
|
|
23
|
+
trap.activate();
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
// Нет фокусируемых узлов.
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
return () => {
|
|
30
|
+
trap.deactivate();
|
|
31
|
+
};
|
|
32
|
+
}, [nodes, isActive]);
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useKeyboardNav } from './useKeyboardNav';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useKeyboardNav } from './useKeyboardNav';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ActiveStepState } from '../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Клавиатурная навигация по туру.
|
|
4
|
+
*
|
|
5
|
+
* → / ← — next/prev, Esc — единая точка выхода `requestClose()`.
|
|
6
|
+
* Слушатель вешается только при активном туре и снимается при закрытии.
|
|
7
|
+
*
|
|
8
|
+
* Слушаем в capture-фазе на window, чтобы перехватить стрелки/Esc раньше
|
|
9
|
+
* вложенных обработчиков и не зависеть от фокуса.
|
|
10
|
+
*/
|
|
11
|
+
export declare const useKeyboardNav: (activeStep: ActiveStepState | null) => void;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
const isEditableTarget = (target) => {
|
|
3
|
+
if (!(target instanceof HTMLElement)) {
|
|
4
|
+
return false;
|
|
5
|
+
}
|
|
6
|
+
const tag = target.tagName;
|
|
7
|
+
return (tag === 'INPUT' ||
|
|
8
|
+
tag === 'TEXTAREA' ||
|
|
9
|
+
tag === 'SELECT' ||
|
|
10
|
+
target.isContentEditable);
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Стрелки игнорируются при фокусе в поле ввода (чтобы свободно двигать каретку) и при
|
|
14
|
+
* скрытой кнопке навигации.
|
|
15
|
+
*/
|
|
16
|
+
const goNext = (activeStep, event) => {
|
|
17
|
+
if (isEditableTarget(event.target) || !activeStep.step.isNextButtonVisible) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
event.preventDefault();
|
|
21
|
+
activeStep.onNext();
|
|
22
|
+
};
|
|
23
|
+
const goPrev = (activeStep, event) => {
|
|
24
|
+
if (isEditableTarget(event.target) || !activeStep.step.isPrevButtonVisible) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
activeStep.onPrev();
|
|
29
|
+
};
|
|
30
|
+
const requestExit = (activeStep, event) => {
|
|
31
|
+
event.preventDefault();
|
|
32
|
+
activeStep.requestClose();
|
|
33
|
+
};
|
|
34
|
+
const KEY_HANDLERS = {
|
|
35
|
+
ArrowRight: goNext,
|
|
36
|
+
ArrowLeft: goPrev,
|
|
37
|
+
Escape: requestExit,
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Клавиатурная навигация по туру.
|
|
41
|
+
*
|
|
42
|
+
* → / ← — next/prev, Esc — единая точка выхода `requestClose()`.
|
|
43
|
+
* Слушатель вешается только при активном туре и снимается при закрытии.
|
|
44
|
+
*
|
|
45
|
+
* Слушаем в capture-фазе на window, чтобы перехватить стрелки/Esc раньше
|
|
46
|
+
* вложенных обработчиков и не зависеть от фокуса.
|
|
47
|
+
*/
|
|
48
|
+
export const useKeyboardNav = (activeStep) => {
|
|
49
|
+
const isActive = Boolean(activeStep) && !activeStep?.isConfirming;
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (!activeStep || !isActive) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const handleKeyDown = (event) => {
|
|
55
|
+
KEY_HANDLERS[event.key]?.(activeStep, event);
|
|
56
|
+
};
|
|
57
|
+
window.addEventListener('keydown', handleKeyDown, true);
|
|
58
|
+
return () => {
|
|
59
|
+
window.removeEventListener('keydown', handleKeyDown, true);
|
|
60
|
+
};
|
|
61
|
+
}, [activeStep, isActive]);
|
|
62
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useStepTransition } from './useStepTransition';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useStepTransition } from './useStepTransition';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type StepTransitionDurations = {
|
|
2
|
+
/**
|
|
3
|
+
* Время скрытия popover при смене шага (не меньше `holeMovingMs`).
|
|
4
|
+
*/
|
|
5
|
+
popoverHiddenMs: number;
|
|
6
|
+
/**
|
|
7
|
+
* Время движения hole к новому элементу.
|
|
8
|
+
*/
|
|
9
|
+
holeMovingMs: number;
|
|
10
|
+
/**
|
|
11
|
+
* Есть ли hole в текущем шаге (highlight). Скрытие popover нужно только для
|
|
12
|
+
* переезда hole (highlight → highlight).
|
|
13
|
+
* @default true
|
|
14
|
+
*/
|
|
15
|
+
hasHole?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type StepTransitionPhase = {
|
|
18
|
+
/**
|
|
19
|
+
* Popover скрыт, пока hole движется.
|
|
20
|
+
*/
|
|
21
|
+
isPopoverHidden: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Идёт анимированный переезд hole.
|
|
24
|
+
*/
|
|
25
|
+
isHoleMoving: boolean;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Координирует скрытие popover и движение hole при переходе между highlight-шагами.
|
|
29
|
+
*/
|
|
30
|
+
export declare const useStepTransition: (stepKey: string, { popoverHiddenMs, holeMovingMs, hasHole }: StepTransitionDurations) => StepTransitionPhase;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
const IDLE_PHASE = {
|
|
3
|
+
isPopoverHidden: false,
|
|
4
|
+
isHoleMoving: false,
|
|
5
|
+
};
|
|
6
|
+
const HIDDEN_PHASE = {
|
|
7
|
+
isPopoverHidden: true,
|
|
8
|
+
isHoleMoving: true,
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Координирует скрытие popover и движение hole при переходе между highlight-шагами.
|
|
12
|
+
*/
|
|
13
|
+
export const useStepTransition = (stepKey, { popoverHiddenMs, holeMovingMs, hasHole = true }) => {
|
|
14
|
+
const [phase, setPhase] = useState(IDLE_PHASE);
|
|
15
|
+
const prevKey = useRef(stepKey);
|
|
16
|
+
const prevHadHole = useRef(hasHole);
|
|
17
|
+
// Триггер для эффекта: `prevKey` мутируется во время render, поэтому в эффекте не сравнить.
|
|
18
|
+
const [transitionId, setTransitionId] = useState(0);
|
|
19
|
+
// Скрываем popover синхронно во время render, иначе виден «прыжок» позиции.
|
|
20
|
+
if (prevKey.current !== stepKey) {
|
|
21
|
+
// Прячем popover только для переезда hole (highlight → highlight).
|
|
22
|
+
const isHoleTravel = prevHadHole.current && hasHole;
|
|
23
|
+
prevKey.current = stepKey;
|
|
24
|
+
prevHadHole.current = hasHole;
|
|
25
|
+
if (isHoleTravel) {
|
|
26
|
+
setPhase(HIDDEN_PHASE);
|
|
27
|
+
setTransitionId((id) => id + 1);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
setPhase(IDLE_PHASE);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
// Первый render (mount) — переход не запускаем.
|
|
35
|
+
if (transitionId === 0) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const popoverTimer = setTimeout(() => setPhase((prev) => ({ ...prev, isPopoverHidden: false })), popoverHiddenMs);
|
|
39
|
+
const holeTimer = setTimeout(() => setPhase((prev) => ({ ...prev, isHoleMoving: false })), holeMovingMs);
|
|
40
|
+
return () => {
|
|
41
|
+
clearTimeout(popoverTimer);
|
|
42
|
+
clearTimeout(holeTimer);
|
|
43
|
+
};
|
|
44
|
+
}, [transitionId, popoverHiddenMs, holeMovingMs]);
|
|
45
|
+
return phase;
|
|
46
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useTargetAnchor';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useTargetAnchor';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type Rect } from '../../../utils/geometry';
|
|
2
|
+
type UseTargetAnchorOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* Обратный вызов при ошибке (элемент не найден за timeout).
|
|
5
|
+
*/
|
|
6
|
+
onError: (error: Error) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Отслеживать ли элемент.
|
|
9
|
+
* @default true
|
|
10
|
+
*/
|
|
11
|
+
shouldTrack?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Прокрутить к элементу при его появлении.
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
scrollOnEnter?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Тайм-аут ожидания появления элемента (мс).
|
|
19
|
+
* @default DEFAULT_WAIT_ELEMENT_TIMEOUT_MS
|
|
20
|
+
*/
|
|
21
|
+
timeout?: number;
|
|
22
|
+
};
|
|
23
|
+
type UseTargetAnchorResult = {
|
|
24
|
+
/**
|
|
25
|
+
* Найденный элемент.
|
|
26
|
+
*/
|
|
27
|
+
element: HTMLElement | null;
|
|
28
|
+
/**
|
|
29
|
+
* Область элемента (синхронизируется при scroll/resize).
|
|
30
|
+
*/
|
|
31
|
+
rect: Rect | null;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Находит элемент по `data-tour-id` и синхронизирует его область.
|
|
35
|
+
*/
|
|
36
|
+
export declare const useTargetAnchor: (targetName: string, { onError, shouldTrack, scrollOnEnter, timeout, }: UseTargetAnchorOptions) => UseTargetAnchorResult;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { getTargetElement } from '../../../utils/getTargetElement';
|
|
3
|
+
import { observeRemoval } from '../../../utils/observeRemoval';
|
|
4
|
+
import { scrollIntoView } from '../../../utils/scrollIntoView';
|
|
5
|
+
import { waitForElement } from '../../../utils/waitForElement';
|
|
6
|
+
import { useTrackedRect } from '../useTrackedRect';
|
|
7
|
+
/**
|
|
8
|
+
* Находит элемент по `data-tour-id` и синхронизирует его область.
|
|
9
|
+
*/
|
|
10
|
+
export const useTargetAnchor = (targetName, { onError, shouldTrack = true, scrollOnEnter = false, timeout, }) => {
|
|
11
|
+
const [element, setElement] = useState(null);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (!shouldTrack) {
|
|
14
|
+
// Очищаем элемент, чтобы useTrackedRect не отслеживал его.
|
|
15
|
+
setElement(null);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
let isCancelled = false;
|
|
19
|
+
let stopRemovalWatch;
|
|
20
|
+
const track = () => {
|
|
21
|
+
// Устанавливаем найденный элемент сразу, без задержки.
|
|
22
|
+
setElement(getTargetElement(targetName));
|
|
23
|
+
waitForElement(targetName, { timeout })
|
|
24
|
+
.then(async (target) => {
|
|
25
|
+
if (isCancelled) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (scrollOnEnter) {
|
|
29
|
+
await scrollIntoView(target);
|
|
30
|
+
}
|
|
31
|
+
if (isCancelled) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
setElement(target);
|
|
35
|
+
stopRemovalWatch = observeRemoval(target, () => {
|
|
36
|
+
if (!isCancelled) {
|
|
37
|
+
setElement(null);
|
|
38
|
+
track();
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
})
|
|
42
|
+
.catch((error) => {
|
|
43
|
+
if (!isCancelled) {
|
|
44
|
+
onError(error);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
track();
|
|
49
|
+
return () => {
|
|
50
|
+
isCancelled = true;
|
|
51
|
+
stopRemovalWatch?.();
|
|
52
|
+
};
|
|
53
|
+
}, [targetName, onError, shouldTrack, scrollOnEnter, timeout]);
|
|
54
|
+
const rect = useTrackedRect(element);
|
|
55
|
+
return { element, rect };
|
|
56
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useTrackedRect } from './useTrackedRect';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useTrackedRect } from './useTrackedRect';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { clampToScrollParents, getViewport, isSameRect, rectFromDomRect, } from '../../../utils/geometry';
|
|
3
|
+
import { getScrollParents } from '../../../utils/getScrollParents';
|
|
4
|
+
/**
|
|
5
|
+
* Отслеживает область элемента для hole overlay и якоря popover.
|
|
6
|
+
*/
|
|
7
|
+
export const useTrackedRect = (element) => {
|
|
8
|
+
const [rect, setRect] = useState(null);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (!element) {
|
|
11
|
+
setRect(null);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
// ID текущей рAF-очереди обновления.
|
|
15
|
+
let frame = 0;
|
|
16
|
+
const scrollParents = getScrollParents(element);
|
|
17
|
+
const update = () => {
|
|
18
|
+
const elementRect = rectFromDomRect(element.getBoundingClientRect());
|
|
19
|
+
const viewport = getViewport();
|
|
20
|
+
const next = clampToScrollParents(elementRect, scrollParents.map((parent) => rectFromDomRect(parent.getBoundingClientRect())), viewport);
|
|
21
|
+
setRect((prev) => (isSameRect(prev, next) ? prev : next));
|
|
22
|
+
};
|
|
23
|
+
const scheduleUpdate = () => {
|
|
24
|
+
cancelAnimationFrame(frame);
|
|
25
|
+
frame = requestAnimationFrame(update);
|
|
26
|
+
};
|
|
27
|
+
update();
|
|
28
|
+
const scrollOptions = { passive: true };
|
|
29
|
+
scrollParents.forEach((parent) => parent.addEventListener('scroll', scheduleUpdate, scrollOptions));
|
|
30
|
+
window.addEventListener('scroll', scheduleUpdate, scrollOptions);
|
|
31
|
+
window.addEventListener('resize', scheduleUpdate);
|
|
32
|
+
const resizeObserver = new ResizeObserver(scheduleUpdate);
|
|
33
|
+
resizeObserver.observe(element);
|
|
34
|
+
return () => {
|
|
35
|
+
cancelAnimationFrame(frame);
|
|
36
|
+
resizeObserver.disconnect();
|
|
37
|
+
scrollParents.forEach((parent) => parent.removeEventListener('scroll', scheduleUpdate, scrollOptions));
|
|
38
|
+
window.removeEventListener('scroll', scheduleUpdate, scrollOptions);
|
|
39
|
+
window.removeEventListener('resize', scheduleUpdate);
|
|
40
|
+
};
|
|
41
|
+
}, [element]);
|
|
42
|
+
return rect;
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useViewportSize } from './useViewportSize';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useViewportSize } from './useViewportSize';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { getViewport } from '../../../utils/geometry';
|
|
3
|
+
/**
|
|
4
|
+
* Синхронизирует размеры viewport без полос прокрутки окна.
|
|
5
|
+
*/
|
|
6
|
+
export const useViewportSize = () => {
|
|
7
|
+
const [viewport, setViewport] = useState(getViewport);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const handleResize = () => setViewport(getViewport());
|
|
10
|
+
window.addEventListener('resize', handleResize);
|
|
11
|
+
return () => window.removeEventListener('resize', handleResize);
|
|
12
|
+
}, []);
|
|
13
|
+
return viewport;
|
|
14
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { backdropClasses } from '@mui/material/Backdrop';
|
|
2
|
+
import { css } from '../../styled';
|
|
3
|
+
import { ONBOARDING_Z_INDEX_OFFSET } from '../constants';
|
|
4
|
+
/**
|
|
5
|
+
* Каркас модальных поверхностей: прозрачный backdrop, приподнятый z-index.
|
|
6
|
+
*/
|
|
7
|
+
export const onboardingModalSurface = (theme) => css `
|
|
8
|
+
&& {
|
|
9
|
+
z-index: ${theme.zIndex.tooltip + ONBOARDING_Z_INDEX_OFFSET.base};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&& .${backdropClasses.root} {
|
|
13
|
+
background-color: transparent;
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Rect } from '../geometry';
|
|
2
|
+
/**
|
|
3
|
+
* Виртуальный anchor для NewPopover — объект с `getBoundingClientRect`,
|
|
4
|
+
* который MUI Popper внутри NewPopover принимает вместо реального узла.
|
|
5
|
+
*/
|
|
6
|
+
export type VirtualAnchor = {
|
|
7
|
+
getBoundingClientRect: () => DOMRect;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Превращает область hole в anchor для позиционирования popover.
|
|
11
|
+
*/
|
|
12
|
+
export declare const createVirtualAnchor: (hole: Rect) => VirtualAnchor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './createVirtualAnchor';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './createVirtualAnchor';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { buildOverlayPath } from './overlayPath';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { buildOverlayPath } from './overlayPath';
|