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
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.usePendingDestinationMeasurement = void 0;
|
|
7
|
+
var _react = require("react");
|
|
7
8
|
var _reactNativeReanimated = require("react-native-reanimated");
|
|
9
|
+
var _animation = require("../../../stores/animation.store");
|
|
8
10
|
var _bounds = require("../../../stores/bounds");
|
|
9
11
|
var _resolvePendingSourceKey = require("../helpers/resolve-pending-source-key");
|
|
10
12
|
var _measurementRules = require("./helpers/measurement-rules");
|
|
@@ -12,17 +14,56 @@ const usePendingDestinationMeasurement = params => {
|
|
|
12
14
|
const {
|
|
13
15
|
sharedBoundTag,
|
|
14
16
|
enabled,
|
|
17
|
+
id,
|
|
18
|
+
group,
|
|
19
|
+
currentScreenKey,
|
|
15
20
|
expectedSourceScreenKey,
|
|
21
|
+
animating,
|
|
16
22
|
maybeMeasureAndStore
|
|
17
23
|
} = params;
|
|
24
|
+
const progress = _animation.AnimationStore.getValue(currentScreenKey, "progress");
|
|
25
|
+
const closing = _animation.AnimationStore.getValue(currentScreenKey, "closing");
|
|
26
|
+
const retryCount = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
27
|
+
const MAX_RETRIES = 4;
|
|
28
|
+
const RETRY_PROGRESS_BUCKETS = 8;
|
|
29
|
+
const RETRY_PROGRESS_MAX = 1.05;
|
|
30
|
+
(0, _react.useLayoutEffect)(() => {
|
|
31
|
+
if (!enabled) return;
|
|
32
|
+
(0, _reactNativeReanimated.runOnUI)(() => {
|
|
33
|
+
"worklet";
|
|
34
|
+
|
|
35
|
+
if (closing.get()) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const currentGroupActiveId = group ? _bounds.BoundStore.getGroupActiveId(group) : null;
|
|
39
|
+
if (group && currentGroupActiveId !== String(id)) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const resolvedSourceKey = (0, _resolvePendingSourceKey.resolvePendingSourceKey)(sharedBoundTag, expectedSourceScreenKey);
|
|
43
|
+
const hasAttachableSourceLink = resolvedSourceKey ? _bounds.BoundStore.hasPendingLinkFromSource(sharedBoundTag, resolvedSourceKey) || _bounds.BoundStore.hasSourceLink(sharedBoundTag, resolvedSourceKey) : false;
|
|
44
|
+
if (!hasAttachableSourceLink) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (_bounds.BoundStore.hasDestinationLink(sharedBoundTag, currentScreenKey)) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
maybeMeasureAndStore({
|
|
51
|
+
intent: "complete-destination"
|
|
52
|
+
});
|
|
53
|
+
})();
|
|
54
|
+
}, [enabled, id, group, sharedBoundTag, currentScreenKey, expectedSourceScreenKey, closing, maybeMeasureAndStore]);
|
|
18
55
|
(0, _reactNativeReanimated.useAnimatedReaction)(() => {
|
|
19
56
|
"worklet";
|
|
20
57
|
|
|
58
|
+
if (closing.get()) {
|
|
59
|
+
return 0;
|
|
60
|
+
}
|
|
21
61
|
const resolvedSourceKey = (0, _resolvePendingSourceKey.resolvePendingSourceKey)(sharedBoundTag, expectedSourceScreenKey);
|
|
22
62
|
return (0, _measurementRules.resolvePendingDestinationCaptureSignal)({
|
|
23
63
|
enabled,
|
|
24
64
|
resolvedSourceKey,
|
|
25
|
-
|
|
65
|
+
hasAttachableSourceLink: resolvedSourceKey ? _bounds.BoundStore.hasPendingLinkFromSource(sharedBoundTag, resolvedSourceKey) || _bounds.BoundStore.hasSourceLink(sharedBoundTag, resolvedSourceKey) : false,
|
|
66
|
+
hasDestinationLink: _bounds.BoundStore.hasDestinationLink(sharedBoundTag, currentScreenKey)
|
|
26
67
|
});
|
|
27
68
|
}, (captureSignal, previousCaptureSignal) => {
|
|
28
69
|
"worklet";
|
|
@@ -31,10 +72,51 @@ const usePendingDestinationMeasurement = params => {
|
|
|
31
72
|
if (!captureSignal || captureSignal === previousCaptureSignal) {
|
|
32
73
|
return;
|
|
33
74
|
}
|
|
75
|
+
const currentGroupActiveId = group ? _bounds.BoundStore.getGroupActiveId(group) : null;
|
|
76
|
+
if (group && currentGroupActiveId !== String(id)) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
maybeMeasureAndStore({
|
|
80
|
+
intent: "complete-destination"
|
|
81
|
+
});
|
|
82
|
+
}, [enabled, id, group, sharedBoundTag, expectedSourceScreenKey, closing, maybeMeasureAndStore]);
|
|
83
|
+
(0, _reactNativeReanimated.useAnimatedReaction)(() => {
|
|
84
|
+
"worklet";
|
|
85
|
+
|
|
86
|
+
if (closing.get()) {
|
|
87
|
+
return 0;
|
|
88
|
+
}
|
|
89
|
+
const resolvedSourceKey = (0, _resolvePendingSourceKey.resolvePendingSourceKey)(sharedBoundTag, expectedSourceScreenKey);
|
|
90
|
+
return (0, _measurementRules.resolvePendingDestinationRetrySignal)({
|
|
91
|
+
enabled,
|
|
92
|
+
retryCount: retryCount.get(),
|
|
93
|
+
maxRetries: MAX_RETRIES,
|
|
94
|
+
isAnimating: !!animating.get(),
|
|
95
|
+
hasDestinationLink: _bounds.BoundStore.hasDestinationLink(sharedBoundTag, currentScreenKey),
|
|
96
|
+
progress: progress.get(),
|
|
97
|
+
retryProgressMax: RETRY_PROGRESS_MAX,
|
|
98
|
+
retryProgressBuckets: RETRY_PROGRESS_BUCKETS,
|
|
99
|
+
resolvedSourceKey,
|
|
100
|
+
hasAttachableSourceLink: resolvedSourceKey ? _bounds.BoundStore.hasPendingLinkFromSource(sharedBoundTag, resolvedSourceKey) || _bounds.BoundStore.hasSourceLink(sharedBoundTag, resolvedSourceKey) : false
|
|
101
|
+
});
|
|
102
|
+
}, captureSignal => {
|
|
103
|
+
"worklet";
|
|
104
|
+
|
|
105
|
+
if (!enabled) return;
|
|
106
|
+
if (!captureSignal) {
|
|
107
|
+
retryCount.set(0);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const currentGroupActiveId = group ? _bounds.BoundStore.getGroupActiveId(group) : null;
|
|
111
|
+
if (group && currentGroupActiveId !== String(id)) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (retryCount.get() >= MAX_RETRIES) return;
|
|
115
|
+
retryCount.set(retryCount.get() + 1);
|
|
34
116
|
maybeMeasureAndStore({
|
|
35
117
|
intent: "complete-destination"
|
|
36
118
|
});
|
|
37
|
-
}, [enabled, sharedBoundTag, expectedSourceScreenKey, maybeMeasureAndStore]);
|
|
119
|
+
}, [enabled, id, group, sharedBoundTag, currentScreenKey, expectedSourceScreenKey, progress, animating, closing, maybeMeasureAndStore, retryCount]);
|
|
38
120
|
};
|
|
39
121
|
exports.usePendingDestinationMeasurement = usePendingDestinationMeasurement;
|
|
40
122
|
//# sourceMappingURL=use-pending-destination-measurement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNativeReanimated","_animation","_bounds","_resolvePendingSourceKey","_measurementRules","usePendingDestinationMeasurement","params","sharedBoundTag","enabled","id","group","currentScreenKey","expectedSourceScreenKey","animating","maybeMeasureAndStore","progress","AnimationStore","getValue","closing","retryCount","useSharedValue","MAX_RETRIES","RETRY_PROGRESS_BUCKETS","RETRY_PROGRESS_MAX","useLayoutEffect","runOnUI","get","currentGroupActiveId","BoundStore","getGroupActiveId","String","resolvedSourceKey","resolvePendingSourceKey","hasAttachableSourceLink","hasPendingLinkFromSource","hasSourceLink","hasDestinationLink","intent","useAnimatedReaction","resolvePendingDestinationCaptureSignal","captureSignal","previousCaptureSignal","resolvePendingDestinationRetrySignal","maxRetries","isAnimating","retryProgressMax","retryProgressBuckets","set","exports"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AAMA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,wBAAA,GAAAJ,OAAA;AAEA,IAAAK,iBAAA,GAAAL,OAAA;AAKO,MAAMM,gCAAgC,GAAIC,MAShD,IAAK;EACL,MAAM;IACLC,cAAc;IACdC,OAAO;IACPC,EAAE;IACFC,KAAK;IACLC,gBAAgB;IAChBC,uBAAuB;IACvBC,SAAS;IACTC;EACD,CAAC,GAAGR,MAAM;EAEV,MAAMS,QAAQ,GAAGC,yBAAc,CAACC,QAAQ,CAACN,gBAAgB,EAAE,UAAU,CAAC;EACtE,MAAMO,OAAO,GAAGF,yBAAc,CAACC,QAAQ,CAACN,gBAAgB,EAAE,SAAS,CAAC;EAEpE,MAAMQ,UAAU,GAAG,IAAAC,qCAAc,EAAC,CAAC,CAAC;EACpC,MAAMC,WAAW,GAAG,CAAC;EACrB,MAAMC,sBAAsB,GAAG,CAAC;EAChC,MAAMC,kBAAkB,GAAG,IAAI;EAE/B,IAAAC,sBAAe,EAAC,MAAM;IACrB,IAAI,CAAChB,OAAO,EAAE;IAEd,IAAAiB,8BAAO,EAAC,MAAM;MACb,SAAS;;MACT,IAAIP,OAAO,CAACQ,GAAG,CAAC,CAAC,EAAE;QAClB;MACD;MAEA,MAAMC,oBAAoB,GA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BAAU,CAACM,wBAAwB,CACnC3B,cAAc,EACdwB,iBACD,CAAC,IAAIH,kBAAU,CAACO,aAAa,CAAC5B,cAAc,EAAEwB,iBAAiB,CAAC,GAC/D;IACJ,CAAC,CAAC;EACH,CAAC,EACAS,aAAa,IAAK;IAClB,SAAS;;IACT,IAAI,CAAChC,OAAO,EAAE;IACd,IAAI,CAACgC,aAAa,EAAE;MACnBrB,UAAU,CAAC4B,GAAG,CAAC,CAAC,CAAC;MACjB;IACD;IACA,MAAMpB,oBAAoB,GAAGjB,KAAK,GAC/BkB,kBAAU,CAACC,gBAAgB,CAACnB,KAAK,CAAC,GAClC,IAAI;IACP,IAAIA,KAAK,IAAIiB,oBAAoB,KAAKG,MAAM,CAACrB,EAAE,CAAC,EAAE;MACjD;IACD;IAEA,IAAIU,UAAU,CAACO,GAAG,CAAC,CAAC,IAAIL,WAAW,EAAE;IACrCF,UAAU,CAAC4B,GAAG,CAAC5B,UAAU,CAACO,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACpCZ,oBAAoB,CAAC;MAAEuB,MAAM,EAAE;IAAuB,CAAC,CAAC;EACzD,CAAC,EACD,CACC7B,OAAO,EACPC,EAAE,EACFC,KAAK,EACLH,cAAc,EACdI,gBAAgB,EAChBC,uBAAuB,EACvBG,QAAQ,EACRF,SAAS,EACTK,OAAO,EACPJ,oBAAoB,EACpBK,UAAU,CAEZ,CAAC;AACF,CAAC;AAAC6B,OAAA,CAAA3C,gCAAA,GAAAA,gCAAA","ignoreList":[]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.usePrepareTransitionMeasurement = void 0;
|
|
7
|
+
var _reactNativeReanimated = require("react-native-reanimated");
|
|
8
|
+
var _animation = require("../../../stores/animation.store");
|
|
9
|
+
var _bounds = require("../../../stores/bounds");
|
|
10
|
+
var _gesture = require("../../../stores/gesture.store");
|
|
11
|
+
var _measurementRules = require("./helpers/measurement-rules");
|
|
12
|
+
const usePrepareTransitionMeasurement = params => {
|
|
13
|
+
const {
|
|
14
|
+
enabled,
|
|
15
|
+
sharedBoundTag,
|
|
16
|
+
id,
|
|
17
|
+
group,
|
|
18
|
+
currentScreenKey,
|
|
19
|
+
nextScreenKey,
|
|
20
|
+
hasNextScreen,
|
|
21
|
+
maybeMeasureAndStore
|
|
22
|
+
} = params;
|
|
23
|
+
const currentWillAnimate = _animation.AnimationStore.getValue(currentScreenKey, "willAnimate");
|
|
24
|
+
const currentAnimating = _animation.AnimationStore.getValue(currentScreenKey, "animating");
|
|
25
|
+
const currentDragging = _gesture.GestureStore.getValue(currentScreenKey, "dragging");
|
|
26
|
+
const nextWillAnimate = nextScreenKey ? _animation.AnimationStore.getValue(nextScreenKey, "willAnimate") : null;
|
|
27
|
+
const nextAnimating = nextScreenKey ? _animation.AnimationStore.getValue(nextScreenKey, "animating") : null;
|
|
28
|
+
const nextDragging = nextScreenKey ? _gesture.GestureStore.getValue(nextScreenKey, "dragging") : null;
|
|
29
|
+
(0, _reactNativeReanimated.useAnimatedReaction)(() => hasNextScreen ? nextWillAnimate?.get() ?? 0 : 0, (nextValue, previousValue) => {
|
|
30
|
+
"worklet";
|
|
31
|
+
|
|
32
|
+
if (!enabled || !hasNextScreen) return;
|
|
33
|
+
if (nextValue === 0 || nextValue === previousValue) return;
|
|
34
|
+
const currentGroupActiveId = group ? _bounds.BoundStore.getGroupActiveId(group) : null;
|
|
35
|
+
if (group && currentGroupActiveId !== String(id)) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const shouldCancelMeasurement = !!nextAnimating?.get() && !!nextDragging?.get();
|
|
39
|
+
if (shouldCancelMeasurement) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const intent = (0, _measurementRules.resolvePrepareSourceMeasurementIntent)({
|
|
43
|
+
hasSourceLink: _bounds.BoundStore.hasSourceLink(sharedBoundTag, currentScreenKey)
|
|
44
|
+
});
|
|
45
|
+
if (!intent) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
maybeMeasureAndStore({
|
|
49
|
+
intent
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
(0, _reactNativeReanimated.useAnimatedReaction)(() => !hasNextScreen ? currentWillAnimate.get() : 0, (nextValue, previousValue) => {
|
|
53
|
+
"worklet";
|
|
54
|
+
|
|
55
|
+
if (!enabled || hasNextScreen) return;
|
|
56
|
+
if (nextValue === 0 || nextValue === previousValue) return;
|
|
57
|
+
const currentGroupActiveId = group ? _bounds.BoundStore.getGroupActiveId(group) : null;
|
|
58
|
+
if (group && currentGroupActiveId !== String(id)) return;
|
|
59
|
+
const shouldCancelMeasurement = !!currentAnimating.get() && !!currentDragging.get();
|
|
60
|
+
if (shouldCancelMeasurement) return;
|
|
61
|
+
maybeMeasureAndStore({
|
|
62
|
+
intent: _measurementRules.PREPARE_DESTINATION_MEASUREMENT_INTENT
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
exports.usePrepareTransitionMeasurement = usePrepareTransitionMeasurement;
|
|
67
|
+
//# sourceMappingURL=use-prepare-transition-measurement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNativeReanimated","require","_animation","_bounds","_gesture","_measurementRules","usePrepareTransitionMeasurement","params","enabled","sharedBoundTag","id","group","currentScreenKey","nextScreenKey","hasNextScreen","maybeMeasureAndStore","currentWillAnimate","AnimationStore","getValue","currentAnimating","currentDragging","GestureStore","nextWillAnimate","nextAnimating","nextDragging","useAnimatedReaction","get","nextValue","previousValue","currentGroupActiveId","BoundStore","getGroupActiveId","String","shouldCancelMeasurement","intent","resolvePrepareSourceMeasurementIntent","hasSourceLink","PREPARE_DESTINATION_MEASUREMENT_INTENT","exports"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/hooks/use-prepare-transition-measurement.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A","ignoreList":[]}
|
|
@@ -4,218 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Boundary = void 0;
|
|
7
|
-
exports
|
|
8
|
-
|
|
7
|
+
Object.defineProperty(exports, "createBoundaryComponent", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _createBoundaryComponent.createBoundaryComponent;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
9
13
|
var _reactNative = require("react-native");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _animation = require("../../stores/animation.store");
|
|
15
|
-
var _bounds = require("../../stores/bounds");
|
|
16
|
-
var _styles = require("../../utils/bounds/helpers/styles");
|
|
17
|
-
var _useAutoSourceMeasurement = require("./hooks/use-auto-source-measurement");
|
|
18
|
-
var _useBoundaryMeasureAndStore = require("./hooks/use-boundary-measure-and-store");
|
|
19
|
-
var _useBoundaryPresence = require("./hooks/use-boundary-presence");
|
|
20
|
-
var _useGroupActiveMeasurement = require("./hooks/use-group-active-measurement");
|
|
21
|
-
var _useGroupActiveSourceMeasurement = require("./hooks/use-group-active-source-measurement");
|
|
22
|
-
var _useInitialLayoutHandler = require("./hooks/use-initial-layout-handler");
|
|
23
|
-
var _usePendingDestinationMeasurement = require("./hooks/use-pending-destination-measurement");
|
|
24
|
-
var _usePendingDestinationRetryMeasurement = require("./hooks/use-pending-destination-retry-measurement");
|
|
25
|
-
var _useScrollSettledMeasurement = require("./hooks/use-scroll-settled-measurement");
|
|
26
|
-
var _buildBoundaryMatchKey = require("./utils/build-boundary-match-key");
|
|
27
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
29
|
-
const setGroupSelectionOnUI = (group, id) => {
|
|
30
|
-
"worklet";
|
|
31
|
-
|
|
32
|
-
_bounds.BoundStore.setGroupActiveId(group, id);
|
|
33
|
-
};
|
|
34
|
-
function createBoundaryComponent(Wrapped, options = {}) {
|
|
35
|
-
const {
|
|
36
|
-
alreadyAnimated = false
|
|
37
|
-
} = options;
|
|
38
|
-
const AnimatedComponent = alreadyAnimated ? Wrapped : _reactNativeReanimated.default.createAnimatedComponent(Wrapped);
|
|
39
|
-
const Inner = /*#__PURE__*/(0, _react.forwardRef)((props, _ref) => {
|
|
40
|
-
const {
|
|
41
|
-
enabled = true,
|
|
42
|
-
group,
|
|
43
|
-
id,
|
|
44
|
-
anchor,
|
|
45
|
-
scaleMode,
|
|
46
|
-
target,
|
|
47
|
-
method,
|
|
48
|
-
style,
|
|
49
|
-
onPress,
|
|
50
|
-
...rest
|
|
51
|
-
} = props;
|
|
52
|
-
const sharedBoundTag = (0, _buildBoundaryMatchKey.buildBoundaryMatchKey)({
|
|
53
|
-
group,
|
|
54
|
-
id
|
|
55
|
-
});
|
|
56
|
-
const animatedRef = (0, _reactNativeReanimated.useAnimatedRef)();
|
|
57
|
-
const {
|
|
58
|
-
previousScreenKey: preferredSourceScreenKey,
|
|
59
|
-
currentScreenKey,
|
|
60
|
-
nextScreenKey,
|
|
61
|
-
ancestorKeys,
|
|
62
|
-
navigatorKey,
|
|
63
|
-
ancestorNavigatorKeys,
|
|
64
|
-
hasConfiguredInterpolator
|
|
65
|
-
} = (0, _descriptors.useDescriptorDerivations)();
|
|
66
|
-
const runtimeEnabled = enabled && hasConfiguredInterpolator;
|
|
67
|
-
const hasNextScreen = !!nextScreenKey;
|
|
68
|
-
const shouldUpdateDestination = !hasNextScreen;
|
|
69
|
-
const layoutAnchor = (0, _layoutAnchor.useLayoutAnchorContext)();
|
|
70
|
-
const boundaryConfig = (0, _react.useMemo)(() => {
|
|
71
|
-
if (anchor === undefined && scaleMode === undefined && target === undefined && method === undefined) {
|
|
72
|
-
return undefined;
|
|
73
|
-
}
|
|
74
|
-
return {
|
|
75
|
-
anchor,
|
|
76
|
-
scaleMode,
|
|
77
|
-
target,
|
|
78
|
-
method
|
|
79
|
-
};
|
|
80
|
-
}, [anchor, scaleMode, target, method]);
|
|
81
|
-
const isAnimating = _animation.AnimationStore.getValue(currentScreenKey, "animating");
|
|
82
|
-
const progress = _animation.AnimationStore.getValue(currentScreenKey, "progress");
|
|
83
|
-
const preparedStyles = (0, _react.useMemo)(() => (0, _styles.prepareStyleForBounds)(style), [style]);
|
|
84
|
-
const {
|
|
85
|
-
associatedStyles
|
|
86
|
-
} = (0, _useAssociatedStyle.useAssociatedStyles)({
|
|
87
|
-
id: sharedBoundTag,
|
|
88
|
-
resetTransformOnUnset: true
|
|
89
|
-
});
|
|
90
|
-
const maybeMeasureAndStore = (0, _useBoundaryMeasureAndStore.useBoundaryMeasureAndStore)({
|
|
91
|
-
enabled,
|
|
92
|
-
sharedBoundTag,
|
|
93
|
-
preferredSourceScreenKey,
|
|
94
|
-
currentScreenKey,
|
|
95
|
-
ancestorKeys,
|
|
96
|
-
navigatorKey,
|
|
97
|
-
ancestorNavigatorKeys,
|
|
98
|
-
isAnimating,
|
|
99
|
-
preparedStyles,
|
|
100
|
-
animatedRef,
|
|
101
|
-
layoutAnchor
|
|
102
|
-
});
|
|
103
|
-
const shouldRunDestinationEffects = runtimeEnabled && !hasNextScreen;
|
|
104
|
-
|
|
105
|
-
// Register/unregister this boundary in the presence map so source/destination
|
|
106
|
-
// matching can resolve across screens (including ancestor relationships).
|
|
107
|
-
(0, _useBoundaryPresence.useBoundaryPresence)({
|
|
108
|
-
enabled: runtimeEnabled,
|
|
109
|
-
sharedBoundTag,
|
|
110
|
-
currentScreenKey,
|
|
111
|
-
ancestorKeys,
|
|
112
|
-
navigatorKey,
|
|
113
|
-
ancestorNavigatorKeys,
|
|
114
|
-
boundaryConfig
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
// On the source screen, capture source bounds when a matching destination
|
|
118
|
-
// appears on the next screen.
|
|
119
|
-
(0, _useAutoSourceMeasurement.useAutoSourceMeasurement)({
|
|
120
|
-
enabled: runtimeEnabled,
|
|
121
|
-
sharedBoundTag,
|
|
122
|
-
nextScreenKey,
|
|
123
|
-
maybeMeasureAndStore
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
// Primary destination capture: once a pending source link exists for this tag,
|
|
127
|
-
// measure destination bounds and complete the pair.
|
|
128
|
-
(0, _usePendingDestinationMeasurement.usePendingDestinationMeasurement)({
|
|
129
|
-
sharedBoundTag,
|
|
130
|
-
enabled: shouldRunDestinationEffects,
|
|
131
|
-
expectedSourceScreenKey: preferredSourceScreenKey,
|
|
132
|
-
maybeMeasureAndStore
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
// Reliability fallback: retry destination capture during transition progress
|
|
136
|
-
// when the initial pending-destination attempt happens before layout is ready.
|
|
137
|
-
(0, _usePendingDestinationRetryMeasurement.usePendingDestinationRetryMeasurement)({
|
|
138
|
-
sharedBoundTag,
|
|
139
|
-
enabled: shouldRunDestinationEffects,
|
|
140
|
-
currentScreenKey,
|
|
141
|
-
expectedSourceScreenKey: preferredSourceScreenKey,
|
|
142
|
-
progress,
|
|
143
|
-
animating: isAnimating,
|
|
144
|
-
maybeMeasureAndStore
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
// Grouped boundaries (e.g. paged/detail UIs): re-measure when this boundary
|
|
148
|
-
// becomes the active member so destination bounds stay accurate.
|
|
149
|
-
(0, _useGroupActiveMeasurement.useGroupActiveMeasurement)({
|
|
150
|
-
enabled: runtimeEnabled,
|
|
151
|
-
group,
|
|
152
|
-
id,
|
|
153
|
-
currentScreenKey,
|
|
154
|
-
shouldUpdateDestination,
|
|
155
|
-
maybeMeasureAndStore
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
// Source-side grouped retargeting: when an unfocused/source boundary
|
|
159
|
-
// becomes the active member, refresh its snapshot and source link so
|
|
160
|
-
// close transitions do not use stale pre-scroll geometry.
|
|
161
|
-
(0, _useGroupActiveSourceMeasurement.useGroupActiveSourceMeasurement)({
|
|
162
|
-
enabled: runtimeEnabled,
|
|
163
|
-
group,
|
|
164
|
-
id,
|
|
165
|
-
hasNextScreen,
|
|
166
|
-
isAnimating,
|
|
167
|
-
maybeMeasureAndStore
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
// While idle on source screens, re-measure after scroll settles so a later
|
|
171
|
-
// close transition starts from up-to-date source geometry.
|
|
172
|
-
(0, _useScrollSettledMeasurement.useScrollSettledMeasurement)({
|
|
173
|
-
enabled: runtimeEnabled,
|
|
174
|
-
group,
|
|
175
|
-
hasNextScreen,
|
|
176
|
-
isAnimating,
|
|
177
|
-
maybeMeasureAndStore
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
// Destination mount-time capture path: onLayout schedules a one-time UI-thread
|
|
181
|
-
// initial measurement when transitions are active.
|
|
182
|
-
(0, _useInitialLayoutHandler.useInitialLayoutHandler)({
|
|
183
|
-
enabled: runtimeEnabled,
|
|
184
|
-
sharedBoundTag,
|
|
185
|
-
currentScreenKey,
|
|
186
|
-
ancestorKeys,
|
|
187
|
-
expectedSourceScreenKey: preferredSourceScreenKey,
|
|
188
|
-
maybeMeasureAndStore
|
|
189
|
-
});
|
|
190
|
-
const handlePress = (0, _react.useCallback)((...args) => {
|
|
191
|
-
// Press path has priority: capture source before user onPress/navigation.
|
|
192
|
-
if (group) {
|
|
193
|
-
(0, _reactNativeReanimated.runOnUI)(setGroupSelectionOnUI)(group, String(id));
|
|
194
|
-
}
|
|
195
|
-
(0, _reactNativeReanimated.runOnUI)(maybeMeasureAndStore)({
|
|
196
|
-
intent: "capture-source"
|
|
197
|
-
});
|
|
198
|
-
if (typeof onPress === "function") {
|
|
199
|
-
onPress(...args);
|
|
200
|
-
}
|
|
201
|
-
}, [group, id, maybeMeasureAndStore, onPress]);
|
|
202
|
-
const resolvedOnPress = typeof onPress === "function" ? handlePress : undefined;
|
|
203
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedComponent, {
|
|
204
|
-
...rest,
|
|
205
|
-
ref: animatedRef,
|
|
206
|
-
style: [style, enabled ? associatedStyles : undefined],
|
|
207
|
-
onPress: resolvedOnPress,
|
|
208
|
-
collapsable: false
|
|
209
|
-
});
|
|
210
|
-
});
|
|
211
|
-
return /*#__PURE__*/(0, _react.memo)(Inner);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
// Pre-built boundary component variants
|
|
215
|
-
const BoundaryView = createBoundaryComponent(_reactNative.View);
|
|
14
|
+
var _boundaryTarget = require("./components/boundary-target");
|
|
15
|
+
var _createBoundaryComponent = require("./create-boundary-component");
|
|
16
|
+
const BoundaryView = (0, _createBoundaryComponent.createBoundaryComponent)(_reactNative.View);
|
|
17
|
+
const BoundaryTrigger = (0, _createBoundaryComponent.createBoundaryComponent)(_reactNative.Pressable);
|
|
216
18
|
BoundaryView.displayName = "Transition.Boundary.View";
|
|
217
|
-
|
|
218
|
-
|
|
19
|
+
BoundaryTrigger.displayName = "Transition.Boundary.Trigger";
|
|
20
|
+
_boundaryTarget.BoundaryTarget.displayName = "Transition.Boundary.Target";
|
|
219
21
|
|
|
220
22
|
/**
|
|
221
23
|
* Shared-boundary components.
|
|
@@ -225,19 +27,28 @@ BoundaryPressable.displayName = "Transition.Boundary.Pressable";
|
|
|
225
27
|
* 2. Destination screen captures bounds for the same tag.
|
|
226
28
|
* 3. The link is updated as layout changes (group-active + scroll-settled paths).
|
|
227
29
|
*
|
|
228
|
-
*
|
|
229
|
-
* - When a boundary has `onPress` (typically `Boundary.
|
|
30
|
+
* Trigger behavior:
|
|
31
|
+
* - When a boundary has `onPress` (typically `Boundary.Trigger`), source
|
|
230
32
|
* measurement runs before the user callback. This gives navigation transitions
|
|
231
33
|
* fresh source geometry on the first frame.
|
|
232
34
|
*
|
|
233
35
|
* Use:
|
|
234
36
|
* - `Boundary.View` for passive/shared elements.
|
|
235
|
-
* - `Boundary.
|
|
37
|
+
* - `Boundary.Trigger` for tappable elements that start navigation.
|
|
38
|
+
* - `Boundary.Target` to measure a nested descendant instead of the owner.
|
|
236
39
|
*/
|
|
237
40
|
const Boundary = exports.Boundary = {
|
|
238
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Passive boundary wrapper (no built-in press semantics).
|
|
43
|
+
*/
|
|
239
44
|
View: BoundaryView,
|
|
240
|
-
/**
|
|
241
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Pressable boundary wrapper with press-priority source capture.
|
|
47
|
+
*/
|
|
48
|
+
Trigger: BoundaryTrigger,
|
|
49
|
+
/**
|
|
50
|
+
* Optional nested measurement override inside a boundary owner.
|
|
51
|
+
*/
|
|
52
|
+
Target: _boundaryTarget.BoundaryTarget
|
|
242
53
|
};
|
|
243
54
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_boundaryTarget","_createBoundaryComponent","BoundaryView","createBoundaryComponent","View","BoundaryTrigger","Pressable","displayName","BoundaryTarget","Boundary","exports","Trigger","Target"],"sourceRoot":"../../../../../src","sources":["shared/components/create-boundary-component/index.tsx"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,wBAAA,GAAAF,OAAA;AAIA,MAAMG,YAAY,GAAG,IAAAC,gDAAuB,EAACC,iBAAI,CAAC;AAClD,MAAMC,eAAe,GAAG,IAAAF,gDAAuB,EAACG,sBAAS,CAAC;AAC1DJ,YAAY,CAACK,WAAW,GAAG,0BAA0B;AACrDF,eAAe,CAACE,WAAW,GAAG,6BAA6B;AAC3DC,8BAAc,CAACD,WAAW,GAAG,4BAA4B;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAG;EACvB;AACD;AACA;EACCL,IAAI,EAAEF,YAAY;EAClB;AACD;AACA;EACCS,OAAO,EAAEN,eAAe;EACxB;AACD;AACA;EACCO,MAAM,EAAEJ;AACT,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useBoundaryOwnerContext = exports.useBoundaryOwner = exports.TARGET_OUTSIDE_OWNER_WARNING = exports.BoundaryOwnerProvider = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
+
const BoundaryOwnerContext = /*#__PURE__*/(0, _react.createContext)(null);
|
|
10
|
+
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.";
|
|
11
|
+
const TARGET_OUTSIDE_OWNER_WARNING = exports.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).";
|
|
12
|
+
const BoundaryOwnerProvider = props => {
|
|
13
|
+
const {
|
|
14
|
+
value,
|
|
15
|
+
children
|
|
16
|
+
} = props;
|
|
17
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(BoundaryOwnerContext.Provider, {
|
|
18
|
+
value: value,
|
|
19
|
+
children: children
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
exports.BoundaryOwnerProvider = BoundaryOwnerProvider;
|
|
23
|
+
const useBoundaryOwnerContext = () => {
|
|
24
|
+
return (0, _react.useContext)(BoundaryOwnerContext);
|
|
25
|
+
};
|
|
26
|
+
exports.useBoundaryOwnerContext = useBoundaryOwnerContext;
|
|
27
|
+
const useBoundaryOwner = params => {
|
|
28
|
+
const {
|
|
29
|
+
ownerRef,
|
|
30
|
+
associatedTargetStyles
|
|
31
|
+
} = params;
|
|
32
|
+
const warnedAboutMultipleTargetsRef = (0, _react.useRef)(false);
|
|
33
|
+
const [targetRefs, setTargetRefs] = (0, _react.useState)([]);
|
|
34
|
+
const registerTargetRef = (0, _react.useCallback)(targetRef => {
|
|
35
|
+
setTargetRefs(prev => {
|
|
36
|
+
if (prev.includes(targetRef)) {
|
|
37
|
+
return prev;
|
|
38
|
+
}
|
|
39
|
+
if (__DEV__ && prev.length > 0 && !warnedAboutMultipleTargetsRef.current) {
|
|
40
|
+
warnedAboutMultipleTargetsRef.current = true;
|
|
41
|
+
console.warn(MULTIPLE_TARGETS_WARNING);
|
|
42
|
+
}
|
|
43
|
+
return [...prev, targetRef];
|
|
44
|
+
});
|
|
45
|
+
}, []);
|
|
46
|
+
const unregisterTargetRef = (0, _react.useCallback)(targetRef => {
|
|
47
|
+
setTargetRefs(prev => prev.filter(existingRef => existingRef !== targetRef));
|
|
48
|
+
}, []);
|
|
49
|
+
const contextValue = (0, _react.useMemo)(() => ({
|
|
50
|
+
ownerRef,
|
|
51
|
+
registerTargetRef,
|
|
52
|
+
unregisterTargetRef,
|
|
53
|
+
activeTargetRef: targetRefs[0] ?? null,
|
|
54
|
+
associatedTargetStyles
|
|
55
|
+
}), [ownerRef, registerTargetRef, unregisterTargetRef, targetRefs, associatedTargetStyles]);
|
|
56
|
+
return {
|
|
57
|
+
contextValue,
|
|
58
|
+
hasActiveTarget: targetRefs.length > 0,
|
|
59
|
+
measuredRef: targetRefs[0] ?? ownerRef
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
exports.useBoundaryOwner = useBoundaryOwner;
|
|
63
|
+
//# sourceMappingURL=boundary-owner.provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_jsxRuntime","BoundaryOwnerContext","createContext","MULTIPLE_TARGETS_WARNING","TARGET_OUTSIDE_OWNER_WARNING","exports","BoundaryOwnerProvider","props","value","children","jsx","Provider","useBoundaryOwnerContext","useContext","useBoundaryOwner","params","ownerRef","associatedTargetStyles","warnedAboutMultipleTargetsRef","useRef","targetRefs","setTargetRefs","useState","registerTargetRef","useCallback","targetRef","prev","includes","__DEV__","length","current","console","warn","unregisterTargetRef","filter","existingRef","contextValue","useMemo","activeTargetRef","hasActiveTarget","measuredRef"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/providers/boundary-owner.provider.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAQe,IAAAC,WAAA,GAAAD,OAAA;AAiBf,MAAME,oBAAoB,gBAAG,IAAAC,oBAAa,EACzC,IACD,CAAC;AAED,MAAMC,wBAAwB,GAC7B,gKAAgK;AAE1J,MAAMC,4BAA4B,GAAAC,OAAA,CAAAD,4BAAA,GACxC,kLAAkL;AAE5K,MAAME,qBAAqB,GAAIC,KAGrC,IAAK;EACL,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAC,GAAGF,KAAK;EAEjC,oBACC,IAAAP,WAAA,CAAAU,GAAA,EAACT,oBAAoB,CAACU,QAAQ;IAACH,KAAK,EAAEA,KAAM;IAAAC,QAAA,EAC1CA;EAAQ,CACqB,CAAC;AAElC,CAAC;AAACJ,OAAA,CAAAC,qBAAA,GAAAA,qBAAA;AAEK,MAAMM,uBAAuB,GAAGA,CAAA,KAAM;EAC5C,OAAO,IAAAC,iBAAU,EAACZ,oBAAoB,CAAC;AACxC,CAAC;AAACI,OAAA,CAAAO,uBAAA,GAAAA,uBAAA;AAEK,MAAME,gBAAgB,GAAIC,MAGhC,IAAK;EAC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