@robertlinde/react-tour-kit 0.8.9 → 1.0.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/CHANGELOG.md +40 -0
- package/MIGRATION.md +205 -0
- package/README.md +401 -850
- package/dist/react-native-platform/hooks/use-tour-scroll-view.hook.d.ts +14 -0
- package/dist/react-native-platform/hooks/use-tour-scroll-view.hook.d.ts.map +1 -0
- package/dist/react-native-platform/hooks/use-tour-scroll-view.hook.js +21 -0
- package/dist/react-native-platform/hooks/use-tour-scroll-view.hook.js.map +1 -0
- package/dist/react-native-platform/hooks/use-tour-target.hook.d.ts +15 -0
- package/dist/react-native-platform/hooks/use-tour-target.hook.d.ts.map +1 -0
- package/dist/react-native-platform/hooks/use-tour-target.hook.js +28 -0
- package/dist/react-native-platform/hooks/use-tour-target.hook.js.map +1 -0
- package/dist/react-native-platform/host-store.d.ts +24 -0
- package/dist/react-native-platform/host-store.d.ts.map +1 -0
- package/dist/react-native-platform/host-store.js +63 -0
- package/dist/react-native-platform/host-store.js.map +1 -0
- package/dist/react-native-platform/insets.util.d.ts +11 -0
- package/dist/react-native-platform/insets.util.d.ts.map +1 -0
- package/dist/react-native-platform/insets.util.js +31 -0
- package/dist/react-native-platform/insets.util.js.map +1 -0
- package/dist/react-native-platform/layer/native-renderer.d.ts +7 -0
- package/dist/react-native-platform/layer/native-renderer.d.ts.map +1 -0
- package/dist/react-native-platform/layer/native-renderer.js +496 -0
- package/dist/react-native-platform/layer/native-renderer.js.map +1 -0
- package/dist/react-native-platform/layer/tour-host.d.ts +13 -0
- package/dist/react-native-platform/layer/tour-host.d.ts.map +1 -0
- package/dist/react-native-platform/layer/tour-host.js +70 -0
- package/dist/react-native-platform/layer/tour-host.js.map +1 -0
- package/dist/react-native-platform/measure.util.d.ts +20 -0
- package/dist/react-native-platform/measure.util.d.ts.map +1 -0
- package/dist/react-native-platform/measure.util.js +100 -0
- package/dist/react-native-platform/measure.util.js.map +1 -0
- package/dist/react-native-platform/native-context.d.ts +12 -0
- package/dist/react-native-platform/native-context.d.ts.map +1 -0
- package/dist/react-native-platform/native-context.js +4 -0
- package/dist/react-native-platform/native-context.js.map +1 -0
- package/dist/react-native-platform/native-environment.d.ts +14 -0
- package/dist/react-native-platform/native-environment.d.ts.map +1 -0
- package/dist/react-native-platform/native-environment.js +20 -0
- package/dist/react-native-platform/native-environment.js.map +1 -0
- package/dist/react-native-platform/native-platform.d.ts +19 -0
- package/dist/react-native-platform/native-platform.d.ts.map +1 -0
- package/dist/react-native-platform/native-platform.js +265 -0
- package/dist/react-native-platform/native-platform.js.map +1 -0
- package/dist/react-native-platform/reduced-motion.d.ts +4 -0
- package/dist/react-native-platform/reduced-motion.d.ts.map +1 -0
- package/dist/react-native-platform/reduced-motion.js +44 -0
- package/dist/react-native-platform/reduced-motion.js.map +1 -0
- package/dist/react-native-platform/registry.d.ts +18 -0
- package/dist/react-native-platform/registry.d.ts.map +1 -0
- package/dist/react-native-platform/registry.js +51 -0
- package/dist/react-native-platform/registry.js.map +1 -0
- package/dist/react-native-platform/tour-provider.d.ts +16 -3
- package/dist/react-native-platform/tour-provider.d.ts.map +1 -0
- package/dist/react-native-platform/tour-provider.js +92 -211
- package/dist/react-native-platform/tour-provider.js.map +1 -1
- package/dist/react-native.d.ts +14 -10
- package/dist/react-native.d.ts.map +1 -0
- package/dist/react-native.js +7 -7
- package/dist/react-native.js.map +1 -1
- package/dist/react-platform/dom/elements.util.d.ts +35 -0
- package/dist/react-platform/dom/elements.util.d.ts.map +1 -0
- package/dist/react-platform/dom/elements.util.js +155 -0
- package/dist/react-platform/dom/elements.util.js.map +1 -0
- package/dist/react-platform/dom/occluders.util.d.ts +13 -0
- package/dist/react-platform/dom/occluders.util.d.ts.map +1 -0
- package/dist/react-platform/dom/occluders.util.js +75 -0
- package/dist/react-platform/dom/occluders.util.js.map +1 -0
- package/dist/react-platform/dom/scroll-lock.util.d.ts +13 -0
- package/dist/react-platform/dom/scroll-lock.util.d.ts.map +1 -0
- package/dist/react-platform/dom/scroll-lock.util.js +219 -0
- package/dist/react-platform/dom/scroll-lock.util.js.map +1 -0
- package/dist/react-platform/dom/scroll.util.d.ts +44 -0
- package/dist/react-platform/dom/scroll.util.d.ts.map +1 -0
- package/dist/react-platform/dom/scroll.util.js +250 -0
- package/dist/react-platform/dom/scroll.util.js.map +1 -0
- package/dist/react-platform/dom/viewport.util.d.ts +16 -0
- package/dist/react-platform/dom/viewport.util.d.ts.map +1 -0
- package/dist/react-platform/dom/viewport.util.js +65 -0
- package/dist/react-platform/dom/viewport.util.js.map +1 -0
- package/dist/react-platform/dom/web-platform.d.ts +15 -0
- package/dist/react-platform/dom/web-platform.d.ts.map +1 -0
- package/dist/react-platform/dom/web-platform.js +169 -0
- package/dist/react-platform/dom/web-platform.js.map +1 -0
- package/dist/react-platform/layer/styles.d.ts +12 -0
- package/dist/react-platform/layer/styles.d.ts.map +1 -0
- package/dist/react-platform/layer/styles.js +285 -0
- package/dist/react-platform/layer/styles.js.map +1 -0
- package/dist/react-platform/layer/web-renderer.d.ts +4 -0
- package/dist/react-platform/layer/web-renderer.d.ts.map +1 -0
- package/dist/react-platform/layer/web-renderer.js +390 -0
- package/dist/react-platform/layer/web-renderer.js.map +1 -0
- package/dist/react-platform/tour-provider.d.ts +9 -3
- package/dist/react-platform/tour-provider.d.ts.map +1 -0
- package/dist/react-platform/tour-provider.js +28 -218
- package/dist/react-platform/tour-provider.js.map +1 -1
- package/dist/react.d.ts +10 -10
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +5 -7
- package/dist/react.js.map +1 -1
- package/dist/shared/engine/abort.util.d.ts +17 -0
- package/dist/shared/engine/abort.util.d.ts.map +1 -0
- package/dist/shared/engine/abort.util.js +72 -0
- package/dist/shared/engine/abort.util.js.map +1 -0
- package/dist/shared/engine/report.util.d.ts +12 -0
- package/dist/shared/engine/report.util.d.ts.map +1 -0
- package/dist/shared/engine/report.util.js +51 -0
- package/dist/shared/engine/report.util.js.map +1 -0
- package/dist/shared/engine/tour-adapter.type.d.ts +60 -0
- package/dist/shared/engine/tour-adapter.type.d.ts.map +1 -0
- package/dist/shared/engine/tour-adapter.type.js +2 -0
- package/dist/shared/engine/tour-adapter.type.js.map +1 -0
- package/dist/shared/engine/tour-engine.d.ts +92 -0
- package/dist/shared/engine/tour-engine.d.ts.map +1 -0
- package/dist/shared/engine/tour-engine.js +787 -0
- package/dist/shared/engine/tour-engine.js.map +1 -0
- package/dist/shared/geometry/box.util.d.ts +39 -0
- package/dist/shared/geometry/box.util.d.ts.map +1 -0
- package/dist/shared/geometry/box.util.js +146 -0
- package/dist/shared/geometry/box.util.js.map +1 -0
- package/dist/shared/geometry/compute-tooltip-layout.util.d.ts +60 -0
- package/dist/shared/geometry/compute-tooltip-layout.util.d.ts.map +1 -0
- package/dist/shared/geometry/compute-tooltip-layout.util.js +148 -0
- package/dist/shared/geometry/compute-tooltip-layout.util.js.map +1 -0
- package/dist/shared/geometry/geometry.type.d.ts +34 -0
- package/dist/shared/geometry/geometry.type.d.ts.map +1 -0
- package/dist/shared/geometry/geometry.type.js +2 -0
- package/dist/shared/geometry/geometry.type.js.map +1 -0
- package/dist/shared/geometry/reveal.util.d.ts +38 -0
- package/dist/shared/geometry/reveal.util.d.ts.map +1 -0
- package/dist/shared/geometry/reveal.util.js +135 -0
- package/dist/shared/geometry/reveal.util.js.map +1 -0
- package/dist/shared/geometry/target-visibility.util.d.ts +10 -0
- package/dist/shared/geometry/target-visibility.util.d.ts.map +1 -0
- package/dist/shared/geometry/target-visibility.util.js +29 -0
- package/dist/shared/geometry/target-visibility.util.js.map +1 -0
- package/dist/shared/platform/create-tour-adapter.d.ts +9 -0
- package/dist/shared/platform/create-tour-adapter.d.ts.map +1 -0
- package/dist/shared/platform/create-tour-adapter.js +130 -0
- package/dist/shared/platform/create-tour-adapter.js.map +1 -0
- package/dist/shared/platform/platform.type.d.ts +77 -0
- package/dist/shared/platform/platform.type.d.ts.map +1 -0
- package/dist/shared/platform/platform.type.js +2 -0
- package/dist/shared/platform/platform.type.js.map +1 -0
- package/dist/shared/platform/reveal-in-scroll-containers.d.ts +27 -0
- package/dist/shared/platform/reveal-in-scroll-containers.d.ts.map +1 -0
- package/dist/shared/platform/reveal-in-scroll-containers.js +49 -0
- package/dist/shared/platform/reveal-in-scroll-containers.js.map +1 -0
- package/dist/shared/react/tour-context.d.ts +7 -0
- package/dist/shared/react/tour-context.d.ts.map +1 -0
- package/dist/shared/react/tour-context.js +23 -0
- package/dist/shared/react/tour-context.js.map +1 -0
- package/dist/shared/react/tour-provider-core.d.ts +41 -0
- package/dist/shared/react/tour-provider-core.d.ts.map +1 -0
- package/dist/shared/react/tour-provider-core.js +24 -0
- package/dist/shared/react/tour-provider-core.js.map +1 -0
- package/dist/shared/react/tour-root.d.ts +14 -0
- package/dist/shared/react/tour-root.d.ts.map +1 -0
- package/dist/shared/react/tour-root.js +22 -0
- package/dist/shared/react/tour-root.js.map +1 -0
- package/dist/shared/react/use-isomorphic-layout-effect.hook.d.ts +4 -0
- package/dist/shared/react/use-isomorphic-layout-effect.hook.d.ts.map +1 -0
- package/dist/shared/react/use-isomorphic-layout-effect.hook.js +5 -0
- package/dist/shared/react/use-isomorphic-layout-effect.hook.js.map +1 -0
- package/dist/shared/react/use-tour-view.hook.d.ts +5 -0
- package/dist/shared/react/use-tour-view.hook.d.ts.map +1 -0
- package/dist/shared/react/use-tour-view.hook.js +14 -0
- package/dist/shared/react/use-tour-view.hook.js.map +1 -0
- package/dist/shared/react/use-tour.hook.d.ts +7 -0
- package/dist/shared/react/use-tour.hook.d.ts.map +1 -0
- package/dist/shared/react/use-tour.hook.js +10 -0
- package/dist/shared/react/use-tour.hook.js.map +1 -0
- package/dist/shared/renderer/default-tooltip.d.ts +5 -0
- package/dist/shared/renderer/default-tooltip.d.ts.map +1 -0
- package/dist/shared/renderer/default-tooltip.js +13 -0
- package/dist/shared/renderer/default-tooltip.js.map +1 -0
- package/dist/shared/renderer/motion.d.ts +29 -0
- package/dist/shared/renderer/motion.d.ts.map +1 -0
- package/dist/shared/renderer/motion.js +49 -0
- package/dist/shared/renderer/motion.js.map +1 -0
- package/dist/shared/renderer/renderer-context.d.ts +17 -0
- package/dist/shared/renderer/renderer-context.d.ts.map +1 -0
- package/dist/shared/renderer/renderer-context.js +16 -0
- package/dist/shared/renderer/renderer-context.js.map +1 -0
- package/dist/shared/renderer/renderer.type.d.ts +164 -0
- package/dist/shared/renderer/renderer.type.d.ts.map +1 -0
- package/dist/shared/renderer/renderer.type.js +2 -0
- package/dist/shared/renderer/renderer.type.js.map +1 -0
- package/dist/shared/renderer/tooltip-model.d.ts +32 -0
- package/dist/shared/renderer/tooltip-model.d.ts.map +1 -0
- package/dist/shared/renderer/tooltip-model.js +24 -0
- package/dist/shared/renderer/tooltip-model.js.map +1 -0
- package/dist/shared/renderer/tour-overlay.d.ts +24 -0
- package/dist/shared/renderer/tour-overlay.d.ts.map +1 -0
- package/dist/shared/renderer/tour-overlay.js +228 -0
- package/dist/shared/renderer/tour-overlay.js.map +1 -0
- package/dist/shared/types/tour-context.type.d.ts +21 -11
- package/dist/shared/types/tour-context.type.d.ts.map +1 -0
- package/dist/shared/types/tour-end-info.type.d.ts +19 -2
- package/dist/shared/types/tour-end-info.type.d.ts.map +1 -0
- package/dist/shared/types/tour-i18n.type.d.ts +8 -0
- package/dist/shared/types/tour-i18n.type.d.ts.map +1 -0
- package/dist/shared/types/tour-step.type.d.ts +35 -6
- package/dist/shared/types/tour-step.type.d.ts.map +1 -0
- package/dist/shared/types/tour-theme.type.d.ts +22 -2
- package/dist/shared/types/tour-theme.type.d.ts.map +1 -0
- package/dist/shared/types/tour-theme.type.js +1 -16
- package/dist/shared/types/tour-theme.type.js.map +1 -1
- package/dist/shared/types/tour-tooltip-props.type.d.ts +21 -17
- package/dist/shared/types/tour-tooltip-props.type.d.ts.map +1 -0
- package/dist/shared/utils/frame.util.d.ts +6 -0
- package/dist/shared/utils/frame.util.d.ts.map +1 -0
- package/dist/shared/utils/frame.util.js +20 -0
- package/dist/shared/utils/frame.util.js.map +1 -0
- package/dist/shared/utils/get-truncated-dots.util.d.ts +13 -7
- package/dist/shared/utils/get-truncated-dots.util.d.ts.map +1 -0
- package/dist/shared/utils/get-truncated-dots.util.js +30 -30
- package/dist/shared/utils/get-truncated-dots.util.js.map +1 -1
- package/dist/shared/utils/i18n.util.d.ts +7 -0
- package/dist/shared/utils/i18n.util.d.ts.map +1 -0
- package/dist/shared/utils/i18n.util.js +34 -0
- package/dist/shared/utils/i18n.util.js.map +1 -0
- package/dist/shared/utils/theme.util.d.ts +6 -0
- package/dist/shared/utils/theme.util.d.ts.map +1 -0
- package/dist/shared/utils/theme.util.js +31 -0
- package/dist/shared/utils/theme.util.js.map +1 -0
- package/package.json +72 -55
- package/src/react-native-platform/hooks/use-tour-scroll-view.hook.ts +24 -0
- package/src/react-native-platform/hooks/use-tour-target.hook.ts +30 -0
- package/src/react-native-platform/host-store.ts +92 -0
- package/src/react-native-platform/insets.util.ts +39 -0
- package/src/react-native-platform/layer/native-renderer.tsx +776 -0
- package/src/react-native-platform/layer/tour-host.tsx +105 -0
- package/src/react-native-platform/measure.util.ts +140 -0
- package/src/react-native-platform/native-context.ts +15 -0
- package/src/react-native-platform/native-environment.ts +33 -0
- package/src/react-native-platform/native-platform.ts +368 -0
- package/src/react-native-platform/reduced-motion.ts +47 -0
- package/src/react-native-platform/registry.ts +70 -0
- package/src/react-native-platform/tour-provider.tsx +148 -0
- package/src/react-native.ts +15 -0
- package/src/react-platform/dom/elements.util.ts +191 -0
- package/src/react-platform/dom/occluders.util.ts +88 -0
- package/src/react-platform/dom/scroll-lock.util.ts +261 -0
- package/src/react-platform/dom/scroll.util.ts +310 -0
- package/src/react-platform/dom/viewport.util.ts +74 -0
- package/src/react-platform/dom/web-platform.ts +208 -0
- package/src/react-platform/layer/styles.ts +286 -0
- package/src/react-platform/layer/web-renderer.tsx +594 -0
- package/src/react-platform/tour-provider.tsx +44 -0
- package/src/react.ts +13 -0
- package/src/shared/engine/abort.util.ts +84 -0
- package/src/shared/engine/report.util.ts +58 -0
- package/src/shared/engine/tour-adapter.type.ts +62 -0
- package/src/shared/engine/tour-engine.ts +1068 -0
- package/src/shared/geometry/box.util.ts +185 -0
- package/src/shared/geometry/compute-tooltip-layout.util.ts +238 -0
- package/src/shared/geometry/geometry.type.ts +38 -0
- package/src/shared/geometry/reveal.util.ts +190 -0
- package/src/shared/geometry/target-visibility.util.ts +44 -0
- package/src/shared/platform/create-tour-adapter.ts +151 -0
- package/src/shared/platform/platform.type.ts +81 -0
- package/src/shared/platform/reveal-in-scroll-containers.ts +78 -0
- package/src/shared/react/tour-context.ts +28 -0
- package/src/shared/react/tour-provider-core.ts +67 -0
- package/src/shared/react/tour-root.tsx +34 -0
- package/src/shared/react/use-isomorphic-layout-effect.hook.ts +7 -0
- package/src/shared/react/use-tour-view.hook.ts +17 -0
- package/src/shared/react/use-tour.hook.ts +11 -0
- package/src/shared/renderer/default-tooltip.tsx +52 -0
- package/src/shared/renderer/motion.ts +59 -0
- package/src/shared/renderer/renderer-context.ts +33 -0
- package/src/shared/renderer/renderer.type.ts +183 -0
- package/src/shared/renderer/tooltip-model.ts +44 -0
- package/src/shared/renderer/tour-overlay.tsx +453 -0
- package/src/shared/types/tour-context.type.ts +23 -0
- package/src/shared/types/tour-end-info.type.ts +32 -0
- package/src/shared/types/tour-i18n.type.ts +15 -0
- package/src/shared/types/tour-step.type.ts +40 -0
- package/src/shared/types/tour-theme.type.ts +28 -0
- package/src/shared/types/tour-tooltip-props.type.ts +27 -0
- package/src/shared/utils/frame.util.ts +21 -0
- package/src/shared/utils/get-truncated-dots.util.ts +46 -0
- package/src/shared/utils/i18n.util.ts +44 -0
- package/src/shared/utils/theme.util.ts +38 -0
- package/dist/react-native-platform/components/index.d.ts +0 -2
- package/dist/react-native-platform/components/index.js +0 -3
- package/dist/react-native-platform/components/index.js.map +0 -1
- package/dist/react-native-platform/components/tour-overlay.d.ts +0 -3
- package/dist/react-native-platform/components/tour-overlay.js +0 -26
- package/dist/react-native-platform/components/tour-overlay.js.map +0 -1
- package/dist/react-native-platform/components/tour-tooltip.d.ts +0 -3
- package/dist/react-native-platform/components/tour-tooltip.js +0 -167
- package/dist/react-native-platform/components/tour-tooltip.js.map +0 -1
- package/dist/react-native-platform/hooks/index.d.ts +0 -1
- package/dist/react-native-platform/hooks/index.js +0 -2
- package/dist/react-native-platform/hooks/index.js.map +0 -1
- package/dist/react-native-platform/hooks/use-tour-target.d.ts +0 -2
- package/dist/react-native-platform/hooks/use-tour-target.js +0 -13
- package/dist/react-native-platform/hooks/use-tour-target.js.map +0 -1
- package/dist/react-native-platform/index.d.ts +0 -7
- package/dist/react-native-platform/index.js +0 -7
- package/dist/react-native-platform/index.js.map +0 -1
- package/dist/react-native-platform/platform-adapter.d.ts +0 -2
- package/dist/react-native-platform/platform-adapter.js +0 -84
- package/dist/react-native-platform/platform-adapter.js.map +0 -1
- package/dist/react-native-platform/target-registry.d.ts +0 -10
- package/dist/react-native-platform/target-registry.js +0 -17
- package/dist/react-native-platform/target-registry.js.map +0 -1
- package/dist/react-native-platform/types/tour-provider.props.type.d.ts +0 -12
- package/dist/react-native-platform/types/tour-provider.props.type.js +0 -2
- package/dist/react-native-platform/types/tour-provider.props.type.js.map +0 -1
- package/dist/react-platform/components/index.d.ts +0 -2
- package/dist/react-platform/components/index.js +0 -3
- package/dist/react-platform/components/index.js.map +0 -1
- package/dist/react-platform/components/tour-overlay.d.ts +0 -3
- package/dist/react-platform/components/tour-overlay.js +0 -29
- package/dist/react-platform/components/tour-overlay.js.map +0 -1
- package/dist/react-platform/components/tour-tooltip.d.ts +0 -2
- package/dist/react-platform/components/tour-tooltip.js +0 -155
- package/dist/react-platform/components/tour-tooltip.js.map +0 -1
- package/dist/react-platform/index.d.ts +0 -6
- package/dist/react-platform/index.js +0 -6
- package/dist/react-platform/index.js.map +0 -1
- package/dist/react-platform/platform-adapter.d.ts +0 -2
- package/dist/react-platform/platform-adapter.js +0 -101
- package/dist/react-platform/platform-adapter.js.map +0 -1
- package/dist/react-platform/types/tour-provider.props.type.d.ts +0 -12
- package/dist/react-platform/types/tour-provider.props.type.js +0 -2
- package/dist/react-platform/types/tour-provider.props.type.js.map +0 -1
- package/dist/react-platform/utils/find-visible-element.util.d.ts +0 -1
- package/dist/react-platform/utils/find-visible-element.util.js +0 -11
- package/dist/react-platform/utils/find-visible-element.util.js.map +0 -1
- package/dist/react-platform/utils/index.d.ts +0 -1
- package/dist/react-platform/utils/index.js +0 -2
- package/dist/react-platform/utils/index.js.map +0 -1
- package/dist/shared/context/index.d.ts +0 -1
- package/dist/shared/context/index.js +0 -2
- package/dist/shared/context/index.js.map +0 -1
- package/dist/shared/context/tour-context.d.ts +0 -3
- package/dist/shared/context/tour-context.js +0 -14
- package/dist/shared/context/tour-context.js.map +0 -1
- package/dist/shared/hooks/index.d.ts +0 -1
- package/dist/shared/hooks/index.js +0 -2
- package/dist/shared/hooks/index.js.map +0 -1
- package/dist/shared/hooks/use-tour.hook.d.ts +0 -2
- package/dist/shared/hooks/use-tour.hook.js +0 -7
- package/dist/shared/hooks/use-tour.hook.js.map +0 -1
- package/dist/shared/index.d.ts +0 -7
- package/dist/shared/index.js +0 -6
- package/dist/shared/index.js.map +0 -1
- package/dist/shared/types/index.d.ts +0 -10
- package/dist/shared/types/index.js +0 -2
- package/dist/shared/types/index.js.map +0 -1
- package/dist/shared/types/platform-adapter.type.d.ts +0 -24
- package/dist/shared/types/platform-adapter.type.js +0 -2
- package/dist/shared/types/platform-adapter.type.js.map +0 -1
- package/dist/shared/types/rect.type.d.ts +0 -11
- package/dist/shared/types/rect.type.js +0 -2
- package/dist/shared/types/rect.type.js.map +0 -1
- package/dist/shared/types/tour-overlay-props.type.d.ts +0 -8
- package/dist/shared/types/tour-overlay-props.type.js +0 -2
- package/dist/shared/types/tour-overlay-props.type.js.map +0 -1
- package/dist/shared/utils/calculate-tooltip-position.util.d.ts +0 -14
- package/dist/shared/utils/calculate-tooltip-position.util.js +0 -49
- package/dist/shared/utils/calculate-tooltip-position.util.js.map +0 -1
- package/dist/shared/utils/index.d.ts +0 -3
- package/dist/shared/utils/index.js +0 -3
- package/dist/shared/utils/index.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-renderer.js","sourceRoot":"","sources":["../../../src/react-platform/layer/web-renderer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAIL,SAAS,EACT,kBAAkB,EAClB,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAC,KAAK,EAAC,MAAM,mCAAmC,CAAC;AAExD,OAAO,EAAC,yBAAyB,EAAC,MAAM,yDAAyD,CAAC;AAClG,OAAO,EAAC,MAAM,EAAC,MAAM,iCAAiC,CAAC;AAmBvD,OAAO,EAAC,UAAU,EAAE,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAC,UAAU,EAAC,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAC,gBAAgB,EAAC,MAAM,aAAa,CAAC;AAK7C,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;AACvC,MAAM,cAAc,GAAG,gBAAgB,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC;AAElE,gGAAgG;AAChG,2CAA2C;AAC3C,gGAAgG;AAEhG,0EAA0E;AAC1E,MAAM,aAAa,GAAG,IAAI,OAAO,EAAgC,CAAC;AAElE;;;;GAIG;AACH,SAAS,SAAS,CAAC,MAAyB;IAC1C,IAAI,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/C,OAAO;IACT,CAAC;IAED,IAAI,OAAO,MAAM,CAAC,SAAS,KAAK,UAAU,EAAE,CAAC;QAC3C,IAAI,CAAC;YACH,MAAM,CAAC,SAAS,EAAE,CA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,QAAQ,EAAY;IACxC,OAAO,CACL,cAAK,SAAS,EAAC,UAAU,EAAC,IAAI,EAAC,OAAO,gBAAa,KAAK,YACrD,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,SAAS,GAAG,CAAC,EAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAW;IAChD,OAAO,CACL,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,SAAS,gBACP,KAAK,kBACH,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC5C,OAAO,EAAE,OAAO,GAChB,CACH,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ;IACf,OAAO,8BAAkB,MAAM,EAAC,SAAS,EAAC,cAAc,GAAG,CAAC;AAC9D,CAAC;AAED,MAAM,IAAI,GAAc;IACtB,IAAI;IACJ,KAAK;IACL,MAAM;IACN,OAAO;IACP,WAAW;IACX,IAAI;IACJ,KAAK;IACL,OAAO;IACP,MAAM;IACN,MAAM;IACN,IAAI;IACJ,GAAG;IACH,QAAQ;CACT,CAAC;AAEF,kCAAkC;AAClC,MAAM,CAAC,MAAM,WAAW,GAAiB,EAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,IAAI,EAAC,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
3
|
-
export
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type TourProviderBaseProps } from '../shared/react/tour-provider-core.js';
|
|
3
|
+
export type TourProviderProps = TourProviderBaseProps;
|
|
4
|
+
/**
|
|
5
|
+
* Provides `useTour()` to its children and renders the tour. Place it around your app, inside
|
|
6
|
+
* your router if steps navigate between pages.
|
|
7
|
+
*/
|
|
8
|
+
export declare function TourProvider(props: TourProviderProps): ReactNode;
|
|
9
|
+
//# sourceMappingURL=tour-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tour-provider.d.ts","sourceRoot":"","sources":["../../src/react-platform/tour-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,SAAS,EAAsB,MAAM,OAAO,CAAC;AAG1D,OAAO,EAAC,KAAK,qBAAqB,EAAc,MAAM,uCAAuC,CAAC;AAO9F,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AAEtD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAUhE"}
|
|
@@ -1,221 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { useCallback, useState, useEffect, useRef, useMemo } from 'react';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
4
3
|
import { createPortal } from 'react-dom';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const [
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}, []);
|
|
32
|
-
const startTour = useCallback((tourSteps, tourId, options) => {
|
|
33
|
-
if (tourSteps.length > 0) {
|
|
34
|
-
setSteps(tourSteps);
|
|
35
|
-
setCurrentStep(0);
|
|
36
|
-
setCurrentTourId(tourId);
|
|
37
|
-
tourOnEndRef.current = options?.onTourEnd;
|
|
38
|
-
setIsActive(true);
|
|
39
|
-
}
|
|
40
|
-
}, []);
|
|
41
|
-
const finishTour = useCallback((reason) => {
|
|
42
|
-
const stepAtEnd = steps[currentStep] ?? steps.at(-1);
|
|
43
|
-
if (stepAtEnd) {
|
|
44
|
-
const info = {
|
|
45
|
-
reason,
|
|
46
|
-
stepIndex: currentStep,
|
|
47
|
-
step: stepAtEnd,
|
|
48
|
-
totalSteps: steps.length,
|
|
49
|
-
};
|
|
50
|
-
tourOnEndRef.current?.(currentTourId, info);
|
|
51
|
-
onTourEnd?.(currentTourId, info);
|
|
52
|
-
}
|
|
53
|
-
tourOnEndRef.current = undefined;
|
|
54
|
-
setIsActive(false);
|
|
55
|
-
setCurrentStep(0);
|
|
56
|
-
setSteps([]);
|
|
57
|
-
setCurrentTourId(undefined);
|
|
58
|
-
setHighlightRect(undefined);
|
|
59
|
-
setTooltipPosition({ top: 0, left: 0 });
|
|
60
|
-
setIsPositioned(false);
|
|
61
|
-
}, [currentTourId, currentStep, steps, onTourEnd]);
|
|
62
|
-
const endTour = useCallback(() => {
|
|
63
|
-
finishTour('closed');
|
|
64
|
-
}, [finishTour]);
|
|
65
|
-
const nextStep = useCallback(() => {
|
|
66
|
-
if (currentStep < steps.length - 1) {
|
|
67
|
-
setCurrentStep((previous) => previous + 1);
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
finishTour('completed');
|
|
71
|
-
}
|
|
72
|
-
}, [currentStep, steps.length, finishTour]);
|
|
73
|
-
const previousStep = useCallback(() => {
|
|
74
|
-
if (currentStep > 0) {
|
|
75
|
-
setCurrentStep((previous) => previous - 1);
|
|
76
|
-
}
|
|
77
|
-
}, [currentStep]);
|
|
78
|
-
const goToStep = useCallback((step) => {
|
|
79
|
-
if (step >= 0 && step < steps.length) {
|
|
80
|
-
setCurrentStep(step);
|
|
81
|
-
}
|
|
82
|
-
}, [steps.length]);
|
|
83
|
-
const updatePositions = useCallback(() => {
|
|
84
|
-
if (!isActive || steps.length === 0) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
const currentTourStep = steps[currentStep];
|
|
88
|
-
if (!currentTourStep) {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
void (async () => {
|
|
92
|
-
const rect = await platform.measureElement(currentTourStep.target);
|
|
93
|
-
if (!rect) {
|
|
94
|
-
if (currentStep < steps.length - 1) {
|
|
95
|
-
setCurrentStep((previous) => previous + 1);
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
finishTour('target-missing');
|
|
99
|
-
}
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
setHighlightRect(rect);
|
|
103
|
-
const placement = currentTourStep.placement ?? defaultPlacement;
|
|
104
|
-
const tooltipDimensions = platform.measureTooltip(tooltipRef);
|
|
105
|
-
const viewportDimensions = platform.getViewportDimensions();
|
|
106
|
-
const position = calculateTooltipPosition(rect, placement, tooltipDimensions, viewportDimensions);
|
|
107
|
-
setTooltipPosition(position);
|
|
108
|
-
setIsPositioned(true);
|
|
109
|
-
})();
|
|
110
|
-
}, [isActive, currentStep, steps, finishTour, platform]);
|
|
111
|
-
useEffect(() => {
|
|
112
|
-
if (!isActive || steps.length === 0) {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
const currentTourStep = steps[currentStep];
|
|
116
|
-
if (!currentTourStep) {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
const runStep = async () => {
|
|
120
|
-
if (currentTourStep.onBeforeStep) {
|
|
121
|
-
await currentTourStep.onBeforeStep(currentTourStep.target);
|
|
122
|
-
await new Promise((resolve) => {
|
|
123
|
-
setTimeout(resolve, domUpdateDelayMs);
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
const rect = await platform.measureElement(currentTourStep.target);
|
|
127
|
-
if (!rect) {
|
|
128
|
-
if (currentStep < steps.length - 1) {
|
|
129
|
-
setCurrentStep((previous) => previous + 1);
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
finishTour('target-missing');
|
|
133
|
-
}
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
setHighlightRect(rect);
|
|
137
|
-
setIsPositioned(false);
|
|
138
|
-
setTimeout(() => {
|
|
139
|
-
setPositionKey((k) => k + 1);
|
|
140
|
-
}, initialPositionDelayMs);
|
|
141
|
-
};
|
|
142
|
-
void runStep();
|
|
143
|
-
}, [isActive, currentStep, steps, finishTour, platform]);
|
|
144
|
-
useEffect(() => {
|
|
145
|
-
if (!isActive || !highlightRect || steps.length === 0) {
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
const currentTourStep = steps[currentStep];
|
|
149
|
-
if (!currentTourStep) {
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
let attempts = 0;
|
|
153
|
-
let timeoutId;
|
|
154
|
-
let animationFrameId;
|
|
155
|
-
const tryPosition = () => {
|
|
156
|
-
attempts++;
|
|
157
|
-
animationFrameId = platform.scheduleFrame(() => {
|
|
158
|
-
void (async () => {
|
|
159
|
-
const rect = await platform.measureElement(currentTourStep.target);
|
|
160
|
-
if (!rect || rect.width === 0 || rect.height === 0) {
|
|
161
|
-
if (attempts < maxPositionAttempts) {
|
|
162
|
-
timeoutId = setTimeout(tryPosition, positionRetryDelayMs);
|
|
163
|
-
}
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
setHighlightRect(rect);
|
|
167
|
-
const placement = currentTourStep.placement ?? defaultPlacement;
|
|
168
|
-
const tooltipDimensions = platform.measureTooltip(tooltipRef);
|
|
169
|
-
const viewportDimensions = platform.getViewportDimensions();
|
|
170
|
-
const position = calculateTooltipPosition(rect, placement, tooltipDimensions, viewportDimensions);
|
|
171
|
-
setTooltipPosition(position);
|
|
172
|
-
setIsPositioned(true);
|
|
173
|
-
await platform.scrollToElement(currentTourStep.target, placement, tooltipDimensions.height);
|
|
174
|
-
})();
|
|
175
|
-
});
|
|
176
|
-
};
|
|
177
|
-
timeoutId = setTimeout(tryPosition, initialPositionDelayMs);
|
|
178
|
-
return () => {
|
|
179
|
-
clearTimeout(timeoutId);
|
|
180
|
-
if (animationFrameId) {
|
|
181
|
-
platform.cancelFrame(animationFrameId);
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
}, [isActive, currentStep, steps, highlightRect, positionKey, platform]);
|
|
185
|
-
useEffect(() => {
|
|
186
|
-
if (!isActive) {
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
|
-
return platform.subscribeToKeyboard({
|
|
190
|
-
onEscape() {
|
|
191
|
-
finishTour('escape');
|
|
192
|
-
},
|
|
193
|
-
onNext: nextStep,
|
|
194
|
-
onPrev: previousStep,
|
|
195
|
-
});
|
|
196
|
-
}, [isActive, finishTour, nextStep, previousStep, platform]);
|
|
197
|
-
useEffect(() => {
|
|
198
|
-
if (!isActive) {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
return platform.subscribeToLayout(updatePositions);
|
|
202
|
-
}, [isActive, updatePositions, platform]);
|
|
203
|
-
const currentTourStep = steps[currentStep];
|
|
204
|
-
const contextValue = useMemo(() => ({
|
|
205
|
-
isActive,
|
|
206
|
-
currentStep,
|
|
207
|
-
steps,
|
|
208
|
-
currentTourId,
|
|
209
|
-
startTour,
|
|
210
|
-
endTour,
|
|
211
|
-
nextStep,
|
|
212
|
-
prevStep: previousStep,
|
|
213
|
-
goToStep,
|
|
214
|
-
}), [isActive, currentStep, steps, currentTourId, startTour, endTour, nextStep, previousStep, goToStep]);
|
|
215
|
-
return (_jsxs(TourContext, { value: contextValue, children: [children, isActive && highlightRect && isMounted
|
|
216
|
-
? createPortal(_jsxs(_Fragment, { children: [_jsx(Overlay, { closeOnOverlayClick: closeOnOverlayClick, highlightRect: highlightRect, theme: resolvedTheme, onClose: () => {
|
|
217
|
-
finishTour('blur');
|
|
218
|
-
} }), currentTourStep ? (_jsx(Tooltip, { ref: tooltipRef, content: currentTourStep.content, currentStep: currentStep, i18n: i18n, isPositioned: isPositioned, position: tooltipPosition, theme: resolvedTheme, title: currentTourStep.title, totalSteps: steps.length, onClose: endTour, onGoToStep: goToStep, onNext: nextStep, onPrev: previousStep })) : null] }), document.body)
|
|
219
|
-
: null] }));
|
|
4
|
+
import { TourRoot } from '../shared/react/tour-root.js';
|
|
5
|
+
import { useTourCore } from '../shared/react/tour-provider-core.js';
|
|
6
|
+
import { useIsomorphicLayoutEffect } from '../shared/react/use-isomorphic-layout-effect.hook.js';
|
|
7
|
+
import { TourOverlay } from '../shared/renderer/tour-overlay.js';
|
|
8
|
+
import { acquireSafeAreaProbe } from './dom/viewport.util.js';
|
|
9
|
+
import { createWebPlatform } from './dom/web-platform.js';
|
|
10
|
+
import { webRenderer } from './layer/web-renderer.js';
|
|
11
|
+
/**
|
|
12
|
+
* Provides `useTour()` to its children and renders the tour. Place it around your app, inside
|
|
13
|
+
* your router if steps navigate between pages.
|
|
14
|
+
*/
|
|
15
|
+
export function TourProvider(props) {
|
|
16
|
+
const [platform] = useState(createWebPlatform);
|
|
17
|
+
const { engine, overlay } = useTourCore(props, platform, webRenderer);
|
|
18
|
+
useEffect(() => acquireSafeAreaProbe(), []);
|
|
19
|
+
return (_jsxs(TourRoot, { engine: engine, children: [props.children, _jsx(WebMount, { platform: platform, overlay: overlay })] }));
|
|
20
|
+
}
|
|
21
|
+
/** Draws the tour into its own element at the end of `<body>`, on the client only (after hydration). */
|
|
22
|
+
function WebMount({ platform, overlay, }) {
|
|
23
|
+
const [container, setContainer] = useState(undefined);
|
|
24
|
+
useIsomorphicLayoutEffect(() => {
|
|
25
|
+
const host = platform.mountHost();
|
|
26
|
+
setContainer(host.container);
|
|
27
|
+
return host.unmount;
|
|
28
|
+
}, [platform]);
|
|
29
|
+
return container ? createPortal(_jsx(TourOverlay, { ...overlay }), container) : null;
|
|
220
30
|
}
|
|
221
31
|
//# sourceMappingURL=tour-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tour-provider.js","sourceRoot":"","sources":["../../src/react-platform/tour-provider.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"tour-provider.js","sourceRoot":"","sources":["../../src/react-platform/tour-provider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAiB,SAAS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QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IACf,OAAO,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,KAAC,WAAW,OAAK,OAAO,GAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAClF,CAAC"}
|
package/dist/react.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { TourProvider, type TourProviderProps } from './react-platform';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export type {
|
|
5
|
-
export type {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export type {
|
|
9
|
-
export {
|
|
10
|
-
|
|
1
|
+
export { TourProvider, type TourProviderProps } from './react-platform/tour-provider.js';
|
|
2
|
+
export { useTour } from './shared/react/use-tour.hook.js';
|
|
3
|
+
export { getTruncatedDots, type DotItem } from './shared/utils/get-truncated-dots.util.js';
|
|
4
|
+
export type { TourContextType } from './shared/types/tour-context.type.js';
|
|
5
|
+
export type { StartTourOptions, TourEndCallback, TourEndInfo, TourEndReason } from './shared/types/tour-end-info.type.js';
|
|
6
|
+
export type { TourI18n } from './shared/types/tour-i18n.type.js';
|
|
7
|
+
export type { TourPlacement, TourStep, TourStepContext, TourTarget } from './shared/types/tour-step.type.js';
|
|
8
|
+
export type { TourTheme } from './shared/types/tour-theme.type.js';
|
|
9
|
+
export type { TourTooltipProps } from './shared/types/tour-tooltip-props.type.js';
|
|
10
|
+
//# sourceMappingURL=react.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,YAAY,EAAE,KAAK,iBAAiB,EAAC,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAC,OAAO,EAAC,MAAM,iCAAiC,CAAC;AACxD,OAAO,EAAC,gBAAgB,EAAE,KAAK,OAAO,EAAC,MAAM,2CAA2C,CAAC;AACzF,YAAY,EAAC,eAAe,EAAC,MAAM,qCAAqC,CAAC;AACzE,YAAY,EAAC,gBAAgB,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAC,MAAM,sCAAsC,CAAC;AACxH,YAAY,EAAC,QAAQ,EAAC,MAAM,kCAAkC,CAAC;AAC/D,YAAY,EAAC,aAAa,EAAE,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAC,MAAM,kCAAkC,CAAC;AAC3G,YAAY,EAAC,SAAS,EAAC,MAAM,mCAAmC,CAAC;AACjE,YAAY,EAAC,gBAAgB,EAAC,MAAM,2CAA2C,CAAC"}
|
package/dist/react.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export { getTruncatedDots
|
|
6
|
-
export { findVisibleElement } from './react-platform';
|
|
7
|
-
export { webPlatformAdapter } from './react-platform';
|
|
1
|
+
'use client';
|
|
2
|
+
// Web entry point: import from '@robertlinde/react-tour-kit/react'.
|
|
3
|
+
export { TourProvider } from './react-platform/tour-provider.js';
|
|
4
|
+
export { useTour } from './shared/react/use-tour.hook.js';
|
|
5
|
+
export { getTruncatedDots } from './shared/utils/get-truncated-dots.util.js';
|
|
8
6
|
//# sourceMappingURL=react.js.map
|
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,oEAAoE;AAEpE,OAAO,EAAC,YAAY,EAAyB,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAC,OAAO,EAAC,MAAM,iCAAiC,CAAC;AACxD,OAAO,EAAC,gBAAgB,EAAe,MAAM,2CAA2C,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs `run` with a child signal that is aborted when `parent` aborts or after `timeoutMs`.
|
|
3
|
+
* Resolves `undefined` on timeout, abort, or when `run` rejects (callers check `parent.aborted`
|
|
4
|
+
* to tell an abort apart from a timeout).
|
|
5
|
+
*
|
|
6
|
+
* Only `aborted` and the `abort` event are used, because the AbortController shipped with
|
|
7
|
+
* React Native supports nothing else (no `reason`, no `throwIfAborted`, no `AbortSignal.any`).
|
|
8
|
+
*/
|
|
9
|
+
export declare function withTimeout<T>(run: (signal: AbortSignal) => Promise<T | undefined>, parent: AbortSignal, timeoutMs: number): Promise<T | undefined>;
|
|
10
|
+
/**
|
|
11
|
+
* Resolves on the next frame, after `ms` at the latest (browsers stop frames in background tabs,
|
|
12
|
+
* but not timers), or right away when `signal` is aborted.
|
|
13
|
+
*/
|
|
14
|
+
export declare function nextFrameOrAfter(signal: AbortSignal, ms: number): Promise<void>;
|
|
15
|
+
/** Resolves on the next frame, or immediately when `signal` is aborted. */
|
|
16
|
+
export declare function nextFrame(signal: AbortSignal): Promise<void>;
|
|
17
|
+
//# sourceMappingURL=abort.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abort.util.d.ts","sourceRoot":"","sources":["../../../src/shared/engine/abort.util.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAAC,CAAC,EACjC,GAAG,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,EACpD,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CA0BxB;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBrF;AAED,2EAA2E;AAC3E,wBAAsB,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBlE"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { requestFrame } from '../utils/frame.util.js';
|
|
2
|
+
/**
|
|
3
|
+
* Runs `run` with a child signal that is aborted when `parent` aborts or after `timeoutMs`.
|
|
4
|
+
* Resolves `undefined` on timeout, abort, or when `run` rejects (callers check `parent.aborted`
|
|
5
|
+
* to tell an abort apart from a timeout).
|
|
6
|
+
*
|
|
7
|
+
* Only `aborted` and the `abort` event are used, because the AbortController shipped with
|
|
8
|
+
* React Native supports nothing else (no `reason`, no `throwIfAborted`, no `AbortSignal.any`).
|
|
9
|
+
*/
|
|
10
|
+
export async function withTimeout(run, parent, timeoutMs) {
|
|
11
|
+
if (parent.aborted) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
const child = new AbortController();
|
|
15
|
+
const abortChild = () => {
|
|
16
|
+
child.abort();
|
|
17
|
+
};
|
|
18
|
+
parent.addEventListener('abort', abortChild);
|
|
19
|
+
let timer;
|
|
20
|
+
const stopped = new Promise((resolve) => {
|
|
21
|
+
child.signal.addEventListener('abort', () => {
|
|
22
|
+
resolve(undefined);
|
|
23
|
+
});
|
|
24
|
+
timer = setTimeout(abortChild, timeoutMs);
|
|
25
|
+
});
|
|
26
|
+
try {
|
|
27
|
+
return await Promise.race([run(child.signal).catch(() => undefined), stopped]);
|
|
28
|
+
}
|
|
29
|
+
finally {
|
|
30
|
+
clearTimeout(timer);
|
|
31
|
+
parent.removeEventListener('abort', abortChild);
|
|
32
|
+
child.abort();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolves on the next frame, after `ms` at the latest (browsers stop frames in background tabs,
|
|
37
|
+
* but not timers), or right away when `signal` is aborted.
|
|
38
|
+
*/
|
|
39
|
+
export async function nextFrameOrAfter(signal, ms) {
|
|
40
|
+
if (signal.aborted) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
await new Promise((resolve) => {
|
|
44
|
+
const done = () => {
|
|
45
|
+
cancelFrame();
|
|
46
|
+
clearTimeout(timer);
|
|
47
|
+
signal.removeEventListener('abort', done);
|
|
48
|
+
resolve();
|
|
49
|
+
};
|
|
50
|
+
const cancelFrame = requestFrame(done);
|
|
51
|
+
const timer = setTimeout(done, ms);
|
|
52
|
+
signal.addEventListener('abort', done);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/** Resolves on the next frame, or immediately when `signal` is aborted. */
|
|
56
|
+
export async function nextFrame(signal) {
|
|
57
|
+
if (signal.aborted) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
await new Promise((resolve) => {
|
|
61
|
+
const onAbort = () => {
|
|
62
|
+
cancelFrame();
|
|
63
|
+
resolve();
|
|
64
|
+
};
|
|
65
|
+
const cancelFrame = requestFrame(() => {
|
|
66
|
+
signal.removeEventListener('abort', onAbort);
|
|
67
|
+
resolve();
|
|
68
|
+
});
|
|
69
|
+
signal.addEventListener('abort', onAbort);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=abort.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abort.util.js","sourceRoot":"","sources":["../../../src/shared/engine/abort.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,GAAoD,EACpD,MAAmB,EACnB,SAAiB;IAEjB,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;IACpC,MAAM,UAAU,GAAG,GAAS,EAAE;QAC5B,KAAK,CAAC,KAAK,EAAE,CAAC;IAChB,CAAC,CAAC;IAEF,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAA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AO,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,2EAA2E;AAC3E,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,MAAmB;IACjD,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO;IACT,CAAC;IAED,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QAClC,MAAM,OAAO,GAAG,GAAS,EAAE;YACzB,WAAW,EAAE,CAAC;YACd,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC;QAEF,MAAM,WAAW,GAAG,YAAY,CAAC,GAAG,EAAE;YACpC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC7C,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const isDevelopment: boolean;
|
|
2
|
+
/** Prints a development-only warning, prefixed so it is easy to find. */
|
|
3
|
+
export declare function devWarn(message: string): void;
|
|
4
|
+
/**
|
|
5
|
+
* Reports an error thrown by user code without interrupting the tour. Uses `reportError` where it
|
|
6
|
+
* exists (browsers; error trackers pick it up), otherwise `console.error` (React Native shows a
|
|
7
|
+
* red box in development and does not crash in production).
|
|
8
|
+
*/
|
|
9
|
+
export declare function reportError(error: unknown): void;
|
|
10
|
+
/** Calls a user callback; errors (sync or async) are reported and never propagate. */
|
|
11
|
+
export declare function safeInvoke(callback: () => unknown): void;
|
|
12
|
+
//# sourceMappingURL=report.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.util.d.ts","sourceRoot":"","sources":["../../../src/shared/engine/report.util.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,aAAa,SAAyB,CAAC;AAEpD,yEAAyE;AACzE,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAK7C;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAShD;AAWD,sFAAsF;AACtF,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,OAAO,GAAG,IAAI,CASxD"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
function computeIsDevelopment() {
|
|
2
|
+
try {
|
|
3
|
+
// Bundlers (Vite, webpack, Metro, Next.js) replace this expression statically.
|
|
4
|
+
return process.env.NODE_ENV !== 'production';
|
|
5
|
+
}
|
|
6
|
+
catch {
|
|
7
|
+
// Unbundled browser ESM: no `process`, treat as production.
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export const isDevelopment = computeIsDevelopment();
|
|
12
|
+
/** Prints a development-only warning, prefixed so it is easy to find. */
|
|
13
|
+
export function devWarn(message) {
|
|
14
|
+
if (isDevelopment) {
|
|
15
|
+
// eslint-disable-next-line no-console -- intentional development warning
|
|
16
|
+
console.warn(`[react-tour-kit] ${message}`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Reports an error thrown by user code without interrupting the tour. Uses `reportError` where it
|
|
21
|
+
* exists (browsers; error trackers pick it up), otherwise `console.error` (React Native shows a
|
|
22
|
+
* red box in development and does not crash in production).
|
|
23
|
+
*/
|
|
24
|
+
export function reportError(error) {
|
|
25
|
+
const report = globalThis.reportError;
|
|
26
|
+
if (typeof report === 'function') {
|
|
27
|
+
report(error);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
// eslint-disable-next-line no-console -- fallback error reporting
|
|
31
|
+
console.error(error);
|
|
32
|
+
}
|
|
33
|
+
function isPromiseLike(value) {
|
|
34
|
+
return ((typeof value === 'object' || typeof value === 'function') &&
|
|
35
|
+
value !== null &&
|
|
36
|
+
'then' in value &&
|
|
37
|
+
typeof value.then === 'function');
|
|
38
|
+
}
|
|
39
|
+
/** Calls a user callback; errors (sync or async) are reported and never propagate. */
|
|
40
|
+
export function safeInvoke(callback) {
|
|
41
|
+
try {
|
|
42
|
+
const result = callback();
|
|
43
|
+
if (isPromiseLike(result)) {
|
|
44
|
+
result.then(undefined, reportError);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
reportError(error);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=report.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.util.js","sourceRoot":"","sources":["../../../src/shared/engine/report.util.ts"],"names":[],"mappings":"AAEA,SAAS,oBAAoB;IAC3B,IAAI,CAAC;QACH,+EAA+E;QAC/E,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACP,4DAA4D;QAC5D,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,oBAAoB,EAAE,CAAC;AAEpD,yEAAyE;AACzE,MAAM,UAAU,OAAO,CAAC,OAAe;IACrC,IAAI,aAAa,EAAE,CAAC;QAClB,yEAAyE;QACzE,OAAO,CAAC,IAAI,CAAC,oBAAoB,OAAO,EAAE,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,MAAM,MAAM,GAAI,UAAuD,CAAC,WAAW,CAAC;IACpF,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE,CAAC;QACjC,MAAM,CAAC,KAAK,CAAC,CAAC;QACd,OAAO;IACT,CAAC;IAED,kEAAkE;IAClE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,CACL,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,UAAU,CAAC;QAC1D,KAAK,KAAK,IAAI;QACd,MAAM,IAAI,KAAK;QACf,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CACjC,CAAC;AACJ,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,UAAU,CAAC,QAAuB;IAChD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;QAC1B,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1B,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Box, Insets, Viewport } from '../geometry/geometry.type.js';
|
|
2
|
+
import type { TourTarget } from '../types/tour-step.type.js';
|
|
3
|
+
/** Where a target is, in the tour layer's coordinate space. */
|
|
4
|
+
export type TargetMeasurement = {
|
|
5
|
+
readonly rect: Box;
|
|
6
|
+
/**
|
|
7
|
+
* The area the target can be seen through: the intersection of the scroll containers and
|
|
8
|
+
* clipping ancestors around it. `undefined` when nothing clips it.
|
|
9
|
+
*/
|
|
10
|
+
readonly clip: Box | undefined;
|
|
11
|
+
/** Elements that stay put while the content scrolls (sticky headers, floating buttons) and overlap the target. */
|
|
12
|
+
readonly occluders?: readonly Box[];
|
|
13
|
+
};
|
|
14
|
+
export type RevealRequest = {
|
|
15
|
+
/** Space to keep around the target, most generous first. */
|
|
16
|
+
readonly margins: readonly Insets[];
|
|
17
|
+
/** `'smooth'` is downgraded to `'instant'` by the adapter when the user prefers reduced motion. */
|
|
18
|
+
readonly behavior: 'smooth' | 'instant';
|
|
19
|
+
readonly signal: AbortSignal;
|
|
20
|
+
/**
|
|
21
|
+
* Must be called right before the first scroll starts, and not at all if nothing scrolls, with
|
|
22
|
+
* where the target will be once scrolling has finished.
|
|
23
|
+
*/
|
|
24
|
+
readonly onScrollStart: (destination: Box) => void;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Everything platform-specific the engine needs. Adapters never own timeouts; they only have to
|
|
28
|
+
* stop work promptly when a signal is aborted.
|
|
29
|
+
*/
|
|
30
|
+
export type TourAdapter = {
|
|
31
|
+
/** Measures a target, or resolves `undefined` when it is not rendered. */
|
|
32
|
+
readonly measure: (target: TourTarget) => Promise<TargetMeasurement | undefined>;
|
|
33
|
+
/** Resolves as soon as the target is rendered and measurable. Event-driven where the platform allows; never busy-polls. */
|
|
34
|
+
readonly waitForTarget: (target: TourTarget, signal: AbortSignal) => Promise<TargetMeasurement | undefined>;
|
|
35
|
+
/**
|
|
36
|
+
* The visible area of the tour layer and what covers its edges (safe areas, the on-screen
|
|
37
|
+
* keyboard, stuck navigation bars). Pass the step's target so that a bar containing it does not
|
|
38
|
+
* count as covering it.
|
|
39
|
+
*/
|
|
40
|
+
readonly getViewport: (target?: TourTarget) => Viewport;
|
|
41
|
+
/**
|
|
42
|
+
* Whether `measure` sees targets move while a scroll animation runs. When it does not (React
|
|
43
|
+
* Native: on the New Architecture, measurements only catch up once a scroll has finished), the
|
|
44
|
+
* highlight moves straight to where the target will end up instead of following it.
|
|
45
|
+
*/
|
|
46
|
+
readonly measuresWhileScrolling: boolean;
|
|
47
|
+
/** Scrolls every container around the target just enough to show it with the given margin, and resolves once scrolling has settled. */
|
|
48
|
+
readonly reveal: (target: TourTarget, request: RevealRequest) => Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Calls `onChange` (at most once per frame) whenever the target's position or size, or the
|
|
51
|
+
* viewport, may have changed. Over-notifying is fine; the engine compares values. Stops when
|
|
52
|
+
* `signal` is aborted. `target` is `undefined` for centred steps (viewport changes only).
|
|
53
|
+
*/
|
|
54
|
+
readonly observe: (target: TourTarget | undefined, onChange: () => void, signal: AbortSignal) => void;
|
|
55
|
+
/** Device pixel ratio, used to place the tooltip on whole device pixels. */
|
|
56
|
+
readonly getPixelRatio?: () => number;
|
|
57
|
+
/** Resolves on the next frame (or right away when `signal` is aborted). */
|
|
58
|
+
readonly nextFrame: (signal: AbortSignal) => Promise<void>;
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=tour-adapter.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tour-adapter.type.d.ts","sourceRoot":"","sources":["../../../src/shared/engine/tour-adapter.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,8BAA8B,CAAC;AACxE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,4BAA4B,CAAC;AAE3D,+DAA+D;AAC/D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,GAAG,GAAG,SAAS,CAAC;IAC/B,kHAAkH;IAClH,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,EAAE,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,mGAAmG;IACnG,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,aAAa,EAAE,CAAC,WAAW,EAAE,GAAG,KAAK,IAAI,CAAC;CACpD,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAC;IACjF,2HAA2H;IAC3H,QAAQ,CAAC,aAAa,E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