@legendapp/spark 0.0.2 → 0.0.3

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 (87) hide show
  1. package/package.json +2 -2
  2. package/patches/dependencies.json +252 -0
  3. package/patches/expo-application@55.0.19.patch +54 -0
  4. package/patches/expo-blur@55.0.18.patch +130 -0
  5. package/patches/expo-device@55.0.21.patch +149 -0
  6. package/patches/expo-font@55.0.8.patch +55 -0
  7. package/patches/expo-glass-effect@55.0.11.patch +304 -0
  8. package/patches/expo-haptics@55.0.18.patch +54 -0
  9. package/patches/expo-image-manipulator@55.0.21.patch +312 -0
  10. package/patches/expo-image-picker@55.0.24.patch +327 -0
  11. package/patches/expo-image@55.0.11.patch +158 -0
  12. package/patches/expo-keep-awake@55.0.8.patch +41 -0
  13. package/patches/expo-localization@55.0.19.patch +32 -0
  14. package/patches/expo-location@55.1.15.patch +190 -0
  15. package/patches/expo-symbols@55.0.9.patch +286 -0
  16. package/patches/expo-system-ui@55.0.22.patch +61 -0
  17. package/patches/expo-web-browser@55.0.20.patch +13 -0
  18. package/patches/react-native-app-logs@0.3.1.patch +20 -0
  19. package/patches/react-native-blurhash@2.1.3.patch +318 -0
  20. package/patches/react-native-community-blur@4.4.1.patch +415 -0
  21. package/patches/react-native-community-datetimepicker@9.2.2.patch +320 -0
  22. package/patches/react-native-fast-image@10.9.9.patch +131 -0
  23. package/patches/react-native-graph@1.4.0.patch +157 -0
  24. package/patches/react-native-keyboard-controller@1.22.9.patch +16 -0
  25. package/patches/react-native-masked-view-masked-view@0.3.2.patch +140 -0
  26. package/patches/react-native-mmkv@4.3.2.patch +40 -0
  27. package/patches/react-native-nitro-fetch@1.9.0.patch +130 -0
  28. package/patches/react-native-nitro-zxing@0.3.0.patch +13 -0
  29. package/patches/react-native-quick-base64@3.0.1.patch +13 -0
  30. package/patches/react-native-quick-crypto@1.1.9.patch +31 -0
  31. package/patches/react-native-release-profiler@0.4.5.patch +37 -0
  32. package/patches/react-native-screen-corner-radius@0.2.3.patch +13 -0
  33. package/patches/react-native-screens@4.23.0.patch +160 -0
  34. package/patches/react-native-svg@15.15.3.patch +31 -0
  35. package/patches/react-native-unistyles@3.6.0.patch +203 -0
  36. package/patches/react-native-worklets-core@1.6.3.patch +13 -0
  37. package/patches/react-navigation-native-stack@7.21.0.patch +16 -0
  38. package/patches/sentry-react-native@8.32.0.patch +76 -0
  39. package/skills/spark/UPGRADING.md +34 -0
  40. package/vendor/node_modules/@legendapp/spark-ai/package.json +3 -3
  41. package/vendor/node_modules/@legendapp/spark-audio/package.json +2 -2
  42. package/vendor/node_modules/@legendapp/spark-auth-session/package.json +3 -3
  43. package/vendor/node_modules/@legendapp/spark-cli/dist/build.js +6 -3
  44. package/vendor/node_modules/@legendapp/spark-cli/dist/dev.js +7 -2
  45. package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.cjs +3 -0
  46. package/vendor/node_modules/@legendapp/spark-cli/dist/project.js +13 -1
  47. package/vendor/node_modules/@legendapp/spark-cli/dist/release.json +11 -11
  48. package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-input-cache.js +140 -0
  49. package/vendor/node_modules/@legendapp/spark-cli/package.json +3 -3
  50. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/package.json +2 -2
  51. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/package.json +2 -2
  52. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/package.json +2 -2
  53. package/vendor/node_modules/@legendapp/spark-clipboard/package.json +2 -2
  54. package/vendor/node_modules/@legendapp/spark-codex/package.json +2 -2
  55. package/vendor/node_modules/@legendapp/spark-commands/package.json +5 -5
  56. package/vendor/node_modules/@legendapp/spark-context-menu/package.json +2 -2
  57. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkTestDriver.mm +64 -2
  58. package/vendor/node_modules/@legendapp/spark-desktop-app/package.json +1 -1
  59. package/vendor/node_modules/@legendapp/spark-desktop-config/autolinking.cjs +3 -2
  60. package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.cjs +28 -10
  61. package/vendor/node_modules/@legendapp/spark-desktop-config/package.json +3 -3
  62. package/vendor/node_modules/@legendapp/spark-desktop-host/package.json +2 -2
  63. package/vendor/node_modules/@legendapp/spark-desktop-links/package.json +2 -2
  64. package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/package.json +2 -2
  65. package/vendor/node_modules/@legendapp/spark-desktop-windows/package.json +3 -3
  66. package/vendor/node_modules/@legendapp/spark-documents/package.json +7 -7
  67. package/vendor/node_modules/@legendapp/spark-drag-drop/package.json +2 -2
  68. package/vendor/node_modules/@legendapp/spark-file-dialog/package.json +2 -2
  69. package/vendor/node_modules/@legendapp/spark-file-system/package.json +2 -2
  70. package/vendor/node_modules/@legendapp/spark-global-shortcuts/package.json +2 -2
  71. package/vendor/node_modules/@legendapp/spark-html/package.json +2 -2
  72. package/vendor/node_modules/@legendapp/spark-markdown/package.json +2 -2
  73. package/vendor/node_modules/@legendapp/spark-message-dialog/package.json +2 -2
  74. package/vendor/node_modules/@legendapp/spark-native-menu/package.json +2 -2
  75. package/vendor/node_modules/@legendapp/spark-notifications/package.json +2 -2
  76. package/vendor/node_modules/@legendapp/spark-processes/package.json +2 -2
  77. package/vendor/node_modules/@legendapp/spark-rich-text/package.json +2 -2
  78. package/vendor/node_modules/@legendapp/spark-secure-storage/package.json +2 -2
  79. package/vendor/node_modules/@legendapp/spark-settings/package.json +3 -3
  80. package/vendor/node_modules/@legendapp/spark-settings-ui/package.json +4 -4
  81. package/vendor/node_modules/@legendapp/spark-sqlite/package.json +3 -3
  82. package/vendor/node_modules/@legendapp/spark-system/package.json +2 -2
  83. package/vendor/node_modules/@legendapp/spark-tray/package.json +2 -2
  84. package/vendor/node_modules/@legendapp/spark-ui/package.json +2 -2
  85. package/vendor/node_modules/@legendapp/spark-updates/package.json +2 -2
  86. package/vendor/node_modules/@legendapp/spark-webview/package.json +2 -2
  87. package/vendor/node_modules/@legendapp/spark-window-options/package.json +1 -1
