react-native-windows 0.83.0-preview.3 → 0.84.0-preview.10
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/.flowconfig +2 -2
- package/Folly/Folly.vcxproj +2 -0
- package/Libraries/Animated/AnimatedEvent.js +2 -2
- package/Libraries/Animated/animations/Animation.js +1 -3
- package/Libraries/Animated/createAnimatedComponent.js +8 -5
- package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +40 -4
- package/Libraries/Animated/nodes/AnimatedNode.js +3 -3
- package/Libraries/Animated/nodes/AnimatedObject.js +16 -11
- package/Libraries/Animated/nodes/AnimatedProps.js +43 -12
- package/Libraries/Animated/nodes/AnimatedStyle.js +12 -12
- package/Libraries/Animated/nodes/AnimatedValue.js +6 -3
- package/Libraries/Animated/nodes/AnimatedValueXY.js +1 -1
- package/Libraries/BatchedBridge/MessageQueue.js +24 -22
- package/Libraries/Blob/URL.js +34 -3
- package/Libraries/Blob/URLSearchParams.js +1 -0
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +9 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +6 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +6 -1
- package/Libraries/Components/Button.js +2 -5
- package/Libraries/Components/Button.windows.js +2 -5
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.js +4 -4
- package/Libraries/Components/Keyboard/Keyboard.js +2 -2
- package/Libraries/Components/Pressable/Pressable.js +8 -8
- package/Libraries/Components/Pressable/Pressable.windows.js +14 -13
- package/Libraries/Components/TextInput/TextInput.flow.js +13 -13
- package/Libraries/Components/TextInput/TextInput.flow.windows.js +19 -18
- package/Libraries/Components/TextInput/TextInput.js +33 -34
- package/Libraries/Components/TextInput/TextInput.windows.js +40 -39
- package/Libraries/Components/Touchable/PooledClass.js +2 -2
- package/Libraries/Components/Touchable/TouchableBounce.js +3 -3
- package/Libraries/Components/Touchable/TouchableBounce.windows.js +3 -3
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.windows.js +1 -1
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +9 -9
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +9 -9
- package/Libraries/Components/View/ViewPropTypes.js +16 -6
- package/Libraries/Components/View/ViewPropTypes.windows.js +21 -11
- package/Libraries/Core/Devtools/loadBundleFromServer.js +6 -3
- package/Libraries/Core/Devtools/loadBundleFromServer.windows.js +6 -3
- package/Libraries/Core/Devtools/symbolicateStackTrace.js +1 -1
- package/Libraries/Core/ExceptionsManager.js +3 -3
- package/Libraries/Core/RawEventEmitter.js +1 -1
- package/Libraries/Core/ReactFiberErrorDialog.js +1 -1
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Core/setUpDeveloperTools.js +1 -1
- package/Libraries/Core/setUpErrorHandling.js +1 -1
- package/Libraries/Core/setUpReactDevTools.js +6 -23
- package/Libraries/EventEmitter/NativeEventEmitter.js +2 -2
- package/Libraries/Image/Image.android.js +2 -2
- package/Libraries/Image/Image.ios.js +2 -2
- package/Libraries/Image/Image.windows.js +2 -2
- package/Libraries/Image/ImageProps.js +1 -1
- package/Libraries/Image/ImageTypes.flow.js +2 -2
- package/Libraries/Interaction/InteractionManager.js +3 -3
- package/Libraries/Interaction/PanResponder.js +1 -1
- package/Libraries/LayoutAnimation/LayoutAnimation.js +1 -1
- package/Libraries/Linking/Linking.js +1 -1
- package/Libraries/Lists/FlatList.js +2 -2
- package/Libraries/LogBox/Data/LogBoxData.js +31 -4
- package/Libraries/LogBox/Data/LogBoxLog.js +2 -2
- package/Libraries/LogBox/Data/LogBoxSymbolication.js +1 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +5 -5
- package/Libraries/LogBox/LogBox.js +7 -7
- package/Libraries/Modal/Modal.windows.js +1 -7
- package/Libraries/NativeComponent/BaseViewConfig.android.js +12 -0
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +4 -4
- package/Libraries/NativeComponent/ViewConfigIgnore.js +1 -1
- package/Libraries/NativeComponent/ViewConfigIgnore.windows.js +1 -1
- package/Libraries/Network/RCTNetworking.android.js +3 -3
- package/Libraries/Network/RCTNetworking.ios.js +2 -2
- package/Libraries/Network/RCTNetworking.js.flow +2 -2
- package/Libraries/Network/RCTNetworking.windows.js +2 -2
- package/Libraries/Pressability/Pressability.js +9 -9
- package/Libraries/Pressability/Pressability.windows.js +17 -16
- package/Libraries/ReactNative/AppRegistry.flow.js +1 -1
- package/Libraries/ReactNative/BridgelessUIManager.js +1 -1
- package/Libraries/ReactNative/FabricUIManager.js +1 -1
- package/Libraries/ReactNative/PaperUIManager.js +1 -1
- package/Libraries/ReactNative/PaperUIManager.windows.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstanceUtils.js +2 -2
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.js +1 -1
- package/Libraries/ReactNative/RendererImplementation.js +1 -1
- package/Libraries/ReactNative/getNativeComponentAttributes.js +1 -1
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -2
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +3 -3
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +3 -3
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3 -3
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +11 -4
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +11 -4
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +11 -4
- package/Libraries/Renderer/shims/ReactFabric.js +3 -1
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +3 -1
- package/Libraries/Renderer/shims/ReactNative.js +2 -2
- package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -1
- package/Libraries/Renderer/shims/ReactNativeTypes.windows.js +3 -1
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -1
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +3 -1
- package/Libraries/Settings/Settings.ios.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +2 -2
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.js.flow +4 -2
- package/Libraries/StyleSheet/StyleSheetExports.js +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +99 -4
- package/Libraries/StyleSheet/StyleSheetTypes.js +6 -8
- package/Libraries/StyleSheet/processFilter.js +1 -1
- package/Libraries/Text/Text.js +46 -6
- package/Libraries/Text/Text.windows.js +46 -6
- package/Libraries/Text/TextNativeComponent.js +1 -1
- package/Libraries/Text/TextProps.js +7 -7
- package/Libraries/Text/TextProps.windows.js +7 -7
- package/Libraries/Types/CodegenTypes.js +1 -1
- package/Libraries/Types/CoreEventTypes.js +31 -0
- package/Libraries/Types/CoreEventTypes.windows.js +31 -13
- package/Libraries/Types/ReactDevToolsTypes.js +2 -2
- package/Libraries/Utilities/Appearance.js +2 -2
- package/Libraries/Utilities/DevLoadingView.js +8 -1
- package/Libraries/Utilities/DevSettings.js +3 -3
- package/Libraries/Utilities/HMRClient.js +4 -3
- package/Libraries/Utilities/RCTLog.js +3 -3
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
- package/Libraries/Utilities/SceneTracker.js +1 -1
- package/Libraries/Utilities/codegenNativeCommands.js +1 -1
- package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +3 -3
- package/Libraries/Utilities/logError.js +1 -1
- package/Libraries/Utilities/stringifySafe.js +7 -7
- package/Libraries/Utilities/useRefEffect.js +1 -1
- package/Libraries/WebSocket/WebSocketInterceptor.js +3 -3
- package/Libraries/promiseRejectionTrackingOptions.js +8 -8
- package/Libraries/vendor/core/ErrorUtils.js +10 -10
- package/Libraries/vendor/emitter/EventEmitter.js +6 -6
- package/Microsoft.ReactNative/Fabric/AbiViewProps.cpp +5 -0
- package/Microsoft.ReactNative/Fabric/AbiViewProps.h +1 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +58 -20
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +5 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +302 -67
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +19 -4
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +23 -12
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.cpp +4 -0
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.h +1 -0
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +0 -2
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +98 -44
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +4 -2
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +2 -3
- package/Microsoft.ReactNative/Fabric/ReactTaggedView.h +2 -2
- package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.cpp +3 -3
- package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.h +3 -1
- package/Microsoft.ReactNative/Fabric/WindowsImageManager.cpp +0 -1
- package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +2 -0
- package/Microsoft.ReactNative/Modules/Animated/AnimatedNode.cpp +3 -3
- package/Microsoft.ReactNative/Modules/Animated/AnimatedNode.h +3 -2
- package/Microsoft.ReactNative/Modules/Timing.h +2 -1
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +6 -0
- package/Microsoft.ReactNative/ViewProps.idl +9 -0
- package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModule.h +12 -2
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/PropertySheets/JSEngine.props +1 -1
- package/ReactCommon/ReactCommon.vcxproj +7 -1
- package/ReactCommon/ReactCommon.vcxproj.filters +0 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSIndexedRAMBundle.cpp +5 -5
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/ReactMarker.cpp +0 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsiexecutor/jsireact/JSIExecutor.cpp +2 -43
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +12 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/attributedstring/TextAttributes.cpp +291 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/EventDispatcher.cpp +0 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/EventQueueProcessor.cpp +1 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/propsConversions.h +199 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/uimanager/UIManager.cpp +6 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +17 -10
- package/Scripts/creaternwapp.cmd +8 -1
- package/Scripts/creaternwlib.cmd +21 -2
- package/Shared/DevSettings.h +0 -3
- package/Shared/Modules/WebSocketModule.cpp +0 -1
- package/Shared/Modules/WebSocketModule.h +62 -3
- package/Shared/OInstance.cpp +5 -0
- package/Shared/Shared.vcxitems +4 -6
- package/Shared/Shared.vcxitems.filters +218 -709
- package/codegen/NativeAccessibilityManagerSpec.g.h +2 -0
- package/codegen/NativeAnimatedModuleSpec.g.h +21 -15
- package/codegen/NativeDevLoadingViewSpec.g.h +3 -3
- package/codegen/NativeIntentAndroidSpec.g.h +16 -3
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +209 -191
- package/codegen/react/components/rnwcore/EventEmitters.h +1 -0
- package/codegen/react/components/rnwcore/Props.h +14 -0
- package/codegen/rnwcoreJSI.h +246 -211
- package/index.js +3 -0
- package/index.windows.js +3 -0
- package/jest/mock.js +2 -2
- package/jest/mockComponent.js +1 -1
- package/jest/setup.js +1 -1
- package/package.json +22 -21
- package/src/private/animated/NativeAnimatedHelper.js +130 -125
- package/src/private/animated/NativeAnimatedValidation.js +7 -4
- package/src/private/animated/createAnimatedPropsHook.js +13 -5
- package/src/private/animated/createAnimatedPropsMemoHook.js +10 -10
- package/src/private/components/virtualview/VirtualView.js +16 -9
- package/src/private/components/virtualview/logger/VirtualViewLogger.js +21 -0
- package/src/private/components/virtualview/logger/VirtualViewLoggerTypes.js +24 -0
- package/src/private/devsupport/devmenu/elementinspector/ElementProperties.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/Inspector.js +6 -25
- package/src/private/devsupport/devmenu/elementinspector/InspectorPanel.js +1 -27
- package/src/private/devsupport/devmenu/elementinspector/XHRInterceptor.js +3 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +63 -42
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +3 -3
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +12 -9
- package/src/private/renderer/errorhandling/ErrorHandlers.js +7 -4
- package/src/private/specs_DEPRECATED/modules/NativeAccessibilityManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeAnimatedModule.js +4 -0
- package/src/private/specs_DEPRECATED/modules/NativeDevLoadingView.js +1 -0
- package/src/private/webapis/dom/events/CustomEvent.js +3 -3
- package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentElementInstanceHandle.js +1 -1
- package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.js +1 -1
- package/src/private/webapis/dom/nodes/specs/NativeDOM.js +29 -29
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +1 -1
- package/src/private/webapis/dom/oldstylecollections/NodeList.js +2 -2
- package/src/private/webapis/geometry/DOMRectReadOnly.js +1 -1
- package/src/private/webapis/html/events/MessageEvent.js +3 -3
- package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +3 -3
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +53 -5
- package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +2 -2
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +4 -4
- package/src/private/webapis/microtasks/specs/NativeMicrotasks.js +1 -1
- package/src/private/webapis/mutationobserver/MutationObserver.js +1 -1
- package/src/private/webapis/mutationobserver/MutationRecord.js +1 -1
- package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +4 -4
- package/src/private/webapis/performance/Performance.js +1 -1
- package/src/private/webapis/performance/UserTiming.js +1 -1
- package/src/private/webapis/performance/specs/NativePerformance.js +3 -3
- package/src/private/webapis/structuredClone/structuredClone.js +3 -3
- package/src/types/globals.d.ts +30 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h +0 -178
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/imagemanager/primitives.h +0 -183
- package/Shared/Modules/WebSocketTurboModule.h +0 -71
- package/src/private/devsupport/devmenu/elementinspector/NetworkOverlay.js +0 -628
- package/src/private/devsupport/devmenu/perfmonitor/PerformanceOverlay.js +0 -66
|
@@ -22,19 +22,19 @@ int64_t AnimatedNode::Tag() {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
void AnimatedNode::AddChild(const int64_t animatedNodeTag) {
|
|
25
|
-
m_children.
|
|
25
|
+
m_children.insert(animatedNodeTag);
|
|
26
26
|
GetChildNode(animatedNodeTag)->OnAttachToNode(m_tag);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
void AnimatedNode::RemoveChild(const int64_t tag) {
|
|
30
30
|
if (const auto childNode = GetChildNode(tag)) {
|
|
31
31
|
childNode->OnDetachedFromNode(m_tag);
|
|
32
|
-
m_children.erase(
|
|
32
|
+
m_children.erase(tag);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
AnimatedNode *AnimatedNode::GetChildNode(int64_t tag) {
|
|
37
|
-
if (
|
|
37
|
+
if (m_children.count(tag)) {
|
|
38
38
|
if (const auto manager = m_manager.lock()) {
|
|
39
39
|
return manager->GetAnimatedNode(tag);
|
|
40
40
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
#include <JSValue.h>
|
|
7
7
|
#include <cstdint>
|
|
8
8
|
#include <memory>
|
|
9
|
+
#include <unordered_set>
|
|
9
10
|
#include <vector>
|
|
10
11
|
|
|
11
12
|
namespace Microsoft::ReactNative {
|
|
@@ -20,7 +21,7 @@ class AnimatedNode {
|
|
|
20
21
|
void AddChild(int64_t animatedNode);
|
|
21
22
|
void RemoveChild(int64_t animatedNode);
|
|
22
23
|
|
|
23
|
-
std::
|
|
24
|
+
std::unordered_set<int64_t> &Children() {
|
|
24
25
|
return m_children;
|
|
25
26
|
}
|
|
26
27
|
|
|
@@ -37,7 +38,7 @@ class AnimatedNode {
|
|
|
37
38
|
AnimatedNode *GetChildNode(int64_t tag);
|
|
38
39
|
int64_t m_tag{0};
|
|
39
40
|
const std::weak_ptr<NativeAnimatedNodeManager> m_manager;
|
|
40
|
-
std::
|
|
41
|
+
std::unordered_set<int64_t> m_children{};
|
|
41
42
|
bool m_useComposition{false};
|
|
42
43
|
|
|
43
44
|
bool HasCompatibleAnimationDriver(int64_t tag);
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
#include <ReactCoreInjection.h>
|
|
10
10
|
#include <react/runtime/PlatformTimerRegistry.h>
|
|
11
11
|
#include <react/runtime/TimerManager.h>
|
|
12
|
+
#include <atomic>
|
|
12
13
|
|
|
13
14
|
namespace Microsoft::ReactNative {
|
|
14
15
|
|
|
@@ -114,7 +115,7 @@ struct Timing : public std::enable_shared_from_this<Timing> {
|
|
|
114
115
|
xaml::Media::CompositionTarget::Rendering_revoker m_rendering;
|
|
115
116
|
winrt::Microsoft::ReactNative::ITimer m_dispatcherQueueTimer{nullptr};
|
|
116
117
|
winrt::weak_ref<winrt::Microsoft::ReactNative::IReactDispatcher> m_uiDispatcher;
|
|
117
|
-
bool m_usingRendering{false};
|
|
118
|
+
std::atomic<bool> m_usingRendering{false};
|
|
118
119
|
bool m_usePostForRendering{false};
|
|
119
120
|
};
|
|
120
121
|
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
+
#if _MSC_VER
|
|
5
|
+
#pragma warning(push)
|
|
6
|
+
#pragma warning(disable : 4996) // deprecated APIs
|
|
7
|
+
#endif
|
|
8
|
+
|
|
4
9
|
#include "ReactInstanceWin.h"
|
|
5
10
|
|
|
6
11
|
#include <AppModelHelpers.h>
|
|
@@ -57,6 +62,7 @@
|
|
|
57
62
|
#include <react/nativemodule/core/ReactCommon/TurboModuleBinding.h>
|
|
58
63
|
#include <react/renderer/componentregistry/componentNameByReactViewName.h>
|
|
59
64
|
#include <react/renderer/componentregistry/native/NativeComponentRegistryBinding.h>
|
|
65
|
+
#include <react/runtime/JSRuntimeBindings.h>
|
|
60
66
|
#include <react/runtime/PlatformTimerRegistry.h>
|
|
61
67
|
#include <react/runtime/TimerManager.h>
|
|
62
68
|
#include <react/threading/MessageQueueThreadImpl.h>
|
|
@@ -30,6 +30,14 @@ namespace Microsoft.ReactNative {
|
|
|
30
30
|
static void WriteValue(IJSValueWriter writer, Color color);
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
[experimental]
|
|
34
|
+
enum Overflow
|
|
35
|
+
{
|
|
36
|
+
Visible,
|
|
37
|
+
Hidden,
|
|
38
|
+
Scroll,
|
|
39
|
+
};
|
|
40
|
+
|
|
33
41
|
[webhosthidden]
|
|
34
42
|
[experimental]
|
|
35
43
|
DOC_STRING("Interface to implement custom view component properties.")
|
|
@@ -51,6 +59,7 @@ namespace Microsoft.ReactNative {
|
|
|
51
59
|
Color BackgroundColor { get; };
|
|
52
60
|
String TestId { get; };
|
|
53
61
|
String AccessibilityLabel { get; };
|
|
62
|
+
Overflow Overflow { get; };
|
|
54
63
|
|
|
55
64
|
// TODO add accessors to all the properties on ViewProps
|
|
56
65
|
};
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
#include <ReactCommon/CallInvoker.h>
|
|
17
17
|
#include <react/bridging/EventEmitter.h>
|
|
18
18
|
|
|
19
|
+
#if _MSC_VER
|
|
20
|
+
#pragma warning(push)
|
|
21
|
+
#pragma warning(disable : 4996) // deprecated APIs
|
|
22
|
+
#endif
|
|
23
|
+
|
|
19
24
|
namespace facebook::react {
|
|
20
25
|
|
|
21
26
|
/**
|
|
@@ -38,7 +43,6 @@ enum TurboModuleMethodValueKind {
|
|
|
38
43
|
*/
|
|
39
44
|
TurboModuleMethodValueKind getTurboModuleMethodValueKind(jsi::Runtime &rt, const jsi::Value *value);
|
|
40
45
|
|
|
41
|
-
class TurboCxxModule;
|
|
42
46
|
class TurboModuleBinding;
|
|
43
47
|
|
|
44
48
|
/**
|
|
@@ -147,7 +151,13 @@ class JSI_EXPORT TurboModule : public jsi::HostObject {
|
|
|
147
151
|
/**
|
|
148
152
|
* An app/platform-specific provider function to get an instance of a module
|
|
149
153
|
* given a name.
|
|
154
|
+
*
|
|
155
|
+
* @deprecated Use TurboModuleProviderFunctionTypeWithRuntime instead.
|
|
156
|
+
* Remove after React Native 0.84 is released.
|
|
150
157
|
*/
|
|
151
|
-
using TurboModuleProviderFunctionType
|
|
158
|
+
using TurboModuleProviderFunctionType [[deprecated("Use TurboModuleProviderFunctionTypeWithRuntime instead")]] =
|
|
159
|
+
std::function<std::shared_ptr<TurboModule>(const std::string &name)>;
|
|
160
|
+
using TurboModuleProviderFunctionTypeWithRuntime =
|
|
161
|
+
std::function<std::shared_ptr<TurboModule>(jsi::Runtime &runtime, const std::string &name)>;
|
|
152
162
|
|
|
153
163
|
} // namespace facebook::react
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.
|
|
13
|
+
<ReactNativeWindowsVersion>0.84.0-preview.10</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
|
-
<ReactNativeWindowsMinor>
|
|
15
|
+
<ReactNativeWindowsMinor>84</ReactNativeWindowsMinor>
|
|
16
16
|
<ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>4dd0ce4b939c43b413fe690306c06342f7357737</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<!-- Enabling this will (1) Include hermes glues in the Microsoft.ReactNative binaries AND (2) Make hermes the default engine -->
|
|
7
7
|
<UseHermes Condition="'$(UseHermes)' == ''">true</UseHermes>
|
|
8
8
|
<!-- This will be true if (1) the client want to use hermes by setting UseHermes to true OR (2) We are building for UWP where dynamic switching is enabled -->
|
|
9
|
-
<HermesVersion Condition="'$(HermesVersion)' == ''">0.0.0-
|
|
9
|
+
<HermesVersion Condition="'$(HermesVersion)' == ''">0.0.0-2605.6002-2279da22 </HermesVersion>
|
|
10
10
|
<HermesPackageName Condition="'$(HermesPackageName)' == ''">Microsoft.JavaScript.Hermes</HermesPackageName>
|
|
11
11
|
<HermesPackage Condition="'$(HermesPackage)' == '' And Exists('$(PkgMicrosoft_JavaScript_Hermes)')">$(PkgMicrosoft_JavaScript_Hermes)</HermesPackage>
|
|
12
12
|
<HermesPackage Condition="'$(HermesPackage)' == ''">$(NuGetPackageRoot)\$(HermesPackageName)\$(HermesVersion)</HermesPackage>
|
|
@@ -146,8 +146,11 @@
|
|
|
146
146
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\tracing\RuntimeSamplingProfileTraceEventSerializer.cpp" />
|
|
147
147
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\tracing\PerformanceTracer.cpp" />
|
|
148
148
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\tracing\TraceEventSerializer.cpp" />
|
|
149
|
+
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\tracing\HostTracingProfileSerializer.cpp" />
|
|
150
|
+
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\tracing\TraceEventGenerator.cpp" />
|
|
149
151
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\tracing\ConsoleTimeStamp.cpp" />
|
|
150
152
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jsitooling\react\runtime\JSRuntimeFactory.cpp" />
|
|
153
|
+
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jsitooling\react\runtime\JSRuntimeBindings.cpp" />
|
|
151
154
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\logger\react_native_log.cpp" />
|
|
152
155
|
<CLCompile Include="$(ReactNativeDir)\ReactCommon\reactperflogger\fusebox\FuseboxTracer.cpp" />
|
|
153
156
|
<CLCompile Include="$(ReactNativeDir)\ReactCommon\reactperflogger\reactperflogger\BridgeNativeModulePerfLogger.cpp" />
|
|
@@ -191,6 +194,9 @@
|
|
|
191
194
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\network\NetworkHandler.cpp" />
|
|
192
195
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\network\BoundedRequestBuffer.cpp" />
|
|
193
196
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\network\CdpNetwork.cpp" />
|
|
197
|
+
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\ConsoleTaskContext.cpp" />
|
|
198
|
+
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\ConsoleTask.cpp" />
|
|
199
|
+
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\ConsoleTaskOrchestrator.cpp" />
|
|
194
200
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\network\HttpUtils.cpp" />
|
|
195
201
|
<ClCompile Include="$(YogaDir)\yoga\event\event.cpp" />
|
|
196
202
|
<ClCompile Include="pch.cpp">
|
|
@@ -227,7 +233,7 @@
|
|
|
227
233
|
<ClInclude Include="$(ReactNativeDir)\ReactCommon\react\renderer\graphics\Rect.h" />
|
|
228
234
|
<ClInclude Include="$(ReactNativeDir)\ReactCommon\react\timing\primitives.h" />
|
|
229
235
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\bridging\LongLivedObject.cpp" />
|
|
230
|
-
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\
|
|
236
|
+
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\core\DynamicPointerEvent.cpp" />
|
|
231
237
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\TurboModule.cpp" />
|
|
232
238
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\TurboModuleBinding.cpp" />
|
|
233
239
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\TurboModuleUtils.cpp" />
|
|
@@ -159,9 +159,6 @@
|
|
|
159
159
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\bridging\LongLivedObject.cpp">
|
|
160
160
|
<Filter>turbomodule\core</Filter>
|
|
161
161
|
</ClCompile>
|
|
162
|
-
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\TurboCxxModule.cpp">
|
|
163
|
-
<Filter>turbomodule\core</Filter>
|
|
164
|
-
</ClCompile>
|
|
165
162
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\TurboModule.cpp">
|
|
166
163
|
<Filter>turbomodule\core</Filter>
|
|
167
164
|
</ClCompile>
|
|
@@ -65,8 +65,8 @@ void JSIndexedRAMBundle::init() {
|
|
|
65
65
|
"header size must exactly match the input file format");
|
|
66
66
|
|
|
67
67
|
readBundle(reinterpret_cast<char*>(header), sizeof(header));
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
size_t numTableEntries = folly::Endian::little(header[1]);
|
|
69
|
+
std::streamsize startupCodeSize = folly::Endian::little(header[2]);
|
|
70
70
|
|
|
71
71
|
// allocate memory for meta data and lookup table.
|
|
72
72
|
m_table = ModuleTable(numTableEntries);
|
|
@@ -76,9 +76,9 @@ void JSIndexedRAMBundle::init() {
|
|
|
76
76
|
readBundle(reinterpret_cast<char*>(m_table.data.get()), m_table.byteLength());
|
|
77
77
|
|
|
78
78
|
// read the startup code
|
|
79
|
-
m_startupCode = std::make_unique<JSBigBufferString>(startupCodeSize - 1);
|
|
79
|
+
m_startupCode = std::make_unique<JSBigBufferString>(static_cast<size_t>(startupCodeSize - 1)); //Windows #15782
|
|
80
80
|
|
|
81
|
-
readBundle(m_startupCode->
|
|
81
|
+
readBundle(m_startupCode->mutableData(), startupCodeSize - 1);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
JSIndexedRAMBundle::Module JSIndexedRAMBundle::getModule(
|
|
@@ -114,7 +114,7 @@ std::string JSIndexedRAMBundle::getModuleCode(const uint32_t id) const {
|
|
|
114
114
|
return ret;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
void JSIndexedRAMBundle::readBundle(char* buffer,
|
|
117
|
+
void JSIndexedRAMBundle::readBundle(char* buffer, std::streamsize bytes)
|
|
118
118
|
const {
|
|
119
119
|
if (!m_bundle->read(buffer, bytes)) {
|
|
120
120
|
if ((m_bundle->rdstate() & std::ios::eofbit) != 0) {
|
|
@@ -173,8 +173,7 @@ void JSIExecutor::loadBundle(
|
|
|
173
173
|
ReactMarker::logTaggedMarker(
|
|
174
174
|
ReactMarker::RUN_JS_BUNDLE_START, scriptName.c_str());
|
|
175
175
|
}
|
|
176
|
-
runtime_->evaluateJavaScript(
|
|
177
|
-
std::make_unique<BigStringBuffer>(std::move(script)), sourceURL);
|
|
176
|
+
runtime_->evaluateJavaScript(std::move(script), sourceURL);
|
|
178
177
|
flush();
|
|
179
178
|
if (hasLogger) {
|
|
180
179
|
ReactMarker::logTaggedMarker(
|
|
@@ -217,7 +216,7 @@ void JSIExecutor::registerBundle(
|
|
|
217
216
|
"Empty bundle registered with ID " + tag + " from " + bundlePath);
|
|
218
217
|
}
|
|
219
218
|
runtime_->evaluateJavaScript(
|
|
220
|
-
std::
|
|
219
|
+
std::move(script),
|
|
221
220
|
JSExecutor::getSyntheticBundlePath(bundleId, bundlePath));
|
|
222
221
|
}
|
|
223
222
|
ReactMarker::logTaggedMarker(
|
|
@@ -582,46 +581,6 @@ void JSIExecutor::flush() {}
|
|
|
582
581
|
|
|
583
582
|
#endif // RCT_REMOVE_LEGACY_ARCH
|
|
584
583
|
|
|
585
|
-
void bindNativeLogger(Runtime& runtime, Logger logger) {
|
|
586
|
-
runtime.global().setProperty(
|
|
587
|
-
runtime,
|
|
588
|
-
"nativeLoggingHook",
|
|
589
|
-
Function::createFromHostFunction(
|
|
590
|
-
runtime,
|
|
591
|
-
PropNameID::forAscii(runtime, "nativeLoggingHook"),
|
|
592
|
-
2,
|
|
593
|
-
[logger = std::move(logger)](
|
|
594
|
-
jsi::Runtime& runtime,
|
|
595
|
-
const jsi::Value&,
|
|
596
|
-
const jsi::Value* args,
|
|
597
|
-
size_t count) {
|
|
598
|
-
if (count != 2) {
|
|
599
|
-
throw std::invalid_argument(
|
|
600
|
-
"nativeLoggingHook takes 2 arguments");
|
|
601
|
-
}
|
|
602
|
-
logger(
|
|
603
|
-
args[0].asString(runtime).utf8(runtime),
|
|
604
|
-
static_cast<unsigned int>(args[1].asNumber()));
|
|
605
|
-
return Value::undefined();
|
|
606
|
-
}));
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
void bindNativePerformanceNow(Runtime& runtime) {
|
|
610
|
-
runtime.global().setProperty(
|
|
611
|
-
runtime,
|
|
612
|
-
"nativePerformanceNow",
|
|
613
|
-
Function::createFromHostFunction(
|
|
614
|
-
runtime,
|
|
615
|
-
PropNameID::forAscii(runtime, "nativePerformanceNow"),
|
|
616
|
-
0,
|
|
617
|
-
[](jsi::Runtime& runtime,
|
|
618
|
-
const jsi::Value&,
|
|
619
|
-
const jsi::Value* args,
|
|
620
|
-
size_t /*count*/) {
|
|
621
|
-
return HighResTimeStamp::now().toDOMHighResTimeStamp();
|
|
622
|
-
}));
|
|
623
|
-
}
|
|
624
|
-
|
|
625
584
|
} // namespace facebook::react
|
|
626
585
|
|
|
627
586
|
#if _MSC_VER
|
package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h
CHANGED
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
#include <ReactCommon/CallInvoker.h>
|
|
17
17
|
#include <react/bridging/EventEmitter.h>
|
|
18
18
|
|
|
19
|
+
#if _MSC_VER
|
|
20
|
+
#pragma warning(push)
|
|
21
|
+
#pragma warning(disable : 4996) // deprecated APIs
|
|
22
|
+
#endif
|
|
23
|
+
|
|
19
24
|
namespace facebook::react {
|
|
20
25
|
|
|
21
26
|
/**
|
|
@@ -38,7 +43,6 @@ enum TurboModuleMethodValueKind {
|
|
|
38
43
|
*/
|
|
39
44
|
TurboModuleMethodValueKind getTurboModuleMethodValueKind(jsi::Runtime &rt, const jsi::Value *value);
|
|
40
45
|
|
|
41
|
-
class TurboCxxModule;
|
|
42
46
|
class TurboModuleBinding;
|
|
43
47
|
|
|
44
48
|
/**
|
|
@@ -147,7 +151,13 @@ class JSI_EXPORT TurboModule : public jsi::HostObject {
|
|
|
147
151
|
/**
|
|
148
152
|
* An app/platform-specific provider function to get an instance of a module
|
|
149
153
|
* given a name.
|
|
154
|
+
*
|
|
155
|
+
* @deprecated Use TurboModuleProviderFunctionTypeWithRuntime instead.
|
|
156
|
+
* Remove after React Native 0.84 is released.
|
|
150
157
|
*/
|
|
151
|
-
using TurboModuleProviderFunctionType
|
|
158
|
+
using TurboModuleProviderFunctionType [[deprecated("Use TurboModuleProviderFunctionTypeWithRuntime instead")]] =
|
|
159
|
+
std::function<std::shared_ptr<TurboModule>(const std::string &name)>;
|
|
160
|
+
using TurboModuleProviderFunctionTypeWithRuntime =
|
|
161
|
+
std::function<std::shared_ptr<TurboModule>(jsi::Runtime &runtime, const std::string &name)>;
|
|
152
162
|
|
|
153
163
|
} // namespace facebook::react
|
package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/attributedstring/TextAttributes.cpp
ADDED
|
@@ -0,0 +1,291 @@
|
|
|
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
|
+
#include "TextAttributes.h"
|
|
9
|
+
|
|
10
|
+
#include <react/renderer/attributedstring/conversions.h>
|
|
11
|
+
#include <react/renderer/core/conversions.h>
|
|
12
|
+
#include <react/renderer/core/graphicsConversions.h>
|
|
13
|
+
#include <react/utils/FloatComparison.h>
|
|
14
|
+
#include <cmath>
|
|
15
|
+
|
|
16
|
+
#include <react/renderer/debug/debugStringConvertibleUtils.h>
|
|
17
|
+
|
|
18
|
+
namespace facebook::react {
|
|
19
|
+
|
|
20
|
+
void TextAttributes::apply(TextAttributes textAttributes) {
|
|
21
|
+
// Color
|
|
22
|
+
foregroundColor = textAttributes.foregroundColor
|
|
23
|
+
? textAttributes.foregroundColor
|
|
24
|
+
: foregroundColor;
|
|
25
|
+
backgroundColor = textAttributes.backgroundColor
|
|
26
|
+
? textAttributes.backgroundColor
|
|
27
|
+
: backgroundColor;
|
|
28
|
+
opacity =
|
|
29
|
+
!std::isnan(textAttributes.opacity) ? textAttributes.opacity : opacity;
|
|
30
|
+
|
|
31
|
+
// Font
|
|
32
|
+
fontFamily = !textAttributes.fontFamily.empty() ? textAttributes.fontFamily
|
|
33
|
+
: fontFamily;
|
|
34
|
+
fontSize =
|
|
35
|
+
!std::isnan(textAttributes.fontSize) ? textAttributes.fontSize : fontSize;
|
|
36
|
+
fontSizeMultiplier = !std::isnan(textAttributes.fontSizeMultiplier)
|
|
37
|
+
? textAttributes.fontSizeMultiplier
|
|
38
|
+
: fontSizeMultiplier;
|
|
39
|
+
fontWeight = textAttributes.fontWeight.has_value() ? textAttributes.fontWeight
|
|
40
|
+
: fontWeight;
|
|
41
|
+
fontStyle = textAttributes.fontStyle.has_value() ? textAttributes.fontStyle
|
|
42
|
+
: fontStyle;
|
|
43
|
+
fontVariant = textAttributes.fontVariant.has_value()
|
|
44
|
+
? textAttributes.fontVariant
|
|
45
|
+
: fontVariant;
|
|
46
|
+
allowFontScaling = textAttributes.allowFontScaling.has_value()
|
|
47
|
+
? textAttributes.allowFontScaling
|
|
48
|
+
: allowFontScaling;
|
|
49
|
+
maxFontSizeMultiplier = !std::isnan(textAttributes.maxFontSizeMultiplier)
|
|
50
|
+
? textAttributes.maxFontSizeMultiplier
|
|
51
|
+
: maxFontSizeMultiplier;
|
|
52
|
+
dynamicTypeRamp = textAttributes.dynamicTypeRamp.has_value()
|
|
53
|
+
? textAttributes.dynamicTypeRamp
|
|
54
|
+
: dynamicTypeRamp;
|
|
55
|
+
letterSpacing = !std::isnan(textAttributes.letterSpacing)
|
|
56
|
+
? textAttributes.letterSpacing
|
|
57
|
+
: letterSpacing;
|
|
58
|
+
textTransform = textAttributes.textTransform.has_value()
|
|
59
|
+
? textAttributes.textTransform
|
|
60
|
+
: textTransform;
|
|
61
|
+
|
|
62
|
+
// Paragraph Styles
|
|
63
|
+
lineHeight = !std::isnan(textAttributes.lineHeight)
|
|
64
|
+
? textAttributes.lineHeight
|
|
65
|
+
: lineHeight;
|
|
66
|
+
alignment = textAttributes.alignment.has_value() ? textAttributes.alignment
|
|
67
|
+
: alignment;
|
|
68
|
+
baseWritingDirection = textAttributes.baseWritingDirection.has_value()
|
|
69
|
+
? textAttributes.baseWritingDirection
|
|
70
|
+
: baseWritingDirection;
|
|
71
|
+
lineBreakStrategy = textAttributes.lineBreakStrategy.has_value()
|
|
72
|
+
? textAttributes.lineBreakStrategy
|
|
73
|
+
: lineBreakStrategy;
|
|
74
|
+
lineBreakMode = textAttributes.lineBreakMode.has_value()
|
|
75
|
+
? textAttributes.lineBreakMode
|
|
76
|
+
: lineBreakMode;
|
|
77
|
+
|
|
78
|
+
// Decoration
|
|
79
|
+
textDecorationColor = textAttributes.textDecorationColor
|
|
80
|
+
? textAttributes.textDecorationColor
|
|
81
|
+
: textDecorationColor;
|
|
82
|
+
textDecorationLineType = textAttributes.textDecorationLineType.has_value()
|
|
83
|
+
? textAttributes.textDecorationLineType
|
|
84
|
+
: textDecorationLineType;
|
|
85
|
+
textDecorationStyle = textAttributes.textDecorationStyle.has_value()
|
|
86
|
+
? textAttributes.textDecorationStyle
|
|
87
|
+
: textDecorationStyle;
|
|
88
|
+
|
|
89
|
+
// Shadow
|
|
90
|
+
textShadowOffset = textAttributes.textShadowOffset.has_value()
|
|
91
|
+
? textAttributes.textShadowOffset.value()
|
|
92
|
+
: textShadowOffset;
|
|
93
|
+
textShadowRadius = !std::isnan(textAttributes.textShadowRadius)
|
|
94
|
+
? textAttributes.textShadowRadius
|
|
95
|
+
: textShadowRadius;
|
|
96
|
+
textShadowColor = textAttributes.textShadowColor
|
|
97
|
+
? textAttributes.textShadowColor
|
|
98
|
+
: textShadowColor;
|
|
99
|
+
|
|
100
|
+
// Special
|
|
101
|
+
isHighlighted = textAttributes.isHighlighted.has_value()
|
|
102
|
+
? textAttributes.isHighlighted
|
|
103
|
+
: isHighlighted;
|
|
104
|
+
// TextAttributes "inherits" the isPressable value from ancestors, so this
|
|
105
|
+
// only applies the current node's value for isPressable if it is truthy.
|
|
106
|
+
isPressable =
|
|
107
|
+
textAttributes.isPressable.has_value() && *textAttributes.isPressable
|
|
108
|
+
? textAttributes.isPressable
|
|
109
|
+
: isPressable;
|
|
110
|
+
layoutDirection = textAttributes.layoutDirection.has_value()
|
|
111
|
+
? textAttributes.layoutDirection
|
|
112
|
+
: layoutDirection;
|
|
113
|
+
accessibilityRole = textAttributes.accessibilityRole.has_value()
|
|
114
|
+
? textAttributes.accessibilityRole
|
|
115
|
+
: accessibilityRole;
|
|
116
|
+
role = textAttributes.role.has_value() ? textAttributes.role : role;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
#pragma mark - Operators
|
|
120
|
+
|
|
121
|
+
bool TextAttributes::operator==(const TextAttributes& rhs) const {
|
|
122
|
+
return std::tie(
|
|
123
|
+
foregroundColor,
|
|
124
|
+
backgroundColor,
|
|
125
|
+
fontFamily,
|
|
126
|
+
fontWeight,
|
|
127
|
+
fontStyle,
|
|
128
|
+
fontVariant,
|
|
129
|
+
allowFontScaling,
|
|
130
|
+
dynamicTypeRamp,
|
|
131
|
+
alignment,
|
|
132
|
+
baseWritingDirection,
|
|
133
|
+
lineBreakStrategy,
|
|
134
|
+
textDecorationColor,
|
|
135
|
+
textDecorationLineType,
|
|
136
|
+
textDecorationStyle,
|
|
137
|
+
textShadowOffset,
|
|
138
|
+
textShadowColor,
|
|
139
|
+
isHighlighted,
|
|
140
|
+
isPressable,
|
|
141
|
+
layoutDirection,
|
|
142
|
+
accessibilityRole,
|
|
143
|
+
role,
|
|
144
|
+
textTransform) ==
|
|
145
|
+
std::tie(
|
|
146
|
+
rhs.foregroundColor,
|
|
147
|
+
rhs.backgroundColor,
|
|
148
|
+
rhs.fontFamily,
|
|
149
|
+
rhs.fontWeight,
|
|
150
|
+
rhs.fontStyle,
|
|
151
|
+
rhs.fontVariant,
|
|
152
|
+
rhs.allowFontScaling,
|
|
153
|
+
rhs.dynamicTypeRamp,
|
|
154
|
+
rhs.alignment,
|
|
155
|
+
rhs.baseWritingDirection,
|
|
156
|
+
rhs.lineBreakStrategy,
|
|
157
|
+
rhs.textDecorationColor,
|
|
158
|
+
rhs.textDecorationLineType,
|
|
159
|
+
rhs.textDecorationStyle,
|
|
160
|
+
rhs.textShadowOffset,
|
|
161
|
+
rhs.textShadowColor,
|
|
162
|
+
rhs.isHighlighted,
|
|
163
|
+
rhs.isPressable,
|
|
164
|
+
rhs.layoutDirection,
|
|
165
|
+
rhs.accessibilityRole,
|
|
166
|
+
rhs.role,
|
|
167
|
+
rhs.textTransform) &&
|
|
168
|
+
floatEquality(maxFontSizeMultiplier, rhs.maxFontSizeMultiplier) &&
|
|
169
|
+
floatEquality(opacity, rhs.opacity) &&
|
|
170
|
+
floatEquality(fontSize, rhs.fontSize) &&
|
|
171
|
+
floatEquality(fontSizeMultiplier, rhs.fontSizeMultiplier) &&
|
|
172
|
+
floatEquality(letterSpacing, rhs.letterSpacing) &&
|
|
173
|
+
floatEquality(lineHeight, rhs.lineHeight) &&
|
|
174
|
+
floatEquality(textShadowRadius, rhs.textShadowRadius);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
TextAttributes TextAttributes::defaultTextAttributes() {
|
|
178
|
+
static auto textAttributes = [] {
|
|
179
|
+
auto defaultAttrs = TextAttributes{};
|
|
180
|
+
// Non-obvious (can be different among platforms) default text attributes.
|
|
181
|
+
defaultAttrs.foregroundColor = facebook::react::Color { // [Windows] override default color to not be black
|
|
182
|
+
.m_color = {},
|
|
183
|
+
.m_platformColor = {"TextFillColorPrimary"},
|
|
184
|
+
};
|
|
185
|
+
defaultAttrs.backgroundColor = clearColor();
|
|
186
|
+
defaultAttrs.fontSize = 14.0;
|
|
187
|
+
defaultAttrs.fontSizeMultiplier = 1.0;
|
|
188
|
+
return defaultAttrs;
|
|
189
|
+
}();
|
|
190
|
+
return textAttributes;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
#pragma mark - DebugStringConvertible
|
|
194
|
+
|
|
195
|
+
#if RN_DEBUG_STRING_CONVERTIBLE
|
|
196
|
+
SharedDebugStringConvertibleList TextAttributes::getDebugProps() const {
|
|
197
|
+
const auto& textAttributes = TextAttributes::defaultTextAttributes();
|
|
198
|
+
return {
|
|
199
|
+
// Color
|
|
200
|
+
debugStringConvertibleItem(
|
|
201
|
+
"backgroundColor", backgroundColor, textAttributes.backgroundColor),
|
|
202
|
+
debugStringConvertibleItem(
|
|
203
|
+
"foregroundColor", foregroundColor, textAttributes.foregroundColor),
|
|
204
|
+
debugStringConvertibleItem("opacity", opacity, textAttributes.opacity),
|
|
205
|
+
|
|
206
|
+
// Font
|
|
207
|
+
debugStringConvertibleItem(
|
|
208
|
+
"fontFamily", fontFamily, textAttributes.fontFamily),
|
|
209
|
+
debugStringConvertibleItem("fontSize", fontSize, textAttributes.fontSize),
|
|
210
|
+
debugStringConvertibleItem(
|
|
211
|
+
"fontSizeMultiplier",
|
|
212
|
+
fontSizeMultiplier,
|
|
213
|
+
textAttributes.fontSizeMultiplier),
|
|
214
|
+
debugStringConvertibleItem(
|
|
215
|
+
"fontWeight", fontWeight, textAttributes.fontWeight),
|
|
216
|
+
debugStringConvertibleItem(
|
|
217
|
+
"fontStyle", fontStyle, textAttributes.fontStyle),
|
|
218
|
+
debugStringConvertibleItem(
|
|
219
|
+
"fontVariant", fontVariant, textAttributes.fontVariant),
|
|
220
|
+
debugStringConvertibleItem(
|
|
221
|
+
"allowFontScaling",
|
|
222
|
+
allowFontScaling,
|
|
223
|
+
textAttributes.allowFontScaling),
|
|
224
|
+
debugStringConvertibleItem(
|
|
225
|
+
"maxFontSizeMultiplier",
|
|
226
|
+
maxFontSizeMultiplier,
|
|
227
|
+
textAttributes.maxFontSizeMultiplier),
|
|
228
|
+
debugStringConvertibleItem(
|
|
229
|
+
"dynamicTypeRamp", dynamicTypeRamp, textAttributes.dynamicTypeRamp),
|
|
230
|
+
debugStringConvertibleItem(
|
|
231
|
+
"letterSpacing", letterSpacing, textAttributes.letterSpacing),
|
|
232
|
+
|
|
233
|
+
// Paragraph Styles
|
|
234
|
+
debugStringConvertibleItem(
|
|
235
|
+
"lineHeight", lineHeight, textAttributes.lineHeight),
|
|
236
|
+
debugStringConvertibleItem(
|
|
237
|
+
"alignment", alignment, textAttributes.alignment),
|
|
238
|
+
debugStringConvertibleItem(
|
|
239
|
+
"writingDirection",
|
|
240
|
+
baseWritingDirection,
|
|
241
|
+
textAttributes.baseWritingDirection),
|
|
242
|
+
debugStringConvertibleItem(
|
|
243
|
+
"lineBreakStrategyIOS",
|
|
244
|
+
lineBreakStrategy,
|
|
245
|
+
textAttributes.lineBreakStrategy),
|
|
246
|
+
debugStringConvertibleItem(
|
|
247
|
+
"lineBreakModeIOS", lineBreakMode, textAttributes.lineBreakMode),
|
|
248
|
+
|
|
249
|
+
// Decoration
|
|
250
|
+
debugStringConvertibleItem(
|
|
251
|
+
"textDecorationColor",
|
|
252
|
+
textDecorationColor,
|
|
253
|
+
textAttributes.textDecorationColor),
|
|
254
|
+
debugStringConvertibleItem(
|
|
255
|
+
"textDecorationLineType",
|
|
256
|
+
textDecorationLineType,
|
|
257
|
+
textAttributes.textDecorationLineType),
|
|
258
|
+
debugStringConvertibleItem(
|
|
259
|
+
"textDecorationStyle",
|
|
260
|
+
textDecorationStyle,
|
|
261
|
+
textAttributes.textDecorationStyle),
|
|
262
|
+
|
|
263
|
+
// Shadow
|
|
264
|
+
debugStringConvertibleItem(
|
|
265
|
+
"textShadowOffset",
|
|
266
|
+
textShadowOffset,
|
|
267
|
+
textAttributes.textShadowOffset),
|
|
268
|
+
debugStringConvertibleItem(
|
|
269
|
+
"textShadowRadius",
|
|
270
|
+
textShadowRadius,
|
|
271
|
+
textAttributes.textShadowRadius),
|
|
272
|
+
debugStringConvertibleItem(
|
|
273
|
+
"textShadowColor", textShadowColor, textAttributes.textShadowColor),
|
|
274
|
+
|
|
275
|
+
// Special
|
|
276
|
+
debugStringConvertibleItem(
|
|
277
|
+
"isHighlighted", isHighlighted, textAttributes.isHighlighted),
|
|
278
|
+
debugStringConvertibleItem(
|
|
279
|
+
"isPressable", isPressable, textAttributes.isPressable),
|
|
280
|
+
debugStringConvertibleItem(
|
|
281
|
+
"layoutDirection", layoutDirection, textAttributes.layoutDirection),
|
|
282
|
+
debugStringConvertibleItem(
|
|
283
|
+
"accessibilityRole",
|
|
284
|
+
accessibilityRole,
|
|
285
|
+
textAttributes.accessibilityRole),
|
|
286
|
+
debugStringConvertibleItem("role", role, textAttributes.role),
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
#endif
|
|
290
|
+
|
|
291
|
+
} // namespace facebook::react
|
|
@@ -10,13 +10,11 @@
|
|
|
10
10
|
#pragma warning(push)
|
|
11
11
|
#pragma warning(disable : 4996) // deprecated APIs
|
|
12
12
|
#endif
|
|
13
|
-
#include
|
|
13
|
+
#include "EventQueueProcessor.h"
|
|
14
14
|
#include <logger/react_native_log.h>
|
|
15
15
|
#include <react/featureflags/ReactNativeFeatureFlags.h>
|
|
16
16
|
#include "EventEmitter.h"
|
|
17
17
|
#include "EventLogger.h"
|
|
18
|
-
#include "EventQueue.h"
|
|
19
|
-
#include "ShadowNodeFamily.h"
|
|
20
18
|
|
|
21
19
|
namespace facebook::react {
|
|
22
20
|
|