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
|
@@ -35,6 +35,11 @@ const getForwardedSlot = (
|
|
|
35
35
|
return slot;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
+
const hasDefinedBucketValue = (value: unknown) => {
|
|
39
|
+
"worklet";
|
|
40
|
+
return value !== undefined && value !== null;
|
|
41
|
+
};
|
|
42
|
+
|
|
38
43
|
const hasEitherResetPatch = (
|
|
39
44
|
hasStyleResetPatch: boolean,
|
|
40
45
|
hasPropResetPatch: boolean,
|
|
@@ -43,11 +48,6 @@ const hasEitherResetPatch = (
|
|
|
43
48
|
return hasStyleResetPatch || hasPropResetPatch;
|
|
44
49
|
};
|
|
45
50
|
|
|
46
|
-
const hasDefinedBucketValue = (value: unknown) => {
|
|
47
|
-
"worklet";
|
|
48
|
-
return value !== undefined && value !== null;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
51
|
const hasResettableDisappearedKeys = (
|
|
52
52
|
previousKeys: Record<string, true> | undefined,
|
|
53
53
|
previousResetValues: Record<string, unknown> | undefined,
|
|
@@ -81,7 +81,6 @@ const getResolvedSlotOutput = ({
|
|
|
81
81
|
}) => {
|
|
82
82
|
"worklet";
|
|
83
83
|
const state = getResolvedSlotState(slot);
|
|
84
|
-
|
|
85
84
|
const hasStyleResetPatch = hasResettableDisappearedKeys(
|
|
86
85
|
previousState?.styleKeys,
|
|
87
86
|
previousState?.styleResetValues,
|
|
@@ -108,6 +107,7 @@ const getResolvedSlotOutput = ({
|
|
|
108
107
|
resolvedSlot: materializeResolvedSlot({
|
|
109
108
|
baseStyle: state.baseStyle,
|
|
110
109
|
baseProps: state.baseProps,
|
|
110
|
+
boundsLocalTransform: slot?.boundsLocalTransform,
|
|
111
111
|
previousState,
|
|
112
112
|
styleKeys: state.styleKeys,
|
|
113
113
|
propKeys: state.propKeys,
|
|
@@ -165,6 +165,9 @@ const getMergedLocalSlot = (
|
|
|
165
165
|
"worklet";
|
|
166
166
|
let mergedStyle: Record<string, unknown> | undefined;
|
|
167
167
|
let mergedProps: Record<string, unknown> | undefined;
|
|
168
|
+
let boundsLocalTransform:
|
|
169
|
+
| NormalizedTransitionSlotStyle["boundsLocalTransform"]
|
|
170
|
+
| undefined;
|
|
168
171
|
|
|
169
172
|
for (let index = 0; index < context.localStylesMaps.length; index++) {
|
|
170
173
|
const slot = context.localStylesMaps[index]?.[slotId];
|
|
@@ -178,15 +181,19 @@ const getMergedLocalSlot = (
|
|
|
178
181
|
slot.style as Record<string, unknown> | undefined,
|
|
179
182
|
);
|
|
180
183
|
mergedProps = mergeBucket(mergedProps, slot.props);
|
|
184
|
+
if (slot.boundsLocalTransform?.length) {
|
|
185
|
+
boundsLocalTransform = slot.boundsLocalTransform;
|
|
186
|
+
}
|
|
181
187
|
}
|
|
182
188
|
|
|
183
|
-
if (!mergedStyle && !mergedProps) {
|
|
189
|
+
if (!mergedStyle && !mergedProps && !boundsLocalTransform) {
|
|
184
190
|
return undefined;
|
|
185
191
|
}
|
|
186
192
|
|
|
187
193
|
return {
|
|
188
194
|
style: mergedStyle,
|
|
189
195
|
props: mergedProps,
|
|
196
|
+
boundsLocalTransform,
|
|
190
197
|
};
|
|
191
198
|
};
|
|
192
199
|
|
|
@@ -344,7 +351,11 @@ const areSlotsEqual = (
|
|
|
344
351
|
|
|
345
352
|
return (
|
|
346
353
|
areFlatObjectsEqual(left.style, right.style) &&
|
|
347
|
-
areFlatObjectsEqual(left.props, right.props)
|
|
354
|
+
areFlatObjectsEqual(left.props, right.props) &&
|
|
355
|
+
areTransformArraysEqual(
|
|
356
|
+
left.boundsLocalTransform,
|
|
357
|
+
right.boundsLocalTransform,
|
|
358
|
+
)
|
|
348
359
|
);
|
|
349
360
|
};
|
|
350
361
|
|
|
@@ -459,10 +470,9 @@ const appendPreviousSlots = (context: ResolveSlotStylesContext) => {
|
|
|
459
470
|
};
|
|
460
471
|
|
|
461
472
|
/**
|
|
462
|
-
* Resolves slot styles for the current screen pass and
|
|
463
|
-
*
|
|
464
|
-
*
|
|
465
|
-
* concrete identity values.
|
|
473
|
+
* Resolves slot styles for the current screen pass and emits reset values for
|
|
474
|
+
* transition-owned keys that existed in the previous resolved map but no longer
|
|
475
|
+
* exist in the current one.
|
|
466
476
|
*/
|
|
467
477
|
export const resolveSlotStyles = ({
|
|
468
478
|
localStylesMaps,
|
|
@@ -111,6 +111,7 @@ const materializeResolvedProps = ({
|
|
|
111
111
|
export const materializeResolvedSlot = ({
|
|
112
112
|
baseStyle,
|
|
113
113
|
baseProps,
|
|
114
|
+
boundsLocalTransform,
|
|
114
115
|
previousState,
|
|
115
116
|
styleKeys,
|
|
116
117
|
propKeys,
|
|
@@ -121,6 +122,7 @@ export const materializeResolvedSlot = ({
|
|
|
121
122
|
}: {
|
|
122
123
|
baseStyle: Record<string, unknown> | undefined;
|
|
123
124
|
baseProps: Record<string, unknown> | undefined;
|
|
125
|
+
boundsLocalTransform: NormalizedTransitionSlotStyle["boundsLocalTransform"];
|
|
124
126
|
previousState: ResettableStyleState | undefined;
|
|
125
127
|
styleKeys: Record<string, true> | undefined;
|
|
126
128
|
propKeys: Record<string, true> | undefined;
|
|
@@ -139,7 +141,6 @@ export const materializeResolvedSlot = ({
|
|
|
139
141
|
hasAnyStyleKeys,
|
|
140
142
|
hasStyleResetPatch,
|
|
141
143
|
});
|
|
142
|
-
|
|
143
144
|
const resolvedProps = materializeResolvedProps({
|
|
144
145
|
baseProps,
|
|
145
146
|
previousState,
|
|
@@ -150,6 +151,7 @@ export const materializeResolvedSlot = ({
|
|
|
150
151
|
|
|
151
152
|
resolvedSlot.style = resolvedStyle;
|
|
152
153
|
resolvedSlot.props = resolvedProps;
|
|
154
|
+
resolvedSlot.boundsLocalTransform = boundsLocalTransform;
|
|
153
155
|
|
|
154
156
|
if (!resolvedSlot.style && !resolvedSlot.props) {
|
|
155
157
|
return undefined;
|
|
@@ -2,11 +2,6 @@ import type { NormalizedTransitionSlotStyle } from "../../../../../types/animati
|
|
|
2
2
|
import { getPropResetValue, getStyleResetValue } from "./reset-values";
|
|
3
3
|
import type { ResettableStyleState } from "./types";
|
|
4
4
|
|
|
5
|
-
const hasTrackedKey = (keys: Record<string, true> | undefined, key: string) => {
|
|
6
|
-
"worklet";
|
|
7
|
-
return keys !== undefined && keys[key] === true;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
5
|
const isDefinedStyleValue = (value: unknown) => {
|
|
11
6
|
"worklet";
|
|
12
7
|
return value !== undefined && value !== null;
|
|
@@ -52,25 +47,6 @@ const collectDefinedKeys = ({
|
|
|
52
47
|
};
|
|
53
48
|
};
|
|
54
49
|
|
|
55
|
-
export const hasDisappearedKeys = (
|
|
56
|
-
previousKeys: Record<string, true> | undefined,
|
|
57
|
-
currentKeys: Record<string, true> | undefined,
|
|
58
|
-
) => {
|
|
59
|
-
"worklet";
|
|
60
|
-
|
|
61
|
-
if (!previousKeys) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
for (const key in previousKeys) {
|
|
66
|
-
if (!hasTrackedKey(currentKeys, key)) {
|
|
67
|
-
return true;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return false;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
50
|
const hasEitherKeySet = (
|
|
75
51
|
styleKeys: Record<string, true> | undefined,
|
|
76
52
|
propKeys: Record<string, true> | undefined,
|
|
@@ -34,12 +34,7 @@ export const resolveScreenVisibilityGate = ({
|
|
|
34
34
|
const isPendingOpen =
|
|
35
35
|
pendingLifecycleRequestKind === LifecycleTransitionRequestKind.Open;
|
|
36
36
|
const isOpening = isPendingOpen || !!entering;
|
|
37
|
-
|
|
38
|
-
// Keep the screen hidden until the first transformed opening frame exists.
|
|
39
|
-
// The lifecycle request is cleared before the RAF-scheduled progress
|
|
40
|
-
// animation starts, so `entering` carries the gate through that one-frame gap.
|
|
41
37
|
const isWaitingForOpenToStart = progress <= 0;
|
|
42
|
-
|
|
43
38
|
const shouldBlock =
|
|
44
39
|
(hasPendingLifecycleBlock || isWaitingForOpenToStart) && isOpening;
|
|
45
40
|
|
|
@@ -48,10 +43,3 @@ export const resolveScreenVisibilityGate = ({
|
|
|
48
43
|
shouldOpenGate: !shouldBlock && progress > 0,
|
|
49
44
|
};
|
|
50
45
|
};
|
|
51
|
-
|
|
52
|
-
export const shouldBlockScreenVisibility = (
|
|
53
|
-
state: ScreenVisibilityGateState,
|
|
54
|
-
) => {
|
|
55
|
-
"worklet";
|
|
56
|
-
return resolveScreenVisibilityGate(state).shouldBlock;
|
|
57
|
-
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { useAnimatedProps, useAnimatedStyle } from "react-native-reanimated";
|
|
3
|
+
import { NO_PROPS, NO_STYLES } from "../../../../constants";
|
|
4
|
+
import {
|
|
5
|
+
composeSlotStyleWithLocalTransform,
|
|
6
|
+
getLocalTransformForSlotComposition,
|
|
7
|
+
} from "../helpers/compose-slot-style";
|
|
8
|
+
import { useScreenSlots } from "../slot.provider";
|
|
9
|
+
|
|
10
|
+
export const useSlotStyles = (slotId: string | undefined) => {
|
|
11
|
+
const { slotsMap } = useScreenSlots();
|
|
12
|
+
|
|
13
|
+
return useAnimatedStyle(() => {
|
|
14
|
+
const slot = slotId ? slotsMap.get()[slotId] : undefined;
|
|
15
|
+
const slotStyle = slot?.style ?? NO_STYLES;
|
|
16
|
+
|
|
17
|
+
return composeSlotStyleWithLocalTransform(
|
|
18
|
+
slotStyle,
|
|
19
|
+
undefined,
|
|
20
|
+
slot?.boundsLocalTransform,
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const useComposedSlotStyles = (
|
|
26
|
+
slotId: string | undefined,
|
|
27
|
+
style: unknown,
|
|
28
|
+
) => {
|
|
29
|
+
const { slotsMap } = useScreenSlots();
|
|
30
|
+
const localTransform = useMemo(
|
|
31
|
+
() => getLocalTransformForSlotComposition(style),
|
|
32
|
+
[style],
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
return useAnimatedStyle(() => {
|
|
36
|
+
const slot = slotId ? slotsMap.get()[slotId] : undefined;
|
|
37
|
+
const slotStyle = slot?.style ?? NO_STYLES;
|
|
38
|
+
|
|
39
|
+
return composeSlotStyleWithLocalTransform(
|
|
40
|
+
slotStyle,
|
|
41
|
+
localTransform,
|
|
42
|
+
slot?.boundsLocalTransform,
|
|
43
|
+
);
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Stacking-only slice (`zIndex`/`elevation`) of a slot's style. Returned
|
|
49
|
+
* separately so an owner can keep just its stacking context while a nested
|
|
50
|
+
* target takes the full associated style. Yields `NO_STYLES` when neither is set.
|
|
51
|
+
*/
|
|
52
|
+
export const useSlotStackingStyles = (slotId: string | undefined) => {
|
|
53
|
+
const { slotsMap } = useScreenSlots();
|
|
54
|
+
|
|
55
|
+
return useAnimatedStyle(() => {
|
|
56
|
+
const baseStyle = slotId ? slotsMap.get()[slotId]?.style : undefined;
|
|
57
|
+
const zIndex = baseStyle?.zIndex ?? 0;
|
|
58
|
+
const elevation = baseStyle?.elevation ?? 0;
|
|
59
|
+
|
|
60
|
+
if (zIndex === 0 && elevation === 0) {
|
|
61
|
+
return NO_STYLES;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return { zIndex, elevation };
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const useSlotLayoutStyles = (slotId: string | undefined) => {
|
|
69
|
+
const { slotsMap } = useScreenSlots();
|
|
70
|
+
|
|
71
|
+
return useAnimatedStyle(() => {
|
|
72
|
+
const baseStyle = slotId ? slotsMap.get()[slotId]?.style : undefined;
|
|
73
|
+
const width = baseStyle?.width;
|
|
74
|
+
const height = baseStyle?.height;
|
|
75
|
+
const minWidth = baseStyle?.minWidth;
|
|
76
|
+
const minHeight = baseStyle?.minHeight;
|
|
77
|
+
const maxWidth = baseStyle?.maxWidth;
|
|
78
|
+
const maxHeight = baseStyle?.maxHeight;
|
|
79
|
+
const aspectRatio = baseStyle?.aspectRatio;
|
|
80
|
+
|
|
81
|
+
if (
|
|
82
|
+
width === undefined &&
|
|
83
|
+
height === undefined &&
|
|
84
|
+
minWidth === undefined &&
|
|
85
|
+
minHeight === undefined &&
|
|
86
|
+
maxWidth === undefined &&
|
|
87
|
+
maxHeight === undefined &&
|
|
88
|
+
aspectRatio === undefined
|
|
89
|
+
) {
|
|
90
|
+
return NO_STYLES;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
width,
|
|
95
|
+
height,
|
|
96
|
+
minWidth,
|
|
97
|
+
minHeight,
|
|
98
|
+
maxWidth,
|
|
99
|
+
maxHeight,
|
|
100
|
+
aspectRatio,
|
|
101
|
+
};
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export const useSlotProps = (slotId: string | undefined) => {
|
|
106
|
+
const { slotsMap } = useScreenSlots();
|
|
107
|
+
|
|
108
|
+
return useAnimatedProps(() => {
|
|
109
|
+
return (slotId ? slotsMap.get()[slotId]?.props : undefined) ?? NO_PROPS;
|
|
110
|
+
});
|
|
111
|
+
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { useDerivedValue, useSharedValue } from "react-native-reanimated";
|
|
2
2
|
import { NO_STYLES } from "../../../../constants";
|
|
3
|
-
import {
|
|
3
|
+
import { AnimationStore } from "../../../../stores/animation.store";
|
|
4
|
+
import {
|
|
5
|
+
LifecycleTransitionRequestKind,
|
|
6
|
+
SystemStore,
|
|
7
|
+
} from "../../../../stores/system.store";
|
|
4
8
|
import type {
|
|
5
9
|
NormalizedTransitionInterpolatedStyle,
|
|
6
10
|
ScreenStyleInterpolator,
|
|
@@ -13,13 +17,13 @@ import { useBuildTransitionAccessor } from "../../animation/helpers/accessors/us
|
|
|
13
17
|
import type { ScreenInterpolatorFrame } from "../../animation/helpers/pipeline";
|
|
14
18
|
import { readScreenAnimationRevisions } from "../../animation/helpers/read-screen-animation-revisions";
|
|
15
19
|
import { syncSelectedInterpolatorOptions } from "../../animation/helpers/selected-interpolator-options";
|
|
16
|
-
import {
|
|
20
|
+
import { useDescriptorsStore } from "../../descriptors";
|
|
17
21
|
import {
|
|
18
22
|
syncScreenOptionsOverrides,
|
|
19
23
|
useScreenOptionsContext,
|
|
20
24
|
} from "../../options";
|
|
21
25
|
import { normalizeSlots } from "../helpers/normalize-slots";
|
|
22
|
-
import {
|
|
26
|
+
import { isOpeningBeforeStart } from "../helpers/opening-phase";
|
|
23
27
|
import type { LocalStyleLayers } from "../helpers/resolve-slot-styles";
|
|
24
28
|
import { stripInterpolatorOptions } from "../helpers/strip-interpolator-options";
|
|
25
29
|
|
|
@@ -37,12 +41,10 @@ type RunInterpolatorParams = {
|
|
|
37
41
|
next: ScreenInterpolatorFrame["next"];
|
|
38
42
|
bounds: Parameters<ScreenStyleInterpolator>[0]["bounds"];
|
|
39
43
|
transition: Parameters<ScreenStyleInterpolator>[0]["transition"];
|
|
40
|
-
shouldDeferStyleBuckets: boolean;
|
|
41
44
|
};
|
|
42
45
|
|
|
43
46
|
const normalizeRawStyleMap = (
|
|
44
47
|
rawStyleMap: TransitionInterpolatedStyle | undefined,
|
|
45
|
-
shouldDeferStyleBuckets: boolean,
|
|
46
48
|
) => {
|
|
47
49
|
"worklet";
|
|
48
50
|
|
|
@@ -52,9 +54,7 @@ const normalizeRawStyleMap = (
|
|
|
52
54
|
|
|
53
55
|
const stylesMap = normalizeSlots(stripInterpolatorOptions(rawStyleMap));
|
|
54
56
|
|
|
55
|
-
return
|
|
56
|
-
? preserveAnimatedPropsOnly(stylesMap)
|
|
57
|
-
: stylesMap;
|
|
57
|
+
return stylesMap;
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
const runInterpolator = ({
|
|
@@ -64,7 +64,6 @@ const runInterpolator = ({
|
|
|
64
64
|
next,
|
|
65
65
|
bounds,
|
|
66
66
|
transition,
|
|
67
|
-
shouldDeferStyleBuckets,
|
|
68
67
|
}: RunInterpolatorParams): InterpolatorResult | undefined => {
|
|
69
68
|
"worklet";
|
|
70
69
|
|
|
@@ -86,7 +85,7 @@ const runInterpolator = ({
|
|
|
86
85
|
|
|
87
86
|
return {
|
|
88
87
|
rawStyleMap,
|
|
89
|
-
stylesMap: normalizeRawStyleMap(rawStyleMap
|
|
88
|
+
stylesMap: normalizeRawStyleMap(rawStyleMap),
|
|
90
89
|
};
|
|
91
90
|
} catch (_) {
|
|
92
91
|
if (__DEV__) {
|
|
@@ -124,17 +123,15 @@ const appendLayer = (
|
|
|
124
123
|
* normal interpolator selection once the gesture-driven close is no longer in
|
|
125
124
|
* play.
|
|
126
125
|
*
|
|
127
|
-
* Visibility gating happens downstream while lifecycle start is blocked for
|
|
128
|
-
* pending destination measurement. We still run the interpolator during that
|
|
129
|
-
* hidden window so animated props and runtime options stay warm, but defer style
|
|
130
|
-
* buckets so measurement sees the final untransformed layout.
|
|
131
|
-
*
|
|
132
126
|
* The result is ordered from lowest to highest priority. Resolution happens
|
|
133
127
|
* downstream, where slot ids determine whether slots inherit from ancestors and
|
|
134
128
|
* where higher owner layers override lower owner layers per key.
|
|
135
129
|
*/
|
|
136
130
|
export const useInterpolatedStylesMap = () => {
|
|
137
|
-
const
|
|
131
|
+
const currentScreenKey = useDescriptorsStore(
|
|
132
|
+
(s) => s.derivations.currentScreenKey,
|
|
133
|
+
);
|
|
134
|
+
const nextScreenKey = useDescriptorsStore((s) => s.derivations.nextScreenKey);
|
|
138
135
|
const screenOptions = useScreenOptionsContext();
|
|
139
136
|
const {
|
|
140
137
|
screenInterpolatorProps,
|
|
@@ -147,14 +144,19 @@ export const useInterpolatedStylesMap = () => {
|
|
|
147
144
|
} = useScreenAnimationContext();
|
|
148
145
|
const boundsAccessor = useBuildBoundsAccessor();
|
|
149
146
|
const transition = useBuildTransitionAccessor();
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
147
|
+
const nextInterpolatorReady = useSharedValue(0);
|
|
148
|
+
|
|
149
|
+
const activeScreenKey = nextScreenKey ?? currentScreenKey;
|
|
150
|
+
const {
|
|
151
|
+
entering: activeEntering,
|
|
152
|
+
transitionProgress: activeTransitionProgress,
|
|
153
|
+
} = AnimationStore.getBag(activeScreenKey);
|
|
154
|
+
const { pendingLifecycleRequestKind: activePendingLifecycleRequestKind } =
|
|
155
|
+
SystemStore.getBag(activeScreenKey);
|
|
154
156
|
|
|
155
157
|
const isGesturingDuringCloseAnimation = useSharedValue(false);
|
|
156
158
|
|
|
157
|
-
|
|
159
|
+
const localStylesMaps = useDerivedValue<LocalStyleLayers>(() => {
|
|
158
160
|
"worklet";
|
|
159
161
|
readScreenAnimationRevisions(
|
|
160
162
|
screenInterpolatorPropsRevision,
|
|
@@ -163,19 +165,6 @@ export const useInterpolatedStylesMap = () => {
|
|
|
163
165
|
);
|
|
164
166
|
const props = screenInterpolatorProps.get();
|
|
165
167
|
|
|
166
|
-
/**
|
|
167
|
-
* There is a niche case where bounds can be attached to a view that's styles are out of viewport.
|
|
168
|
-
* Due to our blocking mechanism and ensuring accurate measurement, this boundary measurement
|
|
169
|
-
* will be blocked and the screen will never be visible. To mitigate this, we:
|
|
170
|
-
*
|
|
171
|
-
* - Defer the style buckets (props are fine), to ensure we get the correct position of the boundary
|
|
172
|
-
*
|
|
173
|
-
* Again this is very niche, and since we're not marketing ourselves as a proper shared element transition
|
|
174
|
-
* package, we won't spend time finding a better solution for this.
|
|
175
|
-
*
|
|
176
|
-
*/
|
|
177
|
-
const shouldDeferStyleBuckets = pendingLifecycleStartBlockCount.get() > 0;
|
|
178
|
-
|
|
179
168
|
const { current, next, progress } = props;
|
|
180
169
|
const isDragging = current.gesture.dragging;
|
|
181
170
|
const isNextClosing = !!next?.closing;
|
|
@@ -194,8 +183,26 @@ export const useInterpolatedStylesMap = () => {
|
|
|
194
183
|
const isInGestureMode =
|
|
195
184
|
!!isDragging || isGesturingDuringCloseAnimation.get();
|
|
196
185
|
|
|
197
|
-
|
|
198
|
-
|
|
186
|
+
// The current screen keeps interpolator ownership until the next screen is
|
|
187
|
+
// genuinely live: never during a gesture-driven close, never before a next
|
|
188
|
+
// interpolator exists, and never in the next screen's pre-start window
|
|
189
|
+
// (entering, but no transformed frame yet). Only then does "next" take over.
|
|
190
|
+
const isPendingOpen =
|
|
191
|
+
activePendingLifecycleRequestKind.get() ===
|
|
192
|
+
LifecycleTransitionRequestKind.Open;
|
|
193
|
+
const activeOpening = isPendingOpen || !!activeEntering.get();
|
|
194
|
+
const currentOwnsInterpolator =
|
|
195
|
+
isInGestureMode ||
|
|
196
|
+
!nextInterpolator ||
|
|
197
|
+
isOpeningBeforeStart(
|
|
198
|
+
activeOpening ? 1 : 0,
|
|
199
|
+
activeTransitionProgress.get(),
|
|
200
|
+
);
|
|
201
|
+
nextInterpolatorReady.set(currentOwnsInterpolator ? 0 : 1);
|
|
202
|
+
|
|
203
|
+
const interpolatorOptionsOwner = currentOwnsInterpolator
|
|
204
|
+
? "current"
|
|
205
|
+
: "next";
|
|
199
206
|
|
|
200
207
|
let selectedProgress = progress;
|
|
201
208
|
let selectedNext = next;
|
|
@@ -212,7 +219,6 @@ export const useInterpolatedStylesMap = () => {
|
|
|
212
219
|
next: selectedNext,
|
|
213
220
|
bounds: boundsAccessor,
|
|
214
221
|
transition,
|
|
215
|
-
shouldDeferStyleBuckets,
|
|
216
222
|
});
|
|
217
223
|
|
|
218
224
|
if (interpolatorOptionsOwner === "current") {
|
|
@@ -237,7 +243,6 @@ export const useInterpolatedStylesMap = () => {
|
|
|
237
243
|
next: selectedNext,
|
|
238
244
|
bounds: boundsAccessor,
|
|
239
245
|
transition,
|
|
240
|
-
shouldDeferStyleBuckets,
|
|
241
246
|
});
|
|
242
247
|
|
|
243
248
|
syncSelectedInterpolatorOptions(
|
|
@@ -258,4 +263,9 @@ export const useInterpolatedStylesMap = () => {
|
|
|
258
263
|
|
|
259
264
|
return layers;
|
|
260
265
|
});
|
|
266
|
+
|
|
267
|
+
return {
|
|
268
|
+
localStylesMaps,
|
|
269
|
+
nextInterpolatorReady,
|
|
270
|
+
};
|
|
261
271
|
};
|
|
@@ -16,22 +16,12 @@ export const useMaybeBlockVisibility = (isFloatingOverlay?: boolean) => {
|
|
|
16
16
|
const { currentScreenKey } = useDescriptorDerivations();
|
|
17
17
|
const { entering, transitionProgress } =
|
|
18
18
|
AnimationStore.getBag(currentScreenKey);
|
|
19
|
-
|
|
20
19
|
const { pendingLifecycleStartBlockCount, pendingLifecycleRequestKind } =
|
|
21
20
|
SystemStore.getBag(currentScreenKey);
|
|
22
21
|
|
|
23
22
|
const hasVisibilityGateOpened = useSharedValue(false);
|
|
24
23
|
const shouldBlockVisibility = useSharedValue(!isFloatingOverlay);
|
|
25
24
|
|
|
26
|
-
/**
|
|
27
|
-
* Visibility has to start blocked before the first animated style pass.
|
|
28
|
-
*
|
|
29
|
-
* `useDerivedValue` can publish its computed value after `useAnimatedStyle`
|
|
30
|
-
* has already read the initial one, which briefly exposes an unhydrated
|
|
31
|
-
* screen. Keep the visible state in an eagerly initialized shared value, then
|
|
32
|
-
* let the reaction open it once the visibility gate allows the first
|
|
33
|
-
* transformed frame to render.
|
|
34
|
-
*/
|
|
35
25
|
useAnimatedReaction(
|
|
36
26
|
() => {
|
|
37
27
|
"worklet";
|
|
@@ -58,13 +48,6 @@ export const useMaybeBlockVisibility = (isFloatingOverlay?: boolean) => {
|
|
|
58
48
|
|
|
59
49
|
const animatedStyle = useAnimatedStyle(() => {
|
|
60
50
|
"worklet";
|
|
61
|
-
/**
|
|
62
|
-
* Keep blocked screens physically offscreen. On physical devices,
|
|
63
|
-
* opacity: 0 can break Liquid Glass sampling.
|
|
64
|
-
*
|
|
65
|
-
* See: https://github.com/expo/expo/issues/41024
|
|
66
|
-
*
|
|
67
|
-
*/
|
|
68
51
|
const offset = getVisibilityBlockOffset(height);
|
|
69
52
|
|
|
70
53
|
return {
|
|
@@ -88,6 +71,5 @@ export const useMaybeBlockVisibility = (isFloatingOverlay?: boolean) => {
|
|
|
88
71
|
return {
|
|
89
72
|
animatedStyle,
|
|
90
73
|
animatedProps,
|
|
91
|
-
shouldBlockVisibility,
|
|
92
74
|
};
|
|
93
75
|
};
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
import { NO_PROPS, NO_STYLES } from "../../../../constants";
|
|
7
7
|
import type { NormalizedTransitionInterpolatedStyle } from "../../../../types/animation.types";
|
|
8
8
|
import {
|
|
9
|
+
areResettableStatesBySlotEqual,
|
|
9
10
|
type LocalStyleLayers,
|
|
10
11
|
type ResettableStyleStatesBySlot,
|
|
11
12
|
resolveSlotStyles,
|
|
@@ -26,7 +27,7 @@ export const useResolvedStylesMap = ({
|
|
|
26
27
|
const previousResolvedStylesMap =
|
|
27
28
|
useSharedValue<NormalizedTransitionInterpolatedStyle>(NO_STYLES);
|
|
28
29
|
|
|
29
|
-
return useDerivedValue(() => {
|
|
30
|
+
return useDerivedValue<NormalizedTransitionInterpolatedStyle>(() => {
|
|
30
31
|
"worklet";
|
|
31
32
|
const { resolvedStylesMap, nextPreviousStyleStatesBySlot } =
|
|
32
33
|
resolveSlotStyles({
|
|
@@ -35,12 +36,24 @@ export const useResolvedStylesMap = ({
|
|
|
35
36
|
previousStyleStatesBySlot: previousStyleStatesBySlot.get(),
|
|
36
37
|
});
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
if (
|
|
40
|
+
!areResettableStatesBySlotEqual(
|
|
41
|
+
previousStyleStatesBySlot.get(),
|
|
42
|
+
nextPreviousStyleStatesBySlot,
|
|
43
|
+
)
|
|
44
|
+
) {
|
|
45
|
+
previousStyleStatesBySlot.set(nextPreviousStyleStatesBySlot);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const previousResolvedStyles = previousResolvedStylesMap.get();
|
|
39
49
|
const stableResolvedStylesMap = reuseEqualResolvedSlots({
|
|
40
50
|
resolvedStylesMap,
|
|
41
|
-
previousResolvedStylesMap:
|
|
51
|
+
previousResolvedStylesMap: previousResolvedStyles,
|
|
42
52
|
});
|
|
43
|
-
|
|
53
|
+
|
|
54
|
+
if (stableResolvedStylesMap !== previousResolvedStyles) {
|
|
55
|
+
previousResolvedStylesMap.set(stableResolvedStylesMap);
|
|
56
|
+
}
|
|
44
57
|
|
|
45
58
|
return stableResolvedStylesMap;
|
|
46
59
|
});
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
export {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
useComposedSlotStyles,
|
|
3
|
+
useSlotLayoutStyles,
|
|
4
|
+
useSlotProps,
|
|
5
|
+
useSlotStackingStyles,
|
|
6
|
+
useSlotStyles,
|
|
7
|
+
} from "./hooks/slot-resolvers";
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
ScreenSlotContext,
|
|
11
|
+
type ScreenSlotName,
|
|
12
|
+
ScreenSlotProvider,
|
|
13
|
+
useScreenSlots,
|
|
14
|
+
} from "./slot.provider";
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type ReactNode, useContext, useLayoutEffect, useMemo } from "react";
|
|
2
|
+
import { StyleSheet } from "react-native";
|
|
3
|
+
import Animated, { type SharedValue } from "react-native-reanimated";
|
|
4
|
+
import type {
|
|
5
|
+
NAVIGATION_MASK_CONTAINER_STYLE_ID,
|
|
6
|
+
NAVIGATION_MASK_ELEMENT_STYLE_ID,
|
|
7
|
+
} from "../../../constants";
|
|
8
|
+
import type { NormalizedTransitionInterpolatedStyle } from "../../../types/animation.types";
|
|
9
|
+
import createProvider from "../../../utils/create-provider";
|
|
10
|
+
import { useDescriptorsStore } from "../descriptors";
|
|
11
|
+
import { FloatingOverlayLayer } from "./components/floating-overlay-layer";
|
|
12
|
+
import type { LocalStyleLayers } from "./helpers/resolve-slot-styles";
|
|
13
|
+
import { useInterpolatedStylesMap } from "./hooks/use-interpolated-style-maps";
|
|
14
|
+
import { useMaybeBlockVisibility } from "./hooks/use-maybe-block-visibility";
|
|
15
|
+
import { useResolvedStylesMap } from "./hooks/use-resolved-slot-style-map";
|
|
16
|
+
import {
|
|
17
|
+
registerScreenSlots,
|
|
18
|
+
unregisterScreenSlots,
|
|
19
|
+
} from "./stores/slot-references.store";
|
|
20
|
+
|
|
21
|
+
type Props = {
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
isFloatingOverlay?: boolean;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type ScreenSlotName =
|
|
27
|
+
| "content"
|
|
28
|
+
| "backdrop"
|
|
29
|
+
| "surface"
|
|
30
|
+
| typeof NAVIGATION_MASK_CONTAINER_STYLE_ID
|
|
31
|
+
| typeof NAVIGATION_MASK_ELEMENT_STYLE_ID;
|
|
32
|
+
|
|
33
|
+
export type ScreenSlotContextValue = {
|
|
34
|
+
localStylesMaps: SharedValue<LocalStyleLayers>;
|
|
35
|
+
nextInterpolatorReady: SharedValue<number>;
|
|
36
|
+
slotsMap: SharedValue<NormalizedTransitionInterpolatedStyle>;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const {
|
|
40
|
+
ScreenSlotProvider,
|
|
41
|
+
ScreenSlotContext,
|
|
42
|
+
useScreenSlotContext: useScreenSlots,
|
|
43
|
+
} = createProvider("ScreenSlot", {
|
|
44
|
+
guarded: true,
|
|
45
|
+
})<Props, ScreenSlotContextValue>(({ children, isFloatingOverlay }) => {
|
|
46
|
+
const parentContext = useContext(ScreenSlotContext);
|
|
47
|
+
const currentScreenKey = useDescriptorsStore(
|
|
48
|
+
(s) => s.derivations.currentScreenKey,
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const { localStylesMaps, nextInterpolatorReady } = useInterpolatedStylesMap();
|
|
52
|
+
|
|
53
|
+
const slotsMap = useResolvedStylesMap({
|
|
54
|
+
localStylesMaps,
|
|
55
|
+
ancestorStylesMap: parentContext?.slotsMap,
|
|
56
|
+
});
|
|
57
|
+
const { animatedStyle, animatedProps } =
|
|
58
|
+
useMaybeBlockVisibility(isFloatingOverlay);
|
|
59
|
+
const value = useMemo(
|
|
60
|
+
() => ({
|
|
61
|
+
localStylesMaps,
|
|
62
|
+
nextInterpolatorReady,
|
|
63
|
+
slotsMap,
|
|
64
|
+
}),
|
|
65
|
+
[localStylesMaps, nextInterpolatorReady, slotsMap],
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
useLayoutEffect(() => {
|
|
69
|
+
registerScreenSlots(currentScreenKey, value);
|
|
70
|
+
|
|
71
|
+
return () => {
|
|
72
|
+
unregisterScreenSlots(currentScreenKey, value);
|
|
73
|
+
};
|
|
74
|
+
}, [currentScreenKey, value]);
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
value,
|
|
78
|
+
children: (
|
|
79
|
+
<FloatingOverlayLayer enabled={isFloatingOverlay}>
|
|
80
|
+
<Animated.View
|
|
81
|
+
style={[styles.container, animatedStyle]}
|
|
82
|
+
animatedProps={animatedProps}
|
|
83
|
+
>
|
|
84
|
+
{children}
|
|
85
|
+
</Animated.View>
|
|
86
|
+
</FloatingOverlayLayer>
|
|
87
|
+
),
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const styles = StyleSheet.create({
|
|
92
|
+
container: { flex: 1 },
|
|
93
|
+
});
|