@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.
Files changed (163) hide show
  1. package/LICENSE +21 -0
  2. package/NativeOverlay.podspec +30 -0
  3. package/README.md +35 -0
  4. package/android/build.gradle +82 -0
  5. package/android/src/main/AndroidManifest.xml +2 -0
  6. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayAnimation.kt +176 -0
  7. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayEntryRootView.kt +415 -0
  8. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayEvents.kt +38 -0
  9. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayHost.kt +174 -0
  10. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayPackage.kt +16 -0
  11. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayPageHostView.kt +122 -0
  12. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayPageHostViewManager.kt +40 -0
  13. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayView.kt +465 -0
  14. package/android/src/main/java/com/onekey/nativeoverlay/NativeOverlayViewManager.kt +156 -0
  15. package/android/src/main/jni/CMakeLists.txt +44 -0
  16. package/android/src/main/jni/RNCNativeOverlay.h +19 -0
  17. package/common/cpp/react/renderer/components/RNCNativeOverlay/NativeOverlayComponentDescriptor.h +12 -0
  18. package/common/cpp/react/renderer/components/RNCNativeOverlay/NativeOverlayShadowNode.cpp +12 -0
  19. package/common/cpp/react/renderer/components/RNCNativeOverlay/NativeOverlayShadowNode.h +41 -0
  20. package/common/cpp/react/renderer/components/RNCNativeOverlay/NativeOverlayState.h +40 -0
  21. package/docs/SPEC.md +693 -0
  22. package/ios/NativeOverlayAnimation.swift +160 -0
  23. package/ios/NativeOverlayContainerView.swift +688 -0
  24. package/ios/NativeOverlayKeyboard.swift +88 -0
  25. package/ios/NativeOverlayPageHostView.swift +98 -0
  26. package/ios/NativeOverlaySheetController.swift +391 -0
  27. package/ios/NativeOverlayWindowManager.swift +194 -0
  28. package/ios/RCTNativeOverlayComponentView.h +11 -0
  29. package/ios/RCTNativeOverlayComponentView.mm +193 -0
  30. package/ios/RCTNativeOverlayPageHostComponentView.h +11 -0
  31. package/ios/RCTNativeOverlayPageHostComponentView.mm +64 -0
  32. package/lib/module/NativeOverlayNativeComponent.ts +61 -0
  33. package/lib/module/NativeOverlayPageHostNativeComponent.ts +13 -0
  34. package/lib/module/OverlayErrors.js +6 -0
  35. package/lib/module/OverlayErrors.js.map +1 -0
  36. package/lib/module/OverlayLevelContext.js +27 -0
  37. package/lib/module/OverlayLevelContext.js.map +1 -0
  38. package/lib/module/OverlayLevels.js +33 -0
  39. package/lib/module/OverlayLevels.js.map +1 -0
  40. package/lib/module/OverlayPageHost.js +24 -0
  41. package/lib/module/OverlayPageHost.js.map +1 -0
  42. package/lib/module/OverlayPageHost.web.js +49 -0
  43. package/lib/module/OverlayPageHost.web.js.map +1 -0
  44. package/lib/module/OverlayPageScope.js +41 -0
  45. package/lib/module/OverlayPageScope.js.map +1 -0
  46. package/lib/module/OverlayStore.js +305 -0
  47. package/lib/module/OverlayStore.js.map +1 -0
  48. package/lib/module/OverlayView.js +141 -0
  49. package/lib/module/OverlayView.js.map +1 -0
  50. package/lib/module/OverlayView.web.js +290 -0
  51. package/lib/module/OverlayView.web.js.map +1 -0
  52. package/lib/module/OverlayViewTypes.js +4 -0
  53. package/lib/module/OverlayViewTypes.js.map +1 -0
  54. package/lib/module/animation/motionPresets.js +57 -0
  55. package/lib/module/animation/motionPresets.js.map +1 -0
  56. package/lib/module/animation/platformMotionPresets.js +4 -0
  57. package/lib/module/animation/platformMotionPresets.js.map +1 -0
  58. package/lib/module/animation/platformMotionPresets.web.js +4 -0
  59. package/lib/module/animation/platformMotionPresets.web.js.map +1 -0
  60. package/lib/module/animation/resolveAnimation.js +80 -0
  61. package/lib/module/animation/resolveAnimation.js.map +1 -0
  62. package/lib/module/animation/spring.js +69 -0
  63. package/lib/module/animation/spring.js.map +1 -0
  64. package/lib/module/animation/types.js +2 -0
  65. package/lib/module/animation/types.js.map +1 -0
  66. package/lib/module/index.js +16 -0
  67. package/lib/module/index.js.map +1 -0
  68. package/lib/module/package.json +1 -0
  69. package/lib/module/types.js +2 -0
  70. package/lib/module/types.js.map +1 -0
  71. package/lib/module/useOverlayController.js +127 -0
  72. package/lib/module/useOverlayController.js.map +1 -0
  73. package/lib/module/useSuspendedPageOwners.js +16 -0
  74. package/lib/module/useSuspendedPageOwners.js.map +1 -0
  75. package/lib/module/web/animateTransition.js +115 -0
  76. package/lib/module/web/animateTransition.js.map +1 -0
  77. package/lib/module/web/overlayLayers.js +147 -0
  78. package/lib/module/web/overlayLayers.js.map +1 -0
  79. package/lib/module/web/useKeyboardShift.js +110 -0
  80. package/lib/module/web/useKeyboardShift.js.map +1 -0
  81. package/lib/module/web/useSheetDrag.js +126 -0
  82. package/lib/module/web/useSheetDrag.js.map +1 -0
  83. package/lib/typescript/package.json +1 -0
  84. package/lib/typescript/src/NativeOverlayNativeComponent.d.ts +41 -0
  85. package/lib/typescript/src/NativeOverlayNativeComponent.d.ts.map +1 -0
  86. package/lib/typescript/src/NativeOverlayPageHostNativeComponent.d.ts +9 -0
  87. package/lib/typescript/src/NativeOverlayPageHostNativeComponent.d.ts.map +1 -0
  88. package/lib/typescript/src/OverlayErrors.d.ts +4 -0
  89. package/lib/typescript/src/OverlayErrors.d.ts.map +1 -0
  90. package/lib/typescript/src/OverlayLevelContext.d.ts +12 -0
  91. package/lib/typescript/src/OverlayLevelContext.d.ts.map +1 -0
  92. package/lib/typescript/src/OverlayLevels.d.ts +13 -0
  93. package/lib/typescript/src/OverlayLevels.d.ts.map +1 -0
  94. package/lib/typescript/src/OverlayPageHost.d.ts +9 -0
  95. package/lib/typescript/src/OverlayPageHost.d.ts.map +1 -0
  96. package/lib/typescript/src/OverlayPageHost.web.d.ts +11 -0
  97. package/lib/typescript/src/OverlayPageHost.web.d.ts.map +1 -0
  98. package/lib/typescript/src/OverlayPageScope.d.ts +17 -0
  99. package/lib/typescript/src/OverlayPageScope.d.ts.map +1 -0
  100. package/lib/typescript/src/OverlayStore.d.ts +72 -0
  101. package/lib/typescript/src/OverlayStore.d.ts.map +1 -0
  102. package/lib/typescript/src/OverlayView.d.ts +3 -0
  103. package/lib/typescript/src/OverlayView.d.ts.map +1 -0
  104. package/lib/typescript/src/OverlayView.web.d.ts +3 -0
  105. package/lib/typescript/src/OverlayView.web.d.ts.map +1 -0
  106. package/lib/typescript/src/OverlayViewTypes.d.ts +68 -0
  107. package/lib/typescript/src/OverlayViewTypes.d.ts.map +1 -0
  108. package/lib/typescript/src/animation/motionPresets.d.ts +13 -0
  109. package/lib/typescript/src/animation/motionPresets.d.ts.map +1 -0
  110. package/lib/typescript/src/animation/platformMotionPresets.d.ts +2 -0
  111. package/lib/typescript/src/animation/platformMotionPresets.d.ts.map +1 -0
  112. package/lib/typescript/src/animation/platformMotionPresets.web.d.ts +2 -0
  113. package/lib/typescript/src/animation/platformMotionPresets.web.d.ts.map +1 -0
  114. package/lib/typescript/src/animation/resolveAnimation.d.ts +23 -0
  115. package/lib/typescript/src/animation/resolveAnimation.d.ts.map +1 -0
  116. package/lib/typescript/src/animation/spring.d.ts +24 -0
  117. package/lib/typescript/src/animation/spring.d.ts.map +1 -0
  118. package/lib/typescript/src/animation/types.d.ts +56 -0
  119. package/lib/typescript/src/animation/types.d.ts.map +1 -0
  120. package/lib/typescript/src/index.d.ts +18 -0
  121. package/lib/typescript/src/index.d.ts.map +1 -0
  122. package/lib/typescript/src/types.d.ts +59 -0
  123. package/lib/typescript/src/types.d.ts.map +1 -0
  124. package/lib/typescript/src/useOverlayController.d.ts +29 -0
  125. package/lib/typescript/src/useOverlayController.d.ts.map +1 -0
  126. package/lib/typescript/src/useSuspendedPageOwners.d.ts +7 -0
  127. package/lib/typescript/src/useSuspendedPageOwners.d.ts.map +1 -0
  128. package/lib/typescript/src/web/animateTransition.d.ts +18 -0
  129. package/lib/typescript/src/web/animateTransition.d.ts.map +1 -0
  130. package/lib/typescript/src/web/overlayLayers.d.ts +10 -0
  131. package/lib/typescript/src/web/overlayLayers.d.ts.map +1 -0
  132. package/lib/typescript/src/web/useKeyboardShift.d.ts +29 -0
  133. package/lib/typescript/src/web/useKeyboardShift.d.ts.map +1 -0
  134. package/lib/typescript/src/web/useSheetDrag.d.ts +13 -0
  135. package/lib/typescript/src/web/useSheetDrag.d.ts.map +1 -0
  136. package/package.json +188 -0
  137. package/react-native.config.js +16 -0
  138. package/src/NativeOverlayNativeComponent.ts +61 -0
  139. package/src/NativeOverlayPageHostNativeComponent.ts +13 -0
  140. package/src/OverlayErrors.ts +3 -0
  141. package/src/OverlayLevelContext.tsx +32 -0
  142. package/src/OverlayLevels.ts +40 -0
  143. package/src/OverlayPageHost.tsx +21 -0
  144. package/src/OverlayPageHost.web.tsx +53 -0
  145. package/src/OverlayPageScope.tsx +42 -0
  146. package/src/OverlayStore.ts +401 -0
  147. package/src/OverlayView.tsx +165 -0
  148. package/src/OverlayView.web.tsx +356 -0
  149. package/src/OverlayViewTypes.ts +81 -0
  150. package/src/animation/motionPresets.ts +52 -0
  151. package/src/animation/platformMotionPresets.ts +1 -0
  152. package/src/animation/platformMotionPresets.web.ts +1 -0
  153. package/src/animation/resolveAnimation.ts +103 -0
  154. package/src/animation/spring.ts +80 -0
  155. package/src/animation/types.ts +71 -0
  156. package/src/index.ts +55 -0
  157. package/src/types.ts +79 -0
  158. package/src/useOverlayController.ts +199 -0
  159. package/src/useSuspendedPageOwners.ts +26 -0
  160. package/src/web/animateTransition.ts +137 -0
  161. package/src/web/overlayLayers.ts +182 -0
  162. package/src/web/useKeyboardShift.ts +130 -0
  163. package/src/web/useSheetDrag.ts +143 -0
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ import { useEffect, useRef } from 'react';
4
+ import { useSuspendedPageOwners } from "./useSuspendedPageOwners.js";
5
+ import { registerOverlayPageHost } from "./web/overlayLayers.js";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ const OWNER_ATTRIBUTE = 'data-overlay-owner';
8
+
9
+ /**
10
+ * Web page host: an absolutely positioned layer inside the root-route card.
11
+ * Page overlays portal into it; entries of covered owners are hidden here
12
+ * because their own (possibly inactive) page does not re-render.
13
+ */
14
+ export function OverlayPageHost({
15
+ hostKey
16
+ }) {
17
+ const ref = useRef(null);
18
+ const suspendedOwners = useSuspendedPageOwners(hostKey);
19
+ useEffect(() => {
20
+ const element = ref.current;
21
+ if (!element) {
22
+ return;
23
+ }
24
+ return registerOverlayPageHost(hostKey, element);
25
+ }, [hostKey]);
26
+ useEffect(() => {
27
+ const element = ref.current;
28
+ if (!element) {
29
+ return;
30
+ }
31
+ const suspended = new Set(suspendedOwners);
32
+ element.querySelectorAll(`[${OWNER_ATTRIBUTE}]`).forEach(node => {
33
+ const hidden = suspended.has(node.getAttribute(OWNER_ATTRIBUTE) ?? '');
34
+ node.style.visibility = hidden ? 'hidden' : '';
35
+ node.inert = hidden;
36
+ });
37
+ }, [suspendedOwners]);
38
+ return /*#__PURE__*/_jsx("div", {
39
+ ref: ref,
40
+ style: {
41
+ position: 'absolute',
42
+ inset: 0,
43
+ pointerEvents: 'none',
44
+ zIndex: 1
45
+ }
46
+ });
47
+ }
48
+ export { OWNER_ATTRIBUTE as OVERLAY_OWNER_ATTRIBUTE };
49
+ //# sourceMappingURL=OverlayPageHost.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useRef","useSuspendedPageOwners","registerOverlayPageHost","jsx","_jsx","OWNER_ATTRIBUTE","OverlayPageHost","hostKey","ref","suspendedOwners","element","current","suspended","Set","querySelectorAll","forEach","node","hidden","has","getAttribute","style","visibility","inert","position","inset","pointerEvents","zIndex","OVERLAY_OWNER_ATTRIBUTE"],"sourceRoot":"../../src","sources":["OverlayPageHost.web.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,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MAAM,EAAE;IACV;EAAE,CACH,CAAC;AAEN;AAEA,SAASrB,eAAe,IAAIsB,uBAAuB","ignoreList":[]}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ import { createContext, useContext, useMemo } from 'react';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ const OverlayPageScopeContext = /*#__PURE__*/createContext({});
6
+ export function useOverlayPageScope() {
7
+ return useContext(OverlayPageScopeContext);
8
+ }
9
+
10
+ /** Provided once per root route, around its navigator and `OverlayPageHost`. */
11
+ export function OverlayPageHostScope({
12
+ hostKey,
13
+ children
14
+ }) {
15
+ const value = useMemo(() => ({
16
+ hostKey
17
+ }), [hostKey]);
18
+ return /*#__PURE__*/_jsx(OverlayPageScopeContext.Provider, {
19
+ value: value,
20
+ children: children
21
+ });
22
+ }
23
+
24
+ /** Provided by each page; page overlays below it belong to `ownerKey`. */
25
+ export function OverlayPageOwnerScope({
26
+ ownerKey,
27
+ children
28
+ }) {
29
+ const {
30
+ hostKey
31
+ } = useOverlayPageScope();
32
+ const value = useMemo(() => ({
33
+ hostKey,
34
+ ownerKey
35
+ }), [hostKey, ownerKey]);
36
+ return /*#__PURE__*/_jsx(OverlayPageScopeContext.Provider, {
37
+ value: value,
38
+ children: children
39
+ });
40
+ }
41
+ //# sourceMappingURL=OverlayPageScope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createContext","useContext","useMemo","jsx","_jsx","OverlayPageScopeContext","useOverlayPageScope","OverlayPageHostScope","hostKey","children","value","Provider","OverlayPageOwnerScope","ownerKey"],"sourceRoot":"../../src","sources":["OverlayPageScope.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAU3D,MAAMC,uBAAuB,gBAAGL,aAAa,CAAoB,CAAC,CAAC,CAAC;AAEpE,OAAO,SAASM,mBAAmBA,CAAA,EAAsB;EACvD,OAAOL,UAAU,CAACI,uBAAuB,CAAC;AAC5C;;AAEA;AACA,OAAO,SAASE,oBAAoBA,CAAC;EACnCC,OAAO;EACPC;AACsC,CAAC,EAAE;EACzC,MAAMC,KAAK,GAAGR,OAAO,CAAC,OAAO;IAAEM;EAAQ,CAAC,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;EACrD,oBACEJ,IAAA,CAACC,uBAAuB,CAACM,QAAQ;IAACD,KAAK,EAAEA,KAAM;IAAAD,QAAA,EAC5CA;EAAQ,CACuB,CAAC;AAEvC;;AAEA;AACA,OAAO,SAASG,qBAAqBA,CAAC;EACpCC,QAAQ;EACRJ;AACuC,CAAC,EAAE;EAC1C,MAAM;IAAED;EAAQ,CAAC,GAAGF,mBAAmB,CAAC,CAAC;EACzC,MAAMI,KAAK,GAAGR,OAAO,CAAC,OAAO;IAAEM,OAAO;IAAEK;EAAS,CAAC,CAAC,EAAE,CAACL,OAAO,EAAEK,QAAQ,CAAC,CAAC;EACzE,oBACET,IAAA,CAACC,uBAAuB,CAACM,QAAQ;IAACD,KAAK,EAAEA,KAAM;IAAAD,QAAA,EAC5CA;EAAQ,CACuB,CAAC;AAEvC","ignoreList":[]}
@@ -0,0 +1,305 @@
1
+ "use strict";
2
+
3
+ import { OverlayRequestError } from "./OverlayErrors.js";
4
+ import { OVERLAY_LEVEL_ORDER, isBlockingLevel } from "./OverlayLevels.js";
5
+ const DEFAULT_CLOSING_TIMEOUT_MS = 5000;
6
+ function laneKeyOf(entry) {
7
+ return entry.scope === 'global' ? `global|${entry.level}` : `page|${entry.hostKey ?? ''}|${entry.level}`;
8
+ }
9
+ function compareRenderOrder(a, b) {
10
+ if (a.scope !== b.scope) {
11
+ return a.scope === 'page' ? -1 : 1;
12
+ }
13
+ if (a.scope === 'page' && a.hostKey !== b.hostKey) {
14
+ return (a.hostKey ?? '') < (b.hostKey ?? '') ? -1 : 1;
15
+ }
16
+ const levelDiff = OVERLAY_LEVEL_ORDER[a.level] - OVERLAY_LEVEL_ORDER[b.level];
17
+ return levelDiff !== 0 ? levelDiff : a.seq - b.seq;
18
+ }
19
+ function compareQueueOrder(a, b) {
20
+ return b.priority !== a.priority ? b.priority - a.priority : a.seq - b.seq;
21
+ }
22
+ export class OverlayStore {
23
+ seq = 0;
24
+ shown = new Map();
25
+ queued = [];
26
+ handlers = new Map();
27
+ closingTimers = new Map();
28
+ pageVisibility = new Map();
29
+ listeners = new Set();
30
+ snapshot = {
31
+ entries: [],
32
+ queued: []
33
+ };
34
+ constructor(options = {}) {
35
+ this.closingTimeoutMs = options.closingTimeoutMs ?? DEFAULT_CLOSING_TIMEOUT_MS;
36
+ }
37
+ subscribe = listener => {
38
+ this.listeners.add(listener);
39
+ return () => {
40
+ this.listeners.delete(listener);
41
+ };
42
+ };
43
+ getSnapshot = () => this.snapshot;
44
+ getEntry(id) {
45
+ return this.shown.get(id) ?? this.queued.find(e => e.id === id);
46
+ }
47
+ request(request, handlers = {}) {
48
+ if (request.id) {
49
+ const existing = this.getEntry(request.id);
50
+ if (existing) {
51
+ return existing;
52
+ }
53
+ }
54
+ const scope = request.scope ?? 'global';
55
+ if (scope === 'page' && (!request.hostKey || !request.ownerKey)) {
56
+ throw new OverlayRequestError('OverlayStore: page scope requires hostKey and ownerKey');
57
+ }
58
+ const level = request.level ?? 'modal';
59
+ const blocking = request.blocking ?? isBlockingLevel(level);
60
+ this.seq += 1;
61
+ const entry = {
62
+ id: request.id ?? `overlay-${this.seq}`,
63
+ scope,
64
+ level,
65
+ strategy: request.strategy ?? 'stack',
66
+ priority: request.priority ?? 0,
67
+ replaceKey: request.replaceKey,
68
+ hostKey: scope === 'page' ? request.hostKey : undefined,
69
+ ownerKey: scope === 'page' ? request.ownerKey : undefined,
70
+ dismissible: request.dismissible ?? blocking,
71
+ statusBarStyle: request.statusBarStyle,
72
+ blocking,
73
+ phase: 'active',
74
+ suspended: false,
75
+ dismissReason: undefined,
76
+ seq: this.seq
77
+ };
78
+ entry.suspended = this.isOwnerHidden(entry);
79
+ this.handlers.set(entry.id, handlers);
80
+ if (entry.strategy === 'replace') {
81
+ this.replaceIn(entry);
82
+ this.shown.set(entry.id, entry);
83
+ } else if (entry.strategy === 'queue' && !this.canPromote(entry)) {
84
+ entry.phase = 'queued';
85
+ this.queued = [...this.queued, entry].toSorted(compareQueueOrder);
86
+ } else {
87
+ this.shown.set(entry.id, entry);
88
+ }
89
+ this.emit();
90
+ return this.getEntry(entry.id) ?? entry;
91
+ }
92
+
93
+ /** Starts closing an entry; the native side calls `finalize` after its exit animation. */
94
+ dismiss(id, reason = 'programmatic') {
95
+ if (this.dismissWithoutEmit(id, reason)) {
96
+ this.emit();
97
+ }
98
+ }
99
+
100
+ /** Removes a closing (or active) entry once its exit animation finished. */
101
+ finalize(id) {
102
+ const entry = this.shown.get(id);
103
+ if (!entry) {
104
+ return;
105
+ }
106
+ this.clearClosingTimer(id);
107
+ this.shown.delete(id);
108
+ this.promoteQueued();
109
+ this.emit();
110
+ this.notifyRemoved(id, entry.dismissReason ?? 'programmatic');
111
+ }
112
+ dismissAll(filter = {}) {
113
+ const reason = filter.reason ?? 'programmatic';
114
+ const matches = entry => (!filter.scope || entry.scope === filter.scope) && (!filter.belowLevel || OVERLAY_LEVEL_ORDER[entry.level] < OVERLAY_LEVEL_ORDER[filter.belowLevel]);
115
+ const dropped = this.queued.filter(matches);
116
+ this.queued = this.queued.filter(e => !matches(e));
117
+ let changed = dropped.length > 0;
118
+ for (const entry of this.shown.values()) {
119
+ if (matches(entry)) {
120
+ changed = this.dismissWithoutEmit(entry.id, reason) || changed;
121
+ }
122
+ }
123
+ if (changed) {
124
+ this.emit();
125
+ }
126
+ dropped.forEach(e => this.notifyRemoved(e.id, reason));
127
+ }
128
+
129
+ /** Native / navigation signal: the owning page was covered, detached or restored. */
130
+ setPageVisible(ownerKey, visible) {
131
+ if ((this.pageVisibility.get(ownerKey) ?? true) === visible) {
132
+ return;
133
+ }
134
+ this.pageVisibility.set(ownerKey, visible);
135
+ for (const entry of this.shown.values()) {
136
+ if (entry.ownerKey === ownerKey) {
137
+ entry.suspended = !visible;
138
+ }
139
+ }
140
+ for (const entry of this.queued) {
141
+ if (entry.ownerKey === ownerKey) {
142
+ entry.suspended = !visible;
143
+ }
144
+ }
145
+ if (visible) {
146
+ this.promoteQueued();
147
+ }
148
+ this.emit();
149
+ }
150
+
151
+ /** The owning page left the navigation state for good. */
152
+ removePage(ownerKey) {
153
+ const dropped = this.queued.filter(e => e.ownerKey === ownerKey);
154
+ this.queued = this.queued.filter(e => e.ownerKey !== ownerKey);
155
+ for (const entry of this.shown.values()) {
156
+ if (entry.ownerKey === ownerKey) {
157
+ this.dismissWithoutEmit(entry.id, 'page-removed');
158
+ }
159
+ }
160
+ this.pageVisibility.delete(ownerKey);
161
+ this.emit();
162
+ dropped.forEach(e => this.notifyRemoved(e.id, 'page-removed'));
163
+ }
164
+
165
+ /**
166
+ * Decides what a back press / Escape does. Global entries win over page
167
+ * entries; `focusedHostKey` limits page entries to the focused root route
168
+ * (split view has one host per pane).
169
+ */
170
+ resolveBack(focusedHostKey) {
171
+ // Non-blocking entries take back / Escape only when they ask to be
172
+ // dismissible (an anchored popover); toasts do not.
173
+ const candidates = this.snapshot.entries.filter(e => e.phase === 'active' && !e.suspended && (e.blocking || e.dismissible) && (e.scope === 'global' || focusedHostKey === undefined || e.hostKey === focusedHostKey));
174
+ const top = candidates[candidates.length - 1];
175
+ if (!top) {
176
+ return {
177
+ kind: 'pass'
178
+ };
179
+ }
180
+ return top.dismissible ? {
181
+ kind: 'dismiss',
182
+ id: top.id
183
+ } : {
184
+ kind: 'block'
185
+ };
186
+ }
187
+
188
+ /** Topmost visible blocking entry; everything rendered below it is inert. */
189
+ /** The entry whose `statusBarStyle` applies (see `findStatusBarOwner`). */
190
+ getStatusBarOwner() {
191
+ return findStatusBarOwner(this.snapshot);
192
+ }
193
+ getBlockingTop() {
194
+ const {
195
+ entries
196
+ } = this.snapshot;
197
+ for (let i = entries.length - 1; i >= 0; i -= 1) {
198
+ const entry = entries[i];
199
+ if (entry && entry.phase !== 'closing' && !entry.suspended && entry.blocking) {
200
+ return entry;
201
+ }
202
+ }
203
+ return undefined;
204
+ }
205
+ dismissWithoutEmit(id, reason) {
206
+ const queuedIndex = this.queued.findIndex(e => e.id === id);
207
+ if (queuedIndex !== -1) {
208
+ this.queued = this.queued.filter(e => e.id !== id);
209
+ // Queued entries never rendered, so they leave without an exit animation.
210
+ queueMicrotask(() => this.notifyRemoved(id, reason));
211
+ return true;
212
+ }
213
+ const entry = this.shown.get(id);
214
+ if (!entry || entry.phase === 'closing') {
215
+ return false;
216
+ }
217
+ entry.phase = 'closing';
218
+ entry.dismissReason = reason;
219
+ this.closingTimers.set(id, setTimeout(() => this.finalize(id), this.closingTimeoutMs));
220
+ return true;
221
+ }
222
+ replaceIn(entry) {
223
+ const laneKey = laneKeyOf(entry);
224
+ const sameLane = [...this.shown.values()].filter(e => e.phase === 'active' && laneKeyOf(e) === laneKey);
225
+ const targets = entry.replaceKey ? sameLane.filter(e => e.replaceKey === entry.replaceKey) : sameLane.slice(-1);
226
+ targets.forEach(e => this.dismissWithoutEmit(e.id, 'replaced'));
227
+ if (entry.replaceKey) {
228
+ const dropped = this.queued.filter(e => laneKeyOf(e) === laneKey && e.replaceKey === entry.replaceKey);
229
+ dropped.forEach(e => this.dismissWithoutEmit(e.id, 'replaced'));
230
+ }
231
+ }
232
+ isOwnerHidden(entry) {
233
+ return entry.scope === 'page' && entry.ownerKey !== undefined && this.pageVisibility.get(entry.ownerKey) === false;
234
+ }
235
+ canPromote(entry) {
236
+ if (this.isOwnerHidden(entry)) {
237
+ return false;
238
+ }
239
+ const laneKey = laneKeyOf(entry);
240
+ for (const shown of this.shown.values()) {
241
+ if (laneKeyOf(shown) === laneKey) {
242
+ return false;
243
+ }
244
+ }
245
+ return true;
246
+ }
247
+ promoteQueued() {
248
+ const promotedLanes = new Set();
249
+ const remaining = [];
250
+ for (const entry of this.queued) {
251
+ const laneKey = laneKeyOf(entry);
252
+ if (!promotedLanes.has(laneKey) && this.canPromote(entry)) {
253
+ entry.phase = 'active';
254
+ this.shown.set(entry.id, entry);
255
+ promotedLanes.add(laneKey);
256
+ } else {
257
+ remaining.push(entry);
258
+ }
259
+ }
260
+ this.queued = remaining;
261
+ }
262
+ clearClosingTimer(id) {
263
+ const timer = this.closingTimers.get(id);
264
+ if (timer) {
265
+ clearTimeout(timer);
266
+ this.closingTimers.delete(id);
267
+ }
268
+ }
269
+ notifyRemoved(id, reason) {
270
+ const handlers = this.handlers.get(id);
271
+ this.handlers.delete(id);
272
+ handlers?.onRemoved?.(reason);
273
+ }
274
+ emit() {
275
+ this.snapshot = {
276
+ entries: [...this.shown.values()].map(e => ({
277
+ ...e
278
+ })).toSorted(compareRenderOrder),
279
+ queued: this.queued.map(e => ({
280
+ ...e
281
+ }))
282
+ };
283
+ this.listeners.forEach(listener => listener());
284
+ }
285
+ }
286
+
287
+ /**
288
+ * The topmost shown, visible entry that styles the status bar. Entries are
289
+ * in render order, so a higher level (or a later request in the same level)
290
+ * wins; page entries render below global ones and suspended ones never own it.
291
+ */
292
+ export function findStatusBarOwner(snapshot) {
293
+ const {
294
+ entries
295
+ } = snapshot;
296
+ for (let i = entries.length - 1; i >= 0; i -= 1) {
297
+ const entry = entries[i];
298
+ if (entry && entry.statusBarStyle && entry.phase === 'active' && !entry.suspended) {
299
+ return entry;
300
+ }
301
+ }
302
+ return undefined;
303
+ }
304
+ export const overlayStore = new OverlayStore();
305
+ //# sourceMappingURL=OverlayStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["OverlayRequestError","OVERLAY_LEVEL_ORDER","isBlockingLevel","DEFAULT_CLOSING_TIMEOUT_MS","laneKeyOf","entry","scope","level","hostKey","compareRenderOrder","a","b","levelDiff","seq","compareQueueOrder","priority","OverlayStore","shown","Map","queued","handlers","closingTimers","pageVisibility","listeners","Set","snapshot","entries","constructor","options","closingTimeoutMs","subscribe","listener","add","delete","getSnapshot","getEntry","id","get","find","e","request","existing","ownerKey","blocking","strategy","replaceKey","undefined","dismissible","statusBarStyle","phase","suspended","dismissReason","isOwnerHidden","set","replaceIn","canPromote","toSorted","emit","dismiss","reason","dismissWithoutEmit","finalize","clearClosingTimer","promoteQueued","notifyRemoved","dismissAll","filter","matches","belowLevel","dropped","changed","length","values","forEach","setPageVisible","visible","removePage","resolveBack","focusedHostKey","candidates","top","kind","getStatusBarOwner","findStatusBarOwner","getBlockingTop","i","queuedIndex","findIndex","queueMicrotask","setTimeout","laneKey","sameLane","targets","slice","promotedLanes","remaining","has","push","timer","clearTimeout","onRemoved","map","overlayStore"],"sourceRoot":"../../src","sources":["OverlayStore.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,oBAAiB;AACrD,SAASC,mBAAmB,EAAEC,eAAe,QAAQ,oBAAiB;AAwBtE,MAAMC,0BAA0B,GAAG,IAAI;AAEvC,SAASC,SAASA,CAACC,KAAoB,EAAU;EAC/C,OAAOA,KAAK,CAACC,KAAK,KAAK,QAAQ,GAC3B,UAAUD,KAAK,CAACE,KAAK,EAAE,GACvB,QAAQF,KAAK,CAACG,OAAO,IAAI,EAAE,IAAIH,KAAK,CAACE,KAAK,EAAE;AAClD;AAEA,SAASE,kBAAkBA,CAACC,CAAgB,EAAEC,CAAgB,EAAU;EACtE,IAAID,CAAC,CAACJ,KAAK,KAAKK,CAAC,CAACL,KAAK,EAAE;IACvB,OAAOI,CAAC,CAACJ,KAAK,KAAK,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC;EACpC;EACA,IAAII,CAAC,CAACJ,KAAK,KAAK,MAAM,IAAII,CAAC,CAACF,OAAO,KAAKG,CAAC,CAACH,OAAO,EAAE;IACjD,OAAO,CAACE,CAAC,CAACF,OAAO,IAAI,EAAE,KAAKG,CAAC,CAACH,OAAO,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;EACvD;EACA,MAAMI,SAAS,GAAGX,mBAAmB,CAACS,CAAC,CAACH,KAAK,CAAC,GAAGN,mBAAmB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MACA,OAAO7C,KAAK;IACd;EACF;EACA,OAAOyC,SAAS;AAClB;AAEA,OAAO,MAAMwD,YAAY,GAAG,IAAItF,YAAY,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+
3
+ import { useCallback, useMemo, useState } from 'react';
4
+ import { StatusBar, StyleSheet, View, useWindowDimensions } from 'react-native';
5
+ import NativeOverlay from './NativeOverlayNativeComponent';
6
+ import { OverlayLevelProvider } from "./OverlayLevelContext.js";
7
+ import { isBlockingLevel } from "./OverlayLevels.js";
8
+ import { useOverlayController } from "./useOverlayController.js";
9
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
10
+ const DEFAULT_BACKDROP_COLOR = 'rgba(0, 0, 0, 0.4)';
11
+ const DEFAULT_SHEET_MAX_RATIO = 0.92;
12
+ const REQUEST_REASONS = {
13
+ back: 'back',
14
+ backdrop: 'backdrop',
15
+ pan: 'pan'
16
+ };
17
+ const styles = StyleSheet.create({
18
+ // The host view never draws: native moves its child into the level host
19
+ // and clips it (zero width) while hidden. The height stays auto on
20
+ // purpose; a fixed 0 makes Yoga measure a fitted sheet's content at most
21
+ // 0 tall, so the sheet would never learn its height.
22
+ host: {
23
+ position: 'absolute',
24
+ top: 0,
25
+ left: 0,
26
+ width: 0
27
+ }
28
+ });
29
+ export function OverlayView(props) {
30
+ const {
31
+ level = 'modal',
32
+ presentation = 'center',
33
+ backdrop,
34
+ blocking,
35
+ dismissOnBackPress,
36
+ sheet,
37
+ keepContentMounted = false,
38
+ statusBarStyle,
39
+ children,
40
+ testID
41
+ } = props;
42
+ const isSheet = presentation === 'sheet';
43
+ const controller = useOverlayController(props);
44
+ const {
45
+ width,
46
+ height
47
+ } = useWindowDimensions();
48
+ const {
49
+ entry,
50
+ mounted,
51
+ presented,
52
+ ownsStatusBar,
53
+ scope,
54
+ hostKey,
55
+ ownerKey,
56
+ animation,
57
+ onHostPresented,
58
+ onHostDismissed,
59
+ onHostRequestDismiss
60
+ } = controller;
61
+ const [measuredSheetHeight, setMeasuredSheetHeight] = useState(0);
62
+ const maxSheetHeight = sheet?.maxHeight ?? height * DEFAULT_SHEET_MAX_RATIO;
63
+ const sheetHeight = Math.min(sheet?.height ?? measuredSheetHeight, maxSheetHeight);
64
+ const onSheetLayout = useCallback(event => {
65
+ setMeasuredSheetHeight(event.nativeEvent.layout.height);
66
+ }, []);
67
+ const animationConfig = useMemo(() => JSON.stringify(animation), [animation]);
68
+ const isBlocking = blocking ?? isBlockingLevel(level);
69
+ const onDismissed = useCallback(() => onHostDismissed(), [onHostDismissed]);
70
+ const onRequestDismiss = useCallback(event => {
71
+ onHostRequestDismiss(REQUEST_REASONS[event.nativeEvent.reason] ?? 'back');
72
+ }, [onHostRequestDismiss]);
73
+ if (!keepContentMounted && (!mounted || !entry)) {
74
+ return null;
75
+ }
76
+
77
+ // The app drives the status bar through React Native's StatusBar stack
78
+ // (iOS runs without view-controller-based appearance), so the owning
79
+ // overlay pushes onto the same stack.
80
+ const statusBar = ownsStatusBar && statusBarStyle ? /*#__PURE__*/_jsx(StatusBar, {
81
+ animated: true,
82
+ barStyle: statusBarStyle === 'light' ? 'light-content' : 'dark-content'
83
+ }) : null;
84
+ return /*#__PURE__*/_jsxs(_Fragment, {
85
+ children: [statusBar, /*#__PURE__*/_jsx(NativeOverlay, {
86
+ style: styles.host
87
+ // A fitted sheet presents once its content height is known.
88
+ ,
89
+ visible: presented && (!isSheet || sheetHeight > 0),
90
+ level: level,
91
+ scope: scope,
92
+ hostKey: hostKey ?? '',
93
+ ownerKey: ownerKey ?? '',
94
+ presentation: presentation,
95
+ stackOrder: entry?.seq ?? 0,
96
+ blocking: isBlocking,
97
+ dismissOnBackPress: dismissOnBackPress ?? isBlocking,
98
+ dismissOnBackdropPress: backdrop ? !!backdrop.dismissOnPress : false,
99
+ backdropColor: backdrop ? backdrop.color ?? DEFAULT_BACKDROP_COLOR : undefined,
100
+ sheetHeight: isSheet ? sheetHeight : 0,
101
+ sheetCornerRadius: sheet?.cornerRadius,
102
+ showHandle: sheet?.showHandle,
103
+ sheetBackgroundColor: sheet?.backgroundColor,
104
+ dismissOnPanDown: sheet?.dismissOnPanDown ?? true,
105
+ animationConfig: animationConfig,
106
+ onPresented: onHostPresented,
107
+ onDismissed: onDismissed,
108
+ onRequestDismiss: onRequestDismiss,
109
+ testID: testID,
110
+ children: isSheet ? /*#__PURE__*/_jsx(View, {
111
+ collapsable: false,
112
+ onLayout: onSheetLayout,
113
+ style: {
114
+ width,
115
+ height: sheet?.height,
116
+ maxHeight: maxSheetHeight,
117
+ // The host is 0x0; without this Yoga shrinks the content to 0 and
118
+ // a fitted sheet never learns its height.
119
+ flexShrink: 0
120
+ },
121
+ children: /*#__PURE__*/_jsx(OverlayLevelProvider, {
122
+ value: level,
123
+ children: children
124
+ })
125
+ }) : /*#__PURE__*/_jsx(View, {
126
+ collapsable: false,
127
+ pointerEvents: "box-none",
128
+ style: {
129
+ width,
130
+ height,
131
+ flexShrink: 0
132
+ },
133
+ children: /*#__PURE__*/_jsx(OverlayLevelProvider, {
134
+ value: level,
135
+ children: children
136
+ })
137
+ })
138
+ })]
139
+ });
140
+ }
141
+ //# sourceMappingURL=OverlayView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useCallback","useMemo","useState","StatusBar","StyleSheet","View","useWindowDimensions","NativeOverlay","OverlayLevelProvider","isBlockingLevel","useOverlayController","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DEFAULT_BACKDROP_COLOR","DEFAULT_SHEET_MAX_RATIO","REQUEST_REASONS","back","backdrop","pan","styles","create","host","position","top","left","width","OverlayView","props","level","presentation","blocking","dismissOnBackPress","sheet","keepContentMounted","statusBarStyle","children","testID","isSheet","controller","height","entry","mounted","presented","ownsStatusBar","scope","hostKey","ownerKey","animation","onHostPresented","onHostDismissed","onHostRequestDismiss","measuredSheetHeight","setMeasuredSheetHeight","maxSheetHeight","maxHeight","sheetHeight","Math","min","onSheetLayout","event","nativeEvent","layout","animationConfig","JSON","stringify","isBlocking","onDismissed","onRequestDismiss","reason","statusBar","animated","barStyle","style","visible","stackOrder","seq","dismissOnBackdropPress","dismissOnPress","backdropColor","color","undefined","sheetCornerRadius","cornerRadius","showHandle","sheetBackgroundColor","backgroundColor","dismissOnPanDown","onPresented","collapsable","onLayout","flexShrink","value","pointerEvents"],"sourceRoot":"../../src","sources":["OverlayView.tsx"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAEtD,SAASC,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,mBAAmB,QAAQ,cAAc;AAE/E,OAAOC,aAAa,MAAM,gCAAgC;AAC1D,SAASC,oBAAoB,QAAQ,0BAAuB;AAC5D,SAASC,eAAe,QAAQ,oBAAiB;AACjD,SAASC,oBAAoB,QAAQ,2BAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAQ9D,MAAMC,sBAAsB,GAAG,oBAAoB;AACnD,MAAMC,uBAAuB,GAAG,IAAI;AAEpC,MAAMC,eAA6D,GAAG;EACpEC,IAAI,EAAE,MAAM;EACZC,QAAQ,EAAE,UAAU;EACpBC,GAAG,EAAE;AACP,CAAC;AAED,MAAMC,MAAM,GAAGnB,UAAU,CAACoB,MAAM,CAAC;EAC/B;EACA;EACA;EACA;EACAC,IAAI,EAAE;IACJC,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,OAAO,SAASC,WAAWA,CAACC,KAAwB,EAAE;EACpD,MAAM;IACJC,KAAK,GAAG,OAAO;IACfC,YAAY,GAAG,QAAQ;IACvBZ,QAAQ;IACRa,QAAQ;IACRC,kBAAkB;IAClBC,KAAK;IACLC,kBAAkB,GAAG,KAAK;IAC1BC,cAAc;IACdC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