@@ -0,0 +1,190 @@
1
+ diff --git a/ios/EXLocation.h b/ios/EXLocation.h
2
+ index 6e6c661..4954506 100644
3
+ --- a/ios/EXLocation.h
4
+ +++ b/ios/EXLocation.h
5
+ @@ -17,6 +17,8 @@ typedef NS_ENUM(NSUInteger, EXLocationAccuracy) {
6
+
7
+ + (NSDictionary *)exportLocation:(CLLocation *)location;
8
+ + (CLLocationAccuracy)CLLocationAccuracyFromOption:(EXLocationAccuracy)accuracy;
9
+ +#if !TARGET_OS_OSX
10
+ + (CLActivityType)CLActivityTypeFromOption:(NSInteger)activityType;
11
+ +#endif
12
+
13
+ @end
14
+ diff --git a/ios/EXLocation.m b/ios/EXLocation.m
15
+ index 0442c37..ac375c6 100644
16
+ --- a/ios/EXLocation.m
17
+ +++ b/ios/EXLocation.m
18
+ @@ -42,6 +42,7 @@ + (CLLocationAccuracy)CLLocationAccuracyFromOption:(EXLocationAccuracy)accuracy
19
+ }
20
+ }
21
+
22
+ +#if !TARGET_OS_OSX
23
+ + (CLActivityType)CLActivityTypeFromOption:(NSInteger)activityType
24
+ {
25
+ if (activityType >= CLActivityTypeOther && activityType <= CLActivityTypeOtherNavigation) {
26
+ @@ -52,6 +53,7 @@ + (CLActivityType)CLActivityTypeFromOption:(NSInteger)activityType
27
+ }
28
+ return CLActivityTypeOther;
29
+ }
30
+ +#endif
31
+
32
+ @end
33
+
34
+ diff --git a/ios/ExpoLocation.podspec b/ios/ExpoLocation.podspec
35
+ index df166fe..2214d91 100644
36
+ --- a/ios/ExpoLocation.podspec
37
+ +++ b/ios/ExpoLocation.podspec
38
+ @@ -11,7 +11,8 @@ Pod::Spec.new do |s|
39
+ s.author = package['author']
40
+ s.homepage = package['homepage']
41
+ s.platforms = {
42
+ - :ios => '15.1'
43
+ + :ios => '15.1',
44
+ + :osx => '14.0'
45
+ }
46
+ s.source = { git: 'https://github.com/expo/expo.git' }
47
+ s.static_framework = true
48
+ diff --git a/ios/Providers/BaseLocationProvider.swift b/ios/Providers/BaseLocationProvider.swift
49
+ index ae9135a..98dcce1 100644
50
+ --- a/ios/Providers/BaseLocationProvider.swift
51
+ +++ b/ios/Providers/BaseLocationProvider.swift
52
+ @@ -9,7 +9,9 @@ internal class BaseLocationProvider: NSObject, CLLocationManagerDelegate {
53
+ @MainActor
54
+ init(options: LocationOptions) {
55
+ super.init()
56
+ + #if !os(macOS)
57
+ manager.allowsBackgroundLocationUpdates = false
58
+ + #endif
59
+ manager.distanceFilter = options.distanceInterval
60
+ manager.desiredAccuracy = options.accuracy.toCLLocationAccuracy()
61
+ manager.delegate = self
62
+ diff --git a/ios/Providers/DeviceHeadingStreamer.swift b/ios/Providers/DeviceHeadingStreamer.swift
63
+ index 802bf57..47d89a3 100644
64
+ --- a/ios/Providers/DeviceHeadingStreamer.swift
65
+ +++ b/ios/Providers/DeviceHeadingStreamer.swift
66
+ @@ -25,14 +25,19 @@ internal class DeviceHeadingStreamer: BaseStreamer {
67
+ }
68
+ let stream = DeviceHeadingStream { continuation in
69
+ self.continuation = continuation
70
+ + // Macs have no compass; headingAvailable() is false there, so this is never reached.
71
+ + #if !os(macOS)
72
+ manager.startUpdatingHeading()
73
+ + #endif
74
+ }
75
+ headingStream = stream
76
+ return stream
77
+ }
78
+
79
+ override func stopStreaming() {
80
+ + #if !os(macOS)
81
+ manager.stopUpdatingHeading()
82
+ + #endif
83
+ continuation?.finish()
84
+
85
+ headingStream = nil
86
+ diff --git a/ios/Requesters/EXBackgroundLocationPermissionRequester.m b/ios/Requesters/EXBackgroundLocationPermissionRequester.m
87
+ index aa54f8c..a2e4918 100644
88
+ --- a/ios/Requesters/EXBackgroundLocationPermissionRequester.m
89
+ +++ b/ios/Requesters/EXBackgroundLocationPermissionRequester.m
90
+ @@ -14,6 +14,12 @@ @interface EXBackgroundLocationPermissionRequester ()
91
+
92
+ @end
93
+
94
+ +#if TARGET_OS_OSX
95
+ +#import <AppKit/AppKit.h>
96
+ +#define UIApplicationWillResignActiveNotification NSApplicationWillResignActiveNotification
97
+ +#define UIApplicationDidBecomeActiveNotification NSApplicationDidBecomeActiveNotification
98
+ +#endif
99
+ +
100
+ @implementation EXBackgroundLocationPermissionRequester
101
+
102
+ - (instancetype)init
103
+ diff --git a/ios/Requesters/EXBaseLocationRequester.h b/ios/Requesters/EXBaseLocationRequester.h
104
+ index ae63560..d29a8be 100644
105
+ --- a/ios/Requesters/EXBaseLocationRequester.h
106
+ +++ b/ios/Requesters/EXBaseLocationRequester.h
107
+ @@ -5,6 +5,11 @@
108
+ #import <ExpoModulesCore/EXPermissionsInterface.h>
109
+ #import <CoreLocation/CLLocationManagerDelegate.h>
110
+
111
+ +#if TARGET_OS_OSX
112
+ +// macOS has no when-in-use authorization and never reports it; keep the shared status switches compiling.
113
+ +#define kCLAuthorizationStatusAuthorizedWhenInUse ((CLAuthorizationStatus)4)
114
+ +#endif
115
+ +
116
+ @interface EXBaseLocationRequester : NSObject<EXPermissionsRequester, CLLocationManagerDelegate>
117
+
118
+ @property (nonatomic, strong) CLLocationManager *locationManager;
119
+ diff --git a/ios/Requesters/EXBaseLocationRequester.m b/ios/Requesters/EXBaseLocationRequester.m
120
+ index 350eb5f..c8f6d82 100644
121
+ --- a/ios/Requesters/EXBaseLocationRequester.m
122
+ +++ b/ios/Requesters/EXBaseLocationRequester.m
123
+ @@ -37,7 +37,12 @@ - (NSDictionary *)getPermissions {
124
+
125
+ CLAuthorizationStatus systemStatus;
126
+ if (![EXBaseLocationRequester isConfiguredForAlwaysAuthorization] && ![EXBaseLocationRequester isConfiguredForWhenInUseAuthorization]) {
127
+ +#if TARGET_OS_OSX
128
+ + // RCTFatal throws in Release; on macOS the missing key reports denied, as it does in Debug.
129
+ + RCTLogError(@"This app is missing NSLocationWhenInUseUsageDescription in its macOS Info.plist, so location services will fail.");
130
+ +#else
131
+ RCTFatal(RCTErrorWithMessage(@"This app is missing usage descriptions, so location services will fail. Add one of the `NSLocation*UsageDescription` keys to your bundle's Info.plist. See https://bit.ly/3iLqy6S (https://docs.expo.dev/distribution/app-stores/#system-permissions-dialogs-on-ios) for more information."));
132
+ +#endif
133
+ systemStatus = kCLAuthorizationStatusDenied;
134
+ } else {
135
+ systemStatus = [CLLocationManager authorizationStatus];
136
+ diff --git a/ios/TaskConsumers/EXGeofencingTaskConsumer.m b/ios/TaskConsumers/EXGeofencingTaskConsumer.m
137
+ index 7e6482e..c94f09e 100644
138
+ --- a/ios/TaskConsumers/EXGeofencingTaskConsumer.m
139
+ +++ b/ios/TaskConsumers/EXGeofencingTaskConsumer.m
140
+ @@ -71,8 +71,10 @@ - (void)startMonitoringRegionsForTask:(id<EXTaskInterface>)task
141
+ self->_regionStates = regionStates;
142
+
143
+ locationManager.delegate = self;
144
+ +#if !TARGET_OS_OSX
145
+ locationManager.allowsBackgroundLocationUpdates = YES;
146
+ locationManager.pausesLocationUpdatesAutomatically = NO;
147
+ +#endif
148
+
149
+ for (NSDictionary *regionDict in regions) {
150
+ NSString *identifier = regionDict[@"identifier"] ?: [[NSUUID UUID] UUIDString];
151
+ diff --git a/ios/TaskConsumers/EXLocationTaskConsumer.m b/ios/TaskConsumers/EXLocationTaskConsumer.m
152
+ index fe1d9dd..75df305 100644
153
+ --- a/ios/TaskConsumers/EXLocationTaskConsumer.m
154
+ +++ b/ios/TaskConsumers/EXLocationTaskConsumer.m
155
+ @@ -49,7 +49,9 @@ - (void)didRegisterTask:(id<EXTaskInterface>)task
156
+ self->_locationManager = locationManager;
157
+
158
+ locationManager.delegate = self;
159
+ +#if !TARGET_OS_OSX
160
+ locationManager.allowsBackgroundLocationUpdates = YES;
161
+ +#endif
162
+
163
+ // Set options-specific things in location manager.
164
+ [self setOptions:task.options];
165
+ @@ -69,9 +71,11 @@ - (void)setOptions:(NSDictionary *)options
166
+
167
+ locationManager.desiredAccuracy = [EXLocation CLLocationAccuracyFromOption:accuracy];
168
+ locationManager.distanceFilter = [self numberToDouble:options[@"distanceInterval"] defaultValue:kCLDistanceFilterNone];
169
+ +#if !TARGET_OS_OSX
170
+ locationManager.activityType = [EXLocation CLActivityTypeFromOption:[self numberToInteger:options[@"activityType"] defaultValue:CLActivityTypeOther]];
171
+ locationManager.pausesLocationUpdatesAutomatically = [self numberToBool:options[@"pausesUpdatesAutomatically"] defaultValue:true];
172
+ locationManager.showsBackgroundLocationIndicator = [self numberToBool:options[@"showsBackgroundLocationIndicator"] defaultValue:false];
173
+ +#endif
174
+
175
+ [locationManager startUpdatingLocation];
176
+ [locationManager startMonitoringSignificantLocationChanges];
177
+ @@ -145,9 +149,13 @@ - (BOOL)shouldReportDeferredLocations
178
+ if (_deferredLocations.count <= 0) {
179
+ return NO;
180
+ }
181
+ +#if TARGET_OS_OSX
182
+ + if (NSApp.isActive) {
183
+ +#else
184
+ UIApplicationState appState = [[UIApplication sharedApplication] applicationState];
185
+
186
+ if (appState == UIApplicationStateActive) {
187
+ +#endif
188
+ // Don't defer location updates when app is in foreground state.
189
+ return YES;
190
+ }
@@ -0,0 +1,286 @@
1
+ diff --git a/build/SymbolView.macos.js b/build/SymbolView.macos.js
2
+ new file mode 100644
3
+ index 0000000..27f2612
4
+ --- /dev/null
5
+ +++ b/build/SymbolView.macos.js
6
+ @@ -0,0 +1,2 @@
7
+ +// macOS renders SF Symbols natively, like iOS.
8
+ +export * from './SymbolView.ios';
9
+ diff --git a/build/materialImageSource.macos.js b/build/materialImageSource.macos.js
10
+ new file mode 100644
11
+ index 0000000..770d07d
12
+ --- /dev/null
13
+ +++ b/build/materialImageSource.macos.js
14
+ @@ -0,0 +1,2 @@
15
+ +// macOS renders SF Symbols natively, like iOS.
16
+ +export * from './materialImageSource.ios';
17
+ diff --git a/build/utils.macos.js b/build/utils.macos.js
18
+ new file mode 100644
19
+ index 0000000..cd5ed0b
20
+ --- /dev/null
21
+ +++ b/build/utils.macos.js
22
+ @@ -0,0 +1,2 @@
23
+ +// macOS renders SF Symbols natively, like iOS.
24
+ +export * from './utils.ios';
25
+ diff --git a/ios/ExpoSymbols.podspec b/ios/ExpoSymbols.podspec
26
+ index 21fe2d7..a40eae2 100644
27
+ --- a/ios/ExpoSymbols.podspec
28
+ +++ b/ios/ExpoSymbols.podspec
29
+ @@ -12,7 +12,8 @@ Pod::Spec.new do |s|
30
+ s.homepage = package['homepage']
31
+ s.platforms = {
32
+ :ios => '15.1',
33
+ - :tvos => '15.1'
34
+ + :tvos => '15.1',
35
+ + :osx => '14.0'
36
+ }
37
+ s.swift_version = '5.9'
38
+ s.source = { git: 'https://github.com/expo/expo.git' }
39
+ diff --git a/ios/SymbolEffects.swift b/ios/SymbolEffects.swift
40
+ index dcfac39..c07d278 100644
41
+ --- a/ios/SymbolEffects.swift
42
+ +++ b/ios/SymbolEffects.swift
43
+ @@ -1,6 +1,6 @@
44
+ @available(iOS 17.0, tvOS 17.0, *)
45
+ internal protocol EffectAdding {
46
+ - func add(to view: UIImageView, with options: SymbolEffectOptions)
47
+ + func add(to view: SymbolImageView, with options: SymbolEffectOptions)
48
+ }
49
+
50
+ @available(iOS 17.0, tvOS 17.0, *)
51
+ @@ -9,7 +9,7 @@ internal struct BounceEffect: EffectAdding {
52
+ let wholeSymbol: Bool?
53
+ let direction: AnimationDirection?
54
+
55
+ - func add(to view: UIImageView, with options: SymbolEffectOptions) {
56
+ + func add(to view: SymbolImageView, with options: SymbolEffectOptions) {
57
+ var finalEffect = effect
58
+ if wholeSymbol ?? false {
59
+ finalEffect = finalEffect.wholeSymbol
60
+ @@ -28,7 +28,7 @@ internal struct PulseEffect: EffectAdding {
61
+ private let effect: PulseSymbolEffect = .pulse
62
+ let wholeSymbol: Bool?
63
+
64
+ - func add(to view: UIImageView, with options: SymbolEffectOptions) {
65
+ + func add(to view: SymbolImageView, with options: SymbolEffectOptions) {
66
+ var finalEffect = effect
67
+ if wholeSymbol ?? false {
68
+ finalEffect = finalEffect.wholeSymbol
69
+ @@ -43,7 +43,7 @@ internal struct ScaleEffect: EffectAdding {
70
+ let wholeSymbol: Bool?
71
+ let direction: AnimationDirection?
72
+
73
+ - func add(to view: UIImageView, with options: SymbolEffectOptions) {
74
+ + func add(to view: SymbolImageView, with options: SymbolEffectOptions) {
75
+ var finalEffect = effect
76
+ if wholeSymbol ?? false {
77
+ finalEffect = finalEffect.wholeSymbol
78
+ diff --git a/ios/SymbolModule.swift b/ios/SymbolModule.swift
79
+ index 304cde1..fa273d7 100644
80
+ --- a/ios/SymbolModule.swift
81
+ +++ b/ios/SymbolModule.swift
82
+ @@ -14,7 +14,11 @@ public class SymbolModule: Module {
83
+ }
84
+
85
+ Prop("scale") { (view, scale: SymbolScale?) in
86
+ + #if os(macOS)
87
+ + view.scale = scale?.imageSymbolScale()
88
+ + #else
89
+ view.scale = scale?.imageSymbolScale() ?? .unspecified
90
+ + #endif
91
+ }
92
+
93
+ Prop("tintColor") { (view, color: UIColor?) in
94
+ @@ -34,7 +38,11 @@ public class SymbolModule: Module {
95
+ }
96
+
97
+ Prop("resizeMode") { (view, resizeMode: SymbolContentMode?) in
98
+ + #if os(macOS)
99
+ + view.imageContentMode = resizeMode?.toContentMode() ?? .scaleProportionallyUpOrDown
100
+ + #else
101
+ view.imageContentMode = resizeMode?.toContentMode() ?? .scaleAspectFit
102
+ + #endif
103
+ }
104
+
105
+ Prop("animationSpec") { (view, spec: AnimationSpec?) in
106
+ diff --git a/ios/SymbolRecords.swift b/ios/SymbolRecords.swift
107
+ index f276485..5f978a1 100644
108
+ --- a/ios/SymbolRecords.swift
109
+ +++ b/ios/SymbolRecords.swift
110
+ @@ -7,6 +7,20 @@ enum SymbolScale: String, Enumerable {
111
+ case medium
112
+ case large
113
+
114
+ + #if os(macOS)
115
+ + func imageSymbolScale() -> NSImage.SymbolScale? {
116
+ + switch self {
117
+ + case .small:
118
+ + return .small
119
+ + case .medium:
120
+ + return .medium
121
+ + case .large:
122
+ + return .large
123
+ + case .default, .unspecified:
124
+ + return nil
125
+ + }
126
+ + }
127
+ + #else
128
+ func imageSymbolScale() -> UIImage.SymbolScale {
129
+ switch self {
130
+ case .default:
131
+ @@ -21,6 +35,7 @@ enum SymbolScale: String, Enumerable {
132
+ return .unspecified
133
+ }
134
+ }
135
+ + #endif
136
+ }
137
+
138
+ enum SymbolWeight: String, Enumerable {
139
+ @@ -35,10 +50,20 @@ enum SymbolWeight: String, Enumerable {
140
+ case heavy
141
+ case black
142
+
143
+ - func imageSymbolWeight() -> UIImage.SymbolWeight {
144
+ + #if os(macOS)
145
+ + typealias ImageSymbolWeight = NSFont.Weight
146
+ + #else
147
+ + typealias ImageSymbolWeight = UIImage.SymbolWeight
148
+ + #endif
149
+ +
150
+ + func imageSymbolWeight() -> ImageSymbolWeight {
151
+ switch self {
152
+ case .unspecified:
153
+ + #if os(macOS)
154
+ + return .regular
155
+ + #else
156
+ return .unspecified
157
+ + #endif
158
+ case .ultraLight:
159
+ return .ultraLight
160
+ case .thin:
161
+ @@ -76,6 +101,19 @@ enum SymbolContentMode: String, Enumerable {
162
+ case bottomLeft
163
+ case bottomRight
164
+
165
+ + #if os(macOS)
166
+ + // NSImageView can only stretch, fit, or draw at its natural size.
167
+ + func toContentMode() -> NSImageScaling {
168
+ + switch self {
169
+ + case .scaleToFill:
170
+ + return .scaleAxesIndependently
171
+ + case .scaleAspectFit, .scaleAspectFill:
172
+ + return .scaleProportionallyUpOrDown
173
+ + default:
174
+ + return .scaleNone
175
+ + }
176
+ + }
177
+ + #else
178
+ func toContentMode() -> UIView.ContentMode {
179
+ switch self {
180
+ case .scaleToFill:
181
+ @@ -106,6 +144,7 @@ enum SymbolContentMode: String, Enumerable {
182
+ return .bottomRight
183
+ }
184
+ }
185
+ + #endif
186
+ }
187
+
188
+ enum SymbolType: String, Enumerable {
189
+ diff --git a/ios/SymbolView.swift b/ios/SymbolView.swift
190
+ index 5e59ad5..edfb848 100644
191
+ --- a/ios/SymbolView.swift
192
+ +++ b/ios/SymbolView.swift
193
+ @@ -1,13 +1,25 @@
194
+ import ExpoModulesCore
195
+
196
+ +#if os(macOS)
197
+ +typealias SymbolImageView = NSImageView
198
+ +#else
199
+ +typealias SymbolImageView = UIImageView
200
+ +#endif
201
+ +
202
+ class SymbolView: ExpoView {
203
+ - let imageView = UIImageView()
204
+ + let imageView = SymbolImageView()
205
+
206
+ // MARK: Properties
207
+ var name: String = ""
208
+ + #if os(macOS)
209
+ + var weight: NSFont.Weight = .regular
210
+ + var scale: NSImage.SymbolScale?
211
+ + var imageContentMode: NSImageScaling = .scaleAxesIndependently
212
+ + #else
213
+ var weight: UIImage.SymbolWeight = .unspecified
214
+ var scale: UIImage.SymbolScale = .default
215
+ var imageContentMode: UIView.ContentMode = .scaleToFill
216
+ + #endif
217
+ var symbolType: SymbolType = .monochrome
218
+ var tint: UIColor?
219
+ var animationSpec: AnimationSpec?
220
+ @@ -23,6 +35,44 @@ class SymbolView: ExpoView {
221
+ imageView.frame = bounds
222
+ }
223
+
224
+ + #if os(macOS)
225
+ + func reloadSymbol() {
226
+ + guard let image = NSImage(systemSymbolName: name, accessibilityDescription: nil) else {
227
+ + return
228
+ + }
229
+ + imageView.imageScaling = imageContentMode
230
+ + imageView.symbolConfiguration = getSymbolConfig()
231
+ + // AppKit tints template images through the view rather than the image.
232
+ + imageView.contentTintColor = symbolType == .hierarchical ? nil : tint
233
+ + imageView.image = image
234
+ +
235
+ + // Effects need to be added last
236
+ + imageView.removeAllSymbolEffects()
237
+ + if animated {
238
+ + addSymbolEffects()
239
+ + }
240
+ + }
241
+ +
242
+ + private func getSymbolConfig() -> NSImage.SymbolConfiguration {
243
+ + var config = scale.map { NSImage.SymbolConfiguration(pointSize: NSFont.systemFontSize, weight: weight, scale: $0) }
244
+ + ?? NSImage.SymbolConfiguration(pointSize: NSFont.systemFontSize, weight: weight)
245
+ +
246
+ + switch symbolType {
247
+ + case .monochrome:
248
+ + config = config.applying(.preferringMonochrome())
249
+ + case .hierarchical:
250
+ + config = config.applying(NSImage.SymbolConfiguration(hierarchicalColor: tint ?? .systemBlue))
251
+ + case .palette:
252
+ + if palette.count > 1 {
253
+ + config = config.applying(NSImage.SymbolConfiguration(paletteColors: palette))
254
+ + }
255
+ + case .multicolor:
256
+ + config = config.applying(.preferringMulticolor())
257
+ + }
258
+ +
259
+ + return config
260
+ + }
261
+ + #else
262
+ func reloadSymbol() {
263
+ guard let image = UIImage(systemName: name) else {
264
+ return
265
+ @@ -45,6 +95,7 @@ class SymbolView: ExpoView {
266
+ }
267
+ }
268
+ }
269
+ + #endif
270
+
271
+ @available(iOS 17.0, tvOS 17.0, *)
272
+ private func addSymbolEffects() {
273
+ @@ -71,6 +122,7 @@ class SymbolView: ExpoView {
274
+ }
275
+ }
276
+
277
+ + #if !os(macOS)
278
+ private func getSymbolConfig() -> UIImage.SymbolConfiguration {
279
+ #if os(tvOS)
280
+ var config = UIImage.SymbolConfiguration(pointSize: 18.0, weight: weight, scale: scale)
281
+ @@ -95,4 +147,5 @@ class SymbolView: ExpoView {
282
+
283
+ return config
284
+ }
285
+ + #endif
286
+ }
@@ -0,0 +1,61 @@
1
+ diff --git a/ios/ExpoSystemUI/ExpoSystemUIModule.swift b/ios/ExpoSystemUI/ExpoSystemUIModule.swift
2
+ index 79e7b61..703babf 100644
3
+ --- a/ios/ExpoSystemUI/ExpoSystemUIModule.swift
4
+ +++ b/ios/ExpoSystemUI/ExpoSystemUIModule.swift
5
+ @@ -28,6 +28,36 @@ public class ExpoSystemUIModule: Module {
6
+ }
7
+ }
8
+
9
+ + #if os(macOS)
10
+ + // The app delegate owns the main window, as on iOS.
11
+ + static var mainWindow: NSWindow? {
12
+ + guard let delegate = NSApp.delegate as? NSObject, delegate.responds(to: Selector(("window"))) else {
13
+ + return nil
14
+ + }
15
+ + return delegate.value(forKey: "window") as? NSWindow
16
+ + }
17
+ +
18
+ + static func getBackgroundColor() -> String? {
19
+ + var color: String?
20
+ + EXUtilities.performSynchronously {
21
+ + if let backgroundColor = mainWindow?.backgroundColor.usingColorSpace(.sRGB)?.cgColor {
22
+ + color = EXUtilities.hexString(with: backgroundColor)
23
+ + }
24
+ + }
25
+ + return color
26
+ + }
27
+ +
28
+ + static func setBackgroundColorAsync(color: Int?) {
29
+ + EXUtilities.performSynchronously {
30
+ + if let color {
31
+ + UserDefaults.standard.set(color, forKey: colorKey)
32
+ + } else {
33
+ + UserDefaults.standard.removeObject(forKey: colorKey)
34
+ + }
35
+ + mainWindow?.backgroundColor = color.flatMap { EXUtilities.uiColor($0) } ?? .windowBackgroundColor
36
+ + }
37
+ + }
38
+ + #else
39
+ static func getBackgroundColor() -> String? {
40
+ var color: String?
41
+ EXUtilities.performSynchronously {
42
+ @@ -70,4 +100,5 @@ public class ExpoSystemUIModule: Module {
43
+ }
44
+ }
45
+ }
46
+ + #endif
47
+ }
48
+ diff --git a/ios/ExpoSystemUI.podspec b/ios/ExpoSystemUI.podspec
49
+ index 6cf5c56..0723ef6 100644
50
+ --- a/ios/ExpoSystemUI.podspec
51
+ +++ b/ios/ExpoSystemUI.podspec
52
+ @@ -12,7 +12,8 @@ Pod::Spec.new do |s|
53
+ s.homepage = package['homepage']
54
+ s.platforms = {
55
+ :ios => '15.1',
56
+ - :tvos => '15.1'
57
+ + :tvos => '15.1',
58
+ + :osx => '14.0'
59
+ }
60
+ s.swift_version = '5.9'
61
+ s.source = { git: 'https://github.com/expo/expo.git' }
@@ -0,0 +1,13 @@
1
+ diff --git a/ios/WebBrowserSession.swift b/ios/WebBrowserSession.swift
2
+ index d3d2981..1ac7c6b 100644
3
+ --- a/ios/WebBrowserSession.swift
4
+ +++ b/ios/WebBrowserSession.swift
5
+ @@ -126,6 +126,8 @@ internal class WebBrowserSession: NSObject, WKNavigationDelegate, WKUIDelegate,
6
+ }
7
+
8
+ func dismiss(completion: ((String) -> Void)? = nil) {
9
+ + // Closing reports "cancel" through windowWillClose, as for the user; a dismiss reports "dismiss", as on iOS.
10
+ + window?.delegate = nil
11
+ window?.close()
12
+ let type = "dismiss"
13
+ finish(type: type)
@@ -0,0 +1,20 @@
1
+ diff --git a/react-native-app-logs.podspec b/react-native-app-logs.podspec
2
+ index 9ce28e8..d815df0 100644
3
+ --- a/react-native-app-logs.podspec
4
+ +++ b/react-native-app-logs.podspec
5
+ @@ -11,7 +11,7 @@ Pod::Spec.new do |s|
6
+ s.license = package["license"]
7
+ s.authors = package["author"]
8
+
9
+ - s.platforms = { :ios => min_ios_version_supported }
10
+ + s.platforms = { :ios => min_ios_version_supported, :osx => "14.0" }
11
+ s.source = { :git => "https://github.com/kirillzyusko/react-native-app-logs.git", :tag => "#{s.version}" }
12
+
13
+ s.source_files = "ios/**/*.{h,m,mm,swift}"
14
+ diff --git a/src/bindings.macos.ts b/src/bindings.macos.ts
15
+ new file mode 100644
16
+ index 0000000..2d2a485
17
+ --- /dev/null
18
+ +++ b/src/bindings.macos.ts
19
+ @@ -0,0 +1 @@
20
+ +export { default } from './bindings.ios';