@onekeyfe/react-native-native-overlay 6.7.0-alpha.424 → 6.7.0-alpha.428
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/docs/SPEC.md
CHANGED
|
@@ -472,25 +472,6 @@ Known divergences:
|
|
|
472
472
|
|
|
473
473
|
## 5.7 Failure, fallback, and safety
|
|
474
474
|
|
|
475
|
-
### iOS global sheet diagnostics
|
|
476
|
-
|
|
477
|
-
Implemented in source; physical-device verification pending. Native global
|
|
478
|
-
sheets record present/completion, host dismiss/completion/teardown,
|
|
479
|
-
interactive dismiss, appearance/disappearance and unexpected disappearance
|
|
480
|
-
through dynamically resolved OneKeyLog. Missing logger class/selector is a
|
|
481
|
-
no-op and adds no package dependency. These diagnostics do not change the
|
|
482
|
-
presentation, retry, callback, cleanup, or timing contracts.
|
|
483
|
-
|
|
484
|
-
Only process-local temporary controller/presenter counters, wall time,
|
|
485
|
-
fixed stage/reason enums, and lifecycle booleans are logged. Controller addresses,
|
|
486
|
-
descriptions, entry/business identifiers, content, and arbitrary errors are
|
|
487
|
-
excluded. Weak controller keys must not extend controller lifetime. No layout
|
|
488
|
-
or per-frame events are logged. JS and native IDs are independent; timeline
|
|
489
|
-
correlation by time is approximate during concurrent operations. This host
|
|
490
|
-
belongs to main on iOS; background JS has a separate heap and is not an owner
|
|
491
|
-
of these UIKit resources. Native logger persistence is owned by the logger.
|
|
492
|
-
|
|
493
|
-
|
|
494
475
|
- A page request without host or owner keys throws `OverlayRequestError`. This
|
|
495
476
|
is a programming error; there is no silent global fallback, unlike today's
|
|
496
477
|
`Portal.Render` retry.
|
|
@@ -574,11 +574,9 @@ final class NativeOverlayEntryView: UIView {
|
|
|
574
574
|
}
|
|
575
575
|
let controller = NativeOverlaySheetController(host: self, style: sheetStyle())
|
|
576
576
|
sheetController = controller
|
|
577
|
-
NativeOverlayDiagnostic.log("stage=present_begin controllerID=\(NativeOverlayDiagnostic.id(controller)) presenterID=\(NativeOverlayDiagnostic.id(presenter))")
|
|
578
577
|
phase = .entering
|
|
579
578
|
presenter.present(controller, animated: true) { [weak self, weak controller] in
|
|
580
579
|
guard let self, let controller, self.sheetController === controller else { return }
|
|
581
|
-
NativeOverlayDiagnostic.log("stage=present_complete controllerID=\(NativeOverlayDiagnostic.id(controller)) visible=\(self.visible) entering=\(self.phase == .entering)")
|
|
582
580
|
if self.phase == .entering {
|
|
583
581
|
self.phase = .shown
|
|
584
582
|
self.didPresent()
|
|
@@ -594,7 +592,6 @@ final class NativeOverlayEntryView: UIView {
|
|
|
594
592
|
finishDismiss(reason: "programmatic")
|
|
595
593
|
return
|
|
596
594
|
}
|
|
597
|
-
NativeOverlayDiagnostic.log("stage=dismiss_request controllerID=\(NativeOverlayDiagnostic.id(controller)) reason=programmatic presenting=\(controller.isBeingPresented) exiting=\(phase == .exiting)")
|
|
598
595
|
if controller.resumeHostDismissal() {
|
|
599
596
|
phase = .exiting
|
|
600
597
|
return
|
|
@@ -605,7 +602,6 @@ final class NativeOverlayEntryView: UIView {
|
|
|
605
602
|
controller.dismissRequestedByHost = true
|
|
606
603
|
controller.dismiss(animated: true) { [weak self, weak controller] in
|
|
607
604
|
guard let self, self.sheetController === controller, self.phase == .exiting else { return }
|
|
608
|
-
NativeOverlayDiagnostic.log("stage=dismiss_complete controllerID=\(NativeOverlayDiagnostic.id(controller)) reason=programmatic")
|
|
609
605
|
self.finishDismiss(reason: "programmatic")
|
|
610
606
|
}
|
|
611
607
|
}
|
|
@@ -616,7 +612,6 @@ final class NativeOverlayEntryView: UIView {
|
|
|
616
612
|
touchHandler.perform(NSSelectorFromString("detachFromView:"), with: controller.view)
|
|
617
613
|
}
|
|
618
614
|
stageContent()
|
|
619
|
-
NativeOverlayDiagnostic.log("stage=teardown controllerID=\(NativeOverlayDiagnostic.id(controller)) presented=\(controller.presentingViewController != nil) dismissing=\(controller.isBeingDismissed)")
|
|
620
615
|
if controller.presentingViewController != nil, !controller.isBeingDismissed {
|
|
621
616
|
controller.dismissRequestedByHost = true
|
|
622
617
|
controller.dismiss(animated: false)
|
|
@@ -710,7 +705,6 @@ extension NativeOverlayContainerView: NativeOverlaySheetHost {
|
|
|
710
705
|
|
|
711
706
|
func sheetDidDisappearUnexpectedly(_ controller: NativeOverlaySheetController) {
|
|
712
707
|
guard sheetController === controller else { return }
|
|
713
|
-
NativeOverlayDiagnostic.log("stage=unexpected_disappear controllerID=\(NativeOverlayDiagnostic.id(controller)) visible=\(visible) reason=system")
|
|
714
708
|
finishDismiss(reason: "system")
|
|
715
709
|
}
|
|
716
710
|
|
|
@@ -277,7 +277,6 @@ final class NativeOverlaySheetController: UIViewController,
|
|
|
277
277
|
|
|
278
278
|
override func viewDidAppear(_ animated: Bool) {
|
|
279
279
|
super.viewDidAppear(animated)
|
|
280
|
-
NativeOverlayDiagnostic.log("stage=did_appear controllerID=\(NativeOverlayDiagnostic.id(self)) presenterID=\(NativeOverlayDiagnostic.id(presentingViewController))")
|
|
281
280
|
stopSuppressingPresentationShadow()
|
|
282
281
|
}
|
|
283
282
|
|
|
@@ -288,7 +287,6 @@ final class NativeOverlaySheetController: UIViewController,
|
|
|
288
287
|
|
|
289
288
|
override func viewDidDisappear(_ animated: Bool) {
|
|
290
289
|
super.viewDidDisappear(animated)
|
|
291
|
-
NativeOverlayDiagnostic.log("stage=did_disappear controllerID=\(NativeOverlayDiagnostic.id(self)) presenterID=\(NativeOverlayDiagnostic.id(presentingViewController)) hostRequested=\(dismissRequestedByHost)")
|
|
292
290
|
if let backdropTap {
|
|
293
291
|
dimmingView?.removeGestureRecognizer(backdropTap)
|
|
294
292
|
}
|
|
@@ -321,7 +319,6 @@ final class NativeOverlaySheetController: UIViewController,
|
|
|
321
319
|
}
|
|
322
320
|
|
|
323
321
|
func presentationControllerDidDismiss(_ presentationController: UIPresentationController) {
|
|
324
|
-
NativeOverlayDiagnostic.log("stage=interactive_dismiss controllerID=\(NativeOverlayDiagnostic.id(self)) reason=pan")
|
|
325
322
|
dismissRequestedByHost = true
|
|
326
323
|
host?.sheetDidDismissInteractively(self)
|
|
327
324
|
}
|
|
@@ -1,29 +1,4 @@
|
|
|
1
1
|
import UIKit
|
|
2
|
-
import ObjectiveC
|
|
3
|
-
|
|
4
|
-
/// IDs are process-local and weakly keyed; never log controller descriptions or addresses.
|
|
5
|
-
enum NativeOverlayDiagnostic {
|
|
6
|
-
private static var nextID = 0
|
|
7
|
-
private static let controllerIDs = NSMapTable<UIViewController, NSNumber>.weakToStrongObjects()
|
|
8
|
-
|
|
9
|
-
static func id(_ controller: UIViewController?) -> Int {
|
|
10
|
-
guard let controller else { return 0 }
|
|
11
|
-
if let existing = controllerIDs.object(forKey: controller) { return existing.intValue }
|
|
12
|
-
nextID += 1
|
|
13
|
-
controllerIDs.setObject(NSNumber(value: nextID), forKey: controller)
|
|
14
|
-
return nextID
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
static func log(_ details: String) {
|
|
18
|
-
guard let logClass = NSClassFromString("ReactNativeNativeLogger.OneKeyLog")
|
|
19
|
-
?? NSClassFromString("OneKeyLog"),
|
|
20
|
-
let method = class_getClassMethod(logClass, NSSelectorFromString("info::")) else { return }
|
|
21
|
-
typealias LogFunction = @convention(c) (AnyClass, Selector, NSString, NSString) -> Void
|
|
22
|
-
let log = unsafeBitCast(method_getImplementation(method), to: LogFunction.self)
|
|
23
|
-
log(logClass, NSSelectorFromString("info::"), "NativeOverlay",
|
|
24
|
-
"wallTimeMs=\(Int64(Date().timeIntervalSince1970 * 1000)) \(details)" as NSString)
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
2
|
|
|
28
3
|
/// Levels mirror `OVERLAY_LEVEL_ORDER`. Each active level gets its own
|
|
29
4
|
/// window so that order between levels never depends on show order.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-native-overlay",
|
|
3
|
-
"version": "6.7.0-alpha.
|
|
3
|
+
"version": "6.7.0-alpha.428",
|
|
4
4
|
"description": "Native and Web overlay hosts with ordered levels, page scope and Fabric measurement",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|