@onekeyfe/react-native-native-overlay 3.0.162-alpha.268
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/LICENSE +21 -0
- package/NativeOverlay.podspec +30 -0
- package/README.md +35 -0
- package/android/build.gradle +82 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayAnimation.kt +176 -0
- package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayEntryRootView.kt +415 -0
- package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayEvents.kt +38 -0
- package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayHost.kt +174 -0
- package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayPackage.kt +16 -0
- package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayPageHostView.kt +122 -0
- package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayPageHostViewManager.kt +40 -0
- package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayView.kt +465 -0
- package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayViewManager.kt +156 -0
- package/android/src/main/jni/CMakeLists.txt +44 -0
- package/android/src/main/jni/RNCNativeOverlay.h +19 -0
- package/common/cpp/react/renderer/components/RNCNativeOverlay/NativeOverlayComponentDescriptor.h +12 -0
- package/common/cpp/react/renderer/components/RNCNativeOverlay/NativeOverlayShadowNode.cpp +12 -0
- package/common/cpp/react/renderer/components/RNCNativeOverlay/NativeOverlayShadowNode.h +41 -0
- package/common/cpp/react/renderer/components/RNCNativeOverlay/NativeOverlayState.h +40 -0
- package/docs/SPEC.md +693 -0
- package/ios/NativeOverlayAnimation.swift +160 -0
- package/ios/NativeOverlayContainerView.swift +688 -0
- package/ios/NativeOverlayKeyboard.swift +88 -0
- package/ios/NativeOverlayPageHostView.swift +98 -0
- package/ios/NativeOverlaySheetController.swift +391 -0
- package/ios/NativeOverlayWindowManager.swift +194 -0
- package/ios/RCTNativeOverlayComponentView.h +11 -0
- package/ios/RCTNativeOverlayComponentView.mm +193 -0
- package/ios/RCTNativeOverlayPageHostComponentView.h +11 -0
- package/ios/RCTNativeOverlayPageHostComponentView.mm +64 -0
- package/lib/module/NativeOverlayNativeComponent.ts +61 -0
- package/lib/module/NativeOverlayPageHostNativeComponent.ts +13 -0
- package/lib/module/OverlayErrors.js +6 -0
- package/lib/module/OverlayErrors.js.map +1 -0
- package/lib/module/OverlayLevelContext.js +27 -0
- package/lib/module/OverlayLevelContext.js.map +1 -0
- package/lib/module/OverlayLevels.js +33 -0
- package/lib/module/OverlayLevels.js.map +1 -0
- package/lib/module/OverlayPageHost.js +24 -0
- package/lib/module/OverlayPageHost.js.map +1 -0
- package/lib/module/OverlayPageHost.web.js +49 -0
- package/lib/module/OverlayPageHost.web.js.map +1 -0
- package/lib/module/OverlayPageScope.js +41 -0
- package/lib/module/OverlayPageScope.js.map +1 -0
- package/lib/module/OverlayStore.js +305 -0
- package/lib/module/OverlayStore.js.map +1 -0
- package/lib/module/OverlayView.js +141 -0
- package/lib/module/OverlayView.js.map +1 -0
- package/lib/module/OverlayView.web.js +290 -0
- package/lib/module/OverlayView.web.js.map +1 -0
- package/lib/module/OverlayViewTypes.js +4 -0
- package/lib/module/OverlayViewTypes.js.map +1 -0
- package/lib/module/animation/motionPresets.js +57 -0
- package/lib/module/animation/motionPresets.js.map +1 -0
- package/lib/module/animation/platformMotionPresets.js +4 -0
- package/lib/module/animation/platformMotionPresets.js.map +1 -0
- package/lib/module/animation/platformMotionPresets.web.js +4 -0
- package/lib/module/animation/platformMotionPresets.web.js.map +1 -0
- package/lib/module/animation/resolveAnimation.js +80 -0
- package/lib/module/animation/resolveAnimation.js.map +1 -0
- package/lib/module/animation/spring.js +69 -0
- package/lib/module/animation/spring.js.map +1 -0
- package/lib/module/animation/types.js +2 -0
- package/lib/module/animation/types.js.map +1 -0
- package/lib/module/index.js +16 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/useOverlayController.js +127 -0
- package/lib/module/useOverlayController.js.map +1 -0
- package/lib/module/useSuspendedPageOwners.js +16 -0
- package/lib/module/useSuspendedPageOwners.js.map +1 -0
- package/lib/module/web/animateTransition.js +115 -0
- package/lib/module/web/animateTransition.js.map +1 -0
- package/lib/module/web/overlayLayers.js +147 -0
- package/lib/module/web/overlayLayers.js.map +1 -0
- package/lib/module/web/useKeyboardShift.js +110 -0
- package/lib/module/web/useKeyboardShift.js.map +1 -0
- package/lib/module/web/useSheetDrag.js +126 -0
- package/lib/module/web/useSheetDrag.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeOverlayNativeComponent.d.ts +41 -0
- package/lib/typescript/src/NativeOverlayNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/NativeOverlayPageHostNativeComponent.d.ts +9 -0
- package/lib/typescript/src/NativeOverlayPageHostNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/OverlayErrors.d.ts +4 -0
- package/lib/typescript/src/OverlayErrors.d.ts.map +1 -0
- package/lib/typescript/src/OverlayLevelContext.d.ts +12 -0
- package/lib/typescript/src/OverlayLevelContext.d.ts.map +1 -0
- package/lib/typescript/src/OverlayLevels.d.ts +13 -0
- package/lib/typescript/src/OverlayLevels.d.ts.map +1 -0
- package/lib/typescript/src/OverlayPageHost.d.ts +9 -0
- package/lib/typescript/src/OverlayPageHost.d.ts.map +1 -0
- package/lib/typescript/src/OverlayPageHost.web.d.ts +11 -0
- package/lib/typescript/src/OverlayPageHost.web.d.ts.map +1 -0
- package/lib/typescript/src/OverlayPageScope.d.ts +17 -0
- package/lib/typescript/src/OverlayPageScope.d.ts.map +1 -0
- package/lib/typescript/src/OverlayStore.d.ts +72 -0
- package/lib/typescript/src/OverlayStore.d.ts.map +1 -0
- package/lib/typescript/src/OverlayView.d.ts +3 -0
- package/lib/typescript/src/OverlayView.d.ts.map +1 -0
- package/lib/typescript/src/OverlayView.web.d.ts +3 -0
- package/lib/typescript/src/OverlayView.web.d.ts.map +1 -0
- package/lib/typescript/src/OverlayViewTypes.d.ts +68 -0
- package/lib/typescript/src/OverlayViewTypes.d.ts.map +1 -0
- package/lib/typescript/src/animation/motionPresets.d.ts +13 -0
- package/lib/typescript/src/animation/motionPresets.d.ts.map +1 -0
- package/lib/typescript/src/animation/platformMotionPresets.d.ts +2 -0
- package/lib/typescript/src/animation/platformMotionPresets.d.ts.map +1 -0
- package/lib/typescript/src/animation/platformMotionPresets.web.d.ts +2 -0
- package/lib/typescript/src/animation/platformMotionPresets.web.d.ts.map +1 -0
- package/lib/typescript/src/animation/resolveAnimation.d.ts +23 -0
- package/lib/typescript/src/animation/resolveAnimation.d.ts.map +1 -0
- package/lib/typescript/src/animation/spring.d.ts +24 -0
- package/lib/typescript/src/animation/spring.d.ts.map +1 -0
- package/lib/typescript/src/animation/types.d.ts +56 -0
- package/lib/typescript/src/animation/types.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +18 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +59 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/useOverlayController.d.ts +29 -0
- package/lib/typescript/src/useOverlayController.d.ts.map +1 -0
- package/lib/typescript/src/useSuspendedPageOwners.d.ts +7 -0
- package/lib/typescript/src/useSuspendedPageOwners.d.ts.map +1 -0
- package/lib/typescript/src/web/animateTransition.d.ts +18 -0
- package/lib/typescript/src/web/animateTransition.d.ts.map +1 -0
- package/lib/typescript/src/web/overlayLayers.d.ts +10 -0
- package/lib/typescript/src/web/overlayLayers.d.ts.map +1 -0
- package/lib/typescript/src/web/useKeyboardShift.d.ts +29 -0
- package/lib/typescript/src/web/useKeyboardShift.d.ts.map +1 -0
- package/lib/typescript/src/web/useSheetDrag.d.ts +13 -0
- package/lib/typescript/src/web/useSheetDrag.d.ts.map +1 -0
- package/package.json +188 -0
- package/react-native.config.js +16 -0
- package/src/NativeOverlayNativeComponent.ts +61 -0
- package/src/NativeOverlayPageHostNativeComponent.ts +13 -0
- package/src/OverlayErrors.ts +3 -0
- package/src/OverlayLevelContext.tsx +32 -0
- package/src/OverlayLevels.ts +40 -0
- package/src/OverlayPageHost.tsx +21 -0
- package/src/OverlayPageHost.web.tsx +53 -0
- package/src/OverlayPageScope.tsx +42 -0
- package/src/OverlayStore.ts +401 -0
- package/src/OverlayView.tsx +165 -0
- package/src/OverlayView.web.tsx +356 -0
- package/src/OverlayViewTypes.ts +81 -0
- package/src/animation/motionPresets.ts +52 -0
- package/src/animation/platformMotionPresets.ts +1 -0
- package/src/animation/platformMotionPresets.web.ts +1 -0
- package/src/animation/resolveAnimation.ts +103 -0
- package/src/animation/spring.ts +80 -0
- package/src/animation/types.ts +71 -0
- package/src/index.ts +55 -0
- package/src/types.ts +79 -0
- package/src/useOverlayController.ts +199 -0
- package/src/useSuspendedPageOwners.ts +26 -0
- package/src/web/animateTransition.ts +137 -0
- package/src/web/overlayLayers.ts +182 -0
- package/src/web/useKeyboardShift.ts +130 -0
- package/src/web/useSheetDrag.ts +143 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
const DRAG_START_THRESHOLD = 6;
|
|
5
|
+
const DISMISS_DISTANCE_RATIO = 0.4;
|
|
6
|
+
const DISMISS_VELOCITY = 0.5; // px per ms
|
|
7
|
+
const UPWARD_RESISTANCE = 0.2;
|
|
8
|
+
const SETTLE_TRANSITION = 'transform 200ms cubic-bezier(0.32, 0.72, 0, 1)';
|
|
9
|
+
function scrolledAncestorWithin(target, sheet) {
|
|
10
|
+
let node = target instanceof HTMLElement ? target : null;
|
|
11
|
+
while (node && node !== sheet) {
|
|
12
|
+
if (node.scrollTop > 0 && node.scrollHeight > node.clientHeight) {
|
|
13
|
+
return node;
|
|
14
|
+
}
|
|
15
|
+
node = node.parentElement;
|
|
16
|
+
}
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Pointer-driven drag-to-dismiss for the web bottom sheet: follows the
|
|
22
|
+
* finger downward, resists upward, and dismisses past 40% of the height or
|
|
23
|
+
* on a fast flick. A drag never starts from inside scrolled content.
|
|
24
|
+
*/
|
|
25
|
+
export function useSheetDrag({
|
|
26
|
+
sheetRef,
|
|
27
|
+
backdropRef,
|
|
28
|
+
enabled,
|
|
29
|
+
onDismissByPan
|
|
30
|
+
}) {
|
|
31
|
+
const onDismissRef = useRef(onDismissByPan);
|
|
32
|
+
onDismissRef.current = onDismissByPan;
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
const sheet = sheetRef.current;
|
|
35
|
+
if (!sheet || !enabled) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
let startY = 0;
|
|
39
|
+
let lastY = 0;
|
|
40
|
+
let lastTime = 0;
|
|
41
|
+
let velocity = 0;
|
|
42
|
+
let tracking = false;
|
|
43
|
+
let dragging = false;
|
|
44
|
+
let pointerId = -1;
|
|
45
|
+
const setOffset = offset => {
|
|
46
|
+
sheet.style.transform = `translate3d(0, ${offset}px, 0)`;
|
|
47
|
+
const backdrop = backdropRef.current;
|
|
48
|
+
if (backdrop && offset > 0) {
|
|
49
|
+
backdrop.style.opacity = String(Math.max(0, 1 - offset / sheet.offsetHeight));
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const onPointerDown = event => {
|
|
53
|
+
if (event.button !== 0 || scrolledAncestorWithin(event.target, sheet)) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
tracking = true;
|
|
57
|
+
dragging = false;
|
|
58
|
+
pointerId = event.pointerId;
|
|
59
|
+
startY = event.clientY;
|
|
60
|
+
lastY = event.clientY;
|
|
61
|
+
lastTime = event.timeStamp;
|
|
62
|
+
velocity = 0;
|
|
63
|
+
};
|
|
64
|
+
const onPointerMove = event => {
|
|
65
|
+
if (!tracking || event.pointerId !== pointerId) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const dy = event.clientY - startY;
|
|
69
|
+
if (!dragging) {
|
|
70
|
+
if (dy < DRAG_START_THRESHOLD) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
dragging = true;
|
|
74
|
+
sheet.setPointerCapture(pointerId);
|
|
75
|
+
sheet.style.transition = 'none';
|
|
76
|
+
}
|
|
77
|
+
const dt = Math.max(1, event.timeStamp - lastTime);
|
|
78
|
+
velocity = (event.clientY - lastY) / dt;
|
|
79
|
+
lastY = event.clientY;
|
|
80
|
+
lastTime = event.timeStamp;
|
|
81
|
+
setOffset(dy > 0 ? dy : dy * UPWARD_RESISTANCE);
|
|
82
|
+
};
|
|
83
|
+
const onPointerUp = event => {
|
|
84
|
+
if (!tracking || event.pointerId !== pointerId) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
tracking = false;
|
|
88
|
+
if (!dragging) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
dragging = false;
|
|
92
|
+
const dy = event.clientY - startY;
|
|
93
|
+
const height = sheet.offsetHeight;
|
|
94
|
+
sheet.style.transition = SETTLE_TRANSITION;
|
|
95
|
+
if (dy > height * DISMISS_DISTANCE_RATIO || velocity > DISMISS_VELOCITY) {
|
|
96
|
+
setOffset(height);
|
|
97
|
+
onDismissRef.current();
|
|
98
|
+
} else {
|
|
99
|
+
setOffset(0);
|
|
100
|
+
if (backdropRef.current) {
|
|
101
|
+
backdropRef.current.style.opacity = '1';
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Swallow the click that follows a drag so buttons under the finger
|
|
105
|
+
// do not fire.
|
|
106
|
+
sheet.addEventListener('click', clickEvent => {
|
|
107
|
+
clickEvent.stopPropagation();
|
|
108
|
+
clickEvent.preventDefault();
|
|
109
|
+
}, {
|
|
110
|
+
capture: true,
|
|
111
|
+
once: true
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
sheet.addEventListener('pointerdown', onPointerDown);
|
|
115
|
+
sheet.addEventListener('pointermove', onPointerMove);
|
|
116
|
+
sheet.addEventListener('pointerup', onPointerUp);
|
|
117
|
+
sheet.addEventListener('pointercancel', onPointerUp);
|
|
118
|
+
return () => {
|
|
119
|
+
sheet.removeEventListener('pointerdown', onPointerDown);
|
|
120
|
+
sheet.removeEventListener('pointermove', onPointerMove);
|
|
121
|
+
sheet.removeEventListener('pointerup', onPointerUp);
|
|
122
|
+
sheet.removeEventListener('pointercancel', onPointerUp);
|
|
123
|
+
};
|
|
124
|
+
}, [sheetRef, backdropRef, enabled]);
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=useSheetDrag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","DRAG_START_THRESHOLD","DISMISS_DISTANCE_RATIO","DISMISS_VELOCITY","UPWARD_RESISTANCE","SETTLE_TRANSITION","scrolledAncestorWithin","target","sheet","node","HTMLElement","scrollTop","scrollHeight","clientHeight","parentElement","undefined","useSheetDrag","sheetRef","backdropRef","enabled","onDismissByPan","onDismissRef","current","startY","lastY","lastTime","velocity","tracking","dragging","pointerId","setOffset","offset","style","transform","backdrop","opacity","String","Math","max","offsetHeight","onPointerDown","event","button","clientY","timeStamp","onPointerMove","dy","setPointerCapture","transition","dt","onPointerUp","height","addEventListener","clickEvent","stopPropagation","preventDefault","capture","once","removeEventListener"],"sourceRoot":"../../../src","sources":["web/useSheetDrag.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAGzC,MAAMC,oBAAoB,GAAG,CAAC;AAC9B,MAAMC,sBAAsB,GAAG,GAAG;AAClC,MAAMC,gBAAgB,GAAG,GAAG,CAAC,CAAC;AAC9B,MAAMC,iBAAiB,GAAG,GAAG;AAC7B,MAAMC,iBAAiB,GAAG,gDAAgD;AAE1E,SAASC,sBAAsBA,CAC7BC,MA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AAK,CAACkD,mBAAmB,CAAC,aAAa,EAAElB,aAAa,CAAC;MACvDhC,KAAK,CAACkD,mBAAmB,CAAC,aAAa,EAAEb,aAAa,CAAC;MACvDrC,KAAK,CAACkD,mBAAmB,CAAC,WAAW,EAAER,WAAW,CAAC;MACnD1C,KAAK,CAACkD,mBAAmB,CAAC,eAAe,EAAER,WAAW,CAAC;IACzD,CAAC;EACH,CAAC,EAAE,CAACjC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,CAAC,CAAC;AACtC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { CodegenTypes, ColorValue, HostComponent, ViewProps } from 'react-native';
|
|
2
|
+
type INativeOverlayDismissedEvent = Readonly<{
|
|
3
|
+
reason: string;
|
|
4
|
+
}>;
|
|
5
|
+
type INativeOverlayRequestDismissEvent = Readonly<{
|
|
6
|
+
reason: string;
|
|
7
|
+
}>;
|
|
8
|
+
type INativeOverlayPresentedEvent = Readonly<{
|
|
9
|
+
stackOrder: CodegenTypes.Int32;
|
|
10
|
+
}>;
|
|
11
|
+
export interface INativeOverlayNativeProps extends ViewProps {
|
|
12
|
+
/** Present when true; play the exit animation and emit onDismissed when it turns false. */
|
|
13
|
+
visible: boolean;
|
|
14
|
+
level?: CodegenTypes.WithDefault<'modal' | 'hardware' | 'secure' | 'toast' | 'lock' | 'debug', 'modal'>;
|
|
15
|
+
presentation?: CodegenTypes.WithDefault<'center' | 'toast' | 'fullscreen' | 'sheet' | 'anchored', 'center'>;
|
|
16
|
+
scope?: CodegenTypes.WithDefault<'global' | 'page', 'global'>;
|
|
17
|
+
/** `page` scope: the `OverlayPageHost` to render in and the owning page. */
|
|
18
|
+
hostKey?: CodegenTypes.WithDefault<string, ''>;
|
|
19
|
+
ownerKey?: CodegenTypes.WithDefault<string, ''>;
|
|
20
|
+
/** Order inside the level; higher renders above. */
|
|
21
|
+
stackOrder?: CodegenTypes.WithDefault<CodegenTypes.Int32, 0>;
|
|
22
|
+
/** Swallow touches that miss the content instead of passing them through. */
|
|
23
|
+
blocking?: CodegenTypes.WithDefault<boolean, true>;
|
|
24
|
+
dismissOnBackPress?: CodegenTypes.WithDefault<boolean, true>;
|
|
25
|
+
dismissOnBackdropPress?: CodegenTypes.WithDefault<boolean, false>;
|
|
26
|
+
backdropColor?: ColorValue;
|
|
27
|
+
/** `sheet` presentation: resolved content height in points. */
|
|
28
|
+
sheetHeight?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
29
|
+
sheetCornerRadius?: CodegenTypes.WithDefault<CodegenTypes.Double, 24>;
|
|
30
|
+
showHandle?: CodegenTypes.WithDefault<boolean, false>;
|
|
31
|
+
sheetBackgroundColor?: ColorValue;
|
|
32
|
+
dismissOnPanDown?: CodegenTypes.WithDefault<boolean, true>;
|
|
33
|
+
/** JSON of the resolved animation (`IResolvedOverlayAnimation`). */
|
|
34
|
+
animationConfig?: CodegenTypes.WithDefault<string, ''>;
|
|
35
|
+
onPresented?: CodegenTypes.DirectEventHandler<INativeOverlayPresentedEvent>;
|
|
36
|
+
onDismissed?: CodegenTypes.DirectEventHandler<INativeOverlayDismissedEvent>;
|
|
37
|
+
onRequestDismiss?: CodegenTypes.DirectEventHandler<INativeOverlayRequestDismissEvent>;
|
|
38
|
+
}
|
|
39
|
+
declare const _default: HostComponent<INativeOverlayNativeProps>;
|
|
40
|
+
export default _default;
|
|
41
|
+
//# sourceMappingURL=NativeOverlayNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeOverlayNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/NativeOverlayNativeComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,aAAa,EACb,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,KAAK,4BAA4B,GAAG,QAAQ,CAAC;IAC3C,MAAM,EAAE,MAAM,C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IAC3B,+DAA+D;IAC/D,WAAW,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC/D,iBAAiB,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACtE,UAAU,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACtD,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAClC,gBAAgB,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC3D,oEAAoE;IACpE,eAAe,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACvD,WAAW,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,4BAA4B,CAAC,CAAC;IAC5E,WAAW,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,4BAA4B,CAAC,CAAC;IAC5E,gBAAgB,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,iCAAiC,CAAC,CAAC;CACvF;wBAOI,aAAa,CAAC,yBAAyB,CAAC;AAH7C,wBAG8C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HostComponent, ViewProps } from 'react-native';
|
|
2
|
+
export interface INativeOverlayPageHostNativeProps extends ViewProps {
|
|
3
|
+
hostKey: string;
|
|
4
|
+
/** Owners whose entries are hidden, newline separated. */
|
|
5
|
+
suspendedOwners?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: HostComponent<INativeOverlayPageHostNativeProps>;
|
|
8
|
+
export default _default;
|
|
9
|
+
//# sourceMappingURL=NativeOverlayPageHostNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeOverlayPageHostNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/NativeOverlayPageHostNativeComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,MAAM,WAAW,iCAAkC,SAAQ,SAAS;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB,0DAA0D;IAC1D,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;wBAII,aAAa,CAAC,iCAAiC,CAAC;AAFrD,wBAEsD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverlayErrors.d.ts","sourceRoot":"","sources":["../../../src/OverlayErrors.ts"],"names":[],"mappings":"AAAA,qBAAa,mBAAoB,SAAQ,KAAK;IACnC,IAAI,SAAyB;CACvC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IOverlayLevel } from './types';
|
|
2
|
+
/** Provided by `OverlayView` to its content. */
|
|
3
|
+
export declare const OverlayLevelProvider: import("react").Provider<IOverlayLevel | undefined>;
|
|
4
|
+
/** The level of the overlay this component renders in, if any. */
|
|
5
|
+
export declare function useEnclosingOverlayLevel(): IOverlayLevel | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* The level for an overlay opened from inside another one (a popover in a
|
|
8
|
+
* password prompt, a tooltip on the lock screen): never below the overlay it
|
|
9
|
+
* is opened from, or it would render underneath it.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useNestedOverlayLevel(minimum?: IOverlayLevel): IOverlayLevel;
|
|
12
|
+
//# sourceMappingURL=OverlayLevelContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverlayLevelContext.d.ts","sourceRoot":"","sources":["../../../src/OverlayLevelContext.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C,gDAAgD;AAChD,eAAO,MAAM,oBAAoB,qDAA+B,CAAC;AAEjE,kEAAkE;AAClE,wBAAgB,wBAAwB,IAAI,aAAa,GAAG,SAAS,CAEpE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,GAAE,aAAuB,GAC/B,aAAa,CAQf"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IOverlayLevel } from './types';
|
|
2
|
+
export declare const OVERLAY_LEVEL_ORDER: Record<IOverlayLevel, number>;
|
|
3
|
+
export declare const OVERLAY_LEVELS: readonly IOverlayLevel[];
|
|
4
|
+
export declare function isBlockingLevel(level: IOverlayLevel): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Web z-index bands of the level layer roots (`document.body` children). In-page
|
|
7
|
+
* content that must rise above a level (a drag clone over a dialog) uses a
|
|
8
|
+
* value just above that level's base.
|
|
9
|
+
*/
|
|
10
|
+
export declare const OVERLAY_WEB_Z_INDEX_BASE: Record<IOverlayLevel, number>;
|
|
11
|
+
/** Page-scope entries always render below every global entry. */
|
|
12
|
+
export declare const OVERLAY_WEB_PAGE_Z_INDEX_BASE = 1000;
|
|
13
|
+
//# sourceMappingURL=OverlayLevels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverlayLevels.d.ts","sourceRoot":"","sources":["../../../src/OverlayLevels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAO7D,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,SAAS,aAAa,EAEkB,CAAC;AAOtE,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAE7D;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAOlE,CAAC;AAEF,iEAAiE;AACjE,eAAO,MAAM,6BAA6B,OAAO,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders page-scope overlays of one root route. Place it as the last child
|
|
3
|
+
* of the root-route screen, after its navigator, so page overlays cover the
|
|
4
|
+
* native header and tab bar of every page in that route.
|
|
5
|
+
*/
|
|
6
|
+
export declare function OverlayPageHost({ hostKey }: {
|
|
7
|
+
hostKey: string;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=OverlayPageHost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverlayPageHost.d.ts","sourceRoot":"","sources":["../../../src/OverlayPageHost.tsx"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,2CAU/D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const OWNER_ATTRIBUTE = "data-overlay-owner";
|
|
2
|
+
/**
|
|
3
|
+
* Web page host: an absolutely positioned layer inside the root-route card.
|
|
4
|
+
* Page overlays portal into it; entries of covered owners are hidden here
|
|
5
|
+
* because their own (possibly inactive) page does not re-render.
|
|
6
|
+
*/
|
|
7
|
+
export declare function OverlayPageHost({ hostKey }: {
|
|
8
|
+
hostKey: string;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { OWNER_ATTRIBUTE as OVERLAY_OWNER_ATTRIBUTE };
|
|
11
|
+
//# sourceMappingURL=OverlayPageHost.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverlayPageHost.web.d.ts","sourceRoot":"","sources":["../../../src/OverlayPageHost.web.tsx"],"names":[],"mappings":"AAKA,QAAA,MAAM,eAAe,uBAAuB,CAAC;AAE7C;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,2CAsC/D;AAED,OAAO,EAAE,eAAe,IAAI,uBAAuB,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
export interface IOverlayPageScope {
|
|
3
|
+
/** Root-route host that renders page overlays (see `OverlayPageHost`). */
|
|
4
|
+
hostKey?: string;
|
|
5
|
+
/** The nearest page; page overlays hide while it is covered. */
|
|
6
|
+
ownerKey?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function useOverlayPageScope(): IOverlayPageScope;
|
|
9
|
+
/** Provided once per root route, around its navigator and `OverlayPageHost`. */
|
|
10
|
+
export declare function OverlayPageHostScope({ hostKey, children, }: PropsWithChildren<{
|
|
11
|
+
hostKey: string;
|
|
12
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
/** Provided by each page; page overlays below it belong to `ownerKey`. */
|
|
14
|
+
export declare function OverlayPageOwnerScope({ ownerKey, children, }: PropsWithChildren<{
|
|
15
|
+
ownerKey: string;
|
|
16
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=OverlayPageScope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverlayPageScope.d.ts","sourceRoot":"","sources":["../../../src/OverlayPageScope.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,MAAM,WAAW,iBAAiB;IAChC,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAID,wBAAgB,mBAAmB,IAAI,iBAAiB,CAEvD;AAED,gFAAgF;AAChF,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,QAAQ,GACT,EAAE,iBAAiB,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,2CAOxC;AAED,0EAA0E;AAC1E,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,QAAQ,GACT,EAAE,iBAAiB,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,2CAQzC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { IOverlayDismissReason, IOverlayEntry, IOverlayRequest, IOverlaySnapshot } from './types';
|
|
2
|
+
export interface IOverlayEntryHandlers {
|
|
3
|
+
/** Called once when the entry leaves the store (finalized or dropped from the queue). */
|
|
4
|
+
onRemoved?: (reason: IOverlayDismissReason) => void;
|
|
5
|
+
}
|
|
6
|
+
export type IOverlayBackResolution = {
|
|
7
|
+
kind: 'dismiss';
|
|
8
|
+
id: string;
|
|
9
|
+
} | {
|
|
10
|
+
kind: 'block';
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'pass';
|
|
13
|
+
};
|
|
14
|
+
export interface IOverlayStoreOptions {
|
|
15
|
+
/** Upper bound for a closing entry to wait for its native exit animation. */
|
|
16
|
+
closingTimeoutMs?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare class OverlayStore {
|
|
19
|
+
private readonly closingTimeoutMs;
|
|
20
|
+
private seq;
|
|
21
|
+
private readonly shown;
|
|
22
|
+
private queued;
|
|
23
|
+
private readonly handlers;
|
|
24
|
+
private readonly closingTimers;
|
|
25
|
+
private readonly pageVisibility;
|
|
26
|
+
private readonly listeners;
|
|
27
|
+
private snapshot;
|
|
28
|
+
constructor(options?: IOverlayStoreOptions);
|
|
29
|
+
subscribe: (listener: () => void) => (() => void);
|
|
30
|
+
getSnapshot: () => IOverlaySnapshot;
|
|
31
|
+
getEntry(id: string): IOverlayEntry | undefined;
|
|
32
|
+
request(request: IOverlayRequest, handlers?: IOverlayEntryHandlers): IOverlayEntry;
|
|
33
|
+
/** Starts closing an entry; the native side calls `finalize` after its exit animation. */
|
|
34
|
+
dismiss(id: string, reason?: IOverlayDismissReason): void;
|
|
35
|
+
/** Removes a closing (or active) entry once its exit animation finished. */
|
|
36
|
+
finalize(id: string): void;
|
|
37
|
+
dismissAll(filter?: {
|
|
38
|
+
scope?: IOverlayEntry['scope'];
|
|
39
|
+
belowLevel?: IOverlayEntry['level'];
|
|
40
|
+
reason?: IOverlayDismissReason;
|
|
41
|
+
}): void;
|
|
42
|
+
/** Native / navigation signal: the owning page was covered, detached or restored. */
|
|
43
|
+
setPageVisible(ownerKey: string, visible: boolean): void;
|
|
44
|
+
/** The owning page left the navigation state for good. */
|
|
45
|
+
removePage(ownerKey: string): void;
|
|
46
|
+
/**
|
|
47
|
+
* Decides what a back press / Escape does. Global entries win over page
|
|
48
|
+
* entries; `focusedHostKey` limits page entries to the focused root route
|
|
49
|
+
* (split view has one host per pane).
|
|
50
|
+
*/
|
|
51
|
+
resolveBack(focusedHostKey?: string): IOverlayBackResolution;
|
|
52
|
+
/** Topmost visible blocking entry; everything rendered below it is inert. */
|
|
53
|
+
/** The entry whose `statusBarStyle` applies (see `findStatusBarOwner`). */
|
|
54
|
+
getStatusBarOwner(): IOverlayEntry | undefined;
|
|
55
|
+
getBlockingTop(): IOverlayEntry | undefined;
|
|
56
|
+
private dismissWithoutEmit;
|
|
57
|
+
private replaceIn;
|
|
58
|
+
private isOwnerHidden;
|
|
59
|
+
private canPromote;
|
|
60
|
+
private promoteQueued;
|
|
61
|
+
private clearClosingTimer;
|
|
62
|
+
private notifyRemoved;
|
|
63
|
+
private emit;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The topmost shown, visible entry that styles the status bar. Entries are
|
|
67
|
+
* in render order, so a higher level (or a later request in the same level)
|
|
68
|
+
* wins; page entries render below global ones and suspended ones never own it.
|
|
69
|
+
*/
|
|
70
|
+
export declare function findStatusBarOwner(snapshot: IOverlaySnapshot): IOverlayEntry | undefined;
|
|
71
|
+
export declare const overlayStore: OverlayStore;
|
|
72
|
+
//# sourceMappingURL=OverlayStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverlayStore.d.ts","sourceRoot":"","sources":["../../../src/OverlayStore.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,qBAAqB,EACrB,aAAa,EACb,eAAe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EAAE,MAAM,GAAG,IAAI;IAY1B,UAAU,CACR,MAAM,GAAE;QACN,KAAK,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;QAC/B,UAAU,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;QACpC,MAAM,CAAC,EAAE,qBAAqB,CAAC;KAC3B,GACL,IAAI;IAqBP,qFAAqF;IACrF,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAqBxD,0DAA0D;IAC1D,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAalC;;;;OAIG;IACH,WAAW,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,sBAAsB;IAqB5D,6EAA6E;IAC7E,2EAA2E;IAC3E,iBAAiB,IAAI,aAAa,GAAG,SAAS;IAI9C,cAAc,IAAI,aAAa,GAAG,SAAS;IAgB3C,OAAO,CAAC,kBAAkB;IAwB1B,OAAO,CAAC,SAAS;IAiBjB,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,UAAU;IAalB,OAAO,CAAC,aAAa;IAgBrB,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,IAAI;CASb;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,gBAAgB,GACzB,aAAa,GAAG,SAAS,CAc3B;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverlayView.d.ts","sourceRoot":"","sources":["../../../src/OverlayView.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAyB5B,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,kDA+HnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverlayView.web.d.ts","sourceRoot":"","sources":["../../../src/OverlayView.web.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAGV,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAyQ5B,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,sCAgEnD"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { IOverlayAnimation, IOverlayPresentation } from './animation/types';
|
|
3
|
+
import type { IOverlayDismissReason, IOverlayLevel, IOverlayScope, IOverlayStatusBarStyle, IOverlayStrategy } from './types';
|
|
4
|
+
import type { ColorValue } from 'react-native';
|
|
5
|
+
export type IOverlayRequestDismissReason = 'back' | 'backdrop' | 'pan';
|
|
6
|
+
export interface IOverlayBackdrop {
|
|
7
|
+
/** Include alpha; e.g. the theme `$bgBackdrop`. */
|
|
8
|
+
color?: ColorValue;
|
|
9
|
+
dismissOnPress?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface IOverlaySheetOptions {
|
|
12
|
+
/** Fixed height; when omitted the sheet fits its content. */
|
|
13
|
+
height?: number;
|
|
14
|
+
/** Defaults to 92% of the window height. */
|
|
15
|
+
maxHeight?: number;
|
|
16
|
+
cornerRadius?: number;
|
|
17
|
+
showHandle?: boolean;
|
|
18
|
+
backgroundColor?: ColorValue;
|
|
19
|
+
/** Swipe down to close. A pan dismissal cannot be vetoed. */
|
|
20
|
+
dismissOnPanDown?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface IOverlayViewProps {
|
|
23
|
+
/** Desired open state. The overlay may still be queued by its strategy. */
|
|
24
|
+
visible: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* `page` renders in the root-route `OverlayPageHost` and hides while the
|
|
27
|
+
* owning page is covered. Keys default to the nearest scope providers.
|
|
28
|
+
*/
|
|
29
|
+
scope?: IOverlayScope;
|
|
30
|
+
hostKey?: string;
|
|
31
|
+
ownerKey?: string;
|
|
32
|
+
level?: IOverlayLevel;
|
|
33
|
+
strategy?: IOverlayStrategy;
|
|
34
|
+
priority?: number;
|
|
35
|
+
replaceKey?: string;
|
|
36
|
+
presentation?: IOverlayPresentation;
|
|
37
|
+
animation?: IOverlayAnimation;
|
|
38
|
+
/** `presentation="sheet"` only. */
|
|
39
|
+
sheet?: IOverlaySheetOptions;
|
|
40
|
+
/**
|
|
41
|
+
* Keep the content mounted (hidden, inert) while closed, so it keeps its
|
|
42
|
+
* state and callers can measure it before opening, as native-sheet did.
|
|
43
|
+
*/
|
|
44
|
+
keepContentMounted?: boolean;
|
|
45
|
+
/** `false` renders no backdrop. */
|
|
46
|
+
backdrop?: IOverlayBackdrop | false;
|
|
47
|
+
/** Defaults by level: toast and debug pass touches through. */
|
|
48
|
+
blocking?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Status bar content (iOS / Android) while this is the topmost shown
|
|
51
|
+
* overlay that sets one, e.g. `light` for a dark full-screen overlay.
|
|
52
|
+
* Unset leaves the status bar to the page below.
|
|
53
|
+
*/
|
|
54
|
+
statusBarStyle?: IOverlayStatusBarStyle;
|
|
55
|
+
dismissOnBackPress?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Back press or backdrop press asked to close. When omitted the overlay
|
|
58
|
+
* closes itself; when provided the caller decides by toggling `visible`.
|
|
59
|
+
* A `pan` dismissal already happened natively and always closes.
|
|
60
|
+
*/
|
|
61
|
+
onRequestDismiss?: (reason: IOverlayRequestDismissReason) => void;
|
|
62
|
+
onPresented?: () => void;
|
|
63
|
+
/** The exit animation finished and the content unmounted. */
|
|
64
|
+
onClose?: (reason: IOverlayDismissReason) => void;
|
|
65
|
+
children?: ReactNode;
|
|
66
|
+
testID?: string;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=OverlayViewTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverlayViewTypes.d.ts","sourceRoot":"","sources":["../../../src/OverlayViewTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC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CAAC,EAAE,OAAO,CAAC;IAC7B,mCAAmC;IACnC,QAAQ,CAAC,EAAE,gBAAgB,GAAG,KAAK,CAAC;IACpC,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,cAAc,CAAC,EAAE,sBAAsB,CAAC;IACxC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,4BAA4B,KAAK,IAAI,CAAC;IAClE,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAClD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IOverlayMotion, IOverlayMotionPreset } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Native tokens mirror `packages/components/tamagui.animations.native.ts`
|
|
4
|
+
* (Reanimated driver). `quick` intentionally uses a damping ratio of ~3.16 (no overshoot).
|
|
5
|
+
*/
|
|
6
|
+
export declare const NATIVE_MOTION_PRESETS: Record<IOverlayMotionPreset, IOverlayMotion>;
|
|
7
|
+
/**
|
|
8
|
+
* Web tokens mirror `packages/components/tamagui.animations.web.ts` (CSS
|
|
9
|
+
* driver). Web keeps its own short curves; converting the native springs
|
|
10
|
+
* would make web overlays several times slower than today.
|
|
11
|
+
*/
|
|
12
|
+
export declare const WEB_MOTION_PRESETS: Record<IOverlayMotionPreset, IOverlayMotion>;
|
|
13
|
+
//# sourceMappingURL=motionPresets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"motionPresets.d.ts","sourceRoot":"","sources":["../../../../src/animation/motionPresets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAgBpE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CACxC,oBAAoB,EACpB,cAAc,CAWf,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,oBAAoB,EAAE,cAAc,CAWzE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platformMotionPresets.d.ts","sourceRoot":"","sources":["../../../../src/animation/platformMotionPresets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,IAAI,sBAAsB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platformMotionPresets.web.d.ts","sourceRoot":"","sources":["../../../../src/animation/platformMotionPresets.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,sBAAsB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { IOverlayAnimation, IOverlayMotion, IOverlayMotionPreset, IOverlayPresentation, IOverlayTransition } from './types';
|
|
2
|
+
export interface IResolvedOverlayTransition extends Omit<IOverlayTransition, 'motion'> {
|
|
3
|
+
motion: IOverlayMotion;
|
|
4
|
+
}
|
|
5
|
+
export interface IResolvedOverlayAnimation {
|
|
6
|
+
enter: IResolvedOverlayTransition;
|
|
7
|
+
exit: IResolvedOverlayTransition;
|
|
8
|
+
backdrop: {
|
|
9
|
+
motion: IOverlayMotion;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Defaults match today's visuals: Dialog center (scale 0.85 + fade, quick),
|
|
14
|
+
* Tamagui Sheet (slide from bottom, quick), message toasts (slide from top,
|
|
15
|
+
* 300ms quad), Popover floating content (scale 0.95 + fade, popoverQuick).
|
|
16
|
+
*/
|
|
17
|
+
export declare const DEFAULT_OVERLAY_ANIMATIONS: Record<IOverlayPresentation, {
|
|
18
|
+
enter: IOverlayTransition;
|
|
19
|
+
backdrop: IOverlayMotionPreset;
|
|
20
|
+
}>;
|
|
21
|
+
/** Fills presentation defaults and turns preset names into concrete curves. */
|
|
22
|
+
export declare function resolveOverlayAnimation(presentation: IOverlayPresentation, animation: IOverlayAnimation | undefined, presets: Record<IOverlayMotionPreset, IOverlayMotion>): IResolvedOverlayAnimation;
|
|
23
|
+
//# sourceMappingURL=resolveAnimation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveAnimation.d.ts","sourceRoot":"","sources":["../../../../src/animation/resolveAnimation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EAEd,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,0BACf,SAAQ,IAAI,CAAC,kBAAkB,EAAE,QAAQ,CAAC;IAC1C,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,0BAA0B,CAAC;IAClC,IAAI,EAAE,0BAA0B,CAAC;IACjC,QAAQ,EAAE;QAAE,MAAM,EAAE,cAAc,CAAA;KAAE,CAAC;CACtC;AAED;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAC7C,oBAAoB,EACpB;IAAE,KAAK,EAAE,kBAAkB,CAAC;IAAC,QAAQ,EAAE,oBAAoB,CAAA;CAAE,CA4B9D,CAAC;AAuBF,+EAA+E;AAC/E,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,oBAAoB,EAClC,SAAS,EAAE,iBAAiB,GAAG,SAAS,EACxC,OAAO,EAAE,MAAM,CAAC,oBAAoB,EAAE,cAAc,CAAC,GACpD,yBAAyB,CAmB3B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { IOverlaySpring } from './types';
|
|
2
|
+
export declare function springNaturalFrequency(spring: IOverlaySpring): number;
|
|
3
|
+
export declare function springDampingRatio(spring: IOverlaySpring): number;
|
|
4
|
+
/**
|
|
5
|
+
* Android `SpringForce` assumes unit mass, so it takes
|
|
6
|
+
* stiffness / mass and the damping ratio.
|
|
7
|
+
*/
|
|
8
|
+
export declare function springToAndroidSpringForce(spring: IOverlaySpring): {
|
|
9
|
+
stiffness: number;
|
|
10
|
+
dampingRatio: number;
|
|
11
|
+
};
|
|
12
|
+
/** Normalized step response: progress from 0 to 1 at `tMs`, zero start velocity. */
|
|
13
|
+
export declare function springProgressAt(spring: IOverlaySpring, tMs: number): number;
|
|
14
|
+
/** First time after which the response stays within `epsilon` of the target. */
|
|
15
|
+
export declare function springSettleTimeMs(spring: IOverlaySpring, epsilon?: number): number;
|
|
16
|
+
/**
|
|
17
|
+
* CSS `linear()` easing sampled from the spring, for the Web Animations API when a
|
|
18
|
+
* caller passes a custom spring. Presets use `WEB_MOTION_PRESETS` instead.
|
|
19
|
+
*/
|
|
20
|
+
export declare function springToCssLinear(spring: IOverlaySpring, stops?: number): {
|
|
21
|
+
durationMs: number;
|
|
22
|
+
easing: string;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=spring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spring.d.ts","sourceRoot":"","sources":["../../../../src/animation/spring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAErE;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAEjE;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,cAAc,GAAG;IAClE,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB,CAKA;AAED,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAoB5E;AAID,gFAAgF;AAChF,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,cAAc,EACtB,OAAO,SAAQ,GACd,MAAM,CAQR;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,cAAc,EACtB,KAAK,SAAK,GACT;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CASxC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Physical spring, identical to Reanimated / Tamagui:
|
|
3
|
+
* mass * x'' + damping * x' + stiffness * x = 0.
|
|
4
|
+
* Springs with a damping ratio above 1 are valid and common (`quick`).
|
|
5
|
+
*/
|
|
6
|
+
export interface IOverlaySpring {
|
|
7
|
+
mass: number;
|
|
8
|
+
stiffness: number;
|
|
9
|
+
damping: number;
|
|
10
|
+
/** Clamp the value at the target instead of overshooting. */
|
|
11
|
+
overshootClamping?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export type IOverlayCubicBezier = readonly [number, number, number, number];
|
|
14
|
+
export interface IOverlayTiming {
|
|
15
|
+
durationMs: number;
|
|
16
|
+
easing: IOverlayCubicBezier;
|
|
17
|
+
}
|
|
18
|
+
export type IOverlayMotion = {
|
|
19
|
+
type: 'spring';
|
|
20
|
+
spring: IOverlaySpring;
|
|
21
|
+
} | {
|
|
22
|
+
type: 'timing';
|
|
23
|
+
timing: IOverlayTiming;
|
|
24
|
+
};
|
|
25
|
+
/** Named motion tokens; each platform maps them to its own curve. */
|
|
26
|
+
export type IOverlayMotionPreset = 'quick' | 'popoverQuick' | 'smooth' | 'fast' | 'medium' | 'slow' | 'toastSlide' | 'lockFade';
|
|
27
|
+
export type IOverlayMotionInput = IOverlayMotionPreset | IOverlayMotion;
|
|
28
|
+
export type IOverlayEdge = 'top' | 'bottom' | 'left' | 'right';
|
|
29
|
+
export interface IOverlayTransition {
|
|
30
|
+
/** `none` shows / hides immediately; content may animate itself. */
|
|
31
|
+
type: 'none' | 'fade' | 'slide' | 'scale';
|
|
32
|
+
/** `slide`: the edge the overlay travels from (enter) or to (exit). */
|
|
33
|
+
edge?: IOverlayEdge;
|
|
34
|
+
/** `slide`: travel in points; defaults to off-screen. */
|
|
35
|
+
distance?: number;
|
|
36
|
+
/** `scale`: start (enter) or end (exit) scale. */
|
|
37
|
+
scale?: number;
|
|
38
|
+
/** `scale`: extra translate along Y in points, e.g. -20 for custom toasts. */
|
|
39
|
+
offsetY?: number;
|
|
40
|
+
/** Fade opacity alongside slide / scale. Defaults to true for scale. */
|
|
41
|
+
fade?: boolean;
|
|
42
|
+
/** `scale`: `anchor` scales from the resolved anchor placement. */
|
|
43
|
+
origin?: 'center' | 'anchor';
|
|
44
|
+
motion?: IOverlayMotionInput;
|
|
45
|
+
}
|
|
46
|
+
export interface IOverlayAnimation {
|
|
47
|
+
enter?: IOverlayTransition;
|
|
48
|
+
/** Defaults to the reverse of `enter`. */
|
|
49
|
+
exit?: IOverlayTransition;
|
|
50
|
+
/** Backdrop fade; runs on the same clock as the content by default. */
|
|
51
|
+
backdrop?: {
|
|
52
|
+
motion?: IOverlayMotionInput;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export type IOverlayPresentation = 'sheet' | 'center' | 'fullscreen' | 'toast' | 'anchored';
|
|
56
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/animation/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,MAAM,mBAAmB,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM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