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
|
@@ -26,19 +26,6 @@ const buildRefreshSignal = (
|
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
const isMatchedScreenPortalDestinationRefresh = (
|
|
30
|
-
linkState: LinkPairsState | undefined,
|
|
31
|
-
pairKey: ScreenPairKey,
|
|
32
|
-
linkId: string,
|
|
33
|
-
) => {
|
|
34
|
-
"worklet";
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
linkState?.[pairKey]?.links?.[linkId]?.source?.portalAttachTarget ===
|
|
38
|
-
"matched-screen"
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
29
|
export const getRefreshBoundarySignal = (params: {
|
|
43
30
|
enabled: boolean;
|
|
44
31
|
currentScreenKey: string;
|
|
@@ -99,22 +86,6 @@ export const getRefreshBoundarySignal = (params: {
|
|
|
99
86
|
return null;
|
|
100
87
|
}
|
|
101
88
|
|
|
102
|
-
// NOTE:
|
|
103
|
-
// Matched-screen portals use the destination as the initial host/anchor.
|
|
104
|
-
// Once attached, the teleported source is the thing being animated, so a
|
|
105
|
-
// fresh destination measure would mix in a second coordinate basis. Signals were introduced for scroll view cases + group
|
|
106
|
-
// cases, but I can't find a case for where a live component ( matched-screen ) would need this complexity. I would just assume
|
|
107
|
-
// you would want this for a->b | b->a transitions.
|
|
108
|
-
if (
|
|
109
|
-
isMatchedScreenPortalDestinationRefresh(
|
|
110
|
-
linkState,
|
|
111
|
-
refreshDestinationPairKey,
|
|
112
|
-
linkId,
|
|
113
|
-
)
|
|
114
|
-
) {
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
89
|
return buildRefreshSignal(
|
|
119
90
|
"destination",
|
|
120
91
|
refreshDestinationPairKey,
|
|
@@ -155,18 +126,6 @@ export const getRefreshBoundarySignal = (params: {
|
|
|
155
126
|
return null;
|
|
156
127
|
}
|
|
157
128
|
|
|
158
|
-
// NOTE:
|
|
159
|
-
// see above for explanation
|
|
160
|
-
if (
|
|
161
|
-
isMatchedScreenPortalDestinationRefresh(
|
|
162
|
-
linkState,
|
|
163
|
-
refreshDestinationPairKey,
|
|
164
|
-
linkId,
|
|
165
|
-
)
|
|
166
|
-
) {
|
|
167
|
-
return null;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
129
|
return buildRefreshSignal(
|
|
171
130
|
"destination",
|
|
172
131
|
refreshDestinationPairKey,
|
|
@@ -15,32 +15,20 @@ export const getInitialSourceCaptureSignal = (params: {
|
|
|
15
15
|
sourcePairKey?: ScreenPairKey;
|
|
16
16
|
linkId: string;
|
|
17
17
|
group?: string;
|
|
18
|
-
shouldAutoMeasure: boolean;
|
|
19
18
|
linkState?: LinkPairsState;
|
|
20
19
|
}): SourceCaptureSignal | null => {
|
|
21
20
|
"worklet";
|
|
22
|
-
const {
|
|
23
|
-
enabled,
|
|
24
|
-
sourcePairKey,
|
|
25
|
-
linkId,
|
|
26
|
-
group,
|
|
27
|
-
shouldAutoMeasure,
|
|
28
|
-
linkState,
|
|
29
|
-
} = params;
|
|
21
|
+
const { enabled, sourcePairKey, linkId, group, linkState } = params;
|
|
30
22
|
|
|
31
23
|
if (!enabled || !sourcePairKey) {
|
|
32
24
|
return null;
|
|
33
25
|
}
|
|
34
26
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const link = linkState?.[sourcePairKey]?.links?.[linkId];
|
|
27
|
+
const pair = linkState?.[sourcePairKey];
|
|
28
|
+
const link = pair?.links?.[linkId];
|
|
29
|
+
const hasSourceRequest = pair?.sourceRequests?.[linkId];
|
|
42
30
|
|
|
43
|
-
if (!link?.destination || link
|
|
31
|
+
if ((!link?.destination && !hasSourceRequest) || link?.source) {
|
|
44
32
|
return null;
|
|
45
33
|
}
|
|
46
34
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { memo, useCallback, useMemo } from "react";
|
|
1
|
+
import { type ComponentType, memo, useCallback, useMemo } from "react";
|
|
2
2
|
import { Pressable, StyleSheet } from "react-native";
|
|
3
3
|
import Animated, { runOnUI } from "react-native-reanimated";
|
|
4
4
|
import { DefaultSnapSpec } from "../../../configs/specs";
|
|
@@ -8,9 +8,13 @@ import { useSlotProps, useSlotStyles } from "../../../providers/screen/styles";
|
|
|
8
8
|
import { AnimationStore } from "../../../stores/animation.store";
|
|
9
9
|
import { GestureStore } from "../../../stores/gesture.store";
|
|
10
10
|
import { SystemStore } from "../../../stores/system.store";
|
|
11
|
-
import type {
|
|
11
|
+
import type {
|
|
12
|
+
BackdropBehavior,
|
|
13
|
+
ScreenBackdropComponentProps,
|
|
14
|
+
} from "../../../types/screen.types";
|
|
12
15
|
import { animateToProgress } from "../../../utils/animation/animate-to-progress";
|
|
13
16
|
import { findCollapseTarget } from "../helpers/find-collapse-target";
|
|
17
|
+
import { usesLayerRenderProps } from "./render-component";
|
|
14
18
|
|
|
15
19
|
export const BackdropLayer = memo(function BackdropLayer({
|
|
16
20
|
backdropBehavior,
|
|
@@ -30,8 +34,10 @@ export const BackdropLayer = memo(function BackdropLayer({
|
|
|
30
34
|
|
|
31
35
|
const AnimatedBackdropComponent = useMemo(
|
|
32
36
|
() =>
|
|
33
|
-
BackdropComponent
|
|
34
|
-
? Animated.createAnimatedComponent(
|
|
37
|
+
BackdropComponent && !usesLayerRenderProps(BackdropComponent)
|
|
38
|
+
? Animated.createAnimatedComponent(
|
|
39
|
+
BackdropComponent as ComponentType<any>,
|
|
40
|
+
)
|
|
35
41
|
: null,
|
|
36
42
|
[BackdropComponent],
|
|
37
43
|
);
|
|
@@ -108,6 +114,13 @@ export const BackdropLayer = memo(function BackdropLayer({
|
|
|
108
114
|
|
|
109
115
|
const animatedBackdropStyle = useSlotStyles("backdrop");
|
|
110
116
|
const animatedBackdropProps = useSlotProps("backdrop");
|
|
117
|
+
const backdropPointerEvents = isBackdropActive ? "auto" : "none";
|
|
118
|
+
const backdropStyles = [
|
|
119
|
+
StyleSheet.absoluteFill,
|
|
120
|
+
animatedBackdropStyle,
|
|
121
|
+
] as ScreenBackdropComponentProps["styles"];
|
|
122
|
+
const backdropProps =
|
|
123
|
+
animatedBackdropProps as ScreenBackdropComponentProps["props"];
|
|
111
124
|
|
|
112
125
|
return (
|
|
113
126
|
<Pressable
|
|
@@ -115,16 +128,24 @@ export const BackdropLayer = memo(function BackdropLayer({
|
|
|
115
128
|
pointerEvents={isBackdropActive ? "auto" : "none"}
|
|
116
129
|
onPress={isBackdropActive ? handleBackdropPress : undefined}
|
|
117
130
|
>
|
|
118
|
-
{
|
|
119
|
-
* BlurView's animatable ref points at the inner native blur view, and mixing
|
|
120
|
-
* animated style with animatedProps can break intensity updates. */}
|
|
121
|
-
{AnimatedBackdropComponent && (
|
|
131
|
+
{AnimatedBackdropComponent ? (
|
|
122
132
|
<AnimatedBackdropComponent
|
|
123
|
-
style={
|
|
133
|
+
style={backdropStyles}
|
|
124
134
|
animatedProps={animatedBackdropProps}
|
|
135
|
+
pointerEvents={backdropPointerEvents}
|
|
136
|
+
/>
|
|
137
|
+
) : BackdropComponent ? (
|
|
138
|
+
<BackdropComponent
|
|
139
|
+
styles={backdropStyles}
|
|
140
|
+
props={backdropProps}
|
|
141
|
+
pointerEvents={backdropPointerEvents}
|
|
142
|
+
/>
|
|
143
|
+
) : (
|
|
144
|
+
<Animated.View
|
|
145
|
+
style={backdropStyles}
|
|
146
|
+
pointerEvents={backdropPointerEvents}
|
|
125
147
|
/>
|
|
126
148
|
)}
|
|
127
|
-
<Animated.View style={[StyleSheet.absoluteFill, animatedBackdropStyle]} />
|
|
128
149
|
</Pressable>
|
|
129
150
|
);
|
|
130
151
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** biome-ignore-all lint/style/noNonNullAssertion: <Screen gesture is under the gesture context, so this will always exist.> */
|
|
2
|
-
import { memo } from "react";
|
|
2
|
+
import { type ComponentType, memo, useMemo } from "react";
|
|
3
3
|
import { StyleSheet, View } from "react-native";
|
|
4
4
|
import { GestureDetector } from "react-native-gesture-handler";
|
|
5
5
|
import Animated from "react-native-reanimated";
|
|
@@ -7,9 +7,11 @@ import { useDescriptors } from "../../../providers/screen/descriptors";
|
|
|
7
7
|
import { useGestureContext } from "../../../providers/screen/gestures";
|
|
8
8
|
import { OriginProvider } from "../../../providers/screen/origin.provider";
|
|
9
9
|
import { useSlotProps, useSlotStyles } from "../../../providers/screen/styles";
|
|
10
|
+
import type { ScreenContentComponentProps } from "../../../types";
|
|
10
11
|
import { ScreenFallbackHost } from "../../boundary/portal/components/host";
|
|
11
12
|
import { useContentLayout } from "../hooks/use-content-layout";
|
|
12
13
|
import { MaybeMaskedNavigationContainer } from "./maybe-masked-navigation-container";
|
|
14
|
+
import { usesLayerRenderProps } from "./render-component";
|
|
13
15
|
import { SurfaceContainer } from "./surface-container";
|
|
14
16
|
|
|
15
17
|
type Props = {
|
|
@@ -23,9 +25,18 @@ export const ContentLayer = memo(
|
|
|
23
25
|
const { current } = useDescriptors();
|
|
24
26
|
|
|
25
27
|
const gestureContext = useGestureContext();
|
|
28
|
+
const ContentComponent = current.options.contentComponent;
|
|
26
29
|
const isNavigationMaskEnabled = !!current.options.navigationMaskEnabled;
|
|
27
30
|
const contentPointerEvents = isBackdropActive ? "box-none" : pointerEvents;
|
|
28
31
|
|
|
32
|
+
const AnimatedContentComponent = useMemo(() => {
|
|
33
|
+
return ContentComponent && !usesLayerRenderProps(ContentComponent)
|
|
34
|
+
? Animated.createAnimatedComponent(
|
|
35
|
+
ContentComponent as ComponentType<any>,
|
|
36
|
+
)
|
|
37
|
+
: null;
|
|
38
|
+
}, [ContentComponent]);
|
|
39
|
+
|
|
29
40
|
const hasAutoSnapPoint =
|
|
30
41
|
current.options.snapPoints?.includes("auto") ?? false;
|
|
31
42
|
|
|
@@ -33,32 +44,60 @@ export const ContentLayer = memo(
|
|
|
33
44
|
|
|
34
45
|
const animatedContentStyle = useSlotStyles("content");
|
|
35
46
|
const animatedContentProps = useSlotProps("content");
|
|
47
|
+
const contentStyles = [
|
|
48
|
+
styles.content,
|
|
49
|
+
animatedContentStyle,
|
|
50
|
+
] as ScreenContentComponentProps["styles"];
|
|
51
|
+
const contentProps =
|
|
52
|
+
animatedContentProps as ScreenContentComponentProps["props"];
|
|
53
|
+
|
|
54
|
+
const contentChildren = (
|
|
55
|
+
<MaybeMaskedNavigationContainer
|
|
56
|
+
pointerEvents={contentPointerEvents}
|
|
57
|
+
enabled={isNavigationMaskEnabled}
|
|
58
|
+
>
|
|
59
|
+
<SurfaceContainer pointerEvents={contentPointerEvents}>
|
|
60
|
+
<OriginProvider>
|
|
61
|
+
{hasAutoSnapPoint ? (
|
|
62
|
+
<View collapsable={false} onLayout={handleContentLayout}>
|
|
63
|
+
{children}
|
|
64
|
+
</View>
|
|
65
|
+
) : (
|
|
66
|
+
children
|
|
67
|
+
)}
|
|
68
|
+
<ScreenFallbackHost />
|
|
69
|
+
</OriginProvider>
|
|
70
|
+
</SurfaceContainer>
|
|
71
|
+
</MaybeMaskedNavigationContainer>
|
|
72
|
+
);
|
|
36
73
|
|
|
37
74
|
return (
|
|
38
75
|
<GestureDetector gesture={gestureContext!.detectorGesture}>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
76
|
+
{AnimatedContentComponent ? (
|
|
77
|
+
<AnimatedContentComponent
|
|
78
|
+
style={contentStyles}
|
|
79
|
+
animatedProps={animatedContentProps}
|
|
80
|
+
pointerEvents={contentPointerEvents}
|
|
81
|
+
>
|
|
82
|
+
{contentChildren}
|
|
83
|
+
</AnimatedContentComponent>
|
|
84
|
+
) : ContentComponent ? (
|
|
85
|
+
<ContentComponent
|
|
86
|
+
styles={contentStyles}
|
|
87
|
+
props={contentProps}
|
|
88
|
+
pointerEvents={contentPointerEvents}
|
|
89
|
+
>
|
|
90
|
+
{contentChildren}
|
|
91
|
+
</ContentComponent>
|
|
92
|
+
) : (
|
|
93
|
+
<Animated.View
|
|
94
|
+
style={contentStyles}
|
|
95
|
+
animatedProps={animatedContentProps}
|
|
45
96
|
pointerEvents={contentPointerEvents}
|
|
46
|
-
enabled={isNavigationMaskEnabled}
|
|
47
97
|
>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<View collapsable={false} onLayout={handleContentLayout}>
|
|
52
|
-
{children}
|
|
53
|
-
</View>
|
|
54
|
-
) : (
|
|
55
|
-
children
|
|
56
|
-
)}
|
|
57
|
-
<ScreenFallbackHost />
|
|
58
|
-
</OriginProvider>
|
|
59
|
-
</SurfaceContainer>
|
|
60
|
-
</MaybeMaskedNavigationContainer>
|
|
61
|
-
</Animated.View>
|
|
98
|
+
{contentChildren}
|
|
99
|
+
</Animated.View>
|
|
100
|
+
)}
|
|
62
101
|
</GestureDetector>
|
|
63
102
|
);
|
|
64
103
|
},
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
|
+
|
|
3
|
+
export function usesLayerRenderProps(
|
|
4
|
+
component: ComponentType<any>,
|
|
5
|
+
): component is ComponentType<Record<string, unknown>> {
|
|
6
|
+
return (
|
|
7
|
+
typeof component === "function" && !component.prototype?.isReactComponent
|
|
8
|
+
);
|
|
9
|
+
}
|
|
@@ -12,13 +12,14 @@ type Props = {
|
|
|
12
12
|
export const SurfaceContainer = memo(({ children, pointerEvents }: Props) => {
|
|
13
13
|
const { current } = useDescriptors();
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
/** @deprecated Use `contentComponent` instead. */
|
|
16
|
+
const DeprecatedSurfaceComponent = current.options.surfaceComponent;
|
|
16
17
|
|
|
17
18
|
const AnimatedSurfaceComponent = useMemo<ComponentType<any> | null>(() => {
|
|
18
|
-
return
|
|
19
|
-
? Animated.createAnimatedComponent(
|
|
19
|
+
return DeprecatedSurfaceComponent
|
|
20
|
+
? Animated.createAnimatedComponent(DeprecatedSurfaceComponent)
|
|
20
21
|
: null;
|
|
21
|
-
}, [
|
|
22
|
+
}, [DeprecatedSurfaceComponent]);
|
|
22
23
|
|
|
23
24
|
if (!AnimatedSurfaceComponent) return children;
|
|
24
25
|
|
package/src/shared/index.ts
CHANGED
|
@@ -18,6 +18,10 @@ export default {
|
|
|
18
18
|
FlatList: createTransitionAwareComponent(FlatList, {
|
|
19
19
|
isScrollable: true,
|
|
20
20
|
}),
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Use `navigationMaskEnabled` with the navigation mask style IDs
|
|
23
|
+
* instead.
|
|
24
|
+
*/
|
|
21
25
|
MaskedView: MaskedView,
|
|
22
26
|
Presets,
|
|
23
27
|
Specs,
|
|
@@ -26,11 +30,6 @@ export default {
|
|
|
26
30
|
export type { NativeStackAdapterOptions } from "./adapters/with-screen-transitions";
|
|
27
31
|
export { withScreenTransitions } from "./adapters/with-screen-transitions";
|
|
28
32
|
export { snapTo } from "./animation/snap-to";
|
|
29
|
-
export type {
|
|
30
|
-
BoundaryPortal,
|
|
31
|
-
BoundaryPortalAttachTarget,
|
|
32
|
-
BoundaryPortalOptions,
|
|
33
|
-
} from "./components/boundary";
|
|
34
33
|
export {
|
|
35
34
|
NAVIGATION_MASK_CONTAINER_STYLE_ID,
|
|
36
35
|
NAVIGATION_MASK_ELEMENT_STYLE_ID,
|
|
@@ -68,7 +67,12 @@ export type {
|
|
|
68
67
|
InactiveBehavior,
|
|
69
68
|
OverlayProps,
|
|
70
69
|
RawGestureValues,
|
|
70
|
+
ScreenBackdropComponent,
|
|
71
|
+
ScreenBackdropComponentProps,
|
|
72
|
+
ScreenContentComponent,
|
|
73
|
+
ScreenContentComponentProps,
|
|
71
74
|
ScreenInterpolationProps,
|
|
75
|
+
ScreenLayerComponentProps,
|
|
72
76
|
ScreenStyleInterpolator,
|
|
73
77
|
ScreenTransitionAccessor,
|
|
74
78
|
ScreenTransitionConfig,
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import type { MeasuredDimensions, StyleProps } from "react-native-reanimated";
|
|
2
2
|
import { setEntry } from "../../stores/bounds/internals/entries";
|
|
3
3
|
import { setDestination, setSource } from "../../stores/bounds/internals/links";
|
|
4
|
-
import type {
|
|
5
|
-
BoundsPortalAttachTarget,
|
|
6
|
-
ScreenPairKey,
|
|
7
|
-
SourceHostRef,
|
|
8
|
-
} from "../../stores/bounds/types";
|
|
4
|
+
import type { ScreenPairKey } from "../../stores/bounds/types";
|
|
9
5
|
|
|
10
6
|
type LinkWrite =
|
|
11
7
|
| {
|
|
@@ -25,8 +21,8 @@ type ApplyMeasuredBoundsWritesParams = {
|
|
|
25
21
|
measured: MeasuredDimensions;
|
|
26
22
|
preparedStyles: StyleProps;
|
|
27
23
|
linkWrite?: LinkWrite;
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
handoff?: boolean;
|
|
25
|
+
escapeClipping?: boolean;
|
|
30
26
|
};
|
|
31
27
|
|
|
32
28
|
export const applyMeasuredBoundsWrites = (
|
|
@@ -41,8 +37,8 @@ export const applyMeasuredBoundsWrites = (
|
|
|
41
37
|
measured,
|
|
42
38
|
preparedStyles,
|
|
43
39
|
linkWrite,
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
handoff,
|
|
41
|
+
escapeClipping,
|
|
46
42
|
} = params;
|
|
47
43
|
|
|
48
44
|
// Set the bounds entry on every measure to avoid any stale measurements
|
|
@@ -59,8 +55,7 @@ export const applyMeasuredBoundsWrites = (
|
|
|
59
55
|
measured,
|
|
60
56
|
preparedStyles,
|
|
61
57
|
group,
|
|
62
|
-
|
|
63
|
-
sourceHost,
|
|
58
|
+
{ handoff, escapeClipping },
|
|
64
59
|
);
|
|
65
60
|
}
|
|
66
61
|
|
|
@@ -25,6 +25,11 @@ import createProvider from "../utils/create-provider";
|
|
|
25
25
|
import { applyMeasuredBoundsWrites } from "./helpers/measured-bounds-writes";
|
|
26
26
|
import { useDescriptorDerivations, useDescriptors } from "./screen/descriptors";
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Internal legacy provider for the old shared-bound-tag registration
|
|
30
|
+
* path. Do not build new boundary behavior here; use the Transition.Boundary
|
|
31
|
+
* measurement pipeline instead.
|
|
32
|
+
*/
|
|
28
33
|
interface MaybeMeasureAndStoreParams {
|
|
29
34
|
onPress?: ((...args: unknown[]) => void) | undefined;
|
|
30
35
|
shouldSetSource?: boolean;
|
|
@@ -5,6 +5,7 @@ interface DerivationsTarget {
|
|
|
5
5
|
current: ScreenTransitionState;
|
|
6
6
|
next?: ScreenTransitionState;
|
|
7
7
|
progress: number;
|
|
8
|
+
transitionProgress: number;
|
|
8
9
|
focused: boolean;
|
|
9
10
|
active: ScreenTransitionState;
|
|
10
11
|
inactive: ScreenTransitionState | undefined;
|
|
@@ -14,6 +15,8 @@ export const updateDerivations = (frame: DerivationsTarget) => {
|
|
|
14
15
|
"worklet";
|
|
15
16
|
|
|
16
17
|
frame.progress = frame.current.progress + (frame.next?.progress ?? 0);
|
|
18
|
+
frame.transitionProgress =
|
|
19
|
+
frame.current.transitionProgress + (frame.next?.transitionProgress ?? 0);
|
|
17
20
|
frame.focused = !frame.next;
|
|
18
21
|
frame.active = frame.focused ? frame.current : (frame.next ?? frame.current);
|
|
19
22
|
frame.inactive = frame.focused ? frame.previous : frame.current;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { StyleProps, TransformArrayItem } from "react-native-reanimated";
|
|
2
|
+
import { NO_STYLES } from "../../../../constants";
|
|
3
|
+
|
|
4
|
+
type SharedValueLike = {
|
|
5
|
+
_isReanimatedSharedValue: true;
|
|
6
|
+
get?: () => unknown;
|
|
7
|
+
value?: unknown;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const isSharedValueLike = (value: unknown): value is SharedValueLike => {
|
|
11
|
+
"worklet";
|
|
12
|
+
return (
|
|
13
|
+
(value as Partial<SharedValueLike> | null)?._isReanimatedSharedValue ===
|
|
14
|
+
true
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const resolveTransformValue = <T>(value: T): T | unknown => {
|
|
19
|
+
"worklet";
|
|
20
|
+
if (isSharedValueLike(value)) {
|
|
21
|
+
return value.value;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (Array.isArray(value)) {
|
|
25
|
+
const resolved = [];
|
|
26
|
+
for (let index = 0; index < value.length; index++) {
|
|
27
|
+
const item = value[index];
|
|
28
|
+
resolved.push(isSharedValueLike(item) ? item.value : item);
|
|
29
|
+
}
|
|
30
|
+
return resolved;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return value;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const resolveTransformItem = (
|
|
37
|
+
value: TransformArrayItem,
|
|
38
|
+
): TransformArrayItem => {
|
|
39
|
+
"worklet";
|
|
40
|
+
if (typeof value === "object" && value !== null) {
|
|
41
|
+
const resolved: Record<string, unknown> = {};
|
|
42
|
+
const source = value as Record<string, unknown>;
|
|
43
|
+
for (const key in source) {
|
|
44
|
+
resolved[key] = resolveTransformValue(source[key]);
|
|
45
|
+
}
|
|
46
|
+
return resolved as TransformArrayItem;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return value;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const resolveLocalTransform = (
|
|
53
|
+
transform: TransformArrayItem[],
|
|
54
|
+
): TransformArrayItem[] => {
|
|
55
|
+
"worklet";
|
|
56
|
+
const resolved: TransformArrayItem[] = [];
|
|
57
|
+
|
|
58
|
+
for (let index = 0; index < transform.length; index++) {
|
|
59
|
+
resolved.push(resolveTransformItem(transform[index]));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return resolved;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const flattenStyleObject = (
|
|
66
|
+
style: unknown,
|
|
67
|
+
): Record<string, unknown> | undefined => {
|
|
68
|
+
if (style === null || style === undefined || typeof style !== "object") {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (!Array.isArray(style)) {
|
|
73
|
+
return style as Record<string, unknown>;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
let flattened: Record<string, unknown> | undefined;
|
|
77
|
+
for (let index = 0; index < style.length; index++) {
|
|
78
|
+
const child = flattenStyleObject(style[index]);
|
|
79
|
+
|
|
80
|
+
if (!child) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
flattened = flattened ?? {};
|
|
85
|
+
Object.assign(flattened, child);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return flattened;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export const getLocalTransformForSlotComposition = (
|
|
92
|
+
style: unknown,
|
|
93
|
+
): TransformArrayItem[] | undefined => {
|
|
94
|
+
const flattened = flattenStyleObject(style);
|
|
95
|
+
const transform = flattened?.transform;
|
|
96
|
+
|
|
97
|
+
return Array.isArray(transform)
|
|
98
|
+
? (transform as TransformArrayItem[])
|
|
99
|
+
: undefined;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const composeSlotStyleWithLocalTransform = (
|
|
103
|
+
slotStyle: StyleProps | undefined,
|
|
104
|
+
localTransform: TransformArrayItem[] | undefined,
|
|
105
|
+
boundsLocalTransform?: TransformArrayItem[],
|
|
106
|
+
): StyleProps => {
|
|
107
|
+
"worklet";
|
|
108
|
+
const resolvedSlotStyle = (slotStyle ?? NO_STYLES) as StyleProps;
|
|
109
|
+
// The measured bounds snapshot supersedes the live local transform so bounds
|
|
110
|
+
// geometry and payload scale are composed from the same measurement frame.
|
|
111
|
+
const transformToCompose = boundsLocalTransform ?? localTransform;
|
|
112
|
+
|
|
113
|
+
if (!transformToCompose?.length) {
|
|
114
|
+
return resolvedSlotStyle;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const slotTransform = resolvedSlotStyle.transform;
|
|
118
|
+
if (!Array.isArray(slotTransform)) {
|
|
119
|
+
return resolvedSlotStyle;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return {
|
|
123
|
+
...resolvedSlotStyle,
|
|
124
|
+
transform: [
|
|
125
|
+
...(slotTransform as TransformArrayItem[]),
|
|
126
|
+
...resolveLocalTransform(transformToCompose),
|
|
127
|
+
],
|
|
128
|
+
};
|
|
129
|
+
};
|
|
@@ -2,6 +2,10 @@ import type {
|
|
|
2
2
|
NormalizedTransitionInterpolatedStyle,
|
|
3
3
|
NormalizedTransitionSlotStyle,
|
|
4
4
|
} from "../../../../types/animation.types";
|
|
5
|
+
import {
|
|
6
|
+
getBoundsLocalTransform,
|
|
7
|
+
stripBoundsLocalTransform,
|
|
8
|
+
} from "../../../../utils/bounds/helpers/styles/local-transform";
|
|
5
9
|
|
|
6
10
|
const isExplicitTransitionSlot = (value: unknown) => {
|
|
7
11
|
"worklet";
|
|
@@ -12,7 +16,14 @@ const isExplicitTransitionSlot = (value: unknown) => {
|
|
|
12
16
|
);
|
|
13
17
|
};
|
|
14
18
|
|
|
15
|
-
const
|
|
19
|
+
const hasBoundsLocalTransformMarker = (style: unknown) => {
|
|
20
|
+
"worklet";
|
|
21
|
+
return !!getBoundsLocalTransform(style as any)?.length;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const isAlreadyNormalizedStyleMapWithoutBoundsMetadata = (
|
|
25
|
+
raw: Record<string, any>,
|
|
26
|
+
) => {
|
|
16
27
|
"worklet";
|
|
17
28
|
|
|
18
29
|
for (const key in raw) {
|
|
@@ -25,6 +36,14 @@ const isAlreadyNormalizedStyleMap = (raw: Record<string, any>) => {
|
|
|
25
36
|
if (!isExplicitTransitionSlot(value)) {
|
|
26
37
|
return false;
|
|
27
38
|
}
|
|
39
|
+
|
|
40
|
+
if (
|
|
41
|
+
hasBoundsLocalTransformMarker(
|
|
42
|
+
(value as NormalizedTransitionSlotStyle).style,
|
|
43
|
+
)
|
|
44
|
+
) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
28
47
|
}
|
|
29
48
|
|
|
30
49
|
return true;
|
|
@@ -42,10 +61,7 @@ export function normalizeSlots(
|
|
|
42
61
|
): NormalizedTransitionInterpolatedStyle {
|
|
43
62
|
"worklet";
|
|
44
63
|
|
|
45
|
-
|
|
46
|
-
// slot shape. In that common case, we can forward the raw object directly and
|
|
47
|
-
// avoid building a second map just to copy the same slot references over.
|
|
48
|
-
if (isAlreadyNormalizedStyleMap(raw)) {
|
|
64
|
+
if (isAlreadyNormalizedStyleMapWithoutBoundsMetadata(raw)) {
|
|
49
65
|
return raw as NormalizedTransitionInterpolatedStyle;
|
|
50
66
|
}
|
|
51
67
|
|
|
@@ -62,11 +78,32 @@ export function normalizeSlots(
|
|
|
62
78
|
}
|
|
63
79
|
|
|
64
80
|
if (isExplicitTransitionSlot(value)) {
|
|
65
|
-
|
|
66
|
-
|
|
81
|
+
const explicitSlot = value as NormalizedTransitionSlotStyle;
|
|
82
|
+
const boundsLocalTransform = getBoundsLocalTransform(explicitSlot.style);
|
|
83
|
+
|
|
84
|
+
if (!boundsLocalTransform?.length) {
|
|
85
|
+
normalized[key] = explicitSlot;
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
normalized[key] = {
|
|
90
|
+
style: explicitSlot.style
|
|
91
|
+
? stripBoundsLocalTransform(explicitSlot.style)
|
|
92
|
+
: undefined,
|
|
93
|
+
props: explicitSlot.props,
|
|
94
|
+
boundsLocalTransform,
|
|
95
|
+
};
|
|
67
96
|
} else {
|
|
97
|
+
const boundsLocalTransform = getBoundsLocalTransform(value);
|
|
98
|
+
const style =
|
|
99
|
+
boundsLocalTransform?.length && value
|
|
100
|
+
? stripBoundsLocalTransform(value)
|
|
101
|
+
: value;
|
|
102
|
+
|
|
68
103
|
// Shorthand: plain StyleProps — wrap it
|
|
69
|
-
normalized[key] =
|
|
104
|
+
normalized[key] = boundsLocalTransform?.length
|
|
105
|
+
? { style, boundsLocalTransform }
|
|
106
|
+
: { style };
|
|
70
107
|
}
|
|
71
108
|
}
|
|
72
109
|
|