react-native-screen-transitions 3.4.0-alpha.6 → 3.4.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/README.md +136 -46
- package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js +27 -45
- package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
- package/lib/commonjs/component-stack/navigators/create-component-stack-navigator.js +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/components/boundary-target.js +41 -0
- package/lib/commonjs/shared/components/create-boundary-component/components/boundary-target.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js +193 -0
- package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +53 -43
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +8 -26
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +84 -2
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-prepare-transition-measurement.js +67 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-prepare-transition-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/index.js +27 -216
- package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/providers/boundary-owner.provider.js +63 -0
- package/lib/commonjs/shared/components/create-boundary-component/providers/boundary-owner.provider.js.map +1 -0
- package/lib/commonjs/shared/components/create-transition-aware-component.js +37 -39
- package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +1 -1
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js +11 -9
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/index.js +8 -12
- package/lib/commonjs/shared/components/screen-container/index.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +11 -9
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/content.js +4 -4
- package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +4 -4
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/surface-container.js +4 -4
- package/lib/commonjs/shared/components/screen-container/layers/surface-container.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/index.js +3 -1
- package/lib/commonjs/shared/components/screen-lifecycle/index.js.map +1 -1
- package/lib/commonjs/shared/constants.js +18 -2
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/hooks/reanimated/use-animated-debounce.js +43 -0
- package/lib/commonjs/shared/hooks/reanimated/use-animated-debounce.js.map +1 -0
- package/lib/commonjs/shared/index.js +6 -0
- package/lib/commonjs/shared/index.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js +7 -0
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js +23 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +3 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/screen-composer.js +1 -1
- package/lib/commonjs/shared/providers/screen/screen-composer.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/build-resolved-style-map.js +144 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/build-resolved-style-map.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.js +28 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/split-normalized-style-maps.js +39 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/split-normalized-style-maps.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/index.js +25 -0
- package/lib/commonjs/shared/providers/screen/styles/index.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/{styles.provider.js → styles/styles.provider.js} +37 -39
- package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +1 -0
- package/lib/commonjs/shared/stores/animation.store.js +9 -3
- package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/registry.js +18 -2
- package/lib/commonjs/shared/stores/bounds/internals/registry.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js +7 -48
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js +10 -0
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js +6 -12
- package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js +21 -10
- package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/zoom/build.js +158 -52
- package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/zoom/config.js +3 -1
- package/lib/commonjs/shared/utils/bounds/zoom/config.js.map +1 -1
- package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js +27 -45
- package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
- package/lib/module/component-stack/navigators/create-component-stack-navigator.js +1 -1
- package/lib/module/shared/components/create-boundary-component/components/boundary-target.js +36 -0
- package/lib/module/shared/components/create-boundary-component/components/boundary-target.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/create-boundary-component.js +188 -0
- package/lib/module/shared/components/create-boundary-component/create-boundary-component.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +1 -1
- package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +51 -41
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +8 -26
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +86 -4
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-prepare-transition-measurement.js +62 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-prepare-transition-measurement.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/index.js +23 -215
- package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/providers/boundary-owner.provider.js +56 -0
- package/lib/module/shared/components/create-boundary-component/providers/boundary-owner.provider.js.map +1 -0
- package/lib/module/shared/components/create-transition-aware-component.js +39 -41
- package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/module/shared/components/overlay/variations/float-overlay.js +1 -1
- package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -1
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +11 -9
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
- package/lib/module/shared/components/screen-container/index.js +8 -12
- package/lib/module/shared/components/screen-container/index.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/backdrop.js +11 -9
- package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/content.js +4 -4
- package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +4 -4
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/surface-container.js +4 -4
- package/lib/module/shared/components/screen-container/layers/surface-container.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/index.js +3 -1
- package/lib/module/shared/components/screen-lifecycle/index.js.map +1 -1
- package/lib/module/shared/constants.js +17 -1
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/hooks/reanimated/use-animated-debounce.js +39 -0
- package/lib/module/shared/hooks/reanimated/use-animated-debounce.js.map +1 -0
- package/lib/module/shared/index.js +1 -1
- package/lib/module/shared/index.js.map +1 -1
- package/lib/module/shared/providers/gestures/handlers/use-handlers.js +7 -0
- package/lib/module/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js +23 -1
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +3 -0
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
- package/lib/module/shared/providers/screen/screen-composer.js +1 -1
- package/lib/module/shared/providers/screen/screen-composer.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/build-resolved-style-map.js +139 -0
- package/lib/module/shared/providers/screen/styles/helpers/build-resolved-style-map.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.js +23 -0
- package/lib/module/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/helpers/split-normalized-style-maps.js +34 -0
- package/lib/module/shared/providers/screen/styles/helpers/split-normalized-style-maps.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/index.js +4 -0
- package/lib/module/shared/providers/screen/styles/index.js.map +1 -0
- package/lib/module/shared/providers/screen/{styles.provider.js → styles/styles.provider.js} +38 -40
- package/lib/module/shared/providers/screen/styles/styles.provider.js.map +1 -0
- package/lib/module/shared/stores/animation.store.js +9 -3
- package/lib/module/shared/stores/animation.store.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/registry.js +18 -2
- package/lib/module/shared/stores/bounds/internals/registry.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/resolver.js +7 -48
- package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/module/shared/utils/animation/animate-to-progress.js +10 -0
- package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js +7 -13
- package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/style-composers.js +21 -10
- package/lib/module/shared/utils/bounds/helpers/style-composers.js.map +1 -1
- package/lib/module/shared/utils/bounds/zoom/build.js +159 -52
- package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/zoom/config.js +2 -0
- package/lib/module/shared/utils/bounds/zoom/config.js.map +1 -1
- package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts +9 -15
- package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
- package/lib/typescript/blank-stack/types.d.ts +6 -4
- package/lib/typescript/blank-stack/types.d.ts.map +1 -1
- package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +1 -1
- package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts +209 -0
- package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts +8 -0
- package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/helpers/resolve-pending-source-key.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts +16 -11
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-auto-source-measurement.d.ts +3 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-auto-source-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts +2 -9
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.d.ts +6 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-prepare-transition-measurement.d.ts +12 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-prepare-transition-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts +224 -14
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/providers/boundary-owner.provider.d.ts +35 -0
- package/lib/typescript/shared/components/create-boundary-component/providers/boundary-owner.provider.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts +1 -1
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts.map +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.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/index.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts +34 -0
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/reanimated/use-animated-debounce.d.ts +13 -0
- package/lib/typescript/shared/hooks/reanimated/use-animated-debounce.d.ts.map +1 -0
- package/lib/typescript/shared/index.d.ts +210 -3
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts +3 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +3 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/build-resolved-style-map.d.ts +11 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/build-resolved-style-map.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.d.ts +7 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/split-normalized-style-maps.d.ts +6 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/split-normalized-style-maps.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/index.d.ts +2 -0
- package/lib/typescript/shared/providers/screen/styles/index.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/{styles.provider.d.ts → styles/styles.provider.d.ts} +3 -5
- package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts.map +1 -0
- package/lib/typescript/shared/stores/animation.store.d.ts +5 -2
- package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/registry.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 +0 -2
- package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +14 -9
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/bounds.types.d.ts +34 -1
- package/lib/typescript/shared/types/bounds.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 +2 -4
- package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts +2 -1
- package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts +1 -11
- package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/config.d.ts +2 -0
- package/lib/typescript/shared/utils/bounds/zoom/config.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/blank-stack/navigators/create-blank-stack-navigator.tsx +37 -80
- package/src/blank-stack/types.ts +7 -4
- package/src/component-stack/navigators/create-component-stack-navigator.tsx +1 -1
- package/src/shared/components/create-boundary-component/components/boundary-target.tsx +47 -0
- package/src/shared/components/create-boundary-component/create-boundary-component.tsx +249 -0
- package/src/shared/components/create-boundary-component/helpers/resolve-pending-source-key.ts +5 -1
- package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +68 -59
- package/src/shared/components/create-boundary-component/hooks/use-auto-source-measurement.ts +19 -3
- package/src/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts +11 -44
- package/src/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts +165 -6
- package/src/shared/components/create-boundary-component/hooks/use-prepare-transition-measurement.ts +107 -0
- package/src/shared/components/create-boundary-component/index.tsx +23 -254
- package/src/shared/components/create-boundary-component/providers/boundary-owner.provider.tsx +109 -0
- package/src/shared/components/create-boundary-component/types.ts +1 -2
- package/src/shared/components/create-transition-aware-component.tsx +43 -52
- package/src/shared/components/overlay/variations/float-overlay.tsx +1 -1
- package/src/shared/components/screen-container/hooks/use-content-layout.ts +10 -17
- package/src/shared/components/screen-container/index.tsx +10 -13
- package/src/shared/components/screen-container/layers/backdrop.tsx +10 -13
- package/src/shared/components/screen-container/layers/content.tsx +4 -4
- package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +6 -4
- package/src/shared/components/screen-container/layers/surface-container.tsx +4 -4
- package/src/shared/components/screen-lifecycle/index.tsx +1 -4
- package/src/shared/constants.ts +12 -0
- package/src/shared/hooks/reanimated/use-animated-debounce.ts +56 -0
- package/src/shared/index.ts +1 -1
- package/src/shared/providers/gestures/handlers/use-handlers.ts +9 -0
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state.ts +27 -1
- package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +6 -0
- package/src/shared/providers/screen/screen-composer.tsx +1 -1
- package/src/shared/providers/screen/styles/helpers/build-resolved-style-map.ts +185 -0
- package/src/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.ts +31 -0
- package/src/shared/providers/screen/styles/helpers/split-normalized-style-maps.ts +44 -0
- package/src/shared/providers/screen/styles/index.tsx +5 -0
- package/src/shared/providers/screen/{styles.provider.tsx → styles/styles.provider.tsx} +54 -56
- package/src/shared/stores/animation.store.ts +11 -2
- package/src/shared/stores/bounds/internals/registry.ts +24 -3
- package/src/shared/stores/bounds/internals/resolver.ts +6 -75
- package/src/shared/stores/bounds/types.ts +0 -2
- package/src/shared/types/animation.types.ts +16 -10
- package/src/shared/types/bounds.types.ts +34 -1
- package/src/shared/types/index.ts +0 -1
- package/src/shared/types/screen.types.ts +2 -4
- package/src/shared/utils/animation/animate-to-progress.ts +11 -1
- package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +3 -12
- package/src/shared/utils/bounds/helpers/style-composers.ts +11 -0
- package/src/shared/utils/bounds/zoom/build.ts +228 -100
- package/src/shared/utils/bounds/zoom/config.ts +2 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +0 -54
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +0 -122
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +0 -72
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +0 -66
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +0 -57
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +0 -53
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js +0 -45
- package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js.map +0 -1
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js +0 -234
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js +0 -50
- package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/styles.provider.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +0 -49
- package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +0 -118
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +0 -67
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +0 -61
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +0 -52
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +0 -48
- package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +0 -1
- package/lib/module/shared/components/screen-container/deferred-visibility-host.js +0 -40
- package/lib/module/shared/components/screen-container/deferred-visibility-host.js.map +0 -1
- package/lib/module/shared/hooks/animation/use-associated-style.js +0 -229
- package/lib/module/shared/hooks/animation/use-associated-style.js.map +0 -1
- package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js +0 -44
- package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +0 -1
- package/lib/module/shared/providers/screen/styles.provider.js.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts +0 -11
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts +0 -17
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts +0 -11
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts +0 -10
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts +0 -12
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts +0 -10
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts +0 -14
- package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts.map +0 -1
- package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts +0 -32
- package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts +0 -14
- package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/styles.provider.d.ts.map +0 -1
- package/src/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.ts +0 -58
- package/src/shared/components/create-boundary-component/hooks/use-group-active-measurement.ts +0 -162
- package/src/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.ts +0 -82
- package/src/shared/components/create-boundary-component/hooks/use-initial-layout-handler.ts +0 -92
- package/src/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.ts +0 -86
- package/src/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.ts +0 -49
- package/src/shared/components/screen-container/deferred-visibility-host.tsx +0 -44
- package/src/shared/hooks/animation/use-associated-style.ts +0 -297
- package/src/shared/providers/screen/helpers/resolve-interpolated-style-output.ts +0 -61
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { measure } from "react-native-reanimated";
|
|
4
4
|
import useStableCallbackValue from "../../../hooks/use-stable-callback-value";
|
|
5
|
+
import { useLayoutAnchorContext } from "../../../providers/layout-anchor.provider";
|
|
5
6
|
import { BoundStore } from "../../../stores/bounds";
|
|
6
7
|
import { applyMeasuredBoundsWrites } from "../../../stores/bounds/helpers/apply-measured-bounds-writes";
|
|
7
8
|
import { resolvePendingSourceKey } from "../helpers/resolve-pending-source-key";
|
|
@@ -21,11 +22,10 @@ export const useBoundaryMeasureAndStore = params => {
|
|
|
21
22
|
ancestorKeys,
|
|
22
23
|
navigatorKey,
|
|
23
24
|
ancestorNavigatorKeys,
|
|
24
|
-
isAnimating,
|
|
25
25
|
preparedStyles,
|
|
26
|
-
|
|
27
|
-
layoutAnchor
|
|
26
|
+
measuredAnimatedRef
|
|
28
27
|
} = params;
|
|
28
|
+
const layoutAnchor = useLayoutAnchorContext();
|
|
29
29
|
return useStableCallbackValue(({
|
|
30
30
|
intent
|
|
31
31
|
} = {}) => {
|
|
@@ -34,39 +34,21 @@ export const useBoundaryMeasureAndStore = params => {
|
|
|
34
34
|
if (!enabled) return;
|
|
35
35
|
const intents = getMeasurementIntentFlags(intent);
|
|
36
36
|
const expectedSourceScreenKey = resolvePendingSourceKey(sharedBoundTag, preferredSourceScreenKey) || undefined;
|
|
37
|
-
if (intents.captureSource && isAnimating.get()) {
|
|
38
|
-
const existing = BoundStore.getSnapshot(sharedBoundTag, currentScreenKey);
|
|
39
|
-
if (existing) {
|
|
40
|
-
applyMeasuredBoundsWrites({
|
|
41
|
-
sharedBoundTag,
|
|
42
|
-
ancestorKeys,
|
|
43
|
-
navigatorKey,
|
|
44
|
-
ancestorNavigatorKeys,
|
|
45
|
-
currentScreenKey,
|
|
46
|
-
measured: existing.bounds,
|
|
47
|
-
preparedStyles,
|
|
48
|
-
shouldSetSource: true
|
|
49
|
-
});
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// No cached snapshot while animating.
|
|
54
|
-
// Fall through to a live measurement so rapid retargeting still
|
|
55
|
-
// captures a valid source link.
|
|
56
|
-
}
|
|
57
37
|
const hasPendingLink = expectedSourceScreenKey ? BoundStore.hasPendingLinkFromSource(sharedBoundTag, expectedSourceScreenKey) : BoundStore.hasPendingLink(sharedBoundTag);
|
|
38
|
+
const hasAttachableSourceLink = expectedSourceScreenKey ? BoundStore.hasSourceLink(sharedBoundTag, expectedSourceScreenKey) : false;
|
|
58
39
|
const hasSourceLink = BoundStore.hasSourceLink(sharedBoundTag, currentScreenKey);
|
|
59
40
|
const hasDestinationLink = BoundStore.hasDestinationLink(sharedBoundTag, currentScreenKey);
|
|
60
41
|
const writePlan = resolveMeasurementWritePlan({
|
|
61
42
|
intents,
|
|
62
43
|
hasPendingLink,
|
|
63
44
|
hasSourceLink,
|
|
64
|
-
hasDestinationLink
|
|
45
|
+
hasDestinationLink,
|
|
46
|
+
hasAttachableSourceLink
|
|
65
47
|
});
|
|
66
48
|
if (!writePlan.writesAny) {
|
|
67
49
|
return;
|
|
68
50
|
}
|
|
69
|
-
const measured = measure(
|
|
51
|
+
const measured = measure(measuredAnimatedRef);
|
|
70
52
|
if (!measured) return;
|
|
71
53
|
const correctedMeasured = layoutAnchor ? layoutAnchor.correctMeasurement(measured) : measured;
|
|
72
54
|
const destinationInViewport = !writePlan.wantsDestinationWrite || !layoutAnchor || !layoutAnchor.isMeasurementInViewport || layoutAnchor.isMeasurementInViewport(correctedMeasured);
|
|
@@ -75,7 +57,7 @@ export const useBoundaryMeasureAndStore = params => {
|
|
|
75
57
|
}
|
|
76
58
|
const existingSnapshot = BoundStore.getSnapshot(sharedBoundTag, currentScreenKey);
|
|
77
59
|
const hasSnapshotChanged = !existingSnapshot || !areMeasurementsEqual(existingSnapshot.bounds, correctedMeasured);
|
|
78
|
-
const shouldWriteSnapshot = hasSnapshotChanged
|
|
60
|
+
const shouldWriteSnapshot = hasSnapshotChanged;
|
|
79
61
|
applyMeasuredBoundsWrites({
|
|
80
62
|
sharedBoundTag,
|
|
81
63
|
currentScreenKey,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["measure","useStableCallbackValue","BoundStore","applyMeasuredBoundsWrites","resolvePendingSourceKey","getMeasurementIntentFlags","resolveMeasurementWritePlan","SNAPSHOT_EPSILON","areMeasurementsEqual","a","b","Math","abs","x","y","pageX","pageY","width","height","useBoundaryMeasureAndStore","params","enabled","sharedBoundTag","preferredSourceScreenKey","currentScreenKey","ancestorKeys","navigatorKey","ancestorNavigatorKeys","
|
|
1
|
+
{"version":3,"names":["measure","useStableCallbackValue","useLayoutAnchorContext","BoundStore","applyMeasuredBoundsWrites","resolvePendingSourceKey","getMeasurementIntentFlags","resolveMeasurementWritePlan","SNAPSHOT_EPSILON","areMeasurementsEqual","a","b","Math","abs","x","y","pageX","pageY","width","height","useBoundaryMeasureAndStore","params","enabled","sharedBoundTag","preferredSourceScreenKey","currentScreenKey","ancestorKeys","navigatorKey","ancestorNavigatorKeys","preparedStyles","measuredAnimatedRef","layoutAnchor","intent","intents","expectedSourceScreenKey","undefined","hasPendingLink","hasPendingLinkFromSource","hasAttachableSourceLink","hasSourceLink","hasDestinationLink","writePlan","writesAny","measured","correctedMeasured","correctMeasurement","destinationInViewport","wantsDestinationWrite","isMeasurementInViewport","captureSource","refreshSource","existingSnapshot","getSnapshot","hasSnapshotChanged","bounds","shouldWriteSnapshot","shouldRegisterSnapshot","shouldSetSource","shouldUpdateSource","shouldUpdateDestination","refreshDestination","shouldSetDestination","completeDestination"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts"],"mappings":";;AACA,SAGCA,OAAO,QAED,yBAAyB;AAChC,OAAOC,sBAAsB,MAAM,0CAA0C;AAC7E,SAASC,sBAAsB,QAAQ,2CAA2C;AAClF,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,yBAAyB,QAAQ,6DAA6D;AACvG,SAASC,uBAAuB,QAAQ,uCAAuC;AAE/E,SACCC,yBAAyB,EACzBC,2BAA2B,QACrB,6BAA6B;AAEpC,MAAMC,gBAAgB,GAAG,GAAG;AAE5B,MAAMC,oBAAoB,GAAGA,CAC5BC,CAAqB,EACrBC,CAAqB,KACR;EACb,SAAS;;EAET,OACCC,IAAI,CAACC,GAAG,CAACH,CAAC,CAACI,CAAC,GAAGH,CAAC,CAACG,CAAC,CAAC,IAAIN,gBAAgB,IACvCI,IAAI,CAACC,GAAG,CAACH,CAAC,CAACK,CAAC,GAAGJ,CAAC,CAACI,CAAC,CAAC,IAAIP,gBAAgB,IACvCI,IAAI,CAACC,GAAG,CAACH,CAAC,CAACM,KAAK,GAAGL,CAAC,CAACK,KAAK,CAAC,IAAIR,gBAAgB,IAC/CI,IAAI,CAACC,GAAG,CAACH,CAAC,CAACO,KAAK,GAAGN,CAAC,CAACM,KAAK,CAAC,IAAIT,gBAAgB,IAC/CI,IAAI,CAACC,GAAG,CAACH,CAAC,CAACQ,KAAK,GAAGP,CAAC,CAACO,KAAK,CAAC,IAAIV,gBAAgB,IAC/CI,IAAI,CAACC,GAAG,CAACH,CAAC,C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IAC7C,IAAI,CAACa,QAAQ,EAAE;IAEf,MAAMC,iBAAiB,GAAGb,YAAY,GACnCA,YAAY,CAACc,kBAAkB,CAACF,QAAQ,CAAC,GACzCA,QAAQ;IAEX,MAAMG,qBAAqB,GAC1B,CAACL,SAAS,CAACM,qBAAqB,IAChC,CAAChB,YAAY,IACb,CAACA,YAAY,CAACiB,uBAAuB,IACrCjB,YAAY,CAACiB,uBAAuB,CAACJ,iBAAiB,CAAC;IAExD,IACC,CAACE,qBAAqB,IACtB,CAACL,SAAS,CAACQ,aAAa,IACxB,CAACR,SAAS,CAACS,aAAa,EACvB;MACD;IACD;IAEA,MAAMC,gBAAgB,GAAGhD,UAAU,CAACiD,WAAW,CAC9C7B,cAAc,EACdE,gBACD,CAAC;IACD,MAAM4B,kBAAkB,GACvB,CAACF,gBAAgB,IACjB,CAAC1C,oBAAoB,CAAC0C,gBAAgB,CAACG,MAAM,EAAEV,iBAAiB,CAAC;IAClE,MAAMW,mBAAmB,GAAGF,kBAAkB;IAE9CjD,yBAAyB,CAAC;MACzBmB,cAAc;MACdE,gBAAgB;MAChBkB,QAAQ,EAAEC,iBAAiB;MAC3Bf,cAAc;MACdH,YAAY;MACZC,YAAY;MACZC,qBAAqB;MACrBM,uBAAuB;MACvBsB,sBAAsB,EAAED,mBAAmB;MAC3CE,eAAe,EAAEhB,SAAS,CAACQ,aAAa;MACxCS,kBAAkB,EAAEjB,SAAS,CAACS,aAAa,IAAIG,kBAAkB;MACjEM,uBAAuB,EACtBlB,SAAS,CAACmB,kBAAkB,IAC5Bd,qBAAqB,IACrBO,kBAAkB;MACnBQ,oBAAoB,EACnBpB,SAAS,CAACqB,mBAAmB,IAAIhB;IACnC,CAAC,CAAC;EACH,CACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,24 +1,65 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { useLayoutEffect } from "react";
|
|
4
|
+
import { runOnUI, useAnimatedReaction, useSharedValue } from "react-native-reanimated";
|
|
5
|
+
import { AnimationStore } from "../../../stores/animation.store";
|
|
4
6
|
import { BoundStore } from "../../../stores/bounds";
|
|
5
7
|
import { resolvePendingSourceKey } from "../helpers/resolve-pending-source-key";
|
|
6
|
-
import { resolvePendingDestinationCaptureSignal } from "./helpers/measurement-rules";
|
|
8
|
+
import { resolvePendingDestinationCaptureSignal, resolvePendingDestinationRetrySignal } from "./helpers/measurement-rules";
|
|
7
9
|
export const usePendingDestinationMeasurement = params => {
|
|
8
10
|
const {
|
|
9
11
|
sharedBoundTag,
|
|
10
12
|
enabled,
|
|
13
|
+
id,
|
|
14
|
+
group,
|
|
15
|
+
currentScreenKey,
|
|
11
16
|
expectedSourceScreenKey,
|
|
17
|
+
animating,
|
|
12
18
|
maybeMeasureAndStore
|
|
13
19
|
} = params;
|
|
20
|
+
const progress = AnimationStore.getValue(currentScreenKey, "progress");
|
|
21
|
+
const closing = AnimationStore.getValue(currentScreenKey, "closing");
|
|
22
|
+
const retryCount = useSharedValue(0);
|
|
23
|
+
const MAX_RETRIES = 4;
|
|
24
|
+
const RETRY_PROGRESS_BUCKETS = 8;
|
|
25
|
+
const RETRY_PROGRESS_MAX = 1.05;
|
|
26
|
+
useLayoutEffect(() => {
|
|
27
|
+
if (!enabled) return;
|
|
28
|
+
runOnUI(() => {
|
|
29
|
+
"worklet";
|
|
30
|
+
|
|
31
|
+
if (closing.get()) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const currentGroupActiveId = group ? BoundStore.getGroupActiveId(group) : null;
|
|
35
|
+
if (group && currentGroupActiveId !== String(id)) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const resolvedSourceKey = resolvePendingSourceKey(sharedBoundTag, expectedSourceScreenKey);
|
|
39
|
+
const hasAttachableSourceLink = resolvedSourceKey ? BoundStore.hasPendingLinkFromSource(sharedBoundTag, resolvedSourceKey) || BoundStore.hasSourceLink(sharedBoundTag, resolvedSourceKey) : false;
|
|
40
|
+
if (!hasAttachableSourceLink) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (BoundStore.hasDestinationLink(sharedBoundTag, currentScreenKey)) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
maybeMeasureAndStore({
|
|
47
|
+
intent: "complete-destination"
|
|
48
|
+
});
|
|
49
|
+
})();
|
|
50
|
+
}, [enabled, id, group, sharedBoundTag, currentScreenKey, expectedSourceScreenKey, closing, maybeMeasureAndStore]);
|
|
14
51
|
useAnimatedReaction(() => {
|
|
15
52
|
"worklet";
|
|
16
53
|
|
|
54
|
+
if (closing.get()) {
|
|
55
|
+
return 0;
|
|
56
|
+
}
|
|
17
57
|
const resolvedSourceKey = resolvePendingSourceKey(sharedBoundTag, expectedSourceScreenKey);
|
|
18
58
|
return resolvePendingDestinationCaptureSignal({
|
|
19
59
|
enabled,
|
|
20
60
|
resolvedSourceKey,
|
|
21
|
-
|
|
61
|
+
hasAttachableSourceLink: resolvedSourceKey ? BoundStore.hasPendingLinkFromSource(sharedBoundTag, resolvedSourceKey) || BoundStore.hasSourceLink(sharedBoundTag, resolvedSourceKey) : false,
|
|
62
|
+
hasDestinationLink: BoundStore.hasDestinationLink(sharedBoundTag, currentScreenKey)
|
|
22
63
|
});
|
|
23
64
|
}, (captureSignal, previousCaptureSignal) => {
|
|
24
65
|
"worklet";
|
|
@@ -27,9 +68,50 @@ export const usePendingDestinationMeasurement = params => {
|
|
|
27
68
|
if (!captureSignal || captureSignal === previousCaptureSignal) {
|
|
28
69
|
return;
|
|
29
70
|
}
|
|
71
|
+
const currentGroupActiveId = group ? BoundStore.getGroupActiveId(group) : null;
|
|
72
|
+
if (group && currentGroupActiveId !== String(id)) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
maybeMeasureAndStore({
|
|
76
|
+
intent: "complete-destination"
|
|
77
|
+
});
|
|
78
|
+
}, [enabled, id, group, sharedBoundTag, expectedSourceScreenKey, closing, maybeMeasureAndStore]);
|
|
79
|
+
useAnimatedReaction(() => {
|
|
80
|
+
"worklet";
|
|
81
|
+
|
|
82
|
+
if (closing.get()) {
|
|
83
|
+
return 0;
|
|
84
|
+
}
|
|
85
|
+
const resolvedSourceKey = resolvePendingSourceKey(sharedBoundTag, expectedSourceScreenKey);
|
|
86
|
+
return resolvePendingDestinationRetrySignal({
|
|
87
|
+
enabled,
|
|
88
|
+
retryCount: retryCount.get(),
|
|
89
|
+
maxRetries: MAX_RETRIES,
|
|
90
|
+
isAnimating: !!animating.get(),
|
|
91
|
+
hasDestinationLink: BoundStore.hasDestinationLink(sharedBoundTag, currentScreenKey),
|
|
92
|
+
progress: progress.get(),
|
|
93
|
+
retryProgressMax: RETRY_PROGRESS_MAX,
|
|
94
|
+
retryProgressBuckets: RETRY_PROGRESS_BUCKETS,
|
|
95
|
+
resolvedSourceKey,
|
|
96
|
+
hasAttachableSourceLink: resolvedSourceKey ? BoundStore.hasPendingLinkFromSource(sharedBoundTag, resolvedSourceKey) || BoundStore.hasSourceLink(sharedBoundTag, resolvedSourceKey) : false
|
|
97
|
+
});
|
|
98
|
+
}, captureSignal => {
|
|
99
|
+
"worklet";
|
|
100
|
+
|
|
101
|
+
if (!enabled) return;
|
|
102
|
+
if (!captureSignal) {
|
|
103
|
+
retryCount.set(0);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const currentGroupActiveId = group ? BoundStore.getGroupActiveId(group) : null;
|
|
107
|
+
if (group && currentGroupActiveId !== String(id)) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (retryCount.get() >= MAX_RETRIES) return;
|
|
111
|
+
retryCount.set(retryCount.get() + 1);
|
|
30
112
|
maybeMeasureAndStore({
|
|
31
113
|
intent: "complete-destination"
|
|
32
114
|
});
|
|
33
|
-
}, [enabled, sharedBoundTag, expectedSourceScreenKey, maybeMeasureAndStore]);
|
|
115
|
+
}, [enabled, id, group, sharedBoundTag, currentScreenKey, expectedSourceScreenKey, progress, animating, closing, maybeMeasureAndStore, retryCount]);
|
|
34
116
|
};
|
|
35
117
|
//# sourceMappingURL=use-pending-destination-measurement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useAnimatedReaction","BoundStore","resolvePendingSourceKey","resolvePendingDestinationCaptureSignal","usePendingDestinationMeasurement","params","sharedBoundTag","enabled","expectedSourceScreenKey","maybeMeasureAndStore","resolvedSourceKey","hasPendingLinkFromSource","captureSignal","previousCaptureSignal","
|
|
1
|
+
{"version":3,"names":["useLayoutEffect","runOnUI","useAnimatedReaction","useSharedValue","AnimationStore","BoundStore","resolvePendingSourceKey","resolvePendingDestinationCaptureSignal","resolvePendingDestinationRetrySignal","usePendingDestinationMeasurement","params","sharedBoundTag","enabled","id","group","currentScreenKey","expectedSourceScreenKey","animating","maybeMeasureAndStore","progress","getValue","closing","retryCount","MAX_RETRIES","RETRY_PROGRESS_BUCKETS","RETRY_PROGRESS_MAX","get","currentGroupActiveId","getGroupActiveId","String","resolvedSourceKey","hasAttachableSourceLink","hasPendingLinkFromSource","hasSourceLink","hasDestinationLink","intent","captureSignal","previousCaptureSignal","maxRetries","isAnimating","retryProgressMax","retryProgressBuckets","set"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts"],"mappings":";;AAAA,SAASA,eAAe,QAAQ,OAAO;AACvC,SACCC,OAAO,EAEPC,mBAAmB,EACnBC,cAAc,QACR,yBAAyB;AAChC,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,uBAAuB,QAAQ,uCAAuC;AAE/E,SACCC,sCAAsC,EACtCC,oCAAoC,QAC9B,6BAA6B;AAEpC,OAAO,MAAMC,gCAAgC,GAAIC,MAShD,IAAK;EACL,MAAM;IACLC,cAAc;IACdC,OAAO;IACPC,EAAE;IACFC,KAAK;IACLC,gBAAgB;IAChBC,uBAAuB;IACvBC,SAAS;IACTC;E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uBAAuB,EACvBG,QAAQ,EACRF,SAAS,EACTI,OAAO,EACPH,oBAAoB,EACpBI,UAAU,CAEZ,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useAnimatedReaction } from "react-native-reanimated";
|
|
4
|
+
import { AnimationStore } from "../../../stores/animation.store";
|
|
5
|
+
import { BoundStore } from "../../../stores/bounds";
|
|
6
|
+
import { GestureStore } from "../../../stores/gesture.store";
|
|
7
|
+
import { PREPARE_DESTINATION_MEASUREMENT_INTENT, resolvePrepareSourceMeasurementIntent } from "./helpers/measurement-rules";
|
|
8
|
+
export const usePrepareTransitionMeasurement = params => {
|
|
9
|
+
const {
|
|
10
|
+
enabled,
|
|
11
|
+
sharedBoundTag,
|
|
12
|
+
id,
|
|
13
|
+
group,
|
|
14
|
+
currentScreenKey,
|
|
15
|
+
nextScreenKey,
|
|
16
|
+
hasNextScreen,
|
|
17
|
+
maybeMeasureAndStore
|
|
18
|
+
} = params;
|
|
19
|
+
const currentWillAnimate = AnimationStore.getValue(currentScreenKey, "willAnimate");
|
|
20
|
+
const currentAnimating = AnimationStore.getValue(currentScreenKey, "animating");
|
|
21
|
+
const currentDragging = GestureStore.getValue(currentScreenKey, "dragging");
|
|
22
|
+
const nextWillAnimate = nextScreenKey ? AnimationStore.getValue(nextScreenKey, "willAnimate") : null;
|
|
23
|
+
const nextAnimating = nextScreenKey ? AnimationStore.getValue(nextScreenKey, "animating") : null;
|
|
24
|
+
const nextDragging = nextScreenKey ? GestureStore.getValue(nextScreenKey, "dragging") : null;
|
|
25
|
+
useAnimatedReaction(() => hasNextScreen ? nextWillAnimate?.get() ?? 0 : 0, (nextValue, previousValue) => {
|
|
26
|
+
"worklet";
|
|
27
|
+
|
|
28
|
+
if (!enabled || !hasNextScreen) return;
|
|
29
|
+
if (nextValue === 0 || nextValue === previousValue) return;
|
|
30
|
+
const currentGroupActiveId = group ? BoundStore.getGroupActiveId(group) : null;
|
|
31
|
+
if (group && currentGroupActiveId !== String(id)) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const shouldCancelMeasurement = !!nextAnimating?.get() && !!nextDragging?.get();
|
|
35
|
+
if (shouldCancelMeasurement) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const intent = resolvePrepareSourceMeasurementIntent({
|
|
39
|
+
hasSourceLink: BoundStore.hasSourceLink(sharedBoundTag, currentScreenKey)
|
|
40
|
+
});
|
|
41
|
+
if (!intent) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
maybeMeasureAndStore({
|
|
45
|
+
intent
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
useAnimatedReaction(() => !hasNextScreen ? currentWillAnimate.get() : 0, (nextValue, previousValue) => {
|
|
49
|
+
"worklet";
|
|
50
|
+
|
|
51
|
+
if (!enabled || hasNextScreen) return;
|
|
52
|
+
if (nextValue === 0 || nextValue === previousValue) return;
|
|
53
|
+
const currentGroupActiveId = group ? BoundStore.getGroupActiveId(group) : null;
|
|
54
|
+
if (group && currentGroupActiveId !== String(id)) return;
|
|
55
|
+
const shouldCancelMeasurement = !!currentAnimating.get() && !!currentDragging.get();
|
|
56
|
+
if (shouldCancelMeasurement) return;
|
|
57
|
+
maybeMeasureAndStore({
|
|
58
|
+
intent: PREPARE_DESTINATION_MEASUREMENT_INTENT
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=use-prepare-transition-measurement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useAnimatedReaction","AnimationStore","BoundStore","GestureStore","PREPARE_DESTINATION_MEASUREMENT_INTENT","resolvePrepareSourceMeasurementIntent","usePrepareTransitionMeasurement","params","enabled","sharedBoundTag","id","group","currentScreenKey","nextScreenKey","hasNextScreen","maybeMeasureAndStore","currentWillAnimate","getValue","currentAnimating","currentDragging","nextWillAnimate","nextAnimating","nextDragging","get","nextValue","previousValue","currentGroupActiveId","getGroupActiveId","String","shouldCancelMeasurement","intent","hasSourceLink"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/hooks/use-prepare-transition-measurement.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,YAAY,QAAQ,+BAA+B;AAE5D,SACCC,sCAAsC,EACtCC,qCAAqC,QAC/B,6BAA6B;AAEpC,OAAO,MAAMC,+BAA+B,GAAIC,MAS/C,IAAK;EACL,MAAM;IACLC,OAAO;IACPC,cAAc;IACdC,EAAE;IACFC,KAAK;IACLC,gBAAgB;IAChBC,aAAa;IACbC,aAAa;IACbC;EACD,CAAC,GAAGR,MAAM;EAEV,MAAMS,kBAAkB,GAAGf,cAAc,CAACgB,QAAQ,CACjDL,gBAAgB,EAChB,aACD,CAAC;EACD,MAAMM,gBAAgB,GAAGjB,cAAc,CAACgB,QAAQ,CAC/CL,gBAAgB,EAChB,WACD,CAAC;EACD,MAAMO,eAAe,GAAGhB,YAAY,CAACc,QAAQ,CAACL,gBAAgB,EAAE,UAAU,CAAC;EAC3E,MAAMQ,eAAe,GAAGP,aAAa,GAClCZ,cAAc,CAACgB,QAAQ,CAACJ,aAAa,EAAE,aAAa,CAAC,GACrD,IAAI;EACP,MAAMQ,aAAa,GAAGR,aAAa,GAChCZ,cAAc,CAACgB,QAAQ,CAACJ,aAAa,EAAE,WAAW,CAAC,GACnD,IAAI;EACP,MAAMS,YAAY,GAAGT,aAAa,GAC/BV,YAAY,CAACc,QAAQ,CAACJ,aAAa,EAAE,UAAU,CAAC,GAChD,IAAI;EAEPb,mBAAmB,CAClB,MAAOc,aAAa,GAAIM,eAAe,EAAEG,GAAG,CAAC,CAAC,IAAI,CAAC,GAAI,CAAE,EACzD,CAACC,SAAS,EAAEC,aAAa,KAAK;IAC7B,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AC,CAAC;IACpD,IAAIM,uBAAuB,EAAE;IAE7Bd,oBAAoB,CAAC;MACpBe,MAAM,EAAE1B;IACT,CAAC,CAAC;EACH,CACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,215 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { AnimationStore } from "../../stores/animation.store";
|
|
10
|
-
import { BoundStore } from "../../stores/bounds";
|
|
11
|
-
import { prepareStyleForBounds } from "../../utils/bounds/helpers/styles";
|
|
12
|
-
import { useAutoSourceMeasurement } from "./hooks/use-auto-source-measurement";
|
|
13
|
-
import { useBoundaryMeasureAndStore } from "./hooks/use-boundary-measure-and-store";
|
|
14
|
-
import { useBoundaryPresence } from "./hooks/use-boundary-presence";
|
|
15
|
-
import { useGroupActiveMeasurement } from "./hooks/use-group-active-measurement";
|
|
16
|
-
import { useGroupActiveSourceMeasurement } from "./hooks/use-group-active-source-measurement";
|
|
17
|
-
import { useInitialLayoutHandler } from "./hooks/use-initial-layout-handler";
|
|
18
|
-
import { usePendingDestinationMeasurement } from "./hooks/use-pending-destination-measurement";
|
|
19
|
-
import { usePendingDestinationRetryMeasurement } from "./hooks/use-pending-destination-retry-measurement";
|
|
20
|
-
import { useScrollSettledMeasurement } from "./hooks/use-scroll-settled-measurement";
|
|
21
|
-
import { buildBoundaryMatchKey } from "./utils/build-boundary-match-key";
|
|
22
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
-
const setGroupSelectionOnUI = (group, id) => {
|
|
24
|
-
"worklet";
|
|
25
|
-
|
|
26
|
-
BoundStore.setGroupActiveId(group, id);
|
|
27
|
-
};
|
|
28
|
-
export function createBoundaryComponent(Wrapped, options = {}) {
|
|
29
|
-
const {
|
|
30
|
-
alreadyAnimated = false
|
|
31
|
-
} = options;
|
|
32
|
-
const AnimatedComponent = alreadyAnimated ? Wrapped : Animated.createAnimatedComponent(Wrapped);
|
|
33
|
-
const Inner = /*#__PURE__*/forwardRef((props, _ref) => {
|
|
34
|
-
const {
|
|
35
|
-
enabled = true,
|
|
36
|
-
group,
|
|
37
|
-
id,
|
|
38
|
-
anchor,
|
|
39
|
-
scaleMode,
|
|
40
|
-
target,
|
|
41
|
-
method,
|
|
42
|
-
style,
|
|
43
|
-
onPress,
|
|
44
|
-
...rest
|
|
45
|
-
} = props;
|
|
46
|
-
const sharedBoundTag = buildBoundaryMatchKey({
|
|
47
|
-
group,
|
|
48
|
-
id
|
|
49
|
-
});
|
|
50
|
-
const animatedRef = useAnimatedRef();
|
|
51
|
-
const {
|
|
52
|
-
previousScreenKey: preferredSourceScreenKey,
|
|
53
|
-
currentScreenKey,
|
|
54
|
-
nextScreenKey,
|
|
55
|
-
ancestorKeys,
|
|
56
|
-
navigatorKey,
|
|
57
|
-
ancestorNavigatorKeys,
|
|
58
|
-
hasConfiguredInterpolator
|
|
59
|
-
} = useDescriptorDerivations();
|
|
60
|
-
const runtimeEnabled = enabled && hasConfiguredInterpolator;
|
|
61
|
-
const hasNextScreen = !!nextScreenKey;
|
|
62
|
-
const shouldUpdateDestination = !hasNextScreen;
|
|
63
|
-
const layoutAnchor = useLayoutAnchorContext();
|
|
64
|
-
const boundaryConfig = useMemo(() => {
|
|
65
|
-
if (anchor === undefined && scaleMode === undefined && target === undefined && method === undefined) {
|
|
66
|
-
return undefined;
|
|
67
|
-
}
|
|
68
|
-
return {
|
|
69
|
-
anchor,
|
|
70
|
-
scaleMode,
|
|
71
|
-
target,
|
|
72
|
-
method
|
|
73
|
-
};
|
|
74
|
-
}, [anchor, scaleMode, target, method]);
|
|
75
|
-
const isAnimating = AnimationStore.getValue(currentScreenKey, "animating");
|
|
76
|
-
const progress = AnimationStore.getValue(currentScreenKey, "progress");
|
|
77
|
-
const preparedStyles = useMemo(() => prepareStyleForBounds(style), [style]);
|
|
78
|
-
const {
|
|
79
|
-
associatedStyles
|
|
80
|
-
} = useAssociatedStyles({
|
|
81
|
-
id: sharedBoundTag,
|
|
82
|
-
resetTransformOnUnset: true
|
|
83
|
-
});
|
|
84
|
-
const maybeMeasureAndStore = useBoundaryMeasureAndStore({
|
|
85
|
-
enabled,
|
|
86
|
-
sharedBoundTag,
|
|
87
|
-
preferredSourceScreenKey,
|
|
88
|
-
currentScreenKey,
|
|
89
|
-
ancestorKeys,
|
|
90
|
-
navigatorKey,
|
|
91
|
-
ancestorNavigatorKeys,
|
|
92
|
-
isAnimating,
|
|
93
|
-
preparedStyles,
|
|
94
|
-
animatedRef,
|
|
95
|
-
layoutAnchor
|
|
96
|
-
});
|
|
97
|
-
const shouldRunDestinationEffects = runtimeEnabled && !hasNextScreen;
|
|
98
|
-
|
|
99
|
-
// Register/unregister this boundary in the presence map so source/destination
|
|
100
|
-
// matching can resolve across screens (including ancestor relationships).
|
|
101
|
-
useBoundaryPresence({
|
|
102
|
-
enabled: runtimeEnabled,
|
|
103
|
-
sharedBoundTag,
|
|
104
|
-
currentScreenKey,
|
|
105
|
-
ancestorKeys,
|
|
106
|
-
navigatorKey,
|
|
107
|
-
ancestorNavigatorKeys,
|
|
108
|
-
boundaryConfig
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
// On the source screen, capture source bounds when a matching destination
|
|
112
|
-
// appears on the next screen.
|
|
113
|
-
useAutoSourceMeasurement({
|
|
114
|
-
enabled: runtimeEnabled,
|
|
115
|
-
sharedBoundTag,
|
|
116
|
-
nextScreenKey,
|
|
117
|
-
maybeMeasureAndStore
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
// Primary destination capture: once a pending source link exists for this tag,
|
|
121
|
-
// measure destination bounds and complete the pair.
|
|
122
|
-
usePendingDestinationMeasurement({
|
|
123
|
-
sharedBoundTag,
|
|
124
|
-
enabled: shouldRunDestinationEffects,
|
|
125
|
-
expectedSourceScreenKey: preferredSourceScreenKey,
|
|
126
|
-
maybeMeasureAndStore
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
// Reliability fallback: retry destination capture during transition progress
|
|
130
|
-
// when the initial pending-destination attempt happens before layout is ready.
|
|
131
|
-
usePendingDestinationRetryMeasurement({
|
|
132
|
-
sharedBoundTag,
|
|
133
|
-
enabled: shouldRunDestinationEffects,
|
|
134
|
-
currentScreenKey,
|
|
135
|
-
expectedSourceScreenKey: preferredSourceScreenKey,
|
|
136
|
-
progress,
|
|
137
|
-
animating: isAnimating,
|
|
138
|
-
maybeMeasureAndStore
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
// Grouped boundaries (e.g. paged/detail UIs): re-measure when this boundary
|
|
142
|
-
// becomes the active member so destination bounds stay accurate.
|
|
143
|
-
useGroupActiveMeasurement({
|
|
144
|
-
enabled: runtimeEnabled,
|
|
145
|
-
group,
|
|
146
|
-
id,
|
|
147
|
-
currentScreenKey,
|
|
148
|
-
shouldUpdateDestination,
|
|
149
|
-
maybeMeasureAndStore
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
// Source-side grouped retargeting: when an unfocused/source boundary
|
|
153
|
-
// becomes the active member, refresh its snapshot and source link so
|
|
154
|
-
// close transitions do not use stale pre-scroll geometry.
|
|
155
|
-
useGroupActiveSourceMeasurement({
|
|
156
|
-
enabled: runtimeEnabled,
|
|
157
|
-
group,
|
|
158
|
-
id,
|
|
159
|
-
hasNextScreen,
|
|
160
|
-
isAnimating,
|
|
161
|
-
maybeMeasureAndStore
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
// While idle on source screens, re-measure after scroll settles so a later
|
|
165
|
-
// close transition starts from up-to-date source geometry.
|
|
166
|
-
useScrollSettledMeasurement({
|
|
167
|
-
enabled: runtimeEnabled,
|
|
168
|
-
group,
|
|
169
|
-
hasNextScreen,
|
|
170
|
-
isAnimating,
|
|
171
|
-
maybeMeasureAndStore
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
// Destination mount-time capture path: onLayout schedules a one-time UI-thread
|
|
175
|
-
// initial measurement when transitions are active.
|
|
176
|
-
useInitialLayoutHandler({
|
|
177
|
-
enabled: runtimeEnabled,
|
|
178
|
-
sharedBoundTag,
|
|
179
|
-
currentScreenKey,
|
|
180
|
-
ancestorKeys,
|
|
181
|
-
expectedSourceScreenKey: preferredSourceScreenKey,
|
|
182
|
-
maybeMeasureAndStore
|
|
183
|
-
});
|
|
184
|
-
const handlePress = useCallback((...args) => {
|
|
185
|
-
// Press path has priority: capture source before user onPress/navigation.
|
|
186
|
-
if (group) {
|
|
187
|
-
runOnUI(setGroupSelectionOnUI)(group, String(id));
|
|
188
|
-
}
|
|
189
|
-
runOnUI(maybeMeasureAndStore)({
|
|
190
|
-
intent: "capture-source"
|
|
191
|
-
});
|
|
192
|
-
if (typeof onPress === "function") {
|
|
193
|
-
onPress(...args);
|
|
194
|
-
}
|
|
195
|
-
}, [group, id, maybeMeasureAndStore, onPress]);
|
|
196
|
-
const resolvedOnPress = typeof onPress === "function" ? handlePress : undefined;
|
|
197
|
-
return /*#__PURE__*/_jsx(AnimatedComponent, {
|
|
198
|
-
...rest,
|
|
199
|
-
ref: animatedRef,
|
|
200
|
-
style: [style, enabled ? associatedStyles : undefined],
|
|
201
|
-
onPress: resolvedOnPress,
|
|
202
|
-
collapsable: false
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
return /*#__PURE__*/memo(Inner);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
// Pre-built boundary component variants
|
|
209
|
-
const BoundaryView = createBoundaryComponent(RNView);
|
|
3
|
+
import { Pressable, View } from "react-native";
|
|
4
|
+
import { BoundaryTarget } from "./components/boundary-target";
|
|
5
|
+
import { createBoundaryComponent } from "./create-boundary-component";
|
|
6
|
+
export { createBoundaryComponent };
|
|
7
|
+
const BoundaryView = createBoundaryComponent(View);
|
|
8
|
+
const BoundaryTrigger = createBoundaryComponent(Pressable);
|
|
210
9
|
BoundaryView.displayName = "Transition.Boundary.View";
|
|
211
|
-
|
|
212
|
-
|
|
10
|
+
BoundaryTrigger.displayName = "Transition.Boundary.Trigger";
|
|
11
|
+
BoundaryTarget.displayName = "Transition.Boundary.Target";
|
|
213
12
|
|
|
214
13
|
/**
|
|
215
14
|
* Shared-boundary components.
|
|
@@ -219,19 +18,28 @@ BoundaryPressable.displayName = "Transition.Boundary.Pressable";
|
|
|
219
18
|
* 2. Destination screen captures bounds for the same tag.
|
|
220
19
|
* 3. The link is updated as layout changes (group-active + scroll-settled paths).
|
|
221
20
|
*
|
|
222
|
-
*
|
|
223
|
-
* - When a boundary has `onPress` (typically `Boundary.
|
|
21
|
+
* Trigger behavior:
|
|
22
|
+
* - When a boundary has `onPress` (typically `Boundary.Trigger`), source
|
|
224
23
|
* measurement runs before the user callback. This gives navigation transitions
|
|
225
24
|
* fresh source geometry on the first frame.
|
|
226
25
|
*
|
|
227
26
|
* Use:
|
|
228
27
|
* - `Boundary.View` for passive/shared elements.
|
|
229
|
-
* - `Boundary.
|
|
28
|
+
* - `Boundary.Trigger` for tappable elements that start navigation.
|
|
29
|
+
* - `Boundary.Target` to measure a nested descendant instead of the owner.
|
|
230
30
|
*/
|
|
231
31
|
export const Boundary = {
|
|
232
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Passive boundary wrapper (no built-in press semantics).
|
|
34
|
+
*/
|
|
233
35
|
View: BoundaryView,
|
|
234
|
-
/**
|
|
235
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Pressable boundary wrapper with press-priority source capture.
|
|
38
|
+
*/
|
|
39
|
+
Trigger: BoundaryTrigger,
|
|
40
|
+
/**
|
|
41
|
+
* Optional nested measurement override inside a boundary owner.
|
|
42
|
+
*/
|
|
43
|
+
Target: BoundaryTarget
|
|
236
44
|
};
|
|
237
45
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Pressable","View","BoundaryTarget","createBoundaryComponent","BoundaryView","BoundaryTrigger","displayName","Boundary","Trigger","Target"],"sourceRoot":"../../../../../src","sources":["shared/components/create-boundary-component/index.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,IAAI,QAAQ,cAAc;AAC9C,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,uBAAuB,QAAQ,6BAA6B;AAErE,SAASA,uBAAuB;AAEhC,MAAMC,YAAY,GAAGD,uBAAuB,CAACF,IAAI,CAAC;AAClD,MAAMI,eAAe,GAAGF,uBAAuB,CAACH,SAAS,CAAC;AAC1DI,YAAY,CAACE,WAAW,GAAG,0BAA0B;AACrDD,eAAe,CAACC,WAAW,GAAG,6BAA6B;AAC3DJ,cAAc,CAACI,WAAW,GAAG,4BAA4B;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,QAAQ,GAAG;EACvB;AACD;AACA;EACCN,IAAI,EAAEG,YAAY;EAClB;AACD;AACA;EACCI,OAAO,EAAEH,eAAe;EACxB;AACD;AACA;EACCI,MAAM,EAAEP;AACT,CAAC","ignoreList":[]}
|
package/lib/module/shared/components/create-boundary-component/providers/boundary-owner.provider.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createContext, useCallback, useContext, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
const BoundaryOwnerContext = /*#__PURE__*/createContext(null);
|
|
6
|
+
const MULTIPLE_TARGETS_WARNING = "[react-native-screen-transitions] Multiple Boundary.Target elements were rendered under the same boundary owner. The first registered target will be measured.";
|
|
7
|
+
export const TARGET_OUTSIDE_OWNER_WARNING = "[react-native-screen-transitions] Boundary.Target must be rendered inside a Boundary owner (Boundary.View, Boundary.Trigger, or a component created by createBoundaryComponent).";
|
|
8
|
+
export const BoundaryOwnerProvider = props => {
|
|
9
|
+
const {
|
|
10
|
+
value,
|
|
11
|
+
children
|
|
12
|
+
} = props;
|
|
13
|
+
return /*#__PURE__*/_jsx(BoundaryOwnerContext.Provider, {
|
|
14
|
+
value: value,
|
|
15
|
+
children: children
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
export const useBoundaryOwnerContext = () => {
|
|
19
|
+
return useContext(BoundaryOwnerContext);
|
|
20
|
+
};
|
|
21
|
+
export const useBoundaryOwner = params => {
|
|
22
|
+
const {
|
|
23
|
+
ownerRef,
|
|
24
|
+
associatedTargetStyles
|
|
25
|
+
} = params;
|
|
26
|
+
const warnedAboutMultipleTargetsRef = useRef(false);
|
|
27
|
+
const [targetRefs, setTargetRefs] = useState([]);
|
|
28
|
+
const registerTargetRef = useCallback(targetRef => {
|
|
29
|
+
setTargetRefs(prev => {
|
|
30
|
+
if (prev.includes(targetRef)) {
|
|
31
|
+
return prev;
|
|
32
|
+
}
|
|
33
|
+
if (__DEV__ && prev.length > 0 && !warnedAboutMultipleTargetsRef.current) {
|
|
34
|
+
warnedAboutMultipleTargetsRef.current = true;
|
|
35
|
+
console.warn(MULTIPLE_TARGETS_WARNING);
|
|
36
|
+
}
|
|
37
|
+
return [...prev, targetRef];
|
|
38
|
+
});
|
|
39
|
+
}, []);
|
|
40
|
+
const unregisterTargetRef = useCallback(targetRef => {
|
|
41
|
+
setTargetRefs(prev => prev.filter(existingRef => existingRef !== targetRef));
|
|
42
|
+
}, []);
|
|
43
|
+
const contextValue = useMemo(() => ({
|
|
44
|
+
ownerRef,
|
|
45
|
+
registerTargetRef,
|
|
46
|
+
unregisterTargetRef,
|
|
47
|
+
activeTargetRef: targetRefs[0] ?? null,
|
|
48
|
+
associatedTargetStyles
|
|
49
|
+
}), [ownerRef, registerTargetRef, unregisterTargetRef, targetRefs, associatedTargetStyles]);
|
|
50
|
+
return {
|
|
51
|
+
contextValue,
|
|
52
|
+
hasActiveTarget: targetRefs.length > 0,
|
|
53
|
+
measuredRef: targetRefs[0] ?? ownerRef
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=boundary-owner.provider.js.map
|