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
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { useSyncExternalStore } from "react";
|
|
2
|
-
import { makeMutable } from "react-native-reanimated";
|
|
3
|
-
import type { SourceHostRef } from "../../../../stores/bounds/types";
|
|
4
2
|
|
|
5
3
|
export type HostRegistration = {
|
|
6
4
|
hostKey: string;
|
|
@@ -19,13 +17,11 @@ const hostStacks = new Map<string, HostRegistration[]>();
|
|
|
19
17
|
let snapshot: HostRegistrySnapshot = EMPTY_SNAPSHOT;
|
|
20
18
|
|
|
21
19
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
20
|
+
* The active host for a screen. Stack ordering is the load-bearing invariant:
|
|
21
|
+
* `registerHost` unshifts fallback hosts to the front and pushes real hosts to
|
|
22
|
+
* the back, so the active host is the last real (non-fallback) host, falling
|
|
23
|
+
* back to the first entry and finally to the screen's own key.
|
|
26
24
|
*/
|
|
27
|
-
const activeScrollHosts = makeMutable<Record<string, SourceHostRef>>({});
|
|
28
|
-
|
|
29
25
|
const getActiveHostFromStack = (
|
|
30
26
|
screenKey: string,
|
|
31
27
|
stack: HostRegistration[] | undefined,
|
|
@@ -54,27 +50,8 @@ const buildSnapshot = (): HostRegistrySnapshot => {
|
|
|
54
50
|
return nextSnapshot;
|
|
55
51
|
};
|
|
56
52
|
|
|
57
|
-
const buildScrollHostSnapshot = (): Record<string, SourceHostRef> => {
|
|
58
|
-
const nextSnapshot: Record<string, SourceHostRef> = {};
|
|
59
|
-
|
|
60
|
-
for (const [screenKey, stack] of hostStacks) {
|
|
61
|
-
const activeHostKey = getActiveHostFromStack(screenKey, stack);
|
|
62
|
-
const activeHost = stack.find((host) => host.hostKey === activeHostKey);
|
|
63
|
-
|
|
64
|
-
if (activeHost?.capturesScroll) {
|
|
65
|
-
nextSnapshot[screenKey] = {
|
|
66
|
-
hostKey: activeHost.hostKey,
|
|
67
|
-
capturesScroll: true,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return nextSnapshot;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
53
|
const emit = () => {
|
|
76
54
|
snapshot = buildSnapshot();
|
|
77
|
-
activeScrollHosts.set(buildScrollHostSnapshot());
|
|
78
55
|
|
|
79
56
|
for (const listener of listeners) {
|
|
80
57
|
listener();
|
|
@@ -143,29 +120,6 @@ export const getActiveHostKey = (screenKey: string) => {
|
|
|
143
120
|
return snapshot[screenKey] ?? screenKey;
|
|
144
121
|
};
|
|
145
122
|
|
|
146
|
-
/**
|
|
147
|
-
* The screen's active host, if it captures scroll. Worklet-safe: measurement
|
|
148
|
-
* code calls this on the UI thread while writing source bounds.
|
|
149
|
-
*/
|
|
150
|
-
export const getActiveScrollHost = (
|
|
151
|
-
screenKey: string,
|
|
152
|
-
): SourceHostRef | null => {
|
|
153
|
-
"worklet";
|
|
154
|
-
return activeScrollHosts.get()[screenKey] ?? null;
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
export const getHostCapturesScroll = (hostKey: string) => {
|
|
158
|
-
for (const stack of hostStacks.values()) {
|
|
159
|
-
const host = stack.find((registration) => registration.hostKey === hostKey);
|
|
160
|
-
|
|
161
|
-
if (host) {
|
|
162
|
-
return host.capturesScroll;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
return false;
|
|
167
|
-
};
|
|
168
|
-
|
|
169
123
|
export const useActiveHostKey = (screenKey?: string | null) => {
|
|
170
124
|
return useSyncExternalStore(
|
|
171
125
|
subscribe,
|
|
@@ -177,6 +131,5 @@ export const useActiveHostKey = (screenKey?: string | null) => {
|
|
|
177
131
|
export const resetHostRegistry = () => {
|
|
178
132
|
hostStacks.clear();
|
|
179
133
|
snapshot = EMPTY_SNAPSHOT;
|
|
180
|
-
activeScrollHosts.set({});
|
|
181
134
|
emit();
|
|
182
135
|
};
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { useSyncExternalStore } from "react";
|
|
2
|
+
import type { SharedValue } from "react-native-reanimated";
|
|
3
|
+
import type { LocalStyleLayers } from "../../../../providers/screen/styles/helpers/resolve-slot-styles";
|
|
4
|
+
import type { NormalizedTransitionInterpolatedStyle } from "../../../../types/animation.types";
|
|
2
5
|
|
|
3
6
|
export type ActivePortalBoundaryHost = {
|
|
4
7
|
boundaryId: string;
|
|
5
|
-
|
|
8
|
+
escapeClipping: boolean;
|
|
6
9
|
hostKey: string;
|
|
10
|
+
localStylesMaps: SharedValue<LocalStyleLayers>;
|
|
7
11
|
pairKey: string;
|
|
12
|
+
portalHostName: string;
|
|
8
13
|
screenKey: string;
|
|
14
|
+
slotsMap: SharedValue<NormalizedTransitionInterpolatedStyle>;
|
|
9
15
|
};
|
|
10
16
|
|
|
11
17
|
type PortalSnapshot = {
|
|
@@ -49,25 +55,72 @@ const isSameHost = (
|
|
|
49
55
|
) => {
|
|
50
56
|
return (
|
|
51
57
|
a.boundaryId === b.boundaryId &&
|
|
52
|
-
a.
|
|
58
|
+
a.escapeClipping === b.escapeClipping &&
|
|
53
59
|
a.hostKey === b.hostKey &&
|
|
60
|
+
a.localStylesMaps === b.localStylesMaps &&
|
|
54
61
|
a.pairKey === b.pairKey &&
|
|
55
|
-
a.
|
|
62
|
+
a.portalHostName === b.portalHostName &&
|
|
63
|
+
a.screenKey === b.screenKey &&
|
|
64
|
+
a.slotsMap === b.slotsMap
|
|
56
65
|
);
|
|
57
66
|
};
|
|
58
67
|
|
|
59
68
|
export const mountPortalBoundaryHost = (host: ActivePortalBoundaryHost) => {
|
|
60
|
-
const previous = activeBoundaryHosts.get(host.
|
|
69
|
+
const previous = activeBoundaryHosts.get(host.portalHostName);
|
|
61
70
|
if (previous && isSameHost(previous, host)) {
|
|
62
71
|
return;
|
|
63
72
|
}
|
|
64
73
|
|
|
65
|
-
activeBoundaryHosts.set(host.
|
|
74
|
+
activeBoundaryHosts.set(host.portalHostName, host);
|
|
66
75
|
emit();
|
|
67
76
|
};
|
|
68
77
|
|
|
69
78
|
export const unmountPortalBoundaryHost = (boundaryId: string) => {
|
|
70
|
-
|
|
79
|
+
let didDelete = false;
|
|
80
|
+
|
|
81
|
+
for (const [hostEntryKey, host] of activeBoundaryHosts) {
|
|
82
|
+
if (host.boundaryId !== boundaryId) {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
activeBoundaryHosts.delete(hostEntryKey);
|
|
87
|
+
didDelete = true;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (!didDelete) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
emit();
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Post-handoff GC: drop every receiver for this boundary except the one now
|
|
99
|
+
* visible (`keepPortalHostName`). Called once the new host is confirmed on
|
|
100
|
+
* screen so the superseded receivers stop rendering.
|
|
101
|
+
*/
|
|
102
|
+
export const dropStalePortalBoundaryHosts = ({
|
|
103
|
+
boundaryId,
|
|
104
|
+
keepPortalHostName,
|
|
105
|
+
}: {
|
|
106
|
+
boundaryId: string;
|
|
107
|
+
keepPortalHostName: string;
|
|
108
|
+
}) => {
|
|
109
|
+
let didDelete = false;
|
|
110
|
+
|
|
111
|
+
for (const [hostEntryKey, host] of activeBoundaryHosts) {
|
|
112
|
+
if (
|
|
113
|
+
host.boundaryId !== boundaryId ||
|
|
114
|
+
host.portalHostName === keepPortalHostName
|
|
115
|
+
) {
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
activeBoundaryHosts.delete(hostEntryKey);
|
|
120
|
+
didDelete = true;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (!didDelete) {
|
|
71
124
|
return;
|
|
72
125
|
}
|
|
73
126
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ComponentType, createElement, type ReactNode } from "react";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* `react-native-teleport` is an optional peer dependency. The require sits in a
|
|
@@ -9,13 +9,38 @@ import type { ComponentType } from "react";
|
|
|
9
9
|
* rendering; everything else keeps working.
|
|
10
10
|
*/
|
|
11
11
|
let mod: any = null;
|
|
12
|
+
let managerMod: any = null;
|
|
13
|
+
let providerViewMod: any = null;
|
|
12
14
|
try {
|
|
13
15
|
mod = require("react-native-teleport");
|
|
16
|
+
managerMod = require("react-native-teleport/lib/module/contexts/PortalManager");
|
|
17
|
+
providerViewMod = require("react-native-teleport/lib/module/views/PortalProvider");
|
|
14
18
|
} catch {}
|
|
15
19
|
|
|
16
|
-
|
|
20
|
+
const NativePortalProviderView: ComponentType<{ children: ReactNode }> | null =
|
|
21
|
+
providerViewMod?.default ?? null;
|
|
22
|
+
const PortalManagerProvider: ComponentType<{ children: ReactNode }> | null =
|
|
23
|
+
managerMod?.PortalManagerProvider ?? null;
|
|
24
|
+
|
|
25
|
+
const SafeNativePortalProvider: ComponentType<{ children: ReactNode }> | null =
|
|
26
|
+
PortalManagerProvider
|
|
27
|
+
? ({ children }: { children: ReactNode }) => {
|
|
28
|
+
const managedChildren = createElement(
|
|
29
|
+
PortalManagerProvider,
|
|
30
|
+
null,
|
|
31
|
+
children,
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
return NativePortalProviderView
|
|
35
|
+
? createElement(NativePortalProviderView, null, managedChildren)
|
|
36
|
+
: managedChildren;
|
|
37
|
+
}
|
|
38
|
+
: null;
|
|
39
|
+
|
|
40
|
+
export const isTeleportAvailable =
|
|
41
|
+
mod !== null && SafeNativePortalProvider !== null;
|
|
17
42
|
export const NativePortal: ComponentType<any> | null = mod?.Portal ?? null;
|
|
18
43
|
export const NativePortalProvider: ComponentType<any> | null =
|
|
19
|
-
|
|
44
|
+
SafeNativePortalProvider;
|
|
20
45
|
export const NativePortalHost: ComponentType<any> | null =
|
|
21
46
|
mod?.PortalHost ?? null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { LocalStyleLayers } from "../../../../providers/screen/styles/helpers/resolve-slot-styles";
|
|
2
|
+
|
|
3
|
+
export const hasLocalSlot = (
|
|
4
|
+
localStylesMaps: LocalStyleLayers,
|
|
5
|
+
slotId: string,
|
|
6
|
+
) => {
|
|
7
|
+
"worklet";
|
|
8
|
+
|
|
9
|
+
for (let index = 0; index < localStylesMaps.length; index++) {
|
|
10
|
+
if (localStylesMaps[index]?.[slotId] !== undefined) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return false;
|
|
16
|
+
};
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
export const PORTAL_HOST_NAME_RESET_VALUE = null;
|
|
2
2
|
const PORTAL_HOST_NAME_SUFFIX = "-portal-host";
|
|
3
|
+
const BOUNDARY_LOCAL_PORTAL_HOST_NAME_SUFFIX = "-boundary-local-portal-host";
|
|
3
4
|
|
|
4
5
|
export const createPortalBoundaryHostName = (
|
|
5
6
|
hostKey: string,
|
|
6
7
|
boundaryId: string,
|
|
8
|
+
pairKey?: string | null,
|
|
7
9
|
) => {
|
|
8
10
|
"worklet";
|
|
9
|
-
return `${hostKey}-${boundaryId}${PORTAL_HOST_NAME_SUFFIX}`;
|
|
11
|
+
return `${hostKey}-${pairKey ? `${pairKey}-` : ""}${boundaryId}${PORTAL_HOST_NAME_SUFFIX}`;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const createBoundaryLocalPortalHostName = (
|
|
15
|
+
screenKey: string,
|
|
16
|
+
boundaryId: string,
|
|
17
|
+
) => {
|
|
18
|
+
"worklet";
|
|
19
|
+
return `${screenKey}-${boundaryId}${BOUNDARY_LOCAL_PORTAL_HOST_NAME_SUFFIX}`;
|
|
10
20
|
};
|
|
@@ -1,171 +1,69 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interpolate,
|
|
3
|
-
type MeasuredDimensions,
|
|
4
|
-
type StyleProps,
|
|
5
|
-
} from "react-native-reanimated";
|
|
1
|
+
import type { StyleProps } from "react-native-reanimated";
|
|
6
2
|
import { getClampedScrollAxisDelta } from "../../../../stores/scroll.store";
|
|
7
|
-
import type {
|
|
3
|
+
import type { ScrollMeasuredDimensions } from "../../utils/measured-bounds";
|
|
8
4
|
import { getPortalHostBounds } from "../stores/host-bounds.store";
|
|
9
5
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
/**
|
|
7
|
+
* The two portal coordinate cases we support:
|
|
8
|
+
*
|
|
9
|
+
* - same-screen: source and host live on the same screen; re-base the stored
|
|
10
|
+
* host frame onto the source measurement's scroll snapshot.
|
|
11
|
+
* - cross-screen: source and host live on different screens; the host is the
|
|
12
|
+
* replacement coordinate space, so destination scroll is inherited naturally
|
|
13
|
+
* from host placement instead of manually propagated.
|
|
14
|
+
*/
|
|
15
|
+
export type PortalOffsetPlacement = "same-screen" | "cross-screen";
|
|
14
16
|
|
|
15
17
|
type ResolvePortalOffsetStyleParams = {
|
|
16
|
-
|
|
17
|
-
bounds:
|
|
18
|
-
boundsCurrentScroll?: ScrollMetadataState | null;
|
|
19
|
-
/**
|
|
20
|
-
* Express the source rect in its scroll host's live frame: the rect is
|
|
21
|
-
* shifted by the clamped travel of `sourceCurrentScroll` since the scroll
|
|
22
|
-
* snapshot stored on `bounds`. Independent of the host scroll fallback
|
|
23
|
-
* chain below — that chain compensates the attached host's own scrolling.
|
|
24
|
-
*/
|
|
25
|
-
compensateSourceScroll?: boolean;
|
|
26
|
-
currentScroll?: ScrollMetadataState | null;
|
|
27
|
-
hostCurrentScroll?: ScrollMetadataState | null;
|
|
18
|
+
/** Source rect, carrying the scroll snapshot taken at measure time. */
|
|
19
|
+
bounds: ScrollMeasuredDimensions;
|
|
28
20
|
hostKey: string;
|
|
29
|
-
|
|
30
|
-
includeScrollOffsets?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* The three portal coordinate cases we support:
|
|
33
|
-
*
|
|
34
|
-
* - same-screen: source and host are on the same screen; align the stored
|
|
35
|
-
* host frame to the source measurement's scroll snapshot once.
|
|
36
|
-
* - cross-screen-open: source and host are on different screens; host
|
|
37
|
-
* placement is static during the open/idle portion.
|
|
38
|
-
* - cross-screen-close: source and host are on different screens; the
|
|
39
|
-
* dismissal needs the host's live scroll frame until the portal detaches.
|
|
40
|
-
*/
|
|
41
|
-
placement?: PortalOffsetPlacement;
|
|
42
|
-
position?: "absolute" | "relative";
|
|
43
|
-
sourceCurrentScroll?: ScrollMetadataState | null;
|
|
44
|
-
trackSourceScroll?: boolean;
|
|
21
|
+
placement: PortalOffsetPlacement;
|
|
45
22
|
};
|
|
46
23
|
|
|
47
24
|
export const resolvePortalOffsetStyle = ({
|
|
48
|
-
alignHostToBoundsScroll = false,
|
|
49
25
|
bounds,
|
|
50
|
-
boundsCurrentScroll,
|
|
51
|
-
compensateSourceScroll = false,
|
|
52
|
-
currentScroll,
|
|
53
|
-
hostCurrentScroll,
|
|
54
26
|
hostKey,
|
|
55
|
-
hostProgress = 0,
|
|
56
|
-
includeScrollOffsets = true,
|
|
57
27
|
placement,
|
|
58
|
-
position = "relative",
|
|
59
|
-
sourceCurrentScroll,
|
|
60
|
-
trackSourceScroll = false,
|
|
61
28
|
}: ResolvePortalOffsetStyleParams): StyleProps => {
|
|
62
29
|
"worklet";
|
|
63
30
|
const hostBounds = getPortalHostBounds(hostKey);
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
(bounds as { scroll?: ScrollMetadataState | null }).scroll ?? null;
|
|
74
|
-
const sourceScrollSnapshot = shouldCompensateSourceScroll
|
|
75
|
-
? boundsScrollSnapshot
|
|
76
|
-
: null;
|
|
77
|
-
const sourceScrollDeltaX = shouldCompensateSourceScroll
|
|
31
|
+
const boundsScrollSnapshot = bounds.scroll ?? null;
|
|
32
|
+
const hostBoundsScrollSnapshot = hostBounds?.scroll ?? null;
|
|
33
|
+
|
|
34
|
+
// same-screen re-bases the static host frame onto the source scroll snapshot.
|
|
35
|
+
// Cross-screen hosts are the chosen replacement coordinate space, so their
|
|
36
|
+
// destination scroll is represented by where the host itself is mounted.
|
|
37
|
+
const alignHostToBoundsScroll = placement === "same-screen";
|
|
38
|
+
|
|
39
|
+
const hostSnapshotDeltaX = alignHostToBoundsScroll
|
|
78
40
|
? getClampedScrollAxisDelta(
|
|
79
|
-
|
|
80
|
-
|
|
41
|
+
boundsScrollSnapshot,
|
|
42
|
+
hostBoundsScrollSnapshot,
|
|
81
43
|
"horizontal",
|
|
82
44
|
)
|
|
83
45
|
: 0;
|
|
84
|
-
const
|
|
46
|
+
const hostSnapshotDeltaY = alignHostToBoundsScroll
|
|
85
47
|
? getClampedScrollAxisDelta(
|
|
86
|
-
|
|
87
|
-
|
|
48
|
+
boundsScrollSnapshot,
|
|
49
|
+
hostBoundsScrollSnapshot,
|
|
88
50
|
"vertical",
|
|
89
51
|
)
|
|
90
52
|
: 0;
|
|
91
|
-
const sourcePageX = bounds.pageX - sourceScrollDeltaX;
|
|
92
|
-
const sourcePageY = bounds.pageY - sourceScrollDeltaY;
|
|
93
|
-
const boundsScroll = shouldIncludeHostScrollOffsets
|
|
94
|
-
? (boundsScrollSnapshot ?? boundsCurrentScroll ?? currentScroll ?? null)
|
|
95
|
-
: null;
|
|
96
|
-
const hostBoundsScrollSnapshot = hostBounds?.scroll ?? null;
|
|
97
|
-
const hostBoundsScroll = shouldIncludeHostScrollOffsets
|
|
98
|
-
? hostBoundsScrollSnapshot
|
|
99
|
-
: null;
|
|
100
|
-
const resolvedHostCurrentScroll =
|
|
101
|
-
hostCurrentScroll ?? boundsScroll ?? hostBoundsScroll ?? null;
|
|
102
|
-
const hostSnapshotDeltaX =
|
|
103
|
-
shouldAlignHostToBoundsScroll && !shouldIncludeHostScrollOffsets
|
|
104
|
-
? getClampedScrollAxisDelta(
|
|
105
|
-
boundsScrollSnapshot,
|
|
106
|
-
hostBoundsScrollSnapshot,
|
|
107
|
-
"horizontal",
|
|
108
|
-
)
|
|
109
|
-
: 0;
|
|
110
|
-
const hostSnapshotDeltaY =
|
|
111
|
-
shouldAlignHostToBoundsScroll && !shouldIncludeHostScrollOffsets
|
|
112
|
-
? getClampedScrollAxisDelta(
|
|
113
|
-
boundsScrollSnapshot,
|
|
114
|
-
hostBoundsScrollSnapshot,
|
|
115
|
-
"vertical",
|
|
116
|
-
)
|
|
117
|
-
: 0;
|
|
118
|
-
// Deltas are clamped to the layout range: iOS rubber-band offsets are
|
|
119
|
-
// outside the real scroll range and must not become coordinate-space deltas.
|
|
120
|
-
const hostScrollDeltaX = getClampedScrollAxisDelta(
|
|
121
|
-
resolvedHostCurrentScroll,
|
|
122
|
-
hostBoundsScroll,
|
|
123
|
-
"horizontal",
|
|
124
|
-
);
|
|
125
|
-
const hostScrollDeltaY = getClampedScrollAxisDelta(
|
|
126
|
-
resolvedHostCurrentScroll,
|
|
127
|
-
hostBoundsScroll,
|
|
128
|
-
"vertical",
|
|
129
|
-
);
|
|
130
53
|
|
|
54
|
+
// Without registered host bounds the host frame is the origin, so the source
|
|
55
|
+
// page position becomes the offset directly.
|
|
131
56
|
const adjustedHostPageX = hostBounds
|
|
132
|
-
? hostBounds.pageX -
|
|
133
|
-
hostSnapshotDeltaX -
|
|
134
|
-
interpolate(hostProgress, [0, 1], [hostScrollDeltaX, 0])
|
|
57
|
+
? hostBounds.pageX - hostSnapshotDeltaX
|
|
135
58
|
: 0;
|
|
136
59
|
const adjustedHostPageY = hostBounds
|
|
137
|
-
? hostBounds.pageY -
|
|
138
|
-
hostSnapshotDeltaY -
|
|
139
|
-
interpolate(hostProgress, [0, 1], [hostScrollDeltaY, 0])
|
|
140
|
-
: 0;
|
|
141
|
-
const boundsScrollDeltaX = shouldIncludeHostScrollOffsets
|
|
142
|
-
? getClampedScrollAxisDelta(
|
|
143
|
-
currentScroll ?? null,
|
|
144
|
-
boundsScroll,
|
|
145
|
-
"horizontal",
|
|
146
|
-
)
|
|
60
|
+
? hostBounds.pageY - hostSnapshotDeltaY
|
|
147
61
|
: 0;
|
|
148
|
-
const boundsScrollDeltaY = shouldIncludeHostScrollOffsets
|
|
149
|
-
? getClampedScrollAxisDelta(currentScroll ?? null, boundsScroll, "vertical")
|
|
150
|
-
: 0;
|
|
151
|
-
const offsetX = hostBounds
|
|
152
|
-
? sourcePageX - adjustedHostPageX
|
|
153
|
-
: sourcePageX - boundsScrollDeltaX;
|
|
154
|
-
const offsetY = hostBounds
|
|
155
|
-
? sourcePageY - adjustedHostPageY
|
|
156
|
-
: sourcePageY - boundsScrollDeltaY;
|
|
157
|
-
const transform = [{ translateY: offsetY }, { translateX: offsetX }];
|
|
158
|
-
|
|
159
|
-
if (position === "absolute") {
|
|
160
|
-
return {
|
|
161
|
-
left: 0,
|
|
162
|
-
position: "absolute",
|
|
163
|
-
top: 0,
|
|
164
|
-
transform,
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
62
|
|
|
168
63
|
return {
|
|
169
|
-
transform
|
|
64
|
+
transform: [
|
|
65
|
+
{ translateY: bounds.pageY - adjustedHostPageY },
|
|
66
|
+
{ translateX: bounds.pageX - adjustedHostPageX },
|
|
67
|
+
],
|
|
170
68
|
};
|
|
171
69
|
};
|