react-native-macos 0.0.0-5c51f7dd6 → 0.0.0-63022c8a7

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.
Files changed (125) hide show
  1. package/Libraries/AddressSanitizerCrash/RCTAddressSanitizerCrash.js +25 -0
  2. package/Libraries/Animated/NativeAnimatedHelper.js +1 -1
  3. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +22 -12
  4. package/Libraries/Components/DatePicker/DatePickerIOS.ios.js +3 -6
  5. package/Libraries/Components/Touchable/TouchableBounce.js +11 -22
  6. package/Libraries/Components/Touchable/TouchableHighlight.js +19 -30
  7. package/Libraries/Components/Touchable/TouchableOpacity.js +14 -29
  8. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +8 -18
  9. package/Libraries/Components/View/ReactNativeViewAttributes.js +8 -7
  10. package/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js +1 -2
  11. package/Libraries/Components/View/View.js +8 -10
  12. package/Libraries/Components/View/ViewPropTypes.js +1 -7
  13. package/Libraries/Core/ExceptionsManager.js +3 -1
  14. package/Libraries/Core/ReactNativeVersion.js +5 -1
  15. package/Libraries/Core/setUpBatchedBridge.js +1 -1
  16. package/Libraries/Core/setUpGlobals.js +2 -0
  17. package/Libraries/Core/setUpTimers.js +2 -2
  18. package/Libraries/Image/Image.ios.js +6 -0
  19. package/Libraries/Pressability/Pressability.js +1 -0
  20. package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +1 -0
  21. package/Libraries/StyleSheet/PlatformColorValueTypes.macos.js +16 -1
  22. package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.js +2 -0
  23. package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.macos.js +8 -1
  24. package/Libraries/Text/RawText/RCTRawTextShadowView.m +2 -0
  25. package/Libraries/Text/Text/RCTTextView.m +7 -9
  26. package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +10 -8
  27. package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +2 -0
  28. package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +15 -3
  29. package/Libraries/Text/TextInput/RCTBaseTextInputView.m +10 -1
  30. package/Libraries/Text/TextProps.js +1 -7
  31. package/Libraries/TurboModule/TurboModuleRegistry.js +1 -1
  32. package/Libraries/Utilities/HMRClient.js +1 -1
  33. package/Libraries/WebSocket/RCTSRWebSocket.m +23 -0
  34. package/README.md +18 -42
  35. package/React/Base/RCTBridgeModule.h +1 -1
  36. package/React/Base/RCTConvert.m +23 -6
  37. package/React/Base/RCTImageSource.m +2 -0
  38. package/React/Base/RCTJSStackFrame.m +2 -0
  39. package/React/Base/RCTJavaScriptLoader.mm +2 -0
  40. package/React/Base/RCTKeyCommands.m +2 -0
  41. package/React/Base/RCTModuleData.mm +2 -0
  42. package/React/Base/RCTModuleMethod.mm +2 -0
  43. package/React/Base/RCTTouchEvent.m +2 -0
  44. package/React/Base/RCTVersion.m +5 -1
  45. package/React/Base/macOS/RCTPlatformDisplayLink.m +4 -1
  46. package/React/CoreModules/RCTActionSheetManager.mm +4 -0
  47. package/React/CoreModules/RCTAddressSanitizerCrashManager.h +12 -0
  48. package/React/CoreModules/RCTAddressSanitizerCrashManager.mm +18 -0
  49. package/React/CoreModules/RCTAppearance.mm +5 -1
  50. package/React/CoreModules/RCTDevLoadingView.mm +14 -9
  51. package/React/CxxModule/RCTCxxMethod.mm +2 -0
  52. package/React/DevSupport/RCTInspectorDevServerHelper.mm +12 -0
  53. package/React/FBReactNativeSpec/FBReactNativeSpec.podspec +12 -2
  54. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +9 -0
  55. package/React/Modules/RCTLayoutAnimation.m +2 -0
  56. package/React/Modules/RCTLayoutAnimationGroup.m +2 -0
  57. package/React/Views/RCTFont.mm +58 -47
  58. package/React/Views/RCTShadowView.m +3 -1
  59. package/React/Views/RCTView.h +5 -2
  60. package/React/Views/RCTView.m +22 -10
  61. package/React/Views/RCTViewManager.m +12 -16
  62. package/React/Views/SafeAreaView/RCTSafeAreaView.m +2 -0
  63. package/React/Views/ScrollView/MacOS/RCTScrollContentLocalData.h +2 -2
  64. package/React/Views/ScrollView/MacOS/RCTScrollContentLocalData.m +4 -4
  65. package/React/Views/ScrollView/RCTScrollContentView.m +10 -24
  66. package/React/Views/ScrollView/RCTScrollView.m +1 -5
  67. package/ReactAndroid/build.gradle +9 -3
  68. package/ReactAndroid/gradle.properties +1 -1
  69. package/ReactAndroid/src/androidTest/java/com/facebook/react/tests/BUCK +0 -1
  70. package/ReactAndroid/src/androidTest/js/TestBundle.js +0 -7
  71. package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +47 -15
  72. package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java +12 -0
  73. package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java +6 -0
  74. package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactCxxErrorHandler.java +39 -0
  75. package/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +6 -0
  76. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +5 -1
  77. package/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK +0 -1
  78. package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +0 -5
  79. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java +0 -4
  80. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +16 -0
  81. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +20 -1
  82. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +25 -6
  83. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java +25 -5
  84. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditTextInputConnectionWrapper.java +3 -0
  85. package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +2 -0
  86. package/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.cpp +18 -0
  87. package/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.h +25 -0
  88. package/ReactAndroid/src/main/third-party/android/androidx/BUCK +6 -6
  89. package/ReactCommon/cxxreact/ReactNativeVersion.h +5 -1
  90. package/ReactCommon/hermes/inspector/tools/msggen/package.json +1 -1
  91. package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +1225 -1481
  92. package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +20 -28
  93. package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp +7 -3
  94. package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.h +12 -2
  95. package/ReactCommon/react/renderer/attributedstring/conversions.h +58 -3
  96. package/ReactCommon/react/renderer/attributedstring/primitives.h +18 -1
  97. package/ReactCommon/react/renderer/components/view/ViewShadowNode.h +1 -1
  98. package/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h +4 -0
  99. package/ReactCommon/react/renderer/core/RawPropsKey.cpp +10 -2
  100. package/ReactCommon/react/renderer/scheduler/SurfaceHandler.h +4 -4
  101. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h +2 -0
  102. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +19 -0
  103. package/ReactCommon/react/test_utils/BUCK +3 -0
  104. package/ReactCommon/react/test_utils/MockSurfaceHandler.h +25 -0
  105. package/ReactCommon/react/utils/ContextContainer.h +0 -27
  106. package/flow/global.js +45 -0
  107. package/index.js +15 -10
  108. package/package.json +21 -13
  109. package/scripts/generate-specs.sh +62 -29
  110. package/scripts/react_native_pods.rb +29 -29
  111. package/template/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  112. package/template/ios/HelloWorld.xcodeproj/project.pbxproj +2 -0
  113. package/template/package.json +4 -2
  114. package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js +0 -87
  115. package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js +0 -30
  116. package/Libraries/Components/DatePickerAndroid/DatePickerAndroidTypes.js +0 -30
  117. package/React/Base/macOS/RCTDynamicColor.h +0 -28
  118. package/React/Base/macOS/RCTDynamicColor.m +0 -217
  119. package/ReactAndroid/src/androidTest/java/com/facebook/react/tests/DatePickerDialogTestCase.java +0 -172
  120. package/ReactAndroid/src/androidTest/js/DatePickerDialogTestModule.js +0 -45
  121. package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/BUCK +0 -27
  122. package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogFragment.java +0 -137
  123. package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogModule.java +0 -153
  124. package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerMode.java +0 -15
  125. package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DismissableDatePickerDialog.java +0 -117
