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","exports","Object","freeze","anchor","scaleMode","
|
|
1
|
+
{"version":3,"names":["ZOOM_SHARED_OPTIONS","exports","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":";;;;;;AAAO,MAAMA,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAGE,MAAM,CAACC,MAAM,CAAC;EAChDC,MAAM,EAAE,KAAc;EACtBC,SAAS,EAAE;AACZ,CAAC,CAAC;AAEK,MAAMC,2BAA2B,GAAAL,OAAA,CAAAK,2BAAA,GAAG,GAAG;AACvC,MAAMC,qBAAqB,GAAAN,OAAA,CAAAM,qBAAA,GAAG,MAAM;AAC3C;AACO,MAAMC,yBAAyB,GAAAP,OAAA,CAAAO,yBAAA,GAAG,IAAI;AAC7C;AACO,MAAMC,sBAAsB,GAAAR,OAAA,CAAAQ,sBAAA,GAAG,IAAI;AAC1C;AACO,MAAMC,uCAAuC,GAAAT,OAAA,CAAAS,uCAAA,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAU;AACvE,MAAMC,yCAAyC,GAAAV,OAAA,CAAAU,yCAAA,GAAG,CACxD,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CACN;AACV;AACO,MAAMC,wCAAwC,GAAAX,OAAA,CAAAW,wCAAA,GAAG,CACvD,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CACN;AACH,MAAMC,0CAA0C,GAAAZ,OAAA,CAAAY,0CAAA,GAAG,CACzD,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CACH","ignoreList":[]}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.resolveZoomCrossAxisDragTranslation = resolveZoomCrossAxisDragTranslation;
|
|
7
|
+
exports.resolveZoomDismissContentScale = resolveZoomDismissContentScale;
|
|
8
|
+
exports.resolveZoomDismissalNorm = resolveZoomDismissalNorm;
|
|
9
|
+
exports.resolveZoomDragScale = resolveZoomDragScale;
|
|
10
|
+
exports.resolveZoomDragState = resolveZoomDragState;
|
|
11
|
+
exports.resolveZoomHorizontalDragTranslation = resolveZoomHorizontalDragTranslation;
|
|
12
|
+
exports.resolveZoomPinchScale = resolveZoomPinchScale;
|
|
13
|
+
exports.resolveZoomPrimaryDragTranslation = resolveZoomPrimaryDragTranslation;
|
|
14
|
+
exports.resolveZoomTrackedGestureScale = resolveZoomTrackedGestureScale;
|
|
15
|
+
var _constants = require("../../../../constants");
|
|
16
|
+
var _math = require("../reveal/math");
|
|
17
|
+
var _config = require("./config");
|
|
18
|
+
const ZOOM_DRAG_SCALE_EXPONENT = 2;
|
|
19
|
+
const ZOOM_DRAG_SCALE_FLOOR = 0.5;
|
|
20
|
+
const ZOOM_COUNTER_DRAG_SCALE_INTENSITY = 0.4;
|
|
21
|
+
const ZOOM_PRIMARY_DRAG_TRANSLATION_SCALE = 0.8;
|
|
22
|
+
const ZOOM_PRIMARY_DRAG_RESISTANCE = 2;
|
|
23
|
+
const ZOOM_HORIZONTAL_DRAG_DISTANCE_SCALE = 1.5;
|
|
24
|
+
const ZOOM_CROSS_AXIS_DRAG_TRANSLATION_SCALE = 0.35;
|
|
25
|
+
const ZOOM_CROSS_AXIS_DRAG_RESISTANCE = 0.05;
|
|
26
|
+
const ZOOM_PINCH_SCALE_RESPONSE = 1;
|
|
27
|
+
const ZOOM_PINCH_VELOCITY_DEPTH_MULTIPLIER = 2;
|
|
28
|
+
function resolveZoomDismissContentScale({
|
|
29
|
+
transitionRemaining,
|
|
30
|
+
releaseScale,
|
|
31
|
+
targetScale,
|
|
32
|
+
velocity,
|
|
33
|
+
velocityDepth
|
|
34
|
+
}) {
|
|
35
|
+
"worklet";
|
|
36
|
+
|
|
37
|
+
const closeProgress = 1 - transitionRemaining;
|
|
38
|
+
const depth = velocityDepth * velocity;
|
|
39
|
+
const scaleDelta = targetScale - releaseScale;
|
|
40
|
+
const controlScale1 = releaseScale + scaleDelta / 3;
|
|
41
|
+
const linearControlScale2 = releaseScale + 2 * scaleDelta / 3;
|
|
42
|
+
const controlScale2 = Math.max(_constants.EPSILON, linearControlScale2 * (1 - depth));
|
|
43
|
+
const remaining = 1 - closeProgress;
|
|
44
|
+
return remaining * remaining * remaining * releaseScale + 3 * remaining * remaining * closeProgress * controlScale1 + 3 * remaining * closeProgress * closeProgress * controlScale2 + closeProgress * closeProgress * closeProgress * targetScale;
|
|
45
|
+
}
|
|
46
|
+
function resolveZoomPrimaryDragTranslation({
|
|
47
|
+
translation,
|
|
48
|
+
dimension
|
|
49
|
+
}) {
|
|
50
|
+
"worklet";
|
|
51
|
+
|
|
52
|
+
const direction = translation < 0 ? -1 : 1;
|
|
53
|
+
const translationDistance = Math.abs(translation);
|
|
54
|
+
const baseDistance = Math.max(1, dimension);
|
|
55
|
+
const normalizedTranslation = translationDistance / baseDistance;
|
|
56
|
+
const effectiveResistance = ZOOM_PRIMARY_DRAG_RESISTANCE * 0.85;
|
|
57
|
+
const resistedTranslation = baseDistance * (1 - Math.exp(-effectiveResistance * normalizedTranslation)) / effectiveResistance;
|
|
58
|
+
return direction * Math.min(baseDistance, resistedTranslation * ZOOM_PRIMARY_DRAG_TRANSLATION_SCALE);
|
|
59
|
+
}
|
|
60
|
+
function resolveZoomHorizontalDragTranslation({
|
|
61
|
+
translation,
|
|
62
|
+
dimension
|
|
63
|
+
}) {
|
|
64
|
+
"worklet";
|
|
65
|
+
|
|
66
|
+
return resolveZoomPrimaryDragTranslation({
|
|
67
|
+
translation,
|
|
68
|
+
dimension
|
|
69
|
+
}) * ZOOM_HORIZONTAL_DRAG_DISTANCE_SCALE;
|
|
70
|
+
}
|
|
71
|
+
function resolveZoomCrossAxisDragTranslation({
|
|
72
|
+
translation,
|
|
73
|
+
dimension
|
|
74
|
+
}) {
|
|
75
|
+
"worklet";
|
|
76
|
+
|
|
77
|
+
const direction = translation < 0 ? -1 : 1;
|
|
78
|
+
const translationDistance = Math.abs(translation);
|
|
79
|
+
const baseDistance = Math.max(1, dimension);
|
|
80
|
+
const normalizedTranslation = translationDistance / baseDistance;
|
|
81
|
+
const resistedTranslation = baseDistance * (1 - Math.exp(-ZOOM_CROSS_AXIS_DRAG_RESISTANCE * normalizedTranslation)) / ZOOM_CROSS_AXIS_DRAG_RESISTANCE;
|
|
82
|
+
return direction * Math.min(baseDistance, resistedTranslation * ZOOM_CROSS_AXIS_DRAG_TRANSLATION_SCALE);
|
|
83
|
+
}
|
|
84
|
+
function resolveZoomDragScale(normalized) {
|
|
85
|
+
"worklet";
|
|
86
|
+
|
|
87
|
+
const scaleInput = normalized < 0 ? normalized * ZOOM_COUNTER_DRAG_SCALE_INTENSITY : normalized;
|
|
88
|
+
const progress = Math.min(1, scaleInput);
|
|
89
|
+
const rawMinimumScale = ZOOM_DRAG_SCALE_FLOOR ** (1 / ZOOM_DRAG_SCALE_EXPONENT);
|
|
90
|
+
const rawScale = 1 + (rawMinimumScale - 1) * progress;
|
|
91
|
+
return rawScale ** ZOOM_DRAG_SCALE_EXPONENT;
|
|
92
|
+
}
|
|
93
|
+
function resolveZoomPinchScale(scale) {
|
|
94
|
+
"worklet";
|
|
95
|
+
|
|
96
|
+
return 1 + (scale - 1) * ZOOM_PINCH_SCALE_RESPONSE;
|
|
97
|
+
}
|
|
98
|
+
function resolveZoomDismissalNorm(normalized, isInverted) {
|
|
99
|
+
"worklet";
|
|
100
|
+
|
|
101
|
+
return isInverted ? -normalized : normalized;
|
|
102
|
+
}
|
|
103
|
+
function resolveZoomDragState({
|
|
104
|
+
gesture,
|
|
105
|
+
activeTransitionProgress,
|
|
106
|
+
screenLayout,
|
|
107
|
+
sourceBounds,
|
|
108
|
+
trackingContentTarget,
|
|
109
|
+
dragOptions
|
|
110
|
+
}) {
|
|
111
|
+
"worklet";
|
|
112
|
+
|
|
113
|
+
const gestureHandoff = gesture.handoff;
|
|
114
|
+
const isDismissing = gesture.dismissing === 1;
|
|
115
|
+
const activeGesture = gestureHandoff.active;
|
|
116
|
+
const isHorizontalInverted = activeGesture === "horizontal-inverted";
|
|
117
|
+
const isHorizontal = activeGesture === "horizontal" || isHorizontalInverted;
|
|
118
|
+
const isVerticalInverted = activeGesture === "vertical-inverted";
|
|
119
|
+
const isVertical = activeGesture === "vertical" || isVerticalInverted;
|
|
120
|
+
const isPinchIn = activeGesture === "pinch-in";
|
|
121
|
+
const isInverted = isHorizontalInverted || isVerticalInverted;
|
|
122
|
+
const translationResponse = Math.max(0, isHorizontal ? dragOptions?.translation?.horizontal ?? 1 : isVertical ? dragOptions?.translation?.vertical ?? 1 : 1);
|
|
123
|
+
const scaleResponse = Math.max(0, isHorizontal ? dragOptions?.scale?.horizontal ?? 1 : isVertical ? dragOptions?.scale?.vertical ?? 1 : 1);
|
|
124
|
+
const handoffPrimaryNorm = isPinchIn ? -gestureHandoff.normScale : isHorizontal ? gestureHandoff.normX : gestureHandoff.normY;
|
|
125
|
+
const livePrimaryNorm = isPinchIn ? -gesture.normScale : isHorizontal ? gesture.normX : gesture.normY;
|
|
126
|
+
const dismissNorm = Math.max(0, resolveZoomDismissalNorm(handoffPrimaryNorm, isInverted));
|
|
127
|
+
const nativeDragX = isPinchIn ? gesture.x : isHorizontal ? resolveZoomHorizontalDragTranslation({
|
|
128
|
+
translation: gesture.x,
|
|
129
|
+
dimension: screenLayout.width
|
|
130
|
+
}) : isVertical ? resolveZoomCrossAxisDragTranslation({
|
|
131
|
+
translation: gesture.x,
|
|
132
|
+
dimension: screenLayout.width
|
|
133
|
+
}) : 0;
|
|
134
|
+
const nativeDragY = isPinchIn ? gesture.y : isHorizontal ? resolveZoomCrossAxisDragTranslation({
|
|
135
|
+
translation: gesture.y,
|
|
136
|
+
dimension: screenLayout.height
|
|
137
|
+
}) : resolveZoomPrimaryDragTranslation({
|
|
138
|
+
translation: gesture.y,
|
|
139
|
+
dimension: screenLayout.height
|
|
140
|
+
});
|
|
141
|
+
const dragX = nativeDragX * translationResponse;
|
|
142
|
+
const dragY = nativeDragY * translationResponse;
|
|
143
|
+
const scaleNorm = resolveZoomDismissalNorm(isDismissing ? handoffPrimaryNorm : livePrimaryNorm, isInverted);
|
|
144
|
+
const nativeGestureScale = isPinchIn ? resolveZoomPinchScale(isDismissing ? gestureHandoff.scale : gesture.scale) : resolveZoomDragScale(scaleNorm);
|
|
145
|
+
const gestureScale = isPinchIn ? nativeGestureScale : Math.max(_constants.EPSILON, 1 + (nativeGestureScale - 1) * scaleResponse);
|
|
146
|
+
const rotation = isPinchIn ? isDismissing ? gestureHandoff.rotation * activeTransitionProgress : gesture.rotation : 0;
|
|
147
|
+
let dismissContentScale = gestureScale;
|
|
148
|
+
if (isDismissing) {
|
|
149
|
+
const targetContentScale = (0, _math.resolveRevealContentBaseTransform)({
|
|
150
|
+
progress: 0,
|
|
151
|
+
sourceBounds,
|
|
152
|
+
destinationBounds: trackingContentTarget,
|
|
153
|
+
screenLayout
|
|
154
|
+
}).scale;
|
|
155
|
+
dismissContentScale = resolveZoomDismissContentScale({
|
|
156
|
+
transitionRemaining: activeTransitionProgress,
|
|
157
|
+
releaseScale: gestureScale,
|
|
158
|
+
targetScale: targetContentScale,
|
|
159
|
+
velocity: gestureHandoff.velocity,
|
|
160
|
+
velocityDepth: _config.ZOOM_DISMISS_VELOCITY_DEPTH * (isPinchIn ? ZOOM_PINCH_VELOCITY_DEPTH_MULTIPLIER : 1)
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
collapsesMask: isVertical,
|
|
165
|
+
dismissContentScale,
|
|
166
|
+
dismissNorm,
|
|
167
|
+
dismissProgress: isDismissing ? 1 - activeTransitionProgress : 0,
|
|
168
|
+
dragX,
|
|
169
|
+
dragY,
|
|
170
|
+
gestureScale,
|
|
171
|
+
isDismissing,
|
|
172
|
+
isVerticalInverted,
|
|
173
|
+
rotation
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function resolveZoomTrackedGestureScale({
|
|
177
|
+
drag,
|
|
178
|
+
activeTransitionProgress,
|
|
179
|
+
screenLayout,
|
|
180
|
+
sourceBounds,
|
|
181
|
+
trackingContentTarget
|
|
182
|
+
}) {
|
|
183
|
+
"worklet";
|
|
184
|
+
|
|
185
|
+
if (!drag.isDismissing) {
|
|
186
|
+
return drag.gestureScale;
|
|
187
|
+
}
|
|
188
|
+
const trackedContentBaseScale = (0, _math.resolveRevealContentBaseTransform)({
|
|
189
|
+
progress: activeTransitionProgress,
|
|
190
|
+
sourceBounds,
|
|
191
|
+
destinationBounds: trackingContentTarget,
|
|
192
|
+
screenLayout
|
|
193
|
+
}).scale;
|
|
194
|
+
return drag.dismissContentScale / trackedContentBaseScale;
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=drag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_constants","require","_math","_config","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","EPSILON","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","resolveRevealContentBaseTransform","destinationBounds","ZOOM_DISMISS_VELOCITY_DEPTH","collapsesMask","dismissProgress","resolveZoomTrackedGestureScale","drag","trackedContentBaseScale"],"sourceRoot":"../../../../../../../src","sources":["shared/utils/bounds/navigation/zoom/drag.ts"],"mappings":";;;;;;;;;;;;;;AACA,IAAAA,UAAA,GAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEA,MAAMG,wBAAwB,GAAG,CAAC;AAClC,MAAMC,qBAAqB,GAAG,GAAG;AACjC,MAAMC,iCAAiC,GAAG,GAAG;AAC7C,MAAMC,mCAAmC,GAAG,GAAG;AAC/C,MAAMC,4BAA4B,GAAG,CAAC;AACtC,MAAMC,mCAAmC,GAAG,GAAG;AAC/C,MAAMC,sCAAsC,GAAG,IAAI;AACnD,MAAMC,+BAA+B,GAAG,IAAI;AAC5C,MAAMC,yBAAyB,GAAG,CAAC;AACnC,MAAMC,oCAAoC,GAAG,CAAC;AAiBvC,SAASC,8BAA8BA,CAAC;EAC9CC,mBAAmB;EACnBC,YAAY;EACZC,WAAW;EACXC,QAAQ;EACRC;AAOD,CAAC,EAAE;EACF,SAAS;;EAET,MAAMC,aAAa,GAAG,CAAC,GAAGL,mBAAmB;EAC7C,MAAMM,KAAK,GAAGF,aAAa,GAAGD,QAAQ;EAEtC,MAA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IAAI,CAAC2C,IAAI,CAACvC,YAAY,EAAE;IACvB,OAAOuC,IAAI,CAACV,YAAY;EACzB;EAEA,MAAMW,uBAAuB,GAAG,IAAAP,uCAAiC,EAAC;IACjEjD,QAAQ,EAAES,wBAAwB;IAClCE,YAAY;IACZuC,iBAAiB,EAAEtC,qBAAqB;IACxCF;EACD,CAAC,CAAC,CAACN,KAAK;EAER,OAAOmD,IAAI,CAACR,mBAAmB,GAAGS,uBAAuB;AAC1D","ignoreList":[]}
|
|
@@ -3,128 +3,114 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.resolveDragScaleTuple = resolveDragScaleTuple;
|
|
10
|
-
exports.resolveDragTranslationTuple = resolveDragTranslationTuple;
|
|
11
|
-
exports.resolveZoomPanGestureDirection = resolveZoomPanGestureDirection;
|
|
12
|
-
var _reactNativeReanimated = require("react-native-reanimated");
|
|
6
|
+
exports.resolveZoomBackdropOpacity = resolveZoomBackdropOpacity;
|
|
7
|
+
exports.resolveZoomPinchFocalOffset = resolveZoomPinchFocalOffset;
|
|
8
|
+
exports.resolveZoomTrackedSourceTransform = resolveZoomTrackedSourceTransform;
|
|
13
9
|
var _constants = require("../../../../constants");
|
|
14
|
-
var
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
var _math = require("../reveal/math");
|
|
11
|
+
function resolveZoomBackdropOpacity({
|
|
12
|
+
transitionProgress,
|
|
13
|
+
dismissalDrag,
|
|
14
|
+
fadeEnd,
|
|
15
|
+
maxOpacity
|
|
20
16
|
}) {
|
|
21
17
|
"worklet";
|
|
22
18
|
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const height = sourceBounds.height / sourceBounds.width * screenWidth;
|
|
30
|
-
const verticalAnchor = anchor === "bottomLeading" || anchor === "bottom" || anchor === "bottomTrailing" ? "bottom" : anchor === "center" || anchor === "leading" || anchor === "trailing" ? "center" : "top";
|
|
31
|
-
const y = verticalAnchor === "top" ? 0 : verticalAnchor === "bottom" ? screenLayout.height - height : (screenLayout.height - height) / 2;
|
|
32
|
-
return {
|
|
33
|
-
x: 0,
|
|
34
|
-
y,
|
|
35
|
-
pageX: 0,
|
|
36
|
-
pageY: y,
|
|
37
|
-
width: screenWidth,
|
|
38
|
-
height
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
function resolveDragScaleTuple(value) {
|
|
42
|
-
"worklet";
|
|
43
|
-
|
|
44
|
-
return {
|
|
45
|
-
shrinkMin: value?.[0] ?? _config.ZOOM_DRAG_DIRECTIONAL_SCALE_MIN,
|
|
46
|
-
growMax: value?.[1] ?? _config.ZOOM_DRAG_DIRECTIONAL_SCALE_MAX,
|
|
47
|
-
exponent: value?.[2] ?? _config.ZOOM_DRAG_DIRECTIONAL_SCALE_EXPONENT
|
|
48
|
-
};
|
|
19
|
+
const clampedProgress = Math.min(1, Math.max(0, transitionProgress));
|
|
20
|
+
const clampedDrag = Math.min(1, Math.max(0, dismissalDrag));
|
|
21
|
+
const safeFadeEnd = Math.max(_constants.EPSILON, fadeEnd);
|
|
22
|
+
const transitionOpacity = Math.min(1, clampedProgress / safeFadeEnd);
|
|
23
|
+
const clampedMaxOpacity = Math.min(1, Math.max(0, maxOpacity));
|
|
24
|
+
return clampedMaxOpacity * transitionOpacity * (1 - clampedDrag);
|
|
49
25
|
}
|
|
50
|
-
function
|
|
26
|
+
function resolveZoomPinchFocalOffset({
|
|
27
|
+
gestureScale,
|
|
28
|
+
pinchOriginX,
|
|
29
|
+
pinchOriginY,
|
|
30
|
+
progress,
|
|
31
|
+
rotation,
|
|
32
|
+
screenLayout
|
|
33
|
+
}) {
|
|
51
34
|
"worklet";
|
|
52
35
|
|
|
36
|
+
if (Math.abs(gestureScale - 1) <= _constants.EPSILON && Math.abs(rotation) <= _constants.EPSILON) {
|
|
37
|
+
return {
|
|
38
|
+
x: 0,
|
|
39
|
+
y: 0
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const offsetX = pinchOriginX - screenLayout.width / 2;
|
|
43
|
+
const offsetY = pinchOriginY - screenLayout.height / 2;
|
|
44
|
+
const cosine = Math.cos(rotation);
|
|
45
|
+
const sine = Math.sin(rotation);
|
|
46
|
+
const transformedOffsetX = gestureScale * (offsetX * cosine - offsetY * sine);
|
|
47
|
+
const transformedOffsetY = gestureScale * (offsetX * sine + offsetY * cosine);
|
|
48
|
+
const clampedProgress = Math.min(1, Math.max(0, progress));
|
|
53
49
|
return {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
exponent: value?.[2] ?? _config.ZOOM_DRAG_TRANSLATION_EXPONENT
|
|
50
|
+
x: (offsetX - transformedOffsetX) * clampedProgress,
|
|
51
|
+
y: (offsetY - transformedOffsetY) * clampedProgress
|
|
57
52
|
};
|
|
58
53
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const resolveMotionDirection = ({
|
|
70
|
-
normX,
|
|
71
|
-
normY,
|
|
72
|
-
rawNormX,
|
|
73
|
-
rawNormY
|
|
74
|
-
}) => {
|
|
75
|
-
"worklet";
|
|
76
|
-
|
|
77
|
-
const motionX = Math.max(Math.abs(normX), Math.abs(rawNormX));
|
|
78
|
-
const motionY = Math.max(Math.abs(normY), Math.abs(rawNormY));
|
|
79
|
-
if (motionX <= _constants.EPSILON && motionY <= _constants.EPSILON) {
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
if (motionY > motionX + _constants.EPSILON) {
|
|
83
|
-
return normY < 0 || rawNormY < 0 ? "vertical-inverted" : "vertical";
|
|
84
|
-
}
|
|
85
|
-
if (motionX > motionY + _constants.EPSILON) {
|
|
86
|
-
return normX < 0 || rawNormX < 0 ? "horizontal-inverted" : "horizontal";
|
|
87
|
-
}
|
|
88
|
-
return null;
|
|
89
|
-
};
|
|
90
|
-
function resolveZoomPanGestureDirection({
|
|
91
|
-
active,
|
|
92
|
-
direction,
|
|
93
|
-
normX,
|
|
94
|
-
normY,
|
|
95
|
-
rawNormX,
|
|
96
|
-
rawNormY
|
|
54
|
+
function resolveZoomTrackedSourceTransform({
|
|
55
|
+
progress,
|
|
56
|
+
sourceBounds,
|
|
57
|
+
destinationBounds,
|
|
58
|
+
screenLayout,
|
|
59
|
+
dragX,
|
|
60
|
+
dragY,
|
|
61
|
+
gestureScale,
|
|
62
|
+
parentScale,
|
|
63
|
+
rotation = 0
|
|
97
64
|
}) {
|
|
98
65
|
"worklet";
|
|
99
66
|
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
rawNormY
|
|
67
|
+
const contentBaseTransform = (0, _math.resolveRevealContentBaseTransform)({
|
|
68
|
+
progress,
|
|
69
|
+
sourceBounds,
|
|
70
|
+
destinationBounds,
|
|
71
|
+
screenLayout
|
|
106
72
|
});
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
const
|
|
114
|
-
const
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
73
|
+
const collapsedContentScale = (0, _math.resolveRevealContentBaseTransform)({
|
|
74
|
+
progress: 0,
|
|
75
|
+
sourceBounds,
|
|
76
|
+
destinationBounds,
|
|
77
|
+
screenLayout
|
|
78
|
+
}).scale;
|
|
79
|
+
const contentScale = contentBaseTransform.scale * gestureScale;
|
|
80
|
+
const safeCollapsedContentScale = Math.max(Math.abs(collapsedContentScale), _constants.EPSILON);
|
|
81
|
+
const safeParentScale = Math.max(Math.abs(parentScale), _constants.EPSILON);
|
|
82
|
+
const uniformSourceScale = contentScale / (safeCollapsedContentScale * safeParentScale);
|
|
83
|
+
const trackedTransform = {
|
|
84
|
+
...(0, _math.resolveTrackedSourceElementTransform)({
|
|
85
|
+
sourceBounds,
|
|
86
|
+
destinationBounds,
|
|
87
|
+
contentTranslateX: contentBaseTransform.translateX + dragX,
|
|
88
|
+
contentTranslateY: contentBaseTransform.translateY + dragY,
|
|
89
|
+
contentScale,
|
|
90
|
+
parentScale,
|
|
91
|
+
screenWidth: screenLayout.width,
|
|
92
|
+
screenHeight: screenLayout.height
|
|
93
|
+
}),
|
|
94
|
+
scaleX: uniformSourceScale,
|
|
95
|
+
scaleY: uniformSourceScale
|
|
96
|
+
};
|
|
97
|
+
if (Math.abs(rotation) <= _constants.EPSILON) {
|
|
98
|
+
return trackedTransform;
|
|
118
99
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
100
|
+
const screenCenterX = screenLayout.width / 2;
|
|
101
|
+
const screenCenterY = screenLayout.height / 2;
|
|
102
|
+
const destinationCenterX = destinationBounds.pageX + destinationBounds.width / 2;
|
|
103
|
+
const destinationCenterY = destinationBounds.pageY + destinationBounds.height / 2;
|
|
104
|
+
const scaledOffsetX = (destinationCenterX - screenCenterX) * contentScale;
|
|
105
|
+
const scaledOffsetY = (destinationCenterY - screenCenterY) * contentScale;
|
|
106
|
+
const cosine = Math.cos(rotation);
|
|
107
|
+
const sine = Math.sin(rotation);
|
|
108
|
+
const rotatedOffsetX = scaledOffsetX * cosine - scaledOffsetY * sine;
|
|
109
|
+
const rotatedOffsetY = scaledOffsetX * sine + scaledOffsetY * cosine;
|
|
110
|
+
return {
|
|
111
|
+
...trackedTransform,
|
|
112
|
+
translateX: trackedTransform.translateX + (rotatedOffsetX - scaledOffsetX) / safeParentScale,
|
|
113
|
+
translateY: trackedTransform.translateY + (rotatedOffsetY - scaledOffsetY) / safeParentScale
|
|
114
|
+
};
|
|
129
115
|
}
|
|
130
116
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_constants","require","_math","resolveZoomBackdropOpacity","transitionProgress","dismissalDrag","fadeEnd","maxOpacity","clampedProgress","Math","min","max","clampedDrag","safeFadeEnd","EPSILON","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","resolveRevealContentBaseTransform","collapsedContentScale","scale","contentScale","safeCollapsedContentScale","safeParentScale","uniformSourceScale","trackedTransform","resolveTrackedSourceElementTransform","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,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AAKO,SAASE,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,EAAED,IAAI,CAACE,GAAG,CAAC,CAAC,EAAEN,aAAa,CAAC,CAAC;EAC3D,MAAMQ,WAAW,GAAGJ,IAAI,CAACE,GAAG,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
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ZOOM_NAVIGATION_MASK_BORDER_RADIUS = void 0;
|
|
7
|
+
exports.resolveZoomNavigationMaskStyle = resolveZoomNavigationMaskStyle;
|
|
8
|
+
var _reactNativeReanimated = require("react-native-reanimated");
|
|
9
|
+
var _helpers = require("../helpers");
|
|
10
|
+
var _config = require("../reveal/config");
|
|
11
|
+
var _math = require("../reveal/math");
|
|
12
|
+
var _config2 = require("./config");
|
|
13
|
+
const ZOOM_NAVIGATION_MASK_BORDER_RADIUS = exports.ZOOM_NAVIGATION_MASK_BORDER_RADIUS = 64;
|
|
14
|
+
const ZOOM_VERTICAL_DRAG_MASK_COLLAPSE_SCALE = 0.8;
|
|
15
|
+
function resolveZoomNavigationMaskStyle({
|
|
16
|
+
scopedBounds,
|
|
17
|
+
link,
|
|
18
|
+
sourceBounds,
|
|
19
|
+
screenLayout,
|
|
20
|
+
transitionProgress,
|
|
21
|
+
drag,
|
|
22
|
+
contentTransform,
|
|
23
|
+
sourceBorderRadius,
|
|
24
|
+
expandedBorderRadius,
|
|
25
|
+
active
|
|
26
|
+
}) {
|
|
27
|
+
"worklet";
|
|
28
|
+
|
|
29
|
+
const maskRaw = scopedBounds.values({
|
|
30
|
+
scaleMode: _config2.ZOOM_SHARED_OPTIONS.scaleMode,
|
|
31
|
+
anchor: _config2.ZOOM_SHARED_OPTIONS.anchor,
|
|
32
|
+
method: "size",
|
|
33
|
+
space: "absolute",
|
|
34
|
+
target: "fullscreen",
|
|
35
|
+
progress: transitionProgress
|
|
36
|
+
});
|
|
37
|
+
const maskWidth = maskRaw.width;
|
|
38
|
+
const maskHeight = maskRaw.height;
|
|
39
|
+
const maskAspectBounds = link.initialSource?.bounds ?? sourceBounds;
|
|
40
|
+
const minMaskHeight = (0, _math.resolveAspectRatioMaskHeight)({
|
|
41
|
+
maskWidth,
|
|
42
|
+
maskHeight,
|
|
43
|
+
targetWidth: maskAspectBounds.width,
|
|
44
|
+
targetHeight: maskAspectBounds.height
|
|
45
|
+
});
|
|
46
|
+
const maskHeightCollapseDrag = drag.collapsesMask ? Math.max(0, drag.dismissNorm * ZOOM_VERTICAL_DRAG_MASK_COLLAPSE_SCALE, drag.dismissProgress) : 0;
|
|
47
|
+
const renderedMaskHeight = (0, _math.interpolateClamped)(maskHeightCollapseDrag, 0, _config.DRAG_MASK_HEIGHT_COLLAPSE_END, maskHeight, minMaskHeight);
|
|
48
|
+
const maskCenterX = maskWidth / 2;
|
|
49
|
+
const maskCenterY = renderedMaskHeight / 2;
|
|
50
|
+
const contentCenterX = screenLayout.width / 2;
|
|
51
|
+
const contentCenterY = screenLayout.height / 2;
|
|
52
|
+
const maskOriginOffsetY = drag.isVerticalInverted ? maskHeight - renderedMaskHeight : 0;
|
|
53
|
+
const compensatedMaskTranslateX = (maskRaw.translateX - contentTransform.translateX + (1 - contentTransform.scale) * (maskCenterX - contentCenterX)) / contentTransform.scale;
|
|
54
|
+
const compensatedMaskTranslateY = (maskRaw.translateY - contentTransform.translateY + maskOriginOffsetY + (1 - contentTransform.scale) * (maskCenterY - contentCenterY)) / contentTransform.scale;
|
|
55
|
+
const initialSourceBorderRadius = (0, _helpers.toNumber)(link.initialSource?.styles.borderRadius, sourceBorderRadius);
|
|
56
|
+
return {
|
|
57
|
+
style: {
|
|
58
|
+
width: maskWidth,
|
|
59
|
+
height: renderedMaskHeight,
|
|
60
|
+
borderRadius: (0, _reactNativeReanimated.interpolate)(transitionProgress, [0, 1], [initialSourceBorderRadius, active.animating ? expandedBorderRadius : 0], "clamp"),
|
|
61
|
+
borderCurve: "continuous",
|
|
62
|
+
transform: [{
|
|
63
|
+
translateX: compensatedMaskTranslateX
|
|
64
|
+
}, {
|
|
65
|
+
translateY: compensatedMaskTranslateY
|
|
66
|
+
}, {
|
|
67
|
+
scale: 1 / contentTransform.scale
|
|
68
|
+
}]
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=mask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNativeReanimated","require","_helpers","_config","_math","_config2","ZOOM_NAVIGATION_MASK_BORDER_RADIUS","exports","ZOOM_VERTICAL_DRAG_MASK_COLLAPSE_SCALE","resolveZoomNavigationMaskStyle","scopedBounds","link","sourceBounds","screenLayout","transitionProgress","drag","contentTransform","sourceBorderRadius","expandedBorderRadius","active","maskRaw","values","scaleMode","ZOOM_SHARED_OPTIONS","anchor","method","space","target","progress","maskWidth","width","maskHeight","height","maskAspectBounds","initialSource","bounds","minMaskHeight","resolveAspectRatioMaskHeight","targetWidth","targetHeight","maskHeightCollapseDrag","collapsesMask","Math","max","dismissNorm","dismissProgress","renderedMaskHeight","interpolateClamped","DRAG_MASK_HEIGHT_COLLAPSE_END","maskCenterX","maskCenterY","contentCenterX","contentCenterY","maskOriginOffsetY","isVerticalInverted","compensatedMaskTranslateX","translateX","scale","compensatedMaskTranslateY","translateY","initialSourceBorderRadius","toNumber","styles","borderRadius","style","interpolate","animating","borderCurve","transform"],"sourceRoot":"../../../../../../../src","sources":["shared/utils/bounds/navigation/zoom/mask.ts"],"mappings":";;;;;;;AACA,IAAAA,sBAAA,GAAAC,OAAA;AAUA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAIA,IAAAI,QAAA,GAAAJ,OAAA;AAGO,MAAMK,kCAAkC,GAAAC,OAAA,CAAAD,kCAAA,GAAG,EAAE;AACpD,MAAME,sCAAsC,GAAG,GAAG;AAmB3C,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,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O,CAACoC,UAAU,GAClBxC,gBAAgB,CAACwC,UAAU,GAC3B,CAAC,CAAC,GAAGxC,gBAAgB,CAACyC,KAAK,KAAKR,WAAW,GAAGE,cAAc,CAAC,IAC9DnC,gBAAgB,CAACyC,KAAK;EACvB,MAAMC,yBAAyB,GAC9B,CAACtC,OAAO,CAACuC,UAAU,GAClB3C,gBAAgB,CAAC2C,UAAU,GAC3BN,iBAAiB,GACjB,CAAC,CAAC,GAAGrC,gBAAgB,CAACyC,KAAK,KAAKP,WAAW,GAAGE,cAAc,CAAC,IAC9DpC,gBAAgB,CAACyC,KAAK;EACvB,MAAMG,yBAAyB,GAAG,IAAAC,iBAAQ,EACzClD,IAAI,CAACuB,aAAa,EAAE4B,MAAM,CAACC,YAAY,EACvC9C,kBACD,CAAC;EAED,OAAO;IACN+C,KAAK,EAAE;MACNlC,KAAK,EAAED,SAAS;MAChBG,MAAM,EAAEc,kBAAkB;MAC1BiB,YAAY,EAAE,IAAAE,kCAAW,EACxBnD,kBAAkB,EAClB,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CACC8C,yBAAyB,EACzBzC,MAAM,CAAC+C,SAAS,GAAGhD,oBAAoB,GAAG,CAAC,CAC3C,EACD,OACD,CAAC;MACDiD,WAAW,EAAE,YAAY;MACzBC,SAAS,EAAE,CACV;QAAEZ,UAAU,EAAED;MAA0B,CAAC,EACzC;QAAEI,UAAU,EAAED;MAA0B,CAAC,EACzC;QAAED,KAAK,EAAE,CAAC,GAAGzC,gBAAgB,CAACyC;MAAM,CAAC;IAEvC;EACD,CAAC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getZoomContentTarget = getZoomContentTarget;
|
|
7
|
+
exports.resolveZoomTrackingContentTarget = resolveZoomTrackingContentTarget;
|
|
8
|
+
function getZoomContentTarget({
|
|
9
|
+
explicitTarget,
|
|
10
|
+
screenLayout,
|
|
11
|
+
link
|
|
12
|
+
}) {
|
|
13
|
+
"worklet";
|
|
14
|
+
|
|
15
|
+
if (explicitTarget !== undefined) {
|
|
16
|
+
return explicitTarget;
|
|
17
|
+
}
|
|
18
|
+
const sourceBounds = link.source?.bounds;
|
|
19
|
+
const screenWidth = screenLayout.width;
|
|
20
|
+
if (!sourceBounds || sourceBounds.width <= 0 || screenWidth <= 0) {
|
|
21
|
+
return "fullscreen";
|
|
22
|
+
}
|
|
23
|
+
const height = sourceBounds.height / sourceBounds.width * screenWidth;
|
|
24
|
+
return {
|
|
25
|
+
x: 0,
|
|
26
|
+
y: 0,
|
|
27
|
+
pageX: 0,
|
|
28
|
+
pageY: 0,
|
|
29
|
+
width: screenWidth,
|
|
30
|
+
height
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function resolveZoomTrackingContentTarget({
|
|
34
|
+
contentTarget,
|
|
35
|
+
link,
|
|
36
|
+
screenLayout
|
|
37
|
+
}) {
|
|
38
|
+
"worklet";
|
|
39
|
+
|
|
40
|
+
if (typeof contentTarget === "object") {
|
|
41
|
+
return contentTarget;
|
|
42
|
+
}
|
|
43
|
+
if (contentTarget === "bound") {
|
|
44
|
+
return link.destination?.bounds;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
x: 0,
|
|
48
|
+
y: 0,
|
|
49
|
+
pageX: 0,
|
|
50
|
+
pageY: 0,
|
|
51
|
+
width: screenLayout.width,
|
|
52
|
+
height: screenLayout.height
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//# 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":";;;;;;;AAYO,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;AAEO,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":[]}
|