react-native-screen-transitions 3.9.0-beta.2 → 3.9.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/shared/components/boundary/components/boundary-target.js +19 -14
- package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +14 -7
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +32 -2
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/index.js +4 -3
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/host.js +3 -2
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +2 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +2 -3
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js +1 -3
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/teleport.js +2 -1
- package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +16 -3
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/commonjs/shared/constants.js +4 -0
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +4 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +10 -10
- package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +10 -2
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +25 -3
- package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -6
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -2
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +6 -1
- package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/snapshot.js +2 -0
- package/lib/commonjs/shared/providers/screen/gestures/shared/snapshot.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/values.js +2 -0
- package/lib/commonjs/shared/providers/screen/gestures/shared/values.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +11 -0
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/commonjs/shared/stores/gesture.store.js +8 -0
- package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js +24 -7
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js +2 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +177 -314
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/config.js +12 -18
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/config.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/drag.js +196 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/drag.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js +94 -108
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/mask.js +72 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/mask.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/targets.js +55 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/targets.js.map +1 -0
- package/lib/module/shared/components/boundary/components/boundary-target.js +20 -15
- package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +14 -7
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +2 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +32 -2
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js +5 -4
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js +3 -2
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +3 -2
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +3 -4
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js +1 -3
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/teleport.js +1 -0
- package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -1
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +17 -4
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/module/shared/constants.js +4 -0
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +4 -0
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +10 -10
- package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +10 -2
- package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +23 -2
- package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -6
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -2
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +6 -1
- package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/snapshot.js +2 -0
- package/lib/module/shared/providers/screen/gestures/shared/snapshot.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/values.js +2 -0
- package/lib/module/shared/providers/screen/gestures/shared/values.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +11 -0
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/module/shared/stores/gesture.store.js +8 -0
- package/lib/module/shared/stores/gesture.store.js.map +1 -1
- package/lib/module/shared/types/bounds.types.js +26 -0
- package/lib/module/shared/types/bounds.types.js.map +1 -1
- package/lib/module/shared/utils/animation/animate-to-progress.js +24 -7
- package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/math.js +2 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js +181 -318
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/config.js +11 -17
- package/lib/module/shared/utils/bounds/navigation/zoom/config.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/drag.js +184 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/drag.js.map +1 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js +91 -102
- package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/mask.js +67 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/mask.js.map +1 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/targets.js +50 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/targets.js.map +1 -0
- package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts +3 -1
- package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/components/host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts +1 -3
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts +2 -3
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts +2 -3
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +1 -0
- package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +1 -0
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +1 -1
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts +2 -0
- package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts +2 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/use-build-pan-gesture.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts +2 -0
- package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/snapshot.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/values.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +4 -0
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
- package/lib/typescript/shared/stores/gesture.store.d.ts +4 -0
- package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
- package/lib/typescript/shared/types/bounds.types.d.ts +115 -88
- package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/gesture.types.d.ts +10 -0
- package/lib/typescript/shared/types/gesture.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/utils/animation/animate-to-progress.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/config.d.ts +7 -17
- package/lib/typescript/shared/utils/bounds/navigation/zoom/config.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/drag.d.ts +55 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/drag.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts +31 -34
- package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/mask.d.ts +25 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/mask.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/targets.d.ts +16 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/targets.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/types.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shared/components/boundary/components/boundary-target.tsx +37 -26
- package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +16 -13
- package/src/shared/components/boundary/portal/components/boundary-content-portal/components/host.tsx +6 -2
- package/src/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +46 -3
- package/src/shared/components/boundary/portal/components/boundary-content-portal/index.tsx +8 -5
- package/src/shared/components/boundary/portal/components/boundary-portal/components/host.tsx +3 -2
- package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx +3 -2
- package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.tsx +4 -5
- package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +5 -1
- package/src/shared/components/boundary/portal/components/boundary-portal/index.tsx +1 -4
- package/src/shared/components/boundary/portal/teleport.ts +1 -0
- package/src/shared/components/boundary/providers/boundary-root.provider.tsx +23 -3
- package/src/shared/constants.ts +4 -0
- package/src/shared/index.ts +2 -0
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +8 -0
- package/src/shared/providers/screen/gestures/pan/activation/use-pan-activation.ts +16 -7
- package/src/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.ts +18 -1
- package/src/shared/providers/screen/gestures/pan/use-build-pan-gesture.ts +1 -0
- package/src/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.ts +40 -2
- package/src/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.ts +7 -11
- package/src/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.ts +12 -15
- package/src/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.ts +6 -1
- package/src/shared/providers/screen/gestures/shared/snapshot.ts +2 -0
- package/src/shared/providers/screen/gestures/shared/values.ts +2 -0
- package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +14 -1
- package/src/shared/stores/gesture.store.ts +12 -0
- package/src/shared/types/bounds.types.ts +119 -90
- package/src/shared/types/gesture.types.ts +10 -0
- package/src/shared/types/index.ts +2 -0
- package/src/shared/utils/animation/animate-to-progress.ts +23 -7
- package/src/shared/utils/bounds/navigation/reveal/math.ts +2 -1
- package/src/shared/utils/bounds/navigation/zoom/build.ts +223 -411
- package/src/shared/utils/bounds/navigation/zoom/config.ts +15 -18
- package/src/shared/utils/bounds/navigation/zoom/drag.ts +327 -0
- package/src/shared/utils/bounds/navigation/zoom/helpers.ts +122 -184
- package/src/shared/utils/bounds/navigation/zoom/mask.ts +130 -0
- package/src/shared/utils/bounds/navigation/zoom/targets.ts +74 -0
- package/src/shared/utils/bounds/navigation/zoom/types.ts +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/math.js +0 -25
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/math.js.map +0 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/math.js +0 -20
- package/lib/module/shared/utils/bounds/navigation/zoom/math.js.map +0 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/math.d.ts +0 -8
- package/lib/typescript/shared/utils/bounds/navigation/zoom/math.d.ts.map +0 -1
- package/src/shared/utils/bounds/navigation/zoom/math.ts +0 -25
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ZOOM_SHARED_OPTIONS","Object","freeze","anchor","scaleMode","
|
|
1
|
+
{"version":3,"names":["ZOOM_SHARED_OPTIONS","Object","freeze","anchor","scaleMode","ZOOM_DISMISS_VELOCITY_DEPTH","ZOOM_BACKGROUND_SCALE","ZOOM_BACKDROP_MAX_OPACITY","ZOOM_SCREEN_A_FADE_END","ZOOM_FOCUSED_ELEMENT_OPEN_OPACITY_RANGE","ZOOM_UNFOCUSED_ELEMENT_OPEN_OPACITY_RANGE","ZOOM_FOCUSED_ELEMENT_CLOSE_OPACITY_RANGE","ZOOM_UNFOCUSED_ELEMENT_CLOSE_OPACITY_RANGE"],"sourceRoot":"../../../../../../../src","sources":["shared/utils/bounds/navigation/zoom/config.ts"],"mappings":";;AAAA,OAAO,MAAMA,mBAAmB,GAAGC,MAAM,CAACC,MAAM,CAAC;EAChDC,MAAM,EAAE,KAAc;EACtBC,SAAS,EAAE;AACZ,CAAC,CAAC;AAEF,OAAO,MAAMC,2BAA2B,GAAG,GAAG;AAC9C,OAAO,MAAMC,qBAAqB,GAAG,MAAM;AAC3C;AACA,OAAO,MAAMC,yBAAyB,GAAG,IAAI;AAC7C;AACA,OAAO,MAAMC,sBAAsB,GAAG,IAAI;AAC1C;AACA,OAAO,MAAMC,uCAAuC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAU;AAC9E,OAAO,MAAMC,yCAAyC,GAAG,CACxD,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CACN;AACV;AACA,OAAO,MAAMC,wCAAwC,GAAG,CACvD,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CACN;AACV,OAAO,MAAMC,0CAA0C,GAAG,CACzD,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CACH","ignoreList":[]}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { EPSILON } from "../../../../constants";
|
|
4
|
+
import { resolveRevealContentBaseTransform } from "../reveal/math";
|
|
5
|
+
import { ZOOM_DISMISS_VELOCITY_DEPTH } from "./config";
|
|
6
|
+
const ZOOM_DRAG_SCALE_EXPONENT = 2;
|
|
7
|
+
const ZOOM_DRAG_SCALE_FLOOR = 0.5;
|
|
8
|
+
const ZOOM_COUNTER_DRAG_SCALE_INTENSITY = 0.4;
|
|
9
|
+
const ZOOM_PRIMARY_DRAG_TRANSLATION_SCALE = 0.8;
|
|
10
|
+
const ZOOM_PRIMARY_DRAG_RESISTANCE = 2;
|
|
11
|
+
const ZOOM_HORIZONTAL_DRAG_DISTANCE_SCALE = 1.5;
|
|
12
|
+
const ZOOM_CROSS_AXIS_DRAG_TRANSLATION_SCALE = 0.35;
|
|
13
|
+
const ZOOM_CROSS_AXIS_DRAG_RESISTANCE = 0.05;
|
|
14
|
+
const ZOOM_PINCH_SCALE_RESPONSE = 1;
|
|
15
|
+
const ZOOM_PINCH_VELOCITY_DEPTH_MULTIPLIER = 2;
|
|
16
|
+
export function resolveZoomDismissContentScale({
|
|
17
|
+
transitionRemaining,
|
|
18
|
+
releaseScale,
|
|
19
|
+
targetScale,
|
|
20
|
+
velocity,
|
|
21
|
+
velocityDepth
|
|
22
|
+
}) {
|
|
23
|
+
"worklet";
|
|
24
|
+
|
|
25
|
+
const closeProgress = 1 - transitionRemaining;
|
|
26
|
+
const depth = velocityDepth * velocity;
|
|
27
|
+
const scaleDelta = targetScale - releaseScale;
|
|
28
|
+
const controlScale1 = releaseScale + scaleDelta / 3;
|
|
29
|
+
const linearControlScale2 = releaseScale + 2 * scaleDelta / 3;
|
|
30
|
+
const controlScale2 = Math.max(EPSILON, linearControlScale2 * (1 - depth));
|
|
31
|
+
const remaining = 1 - closeProgress;
|
|
32
|
+
return remaining * remaining * remaining * releaseScale + 3 * remaining * remaining * closeProgress * controlScale1 + 3 * remaining * closeProgress * closeProgress * controlScale2 + closeProgress * closeProgress * closeProgress * targetScale;
|
|
33
|
+
}
|
|
34
|
+
export function resolveZoomPrimaryDragTranslation({
|
|
35
|
+
translation,
|
|
36
|
+
dimension
|
|
37
|
+
}) {
|
|
38
|
+
"worklet";
|
|
39
|
+
|
|
40
|
+
const direction = translation < 0 ? -1 : 1;
|
|
41
|
+
const translationDistance = Math.abs(translation);
|
|
42
|
+
const baseDistance = Math.max(1, dimension);
|
|
43
|
+
const normalizedTranslation = translationDistance / baseDistance;
|
|
44
|
+
const effectiveResistance = ZOOM_PRIMARY_DRAG_RESISTANCE * 0.85;
|
|
45
|
+
const resistedTranslation = baseDistance * (1 - Math.exp(-effectiveResistance * normalizedTranslation)) / effectiveResistance;
|
|
46
|
+
return direction * Math.min(baseDistance, resistedTranslation * ZOOM_PRIMARY_DRAG_TRANSLATION_SCALE);
|
|
47
|
+
}
|
|
48
|
+
export function resolveZoomHorizontalDragTranslation({
|
|
49
|
+
translation,
|
|
50
|
+
dimension
|
|
51
|
+
}) {
|
|
52
|
+
"worklet";
|
|
53
|
+
|
|
54
|
+
return resolveZoomPrimaryDragTranslation({
|
|
55
|
+
translation,
|
|
56
|
+
dimension
|
|
57
|
+
}) * ZOOM_HORIZONTAL_DRAG_DISTANCE_SCALE;
|
|
58
|
+
}
|
|
59
|
+
export function resolveZoomCrossAxisDragTranslation({
|
|
60
|
+
translation,
|
|
61
|
+
dimension
|
|
62
|
+
}) {
|
|
63
|
+
"worklet";
|
|
64
|
+
|
|
65
|
+
const direction = translation < 0 ? -1 : 1;
|
|
66
|
+
const translationDistance = Math.abs(translation);
|
|
67
|
+
const baseDistance = Math.max(1, dimension);
|
|
68
|
+
const normalizedTranslation = translationDistance / baseDistance;
|
|
69
|
+
const resistedTranslation = baseDistance * (1 - Math.exp(-ZOOM_CROSS_AXIS_DRAG_RESISTANCE * normalizedTranslation)) / ZOOM_CROSS_AXIS_DRAG_RESISTANCE;
|
|
70
|
+
return direction * Math.min(baseDistance, resistedTranslation * ZOOM_CROSS_AXIS_DRAG_TRANSLATION_SCALE);
|
|
71
|
+
}
|
|
72
|
+
export function resolveZoomDragScale(normalized) {
|
|
73
|
+
"worklet";
|
|
74
|
+
|
|
75
|
+
const scaleInput = normalized < 0 ? normalized * ZOOM_COUNTER_DRAG_SCALE_INTENSITY : normalized;
|
|
76
|
+
const progress = Math.min(1, scaleInput);
|
|
77
|
+
const rawMinimumScale = ZOOM_DRAG_SCALE_FLOOR ** (1 / ZOOM_DRAG_SCALE_EXPONENT);
|
|
78
|
+
const rawScale = 1 + (rawMinimumScale - 1) * progress;
|
|
79
|
+
return rawScale ** ZOOM_DRAG_SCALE_EXPONENT;
|
|
80
|
+
}
|
|
81
|
+
export function resolveZoomPinchScale(scale) {
|
|
82
|
+
"worklet";
|
|
83
|
+
|
|
84
|
+
return 1 + (scale - 1) * ZOOM_PINCH_SCALE_RESPONSE;
|
|
85
|
+
}
|
|
86
|
+
export function resolveZoomDismissalNorm(normalized, isInverted) {
|
|
87
|
+
"worklet";
|
|
88
|
+
|
|
89
|
+
return isInverted ? -normalized : normalized;
|
|
90
|
+
}
|
|
91
|
+
export function resolveZoomDragState({
|
|
92
|
+
gesture,
|
|
93
|
+
activeTransitionProgress,
|
|
94
|
+
screenLayout,
|
|
95
|
+
sourceBounds,
|
|
96
|
+
trackingContentTarget,
|
|
97
|
+
dragOptions
|
|
98
|
+
}) {
|
|
99
|
+
"worklet";
|
|
100
|
+
|
|
101
|
+
const gestureHandoff = gesture.handoff;
|
|
102
|
+
const isDismissing = gesture.dismissing === 1;
|
|
103
|
+
const activeGesture = gestureHandoff.active;
|
|
104
|
+
const isHorizontalInverted = activeGesture === "horizontal-inverted";
|
|
105
|
+
const isHorizontal = activeGesture === "horizontal" || isHorizontalInverted;
|
|
106
|
+
const isVerticalInverted = activeGesture === "vertical-inverted";
|
|
107
|
+
const isVertical = activeGesture === "vertical" || isVerticalInverted;
|
|
108
|
+
const isPinchIn = activeGesture === "pinch-in";
|
|
109
|
+
const isInverted = isHorizontalInverted || isVerticalInverted;
|
|
110
|
+
const translationResponse = Math.max(0, isHorizontal ? dragOptions?.translation?.horizontal ?? 1 : isVertical ? dragOptions?.translation?.vertical ?? 1 : 1);
|
|
111
|
+
const scaleResponse = Math.max(0, isHorizontal ? dragOptions?.scale?.horizontal ?? 1 : isVertical ? dragOptions?.scale?.vertical ?? 1 : 1);
|
|
112
|
+
const handoffPrimaryNorm = isPinchIn ? -gestureHandoff.normScale : isHorizontal ? gestureHandoff.normX : gestureHandoff.normY;
|
|
113
|
+
const livePrimaryNorm = isPinchIn ? -gesture.normScale : isHorizontal ? gesture.normX : gesture.normY;
|
|
114
|
+
const dismissNorm = Math.max(0, resolveZoomDismissalNorm(handoffPrimaryNorm, isInverted));
|
|
115
|
+
const nativeDragX = isPinchIn ? gesture.x : isHorizontal ? resolveZoomHorizontalDragTranslation({
|
|
116
|
+
translation: gesture.x,
|
|
117
|
+
dimension: screenLayout.width
|
|
118
|
+
}) : isVertical ? resolveZoomCrossAxisDragTranslation({
|
|
119
|
+
translation: gesture.x,
|
|
120
|
+
dimension: screenLayout.width
|
|
121
|
+
}) : 0;
|
|
122
|
+
const nativeDragY = isPinchIn ? gesture.y : isHorizontal ? resolveZoomCrossAxisDragTranslation({
|
|
123
|
+
translation: gesture.y,
|
|
124
|
+
dimension: screenLayout.height
|
|
125
|
+
}) : resolveZoomPrimaryDragTranslation({
|
|
126
|
+
translation: gesture.y,
|
|
127
|
+
dimension: screenLayout.height
|
|
128
|
+
});
|
|
129
|
+
const dragX = nativeDragX * translationResponse;
|
|
130
|
+
const dragY = nativeDragY * translationResponse;
|
|
131
|
+
const scaleNorm = resolveZoomDismissalNorm(isDismissing ? handoffPrimaryNorm : livePrimaryNorm, isInverted);
|
|
132
|
+
const nativeGestureScale = isPinchIn ? resolveZoomPinchScale(isDismissing ? gestureHandoff.scale : gesture.scale) : resolveZoomDragScale(scaleNorm);
|
|
133
|
+
const gestureScale = isPinchIn ? nativeGestureScale : Math.max(EPSILON, 1 + (nativeGestureScale - 1) * scaleResponse);
|
|
134
|
+
const rotation = isPinchIn ? isDismissing ? gestureHandoff.rotation * activeTransitionProgress : gesture.rotation : 0;
|
|
135
|
+
let dismissContentScale = gestureScale;
|
|
136
|
+
if (isDismissing) {
|
|
137
|
+
const targetContentScale = resolveRevealContentBaseTransform({
|
|
138
|
+
progress: 0,
|
|
139
|
+
sourceBounds,
|
|
140
|
+
destinationBounds: trackingContentTarget,
|
|
141
|
+
screenLayout
|
|
142
|
+
}).scale;
|
|
143
|
+
dismissContentScale = resolveZoomDismissContentScale({
|
|
144
|
+
transitionRemaining: activeTransitionProgress,
|
|
145
|
+
releaseScale: gestureScale,
|
|
146
|
+
targetScale: targetContentScale,
|
|
147
|
+
velocity: gestureHandoff.velocity,
|
|
148
|
+
velocityDepth: ZOOM_DISMISS_VELOCITY_DEPTH * (isPinchIn ? ZOOM_PINCH_VELOCITY_DEPTH_MULTIPLIER : 1)
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
collapsesMask: isVertical,
|
|
153
|
+
dismissContentScale,
|
|
154
|
+
dismissNorm,
|
|
155
|
+
dismissProgress: isDismissing ? 1 - activeTransitionProgress : 0,
|
|
156
|
+
dragX,
|
|
157
|
+
dragY,
|
|
158
|
+
gestureScale,
|
|
159
|
+
isDismissing,
|
|
160
|
+
isVerticalInverted,
|
|
161
|
+
rotation
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
export function resolveZoomTrackedGestureScale({
|
|
165
|
+
drag,
|
|
166
|
+
activeTransitionProgress,
|
|
167
|
+
screenLayout,
|
|
168
|
+
sourceBounds,
|
|
169
|
+
trackingContentTarget
|
|
170
|
+
}) {
|
|
171
|
+
"worklet";
|
|
172
|
+
|
|
173
|
+
if (!drag.isDismissing) {
|
|
174
|
+
return drag.gestureScale;
|
|
175
|
+
}
|
|
176
|
+
const trackedContentBaseScale = resolveRevealContentBaseTransform({
|
|
177
|
+
progress: activeTransitionProgress,
|
|
178
|
+
sourceBounds,
|
|
179
|
+
destinationBounds: trackingContentTarget,
|
|
180
|
+
screenLayout
|
|
181
|
+
}).scale;
|
|
182
|
+
return drag.dismissContentScale / trackedContentBaseScale;
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=drag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["EPSILON","resolveRevealContentBaseTransform","ZOOM_DISMISS_VELOCITY_DEPTH","ZOOM_DRAG_SCALE_EXPONENT","ZOOM_DRAG_SCALE_FLOOR","ZOOM_COUNTER_DRAG_SCALE_INTENSITY","ZOOM_PRIMARY_DRAG_TRANSLATION_SCALE","ZOOM_PRIMARY_DRAG_RESISTANCE","ZOOM_HORIZONTAL_DRAG_DISTANCE_SCALE","ZOOM_CROSS_AXIS_DRAG_TRANSLATION_SCALE","ZOOM_CROSS_AXIS_DRAG_RESISTANCE","ZOOM_PINCH_SCALE_RESPONSE","ZOOM_PINCH_VELOCITY_DEPTH_MULTIPLIER","resolveZoomDismissContentScale","transitionRemaining","releaseScale","targetScale","velocity","velocityDepth","closeProgress","depth","scaleDelta","controlScale1","linearControlScale2","controlScale2","Math","max","remaining","resolveZoomPrimaryDragTranslation","translation","dimension","direction","translationDistance","abs","baseDistance","normalizedTranslation","effectiveResistance","resistedTranslation","exp","min","resolveZoomHorizontalDragTranslation","resolveZoomCrossAxisDragTranslation","resolveZoomDragScale","normalized","scaleInput","progress","rawMinimumScale","rawScale","resolveZoomPinchScale","scale","resolveZoomDismissalNorm","isInverted","resolveZoomDragState","gesture","activeTransitionProgress","screenLayout","sourceBounds","trackingContentTarget","dragOptions","gestureHandoff","handoff","isDismissing","dismissing","activeGesture","active","isHorizontalInverted","isHorizontal","isVerticalInverted","isVertical","isPinchIn","translationResponse","horizontal","vertical","scaleResponse","handoffPrimaryNorm","normScale","normX","normY","livePrimaryNorm","dismissNorm","nativeDragX","x","width","nativeDragY","y","height","dragX","dragY","scaleNorm","nativeGestureScale","gestureScale","rotation","dismissContentScale","targetContentScale","destinationBounds","collapsesMask","dismissProgress","resolveZoomTrackedGestureScale","drag","trackedContentBaseScale"],"sourceRoot":"../../../../../../../src","sources":["shared/utils/bounds/navigation/zoom/drag.ts"],"mappings":";;AACA,SAASA,OAAO,QAAQ,uBAAuB;AAM/C,SAASC,iCAAiC,QAAQ,gBAAgB;AAClE,SAASC,2BAA2B,QAAQ,UAAU;AAEtD,MAAMC,wBAAwB,GAAG,CAAC;AAClC,MAAMC,qBAAqB,GAAG,GAAG;AACj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AE2E,YAAY;MAC1B1E,WAAW,EAAE6E,kBAAkB;MAC/B5E,QAAQ,EAAE0C,cAAc,CAAC1C,QAAQ;MACjCC,aAAa,EACZhB,2BAA2B,IAC1BmE,SAAS,GAAGzD,oCAAoC,GAAG,CAAC;IACvD,CAAC,CAAC;EACH;EAEA,OAAO;IACNmF,aAAa,EAAE3B,UAAU;IACzBwB,mBAAmB;IACnBb,WAAW;IACXiB,eAAe,EAAEnC,YAAY,GAAG,CAAC,GAAGP,wBAAwB,GAAG,CAAC;IAChEgC,KAAK;IACLC,KAAK;IACLG,YAAY;IACZ7B,YAAY;IACZM,kBAAkB;IAClBwB;EACD,CAAC;AACF;AAEA,OAAO,SAASM,8BAA8BA,CAAC;EAC9CC,IAAI;EACJ5C,wBAAwB;EACxBC,YAAY;EACZC,YAAY;EACZC;AAOD,CAAC,EAAE;EACF,SAAS;;EAET,IAAI,CAACyC,IAAI,CAACrC,YAAY,EAAE;IACvB,OAAOqC,IAAI,CAACR,YAAY;EACzB;EAEA,MAAMS,uBAAuB,GAAGlG,iCAAiC,CAAC;IACjE4C,QAAQ,EAAES,wBAAwB;IAClCE,YAAY;IACZsC,iBAAiB,EAAErC,qBAAqB;IACxCF;EACD,CAAC,CAAC,CAACN,KAAK;EAER,OAAOiD,IAAI,CAACN,mBAAmB,GAAGO,uBAAuB;AAC1D","ignoreList":[]}
|
|
@@ -1,121 +1,110 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { interpolate } from "react-native-reanimated";
|
|
4
3
|
import { EPSILON } from "../../../../constants";
|
|
5
|
-
import {
|
|
6
|
-
export function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import { resolveRevealContentBaseTransform, resolveTrackedSourceElementTransform } from "../reveal/math";
|
|
5
|
+
export function resolveZoomBackdropOpacity({
|
|
6
|
+
transitionProgress,
|
|
7
|
+
dismissalDrag,
|
|
8
|
+
fadeEnd,
|
|
9
|
+
maxOpacity
|
|
11
10
|
}) {
|
|
12
11
|
"worklet";
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const height = sourceBounds.height / sourceBounds.width * screenWidth;
|
|
21
|
-
const verticalAnchor = anchor === "bottomLeading" || anchor === "bottom" || anchor === "bottomTrailing" ? "bottom" : anchor === "center" || anchor === "leading" || anchor === "trailing" ? "center" : "top";
|
|
22
|
-
const y = verticalAnchor === "top" ? 0 : verticalAnchor === "bottom" ? screenLayout.height - height : (screenLayout.height - height) / 2;
|
|
23
|
-
return {
|
|
24
|
-
x: 0,
|
|
25
|
-
y,
|
|
26
|
-
pageX: 0,
|
|
27
|
-
pageY: y,
|
|
28
|
-
width: screenWidth,
|
|
29
|
-
height
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export function resolveDragScaleTuple(value) {
|
|
33
|
-
"worklet";
|
|
34
|
-
|
|
35
|
-
return {
|
|
36
|
-
shrinkMin: value?.[0] ?? ZOOM_DRAG_DIRECTIONAL_SCALE_MIN,
|
|
37
|
-
growMax: value?.[1] ?? ZOOM_DRAG_DIRECTIONAL_SCALE_MAX,
|
|
38
|
-
exponent: value?.[2] ?? ZOOM_DRAG_DIRECTIONAL_SCALE_EXPONENT
|
|
39
|
-
};
|
|
13
|
+
const clampedProgress = Math.min(1, Math.max(0, transitionProgress));
|
|
14
|
+
const clampedDrag = Math.min(1, Math.max(0, dismissalDrag));
|
|
15
|
+
const safeFadeEnd = Math.max(EPSILON, fadeEnd);
|
|
16
|
+
const transitionOpacity = Math.min(1, clampedProgress / safeFadeEnd);
|
|
17
|
+
const clampedMaxOpacity = Math.min(1, Math.max(0, maxOpacity));
|
|
18
|
+
return clampedMaxOpacity * transitionOpacity * (1 - clampedDrag);
|
|
40
19
|
}
|
|
41
|
-
export function
|
|
20
|
+
export function resolveZoomPinchFocalOffset({
|
|
21
|
+
gestureScale,
|
|
22
|
+
pinchOriginX,
|
|
23
|
+
pinchOriginY,
|
|
24
|
+
progress,
|
|
25
|
+
rotation,
|
|
26
|
+
screenLayout
|
|
27
|
+
}) {
|
|
42
28
|
"worklet";
|
|
43
29
|
|
|
30
|
+
if (Math.abs(gestureScale - 1) <= EPSILON && Math.abs(rotation) <= EPSILON) {
|
|
31
|
+
return {
|
|
32
|
+
x: 0,
|
|
33
|
+
y: 0
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const offsetX = pinchOriginX - screenLayout.width / 2;
|
|
37
|
+
const offsetY = pinchOriginY - screenLayout.height / 2;
|
|
38
|
+
const cosine = Math.cos(rotation);
|
|
39
|
+
const sine = Math.sin(rotation);
|
|
40
|
+
const transformedOffsetX = gestureScale * (offsetX * cosine - offsetY * sine);
|
|
41
|
+
const transformedOffsetY = gestureScale * (offsetX * sine + offsetY * cosine);
|
|
42
|
+
const clampedProgress = Math.min(1, Math.max(0, progress));
|
|
44
43
|
return {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
exponent: value?.[2] ?? ZOOM_DRAG_TRANSLATION_EXPONENT
|
|
44
|
+
x: (offsetX - transformedOffsetX) * clampedProgress,
|
|
45
|
+
y: (offsetY - transformedOffsetY) * clampedProgress
|
|
48
46
|
};
|
|
49
47
|
}
|
|
50
|
-
export function
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const resolveMotionDirection = ({
|
|
61
|
-
normX,
|
|
62
|
-
normY,
|
|
63
|
-
rawNormX,
|
|
64
|
-
rawNormY
|
|
65
|
-
}) => {
|
|
66
|
-
"worklet";
|
|
67
|
-
|
|
68
|
-
const motionX = Math.max(Math.abs(normX), Math.abs(rawNormX));
|
|
69
|
-
const motionY = Math.max(Math.abs(normY), Math.abs(rawNormY));
|
|
70
|
-
if (motionX <= EPSILON && motionY <= EPSILON) {
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
if (motionY > motionX + EPSILON) {
|
|
74
|
-
return normY < 0 || rawNormY < 0 ? "vertical-inverted" : "vertical";
|
|
75
|
-
}
|
|
76
|
-
if (motionX > motionY + EPSILON) {
|
|
77
|
-
return normX < 0 || rawNormX < 0 ? "horizontal-inverted" : "horizontal";
|
|
78
|
-
}
|
|
79
|
-
return null;
|
|
80
|
-
};
|
|
81
|
-
export function resolveZoomPanGestureDirection({
|
|
82
|
-
active,
|
|
83
|
-
direction,
|
|
84
|
-
normX,
|
|
85
|
-
normY,
|
|
86
|
-
rawNormX,
|
|
87
|
-
rawNormY
|
|
48
|
+
export function resolveZoomTrackedSourceTransform({
|
|
49
|
+
progress,
|
|
50
|
+
sourceBounds,
|
|
51
|
+
destinationBounds,
|
|
52
|
+
screenLayout,
|
|
53
|
+
dragX,
|
|
54
|
+
dragY,
|
|
55
|
+
gestureScale,
|
|
56
|
+
parentScale,
|
|
57
|
+
rotation = 0
|
|
88
58
|
}) {
|
|
89
59
|
"worklet";
|
|
90
60
|
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
rawNormY
|
|
61
|
+
const contentBaseTransform = resolveRevealContentBaseTransform({
|
|
62
|
+
progress,
|
|
63
|
+
sourceBounds,
|
|
64
|
+
destinationBounds,
|
|
65
|
+
screenLayout
|
|
97
66
|
});
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
const
|
|
105
|
-
const
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
67
|
+
const collapsedContentScale = resolveRevealContentBaseTransform({
|
|
68
|
+
progress: 0,
|
|
69
|
+
sourceBounds,
|
|
70
|
+
destinationBounds,
|
|
71
|
+
screenLayout
|
|
72
|
+
}).scale;
|
|
73
|
+
const contentScale = contentBaseTransform.scale * gestureScale;
|
|
74
|
+
const safeCollapsedContentScale = Math.max(Math.abs(collapsedContentScale), EPSILON);
|
|
75
|
+
const safeParentScale = Math.max(Math.abs(parentScale), EPSILON);
|
|
76
|
+
const uniformSourceScale = contentScale / (safeCollapsedContentScale * safeParentScale);
|
|
77
|
+
const trackedTransform = {
|
|
78
|
+
...resolveTrackedSourceElementTransform({
|
|
79
|
+
sourceBounds,
|
|
80
|
+
destinationBounds,
|
|
81
|
+
contentTranslateX: contentBaseTransform.translateX + dragX,
|
|
82
|
+
contentTranslateY: contentBaseTransform.translateY + dragY,
|
|
83
|
+
contentScale,
|
|
84
|
+
parentScale,
|
|
85
|
+
screenWidth: screenLayout.width,
|
|
86
|
+
screenHeight: screenLayout.height
|
|
87
|
+
}),
|
|
88
|
+
scaleX: uniformSourceScale,
|
|
89
|
+
scaleY: uniformSourceScale
|
|
90
|
+
};
|
|
91
|
+
if (Math.abs(rotation) <= EPSILON) {
|
|
92
|
+
return trackedTransform;
|
|
109
93
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
94
|
+
const screenCenterX = screenLayout.width / 2;
|
|
95
|
+
const screenCenterY = screenLayout.height / 2;
|
|
96
|
+
const destinationCenterX = destinationBounds.pageX + destinationBounds.width / 2;
|
|
97
|
+
const destinationCenterY = destinationBounds.pageY + destinationBounds.height / 2;
|
|
98
|
+
const scaledOffsetX = (destinationCenterX - screenCenterX) * contentScale;
|
|
99
|
+
const scaledOffsetY = (destinationCenterY - screenCenterY) * contentScale;
|
|
100
|
+
const cosine = Math.cos(rotation);
|
|
101
|
+
const sine = Math.sin(rotation);
|
|
102
|
+
const rotatedOffsetX = scaledOffsetX * cosine - scaledOffsetY * sine;
|
|
103
|
+
const rotatedOffsetY = scaledOffsetX * sine + scaledOffsetY * cosine;
|
|
104
|
+
return {
|
|
105
|
+
...trackedTransform,
|
|
106
|
+
translateX: trackedTransform.translateX + (rotatedOffsetX - scaledOffsetX) / safeParentScale,
|
|
107
|
+
translateY: trackedTransform.translateY + (rotatedOffsetY - scaledOffsetY) / safeParentScale
|
|
108
|
+
};
|
|
120
109
|
}
|
|
121
110
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["EPSILON","resolveRevealContentBaseTransform","resolveTrackedSourceElementTransform","resolveZoomBackdropOpacity","transitionProgress","dismissalDrag","fadeEnd","maxOpacity","clampedProgress","Math","min","max","clampedDrag","safeFadeEnd","transitionOpacity","clampedMaxOpacity","resolveZoomPinchFocalOffset","gestureScale","pinchOriginX","pinchOriginY","progress","rotation","screenLayout","abs","x","y","offsetX","width","offsetY","height","cosine","cos","sine","sin","transformedOffsetX","transformedOffsetY","resolveZoomTrackedSourceTransform","sourceBounds","destinationBounds","dragX","dragY","parentScale","contentBaseTransform","collapsedContentScale","scale","contentScale","safeCollapsedContentScale","safeParentScale","uniformSourceScale","trackedTransform","contentTranslateX","translateX","contentTranslateY","translateY","screenWidth","screenHeight","scaleX","scaleY","screenCenterX","screenCenterY","destinationCenterX","pageX","destinationCenterY","pageY","scaledOffsetX","scaledOffsetY","rotatedOffsetX","rotatedOffsetY"],"sourceRoot":"../../../../../../../src","sources":["shared/utils/bounds/navigation/zoom/helpers.ts"],"mappings":";;AACA,SAASA,OAAO,QAAQ,uBAAuB;AAE/C,SACCC,iCAAiC,EACjCC,oCAAoC,QAC9B,gBAAgB;AAEvB,OAAO,SAASC,0BAA0BA,CAAC;EAC1CC,kBAAkB;EAClBC,aAAa;EACbC,OAAO;EACPC;AAMD,CAAC,EAAE;EACF,SAAS;;EAET,MAAMC,eAAe,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAED,IAAI,CAACE,GAAG,CAAC,CAAC,EAAEP,kBAAkB,CAAC,CAAC;EACpE,MAAMQ,WAAW,GAAGH,IAAI,CAACC,GAAG,CAAC,CAAC,EA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U,GAC3B,CAACc,cAAc,GAAGF,aAAa,IAAIlB;EACrC,CAAC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { interpolate } from "react-native-reanimated";
|
|
4
|
+
import { toNumber } from "../helpers";
|
|
5
|
+
import { DRAG_MASK_HEIGHT_COLLAPSE_END } from "../reveal/config";
|
|
6
|
+
import { interpolateClamped, resolveAspectRatioMaskHeight } from "../reveal/math";
|
|
7
|
+
import { ZOOM_SHARED_OPTIONS } from "./config";
|
|
8
|
+
export const ZOOM_NAVIGATION_MASK_BORDER_RADIUS = 64;
|
|
9
|
+
const ZOOM_VERTICAL_DRAG_MASK_COLLAPSE_SCALE = 0.8;
|
|
10
|
+
export function resolveZoomNavigationMaskStyle({
|
|
11
|
+
scopedBounds,
|
|
12
|
+
link,
|
|
13
|
+
sourceBounds,
|
|
14
|
+
screenLayout,
|
|
15
|
+
transitionProgress,
|
|
16
|
+
drag,
|
|
17
|
+
contentTransform,
|
|
18
|
+
sourceBorderRadius,
|
|
19
|
+
expandedBorderRadius,
|
|
20
|
+
active
|
|
21
|
+
}) {
|
|
22
|
+
"worklet";
|
|
23
|
+
|
|
24
|
+
const maskRaw = scopedBounds.values({
|
|
25
|
+
scaleMode: ZOOM_SHARED_OPTIONS.scaleMode,
|
|
26
|
+
anchor: ZOOM_SHARED_OPTIONS.anchor,
|
|
27
|
+
method: "size",
|
|
28
|
+
space: "absolute",
|
|
29
|
+
target: "fullscreen",
|
|
30
|
+
progress: transitionProgress
|
|
31
|
+
});
|
|
32
|
+
const maskWidth = maskRaw.width;
|
|
33
|
+
const maskHeight = maskRaw.height;
|
|
34
|
+
const maskAspectBounds = link.initialSource?.bounds ?? sourceBounds;
|
|
35
|
+
const minMaskHeight = resolveAspectRatioMaskHeight({
|
|
36
|
+
maskWidth,
|
|
37
|
+
maskHeight,
|
|
38
|
+
targetWidth: maskAspectBounds.width,
|
|
39
|
+
targetHeight: maskAspectBounds.height
|
|
40
|
+
});
|
|
41
|
+
const maskHeightCollapseDrag = drag.collapsesMask ? Math.max(0, drag.dismissNorm * ZOOM_VERTICAL_DRAG_MASK_COLLAPSE_SCALE, drag.dismissProgress) : 0;
|
|
42
|
+
const renderedMaskHeight = interpolateClamped(maskHeightCollapseDrag, 0, DRAG_MASK_HEIGHT_COLLAPSE_END, maskHeight, minMaskHeight);
|
|
43
|
+
const maskCenterX = maskWidth / 2;
|
|
44
|
+
const maskCenterY = renderedMaskHeight / 2;
|
|
45
|
+
const contentCenterX = screenLayout.width / 2;
|
|
46
|
+
const contentCenterY = screenLayout.height / 2;
|
|
47
|
+
const maskOriginOffsetY = drag.isVerticalInverted ? maskHeight - renderedMaskHeight : 0;
|
|
48
|
+
const compensatedMaskTranslateX = (maskRaw.translateX - contentTransform.translateX + (1 - contentTransform.scale) * (maskCenterX - contentCenterX)) / contentTransform.scale;
|
|
49
|
+
const compensatedMaskTranslateY = (maskRaw.translateY - contentTransform.translateY + maskOriginOffsetY + (1 - contentTransform.scale) * (maskCenterY - contentCenterY)) / contentTransform.scale;
|
|
50
|
+
const initialSourceBorderRadius = toNumber(link.initialSource?.styles.borderRadius, sourceBorderRadius);
|
|
51
|
+
return {
|
|
52
|
+
style: {
|
|
53
|
+
width: maskWidth,
|
|
54
|
+
height: renderedMaskHeight,
|
|
55
|
+
borderRadius: interpolate(transitionProgress, [0, 1], [initialSourceBorderRadius, active.animating ? expandedBorderRadius : 0], "clamp"),
|
|
56
|
+
borderCurve: "continuous",
|
|
57
|
+
transform: [{
|
|
58
|
+
translateX: compensatedMaskTranslateX
|
|
59
|
+
}, {
|
|
60
|
+
translateY: compensatedMaskTranslateY
|
|
61
|
+
}, {
|
|
62
|
+
scale: 1 / contentTransform.scale
|
|
63
|
+
}]
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=mask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["interpolate","toNumber","DRAG_MASK_HEIGHT_COLLAPSE_END","interpolateClamped","resolveAspectRatioMaskHeight","ZOOM_SHARED_OPTIONS","ZOOM_NAVIGATION_MASK_BORDER_RADIUS","ZOOM_VERTICAL_DRAG_MASK_COLLAPSE_SCALE","resolveZoomNavigationMaskStyle","scopedBounds","link","sourceBounds","screenLayout","transitionProgress","drag","contentTransform","sourceBorderRadius","expandedBorderRadius","active","maskRaw","values","scaleMode","anchor","method","space","target","progress","maskWidth","width","maskHeight","height","maskAspectBounds","initialSource","bounds","minMaskHeight","targetWidth","targetHeight","maskHeightCollapseDrag","collapsesMask","Math","max","dismissNorm","dismissProgress","renderedMaskHeight","maskCenterX","maskCenterY","contentCenterX","contentCenterY","maskOriginOffsetY","isVerticalInverted","compensatedMaskTranslateX","translateX","scale","compensatedMaskTranslateY","translateY","initialSourceBorderRadius","styles","borderRadius","style","animating","borderCurve","transform"],"sourceRoot":"../../../../../../../src","sources":["shared/utils/bounds/navigation/zoom/mask.ts"],"mappings":";;AACA,SAASA,WAAW,QAAQ,yBAAyB;AAUrD,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,6BAA6B,QAAQ,kBAAkB;AAChE,SACCC,kBAAkB,EAClBC,4BAA4B,QACtB,gBAAgB;AACvB,SAASC,mBAAmB,QAAQ,UAAU;AAG9C,OAAO,MAAMC,kCAAkC,GAAG,EAAE;AACpD,MAAMC,sCAAsC,GAAG,GAAG;AAmBlD,OAAO,SAASC,8BAA8BA,CAAC;EAC9CC,YAAY;EACZC,IAAI;EACJC,YAAY;EACZC,YAAY;EACZC,kBAAkB;EAClBC,IAAI;EACJC,gBAAgB;EAChBC,kBAAkB;EAClBC,oBAAoB;EACpBC;AAC6B,CAAC,EAAuB;EACrD,SAAS;;EAET,MAAMC,OAAO,GAAGV,YAAY,CAACW,MAAM,CAAC;IACnCC,SAAS,EAAEhB,mBAAmB,CAACgB,SAAS;IACxCC,MAAM,EAAEjB,mBAAmB,CAACiB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BAAgB,CAACqC,KAAK;EACvB,MAAMC,yBAAyB,GAC9B,CAAClC,OAAO,CAACmC,UAAU,GAClBvC,gBAAgB,CAACuC,UAAU,GAC3BN,iBAAiB,GACjB,CAAC,CAAC,GAAGjC,gBAAgB,CAACqC,KAAK,KAAKP,WAAW,GAAGE,cAAc,CAAC,IAC9DhC,gBAAgB,CAACqC,KAAK;EACvB,MAAMG,yBAAyB,GAAGtD,QAAQ,CACzCS,IAAI,CAACsB,aAAa,EAAEwB,MAAM,CAACC,YAAY,EACvCzC,kBACD,CAAC;EAED,OAAO;IACN0C,KAAK,EAAE;MACN9B,KAAK,EAAED,SAAS;MAChBG,MAAM,EAAEa,kBAAkB;MAC1Bc,YAAY,EAAEzD,WAAW,CACxBa,kBAAkB,EAClB,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CACC0C,yBAAyB,EACzBrC,MAAM,CAACyC,SAAS,GAAG1C,oBAAoB,GAAG,CAAC,CAC3C,EACD,OACD,CAAC;MACD2C,WAAW,EAAE,YAAY;MACzBC,SAAS,EAAE,CACV;QAAEV,UAAU,EAAED;MAA0B,CAAC,EACzC;QAAEI,UAAU,EAAED;MAA0B,CAAC,EACzC;QAAED,KAAK,EAAE,CAAC,GAAGrC,gBAAgB,CAACqC;MAAM,CAAC;IAEvC;EACD,CAAC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export function getZoomContentTarget({
|
|
4
|
+
explicitTarget,
|
|
5
|
+
screenLayout,
|
|
6
|
+
link
|
|
7
|
+
}) {
|
|
8
|
+
"worklet";
|
|
9
|
+
|
|
10
|
+
if (explicitTarget !== undefined) {
|
|
11
|
+
return explicitTarget;
|
|
12
|
+
}
|
|
13
|
+
const sourceBounds = link.source?.bounds;
|
|
14
|
+
const screenWidth = screenLayout.width;
|
|
15
|
+
if (!sourceBounds || sourceBounds.width <= 0 || screenWidth <= 0) {
|
|
16
|
+
return "fullscreen";
|
|
17
|
+
}
|
|
18
|
+
const height = sourceBounds.height / sourceBounds.width * screenWidth;
|
|
19
|
+
return {
|
|
20
|
+
x: 0,
|
|
21
|
+
y: 0,
|
|
22
|
+
pageX: 0,
|
|
23
|
+
pageY: 0,
|
|
24
|
+
width: screenWidth,
|
|
25
|
+
height
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export function resolveZoomTrackingContentTarget({
|
|
29
|
+
contentTarget,
|
|
30
|
+
link,
|
|
31
|
+
screenLayout
|
|
32
|
+
}) {
|
|
33
|
+
"worklet";
|
|
34
|
+
|
|
35
|
+
if (typeof contentTarget === "object") {
|
|
36
|
+
return contentTarget;
|
|
37
|
+
}
|
|
38
|
+
if (contentTarget === "bound") {
|
|
39
|
+
return link.destination?.bounds;
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
x: 0,
|
|
43
|
+
y: 0,
|
|
44
|
+
pageX: 0,
|
|
45
|
+
pageY: 0,
|
|
46
|
+
width: screenLayout.width,
|
|
47
|
+
height: screenLayout.height
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=targets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getZoomContentTarget","explicitTarget","screenLayout","link","undefined","sourceBounds","source","bounds","screenWidth","width","height","x","y","pageX","pageY","resolveZoomTrackingContentTarget","contentTarget","destination"],"sourceRoot":"../../../../../../../src","sources":["shared/utils/bounds/navigation/zoom/targets.ts"],"mappings":";;AAYA,OAAO,SAASA,oBAAoBA,CAAC;EACpCC,cAAc;EACdC,YAAY;EACZC;AAKD,CAAC,EAAqB;EACrB,SAAS;;EAET,IAAIF,cAAc,KAAKG,SAAS,EAAE;IACjC,OAAOH,cAAc;EACtB;EAEA,MAAMI,YAAY,GAAGF,IAAI,CAACG,MAAM,EAAEC,MAAM;EACxC,MAAMC,WAAW,GAAGN,YAAY,CAACO,KAAK;EAEtC,IAAI,CAACJ,YAAY,IAAIA,YAAY,CAACI,KAAK,IAAI,CAAC,IAAID,WAAW,IAAI,CAAC,EAAE;IACjE,OAAO,YAAY;EACpB;EAEA,MAAME,MAAM,GAAIL,YAAY,CAACK,MAAM,GAAGL,YAAY,CAACI,KAAK,GAAID,WAAW;EAEvE,OAAO;IACNG,CAAC,EAAE,CAAC;IACJC,CAAC,EAAE,CAAC;IACJC,KAAK,EAAE,CAAC;IACRC,KAAK,EAAE,CAAC;IACRL,KAAK,EAAED,WAAW;IAClBE;EACD,CAAC;AACF;AAEA,OAAO,SAASK,gCAAgCA,CAAC;EAChDC,aAAa;EACbb,IAAI;EACJD;AAKD,CAAC,EAAkC;EAClC,SAAS;;EAET,IAAI,OAAOc,aAAa,KAAK,QAAQ,EAAE;IACtC,OAAOA,aAAa;EACrB;EAEA,IAAIA,aAAa,KAAK,OAAO,EAAE;IAC9B,OAAOb,IAAI,CAACc,WAAW,EAAEV,MAAM;EAChC;EAEA,OAAO;IACNI,CAAC,EAAE,CAAC;IACJC,CAAC,EAAE,CAAC;IACJC,KAAK,EAAE,CAAC;IACRC,KAAK,EAAE,CAAC;IACRL,KAAK,EAAEP,YAAY,CAACO,KAAK;IACzBC,MAAM,EAAER,YAAY,CAACQ;EACtB,CAAC;AACF","ignoreList":[]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
2
|
import Animated from "react-native-reanimated";
|
|
3
|
-
type BoundaryTargetProps = React.ComponentProps<typeof Animated.View
|
|
3
|
+
type BoundaryTargetProps = Omit<React.ComponentProps<typeof Animated.View>, "children"> & {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
};
|
|
4
6
|
export declare const BoundaryTarget: React.MemoExoticComponent<(props: BoundaryTargetProps) => import("react/jsx-runtime").JSX.Element>;
|
|
5
7
|
export {};
|
|
6
8
|
//# sourceMappingURL=boundary-target.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boundary-target.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/components/boundary/components/boundary-target.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,QAA4B,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"boundary-target.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/components/boundary/components/boundary-target.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,QAA4B,MAAM,yBAAyB,CAAC;AAcnE,KAAK,mBAAmB,GAAG,IAAI,CAC9B,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,IAAI,CAAC,EAC1C,UAAU,CACV,GAAG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,cAAc,oCACnB,mBAAmB,6CA+DzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-initial-destination-measurement.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAGhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAWnD,UAAU,sCAAsC;IAC/C,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,eAAe,CAAC;CACjC;AAED,eAAO,MAAM,gCAAgC,GAAI,yDAK9C,sCAAsC,
|
|
1
|
+
{"version":3,"file":"use-initial-destination-measurement.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAGhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAWnD,UAAU,sCAAsC;IAC/C,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,eAAe,CAAC;CACjC;AAED,eAAO,MAAM,gCAAgC,GAAI,yDAK9C,sCAAsC,SAsLxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shared/components/boundary/portal/components/boundary-content-portal/components/host.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAU7C,KAAK,8BAA8B,GAAG;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,yBAAyB,sFAMlC,8BAA8B,
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shared/components/boundary/portal/components/boundary-content-portal/components/host.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAU7C,KAAK,8BAA8B,GAAG;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,yBAAyB,sFAMlC,8BAA8B,6CAqBjC,CAAC"}
|