react-native-macos 0.81.4 → 0.81.6

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 (45) hide show
  1. package/Libraries/Components/Pressable/Pressable.js +8 -1
  2. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +16 -0
  3. package/Libraries/Components/TextInput/TextInput.js +26 -9
  4. package/Libraries/Components/View/View.js +30 -10
  5. package/Libraries/Core/ReactNativeVersion.js +1 -1
  6. package/Libraries/LinkingIOS/RCTLinkingManager.mm +119 -0
  7. package/Libraries/LinkingIOS/React-RCTLinking.podspec +0 -4
  8. package/Libraries/Text/RCTTextAttributes.mm +1 -1
  9. package/Libraries/Text/TextInput/Multiline/RCTUITextView.mm +1 -1
  10. package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +1 -1
  11. package/Libraries/Utilities/normalizeLegacyHandledKeyEvents.js +164 -0
  12. package/React/Base/RCTRootView.m +7 -0
  13. package/React/Base/RCTUIKit.h +18 -7
  14. package/React/Base/RCTVersion.m +1 -1
  15. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +9 -0
  16. package/React/Base/macOS/RCTUIKit.m +65 -8
  17. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +6 -0
  18. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +77 -1
  19. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +4 -0
  20. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +93 -3
  21. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +306 -8
  22. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +6 -0
  23. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +26 -18
  24. package/React/Modules/RCTUIManager.mm +1 -1
  25. package/React/Views/RCTCursor.m +0 -1
  26. package/React/Views/RCTView.m +1 -2
  27. package/React/Views/ScrollView/RCTScrollView.m +25 -0
  28. package/React/Views/UIView+React.m +1 -1
  29. package/ReactAndroid/gradle.properties +1 -1
  30. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
  31. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  32. package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +1 -1
  33. package/ReactCommon/react/renderer/graphics/Color.h +1 -0
  34. package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.h +10 -0
  35. package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.mm +83 -6
  36. package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/PlatformColorParser.mm +18 -0
  37. package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/RCTPlatformColorUtils.mm +144 -3
  38. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +1 -1
  39. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.h +2 -2
  40. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +3 -3
  41. package/local-cli/generate-macos.js +0 -3
  42. package/local-cli/generator-common/index.js +5 -5
  43. package/local-cli/generator-macos/index.js +7 -22
  44. package/package.json +2 -2
  45. package/Libraries/LinkingIOS/macos/RCTLinkingManager.mm +0 -123
@@ -1,123 +0,0 @@
1
- /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
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
- // [macOS]
9
-
10
- #import "RCTLinkingManager.h"
11
-
12
- #import <FBReactNativeSpec/FBReactNativeSpec.h>
13
-
14
- #import <React/RCTBridge.h>
15
- #import <React/RCTEventDispatcher.h>
16
- #import <React/RCTUtils.h>
17
-
18
- #import "RCTLinkingPlugins.h"
19
-
20
- NSString *const RCTOpenURLNotification = @"RCTOpenURLNotification";
21
-
22
- static NSString *initialURL = nil;
23
- static BOOL moduleInitalized = NO;
24
- static BOOL alwaysForegroundLastWindow = YES;
25
-
26
- static void postNotificationWithURL(NSString *url, id sender)
27
- {
28
- NSDictionary<NSString *, id> *payload = @{@"url": url};
29
- [[NSNotificationCenter defaultCenter] postNotificationName:RCTOpenURLNotification
30
- object:sender
31
- userInfo:payload];
32
- }
33
-
34
- @implementation RCTLinkingManager
35
-
36
- RCT_EXPORT_MODULE()
37
-
38
- - (dispatch_queue_t)methodQueue
39
- {
40
- return dispatch_get_main_queue();
41
- }
42
-
43
- - (void)startObserving
44
- {
45
- moduleInitalized = YES;
46
-
47
- [[NSNotificationCenter defaultCenter] addObserver:self
48
- selector:@selector(handleOpenURLNotification:)
49
- name:RCTOpenURLNotification
50
- object:nil];
51
- }
52
-
53
- - (void)stopObserving
54
- {
55
- moduleInitalized = NO;
56
- [[NSNotificationCenter defaultCenter] removeObserver:self];
57
- }
58
-
59
- - (NSArray<NSString *> *)supportedEvents
60
- {
61
- return @[@"url"];
62
- }
63
-
64
- + (void)setAlwaysForegroundLastWindow:(BOOL)alwaysForeground
65
- {
66
- alwaysForegroundLastWindow = alwaysForeground;
67
- }
68
-
69
- + (void)getUrlEventHandler:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
70
- {
71
- // extract url value from the event
72
- NSString* url = [[event paramDescriptorForKeyword:keyDirectObject] stringValue];
73
-
74
- // If the application was launched via URL, this handler will be called before
75
- // the module is initialized by the bridge. Store the initial URL, becase we are not listening to the notification yet.
76
- if (!moduleInitalized && initialURL == nil) {
77
- initialURL = url;
78
- }
79
-
80
- postNotificationWithURL(url, self);
81
- }
82
-
83
- - (void)handleOpenURLNotification:(NSNotification *)notification
84
- {
85
- // Activate app, because [NSApp mainWindow] returns nil when the app is hidden and another app is maximized
86
- [NSApp activateIgnoringOtherApps:YES];
87
- // foreground top level window
88
- if (alwaysForegroundLastWindow) {
89
- NSWindow *lastWindow = [[NSApp windows] lastObject];
90
- [lastWindow makeKeyAndOrderFront:nil];
91
- }
92
- [self sendEventWithName:@"url" body:notification.userInfo];
93
- }
94
-
95
- RCT_EXPORT_METHOD(openURL:(NSURL *)URL
96
- resolve:(RCTPromiseResolveBlock)resolve
97
- reject:(RCTPromiseRejectBlock)reject)
98
- {
99
- BOOL result = [[NSWorkspace sharedWorkspace] openURL:URL];
100
- if (result) {
101
- resolve(@YES);
102
- } else {
103
- reject(RCTErrorUnspecified, [NSString stringWithFormat:@"Unable to open URL: %@", URL], nil);
104
- }
105
- }
106
-
107
- RCT_EXPORT_METHOD(canOpenURL:(NSURL *)URL
108
- resolve:(RCTPromiseResolveBlock)resolve
109
- reject:(__unused RCTPromiseRejectBlock)reject)
110
- {
111
- resolve(@YES);
112
- }
113
-
114
- RCT_EXPORT_METHOD(getInitialURL:(RCTPromiseResolveBlock)resolve
115
- reject:(__unused RCTPromiseRejectBlock)reject)
116
- {
117
- resolve(RCTNullIfNil(initialURL));
118
- }
119
- @end
120
-
121
- Class RCTLinkingManagerCls(void) {
122
- return RCTLinkingManager.class;
123
- }