react-native-tvos 0.85.2-0 → 0.85.3-1
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/Libraries/Components/ScrollView/ScrollView.d.ts +1 -1
- package/Libraries/Components/ScrollView/ScrollView.js +1 -1
- package/Libraries/Components/TV/TVViewPropTypes.js +9 -0
- package/Libraries/Components/View/View.js +7 -3
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/NativeComponent/TVViewConfig.js +1 -0
- package/Libraries/Utilities/HMRClient.js +28 -1
- package/README.md +13 -1
- package/React/Base/RCTVersion.m +2 -2
- package/React/CoreModules/RCTJscSafeUrl+Internal.h +23 -0
- package/React/CoreModules/RCTJscSafeUrl.mm +38 -0
- package/React/CoreModules/RCTRedBox+Internal.h +42 -0
- package/React/CoreModules/RCTRedBox.mm +30 -471
- package/React/CoreModules/RCTRedBox2AnsiParser+Internal.h +22 -0
- package/React/CoreModules/RCTRedBox2AnsiParser.mm +55 -0
- package/React/CoreModules/RCTRedBox2Controller+Internal.h +34 -0
- package/React/CoreModules/RCTRedBox2Controller.mm +764 -0
- package/React/CoreModules/RCTRedBox2ErrorParser+Internal.h +46 -0
- package/React/CoreModules/RCTRedBox2ErrorParser.mm +57 -0
- package/React/CoreModules/RCTRedBoxController+Internal.h +31 -0
- package/React/CoreModules/RCTRedBoxController.mm +447 -0
- package/React/CoreModules/RCTRedBoxHMRClient+Internal.h +26 -0
- package/React/CoreModules/RCTRedBoxHMRClient.mm +125 -0
- package/React/CoreModules/React-CoreModules.podspec +1 -0
- package/React/DevSupport/RCTFrameTimingsObserver.h +24 -0
- package/React/DevSupport/RCTFrameTimingsObserver.mm +298 -0
- package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +40 -0
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +35 -15
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/hermes-engine/build.gradle.kts +17 -0
- package/ReactAndroid/publish.gradle +20 -46
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/InspectorFlags.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/FrameTimingSequence.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/FrameTimingsObserver.kt +127 -26
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +31 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +51 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +11 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +11 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +56 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +11 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/tracing/PerformanceTracer.kt +39 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt +50 -10
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +14 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +14 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewHelper.kt +46 -6
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.kt +5 -0
- package/ReactAndroid/src/main/jni/CMakeLists.txt +7 -0
- package/ReactAndroid/src/main/jni/react/devsupport/JInspectorFlags.cpp +22 -0
- package/ReactAndroid/src/main/jni/react/devsupport/JInspectorFlags.h +2 -0
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +71 -1
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +16 -1
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactHostInspectorTarget.cpp +14 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactHostInspectorTarget.h +18 -4
- package/ReactCommon/React-Fabric.podspec +6 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +3 -3
- package/ReactCommon/jsinspector-modern/HostAgent.cpp +36 -0
- package/ReactCommon/jsinspector-modern/HostTarget.cpp +7 -1
- package/ReactCommon/jsinspector-modern/HostTarget.h +25 -0
- package/ReactCommon/jsinspector-modern/HostTargetTracing.cpp +1 -1
- package/ReactCommon/jsinspector-modern/HostTargetTracing.h +4 -4
- package/ReactCommon/jsinspector-modern/InspectorFlags.cpp +12 -0
- package/ReactCommon/jsinspector-modern/InspectorFlags.h +12 -0
- package/ReactCommon/jsinspector-modern/NetworkIOAgent.cpp +1 -1
- package/ReactCommon/jsinspector-modern/RuntimeAgent.cpp +19 -0
- package/ReactCommon/jsinspector-modern/RuntimeAgent.h +7 -0
- package/ReactCommon/jsinspector-modern/RuntimeTarget.cpp +33 -0
- package/ReactCommon/jsinspector-modern/RuntimeTarget.h +6 -0
- package/ReactCommon/jsinspector-modern/tests/HostTargetTest.cpp +12 -0
- package/ReactCommon/jsinspector-modern/tests/InspectorMocks.h +3 -2
- package/ReactCommon/jsinspector-modern/tests/JsiIntegrationTest.cpp +1 -0
- package/ReactCommon/jsinspector-modern/tests/NetworkReporterTest.cpp +1 -1
- package/ReactCommon/jsinspector-modern/tests/TracingTest.cpp +1 -1
- package/ReactCommon/jsinspector-modern/tests/utils/InspectorFlagOverridesGuard.cpp +10 -0
- package/ReactCommon/jsinspector-modern/tests/utils/InspectorFlagOverridesGuard.h +3 -1
- package/ReactCommon/jsinspector-modern/tracing/CMakeLists.txt +1 -0
- package/ReactCommon/jsinspector-modern/tracing/FrameTimingSequence.h +7 -3
- package/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.cpp +52 -29
- package/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.h +6 -6
- package/ReactCommon/jsinspector-modern/tracing/PerformanceTracerSection.h +113 -0
- package/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec +1 -0
- package/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.cpp +12 -5
- package/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.h +3 -1
- package/ReactCommon/jsinspector-modern/tracing/TraceEventSerializer.cpp +42 -0
- package/ReactCommon/jsinspector-modern/tracing/TraceEventSerializer.h +7 -0
- package/ReactCommon/react/debug/CMakeLists.txt +2 -1
- package/ReactCommon/react/debug/React-debug.podspec +7 -1
- package/ReactCommon/react/debug/redbox/AnsiParser.cpp +139 -0
- package/ReactCommon/react/debug/redbox/AnsiParser.h +35 -0
- package/ReactCommon/react/debug/redbox/JscSafeUrl.cpp +179 -0
- package/ReactCommon/react/debug/redbox/JscSafeUrl.h +27 -0
- package/ReactCommon/react/debug/redbox/RedBoxErrorParser.cpp +171 -0
- package/ReactCommon/react/debug/redbox/RedBoxErrorParser.h +40 -0
- package/ReactCommon/react/debug/redbox/tests/AnsiParserTest.cpp +97 -0
- package/ReactCommon/react/debug/redbox/tests/JscSafeUrlTest.cpp +173 -0
- package/ReactCommon/react/debug/redbox/tests/RedBoxErrorParserTest.cpp +107 -0
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +21 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +26 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +135 -45
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +12 -2
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +21 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +46 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +6 -1
- package/ReactCommon/react/nativemodule/defaults/CMakeLists.txt +1 -0
- package/ReactCommon/react/nativemodule/defaults/DefaultTurboModules.cpp +7 -0
- package/ReactCommon/react/nativemodule/defaults/React-defaultsnativemodule.podspec +1 -0
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +26 -1
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +11 -1
- package/ReactCommon/react/nativemodule/mutationobserver/NativeMutationObserver.h +4 -0
- package/ReactCommon/react/nativemodule/mutationobserver/React-mutationobservernativemodule.podspec +66 -0
- package/ReactCommon/react/performance/timeline/PerformanceObserver.cpp +18 -6
- package/ReactCommon/react/performance/timeline/PerformanceObserver.h +2 -0
- package/ReactCommon/react/renderer/components/view/BaseViewProps.cpp +7 -0
- package/ReactCommon/react/renderer/components/view/BaseViewProps.h +1 -0
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp +18 -0
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.h +1 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +115 -0
- package/ReactCommon/{jsinspector-modern → react/utils}/Base64.h +2 -2
- package/package.json +11 -11
- package/scripts/cocoapods/utils.rb +1 -0
- package/scripts/react_native_pods.rb +1 -0
- package/scripts/replace-rncore-version.js +72 -15
- package/src/private/featureflags/ReactNativeFeatureFlags.js +26 -1
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +6 -1
- package/src/private/setup/setUpDefaultReactNativeEnvironment.js +6 -0
- package/types/public/ReactNativeTVTypes.d.ts +9 -0
|
@@ -515,7 +515,7 @@ export interface ScrollViewPropsIOS {
|
|
|
515
515
|
* - `start` (the default) will align the snap at the left (horizontal) or top (vertical)
|
|
516
516
|
* - `center` will align the snap in the center
|
|
517
517
|
* - `end` will align the snap at the right (horizontal) or bottom (vertical)
|
|
518
|
-
* - `item` will align the snap according to
|
|
518
|
+
* - `item` will align the snap according to each item's own `scrollSnapAlign` or `scrollSnapOffset` prop (TV platforms only).
|
|
519
519
|
*/
|
|
520
520
|
snapToAlignment?: 'start' | 'center' | 'end' | 'item' | undefined;
|
|
521
521
|
|
|
@@ -620,7 +620,7 @@ type ScrollViewBaseProps = Readonly<{
|
|
|
620
620
|
* - `'start'` (the default) will align the snap at the left (horizontal) or top (vertical)
|
|
621
621
|
* - `'center'` will align the snap in the center
|
|
622
622
|
* - `'end'` will align the snap at the right (horizontal) or bottom (vertical)
|
|
623
|
-
* - `'item'` will align the snap according to
|
|
623
|
+
* - `'item'` will align the snap according to each item's own `scrollSnapAlign` or `scrollSnapOffset` prop (TV platforms only).
|
|
624
624
|
*/
|
|
625
625
|
snapToAlignment?: ?('start' | 'center' | 'end' | 'item'),
|
|
626
626
|
/**
|
|
@@ -131,4 +131,13 @@ export type TVViewProps = $ReadOnly<{|
|
|
|
131
131
|
*/
|
|
132
132
|
scrollSnapAlign?: ?('start' | 'center' | 'end'),
|
|
133
133
|
|
|
134
|
+
/**
|
|
135
|
+
* Per-item scroll snap offset in dp/pt. When set on a View inside a
|
|
136
|
+
* ScrollView with `snapToAlignment="item"`, the focus engine lands the
|
|
137
|
+
* View's top at viewport y = scrollSnapOffset. Standalone alternative to
|
|
138
|
+
* `scrollSnapAlign` — set one or the other; if both are set on the same
|
|
139
|
+
* View, `scrollSnapOffset` takes precedence.
|
|
140
|
+
*/
|
|
141
|
+
scrollSnapOffset?: ?number,
|
|
142
|
+
|
|
134
143
|
|}>;
|
|
@@ -153,9 +153,13 @@ component View(
|
|
|
153
153
|
delete processedProps.isTVSelectable;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
// Views with scrollSnapAlign must not be flattened by
|
|
157
|
-
// the prop never reaches the native view and scroll
|
|
158
|
-
|
|
156
|
+
// Views with scrollSnapAlign or scrollSnapOffset must not be flattened by
|
|
157
|
+
// Fabric, otherwise the prop never reaches the native view and scroll
|
|
158
|
+
// snapping breaks.
|
|
159
|
+
if (
|
|
160
|
+
processedProps.scrollSnapAlign != null ||
|
|
161
|
+
processedProps.scrollSnapOffset != null
|
|
162
|
+
) {
|
|
159
163
|
processedProps.collapsable = false;
|
|
160
164
|
}
|
|
161
165
|
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
export default class ReactNativeVersion {
|
|
29
29
|
static major: number = 0;
|
|
30
30
|
static minor: number = 85;
|
|
31
|
-
static patch: number =
|
|
32
|
-
static prerelease: string | null = '
|
|
31
|
+
static patch: number = 3;
|
|
32
|
+
static prerelease: string | null = '1';
|
|
33
33
|
|
|
34
34
|
static getVersionString(): string {
|
|
35
35
|
return `${this.major}.${this.minor}.${this.patch}${this.prerelease != null ? `-${this.prerelease}` : ''}`;
|
|
@@ -212,6 +212,7 @@ Error: ${e.message}`;
|
|
|
212
212
|
});
|
|
213
213
|
|
|
214
214
|
let pendingUpdatesCount = 0;
|
|
215
|
+
let lastMarkerChangeId: string | null = null;
|
|
215
216
|
client.on('update-start', ({isInitialUpdate}) => {
|
|
216
217
|
pendingUpdatesCount++;
|
|
217
218
|
currentCompileErrorMessage = null;
|
|
@@ -229,10 +230,15 @@ Error: ${e.message}`;
|
|
|
229
230
|
}
|
|
230
231
|
});
|
|
231
232
|
|
|
232
|
-
client.on('update-done',
|
|
233
|
+
client.on('update-done', body => {
|
|
233
234
|
pendingUpdatesCount--;
|
|
234
235
|
if (pendingUpdatesCount === 0) {
|
|
235
236
|
DevLoadingView.hide();
|
|
237
|
+
const changeId = body?.changeId;
|
|
238
|
+
if (changeId != null && changeId !== lastMarkerChangeId) {
|
|
239
|
+
lastMarkerChangeId = changeId;
|
|
240
|
+
emitFastRefreshCompleteEvents();
|
|
241
|
+
}
|
|
236
242
|
}
|
|
237
243
|
});
|
|
238
244
|
|
|
@@ -379,4 +385,25 @@ function showCompileError() {
|
|
|
379
385
|
throw error;
|
|
380
386
|
}
|
|
381
387
|
|
|
388
|
+
function emitFastRefreshCompleteEvents() {
|
|
389
|
+
// Add marker entry in performance timeline
|
|
390
|
+
performance.mark('Fast Refresh - Update done', {
|
|
391
|
+
detail: {
|
|
392
|
+
devtools: {
|
|
393
|
+
dataType: 'marker',
|
|
394
|
+
color: 'primary',
|
|
395
|
+
tooltipText: 'Fast Refresh \u269b',
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
// Notify CDP clients via internal binding
|
|
401
|
+
if (
|
|
402
|
+
// $FlowFixMe[prop-missing] - Injected by RuntimeTarget
|
|
403
|
+
typeof globalThis.__notifyFastRefreshComplete === 'function'
|
|
404
|
+
) {
|
|
405
|
+
globalThis.__notifyFastRefreshComplete();
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
382
409
|
export default HMRClient;
|
package/README.md
CHANGED
|
@@ -272,6 +272,7 @@ class Game2048 extends React.Component {
|
|
|
272
272
|
| Prop (View) | Value | Description |
|
|
273
273
|
|---|---|---|
|
|
274
274
|
| scrollSnapAlign | `'start'` \| `'center'` \| `'end'` | Controls where this item snaps inside its parent ScrollView. Only used when the parent has `snapToAlignment="item"`. |
|
|
275
|
+
| scrollSnapOffset | `number` | Per-item pixel offset (in dp/pt). When set, the focus engine lands this item's leading edge at `scrollSnapOffset` from the viewport origin. Standalone alternative to `scrollSnapAlign` — takes precedence if both are set on the same item. Only used when the parent has `snapToAlignment="item"`. |
|
|
275
276
|
|
|
276
277
|
```jsx
|
|
277
278
|
<ScrollView
|
|
@@ -291,6 +292,16 @@ class Game2048 extends React.Component {
|
|
|
291
292
|
</ScrollView>
|
|
292
293
|
```
|
|
293
294
|
|
|
295
|
+
`scrollSnapOffset` is useful when different items in the same ScrollView need to land at different positions — e.g. a hero row peeking 27dp from the top while poster rows peek 550dp:
|
|
296
|
+
|
|
297
|
+
```jsx
|
|
298
|
+
<ScrollView snapToAlignment="item">
|
|
299
|
+
<View scrollSnapOffset={27}><Hero /></View>
|
|
300
|
+
<View scrollSnapOffset={100}><Featured /></View>
|
|
301
|
+
<View scrollSnapOffset={550}><PosterRow /></View>
|
|
302
|
+
</ScrollView>
|
|
303
|
+
```
|
|
304
|
+
|
|
294
305
|
- _ScrollView animation control_: The `scrollAnimationEnabled` prop allows disabling scroll animations when focus changes on TV. When set to `false`, the scroll view jumps instantly to the focused item instead of animating. This only affects TV platforms and has no effect on mobile.
|
|
295
306
|
|
|
296
307
|
| Prop (ScrollView) | Value | Description |
|
|
@@ -307,7 +318,8 @@ class Game2048 extends React.Component {
|
|
|
307
318
|
|
|
308
319
|
- _Interaction with existing ScrollView props_: The TV scroll props build on top of existing React Native ScrollView behavior. Here is how they interact:
|
|
309
320
|
|
|
310
|
-
- `snapToAlignment="item"` does not require `snapToInterval` to be set. It works as a standalone snapping mode where each child's `scrollSnapAlign` determines the snap position. If `snapToInterval` is also set, the interval is applied as an additional constraint after the item offset is computed.
|
|
321
|
+
- `snapToAlignment="item"` does not require `snapToInterval` to be set. It works as a standalone snapping mode where each child's `scrollSnapAlign` or `scrollSnapOffset` determines the snap position. If `snapToInterval` is also set, the interval is applied as an additional constraint after the item offset is computed.
|
|
322
|
+
- `scrollSnapOffset` ignores `snapToItemPadding`. The padding is a global value applied to `scrollSnapAlign` cases; `scrollSnapOffset` is itself a per-item pixel offset that fully specifies where the item lands.
|
|
311
323
|
- `snapToAlignment="item"` should not be combined with `pagingEnabled`. Both attempt to control scroll positioning independently, which leads to unpredictable behavior. Use one or the other.
|
|
312
324
|
- `snapToStart` and `snapToEnd` work independently of `snapToAlignment="item"`. They control edge behavior during swipe/drag momentum (whether the scroll view snaps to the first or last position), but do not affect focus driven item snapping.
|
|
313
325
|
- `scrollAnimationEnabled={false}` disables all scroll animations, including programmatic `scrollTo({animated: true})` calls. When disabled, all scrolling is instant.
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -23,8 +23,8 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
|
|
23
23
|
__rnVersion = @{
|
|
24
24
|
RCTVersionMajor: @(0),
|
|
25
25
|
RCTVersionMinor: @(85),
|
|
26
|
-
RCTVersionPatch: @(
|
|
27
|
-
RCTVersionPrerelease: @"
|
|
26
|
+
RCTVersionPatch: @(3),
|
|
27
|
+
RCTVersionPrerelease: @"1",
|
|
28
28
|
};
|
|
29
29
|
});
|
|
30
30
|
return __rnVersion;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Converts between standard URLs and JSC-safe URLs.
|
|
12
|
+
*
|
|
13
|
+
* JSC (JavaScriptCore) strips query strings from source URLs in stack traces
|
|
14
|
+
* as of iOS 16.4. Metro works around this by encoding the query string into
|
|
15
|
+
* the URL path. These methods convert between the two formats.
|
|
16
|
+
*/
|
|
17
|
+
@interface RCTJscSafeUrl : NSObject
|
|
18
|
+
|
|
19
|
+
+ (nonnull NSString *)normalUrlFromJscSafeUrl:(nonnull NSString *)url;
|
|
20
|
+
+ (nonnull NSString *)jscSafeUrlFromNormalUrl:(nonnull NSString *)url;
|
|
21
|
+
+ (BOOL)isJscSafeUrl:(nonnull NSString *)url;
|
|
22
|
+
|
|
23
|
+
@end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import "RCTJscSafeUrl+Internal.h"
|
|
9
|
+
|
|
10
|
+
#import <React/RCTDefines.h>
|
|
11
|
+
#import <react/debug/redbox/JscSafeUrl.h>
|
|
12
|
+
|
|
13
|
+
#if RCT_DEV_MENU
|
|
14
|
+
|
|
15
|
+
using facebook::react::unstable_redbox::isJscSafeUrl;
|
|
16
|
+
using facebook::react::unstable_redbox::toJscSafeUrl;
|
|
17
|
+
using facebook::react::unstable_redbox::toNormalUrl;
|
|
18
|
+
|
|
19
|
+
@implementation RCTJscSafeUrl
|
|
20
|
+
|
|
21
|
+
+ (NSString *)normalUrlFromJscSafeUrl:(NSString *)url
|
|
22
|
+
{
|
|
23
|
+
return [NSString stringWithUTF8String:toNormalUrl(url.UTF8String).c_str()];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
+ (NSString *)jscSafeUrlFromNormalUrl:(NSString *)url
|
|
27
|
+
{
|
|
28
|
+
return [NSString stringWithUTF8String:toJscSafeUrl(url.UTF8String).c_str()];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
+ (BOOL)isJscSafeUrl:(NSString *)url
|
|
32
|
+
{
|
|
33
|
+
return isJscSafeUrl(url.UTF8String);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@end
|
|
37
|
+
|
|
38
|
+
#endif
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <React/RCTDefines.h>
|
|
9
|
+
#import <UIKit/UIKit.h>
|
|
10
|
+
|
|
11
|
+
#if RCT_DEV_MENU
|
|
12
|
+
|
|
13
|
+
@class RCTJSStackFrame;
|
|
14
|
+
|
|
15
|
+
@protocol RCTRedBoxControllerActionDelegate <NSObject>
|
|
16
|
+
|
|
17
|
+
- (void)redBoxController:(UIViewController *)redBoxController openStackFrameInEditor:(RCTJSStackFrame *)stackFrame;
|
|
18
|
+
- (void)reloadFromRedBoxController:(UIViewController *)redBoxController;
|
|
19
|
+
- (void)loadExtraDataViewController;
|
|
20
|
+
|
|
21
|
+
@end
|
|
22
|
+
|
|
23
|
+
@protocol RCTRedBoxControlling <NSObject>
|
|
24
|
+
|
|
25
|
+
@property (nonatomic, weak) id<RCTRedBoxControllerActionDelegate> actionDelegate;
|
|
26
|
+
|
|
27
|
+
- (void)showErrorMessage:(NSString *)message
|
|
28
|
+
withStack:(NSArray<RCTJSStackFrame *> *)stack
|
|
29
|
+
isUpdate:(BOOL)isUpdate
|
|
30
|
+
errorCookie:(int)errorCookie;
|
|
31
|
+
|
|
32
|
+
- (void)dismiss;
|
|
33
|
+
|
|
34
|
+
@end
|
|
35
|
+
|
|
36
|
+
@protocol RCTRedBox2Controlling <RCTRedBoxControlling>
|
|
37
|
+
|
|
38
|
+
@property (nonatomic, strong, nullable) NSURL *bundleURL;
|
|
39
|
+
|
|
40
|
+
@end
|
|
41
|
+
|
|
42
|
+
#endif
|