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
|
@@ -10,7 +10,6 @@ export type MeasurementIntentFlags = {
|
|
|
10
10
|
completeDestination: boolean;
|
|
11
11
|
refreshSource: boolean;
|
|
12
12
|
refreshDestination: boolean;
|
|
13
|
-
snapshotOnly: boolean;
|
|
14
13
|
};
|
|
15
14
|
|
|
16
15
|
export type MeasurementWritePlan = {
|
|
@@ -18,7 +17,6 @@ export type MeasurementWritePlan = {
|
|
|
18
17
|
completeDestination: boolean;
|
|
19
18
|
refreshSource: boolean;
|
|
20
19
|
refreshDestination: boolean;
|
|
21
|
-
registerSnapshot: boolean;
|
|
22
20
|
writesAny: boolean;
|
|
23
21
|
wantsDestinationWrite: boolean;
|
|
24
22
|
};
|
|
@@ -37,7 +35,6 @@ export const getMeasurementIntentFlags = (
|
|
|
37
35
|
completeDestination: false,
|
|
38
36
|
refreshSource: false,
|
|
39
37
|
refreshDestination: false,
|
|
40
|
-
snapshotOnly: false,
|
|
41
38
|
};
|
|
42
39
|
|
|
43
40
|
if (!intent) {
|
|
@@ -60,9 +57,6 @@ export const getMeasurementIntentFlags = (
|
|
|
60
57
|
case "refresh-destination":
|
|
61
58
|
flags.refreshDestination = true;
|
|
62
59
|
break;
|
|
63
|
-
case "snapshot-only":
|
|
64
|
-
flags.snapshotOnly = true;
|
|
65
|
-
break;
|
|
66
60
|
}
|
|
67
61
|
}
|
|
68
62
|
|
|
@@ -74,68 +68,99 @@ export const resolveMeasurementWritePlan = (params: {
|
|
|
74
68
|
hasPendingLink: boolean;
|
|
75
69
|
hasSourceLink: boolean;
|
|
76
70
|
hasDestinationLink: boolean;
|
|
71
|
+
hasAttachableSourceLink: boolean;
|
|
77
72
|
}): MeasurementWritePlan => {
|
|
78
73
|
"worklet";
|
|
79
|
-
const {
|
|
74
|
+
const {
|
|
75
|
+
intents,
|
|
76
|
+
hasPendingLink,
|
|
77
|
+
hasSourceLink,
|
|
78
|
+
hasDestinationLink,
|
|
79
|
+
hasAttachableSourceLink,
|
|
80
|
+
} = params;
|
|
80
81
|
|
|
81
82
|
const captureSource = intents.captureSource;
|
|
82
|
-
const completeDestination =
|
|
83
|
+
const completeDestination =
|
|
84
|
+
intents.completeDestination && (hasPendingLink || hasAttachableSourceLink);
|
|
83
85
|
const refreshSource = intents.refreshSource && hasSourceLink;
|
|
84
86
|
const refreshDestination =
|
|
85
|
-
intents.refreshDestination &&
|
|
86
|
-
|
|
87
|
+
intents.refreshDestination &&
|
|
88
|
+
(hasDestinationLink || hasPendingLink || hasAttachableSourceLink);
|
|
87
89
|
const writesAny =
|
|
88
|
-
|
|
89
|
-
captureSource ||
|
|
90
|
-
completeDestination ||
|
|
91
|
-
refreshSource ||
|
|
92
|
-
refreshDestination;
|
|
90
|
+
captureSource || completeDestination || refreshSource || refreshDestination;
|
|
93
91
|
|
|
94
92
|
return {
|
|
95
93
|
captureSource,
|
|
96
94
|
completeDestination,
|
|
97
95
|
refreshSource,
|
|
98
96
|
refreshDestination,
|
|
99
|
-
registerSnapshot,
|
|
100
97
|
writesAny,
|
|
101
98
|
wantsDestinationWrite: completeDestination || refreshDestination,
|
|
102
99
|
};
|
|
103
100
|
};
|
|
104
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Temporarily removed destination-match gating for auto source capture.
|
|
104
|
+
*
|
|
105
|
+
* For now, any enabled boundary on a source screen will eagerly capture when a
|
|
106
|
+
* next screen exists, even if no matching destination boundary has registered
|
|
107
|
+
* presence yet. The previous behavior waited for an explicit destination match
|
|
108
|
+
* before allowing source capture.
|
|
109
|
+
*/
|
|
105
110
|
export const resolveAutoSourceCaptureSignal = (params: {
|
|
106
111
|
enabled: boolean;
|
|
107
112
|
nextScreenKey?: string;
|
|
108
113
|
tagPresence?: Record<string, PresenceLikeEntry>;
|
|
109
114
|
}): string | 0 => {
|
|
110
115
|
"worklet";
|
|
111
|
-
const { enabled, nextScreenKey
|
|
116
|
+
const { enabled, nextScreenKey } = params;
|
|
112
117
|
if (!enabled) return 0;
|
|
113
118
|
if (!nextScreenKey) return 0;
|
|
114
|
-
if (!tagPresence) return 0;
|
|
115
|
-
|
|
116
|
-
const direct = tagPresence[nextScreenKey];
|
|
117
|
-
if (direct && direct.count > 0) return nextScreenKey;
|
|
118
119
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
/**
|
|
121
|
+
* Temporarily removed destination-match gating for auto source capture.
|
|
122
|
+
*
|
|
123
|
+
* For now, any enabled boundary on a source screen will eagerly capture when
|
|
124
|
+
* a next screen exists, even if no matching destination boundary has
|
|
125
|
+
* registered presence yet. The previous behavior waited for an explicit
|
|
126
|
+
* destination match before allowing source capture.
|
|
127
|
+
*/
|
|
128
|
+
// const tagPresence = params.tagPresence;
|
|
129
|
+
// if (!tagPresence) return 0;
|
|
130
|
+
//
|
|
131
|
+
// const direct = tagPresence[nextScreenKey];
|
|
132
|
+
// if (direct && direct.count > 0) return nextScreenKey;
|
|
133
|
+
//
|
|
134
|
+
// for (const screenKey in tagPresence) {
|
|
135
|
+
// const entry = tagPresence[screenKey];
|
|
136
|
+
// if (entry.ancestorKeys?.includes(nextScreenKey)) {
|
|
137
|
+
// return nextScreenKey;
|
|
138
|
+
// }
|
|
139
|
+
// }
|
|
140
|
+
//
|
|
141
|
+
// return 0;
|
|
125
142
|
|
|
126
|
-
return
|
|
143
|
+
return nextScreenKey;
|
|
127
144
|
};
|
|
128
145
|
|
|
129
146
|
export const resolvePendingDestinationCaptureSignal = (params: {
|
|
130
147
|
enabled: boolean;
|
|
131
148
|
resolvedSourceKey?: string | null;
|
|
132
|
-
|
|
149
|
+
hasAttachableSourceLink: boolean;
|
|
150
|
+
hasDestinationLink: boolean;
|
|
133
151
|
}): string | 0 => {
|
|
134
152
|
"worklet";
|
|
135
|
-
const {
|
|
153
|
+
const {
|
|
154
|
+
enabled,
|
|
155
|
+
resolvedSourceKey,
|
|
156
|
+
hasAttachableSourceLink,
|
|
157
|
+
hasDestinationLink,
|
|
158
|
+
} = params;
|
|
136
159
|
if (!enabled) return 0;
|
|
137
160
|
if (!resolvedSourceKey) return 0;
|
|
138
|
-
|
|
161
|
+
if (!hasAttachableSourceLink) return 0;
|
|
162
|
+
if (hasDestinationLink) return 0;
|
|
163
|
+
return resolvedSourceKey;
|
|
139
164
|
};
|
|
140
165
|
|
|
141
166
|
export const resolvePendingDestinationRetrySignal = (params: {
|
|
@@ -148,7 +173,7 @@ export const resolvePendingDestinationRetrySignal = (params: {
|
|
|
148
173
|
retryProgressMax: number;
|
|
149
174
|
retryProgressBuckets: number;
|
|
150
175
|
resolvedSourceKey?: string | null;
|
|
151
|
-
|
|
176
|
+
hasAttachableSourceLink: boolean;
|
|
152
177
|
}): number => {
|
|
153
178
|
"worklet";
|
|
154
179
|
const {
|
|
@@ -161,7 +186,7 @@ export const resolvePendingDestinationRetrySignal = (params: {
|
|
|
161
186
|
retryProgressMax,
|
|
162
187
|
retryProgressBuckets,
|
|
163
188
|
resolvedSourceKey,
|
|
164
|
-
|
|
189
|
+
hasAttachableSourceLink,
|
|
165
190
|
} = params;
|
|
166
191
|
|
|
167
192
|
if (!enabled) return 0;
|
|
@@ -170,39 +195,23 @@ export const resolvePendingDestinationRetrySignal = (params: {
|
|
|
170
195
|
if (hasDestinationLink) return 0;
|
|
171
196
|
if (progress <= 0 || progress >= retryProgressMax) return 0;
|
|
172
197
|
if (!resolvedSourceKey) return 0;
|
|
173
|
-
if (!
|
|
198
|
+
if (!hasAttachableSourceLink) return 0;
|
|
174
199
|
|
|
175
200
|
return Math.floor(progress * retryProgressBuckets) + 1;
|
|
176
201
|
};
|
|
177
202
|
|
|
178
|
-
export const
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
hasMeasuredOnLayout: boolean;
|
|
182
|
-
isAnyAnimating: boolean;
|
|
183
|
-
hasPendingLinkFromSource: boolean;
|
|
184
|
-
}): MeasurementIntent | readonly MeasurementIntent[] | null => {
|
|
203
|
+
export const resolvePrepareSourceMeasurementIntent = (params: {
|
|
204
|
+
hasSourceLink: boolean;
|
|
205
|
+
}): MeasurementIntent | null => {
|
|
185
206
|
"worklet";
|
|
186
|
-
|
|
187
|
-
enabled,
|
|
188
|
-
hasSharedBoundTag,
|
|
189
|
-
hasMeasuredOnLayout,
|
|
190
|
-
isAnyAnimating,
|
|
191
|
-
hasPendingLinkFromSource,
|
|
192
|
-
} = params;
|
|
193
|
-
|
|
194
|
-
if (!enabled) return null;
|
|
195
|
-
if (!hasSharedBoundTag || hasMeasuredOnLayout) return null;
|
|
196
|
-
|
|
197
|
-
if (!isAnyAnimating) {
|
|
198
|
-
return "snapshot-only";
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
return hasPendingLinkFromSource
|
|
202
|
-
? ["snapshot-only", "complete-destination"]
|
|
203
|
-
: "snapshot-only";
|
|
207
|
+
return params.hasSourceLink ? null : "capture-source";
|
|
204
208
|
};
|
|
205
209
|
|
|
210
|
+
export const PREPARE_DESTINATION_MEASUREMENT_INTENT = [
|
|
211
|
+
"complete-destination",
|
|
212
|
+
"refresh-destination",
|
|
213
|
+
] as const satisfies readonly MeasurementIntent[];
|
|
214
|
+
|
|
206
215
|
export const resolveGroupActiveMeasurementAction = (params: {
|
|
207
216
|
enabled: boolean;
|
|
208
217
|
isEligible: boolean;
|
package/src/shared/components/create-boundary-component/hooks/use-auto-source-measurement.ts
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import { useAnimatedReaction } from "react-native-reanimated";
|
|
2
2
|
import { BoundStore } from "../../../stores/bounds";
|
|
3
|
-
import type { MaybeMeasureAndStoreParams } from "../types";
|
|
3
|
+
import type { BoundaryId, MaybeMeasureAndStoreParams } from "../types";
|
|
4
4
|
import { resolveAutoSourceCaptureSignal } from "./helpers/measurement-rules";
|
|
5
5
|
|
|
6
6
|
export const useAutoSourceMeasurement = (params: {
|
|
7
7
|
enabled: boolean;
|
|
8
8
|
sharedBoundTag: string;
|
|
9
|
+
id: BoundaryId;
|
|
10
|
+
group?: string;
|
|
9
11
|
nextScreenKey?: string;
|
|
10
12
|
maybeMeasureAndStore: (options: MaybeMeasureAndStoreParams) => void;
|
|
11
13
|
}) => {
|
|
12
|
-
const {
|
|
13
|
-
|
|
14
|
+
const {
|
|
15
|
+
enabled,
|
|
16
|
+
sharedBoundTag,
|
|
17
|
+
id,
|
|
18
|
+
group,
|
|
19
|
+
nextScreenKey,
|
|
20
|
+
maybeMeasureAndStore,
|
|
21
|
+
} = params;
|
|
14
22
|
const boundaryPresence = BoundStore.getBoundaryPresence();
|
|
15
23
|
|
|
16
24
|
useAnimatedReaction(
|
|
@@ -27,10 +35,18 @@ export const useAutoSourceMeasurement = (params: {
|
|
|
27
35
|
if (!enabled) return;
|
|
28
36
|
if (!nextScreenKey) return;
|
|
29
37
|
if (!captureSignal || captureSignal === previousCaptureSignal) return;
|
|
38
|
+
const currentGroupActiveId = group
|
|
39
|
+
? BoundStore.getGroupActiveId(group)
|
|
40
|
+
: null;
|
|
41
|
+
if (group && currentGroupActiveId !== String(id)) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
30
44
|
maybeMeasureAndStore({ intent: "capture-source" });
|
|
31
45
|
},
|
|
32
46
|
[
|
|
33
47
|
enabled,
|
|
48
|
+
id,
|
|
49
|
+
group,
|
|
34
50
|
nextScreenKey,
|
|
35
51
|
sharedBoundTag,
|
|
36
52
|
boundaryPresence,
|
package/src/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts
CHANGED
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
type AnimatedRef,
|
|
4
4
|
type MeasuredDimensions,
|
|
5
5
|
measure,
|
|
6
|
-
type SharedValue,
|
|
7
6
|
type StyleProps,
|
|
8
7
|
} from "react-native-reanimated";
|
|
9
8
|
import useStableCallbackValue from "../../../hooks/use-stable-callback-value";
|
|
9
|
+
import { useLayoutAnchorContext } from "../../../providers/layout-anchor.provider";
|
|
10
10
|
import { BoundStore } from "../../../stores/bounds";
|
|
11
11
|
import { applyMeasuredBoundsWrites } from "../../../stores/bounds/helpers/apply-measured-bounds-writes";
|
|
12
12
|
import { resolvePendingSourceKey } from "../helpers/resolve-pending-source-key";
|
|
@@ -16,11 +16,6 @@ import {
|
|
|
16
16
|
resolveMeasurementWritePlan,
|
|
17
17
|
} from "./helpers/measurement-rules";
|
|
18
18
|
|
|
19
|
-
type LayoutAnchor = {
|
|
20
|
-
correctMeasurement: (measured: MeasuredDimensions) => MeasuredDimensions;
|
|
21
|
-
isMeasurementInViewport?: (measured: MeasuredDimensions) => boolean;
|
|
22
|
-
} | null;
|
|
23
|
-
|
|
24
19
|
const SNAPSHOT_EPSILON = 0.5;
|
|
25
20
|
|
|
26
21
|
const areMeasurementsEqual = (
|
|
@@ -47,10 +42,8 @@ export const useBoundaryMeasureAndStore = (params: {
|
|
|
47
42
|
ancestorKeys: string[];
|
|
48
43
|
navigatorKey?: string;
|
|
49
44
|
ancestorNavigatorKeys?: string[];
|
|
50
|
-
isAnimating: SharedValue<number>;
|
|
51
45
|
preparedStyles: StyleProps;
|
|
52
|
-
|
|
53
|
-
layoutAnchor: LayoutAnchor;
|
|
46
|
+
measuredAnimatedRef: AnimatedRef<View>;
|
|
54
47
|
}) => {
|
|
55
48
|
const {
|
|
56
49
|
enabled,
|
|
@@ -60,12 +53,12 @@ export const useBoundaryMeasureAndStore = (params: {
|
|
|
60
53
|
ancestorKeys,
|
|
61
54
|
navigatorKey,
|
|
62
55
|
ancestorNavigatorKeys,
|
|
63
|
-
isAnimating,
|
|
64
56
|
preparedStyles,
|
|
65
|
-
|
|
66
|
-
layoutAnchor,
|
|
57
|
+
measuredAnimatedRef,
|
|
67
58
|
} = params;
|
|
68
59
|
|
|
60
|
+
const layoutAnchor = useLayoutAnchorContext();
|
|
61
|
+
|
|
69
62
|
return useStableCallbackValue(
|
|
70
63
|
({ intent }: MaybeMeasureAndStoreParams = {}) => {
|
|
71
64
|
"worklet";
|
|
@@ -77,36 +70,15 @@ export const useBoundaryMeasureAndStore = (params: {
|
|
|
77
70
|
resolvePendingSourceKey(sharedBoundTag, preferredSourceScreenKey) ||
|
|
78
71
|
undefined;
|
|
79
72
|
|
|
80
|
-
if (intents.captureSource && isAnimating.get()) {
|
|
81
|
-
const existing = BoundStore.getSnapshot(
|
|
82
|
-
sharedBoundTag,
|
|
83
|
-
currentScreenKey,
|
|
84
|
-
);
|
|
85
|
-
if (existing) {
|
|
86
|
-
applyMeasuredBoundsWrites({
|
|
87
|
-
sharedBoundTag,
|
|
88
|
-
ancestorKeys,
|
|
89
|
-
navigatorKey,
|
|
90
|
-
ancestorNavigatorKeys,
|
|
91
|
-
currentScreenKey,
|
|
92
|
-
measured: existing.bounds,
|
|
93
|
-
preparedStyles,
|
|
94
|
-
shouldSetSource: true,
|
|
95
|
-
});
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// No cached snapshot while animating.
|
|
100
|
-
// Fall through to a live measurement so rapid retargeting still
|
|
101
|
-
// captures a valid source link.
|
|
102
|
-
}
|
|
103
|
-
|
|
104
73
|
const hasPendingLink = expectedSourceScreenKey
|
|
105
74
|
? BoundStore.hasPendingLinkFromSource(
|
|
106
75
|
sharedBoundTag,
|
|
107
76
|
expectedSourceScreenKey,
|
|
108
77
|
)
|
|
109
78
|
: BoundStore.hasPendingLink(sharedBoundTag);
|
|
79
|
+
const hasAttachableSourceLink = expectedSourceScreenKey
|
|
80
|
+
? BoundStore.hasSourceLink(sharedBoundTag, expectedSourceScreenKey)
|
|
81
|
+
: false;
|
|
110
82
|
const hasSourceLink = BoundStore.hasSourceLink(
|
|
111
83
|
sharedBoundTag,
|
|
112
84
|
currentScreenKey,
|
|
@@ -121,13 +93,14 @@ export const useBoundaryMeasureAndStore = (params: {
|
|
|
121
93
|
hasPendingLink,
|
|
122
94
|
hasSourceLink,
|
|
123
95
|
hasDestinationLink,
|
|
96
|
+
hasAttachableSourceLink,
|
|
124
97
|
});
|
|
125
98
|
|
|
126
99
|
if (!writePlan.writesAny) {
|
|
127
100
|
return;
|
|
128
101
|
}
|
|
129
102
|
|
|
130
|
-
const measured = measure(
|
|
103
|
+
const measured = measure(measuredAnimatedRef);
|
|
131
104
|
if (!measured) return;
|
|
132
105
|
|
|
133
106
|
const correctedMeasured = layoutAnchor
|
|
@@ -155,13 +128,7 @@ export const useBoundaryMeasureAndStore = (params: {
|
|
|
155
128
|
const hasSnapshotChanged =
|
|
156
129
|
!existingSnapshot ||
|
|
157
130
|
!areMeasurementsEqual(existingSnapshot.bounds, correctedMeasured);
|
|
158
|
-
const shouldWriteSnapshot =
|
|
159
|
-
hasSnapshotChanged &&
|
|
160
|
-
(writePlan.registerSnapshot ||
|
|
161
|
-
writePlan.captureSource ||
|
|
162
|
-
writePlan.completeDestination ||
|
|
163
|
-
writePlan.refreshSource ||
|
|
164
|
-
writePlan.refreshDestination);
|
|
131
|
+
const shouldWriteSnapshot = hasSnapshotChanged;
|
|
165
132
|
|
|
166
133
|
applyMeasuredBoundsWrites({
|
|
167
134
|
sharedBoundTag,
|
package/src/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts
CHANGED
|
@@ -1,25 +1,102 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useLayoutEffect } from "react";
|
|
2
|
+
import {
|
|
3
|
+
runOnUI,
|
|
4
|
+
type SharedValue,
|
|
5
|
+
useAnimatedReaction,
|
|
6
|
+
useSharedValue,
|
|
7
|
+
} from "react-native-reanimated";
|
|
8
|
+
import { AnimationStore } from "../../../stores/animation.store";
|
|
2
9
|
import { BoundStore } from "../../../stores/bounds";
|
|
3
10
|
import { resolvePendingSourceKey } from "../helpers/resolve-pending-source-key";
|
|
4
|
-
import type { MaybeMeasureAndStoreParams } from "../types";
|
|
5
|
-
import {
|
|
11
|
+
import type { BoundaryId, MaybeMeasureAndStoreParams } from "../types";
|
|
12
|
+
import {
|
|
13
|
+
resolvePendingDestinationCaptureSignal,
|
|
14
|
+
resolvePendingDestinationRetrySignal,
|
|
15
|
+
} from "./helpers/measurement-rules";
|
|
6
16
|
|
|
7
17
|
export const usePendingDestinationMeasurement = (params: {
|
|
8
18
|
sharedBoundTag: string;
|
|
9
19
|
enabled: boolean;
|
|
20
|
+
id: BoundaryId;
|
|
21
|
+
group?: string;
|
|
22
|
+
currentScreenKey: string;
|
|
10
23
|
expectedSourceScreenKey?: string;
|
|
24
|
+
animating: SharedValue<number>;
|
|
11
25
|
maybeMeasureAndStore: (options: MaybeMeasureAndStoreParams) => void;
|
|
12
26
|
}) => {
|
|
13
27
|
const {
|
|
14
28
|
sharedBoundTag,
|
|
15
29
|
enabled,
|
|
30
|
+
id,
|
|
31
|
+
group,
|
|
32
|
+
currentScreenKey,
|
|
16
33
|
expectedSourceScreenKey,
|
|
34
|
+
animating,
|
|
17
35
|
maybeMeasureAndStore,
|
|
18
36
|
} = params;
|
|
19
37
|
|
|
38
|
+
const progress = AnimationStore.getValue(currentScreenKey, "progress");
|
|
39
|
+
const closing = AnimationStore.getValue(currentScreenKey, "closing");
|
|
40
|
+
|
|
41
|
+
const retryCount = useSharedValue(0);
|
|
42
|
+
const MAX_RETRIES = 4;
|
|
43
|
+
const RETRY_PROGRESS_BUCKETS = 8;
|
|
44
|
+
const RETRY_PROGRESS_MAX = 1.05;
|
|
45
|
+
|
|
46
|
+
useLayoutEffect(() => {
|
|
47
|
+
if (!enabled) return;
|
|
48
|
+
|
|
49
|
+
runOnUI(() => {
|
|
50
|
+
"worklet";
|
|
51
|
+
if (closing.get()) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const currentGroupActiveId = group
|
|
56
|
+
? BoundStore.getGroupActiveId(group)
|
|
57
|
+
: null;
|
|
58
|
+
if (group && currentGroupActiveId !== String(id)) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const resolvedSourceKey = resolvePendingSourceKey(
|
|
63
|
+
sharedBoundTag,
|
|
64
|
+
expectedSourceScreenKey,
|
|
65
|
+
);
|
|
66
|
+
const hasAttachableSourceLink = resolvedSourceKey
|
|
67
|
+
? BoundStore.hasPendingLinkFromSource(
|
|
68
|
+
sharedBoundTag,
|
|
69
|
+
resolvedSourceKey,
|
|
70
|
+
) || BoundStore.hasSourceLink(sharedBoundTag, resolvedSourceKey)
|
|
71
|
+
: false;
|
|
72
|
+
|
|
73
|
+
if (!hasAttachableSourceLink) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (BoundStore.hasDestinationLink(sharedBoundTag, currentScreenKey)) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
maybeMeasureAndStore({ intent: "complete-destination" });
|
|
82
|
+
})();
|
|
83
|
+
}, [
|
|
84
|
+
enabled,
|
|
85
|
+
id,
|
|
86
|
+
group,
|
|
87
|
+
sharedBoundTag,
|
|
88
|
+
currentScreenKey,
|
|
89
|
+
expectedSourceScreenKey,
|
|
90
|
+
closing,
|
|
91
|
+
maybeMeasureAndStore,
|
|
92
|
+
]);
|
|
93
|
+
|
|
20
94
|
useAnimatedReaction(
|
|
21
95
|
() => {
|
|
22
96
|
"worklet";
|
|
97
|
+
if (closing.get()) {
|
|
98
|
+
return 0;
|
|
99
|
+
}
|
|
23
100
|
const resolvedSourceKey = resolvePendingSourceKey(
|
|
24
101
|
sharedBoundTag,
|
|
25
102
|
expectedSourceScreenKey,
|
|
@@ -27,12 +104,16 @@ export const usePendingDestinationMeasurement = (params: {
|
|
|
27
104
|
return resolvePendingDestinationCaptureSignal({
|
|
28
105
|
enabled,
|
|
29
106
|
resolvedSourceKey,
|
|
30
|
-
|
|
107
|
+
hasAttachableSourceLink: resolvedSourceKey
|
|
31
108
|
? BoundStore.hasPendingLinkFromSource(
|
|
32
109
|
sharedBoundTag,
|
|
33
110
|
resolvedSourceKey,
|
|
34
|
-
)
|
|
111
|
+
) || BoundStore.hasSourceLink(sharedBoundTag, resolvedSourceKey)
|
|
35
112
|
: false,
|
|
113
|
+
hasDestinationLink: BoundStore.hasDestinationLink(
|
|
114
|
+
sharedBoundTag,
|
|
115
|
+
currentScreenKey,
|
|
116
|
+
),
|
|
36
117
|
});
|
|
37
118
|
},
|
|
38
119
|
(captureSignal, previousCaptureSignal) => {
|
|
@@ -41,9 +122,87 @@ export const usePendingDestinationMeasurement = (params: {
|
|
|
41
122
|
if (!captureSignal || captureSignal === previousCaptureSignal) {
|
|
42
123
|
return;
|
|
43
124
|
}
|
|
125
|
+
const currentGroupActiveId = group
|
|
126
|
+
? BoundStore.getGroupActiveId(group)
|
|
127
|
+
: null;
|
|
128
|
+
if (group && currentGroupActiveId !== String(id)) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
maybeMeasureAndStore({ intent: "complete-destination" });
|
|
133
|
+
},
|
|
134
|
+
[
|
|
135
|
+
enabled,
|
|
136
|
+
id,
|
|
137
|
+
group,
|
|
138
|
+
sharedBoundTag,
|
|
139
|
+
expectedSourceScreenKey,
|
|
140
|
+
closing,
|
|
141
|
+
maybeMeasureAndStore,
|
|
142
|
+
],
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
useAnimatedReaction(
|
|
146
|
+
() => {
|
|
147
|
+
"worklet";
|
|
148
|
+
if (closing.get()) {
|
|
149
|
+
return 0;
|
|
150
|
+
}
|
|
151
|
+
const resolvedSourceKey = resolvePendingSourceKey(
|
|
152
|
+
sharedBoundTag,
|
|
153
|
+
expectedSourceScreenKey,
|
|
154
|
+
);
|
|
155
|
+
return resolvePendingDestinationRetrySignal({
|
|
156
|
+
enabled,
|
|
157
|
+
retryCount: retryCount.get(),
|
|
158
|
+
maxRetries: MAX_RETRIES,
|
|
159
|
+
isAnimating: !!animating.get(),
|
|
160
|
+
hasDestinationLink: BoundStore.hasDestinationLink(
|
|
161
|
+
sharedBoundTag,
|
|
162
|
+
currentScreenKey,
|
|
163
|
+
),
|
|
164
|
+
progress: progress.get(),
|
|
165
|
+
retryProgressMax: RETRY_PROGRESS_MAX,
|
|
166
|
+
retryProgressBuckets: RETRY_PROGRESS_BUCKETS,
|
|
167
|
+
resolvedSourceKey,
|
|
168
|
+
hasAttachableSourceLink: resolvedSourceKey
|
|
169
|
+
? BoundStore.hasPendingLinkFromSource(
|
|
170
|
+
sharedBoundTag,
|
|
171
|
+
resolvedSourceKey,
|
|
172
|
+
) || BoundStore.hasSourceLink(sharedBoundTag, resolvedSourceKey)
|
|
173
|
+
: false,
|
|
174
|
+
});
|
|
175
|
+
},
|
|
176
|
+
(captureSignal) => {
|
|
177
|
+
"worklet";
|
|
178
|
+
if (!enabled) return;
|
|
179
|
+
if (!captureSignal) {
|
|
180
|
+
retryCount.set(0);
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
const currentGroupActiveId = group
|
|
184
|
+
? BoundStore.getGroupActiveId(group)
|
|
185
|
+
: null;
|
|
186
|
+
if (group && currentGroupActiveId !== String(id)) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
44
189
|
|
|
190
|
+
if (retryCount.get() >= MAX_RETRIES) return;
|
|
191
|
+
retryCount.set(retryCount.get() + 1);
|
|
45
192
|
maybeMeasureAndStore({ intent: "complete-destination" });
|
|
46
193
|
},
|
|
47
|
-
[
|
|
194
|
+
[
|
|
195
|
+
enabled,
|
|
196
|
+
id,
|
|
197
|
+
group,
|
|
198
|
+
sharedBoundTag,
|
|
199
|
+
currentScreenKey,
|
|
200
|
+
expectedSourceScreenKey,
|
|
201
|
+
progress,
|
|
202
|
+
animating,
|
|
203
|
+
closing,
|
|
204
|
+
maybeMeasureAndStore,
|
|
205
|
+
retryCount,
|
|
206
|
+
],
|
|
48
207
|
);
|
|
49
208
|
};
|