react-native-screen-transitions 3.9.0-alpha.2 → 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 +14 -9
- package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/create-boundary-component.js +66 -28
- 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} +8 -4
- 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} +27 -10
- 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} +5 -7
- 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} +4 -4
- 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 +14 -35
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +5 -6
- package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/index.js +26 -29
- 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 +6 -7
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +1 -22
- 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/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 +1 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.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/resolve-slot-styles/index.js +9 -3
- 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/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 +16 -3
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/index.js +16 -3
- package/lib/commonjs/shared/providers/screen/styles/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +22 -51
- package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -1
- 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 +22 -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/module/shared/components/boundary/components/boundary-target.js +12 -7
- package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/module/shared/components/boundary/create-boundary-component.js +67 -29
- package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/{use-boundary-presence.js → lifecycles/use-boundary-presence.js} +8 -4
- 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} +27 -10
- 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} +5 -7
- 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} +4 -4
- 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 +15 -36
- package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/use-measurer.js +5 -6
- package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
- package/lib/module/shared/components/boundary/index.js +26 -29
- 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 +212 -102
- 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 +6 -7
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/module/shared/components/boundary/utils/destination-signals.js +2 -23
- 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/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 +1 -0
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.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/resolve-slot-styles/index.js +9 -3
- 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/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 +16 -3
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.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 +22 -47
- package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -1
- 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 +19 -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/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts +1 -2
- package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
- package/lib/typescript/component-stack/components/component-screen.d.ts +1 -1
- package/lib/typescript/component-stack/components/component-screen.d.ts.map +1 -1
- package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +1 -2
- package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts.map +1 -1
- package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +1 -1
- package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts.map +1 -1
- package/lib/typescript/native-stack/views/NativeStackView.d.ts +1 -2
- package/lib/typescript/native-stack/views/NativeStackView.d.ts.map +1 -1
- package/lib/typescript/native-stack/views/useHeaderConfigProps.d.ts +2 -2
- package/lib/typescript/shared/adapters/with-screen-transitions/context.d.ts +1 -1
- package/lib/typescript/shared/adapters/with-screen-transitions/context.d.ts.map +1 -1
- package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts +1 -1
- package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts.map +1 -1
- package/lib/typescript/shared/components/activity/variants/activity-container.d.ts +1 -1
- package/lib/typescript/shared/components/activity/variants/activity-container.d.ts.map +1 -1
- package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts +1 -1
- package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts +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/{use-initial-destination-measurement.d.ts → lifecycles/use-initial-destination-measurement.d.ts} +2 -2
- 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/{use-refresh-boundary.d.ts → lifecycles/use-refresh-boundary.d.ts} +2 -2
- 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 +5 -9
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts +4 -3
- package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/index.d.ts +35 -24
- 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 +2 -2
- 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 +2 -2
- 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-provider.d.ts +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/portal-provider.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 +7 -12
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
- 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.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 +6 -5
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/masked-view.d.ts +1 -1
- package/lib/typescript/shared/components/masked-view.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts +1 -1
- package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +1 -1
- package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/scene-view.d.ts +1 -1
- package/lib/typescript/shared/components/scene-view.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/index.d.ts +1 -1
- package/lib/typescript/shared/components/screen-container/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts +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 +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 +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 +1 -1
- package/lib/typescript/shared/components/screen-container/layers/surface-container.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +1 -1
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +711 -667
- 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/descriptors/descriptors.provider.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/screen-composer.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/screen-composer.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.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/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/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 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +2 -2
- 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 +5 -10
- package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -1
- 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 +2 -0
- 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 +9 -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/package.json +1 -1
- package/src/shared/components/boundary/components/boundary-target.tsx +21 -7
- package/src/shared/components/boundary/create-boundary-component.tsx +92 -28
- package/src/shared/components/boundary/hooks/{use-boundary-presence.ts → lifecycles/use-boundary-presence.ts} +16 -5
- package/src/shared/components/boundary/hooks/{use-initial-destination-measurement.ts → lifecycles/use-initial-destination-measurement.ts} +40 -13
- package/src/shared/components/boundary/hooks/{use-initial-source-measurement.ts → lifecycles/use-initial-source-measurement.ts} +7 -9
- package/src/shared/components/boundary/hooks/{use-refresh-boundary.ts → lifecycles/use-refresh-boundary.ts} +6 -6
- package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +15 -45
- package/src/shared/components/boundary/hooks/use-measurer.ts +9 -14
- package/src/shared/components/boundary/index.tsx +55 -29
- 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 +280 -119
- 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-root.provider.tsx +9 -18
- package/src/shared/components/boundary/types.ts +9 -39
- package/src/shared/components/boundary/utils/destination-signals.ts +1 -32
- 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/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 +1 -0
- 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/resolve-slot-styles/index.ts +14 -2
- package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.ts +3 -0
- package/src/shared/providers/screen/styles/hooks/slot-resolvers.tsx +111 -0
- package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +21 -3
- package/src/shared/providers/screen/styles/index.tsx +8 -3
- package/src/shared/providers/screen/styles/slot.provider.tsx +36 -54
- package/src/shared/providers/screen/styles/stores/slot-references.store.ts +71 -0
- package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +24 -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 +10 -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/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/resolve-portal.js +0 -36
- package/lib/commonjs/shared/components/boundary/portal/resolve-portal.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/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/resolve-portal.js +0 -31
- package/lib/module/shared/components/boundary/portal/resolve-portal.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/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts +0 -9
- 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.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.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/resolve-portal.d.ts +0 -14
- package/lib/typescript/shared/components/boundary/portal/resolve-portal.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/src/shared/components/boundary/portal/resolve-portal.ts +0 -40
- package/src/shared/components/boundary/portal/utils/attachment.ts +0 -48
|
@@ -1,149 +1,243 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { memo, useCallback, useLayoutEffect, useState } from "react";
|
|
4
|
-
import Animated, { runOnJS, useAnimatedProps, useAnimatedReaction, useAnimatedStyle, useSharedValue } from "react-native-reanimated";
|
|
4
|
+
import Animated, { runOnJS, runOnUI, useAnimatedProps, useAnimatedReaction, useAnimatedStyle, useSharedValue } from "react-native-reanimated";
|
|
5
|
+
import { EPSILON } from "../../../../constants";
|
|
5
6
|
import { useDescriptorsStore } from "../../../../providers/screen/descriptors";
|
|
6
7
|
import { useScreenSlots } from "../../../../providers/screen/styles";
|
|
8
|
+
import { useRegisteredScreenSlots } from "../../../../providers/screen/styles/stores/slot-references.store";
|
|
7
9
|
import { AnimationStore } from "../../../../stores/animation.store";
|
|
8
|
-
import { getLinkKeyFromTag } from "../../../../stores/bounds/helpers/link-pairs.helpers";
|
|
9
|
-
import { getLink } from "../../../../stores/bounds/internals/links";
|
|
10
10
|
import { pairs } from "../../../../stores/bounds/internals/state";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { mountPortalBoundaryHost, unmountPortalBoundaryHost } from "../stores/portal-boundary-host.store";
|
|
11
|
+
import { logger } from "../../../../utils/logger";
|
|
12
|
+
import { useActiveHostKey } from "../stores/host-registry.store";
|
|
13
|
+
import { dropStalePortalBoundaryHosts, mountPortalBoundaryHost, unmountPortalBoundaryHost } from "../stores/portal-boundary-host.store";
|
|
14
14
|
import { isTeleportAvailable, NativePortal } from "../teleport";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
15
|
+
import { createBoundaryLocalPortalHostName, createPortalBoundaryHostName, PORTAL_HOST_NAME_RESET_VALUE } from "../utils/naming";
|
|
16
|
+
import { canSwitchBoundaryLocalHandoffImmediately, resolveBoundaryPortalOwnership } from "../utils/ownership";
|
|
17
|
+
import { shallowEqual } from "../utils/shallow-equal";
|
|
18
|
+
import { shouldAttachBoundaryPortal } from "../utils/teleport-control";
|
|
19
|
+
import { resolveNextVisiblePortalHostName } from "../utils/visible-host";
|
|
20
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
const AnimatedNativePortal = NativePortal ? Animated.createAnimatedComponent(NativePortal) : null;
|
|
20
22
|
export const Portal = /*#__PURE__*/memo(function Portal({
|
|
21
|
-
id
|
|
23
|
+
id,
|
|
22
24
|
children,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
handoff = false,
|
|
26
|
+
escapeClipping = false,
|
|
27
|
+
placeholderRef,
|
|
28
|
+
placeholderChildren
|
|
25
29
|
}) {
|
|
26
|
-
// Teleporting requires the optional `react-native-teleport` peer
|
|
27
|
-
//
|
|
28
|
-
// children` path below).
|
|
29
|
-
const isPortalEnabled =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
// Teleporting requires the optional `react-native-teleport` peer and a stable
|
|
31
|
+
// `id` to name the boundary host. Missing either degrades to inline rendering
|
|
32
|
+
// (the `return children` path below).
|
|
33
|
+
const isPortalEnabled = (handoff || escapeClipping) && isTeleportAvailable && id !== undefined;
|
|
34
|
+
if (__DEV__ && (handoff || escapeClipping) && id === undefined) {
|
|
35
|
+
logger.warnOnce("portal:missing-id", "A handoff or escapeClipping boundary was rendered without an id; rendering inline.");
|
|
36
|
+
}
|
|
37
|
+
const boundaryId = id ?? "";
|
|
38
|
+
const ownScreenSlots = useScreenSlots();
|
|
34
39
|
const sourcePairKey = useDescriptorsStore(s => s.derivations.sourcePairKey);
|
|
35
40
|
const currentScreenKey = useDescriptorsStore(s => s.derivations.currentScreenKey);
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
41
|
+
const [ownership, setOwnership] = useState(null);
|
|
42
|
+
const styleOwnerScreenKey = ownership?.ownerScreenKey ?? currentScreenKey;
|
|
43
|
+
const ownerScreenSlots = useRegisteredScreenSlots(styleOwnerScreenKey);
|
|
44
|
+
const activeScreenSlots = ownerScreenSlots ?? ownScreenSlots;
|
|
45
|
+
const {
|
|
46
|
+
localStylesMaps: activeLocalStylesMaps,
|
|
47
|
+
nextInterpolatorReady: activeNextInterpolatorReady,
|
|
48
|
+
slotsMap: activeSlotsMap
|
|
49
|
+
} = activeScreenSlots;
|
|
50
|
+
const requestedPortalHostName = useSharedValue(null);
|
|
51
|
+
const visiblePortalHostName = useSharedValue(null);
|
|
52
|
+
const canSwitchPortalHostImmediately = useSharedValue(0);
|
|
39
53
|
const placeholderWidth = useSharedValue(0);
|
|
40
54
|
const placeholderHeight = useSharedValue(0);
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const progress = AnimationStore.getValue(progressScreenKey ?? "", "transitionProgress");
|
|
54
|
-
const closing = AnimationStore.getValue(progressScreenKey ?? "", "closing");
|
|
55
|
-
const updatePortalAttachment = useCallback((matchedScreenKey, pairKey) => {
|
|
56
|
-
if (matchedScreenKey && pairKey) {
|
|
57
|
-
setAttachment(current => {
|
|
58
|
-
if (current?.matchedScreenKey === matchedScreenKey && current.pairKey === pairKey) {
|
|
55
|
+
const targetScreenKey = ownership ? ownership.hostScreenKey : null;
|
|
56
|
+
const settledHostScreenKey = ownership?.hostScreenKey ?? null;
|
|
57
|
+
const settledHostProgress = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "progressSettled");
|
|
58
|
+
const settledHostAnimating = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "progressAnimating");
|
|
59
|
+
const settledHostClosing = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "closing");
|
|
60
|
+
const settledHostVisualProgress = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "visualProgress");
|
|
61
|
+
const activeHostKey = useActiveHostKey(escapeClipping ? targetScreenKey : null);
|
|
62
|
+
const boundaryLocalHostName = handoff && !escapeClipping && targetScreenKey ? createBoundaryLocalPortalHostName(targetScreenKey, boundaryId) : null;
|
|
63
|
+
const updatePortalOwnership = useCallback((hostScreenKey, ownerPairKey, ownerScreenKey) => {
|
|
64
|
+
if (hostScreenKey && ownerPairKey && ownerScreenKey) {
|
|
65
|
+
setOwnership(current => {
|
|
66
|
+
if (current?.hostScreenKey === hostScreenKey && current.ownerPairKey === ownerPairKey && current.ownerScreenKey === ownerScreenKey) {
|
|
59
67
|
return current;
|
|
60
68
|
}
|
|
61
69
|
return {
|
|
62
|
-
|
|
63
|
-
|
|
70
|
+
hostScreenKey,
|
|
71
|
+
ownerPairKey,
|
|
72
|
+
ownerScreenKey,
|
|
73
|
+
status: "complete"
|
|
64
74
|
};
|
|
65
75
|
});
|
|
66
76
|
return;
|
|
67
77
|
}
|
|
68
|
-
|
|
78
|
+
setOwnership(current => current ? null : current);
|
|
69
79
|
}, []);
|
|
70
80
|
useLayoutEffect(() => {
|
|
71
|
-
if (!isPortalEnabled || !
|
|
72
|
-
|
|
81
|
+
if (!isPortalEnabled || !ownership || !targetScreenKey) {
|
|
82
|
+
requestedPortalHostName.set(null);
|
|
83
|
+
visiblePortalHostName.set(null);
|
|
84
|
+
unmountPortalBoundaryHost(boundaryId);
|
|
73
85
|
return;
|
|
74
86
|
}
|
|
87
|
+
if (boundaryLocalHostName) {
|
|
88
|
+
requestedPortalHostName.set(boundaryLocalHostName);
|
|
89
|
+
unmountPortalBoundaryHost(boundaryId);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (!escapeClipping || !activeHostKey) {
|
|
93
|
+
requestedPortalHostName.set(null);
|
|
94
|
+
visiblePortalHostName.set(null);
|
|
95
|
+
unmountPortalBoundaryHost(boundaryId);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const portalHostName = createPortalBoundaryHostName(activeHostKey, boundaryId, ownership.ownerPairKey);
|
|
75
99
|
mountPortalBoundaryHost({
|
|
76
|
-
boundaryId
|
|
77
|
-
|
|
100
|
+
boundaryId,
|
|
101
|
+
escapeClipping,
|
|
78
102
|
hostKey: activeHostKey,
|
|
79
|
-
|
|
80
|
-
|
|
103
|
+
localStylesMaps: activeLocalStylesMaps,
|
|
104
|
+
pairKey: ownership.ownerPairKey,
|
|
105
|
+
portalHostName,
|
|
106
|
+
screenKey: targetScreenKey,
|
|
107
|
+
slotsMap: activeSlotsMap
|
|
81
108
|
});
|
|
82
109
|
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
//
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}, [activeHostKey, activeHostCapturesScroll, attachedHostName, attachment, id, isPortalEnabled, targetScreenKey]);
|
|
110
|
+
// Request the new receiver immediately, but keep the currently visible
|
|
111
|
+
// receiver until the new interpolator is ready. This avoids a no-host gap
|
|
112
|
+
// during A -> B(closing) -> C(opening) spam retargets.
|
|
113
|
+
requestedPortalHostName.set(portalHostName);
|
|
114
|
+
}, [activeHostKey, boundaryId, escapeClipping, isPortalEnabled, activeLocalStylesMaps, activeSlotsMap, ownership, boundaryLocalHostName, requestedPortalHostName, targetScreenKey, visiblePortalHostName]);
|
|
89
115
|
useLayoutEffect(() => {
|
|
90
116
|
return () => {
|
|
91
|
-
|
|
92
|
-
|
|
117
|
+
requestedPortalHostName.set(null);
|
|
118
|
+
visiblePortalHostName.set(null);
|
|
119
|
+
unmountPortalBoundaryHost(boundaryId);
|
|
93
120
|
};
|
|
94
|
-
}, [
|
|
121
|
+
}, [boundaryId, requestedPortalHostName, visiblePortalHostName]);
|
|
95
122
|
useAnimatedReaction(() => {
|
|
96
123
|
"worklet";
|
|
97
124
|
|
|
98
125
|
if (!isPortalEnabled || !sourcePairKey) {
|
|
99
|
-
return
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
// attach. A portal may only teleport on its OWN member's link.
|
|
106
|
-
const link = getLink(sourcePairKey, id);
|
|
107
|
-
if (link?.status !== "complete") {
|
|
108
|
-
return null;
|
|
126
|
+
return {
|
|
127
|
+
hostScreenKey: null,
|
|
128
|
+
ownerPairKey: sourcePairKey,
|
|
129
|
+
ownerScreenKey: null,
|
|
130
|
+
status: "clear"
|
|
131
|
+
};
|
|
109
132
|
}
|
|
133
|
+
return resolveBoundaryPortalOwnership({
|
|
134
|
+
boundaryId,
|
|
135
|
+
currentScreenKey,
|
|
136
|
+
escapeClipping,
|
|
137
|
+
handoff,
|
|
138
|
+
isSettledHostClosingComplete: !!settledHostClosing.get() && settledHostVisualProgress.get() <= EPSILON,
|
|
139
|
+
isSettledHostReady: settledHostProgress.get() === 1 && settledHostAnimating.get() === 0,
|
|
140
|
+
pairsState: pairs.get(),
|
|
141
|
+
settledHostScreenKey,
|
|
142
|
+
sourcePairKey
|
|
143
|
+
});
|
|
144
|
+
}, (signal, previousSignal) => {
|
|
145
|
+
"worklet";
|
|
110
146
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
147
|
+
if (shallowEqual(previousSignal, signal)) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (!handoff || escapeClipping) {
|
|
151
|
+
canSwitchPortalHostImmediately.set(0);
|
|
152
|
+
} else if (signal.status === "pending") {
|
|
153
|
+
canSwitchPortalHostImmediately.set(0);
|
|
154
|
+
return;
|
|
155
|
+
} else {
|
|
156
|
+
const hostScreenKey = signal.status === "complete" ? signal.hostScreenKey : null;
|
|
157
|
+
let previousOwnerPairKey;
|
|
158
|
+
if (previousSignal?.status === "complete") {
|
|
159
|
+
previousOwnerPairKey = previousSignal.ownerPairKey ?? undefined;
|
|
160
|
+
}
|
|
161
|
+
const canSwitchImmediately = canSwitchBoundaryLocalHandoffImmediately({
|
|
162
|
+
hostScreenKey,
|
|
163
|
+
ownerPairKey: signal.status === "complete" ? signal.ownerPairKey : undefined,
|
|
164
|
+
previousOwnerPairKey
|
|
165
|
+
});
|
|
166
|
+
canSwitchPortalHostImmediately.set(canSwitchImmediately ? 1 : 0);
|
|
167
|
+
if (canSwitchImmediately && hostScreenKey) {
|
|
168
|
+
const hostName = createBoundaryLocalPortalHostName(hostScreenKey, boundaryId);
|
|
169
|
+
requestedPortalHostName.set(hostName);
|
|
170
|
+
visiblePortalHostName.set(hostName);
|
|
119
171
|
}
|
|
120
172
|
}
|
|
121
|
-
|
|
122
|
-
}
|
|
173
|
+
runOnJS(updatePortalOwnership)(signal.hostScreenKey, signal.ownerPairKey, signal.ownerScreenKey ?? undefined);
|
|
174
|
+
});
|
|
175
|
+
useAnimatedReaction(() => {
|
|
123
176
|
"worklet";
|
|
124
177
|
|
|
125
|
-
|
|
178
|
+
const slot = activeSlotsMap.get()[boundaryId];
|
|
179
|
+
const teleport = slot?.props?.teleport;
|
|
180
|
+
const shouldTeleport = shouldAttachBoundaryPortal({
|
|
181
|
+
enabled: isPortalEnabled,
|
|
182
|
+
teleport
|
|
183
|
+
});
|
|
184
|
+
const requestedName = requestedPortalHostName.get();
|
|
185
|
+
const visibleName = visiblePortalHostName.get();
|
|
186
|
+
const isInterpolatorReady = activeNextInterpolatorReady.get();
|
|
187
|
+
const nextVisibleName = resolveNextVisiblePortalHostName({
|
|
188
|
+
canSwitchImmediately: canSwitchPortalHostImmediately.get() === 1,
|
|
189
|
+
isInterpolatorReady: isInterpolatorReady === 1,
|
|
190
|
+
requestedName,
|
|
191
|
+
shouldTeleport,
|
|
192
|
+
visibleName
|
|
193
|
+
});
|
|
194
|
+
return {
|
|
195
|
+
isInterpolatorReady,
|
|
196
|
+
nextVisibleName,
|
|
197
|
+
requestedName,
|
|
198
|
+
shouldTeleport,
|
|
199
|
+
teleport,
|
|
200
|
+
visibleName
|
|
201
|
+
};
|
|
202
|
+
}, (state, previousState) => {
|
|
203
|
+
"worklet";
|
|
204
|
+
|
|
205
|
+
if (shallowEqual(previousState, state)) {
|
|
126
206
|
return;
|
|
127
207
|
}
|
|
128
|
-
|
|
208
|
+
if (state.nextVisibleName !== state.visibleName) {
|
|
209
|
+
visiblePortalHostName.set(state.nextVisibleName);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Visible receiver has caught up to the request: GC the superseded hosts.
|
|
214
|
+
if (state.visibleName && state.visibleName === state.requestedName) {
|
|
215
|
+
runOnJS(dropStalePortalBoundaryHosts)({
|
|
216
|
+
boundaryId,
|
|
217
|
+
keepPortalHostName: state.visibleName
|
|
218
|
+
});
|
|
219
|
+
}
|
|
129
220
|
});
|
|
130
221
|
const teleportProps = useAnimatedProps(() => {
|
|
131
222
|
"worklet";
|
|
132
223
|
|
|
133
|
-
|
|
134
|
-
// re-parented before the host is visually ready. Closing stays attached
|
|
135
|
-
// through progress 0 so the final frame can land in the matched host.
|
|
136
|
-
const attachThreshold = closing.get() === 1 ? 0 : 0.001;
|
|
224
|
+
const slot = activeSlotsMap.get()[boundaryId];
|
|
137
225
|
const {
|
|
138
226
|
teleport,
|
|
139
227
|
...slotProps
|
|
140
|
-
} =
|
|
141
|
-
const shouldTeleport =
|
|
228
|
+
} = slot?.props ?? {};
|
|
229
|
+
const shouldTeleport = shouldAttachBoundaryPortal({
|
|
230
|
+
enabled: isPortalEnabled,
|
|
231
|
+
teleport
|
|
232
|
+
});
|
|
233
|
+
const visibleName = visiblePortalHostName.get();
|
|
142
234
|
return {
|
|
143
235
|
// Preserve portal slot props from the interpolator while keeping
|
|
144
|
-
// hostName owned by the attachment gate below.
|
|
236
|
+
// hostName owned by the attachment gate below. Handoff
|
|
237
|
+
// waits until the receiving interpolator owns styles for the same host;
|
|
238
|
+
// after that, it stays attached until teleport is disabled or retargeted.
|
|
145
239
|
...slotProps,
|
|
146
|
-
hostName: shouldTeleport &&
|
|
240
|
+
hostName: shouldTeleport && visibleName ? visibleName : PORTAL_HOST_NAME_RESET_VALUE
|
|
147
241
|
};
|
|
148
242
|
});
|
|
149
243
|
|
|
@@ -154,8 +248,7 @@ export const Portal = /*#__PURE__*/memo(function Portal({
|
|
|
154
248
|
const placeholderStyle = useAnimatedStyle(() => {
|
|
155
249
|
"worklet";
|
|
156
250
|
|
|
157
|
-
const
|
|
158
|
-
const isAttached = hostName !== null;
|
|
251
|
+
const isAttached = visiblePortalHostName.get() !== null;
|
|
159
252
|
const width = placeholderWidth.get();
|
|
160
253
|
const height = placeholderHeight.get();
|
|
161
254
|
if (!isAttached || width === 0) {
|
|
@@ -169,23 +262,40 @@ export const Portal = /*#__PURE__*/memo(function Portal({
|
|
|
169
262
|
height
|
|
170
263
|
};
|
|
171
264
|
});
|
|
172
|
-
|
|
173
|
-
|
|
265
|
+
const handleOnLayout = useCallback(layout => {
|
|
266
|
+
"worklet";
|
|
267
|
+
|
|
268
|
+
const {
|
|
269
|
+
width,
|
|
270
|
+
height
|
|
271
|
+
} = layout;
|
|
272
|
+
if (width === 0 || height === 0) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
const hasValidDimensions = placeholderHeight.get() !== 0 && placeholderWidth.get() !== 0;
|
|
276
|
+
if (!hasValidDimensions) {
|
|
277
|
+
placeholderWidth.set(width);
|
|
278
|
+
placeholderHeight.set(height);
|
|
279
|
+
}
|
|
280
|
+
}, [placeholderHeight, placeholderWidth]);
|
|
281
|
+
if (isPortalEnabled && AnimatedNativePortal) {
|
|
282
|
+
return /*#__PURE__*/_jsxs(Animated.View, {
|
|
174
283
|
ref: placeholderRef,
|
|
175
|
-
onLayout:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
284
|
+
onLayout: ({
|
|
285
|
+
nativeEvent: {
|
|
286
|
+
layout
|
|
287
|
+
}
|
|
288
|
+
}) => runOnUI(handleOnLayout)(layout),
|
|
179
289
|
style: placeholderStyle,
|
|
180
290
|
collapsable: false,
|
|
181
|
-
children: /*#__PURE__*/_jsx(
|
|
291
|
+
children: [placeholderChildren, /*#__PURE__*/_jsx(AnimatedNativePortal, {
|
|
182
292
|
animatedProps: teleportProps,
|
|
183
|
-
name:
|
|
293
|
+
name: boundaryId,
|
|
184
294
|
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
185
295
|
style: placeholderStyle,
|
|
186
296
|
children: children
|
|
187
297
|
})
|
|
188
|
-
})
|
|
298
|
+
})]
|
|
189
299
|
});
|
|
190
300
|
}
|
|
191
301
|
return children;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["memo","useCallback","useLayoutEffect","useState","Animated","runOnJS","useAnimatedProps","useAnimatedReaction","useAnimatedStyle","useSharedValue","useDescriptorsStore","useScreenSlots","AnimationStore","getLinkKeyFromTag","getLink","pairs","createTransitionAwareComponent","getHostCapturesScroll","useActiveHostKey","mountPortalBoundaryHost","unmountPortalBoundaryHost","isTeleportAvailable","NativePortal","resolvePortalAttachmentTargets","createPortalBoundaryHostName","PORTAL_HOST_NAME_RESET_VALUE","isTeleportEnabled","jsx","_jsx","TransitionAwareTeleport","Portal","id","children","mode","placeholderRef","isPortalEnabled","portalAttachTarget","attachTo","slotsMap","sourcePairKey","s","derivations","currentScreenKey","nextScreenKey","attachment","setAttachment","attachedHostName","placeholderWidth","placeholderHeight","progressScreenKey","targetScreenKey","activeHostKey","activeHostCapturesScroll","progress","getValue","closing","updatePortalAttachment","matchedScreenKey","pairKey","current","set","boundaryId","capturesScroll","hostKey","screenKey","get","link","status","group","activeId","groups","destination","previousMatchedScreenKey","teleportProps","attachThreshold","teleport","slotProps","props","shouldTeleport","hostName","placeholderStyle","isAttached","width","height","View","ref","onLayout","event","nativeEvent","layout","style","collapsable","animatedProps","name"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/components/port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utEffect","useState","Animated","runOnJS","runOnUI","useAnimatedProps","useAnimatedReaction","useAnimatedStyle","useSharedValue","EPSILON","useDescriptorsStore","useScreenSlots","useRegisteredScreenSlots","AnimationStore","pairs","logger","useActiveHostKey","dropStalePortalBoundaryHosts","mountPortalBoundaryHost","unmountPortalBoundaryHost","isTeleportAvailable","NativePortal","createBoundaryLocalPortalHostName","createPortalBoundaryHostName","PORTAL_HOST_NAME_RESET_VALUE","canSwitchBoundaryLocalHandoffImmediately","resolveBoundaryPortalOwnership","shallowEqual","shouldAttachBoundaryPortal","resolveNextVisiblePortalHostName","jsx","_jsx","jsxs","_jsxs","AnimatedNativePortal","createAnimatedComponent","Portal","id","children","handoff","escapeClipping","placeholderRef","placeholderChildren","isPortalEnabled","undefined","__DEV__","warnOnce","boundaryId","ownScreenSlots","sourcePairKey","s","derivations","currentScreenKey","ownership","setOwnership","styleOwnerScreenKey","ownerScreenKey","ownerScreenSlots","activeScreenSlots","localStylesMaps","activeLocalStylesMaps","nextInterpolatorReady","activeNextInterpolatorReady","slotsMap","activeSlotsMap","requestedPortalHostName","visiblePortalHostName","canSwitchPortalHostImmediately","placeholderWidth","placeholderHeight","targetScreenKey","hostScreenKey","settledHostScreenKey","settledHostProgress","getValue","settledHostAnimating","settledHostClosing","settledHostVisualProgress","activeHostKey","boundaryLocalHostName","updatePortalOwnership","ownerPairKey","current","status","set","portalHostName","hostKey","pairKey","screenKey","isSettledHostClosingComplete","get","isSettledHostReady","pairsState","signal","previousSignal","previousOwnerPairKey","canSwitchImmediately","hostName","slot","teleport","props","shouldTeleport","enabled","requestedName","visibleName","isInterpolatorReady","nextVisibleName","state","previousState","keepPortalHostName","teleportProps","slotProps","placeholderStyle","isAttached","width","height","handleOnLayout","layout","hasValidDimensions","View","ref","onLayout","nativeEvent","style","collapsable","animatedProps","name"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/components/portal.tsx"],"mappings":";;AAAA,SAGCA,IAAI,EAEJC,WAAW,EACXC,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ACrCjH,OAAO,CAACgH,cAAc,CAAC,CAACC,MAAM,CAC9B;MACDM,KAAK,EAAEX,gBAAiB;MACxBY,WAAW,EAAE,KAAM;MAAAtF,QAAA,GAElBI,mBAAmB,eACpBX,IAAA,CAACG,oBAAoB;QAAC2F,aAAa,EAAEf,aAAc;QAACgB,IAAI,EAAE/E,UAAW;QAAAT,QAAA,eACpEP,IAAA,CAAC7B,QAAQ,CAACqH,IAAI;UAACI,KAAK,EAAEX,gBAAiB;UAAA1E,QAAA,EAAEA;QAAQ,CAAgB;MAAC,CAC7C,CAAC;IAAA,CACT,CAAC;EAElB;EAEA,OAAOA,QAAQ;AAChB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { useLayoutEffect, useState } from "react";
|
|
4
|
-
import { measure, runOnJS, runOnUI, useAnimatedReaction, useAnimatedRef, useSharedValue } from "react-native-reanimated";
|
|
4
|
+
import { cancelAnimation, measure, runOnJS, runOnUI, useAnimatedReaction, useAnimatedRef, useSharedValue, withDelay, withTiming } from "react-native-reanimated";
|
|
5
5
|
import { useOriginContext } from "../../../../providers/screen/origin.provider";
|
|
6
6
|
import { ScrollStore } from "../../../../stores/scroll.store";
|
|
7
7
|
import { adjustedMeasuredBoundsForOverscrollDeltas, normalizeMeasuredBoundsToOrigin } from "../../utils/measured-bounds";
|
|
8
8
|
import { clearPortalHostBounds, setPortalHostBounds } from "../stores/host-bounds.store";
|
|
9
|
+
const HOST_MEASUREMENT_RETRY_DELAY_MS = 16;
|
|
9
10
|
export const useHostMeasurement = ({
|
|
10
11
|
capturesScroll,
|
|
11
12
|
enabled,
|
|
@@ -19,24 +20,35 @@ export const useHostMeasurement = ({
|
|
|
19
20
|
originRef
|
|
20
21
|
} = useOriginContext();
|
|
21
22
|
const hasMeasuredHost = useSharedValue(false);
|
|
23
|
+
const retryToken = useSharedValue(0);
|
|
22
24
|
useAnimatedReaction(() => {
|
|
23
25
|
"worklet";
|
|
24
26
|
|
|
25
27
|
if (!enabled) {
|
|
26
28
|
return null;
|
|
27
29
|
}
|
|
28
|
-
return hasMeasuredHost.get();
|
|
29
|
-
},
|
|
30
|
+
return [hasMeasuredHost.get(), retryToken.get()];
|
|
31
|
+
}, state => {
|
|
30
32
|
"worklet";
|
|
31
33
|
|
|
34
|
+
if (!state) {
|
|
35
|
+
cancelAnimation(retryToken);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const [hasAlreadyMeasured] = state;
|
|
32
39
|
if (!enabled || hasAlreadyMeasured) {
|
|
33
40
|
return;
|
|
34
41
|
}
|
|
35
42
|
const measured = measure(hostRef);
|
|
36
43
|
const measuredOrigin = measure(originRef);
|
|
37
44
|
if (!measured || !measuredOrigin) {
|
|
45
|
+
cancelAnimation(retryToken);
|
|
46
|
+
retryToken.set(withDelay(HOST_MEASUREMENT_RETRY_DELAY_MS, withTiming(retryToken.get() + 1, {
|
|
47
|
+
duration: 0
|
|
48
|
+
})));
|
|
38
49
|
return;
|
|
39
50
|
}
|
|
51
|
+
cancelAnimation(retryToken);
|
|
40
52
|
hasMeasuredHost.set(true);
|
|
41
53
|
|
|
42
54
|
// A measurement taken mid rubber-band would bake the transient
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useLayoutEffect","useState","measure","runOnJS","runOnUI","useAnimatedReaction","useAnimatedRef","useSharedValue","useOriginContext","ScrollStore","adjustedMeasuredBoundsForOverscrollDeltas","normalizeMeasuredBoundsToOrigin","clearPortalHostBounds","setPortalHostBounds","useHostMeasurement","capturesScroll","enabled","hostKey","screenKey","hostRef","scrollMetadata","getValue","canRenderHosts","setCanRenderHosts","originRef","hasMeasuredHost","get","hasAlreadyMeasured","measured","measuredOrigin","set","currentScroll","overscrollNormalized","normalizedMeasured","x","y","width","height","pageX","pageY","scroll"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/hooks/use-host-measurement.ts"],"mappings":";;AAAA,SAASA,eAAe,EAAEC,QAAQ,QAAQ,OAAO;AAEjD,SACCC,OAAO,EACPC,OAAO,EACPC,OAAO,EACPC,mBAAmB,EACnBC,cAAc,EACdC,cAAc,
|
|
1
|
+
{"version":3,"names":["useLayoutEffect","useState","cancelAnimation","measure","runOnJS","runOnUI","useAnimatedReaction","useAnimatedRef","useSharedValue","withDelay","withTiming","useOriginContext","ScrollStore","adjustedMeasuredBoundsForOverscrollDeltas","normalizeMeasuredBoundsToOrigin","clearPortalHostBounds","setPortalHostBounds","HOST_MEASUREMENT_RETRY_DELAY_MS","useHostMeasurement","capturesScroll","enabled","hostKey","screenKey","hostRef","scrollMetadata","getValue","canRenderHosts","setCanRenderHosts","originRef","hasMeasuredHost","retryToken","get","state","hasAlreadyMeasured","measured","measuredOrigin","set","duration","currentScroll","overscrollNormalized","normalizedMeasured","x","y","width","height","pageX","pageY","scroll"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/hooks/use-host-measurement.ts"],"mappings":";;AAAA,SAASA,eAAe,EAAEC,QAAQ,QAAQ,OAAO;AAEjD,SACCC,eAAe,EACfC,OAAO,EACPC,OAAO,EACPC,OAAO,EACPC,mBAAmB,EACnBC,cAAc,EACdC,cAAc,EACdC,SAAS,EACTC,UAAU,QACJ,yBAAyB;AAChC,SAASC,gBAAgB,QAAQ,8CAA8C;AAC/E,SAASC,WAAW,QAAQ,iCAAiC;AAC7D,SACCC,yCAAyC,EACzCC,+BAA+B,QACzB,6BAA6B;AACpC,SACCC,qBAAqB,EACrBC,mBAAmB,QACb,6BAA6B;AAEpC,MAAMC,+BAA+B,GAAG,EAAE;AAS1C,OAAO,MAAMC,kBAAkB,GAAGA,CAAC;EAClCC,cAAc;EACdC,OAAO;EACPC,OAAO;EACPC;AACyB,CAAC,KAAK;EAC/B,MAAMC,OAAO,GAAGhB,cAAc,CAAO,CAAC;EACtC,MAAMiB,cAAc,GAAGZ,WAAW,CAACa,QAAQ,CAACH,SAAS,EAAE,UAAU,CA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AyC,CAACqB,QAAQ,EAAEI,aAAa,CAAC,GAClEJ,QAAQ;IAEX,MAAMM,kBAAkB,GAAG1B,+BAA+B,CACzDyB,oBAAoB,EACpBJ,cACD,CAAC;IAEDnB,mBAAmB,CAACK,OAAO,EAAE;MAC5BoB,CAAC,EAAED,kBAAkB,CAACC,CAAC;MACvBC,CAAC,EAAEF,kBAAkB,CAACE,CAAC;MACvBC,KAAK,EAAEH,kBAAkB,CAACG,KAAK;MAC/BC,MAAM,EAAEJ,kBAAkB,CAACI,MAAM;MACjCC,KAAK,EAAEL,kBAAkB,CAACK,KAAK;MAC/BC,KAAK,EAAEN,kBAAkB,CAACM,KAAK;MAC/BC,MAAM,EAAE5B,cAAc,GAAGmB,aAAa,GAAG;IAC1C,CAAC,CAAC;IAEFlC,OAAO,CAACuB,iBAAiB,CAAC,CAAC,IAAI,CAAC;EACjC,CACD,CAAC;EAED3B,eAAe,CAAC,MAAM;IACrB,OAAO,MAAM;MACZK,OAAO,CAACU,qBAAqB,CAAC,CAACM,OAAO,CAAC;IACxC,CAAC;EACF,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;EAEb,OAAO;IACNK,cAAc;IACdH;EACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { useSyncExternalStore } from "react";
|
|
4
|
-
import { makeMutable } from "react-native-reanimated";
|
|
5
4
|
const EMPTY_SNAPSHOT = {};
|
|
6
5
|
const listeners = new Set();
|
|
7
6
|
const hostStacks = new Map();
|
|
8
7
|
let snapshot = EMPTY_SNAPSHOT;
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
* The active host for a screen. Stack ordering is the load-bearing invariant:
|
|
11
|
+
* `registerHost` unshifts fallback hosts to the front and pushes real hosts to
|
|
12
|
+
* the back, so the active host is the last real (non-fallback) host, falling
|
|
13
|
+
* back to the first entry and finally to the screen's own key.
|
|
15
14
|
*/
|
|
16
|
-
const activeScrollHosts = makeMutable({});
|
|
17
15
|
const getActiveHostFromStack = (screenKey, stack) => {
|
|
18
16
|
if (!stack || stack.length === 0) {
|
|
19
17
|
return screenKey;
|
|
@@ -33,23 +31,8 @@ const buildSnapshot = () => {
|
|
|
33
31
|
}
|
|
34
32
|
return nextSnapshot;
|
|
35
33
|
};
|
|
36
|
-
const buildScrollHostSnapshot = () => {
|
|
37
|
-
const nextSnapshot = {};
|
|
38
|
-
for (const [screenKey, stack] of hostStacks) {
|
|
39
|
-
const activeHostKey = getActiveHostFromStack(screenKey, stack);
|
|
40
|
-
const activeHost = stack.find(host => host.hostKey === activeHostKey);
|
|
41
|
-
if (activeHost?.capturesScroll) {
|
|
42
|
-
nextSnapshot[screenKey] = {
|
|
43
|
-
hostKey: activeHost.hostKey,
|
|
44
|
-
capturesScroll: true
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return nextSnapshot;
|
|
49
|
-
};
|
|
50
34
|
const emit = () => {
|
|
51
35
|
snapshot = buildSnapshot();
|
|
52
|
-
activeScrollHosts.set(buildScrollHostSnapshot());
|
|
53
36
|
for (const listener of listeners) {
|
|
54
37
|
listener();
|
|
55
38
|
}
|
|
@@ -95,32 +78,12 @@ export const unregisterHost = (screenKey, hostKey) => {
|
|
|
95
78
|
export const getActiveHostKey = screenKey => {
|
|
96
79
|
return snapshot[screenKey] ?? screenKey;
|
|
97
80
|
};
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* The screen's active host, if it captures scroll. Worklet-safe: measurement
|
|
101
|
-
* code calls this on the UI thread while writing source bounds.
|
|
102
|
-
*/
|
|
103
|
-
export const getActiveScrollHost = screenKey => {
|
|
104
|
-
"worklet";
|
|
105
|
-
|
|
106
|
-
return activeScrollHosts.get()[screenKey] ?? null;
|
|
107
|
-
};
|
|
108
|
-
export const getHostCapturesScroll = hostKey => {
|
|
109
|
-
for (const stack of hostStacks.values()) {
|
|
110
|
-
const host = stack.find(registration => registration.hostKey === hostKey);
|
|
111
|
-
if (host) {
|
|
112
|
-
return host.capturesScroll;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return false;
|
|
116
|
-
};
|
|
117
81
|
export const useActiveHostKey = screenKey => {
|
|
118
82
|
return useSyncExternalStore(subscribe, () => screenKey ? getActiveHostKey(screenKey) : undefined, () => undefined);
|
|
119
83
|
};
|
|
120
84
|
export const resetHostRegistry = () => {
|
|
121
85
|
hostStacks.clear();
|
|
122
86
|
snapshot = EMPTY_SNAPSHOT;
|
|
123
|
-
activeScrollHosts.set({});
|
|
124
87
|
emit();
|
|
125
88
|
};
|
|
126
89
|
//# sourceMappingURL=host-registry.store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSyncExternalStore","
|
|
1
|
+
{"version":3,"names":["useSyncExternalStore","EMPTY_SNAPSHOT","listeners","Set","hostStacks","Map","snapshot","getActiveHostFromStack","screenKey","stack","length","index","host","fallback","hostKey","buildSnapshot","nextSnapshot","emit","listener","subscribe","add","delete","registerHost","registration","get","previousActiveHostKey","nextStack","filter","unshift","push","set","unregisterHost","getActiveHostKey","useActiveHostKey","undefined","resetHostRegistry","clear"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/stores/host-registry.store.ts"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,OAAO;AAW5C,MAAMC,cAAoC,GAAG,CAAC,CAAC;AAE/C,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAa,CAAC;AACvC,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAA6B,CAAC;AAExD,IAAIC,QAA8B,GAAGL,cAAc;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,sBAAsB,GAAGA,CAC9BC,SAAiB,EACjBC,KAAqC,KACjC;EACJ,IAAI,CAACA,KAAK,IAAIA,KAAK,CAACC,MAAM,KAAK,CA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