react-native-tvos 0.77.1-0 → 0.77.2-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/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Image/Image.android.js +2 -0
- package/Libraries/Image/ImageViewNativeComponent.js +3 -4
- package/React/Base/RCTVersion.m +2 -2
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +1 -7
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/AndroidManifest.xml +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +4 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactFragment.java +6 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DebugOverlayController.java +7 -2
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +8 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/I18nManagerModule.kt +6 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/PermissionsModule.kt +15 -4
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BackgroundStyleApplicator.kt +21 -41
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/BackgroundDrawable.kt +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/BorderDrawable.kt +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/CSSBackgroundDrawable.java +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/CompositeBackgroundDrawable.kt +132 -150
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/Drawable.kt +17 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/LayerDrawable.kt +19 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/OutlineDrawable.kt +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageManager.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +8 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java +10 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +36 -27
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +38 -31
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java +4 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputLocalData.java +13 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputShadowNode.java +12 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactDrawableHelper.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.kt +3 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.mm +9 -0
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +24 -13
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h +24 -3
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +1 -43
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +4 -5
- package/gradle/libs.versions.toml +1 -1
- package/package.json +10 -10
- package/react-native.config.js +11 -21
- package/scripts/codegen/generate-artifacts-executor.js +8 -4
- package/scripts/generate-codegen-artifacts.js +6 -1
- package/sdks/hermesc/osx-bin/hermes +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/sdks/hermesc/win64-bin/msvcp140.dll +0 -0
- package/sdks/hermesc/win64-bin/vcruntime140.dll +0 -0
- package/sdks/hermesc/win64-bin/vcruntime140_1.dll +0 -0
|
@@ -232,7 +232,9 @@ public class ReactEditText extends AppCompatEditText {
|
|
|
232
232
|
public void onDestroyActionMode(ActionMode mode) {}
|
|
233
233
|
};
|
|
234
234
|
setCustomSelectionActionModeCallback(customActionModeCallback);
|
|
235
|
-
|
|
235
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
236
|
+
setCustomInsertionActionModeCallback(customActionModeCallback);
|
|
237
|
+
}
|
|
236
238
|
}
|
|
237
239
|
|
|
238
240
|
@Override
|
|
@@ -753,7 +755,7 @@ public class ReactEditText extends AppCompatEditText {
|
|
|
753
755
|
}
|
|
754
756
|
mDisableTextDiffing = false;
|
|
755
757
|
|
|
756
|
-
if (getBreakStrategy() != reactTextUpdate.getTextBreakStrategy()) {
|
|
758
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && getBreakStrategy() != reactTextUpdate.getTextBreakStrategy()) {
|
|
757
759
|
setBreakStrategy(reactTextUpdate.getTextBreakStrategy());
|
|
758
760
|
}
|
|
759
761
|
|
package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputLocalData.java
CHANGED
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
package com.facebook.react.views.textinput;
|
|
9
9
|
|
|
10
|
+
import android.annotation.TargetApi;
|
|
11
|
+
import android.graphics.text.LineBreaker;
|
|
12
|
+
import android.os.Build;
|
|
13
|
+
import android.text.Layout;
|
|
10
14
|
import android.text.SpannableStringBuilder;
|
|
11
15
|
import android.util.TypedValue;
|
|
12
16
|
import android.widget.EditText;
|
|
@@ -22,6 +26,7 @@ public final class ReactTextInputLocalData {
|
|
|
22
26
|
private final int mBreakStrategy;
|
|
23
27
|
private final CharSequence mPlaceholder;
|
|
24
28
|
|
|
29
|
+
@TargetApi(Build.VERSION_CODES.M)
|
|
25
30
|
public ReactTextInputLocalData(EditText editText) {
|
|
26
31
|
mText = new SpannableStringBuilder(editText.getText());
|
|
27
32
|
mTextSize = editText.getTextSize();
|
|
@@ -29,7 +34,11 @@ public final class ReactTextInputLocalData {
|
|
|
29
34
|
mPlaceholder = editText.getHint();
|
|
30
35
|
mMinLines = editText.getMinLines();
|
|
31
36
|
mMaxLines = editText.getMaxLines();
|
|
32
|
-
|
|
37
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
38
|
+
mBreakStrategy = editText.getBreakStrategy();
|
|
39
|
+
} else {
|
|
40
|
+
mBreakStrategy = Layout.BREAK_STRATEGY_SIMPLE;
|
|
41
|
+
}
|
|
33
42
|
}
|
|
34
43
|
|
|
35
44
|
public void apply(EditText editText) {
|
|
@@ -39,6 +48,8 @@ public final class ReactTextInputLocalData {
|
|
|
39
48
|
editText.setMaxLines(mMaxLines);
|
|
40
49
|
editText.setInputType(mInputType);
|
|
41
50
|
editText.setHint(mPlaceholder);
|
|
42
|
-
|
|
51
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
52
|
+
editText.setBreakStrategy(mBreakStrategy);
|
|
53
|
+
}
|
|
43
54
|
}
|
|
44
55
|
}
|
package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputShadowNode.java
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
package com.facebook.react.views.textinput;
|
|
9
9
|
|
|
10
|
+
import android.annotation.TargetApi;
|
|
11
|
+
import android.os.Build;
|
|
10
12
|
import android.text.Layout;
|
|
11
13
|
import android.util.TypedValue;
|
|
12
14
|
import android.view.ViewGroup;
|
|
@@ -32,6 +34,7 @@ import com.facebook.yoga.YogaMeasureMode;
|
|
|
32
34
|
import com.facebook.yoga.YogaMeasureOutput;
|
|
33
35
|
import com.facebook.yoga.YogaNode;
|
|
34
36
|
|
|
37
|
+
@TargetApi(Build.VERSION_CODES.M)
|
|
35
38
|
@VisibleForTesting
|
|
36
39
|
public class ReactTextInputShadowNode extends ReactBaseTextShadowNode
|
|
37
40
|
implements YogaMeasureFunction {
|
|
@@ -50,7 +53,9 @@ public class ReactTextInputShadowNode extends ReactBaseTextShadowNode
|
|
|
50
53
|
public ReactTextInputShadowNode(
|
|
51
54
|
@Nullable ReactTextViewManagerCallback reactTextViewManagerCallback) {
|
|
52
55
|
super(reactTextViewManagerCallback);
|
|
53
|
-
mTextBreakStrategy =
|
|
56
|
+
mTextBreakStrategy = (Build.VERSION.SDK_INT < Build.VERSION_CODES.M)
|
|
57
|
+
? Layout.BREAK_STRATEGY_SIMPLE
|
|
58
|
+
: Layout.BREAK_STRATEGY_HIGH_QUALITY;
|
|
54
59
|
|
|
55
60
|
initMeasureFunction();
|
|
56
61
|
}
|
|
@@ -112,7 +117,8 @@ public class ReactTextInputShadowNode extends ReactBaseTextShadowNode
|
|
|
112
117
|
editText.setLines(mNumberOfLines);
|
|
113
118
|
}
|
|
114
119
|
|
|
115
|
-
if (
|
|
120
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
|
|
121
|
+
&& editText.getBreakStrategy() != mTextBreakStrategy) {
|
|
116
122
|
editText.setBreakStrategy(mTextBreakStrategy);
|
|
117
123
|
}
|
|
118
124
|
}
|
|
@@ -175,6 +181,10 @@ public class ReactTextInputShadowNode extends ReactBaseTextShadowNode
|
|
|
175
181
|
|
|
176
182
|
@Override
|
|
177
183
|
public void setTextBreakStrategy(@Nullable String textBreakStrategy) {
|
|
184
|
+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
|
|
178
188
|
if (textBreakStrategy == null || "simple".equals(textBreakStrategy)) {
|
|
179
189
|
mTextBreakStrategy = Layout.BREAK_STRATEGY_SIMPLE;
|
|
180
190
|
} else if ("highQuality".equals(textBreakStrategy)) {
|
|
@@ -13,6 +13,7 @@ import android.graphics.Color;
|
|
|
13
13
|
import android.graphics.drawable.ColorDrawable;
|
|
14
14
|
import android.graphics.drawable.Drawable;
|
|
15
15
|
import android.graphics.drawable.RippleDrawable;
|
|
16
|
+
import android.os.Build;
|
|
16
17
|
import android.util.TypedValue;
|
|
17
18
|
import androidx.annotation.Nullable;
|
|
18
19
|
import com.facebook.infer.annotation.Nullsafe;
|
|
@@ -79,7 +80,7 @@ public class ReactDrawableHelper {
|
|
|
79
80
|
|
|
80
81
|
private static @Nullable Drawable setRadius(
|
|
81
82
|
ReadableMap drawableDescriptionDict, @Nullable Drawable drawable) {
|
|
82
|
-
if (drawableDescriptionDict.hasKey("rippleRadius") && drawable instanceof RippleDrawable) {
|
|
83
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && drawableDescriptionDict.hasKey("rippleRadius") && drawable instanceof RippleDrawable) {
|
|
83
84
|
RippleDrawable rippleDrawable = (RippleDrawable) drawable;
|
|
84
85
|
double rippleRadius = drawableDescriptionDict.getDouble("rippleRadius");
|
|
85
86
|
rippleDrawable.setRadius((int) PixelUtil.toPixelFromDIP(rippleRadius));
|
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
package com.facebook.react.views.view
|
|
9
9
|
|
|
10
10
|
import android.accessibilityservice.AccessibilityServiceInfo
|
|
11
|
+
import android.annotation.TargetApi
|
|
11
12
|
import android.content.Context
|
|
12
13
|
import android.content.pm.PackageManager
|
|
13
14
|
import android.graphics.Rect
|
|
15
|
+
import android.os.Build
|
|
14
16
|
import android.view.View
|
|
15
17
|
import android.view.ViewGroup
|
|
16
18
|
import android.view.accessibility.AccessibilityManager
|
|
@@ -281,6 +283,7 @@ public open class ReactViewManager : ReactClippingViewManager<ReactViewGroup>()
|
|
|
281
283
|
BackgroundStyleApplicator.setFeedbackUnderlay(view, bg)
|
|
282
284
|
}
|
|
283
285
|
|
|
286
|
+
@TargetApi(Build.VERSION_CODES.M)
|
|
284
287
|
@ReactProp(name = "nativeForegroundAndroid")
|
|
285
288
|
public open fun setNativeForeground(view: ReactViewGroup, foreground: ReadableMap?) {
|
|
286
289
|
view.foreground =
|
|
@@ -17,8 +17,8 @@ namespace facebook::react {
|
|
|
17
17
|
constexpr struct {
|
|
18
18
|
int32_t Major = 0;
|
|
19
19
|
int32_t Minor = 77;
|
|
20
|
-
int32_t Patch =
|
|
21
|
-
std::string_view Prerelease = "
|
|
20
|
+
int32_t Patch = 2;
|
|
21
|
+
std::string_view Prerelease = "1";
|
|
22
22
|
} ReactNativeVersion;
|
|
23
23
|
|
|
24
24
|
} // namespace facebook::react
|
package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.mm
CHANGED
|
@@ -446,6 +446,15 @@ void ObjCInteropTurboModule::setInvocationArg(
|
|
|
446
446
|
|
|
447
447
|
if (objCArgType == @encode(id)) {
|
|
448
448
|
id arg = RCTConvertTo<id>(selector, objCArg);
|
|
449
|
+
|
|
450
|
+
// Handle the special case where there is an argument and it must be nil
|
|
451
|
+
// Without this check, the JS side will receive an object.
|
|
452
|
+
// See: discussion at
|
|
453
|
+
// https://github.com/facebook/react-native/pull/49250#issuecomment-2668465893
|
|
454
|
+
if (arg == [NSNull null]) {
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
|
|
449
458
|
if (arg) {
|
|
450
459
|
[retainedObjectsForInvocation addObject:arg];
|
|
451
460
|
}
|
|
@@ -57,7 +57,7 @@ static jsi::Value convertNSNumberToJSINumber(jsi::Runtime &runtime, NSNumber *va
|
|
|
57
57
|
|
|
58
58
|
static jsi::String convertNSStringToJSIString(jsi::Runtime &runtime, NSString *value)
|
|
59
59
|
{
|
|
60
|
-
return jsi::String::createFromUtf8(runtime, [value UTF8String]
|
|
60
|
+
return jsi::String::createFromUtf8(runtime, [value UTF8String] ? [value UTF8String] : "");
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
static jsi::Object convertNSDictionaryToJSIObject(jsi::Runtime &runtime, NSDictionary *value)
|
|
@@ -213,7 +213,11 @@ static jsi::Value createJSRuntimeError(jsi::Runtime &runtime, const std::string
|
|
|
213
213
|
/**
|
|
214
214
|
* Creates JSError with current JS runtime and NSException stack trace.
|
|
215
215
|
*/
|
|
216
|
-
static jsi::JSError convertNSExceptionToJSError(
|
|
216
|
+
static jsi::JSError convertNSExceptionToJSError(
|
|
217
|
+
jsi::Runtime &runtime,
|
|
218
|
+
NSException *exception,
|
|
219
|
+
const std::string &moduleName,
|
|
220
|
+
const std::string &methodName)
|
|
217
221
|
{
|
|
218
222
|
std::string reason = [exception.reason UTF8String];
|
|
219
223
|
|
|
@@ -224,7 +228,8 @@ static jsi::JSError convertNSExceptionToJSError(jsi::Runtime &runtime, NSExcepti
|
|
|
224
228
|
cause.setProperty(
|
|
225
229
|
runtime, "stackReturnAddresses", convertNSArrayToJSIArray(runtime, exception.callStackReturnAddresses));
|
|
226
230
|
|
|
227
|
-
|
|
231
|
+
std::string message = moduleName + "." + methodName + " raised an exception: " + reason;
|
|
232
|
+
jsi::Value error = createJSRuntimeError(runtime, message);
|
|
228
233
|
error.asObject(runtime).setProperty(runtime, "cause", std::move(cause));
|
|
229
234
|
return {runtime, std::move(error)};
|
|
230
235
|
}
|
|
@@ -356,28 +361,34 @@ id ObjCTurboModule::performMethodInvocation(
|
|
|
356
361
|
}
|
|
357
362
|
|
|
358
363
|
if (isSync) {
|
|
359
|
-
TurboModulePerfLogger::syncMethodCallExecutionStart(moduleName,
|
|
364
|
+
TurboModulePerfLogger::syncMethodCallExecutionStart(moduleName, methodName);
|
|
360
365
|
} else {
|
|
361
|
-
TurboModulePerfLogger::asyncMethodCallExecutionStart(moduleName,
|
|
366
|
+
TurboModulePerfLogger::asyncMethodCallExecutionStart(moduleName, methodName, asyncCallCounter);
|
|
362
367
|
}
|
|
363
368
|
|
|
364
369
|
@try {
|
|
365
370
|
[inv invokeWithTarget:strongModule];
|
|
366
371
|
} @catch (NSException *exception) {
|
|
367
|
-
|
|
372
|
+
if (isSync) {
|
|
373
|
+
// We can only convert NSException to JSError in sync method calls.
|
|
374
|
+
// See https://github.com/reactwg/react-native-new-architecture/discussions/276#discussioncomment-12567155
|
|
375
|
+
throw convertNSExceptionToJSError(runtime, exception, std::string{moduleName}, methodNameStr);
|
|
376
|
+
} else {
|
|
377
|
+
@throw exception;
|
|
378
|
+
}
|
|
368
379
|
} @finally {
|
|
369
380
|
[retainedObjectsForInvocation removeAllObjects];
|
|
370
381
|
}
|
|
371
382
|
|
|
372
383
|
if (!isSync) {
|
|
373
|
-
TurboModulePerfLogger::asyncMethodCallExecutionEnd(moduleName,
|
|
384
|
+
TurboModulePerfLogger::asyncMethodCallExecutionEnd(moduleName, methodName, asyncCallCounter);
|
|
374
385
|
return;
|
|
375
386
|
}
|
|
376
387
|
|
|
377
388
|
void *rawResult;
|
|
378
389
|
[inv getReturnValue:&rawResult];
|
|
379
390
|
result = (__bridge id)rawResult;
|
|
380
|
-
TurboModulePerfLogger::syncMethodCallExecutionEnd(moduleName,
|
|
391
|
+
TurboModulePerfLogger::syncMethodCallExecutionEnd(moduleName, methodName);
|
|
381
392
|
};
|
|
382
393
|
|
|
383
394
|
if (isSync) {
|
|
@@ -419,23 +430,23 @@ void ObjCTurboModule::performVoidMethodInvocation(
|
|
|
419
430
|
}
|
|
420
431
|
|
|
421
432
|
if (shouldVoidMethodsExecuteSync_) {
|
|
422
|
-
TurboModulePerfLogger::syncMethodCallExecutionStart(moduleName,
|
|
433
|
+
TurboModulePerfLogger::syncMethodCallExecutionStart(moduleName, methodName);
|
|
423
434
|
} else {
|
|
424
|
-
TurboModulePerfLogger::asyncMethodCallExecutionStart(moduleName,
|
|
435
|
+
TurboModulePerfLogger::asyncMethodCallExecutionStart(moduleName, methodName, asyncCallCounter);
|
|
425
436
|
}
|
|
426
437
|
|
|
427
438
|
@try {
|
|
428
439
|
[inv invokeWithTarget:strongModule];
|
|
429
440
|
} @catch (NSException *exception) {
|
|
430
|
-
throw convertNSExceptionToJSError(runtime, exception);
|
|
441
|
+
throw convertNSExceptionToJSError(runtime, exception, std::string{moduleName}, methodNameStr);
|
|
431
442
|
} @finally {
|
|
432
443
|
[retainedObjectsForInvocation removeAllObjects];
|
|
433
444
|
}
|
|
434
445
|
|
|
435
446
|
if (shouldVoidMethodsExecuteSync_) {
|
|
436
|
-
TurboModulePerfLogger::syncMethodCallExecutionEnd(moduleName,
|
|
447
|
+
TurboModulePerfLogger::syncMethodCallExecutionEnd(moduleName, methodName);
|
|
437
448
|
} else {
|
|
438
|
-
TurboModulePerfLogger::asyncMethodCallExecutionEnd(moduleName,
|
|
449
|
+
TurboModulePerfLogger::asyncMethodCallExecutionEnd(moduleName, methodName, asyncCallCounter);
|
|
439
450
|
}
|
|
440
451
|
|
|
441
452
|
return;
|
|
@@ -52,8 +52,29 @@ BOOL RCTIsAttributedStringEffectivelySame(
|
|
|
52
52
|
NSDictionary<NSAttributedStringKey, id> *insensitiveAttributes,
|
|
53
53
|
const facebook::react::TextAttributes &baseTextAttributes);
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
static inline NSData *RCTWrapEventEmitter(const facebook::react::SharedEventEmitter &eventEmitter)
|
|
56
|
+
{
|
|
57
|
+
auto eventEmitterPtr = new std::weak_ptr<const facebook::react::EventEmitter>(eventEmitter);
|
|
58
|
+
return [[NSData alloc] initWithBytesNoCopy:eventEmitterPtr
|
|
59
|
+
length:sizeof(eventEmitterPtr)
|
|
60
|
+
deallocator:^(void *ptrToDelete, NSUInteger) {
|
|
61
|
+
delete (std::weak_ptr<facebook::react::EventEmitter> *)ptrToDelete;
|
|
62
|
+
}];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
static inline facebook::react::SharedEventEmitter RCTUnwrapEventEmitter(NSData *data)
|
|
66
|
+
{
|
|
67
|
+
if (data.length == 0) {
|
|
68
|
+
return nullptr;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
auto weakPtr = dynamic_cast<std::weak_ptr<const facebook::react::EventEmitter> *>(
|
|
72
|
+
(std::weak_ptr<const facebook::react::EventEmitter> *)data.bytes);
|
|
73
|
+
if (weakPtr) {
|
|
74
|
+
return weakPtr->lock();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return nullptr;
|
|
78
|
+
}
|
|
58
79
|
|
|
59
80
|
NS_ASSUME_NONNULL_END
|
|
@@ -16,45 +16,6 @@
|
|
|
16
16
|
|
|
17
17
|
using namespace facebook::react;
|
|
18
18
|
|
|
19
|
-
@implementation RCTWeakEventEmitterWrapper {
|
|
20
|
-
std::weak_ptr<const EventEmitter> _weakEventEmitter;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
- (void)setEventEmitter:(SharedEventEmitter)eventEmitter
|
|
24
|
-
{
|
|
25
|
-
_weakEventEmitter = eventEmitter;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
- (SharedEventEmitter)eventEmitter
|
|
29
|
-
{
|
|
30
|
-
return _weakEventEmitter.lock();
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
- (void)dealloc
|
|
34
|
-
{
|
|
35
|
-
_weakEventEmitter.reset();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
- (BOOL)isEqual:(id)object
|
|
39
|
-
{
|
|
40
|
-
// We consider the underlying EventEmitter as the identity
|
|
41
|
-
if (![object isKindOfClass:[self class]]) {
|
|
42
|
-
return NO;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
auto thisEventEmitter = [self eventEmitter];
|
|
46
|
-
auto otherEventEmitter = [((RCTWeakEventEmitterWrapper *)object) eventEmitter];
|
|
47
|
-
return thisEventEmitter == otherEventEmitter;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
- (NSUInteger)hash
|
|
51
|
-
{
|
|
52
|
-
// We consider the underlying EventEmitter as the identity
|
|
53
|
-
return (NSUInteger)_weakEventEmitter.lock().get();
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
@end
|
|
57
|
-
|
|
58
19
|
inline static UIFontWeight RCTUIFontWeightFromInteger(NSInteger fontWeight)
|
|
59
20
|
{
|
|
60
21
|
assert(fontWeight > 50);
|
|
@@ -409,10 +370,8 @@ static NSMutableAttributedString *RCTNSAttributedStringFragmentWithAttributesFro
|
|
|
409
370
|
{
|
|
410
371
|
auto nsAttributedStringFragment = RCTNSAttributedStringFragmentFromFragment(fragment, placeholderImage);
|
|
411
372
|
|
|
412
|
-
#if !TARGET_OS_MACCATALYST
|
|
413
373
|
if (fragment.parentShadowView.componentHandle) {
|
|
414
|
-
|
|
415
|
-
eventEmitterWrapper.eventEmitter = fragment.parentShadowView.eventEmitter;
|
|
374
|
+
auto eventEmitterWrapper = RCTWrapEventEmitter(fragment.parentShadowView.eventEmitter);
|
|
416
375
|
|
|
417
376
|
NSDictionary<NSAttributedStringKey, id> *additionalTextAttributes =
|
|
418
377
|
@{RCTAttributedStringEventEmitterKey : eventEmitterWrapper};
|
|
@@ -420,7 +379,6 @@ static NSMutableAttributedString *RCTNSAttributedStringFragmentWithAttributesFro
|
|
|
420
379
|
[nsAttributedStringFragment addAttributes:additionalTextAttributes
|
|
421
380
|
range:NSMakeRange(0, nsAttributedStringFragment.length)];
|
|
422
381
|
}
|
|
423
|
-
#endif
|
|
424
382
|
|
|
425
383
|
return nsAttributedStringFragment;
|
|
426
384
|
}
|
|
@@ -280,11 +280,10 @@ static NSLineBreakMode RCTNSLineBreakModeFromEllipsizeMode(EllipsizeMode ellipsi
|
|
|
280
280
|
// after (fraction == 1.0) the last character, then the attribute is valid.
|
|
281
281
|
if (textStorage.length > 0 && (fraction > 0 || characterIndex > 0) &&
|
|
282
282
|
(fraction < 1 || characterIndex < textStorage.length - 1)) {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
return eventEmitterWrapper.eventEmitter;
|
|
283
|
+
NSData *eventEmitterWrapper = (NSData *)[textStorage attribute:RCTAttributedStringEventEmitterKey
|
|
284
|
+
atIndex:characterIndex
|
|
285
|
+
effectiveRange:NULL];
|
|
286
|
+
return RCTUnwrapEventEmitter(eventEmitterWrapper);
|
|
288
287
|
}
|
|
289
288
|
|
|
290
289
|
return nil;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-tvos",
|
|
3
|
-
"version": "0.77.1
|
|
3
|
+
"version": "0.77.2-1",
|
|
4
4
|
"description": "A framework for building native apps using React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -112,13 +112,13 @@
|
|
|
112
112
|
},
|
|
113
113
|
"dependencies": {
|
|
114
114
|
"@jest/create-cache-key-function": "^29.6.3",
|
|
115
|
-
"@react-native/assets-registry": "0.77.
|
|
116
|
-
"@react-native/codegen": "0.77.
|
|
117
|
-
"@react-native/community-cli-plugin": "0.77.
|
|
118
|
-
"@react-native/gradle-plugin": "0.77.
|
|
119
|
-
"@react-native/js-polyfills": "0.77.
|
|
120
|
-
"@react-native/normalize-colors": "0.77.
|
|
121
|
-
"@react-native-tvos/virtualized-lists": "0.77.1
|
|
115
|
+
"@react-native/assets-registry": "0.77.2",
|
|
116
|
+
"@react-native/codegen": "0.77.2",
|
|
117
|
+
"@react-native/community-cli-plugin": "0.77.2",
|
|
118
|
+
"@react-native/gradle-plugin": "0.77.2",
|
|
119
|
+
"@react-native/js-polyfills": "0.77.2",
|
|
120
|
+
"@react-native/normalize-colors": "0.77.2",
|
|
121
|
+
"@react-native-tvos/virtualized-lists": "0.77.2-1",
|
|
122
122
|
"abort-controller": "^3.0.0",
|
|
123
123
|
"anser": "^1.4.9",
|
|
124
124
|
"ansi-regex": "^5.0.0",
|
|
@@ -134,8 +134,8 @@
|
|
|
134
134
|
"jest-environment-node": "^29.6.3",
|
|
135
135
|
"jsc-android": "^250231.0.0",
|
|
136
136
|
"memoize-one": "^5.0.0",
|
|
137
|
-
"metro-runtime": "^0.81.
|
|
138
|
-
"metro-source-map": "^0.81.
|
|
137
|
+
"metro-runtime": "^0.81.3",
|
|
138
|
+
"metro-source-map": "^0.81.3",
|
|
139
139
|
"nullthrows": "^1.1.1",
|
|
140
140
|
"pretty-format": "^29.7.0",
|
|
141
141
|
"promise": "^8.3.0",
|
package/react-native.config.js
CHANGED
|
@@ -44,27 +44,11 @@ try {
|
|
|
44
44
|
|
|
45
45
|
const commands = [];
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
commands.push(bundleCommand, startCommand);
|
|
53
|
-
} catch (e) {
|
|
54
|
-
const known =
|
|
55
|
-
e.code === 'MODULE_NOT_FOUND' &&
|
|
56
|
-
e.message.includes('@react-native-community/cli-server-api');
|
|
57
|
-
|
|
58
|
-
if (!known) {
|
|
59
|
-
throw e;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (verbose) {
|
|
63
|
-
console.warn(
|
|
64
|
-
'@react-native-community/cli-server-api not found, the react-native.config.js may be unusable.',
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
47
|
+
const {
|
|
48
|
+
bundleCommand,
|
|
49
|
+
startCommand,
|
|
50
|
+
} = require('@react-native/community-cli-plugin');
|
|
51
|
+
commands.push(bundleCommand, startCommand);
|
|
68
52
|
|
|
69
53
|
const codegenCommand = {
|
|
70
54
|
name: 'codegen',
|
|
@@ -84,12 +68,18 @@ const codegenCommand = {
|
|
|
84
68
|
name: '--outputPath <path>',
|
|
85
69
|
description: 'Path where generated artifacts will be output to.',
|
|
86
70
|
},
|
|
71
|
+
{
|
|
72
|
+
name: '--source <string>',
|
|
73
|
+
description: 'Whether the script is invoked from an `app` or a `library`',
|
|
74
|
+
default: 'app',
|
|
75
|
+
},
|
|
87
76
|
],
|
|
88
77
|
func: (argv, config, args) =>
|
|
89
78
|
require('./scripts/codegen/generate-artifacts-executor').execute(
|
|
90
79
|
args.path,
|
|
91
80
|
args.platform,
|
|
92
81
|
args.outputPath,
|
|
82
|
+
args.source,
|
|
93
83
|
),
|
|
94
84
|
};
|
|
95
85
|
|
|
@@ -900,11 +900,12 @@ function generateFBReactNativeSpecIOS(projectRoot /*: string */) /*: void*/ {
|
|
|
900
900
|
* @parameter projectRoot: the directory with the app source code, where the package.json lives.
|
|
901
901
|
* @parameter baseOutputPath: the base output path for the CodeGen.
|
|
902
902
|
* @parameter targetPlatform: the target platform. Supported values: 'android', 'ios', 'all'.
|
|
903
|
+
* @parameter source: the source that is invoking codegen. Supported values: 'app', 'library'.
|
|
903
904
|
* @throws If it can't find a config file for react-native.
|
|
904
905
|
* @throws If it can't find a CodeGen configuration in the file.
|
|
905
906
|
* @throws If it can't find a cli for the CodeGen.
|
|
906
907
|
*/
|
|
907
|
-
function execute(projectRoot, targetPlatform, baseOutputPath) {
|
|
908
|
+
function execute(projectRoot, targetPlatform, baseOutputPath, source) {
|
|
908
909
|
try {
|
|
909
910
|
codegenLog(`Analyzing ${path.join(projectRoot, 'package.json')}`);
|
|
910
911
|
|
|
@@ -952,9 +953,12 @@ function execute(projectRoot, targetPlatform, baseOutputPath) {
|
|
|
952
953
|
platform,
|
|
953
954
|
);
|
|
954
955
|
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
956
|
+
if (source === 'app') {
|
|
957
|
+
// These components are only required by apps, not by libraries
|
|
958
|
+
generateRCTThirdPartyComponents(libraries, outputPath);
|
|
959
|
+
generateCustomURLHandlers(libraries, outputPath);
|
|
960
|
+
generateAppDependencyProvider(outputPath);
|
|
961
|
+
}
|
|
958
962
|
|
|
959
963
|
cleanupEmptyFilesAndFolders(outputPath);
|
|
960
964
|
}
|
|
@@ -25,7 +25,12 @@ const argv = yargs
|
|
|
25
25
|
alias: 'outputPath',
|
|
26
26
|
description: 'Path where generated artifacts will be output to.',
|
|
27
27
|
})
|
|
28
|
+
.option('s', {
|
|
29
|
+
alias: 'source',
|
|
30
|
+
description: 'Whether the script is invoked from an `app` or a `library`',
|
|
31
|
+
default: 'app',
|
|
32
|
+
})
|
|
28
33
|
.usage('Usage: $0 -p [path to app] -t [target platform] -o [output path]')
|
|
29
34
|
.demandOption(['p', 't']).argv;
|
|
30
35
|
|
|
31
|
-
executor.execute(argv.path, argv.targetPlatform, argv.outputPath);
|
|
36
|
+
executor.execute(argv.path, argv.targetPlatform, argv.outputPath, argv.source);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|