react-native-screen-transitions 3.9.0-alpha.2 → 3.9.0-beta.0
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 +78 -27
- 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 +195 -121
- 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/hooks/use-placeholder-styles.js +57 -0
- package/lib/commonjs/shared/components/boundary/portal/hooks/use-placeholder-styles.js.map +1 -0
- 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 -48
- 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/components/masked-view.js +5 -0
- package/lib/commonjs/shared/components/masked-view.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +18 -8
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/content.js +34 -16
- package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/render-component.js +10 -0
- package/lib/commonjs/shared/components/screen-container/layers/render-component.js.map +1 -0
- package/lib/commonjs/shared/components/screen-container/layers/surface-container.js +5 -3
- package/lib/commonjs/shared/components/screen-container/layers/surface-container.js.map +1 -1
- package/lib/commonjs/shared/index.js +4 -0
- 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/register-bounds.provider.js +6 -0
- package/lib/commonjs/shared/providers/register-bounds.provider.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 +79 -28
- 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 +201 -127
- 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/hooks/use-placeholder-styles.js +52 -0
- package/lib/module/shared/components/boundary/portal/hooks/use-placeholder-styles.js.map +1 -0
- 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 -48
- 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/components/masked-view.js +5 -0
- package/lib/module/shared/components/masked-view.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/backdrop.js +19 -9
- package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/content.js +35 -17
- package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/render-component.js +6 -0
- package/lib/module/shared/components/screen-container/layers/render-component.js.map +1 -0
- package/lib/module/shared/components/screen-container/layers/surface-container.js +5 -3
- package/lib/module/shared/components/screen-container/layers/surface-container.js.map +1 -1
- package/lib/module/shared/index.js +4 -0
- 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/register-bounds.provider.js +6 -0
- package/lib/module/shared/providers/register-bounds.provider.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/component-stack/types.d.ts +26 -0
- package/lib/typescript/component-stack/types.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/hooks/use-placeholder-styles.d.ts +17 -0
- package/lib/typescript/shared/components/boundary/portal/hooks/use-placeholder-styles.d.ts.map +1 -0
- 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 +23 -30
- 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 +5 -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/render-component.d.ts +3 -0
- package/lib/typescript/shared/components/screen-container/layers/render-component.d.ts.map +1 -0
- 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 +731 -683
- 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/register-bounds.provider.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 +3 -3
- 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/types/index.d.ts +1 -1
- package/lib/typescript/shared/types/index.d.ts.map +1 -1
- package/lib/typescript/shared/types/screen.types.d.ts +99 -4
- package/lib/typescript/shared/types/screen.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/types/options.d.ts +2 -0
- package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/component-stack/types.ts +26 -0
- 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 +112 -46
- package/src/shared/components/boundary/portal/components/portal.tsx +263 -134
- package/src/shared/components/boundary/portal/hooks/use-host-measurement.ts +23 -2
- package/src/shared/components/boundary/portal/hooks/use-placeholder-styles.ts +55 -0
- 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 +42 -137
- 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/components/masked-view.tsx +4 -0
- package/src/shared/components/screen-container/layers/backdrop.tsx +31 -10
- package/src/shared/components/screen-container/layers/content.tsx +61 -22
- package/src/shared/components/screen-container/layers/render-component.ts +9 -0
- package/src/shared/components/screen-container/layers/surface-container.tsx +5 -4
- package/src/shared/index.ts +9 -5
- package/src/shared/providers/helpers/measured-bounds-writes.ts +6 -11
- package/src/shared/providers/register-bounds.provider.tsx +5 -0
- 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/types/index.ts +5 -0
- package/src/shared/types/screen.types.ts +111 -4
- 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/types/options.ts +2 -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
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getDestinationScreenKeyFromPairKey,
|
|
3
|
+
getLinkKeyFromTag,
|
|
4
|
+
getLink as getPairLink,
|
|
5
|
+
getSourceScreenKeyFromPairKey,
|
|
6
|
+
} from "../../../../stores/bounds/helpers/link-pairs.helpers";
|
|
7
|
+
import type {
|
|
8
|
+
LinkKey,
|
|
9
|
+
LinkPairsState,
|
|
10
|
+
ScreenKey,
|
|
11
|
+
ScreenPairKey,
|
|
12
|
+
TagLink,
|
|
13
|
+
} from "../../../../stores/bounds/types";
|
|
14
|
+
|
|
15
|
+
export type PortalOwnershipSignal =
|
|
16
|
+
| {
|
|
17
|
+
hostScreenKey: null;
|
|
18
|
+
ownerPairKey?: ScreenPairKey;
|
|
19
|
+
ownerScreenKey: null;
|
|
20
|
+
status: "clear" | "pending";
|
|
21
|
+
}
|
|
22
|
+
| {
|
|
23
|
+
hostScreenKey: ScreenKey;
|
|
24
|
+
ownerPairKey: ScreenPairKey;
|
|
25
|
+
ownerScreenKey: ScreenKey;
|
|
26
|
+
status: "complete";
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const hasSeenScreenKey = (screenKeys: ScreenKey[], screenKey: ScreenKey) => {
|
|
30
|
+
"worklet";
|
|
31
|
+
for (let index = 0; index < screenKeys.length; index++) {
|
|
32
|
+
if (screenKeys[index] === screenKey) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return false;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const usesEscapeClippingHost = (
|
|
40
|
+
link: TagLink | null | undefined,
|
|
41
|
+
): boolean => {
|
|
42
|
+
"worklet";
|
|
43
|
+
return link?.source?.handoff === true && link.source.escapeClipping === true;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const isReturningToPreviousSourceHost = ({
|
|
47
|
+
hostScreenKey,
|
|
48
|
+
ownerPairKey,
|
|
49
|
+
previousOwnerPairKey,
|
|
50
|
+
}: {
|
|
51
|
+
hostScreenKey: ScreenKey;
|
|
52
|
+
ownerPairKey: ScreenPairKey;
|
|
53
|
+
previousOwnerPairKey: ScreenPairKey;
|
|
54
|
+
}) => {
|
|
55
|
+
"worklet";
|
|
56
|
+
const previousSourceScreenKey =
|
|
57
|
+
getSourceScreenKeyFromPairKey(previousOwnerPairKey);
|
|
58
|
+
const previousDestinationScreenKey =
|
|
59
|
+
getDestinationScreenKeyFromPairKey(previousOwnerPairKey);
|
|
60
|
+
const ownerDestinationScreenKey =
|
|
61
|
+
getDestinationScreenKeyFromPairKey(ownerPairKey);
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
previousDestinationScreenKey !== "" &&
|
|
65
|
+
ownerDestinationScreenKey !== "" &&
|
|
66
|
+
previousDestinationScreenKey !== previousSourceScreenKey &&
|
|
67
|
+
ownerDestinationScreenKey === previousSourceScreenKey &&
|
|
68
|
+
hostScreenKey === previousSourceScreenKey
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const canSwitchBoundaryLocalHandoffImmediately = ({
|
|
73
|
+
hostScreenKey,
|
|
74
|
+
ownerPairKey,
|
|
75
|
+
previousOwnerPairKey,
|
|
76
|
+
}: {
|
|
77
|
+
hostScreenKey: ScreenKey | null;
|
|
78
|
+
ownerPairKey?: ScreenPairKey;
|
|
79
|
+
previousOwnerPairKey?: ScreenPairKey;
|
|
80
|
+
}) => {
|
|
81
|
+
"worklet";
|
|
82
|
+
if (!hostScreenKey || !ownerPairKey) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (hostScreenKey === getSourceScreenKeyFromPairKey(ownerPairKey)) {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (!previousOwnerPairKey) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return isReturningToPreviousSourceHost({
|
|
95
|
+
hostScreenKey,
|
|
96
|
+
ownerPairKey,
|
|
97
|
+
previousOwnerPairKey,
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const isActiveHandoffLink = ({
|
|
102
|
+
link,
|
|
103
|
+
linkKey,
|
|
104
|
+
pairKey,
|
|
105
|
+
pairsState,
|
|
106
|
+
}: {
|
|
107
|
+
link: TagLink;
|
|
108
|
+
linkKey: LinkKey;
|
|
109
|
+
pairKey: ScreenPairKey;
|
|
110
|
+
pairsState: LinkPairsState;
|
|
111
|
+
}) => {
|
|
112
|
+
"worklet";
|
|
113
|
+
if (!link.group) {
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const activeId = pairsState[pairKey]?.groups?.[link.group]?.activeId;
|
|
118
|
+
return !activeId || activeId === linkKey;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const resolveBoundaryLocalStyleOwnerScreenKey = ({
|
|
122
|
+
hostScreenKey,
|
|
123
|
+
isSettledHostReady,
|
|
124
|
+
settledHostScreenKey,
|
|
125
|
+
sourceScreenKey,
|
|
126
|
+
}: {
|
|
127
|
+
hostScreenKey: ScreenKey;
|
|
128
|
+
isSettledHostReady: boolean;
|
|
129
|
+
settledHostScreenKey?: ScreenKey | null;
|
|
130
|
+
sourceScreenKey: ScreenKey;
|
|
131
|
+
}): ScreenKey => {
|
|
132
|
+
"worklet";
|
|
133
|
+
if (settledHostScreenKey === hostScreenKey && isSettledHostReady) {
|
|
134
|
+
return hostScreenKey;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return sourceScreenKey;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const pendingSignal = (sourcePairKey: ScreenPairKey): PortalOwnershipSignal => {
|
|
141
|
+
"worklet";
|
|
142
|
+
return {
|
|
143
|
+
hostScreenKey: null,
|
|
144
|
+
ownerPairKey: sourcePairKey,
|
|
145
|
+
ownerScreenKey: null,
|
|
146
|
+
status: "pending",
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const clearSignal = (sourcePairKey: ScreenPairKey): PortalOwnershipSignal => {
|
|
151
|
+
"worklet";
|
|
152
|
+
return {
|
|
153
|
+
hostScreenKey: null,
|
|
154
|
+
ownerPairKey: sourcePairKey,
|
|
155
|
+
ownerScreenKey: null,
|
|
156
|
+
status: "clear",
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export const resolveBoundaryPortalOwnership = ({
|
|
161
|
+
boundaryId,
|
|
162
|
+
currentScreenKey,
|
|
163
|
+
escapeClipping,
|
|
164
|
+
handoff,
|
|
165
|
+
isSettledHostClosingComplete = false,
|
|
166
|
+
isSettledHostReady = false,
|
|
167
|
+
pairsState,
|
|
168
|
+
settledHostScreenKey = null,
|
|
169
|
+
sourcePairKey,
|
|
170
|
+
}: {
|
|
171
|
+
boundaryId: string;
|
|
172
|
+
currentScreenKey: ScreenKey;
|
|
173
|
+
escapeClipping: boolean;
|
|
174
|
+
handoff: boolean;
|
|
175
|
+
isSettledHostClosingComplete?: boolean;
|
|
176
|
+
isSettledHostReady?: boolean;
|
|
177
|
+
pairsState: LinkPairsState;
|
|
178
|
+
settledHostScreenKey?: ScreenKey | null;
|
|
179
|
+
sourcePairKey: ScreenPairKey;
|
|
180
|
+
}): PortalOwnershipSignal => {
|
|
181
|
+
"worklet";
|
|
182
|
+
const linkKey = getLinkKeyFromTag(boundaryId);
|
|
183
|
+
const link = getPairLink(pairsState, sourcePairKey, linkKey);
|
|
184
|
+
|
|
185
|
+
if (link?.status !== "complete") {
|
|
186
|
+
return pendingSignal(sourcePairKey);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (
|
|
190
|
+
!isActiveHandoffLink({
|
|
191
|
+
link,
|
|
192
|
+
linkKey,
|
|
193
|
+
pairKey: sourcePairKey,
|
|
194
|
+
pairsState,
|
|
195
|
+
})
|
|
196
|
+
) {
|
|
197
|
+
return clearSignal(sourcePairKey);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if (!handoff) {
|
|
201
|
+
return {
|
|
202
|
+
hostScreenKey: currentScreenKey,
|
|
203
|
+
ownerPairKey: sourcePairKey,
|
|
204
|
+
ownerScreenKey: currentScreenKey,
|
|
205
|
+
status: "complete",
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
let hostScreenKey = link.destination.screenKey;
|
|
210
|
+
let ownerPairKey = sourcePairKey;
|
|
211
|
+
let previousOwnerPairKey: ScreenPairKey | null = null;
|
|
212
|
+
const seenScreenKeys: ScreenKey[] = [
|
|
213
|
+
getSourceScreenKeyFromPairKey(sourcePairKey),
|
|
214
|
+
hostScreenKey,
|
|
215
|
+
];
|
|
216
|
+
|
|
217
|
+
const pairKeys = Object.keys(pairsState);
|
|
218
|
+
|
|
219
|
+
for (let hop = 0; hop < pairKeys.length; hop++) {
|
|
220
|
+
let didAdvance = false;
|
|
221
|
+
let hasPendingNextHop = false;
|
|
222
|
+
let didHitVisitedScreen = false;
|
|
223
|
+
|
|
224
|
+
for (let index = 0; index < pairKeys.length; index++) {
|
|
225
|
+
const candidatePairKey = pairKeys[index];
|
|
226
|
+
if (!candidatePairKey || candidatePairKey === ownerPairKey) {
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const candidate = getPairLink(pairsState, candidatePairKey, linkKey);
|
|
231
|
+
if (!candidate?.source || candidate.source.screenKey !== hostScreenKey) {
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if (!candidate.source.handoff) {
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (
|
|
240
|
+
!isActiveHandoffLink({
|
|
241
|
+
link: candidate,
|
|
242
|
+
linkKey,
|
|
243
|
+
pairKey: candidatePairKey,
|
|
244
|
+
pairsState,
|
|
245
|
+
})
|
|
246
|
+
) {
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (candidate.status !== "complete") {
|
|
251
|
+
hasPendingNextHop = true;
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
const nextHostScreenKey = candidate.destination.screenKey;
|
|
256
|
+
|
|
257
|
+
previousOwnerPairKey = ownerPairKey;
|
|
258
|
+
ownerPairKey = candidatePairKey;
|
|
259
|
+
hostScreenKey = nextHostScreenKey;
|
|
260
|
+
|
|
261
|
+
if (hasSeenScreenKey(seenScreenKeys, nextHostScreenKey)) {
|
|
262
|
+
didHitVisitedScreen = true;
|
|
263
|
+
break;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
seenScreenKeys.push(nextHostScreenKey);
|
|
267
|
+
didAdvance = true;
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (didHitVisitedScreen) {
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
if (didAdvance) {
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
if (hasPendingNextHop) {
|
|
280
|
+
return pendingSignal(ownerPairKey);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
const ownerLink = getPairLink(pairsState, ownerPairKey, linkKey);
|
|
287
|
+
const ownerUsesEscapeClipping =
|
|
288
|
+
ownerLink?.source?.escapeClipping ?? escapeClipping;
|
|
289
|
+
|
|
290
|
+
if (
|
|
291
|
+
!ownerUsesEscapeClipping &&
|
|
292
|
+
isSettledHostClosingComplete &&
|
|
293
|
+
settledHostScreenKey === hostScreenKey &&
|
|
294
|
+
previousOwnerPairKey
|
|
295
|
+
) {
|
|
296
|
+
hostScreenKey = getSourceScreenKeyFromPairKey(ownerPairKey);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
const ownerScreenKey = ownerUsesEscapeClipping
|
|
300
|
+
? getSourceScreenKeyFromPairKey(ownerPairKey)
|
|
301
|
+
: resolveBoundaryLocalStyleOwnerScreenKey({
|
|
302
|
+
hostScreenKey,
|
|
303
|
+
isSettledHostReady,
|
|
304
|
+
settledHostScreenKey,
|
|
305
|
+
sourceScreenKey: getSourceScreenKeyFromPairKey(ownerPairKey),
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
return {
|
|
309
|
+
hostScreenKey,
|
|
310
|
+
ownerPairKey,
|
|
311
|
+
ownerScreenKey,
|
|
312
|
+
status: "complete",
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
export const hasHandoffEscapeContinuation = ({
|
|
317
|
+
linkKey,
|
|
318
|
+
linkState,
|
|
319
|
+
sourceScreenKey,
|
|
320
|
+
}: {
|
|
321
|
+
linkKey: string;
|
|
322
|
+
linkState: LinkPairsState;
|
|
323
|
+
sourceScreenKey: ScreenKey;
|
|
324
|
+
}) => {
|
|
325
|
+
"worklet";
|
|
326
|
+
const pairKeys = Object.keys(linkState);
|
|
327
|
+
const visitedScreenKeys: ScreenKey[] = [];
|
|
328
|
+
let cursorScreenKey = sourceScreenKey;
|
|
329
|
+
|
|
330
|
+
for (let hop = 0; hop < pairKeys.length; hop++) {
|
|
331
|
+
if (hasSeenScreenKey(visitedScreenKeys, cursorScreenKey)) {
|
|
332
|
+
return false;
|
|
333
|
+
}
|
|
334
|
+
visitedScreenKeys.push(cursorScreenKey);
|
|
335
|
+
|
|
336
|
+
let previousScreenKey: ScreenKey | null = null;
|
|
337
|
+
for (let index = 0; index < pairKeys.length; index++) {
|
|
338
|
+
const candidatePairKey = pairKeys[index];
|
|
339
|
+
const link = candidatePairKey
|
|
340
|
+
? linkState[candidatePairKey]?.links?.[linkKey]
|
|
341
|
+
: null;
|
|
342
|
+
|
|
343
|
+
if (
|
|
344
|
+
!link?.source ||
|
|
345
|
+
!link.destination ||
|
|
346
|
+
link.destination.screenKey !== cursorScreenKey
|
|
347
|
+
) {
|
|
348
|
+
continue;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
if (usesEscapeClippingHost(link)) {
|
|
352
|
+
return true;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
if (!link.source.handoff) {
|
|
356
|
+
return false;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
previousScreenKey = link.source.screenKey;
|
|
360
|
+
break;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
if (!previousScreenKey) {
|
|
364
|
+
return false;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
cursorScreenKey = previousScreenKey;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
return false;
|
|
371
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { logger } from "../../../../utils/logger";
|
|
2
|
+
import { isTeleportAvailable } from "../teleport";
|
|
3
|
+
|
|
4
|
+
export type BoundaryPortalRuntime = {
|
|
5
|
+
handoff: boolean;
|
|
6
|
+
escapeClipping: boolean;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type ResolveBoundaryPortalParams = {
|
|
11
|
+
handoff?: boolean;
|
|
12
|
+
escapeClipping?: boolean;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const resolveBoundaryPortal = ({
|
|
16
|
+
handoff,
|
|
17
|
+
escapeClipping,
|
|
18
|
+
}: ResolveBoundaryPortalParams): BoundaryPortalRuntime => {
|
|
19
|
+
const resolvedHandoff = handoff ?? false;
|
|
20
|
+
const resolvedEscapeClipping = escapeClipping ?? false;
|
|
21
|
+
|
|
22
|
+
const enabled = resolvedHandoff || resolvedEscapeClipping;
|
|
23
|
+
|
|
24
|
+
if (!enabled) {
|
|
25
|
+
return {
|
|
26
|
+
handoff: false,
|
|
27
|
+
escapeClipping: false,
|
|
28
|
+
enabled: false,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (!isTeleportAvailable) {
|
|
33
|
+
logger.warnOnce(
|
|
34
|
+
"boundary:teleport-missing",
|
|
35
|
+
"react-native-teleport is not installed; handoff and escapeClipping boundaries will render inline.",
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
handoff: false,
|
|
40
|
+
escapeClipping: false,
|
|
41
|
+
enabled: false,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
handoff: resolvedHandoff,
|
|
47
|
+
escapeClipping: resolvedEscapeClipping,
|
|
48
|
+
enabled,
|
|
49
|
+
};
|
|
50
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shallow equality for the flat signal objects produced by the portal
|
|
3
|
+
* `useAnimatedReaction` blocks. Both sides always carry the same fixed key set,
|
|
4
|
+
* so iterating one side's keys is sufficient. A `null`/`undefined` operand
|
|
5
|
+
* (the first reaction run) is treated as not-equal so the reaction proceeds.
|
|
6
|
+
*/
|
|
7
|
+
export const shallowEqual = (
|
|
8
|
+
a: Record<string, unknown> | null | undefined,
|
|
9
|
+
b: Record<string, unknown> | null | undefined,
|
|
10
|
+
) => {
|
|
11
|
+
"worklet";
|
|
12
|
+
if (!a || !b) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const keys = Object.keys(a);
|
|
17
|
+
for (let index = 0; index < keys.length; index++) {
|
|
18
|
+
const key = keys[index];
|
|
19
|
+
if (a[key] !== b[key]) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return true;
|
|
25
|
+
};
|
|
@@ -11,3 +11,15 @@ export const isTeleportEnabled = (
|
|
|
11
11
|
|
|
12
12
|
return teleport?.enabled !== false;
|
|
13
13
|
};
|
|
14
|
+
|
|
15
|
+
export const shouldAttachBoundaryPortal = ({
|
|
16
|
+
enabled,
|
|
17
|
+
teleport,
|
|
18
|
+
}: {
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
teleport?: BoundaryTeleportControl;
|
|
21
|
+
}) => {
|
|
22
|
+
"worklet";
|
|
23
|
+
|
|
24
|
+
return enabled && isTeleportEnabled(teleport);
|
|
25
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export const resolveNextVisiblePortalHostName = ({
|
|
2
|
+
canSwitchImmediately,
|
|
3
|
+
isInterpolatorReady,
|
|
4
|
+
requestedName,
|
|
5
|
+
shouldTeleport,
|
|
6
|
+
visibleName,
|
|
7
|
+
}: {
|
|
8
|
+
canSwitchImmediately?: boolean;
|
|
9
|
+
isInterpolatorReady: boolean;
|
|
10
|
+
requestedName: string | null;
|
|
11
|
+
shouldTeleport: boolean;
|
|
12
|
+
visibleName: string | null;
|
|
13
|
+
}) => {
|
|
14
|
+
"worklet";
|
|
15
|
+
if (!shouldTeleport) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (requestedName && (canSwitchImmediately || isInterpolatorReady)) {
|
|
20
|
+
return requestedName;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return visibleName;
|
|
24
|
+
};
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import type React from "react";
|
|
2
1
|
import { type ReactNode, useCallback, useMemo, useState } from "react";
|
|
3
2
|
import type { View } from "react-native";
|
|
4
|
-
import type Animated from "react-native-reanimated";
|
|
5
3
|
import type { AnimatedRef, StyleProps } from "react-native-reanimated";
|
|
6
4
|
import { useAnimatedRef } from "react-native-reanimated";
|
|
7
5
|
import type { BoundTag } from "../../../stores/bounds/types";
|
|
8
6
|
import createProvider from "../../../utils/create-provider";
|
|
9
7
|
import { logger } from "../../../utils/logger";
|
|
10
|
-
import type {
|
|
11
|
-
|
|
12
|
-
type BoundaryAssociatedStyle = React.ComponentProps<
|
|
13
|
-
typeof Animated.View
|
|
14
|
-
>["style"];
|
|
8
|
+
import type { BoundaryPortalRuntime } from "../portal/utils/resolve-portal";
|
|
15
9
|
|
|
16
10
|
interface BoundaryRootContextValue {
|
|
17
11
|
registerTargetRef: (
|
|
@@ -21,9 +15,8 @@ interface BoundaryRootContextValue {
|
|
|
21
15
|
) => void;
|
|
22
16
|
unregisterTargetRef: (targetRef: AnimatedRef<View>) => void;
|
|
23
17
|
activeTargetRef: AnimatedRef<View> | null;
|
|
24
|
-
associatedTargetStyles?: BoundaryAssociatedStyle;
|
|
25
18
|
boundTag: BoundTag;
|
|
26
|
-
|
|
19
|
+
portalRuntime: BoundaryPortalRuntime;
|
|
27
20
|
}
|
|
28
21
|
|
|
29
22
|
type BoundaryTargetEntry = {
|
|
@@ -38,7 +31,7 @@ const MULTIPLE_TARGETS_WARNING =
|
|
|
38
31
|
"Multiple Boundary.Target elements were rendered under the same boundary root. The first registered target will be measured.";
|
|
39
32
|
|
|
40
33
|
export const TARGET_OUTSIDE_ROOT_WARNING =
|
|
41
|
-
"Boundary.Target must be rendered inside
|
|
34
|
+
"Boundary.Target must be rendered inside Transition.Boundary or a component created by createBoundaryComponent.";
|
|
42
35
|
|
|
43
36
|
interface BoundaryRootProps {
|
|
44
37
|
value: BoundaryRootContextValue;
|
|
@@ -51,11 +44,11 @@ export const { BoundaryRootProvider, useBoundaryRootContext } = createProvider(
|
|
|
51
44
|
)<BoundaryRootProps, BoundaryRootContextValue>((props) => props);
|
|
52
45
|
|
|
53
46
|
export const useBoundaryRootState = (params: {
|
|
54
|
-
associatedTargetStyles?: BoundaryAssociatedStyle;
|
|
55
47
|
boundTag: BoundTag;
|
|
56
|
-
|
|
48
|
+
portalRuntime: BoundaryPortalRuntime;
|
|
49
|
+
rootMeasurementRef?: AnimatedRef<View>;
|
|
57
50
|
}) => {
|
|
58
|
-
const {
|
|
51
|
+
const { boundTag, portalRuntime, rootMeasurementRef } = params;
|
|
59
52
|
const rootRef = useAnimatedRef<View>();
|
|
60
53
|
const [targetEntry, setTargetEntry] = useState<BoundaryTargetEntry | null>(
|
|
61
54
|
null,
|
|
@@ -100,17 +93,15 @@ export const useBoundaryRootState = (params: {
|
|
|
100
93
|
registerTargetRef,
|
|
101
94
|
unregisterTargetRef,
|
|
102
95
|
activeTargetRef: targetEntry?.ref ?? null,
|
|
103
|
-
associatedTargetStyles,
|
|
104
96
|
boundTag,
|
|
105
|
-
|
|
97
|
+
portalRuntime,
|
|
106
98
|
}),
|
|
107
99
|
[
|
|
108
100
|
registerTargetRef,
|
|
109
101
|
unregisterTargetRef,
|
|
110
102
|
targetEntry,
|
|
111
|
-
associatedTargetStyles,
|
|
112
103
|
boundTag,
|
|
113
|
-
|
|
104
|
+
portalRuntime,
|
|
114
105
|
],
|
|
115
106
|
);
|
|
116
107
|
|
|
@@ -118,7 +109,7 @@ export const useBoundaryRootState = (params: {
|
|
|
118
109
|
ref: rootRef,
|
|
119
110
|
contextValue,
|
|
120
111
|
hasActiveTarget: targetEntry !== null,
|
|
121
|
-
measuredRef: targetEntry?.measurementRef ?? rootRef,
|
|
112
|
+
measuredRef: targetEntry?.measurementRef ?? rootMeasurementRef ?? rootRef,
|
|
122
113
|
targetPreparedStyles: targetEntry?.preparedStyles,
|
|
123
114
|
};
|
|
124
115
|
};
|
|
@@ -3,35 +3,6 @@ import type { BoundsOptions } from "../../utils/bounds/types/options";
|
|
|
3
3
|
|
|
4
4
|
export type BoundaryId = string | number;
|
|
5
5
|
|
|
6
|
-
export type BoundaryPortalAttachTarget = "current-screen" | "matched-screen";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Configures automatic portal attachment for a boundary target.
|
|
10
|
-
*
|
|
11
|
-
* `attachTo` selects where the portal physically renders. Independently of
|
|
12
|
-
* that choice, `Transition.Boundary.Host` marks the screen-local coordinate
|
|
13
|
-
* space the portal should render within.
|
|
14
|
-
*
|
|
15
|
-
* - `current-screen`: the portal attaches to this screen's active host — for a
|
|
16
|
-
* scroll-hosted screen, place `Transition.Boundary.Host` inside that
|
|
17
|
-
* ScrollView to make the content ride with it.
|
|
18
|
-
* - `matched-screen`: the portal attaches to the matched screen's active host
|
|
19
|
-
* for the whole transition (open and close), which avoids re-parenting
|
|
20
|
-
* flicker while keeping the source placeholder measured at home.
|
|
21
|
-
*/
|
|
22
|
-
export type BoundaryPortalOptions = {
|
|
23
|
-
/**
|
|
24
|
-
* `current-screen` keeps the portal on this boundary's screen.
|
|
25
|
-
* `matched-screen` moves it to the matched screen once the
|
|
26
|
-
* source/destination link completes.
|
|
27
|
-
*
|
|
28
|
-
* @default "current-screen"
|
|
29
|
-
*/
|
|
30
|
-
attachTo?: BoundaryPortalAttachTarget;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export type BoundaryPortal = boolean | BoundaryPortalOptions;
|
|
34
|
-
|
|
35
6
|
export type BoundaryConfigProps = Pick<
|
|
36
7
|
BoundsOptions,
|
|
37
8
|
"anchor" | "scaleMode" | "target" | "method"
|
|
@@ -55,20 +26,19 @@ export interface BoundaryOwnProps extends BoundaryConfigProps {
|
|
|
55
26
|
*/
|
|
56
27
|
enabled?: boolean;
|
|
57
28
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* The target keeps its measured layout space in the original tree. Once the
|
|
62
|
-
* active source/destination link for this boundary is complete, the screen
|
|
63
|
-
* portal layer can render a boundary-specific host and attach this target to
|
|
64
|
-
* it so the active matched target escapes local clipping.
|
|
29
|
+
* Teleports this boundary's live payload to the next matching boundary while
|
|
30
|
+
* a transition is active.
|
|
65
31
|
*
|
|
66
|
-
*
|
|
67
|
-
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
handoff?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Renders this boundary through the current screen's portal host while a
|
|
37
|
+
* transition is active so the payload can escape clipping/layout constraints.
|
|
68
38
|
*
|
|
69
39
|
* @default false
|
|
70
40
|
*/
|
|
71
|
-
|
|
41
|
+
escapeClipping?: boolean;
|
|
72
42
|
id: BoundaryId;
|
|
73
43
|
}
|
|
74
44
|
|
|
@@ -1,34 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
-
createPendingPairKey,
|
|
3
2
|
getActiveGroupId,
|
|
4
3
|
getLinkKeyFromTag,
|
|
5
|
-
getSourceScreenKeyFromPairKey,
|
|
6
4
|
} from "../../../stores/bounds/helpers/link-pairs.helpers";
|
|
7
5
|
import type {
|
|
8
6
|
LinkPairsState,
|
|
9
7
|
ScreenPairKey,
|
|
10
8
|
} from "../../../stores/bounds/types";
|
|
11
9
|
|
|
12
|
-
const hasPendingSourceLinks = (
|
|
13
|
-
linkState: LinkPairsState | undefined,
|
|
14
|
-
pendingPairKey: ScreenPairKey,
|
|
15
|
-
) => {
|
|
16
|
-
"worklet";
|
|
17
|
-
const links = linkState?.[pendingPairKey]?.links;
|
|
18
|
-
|
|
19
|
-
if (!links) {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
for (const key in links) {
|
|
24
|
-
if (links[key]?.source) {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return false;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
10
|
export const getInitialDestinationMeasurePairKey = (params: {
|
|
33
11
|
enabled: boolean;
|
|
34
12
|
destinationPairKey?: ScreenPairKey;
|
|
@@ -60,21 +38,12 @@ export const getInitialDestinationMeasurePairKey = (params: {
|
|
|
60
38
|
return null;
|
|
61
39
|
}
|
|
62
40
|
|
|
63
|
-
const sourceScreenKey = getSourceScreenKeyFromPairKey(measurePairKey);
|
|
64
|
-
const pendingPairKey = createPendingPairKey(sourceScreenKey);
|
|
65
|
-
const hasPendingSources = hasPendingSourceLinks(linkState, pendingPairKey);
|
|
66
|
-
const pendingSource = linkState?.[pendingPairKey]?.links?.[linkKey]?.source;
|
|
67
|
-
|
|
68
|
-
if (hasPendingSources && !pendingSource) {
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
41
|
const activeGroupId =
|
|
73
42
|
group && linkState
|
|
74
43
|
? getActiveGroupId(linkState, measurePairKey, group)
|
|
75
44
|
: null;
|
|
76
45
|
|
|
77
|
-
if (
|
|
46
|
+
if (activeGroupId && activeGroupId !== linkKey) {
|
|
78
47
|
return null;
|
|
79
48
|
}
|
|
80
49
|
|