react-native-screen-transitions 3.9.0-alpha.1 → 3.9.0-alpha.3
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/components/boundary/components/boundary-target.js +21 -16
- package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/create-boundary-component.js +88 -114
- package/lib/commonjs/shared/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/{use-boundary-presence.js → lifecycles/use-boundary-presence.js} +14 -7
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/hooks/{use-initial-destination-measurement.js → lifecycles/use-initial-destination-measurement.js} +51 -24
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/hooks/{use-initial-source-measurement.js → lifecycles/use-initial-source-measurement.js} +7 -10
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/hooks/{use-refresh-boundary.js → lifecycles/use-refresh-boundary.js} +10 -7
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +82 -0
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +10 -13
- package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/index.js +27 -30
- package/lib/commonjs/shared/components/boundary/index.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-local-portal-host.js +58 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/host.js +20 -4
- package/lib/commonjs/shared/components/boundary/portal/components/host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js +53 -32
- package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/portal.js +206 -96
- package/lib/commonjs/shared/components/boundary/portal/components/portal.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/hooks/use-host-measurement.js +14 -2
- package/lib/commonjs/shared/components/boundary/portal/hooks/use-host-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js +5 -44
- package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js +37 -5
- package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/teleport.js +15 -2
- package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/has-local-slot.js +18 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/has-local-slot.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/naming.js +10 -3
- package/lib/commonjs/shared/components/boundary/portal/utils/naming.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js +28 -49
- package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js +254 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/resolve-portal.js +38 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/resolve-portal.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/shallow-equal.js +29 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/shallow-equal.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/teleport-control.js +10 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/teleport-control.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/visible-host.js +25 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/visible-host.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +65 -0
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +12 -2
- package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js +0 -21
- package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/utils/source-signals.js +4 -9
- package/lib/commonjs/shared/components/boundary/utils/source-signals.js.map +1 -1
- package/lib/commonjs/shared/components/create-transition-aware-component.js +2 -20
- package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +1 -1
- package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +2 -14
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/content.js +4 -16
- package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +4 -15
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/surface-container.js +4 -16
- package/lib/commonjs/shared/components/screen-container/layers/surface-container.js.map +1 -1
- package/lib/commonjs/shared/index.js.map +1 -1
- package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js +6 -3
- package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js +1 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +143 -24
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/screen-composer.js +1 -1
- package/lib/commonjs/shared/providers/screen/screen-composer.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/compose-slot-style.js +95 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/compose-slot-style.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/normalize-slots.js +30 -9
- package/lib/commonjs/shared/providers/screen/styles/helpers/normalize-slots.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/opening-phase.js +32 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/opening-phase.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +16 -11
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js +2 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js +1 -20
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-gate.js +1 -11
- package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-gate.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js +96 -0
- package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +36 -36
- 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 +1 -19
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js +8 -3
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/index.js +38 -7
- package/lib/commonjs/shared/providers/screen/styles/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/{styles.provider.js → slot.provider.js} +34 -21
- package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js +53 -0
- package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -0
- package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +37 -2
- package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/entries.js +11 -4
- package/lib/commonjs/shared/stores/bounds/internals/entries.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/links.js +134 -51
- package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js +1 -3
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/commonjs/shared/stores/system.store.js +5 -0
- package/lib/commonjs/shared/stores/system.store.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js +10 -69
- package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/styles/local-transform.js +59 -0
- package/lib/commonjs/shared/utils/bounds/helpers/styles/local-transform.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +8 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js +59 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
- package/lib/commonjs/shared/utils/logger.js +11 -0
- package/lib/commonjs/shared/utils/logger.js.map +1 -1
- package/lib/module/shared/components/boundary/components/boundary-target.js +19 -14
- package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/module/shared/components/boundary/create-boundary-component.js +93 -119
- package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js +30 -0
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js.map +1 -0
- package/lib/module/shared/components/boundary/hooks/{use-initial-destination-measurement.js → lifecycles/use-initial-destination-measurement.js} +51 -24
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -0
- package/lib/module/shared/components/boundary/hooks/{use-initial-source-measurement.js → lifecycles/use-initial-source-measurement.js} +7 -10
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +1 -0
- package/lib/module/shared/components/boundary/hooks/{use-refresh-boundary.js → lifecycles/use-refresh-boundary.js} +10 -7
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -0
- package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +77 -0
- package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -0
- package/lib/module/shared/components/boundary/hooks/use-measurer.js +10 -13
- package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
- package/lib/module/shared/components/boundary/index.js +27 -30
- package/lib/module/shared/components/boundary/index.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js +53 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/host.js +21 -5
- package/lib/module/shared/components/boundary/portal/components/host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js +53 -32
- package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/portal.js +213 -103
- package/lib/module/shared/components/boundary/portal/components/portal.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js +15 -3
- package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js +4 -41
- package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js +35 -4
- package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/teleport.js +16 -2
- package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/utils/has-local-slot.js +13 -0
- package/lib/module/shared/components/boundary/portal/utils/has-local-slot.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/utils/naming.js +8 -2
- package/lib/module/shared/components/boundary/portal/utils/naming.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/utils/offset-style.js +29 -49
- package/lib/module/shared/components/boundary/portal/utils/offset-style.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/utils/ownership.js +246 -0
- package/lib/module/shared/components/boundary/portal/utils/ownership.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/utils/resolve-portal.js +33 -0
- package/lib/module/shared/components/boundary/portal/utils/resolve-portal.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/utils/shallow-equal.js +24 -0
- package/lib/module/shared/components/boundary/portal/utils/shallow-equal.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/utils/teleport-control.js +8 -0
- package/lib/module/shared/components/boundary/portal/utils/teleport-control.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/utils/visible-host.js +20 -0
- package/lib/module/shared/components/boundary/portal/utils/visible-host.js.map +1 -0
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +57 -0
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -0
- package/lib/module/shared/components/boundary/utils/destination-signals.js +12 -2
- package/lib/module/shared/components/boundary/utils/destination-signals.js.map +1 -1
- package/lib/module/shared/components/boundary/utils/refresh-signals.js +0 -21
- package/lib/module/shared/components/boundary/utils/refresh-signals.js.map +1 -1
- package/lib/module/shared/components/boundary/utils/source-signals.js +4 -9
- package/lib/module/shared/components/boundary/utils/source-signals.js.map +1 -1
- package/lib/module/shared/components/create-transition-aware-component.js +4 -22
- package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/module/shared/components/overlay/variations/float-overlay.js +2 -2
- package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/backdrop.js +4 -16
- package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/content.js +4 -16
- package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +5 -16
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/surface-container.js +4 -16
- package/lib/module/shared/components/screen-container/layers/surface-container.js.map +1 -1
- package/lib/module/shared/index.js.map +1 -1
- package/lib/module/shared/providers/helpers/measured-bounds-writes.js +6 -3
- package/lib/module/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/derivations.js +1 -0
- package/lib/module/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +144 -25
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/module/shared/providers/screen/screen-composer.js +2 -2
- package/lib/module/shared/providers/screen/screen-composer.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/compose-slot-style.js +89 -0
- package/lib/module/shared/providers/screen/styles/helpers/compose-slot-style.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/helpers/normalize-slots.js +30 -9
- package/lib/module/shared/providers/screen/styles/helpers/normalize-slots.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/opening-phase.js +26 -0
- package/lib/module/shared/providers/screen/styles/helpers/opening-phase.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +16 -11
- package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js +2 -0
- package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js +0 -18
- package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/visibility-gate.js +0 -9
- package/lib/module/shared/providers/screen/styles/helpers/visibility-gate.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js +87 -0
- package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +36 -36
- 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 +1 -19
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js +9 -4
- package/lib/module/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/index.js +2 -1
- package/lib/module/shared/providers/screen/styles/index.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/slot.provider.js +66 -0
- package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js +47 -0
- package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -0
- package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +33 -1
- package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/entries.js +11 -4
- package/lib/module/shared/stores/bounds/internals/entries.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/links.js +135 -53
- package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/resolver.js +1 -3
- package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/module/shared/stores/system.store.js +5 -0
- package/lib/module/shared/stores/system.store.js.map +1 -1
- package/lib/module/shared/types/animation.types.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/styles/compute.js +10 -69
- package/lib/module/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/styles/local-transform.js +52 -0
- package/lib/module/shared/utils/bounds/helpers/styles/local-transform.js.map +1 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js +9 -2
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js +58 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
- package/lib/module/shared/utils/logger.js +11 -0
- package/lib/module/shared/utils/logger.js.map +1 -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 +0 -1
- package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-boundary-presence.d.ts +11 -0
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-boundary-presence.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts +10 -0
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.d.ts +8 -0
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts +10 -0
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts +28 -0
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts +5 -6
- package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/index.d.ts +36 -229
- package/lib/typescript/shared/components/boundary/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts +8 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts +4 -3
- package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/hooks/use-host-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts +0 -7
- package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts +16 -1
- package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +1 -1
- package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts +3 -0
- package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts +2 -1
- package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts +16 -32
- package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts +35 -0
- package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/utils/resolve-portal.d.ts +12 -0
- package/lib/typescript/shared/components/boundary/portal/utils/resolve-portal.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/utils/shallow-equal.d.ts +8 -0
- package/lib/typescript/shared/components/boundary/portal/utils/shallow-equal.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/utils/teleport-control.d.ts +4 -0
- package/lib/typescript/shared/components/boundary/portal/utils/teleport-control.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/utils/visible-host.d.ts +8 -0
- package/lib/typescript/shared/components/boundary/portal/utils/visible-host.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +37 -0
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/types.d.ts +9 -36
- package/lib/typescript/shared/components/boundary/types.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts +1 -0
- package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/utils/source-signals.d.ts +0 -1
- package/lib/typescript/shared/components/boundary/utils/source-signals.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-transition-aware-component.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/content.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-container/layers/surface-container.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +3 -215
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts +3 -3
- package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts +1 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/compose-slot-style.d.ts +4 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/compose-slot-style.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/normalize-slots.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/opening-phase.d.ts +16 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/opening-phase.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts +3 -4
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.d.ts +2 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.d.ts +0 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/visibility-gate.d.ts +0 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/visibility-gate.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts +11 -0
- package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts +4 -6
- 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 +0 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/index.d.ts +2 -1
- package/lib/typescript/shared/providers/screen/styles/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +18 -0
- package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts +6 -0
- package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts.map +1 -0
- package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +8 -1
- package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/entries.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/links.d.ts +4 -3
- package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/types.d.ts +22 -20
- package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
- package/lib/typescript/shared/stores/system.store.d.ts +1 -0
- package/lib/typescript/shared/stores/system.store.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +7 -1
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/styles/compute.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/styles/local-transform.d.ts +6 -0
- package/lib/typescript/shared/utils/bounds/helpers/styles/local-transform.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts +9 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts.map +1 -1
- package/lib/typescript/shared/utils/logger.d.ts +6 -0
- package/lib/typescript/shared/utils/logger.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shared/components/boundary/components/boundary-target.tsx +30 -16
- package/src/shared/components/boundary/create-boundary-component.tsx +132 -164
- package/src/shared/components/boundary/hooks/lifecycles/use-boundary-presence.ts +41 -0
- package/src/shared/components/boundary/hooks/{use-initial-destination-measurement.ts → lifecycles/use-initial-destination-measurement.ts} +65 -22
- package/src/shared/components/boundary/hooks/{use-initial-source-measurement.ts → lifecycles/use-initial-source-measurement.ts} +10 -12
- package/src/shared/components/boundary/hooks/{use-refresh-boundary.ts → lifecycles/use-refresh-boundary.ts} +10 -10
- package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +97 -0
- package/src/shared/components/boundary/hooks/use-measurer.ts +16 -24
- package/src/shared/components/boundary/index.tsx +56 -30
- package/src/shared/components/boundary/portal/components/boundary-local-portal-host.tsx +66 -0
- package/src/shared/components/boundary/portal/components/host.tsx +20 -5
- package/src/shared/components/boundary/portal/components/portal-boundary-host.tsx +67 -52
- package/src/shared/components/boundary/portal/components/portal.tsx +281 -120
- package/src/shared/components/boundary/portal/hooks/use-host-measurement.ts +23 -2
- package/src/shared/components/boundary/portal/stores/host-registry.store.ts +4 -51
- package/src/shared/components/boundary/portal/stores/portal-boundary-host.store.ts +59 -6
- package/src/shared/components/boundary/portal/teleport.ts +28 -3
- package/src/shared/components/boundary/portal/utils/has-local-slot.ts +16 -0
- package/src/shared/components/boundary/portal/utils/naming.ts +11 -1
- package/src/shared/components/boundary/portal/utils/offset-style.ts +37 -139
- package/src/shared/components/boundary/portal/utils/ownership.ts +371 -0
- package/src/shared/components/boundary/portal/utils/resolve-portal.ts +50 -0
- package/src/shared/components/boundary/portal/utils/shallow-equal.ts +25 -0
- package/src/shared/components/boundary/portal/utils/teleport-control.ts +12 -0
- package/src/shared/components/boundary/portal/utils/visible-host.ts +24 -0
- package/src/shared/components/boundary/providers/{boundary-owner.provider.tsx → boundary-root.provider.tsx} +33 -47
- package/src/shared/components/boundary/types.ts +9 -39
- package/src/shared/components/boundary/utils/destination-signals.ts +22 -2
- package/src/shared/components/boundary/utils/refresh-signals.ts +0 -41
- package/src/shared/components/boundary/utils/source-signals.ts +5 -17
- package/src/shared/components/create-transition-aware-component.tsx +3 -25
- package/src/shared/components/overlay/variations/float-overlay.tsx +3 -3
- package/src/shared/components/screen-container/layers/backdrop.tsx +4 -17
- package/src/shared/components/screen-container/layers/content.tsx +4 -16
- package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +8 -18
- package/src/shared/components/screen-container/layers/surface-container.tsx +4 -17
- package/src/shared/index.ts +0 -5
- package/src/shared/providers/helpers/measured-bounds-writes.ts +6 -11
- package/src/shared/providers/screen/animation/helpers/derivations.ts +3 -0
- package/src/shared/providers/screen/animation/helpers/pipeline.ts +251 -68
- package/src/shared/providers/screen/screen-composer.tsx +3 -3
- package/src/shared/providers/screen/styles/helpers/compose-slot-style.ts +129 -0
- package/src/shared/providers/screen/styles/helpers/normalize-slots.ts +45 -8
- package/src/shared/providers/screen/styles/helpers/opening-phase.ts +25 -0
- package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/index.ts +22 -12
- package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.ts +3 -1
- package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.ts +0 -24
- package/src/shared/providers/screen/styles/helpers/visibility-gate.ts +0 -12
- package/src/shared/providers/screen/styles/hooks/slot-resolvers.tsx +111 -0
- package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +48 -38
- package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +0 -18
- package/src/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.tsx +17 -4
- package/src/shared/providers/screen/styles/index.tsx +13 -4
- package/src/shared/providers/screen/styles/slot.provider.tsx +93 -0
- package/src/shared/providers/screen/styles/stores/slot-references.store.ts +71 -0
- package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +41 -1
- package/src/shared/stores/bounds/internals/entries.ts +13 -5
- package/src/shared/stores/bounds/internals/links.ts +167 -85
- package/src/shared/stores/bounds/internals/resolver.ts +0 -2
- package/src/shared/stores/bounds/types.ts +24 -22
- package/src/shared/stores/system.store.ts +6 -0
- package/src/shared/types/animation.types.ts +8 -1
- package/src/shared/utils/bounds/helpers/styles/compute.ts +22 -124
- package/src/shared/utils/bounds/helpers/styles/local-transform.ts +86 -0
- package/src/shared/utils/bounds/navigation/zoom/build.ts +9 -1
- package/src/shared/utils/bounds/navigation/zoom/helpers.ts +96 -0
- package/src/shared/utils/logger.ts +12 -0
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-presence.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-initial-source-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-refresh-boundary.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/attachment.js +0 -40
- package/lib/commonjs/shared/components/boundary/portal/utils/attachment.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/providers/boundary-owner.provider.js +0 -68
- package/lib/commonjs/shared/components/boundary/providers/boundary-owner.provider.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/preserve-animated-props-only.js +0 -26
- package/lib/commonjs/shared/providers/screen/styles/helpers/preserve-animated-props-only.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +0 -1
- package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js +0 -23
- package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js.map +0 -1
- package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +0 -1
- package/lib/module/shared/components/boundary/hooks/use-initial-source-measurement.js.map +0 -1
- package/lib/module/shared/components/boundary/hooks/use-refresh-boundary.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/utils/attachment.js +0 -35
- package/lib/module/shared/components/boundary/portal/utils/attachment.js.map +0 -1
- package/lib/module/shared/components/boundary/providers/boundary-owner.provider.js +0 -60
- package/lib/module/shared/components/boundary/providers/boundary-owner.provider.js.map +0 -1
- package/lib/module/shared/providers/screen/styles/helpers/preserve-animated-props-only.js +0 -21
- package/lib/module/shared/providers/screen/styles/helpers/preserve-animated-props-only.js.map +0 -1
- package/lib/module/shared/providers/screen/styles/styles.provider.js +0 -53
- package/lib/module/shared/providers/screen/styles/styles.provider.js.map +0 -1
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts +0 -8
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts +0 -9
- package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts +0 -9
- package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts +0 -10
- package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/utils/attachment.d.ts +0 -21
- package/lib/typescript/shared/components/boundary/portal/utils/attachment.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/providers/boundary-owner.provider.d.ts +0 -44
- package/lib/typescript/shared/components/boundary/providers/boundary-owner.provider.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/preserve-animated-props-only.d.ts +0 -3
- package/lib/typescript/shared/providers/screen/styles/helpers/preserve-animated-props-only.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts +0 -14
- package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts.map +0 -1
- package/src/shared/components/boundary/hooks/use-boundary-presence.ts +0 -28
- package/src/shared/components/boundary/portal/utils/attachment.ts +0 -48
- package/src/shared/providers/screen/styles/helpers/preserve-animated-props-only.ts +0 -22
- package/src/shared/providers/screen/styles/styles.provider.tsx +0 -60
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import type { View } from "react-native";
|
|
3
|
+
import type { AnimatedRef, StyleProps } from "react-native-reanimated";
|
|
4
|
+
import type { BoundTag } from "../../../stores/bounds/types";
|
|
5
|
+
import { prepareStyleForBounds } from "../../../utils/bounds/helpers/styles/styles";
|
|
6
|
+
import type { BoundaryConfigProps } from "../types";
|
|
7
|
+
import { useBoundaryPresence } from "./lifecycles/use-boundary-presence";
|
|
8
|
+
import { useInitialDestinationMeasurement } from "./lifecycles/use-initial-destination-measurement";
|
|
9
|
+
import { useInitialSourceMeasurement } from "./lifecycles/use-initial-source-measurement";
|
|
10
|
+
import { useRefreshBoundary } from "./lifecycles/use-refresh-boundary";
|
|
11
|
+
import { useMeasurer } from "./use-measurer";
|
|
12
|
+
|
|
13
|
+
interface UseBoundaryMeasurementParams {
|
|
14
|
+
boundTag: BoundTag;
|
|
15
|
+
/** Raw `enabled` prop — drives the measurer and the passive-source gate. */
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
/** `enabled && hasConfiguredInterpolator` — gates presence + lifecycle. */
|
|
18
|
+
runtimeEnabled: boolean;
|
|
19
|
+
currentScreenKey: string;
|
|
20
|
+
/** Surface to measure: a nested target's placeholder, else the root. */
|
|
21
|
+
measuredRef: AnimatedRef<View>;
|
|
22
|
+
/** Root's own style; ignored when a nested target supplies its own. */
|
|
23
|
+
style?: unknown;
|
|
24
|
+
targetPreparedStyles?: StyleProps;
|
|
25
|
+
handoff: boolean;
|
|
26
|
+
escapeClipping: boolean;
|
|
27
|
+
config: BoundaryConfigProps;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Owns the full measurement lifecycle for a boundary: builds the measurer,
|
|
32
|
+
* registers presence, runs the initial source/destination + refresh reactions,
|
|
33
|
+
* and keeps the component itself away from the measurer.
|
|
34
|
+
*/
|
|
35
|
+
export const useBoundaryMeasurement = ({
|
|
36
|
+
boundTag,
|
|
37
|
+
enabled,
|
|
38
|
+
runtimeEnabled,
|
|
39
|
+
currentScreenKey,
|
|
40
|
+
measuredRef,
|
|
41
|
+
style,
|
|
42
|
+
targetPreparedStyles,
|
|
43
|
+
handoff,
|
|
44
|
+
escapeClipping,
|
|
45
|
+
config,
|
|
46
|
+
}: UseBoundaryMeasurementParams) => {
|
|
47
|
+
const { anchor, scaleMode, target, method } = config;
|
|
48
|
+
const boundaryConfig = useMemo<BoundaryConfigProps>(
|
|
49
|
+
() => ({ anchor, scaleMode, target, method }),
|
|
50
|
+
[anchor, scaleMode, target, method],
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const rootPreparedStyles = useMemo(
|
|
54
|
+
() => prepareStyleForBounds(style),
|
|
55
|
+
[style],
|
|
56
|
+
);
|
|
57
|
+
const preparedStyles = targetPreparedStyles ?? rootPreparedStyles;
|
|
58
|
+
|
|
59
|
+
const measureBoundary = useMeasurer({
|
|
60
|
+
enabled,
|
|
61
|
+
boundTag,
|
|
62
|
+
currentScreenKey,
|
|
63
|
+
preparedStyles,
|
|
64
|
+
measuredAnimatedRef: measuredRef,
|
|
65
|
+
handoff,
|
|
66
|
+
escapeClipping,
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// Register/unregister this boundary in the presence map so source/destination
|
|
70
|
+
// matching can resolve across concrete screen keys.
|
|
71
|
+
useBoundaryPresence({
|
|
72
|
+
enabled: runtimeEnabled,
|
|
73
|
+
boundTag,
|
|
74
|
+
currentScreenKey,
|
|
75
|
+
boundaryConfig,
|
|
76
|
+
handoff,
|
|
77
|
+
escapeClipping,
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
useInitialSourceMeasurement({
|
|
81
|
+
enabled: runtimeEnabled,
|
|
82
|
+
measureBoundary,
|
|
83
|
+
boundTag,
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
useInitialDestinationMeasurement({
|
|
87
|
+
boundTag,
|
|
88
|
+
enabled: runtimeEnabled,
|
|
89
|
+
measureBoundary,
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
useRefreshBoundary({
|
|
93
|
+
enabled: runtimeEnabled,
|
|
94
|
+
boundTag,
|
|
95
|
+
measureBoundary,
|
|
96
|
+
});
|
|
97
|
+
};
|
|
@@ -8,10 +8,9 @@ import {
|
|
|
8
8
|
} from "react-native-reanimated";
|
|
9
9
|
import { applyMeasuredBoundsWrites } from "../../../providers/helpers/measured-bounds-writes";
|
|
10
10
|
import { useOriginContext } from "../../../providers/screen/origin.provider";
|
|
11
|
-
import type {
|
|
11
|
+
import type { BoundTag } from "../../../stores/bounds/types";
|
|
12
12
|
import { ScrollStore } from "../../../stores/scroll.store";
|
|
13
13
|
import { SystemStore } from "../../../stores/system.store";
|
|
14
|
-
import { getActiveScrollHost } from "../portal/stores/host-registry.store";
|
|
15
14
|
import type { MeasureBoundary } from "../types";
|
|
16
15
|
import {
|
|
17
16
|
attachScrollSnapshotToMeasuredBounds,
|
|
@@ -22,24 +21,22 @@ import {
|
|
|
22
21
|
|
|
23
22
|
interface UseMeasurerParams {
|
|
24
23
|
enabled: boolean;
|
|
25
|
-
|
|
26
|
-
linkId: string;
|
|
27
|
-
group?: string;
|
|
24
|
+
boundTag: BoundTag;
|
|
28
25
|
currentScreenKey: string;
|
|
29
26
|
preparedStyles: StyleProps;
|
|
30
27
|
measuredAnimatedRef: AnimatedRef<View>;
|
|
31
|
-
|
|
28
|
+
handoff: boolean;
|
|
29
|
+
escapeClipping: boolean;
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
export const useMeasurer = ({
|
|
35
33
|
enabled,
|
|
36
|
-
|
|
37
|
-
linkId,
|
|
38
|
-
group,
|
|
34
|
+
boundTag,
|
|
39
35
|
currentScreenKey,
|
|
40
36
|
preparedStyles,
|
|
41
37
|
measuredAnimatedRef,
|
|
42
|
-
|
|
38
|
+
handoff,
|
|
39
|
+
escapeClipping,
|
|
43
40
|
}: UseMeasurerParams): MeasureBoundary => {
|
|
44
41
|
const { width: viewportWidth, height: viewportHeight } =
|
|
45
42
|
useWindowDimensions();
|
|
@@ -78,7 +75,7 @@ export const useMeasurer = ({
|
|
|
78
75
|
* lifecycle blocked until a valid retry lands.
|
|
79
76
|
*/
|
|
80
77
|
const shouldGuardDestinationViewport =
|
|
81
|
-
pendingLifecycleStartBlockCount.get() > 0 || !!group;
|
|
78
|
+
pendingLifecycleStartBlockCount.get() > 0 || !!boundTag.group;
|
|
82
79
|
|
|
83
80
|
const viewportAllowsDestinationWrite =
|
|
84
81
|
target.type !== "destination" ||
|
|
@@ -95,32 +92,27 @@ export const useMeasurer = ({
|
|
|
95
92
|
normalizedMeasured,
|
|
96
93
|
scrollMetadata.get(),
|
|
97
94
|
);
|
|
98
|
-
const sourceHost =
|
|
99
|
-
target.type === "source"
|
|
100
|
-
? (getActiveScrollHost(currentScreenKey) ?? undefined)
|
|
101
|
-
: undefined;
|
|
102
95
|
|
|
103
96
|
applyMeasuredBoundsWrites({
|
|
104
|
-
entryTag,
|
|
105
|
-
linkId,
|
|
106
|
-
group,
|
|
97
|
+
entryTag: boundTag.tag,
|
|
98
|
+
linkId: boundTag.linkKey,
|
|
99
|
+
group: boundTag.group,
|
|
107
100
|
currentScreenKey,
|
|
108
101
|
measured: measuredWithScroll,
|
|
109
102
|
preparedStyles,
|
|
110
103
|
linkWrite: target,
|
|
111
|
-
|
|
112
|
-
|
|
104
|
+
handoff,
|
|
105
|
+
escapeClipping,
|
|
113
106
|
});
|
|
114
107
|
},
|
|
115
108
|
[
|
|
116
109
|
enabled,
|
|
117
|
-
|
|
118
|
-
linkId,
|
|
119
|
-
group,
|
|
110
|
+
boundTag,
|
|
120
111
|
currentScreenKey,
|
|
121
112
|
preparedStyles,
|
|
122
113
|
measuredAnimatedRef,
|
|
123
|
-
|
|
114
|
+
handoff,
|
|
115
|
+
escapeClipping,
|
|
124
116
|
viewportWidth,
|
|
125
117
|
viewportHeight,
|
|
126
118
|
scrollState,
|
|
@@ -1,58 +1,84 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Pressable,
|
|
4
|
+
type PressableProps,
|
|
5
|
+
View,
|
|
6
|
+
type ViewProps,
|
|
7
|
+
} from "react-native";
|
|
2
8
|
import { BoundaryTarget } from "./components/boundary-target";
|
|
3
9
|
import { createBoundaryComponent } from "./create-boundary-component";
|
|
4
10
|
import { Host } from "./portal";
|
|
11
|
+
import type { BoundaryComponentProps } from "./types";
|
|
5
12
|
|
|
6
|
-
export type {
|
|
7
|
-
BoundaryPortal,
|
|
8
|
-
BoundaryPortalAttachTarget,
|
|
9
|
-
BoundaryPortalOptions,
|
|
10
|
-
} from "./types";
|
|
11
13
|
export { createBoundaryComponent };
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
type BoundaryPrimitiveProps = Omit<ViewProps, "id" | "style"> &
|
|
16
|
+
Omit<PressableProps, "id" | "style"> & {
|
|
17
|
+
style?: ViewProps["style"] | PressableProps["style"];
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const BoundaryPrimitive = forwardRef<View, BoundaryPrimitiveProps>(
|
|
21
|
+
(props, ref) => {
|
|
22
|
+
const Component = "onPress" in props ? Pressable : View;
|
|
23
|
+
|
|
24
|
+
return <Component {...(props as any)} ref={ref as any} />;
|
|
25
|
+
},
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
BoundaryPrimitive.displayName = "Transition.Boundary.Primitive";
|
|
29
|
+
|
|
30
|
+
const BoundaryRoot = createBoundaryComponent(BoundaryPrimitive);
|
|
31
|
+
const BoundaryView = createBoundaryComponent(View);
|
|
16
32
|
const BoundaryTrigger = createBoundaryComponent(Pressable);
|
|
33
|
+
BoundaryRoot.displayName = "Transition.Boundary";
|
|
17
34
|
BoundaryView.displayName = "Transition.Boundary.View";
|
|
18
35
|
BoundaryTrigger.displayName = "Transition.Boundary.Trigger";
|
|
19
36
|
BoundaryTarget.displayName = "Transition.Boundary.Target";
|
|
20
37
|
Host.displayName = "Transition.Boundary.Host";
|
|
21
38
|
|
|
39
|
+
type BoundaryRootComponent = typeof BoundaryRoot;
|
|
40
|
+
|
|
22
41
|
/**
|
|
23
|
-
* Shared-boundary
|
|
42
|
+
* Shared-boundary component with static helpers.
|
|
24
43
|
*
|
|
25
44
|
* How measurement works:
|
|
26
|
-
* 1.
|
|
27
|
-
* 2.
|
|
28
|
-
* 3. The link is updated as layout changes
|
|
45
|
+
* 1. Destination screen captures bounds for a tag.
|
|
46
|
+
* 2. Source screen captures bounds for the same concrete pair.
|
|
47
|
+
* 3. The link is updated as layout changes.
|
|
29
48
|
*
|
|
30
|
-
*
|
|
31
|
-
* -
|
|
32
|
-
*
|
|
33
|
-
* fresh source geometry on the first frame.
|
|
49
|
+
* Runtime primitive:
|
|
50
|
+
* - With an `onPress` handler, the root renders as a Pressable.
|
|
51
|
+
* - Without an `onPress` handler, the root renders as a View.
|
|
34
52
|
*
|
|
35
53
|
* Use:
|
|
36
|
-
* - `Boundary
|
|
37
|
-
* - `Boundary.
|
|
38
|
-
* - `Boundary.Target` to measure a nested descendant instead of the owner.
|
|
54
|
+
* - `Boundary` for passive and pressable shared elements.
|
|
55
|
+
* - `Boundary.Target` to measure a nested descendant instead of the root.
|
|
39
56
|
* - `Boundary.Host` to make nested portal placement explicit.
|
|
40
57
|
*/
|
|
41
|
-
export
|
|
58
|
+
export interface BoundaryComponent extends BoundaryRootComponent {
|
|
42
59
|
/**
|
|
43
|
-
*
|
|
60
|
+
* Optional nested measurement override inside a boundary root.
|
|
44
61
|
*/
|
|
45
|
-
|
|
62
|
+
Target: typeof BoundaryTarget;
|
|
46
63
|
/**
|
|
47
|
-
*
|
|
64
|
+
* Explicit portal host for scrollable or otherwise clipped coordinate spaces.
|
|
48
65
|
*/
|
|
49
|
-
|
|
66
|
+
Host: typeof Host;
|
|
50
67
|
/**
|
|
51
|
-
*
|
|
68
|
+
* @deprecated Use `Transition.Boundary` without `onPress`.
|
|
52
69
|
*/
|
|
53
|
-
|
|
70
|
+
View: typeof BoundaryView;
|
|
54
71
|
/**
|
|
55
|
-
*
|
|
72
|
+
* @deprecated Use `Transition.Boundary` with `onPress`.
|
|
56
73
|
*/
|
|
57
|
-
|
|
58
|
-
}
|
|
74
|
+
Trigger: typeof BoundaryTrigger;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export type BoundaryProps = BoundaryComponentProps<BoundaryPrimitiveProps>;
|
|
78
|
+
|
|
79
|
+
export const Boundary = Object.assign(BoundaryRoot, {
|
|
80
|
+
Target: BoundaryTarget,
|
|
81
|
+
Host,
|
|
82
|
+
View: BoundaryView,
|
|
83
|
+
Trigger: BoundaryTrigger,
|
|
84
|
+
}) as BoundaryComponent;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { memo, useCallback, useLayoutEffect } from "react";
|
|
2
|
+
import { StyleSheet, View } from "react-native";
|
|
3
|
+
import Animated from "react-native-reanimated";
|
|
4
|
+
import { SystemStore } from "../../../../stores/system.store";
|
|
5
|
+
import { NativePortalHost } from "../teleport";
|
|
6
|
+
import { createBoundaryLocalPortalHostName } from "../utils/naming";
|
|
7
|
+
|
|
8
|
+
const AnimatedPortalHost = NativePortalHost
|
|
9
|
+
? Animated.createAnimatedComponent(NativePortalHost)
|
|
10
|
+
: null;
|
|
11
|
+
|
|
12
|
+
type BoundaryLocalPortalHostProps = {
|
|
13
|
+
boundaryId: string;
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
screenKey: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const BoundaryLocalPortalHost = memo(function BoundaryLocalPortalHost({
|
|
19
|
+
boundaryId,
|
|
20
|
+
enabled,
|
|
21
|
+
screenKey,
|
|
22
|
+
}: BoundaryLocalPortalHostProps) {
|
|
23
|
+
const { drainLifecycleStartBlocks } = SystemStore.getBag(screenKey).actions;
|
|
24
|
+
const handleLayout = useCallback(() => {
|
|
25
|
+
drainLifecycleStartBlocks();
|
|
26
|
+
}, [drainLifecycleStartBlocks]);
|
|
27
|
+
|
|
28
|
+
useLayoutEffect(() => {
|
|
29
|
+
if (!enabled || !AnimatedPortalHost) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
drainLifecycleStartBlocks();
|
|
34
|
+
}, [enabled, drainLifecycleStartBlocks]);
|
|
35
|
+
|
|
36
|
+
if (!enabled || !AnimatedPortalHost) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const portalHostName = createBoundaryLocalPortalHostName(
|
|
41
|
+
screenKey,
|
|
42
|
+
boundaryId,
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<View
|
|
47
|
+
pointerEvents="none"
|
|
48
|
+
style={styles.hostWrapper}
|
|
49
|
+
onLayout={handleLayout}
|
|
50
|
+
collapsable={false}
|
|
51
|
+
>
|
|
52
|
+
<AnimatedPortalHost name={portalHostName} style={styles.host} />
|
|
53
|
+
</View>
|
|
54
|
+
);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const styles = StyleSheet.create({
|
|
58
|
+
host: {
|
|
59
|
+
...StyleSheet.absoluteFillObject,
|
|
60
|
+
overflow: "visible",
|
|
61
|
+
},
|
|
62
|
+
hostWrapper: {
|
|
63
|
+
...StyleSheet.absoluteFillObject,
|
|
64
|
+
overflow: "visible",
|
|
65
|
+
},
|
|
66
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { memo, useLayoutEffect, useRef } from "react";
|
|
1
|
+
import { memo, useCallback, useLayoutEffect, useRef } from "react";
|
|
2
2
|
import {
|
|
3
3
|
type StyleProp,
|
|
4
4
|
StyleSheet,
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
} from "react-native";
|
|
9
9
|
import Animated from "react-native-reanimated";
|
|
10
10
|
import { useDescriptorsStore } from "../../../../providers/screen/descriptors";
|
|
11
|
+
import { SystemStore } from "../../../../stores/system.store";
|
|
11
12
|
import { useHostMeasurement } from "../hooks/use-host-measurement";
|
|
12
13
|
import { registerHost, unregisterHost } from "../stores/host-registry.store";
|
|
13
14
|
import { useActivePortalBoundaryHosts } from "../stores/portal-boundary-host.store";
|
|
@@ -25,6 +26,7 @@ type HostImplProps = PublicHostProps & {
|
|
|
25
26
|
|
|
26
27
|
function HostImpl({ fallback = false, style }: HostImplProps) {
|
|
27
28
|
const screenKey = useDescriptorsStore((s) => s.derivations.currentScreenKey);
|
|
29
|
+
const { drainLifecycleStartBlocks } = SystemStore.getBag(screenKey).actions;
|
|
28
30
|
const generatedHostKeyRef = useRef<string | null>(null);
|
|
29
31
|
|
|
30
32
|
if (generatedHostKeyRef.current === null) {
|
|
@@ -57,15 +59,28 @@ function HostImpl({ fallback = false, style }: HostImplProps) {
|
|
|
57
59
|
};
|
|
58
60
|
}, [capturesScroll, fallback, hostKey, screenKey]);
|
|
59
61
|
|
|
62
|
+
const handleUnblocking = useCallback(() => {
|
|
63
|
+
// Screen-level escape keeps the open transition gated until portal hosts
|
|
64
|
+
// have committed layout. A screen may render more than one portal boundary
|
|
65
|
+
// host for the same lifecycle request, so the final host layout drains the
|
|
66
|
+
// outstanding start blocks for this screen.
|
|
67
|
+
drainLifecycleStartBlocks();
|
|
68
|
+
}, [drainLifecycleStartBlocks]);
|
|
69
|
+
|
|
60
70
|
const boundaryHosts = measurement.canRenderHosts
|
|
61
|
-
? activeBoundaryHosts.map((host) => (
|
|
71
|
+
? activeBoundaryHosts.map((host, idx, list) => (
|
|
62
72
|
<View
|
|
63
|
-
key={host.
|
|
64
|
-
pointerEvents="
|
|
73
|
+
key={host.portalHostName}
|
|
74
|
+
pointerEvents="none"
|
|
65
75
|
style={[
|
|
66
76
|
styles.boundaryHostViewport,
|
|
67
77
|
{ width: viewportWidth, height: viewportHeight },
|
|
68
78
|
]}
|
|
79
|
+
onLayout={() => {
|
|
80
|
+
if (list.length - 1 === idx) {
|
|
81
|
+
handleUnblocking();
|
|
82
|
+
}
|
|
83
|
+
}}
|
|
69
84
|
>
|
|
70
85
|
<PortalBoundaryHost host={host} style={StyleSheet.absoluteFill} />
|
|
71
86
|
</View>
|
|
@@ -75,7 +90,7 @@ function HostImpl({ fallback = false, style }: HostImplProps) {
|
|
|
75
90
|
return (
|
|
76
91
|
<Animated.View
|
|
77
92
|
ref={measurement.hostRef}
|
|
78
|
-
pointerEvents="
|
|
93
|
+
pointerEvents="none"
|
|
79
94
|
style={[
|
|
80
95
|
styles.host,
|
|
81
96
|
{ width: viewportWidth, height: viewportHeight },
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { memo } from "react";
|
|
2
|
-
import type
|
|
2
|
+
import { type StyleProp, StyleSheet, type ViewStyle } from "react-native";
|
|
3
3
|
import Animated, { useAnimatedStyle } from "react-native-reanimated";
|
|
4
4
|
import { NO_STYLES } from "../../../../constants";
|
|
5
|
-
import {
|
|
6
|
-
import { getSourceScreenKeyFromPairKey } from "../../../../stores/bounds/helpers/link-pairs.helpers";
|
|
5
|
+
import { composeSlotStyleWithLocalTransform } from "../../../../providers/screen/styles/helpers/compose-slot-style";
|
|
7
6
|
import { getLink } from "../../../../stores/bounds/internals/links";
|
|
8
|
-
import {
|
|
9
|
-
import { ScrollStore } from "../../../../stores/scroll.store";
|
|
7
|
+
import type { ScrollMeasuredDimensions } from "../../utils/measured-bounds";
|
|
10
8
|
import type { ActivePortalBoundaryHost } from "../stores/portal-boundary-host.store";
|
|
11
9
|
import { NativePortalHost } from "../teleport";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
type PortalOffsetPlacement,
|
|
15
|
-
resolvePortalOffsetStyle,
|
|
16
|
-
} from "../utils/offset-style";
|
|
10
|
+
import { hasLocalSlot } from "../utils/has-local-slot";
|
|
11
|
+
import { resolvePortalOffsetStyle } from "../utils/offset-style";
|
|
17
12
|
|
|
18
13
|
const AnimatedPortalBoundaryHost = NativePortalHost
|
|
19
14
|
? Animated.createAnimatedComponent(NativePortalHost)
|
|
@@ -28,21 +23,6 @@ export const PortalBoundaryHost = memo(function PortalBoundaryHost({
|
|
|
28
23
|
host,
|
|
29
24
|
style,
|
|
30
25
|
}: PortalBoundaryHostProps) {
|
|
31
|
-
const hostName = createPortalBoundaryHostName(host.hostKey, host.boundaryId);
|
|
32
|
-
const hostClosing = AnimationStore.getValue(host.screenKey, "closing");
|
|
33
|
-
const hostProgress = AnimationStore.getValue(
|
|
34
|
-
host.screenKey,
|
|
35
|
-
"transitionProgress",
|
|
36
|
-
);
|
|
37
|
-
const hostGestureDismissing = GestureStore.getValue(
|
|
38
|
-
host.screenKey,
|
|
39
|
-
"dismissing",
|
|
40
|
-
);
|
|
41
|
-
const hostScrollMetadata = ScrollStore.getValue(host.screenKey, "metadata");
|
|
42
|
-
const sourceScrollMetadata = ScrollStore.getValue(
|
|
43
|
-
getSourceScreenKeyFromPairKey(host.pairKey),
|
|
44
|
-
"metadata",
|
|
45
|
-
);
|
|
46
26
|
const hostStyle = useAnimatedStyle(() => {
|
|
47
27
|
"worklet";
|
|
48
28
|
// Strict per-member lookup — a fallback member's source rect would
|
|
@@ -52,38 +32,56 @@ export const PortalBoundaryHost = memo(function PortalBoundaryHost({
|
|
|
52
32
|
return NO_STYLES;
|
|
53
33
|
}
|
|
54
34
|
|
|
55
|
-
|
|
56
|
-
// The resolver owns the math; this component decides which screen/scroll
|
|
57
|
-
// relationship the active portal is in.
|
|
35
|
+
const sourceBounds = link.source.bounds as ScrollMeasuredDimensions;
|
|
58
36
|
const isCrossScreenPortal = link.source.screenKey !== host.screenKey;
|
|
59
|
-
const isHostClosing =
|
|
60
|
-
hostClosing.get() === 1 || hostGestureDismissing.get() === 1;
|
|
61
|
-
const placement: PortalOffsetPlacement = !isCrossScreenPortal
|
|
62
|
-
? "same-screen"
|
|
63
|
-
: isHostClosing
|
|
64
|
-
? "cross-screen-close"
|
|
65
|
-
: "cross-screen-open";
|
|
66
|
-
|
|
67
|
-
// A source that originated inside its own scroll host moves with that
|
|
68
|
-
// ScrollView while this portal stays attached over here. Shifting the
|
|
69
|
-
// source rect by the clamped source scroll travel keeps the return
|
|
70
|
-
// landing point on the live placeholder, so the close detach is seamless.
|
|
71
|
-
const trackSourceScroll =
|
|
72
|
-
isCrossScreenPortal && link.source.sourceHost?.capturesScroll === true;
|
|
73
37
|
|
|
74
38
|
return resolvePortalOffsetStyle({
|
|
75
|
-
bounds:
|
|
76
|
-
hostCurrentScroll:
|
|
77
|
-
placement === "cross-screen-close" ? hostScrollMetadata.get() : null,
|
|
39
|
+
bounds: sourceBounds,
|
|
78
40
|
hostKey: host.hostKey,
|
|
79
|
-
placement,
|
|
80
|
-
sourceCurrentScroll: trackSourceScroll
|
|
81
|
-
? sourceScrollMetadata.get()
|
|
82
|
-
: null,
|
|
83
|
-
hostProgress: hostProgress.get(),
|
|
84
|
-
trackSourceScroll,
|
|
41
|
+
placement: isCrossScreenPortal ? "cross-screen" : "same-screen",
|
|
85
42
|
});
|
|
86
43
|
});
|
|
44
|
+
const contentFrameStyle = useAnimatedStyle(() => {
|
|
45
|
+
"worklet";
|
|
46
|
+
const link = getLink(host.pairKey, host.boundaryId);
|
|
47
|
+
if (!link?.source || !link.destination) {
|
|
48
|
+
return NO_STYLES;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const sourceBounds = link.source.bounds as ScrollMeasuredDimensions;
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
height: sourceBounds.height,
|
|
55
|
+
width: sourceBounds.width,
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
const slotStyle = useAnimatedStyle(() => {
|
|
59
|
+
"worklet";
|
|
60
|
+
// `slotsMap` is the resolved map: it may contain real interpolator output,
|
|
61
|
+
// inherited styles, or resolver-created reset patches for slots that just
|
|
62
|
+
// disappeared. Normal components need those reset patches so stale styles
|
|
63
|
+
// clear correctly.
|
|
64
|
+
//
|
|
65
|
+
// A screen-level portal host is different. It is only the temporary visual
|
|
66
|
+
// receiver for teleported content, not the original component that needs a
|
|
67
|
+
// cleanup frame. If the current local interpolator layers did not emit this
|
|
68
|
+
// boundary id, any resolved style here is cleanup/stale residue and should
|
|
69
|
+
// not be drawn by the host.
|
|
70
|
+
if (
|
|
71
|
+
host.escapeClipping &&
|
|
72
|
+
!hasLocalSlot(host.localStylesMaps.get(), host.boundaryId)
|
|
73
|
+
) {
|
|
74
|
+
return NO_STYLES;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const slot = host.slotsMap.get()[host.boundaryId];
|
|
78
|
+
|
|
79
|
+
return composeSlotStyleWithLocalTransform(
|
|
80
|
+
slot?.style ?? NO_STYLES,
|
|
81
|
+
undefined,
|
|
82
|
+
slot?.boundsLocalTransform,
|
|
83
|
+
);
|
|
84
|
+
});
|
|
87
85
|
|
|
88
86
|
// Without `react-native-teleport` no portal ever mounts a boundary host, so
|
|
89
87
|
// this never renders — the guard just narrows the nullable animated host.
|
|
@@ -92,6 +90,23 @@ export const PortalBoundaryHost = memo(function PortalBoundaryHost({
|
|
|
92
90
|
}
|
|
93
91
|
|
|
94
92
|
return (
|
|
95
|
-
<
|
|
93
|
+
<Animated.View
|
|
94
|
+
pointerEvents="none"
|
|
95
|
+
style={[style, hostStyle]}
|
|
96
|
+
collapsable={false}
|
|
97
|
+
>
|
|
98
|
+
<AnimatedPortalBoundaryHost
|
|
99
|
+
name={host.portalHostName}
|
|
100
|
+
style={[styles.content, contentFrameStyle, slotStyle]}
|
|
101
|
+
/>
|
|
102
|
+
</Animated.View>
|
|
96
103
|
);
|
|
97
104
|
});
|
|
105
|
+
|
|
106
|
+
const styles = StyleSheet.create({
|
|
107
|
+
content: {
|
|
108
|
+
left: 0,
|
|
109
|
+
position: "absolute",
|
|
110
|
+
top: 0,
|
|
111
|
+
},
|
|
112
|
+
});
|