@onekeyfe/react-native-native-overlay 6.8.0-14 → 6.8.0-15
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 +4 -0
- package/ios/NativeOverlayContainerView.swift +20 -4
- package/package.json +1 -1
package/docs/SPEC.md
CHANGED
|
@@ -947,6 +947,10 @@ P2 sheet notes:
|
|
|
947
947
|
- `keepContentMounted` renders content while closed so callers can measure it
|
|
948
948
|
before opening (Popover waits for header / scroll measurements).
|
|
949
949
|
- `pan` dismissals cannot be vetoed; `onRequestDismiss('pan')` is informative.
|
|
950
|
+
- An active iOS NativeList reorder temporarily suppresses the enclosing page
|
|
951
|
+
sheet's dismiss pan. The sheet owns the latest `dismissOnPanDown` setting
|
|
952
|
+
throughout the suppression. Releasing the reorder restores eligibility
|
|
953
|
+
only when the current setting allows it.
|
|
950
954
|
|
|
951
955
|
P4a toast notes:
|
|
952
956
|
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import React
|
|
2
2
|
import UIKit
|
|
3
3
|
|
|
4
|
+
final class NativeOverlayPageSheetPan: UIPanGestureRecognizer {
|
|
5
|
+
var dismissalAllowed = false {
|
|
6
|
+
didSet { updateAvailability() }
|
|
7
|
+
}
|
|
8
|
+
private var reorderSuppressions = 0
|
|
9
|
+
|
|
10
|
+
@objc func setOneKeyNativeListReorderSuppressed(_ suppressed: NSNumber) {
|
|
11
|
+
reorderSuppressions = max(0, reorderSuppressions + (suppressed.boolValue ? 1 : -1))
|
|
12
|
+
updateAvailability()
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
private func updateAvailability() {
|
|
16
|
+
isEnabled = dismissalAllowed && reorderSuppressions == 0
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
4
20
|
/// One overlay inside a level window: backdrop plus the reparented content.
|
|
5
21
|
final class NativeOverlayEntryView: UIView {
|
|
6
22
|
let backdropView = UIView()
|
|
@@ -22,7 +38,7 @@ final class NativeOverlayEntryView: UIView {
|
|
|
22
38
|
/// Page scope cannot use UIKit sheets (they always cover the window), so a
|
|
23
39
|
/// page sheet is this entry's content view pinned to the bottom.
|
|
24
40
|
private(set) var pageSheetHeight: CGFloat?
|
|
25
|
-
private var pageSheetPan:
|
|
41
|
+
private var pageSheetPan: NativeOverlayPageSheetPan?
|
|
26
42
|
|
|
27
43
|
override init(frame: CGRect) {
|
|
28
44
|
super.init(frame: frame)
|
|
@@ -93,12 +109,12 @@ final class NativeOverlayEntryView: UIView {
|
|
|
93
109
|
contentView.clipsToBounds = true
|
|
94
110
|
contentView.autoresizingMask = [.flexibleWidth, .flexibleTopMargin]
|
|
95
111
|
layoutPageSheet()
|
|
96
|
-
if
|
|
97
|
-
let pan =
|
|
112
|
+
if pageSheetPan == nil {
|
|
113
|
+
let pan = NativeOverlayPageSheetPan(target: self, action: #selector(handlePageSheetPan(_:)))
|
|
98
114
|
contentView.addGestureRecognizer(pan)
|
|
99
115
|
pageSheetPan = pan
|
|
100
116
|
}
|
|
101
|
-
pageSheetPan?.
|
|
117
|
+
pageSheetPan?.dismissalAllowed = draggable
|
|
102
118
|
}
|
|
103
119
|
|
|
104
120
|
/// Layout changed (rotation, page sheet height); the owner re-reports
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-native-overlay",
|
|
3
|
-
"version": "6.8.0-
|
|
3
|
+
"version": "6.8.0-15",
|
|
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",
|