@@ -1,153 +0,0 @@
1
- /*
2
- * Copyright (c) Facebook, Inc. and its 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
- package com.facebook.react.modules.datepicker;
9
-
10
- import android.app.Activity;
11
- import android.app.DatePickerDialog.OnDateSetListener;
12
- import android.content.DialogInterface;
13
- import android.content.DialogInterface.OnDismissListener;
14
- import android.os.Bundle;
15
- import android.widget.DatePicker;
16
- import androidx.annotation.NonNull;
17
- import androidx.annotation.Nullable;
18
- import androidx.fragment.app.DialogFragment;
19
- import androidx.fragment.app.FragmentActivity;
20
- import androidx.fragment.app.FragmentManager;
21
- import com.facebook.fbreact.specs.NativeDatePickerAndroidSpec;
22
- import com.facebook.react.bridge.*;
23
- import com.facebook.react.common.annotations.VisibleForTesting;
24
- import com.facebook.react.module.annotations.ReactModule;
25
-
26
- /**
27
- * {@link NativeModule} that allows JS to show a native date picker dialog and get called back when
28
- * the user selects a date.
29
- */
30
- @ReactModule(name = DatePickerDialogModule.FRAGMENT_TAG)
31
- public class DatePickerDialogModule extends NativeDatePickerAndroidSpec {
32
-
33
- @VisibleForTesting public static final String FRAGMENT_TAG = "DatePickerAndroid";
34
-
35
- private static final String ERROR_NO_ACTIVITY = "E_NO_ACTIVITY";
36
-
37
- /* package */ static final String ARG_DATE = "date";
38
- /* package */ static final String ARG_MINDATE = "minDate";
39
- /* package */ static final String ARG_MAXDATE = "maxDate";
40
- /* package */ static final String ARG_MODE = "mode";
41
-
42
- /* package */ static final String ACTION_DATE_SET = "dateSetAction";
43
- /* package */ static final String ACTION_DISMISSED = "dismissedAction";
44
-
45
- public DatePickerDialogModule(ReactApplicationContext reactContext) {
46
- super(reactContext);
47
- }
48
-
49
- public @NonNull String getName() {
50
- return DatePickerDialogModule.FRAGMENT_TAG;
51
- }
52
-
53
- private class DatePickerDialogListener implements OnDateSetListener, OnDismissListener {
54
-
55
- private final Promise mPromise;
56
- private boolean mPromiseResolved = false;
57
-
58
- public DatePickerDialogListener(final Promise promise) {
59
- mPromise = promise;
60
- }
61
-
62
- @Override
63
- public void onDateSet(DatePicker view, int year, int month, int day) {
64
- if (!mPromiseResolved && getReactApplicationContext().hasActiveReactInstance()) {
65
- WritableMap result = new WritableNativeMap();
66
- result.putString("action", ACTION_DATE_SET);
67
- result.putInt("year", year);
68
- result.putInt("month", month);
69
- result.putInt("day", day);
70
- mPromise.resolve(result);
71
- mPromiseResolved = true;
72
- }
73
- }
74
-
75
- @Override
76
- public void onDismiss(DialogInterface dialog) {
77
- if (!mPromiseResolved && getReactApplicationContext().hasActiveReactInstance()) {
78
- WritableMap result = new WritableNativeMap();
79
- result.putString("action", ACTION_DISMISSED);
80
- mPromise.resolve(result);
81
- mPromiseResolved = true;
82
- }
83
- }
84
- }
85
-
86
- /**
87
- * Show a date picker dialog.
88
- *
89
- * @param options a map containing options. Available keys are:
90
- * <ul>
91
- * <li>{@code date} (timestamp in milliseconds) the date to show by default
92
- * <li>{@code minDate} (timestamp in milliseconds) the minimum date the user should be
93
- * allowed to select
94
- * <li>{@code maxDate} (timestamp in milliseconds) the maximum date the user should be
95
- * allowed to select
96
- * <li>{@code mode} To set the date picker mode to 'calendar/spinner/default'
97
- * </ul>
98
- *
99
- * @param promise This will be invoked with parameters action, year, month (0-11), day, where
100
- * action is {@code dateSetAction} or {@code dismissedAction}, depending on what the user did.
101
- * If the action is dismiss, year, month and date are undefined.
102
- */
103
- @Override
104
- public void open(@Nullable final ReadableMap options, final Promise promise) {
105
- Activity raw_activity = getCurrentActivity();
106
- if (raw_activity == null || !(raw_activity instanceof FragmentActivity)) {
107
- promise.reject(
108
- ERROR_NO_ACTIVITY,
109
- "Tried to open a DatePicker dialog while not attached to a FragmentActivity");
110
- return;
111
- }
112
-
113
- FragmentActivity activity = (FragmentActivity) raw_activity;
114
-
115
- final FragmentManager fragmentManager = activity.getSupportFragmentManager();
116
- DialogFragment oldFragment = (DialogFragment) fragmentManager.findFragmentByTag(FRAGMENT_TAG);
117
- if (oldFragment != null) {
118
- oldFragment.dismiss();
119
- }
120
- activity.runOnUiThread(
121
- new Runnable() {
122
- @Override
123
- public void run() {
124
- DatePickerDialogFragment fragment = new DatePickerDialogFragment();
125
- if (options != null) {
126
- final Bundle args = createFragmentArguments(options);
127
- fragment.setArguments(args);
128
- }
129
- final DatePickerDialogListener listener = new DatePickerDialogListener(promise);
130
- fragment.setOnDismissListener(listener);
131
- fragment.setOnDateSetListener(listener);
132
- fragment.show(fragmentManager, FRAGMENT_TAG);
133
- }
134
- });
135
- }
136
-
137
- private Bundle createFragmentArguments(ReadableMap options) {
138
- final Bundle args = new Bundle();
139
- if (options.hasKey(ARG_DATE) && !options.isNull(ARG_DATE)) {
140
- args.putLong(ARG_DATE, (long) options.getDouble(ARG_DATE));
141
- }
142
- if (options.hasKey(ARG_MINDATE) && !options.isNull(ARG_MINDATE)) {
143
- args.putLong(ARG_MINDATE, (long) options.getDouble(ARG_MINDATE));
144
- }
145
- if (options.hasKey(ARG_MAXDATE) && !options.isNull(ARG_MAXDATE)) {
146
- args.putLong(ARG_MAXDATE, (long) options.getDouble(ARG_MAXDATE));
147
- }
148
- if (options.hasKey(ARG_MODE) && !options.isNull(ARG_MODE)) {
149
- args.putString(ARG_MODE, options.getString(ARG_MODE));
150
- }
151
- return args;
152
- }
153
- }
@@ -1,15 +0,0 @@
1
- /*
2
- * Copyright (c) Facebook, Inc. and its 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
- package com.facebook.react.modules.datepicker;
9
-
10
- /** Date picker modes */
11
- public enum DatePickerMode {
12
- CALENDAR,
13
- SPINNER,
14
- DEFAULT
15
- }
@@ -1,117 +0,0 @@
1
- /*
2
- * Copyright (c) Facebook, Inc. and its 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
- package com.facebook.react.modules.datepicker;
9
-
10
- import android.app.DatePickerDialog;
11
- import android.content.Context;
12
- import android.content.res.TypedArray;
13
- import android.os.Build;
14
- import android.util.AttributeSet;
15
- import android.widget.DatePicker;
16
- import androidx.annotation.Nullable;
17
- import java.lang.reflect.Field;
18
- import java.lang.reflect.Method;
19
-
20
- public class DismissableDatePickerDialog extends DatePickerDialog {
21
-
22
- public DismissableDatePickerDialog(
23
- Context context,
24
- @Nullable DatePickerDialog.OnDateSetListener callback,
25
- int year,
26
- int monthOfYear,
27
- int dayOfMonth) {
28
- super(context, callback, year, monthOfYear, dayOfMonth);
29
- fixSpinner(context, year, monthOfYear, dayOfMonth);
30
- }
31
-
32
- public DismissableDatePickerDialog(
33
- Context context,
34
- int theme,
35
- @Nullable DatePickerDialog.OnDateSetListener callback,
36
- int year,
37
- int monthOfYear,
38
- int dayOfMonth) {
39
- super(context, theme, callback, year, monthOfYear, dayOfMonth);
40
- fixSpinner(context, year, monthOfYear, dayOfMonth);
41
- }
42
-
43
- private void fixSpinner(Context context, int year, int month, int dayOfMonth) {
44
- if (Build.VERSION.SDK_INT == Build.VERSION_CODES.N) {
45
- try {
46
- // Get the theme's android:datePickerMode
47
- final int MODE_SPINNER = 2;
48
- Class<?> styleableClass = Class.forName("com.android.internal.R$styleable");
49
- Field datePickerStyleableField = styleableClass.getField("DatePicker");
50
- int[] datePickerStyleable = (int[]) datePickerStyleableField.get(null);
51
-
52
- final TypedArray a =
53
- context.obtainStyledAttributes(
54
- null, datePickerStyleable, android.R.attr.datePickerStyle, 0);
55
- Field datePickerModeStyleableField = styleableClass.getField("DatePicker_datePickerMode");
56
- int datePickerModeStyleable = datePickerModeStyleableField.getInt(null);
57
- final int mode = a.getInt(datePickerModeStyleable, MODE_SPINNER);
58
- a.recycle();
59
-
60
- if (mode == MODE_SPINNER) {
61
- DatePicker datePicker =
62
- (DatePicker)
63
- findField(DatePickerDialog.class, DatePicker.class, "mDatePicker").get(this);
64
- Class<?> delegateClass = Class.forName("android.widget.DatePickerSpinnerDelegate");
65
- Field delegateField = findField(DatePicker.class, delegateClass, "mDelegate");
66
- Object delegate = delegateField.get(datePicker);
67
- Class<?> spinnerDelegateClass;
68
- spinnerDelegateClass = Class.forName("android.widget.DatePickerSpinnerDelegate");
69
-
70
- // In 7.0 Nougat for some reason the datePickerMode is ignored and the delegate is
71
- // DatePickerClockDelegate
72
- if (delegate.getClass() != spinnerDelegateClass) {
73
- delegateField.set(datePicker, null); // throw out the DatePickerClockDelegate!
74
- datePicker.removeAllViews(); // remove the DatePickerClockDelegate views
75
- Method createSpinnerUIDelegate =
76
- DatePicker.class.getDeclaredMethod(
77
- "createSpinnerUIDelegate",
78
- Context.class,
79
- AttributeSet.class,
80
- int.class,
81
- int.class);
82
- createSpinnerUIDelegate.setAccessible(true);
83
-
84
- // Instantiate a DatePickerSpinnerDelegate throughout createSpinnerUIDelegate method
85
- delegate =
86
- createSpinnerUIDelegate.invoke(
87
- datePicker, context, null, android.R.attr.datePickerStyle, 0);
88
- delegateField.set(
89
- datePicker, delegate); // set the DatePicker.mDelegate to the spinner delegate
90
- datePicker.setCalendarViewShown(false);
91
- // Initialize the date for the DatePicker delegate again
92
- datePicker.init(year, month, dayOfMonth, this);
93
- }
94
- }
95
- } catch (Exception e) {
96
- throw new RuntimeException(e);
97
- }
98
- }
99
- }
100
-
101
- private static Field findField(Class objectClass, Class fieldClass, String expectedName) {
102
- try {
103
- Field field = objectClass.getDeclaredField(expectedName);
104
- field.setAccessible(true);
105
- return field;
106
- } catch (NoSuchFieldException e) {
107
- } // ignore
108
- // search for it if it wasn't found under the expected ivar name
109
- for (Field searchField : objectClass.getDeclaredFields()) {
110
- if (searchField.getType() == fieldClass) {
111
- searchField.setAccessible(true);
112
- return searchField;
113
- }
114
- }
115
- return null;
116
- }
117
- }