@react-navigation/native 8.0.0-alpha.11 → 8.0.0-alpha.12
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/android/src/main/java/org/reactnavigation/ReactNavigationPackage.kt +3 -1
- package/ios/ReactNavigationCornerInsetView.h +14 -0
- package/ios/ReactNavigationCornerInsetView.mm +182 -0
- package/ios/ReactNavigationCornerInsetView.swift +193 -0
- package/ios/ReactNavigationCornerInsetViewComponentDescriptor.h +23 -0
- package/ios/ReactNavigationCornerInsetViewShadowNode.h +27 -0
- package/ios/ReactNavigationCornerInsetViewShadowNode.mm +42 -0
- package/ios/ReactNavigationCornerInsetViewState.h +19 -0
- package/lib/module/ServerContext.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/native/CornerInset.ios.js +61 -0
- package/lib/module/native/CornerInset.ios.js.map +1 -0
- package/lib/module/native/CornerInset.js +15 -0
- package/lib/module/native/CornerInset.js.map +1 -0
- package/lib/module/native/ReactNavigationCornerInsetViewNativeComponent.ts +32 -0
- package/lib/module/useLinkBuilder.js.map +1 -1
- package/lib/module/useLinkProps.js +2 -23
- package/lib/module/useLinkProps.js.map +1 -1
- package/lib/typescript/src/ServerContext.d.ts +1 -1
- package/lib/typescript/src/ServerContext.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/native/CornerInset.d.ts +40 -0
- package/lib/typescript/src/native/CornerInset.d.ts.map +1 -0
- package/lib/typescript/src/native/CornerInset.ios.d.ts +8 -0
- package/lib/typescript/src/native/CornerInset.ios.d.ts.map +1 -0
- package/lib/typescript/src/native/ReactNavigationCornerInsetViewNativeComponent.d.ts +14 -0
- package/lib/typescript/src/native/ReactNavigationCornerInsetViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/native/types.d.ts +21 -21
- package/lib/typescript/src/native/types.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +13 -13
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/useLinkBuilder.d.ts +54 -66
- package/lib/typescript/src/useLinkBuilder.d.ts.map +1 -1
- package/lib/typescript/src/useLinkProps.d.ts.map +1 -1
- package/lib/typescript/src/useLinking.d.ts +10 -10
- package/lib/typescript/src/useLinking.native.d.ts +20 -20
- package/package.json +12 -9
- package/src/ServerContext.tsx +6 -4
- package/src/index.tsx +5 -0
- package/src/native/CornerInset.ios.tsx +82 -0
- package/src/native/CornerInset.tsx +41 -0
- package/src/native/ReactNavigationCornerInsetViewNativeComponent.ts +32 -0
- package/src/native/types.tsx +26 -22
- package/src/types.tsx +38 -36
- package/src/useLinkBuilder.tsx +7 -1
- package/src/useLinkProps.tsx +5 -38
|
@@ -9,7 +9,9 @@ import com.facebook.react.uimanager.ViewManager
|
|
|
9
9
|
|
|
10
10
|
class ReactNavigationPackage : BaseReactPackage() {
|
|
11
11
|
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
|
|
12
|
-
return listOf(
|
|
12
|
+
return listOf(
|
|
13
|
+
MaterialSymbolViewManager()
|
|
14
|
+
)
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#import <React/RCTViewComponentView.h>
|
|
2
|
+
#import <UIKit/UIKit.h>
|
|
3
|
+
|
|
4
|
+
#ifndef ReactNavigationCornerInsetViewNativeComponent_h
|
|
5
|
+
#define ReactNavigationCornerInsetViewNativeComponent_h
|
|
6
|
+
|
|
7
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
8
|
+
|
|
9
|
+
@interface ReactNavigationCornerInsetView : RCTViewComponentView
|
|
10
|
+
@end
|
|
11
|
+
|
|
12
|
+
NS_ASSUME_NONNULL_END
|
|
13
|
+
|
|
14
|
+
#endif /* ReactNavigationCornerInsetViewNativeComponent_h */
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
#import "ReactNavigationCornerInsetView.h"
|
|
2
|
+
|
|
3
|
+
#import <React/RCTConversions.h>
|
|
4
|
+
|
|
5
|
+
#if __has_include("ReactNavigation/ReactNavigation-Swift.h")
|
|
6
|
+
#import "ReactNavigation/ReactNavigation-Swift.h"
|
|
7
|
+
#else
|
|
8
|
+
#import "ReactNavigation-Swift.h"
|
|
9
|
+
#endif
|
|
10
|
+
|
|
11
|
+
#import "ReactNavigationCornerInsetViewComponentDescriptor.h"
|
|
12
|
+
#import "ReactNavigationCornerInsetViewShadowNode.h"
|
|
13
|
+
|
|
14
|
+
#import <QuartzCore/QuartzCore.h>
|
|
15
|
+
#import <react/renderer/components/ReactNavigationSpec/Props.h>
|
|
16
|
+
|
|
17
|
+
#import "RCTFabricComponentsPlugins.h"
|
|
18
|
+
|
|
19
|
+
using namespace facebook::react;
|
|
20
|
+
|
|
21
|
+
static NSTimeInterval const ReactNavigationCornerInsetAnimationDuration = 0.2;
|
|
22
|
+
static CGFloat const ReactNavigationCornerInsetAnimationTolerance = 0.01;
|
|
23
|
+
|
|
24
|
+
@interface ReactNavigationCornerInsetView () <ReactNavigationCornerInsetViewImplDelegate>
|
|
25
|
+
|
|
26
|
+
@end
|
|
27
|
+
|
|
28
|
+
@implementation ReactNavigationCornerInsetView {
|
|
29
|
+
ReactNavigationCornerInsetViewImpl * _view;
|
|
30
|
+
ReactNavigationCornerInsetViewShadowNode::ConcreteState::Shared _state;
|
|
31
|
+
CGFloat _currentCornerInset;
|
|
32
|
+
CADisplayLink * _cornerInsetAnimationDisplayLink;
|
|
33
|
+
CFTimeInterval _cornerInsetAnimationStartTime;
|
|
34
|
+
CGFloat _cornerInsetAnimationFromValue;
|
|
35
|
+
CGFloat _cornerInsetAnimationToValue;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
39
|
+
{
|
|
40
|
+
return concreteComponentDescriptorProvider<ReactNavigationCornerInsetViewComponentDescriptor>();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
+ (BOOL)shouldBeRecycled
|
|
44
|
+
{
|
|
45
|
+
return NO;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
- (instancetype)initWithFrame:(CGRect)frame
|
|
49
|
+
{
|
|
50
|
+
if (self = [super initWithFrame:frame]) {
|
|
51
|
+
static const auto defaultProps = std::make_shared<const ReactNavigationCornerInsetViewProps>();
|
|
52
|
+
_props = defaultProps;
|
|
53
|
+
|
|
54
|
+
_view = [[ReactNavigationCornerInsetViewImpl alloc] init];
|
|
55
|
+
_view.delegate = self;
|
|
56
|
+
|
|
57
|
+
self.contentView = _view;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return self;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
static ReactNavigationCornerInsetViewImplProps *convertProps(const Props::Shared &props) {
|
|
64
|
+
const auto &viewProps = *std::static_pointer_cast<ReactNavigationCornerInsetViewProps const>(props);
|
|
65
|
+
|
|
66
|
+
ReactNavigationCornerInsetViewImplProps *swiftProps = [[ReactNavigationCornerInsetViewImplProps alloc] init];
|
|
67
|
+
|
|
68
|
+
swiftProps.direction = viewProps.direction == ReactNavigationCornerInsetViewDirection::Horizontal
|
|
69
|
+
? CornerInsetDirectionHorizontal
|
|
70
|
+
: CornerInsetDirectionVertical;
|
|
71
|
+
|
|
72
|
+
swiftProps.edge = viewProps.edge == ReactNavigationCornerInsetViewEdge::Left
|
|
73
|
+
? CornerInsetEdgeLeft
|
|
74
|
+
: viewProps.edge == ReactNavigationCornerInsetViewEdge::Right
|
|
75
|
+
? CornerInsetEdgeRight
|
|
76
|
+
: viewProps.edge == ReactNavigationCornerInsetViewEdge::Bottom
|
|
77
|
+
? CornerInsetEdgeBottom
|
|
78
|
+
: CornerInsetEdgeTop;
|
|
79
|
+
swiftProps.adaptive = viewProps.adaptive;
|
|
80
|
+
|
|
81
|
+
return swiftProps;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
|
|
85
|
+
{
|
|
86
|
+
[_view updateProps:convertProps(props) oldProps:convertProps(_props)];
|
|
87
|
+
[super updateProps:props oldProps:oldProps];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
- (void)updateState:(const State::Shared &)state oldState:(const State::Shared &)oldState
|
|
91
|
+
{
|
|
92
|
+
_state = std::static_pointer_cast<ReactNavigationCornerInsetViewShadowNode::ConcreteState const>(state);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
- (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args
|
|
96
|
+
{
|
|
97
|
+
if ([commandName isEqualToString:@"relayout"]) {
|
|
98
|
+
[_view relayout];
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
[super handleCommand:commandName args:args];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
- (void)dealloc
|
|
106
|
+
{
|
|
107
|
+
[self stopCornerInsetAnimation];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
- (void)cornerInsetDidChange:(CGFloat)cornerInset animated:(BOOL)animated
|
|
111
|
+
{
|
|
112
|
+
if (animated) {
|
|
113
|
+
if (fabs(_currentCornerInset - cornerInset) <= ReactNavigationCornerInsetAnimationTolerance) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
[self startCornerInsetAnimationTo:cornerInset];
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (_cornerInsetAnimationDisplayLink != nil &&
|
|
122
|
+
fabs(_cornerInsetAnimationToValue - cornerInset) <= ReactNavigationCornerInsetAnimationTolerance) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
[self stopCornerInsetAnimation];
|
|
127
|
+
|
|
128
|
+
if (fabs(_currentCornerInset - cornerInset) <= ReactNavigationCornerInsetAnimationTolerance) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
[self applyCornerInset:cornerInset];
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
- (void)startCornerInsetAnimationTo:(CGFloat)cornerInset
|
|
136
|
+
{
|
|
137
|
+
[self stopCornerInsetAnimation];
|
|
138
|
+
|
|
139
|
+
_cornerInsetAnimationFromValue = _currentCornerInset;
|
|
140
|
+
_cornerInsetAnimationToValue = cornerInset;
|
|
141
|
+
_cornerInsetAnimationStartTime = CACurrentMediaTime();
|
|
142
|
+
_cornerInsetAnimationDisplayLink =
|
|
143
|
+
[CADisplayLink displayLinkWithTarget:self selector:@selector(handleCornerInsetAnimationFrame:)];
|
|
144
|
+
[_cornerInsetAnimationDisplayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
- (void)stopCornerInsetAnimation
|
|
148
|
+
{
|
|
149
|
+
[_cornerInsetAnimationDisplayLink invalidate];
|
|
150
|
+
_cornerInsetAnimationDisplayLink = nil;
|
|
151
|
+
_cornerInsetAnimationStartTime = 0;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
- (void)handleCornerInsetAnimationFrame:(CADisplayLink *)displayLink
|
|
155
|
+
{
|
|
156
|
+
NSTimeInterval elapsed = CACurrentMediaTime() - _cornerInsetAnimationStartTime;
|
|
157
|
+
CGFloat progress = MIN(1, elapsed / ReactNavigationCornerInsetAnimationDuration);
|
|
158
|
+
CGFloat inverseProgress = 1 - progress;
|
|
159
|
+
CGFloat easedProgress = 1 - inverseProgress * inverseProgress * inverseProgress;
|
|
160
|
+
|
|
161
|
+
CGFloat cornerInset = _cornerInsetAnimationFromValue +
|
|
162
|
+
(_cornerInsetAnimationToValue - _cornerInsetAnimationFromValue) * easedProgress;
|
|
163
|
+
[self applyCornerInset:cornerInset];
|
|
164
|
+
|
|
165
|
+
if (progress >= 1) {
|
|
166
|
+
[self stopCornerInsetAnimation];
|
|
167
|
+
[self applyCornerInset:_cornerInsetAnimationToValue];
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
- (void)applyCornerInset:(CGFloat)cornerInset
|
|
172
|
+
{
|
|
173
|
+
_currentCornerInset = cornerInset;
|
|
174
|
+
|
|
175
|
+
if (!_state) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
_state->updateState(ReactNavigationCornerInsetViewState(cornerInset), facebook::react::EventQueue::UpdateMode::unstable_Immediate);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
@end
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import UIKit
|
|
2
|
+
|
|
3
|
+
@objc public enum CornerInsetDirection: Int {
|
|
4
|
+
case vertical
|
|
5
|
+
case horizontal
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@objc public enum CornerInsetEdge: Int {
|
|
9
|
+
case top
|
|
10
|
+
case right
|
|
11
|
+
case bottom
|
|
12
|
+
case left
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@objcMembers public class ReactNavigationCornerInsetViewImplProps: NSObject {
|
|
16
|
+
public var direction: CornerInsetDirection = .vertical
|
|
17
|
+
public var edge: CornerInsetEdge = .top
|
|
18
|
+
public var adaptive: Bool = true
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@objc public protocol ReactNavigationCornerInsetViewImplDelegate: NSObjectProtocol {
|
|
22
|
+
func cornerInsetDidChange(_ cornerInset: CGFloat, animated: Bool)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@objc public class ReactNavigationCornerInsetViewImpl: UIView {
|
|
26
|
+
@objc public weak var delegate: ReactNavigationCornerInsetViewImplDelegate?
|
|
27
|
+
|
|
28
|
+
private var props: ReactNavigationCornerInsetViewImplProps = ReactNavigationCornerInsetViewImplProps()
|
|
29
|
+
private var hasMeasuredCornerInset = false
|
|
30
|
+
private var lastMeasuredCornerInset: CGFloat = 0
|
|
31
|
+
private weak var measurementView: UIView?
|
|
32
|
+
private weak var lastMeasuredWindow: UIWindow?
|
|
33
|
+
|
|
34
|
+
@objc public func updateProps(_ props: ReactNavigationCornerInsetViewImplProps, oldProps: ReactNavigationCornerInsetViewImplProps) {
|
|
35
|
+
self.props = props
|
|
36
|
+
|
|
37
|
+
if props.direction != oldProps.direction || props.edge != oldProps.edge || props.adaptive != oldProps.adaptive {
|
|
38
|
+
setNeedsLayout()
|
|
39
|
+
updateCornerInset(forceMeasurement: true)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@objc public func relayout() {
|
|
44
|
+
updateCornerInset(animated: true, forceMeasurement: true)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public override func didMoveToWindow() {
|
|
48
|
+
super.didMoveToWindow()
|
|
49
|
+
|
|
50
|
+
if window == nil {
|
|
51
|
+
measurementView?.removeFromSuperview()
|
|
52
|
+
measurementView = nil
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
updateCornerInset()
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
private func updateCornerInset(animated: Bool = false, forceMeasurement: Bool = false) {
|
|
59
|
+
if shouldMeasureCornerInset(forceMeasurement: forceMeasurement) {
|
|
60
|
+
if #available(iOS 26.0, *) {
|
|
61
|
+
let sourceView: UIView
|
|
62
|
+
|
|
63
|
+
if let window {
|
|
64
|
+
sourceView = prepareMeasurementView(in: window)
|
|
65
|
+
} else {
|
|
66
|
+
sourceView = self
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
let cornerMargins = readCornerMargins(from: sourceView)
|
|
70
|
+
|
|
71
|
+
switch props.edge {
|
|
72
|
+
case .top:
|
|
73
|
+
lastMeasuredCornerInset = cornerMargins.top
|
|
74
|
+
case .right:
|
|
75
|
+
lastMeasuredCornerInset = cornerMargins.right
|
|
76
|
+
case .bottom:
|
|
77
|
+
lastMeasuredCornerInset = cornerMargins.bottom
|
|
78
|
+
case .left:
|
|
79
|
+
lastMeasuredCornerInset = cornerMargins.left
|
|
80
|
+
}
|
|
81
|
+
} else {
|
|
82
|
+
lastMeasuredCornerInset = 0
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
hasMeasuredCornerInset = true
|
|
86
|
+
lastMeasuredWindow = window
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
delegate?.cornerInsetDidChange(hasMeasuredCornerInset ? lastMeasuredCornerInset : 0, animated: animated)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
private func shouldMeasureCornerInset(forceMeasurement: Bool) -> Bool {
|
|
93
|
+
let currentWindow = window
|
|
94
|
+
|
|
95
|
+
if forceMeasurement {
|
|
96
|
+
return currentWindow != nil || !hasMeasuredCornerInset
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if !hasMeasuredCornerInset {
|
|
100
|
+
return true
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
guard let currentWindow else {
|
|
104
|
+
return false
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return lastMeasuredWindow !== currentWindow
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@available(iOS 26.0, *)
|
|
111
|
+
private func prepareMeasurementView(in window: UIWindow) -> UIView {
|
|
112
|
+
let measurementView = resolveMeasurementView(in: window)
|
|
113
|
+
|
|
114
|
+
measurementView.frame = resolveFrameInWindow()
|
|
115
|
+
|
|
116
|
+
window.setNeedsUpdateProperties()
|
|
117
|
+
measurementView.setNeedsUpdateProperties()
|
|
118
|
+
window.updatePropertiesIfNeeded()
|
|
119
|
+
measurementView.updatePropertiesIfNeeded()
|
|
120
|
+
|
|
121
|
+
return measurementView
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@available(iOS 26.0, *)
|
|
125
|
+
private func readCornerMargins(from sourceView: UIView) -> UIEdgeInsets {
|
|
126
|
+
let adaptedRegion = UIView.LayoutRegion.margins(
|
|
127
|
+
cornerAdaptation: props.direction == .horizontal ? .horizontal : .vertical
|
|
128
|
+
)
|
|
129
|
+
let adaptedMargins = sourceView.edgeInsets(for: adaptedRegion)
|
|
130
|
+
|
|
131
|
+
if !props.adaptive {
|
|
132
|
+
return adaptedMargins
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
let baselineRegion = UIView.LayoutRegion.margins(cornerAdaptation: .none)
|
|
136
|
+
let baselineMargins = sourceView.edgeInsets(for: baselineRegion)
|
|
137
|
+
|
|
138
|
+
return UIEdgeInsets(
|
|
139
|
+
top: adaptedMargins.top == baselineMargins.top ? 0 : adaptedMargins.top,
|
|
140
|
+
left: adaptedMargins.left == baselineMargins.left ? 0 : adaptedMargins.left,
|
|
141
|
+
bottom: adaptedMargins.bottom == baselineMargins.bottom ? 0 : adaptedMargins.bottom,
|
|
142
|
+
right: adaptedMargins.right == baselineMargins.right ? 0 : adaptedMargins.right
|
|
143
|
+
)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@available(iOS 26.0, *)
|
|
147
|
+
private func resolveMeasurementView(in window: UIWindow) -> UIView {
|
|
148
|
+
if let measurementView, measurementView.window === window {
|
|
149
|
+
return measurementView
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
measurementView?.removeFromSuperview()
|
|
153
|
+
|
|
154
|
+
// Use a hidden view in the window so relayout can read the current corner
|
|
155
|
+
// insets even while transforms are animating.
|
|
156
|
+
let view = UIView(frame: .zero)
|
|
157
|
+
|
|
158
|
+
view.backgroundColor = .clear
|
|
159
|
+
view.isUserInteractionEnabled = false
|
|
160
|
+
view.isAccessibilityElement = false
|
|
161
|
+
view.alpha = 0
|
|
162
|
+
|
|
163
|
+
window.addSubview(view)
|
|
164
|
+
measurementView = view
|
|
165
|
+
|
|
166
|
+
return view
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
private func resolveFrameInWindow() -> CGRect {
|
|
170
|
+
guard let window else {
|
|
171
|
+
return .zero
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
guard
|
|
175
|
+
let superLayer = layer.superlayer,
|
|
176
|
+
let presentationLayer = layer.presentation()
|
|
177
|
+
else {
|
|
178
|
+
return superview?.convert(frame, to: window) ?? convert(bounds, to: window)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
let sourceLayer = superLayer.presentation() ?? superLayer
|
|
182
|
+
let destinationLayer = window.layer.presentation() ?? window.layer
|
|
183
|
+
let center = destinationLayer.convert(presentationLayer.position, from: sourceLayer)
|
|
184
|
+
let bounds = presentationLayer.bounds
|
|
185
|
+
|
|
186
|
+
return CGRect(
|
|
187
|
+
x: center.x - bounds.size.width / 2,
|
|
188
|
+
y: center.y - bounds.size.height / 2,
|
|
189
|
+
width: bounds.size.width,
|
|
190
|
+
height: bounds.size.height
|
|
191
|
+
)
|
|
192
|
+
}
|
|
193
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include "ReactNavigationCornerInsetViewShadowNode.h"
|
|
4
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
5
|
+
|
|
6
|
+
namespace facebook {
|
|
7
|
+
namespace react {
|
|
8
|
+
|
|
9
|
+
class ReactNavigationCornerInsetViewComponentDescriptor final
|
|
10
|
+
: public ConcreteComponentDescriptor<ReactNavigationCornerInsetViewShadowNode> {
|
|
11
|
+
using ConcreteComponentDescriptor::ConcreteComponentDescriptor;
|
|
12
|
+
|
|
13
|
+
void adopt(ShadowNode &shadowNode) const override {
|
|
14
|
+
auto &concreteShadowNode =
|
|
15
|
+
static_cast<ReactNavigationCornerInsetViewShadowNode &>(shadowNode);
|
|
16
|
+
concreteShadowNode.adjustLayoutWithState();
|
|
17
|
+
|
|
18
|
+
ConcreteComponentDescriptor::adopt(shadowNode);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
} // namespace react
|
|
23
|
+
} // namespace facebook
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <jsi/jsi.h>
|
|
4
|
+
#include <react/renderer/components/ReactNavigationSpec/EventEmitters.h>
|
|
5
|
+
#include <react/renderer/components/ReactNavigationSpec/Props.h>
|
|
6
|
+
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
7
|
+
#include "ReactNavigationCornerInsetViewState.h"
|
|
8
|
+
|
|
9
|
+
namespace facebook {
|
|
10
|
+
namespace react {
|
|
11
|
+
|
|
12
|
+
JSI_EXPORT extern const char ReactNavigationCornerInsetViewComponentName[];
|
|
13
|
+
|
|
14
|
+
class JSI_EXPORT ReactNavigationCornerInsetViewShadowNode final
|
|
15
|
+
: public ConcreteViewShadowNode<
|
|
16
|
+
ReactNavigationCornerInsetViewComponentName,
|
|
17
|
+
ReactNavigationCornerInsetViewProps,
|
|
18
|
+
ViewEventEmitter,
|
|
19
|
+
ReactNavigationCornerInsetViewState> {
|
|
20
|
+
using ConcreteViewShadowNode::ConcreteViewShadowNode;
|
|
21
|
+
|
|
22
|
+
public:
|
|
23
|
+
void adjustLayoutWithState();
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
} // namespace react
|
|
27
|
+
} // namespace facebook
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#include "ReactNavigationCornerInsetViewShadowNode.h"
|
|
2
|
+
|
|
3
|
+
#include <react/renderer/core/LayoutContext.h>
|
|
4
|
+
#include <yoga/Yoga.h>
|
|
5
|
+
|
|
6
|
+
namespace facebook {
|
|
7
|
+
namespace react {
|
|
8
|
+
|
|
9
|
+
using namespace yoga;
|
|
10
|
+
|
|
11
|
+
extern const char ReactNavigationCornerInsetViewComponentName[] =
|
|
12
|
+
"ReactNavigationCornerInsetView";
|
|
13
|
+
|
|
14
|
+
void ReactNavigationCornerInsetViewShadowNode::adjustLayoutWithState() {
|
|
15
|
+
ensureUnsealed();
|
|
16
|
+
|
|
17
|
+
const auto &props = getConcreteProps();
|
|
18
|
+
auto state =
|
|
19
|
+
std::static_pointer_cast<const ReactNavigationCornerInsetViewShadowNode::ConcreteState>(
|
|
20
|
+
getState());
|
|
21
|
+
auto stateData = state->getData();
|
|
22
|
+
|
|
23
|
+
Float cornerInset = stateData.cornerInset;
|
|
24
|
+
|
|
25
|
+
Dimension dimension = props.edge == ReactNavigationCornerInsetViewEdge::Left ||
|
|
26
|
+
props.edge == ReactNavigationCornerInsetViewEdge::Right
|
|
27
|
+
? Dimension::Width
|
|
28
|
+
: Dimension::Height;
|
|
29
|
+
|
|
30
|
+
auto newLength = StyleSizeLength::points(cornerInset);
|
|
31
|
+
auto currentLength = yogaNode_.style().dimension(dimension);
|
|
32
|
+
|
|
33
|
+
if (currentLength != newLength) {
|
|
34
|
+
yoga::Style style = yogaNode_.style();
|
|
35
|
+
style.setDimension(dimension, newLength);
|
|
36
|
+
yogaNode_.setStyle(style);
|
|
37
|
+
yogaNode_.setDirty(true);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
} // namespace react
|
|
42
|
+
} // namespace facebook
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <react/renderer/graphics/Float.h>
|
|
4
|
+
|
|
5
|
+
namespace facebook {
|
|
6
|
+
namespace react {
|
|
7
|
+
|
|
8
|
+
class JSI_EXPORT ReactNavigationCornerInsetViewState final {
|
|
9
|
+
public:
|
|
10
|
+
using Shared = std::shared_ptr<const ReactNavigationCornerInsetViewState>;
|
|
11
|
+
|
|
12
|
+
ReactNavigationCornerInsetViewState() = default;
|
|
13
|
+
ReactNavigationCornerInsetViewState(Float value): cornerInset(value) {}
|
|
14
|
+
|
|
15
|
+
Float cornerInset{0};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
} // namespace react
|
|
19
|
+
} // namespace facebook
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","ServerContext","createContext","undefined"],"sourceRoot":"../../src","sources":["ServerContext.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;
|
|
1
|
+
{"version":3,"names":["React","ServerContext","createContext","undefined"],"sourceRoot":"../../src","sources":["ServerContext.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAW9B,OAAO,MAAMC,aAAa,gBAAGD,KAAK,CAACE,aAAa,CAC9CC,SACF,CAAC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export { createStaticNavigation } from "./createStaticNavigation.js";
|
|
|
4
4
|
export { Link } from "./Link.js";
|
|
5
5
|
export { LinkingContext } from "./LinkingContext.js";
|
|
6
6
|
export { LocaleDirContext } from "./LocaleDirContext.js";
|
|
7
|
+
export { CornerInset as UNSTABLE_CornerInset } from './native/CornerInset';
|
|
7
8
|
export { MaterialSymbol } from './native/MaterialSymbol';
|
|
8
9
|
export { SFSymbol } from './native/SFSymbol';
|
|
9
10
|
export { NavigationContainer } from "./NavigationContainer.js";
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createStaticNavigation","Link","LinkingContext","LocaleDirContext","MaterialSymbol","SFSymbol","NavigationContainer","ServerContainer","DarkTheme","LightTheme","DefaultTheme","MaterialDarkTheme","MaterialLightTheme","useLinkBuilder","useLinkProps","useLinkTo","useLocale","useRoutePath","useScrollToTop"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,sBAAsB,QAAQ,6BAA0B;AACjE,SAASC,IAAI,QAAQ,WAAQ;AAC7B,SAASC,cAAc,QAAQ,qBAAkB;AACjD,SAASC,gBAAgB,QAAQ,uBAAoB;AACrD,SACEC,cAAc,QAET,yBAAyB;AAChC,SAASC,QAAQ,QAA4B,mBAAmB;AAChE,SAASC,mBAAmB,QAAQ,0BAAuB;AAC3D,SAASC,eAAe,QAAQ,sBAAmB;AACnD,SAASC,SAAS,QAAQ,wBAAqB;AAC/C,SAASC,UAAU,IAAIC,YAAY,QAAQ,yBAAsB;AACjE,SAASC,iBAAiB,EAAEC,kBAAkB,QAAQ,yBAAyB;AAC/E,cAAc,YAAS;AACvB,SAASC,cAAc,QAAQ,qBAAkB;AACjD,SAAyBC,YAAY,QAAQ,mBAAgB;AAC7D,SAASC,SAAS,QAAQ,gBAAa;AACvC,SAASC,SAAS,QAAQ,gBAAa;AACvC,SAASC,YAAY,QAAQ,mBAAgB;AAC7C,SAASC,cAAc,QAAQ,qBAAkB;AACjD,cAAc,wBAAwB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["createStaticNavigation","Link","LinkingContext","LocaleDirContext","CornerInset","UNSTABLE_CornerInset","MaterialSymbol","SFSymbol","NavigationContainer","ServerContainer","DarkTheme","LightTheme","DefaultTheme","MaterialDarkTheme","MaterialLightTheme","useLinkBuilder","useLinkProps","useLinkTo","useLocale","useRoutePath","useScrollToTop"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,sBAAsB,QAAQ,6BAA0B;AACjE,SAASC,IAAI,QAAQ,WAAQ;AAC7B,SAASC,cAAc,QAAQ,qBAAkB;AACjD,SAASC,gBAAgB,QAAQ,uBAAoB;AACrD,SAGEC,WAAW,IAAIC,oBAAoB,QAC9B,sBAAsB;AAC7B,SACEC,cAAc,QAET,yBAAyB;AAChC,SAASC,QAAQ,QAA4B,mBAAmB;AAChE,SAASC,mBAAmB,QAAQ,0BAAuB;AAC3D,SAASC,eAAe,QAAQ,sBAAmB;AACnD,SAASC,SAAS,QAAQ,wBAAqB;AAC/C,SAASC,UAAU,IAAIC,YAAY,QAAQ,yBAAsB;AACjE,SAASC,iBAAiB,EAAEC,kBAAkB,QAAQ,yBAAyB;AAC/E,cAAc,YAAS;AACvB,SAASC,cAAc,QAAQ,qBAAkB;AACjD,SAAyBC,YAAY,QAAQ,mBAAgB;AAC7D,SAASC,SAAS,QAAQ,gBAAa;AACvC,SAASC,SAAS,QAAQ,gBAAa;AACvC,SAASC,YAAY,QAAQ,mBAAgB;AAC7C,SAASC,cAAc,QAAQ,qBAAkB;AACjD,cAAc,wBAAwB","ignoreList":[]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { NavigationContainerRefContext } from '@react-navigation/core';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { Dimensions } from 'react-native';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line import-x/extensions
|
|
8
|
+
|
|
9
|
+
import ReactNavigationCornerInsetViewNativeComponent, { Commands } from './ReactNavigationCornerInsetViewNativeComponent';
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
function CornerInsetIOS(props, ref) {
|
|
12
|
+
const root = React.use(NavigationContainerRefContext);
|
|
13
|
+
const nativeRef = React.useRef(null);
|
|
14
|
+
const relayout = React.useCallback(() => {
|
|
15
|
+
if (nativeRef.current) {
|
|
16
|
+
Commands.relayout(nativeRef.current);
|
|
17
|
+
}
|
|
18
|
+
}, []);
|
|
19
|
+
React.useEffect(() => {
|
|
20
|
+
if (root == null) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
let animationFrameHandle = null;
|
|
24
|
+
|
|
25
|
+
// We freeze the corner insets after initial measurements
|
|
26
|
+
// This is to avoid the insets getting out of sync during transitions
|
|
27
|
+
// We trigger a relayout explicitly on window resize and transition end
|
|
28
|
+
const unsubscribeWindowResize = Dimensions.addEventListener('change', () => {
|
|
29
|
+
if (animationFrameHandle) {
|
|
30
|
+
cancelAnimationFrame(animationFrameHandle);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// When window is unmaximized, calling relayout immediately doesn't work
|
|
34
|
+
// So we delay it to the next frame as a workaround
|
|
35
|
+
animationFrameHandle = requestAnimationFrame(() => {
|
|
36
|
+
relayout();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
const unsubscribeTransition = root.addListener('__unsafe_event__', e => {
|
|
40
|
+
if (e.data.type === 'transitionEnd') {
|
|
41
|
+
relayout();
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
return () => {
|
|
45
|
+
if (animationFrameHandle) {
|
|
46
|
+
cancelAnimationFrame(animationFrameHandle);
|
|
47
|
+
}
|
|
48
|
+
unsubscribeWindowResize.remove();
|
|
49
|
+
unsubscribeTransition();
|
|
50
|
+
};
|
|
51
|
+
}, [root, relayout]);
|
|
52
|
+
React.useImperativeHandle(ref, () => ({
|
|
53
|
+
relayout
|
|
54
|
+
}), [relayout]);
|
|
55
|
+
return /*#__PURE__*/_jsx(ReactNavigationCornerInsetViewNativeComponent, {
|
|
56
|
+
...props,
|
|
57
|
+
ref: nativeRef
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
export const CornerInset = /*#__PURE__*/React.forwardRef(CornerInsetIOS);
|
|
61
|
+
//# sourceMappingURL=CornerInset.ios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NavigationContainerRefContext","React","Dimensions","ReactNavigationCornerInsetViewNativeComponent","Commands","jsx","_jsx","CornerInsetIOS","props","ref","root","use","nativeRef","useRef","relayout","useCallback","current","useEffect","animationFrameHandle","unsubscribeWindowResize","addEventListener","cancelAnimationFrame","requestAnimationFrame","unsubscribeTransition","addListener","e","data","type","remove","useImperativeHandle","CornerInset","forwardRef"],"sourceRoot":"../../../src","sources":["native/CornerInset.ios.tsx"],"mappings":";;AAAA,SAASA,6BAA6B,QAAQ,wBAAwB;AACtE,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,QAAQ,cAAc;;AAEzC;;AAEA,OAAOC,6CAA6C,IAClDC,QAAQ,QACH,iDAAiD;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEzD,SAASC,cAAcA,CACrBC,KAAuB,EACvBC,GAA8B,EAC9B;EACA,MAAMC,IAAI,GAAGT,KAAK,CAACU,GAAG,CAACX,6BAA6B,CAAC;EAErD,MAAMY,SAAS,GACbX,KAAK,CAACY,MAAM,CA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AAMkB,WAAW,gBAAG7B,KAAK,CAAC8B,UAAU,CAACxB,cAAc,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
function CornerInsetBase(props, ref) {
|
|
7
|
+
React.useImperativeHandle(ref, () => ({
|
|
8
|
+
relayout() {}
|
|
9
|
+
}), []);
|
|
10
|
+
return /*#__PURE__*/_jsx(View, {
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export const CornerInset = /*#__PURE__*/React.forwardRef(CornerInsetBase);
|
|
15
|
+
//# sourceMappingURL=CornerInset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","jsx","_jsx","CornerInsetBase","props","ref","useImperativeHandle","relayout","CornerInset","forwardRef"],"sourceRoot":"../../../src","sources":["native/CornerInset.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,IAAI,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAwBpC,SAASC,eAAeA,CACtBC,KAAuB,EACvBC,GAA8B,EAC9B;EACAN,KAAK,CAACO,mBAAmB,CACvBD,GAAG,EACH,OAAO;IACLE,QAAQA,CAAA,EAAG,CAAC;EACd,CAAC,CAAC,EACF,EACF,CAAC;EAED,oBAAOL,IAAA,CAACF,IAAI;IAAA,GAAKI;EAAK,CAAG,CAAC;AAC5B;AAEA,OAAO,MAAMI,WAAW,gBAAGT,KAAK,CAACU,UAAU,CAACN,eAAe,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* eslint-disable import-x/no-default-export */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
codegenNativeCommands,
|
|
5
|
+
codegenNativeComponent,
|
|
6
|
+
CodegenTypes,
|
|
7
|
+
type HostComponent,
|
|
8
|
+
type ViewProps,
|
|
9
|
+
} from 'react-native';
|
|
10
|
+
|
|
11
|
+
export interface NativeProps extends ViewProps {
|
|
12
|
+
direction?: CodegenTypes.WithDefault<'vertical' | 'horizontal', 'vertical'>;
|
|
13
|
+
edge?: CodegenTypes.WithDefault<'top' | 'right' | 'bottom' | 'left', 'top'>;
|
|
14
|
+
adaptive?: CodegenTypes.WithDefault<boolean, true>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface NativeCommands {
|
|
18
|
+
// FIXME: codegen fails with ComponentRef
|
|
19
|
+
// so we currently use the deprecated ElementRef
|
|
20
|
+
relayout(viewRef: React.ElementRef<HostComponent<NativeProps>>): void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const Commands = codegenNativeCommands<NativeCommands>({
|
|
24
|
+
supportedCommands: ['relayout'],
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export default codegenNativeComponent<NativeProps>(
|
|
28
|
+
'ReactNavigationCornerInsetView',
|
|
29
|
+
{
|
|
30
|
+
interfaceOnly: true,
|
|
31
|
+
}
|
|
32
|
+
) as HostComponent<NativeProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CommonActions","findFocusedRoute","getActionFromState","getPathFromState","NavigationHelpersContext","NavigationRouteContext","useStateForPath","React","getStateFromHref","LinkingContext","useBuildHref","navigation","useContext","route","options","focusedRouteState","getPathFromStateHelper","buildHref","useCallback","name","params","enabled","undefined","isScreen","key","getState","routes","some","r","stateForRoute","constructState","state","path","config","useBuildAction","getActionFromStateHelper","buildAction","href","action","reset","Error","useLinkBuilder"],"sourceRoot":"../../src","sources":["useLinkBuilder.tsx"],"mappings":";;AAAA,SACEA,aAAa,EACbC,gBAAgB,EAChBC,kBAAkB,EAClBC,gBAAgB,EAChBC,wBAAwB,EACxBC,sBAAsB,EACtBC,eAAe,QACV,wBAAwB;AAC/B,OAAO,KAAKC,KAAK,MAAM,OAAO;AAE9B,SAASC,gBAAgB,QAAQ,uBAAoB;AACrD,SAASC,cAAc,QAAQ,qBAAkB;
|
|
1
|
+
{"version":3,"names":["CommonActions","findFocusedRoute","getActionFromState","getPathFromState","NavigationHelpersContext","NavigationRouteContext","useStateForPath","React","getStateFromHref","LinkingContext","useBuildHref","navigation","useContext","route","options","focusedRouteState","getPathFromStateHelper","buildHref","useCallback","name","params","enabled","undefined","isScreen","key","getState","routes","some","r","stateForRoute","constructState","state","path","config","useBuildAction","getActionFromStateHelper","buildAction","href","action","reset","Error","useLinkBuilder"],"sourceRoot":"../../src","sources":["useLinkBuilder.tsx"],"mappings":";;AAAA,SACEA,aAAa,EACbC,gBAAgB,EAChBC,kBAAkB,EAClBC,gBAAgB,EAChBC,wBAAwB,EACxBC,sBAAsB,EACtBC,eAAe,QACV,wBAAwB;AAC/B,OAAO,KAAKC,KAAK,MAAM,OAAO;AAE9B,SAASC,gBAAgB,QAAQ,uBAAoB;AACrD,SAASC,cAAc,QAAQ,qBAAkB;AAYjD;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAA,EAAG;EAC7B,MAAMC,UAAU,GAAGJ,KAAK,CAACK,UAAU,CAACR,wBAAwB,CAAC;EAC7D,MAAMS,KAAK,GAAGN,KAAK,CAACK,UAAU,CAACP,sBAAsB,CAAC;EAEtD,MAAM;IAAES;EAAQ,CAAC,GAAGP,KAAK,CAACK,UAAU,CAACH,cAAc,CAAC;EAEpD,MAAMM,iBAAiB,GAAGT,eAAe,CAAC,CAAC;EAE3C,MAAMU,sBAAsB,GAAGF,OAAO,EAAEX,gBAAgB,IAAIA,gBAAgB;EAE5E,MAAMc,SAAS,GAAGV,KAAK,CAACW,WAAW,CACjC,CAACC,IAAY,EAAEC,MAAe,KAAK;IACjC,IAAIN,OAAO,EAAEO,OAAO,KAAK,KAAK,EAAE;MAC9B,OAAOC,SAAS;IAClB;;IAEA;IACA;IACA;IACA;IACA;IACA,M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