@robertlinde/react-tour-kit 0.8.8 → 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 -8
- package/dist/react-native.d.ts.map +1 -0
- package/dist/react-native.js +7 -6
- 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 -8
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +5 -6
- 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 -5
- package/dist/shared/index.js +0 -5
- 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,24 @@
|
|
|
1
|
+
import { useMemo, useState, useSyncExternalStore } from 'react';
|
|
2
|
+
import { createTourAdapter } from '../platform/create-tour-adapter.js';
|
|
3
|
+
import { DefaultTooltip } from '../renderer/default-tooltip.js';
|
|
4
|
+
import { resolveI18n } from '../utils/i18n.util.js';
|
|
5
|
+
import { resolveTheme } from '../utils/theme.util.js';
|
|
6
|
+
import { useTourEngine } from './tour-root.js';
|
|
7
|
+
const neverReduced = () => false;
|
|
8
|
+
/**
|
|
9
|
+
* What every `TourProvider` does, whatever the platform: creates the engine on top of the
|
|
10
|
+
* platform's facts, resolves theme and texts, and prepares the overlay. `platform` and `renderer`
|
|
11
|
+
* must keep their identity for the lifetime of the provider.
|
|
12
|
+
*/
|
|
13
|
+
export function useTourCore(props, platform, renderer) {
|
|
14
|
+
const [adapter] = useState(() => createTourAdapter(platform));
|
|
15
|
+
const engine = useTourEngine(adapter, props.onTourEnd);
|
|
16
|
+
const isReducedMotion = useSyncExternalStore(platform.reducedMotion.subscribe, platform.reducedMotion.get, neverReduced);
|
|
17
|
+
const theme = useMemo(() => resolveTheme(props.theme), [props.theme]);
|
|
18
|
+
const i18n = useMemo(() => resolveI18n(props.i18n), [props.i18n]);
|
|
19
|
+
const Tooltip = props.TooltipComponent ?? DefaultTooltip;
|
|
20
|
+
const isOverlayDismissible = props.closeOnOverlayClick ?? true;
|
|
21
|
+
const overlay = useMemo(() => ({ engine, renderer, theme, i18n, Tooltip, isOverlayDismissible, isReducedMotion }), [engine, renderer, theme, i18n, Tooltip, isOverlayDismissible, isReducedMotion]);
|
|
22
|
+
return { engine, overlay };
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=tour-provider-core.js.map
|
|
@@ -0,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zD,MAAM,oBAAoB,GAAG,KAAK,CAAC,mBAAmB,IAAI,IAAI,CAAC;IAC/D,MAAM,OAAO,GAAG,OAAO,CACrB,GAAG,EAAE,CAAC,CAAC,EAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAC,CAAC,EACvF,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,oBAAoB,EAAE,eAAe,CAAC,CAChF,CAAC;IACF,OAAO,EAAC,MAAM,EAAE,OAAO,EAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { TourAdapter } from '../engine/tour-adapter.type.js';
|
|
3
|
+
import { type TourEngine } from '../engine/tour-engine.js';
|
|
4
|
+
import type { TourEndCallback } from '../types/tour-end-info.type.js';
|
|
5
|
+
/** Creates the engine once and keeps its options in sync with the latest props. */
|
|
6
|
+
export declare function useTourEngine(adapter: TourAdapter, onTourEnd: TourEndCallback | undefined): TourEngine;
|
|
7
|
+
type TourRootProps = {
|
|
8
|
+
readonly engine: TourEngine;
|
|
9
|
+
readonly children: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
/** Provides the public tour context (for `useTour`) and the engine (for the renderer). */
|
|
12
|
+
export declare function TourRoot({ engine, children }: TourRootProps): ReactNode;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=tour-root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tour-root.d.ts","sourceRoot":"","sources":["../../../src/shared/react/tour-root.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,SAAS,EAAqD,MAAM,OAAO,CAAC;AACzF,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAmB,KAAK,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAE3E,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAIpE,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,GAAG,SAAS,GAAG,UAAU,CAQtG;AAED,KAAK,aAAa,GAAG;IACnB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B,CAAC;AAEF,0FAA0F;AAC1F,wBAAgB,QAAQ,CAAC,EAAC,MAAM,EAAE,QAAQ,EAAC,EAAE,aAAa,GAAG,SAAS,CAQrE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useState, useSyncExternalStore } from 'react';
|
|
3
|
+
import { createTourEngine } from '../engine/tour-engine.js';
|
|
4
|
+
import { TourContext, TourEngineContext } from './tour-context.js';
|
|
5
|
+
import { useIsomorphicLayoutEffect } from './use-isomorphic-layout-effect.hook.js';
|
|
6
|
+
/** Creates the engine once and keeps its options in sync with the latest props. */
|
|
7
|
+
export function useTourEngine(adapter, onTourEnd) {
|
|
8
|
+
const [engine] = useState(() => createTourEngine({ adapter, onTourEnd }));
|
|
9
|
+
// Latest props: callback identity never matters, so inline callbacks cannot restart anything.
|
|
10
|
+
useIsomorphicLayoutEffect(() => {
|
|
11
|
+
engine.configure({ adapter, onTourEnd });
|
|
12
|
+
});
|
|
13
|
+
useEffect(() => engine.mount(), [engine]);
|
|
14
|
+
return engine;
|
|
15
|
+
}
|
|
16
|
+
/** Provides the public tour context (for `useTour`) and the engine (for the renderer). */
|
|
17
|
+
export function TourRoot({ engine, children }) {
|
|
18
|
+
const state = useSyncExternalStore(engine.subscribe, engine.getPublicState, engine.getPublicState);
|
|
19
|
+
const value = useMemo(() => ({ ...state, ...engine.actions }), [state, engine]);
|
|
20
|
+
return (_jsx(TourEngineContext.Provider, { value: engine, children: _jsx(TourContext.Provider, { value: value, children: children }) }));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=tour-root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tour-root.js","sourceRoot":"","sources":["../../../src/shared/react/tour-root.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAiB,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAC,MAAM,OAAO,CAAC;AAEzF,OAAO,EAAC,gBAAgB,EAAkB,MAAM,0BAA0B,CAAC;AAG3E,OAAO,EAAC,WAAW,EAAE,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAC,yBAAyB,EAAC,MAAM,wCAAwC,CAAC;AAEjF,mFAAmF;AACnF,MAAM,UAAU,aAAa,CAAC,OAAoB,EAAE,SAAsC;IACxF,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,EAAC,OAAO,EAAE,SAAS,EAAC,CAAC,CAAC,CAAC;IACxE,8FAA8F;IAC9F,yBAAyB,CAAC,GAAG,EAAE;QAC7B,MAAM,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,SAAS,EAAC,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IACH,SAAS,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1C,OAAO,MAAM,CAAC;AAChB,CAAC;AAOD,0FAA0F;AAC1F,MAAM,UAAU,QAAQ,CAAC,EAAC,MAAM,EAAE,QAAQ,EAAgB;IACxD,MAAM,KAAK,GAAG,oBAAoB,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IACnG,MAAM,KAAK,GAAG,OAAO,CAAkB,GAAG,EAAE,CAAC,CAAC,EAAC,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC,OAAO,EAAC,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/F,OAAO,CACL,KAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,YACvC,KAAC,WAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAwB,GAC1C,CAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { useLayoutEffect } from 'react';
|
|
2
|
+
/** `useLayoutEffect` in the browser and on React Native; `useEffect` during server rendering (avoids React 18's SSR warning). */
|
|
3
|
+
export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
|
|
4
|
+
//# sourceMappingURL=use-isomorphic-layout-effect.hook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-isomorphic-layout-effect.hook.d.ts","sourceRoot":"","sources":["../../../src/shared/react/use-isomorphic-layout-effect.hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,eAAe,EAAC,MAAM,OAAO,CAAC;AAKjD,iIAAiI;AACjI,eAAO,MAAM,yBAAyB,wBAAmD,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { useEffect, useLayoutEffect } from 'react';
|
|
2
|
+
const canUseLayoutEffect = typeof document !== 'undefined' || (typeof navigator !== 'undefined' && navigator.product === 'ReactNative');
|
|
3
|
+
/** `useLayoutEffect` in the browser and on React Native; `useEffect` during server rendering (avoids React 18's SSR warning). */
|
|
4
|
+
export const useIsomorphicLayoutEffect = canUseLayoutEffect ? useLayoutEffect : useEffect;
|
|
5
|
+
//# sourceMappingURL=use-isomorphic-layout-effect.hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-isomorphic-layout-effect.hook.js","sourceRoot":"","sources":["../../../src/shared/react/use-isomorphic-layout-effect.hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,eAAe,EAAC,MAAM,OAAO,CAAC;AAEjD,MAAM,kBAAkB,GACtB,OAAO,QAAQ,KAAK,WAAW,IAAI,CAAC,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,CAAC,OAAO,KAAK,aAAa,CAAC,CAAC;AAE/G,iIAAiI;AACjI,MAAM,CAAC,MAAM,yBAAyB,GAAG,kBAAkB,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TourEngine, TourViewState } from '../engine/tour-engine.js';
|
|
2
|
+
export declare function useTourEngineContext(): TourEngine;
|
|
3
|
+
/** What the renderer draws. Re-renders only on structural changes (step, phase, layout). */
|
|
4
|
+
export declare function useTourView(engine: TourEngine): TourViewState;
|
|
5
|
+
//# sourceMappingURL=use-tour-view.hook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-tour-view.hook.d.ts","sourceRoot":"","sources":["../../../src/shared/react/use-tour-view.hook.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,UAAU,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAGxE,wBAAgB,oBAAoB,IAAI,UAAU,CAOjD;AAED,4FAA4F;AAC5F,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,aAAa,CAE7D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useContext, useSyncExternalStore } from 'react';
|
|
2
|
+
import { TourEngineContext } from './tour-context.js';
|
|
3
|
+
export function useTourEngineContext() {
|
|
4
|
+
const engine = useContext(TourEngineContext);
|
|
5
|
+
if (!engine) {
|
|
6
|
+
throw new Error('[react-tour-kit] This component must be rendered inside <TourProvider>.');
|
|
7
|
+
}
|
|
8
|
+
return engine;
|
|
9
|
+
}
|
|
10
|
+
/** What the renderer draws. Re-renders only on structural changes (step, phase, layout). */
|
|
11
|
+
export function useTourView(engine) {
|
|
12
|
+
return useSyncExternalStore(engine.subscribe, engine.getViewState, engine.getViewState);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=use-tour-view.hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-tour-view.hook.js","sourceRoot":"","sources":["../../../src/shared/react/use-tour-view.hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,oBAAoB,EAAC,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAEpD,MAAM,UAAU,oBAAoB;IAClC,MAAM,MAAM,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC7C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,yEAAyE,CAAC,CAAC;IAC7F,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,WAAW,CAAC,MAAkB;IAC5C,OAAO,oBAAoB,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;AAC1F,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TourContextType } from '../types/tour-context.type.js';
|
|
2
|
+
/**
|
|
3
|
+
* The current tour's state and the functions to control it. The functions keep their identity for
|
|
4
|
+
* the lifetime of the `TourProvider`, so they are safe to use in effect dependencies.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useTour(): TourContextType;
|
|
7
|
+
//# sourceMappingURL=use-tour.hook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-tour.hook.d.ts","sourceRoot":"","sources":["../../../src/shared/react/use-tour.hook.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAGnE;;;GAGG;AACH,wBAAgB,OAAO,IAAI,eAAe,CAEzC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { TourContext } from './tour-context.js';
|
|
3
|
+
/**
|
|
4
|
+
* The current tour's state and the functions to control it. The functions keep their identity for
|
|
5
|
+
* the lifetime of the `TourProvider`, so they are safe to use in effect dependencies.
|
|
6
|
+
*/
|
|
7
|
+
export function useTour() {
|
|
8
|
+
return useContext(TourContext);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=use-tour.hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-tour.hook.js","sourceRoot":"","sources":["../../../src/shared/react/use-tour.hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAE9C;;;GAGG;AACH,MAAM,UAAU,OAAO;IACrB,OAAO,UAAU,CAAC,WAAW,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { TourTooltipProps } from '../types/tour-tooltip-props.type.js';
|
|
3
|
+
/** The built-in tooltip: the same structure and texts on every platform, drawn with the platform's card parts. */
|
|
4
|
+
export declare function DefaultTooltip(props: TourTooltipProps): ReactNode;
|
|
5
|
+
//# sourceMappingURL=default-tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-tooltip.d.ts","sourceRoot":"","sources":["../../../src/shared/renderer/default-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AAI1E,kHAAkH;AAClH,wBAAgB,cAAc,CAAC,KAAK,EAAE,gBAAgB,GAAG,SAAS,CA6CjE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRendererContext } from './renderer-context.js';
|
|
3
|
+
import { tooltipModel } from './tooltip-model.js';
|
|
4
|
+
/** The built-in tooltip: the same structure and texts on every platform, drawn with the platform's card parts. */
|
|
5
|
+
export function DefaultTooltip(props) {
|
|
6
|
+
const { renderer, i18n } = useRendererContext();
|
|
7
|
+
const { Card, Arrow, Header, Counter, CloseButton, Body, Title, Content, Footer, Button, Dots, Dot, Ellipsis } = renderer.card;
|
|
8
|
+
const model = tooltipModel(props, i18n);
|
|
9
|
+
return (_jsxs(Card, { placement: props.placement, children: [model.arrow ? _jsx(Arrow, { side: model.arrow.side, offset: model.arrow.offset }) : null, _jsxs(Header, { children: [_jsx(Counter, { text: model.counter }), _jsx(CloseButton, { label: model.closeLabel, onPress: props.onClose })] }), _jsxs(Body, { children: [_jsx(Title, { id: props.titleId, children: props.step.title }), _jsx(Content, { id: props.descriptionId, children: props.step.content })] }), _jsxs(Footer, { children: [_jsx(Button, { kind: "previous", label: model.previous.label, isDisabled: model.previous.isDisabled, onPress: props.onPrev }), model.dots ? (_jsx(Dots, { label: model.counter, children: model.dots.map((dot) => dot.kind === 'ellipsis' ? (_jsx(Ellipsis, {}, dot.key)) : (_jsx(Dot, { label: dot.label, isCurrent: dot.isCurrent, onPress: () => {
|
|
10
|
+
props.onGoToStep(dot.index);
|
|
11
|
+
} }, dot.index))) })) : null, _jsx(Button, { kind: "next", label: model.next.label, isDisabled: false, onPress: props.onNext })] })] }));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=default-tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-tooltip.js","sourceRoot":"","sources":["../../../src/shared/renderer/default-tooltip.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAEhD,kHAAkH;AAClH,MA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AI,CAAC,CAAC,CAAC,CACZ,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,OAAO,YACvB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CACtB,GAAG,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,CACxB,KAAC,QAAQ,MAAM,GAAG,CAAC,GAAG,CAAI,CAC3B,CAAC,CAAC,CAAC,CACF,KAAC,GAAG,IAEF,KAAK,EAAE,GAAG,CAAC,KAAK,EAChB,SAAS,EAAE,GAAG,CAAC,SAAS,EACxB,OAAO,EAAE,GAAG,EAAE;gCACZ,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;4BAC9B,CAAC,IALI,GAAG,CAAC,KAAK,CAMd,CACH,CACF,GACI,CACR,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,MAAM,IAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,GAAI,IAClF,IACJ,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { TourPlacement } from '../types/tour-step.type.js';
|
|
2
|
+
import type { Entrance } from './renderer.type.js';
|
|
3
|
+
/** Timing of every animation, the same on every platform. */
|
|
4
|
+
export declare const motion: {
|
|
5
|
+
readonly fadeInMs: 200;
|
|
6
|
+
readonly fadeOutMs: 150;
|
|
7
|
+
/** With reduced motion turned on: short fades, no movement. */
|
|
8
|
+
readonly reducedMs: 100;
|
|
9
|
+
/** The spotlight moving from one target to the next. */
|
|
10
|
+
readonly morphMs: 250;
|
|
11
|
+
/** The spotlight following a target that is being scrolled into view, frame by frame. */
|
|
12
|
+
readonly chaseMs: 120;
|
|
13
|
+
readonly enterMs: 200;
|
|
14
|
+
/** The tooltip starts entering while the spotlight is still on its way. */
|
|
15
|
+
readonly enterDelayMs: 100;
|
|
16
|
+
/** Distance (from the target's side) and scale the tooltip enters from. */
|
|
17
|
+
readonly enterOffset: 6;
|
|
18
|
+
readonly enterScale: 0.96;
|
|
19
|
+
/** If the first step takes longer than this to prepare (navigation, data), the screen is dimmed meanwhile. */
|
|
20
|
+
readonly waitingDimDelayMs: 300;
|
|
21
|
+
/** Control points of the standard easing curve (`cubic-bezier`). */
|
|
22
|
+
readonly easing: readonly [0.2, 0, 0, 1];
|
|
23
|
+
};
|
|
24
|
+
export declare function fadeDuration(isClosing: boolean, isReducedMotion: boolean): number;
|
|
25
|
+
export declare function entranceFor(placement: TourPlacement | 'center', { isDelayed, isReducedMotion }: {
|
|
26
|
+
readonly isDelayed: boolean;
|
|
27
|
+
readonly isReducedMotion: boolean;
|
|
28
|
+
}): Entrance;
|
|
29
|
+
//# sourceMappingURL=motion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../../../src/shared/renderer/motion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,oBAAoB,CAAC;AAEjD,6DAA6D;AAC7D,eAAO,MAAM,MAAM;;;IAGjB,+DAA+D;;IAE/D,wDAAwD;;IAExD,yFAAyF;;;IAGzF,2EAA2E;;IAE3E,2EAA2E;;;IAG3E,8GAA8G;;IAE9G,oEAAoE;;CAE5D,CAAC;AAEX,wBAAgB,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,GAAG,MAAM,CAMjF;AAWD,wBAAgB,WAAW,CACzB,SAAS,EAAE,aAAa,GAAG,QAAQ,EACnC,EAAC,SAAS,EAAE,eAAe,EAAC,EAAE;IAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAA;CAAC,GAC7F,QAAQ,CAaV"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** Timing of every animation, the same on every platform. */
|
|
2
|
+
export const motion = {
|
|
3
|
+
fadeInMs: 200,
|
|
4
|
+
fadeOutMs: 150,
|
|
5
|
+
/** With reduced motion turned on: short fades, no movement. */
|
|
6
|
+
reducedMs: 100,
|
|
7
|
+
/** The spotlight moving from one target to the next. */
|
|
8
|
+
morphMs: 250,
|
|
9
|
+
/** The spotlight following a target that is being scrolled into view, frame by frame. */
|
|
10
|
+
chaseMs: 120,
|
|
11
|
+
enterMs: 200,
|
|
12
|
+
/** The tooltip starts entering while the spotlight is still on its way. */
|
|
13
|
+
enterDelayMs: 100,
|
|
14
|
+
/** Distance (from the target's side) and scale the tooltip enters from. */
|
|
15
|
+
enterOffset: 6,
|
|
16
|
+
enterScale: 0.96,
|
|
17
|
+
/** If the first step takes longer than this to prepare (navigation, data), the screen is dimmed meanwhile. */
|
|
18
|
+
waitingDimDelayMs: 300,
|
|
19
|
+
/** Control points of the standard easing curve (`cubic-bezier`). */
|
|
20
|
+
easing: [0.2, 0, 0, 1],
|
|
21
|
+
};
|
|
22
|
+
export function fadeDuration(isClosing, isReducedMotion) {
|
|
23
|
+
if (isReducedMotion) {
|
|
24
|
+
return motion.reducedMs;
|
|
25
|
+
}
|
|
26
|
+
return isClosing ? motion.fadeOutMs : motion.fadeInMs;
|
|
27
|
+
}
|
|
28
|
+
const entranceDirection = {
|
|
29
|
+
// Above the target: comes down towards it; below: comes up; and so on.
|
|
30
|
+
top: [0, 1],
|
|
31
|
+
bottom: [0, -1],
|
|
32
|
+
left: [1, 0],
|
|
33
|
+
right: [-1, 0],
|
|
34
|
+
center: [0, 0],
|
|
35
|
+
};
|
|
36
|
+
export function entranceFor(placement, { isDelayed, isReducedMotion }) {
|
|
37
|
+
if (isReducedMotion) {
|
|
38
|
+
return { dx: 0, dy: 0, scale: 1, durationMs: motion.reducedMs, delayMs: 0 };
|
|
39
|
+
}
|
|
40
|
+
const [x, y] = entranceDirection[placement];
|
|
41
|
+
return {
|
|
42
|
+
dx: x * motion.enterOffset,
|
|
43
|
+
dy: y * motion.enterOffset,
|
|
44
|
+
scale: motion.enterScale,
|
|
45
|
+
durationMs: motion.enterMs,
|
|
46
|
+
delayMs: isDelayed ? motion.enterDelayMs : 0,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=motion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"motion.js","sourceRoot":"","sources":["../../../src/shared/renderer/motion.ts"],"names":[],"mappings":"AAGA,6DAA6D;AAC7D,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,QAAQ,EAAE,GAAG;IACb,SAAS,EAAE,GAAG;IACd,+DAA+D;IAC/D,SAAS,EAAE,GAAG;IACd,wDAAwD;IACxD,OAAO,EAAE,GAAG;IACZ,yFAAyF;IACzF,OAAO,EAAE,GAAG;IACZ,OAAO,EAAE,GAAG;IACZ,2EAA2E;IAC3E,YAAY,EAAE,GAAG;IACjB,2EAA2E;IAC3E,WAAW,EAAE,CAAC;IACd,UAAU,EAAE,IAAI;IAChB,8GAA8G;IAC9G,iBAAiB,EAAE,GAAG;IACtB,oEAAoE;IACpE,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;CACd,CAAC;AAEX,MAAM,UAAU,YAAY,CAAC,SAAkB,EAAE,eAAwB;IACvE,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED,OAAO,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;AACxD,CAAC;AAED,MAAM,iBAAiB,GAAgE;IACrF,uEAAuE;IACvE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACX,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACf,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACZ,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;CACf,CAAC;AAEF,MAAM,UAAU,WAAW,CACzB,SAAmC,EACnC,EAAC,SAAS,EAAE,eAAe,EAAmE;IAE9F,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,EAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,CAAC,EAAC,CAAC;IAC5E,CAAC;IAED,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC5C,OAAO;QACL,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,WAAW;QAC1B,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,WAAW;QAC1B,KAAK,EAAE,MAAM,CAAC,UAAU;QACxB,UAAU,EAAE,MAAM,CAAC,OAAO;QAC1B,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;KAC7C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ResolvedI18n } from '../utils/i18n.util.js';
|
|
2
|
+
import type { ResolvedTheme } from '../utils/theme.util.js';
|
|
3
|
+
import type { TourRenderer } from './renderer.type.js';
|
|
4
|
+
export type RendererContextValue = {
|
|
5
|
+
readonly renderer: TourRenderer;
|
|
6
|
+
readonly theme: ResolvedTheme;
|
|
7
|
+
readonly i18n: ResolvedI18n;
|
|
8
|
+
};
|
|
9
|
+
/** The platform's primitives, the theme and the texts, for everything drawn inside the tour. Internal. */
|
|
10
|
+
export declare const RendererContext: import("react").Context<RendererContextValue | undefined>;
|
|
11
|
+
export declare function useRendererContext(): RendererContextValue;
|
|
12
|
+
export type TooltipLimits = {
|
|
13
|
+
readonly maxWidth: number;
|
|
14
|
+
readonly maxHeight: number;
|
|
15
|
+
};
|
|
16
|
+
export declare const TooltipLimitsContext: import("react").Context<TooltipLimits>;
|
|
17
|
+
//# sourceMappingURL=renderer-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer-context.d.ts","sourceRoot":"","sources":["../../../src/shared/renderer/renderer-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAErD,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;CAC7B,CAAC;AAEF,0GAA0G;AAC1G,eAAO,MAAM,eAAe,2DAA6D,CAAC;AAG1F,wBAAgB,kBAAkB,IAAI,oBAAoB,CAOzD;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B,CAAC;AAIF,eAAO,MAAM,oBAAoB,wCAA+B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
/** The platform's primitives, the theme and the texts, for everything drawn inside the tour. Internal. */
|
|
3
|
+
export const RendererContext = createContext(undefined);
|
|
4
|
+
RendererContext.displayName = 'TourRendererContext';
|
|
5
|
+
export function useRendererContext() {
|
|
6
|
+
const value = useContext(RendererContext);
|
|
7
|
+
if (!value) {
|
|
8
|
+
throw new Error('[react-tour-kit] The built-in tooltip can only be rendered by the tour.');
|
|
9
|
+
}
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
/** Size limits of the tooltip being rendered; platforms that cannot express them in styles size the card with them. */
|
|
13
|
+
const defaultLimits = { maxWidth: 380, maxHeight: 600 };
|
|
14
|
+
export const TooltipLimitsContext = createContext(defaultLimits);
|
|
15
|
+
TooltipLimitsContext.displayName = 'TourTooltipLimitsContext';
|
|
16
|
+
//# sourceMappingURL=renderer-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer-context.js","sourceRoot":"","sources":["../../../src/shared/renderer/renderer-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,UAAU,EAAC,MAAM,OAAO,CAAC;AAWhD,0GAA0G;AAC1G,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAmC,SAAS,CAAC,CAAC;AAC1F,eAAe,CAAC,WAAW,GAAG,qBAAqB,CAAC;AAEpD,MAAM,UAAU,kBAAkB;IAChC,MAAM,KAAK,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAC1C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,yEAAyE,CAAC,CAAC;IAC7F,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAOD,uHAAuH;AACvH,MAAM,aAAa,GAAkB,EAAC,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAC,CAAC;AACrE,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC,aAAa,CAAC,CAAC;AACjE,oBAAoB,CAAC,WAAW,GAAG,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import type { TourPhase } from '../engine/tour-engine.js';
|
|
3
|
+
import type { TooltipLayout } from '../geometry/compute-tooltip-layout.util.js';
|
|
4
|
+
import type { Box, Point, Side, Size } from '../geometry/geometry.type.js';
|
|
5
|
+
import type { TourPlacement } from '../types/tour-step.type.js';
|
|
6
|
+
import type { ResolvedTheme } from '../utils/theme.util.js';
|
|
7
|
+
/**
|
|
8
|
+
* How a platform draws the tour: primitives only. Every decision — what is visible, when and how
|
|
9
|
+
* things animate, which texts are shown, what a press means — is made by the shared overlay
|
|
10
|
+
* (`TourOverlay`) and default tooltip (`DefaultTooltip`), so all platforms behave the same.
|
|
11
|
+
*
|
|
12
|
+
* Every primitive is required: a platform that lacks one does not compile. A new feature either
|
|
13
|
+
* lives in the shared code (and every platform gets it), or needs a new primitive here (and every
|
|
14
|
+
* platform has to draw it).
|
|
15
|
+
*/
|
|
16
|
+
export type TourRenderer = {
|
|
17
|
+
/** The full-screen layer everything else is drawn in. */
|
|
18
|
+
readonly Layer: ComponentType<LayerProps>;
|
|
19
|
+
/** The area behind the spotlight that receives presses on the dimmed part of the screen. */
|
|
20
|
+
readonly Backdrop: ComponentType<BackdropProps>;
|
|
21
|
+
/** The dimmed overlay with a hole over the target. */
|
|
22
|
+
readonly Spotlight: ComponentType<SpotlightProps>;
|
|
23
|
+
/** Places the tooltip, plays its entrance, reports its size and takes focus. */
|
|
24
|
+
readonly TooltipFrame: ComponentType<TooltipFrameProps>;
|
|
25
|
+
/** Renders a tooltip invisibly with given size limits and reports its size. */
|
|
26
|
+
readonly MeasureFrame: ComponentType<MeasureFrameProps>;
|
|
27
|
+
/** The pieces of the built-in tooltip card. */
|
|
28
|
+
readonly card: CardParts;
|
|
29
|
+
};
|
|
30
|
+
/** What the user asked for through platform input (keys, gestures, system buttons). */
|
|
31
|
+
export type TourIntent =
|
|
32
|
+
/** Go to the next step. */
|
|
33
|
+
'next'
|
|
34
|
+
/** Go to the previous step. */
|
|
35
|
+
| 'previous'
|
|
36
|
+
/** Leave the tour like Escape does (ends with `'escape'`). */
|
|
37
|
+
| 'escape'
|
|
38
|
+
/** Leave the tour with a system back action (ends with `'closed'`). */
|
|
39
|
+
| 'back';
|
|
40
|
+
export type LayerProps = {
|
|
41
|
+
readonly children: ReactNode;
|
|
42
|
+
readonly state: TourPhase | 'closing';
|
|
43
|
+
/** Faded in (`true`) or out, over `fadeMs`. */
|
|
44
|
+
readonly isVisible: boolean;
|
|
45
|
+
readonly fadeMs: number;
|
|
46
|
+
/** False while fading out: input is no longer handled. */
|
|
47
|
+
readonly isInteractive: boolean;
|
|
48
|
+
readonly theme: ResolvedTheme;
|
|
49
|
+
/** Id of the element showing the step's title, `undefined` while no step is shown. */
|
|
50
|
+
readonly titleId: string | undefined;
|
|
51
|
+
/** Id of the element showing the step's content, `undefined` while no step is shown. */
|
|
52
|
+
readonly descriptionId: string | undefined;
|
|
53
|
+
/** Accessible name for when a custom tooltip renders no element with `titleId`. */
|
|
54
|
+
readonly fallbackLabel: string;
|
|
55
|
+
/** Text for screen readers when the step changes; empty when there is nothing to announce. */
|
|
56
|
+
readonly announcement: string;
|
|
57
|
+
/** Changes whenever a step is shown. */
|
|
58
|
+
readonly stepKey: number | undefined;
|
|
59
|
+
readonly onIntent: (intent: TourIntent) => void;
|
|
60
|
+
};
|
|
61
|
+
export type BackdropProps = {
|
|
62
|
+
/** Whether a press closes the tour (to show it with a pointer cursor, for example). */
|
|
63
|
+
readonly isDismissible: boolean;
|
|
64
|
+
/** A press on the dimmed area, at a point in layer coordinates. */
|
|
65
|
+
readonly onPress: (point: Point) => void;
|
|
66
|
+
};
|
|
67
|
+
export type SpotlightProps = {
|
|
68
|
+
/** The hole over the target, or `undefined`: no hole, everything dimmed (shrunk to the layer's centre). */
|
|
69
|
+
readonly hole: Box | undefined;
|
|
70
|
+
/** How changes are animated; `undefined`: applied instantly. */
|
|
71
|
+
readonly transition: SpotlightTransition | undefined;
|
|
72
|
+
readonly theme: ResolvedTheme;
|
|
73
|
+
};
|
|
74
|
+
export type SpotlightTransition = {
|
|
75
|
+
readonly durationMs: number;
|
|
76
|
+
readonly easing: 'standard' | 'linear';
|
|
77
|
+
};
|
|
78
|
+
export type TooltipFrameProps = {
|
|
79
|
+
readonly children: ReactNode;
|
|
80
|
+
readonly layout: TooltipLayout;
|
|
81
|
+
/** Played once, when the frame mounts. */
|
|
82
|
+
readonly entrance: Entrance;
|
|
83
|
+
/** A step change is being prepared: ignore presses. */
|
|
84
|
+
readonly isBusy: boolean;
|
|
85
|
+
/** The next target is being scrolled into view: hide the tooltip (keep its size). */
|
|
86
|
+
readonly isHidden: boolean;
|
|
87
|
+
readonly onSize: (size: Size) => void;
|
|
88
|
+
readonly onIntent: (intent: TourIntent) => void;
|
|
89
|
+
};
|
|
90
|
+
/** The tooltip's entrance: from this offset, scale and transparency to its place, after `delayMs`. */
|
|
91
|
+
export type Entrance = {
|
|
92
|
+
readonly dx: number;
|
|
93
|
+
readonly dy: number;
|
|
94
|
+
readonly scale: number;
|
|
95
|
+
readonly durationMs: number;
|
|
96
|
+
readonly delayMs: number;
|
|
97
|
+
};
|
|
98
|
+
export type MeasureFrameProps = {
|
|
99
|
+
readonly children: ReactNode;
|
|
100
|
+
readonly maxWidth: number;
|
|
101
|
+
readonly maxHeight: number;
|
|
102
|
+
readonly onSize: (size: Size) => void;
|
|
103
|
+
};
|
|
104
|
+
/** The pieces of the built-in tooltip, put together by the shared `DefaultTooltip`. */
|
|
105
|
+
export type CardParts = {
|
|
106
|
+
readonly Card: ComponentType<CardProps>;
|
|
107
|
+
readonly Arrow: ComponentType<ArrowProps>;
|
|
108
|
+
readonly Header: ComponentType<ContainerProps>;
|
|
109
|
+
readonly Counter: ComponentType<CounterProps>;
|
|
110
|
+
readonly CloseButton: ComponentType<CloseButtonProps>;
|
|
111
|
+
/** Scrolls when the content is taller than the space available. */
|
|
112
|
+
readonly Body: ComponentType<ContainerProps>;
|
|
113
|
+
readonly Title: ComponentType<TextPartProps>;
|
|
114
|
+
readonly Content: ComponentType<TextPartProps>;
|
|
115
|
+
readonly Footer: ComponentType<ContainerProps>;
|
|
116
|
+
readonly Button: ComponentType<ButtonProps>;
|
|
117
|
+
readonly Dots: ComponentType<DotsProps>;
|
|
118
|
+
readonly Dot: ComponentType<DotProps>;
|
|
119
|
+
readonly Ellipsis: ComponentType<EllipsisProps>;
|
|
120
|
+
};
|
|
121
|
+
export type CardProps = {
|
|
122
|
+
readonly placement: TourPlacement | 'center';
|
|
123
|
+
readonly children: ReactNode;
|
|
124
|
+
};
|
|
125
|
+
export type ArrowProps = {
|
|
126
|
+
readonly side: Side;
|
|
127
|
+
/** Distance from the card's left edge (top/bottom) or top edge (left/right) to the arrow's tip. */
|
|
128
|
+
readonly offset: number;
|
|
129
|
+
};
|
|
130
|
+
export type ContainerProps = {
|
|
131
|
+
readonly children: ReactNode;
|
|
132
|
+
};
|
|
133
|
+
export type CounterProps = {
|
|
134
|
+
readonly text: string;
|
|
135
|
+
};
|
|
136
|
+
export type CloseButtonProps = {
|
|
137
|
+
readonly label: string;
|
|
138
|
+
readonly onPress: () => void;
|
|
139
|
+
};
|
|
140
|
+
/** The title or the content: any React content, with the id screen readers find it by. */
|
|
141
|
+
export type TextPartProps = {
|
|
142
|
+
readonly id: string;
|
|
143
|
+
readonly children: ReactNode;
|
|
144
|
+
};
|
|
145
|
+
export type ButtonProps = {
|
|
146
|
+
readonly kind: 'previous' | 'next';
|
|
147
|
+
readonly label: string;
|
|
148
|
+
readonly isDisabled: boolean;
|
|
149
|
+
readonly onPress: () => void;
|
|
150
|
+
};
|
|
151
|
+
export type DotsProps = {
|
|
152
|
+
/** Describes the group, for example "2 of 5". */
|
|
153
|
+
readonly label: string;
|
|
154
|
+
readonly children: ReactNode;
|
|
155
|
+
};
|
|
156
|
+
export type DotProps = {
|
|
157
|
+
readonly label: string;
|
|
158
|
+
readonly isCurrent: boolean;
|
|
159
|
+
readonly onPress: () => void;
|
|
160
|
+
};
|
|
161
|
+
export type EllipsisProps = {
|
|
162
|
+
readonly children?: never;
|
|
163
|
+
};
|
|
164
|
+
//# sourceMappingURL=renderer.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.type.d.ts","sourceR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AAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,iDAAiD;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC;CAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.type.js","sourceRoot":"","sources":["../../../src/shared/renderer/renderer.type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Side } from '../geometry/geometry.type.js';
|
|
2
|
+
import type { TourTooltipProps } from '../types/tour-tooltip-props.type.js';
|
|
3
|
+
import { type ResolvedI18n } from '../utils/i18n.util.js';
|
|
4
|
+
export type TooltipDot = {
|
|
5
|
+
readonly kind: 'dot';
|
|
6
|
+
readonly index: number;
|
|
7
|
+
readonly label: string;
|
|
8
|
+
readonly isCurrent: boolean;
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: 'ellipsis';
|
|
11
|
+
readonly key: string;
|
|
12
|
+
};
|
|
13
|
+
/** Everything the built-in tooltip shows, worked out once for every platform. */
|
|
14
|
+
export type TooltipModel = {
|
|
15
|
+
readonly counter: string;
|
|
16
|
+
readonly closeLabel: string;
|
|
17
|
+
readonly arrow: {
|
|
18
|
+
readonly side: Side;
|
|
19
|
+
readonly offset: number;
|
|
20
|
+
} | undefined;
|
|
21
|
+
readonly previous: {
|
|
22
|
+
readonly label: string;
|
|
23
|
+
readonly isDisabled: boolean;
|
|
24
|
+
};
|
|
25
|
+
readonly next: {
|
|
26
|
+
readonly label: string;
|
|
27
|
+
};
|
|
28
|
+
/** `undefined` for a single step. */
|
|
29
|
+
readonly dots: readonly TooltipDot[] | undefined;
|
|
30
|
+
};
|
|
31
|
+
export declare function tooltipModel(props: TourTooltipProps, i18n: ResolvedI18n): TooltipModel;
|
|
32
|
+
//# sourceMappingURL=tooltip-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip-model.d.ts","sourceRoot":"","sources":["../../../src/shared/renderer/tooltip-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,8BAA8B,CAAC;AACvD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AAE1E,OAAO,EAAiB,KAAK,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAExE,MAAM,MAAM,UAAU,GAClB;IAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAAC,GACnG;IAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAC,CAAC;AAEtD,iFAAiF;AACjF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE;QAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAC,GAAG,SAAS,CAAC;IAC3E,QAAQ,CAAC,QAAQ,EAAE;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;KAAC,CAAC;IAC1E,QAAQ,CAAC,IAAI,EAAE;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC;IACxC,qCAAqC;IACrC,QAAQ,CAAC,IAAI,EAAE,SAAS,UAAU,EAAE,GAAG,SAAS,CAAC;CAClD,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,YAAY,GAAG,YAAY,CAuBtF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { getTruncatedDots } from '../utils/get-truncated-dots.util.js';
|
|
2
|
+
import { formatTemplate } from '../utils/i18n.util.js';
|
|
3
|
+
export function tooltipModel(props, i18n) {
|
|
4
|
+
const { currentStep, totalSteps, placement, arrowOffset } = props;
|
|
5
|
+
const isLast = currentStep >= totalSteps - 1;
|
|
6
|
+
return {
|
|
7
|
+
counter: formatTemplate(i18n.stepCounterTemplate, { current: currentStep + 1, total: totalSteps }),
|
|
8
|
+
closeLabel: i18n.closeAriaLabel,
|
|
9
|
+
arrow: arrowOffset === undefined || placement === 'center' ? undefined : { side: placement, offset: arrowOffset },
|
|
10
|
+
previous: { label: i18n.prevLabel, isDisabled: currentStep === 0 },
|
|
11
|
+
next: { label: isLast ? i18n.finishLabel : i18n.nextLabel },
|
|
12
|
+
dots: totalSteps > 1
|
|
13
|
+
? getTruncatedDots(currentStep, totalSteps).map((item) => item.type === 'ellipsis'
|
|
14
|
+
? { kind: 'ellipsis', key: `ellipsis-${item.position}` }
|
|
15
|
+
: {
|
|
16
|
+
kind: 'dot',
|
|
17
|
+
index: item.index,
|
|
18
|
+
label: formatTemplate(i18n.dotAriaLabelTemplate, { step: item.index + 1, total: totalSteps }),
|
|
19
|
+
isCurrent: item.index === currentStep,
|
|
20
|
+
})
|
|
21
|
+
: undefined,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=tooltip-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip-model.js","sourceRoot":"","sources":["../../../src/shared/renderer/tooltip-model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAC,cAAc,EAAoB,MAAM,uBAAuB,CAAC;AAiBxE,MAAM,UAAU,YAAY,CAAC,KAAuB,EAAE,IAAkB;IACtE,MAAM,EAAC,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAC,GAAG,KAAK,CAAC;IAChE,MAAM,MAAM,GAAG,WAAW,IAAI,UAAU,GAAG,CAAC,CAAC;IAC7C,OAAO;QACL,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAC,OAAO,EAAE,WAAW,GAAG,CAAC,EAAE,KAAK,EAAE,UAAU,EAAC,CAAC;QAChG,UAAU,EAAE,IAAI,CAAC,cAAc;QAC/B,KAAK,EAAE,WAAW,KAAK,SAAS,IAAI,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAC;QAC/G,QAAQ,EAAE,EAAC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,WAAW,KAAK,CAAC,EAAC;QAChE,IAAI,EAAE,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAC;QACzD,IAAI,EACF,UAAU,GAAG,CAAC;YACZ,CAAC,CAAC,gBAAgB,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAc,EAAE,CACjE,IAAI,CAAC,IAAI,KAAK,UAAU;gBACtB,CAAC,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,IAAI,CAAC,QAAQ,EAAE,EAAC;gBACtD,CAAC,CAAC;oBACE,IAAI,EAAE,KAAK;oBACX,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAC,IAAI,EAAE,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,UAAU,EAAC,CAAC;oBAC3F,SAAS,EAAE,IAAI,CAAC,KAAK,KAAK,WAAW;iBACtC,CACN;YACH,CAAC,CAAC,SAAS;KAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ComponentType, type ReactNode } from 'react';
|
|
2
|
+
import { type TourEngine } from '../engine/tour-engine.js';
|
|
3
|
+
import type { TourTooltipProps } from '../types/tour-tooltip-props.type.js';
|
|
4
|
+
import { type ResolvedI18n } from '../utils/i18n.util.js';
|
|
5
|
+
import type { ResolvedTheme } from '../utils/theme.util.js';
|
|
6
|
+
import type { TourRenderer } from './renderer.type.js';
|
|
7
|
+
export type TourOverlayProps = {
|
|
8
|
+
readonly engine: TourEngine;
|
|
9
|
+
readonly renderer: TourRenderer;
|
|
10
|
+
readonly theme: ResolvedTheme;
|
|
11
|
+
readonly i18n: ResolvedI18n;
|
|
12
|
+
readonly Tooltip: ComponentType<TourTooltipProps>;
|
|
13
|
+
readonly isOverlayDismissible: boolean;
|
|
14
|
+
readonly isReducedMotion: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The tour on screen, for every platform: decides what is visible, how it animates, what it
|
|
18
|
+
* says and what input means, and draws it with the platform's primitives ({@link TourRenderer}).
|
|
19
|
+
* Keeps the last step on screen while the tour fades out.
|
|
20
|
+
*/
|
|
21
|
+
export declare function TourOverlay(props: TourOverlayProps): ReactNode;
|
|
22
|
+
/** The plain text of React content (strings, numbers, arrays and the children of elements). */
|
|
23
|
+
export declare function textOf(node: ReactNode): string;
|
|
24
|
+
//# sourceMappingURL=tour-overlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tour-overlay.d.ts","sourceRoot":"","sources":["../../../src/shared/renderer/tour-overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AACf,OAAO,EAGL,KAAK,UAAU,EAGhB,MAAM,0BAA0B,CAAC;AAIlC,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAiB,KAAK,YAAY,EAAC,MAAM,uBAAuB,CAAC;AACxE,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAG1D,OAAO,KAAK,EAAkC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAEtF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAClD,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;IACvC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;CACnC,CAAC;AAMF;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,SAAS,CAqB9D;AAiXD,+FAA+F;AAC/F,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAc9C"}
|