@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.
- package/package.json +2 -2
- package/patches/dependencies.json +252 -0
- package/patches/expo-application@55.0.19.patch +54 -0
- package/patches/expo-blur@55.0.18.patch +130 -0
- package/patches/expo-device@55.0.21.patch +149 -0
- package/patches/expo-font@55.0.8.patch +55 -0
- package/patches/expo-glass-effect@55.0.11.patch +304 -0
- package/patches/expo-haptics@55.0.18.patch +54 -0
- package/patches/expo-image-manipulator@55.0.21.patch +312 -0
- package/patches/expo-image-picker@55.0.24.patch +327 -0
- package/patches/expo-image@55.0.11.patch +158 -0
- package/patches/expo-keep-awake@55.0.8.patch +41 -0
- package/patches/expo-localization@55.0.19.patch +32 -0
- package/patches/expo-location@55.1.15.patch +190 -0
- package/patches/expo-symbols@55.0.9.patch +286 -0
- package/patches/expo-system-ui@55.0.22.patch +61 -0
- package/patches/expo-web-browser@55.0.20.patch +13 -0
- package/patches/react-native-app-logs@0.3.1.patch +20 -0
- package/patches/react-native-blurhash@2.1.3.patch +318 -0
- package/patches/react-native-community-blur@4.4.1.patch +415 -0
- package/patches/react-native-community-datetimepicker@9.2.2.patch +320 -0
- package/patches/react-native-fast-image@10.9.9.patch +131 -0
- package/patches/react-native-graph@1.4.0.patch +157 -0
- package/patches/react-native-keyboard-controller@1.22.9.patch +16 -0
- package/patches/react-native-masked-view-masked-view@0.3.2.patch +140 -0
- package/patches/react-native-mmkv@4.3.2.patch +40 -0
- package/patches/react-native-nitro-fetch@1.9.0.patch +130 -0
- package/patches/react-native-nitro-zxing@0.3.0.patch +13 -0
- package/patches/react-native-quick-base64@3.0.1.patch +13 -0
- package/patches/react-native-quick-crypto@1.1.9.patch +31 -0
- package/patches/react-native-release-profiler@0.4.5.patch +37 -0
- package/patches/react-native-screen-corner-radius@0.2.3.patch +13 -0
- package/patches/react-native-screens@4.23.0.patch +160 -0
- package/patches/react-native-svg@15.15.3.patch +31 -0
- package/patches/react-native-unistyles@3.6.0.patch +203 -0
- package/patches/react-native-worklets-core@1.6.3.patch +13 -0
- package/patches/react-navigation-native-stack@7.21.0.patch +16 -0
- package/patches/sentry-react-native@8.32.0.patch +76 -0
- package/skills/spark/UPGRADING.md +34 -0
- package/vendor/node_modules/@legendapp/spark-ai/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-audio/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-auth-session/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-cli/dist/build.js +6 -3
- package/vendor/node_modules/@legendapp/spark-cli/dist/dev.js +7 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.cjs +3 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/project.js +13 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/release.json +11 -11
- package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-input-cache.js +140 -0
- package/vendor/node_modules/@legendapp/spark-cli/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-clipboard/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-codex/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-commands/package.json +5 -5
- package/vendor/node_modules/@legendapp/spark-context-menu/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkTestDriver.mm +64 -2
- package/vendor/node_modules/@legendapp/spark-desktop-app/package.json +1 -1
- package/vendor/node_modules/@legendapp/spark-desktop-config/autolinking.cjs +3 -2
- package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.cjs +28 -10
- package/vendor/node_modules/@legendapp/spark-desktop-config/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-desktop-host/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-links/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-windows/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-documents/package.json +7 -7
- package/vendor/node_modules/@legendapp/spark-drag-drop/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-file-dialog/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-file-system/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-html/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-markdown/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-message-dialog/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-native-menu/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-notifications/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-processes/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-rich-text/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-secure-storage/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-settings/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-settings-ui/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-sqlite/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-system/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-tray/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-ui/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-updates/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-webview/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-window-options/package.json +1 -1
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
diff --git a/ios/BlurEffectWithAmount.h b/ios/BlurEffectWithAmount.h
|
|
2
|
+
index bf3992a..b15d6f0 100644
|
|
3
|
+
--- a/ios/BlurEffectWithAmount.h
|
|
4
|
+
+++ b/ios/BlurEffectWithAmount.h
|
|
5
|
+
@@ -1,3 +1,5 @@
|
|
6
|
+
+#include <TargetConditionals.h>
|
|
7
|
+
+#if !TARGET_OS_OSX
|
|
8
|
+
#import <UIKit/UIKit.h>
|
|
9
|
+
|
|
10
|
+
@interface BlurEffectWithAmount : UIBlurEffect
|
|
11
|
+
@@ -5,3 +7,4 @@
|
|
12
|
+
|
|
13
|
+
+ (instancetype)effectWithStyle:(UIBlurEffectStyle)style andBlurAmount:(NSNumber*)blurAmount;
|
|
14
|
+
@end
|
|
15
|
+
+#endif
|
|
16
|
+
diff --git a/ios/BlurEffectWithAmount.m b/ios/BlurEffectWithAmount.m
|
|
17
|
+
index e279400..70d41b6 100644
|
|
18
|
+
--- a/ios/BlurEffectWithAmount.m
|
|
19
|
+
+++ b/ios/BlurEffectWithAmount.m
|
|
20
|
+
@@ -1,3 +1,5 @@
|
|
21
|
+
+#include <TargetConditionals.h>
|
|
22
|
+
+#if !TARGET_OS_OSX
|
|
23
|
+
//
|
|
24
|
+
// We subclass UIBlurEffect so that we can set the BlurAmount.
|
|
25
|
+
// See: http://stackoverflow.com/a/30744777/304706
|
|
26
|
+
@@ -63,3 +65,4 @@ - (id)copyWithZone:(NSZone*)zone
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@end
|
|
30
|
+
+#endif
|
|
31
|
+
diff --git a/ios/BlurView.h b/ios/BlurView.h
|
|
32
|
+
index e960937..5a7415b 100644
|
|
33
|
+
--- a/ios/BlurView.h
|
|
34
|
+
+++ b/ios/BlurView.h
|
|
35
|
+
@@ -1,3 +1,5 @@
|
|
36
|
+
+#include <TargetConditionals.h>
|
|
37
|
+
+#if !TARGET_OS_OSX
|
|
38
|
+
#import <UIKit/UIKit.h>
|
|
39
|
+
#import "BlurEffectWithAmount.h"
|
|
40
|
+
|
|
41
|
+
@@ -24,3 +26,4 @@
|
|
42
|
+
- (void)updateFallbackView;
|
|
43
|
+
- (BOOL)useReduceTransparencyFallback;
|
|
44
|
+
@end
|
|
45
|
+
+#endif
|
|
46
|
+
diff --git a/ios/BlurView.mm b/ios/BlurView.mm
|
|
47
|
+
index 3d35d8f..71410a5 100644
|
|
48
|
+
--- a/ios/BlurView.mm
|
|
49
|
+
+++ b/ios/BlurView.mm
|
|
50
|
+
@@ -1,3 +1,5 @@
|
|
51
|
+
+#include <TargetConditionals.h>
|
|
52
|
+
+#if !TARGET_OS_OSX
|
|
53
|
+
#import "BlurView.h"
|
|
54
|
+
#import "BlurEffectWithAmount.h"
|
|
55
|
+
|
|
56
|
+
@@ -221,3 +223,4 @@ - (void)reduceTransparencyStatusDidChange:(__unused NSNotification *)notificatio
|
|
57
|
+
return BlurView.class;
|
|
58
|
+
}
|
|
59
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
60
|
+
+#endif
|
|
61
|
+
diff --git a/ios/BlurViewManager.h b/ios/BlurViewManager.h
|
|
62
|
+
index 7aad0df..e33ca8d 100644
|
|
63
|
+
--- a/ios/BlurViewManager.h
|
|
64
|
+
+++ b/ios/BlurViewManager.h
|
|
65
|
+
@@ -1,5 +1,8 @@
|
|
66
|
+
+#include <TargetConditionals.h>
|
|
67
|
+
+#if !TARGET_OS_OSX
|
|
68
|
+
#import <React/RCTViewManager.h>
|
|
69
|
+
|
|
70
|
+
@interface BlurViewManager : RCTViewManager
|
|
71
|
+
|
|
72
|
+
@end
|
|
73
|
+
+#endif
|
|
74
|
+
diff --git a/ios/BlurViewManager.mm b/ios/BlurViewManager.mm
|
|
75
|
+
index de58e0c..0bc1e39 100644
|
|
76
|
+
--- a/ios/BlurViewManager.mm
|
|
77
|
+
+++ b/ios/BlurViewManager.mm
|
|
78
|
+
@@ -1,3 +1,5 @@
|
|
79
|
+
+#include <TargetConditionals.h>
|
|
80
|
+
+#if !TARGET_OS_OSX
|
|
81
|
+
#import "BlurViewManager.h"
|
|
82
|
+
#import "BlurView.h"
|
|
83
|
+
|
|
84
|
+
@@ -15,3 +17,4 @@ - (UIView *)view
|
|
85
|
+
RCT_EXPORT_VIEW_PROPERTY(reducedTransparencyFallbackColor, UIColor);
|
|
86
|
+
|
|
87
|
+
@end
|
|
88
|
+
+#endif
|
|
89
|
+
diff --git a/ios/VibrancyView.h b/ios/VibrancyView.h
|
|
90
|
+
index a5c0608..139c55c 100644
|
|
91
|
+
--- a/ios/VibrancyView.h
|
|
92
|
+
+++ b/ios/VibrancyView.h
|
|
93
|
+
@@ -1,4 +1,7 @@
|
|
94
|
+
+#include <TargetConditionals.h>
|
|
95
|
+
+#if !TARGET_OS_OSX
|
|
96
|
+
#import "BlurView.h"
|
|
97
|
+
|
|
98
|
+
@interface VibrancyView : BlurView
|
|
99
|
+
@end
|
|
100
|
+
+#endif
|
|
101
|
+
diff --git a/ios/VibrancyView.mm b/ios/VibrancyView.mm
|
|
102
|
+
index 63660cd..0137596 100644
|
|
103
|
+
--- a/ios/VibrancyView.mm
|
|
104
|
+
+++ b/ios/VibrancyView.mm
|
|
105
|
+
@@ -1,3 +1,5 @@
|
|
106
|
+
+#include <TargetConditionals.h>
|
|
107
|
+
+#if !TARGET_OS_OSX
|
|
108
|
+
#import <React/RCTComponent.h>
|
|
109
|
+
#import "BlurView.h"
|
|
110
|
+
#import "VibrancyView.h"
|
|
111
|
+
@@ -118,3 +120,4 @@ - (void)updateFallbackView
|
|
112
|
+
return VibrancyView.class;
|
|
113
|
+
}
|
|
114
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
115
|
+
+#endif
|
|
116
|
+
diff --git a/ios/VibrancyViewManager.h b/ios/VibrancyViewManager.h
|
|
117
|
+
index 2593794..0db60b2 100644
|
|
118
|
+
--- a/ios/VibrancyViewManager.h
|
|
119
|
+
+++ b/ios/VibrancyViewManager.h
|
|
120
|
+
@@ -1,5 +1,8 @@
|
|
121
|
+
+#include <TargetConditionals.h>
|
|
122
|
+
+#if !TARGET_OS_OSX
|
|
123
|
+
#import <React/RCTViewManager.h>
|
|
124
|
+
|
|
125
|
+
@interface VibrancyViewManager : RCTViewManager
|
|
126
|
+
|
|
127
|
+
-@end
|
|
128
|
+
|
|
129
|
+
+@end
|
|
130
|
+
+#endif
|
|
131
|
+
diff --git a/ios/VibrancyViewManager.mm b/ios/VibrancyViewManager.mm
|
|
132
|
+
index 17bb10e..a0ca18f 100644
|
|
133
|
+
--- a/ios/VibrancyViewManager.mm
|
|
134
|
+
+++ b/ios/VibrancyViewManager.mm
|
|
135
|
+
@@ -1,3 +1,5 @@
|
|
136
|
+
+#include <TargetConditionals.h>
|
|
137
|
+
+#if !TARGET_OS_OSX
|
|
138
|
+
#import "VibrancyViewManager.h"
|
|
139
|
+
#import "VibrancyView.h"
|
|
140
|
+
|
|
141
|
+
@@ -15,3 +17,4 @@ - (UIView *)view
|
|
142
|
+
RCT_EXPORT_VIEW_PROPERTY(reducedTransparencyFallbackColor, UIColor);
|
|
143
|
+
|
|
144
|
+
@end
|
|
145
|
+
+#endif
|
|
146
|
+
diff --git a/ios/macos/RNBlurMacOS.mm b/ios/macos/RNBlurMacOS.mm
|
|
147
|
+
new file mode 100644
|
|
148
|
+
index 0000000..e365754
|
|
149
|
+
--- /dev/null
|
|
150
|
+
+++ b/ios/macos/RNBlurMacOS.mm
|
|
151
|
+
@@ -0,0 +1,218 @@
|
|
152
|
+
+#include <TargetConditionals.h>
|
|
153
|
+
+#if TARGET_OS_OSX
|
|
154
|
+
+
|
|
155
|
+
+// AppKit BlurView and VibrancyView: NSVisualEffectView takes a material instead of a
|
|
156
|
+
+// UIBlurEffectStyle and has no blur radius, so blurAmount has no effect on macOS.
|
|
157
|
+
+#import <AppKit/AppKit.h>
|
|
158
|
+
+#import <React/RCTAssert.h>
|
|
159
|
+
+#import <React/RCTConversions.h>
|
|
160
|
+
+#import <React/RCTFabricComponentsPlugins.h>
|
|
161
|
+
+#import <React/RCTViewComponentView.h>
|
|
162
|
+
+#import <react/renderer/components/rnblurview/ComponentDescriptors.h>
|
|
163
|
+
+#import <react/renderer/components/rnblurview/Props.h>
|
|
164
|
+
+#import <react/renderer/components/rnblurview/RCTComponentViewHelpers.h>
|
|
165
|
+
+
|
|
166
|
+
+using namespace facebook::react;
|
|
167
|
+
+
|
|
168
|
+
+static NSVisualEffectMaterial RNBlurMaterial(NSString *type)
|
|
169
|
+
+{
|
|
170
|
+
+ if ([type hasPrefix:@"ultraThinMaterial"]) return NSVisualEffectMaterialHUDWindow;
|
|
171
|
+
+ if ([type hasPrefix:@"thinMaterial"]) return NSVisualEffectMaterialPopover;
|
|
172
|
+
+ if ([type hasPrefix:@"thickMaterial"]) return NSVisualEffectMaterialWindowBackground;
|
|
173
|
+
+ if ([type hasPrefix:@"chromeMaterial"]) return NSVisualEffectMaterialTitlebar;
|
|
174
|
+
+ if ([type hasPrefix:@"material"] || [type isEqual:@"regular"] || [type isEqual:@"prominent"]) return NSVisualEffectMaterialContentBackground;
|
|
175
|
+
+ return NSVisualEffectMaterialFullScreenUI;
|
|
176
|
+
+}
|
|
177
|
+
+
|
|
178
|
+
+static NSAppearance *RNBlurAppearance(NSString *type)
|
|
179
|
+
+{
|
|
180
|
+
+ if ([type isEqual:@"dark"] || [type isEqual:@"extraDark"] || [type hasSuffix:@"Dark"]) return [NSAppearance appearanceNamed:NSAppearanceNameDarkAqua];
|
|
181
|
+
+ if ([type isEqual:@"light"] || [type isEqual:@"xlight"] || [type hasSuffix:@"Light"]) return [NSAppearance appearanceNamed:NSAppearanceNameAqua];
|
|
182
|
+
+ return nil; // Adaptive materials follow the window.
|
|
183
|
+
+}
|
|
184
|
+
+
|
|
185
|
+
+// Flipped like React's views, so children mounted inside get React's coordinates.
|
|
186
|
+
+@interface RNBlurEffectView : NSVisualEffectView
|
|
187
|
+
+@end
|
|
188
|
+
+
|
|
189
|
+
+@implementation RNBlurEffectView
|
|
190
|
+
+- (BOOL)isFlipped
|
|
191
|
+
+{
|
|
192
|
+
+ return YES;
|
|
193
|
+
+}
|
|
194
|
+
+@end
|
|
195
|
+
+
|
|
196
|
+
+// Resolves its color in updateLayer, under the view's appearance, so dynamic colors follow Dark Mode.
|
|
197
|
+
+@interface RNBlurFallbackView : NSView
|
|
198
|
+
+@property (nonatomic, strong) NSColor *color;
|
|
199
|
+
+@end
|
|
200
|
+
+
|
|
201
|
+
+@implementation RNBlurFallbackView
|
|
202
|
+
+- (BOOL)isFlipped
|
|
203
|
+
+{
|
|
204
|
+
+ return YES;
|
|
205
|
+
+}
|
|
206
|
+
+
|
|
207
|
+
+- (BOOL)wantsUpdateLayer
|
|
208
|
+
+{
|
|
209
|
+
+ return YES;
|
|
210
|
+
+}
|
|
211
|
+
+
|
|
212
|
+
+- (void)setColor:(NSColor *)color
|
|
213
|
+
+{
|
|
214
|
+
+ _color = color;
|
|
215
|
+
+ self.needsDisplay = YES;
|
|
216
|
+
+}
|
|
217
|
+
+
|
|
218
|
+
+- (void)updateLayer
|
|
219
|
+
+{
|
|
220
|
+
+ self.layer.backgroundColor = _color.CGColor;
|
|
221
|
+
+}
|
|
222
|
+
+@end
|
|
223
|
+
+
|
|
224
|
+
+@interface BlurView : RCTViewComponentView
|
|
225
|
+
+@property (nonatomic, readonly) NSVisualEffectView *effectView;
|
|
226
|
+
+@property (nonatomic, readonly) RNBlurFallbackView *fallbackView;
|
|
227
|
+
+@property (nonatomic, copy) NSString *blurType;
|
|
228
|
+
+@property (nonatomic, strong) NSColor *fallbackColor;
|
|
229
|
+
+@end
|
|
230
|
+
+
|
|
231
|
+
+@interface BlurView () <RCTBlurViewViewProtocol>
|
|
232
|
+
+@end
|
|
233
|
+
+
|
|
234
|
+
+@implementation BlurView
|
|
235
|
+
+
|
|
236
|
+
++ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
237
|
+
+{
|
|
238
|
+
+ return concreteComponentDescriptorProvider<BlurViewComponentDescriptor>();
|
|
239
|
+
+}
|
|
240
|
+
+
|
|
241
|
+
+- (instancetype)initWithFrame:(CGRect)frame
|
|
242
|
+
+{
|
|
243
|
+
+ if (self = [super initWithFrame:frame]) {
|
|
244
|
+
+ static const auto defaultProps = std::make_shared<const BlurViewProps>();
|
|
245
|
+
+ _props = defaultProps;
|
|
246
|
+
+ _effectView = [[RNBlurEffectView alloc] initWithFrame:self.bounds];
|
|
247
|
+
+ _effectView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
|
|
248
|
+
+ _effectView.blendingMode = NSVisualEffectBlendingModeWithinWindow;
|
|
249
|
+
+ _effectView.state = NSVisualEffectStateFollowsWindowActiveState;
|
|
250
|
+
+ _fallbackView = [[RNBlurFallbackView alloc] initWithFrame:self.bounds];
|
|
251
|
+
+ _fallbackView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
|
|
252
|
+
+ _fallbackView.wantsLayer = YES;
|
|
253
|
+
+ self.blurType = @"dark";
|
|
254
|
+
+ self.clipsToBounds = YES;
|
|
255
|
+
+ [self updateFallbackView];
|
|
256
|
+
+ [NSWorkspace.sharedWorkspace.notificationCenter addObserver:self selector:@selector(updateFallbackView) name:NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification object:nil];
|
|
257
|
+
+ }
|
|
258
|
+
+ return self;
|
|
259
|
+
+}
|
|
260
|
+
+
|
|
261
|
+
+- (void)dealloc
|
|
262
|
+
+{
|
|
263
|
+
+ [NSWorkspace.sharedWorkspace.notificationCenter removeObserver:self];
|
|
264
|
+
+}
|
|
265
|
+
+
|
|
266
|
+
+- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
|
|
267
|
+
+{
|
|
268
|
+
+ const auto &newViewProps = *std::static_pointer_cast<const BlurViewProps>(props);
|
|
269
|
+
+ self.blurType = [NSString stringWithUTF8String:toString(newViewProps.blurType).c_str()];
|
|
270
|
+
+ self.fallbackColor = RCTUIColorFromSharedColor(newViewProps.reducedTransparencyFallbackColor);
|
|
271
|
+
+ [self updateFallbackView];
|
|
272
|
+
+ [super updateProps:props oldProps:oldProps];
|
|
273
|
+
+}
|
|
274
|
+
+
|
|
275
|
+
+- (void)setBlurType:(NSString *)blurType
|
|
276
|
+
+{
|
|
277
|
+
+ _blurType = [blurType copy];
|
|
278
|
+
+ _effectView.material = RNBlurMaterial(blurType);
|
|
279
|
+
+ _effectView.appearance = RNBlurAppearance(blurType);
|
|
280
|
+
+}
|
|
281
|
+
+
|
|
282
|
+
+- (void)updateFallbackView
|
|
283
|
+
+{
|
|
284
|
+
+ BOOL fallback = NSWorkspace.sharedWorkspace.accessibilityDisplayShouldReduceTransparency && self.fallbackColor;
|
|
285
|
+
+ NSView *shown = fallback ? _fallbackView : _effectView, *hidden = fallback ? _effectView : _fallbackView;
|
|
286
|
+
+ _fallbackView.color = self.fallbackColor;
|
|
287
|
+
+ if (shown.superview) {
|
|
288
|
+
+ return;
|
|
289
|
+
+ }
|
|
290
|
+
+ // VibrancyView mounts its children inside the material, so they move with it.
|
|
291
|
+
+ for (NSView *child in [hidden.subviews copy]) {
|
|
292
|
+
+ [shown addSubview:child];
|
|
293
|
+
+ }
|
|
294
|
+
+ // React may have moved the material into its clipping container; swap it in place.
|
|
295
|
+
+ NSView *parent = hidden.superview ?: self;
|
|
296
|
+
+ [hidden removeFromSuperview];
|
|
297
|
+
+ shown.frame = parent.bounds;
|
|
298
|
+
+ [parent addSubview:shown positioned:NSWindowBelow relativeTo:nil];
|
|
299
|
+
+}
|
|
300
|
+
+
|
|
301
|
+
+@end
|
|
302
|
+
+
|
|
303
|
+
+@interface VibrancyView : BlurView
|
|
304
|
+
+@end
|
|
305
|
+
+
|
|
306
|
+
+@interface VibrancyView () <RCTVibrancyViewViewProtocol>
|
|
307
|
+
+@end
|
|
308
|
+
+
|
|
309
|
+
+@implementation VibrancyView
|
|
310
|
+
+
|
|
311
|
+
++ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
312
|
+
+{
|
|
313
|
+
+ return concreteComponentDescriptorProvider<VibrancyViewComponentDescriptor>();
|
|
314
|
+
+}
|
|
315
|
+
+
|
|
316
|
+
+- (instancetype)initWithFrame:(CGRect)frame
|
|
317
|
+
+{
|
|
318
|
+
+ if (self = [super initWithFrame:frame]) {
|
|
319
|
+
+ static const auto defaultProps = std::make_shared<const VibrancyViewProps>();
|
|
320
|
+
+ _props = defaultProps;
|
|
321
|
+
+ }
|
|
322
|
+
+ return self;
|
|
323
|
+
+}
|
|
324
|
+
+
|
|
325
|
+
+// Like iOS, children mount inside the material (or the reduced-transparency fallback).
|
|
326
|
+
+- (NSView *)contentView
|
|
327
|
+
+{
|
|
328
|
+
+ return self.effectView.superview ? self.effectView : self.fallbackView;
|
|
329
|
+
+}
|
|
330
|
+
+
|
|
331
|
+
+- (void)mountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
332
|
+
+{
|
|
333
|
+
+ NSView *contentView = self.contentView;
|
|
334
|
+
+ if (index < (NSInteger)contentView.subviews.count) {
|
|
335
|
+
+ [contentView addSubview:childComponentView positioned:NSWindowBelow relativeTo:contentView.subviews[index]];
|
|
336
|
+
+ } else {
|
|
337
|
+
+ [contentView addSubview:childComponentView];
|
|
338
|
+
+ }
|
|
339
|
+
+}
|
|
340
|
+
+
|
|
341
|
+
+- (void)unmountChildComponentView:(RCTUIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
342
|
+
+{
|
|
343
|
+
+ RCTAssert(childComponentView.superview == self.contentView, @"Attempt to unmount a view which is mounted inside a different view.");
|
|
344
|
+
+ RCTAssert(self.contentView.subviews[index] == childComponentView, @"Attempt to unmount a view which has a different index.");
|
|
345
|
+
+ [childComponentView removeFromSuperview];
|
|
346
|
+
+}
|
|
347
|
+
+
|
|
348
|
+
+- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
|
|
349
|
+
+{
|
|
350
|
+
+ const auto &newViewProps = *std::static_pointer_cast<const VibrancyViewProps>(props);
|
|
351
|
+
+ self.blurType = [NSString stringWithUTF8String:toString(newViewProps.blurType).c_str()];
|
|
352
|
+
+ self.fallbackColor = RCTUIColorFromSharedColor(newViewProps.reducedTransparencyFallbackColor);
|
|
353
|
+
+ [self updateFallbackView];
|
|
354
|
+
+ [super updateProps:props oldProps:oldProps];
|
|
355
|
+
+}
|
|
356
|
+
+
|
|
357
|
+
+@end
|
|
358
|
+
+
|
|
359
|
+
+Class<RCTComponentViewProtocol> BlurViewCls(void)
|
|
360
|
+
+{
|
|
361
|
+
+ return BlurView.class;
|
|
362
|
+
+}
|
|
363
|
+
+
|
|
364
|
+
+Class<RCTComponentViewProtocol> VibrancyViewCls(void)
|
|
365
|
+
+{
|
|
366
|
+
+ return VibrancyView.class;
|
|
367
|
+
+}
|
|
368
|
+
+
|
|
369
|
+
+#endif
|
|
370
|
+
diff --git a/package.json b/package.json
|
|
371
|
+
index 4e5c8a6..c8932f9 100644
|
|
372
|
+
--- a/package.json
|
|
373
|
+
+++ b/package.json
|
|
374
|
+
@@ -150,6 +150,12 @@
|
|
375
|
+
"name": "rnblurview",
|
|
376
|
+
"type": "components",
|
|
377
|
+
"jsSrcsDir": "./src/fabric",
|
|
378
|
+
+ "ios": {
|
|
379
|
+
+ "componentProvider": {
|
|
380
|
+
+ "BlurView": "BlurView",
|
|
381
|
+
+ "VibrancyView": "VibrancyView"
|
|
382
|
+
+ }
|
|
383
|
+
+ },
|
|
384
|
+
"android": {
|
|
385
|
+
"javaPackageName": "com.reactnativecommunityblur"
|
|
386
|
+
}
|
|
387
|
+
diff --git a/react-native-blur.podspec b/react-native-blur.podspec
|
|
388
|
+
index 2913ba7..2d032c5 100644
|
|
389
|
+
--- a/react-native-blur.podspec
|
|
390
|
+
+++ b/react-native-blur.podspec
|
|
391
|
+
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
|
|
392
|
+
s.license = package["license"]
|
|
393
|
+
s.authors = package["author"]
|
|
394
|
+
|
|
395
|
+
- s.platforms = { :ios => "10.0", :tvos => "11.0", :visionos => "1.0" }
|
|
396
|
+
+ s.platforms = { :ios => "10.0", :tvos => "11.0", :visionos => "1.0", :osx => "14.0" }
|
|
397
|
+
s.source = { :git => "https://github.com/react-native-community/react-native-blur.git" }
|
|
398
|
+
|
|
399
|
+
s.source_files = "ios/**/*.{h,m,mm}"
|
|
400
|
+
diff --git a/src/components/BlurView.macos.tsx b/src/components/BlurView.macos.tsx
|
|
401
|
+
new file mode 100644
|
|
402
|
+
index 0000000..a5a3f06
|
|
403
|
+
--- /dev/null
|
|
404
|
+
+++ b/src/components/BlurView.macos.tsx
|
|
405
|
+
@@ -0,0 +1,2 @@
|
|
406
|
+
+export * from './BlurView.ios';
|
|
407
|
+
+export { default } from './BlurView.ios';
|
|
408
|
+
diff --git a/src/components/VibrancyView.macos.tsx b/src/components/VibrancyView.macos.tsx
|
|
409
|
+
new file mode 100644
|
|
410
|
+
index 0000000..99d118b
|
|
411
|
+
--- /dev/null
|
|
412
|
+
+++ b/src/components/VibrancyView.macos.tsx
|
|
413
|
+
@@ -0,0 +1,2 @@
|
|
414
|
+
+export * from './VibrancyView.ios';
|
|
415
|
+
+export { default } from './VibrancyView.ios';
|