@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,290 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useId, useLayoutEffect, useRef } from 'react';
|
|
4
|
+
import { createPortal } from 'react-dom';
|
|
5
|
+
import { StyleSheet, View } from 'react-native';
|
|
6
|
+
import { OverlayLevelProvider } from "./OverlayLevelContext.js";
|
|
7
|
+
import { OVERLAY_LEVEL_ORDER, isBlockingLevel } from "./OverlayLevels.js";
|
|
8
|
+
import { OVERLAY_OWNER_ATTRIBUTE } from "./OverlayPageHost.web.js";
|
|
9
|
+
import { useOverlayController } from "./useOverlayController.js";
|
|
10
|
+
import { animateBackdrop, animateTransition } from "./web/animateTransition.js";
|
|
11
|
+
import { ENTRY_ATTRIBUTE, getOverlayLayerRoot, getOverlayPageHost, registerOverlayDismissRequester, scheduleOverlayInertSync } from "./web/overlayLayers.js";
|
|
12
|
+
import { useKeyboardShift } from "./web/useKeyboardShift.js";
|
|
13
|
+
import { useSheetDrag } from "./web/useSheetDrag.js";
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
const DEFAULT_BACKDROP_COLOR = 'rgba(0, 0, 0, 0.4)';
|
|
16
|
+
const DEFAULT_SHEET_MAX_HEIGHT = '92vh';
|
|
17
|
+
const DEFAULT_SHEET_CORNER_RADIUS = 24;
|
|
18
|
+
|
|
19
|
+
// Portaled content still bubbles React events to the caller's ancestors;
|
|
20
|
+
// stop them at the entry so presses cannot reach the page underneath.
|
|
21
|
+
// Mouse and touch events must keep bubbling natively: react-native-web's
|
|
22
|
+
// responder system (PanResponder, gesture responders) listens for them on
|
|
23
|
+
// `document`, and a React stopPropagation also stops the native event.
|
|
24
|
+
const stopPropagation = event => event.stopPropagation();
|
|
25
|
+
const ISOLATED_EVENT_HANDLERS = {
|
|
26
|
+
onClick: stopPropagation,
|
|
27
|
+
onPointerDown: stopPropagation,
|
|
28
|
+
onPointerUp: stopPropagation,
|
|
29
|
+
onKeyDown: stopPropagation
|
|
30
|
+
};
|
|
31
|
+
function WebOverlayEntry({
|
|
32
|
+
entryId,
|
|
33
|
+
parked = false,
|
|
34
|
+
stackOrder,
|
|
35
|
+
presented,
|
|
36
|
+
animation,
|
|
37
|
+
blocking,
|
|
38
|
+
backdropColor,
|
|
39
|
+
dismissOnBackdropPress,
|
|
40
|
+
onPresented,
|
|
41
|
+
onDismissed,
|
|
42
|
+
onRequestDismiss,
|
|
43
|
+
sheet,
|
|
44
|
+
zIndex,
|
|
45
|
+
ownerKey,
|
|
46
|
+
testID,
|
|
47
|
+
children
|
|
48
|
+
}) {
|
|
49
|
+
const sheetRef = useRef(null);
|
|
50
|
+
// A pan dismissal already moved the sheet off screen; skip the exit run.
|
|
51
|
+
const pannedAwayRef = useRef(false);
|
|
52
|
+
const isSheet = !!sheet;
|
|
53
|
+
const entryRef = useRef(null);
|
|
54
|
+
const contentRef = useRef(null);
|
|
55
|
+
const keyboardLayerRef = useRef(null);
|
|
56
|
+
const backdropRef = useRef(null);
|
|
57
|
+
const directionRef = useRef(undefined);
|
|
58
|
+
const restoreFocusRef = useRef(null);
|
|
59
|
+
const callbacksRef = useRef({
|
|
60
|
+
onPresented,
|
|
61
|
+
onDismissed
|
|
62
|
+
});
|
|
63
|
+
callbacksRef.current = {
|
|
64
|
+
onPresented,
|
|
65
|
+
onDismissed
|
|
66
|
+
};
|
|
67
|
+
useLayoutEffect(() => {
|
|
68
|
+
const content = contentRef.current;
|
|
69
|
+
if (!content) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const direction = presented ? 'in' : 'out';
|
|
73
|
+
if (directionRef.current === direction) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const neverEntered = directionRef.current === undefined;
|
|
77
|
+
directionRef.current = direction;
|
|
78
|
+
scheduleOverlayInertSync();
|
|
79
|
+
if (direction === 'out' && (neverEntered || pannedAwayRef.current)) {
|
|
80
|
+
callbacksRef.current.onDismissed();
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (direction === 'in' && blocking) {
|
|
84
|
+
restoreFocusRef.current = document.activeElement;
|
|
85
|
+
entryRef.current?.focus({
|
|
86
|
+
preventScroll: true
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
content.getAnimations().forEach(running => running.cancel());
|
|
90
|
+
backdropRef.current?.getAnimations().forEach(running => running.cancel());
|
|
91
|
+
// A sheet is measured as a whole; other presentations by the children
|
|
92
|
+
// of the full-window React root.
|
|
93
|
+
const contentRoot = isSheet ? content : content.firstElementChild ?? content;
|
|
94
|
+
const transition = direction === 'in' ? animation.enter : animation.exit;
|
|
95
|
+
const running = [animateTransition(content, contentRoot, transition, direction), backdropRef.current ? animateBackdrop(backdropRef.current, animation.backdrop.motion, direction) : undefined].filter(item => !!item);
|
|
96
|
+
void Promise.all(running.map(item => item.finished)).then(() => {
|
|
97
|
+
if (directionRef.current !== direction) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (direction === 'in') {
|
|
101
|
+
callbacksRef.current.onPresented();
|
|
102
|
+
} else {
|
|
103
|
+
restoreFocusRef.current?.focus?.({
|
|
104
|
+
preventScroll: true
|
|
105
|
+
});
|
|
106
|
+
restoreFocusRef.current = null;
|
|
107
|
+
callbacksRef.current.onDismissed();
|
|
108
|
+
}
|
|
109
|
+
}).catch(() => {
|
|
110
|
+
// Cancelled by a newer transition; that run reports instead.
|
|
111
|
+
});
|
|
112
|
+
}, [presented, animation, blocking, isSheet]);
|
|
113
|
+
useEffect(() => registerOverlayDismissRequester(entryId, onRequestDismiss), [entryId, onRequestDismiss]);
|
|
114
|
+
|
|
115
|
+
// A plain DOM listener: the backdrop is a pointer target only; keyboard
|
|
116
|
+
// users dismiss with Escape through the layer manager.
|
|
117
|
+
useEffect(() => {
|
|
118
|
+
const backdropNode = backdropRef.current;
|
|
119
|
+
if (!backdropNode || !dismissOnBackdropPress) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const onBackdropClick = () => onRequestDismiss('backdrop');
|
|
123
|
+
backdropNode.addEventListener('click', onBackdropClick);
|
|
124
|
+
return () => backdropNode.removeEventListener('click', onBackdropClick);
|
|
125
|
+
}, [dismissOnBackdropPress, onRequestDismiss]);
|
|
126
|
+
useKeyboardShift({
|
|
127
|
+
layerRef: keyboardLayerRef,
|
|
128
|
+
sheetRef,
|
|
129
|
+
contentRef,
|
|
130
|
+
isSheet,
|
|
131
|
+
enabled: presented
|
|
132
|
+
});
|
|
133
|
+
useSheetDrag({
|
|
134
|
+
sheetRef,
|
|
135
|
+
backdropRef,
|
|
136
|
+
enabled: !!sheet && (sheet.dismissOnPanDown ?? true) && presented,
|
|
137
|
+
onDismissByPan: () => {
|
|
138
|
+
pannedAwayRef.current = true;
|
|
139
|
+
onRequestDismiss('pan');
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
const showBackdrop = !!backdropColor || blocking;
|
|
143
|
+
const cornerRadius = sheet?.cornerRadius ?? DEFAULT_SHEET_CORNER_RADIUS;
|
|
144
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
145
|
+
ref: entryRef,
|
|
146
|
+
[ENTRY_ATTRIBUTE]: '',
|
|
147
|
+
...(ownerKey ? {
|
|
148
|
+
[OVERLAY_OWNER_ATTRIBUTE]: ownerKey
|
|
149
|
+
} : {}),
|
|
150
|
+
"data-stack-order": stackOrder,
|
|
151
|
+
"data-testid": testID,
|
|
152
|
+
role: blocking ? 'dialog' : undefined,
|
|
153
|
+
"aria-modal": blocking || undefined,
|
|
154
|
+
tabIndex: -1,
|
|
155
|
+
inert: parked || undefined,
|
|
156
|
+
"aria-hidden": parked || undefined,
|
|
157
|
+
style: {
|
|
158
|
+
position: 'absolute',
|
|
159
|
+
inset: 0,
|
|
160
|
+
zIndex,
|
|
161
|
+
pointerEvents: 'none',
|
|
162
|
+
outline: 'none',
|
|
163
|
+
visibility: parked ? 'hidden' : undefined
|
|
164
|
+
},
|
|
165
|
+
...ISOLATED_EVENT_HANDLERS,
|
|
166
|
+
children: [showBackdrop ? /*#__PURE__*/_jsx("div", {
|
|
167
|
+
ref: backdropRef,
|
|
168
|
+
"aria-hidden": true,
|
|
169
|
+
style: {
|
|
170
|
+
position: 'absolute',
|
|
171
|
+
inset: 0,
|
|
172
|
+
opacity: 0,
|
|
173
|
+
background: backdropColor ?? 'transparent',
|
|
174
|
+
pointerEvents: blocking ? 'auto' : 'none'
|
|
175
|
+
}
|
|
176
|
+
}) : null, /*#__PURE__*/_jsx("div", {
|
|
177
|
+
ref: keyboardLayerRef,
|
|
178
|
+
style: {
|
|
179
|
+
position: 'absolute',
|
|
180
|
+
inset: 0,
|
|
181
|
+
pointerEvents: 'none',
|
|
182
|
+
transition: 'transform 250ms ease-out'
|
|
183
|
+
},
|
|
184
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
185
|
+
ref: contentRef,
|
|
186
|
+
style: {
|
|
187
|
+
position: 'absolute',
|
|
188
|
+
inset: 0,
|
|
189
|
+
pointerEvents: 'none'
|
|
190
|
+
},
|
|
191
|
+
children: sheet ? /*#__PURE__*/_jsxs("div", {
|
|
192
|
+
ref: sheetRef,
|
|
193
|
+
style: {
|
|
194
|
+
position: 'absolute',
|
|
195
|
+
left: 0,
|
|
196
|
+
right: 0,
|
|
197
|
+
bottom: 0,
|
|
198
|
+
height: sheet.height,
|
|
199
|
+
maxHeight: sheet.maxHeight ?? DEFAULT_SHEET_MAX_HEIGHT,
|
|
200
|
+
display: 'flex',
|
|
201
|
+
flexDirection: 'column',
|
|
202
|
+
overflow: 'hidden',
|
|
203
|
+
pointerEvents: 'auto',
|
|
204
|
+
touchAction: 'pan-y',
|
|
205
|
+
background: sheet.backgroundColor ? String(sheet.backgroundColor) : undefined,
|
|
206
|
+
borderTopLeftRadius: cornerRadius,
|
|
207
|
+
borderTopRightRadius: cornerRadius
|
|
208
|
+
},
|
|
209
|
+
children: [sheet.showHandle ? /*#__PURE__*/_jsx("div", {
|
|
210
|
+
style: {
|
|
211
|
+
alignSelf: 'center',
|
|
212
|
+
width: 36,
|
|
213
|
+
height: 5,
|
|
214
|
+
marginTop: 8,
|
|
215
|
+
borderRadius: 2.5,
|
|
216
|
+
background: 'rgba(0, 0, 0, 0.2)',
|
|
217
|
+
flexShrink: 0
|
|
218
|
+
}
|
|
219
|
+
}) : null, /*#__PURE__*/_jsx(View, {
|
|
220
|
+
style: {
|
|
221
|
+
flexShrink: 1
|
|
222
|
+
},
|
|
223
|
+
children: children
|
|
224
|
+
})]
|
|
225
|
+
}) : /*#__PURE__*/_jsx(View, {
|
|
226
|
+
pointerEvents: "box-none",
|
|
227
|
+
style: StyleSheet.absoluteFill,
|
|
228
|
+
children: children
|
|
229
|
+
})
|
|
230
|
+
})
|
|
231
|
+
})]
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
export function OverlayView(props) {
|
|
235
|
+
const {
|
|
236
|
+
level = 'modal',
|
|
237
|
+
presentation = 'center',
|
|
238
|
+
backdrop,
|
|
239
|
+
blocking,
|
|
240
|
+
sheet,
|
|
241
|
+
keepContentMounted = false,
|
|
242
|
+
children,
|
|
243
|
+
testID
|
|
244
|
+
} = props;
|
|
245
|
+
const parkedId = useId();
|
|
246
|
+
const {
|
|
247
|
+
entry,
|
|
248
|
+
mounted,
|
|
249
|
+
presented,
|
|
250
|
+
animation,
|
|
251
|
+
onHostPresented,
|
|
252
|
+
onHostDismissed,
|
|
253
|
+
onHostRequestDismiss,
|
|
254
|
+
scope,
|
|
255
|
+
hostKey,
|
|
256
|
+
ownerKey
|
|
257
|
+
} = useOverlayController(props);
|
|
258
|
+
|
|
259
|
+
// Closed with `keepContentMounted`: the same entry stays in the layer,
|
|
260
|
+
// hidden and inert, so the content keeps its state and can be measured.
|
|
261
|
+
const parked = !mounted || !entry;
|
|
262
|
+
if (parked && !keepContentMounted) {
|
|
263
|
+
return null;
|
|
264
|
+
}
|
|
265
|
+
const pageHost = !parked && scope === 'page' ? getOverlayPageHost(hostKey) : undefined;
|
|
266
|
+
return /*#__PURE__*/createPortal(/*#__PURE__*/_jsx(WebOverlayEntry, {
|
|
267
|
+
parked: parked,
|
|
268
|
+
entryId: entry?.id ?? parkedId,
|
|
269
|
+
stackOrder: entry?.seq ?? 0,
|
|
270
|
+
presented: !parked && presented,
|
|
271
|
+
animation: animation,
|
|
272
|
+
blocking: blocking ?? isBlockingLevel(level),
|
|
273
|
+
backdropColor: backdrop ? String(backdrop.color ?? DEFAULT_BACKDROP_COLOR) : undefined,
|
|
274
|
+
dismissOnBackdropPress: backdrop ? !!backdrop.dismissOnPress : false,
|
|
275
|
+
onPresented: onHostPresented,
|
|
276
|
+
onDismissed: onHostDismissed,
|
|
277
|
+
onRequestDismiss: onHostRequestDismiss,
|
|
278
|
+
sheet: presentation === 'sheet' ? sheet ?? {} : undefined
|
|
279
|
+
// Inside a page host all levels share one stacking context.
|
|
280
|
+
,
|
|
281
|
+
zIndex: pageHost ? OVERLAY_LEVEL_ORDER[level] * 1000 + (entry?.seq ?? 0) : entry?.seq ?? 0,
|
|
282
|
+
ownerKey: pageHost ? ownerKey : undefined,
|
|
283
|
+
testID: testID,
|
|
284
|
+
children: /*#__PURE__*/_jsx(OverlayLevelProvider, {
|
|
285
|
+
value: level,
|
|
286
|
+
children: children
|
|
287
|
+
})
|
|
288
|
+
}, "entry"), pageHost ?? getOverlayLayerRoot(level));
|
|
289
|
+
}
|
|
290
|
+
//# sourceMappingURL=OverlayView.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useId","useLayoutEffect","useRef","createPortal","StyleSheet","View","OverlayLevelProvider","OVERLAY_LEVEL_ORDER","isBlockingLevel","OVERLAY_OWNER_ATTRIBUTE","useOverlayController","animateBackdrop","animateTransition","ENTRY_ATTRIBUTE","getOverlayLayerRoot","getOverlayPageHost","registerOverlayDismissRequester","scheduleOverlayInertSync","useKeyboardShift","useSheetDrag","jsx","_jsx","jsxs","_jsxs","DEFAULT_BACKDROP_COLOR","DEFAULT_SHEET_MAX_HEIGHT","DEFAULT_SHEET_CORNER_RADIUS","stopPropagation","event","ISOLATED_EVENT_HANDLERS","onClick","onPointerDown","onPointerUp","onKeyDown","WebOverlayEntry","entryId","parked","stackOrder","presented","animation","blocking","backdropColor","dismissOnBackdropPress","onPresented","onDismissed","onRequestDismiss","sheet","zIndex","ownerKey","testID","children","sheetRef","pannedAwayRef","isSheet","entryRef","contentRef","keyboardLayerRef","backdropRef","directionRef","undefined","restoreFocusRef","callbacksRef","current","content","direction","neverEntered","document","activeElement","focus","preventScroll","getAnimations","forEach","running","cancel","contentRoot","firstElementChild","transition","enter","exit","backdrop","motion","filter","item","Promise","all","map","finished","then","catch","backdropNode","onBackdropClick","addEventListener","removeEventListener","layerRef","enabled","dismissOnPanDown","onDismissByPan","showBackdrop","cornerRadius","ref","role","tabIndex","inert","style","position","inset","pointerEvents","outline","visibility","opacity","background","left","right","bottom","height","maxHeight","display","flexDirection","overflow","touchAction","backgroundColor","String","borderTopLeftRadius","borderTopRightRadius","showHandle","alignSelf","width","marginTop","borderRadius","flexShrink","absoluteFill","OverlayView","props","level","presentation","keepContentMounted","parkedId","entry","mounted","onHostPresented","onHostDismissed","onHostRequestDismiss","scope","hostKey","pageHost","id","seq","color","dismissOnPress","value"],"sourceRoot":"../../src","sources":["OverlayView.web.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,KAAK,EAAEC,eAAe,EAAEC,MAAM,QAAQ,OAAO;AAGjE,SAASC,YAAY,QAAQ,WAAW;AACxC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,oBAAoB,QAAQ,0BAAuB;AAC5D,SAASC,mBAAmB,EAAEC,eAAe,QAAQ,oBAAiB;AACtE,SAASC,uBAAuB,QAAQ,0BAAuB;AAC/D,SAASC,oBAAoB,QAAQ,2BAAwB;AAC7D,SAASC,eAAe,EAAEC,iBAAiB,QAAQ,4BAAyB;AAC5E,SACEC,eAAe,EACfC,mBAAmB,EACnBC,kBAAkB,EAClBC,+BAA+B,EAC/BC,wBAAwB,QACnB,wBAAqB;AAC5B,SAASC,gBAAgB,QAAQ,2BAAwB;AACzD,SAASC,YAAY,QAAQ,uBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AASlD,MAAMC,sBAAsB,GAAG,oBAAoB;AACnD,MAAMC,wBAAwB,GAAG,MAAM;AACvC,MAAMC,2BAA2B,GAAG,EAAE;;AAEtC;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,GAAIC,KAAqB,IAAKA,KAAK,CAACD,eAAe,CAAC,CAAC;AAC1E,MAAME,uBAAuB,GAAG;EAC9BC,OAAO,EAAEH,eAAe;EACxBI,aAAa,EAAEJ,eAAe;EAC9BK,WAAW,EAAEL,eAAe;EAC5BM,SAAS,EAAEN;AACb,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E,SAAU;IAChCC,SAAS,EAAEA,SAAU;IACrBC,QAAQ,EAAEA,QAAQ,IAAIhC,eAAe,CAAC6H,KAAK,CAAE;IAC7C5F,aAAa,EACXsC,QAAQ,GAAG0C,MAAM,CAAC1C,QAAQ,CAACoE,KAAK,IAAI3H,sBAAsB,CAAC,GAAGmC,SAC/D;IACDjB,sBAAsB,EAAEqC,QAAQ,GAAG,CAAC,CAACA,QAAQ,CAACqE,cAAc,GAAG,KAAM;IACrEzG,WAAW,EAAEgG,eAAgB;IAC7B/F,WAAW,EAAEgG,eAAgB;IAC7B/F,gBAAgB,EAAEgG,oBAAqB;IACvC/F,KAAK,EAAEwF,YAAY,KAAK,OAAO,GAAGxF,KAAK,IAAI,CAAC,CAAC,GAAGa;IAChD;IAAA;IACAZ,MAAM,EACJiG,QAAQ,GACJzI,mBAAmB,CAAC8H,KAAK,CAAC,GAAG,IAAI,IAAII,KAAK,EAAES,GAAG,IAAI,CAAC,CAAC,GACrDT,KAAK,EAAES,GAAG,IAAI,CACnB;IACDlG,QAAQ,EAAEgG,QAAQ,GAAGhG,QAAQ,GAAGW,SAAU;IAC1CV,MAAM,EAAEA,MAAO;IAAAC,QAAA,eAEf7B,IAAA,CAACf,oBAAoB;MAAC+I,KAAK,EAAEhB,KAAM;MAAAnF,QAAA,EAAEA;IAAQ,CAAuB;EAAC,GAxBjE,OAyBW,CAAC,EAClB8F,QAAQ,IAAIlI,mBAAmB,CAACuH,KAAK,CACvC,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["OverlayViewTypes.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const EASE = [0.25, 0.1, 0.25, 1];
|
|
4
|
+
const EASE_OUT = [0, 0, 0.58, 1];
|
|
5
|
+
function spring(mass, stiffness, damping) {
|
|
6
|
+
return {
|
|
7
|
+
type: 'spring',
|
|
8
|
+
spring: {
|
|
9
|
+
mass,
|
|
10
|
+
stiffness,
|
|
11
|
+
damping
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function timing(durationMs, easing) {
|
|
16
|
+
return {
|
|
17
|
+
type: 'timing',
|
|
18
|
+
timing: {
|
|
19
|
+
durationMs,
|
|
20
|
+
easing
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Native tokens mirror `packages/components/tamagui.animations.native.ts`
|
|
27
|
+
* (Reanimated driver). `quick` intentionally uses a damping ratio of ~3.16 (no overshoot).
|
|
28
|
+
*/
|
|
29
|
+
export const NATIVE_MOTION_PRESETS = {
|
|
30
|
+
quick: spring(0.1, 100, 20),
|
|
31
|
+
popoverQuick: timing(150, [0.215, 0.61, 0.355, 1]),
|
|
32
|
+
smooth: spring(1, 438, 42),
|
|
33
|
+
fast: spring(1.2, 250, 20),
|
|
34
|
+
medium: spring(0.9, 100, 10),
|
|
35
|
+
slow: spring(1, 60, 20),
|
|
36
|
+
// @backpackapp-io/react-native-toast: 300ms Easing.inOut(Easing.quad).
|
|
37
|
+
toastSlide: timing(300, [0.455, 0.03, 0.515, 0.955]),
|
|
38
|
+
lockFade: timing(150, EASE_OUT)
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Web tokens mirror `packages/components/tamagui.animations.web.ts` (CSS
|
|
43
|
+
* driver). Web keeps its own short curves; converting the native springs
|
|
44
|
+
* would make web overlays several times slower than today.
|
|
45
|
+
*/
|
|
46
|
+
export const WEB_MOTION_PRESETS = {
|
|
47
|
+
quick: timing(150, EASE),
|
|
48
|
+
popoverQuick: timing(150, [0.215, 0.61, 0.355, 1]),
|
|
49
|
+
smooth: timing(300, [0.2, 0, 0, 1]),
|
|
50
|
+
fast: timing(200, EASE_OUT),
|
|
51
|
+
medium: timing(300, EASE_OUT),
|
|
52
|
+
slow: timing(450, EASE_OUT),
|
|
53
|
+
// sonner: transform / opacity 400ms ease.
|
|
54
|
+
toastSlide: timing(400, EASE),
|
|
55
|
+
lockFade: timing(150, EASE_OUT)
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=motionPresets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["EASE","EASE_OUT","spring","mass","stiffness","damping","type","timing","durationMs","easing","NATIVE_MOTION_PRESETS","quick","popoverQuick","smooth","fast","medium","slow","toastSlide","lockFade","WEB_MOTION_PRESETS"],"sourceRoot":"../../../src","sources":["animation/motionPresets.ts"],"mappings":";;AAEA,MAAMA,IAA+C,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;AAC5E,MAAMC,QAAmD,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;AAE3E,SAASC,MAAMA,CAACC,IAAY,EAAEC,SAAiB,EAAEC,OAAe,EAAE;EAChE,OAAO;IAAEC,IAAI,EAAE,QAAQ;IAAEJ,MAAM,EAAE;MAAEC,IAAI;MAAEC,SAAS;MAAEC;IAAQ;EAAE,CAAC;AACjE;AAEA,SAASE,MAAMA,CACbC,UAAkB,EAClBC,MAAiD,EACjD;EACA,OAAO;IAAEH,IAAI,EAAE,QAAQ;IAAEC,MAAM,EAAE;MAAEC,UAAU;MAAEC;IAAO;EAAE,CAAC;AAC3D;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAGZ,GAAG;EACFC,KAAK,EAAET,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC;EAC3BU,YAAY,EAAEL,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;EAClDM,MAAM,EAAEX,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC;EAC1BY,IAAI,EAAEZ,MAAM,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@@
|
|
|
1
|
+
{"version":3,"names":["WEB_MOTION_PRESETS","OVERLAY_MOTION_PRESETS"],"sourceRoot":"../../../src","sources":["animation/platformMotionPresets.web.ts"],"mappings":";;AAAA,SAASA,kBAAkB,IAAIC,sBAAsB,QAAQ,oBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Defaults match today's visuals: Dialog center (scale 0.85 + fade, quick),
|
|
5
|
+
* Tamagui Sheet (slide from bottom, quick), message toasts (slide from top,
|
|
6
|
+
* 300ms quad), Popover floating content (scale 0.95 + fade, popoverQuick).
|
|
7
|
+
*/
|
|
8
|
+
export const DEFAULT_OVERLAY_ANIMATIONS = {
|
|
9
|
+
sheet: {
|
|
10
|
+
enter: {
|
|
11
|
+
type: 'slide',
|
|
12
|
+
edge: 'bottom',
|
|
13
|
+
motion: 'quick'
|
|
14
|
+
},
|
|
15
|
+
backdrop: 'quick'
|
|
16
|
+
},
|
|
17
|
+
center: {
|
|
18
|
+
enter: {
|
|
19
|
+
type: 'scale',
|
|
20
|
+
scale: 0.85,
|
|
21
|
+
fade: true,
|
|
22
|
+
motion: 'quick'
|
|
23
|
+
},
|
|
24
|
+
backdrop: 'quick'
|
|
25
|
+
},
|
|
26
|
+
toast: {
|
|
27
|
+
enter: {
|
|
28
|
+
type: 'slide',
|
|
29
|
+
edge: 'top',
|
|
30
|
+
fade: true,
|
|
31
|
+
motion: 'toastSlide'
|
|
32
|
+
},
|
|
33
|
+
backdrop: 'quick'
|
|
34
|
+
},
|
|
35
|
+
fullscreen: {
|
|
36
|
+
enter: {
|
|
37
|
+
type: 'fade',
|
|
38
|
+
motion: 'quick'
|
|
39
|
+
},
|
|
40
|
+
backdrop: 'quick'
|
|
41
|
+
},
|
|
42
|
+
anchored: {
|
|
43
|
+
enter: {
|
|
44
|
+
type: 'scale',
|
|
45
|
+
scale: 0.95,
|
|
46
|
+
fade: true,
|
|
47
|
+
origin: 'anchor',
|
|
48
|
+
motion: 'popoverQuick'
|
|
49
|
+
},
|
|
50
|
+
backdrop: 'popoverQuick'
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
function resolveMotion(input, fallback, presets) {
|
|
54
|
+
const value = input ?? fallback;
|
|
55
|
+
return typeof value === 'string' ? presets[value] : value;
|
|
56
|
+
}
|
|
57
|
+
function resolveTransition(transition, fallbackMotion, presets) {
|
|
58
|
+
return {
|
|
59
|
+
...transition,
|
|
60
|
+
fade: transition.fade ?? transition.type === 'scale',
|
|
61
|
+
motion: resolveMotion(transition.motion, fallbackMotion, presets)
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Fills presentation defaults and turns preset names into concrete curves. */
|
|
66
|
+
export function resolveOverlayAnimation(presentation, animation, presets) {
|
|
67
|
+
const defaults = DEFAULT_OVERLAY_ANIMATIONS[presentation];
|
|
68
|
+
const enterInput = animation?.enter ?? defaults.enter;
|
|
69
|
+
const fallbackMotion = defaults.enter.motion ?? 'quick';
|
|
70
|
+
const enter = resolveTransition(enterInput, fallbackMotion, presets);
|
|
71
|
+
const exit = animation?.exit ? resolveTransition(animation.exit, fallbackMotion, presets) : enter;
|
|
72
|
+
return {
|
|
73
|
+
enter,
|
|
74
|
+
exit,
|
|
75
|
+
backdrop: {
|
|
76
|
+
motion: resolveMotion(animation?.backdrop?.motion, defaults.backdrop, presets)
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=resolveAnimation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DEFAULT_OVERLAY_ANIMATIONS","sheet","enter","type","edge","motion","backdrop","center","scale","fade","toast","fullscreen","anchored","origin","resolveMotion","input","fallback","presets","value","resolveTransition","transition","fallbackMotion","resolveOverlayAnimation","presentation","animation","defaults","enterInput","exit"],"sourceRoot":"../../../src","sources":["animation/resolveAnimation.ts"],"mappings":";;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CAACX,IAAI,IAAIW,UAAU,CAACjB,IAAI,KAAK,OAAO;IACpDE,MAAM,EAAES,aAAa,CAACM,UAAU,CAACf,MAAM,EAAEgB,cAAc,EAAEJ,OAAO;EAClE,CAAC;AACH;;AAEA;AACA,OAAO,SAASK,uBAAuBA,CACrCC,YAAkC,EAClCC,SAAwC,EACxCP,OAAqD,EAC1B;EAC3B,MAAMQ,QAAQ,GAAGzB,0BAA0B,CAACuB,YAAY,CAAC;EACzD,MAAMG,UAAU,GAAGF,SAAS,EAAEtB,KAAK,IAAIuB,QAAQ,CAACvB,KAAK;EACrD,MAAMmB,cAAc,GAAGI,QAAQ,CAACvB,KAAK,CAACG,MAAM,IAAI,OAAO;EACvD,MAAMH,KAAK,GAAGiB,iBAAiB,CAACO,UAAU,EAAEL,cAAc,EAAEJ,OAAO,CAAC;EACpE,MAAMU,IAAI,GAAGH,SAAS,EAAEG,IAAI,GACxBR,iBAAiB,CAACK,SAAS,CAACG,IAAI,EAAEN,cAAc,EAAEJ,OAAO,CAAC,GAC1Df,KAAK;EACT,OAAO;IACLA,KAAK;IACLyB,IAAI;IACJrB,QAAQ,EAAE;MACRD,MAAM,EAAES,aAAa,CACnBU,SAAS,EAAElB,QAAQ,EAAED,MAAM,EAC3BoB,QAAQ,CAACnB,QAAQ,EACjBW,OACF;IACF;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export function springNaturalFrequency(spring) {
|
|
4
|
+
return Math.sqrt(spring.stiffness / spring.mass);
|
|
5
|
+
}
|
|
6
|
+
export function springDampingRatio(spring) {
|
|
7
|
+
return spring.damping / (2 * Math.sqrt(spring.stiffness * spring.mass));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Android `SpringForce` assumes unit mass, so it takes
|
|
12
|
+
* stiffness / mass and the damping ratio.
|
|
13
|
+
*/
|
|
14
|
+
export function springToAndroidSpringForce(spring) {
|
|
15
|
+
return {
|
|
16
|
+
stiffness: spring.stiffness / spring.mass,
|
|
17
|
+
dampingRatio: springDampingRatio(spring)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Normalized step response: progress from 0 to 1 at `tMs`, zero start velocity. */
|
|
22
|
+
export function springProgressAt(spring, tMs) {
|
|
23
|
+
const t = tMs / 1000;
|
|
24
|
+
const w0 = springNaturalFrequency(spring);
|
|
25
|
+
const zeta = springDampingRatio(spring);
|
|
26
|
+
let progress;
|
|
27
|
+
if (zeta < 1) {
|
|
28
|
+
const wd = w0 * Math.sqrt(1 - zeta * zeta);
|
|
29
|
+
progress = 1 - Math.exp(-zeta * w0 * t) * (Math.cos(wd * t) + zeta * w0 / wd * Math.sin(wd * t));
|
|
30
|
+
} else if (zeta === 1) {
|
|
31
|
+
progress = 1 - Math.exp(-w0 * t) * (1 + w0 * t);
|
|
32
|
+
} else {
|
|
33
|
+
const root = Math.sqrt(zeta * zeta - 1);
|
|
34
|
+
const r1 = -w0 * (zeta - root);
|
|
35
|
+
const r2 = -w0 * (zeta + root);
|
|
36
|
+
progress = 1 - (r2 * Math.exp(r1 * t) - r1 * Math.exp(r2 * t)) / (r2 - r1);
|
|
37
|
+
}
|
|
38
|
+
return spring.overshootClamping ? Math.min(progress, 1) : progress;
|
|
39
|
+
}
|
|
40
|
+
const MAX_SETTLE_MS = 10_000;
|
|
41
|
+
|
|
42
|
+
/** First time after which the response stays within `epsilon` of the target. */
|
|
43
|
+
export function springSettleTimeMs(spring, epsilon = 0.001) {
|
|
44
|
+
let lastOutside = 0;
|
|
45
|
+
for (let t = 0; t <= MAX_SETTLE_MS; t += 1) {
|
|
46
|
+
if (Math.abs(1 - springProgressAt(spring, t)) >= epsilon) {
|
|
47
|
+
lastOutside = t;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return lastOutside + 1;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* CSS `linear()` easing sampled from the spring, for the Web Animations API when a
|
|
55
|
+
* caller passes a custom spring. Presets use `WEB_MOTION_PRESETS` instead.
|
|
56
|
+
*/
|
|
57
|
+
export function springToCssLinear(spring, stops = 40) {
|
|
58
|
+
const durationMs = springSettleTimeMs(spring);
|
|
59
|
+
const points = [];
|
|
60
|
+
for (let i = 0; i <= stops; i += 1) {
|
|
61
|
+
const value = i === stops ? 1 : springProgressAt(spring, durationMs * i / stops);
|
|
62
|
+
points.push(String(Math.round(value * 10_000) / 10_000));
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
durationMs,
|
|
66
|
+
easing: `linear(${points.join(', ')})`
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=spring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["springNaturalFrequency","spring","Math","sqrt","stiffness","mass","springDampingRatio","damping","springToAndroidSpringForce","dampingRatio","springProgressAt","tMs","t","w0","zeta","progress","wd","exp","cos","sin","root","r1","r2","overshootClamping","min","MAX_SETTLE_MS","springSettleTimeMs","epsilon","lastOutside","abs","springToCssLinear","stops","durationMs","points","i","value","push","String","round","easing","join"],"sourceRoot":"../../../src","sources":["animation/spring.ts"],"mappings":";;AAEA,OAAO,SAASA,sBAAsBA,CAACC,MAAsB,EAAU;EACrE,OAAOC,IAAI,CAACC,IAAI,CAACF,MAAM,CAACG,SAAS,GAAGH,MAAM,CAACI,IAAI,CAAC;AAClD;AAEA,OAAO,SAASC,kBAAkBA,CAACL,MAAsB,EAAU;EACjE,OAAOA,MAAM,CAACM,OAAO,IAAI,CAAC,GAAGL,IAAI,CAACC,IAAI,CAACF,MAAM,CAACG,SAAS,GAAGH,MAAM,CAACI,IAAI,CAAC,CAAC;AACzE;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASG,0BAA0BA,CAACP,MAAsB,EAG/D;EACA,OAAO;IACLG,SAAS,EAAEH,MAAM,CAACG,SAAS,GAAG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AAEH,UAAU;IAAEO,MAAM,EAAE,UAAUN,MAAM,CAACO,IAAI,CAAC,IAAI,CAAC;EAAI,CAAC;AAC/D","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["animation/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export * from "./types.js";
|
|
4
|
+
export { OVERLAY_LEVELS, OVERLAY_LEVEL_ORDER, OVERLAY_WEB_PAGE_Z_INDEX_BASE, OVERLAY_WEB_Z_INDEX_BASE, isBlockingLevel } from "./OverlayLevels.js";
|
|
5
|
+
export { OverlayRequestError } from "./OverlayErrors.js";
|
|
6
|
+
export { OverlayStore, findStatusBarOwner, overlayStore } from "./OverlayStore.js";
|
|
7
|
+
export * from "./animation/types.js";
|
|
8
|
+
export { NATIVE_MOTION_PRESETS, WEB_MOTION_PRESETS } from "./animation/motionPresets.js";
|
|
9
|
+
export { OVERLAY_MOTION_PRESETS } from './animation/platformMotionPresets';
|
|
10
|
+
export { DEFAULT_OVERLAY_ANIMATIONS, resolveOverlayAnimation } from "./animation/resolveAnimation.js";
|
|
11
|
+
export { springDampingRatio, springNaturalFrequency, springProgressAt, springSettleTimeMs, springToAndroidSpringForce, springToCssLinear } from "./animation/spring.js";
|
|
12
|
+
export { OverlayView } from './OverlayView';
|
|
13
|
+
export { useEnclosingOverlayLevel, useNestedOverlayLevel } from "./OverlayLevelContext.js";
|
|
14
|
+
export { OverlayPageHostScope, OverlayPageOwnerScope, useOverlayPageScope } from "./OverlayPageScope.js";
|
|
15
|
+
export { OverlayPageHost } from './OverlayPageHost';
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["OVERLAY_LEVELS","OVERLAY_LEVEL_ORDER","OVERLAY_WEB_PAGE_Z_INDEX_BASE","OVERLAY_WEB_Z_INDEX_BASE","isBlockingLevel","OverlayRequestError","OverlayStore","findStatusBarOwner","overlayStore","NATIVE_MOTION_PRESETS","WEB_MOTION_PRESETS","OVERLAY_MOTION_PRESETS","DEFAULT_OVERLAY_ANIMATIONS","resolveOverlayAnimation","springDampingRatio","springNaturalFrequency","springProgressAt","springSettleTimeMs","springToAndroidSpringForce","springToCssLinear","OverlayView","useEnclosingOverlayLevel","useNestedOverlayLevel","OverlayPageHostScope","OverlayPageOwnerScope","useOverlayPageScope","OverlayPageHost"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,cAAc,YAAS;AACvB,SACEA,cAAc,EACdC,mBAAmB,EACnBC,6BAA6B,EAC7BC,wBAAwB,EACxBC,eAAe,QACV,oBAAiB;AACxB,SAASC,mBAAmB,QAAQ,oBAAiB;AACrD,SAASC,YAAY,EAAEC,kBAAkB,EAAEC,YAAY,QAAQ,mBAAgB;AAM/E,cAAc,sBAAmB;AACjC,SACEC,qBAAqB,EACrBC,kBAAkB,QACb,8BAA2B;AAClC,SAASC,sBAAsB,QAAQ,mCAAmC;AAC1E,SACEC,0BAA0B,EAC1BC,uBAAuB,QAClB,iCAA8B;AAKrC,SACEC,kBAAkB,EAClBC,sBAAsB,EACtBC,gBAAgB,EAChBC,kBAAkB,EAClBC,0BAA0B,EAC1BC,iBAAiB,QACZ,uBAAoB;AAC3B,SAASC,WAAW,QAAQ,eAAe;AAC3C,SACEC,wBAAwB,EACxBC,qBAAqB,QAChB,0BAAuB;AAO9B,SACEC,oBAAoB,EACpBC,qBAAqB,EACrBC,mBAAmB,QACd,uBAAoB;AAE3B,SAASC,eAAe,QAAQ,mBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
|