react-native-screen-transitions 4.0.0-alpha.0 → 4.0.0-alpha.2
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/animation/snap-to.js +2 -0
- package/lib/commonjs/animation/snap-to.js.map +1 -1
- package/lib/commonjs/components/boundary/components/boundary-target.js +19 -20
- package/lib/commonjs/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/commonjs/components/boundary/create-boundary-component.js +16 -2
- package/lib/commonjs/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/commonjs/components/boundary/hooks/lifecycles/use-refresh-boundary.js +5 -0
- package/lib/commonjs/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -1
- package/lib/commonjs/components/boundary/hooks/use-boundary-measurement.js +1 -3
- package/lib/commonjs/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
- package/lib/commonjs/components/boundary/index.js +4 -3
- package/lib/commonjs/components/boundary/index.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/components/host.js +5 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +47 -188
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/index.js +21 -13
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/components/host.js +1 -12
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +40 -33
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/helpers/offset-style.js +3 -4
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +46 -131
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/index.js +45 -9
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/stores/host-registry.store.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js +2 -29
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/utils/handoff-target.js +33 -0
- package/lib/commonjs/components/boundary/portal/utils/handoff-target.js.map +1 -0
- package/lib/commonjs/components/boundary/portal/utils/resolve-portal.js +19 -15
- package/lib/commonjs/components/boundary/portal/utils/resolve-portal.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/utils/teleport-control.js +1 -10
- package/lib/commonjs/components/boundary/portal/utils/teleport-control.js.map +1 -1
- package/lib/commonjs/components/boundary/providers/boundary-root.provider.js +18 -36
- package/lib/commonjs/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/commonjs/components/boundary/utils/refresh-signals.js +7 -0
- package/lib/commonjs/components/boundary/utils/refresh-signals.js.map +1 -1
- package/lib/commonjs/components/boundary/utils/resolve-boundary-target.js +29 -0
- package/lib/commonjs/components/boundary/utils/resolve-boundary-target.js.map +1 -0
- package/lib/commonjs/components/masked-view.js +9 -1
- package/lib/commonjs/components/masked-view.js.map +1 -1
- package/lib/commonjs/components/screen-container/layers/backdrop.js +3 -1
- package/lib/commonjs/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/commonjs/components/screen-container/layers/maybe-masked-navigation-container.js +9 -1
- package/lib/commonjs/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
- package/lib/commonjs/components/screen-lifecycle/hooks/use-transition-start-controller.js +2 -0
- package/lib/commonjs/components/screen-lifecycle/hooks/use-transition-start-controller.js.map +1 -1
- package/lib/commonjs/navigators/react-navigation/index.js +7 -8
- package/lib/commonjs/navigators/react-navigation/index.js.map +1 -1
- package/lib/commonjs/providers/helpers/measured-bounds-writes.js +4 -1
- package/lib/commonjs/providers/helpers/measured-bounds-writes.js.map +1 -1
- package/lib/commonjs/providers/screen/gestures/gestures.provider.js +2 -8
- package/lib/commonjs/providers/screen/gestures/gestures.provider.js.map +1 -1
- package/lib/commonjs/providers/screen/gestures/pan/behavior/pan-lifecycle.js +1 -0
- package/lib/commonjs/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -1
- package/lib/commonjs/providers/screen/gestures/pinch/activation/use-pinch-activation.js +37 -3
- package/lib/commonjs/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
- package/lib/commonjs/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +1 -0
- package/lib/commonjs/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
- package/lib/commonjs/providers/screen/gestures/pinch/behavior/pinch-release.js +3 -2
- package/lib/commonjs/providers/screen/gestures/pinch/behavior/pinch-release.js.map +1 -1
- package/lib/commonjs/providers/screen/gestures/types.js.map +1 -1
- package/lib/commonjs/providers/screen/styles/helpers/transition-visual-state.js +42 -0
- package/lib/commonjs/providers/screen/styles/helpers/transition-visual-state.js.map +1 -0
- package/lib/commonjs/providers/screen/styles/helpers/visibility-gate.js +11 -5
- package/lib/commonjs/providers/screen/styles/helpers/visibility-gate.js.map +1 -1
- package/lib/commonjs/providers/screen/styles/hooks/use-interpolated-style-maps.js +23 -10
- package/lib/commonjs/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/commonjs/providers/screen/styles/hooks/use-maybe-block-visibility.js +10 -8
- package/lib/commonjs/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/commonjs/stores/bounds/internals/links.js +4 -4
- package/lib/commonjs/stores/bounds/internals/links.js.map +1 -1
- package/lib/commonjs/stores/scroll.store.js +20 -2
- package/lib/commonjs/stores/scroll.store.js.map +1 -1
- package/lib/commonjs/stores/system.store.js +2 -0
- package/lib/commonjs/stores/system.store.js.map +1 -1
- package/lib/commonjs/utils/animation/animate-to-progress.js +23 -1
- package/lib/commonjs/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/commonjs/utils/animation/animate.js +14 -2
- package/lib/commonjs/utils/animation/animate.js.map +1 -1
- package/lib/commonjs/utils/animation/spring/spring.js +22 -2
- package/lib/commonjs/utils/animation/spring/spring.js.map +1 -1
- package/lib/commonjs/utils/animation/spring/springUtils.js +96 -0
- package/lib/commonjs/utils/animation/spring/springUtils.js.map +1 -1
- package/lib/commonjs/utils/animation/state.js +4 -0
- package/lib/commonjs/utils/bounds/navigation/reveal/math.js +17 -5
- package/lib/commonjs/utils/bounds/navigation/reveal/math.js.map +1 -1
- package/lib/commonjs/utils/bounds/navigation/zoom/build.js +44 -20
- package/lib/commonjs/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/commonjs/utils/bounds/navigation/zoom/drag.js +2 -31
- package/lib/commonjs/utils/bounds/navigation/zoom/drag.js.map +1 -1
- package/lib/commonjs/utils/bounds/navigation/zoom/helpers.js +3 -17
- package/lib/commonjs/utils/bounds/navigation/zoom/helpers.js.map +1 -1
- package/lib/module/animation/snap-to.js +2 -0
- package/lib/module/animation/snap-to.js.map +1 -1
- package/lib/module/components/boundary/components/boundary-target.js +19 -20
- package/lib/module/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/module/components/boundary/create-boundary-component.js +17 -3
- package/lib/module/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/module/components/boundary/hooks/lifecycles/use-refresh-boundary.js +5 -0
- package/lib/module/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -1
- package/lib/module/components/boundary/hooks/use-boundary-measurement.js +1 -3
- package/lib/module/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
- package/lib/module/components/boundary/index.js +3 -2
- package/lib/module/components/boundary/index.js.map +1 -1
- package/lib/module/components/boundary/portal/components/boundary-content-portal/components/host.js +5 -1
- package/lib/module/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -1
- package/lib/module/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +49 -190
- package/lib/module/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
- package/lib/module/components/boundary/portal/components/boundary-content-portal/index.js +21 -13
- package/lib/module/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/components/host.js +2 -13
- package/lib/module/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +43 -36
- package/lib/module/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/helpers/offset-style.js +3 -4
- package/lib/module/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +1 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +50 -135
- package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/index.js +44 -9
- package/lib/module/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/stores/host-registry.store.js.map +1 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js +1 -27
- package/lib/module/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -1
- package/lib/module/components/boundary/portal/utils/handoff-target.js +28 -0
- package/lib/module/components/boundary/portal/utils/handoff-target.js.map +1 -0
- package/lib/module/components/boundary/portal/utils/resolve-portal.js +19 -15
- package/lib/module/components/boundary/portal/utils/resolve-portal.js.map +1 -1
- package/lib/module/components/boundary/portal/utils/teleport-control.js +0 -8
- package/lib/module/components/boundary/portal/utils/teleport-control.js.map +1 -1
- package/lib/module/components/boundary/providers/boundary-root.provider.js +19 -37
- package/lib/module/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/module/components/boundary/utils/refresh-signals.js +7 -0
- package/lib/module/components/boundary/utils/refresh-signals.js.map +1 -1
- package/lib/module/components/boundary/utils/resolve-boundary-target.js +24 -0
- package/lib/module/components/boundary/utils/resolve-boundary-target.js.map +1 -0
- package/lib/module/components/masked-view.js +10 -2
- package/lib/module/components/masked-view.js.map +1 -1
- package/lib/module/components/screen-container/layers/backdrop.js +3 -1
- package/lib/module/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/module/components/screen-container/layers/maybe-masked-navigation-container.js +10 -2
- package/lib/module/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
- package/lib/module/components/screen-lifecycle/hooks/use-transition-start-controller.js +2 -0
- package/lib/module/components/screen-lifecycle/hooks/use-transition-start-controller.js.map +1 -1
- package/lib/module/navigators/react-navigation/index.js +4 -6
- package/lib/module/navigators/react-navigation/index.js.map +1 -1
- package/lib/module/providers/helpers/measured-bounds-writes.js +4 -1
- package/lib/module/providers/helpers/measured-bounds-writes.js.map +1 -1
- package/lib/module/providers/screen/gestures/gestures.provider.js +2 -8
- package/lib/module/providers/screen/gestures/gestures.provider.js.map +1 -1
- package/lib/module/providers/screen/gestures/pan/behavior/pan-lifecycle.js +1 -0
- package/lib/module/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -1
- package/lib/module/providers/screen/gestures/pinch/activation/use-pinch-activation.js +35 -2
- package/lib/module/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
- package/lib/module/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +1 -0
- package/lib/module/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
- package/lib/module/providers/screen/gestures/pinch/behavior/pinch-release.js +3 -2
- package/lib/module/providers/screen/gestures/pinch/behavior/pinch-release.js.map +1 -1
- package/lib/module/providers/screen/gestures/types.js.map +1 -1
- package/lib/module/providers/screen/styles/helpers/transition-visual-state.js +35 -0
- package/lib/module/providers/screen/styles/helpers/transition-visual-state.js.map +1 -0
- package/lib/module/providers/screen/styles/helpers/visibility-gate.js +11 -5
- package/lib/module/providers/screen/styles/helpers/visibility-gate.js.map +1 -1
- package/lib/module/providers/screen/styles/hooks/use-interpolated-style-maps.js +23 -10
- package/lib/module/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/module/providers/screen/styles/hooks/use-maybe-block-visibility.js +10 -8
- package/lib/module/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/module/stores/bounds/internals/links.js +4 -4
- package/lib/module/stores/bounds/internals/links.js.map +1 -1
- package/lib/module/stores/scroll.store.js +17 -0
- package/lib/module/stores/scroll.store.js.map +1 -1
- package/lib/module/stores/system.store.js +2 -0
- package/lib/module/stores/system.store.js.map +1 -1
- package/lib/module/utils/animation/animate-to-progress.js +21 -0
- package/lib/module/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/module/utils/animation/animate.js +14 -2
- package/lib/module/utils/animation/animate.js.map +1 -1
- package/lib/module/utils/animation/spring/spring.js +23 -3
- package/lib/module/utils/animation/spring/spring.js.map +1 -1
- package/lib/module/utils/animation/spring/springUtils.js +95 -0
- package/lib/module/utils/animation/spring/springUtils.js.map +1 -1
- package/lib/module/utils/animation/state.js +2 -0
- package/lib/module/utils/bounds/navigation/reveal/math.js +16 -5
- package/lib/module/utils/bounds/navigation/reveal/math.js.map +1 -1
- package/lib/module/utils/bounds/navigation/zoom/build.js +46 -22
- package/lib/module/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/module/utils/bounds/navigation/zoom/drag.js +2 -30
- package/lib/module/utils/bounds/navigation/zoom/drag.js.map +1 -1
- package/lib/module/utils/bounds/navigation/zoom/helpers.js +4 -18
- package/lib/module/utils/bounds/navigation/zoom/helpers.js.map +1 -1
- package/lib/typescript/animation/snap-to.d.ts.map +1 -1
- package/lib/typescript/components/boundary/components/boundary-target.d.ts +2 -1
- package/lib/typescript/components/boundary/components/boundary-target.d.ts.map +1 -1
- package/lib/typescript/components/boundary/create-boundary-component.d.ts.map +1 -1
- package/lib/typescript/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts.map +1 -1
- package/lib/typescript/components/boundary/hooks/use-boundary-measurement.d.ts +3 -4
- package/lib/typescript/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -1
- package/lib/typescript/components/boundary/index.d.ts +6 -9
- package/lib/typescript/components/boundary/index.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts +1 -3
- package/lib/typescript/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/components/boundary-content-portal/index.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/components/host.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/helpers/offset-style.d.ts +1 -10
- package/lib/typescript/components/boundary/portal/components/boundary-portal/helpers/offset-style.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts +1 -3
- package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.d.ts +2 -2
- package/lib/typescript/components/boundary/portal/components/boundary-portal/index.d.ts +2 -2
- package/lib/typescript/components/boundary/portal/components/boundary-portal/index.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/stores/host-registry.store.d.ts +0 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/stores/host-registry.store.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts +1 -10
- package/lib/typescript/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/utils/handoff-target.d.ts +12 -0
- package/lib/typescript/components/boundary/portal/utils/handoff-target.d.ts.map +1 -0
- package/lib/typescript/components/boundary/portal/utils/resolve-portal.d.ts +2 -3
- package/lib/typescript/components/boundary/portal/utils/resolve-portal.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/utils/teleport-control.d.ts +0 -4
- package/lib/typescript/components/boundary/portal/utils/teleport-control.d.ts.map +1 -1
- package/lib/typescript/components/boundary/providers/boundary-root.provider.d.ts +8 -12
- package/lib/typescript/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
- package/lib/typescript/components/boundary/utils/refresh-signals.d.ts +1 -0
- package/lib/typescript/components/boundary/utils/refresh-signals.d.ts.map +1 -1
- package/lib/typescript/components/boundary/utils/resolve-boundary-target.d.ts +12 -0
- package/lib/typescript/components/boundary/utils/resolve-boundary-target.d.ts.map +1 -0
- package/lib/typescript/components/create-transition-aware-component.d.ts +5 -6
- package/lib/typescript/components/create-transition-aware-component.d.ts.map +1 -1
- package/lib/typescript/components/masked-view.d.ts.map +1 -1
- package/lib/typescript/components/screen-container/layers/backdrop.d.ts.map +1 -1
- package/lib/typescript/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
- package/lib/typescript/components/screen-lifecycle/hooks/use-transition-start-controller.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +650 -702
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/navigators/react-navigation/index.d.ts +6 -17
- package/lib/typescript/navigators/react-navigation/index.d.ts.map +1 -1
- package/lib/typescript/providers/helpers/measured-bounds-writes.d.ts.map +1 -1
- package/lib/typescript/providers/screen/gestures/gestures.provider.d.ts.map +1 -1
- package/lib/typescript/providers/screen/gestures/pan/behavior/pan-lifecycle.d.ts.map +1 -1
- package/lib/typescript/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts +2 -1
- package/lib/typescript/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts.map +1 -1
- package/lib/typescript/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts.map +1 -1
- package/lib/typescript/providers/screen/gestures/pinch/behavior/pinch-release.d.ts.map +1 -1
- package/lib/typescript/providers/screen/gestures/types.d.ts +1 -9
- package/lib/typescript/providers/screen/gestures/types.d.ts.map +1 -1
- package/lib/typescript/providers/screen/styles/helpers/transition-visual-state.d.ts +18 -0
- package/lib/typescript/providers/screen/styles/helpers/transition-visual-state.d.ts.map +1 -0
- package/lib/typescript/providers/screen/styles/helpers/visibility-gate.d.ts +2 -2
- package/lib/typescript/providers/screen/styles/helpers/visibility-gate.d.ts.map +1 -1
- package/lib/typescript/providers/screen/styles/hooks/slot-resolvers.d.ts +4 -4
- package/lib/typescript/providers/screen/styles/hooks/slot-resolvers.d.ts.map +1 -1
- package/lib/typescript/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
- package/lib/typescript/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +2 -2
- package/lib/typescript/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
- package/lib/typescript/stores/bounds/internals/links.d.ts +1 -1
- package/lib/typescript/stores/bounds/internals/links.d.ts.map +1 -1
- package/lib/typescript/stores/scroll.store.d.ts +7 -0
- package/lib/typescript/stores/scroll.store.d.ts.map +1 -1
- package/lib/typescript/stores/system.store.d.ts +5 -0
- package/lib/typescript/stores/system.store.d.ts.map +1 -1
- package/lib/typescript/utils/animation/animate-to-progress.d.ts +6 -1
- package/lib/typescript/utils/animation/animate-to-progress.d.ts.map +1 -1
- package/lib/typescript/utils/animation/animate.d.ts +2 -2
- package/lib/typescript/utils/animation/animate.d.ts.map +1 -1
- package/lib/typescript/utils/animation/spring/spring.d.ts +2 -2
- package/lib/typescript/utils/animation/spring/spring.d.ts.map +1 -1
- package/lib/typescript/utils/animation/spring/springUtils.d.ts +3 -0
- package/lib/typescript/utils/animation/spring/springUtils.d.ts.map +1 -1
- package/lib/typescript/utils/animation/state.d.ts +6 -0
- package/lib/typescript/utils/animation/state.d.ts.map +1 -1
- package/lib/typescript/utils/bounds/navigation/reveal/math.d.ts +9 -0
- package/lib/typescript/utils/bounds/navigation/reveal/math.d.ts.map +1 -1
- package/lib/typescript/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
- package/lib/typescript/utils/bounds/navigation/zoom/drag.d.ts +2 -11
- package/lib/typescript/utils/bounds/navigation/zoom/drag.d.ts.map +1 -1
- package/lib/typescript/utils/bounds/navigation/zoom/helpers.d.ts +7 -4
- package/lib/typescript/utils/bounds/navigation/zoom/helpers.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/animation/snap-to.ts +5 -0
- package/src/components/boundary/components/boundary-target.tsx +37 -23
- package/src/components/boundary/create-boundary-component.tsx +29 -3
- package/src/components/boundary/hooks/lifecycles/use-refresh-boundary.ts +11 -0
- package/src/components/boundary/hooks/use-boundary-measurement.ts +3 -9
- package/src/components/boundary/index.tsx +4 -8
- package/src/components/boundary/portal/components/boundary-content-portal/components/host.tsx +5 -1
- package/src/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +73 -276
- package/src/components/boundary/portal/components/boundary-content-portal/index.tsx +31 -12
- package/src/components/boundary/portal/components/boundary-portal/components/host.tsx +2 -12
- package/src/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx +64 -62
- package/src/components/boundary/portal/components/boundary-portal/helpers/offset-style.ts +2 -9
- package/src/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +73 -187
- package/src/components/boundary/portal/components/boundary-portal/index.tsx +72 -12
- package/src/components/boundary/portal/components/boundary-portal/stores/host-registry.store.ts +0 -1
- package/src/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.ts +2 -39
- package/src/components/boundary/portal/utils/handoff-target.ts +48 -0
- package/src/components/boundary/portal/utils/resolve-portal.ts +26 -18
- package/src/components/boundary/portal/utils/teleport-control.ts +0 -12
- package/src/components/boundary/providers/boundary-root.provider.tsx +28 -80
- package/src/components/boundary/utils/refresh-signals.ts +8 -0
- package/src/components/boundary/utils/resolve-boundary-target.tsx +39 -0
- package/src/components/masked-view.tsx +20 -4
- package/src/components/screen-container/layers/backdrop.tsx +3 -1
- package/src/components/screen-container/layers/maybe-masked-navigation-container.tsx +14 -4
- package/src/components/screen-lifecycle/hooks/use-transition-start-controller.ts +2 -0
- package/src/navigators/react-navigation/index.tsx +4 -48
- package/src/providers/helpers/measured-bounds-writes.ts +1 -0
- package/src/providers/screen/gestures/gestures.provider.tsx +2 -10
- package/src/providers/screen/gestures/pan/behavior/pan-lifecycle.ts +1 -0
- package/src/providers/screen/gestures/pinch/activation/use-pinch-activation.ts +74 -3
- package/src/providers/screen/gestures/pinch/behavior/pinch-lifecycle.ts +1 -0
- package/src/providers/screen/gestures/pinch/behavior/pinch-release.ts +2 -4
- package/src/providers/screen/gestures/types.ts +0 -14
- package/src/providers/screen/styles/helpers/transition-visual-state.ts +44 -0
- package/src/providers/screen/styles/helpers/visibility-gate.ts +17 -7
- package/src/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +30 -15
- package/src/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +14 -13
- package/src/stores/bounds/internals/links.ts +13 -2
- package/src/stores/scroll.store.ts +23 -0
- package/src/stores/system.store.ts +8 -0
- package/src/utils/animation/animate-to-progress.ts +59 -28
- package/src/utils/animation/animate.ts +18 -2
- package/src/utils/animation/spring/spring.ts +36 -1
- package/src/utils/animation/spring/springUtils.ts +130 -0
- package/src/utils/animation/state.ts +8 -0
- package/src/utils/bounds/navigation/reveal/math.ts +21 -5
- package/src/utils/bounds/navigation/zoom/build.ts +77 -23
- package/src/utils/bounds/navigation/zoom/drag.ts +3 -42
- package/src/utils/bounds/navigation/zoom/helpers.ts +9 -23
- package/lib/commonjs/components/boundary/hooks/use-register-target.js +0 -32
- package/lib/commonjs/components/boundary/hooks/use-register-target.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/components/portal-slot.js +0 -52
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/utils/ownership.js +0 -220
- package/lib/commonjs/components/boundary/portal/utils/ownership.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/utils/shallow-equal.js +0 -29
- package/lib/commonjs/components/boundary/portal/utils/shallow-equal.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/utils/visible-host.js +0 -25
- package/lib/commonjs/components/boundary/portal/utils/visible-host.js.map +0 -1
- package/lib/commonjs/providers/screen/gestures/rotation/activation/use-rotation-activation.js +0 -64
- package/lib/commonjs/providers/screen/gestures/rotation/activation/use-rotation-activation.js.map +0 -1
- package/lib/commonjs/providers/screen/gestures/rotation/behavior/rotation-lifecycle.js +0 -21
- package/lib/commonjs/providers/screen/gestures/rotation/behavior/rotation-lifecycle.js.map +0 -1
- package/lib/commonjs/providers/screen/gestures/rotation/behavior/use-rotation-behavior.js +0 -29
- package/lib/commonjs/providers/screen/gestures/rotation/behavior/use-rotation-behavior.js.map +0 -1
- package/lib/commonjs/providers/screen/gestures/rotation/use-build-rotation-gesture.js +0 -38
- package/lib/commonjs/providers/screen/gestures/rotation/use-build-rotation-gesture.js.map +0 -1
- package/lib/commonjs/providers/screen/styles/helpers/opening-phase.js +0 -32
- package/lib/commonjs/providers/screen/styles/helpers/opening-phase.js.map +0 -1
- package/lib/module/components/boundary/hooks/use-register-target.js +0 -27
- package/lib/module/components/boundary/hooks/use-register-target.js.map +0 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/components/portal-slot.js +0 -47
- package/lib/module/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +0 -1
- package/lib/module/components/boundary/portal/utils/ownership.js +0 -213
- package/lib/module/components/boundary/portal/utils/ownership.js.map +0 -1
- package/lib/module/components/boundary/portal/utils/shallow-equal.js +0 -24
- package/lib/module/components/boundary/portal/utils/shallow-equal.js.map +0 -1
- package/lib/module/components/boundary/portal/utils/visible-host.js +0 -20
- package/lib/module/components/boundary/portal/utils/visible-host.js.map +0 -1
- package/lib/module/providers/screen/gestures/rotation/activation/use-rotation-activation.js +0 -59
- package/lib/module/providers/screen/gestures/rotation/activation/use-rotation-activation.js.map +0 -1
- package/lib/module/providers/screen/gestures/rotation/behavior/rotation-lifecycle.js +0 -15
- package/lib/module/providers/screen/gestures/rotation/behavior/rotation-lifecycle.js.map +0 -1
- package/lib/module/providers/screen/gestures/rotation/behavior/use-rotation-behavior.js +0 -24
- package/lib/module/providers/screen/gestures/rotation/behavior/use-rotation-behavior.js.map +0 -1
- package/lib/module/providers/screen/gestures/rotation/use-build-rotation-gesture.js +0 -33
- package/lib/module/providers/screen/gestures/rotation/use-build-rotation-gesture.js.map +0 -1
- package/lib/module/providers/screen/styles/helpers/opening-phase.js +0 -26
- package/lib/module/providers/screen/styles/helpers/opening-phase.js.map +0 -1
- package/lib/typescript/components/boundary/hooks/use-register-target.d.ts +0 -10
- package/lib/typescript/components/boundary/hooks/use-register-target.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts +0 -13
- package/lib/typescript/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/utils/ownership.d.ts +0 -34
- package/lib/typescript/components/boundary/portal/utils/ownership.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/utils/shallow-equal.d.ts +0 -8
- package/lib/typescript/components/boundary/portal/utils/shallow-equal.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/utils/visible-host.d.ts +0 -8
- package/lib/typescript/components/boundary/portal/utils/visible-host.d.ts.map +0 -1
- package/lib/typescript/providers/screen/gestures/rotation/activation/use-rotation-activation.d.ts +0 -15
- package/lib/typescript/providers/screen/gestures/rotation/activation/use-rotation-activation.d.ts.map +0 -1
- package/lib/typescript/providers/screen/gestures/rotation/behavior/rotation-lifecycle.d.ts +0 -4
- package/lib/typescript/providers/screen/gestures/rotation/behavior/rotation-lifecycle.d.ts.map +0 -1
- package/lib/typescript/providers/screen/gestures/rotation/behavior/use-rotation-behavior.d.ts +0 -5
- package/lib/typescript/providers/screen/gestures/rotation/behavior/use-rotation-behavior.d.ts.map +0 -1
- package/lib/typescript/providers/screen/gestures/rotation/use-build-rotation-gesture.d.ts +0 -9
- package/lib/typescript/providers/screen/gestures/rotation/use-build-rotation-gesture.d.ts.map +0 -1
- package/lib/typescript/providers/screen/styles/helpers/opening-phase.d.ts +0 -16
- package/lib/typescript/providers/screen/styles/helpers/opening-phase.d.ts.map +0 -1
- package/src/components/boundary/hooks/use-register-target.ts +0 -43
- package/src/components/boundary/portal/components/boundary-portal/components/portal-slot.tsx +0 -80
- package/src/components/boundary/portal/utils/ownership.ts +0 -319
- package/src/components/boundary/portal/utils/shallow-equal.ts +0 -25
- package/src/components/boundary/portal/utils/visible-host.ts +0 -24
- package/src/providers/screen/gestures/rotation/activation/use-rotation-activation.ts +0 -88
- package/src/providers/screen/gestures/rotation/behavior/rotation-lifecycle.ts +0 -19
- package/src/providers/screen/gestures/rotation/behavior/use-rotation-behavior.ts +0 -47
- package/src/providers/screen/gestures/rotation/use-build-rotation-gesture.ts +0 -50
- package/src/providers/screen/styles/helpers/opening-phase.ts +0 -25
|
@@ -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":["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,OAAO,QAAQ,iDAAiD;AACzE,SAASC,WAAW,QAAQ,uCAAuC;AAEnE,SAASC,gBAAgB,EAAEC,qBAAqB,QAAQ,mBAAmB;AAC3E,SAASC,YAAY,QAAQ,2BAA2B;AACxD,SAASC,wBAAwB,QAAQ,yBAAyB;AAClE,SAASC,mBAAmB,QAAQ,6BAA6B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGlE,MAAMC,0BAA0B,GAAGP,gBAAgB,GAChDR,QAAQ,CAACgB,uBAAuB,CAACR,gBAAgB,CAAC,GAClD,IAAI;AAOP,OAAO,MAAMS,kBAAkB,gBAAGrB,IAAI,CAAC,SAASqB,kBAAkBA,CAAC;EAClEC,IAAI;E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ACTa,IAAI,EAAEE,oBACP,CAAC;EACF,CAAC,CAAC;;EAEF;EACA;EACA,IAAI,CAACjC,0BAA0B,EAAE;IAChC,OAAO,IAAI;EACZ;EAEA,oBACCD,IAAA,CAACd,QAAQ,CAACiD,IAAI;IACbC,aAAa,EAAEzC,qBAAsB;IACrCU,KAAK,EAAE,CAACA,KAAK,EAAEkB,SAAS,CAAE;IAC1Bc,WAAW,EAAE,KAAM;IAAAC,QAAA,eAEnBtC,IAAA,CAACC,0BAA0B;MAC1BsC,IAAI,EAAEnC,IAAI,CAACoC,cAAe;MAC1BJ,aAAa,EAAEzC,qBAAsB;MACrCU,KAAK,EAAE,CAACoC,MAAM,CAACC,OAAO,EAAEd,iBAAiB,EAAEG,SAAS;IAAE,CACtD;EAAC,CACY,CAAC;AAElB,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA,MAAMU,MAAM,GAAGxD,UAAU,CAAC0D,MAAM,CAAC;EAChCD,OAAO,EAAE1D,WAAW,CAAC4D,KAAK,GACvB;IACAC,GAAG,EAAE,CAAC;IACNC,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE;EACN,CAAC,GACA;IACAC,IAAI,EAAE,CAAC;IACPF,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE;EACN;AACH,CAAC,CAAC","ignoreList":[]}
|
package/lib/module/components/boundary/portal/components/boundary-portal/helpers/offset-style.js
CHANGED
|
@@ -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
|
};
|
package/lib/module/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getClampedScrollAxisDelta","getPortalHostBounds","resolvePortalOffsetStyle","bounds","hostKey","placement","
|
|
1
|
+
{"version":3,"names":["getClampedScrollAxisDelta","getPortalHostBounds","resolvePortalOffsetStyle","bounds","hostKey","placement","hostBounds","boundsScrollSnapshot","scroll","hostBoundsScrollSnapshot","alignHostToBoundsScroll","hostSnapshotDeltaX","hostSnapshotDeltaY","adjustedHostPageX","pageX","adjustedHostPageY","pageY","transform","translateY","translateX"],"sourceRoot":"../../../../../../../../src","sources":["components/boundary/portal/components/boundary-portal/helpers/offset-style.ts"],"mappings":";;AACA,SAASA,yBAAyB,QAAQ,uCAAuC;AAEjF,SAASC,mBAAmB,QAAQ,6BAA6B;;AAEjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,OAAO,MAAMC,wBAAwB,GAAGA,CAAC;EACxCC,MAAM;EACNC,OAAO;EACPC;AAC+B,CAAC,KAAiB;EACjD,SAAS;;EACT,MAAMC,UAAU,GAAGL,mBAAmB,CAACG,OAAO,CAAC;EAC/C,MAAMG,oBAAoB,GAAGJ,MAAM,CAACK,MAAM,IAAI,IAAI;EAClD,MAAMC,wBAAwB,GAAGH,UAAU,EAAEE,MAAM,IAAI,IAAI;;EAE3D;EACA;EACA;EACA,MAAME,uBAAuB,GAAGL,SAAS,KAAK,aAAa;EAE3D,MAAMM,kBAAkB,GAAGD,uBAAuB,GAC/CV,yBAAyB,CACzBO,oBAAoB,EACpBE,wBAAwB,EACxB,YACD,CAAC,GACA,CAAC;EACJ,MAAMG,kBAAkB,GAAGF,uBAAuB,GAC/CV,yBAAyB,CACzBO,oBAAoB,EACpBE,wBAAwB,EACxB,UACD,CAAC,GACA,CAAC;;EAEJ;EACA;EACA,MAAMI,iBAAiB,GAAGP,UAAU,GACjCA,UAAU,CAACQ,KAAK,GAAGH,kBAAkB,GACrC,CAAC;EACJ,MAAMI,iBAAiB,GAAGT,UAAU,GACjCA,UAAU,CAACU,KAAK,GAAGJ,kBAAkB,GACrC,CAAC;EAEJ,OAAO;IACNK,SAAS,EAAE,CACV;MAAEC,UAAU,EAAEf,MAAM,CAACa,KAAK,GAAGD;IAAkB,CAAC,EAChD;MAAEI,UAAU,EAAEhB,MAAM,CAACW,KAAK,GAAGD;IAAkB,CAAC;EAElD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,159 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { useAnimatedProps,
|
|
5
|
-
import { scheduleOnRN } from "react-native-worklets";
|
|
3
|
+
import { useLayoutEffect } from "react";
|
|
4
|
+
import { useAnimatedProps, useSharedValue } from "react-native-reanimated";
|
|
6
5
|
import { useDescriptorsStore } from "../../../../../../providers/screen/descriptors";
|
|
7
6
|
import { useScreenSlots } from "../../../../../../providers/screen/styles";
|
|
7
|
+
import { hasCloseTransitionFinished } from "../../../../../../providers/screen/styles/helpers/transition-visual-state";
|
|
8
|
+
import { AnimationStore } from "../../../../../../stores/animation.store";
|
|
9
|
+
import { getLinkKeyFromTag } from "../../../../../../stores/bounds/helpers/link-pairs.helpers";
|
|
8
10
|
import { pairs } from "../../../../../../stores/bounds/internals/state";
|
|
11
|
+
import { SystemStore } from "../../../../../../stores/system.store";
|
|
9
12
|
import { PORTAL_HOST_NAME_RESET_VALUE } from "../../../utils/naming";
|
|
10
|
-
import {
|
|
11
|
-
import { shallowEqual } from "../../../utils/shallow-equal";
|
|
12
|
-
import { shouldAttachBoundaryPortal } from "../../../utils/teleport-control";
|
|
13
|
-
import { resolveNextVisiblePortalHostName } from "../../../utils/visible-host";
|
|
13
|
+
import { isTeleportEnabled } from "../../../utils/teleport-control";
|
|
14
14
|
import { createBoundaryPortalHostName } from "../helpers/host-name";
|
|
15
15
|
import { useActiveHostKey } from "../stores/host-registry.store";
|
|
16
|
-
import {
|
|
16
|
+
import { mountPortalBoundaryHost, unmountPortalBoundaryHostByName } from "../stores/portal-boundary-host.store";
|
|
17
17
|
export const useBoundaryPortalAttachment = ({
|
|
18
|
-
boundaryId
|
|
19
|
-
enabled
|
|
18
|
+
boundaryId
|
|
20
19
|
}) => {
|
|
21
20
|
const sourcePairKey = useDescriptorsStore(s => s.derivations.sourcePairKey);
|
|
22
21
|
const currentScreenKey = useDescriptorsStore(s => s.derivations.currentScreenKey);
|
|
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");
|
|
23
26
|
const {
|
|
24
27
|
localStylesMaps,
|
|
25
|
-
nextInterpolatorReady,
|
|
26
28
|
slotsMap
|
|
27
29
|
} = useScreenSlots();
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const escapeHostKey = useActiveHostKey(enabled ? currentScreenKey : null);
|
|
33
|
-
const updatePortalOwnership = useCallback((hostScreenKey, ownerPairKey, ownerScreenKey) => {
|
|
34
|
-
if (hostScreenKey && ownerPairKey && ownerScreenKey) {
|
|
35
|
-
setOwnership(current => {
|
|
36
|
-
if (current?.hostScreenKey === hostScreenKey && current.ownerPairKey === ownerPairKey && current.ownerScreenKey === ownerScreenKey) {
|
|
37
|
-
return current;
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
hostScreenKey,
|
|
41
|
-
ownerPairKey,
|
|
42
|
-
ownerScreenKey,
|
|
43
|
-
status: "complete"
|
|
44
|
-
};
|
|
45
|
-
});
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
setOwnership(current => current ? null : current);
|
|
49
|
-
}, []);
|
|
50
|
-
const unmountOwnedPortalBoundaryHosts = useCallback(() => {
|
|
51
|
-
for (const portalHostName of mountedPortalBoundaryHostNamesRef.current) {
|
|
52
|
-
unmountPortalBoundaryHostByName(portalHostName);
|
|
53
|
-
}
|
|
54
|
-
mountedPortalBoundaryHostNamesRef.current.clear();
|
|
55
|
-
}, []);
|
|
30
|
+
const portalHostName = useSharedValue(null);
|
|
31
|
+
const portalHostReady = useSharedValue(false);
|
|
32
|
+
const attachedDestination = useSharedValue(null);
|
|
33
|
+
const escapeHostKey = useActiveHostKey(currentScreenKey);
|
|
56
34
|
useLayoutEffect(() => {
|
|
57
|
-
if (!
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
unmountOwnedPortalBoundaryHosts();
|
|
35
|
+
if (!sourcePairKey || !escapeHostKey) {
|
|
36
|
+
portalHostName.set(null);
|
|
37
|
+
portalHostReady.set(false);
|
|
61
38
|
return;
|
|
62
39
|
}
|
|
63
|
-
const
|
|
40
|
+
const nextPortalHostName = createBoundaryPortalHostName(escapeHostKey, boundaryId, sourcePairKey);
|
|
64
41
|
mountPortalBoundaryHost({
|
|
65
42
|
boundaryId,
|
|
66
|
-
escapeClipping: true,
|
|
67
43
|
hostKey: escapeHostKey,
|
|
68
44
|
localStylesMaps,
|
|
69
|
-
pairKey:
|
|
70
|
-
portalHostName,
|
|
45
|
+
pairKey: sourcePairKey,
|
|
46
|
+
portalHostName: nextPortalHostName,
|
|
47
|
+
portalHostReady,
|
|
71
48
|
screenKey: currentScreenKey,
|
|
72
49
|
slotsMap
|
|
73
50
|
});
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
// Request the new receiver immediately, but keep the currently visible
|
|
77
|
-
// receiver until the new interpolator is ready. This avoids a no-host gap
|
|
78
|
-
// during rapid close/open retargets.
|
|
79
|
-
requestedPortalHostName.set(portalHostName);
|
|
80
|
-
}, [boundaryId, currentScreenKey, enabled, escapeHostKey, localStylesMaps, ownership, requestedPortalHostName, slotsMap, unmountOwnedPortalBoundaryHosts, visiblePortalHostName]);
|
|
81
|
-
useLayoutEffect(() => {
|
|
51
|
+
portalHostName.set(nextPortalHostName);
|
|
82
52
|
return () => {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
53
|
+
portalHostName.set(null);
|
|
54
|
+
portalHostReady.set(false);
|
|
55
|
+
unmountPortalBoundaryHostByName(nextPortalHostName);
|
|
86
56
|
};
|
|
87
|
-
}, [
|
|
88
|
-
useAnimatedReaction(() => {
|
|
89
|
-
"worklet";
|
|
90
|
-
|
|
91
|
-
if (!enabled || !sourcePairKey) {
|
|
92
|
-
return {
|
|
93
|
-
hostScreenKey: null,
|
|
94
|
-
ownerPairKey: sourcePairKey,
|
|
95
|
-
ownerScreenKey: null,
|
|
96
|
-
status: "clear"
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
return resolveBoundaryPortalOwnership({
|
|
100
|
-
boundaryId,
|
|
101
|
-
currentScreenKey,
|
|
102
|
-
handoff: false,
|
|
103
|
-
pairsState: pairs.get(),
|
|
104
|
-
sourcePairKey
|
|
105
|
-
});
|
|
106
|
-
}, (signal, previousSignal) => {
|
|
107
|
-
"worklet";
|
|
108
|
-
|
|
109
|
-
if (shallowEqual(previousSignal, signal)) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
scheduleOnRN(updatePortalOwnership, signal.hostScreenKey, signal.ownerPairKey, signal.ownerScreenKey ?? undefined);
|
|
113
|
-
});
|
|
114
|
-
useAnimatedReaction(() => {
|
|
115
|
-
"worklet";
|
|
116
|
-
|
|
117
|
-
const slot = slotsMap.get()[boundaryId];
|
|
118
|
-
const teleport = slot?.props?.teleport;
|
|
119
|
-
const shouldTeleport = shouldAttachBoundaryPortal({
|
|
120
|
-
enabled,
|
|
121
|
-
teleport
|
|
122
|
-
});
|
|
123
|
-
const requestedName = requestedPortalHostName.get();
|
|
124
|
-
const visibleName = visiblePortalHostName.get();
|
|
125
|
-
const isInterpolatorReady = nextInterpolatorReady.get();
|
|
126
|
-
const nextVisibleName = resolveNextVisiblePortalHostName({
|
|
127
|
-
isInterpolatorReady: isInterpolatorReady === 1,
|
|
128
|
-
requestedName,
|
|
129
|
-
shouldTeleport,
|
|
130
|
-
visibleName
|
|
131
|
-
});
|
|
132
|
-
return {
|
|
133
|
-
isInterpolatorReady,
|
|
134
|
-
nextVisibleName,
|
|
135
|
-
requestedName,
|
|
136
|
-
shouldTeleport,
|
|
137
|
-
teleport,
|
|
138
|
-
visibleName
|
|
139
|
-
};
|
|
140
|
-
}, (state, previousState) => {
|
|
141
|
-
"worklet";
|
|
142
|
-
|
|
143
|
-
if (shallowEqual(previousState, state)) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
if (state.nextVisibleName !== state.visibleName) {
|
|
147
|
-
visiblePortalHostName.set(state.nextVisibleName);
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
if (state.visibleName && state.visibleName === state.requestedName) {
|
|
151
|
-
scheduleOnRN(dropStalePortalBoundaryHosts, {
|
|
152
|
-
boundaryId,
|
|
153
|
-
keepPortalHostName: state.visibleName
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
});
|
|
57
|
+
}, [boundaryId, currentScreenKey, escapeHostKey, localStylesMaps, portalHostName, portalHostReady, sourcePairKey, slotsMap]);
|
|
157
58
|
const teleportProps = useAnimatedProps(() => {
|
|
158
59
|
"worklet";
|
|
159
60
|
|
|
@@ -163,19 +64,33 @@ export const useBoundaryPortalAttachment = ({
|
|
|
163
64
|
teleport,
|
|
164
65
|
...slotProps
|
|
165
66
|
} = slot?.props ?? {};
|
|
166
|
-
const shouldTeleport =
|
|
167
|
-
|
|
168
|
-
|
|
67
|
+
const shouldTeleport = isTeleportEnabled(teleport);
|
|
68
|
+
const hostName = portalHostName.get();
|
|
69
|
+
const pair = sourcePairKey ? pairs.get()[sourcePairKey] : undefined;
|
|
70
|
+
const linkKey = getLinkKeyFromTag(boundaryId);
|
|
71
|
+
const link = pair?.links[linkKey];
|
|
72
|
+
const hasActiveLink = link?.source !== null && link !== undefined && (!link.group || pair?.groups[link.group]?.activeId === linkKey);
|
|
73
|
+
const hasAttachableHost = shouldTeleport && hasActiveLink && portalHostReady.get() && hostName;
|
|
74
|
+
if (hasAttachableHost) {
|
|
75
|
+
attachedDestination.set({
|
|
76
|
+
animationProgress: destinationAnimationProgress,
|
|
77
|
+
closing: destinationClosing
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const attached = attachedDestination.get();
|
|
81
|
+
const hasAttachedCloseFinished = attached !== null && hasCloseTransitionFinished({
|
|
82
|
+
animationProgress: attached.animationProgress.get(),
|
|
83
|
+
closing: attached.closing.get()
|
|
169
84
|
});
|
|
170
|
-
const
|
|
85
|
+
const canAttach = hasAttachableHost && !hasAttachedCloseFinished;
|
|
86
|
+
const targetHostName = canAttach ? hostName : PORTAL_HOST_NAME_RESET_VALUE;
|
|
171
87
|
return {
|
|
172
88
|
...slotProps,
|
|
173
|
-
hostName:
|
|
89
|
+
hostName: targetHostName
|
|
174
90
|
};
|
|
175
91
|
});
|
|
176
92
|
return {
|
|
177
|
-
teleportProps
|
|
178
|
-
visiblePortalHostName
|
|
93
|
+
teleportProps
|
|
179
94
|
};
|
|
180
95
|
};
|
|
181
96
|
//# sourceMappingURL=use-boundary-portal-attachment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["useLayoutEffect","useAnimatedProps","useSharedValue","useDescriptorsStore","useScreenSlots","hasCloseTransitionFinished","AnimationStore","getLinkKeyFromTag","pairs","SystemStore","PORTAL_HOST_NAME_RESET_VALUE","isTeleportEnabled","createBoundaryPortalHostName","useActiveHostKey","mountPortalBoundaryHost","unmountPortalBoundaryHostByName","useBoundaryPortalAttachment","boundaryId","sourcePairKey","s","derivations","currentScreenKey","nextScreenKey","destinationScreenKey","destinationAnimationProgress","getValue","destinationClosing","localStylesMaps","slotsMap","portalHostName","portalHostReady","attachedDestination","escapeHostKey","set","nextPortalHostName","hostKey","pairKey","screenKey","teleportProps","slot","get","pointerEvents","_pointerEvents","teleport","slotProps","props","shouldTeleport","hostName","pair","undefined","linkKey","link","links","hasActiveLink","source","group","groups","activeId","hasAttachableHost","animationProgress","closing","attached","hasAttachedCloseFinished","canAttach","targetHostName"],"sourceRoot":"../../../../../../../../src","sources":["components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts"],"mappings":";;AAAA,SAASA,eAAe,QAAQ,OAAO;AACvC,SAECC,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,iBAAiB,QAAQ,4DAA4D;AAC9F,SAASC,KAAK,QAAQ,iDAAiD;AACvE,SAASC,WAAW,QAAQ,uCAAuC;AACnE,SAASC,4BAA4B,QAAQ,uBAAuB;AACpE,SAASC,iBAAiB,QAAQ,iCAAiC;AACnE,SAASC,4BAA4B,QAAQ,sBAAsB;AACnE,SAASC,gBAAgB,QAAQ,+BAA+B;AAChE,SACCC,uBAAuB,EACvBC,+BAA+B,QACzB,sCAAsC;AAW7C,OAAO,MAAMC,2BAA2B,GAAGA,CAAC;EAC3CC;AACkC,CAAC,KAAK;EACxC,MAAMC,aAAa,GAAGf,mBAAmB,CAAEgB,CAAC,IAAKA,CAAC,CAACC,WAAW,CAACF,aAAa,CAAC;EAC7E,MAAMG,gBAAgB,GAAGlB,mBAAmB,CAC1CgB,CAAC,IAAKA,CAAC,CAACC,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AC;IACH;IAEA,MAAMmC,QAAQ,GAAG9B,mBAAmB,CAACS,GAAG,CAAC,CAAC;IAC1C,MAAMsB,wBAAwB,GAC7BD,QAAQ,KAAK,IAAI,IACjBxD,0BAA0B,CAAC;MAC1BsD,iBAAiB,EAAEE,QAAQ,CAACF,iBAAiB,CAACnB,GAAG,CAAC,CAAC;MACnDoB,OAAO,EAAEC,QAAQ,CAACD,OAAO,CAACpB,GAAG,CAAC;IAC/B,CAAC,CAAC;IACH,MAAMuB,SAAS,GAAGL,iBAAiB,IAAI,CAACI,wBAAwB;IAChE,MAAME,cAAc,GAAGD,SAAS,GAAGhB,QAAQ,GAAGrC,4BAA4B;IAE1E,OAAO;MACN,GAAGkC,SAAS;MACZG,QAAQ,EAAEiB;IACX,CAAC;EACF,CAAC,CAAC;EAEF,OAAO;IAAE1B;EAAc,CAAC;AACzB,CAAC","ignoreList":[]}
|
|
@@ -1,27 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { memo } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import Animated, { runOnUI } from "react-native-reanimated";
|
|
5
|
+
import { logger } from "../../../../../utils/logger";
|
|
6
|
+
import { isTeleportAvailable, PORTAL_POINTER_EVENTS, NativePortal as TeleportPortal } from "../../teleport";
|
|
5
7
|
import { useBoundaryPortalAttachment } from "./hooks/use-boundary-portal-attachment";
|
|
8
|
+
import { usePlaceholderStyles } from "./hooks/use-placeholder-styles";
|
|
6
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
const AnimatedNativePortal = TeleportPortal ? Animated.createAnimatedComponent(TeleportPortal) : null;
|
|
11
|
+
const EnabledNativePortal = AnimatedNativePortal;
|
|
7
12
|
export const BoundaryPortal = /*#__PURE__*/memo(function BoundaryPortal({
|
|
8
13
|
boundaryId,
|
|
9
14
|
children,
|
|
10
15
|
enabled,
|
|
11
16
|
placeholderRef
|
|
12
17
|
}) {
|
|
18
|
+
if (!enabled || !isTeleportAvailable || !AnimatedNativePortal) {
|
|
19
|
+
return children;
|
|
20
|
+
}
|
|
21
|
+
return /*#__PURE__*/_jsx(EnabledBoundaryPortal, {
|
|
22
|
+
boundaryId: boundaryId,
|
|
23
|
+
placeholderRef: placeholderRef,
|
|
24
|
+
children: children
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
const EnabledBoundaryPortal = /*#__PURE__*/memo(function EnabledBoundaryPortal({
|
|
28
|
+
boundaryId,
|
|
29
|
+
children,
|
|
30
|
+
placeholderRef
|
|
31
|
+
}) {
|
|
32
|
+
if (__DEV__ && !boundaryId) {
|
|
33
|
+
logger.warnOnce("portal:missing-id", "A boundary portal was rendered without an id; rendering inline.");
|
|
34
|
+
}
|
|
13
35
|
const {
|
|
14
36
|
teleportProps
|
|
15
37
|
} = useBoundaryPortalAttachment({
|
|
16
|
-
boundaryId
|
|
17
|
-
enabled
|
|
38
|
+
boundaryId
|
|
18
39
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
40
|
+
const {
|
|
41
|
+
handleOnLayout,
|
|
42
|
+
placeholderStyle
|
|
43
|
+
} = usePlaceholderStyles();
|
|
44
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
45
|
+
ref: placeholderRef,
|
|
46
|
+
onLayout: ({
|
|
47
|
+
nativeEvent: {
|
|
48
|
+
layout
|
|
49
|
+
}
|
|
50
|
+
}) => runOnUI(handleOnLayout)(layout),
|
|
51
|
+
style: placeholderStyle,
|
|
52
|
+
pointerEvents: PORTAL_POINTER_EVENTS,
|
|
53
|
+
collapsable: false,
|
|
54
|
+
children: /*#__PURE__*/_jsx(EnabledNativePortal, {
|
|
55
|
+
animatedProps: teleportProps,
|
|
56
|
+
name: boundaryId,
|
|
57
|
+
pointerEvents: PORTAL_POINTER_EVENTS,
|
|
58
|
+
children: children
|
|
59
|
+
})
|
|
25
60
|
});
|
|
26
61
|
});
|
|
27
62
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["memo","
|
|
1
|
+
{"version":3,"names":["memo","Animated","runOnUI","logger","isTeleportAvailable","PORTAL_POINTER_EVENTS","NativePortal","TeleportPortal","useBoundaryPortalAttachment","usePlaceholderStyles","jsx","_jsx","AnimatedNativePortal","createAnimatedComponent","EnabledNativePortal","BoundaryPortal","boundaryId","children","enabled","placeholderRef","EnabledBoundaryPortal","__DEV__","warnOnce","teleportProps","handleOnLayout","placeholderStyle","View","ref","onLayout","nativeEvent","layout","style","pointerEvents","collapsable","animatedProps","name"],"sourceRoot":"../../../../../../../src","sources":["components/boundary/portal/components/boundary-portal/index.tsx"],"mappings":";;AAAA,SAGCA,IAAI,QAEE,OAAO;AAEd,OAAOC,QAAQ,IAAsBC,OAAO,QAAQ,yBAAyB;AAC7E,SAASC,MAAM,QAAQ,6BAA6B;AACpD,SACCC,mBAAmB,EACnBC,qBAAqB,EACrBC,YAAY,IAAIC,cAAc,QACxB,gBAAgB;AACvB,SAASC,2BAA2B,QAAQ,wCAAwC;AACpF,SAASC,oBAAoB,QAAQ,gCAAgC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAStE,MAAMC,oBAAoB,GAAGL,cAAc,GACxCN,QAAQ,CAACY,uBAAuB,CAChCN,cACD,CAAC,GACA,IAAI;AACP,MAAMO,mBAAmB,GAAGF,oBAE3B;AASD,OAAO,MAAMG,cAAc,gBAAGf,IAAI,CAAC,SAASe,cAAcA,CAAC;EAC1DC,UAAU;EACVC,QAAQ;EACRC,OAAO;EACPC;AACoB,CAAC,EAAE;EACvB,IAAI,CAACD,OAAO,IAAI,CAACd,mBAAmB,IAAI,CAACQ,oBAAoB,EAAE;IAC9D,OAAOK,QAAQ;EAChB;EAEA,oBACCN,IAAA,CAACS,qBAAqB;IACrBJ,UAAU,EAAEA,UAAW;IACvBG,cAAc,EAAEA,cAAe;IAAAF,QAAA,EAE9BA;EAAQ,CACa,CAAC;AAE1B,CAAC,CAAC;AAEF,MAAMG,qBAAqB,gBAAGpB,IAAI,CAAC,SAASoB,qBAAqBA,CAAC;EACjEJ,UAAU;EACVC,QAAQ;EACRE;AACqC,CAAC,EAAE;EACxC,IAAIE,OAAO,IAAI,CAACL,UAAU,EAAE;IAC3Bb,MAAM,CAACmB,QAAQ,CACd,mBAAmB,EACnB,iEACD,CAAC;EACF;EAEA,MAAM;IAAEC;EAAc,CAAC,GAAGf,2BAA2B,CAAC;IAAEQ;EAAW,CAAC,CAAC;EACrE,MAAM;IAAEQ,cAAc;IAAEC;EAAiB,CAAC,GAAGhB,oBAAoB,CAAC,CAAC;EAEnE,oBACCE,IAAA,CAACV,QAAQ,CAACyB,IAAI;IACbC,GAAG,EAAER,cAAe;IACpBS,QAAQ,EAAEA,CAAC;MAAEC,WAAW,EAAE;QAAEC;MAAO;IAAE,CAAC,KACrC5B,OAAO,CAACsB,cAAc,CAAC,CAACM,MAAM,CAC9B;IACDC,KAAK,EAAEN,gBAAiB;IACxBO,aAAa,EAAE3B,qBAAsB;IACrC4B,WAAW,EAAE,KAAM;IAAAhB,QAAA,eAEnBN,IAAA,CAACG,mBAAmB;MACnBoB,aAAa,EAAEX,aAAc;MAC7BY,IAAI,EAAEnB,UAAW;MACjBgB,aAAa,EAAE3B,qBAAsB;MAAAY,QAAA,EAEpCA;IAAQ,CACW;EAAC,CACR,CAAC;AAElB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSyncExternalStore","EMPTY_SNAPSHOT","listeners","Set","hostStacks","Map","snapshot","getActiveHostFromStack","screenKey","stack","length","index","host","fallback","hostKey","buildSnapshot","nextSnapshot","emit","listener","subscribe","add","delete","registerHost","registration","get","previousActiveHostKey","nextStack","filter","unshift","push","set","unregisterHost","getActiveHostKey","useActiveHostKey","undefined","resetHostRegistry","clear"],"sourceRoot":"../../../../../../../../src","sources":["components/boundary/portal/components/boundary-portal/stores/host-registry.store.ts"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,OAAO;
|
|
1
|
+
{"version":3,"names":["useSyncExternalStore","EMPTY_SNAPSHOT","listeners","Set","hostStacks","Map","snapshot","getActiveHostFromStack","screenKey","stack","length","index","host","fallback","hostKey","buildSnapshot","nextSnapshot","emit","listener","subscribe","add","delete","registerHost","registration","get","previousActiveHostKey","nextStack","filter","unshift","push","set","unregisterHost","getActiveHostKey","useActiveHostKey","undefined","resetHostRegistry","clear"],"sourceRoot":"../../../../../../../../src","sources":["components/boundary/portal/components/boundary-portal/stores/host-registry.store.ts"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,OAAO;AAU5C,MAAMC,cAAoC,GAAG,CAAC,CAAC;AAE/C,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAa,CAAC;AACvC,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAA6B,CAAC;AAExD,IAAIC,QAA8B,GAAGL,cAAc;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,sBAAsB,GAAGA,CAC9BC,SAAiB,EACjBC,KAAqC,KACjC;EACJ,IAAI,CAACA,KAAK,IAAIA,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE;IACjC,OAAOF,SAAS;EACjB;EAEA,KAAK,IAAIG,KAAK,GAAGF,KAAK,CAACC,MAAM,GAAG,CAAC,EAAEC,KAAK,IAAI,CAAC,EAAEA,KAAK,EAAE,EAAE;IACvD,MAAMC,IAAI,GAAGH,KAAK,CAACE,KAAK,CAAC;IACzB,IAAI,CAACC,IAAI,CAACC,QAAQ,EAAE;MACnB,OAAOD,IAAI,CAACE,OAAO;IACpB;EACD;EAEA,OAAOL,KAAK,CAAC,CAAC,CAAC,EAAEK,OAAO,IAAIN,SAAS;AACtC,CAAC;AAED,MAAMO,aAAa,GAAGA,CAAA,KAA4B;EACjD,MAAMC,YAAkC,GAAG,CAAC,CAAC;EAE7C,KAAK,MAAM,CAACR,SAAS,EAAEC,KAAK,CAAC,IAAIL,UAAU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rE,MAAML,KAAK,GAAGL,UAAU,CAACoB,GAAG,CAAChB,SAAS,CAAC;EACvC,IAAI,CAACC,KAAK,EAAE;IACX;EACD;EAEA,MAAMgB,qBAAqB,GAAGlB,sBAAsB,CAACC,SAAS,EAAEC,KAAK,CAAC;EACtE,MAAMiB,SAAS,GAAGjB,KAAK,CAACkB,MAAM,CAAEf,IAAI,IAAKA,IAAI,CAACE,OAAO,KAAKA,OAAO,CAAC;EAElE,IAAIY,SAAS,CAAChB,MAAM,KAAK,CAAC,EAAE;IAC3BN,UAAU,CAACiB,MAAM,CAACb,SAAS,CAAC;EAC7B,CAAC,MAAM;IACNJ,UAAU,CAAC0B,GAAG,CAACtB,SAAS,EAAEkB,SAAS,CAAC;EACrC;EAEA,IAAID,qBAAqB,KAAKlB,sBAAsB,CAACC,SAAS,EAAEkB,SAAS,CAAC,EAAE;IAC3E;EACD;EAEAT,IAAI,CAAC,CAAC;AACP,CAAC;AAED,OAAO,MAAMe,gBAAgB,GAAIxB,SAAiB,IAAK;EACtD,OAAOF,QAAQ,CAACE,SAAS,CAAC,IAAIA,SAAS;AACxC,CAAC;AAED,OAAO,MAAMyB,gBAAgB,GAAIzB,SAAyB,IAAK;EAC9D,OAAOR,oBAAoB,CAC1BmB,SAAS,EACT,MAAOX,SAAS,GAAGwB,gBAAgB,CAACxB,SAAS,CAAC,GAAG0B,SAAU,EAC3D,MAAMA,SACP,CAAC;AACF,CAAC;AAED,OAAO,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;EACtC/B,UAAU,CAACgC,KAAK,CAAC,CAAC;EAClB9B,QAAQ,GAAGL,cAAc;EACzBgB,IAAI,CAAC,CAAC;AACP,CAAC","ignoreList":[]}
|
|
@@ -25,7 +25,7 @@ const emit = () => {
|
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
const isSameHost = (a, b) => {
|
|
28
|
-
return a.boundaryId === b.boundaryId && a.
|
|
28
|
+
return a.boundaryId === b.boundaryId && a.hostKey === b.hostKey && a.localStylesMaps === b.localStylesMaps && a.pairKey === b.pairKey && a.portalHostName === b.portalHostName && a.portalHostReady === b.portalHostReady && a.screenKey === b.screenKey && a.slotsMap === b.slotsMap;
|
|
29
29
|
};
|
|
30
30
|
export const mountPortalBoundaryHost = host => {
|
|
31
31
|
const previous = activeBoundaryHosts.get(host.portalHostName);
|
|
@@ -41,32 +41,6 @@ export const unmountPortalBoundaryHostByName = portalHostName => {
|
|
|
41
41
|
}
|
|
42
42
|
emit();
|
|
43
43
|
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Post-handoff GC: drop every receiver for this boundary except the one now
|
|
47
|
-
* visible (`keepPortalHostName`). Called once the new host is confirmed on
|
|
48
|
-
* screen so the superseded receivers stop rendering.
|
|
49
|
-
*/
|
|
50
|
-
export const dropStalePortalBoundaryHosts = ({
|
|
51
|
-
boundaryId,
|
|
52
|
-
keepPortalHostName
|
|
53
|
-
}) => {
|
|
54
|
-
if (!activeBoundaryHosts.has(keepPortalHostName)) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
let didDelete = false;
|
|
58
|
-
for (const [hostEntryKey, host] of activeBoundaryHosts) {
|
|
59
|
-
if (host.boundaryId !== boundaryId || host.portalHostName === keepPortalHostName) {
|
|
60
|
-
continue;
|
|
61
|
-
}
|
|
62
|
-
activeBoundaryHosts.delete(hostEntryKey);
|
|
63
|
-
didDelete = true;
|
|
64
|
-
}
|
|
65
|
-
if (!didDelete) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
emit();
|
|
69
|
-
};
|
|
70
44
|
const subscribe = listener => {
|
|
71
45
|
listeners.add(listener);
|
|
72
46
|
return () => {
|