react-native-screen-transitions 3.9.0 → 3.10.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/lib/commonjs/shared/animation/snap-to.js +2 -0
- package/lib/commonjs/shared/animation/snap-to.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/components/boundary-target.js +19 -20
- package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/create-boundary-component.js +16 -2
- package/lib/commonjs/shared/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js +5 -0
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +1 -3
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/index.js +4 -3
- package/lib/commonjs/shared/components/boundary/index.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +47 -187
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/index.js +21 -13
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/host.js +1 -12
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +40 -33
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js +3 -4
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +46 -130
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js +45 -9
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/host-registry.store.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js +2 -29
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/handoff-target.js +33 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/handoff-target.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/resolve-portal.js +19 -15
- package/lib/commonjs/shared/components/boundary/portal/utils/resolve-portal.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/teleport-control.js +1 -10
- package/lib/commonjs/shared/components/boundary/portal/utils/teleport-control.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +18 -36
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js +7 -0
- package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/utils/resolve-boundary-target.js +29 -0
- package/lib/commonjs/shared/components/boundary/utils/resolve-boundary-target.js.map +1 -0
- package/lib/commonjs/shared/components/masked-view.js +9 -1
- package/lib/commonjs/shared/components/masked-view.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +3 -1
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +9 -1
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js +2 -0
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js.map +1 -1
- package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js +4 -1
- package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/gestures.provider.js +2 -8
- package/lib/commonjs/shared/providers/screen/gestures/gestures.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +37 -3
- package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-release.js +3 -2
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-release.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/types.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/transition-visual-state.js +42 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/transition-visual-state.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-gate.js +11 -5
- package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-gate.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +23 -10
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +10 -8
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/links.js +4 -4
- package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
- package/lib/commonjs/shared/stores/scroll.store.js +20 -2
- package/lib/commonjs/shared/stores/scroll.store.js.map +1 -1
- package/lib/commonjs/shared/stores/system.store.js +2 -0
- package/lib/commonjs/shared/stores/system.store.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js +23 -1
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/animate.js +14 -2
- package/lib/commonjs/shared/utils/animation/animate.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/spring/spring.js +22 -2
- package/lib/commonjs/shared/utils/animation/spring/spring.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/spring/springUtils.js +96 -0
- package/lib/commonjs/shared/utils/animation/spring/springUtils.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/state.js +4 -0
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js +17 -5
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +44 -20
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/drag.js +2 -31
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/drag.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js +3 -17
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
- package/lib/module/shared/animation/snap-to.js +2 -0
- package/lib/module/shared/animation/snap-to.js.map +1 -1
- package/lib/module/shared/components/boundary/components/boundary-target.js +19 -20
- package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/module/shared/components/boundary/create-boundary-component.js +17 -3
- package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js +5 -0
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +1 -3
- package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/index.js +3 -2
- package/lib/module/shared/components/boundary/index.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +49 -189
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js +21 -13
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js +2 -13
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +43 -36
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js +3 -4
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +50 -134
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js +44 -9
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/host-registry.store.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js +1 -27
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/utils/handoff-target.js +28 -0
- package/lib/module/shared/components/boundary/portal/utils/handoff-target.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/utils/resolve-portal.js +19 -15
- package/lib/module/shared/components/boundary/portal/utils/resolve-portal.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/utils/teleport-control.js +0 -8
- package/lib/module/shared/components/boundary/portal/utils/teleport-control.js.map +1 -1
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +19 -37
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/module/shared/components/boundary/utils/refresh-signals.js +7 -0
- package/lib/module/shared/components/boundary/utils/refresh-signals.js.map +1 -1
- package/lib/module/shared/components/boundary/utils/resolve-boundary-target.js +24 -0
- package/lib/module/shared/components/boundary/utils/resolve-boundary-target.js.map +1 -0
- package/lib/module/shared/components/masked-view.js +10 -2
- package/lib/module/shared/components/masked-view.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/backdrop.js +3 -1
- package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +10 -2
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js +2 -0
- package/lib/module/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js.map +1 -1
- package/lib/module/shared/providers/helpers/measured-bounds-writes.js +4 -1
- package/lib/module/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/gestures.provider.js +2 -8
- package/lib/module/shared/providers/screen/gestures/gestures.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js +1 -0
- package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +35 -2
- package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +1 -0
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-release.js +3 -2
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-release.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/types.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/transition-visual-state.js +35 -0
- package/lib/module/shared/providers/screen/styles/helpers/transition-visual-state.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/helpers/visibility-gate.js +11 -5
- package/lib/module/shared/providers/screen/styles/helpers/visibility-gate.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +23 -10
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +10 -8
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/links.js +4 -4
- package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
- package/lib/module/shared/stores/scroll.store.js +17 -0
- package/lib/module/shared/stores/scroll.store.js.map +1 -1
- package/lib/module/shared/stores/system.store.js +2 -0
- package/lib/module/shared/stores/system.store.js.map +1 -1
- package/lib/module/shared/utils/animation/animate-to-progress.js +21 -0
- package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/module/shared/utils/animation/animate.js +14 -2
- package/lib/module/shared/utils/animation/animate.js.map +1 -1
- package/lib/module/shared/utils/animation/spring/spring.js +23 -3
- package/lib/module/shared/utils/animation/spring/spring.js.map +1 -1
- package/lib/module/shared/utils/animation/spring/springUtils.js +95 -0
- package/lib/module/shared/utils/animation/spring/springUtils.js.map +1 -1
- package/lib/module/shared/utils/animation/state.js +2 -0
- package/lib/module/shared/utils/bounds/navigation/reveal/math.js +16 -5
- package/lib/module/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js +46 -22
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/drag.js +2 -30
- package/lib/module/shared/utils/bounds/navigation/zoom/drag.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js +4 -18
- package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
- package/lib/typescript/shared/animation/snap-to.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts +2 -1
- package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts +3 -4
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/index.d.ts +6 -9
- package/lib/typescript/shared/components/boundary/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts +1 -3
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.d.ts +1 -10
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts +1 -3
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts +2 -2
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/host-registry.store.d.ts +0 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/host-registry.store.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts +1 -10
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/utils/handoff-target.d.ts +12 -0
- package/lib/typescript/shared/components/boundary/portal/utils/handoff-target.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/utils/resolve-portal.d.ts +2 -3
- package/lib/typescript/shared/components/boundary/portal/utils/resolve-portal.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/utils/teleport-control.d.ts +0 -4
- package/lib/typescript/shared/components/boundary/portal/utils/teleport-control.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +8 -12
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts +1 -0
- package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/utils/resolve-boundary-target.d.ts +12 -0
- package/lib/typescript/shared/components/boundary/utils/resolve-boundary-target.d.ts.map +1 -0
- package/lib/typescript/shared/components/masked-view.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-transition-start-controller.d.ts.map +1 -1
- package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/gestures.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts +2 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-release.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/types.d.ts +1 -9
- package/lib/typescript/shared/providers/screen/gestures/types.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/transition-visual-state.d.ts +18 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/transition-visual-state.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/visibility-gate.d.ts +2 -2
- package/lib/typescript/shared/providers/screen/styles/helpers/visibility-gate.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/links.d.ts +1 -1
- package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
- package/lib/typescript/shared/stores/scroll.store.d.ts +7 -0
- package/lib/typescript/shared/stores/scroll.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/system.store.d.ts +5 -0
- package/lib/typescript/shared/stores/system.store.d.ts.map +1 -1
- package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts +6 -1
- package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
- package/lib/typescript/shared/utils/animation/animate.d.ts +2 -2
- package/lib/typescript/shared/utils/animation/animate.d.ts.map +1 -1
- package/lib/typescript/shared/utils/animation/spring/spring.d.ts +2 -2
- package/lib/typescript/shared/utils/animation/spring/spring.d.ts.map +1 -1
- package/lib/typescript/shared/utils/animation/spring/springUtils.d.ts +3 -0
- package/lib/typescript/shared/utils/animation/spring/springUtils.d.ts.map +1 -1
- package/lib/typescript/shared/utils/animation/state.d.ts +6 -0
- package/lib/typescript/shared/utils/animation/state.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts +9 -0
- package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/drag.d.ts +2 -11
- package/lib/typescript/shared/utils/bounds/navigation/zoom/drag.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts +7 -4
- package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shared/animation/snap-to.ts +5 -0
- package/src/shared/components/boundary/components/boundary-target.tsx +37 -23
- package/src/shared/components/boundary/create-boundary-component.tsx +29 -3
- package/src/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.ts +11 -0
- package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +3 -9
- package/src/shared/components/boundary/index.tsx +4 -8
- package/src/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +73 -275
- package/src/shared/components/boundary/portal/components/boundary-content-portal/index.tsx +31 -12
- package/src/shared/components/boundary/portal/components/boundary-portal/components/host.tsx +2 -12
- package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx +64 -62
- package/src/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.ts +2 -9
- package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +73 -186
- package/src/shared/components/boundary/portal/components/boundary-portal/index.tsx +72 -12
- package/src/shared/components/boundary/portal/components/boundary-portal/stores/host-registry.store.ts +0 -1
- package/src/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.ts +2 -39
- package/src/shared/components/boundary/portal/utils/handoff-target.ts +48 -0
- package/src/shared/components/boundary/portal/utils/resolve-portal.ts +26 -18
- package/src/shared/components/boundary/portal/utils/teleport-control.ts +0 -12
- package/src/shared/components/boundary/providers/boundary-root.provider.tsx +28 -80
- package/src/shared/components/boundary/utils/refresh-signals.ts +8 -0
- package/src/shared/components/boundary/utils/resolve-boundary-target.tsx +39 -0
- package/src/shared/components/masked-view.tsx +20 -4
- package/src/shared/components/screen-container/layers/backdrop.tsx +3 -1
- package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +14 -4
- package/src/shared/components/screen-lifecycle/hooks/use-transition-start-controller.ts +2 -0
- package/src/shared/providers/helpers/measured-bounds-writes.ts +1 -0
- package/src/shared/providers/screen/gestures/gestures.provider.tsx +2 -10
- package/src/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.ts +1 -0
- package/src/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.ts +74 -3
- package/src/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.ts +1 -0
- package/src/shared/providers/screen/gestures/pinch/behavior/pinch-release.ts +2 -4
- package/src/shared/providers/screen/gestures/types.ts +0 -14
- package/src/shared/providers/screen/styles/helpers/transition-visual-state.ts +44 -0
- package/src/shared/providers/screen/styles/helpers/visibility-gate.ts +17 -7
- package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +30 -15
- package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +14 -13
- package/src/shared/stores/bounds/internals/links.ts +13 -2
- package/src/shared/stores/scroll.store.ts +23 -0
- package/src/shared/stores/system.store.ts +8 -0
- package/src/shared/utils/animation/animate-to-progress.ts +59 -28
- package/src/shared/utils/animation/animate.ts +18 -2
- package/src/shared/utils/animation/spring/spring.ts +36 -1
- package/src/shared/utils/animation/spring/springUtils.ts +130 -0
- package/src/shared/utils/animation/state.ts +8 -0
- package/src/shared/utils/bounds/navigation/reveal/math.ts +21 -5
- package/src/shared/utils/bounds/navigation/zoom/build.ts +77 -23
- package/src/shared/utils/bounds/navigation/zoom/drag.ts +3 -42
- package/src/shared/utils/bounds/navigation/zoom/helpers.ts +9 -23
- package/lib/commonjs/shared/components/boundary/hooks/use-register-target.js +0 -32
- package/lib/commonjs/shared/components/boundary/hooks/use-register-target.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +0 -51
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js +0 -220
- package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/shallow-equal.js +0 -29
- package/lib/commonjs/shared/components/boundary/portal/utils/shallow-equal.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/visible-host.js +0 -25
- package/lib/commonjs/shared/components/boundary/portal/utils/visible-host.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.js +0 -64
- package/lib/commonjs/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.js +0 -21
- package/lib/commonjs/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.js +0 -29
- package/lib/commonjs/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.js +0 -38
- package/lib/commonjs/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/opening-phase.js +0 -32
- package/lib/commonjs/shared/providers/screen/styles/helpers/opening-phase.js.map +0 -1
- package/lib/module/shared/components/boundary/hooks/use-register-target.js +0 -27
- package/lib/module/shared/components/boundary/hooks/use-register-target.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +0 -46
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/utils/ownership.js +0 -213
- package/lib/module/shared/components/boundary/portal/utils/ownership.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/utils/shallow-equal.js +0 -24
- package/lib/module/shared/components/boundary/portal/utils/shallow-equal.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/utils/visible-host.js +0 -20
- package/lib/module/shared/components/boundary/portal/utils/visible-host.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.js +0 -59
- package/lib/module/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.js +0 -15
- package/lib/module/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.js +0 -24
- package/lib/module/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.js +0 -33
- package/lib/module/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.js.map +0 -1
- package/lib/module/shared/providers/screen/styles/helpers/opening-phase.js +0 -26
- package/lib/module/shared/providers/screen/styles/helpers/opening-phase.js.map +0 -1
- package/lib/typescript/shared/components/boundary/hooks/use-register-target.d.ts +0 -10
- package/lib/typescript/shared/components/boundary/hooks/use-register-target.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts +0 -13
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts +0 -34
- package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/utils/shallow-equal.d.ts +0 -8
- package/lib/typescript/shared/components/boundary/portal/utils/shallow-equal.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/utils/visible-host.d.ts +0 -8
- package/lib/typescript/shared/components/boundary/portal/utils/visible-host.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.d.ts +0 -15
- package/lib/typescript/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.d.ts +0 -4
- package/lib/typescript/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.d.ts +0 -5
- package/lib/typescript/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.d.ts +0 -9
- package/lib/typescript/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/opening-phase.d.ts +0 -16
- package/lib/typescript/shared/providers/screen/styles/helpers/opening-phase.d.ts.map +0 -1
- package/src/shared/components/boundary/hooks/use-register-target.ts +0 -43
- package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.tsx +0 -79
- package/src/shared/components/boundary/portal/utils/ownership.ts +0 -319
- package/src/shared/components/boundary/portal/utils/shallow-equal.ts +0 -25
- package/src/shared/components/boundary/portal/utils/visible-host.ts +0 -24
- package/src/shared/providers/screen/gestures/rotation/activation/use-rotation-activation.ts +0 -88
- package/src/shared/providers/screen/gestures/rotation/behavior/rotation-lifecycle.ts +0 -19
- package/src/shared/providers/screen/gestures/rotation/behavior/use-rotation-behavior.ts +0 -47
- package/src/shared/providers/screen/gestures/rotation/use-build-rotation-gesture.ts +0 -50
- package/src/shared/providers/screen/styles/helpers/opening-phase.ts +0 -25
|
@@ -1,219 +1,79 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { runOnJS, useAnimatedProps, useAnimatedReaction, useSharedValue } from "react-native-reanimated";
|
|
3
|
+
import { useAnimatedProps, useSharedValue } from "react-native-reanimated";
|
|
5
4
|
import { useDescriptorsStore } from "../../../../../../providers/screen/descriptors";
|
|
6
5
|
import { useScreenSlots } from "../../../../../../providers/screen/styles";
|
|
7
|
-
import {
|
|
6
|
+
import { hasCloseTransitionFinished } from "../../../../../../providers/screen/styles/helpers/transition-visual-state";
|
|
8
7
|
import { AnimationStore } from "../../../../../../stores/animation.store";
|
|
9
|
-
import { getSourceScreenKeyFromPairKey } from "../../../../../../stores/bounds/helpers/link-pairs.helpers";
|
|
10
8
|
import { pairs } from "../../../../../../stores/bounds/internals/state";
|
|
9
|
+
import { SystemStore } from "../../../../../../stores/system.store";
|
|
10
|
+
import { resolveEnteringHandoffTarget } from "../../../utils/handoff-target";
|
|
11
11
|
import { PORTAL_HOST_NAME_RESET_VALUE } from "../../../utils/naming";
|
|
12
|
-
import {
|
|
13
|
-
import { shallowEqual } from "../../../utils/shallow-equal";
|
|
14
|
-
import { shouldAttachBoundaryPortal } from "../../../utils/teleport-control";
|
|
15
|
-
import { resolveNextVisiblePortalHostName } from "../../../utils/visible-host";
|
|
12
|
+
import { isTeleportEnabled } from "../../../utils/teleport-control";
|
|
16
13
|
import { createBoundaryContentPortalHostName } from "../helpers/host-name";
|
|
17
14
|
export const useBoundaryContentPortalAttachment = ({
|
|
18
|
-
boundaryId
|
|
19
|
-
enabled
|
|
15
|
+
boundaryId
|
|
20
16
|
}) => {
|
|
21
|
-
const
|
|
17
|
+
const {
|
|
18
|
+
slotsMap
|
|
19
|
+
} = useScreenSlots();
|
|
22
20
|
const sourcePairKey = useDescriptorsStore(s => s.derivations.sourcePairKey);
|
|
23
21
|
const currentScreenKey = useDescriptorsStore(s => s.derivations.currentScreenKey);
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const {
|
|
29
|
-
nextInterpolatorReady: activeNextInterpolatorReady,
|
|
30
|
-
slotsMap: activeSlotsMap
|
|
31
|
-
} = activeScreenSlots;
|
|
32
|
-
const requestedPortalHostName = useSharedValue(null);
|
|
33
|
-
const visiblePortalHostName = useSharedValue(null);
|
|
34
|
-
const canSwitchPortalHostImmediately = useSharedValue(0);
|
|
35
|
-
const targetScreenKey = ownership ? ownership.hostScreenKey : null;
|
|
36
|
-
const settledHostScreenKey = ownership?.hostScreenKey ?? null;
|
|
37
|
-
const settledHostProgress = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "progressSettled");
|
|
38
|
-
const settledHostAnimating = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "progressAnimating");
|
|
39
|
-
const settledHostWillAnimate = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "willAnimate");
|
|
40
|
-
const settledHostClosing = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "closing");
|
|
41
|
-
const handoffHostName = targetScreenKey !== null ? createBoundaryContentPortalHostName(targetScreenKey, boundaryId) : null;
|
|
42
|
-
const updatePortalOwnership = useCallback((hostScreenKey, ownerPairKey, ownerScreenKey) => {
|
|
43
|
-
if (hostScreenKey && ownerPairKey && ownerScreenKey) {
|
|
44
|
-
setOwnership(current => {
|
|
45
|
-
if (current?.hostScreenKey === hostScreenKey && current.ownerPairKey === ownerPairKey && current.ownerScreenKey === ownerScreenKey) {
|
|
46
|
-
return current;
|
|
47
|
-
}
|
|
48
|
-
return {
|
|
49
|
-
hostScreenKey,
|
|
50
|
-
ownerPairKey,
|
|
51
|
-
ownerScreenKey,
|
|
52
|
-
status: "complete"
|
|
53
|
-
};
|
|
54
|
-
});
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
setOwnership(current => current ? null : current);
|
|
58
|
-
}, []);
|
|
59
|
-
useLayoutEffect(() => {
|
|
60
|
-
if (!enabled || !ownership || !handoffHostName) {
|
|
61
|
-
requestedPortalHostName.set(null);
|
|
62
|
-
visiblePortalHostName.set(null);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
requestedPortalHostName.set(handoffHostName);
|
|
66
|
-
}, [enabled, handoffHostName, ownership, requestedPortalHostName, visiblePortalHostName]);
|
|
67
|
-
useLayoutEffect(() => {
|
|
68
|
-
return () => {
|
|
69
|
-
requestedPortalHostName.set(null);
|
|
70
|
-
visiblePortalHostName.set(null);
|
|
71
|
-
};
|
|
72
|
-
}, [requestedPortalHostName, visiblePortalHostName]);
|
|
73
|
-
useAnimatedReaction(() => {
|
|
74
|
-
"worklet";
|
|
22
|
+
const nextScreenKey = useDescriptorsStore(s => s.derivations.nextScreenKey);
|
|
23
|
+
const destinationScreenKey = nextScreenKey ?? currentScreenKey;
|
|
24
|
+
const destinationAnimationProgress = SystemStore.getValue(destinationScreenKey, "animationProgress");
|
|
25
|
+
const destinationClosing = AnimationStore.getValue(destinationScreenKey, "closing");
|
|
75
26
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
ownerScreenKey: null,
|
|
81
|
-
status: "clear"
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
const progressAnimating = settledHostAnimating.get();
|
|
85
|
-
const progressSettled = settledHostProgress.get();
|
|
86
|
-
const willAnimate = settledHostWillAnimate.get();
|
|
87
|
-
const closing = settledHostClosing.get();
|
|
88
|
-
const isOwnedHostClosing = !!closing && !!ownership && settledHostScreenKey === ownership.hostScreenKey;
|
|
89
|
-
if (isOwnedHostClosing && ownership) {
|
|
90
|
-
const isClosingComplete = isHandoffHostClosingComplete({
|
|
91
|
-
closing,
|
|
92
|
-
progressAnimating,
|
|
93
|
-
progressSettled,
|
|
94
|
-
willAnimate
|
|
95
|
-
});
|
|
96
|
-
if (!isClosingComplete) {
|
|
97
|
-
return ownership;
|
|
98
|
-
}
|
|
99
|
-
const sourceScreenKey = getSourceScreenKeyFromPairKey(ownership.ownerPairKey);
|
|
100
|
-
return {
|
|
101
|
-
hostScreenKey: sourceScreenKey,
|
|
102
|
-
ownerPairKey: ownership.ownerPairKey,
|
|
103
|
-
ownerScreenKey: sourceScreenKey,
|
|
104
|
-
status: "complete"
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
if (!sourcePairKey) {
|
|
108
|
-
return {
|
|
109
|
-
hostScreenKey: null,
|
|
110
|
-
ownerPairKey: sourcePairKey,
|
|
111
|
-
ownerScreenKey: null,
|
|
112
|
-
status: "clear"
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
return resolveBoundaryPortalOwnership({
|
|
116
|
-
boundaryId,
|
|
117
|
-
currentScreenKey,
|
|
118
|
-
handoff: true,
|
|
119
|
-
isSettledHostClosingComplete: isHandoffHostClosingComplete({
|
|
120
|
-
closing,
|
|
121
|
-
progressAnimating,
|
|
122
|
-
progressSettled,
|
|
123
|
-
willAnimate
|
|
124
|
-
}),
|
|
125
|
-
isSettledHostReady: progressSettled === 1 && progressAnimating === 0,
|
|
126
|
-
pairsState: pairs.get(),
|
|
127
|
-
settledHostScreenKey,
|
|
128
|
-
sourcePairKey
|
|
129
|
-
});
|
|
130
|
-
}, (signal, previousSignal) => {
|
|
131
|
-
"worklet";
|
|
132
|
-
|
|
133
|
-
if (shallowEqual(previousSignal, signal)) {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
if (signal.status === "pending") {
|
|
137
|
-
canSwitchPortalHostImmediately.set(0);
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
const hostScreenKey = signal.status === "complete" ? signal.hostScreenKey : null;
|
|
141
|
-
let previousOwnerPairKey;
|
|
142
|
-
if (previousSignal?.status === "complete") {
|
|
143
|
-
previousOwnerPairKey = previousSignal.ownerPairKey ?? undefined;
|
|
144
|
-
}
|
|
145
|
-
const canSwitchImmediately = canSwitchHandoffHostImmediately({
|
|
146
|
-
hostScreenKey,
|
|
147
|
-
ownerPairKey: signal.status === "complete" ? signal.ownerPairKey : undefined,
|
|
148
|
-
previousOwnerPairKey
|
|
149
|
-
});
|
|
150
|
-
canSwitchPortalHostImmediately.set(canSwitchImmediately ? 1 : 0);
|
|
151
|
-
if (canSwitchImmediately && hostScreenKey) {
|
|
152
|
-
const hostName = createBoundaryContentPortalHostName(hostScreenKey, boundaryId);
|
|
153
|
-
requestedPortalHostName.set(hostName);
|
|
154
|
-
visiblePortalHostName.set(hostName);
|
|
155
|
-
}
|
|
156
|
-
runOnJS(updatePortalOwnership)(signal.hostScreenKey, signal.ownerPairKey, signal.ownerScreenKey ?? undefined);
|
|
157
|
-
});
|
|
158
|
-
useAnimatedReaction(() => {
|
|
159
|
-
"worklet";
|
|
160
|
-
|
|
161
|
-
const slot = activeSlotsMap.get()[boundaryId];
|
|
162
|
-
const teleport = slot?.props?.teleport;
|
|
163
|
-
const shouldTeleport = shouldAttachBoundaryPortal({
|
|
164
|
-
enabled,
|
|
165
|
-
teleport
|
|
166
|
-
});
|
|
167
|
-
const requestedName = requestedPortalHostName.get();
|
|
168
|
-
const visibleName = visiblePortalHostName.get();
|
|
169
|
-
const isInterpolatorReady = activeNextInterpolatorReady.get();
|
|
170
|
-
const nextVisibleName = resolveNextVisiblePortalHostName({
|
|
171
|
-
canSwitchImmediately: canSwitchPortalHostImmediately.get() === 1,
|
|
172
|
-
isInterpolatorReady: isInterpolatorReady === 1,
|
|
173
|
-
requestedName,
|
|
174
|
-
shouldTeleport,
|
|
175
|
-
visibleName
|
|
176
|
-
});
|
|
177
|
-
return {
|
|
178
|
-
isInterpolatorReady,
|
|
179
|
-
nextVisibleName,
|
|
180
|
-
requestedName,
|
|
181
|
-
shouldTeleport,
|
|
182
|
-
teleport,
|
|
183
|
-
visibleName
|
|
184
|
-
};
|
|
185
|
-
}, (state, previousState) => {
|
|
186
|
-
"worklet";
|
|
187
|
-
|
|
188
|
-
if (shallowEqual(previousState, state)) {
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
if (state.nextVisibleName !== state.visibleName) {
|
|
192
|
-
visiblePortalHostName.set(state.nextVisibleName);
|
|
193
|
-
}
|
|
194
|
-
});
|
|
27
|
+
// `nextScreenKey` can change while the previously attached destination is
|
|
28
|
+
// still closing. Retain that destination's lifecycle shared values so this
|
|
29
|
+
// payload follows the screen that actually hosts it, not the newest route.
|
|
30
|
+
const attachedDestination = useSharedValue(null);
|
|
195
31
|
const teleportProps = useAnimatedProps(() => {
|
|
196
32
|
"worklet";
|
|
197
33
|
|
|
198
|
-
const slot =
|
|
34
|
+
const slot = slotsMap.get()[boundaryId];
|
|
199
35
|
const {
|
|
200
36
|
pointerEvents: _pointerEvents,
|
|
201
37
|
teleport,
|
|
202
38
|
...slotProps
|
|
203
39
|
} = slot?.props ?? {};
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
40
|
+
const animationProgress = destinationAnimationProgress.get();
|
|
41
|
+
const shouldTeleport = isTeleportEnabled(teleport);
|
|
42
|
+
const pairsState = pairs.get();
|
|
43
|
+
const enteringTargetScreenKey = shouldTeleport ? resolveEnteringHandoffTarget({
|
|
44
|
+
animationProgress,
|
|
45
|
+
boundaryId,
|
|
46
|
+
currentScreenKey,
|
|
47
|
+
pairsState,
|
|
48
|
+
sourcePairKey
|
|
49
|
+
}) : null;
|
|
50
|
+
if (enteringTargetScreenKey) {
|
|
51
|
+
// A valid entering pair is the only event that replaces the current
|
|
52
|
+
// attachment and its lifecycle owner.
|
|
53
|
+
attachedDestination.set({
|
|
54
|
+
animationProgress: destinationAnimationProgress,
|
|
55
|
+
closing: destinationClosing,
|
|
56
|
+
screenKey: enteringTargetScreenKey
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const attached = attachedDestination.get();
|
|
60
|
+
const hasAttachedCloseFinished = attached !== null && hasCloseTransitionFinished({
|
|
61
|
+
animationProgress: attached.animationProgress.get(),
|
|
62
|
+
closing: attached.closing.get()
|
|
207
63
|
});
|
|
208
|
-
|
|
64
|
+
|
|
65
|
+
// Missing or changing pairs do not imply a return: keep the current host
|
|
66
|
+
// until its own screen visually closes. At that point, target the source
|
|
67
|
+
// host explicitly instead of `null` so Teleport restores source dimensions.
|
|
68
|
+
const targetScreenKey = enteringTargetScreenKey ? enteringTargetScreenKey : shouldTeleport ? hasAttachedCloseFinished ? currentScreenKey : attached?.screenKey ?? null : null;
|
|
69
|
+
const targetHostName = targetScreenKey ? createBoundaryContentPortalHostName(targetScreenKey, boundaryId) : PORTAL_HOST_NAME_RESET_VALUE;
|
|
209
70
|
return {
|
|
210
71
|
...slotProps,
|
|
211
|
-
hostName:
|
|
72
|
+
hostName: targetHostName
|
|
212
73
|
};
|
|
213
74
|
});
|
|
214
75
|
return {
|
|
215
|
-
teleportProps
|
|
216
|
-
visiblePortalHostName
|
|
76
|
+
teleportProps
|
|
217
77
|
};
|
|
218
78
|
};
|
|
219
79
|
//# sourceMappingURL=use-boundary-content-portal-attachment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["useAnimatedProps","useSharedValue","useDescriptorsStore","useScreenSlots","hasCloseTransitionFinished","AnimationStore","pairs","SystemStore","resolveEnteringHandoffTarget","PORTAL_HOST_NAME_RESET_VALUE","isTeleportEnabled","createBoundaryContentPortalHostName","useBoundaryContentPortalAttachment","boundaryId","slotsMap","sourcePairKey","s","derivations","currentScreenKey","nextScreenKey","destinationScreenKey","destinationAnimationProgress","getValue","destinationClosing","attachedDestination","teleportProps","slot","get","pointerEvents","_pointerEvents","teleport","slotProps","props","animationProgress","shouldTeleport","pairsState","enteringTargetScreenKey","set","closing","screenKey","attached","hasAttachedCloseFinished","targetScreenKey","targetHostName","hostName"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts"],"mappings":";;AAAA,SAECA,gBAAgB,EAChBC,cAAc,QACR,yBAAyB;AAChC,SAASC,mBAAmB,QAAQ,gDAAgD;AACpF,SAASC,cAAc,QAAQ,2CAA2C;AAC1E,SAASC,0BAA0B,QAAQ,2EAA2E;AACtH,SAASC,cAAc,QAAQ,0CAA0C;AACzE,SAASC,KAAK,QAAQ,iDAAiD;AACvE,SAASC,WAAW,QAAQ,uCAAuC;AACnE,SAASC,4BAA4B,QAAQ,+BAA+B;AAC5E,SAASC,4BAA4B,QAAQ,uBAAuB;AACpE,SAASC,iBAAiB,QAAQ,iCAAiC;AACnE,SAASC,mCAAmC,QAAQ,sBAAsB;AAY1E,OAAO,MAAMC,kCAAkC,GAAGA,CAAC;EAClDC;AACyC,CAAC,KAAK;EAC/C,MAAM;IAAEC;EAAS,CAAC,GAAGX,cAAc,CAAC,CAAC;EACrC,MAAMY,aAAa,GAAGb,mBAAmB,CAAEc,CAAC,IAAKA,CAAC,CAACC,WAAW,CAACF,aAAa,CAAC;EAC7E,MAAMG,gBAAgB,GAAGhB,mBAAmB,CAC1Cc,CAAC,IAAKA,CAAC,CAACC,WAAW,CAACC,gBACtB,CAAC;EACD,MAAMC,aAAa,GAAGjB,mBAAmB,CAAEc,CAAC,IAAKA,CAAC,CAACC,WAAW,CAACE,aAAa,CAAC;EAC7E,MAAMC,oBAAoB,GAAGD,aAAa,IAAID,gBAAgB;EAC9D,MAAMG,4BAA4B,GAAGd,WAAW,CAACe,QAAQ,CACxDF,oBAAoB,EACpB,mBACD,CAAC;EACD,MAAMG,kBAAkB,GAAGlB,cAAc,CAACiB,QAAQ,CACjDF,oBAAoB,EACpB,SACD,CAAC;;EAED;EACA;EACA;EACA,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sB,QAAQ,EAAED,SAAS,IAAI,IAAK,GAC9B,IAAI;IAER,MAAMI,cAAc,GAAGD,eAAe,GACnC/B,mCAAmC,CAAC+B,eAAe,EAAE7B,UAAU,CAAC,GAChEJ,4BAA4B;IAE/B,OAAO;MACN,GAAGsB,SAAS;MACZa,QAAQ,EAAED;IACX,CAAC;EACF,CAAC,CAAC;EAEF,OAAO;IAAElB;EAAc,CAAC;AACzB,CAAC","ignoreList":[]}
|
package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js
CHANGED
|
@@ -8,27 +8,35 @@ import { useBoundaryContentPortalAttachment } from "./hooks/use-boundary-content
|
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
export { BoundaryContentPortalHost } from "./components/host";
|
|
10
10
|
const AnimatedNativePortal = NativePortal ? Animated.createAnimatedComponent(NativePortal) : null;
|
|
11
|
+
const EnabledNativePortal = AnimatedNativePortal;
|
|
11
12
|
export const BoundaryContentPortal = /*#__PURE__*/memo(function BoundaryContentPortal({
|
|
12
13
|
boundaryId,
|
|
13
14
|
children,
|
|
14
15
|
enabled
|
|
15
16
|
}) {
|
|
16
|
-
|
|
17
|
+
if (!enabled || boundaryId === undefined || !isTeleportAvailable || !AnimatedNativePortal) {
|
|
18
|
+
return children;
|
|
19
|
+
}
|
|
20
|
+
return /*#__PURE__*/_jsx(EnabledBoundaryContentPortal, {
|
|
21
|
+
boundaryId: boundaryId,
|
|
22
|
+
children: children
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
const EnabledBoundaryContentPortal = /*#__PURE__*/memo(function EnabledBoundaryContentPortal({
|
|
26
|
+
boundaryId,
|
|
27
|
+
children
|
|
28
|
+
}) {
|
|
17
29
|
const {
|
|
18
30
|
teleportProps
|
|
19
31
|
} = useBoundaryContentPortalAttachment({
|
|
20
|
-
boundaryId
|
|
21
|
-
|
|
32
|
+
boundaryId
|
|
33
|
+
});
|
|
34
|
+
return /*#__PURE__*/_jsx(EnabledNativePortal, {
|
|
35
|
+
animatedProps: teleportProps,
|
|
36
|
+
name: boundaryId,
|
|
37
|
+
pointerEvents: PORTAL_POINTER_EVENTS,
|
|
38
|
+
style: StyleSheet.absoluteFill,
|
|
39
|
+
children: children
|
|
22
40
|
});
|
|
23
|
-
if (shouldEnablePortal && isTeleportAvailable && AnimatedNativePortal) {
|
|
24
|
-
return /*#__PURE__*/_jsx(AnimatedNativePortal, {
|
|
25
|
-
animatedProps: teleportProps,
|
|
26
|
-
name: boundaryId,
|
|
27
|
-
pointerEvents: PORTAL_POINTER_EVENTS,
|
|
28
|
-
style: StyleSheet.absoluteFill,
|
|
29
|
-
children: children
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
return children;
|
|
33
41
|
});
|
|
34
42
|
//# sourceMappingURL=index.js.map
|
package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["memo","StyleSheet","Animated","isTeleportAvailable","NativePortal","PORTAL_POINTER_EVENTS","useBoundaryContentPortalAttachment","jsx","_jsx","BoundaryContentPortalHost","AnimatedNativePortal","createAnimatedComponent","BoundaryContentPortal","boundaryId","children","enabled","
|
|
1
|
+
{"version":3,"names":["memo","StyleSheet","Animated","isTeleportAvailable","NativePortal","PORTAL_POINTER_EVENTS","useBoundaryContentPortalAttachment","jsx","_jsx","BoundaryContentPortalHost","AnimatedNativePortal","createAnimatedComponent","EnabledNativePortal","BoundaryContentPortal","boundaryId","children","enabled","undefined","EnabledBoundaryContentPortal","teleportProps","animatedProps","name","pointerEvents","style","absoluteFill"],"sourceRoot":"../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-content-portal/index.tsx"],"mappings":";;AAAA,SAGCA,IAAI,QAEE,OAAO;AACd,SAASC,UAAU,QAAQ,cAAc;AACzC,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SACCC,mBAAmB,EACnBC,YAAY,EACZC,qBAAqB,QACf,gBAAgB;AACvB,SAASC,kCAAkC,QAAQ,gDAAgD;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEpG,SAASC,yBAAyB,QAAQ,mBAAmB;AAe7D,MAAMC,oBAAoB,GAAGN,YAAY,GACtCF,QAAQ,CAACS,uBAAuB,CAChCP,YACD,CAAC,GACA,IAAI;AACP,MAAMQ,mBAAmB,GAAGF,oBAE3B;AAED,OAAO,MAAMG,qBAAqB,gBAAGb,IAAI,CAAC,SAASa,qBAAqBA,CAAC;EACxEC,UAAU;EACVC,QAAQ;EACRC;AAC2B,CAAC,EAAE;EAC9B,IACC,CAACA,OAAO,IACRF,UAAU,KAAKG,SAAS,IACxB,CAACd,mBAAmB,IACpB,CAACO,oBAAoB,EACpB;IACD,OAAOK,QAAQ;EAChB;EAEA,oBACCP,IAAA,CAACU,4BAA4B;IAACJ,UAAU,EAAEA,UAAW;IAAAC,QAAA,EACnDA;EAAQ,CACoB,CAAC;AAEjC,CAAC,CAAC;AAEF,MAAMG,4BAA4B,gBAAGlB,IAAI,CACxC,SAASkB,4BAA4BA,CAAC;EACrCJ,UAAU;EACVC;AACqE,CAAC,EAAE;EACxE,MAAM;IAAEI;EAAc,CAAC,GAAGb,kCAAkC,CAAC;IAC5DQ;EACD,CAAC,CAAC;EAEF,oBACCN,IAAA,CAACI,mBAAmB;IACnBQ,aAAa,EAAED,aAAc;IAC7BE,IAAI,EAAEP,UAAW;IACjBQ,aAAa,EAAEjB,qBAAsB;IACrCkB,KAAK,EAAEtB,UAAU,CAACuB,YAAa;IAAAT,QAAA,EAE9BA;EAAQ,CACW,CAAC;AAExB,CACD,CAAC","ignoreList":[]}
|
package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { memo,
|
|
3
|
+
import { memo, useLayoutEffect, useRef } from "react";
|
|
4
4
|
import { StyleSheet, useWindowDimensions, View } from "react-native";
|
|
5
5
|
import Animated from "react-native-reanimated";
|
|
6
6
|
import { useDescriptorsStore } from "../../../../../../providers/screen/descriptors";
|
|
7
7
|
import { useScreenSlots } from "../../../../../../providers/screen/styles";
|
|
8
|
-
import { SystemStore } from "../../../../../../stores/system.store";
|
|
9
8
|
import { PORTAL_POINTER_EVENTS } from "../../../teleport";
|
|
10
9
|
import { useHostMeasurement } from "../hooks/use-host-measurement";
|
|
11
10
|
import { registerHost, unregisterHost } from "../stores/host-registry.store";
|
|
@@ -18,9 +17,6 @@ function HostImpl({
|
|
|
18
17
|
style
|
|
19
18
|
}) {
|
|
20
19
|
const screenKey = useDescriptorsStore(s => s.derivations.currentScreenKey);
|
|
21
|
-
const {
|
|
22
|
-
unblockLifecycleStart
|
|
23
|
-
} = SystemStore.getBag(screenKey).actions;
|
|
24
20
|
const generatedHostKeyRef = useRef(null);
|
|
25
21
|
if (generatedHostKeyRef.current === null) {
|
|
26
22
|
generatedHostKeyRef.current = `${screenKey}-host-${nextHostId++}`;
|
|
@@ -46,7 +42,6 @@ function HostImpl({
|
|
|
46
42
|
});
|
|
47
43
|
useLayoutEffect(() => {
|
|
48
44
|
registerHost({
|
|
49
|
-
capturesScroll,
|
|
50
45
|
fallback,
|
|
51
46
|
hostKey,
|
|
52
47
|
screenKey
|
|
@@ -54,19 +49,13 @@ function HostImpl({
|
|
|
54
49
|
return () => {
|
|
55
50
|
unregisterHost(screenKey, hostKey);
|
|
56
51
|
};
|
|
57
|
-
}, [
|
|
58
|
-
const handleUnblocking = useCallback(() => {
|
|
59
|
-
// Each destination boundary contributes one lifecycle start block. Release
|
|
60
|
-
// only this host's block so unrelated boundary and user blocks stay intact.
|
|
61
|
-
unblockLifecycleStart();
|
|
62
|
-
}, [unblockLifecycleStart]);
|
|
52
|
+
}, [fallback, hostKey, screenKey]);
|
|
63
53
|
const boundaryHosts = measurement.canRenderHosts ? activeBoundaryHosts.map(host => /*#__PURE__*/_jsx(View, {
|
|
64
54
|
pointerEvents: PORTAL_POINTER_EVENTS,
|
|
65
55
|
style: [styles.boundaryHostViewport, {
|
|
66
56
|
width: viewportWidth,
|
|
67
57
|
height: viewportHeight
|
|
68
58
|
}],
|
|
69
|
-
onLayout: handleUnblocking,
|
|
70
59
|
children: /*#__PURE__*/_jsx(PortalBoundaryHost, {
|
|
71
60
|
host: host,
|
|
72
61
|
style: StyleSheet.absoluteFill
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["memo","
|
|
1
|
+
{"version":3,"names":["memo","useLayoutEffect","useRef","StyleSheet","useWindowDimensions","View","Animated","useDescriptorsStore","useScreenSlots","PORTAL_POINTER_EVENTS","useHostMeasurement","registerHost","unregisterHost","useActivePortalBoundaryHosts","PortalBoundaryHost","jsx","_jsx","nextHostId","HostImpl","fallback","style","screenKey","s","derivations","currentScreenKey","generatedHostKeyRef","current","hostKey","capturesScroll","activeBoundaryHosts","visibilityBlocked","height","viewportHeight","width","viewportWidth","measurement","enabled","length","boundaryHosts","canRenderHosts","map","host","pointerEvents","styles","boundaryHostViewport","children","absoluteFill","portalHostName","ref","hostRef","collapsable","Host","props","ScreenFallbackHost","create","elevation","left","overflow","position","top","zIndex"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/components/host.tsx"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,eAAe,EAAEC,MAAM,QAAQ,OAAO;AACrD,SAECC,UAAU,EACVC,mBAAmB,EACnBC,IAAI,QAEE,cAAc;AACrB,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,mBAAmB,QAAQ,gDAAgD;AACpF,SAASC,cAAc,QAAQ,2CAA2C;AAC1E,SAASC,qBAAqB,QAAQ,mBAAmB;AACzD,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SAASC,YAAY,EAAEC,cAAc,QAAQ,+BAA+B;AAC5E,SAASC,4BAA4B,QAAQ,sCAAsC;AACnF,SAASC,kBAAkB,QAAQ,wBAAwB;AAAC,SAAAC,GAAA,IA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E;EACT,CAAC;EACDhB,oBAAoB,EAAE;IACrBY,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE,SAAS;IACnBC,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE;EACN;AACD,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,30 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { memo } from "react";
|
|
4
|
-
import { StyleSheet } from "react-native";
|
|
5
|
-
import Animated, { useAnimatedStyle } from "react-native-reanimated";
|
|
3
|
+
import { memo, useCallback } from "react";
|
|
4
|
+
import { I18nManager, StyleSheet } from "react-native";
|
|
5
|
+
import Animated, { useAnimatedStyle, useFrameCallback, useSharedValue } from "react-native-reanimated";
|
|
6
6
|
import { NO_STYLES } from "../../../../../../constants";
|
|
7
7
|
import { composeSlotStyleWithLocalTransform } from "../../../../../../providers/screen/styles/helpers/compose-slot-style";
|
|
8
|
-
import { AnimationStore } from "../../../../../../stores/animation.store";
|
|
9
|
-
import { getSourceScreenKeyFromPairKey } from "../../../../../../stores/bounds/helpers/link-pairs.helpers";
|
|
10
8
|
import { getLink } from "../../../../../../stores/bounds/internals/links";
|
|
11
|
-
import {
|
|
9
|
+
import { SystemStore } from "../../../../../../stores/system.store";
|
|
12
10
|
import { NativePortalHost, PORTAL_POINTER_EVENTS } from "../../../teleport";
|
|
13
11
|
import { hasLocalSlot } from "../helpers/has-local-slot";
|
|
14
12
|
import { resolvePortalOffsetStyle } from "../helpers/offset-style";
|
|
13
|
+
import { getPortalHostBounds } from "../stores/host-bounds.store";
|
|
15
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
15
|
const AnimatedPortalBoundaryHost = NativePortalHost ? Animated.createAnimatedComponent(NativePortalHost) : null;
|
|
17
16
|
export const PortalBoundaryHost = /*#__PURE__*/memo(function PortalBoundaryHost({
|
|
18
17
|
host,
|
|
19
18
|
style
|
|
20
19
|
}) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
const geometryReadyFrames = useSharedValue(0);
|
|
21
|
+
const {
|
|
22
|
+
unblockLifecycleStart
|
|
23
|
+
} = SystemStore.getBag(host.screenKey).actions;
|
|
24
|
+
const handleFrame = useCallback(() => {
|
|
25
|
+
"worklet";
|
|
26
|
+
|
|
27
|
+
if (host.portalHostReady.get()) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const link = getLink(host.pairKey, host.boundaryId);
|
|
31
|
+
const hasGeometry = link?.source !== null && link !== undefined && getPortalHostBounds(host.hostKey) !== null && hasLocalSlot(host.localStylesMaps.get(), host.boundaryId);
|
|
32
|
+
if (!hasGeometry) {
|
|
33
|
+
geometryReadyFrames.set(0);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (geometryReadyFrames.get() === 0) {
|
|
37
|
+
// Give the source frame, host offset, and slot style one UI frame to
|
|
38
|
+
// reach native before Teleport targets this receiver.
|
|
39
|
+
geometryReadyFrames.set(1);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
host.portalHostReady.set(true);
|
|
43
|
+
unblockLifecycleStart();
|
|
44
|
+
}, [geometryReadyFrames, host, unblockLifecycleStart]);
|
|
45
|
+
useFrameCallback(handleFrame, true);
|
|
28
46
|
const hostStyle = useAnimatedStyle(() => {
|
|
29
47
|
"worklet";
|
|
30
48
|
|
|
@@ -36,30 +54,10 @@ export const PortalBoundaryHost = /*#__PURE__*/memo(function PortalBoundaryHost(
|
|
|
36
54
|
}
|
|
37
55
|
const sourceBounds = link.source.bounds;
|
|
38
56
|
const isCrossScreenPortal = link.source.screenKey !== host.screenKey;
|
|
39
|
-
let landingShift;
|
|
40
|
-
if (isCrossScreenPortal) {
|
|
41
|
-
// Weight by distance-to-landing so the destination end of the flight
|
|
42
|
-
// stays pinned: no correction while the content sits over the
|
|
43
|
-
// destination rect (progress 1), full correction at touchdown on the
|
|
44
|
-
// source rect (progress 0).
|
|
45
|
-
const landingWeight = 1 - Math.min(Math.max(hostVisualProgress.get(), 0), 1);
|
|
46
|
-
if (landingWeight > 0) {
|
|
47
|
-
const liveScroll = sourceScrollMetadata.get();
|
|
48
|
-
const capturedScroll = sourceBounds.scroll ?? null;
|
|
49
|
-
|
|
50
|
-
// Scroll offset grows as content moves up/left, so the rect's
|
|
51
|
-
// on-screen position shifts by the negative delta.
|
|
52
|
-
landingShift = {
|
|
53
|
-
x: -getClampedScrollAxisDelta(liveScroll, capturedScroll, "horizontal") * landingWeight,
|
|
54
|
-
y: -getClampedScrollAxisDelta(liveScroll, capturedScroll, "vertical") * landingWeight
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
57
|
return resolvePortalOffsetStyle({
|
|
59
58
|
bounds: sourceBounds,
|
|
60
59
|
hostKey: host.hostKey,
|
|
61
|
-
placement: isCrossScreenPortal ? "cross-screen" : "same-screen"
|
|
62
|
-
landingShift
|
|
60
|
+
placement: isCrossScreenPortal ? "cross-screen" : "same-screen"
|
|
63
61
|
});
|
|
64
62
|
});
|
|
65
63
|
const contentFrameStyle = useAnimatedStyle(() => {
|
|
@@ -88,7 +86,7 @@ export const PortalBoundaryHost = /*#__PURE__*/memo(function PortalBoundaryHost(
|
|
|
88
86
|
// cleanup frame. If the current local interpolator layers did not emit this
|
|
89
87
|
// boundary id, any resolved style here is cleanup/stale residue and should
|
|
90
88
|
// not be drawn by the host.
|
|
91
|
-
if (
|
|
89
|
+
if (!hasLocalSlot(host.localStylesMaps.get(), host.boundaryId)) {
|
|
92
90
|
return NO_STYLES;
|
|
93
91
|
}
|
|
94
92
|
const slot = host.slotsMap.get()[host.boundaryId];
|
|
@@ -111,8 +109,17 @@ export const PortalBoundaryHost = /*#__PURE__*/memo(function PortalBoundaryHost(
|
|
|
111
109
|
})
|
|
112
110
|
});
|
|
113
111
|
});
|
|
112
|
+
|
|
113
|
+
// The teleport offset is a physical page delta measured from the screen's
|
|
114
|
+
// left edge, so the content box must anchor there too. Under native RTL,
|
|
115
|
+
// `left: 0` swaps to a right-edge anchor; `end: 0` is the physical left edge
|
|
116
|
+
// in RTL regardless of the swap setting.
|
|
114
117
|
const styles = StyleSheet.create({
|
|
115
|
-
content: {
|
|
118
|
+
content: I18nManager.isRTL ? {
|
|
119
|
+
end: 0,
|
|
120
|
+
position: "absolute",
|
|
121
|
+
top: 0
|
|
122
|
+
} : {
|
|
116
123
|
left: 0,
|
|
117
124
|
position: "absolute",
|
|
118
125
|
top: 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["memo","StyleSheet","Animated","useAnimatedStyle","
|
|
1
|
+
{"version":3,"names":["memo","useCallback","I18nManager","StyleSheet","Animated","useAnimatedStyle","useFrameCallback","useSharedValue","NO_STYLES","composeSlotStyleWithLocalTransform","getLink","SystemStore","NativePortalHost","PORTAL_POINTER_EVENTS","hasLocalSlot","resolvePortalOffsetStyle","getPortalHostBounds","jsx","_jsx","AnimatedPortalBoundaryHost","createAnimatedComponent","PortalBoundaryHost","host","style","geometryReadyFrames","unblockLifecycleStart","getBag","screenKey","actions","handleFrame","portalHostReady","get","link","pairKey","boundaryId","hasGeometry","source","undefined","hostKey","localStylesMaps","set","hostStyle","sourceBounds","bounds","isCrossScreenPortal","placement","contentFrameStyle","height","width","slotStyle","slot","slotsMap","boundsLocalTransform","View","pointerEvents","collapsable","children","name","portalHostName","styles","content","create","isRTL","end","position","top","left"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,WAAW,QAAQ,OAAO;AACzC,SACCC,WAAW,EAEXC,UAAU,QAEJ,cAAc;AACrB,OAAOC,QAAQ,IACdC,gBAAgB,EAChBC,gBAAgB,EAChBC,cAAc,QACR,yBAAyB;AAChC,SAASC,SAAS,QAAQ,6BAA6B;AACvD,SAASC,kCAAkC,QAAQ,sEAAsE;AACzH,SAASC,O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C,CAAC","ignoreList":[]}
|
|
@@ -16,8 +16,7 @@ import { getPortalHostBounds } from "../stores/host-bounds.store";
|
|
|
16
16
|
export const resolvePortalOffsetStyle = ({
|
|
17
17
|
bounds,
|
|
18
18
|
hostKey,
|
|
19
|
-
placement
|
|
20
|
-
landingShift
|
|
19
|
+
placement
|
|
21
20
|
}) => {
|
|
22
21
|
"worklet";
|
|
23
22
|
|
|
@@ -38,9 +37,9 @@ export const resolvePortalOffsetStyle = ({
|
|
|
38
37
|
const adjustedHostPageY = hostBounds ? hostBounds.pageY - hostSnapshotDeltaY : 0;
|
|
39
38
|
return {
|
|
40
39
|
transform: [{
|
|
41
|
-
translateY: bounds.pageY - adjustedHostPageY
|
|
40
|
+
translateY: bounds.pageY - adjustedHostPageY
|
|
42
41
|
}, {
|
|
43
|
-
translateX: bounds.pageX - adjustedHostPageX
|
|
42
|
+
translateX: bounds.pageX - adjustedHostPageX
|
|
44
43
|
}]
|
|
45
44
|
};
|
|
46
45
|
};
|