@legendapp/spark 0.0.2 → 0.0.4

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 (224) hide show
  1. package/init-template.cjs +7 -1
  2. package/package.json +10 -5
  3. package/patches/dependencies.json +252 -0
  4. package/patches/expo-application@55.0.19.patch +54 -0
  5. package/patches/expo-blur@55.0.18.patch +130 -0
  6. package/patches/expo-device@55.0.21.patch +149 -0
  7. package/patches/expo-font@55.0.8.patch +55 -0
  8. package/patches/expo-glass-effect@55.0.11.patch +304 -0
  9. package/patches/expo-haptics@55.0.18.patch +54 -0
  10. package/patches/expo-image-manipulator@55.0.21.patch +312 -0
  11. package/patches/expo-image-picker@55.0.24.patch +327 -0
  12. package/patches/expo-image@55.0.11.patch +158 -0
  13. package/patches/expo-keep-awake@55.0.8.patch +41 -0
  14. package/patches/expo-localization@55.0.19.patch +32 -0
  15. package/patches/expo-location@55.1.15.patch +190 -0
  16. package/patches/expo-symbols@55.0.9.patch +286 -0
  17. package/patches/expo-system-ui@55.0.22.patch +61 -0
  18. package/patches/expo-web-browser@55.0.20.patch +13 -0
  19. package/patches/react-native-app-logs@0.3.1.patch +20 -0
  20. package/patches/react-native-blurhash@2.1.3.patch +318 -0
  21. package/patches/react-native-community-blur@4.4.1.patch +415 -0
  22. package/patches/react-native-community-datetimepicker@9.2.2.patch +320 -0
  23. package/patches/react-native-fast-image@10.9.9.patch +131 -0
  24. package/patches/react-native-graph@1.4.0.patch +157 -0
  25. package/patches/react-native-keyboard-controller@1.22.9.patch +16 -0
  26. package/patches/react-native-masked-view-masked-view@0.3.2.patch +140 -0
  27. package/patches/react-native-mmkv@4.3.2.patch +40 -0
  28. package/patches/react-native-nitro-fetch@1.9.0.patch +130 -0
  29. package/patches/react-native-nitro-zxing@0.3.0.patch +13 -0
  30. package/patches/react-native-nitro-zxing@0.3.1.patch +22 -0
  31. package/patches/react-native-quick-base64@3.0.1.patch +13 -0
  32. package/patches/react-native-quick-crypto@1.1.9.patch +31 -0
  33. package/patches/react-native-release-profiler@0.4.5.patch +37 -0
  34. package/patches/react-native-screen-corner-radius@0.2.3.patch +13 -0
  35. package/patches/react-native-screens@4.23.0.patch +160 -0
  36. package/patches/react-native-svg@15.15.3.patch +31 -0
  37. package/patches/react-native-unistyles@3.6.0.patch +203 -0
  38. package/patches/react-native-worklets-core@1.6.3.patch +13 -0
  39. package/patches/react-navigation-native-stack@7.21.0.patch +16 -0
  40. package/patches/registry.json +615 -0
  41. package/patches/sentry-react-native@8.32.0.patch +76 -0
  42. package/patches/workspace/expo-audio@55.0.18.patch +159 -0
  43. package/patches/workspace/op-engineering-op-sqlite@18.2.1.patch +796 -0
  44. package/patches/workspace/react-native-nitro-modules@0.37.0.patch +1348 -0
  45. package/patches/workspace/react-native-runtimes-core@0.1.0-alpha.2.patch +276 -0
  46. package/patches/workspace/react-native-webview@16.0.0.patch +208 -0
  47. package/postinstall.cjs +10 -1
  48. package/skills/spark/SKILL.md +37 -4
  49. package/skills/spark/UPGRADING.md +150 -1
  50. package/skills/spark/ai-customize.md +39 -0
  51. package/skills/spark/app-and-documents.md +56 -0
  52. package/skills/spark/external-libraries.md +87 -0
  53. package/skills/spark/files.md +64 -0
  54. package/skills/spark/integrations.md +69 -0
  55. package/skills/spark/keyboard.md +54 -0
  56. package/skills/spark/library-compat.md +76 -0
  57. package/skills/spark/menus-tray-dock.md +83 -0
  58. package/skills/spark/storage-settings.md +85 -0
  59. package/skills/spark/ui.md +57 -0
  60. package/skills/spark/windows.md +91 -0
  61. package/ui-popover.ts +1 -0
  62. package/ui-progress.ts +1 -0
  63. package/ui-sheet.ts +1 -0
  64. package/ui-split-view.ts +1 -0
  65. package/ui-table.ts +1 -0
  66. package/vendor/node_modules/@legendapp/spark-ai/package.json +3 -3
  67. package/vendor/node_modules/@legendapp/spark-audio/package.json +3 -13
  68. package/vendor/node_modules/@legendapp/spark-auth-session/package.json +3 -10
  69. package/vendor/node_modules/@legendapp/spark-cli/dist/add-desktop.js +5 -0
  70. package/vendor/node_modules/@legendapp/spark-cli/dist/build.js +139 -104
  71. package/vendor/node_modules/@legendapp/spark-cli/dist/cli-arguments.js +4 -1
  72. package/vendor/node_modules/@legendapp/spark-cli/dist/commands.js +16 -7
  73. package/vendor/node_modules/@legendapp/spark-cli/dist/dependency-pins.js +19 -3
  74. package/vendor/node_modules/@legendapp/spark-cli/dist/dev-command.js +2 -0
  75. package/vendor/node_modules/@legendapp/spark-cli/dist/dev.js +10 -2
  76. package/vendor/node_modules/@legendapp/spark-cli/dist/enriched-html-pins.js +2 -0
  77. package/vendor/node_modules/@legendapp/spark-cli/dist/errors.js +1 -1
  78. package/vendor/node_modules/@legendapp/spark-cli/dist/index.js +57 -9
  79. package/vendor/node_modules/@legendapp/spark-cli/dist/init-template.cjs +12 -2
  80. package/vendor/node_modules/@legendapp/spark-cli/dist/init-template.d.cts +1 -1
  81. package/vendor/node_modules/@legendapp/spark-cli/dist/metro.cjs +1 -0
  82. package/vendor/node_modules/@legendapp/spark-cli/dist/migrate.js +65 -0
  83. package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.cjs +4 -4
  84. package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.d.cts +2 -2
  85. package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.cjs +15 -8
  86. package/vendor/node_modules/@legendapp/spark-cli/dist/native-patch-preflight.js +35 -7
  87. package/vendor/node_modules/@legendapp/spark-cli/dist/patch.js +92 -0
  88. package/vendor/node_modules/@legendapp/spark-cli/dist/project-version.js +12 -4
  89. package/vendor/node_modules/@legendapp/spark-cli/dist/project.js +20 -1
  90. package/vendor/node_modules/@legendapp/spark-cli/dist/release.json +20 -20
  91. package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-input-cache.js +140 -0
  92. package/vendor/node_modules/@legendapp/spark-cli/dist/upgrade.js +1 -1
  93. package/vendor/node_modules/@legendapp/spark-cli/dist/windows.js +3 -0
  94. package/vendor/node_modules/@legendapp/spark-cli/package.json +5 -4
  95. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/package.json +2 -2
  96. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/package.json +2 -2
  97. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/package.json +2 -2
  98. package/vendor/node_modules/@legendapp/spark-clipboard/macos/RNDesktopClipboard.mm +1 -1
  99. package/vendor/node_modules/@legendapp/spark-clipboard/package.json +3 -10
  100. package/vendor/node_modules/@legendapp/spark-clipboard/src/desktop.ts +1 -0
  101. package/vendor/node_modules/@legendapp/spark-codex/package.json +3 -7
  102. package/vendor/node_modules/@legendapp/spark-commands/package.json +5 -5
  103. package/vendor/node_modules/@legendapp/spark-context-menu/package.json +3 -10
  104. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkDesktop.h +3 -1
  105. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkDesktop.mm +51 -10
  106. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkStorage.h +4 -0
  107. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkStorage.mm +82 -0
  108. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkTestDriver.mm +64 -2
  109. package/vendor/node_modules/@legendapp/spark-desktop-app/package.json +2 -8
  110. package/vendor/node_modules/@legendapp/spark-desktop-config/autolinking.cjs +3 -2
  111. package/vendor/node_modules/@legendapp/spark-desktop-config/config.cjs +6 -8
  112. package/vendor/node_modules/@legendapp/spark-desktop-config/identity.cjs +2 -0
  113. package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.cjs +315 -68
  114. package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.d.cts +7 -0
  115. package/vendor/node_modules/@legendapp/spark-desktop-config/package.json +3 -3
  116. package/vendor/node_modules/@legendapp/spark-desktop-config/patch-registry.cjs +318 -0
  117. package/vendor/node_modules/@legendapp/spark-desktop-config/patch-registry.d.cts +20 -0
  118. package/vendor/node_modules/@legendapp/spark-desktop-config/validation.cjs +66 -9
  119. package/vendor/node_modules/@legendapp/spark-desktop-config/windows.plugin.cjs +1 -0
  120. package/vendor/node_modules/@legendapp/spark-desktop-host/AppDelegate.mm +1 -0
  121. package/vendor/node_modules/@legendapp/spark-desktop-host/package.json +2 -2
  122. package/vendor/node_modules/@legendapp/spark-desktop-links/package.json +3 -10
  123. package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/package.json +3 -10
  124. package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/RNDesktopWindows.mm +7 -2
  125. package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/RNWindowManager.mm +235 -240
  126. package/vendor/node_modules/@legendapp/spark-desktop-windows/package.json +4 -11
  127. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/api.ts +9 -3
  128. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/macos-adapter.ts +7 -0
  129. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/types.ts +32 -3
  130. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/validation.ts +28 -11
  131. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/createWindowsNavigator.tsx +15 -3
  132. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/primaryWindowLifecycle.ts +12 -3
  133. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/usePrimaryWindowLifecycle.ts +2 -1
  134. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/useWindowFocusEffect.ts +4 -1
  135. package/vendor/node_modules/@legendapp/spark-documents/package.json +7 -7
  136. package/vendor/node_modules/@legendapp/spark-drag-drop/macos/RNDesktopDragView.mm +77 -17
  137. package/vendor/node_modules/@legendapp/spark-drag-drop/package.json +3 -8
  138. package/vendor/node_modules/@legendapp/spark-drag-drop/src/DesktopDragViewNativeComponent.ts +1 -0
  139. package/vendor/node_modules/@legendapp/spark-drag-drop/src/contracts.ts +13 -4
  140. package/vendor/node_modules/@legendapp/spark-drag-drop/src/index.tsx +5 -3
  141. package/vendor/node_modules/@legendapp/spark-drag-drop/windows/SparkDragDrop/SparkDragDrop.h +6 -1
  142. package/vendor/node_modules/@legendapp/spark-expo-compat/metro.cjs +44 -0
  143. package/vendor/node_modules/@legendapp/spark-expo-compat/package.json +20 -0
  144. package/vendor/node_modules/@legendapp/spark-expo-compat/src/clipboard.ts +40 -0
  145. package/vendor/node_modules/@legendapp/spark-expo-compat/src/document-picker.ts +52 -0
  146. package/vendor/node_modules/@legendapp/spark-file-dialog/package.json +3 -10
  147. package/vendor/node_modules/@legendapp/spark-file-dialog/src/options.ts +5 -2
  148. package/vendor/node_modules/@legendapp/spark-file-dialog/src/types.ts +3 -3
  149. package/vendor/node_modules/@legendapp/spark-file-system/macos/RNDesktopFileSystem.mm +1 -1
  150. package/vendor/node_modules/@legendapp/spark-file-system/package.json +3 -11
  151. package/vendor/node_modules/@legendapp/spark-global-shortcuts/package.json +3 -10
  152. package/vendor/node_modules/@legendapp/spark-html/package.json +2 -2
  153. package/vendor/node_modules/@legendapp/spark-markdown/package.json +2 -2
  154. package/vendor/node_modules/@legendapp/spark-message-dialog/package.json +3 -10
  155. package/vendor/node_modules/@legendapp/spark-message-dialog/src/index.ts +1 -0
  156. package/vendor/node_modules/@legendapp/spark-native-menu/package.json +3 -9
  157. package/vendor/node_modules/@legendapp/spark-native-menu/src/hooks.ts +4 -0
  158. package/vendor/node_modules/@legendapp/spark-notifications/package.json +3 -10
  159. package/vendor/node_modules/@legendapp/spark-processes/package.json +3 -10
  160. package/vendor/node_modules/@legendapp/spark-rich-text/package.json +2 -2
  161. package/vendor/node_modules/@legendapp/spark-secure-storage/package.json +3 -10
  162. package/vendor/node_modules/@legendapp/spark-settings/package.json +3 -3
  163. package/vendor/node_modules/@legendapp/spark-settings-ui/package.json +4 -4
  164. package/vendor/node_modules/@legendapp/spark-sqlite/package.json +3 -3
  165. package/vendor/node_modules/@legendapp/spark-system/package.json +3 -10
  166. package/vendor/node_modules/@legendapp/spark-tray/package.json +3 -10
  167. package/vendor/node_modules/@legendapp/spark-tray/src/index.ts +2 -1
  168. package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkButton.mm +82 -14
  169. package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkTextInput.h +1 -1
  170. package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkTextInput.mm +94 -11
  171. package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSidebarSplitViewComponent.mm +235 -18
  172. package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSparkPaneSplitView.h +17 -0
  173. package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSparkPaneSplitView.mm +216 -0
  174. package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSparkSplitViewComponent.h +4 -0
  175. package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSparkSplitViewComponent.mm +212 -0
  176. package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSparkSplitViewUpdates.h +6 -0
  177. package/vendor/node_modules/@legendapp/spark-ui/macos/native-select/RNNativeSegmentedControl.mm +26 -13
  178. package/vendor/node_modules/@legendapp/spark-ui/macos/popover/RNSparkPopover.h +9 -0
  179. package/vendor/node_modules/@legendapp/spark-ui/macos/popover/RNSparkPopover.mm +126 -0
  180. package/vendor/node_modules/@legendapp/spark-ui/macos/progress/RNSparkProgressIndicator.h +9 -0
  181. package/vendor/node_modules/@legendapp/spark-ui/macos/progress/RNSparkProgressIndicator.mm +66 -0
  182. package/vendor/node_modules/@legendapp/spark-ui/macos/radio-group/RNSparkRadioGroup.h +9 -0
  183. package/vendor/node_modules/@legendapp/spark-ui/macos/radio-group/RNSparkRadioGroup.mm +118 -0
  184. package/vendor/node_modules/@legendapp/spark-ui/macos/sf-symbol/RNSFSymbol.mm +4 -12
  185. package/vendor/node_modules/@legendapp/spark-ui/macos/sheet/RNSparkSheet.h +9 -0
  186. package/vendor/node_modules/@legendapp/spark-ui/macos/sheet/RNSparkSheet.mm +109 -0
  187. package/vendor/node_modules/@legendapp/spark-ui/macos/sidebar/RNSidebar.mm +418 -102
  188. package/vendor/node_modules/@legendapp/spark-ui/macos/table/RNSparkTable.h +9 -0
  189. package/vendor/node_modules/@legendapp/spark-ui/macos/table/RNSparkTable.mm +179 -0
  190. package/vendor/node_modules/@legendapp/spark-ui/package.json +9 -8
  191. package/vendor/node_modules/@legendapp/spark-ui/src/SparkButtonNativeComponent.ts +10 -2
  192. package/vendor/node_modules/@legendapp/spark-ui/src/SparkTextInputNativeComponent.ts +2 -0
  193. package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SidebarSplitViewNativeComponent.ts +9 -0
  194. package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SplitView.tsx +99 -0
  195. package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SplitViewNativeComponent.ts +29 -0
  196. package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/index.tsx +34 -17
  197. package/vendor/node_modules/@legendapp/spark-ui/src/availability.ts +5 -4
  198. package/vendor/node_modules/@legendapp/spark-ui/src/checkbox-unavailable.tsx +20 -0
  199. package/vendor/node_modules/@legendapp/spark-ui/src/control.ts +24 -3
  200. package/vendor/node_modules/@legendapp/spark-ui/src/desktop.tsx +63 -13
  201. package/vendor/node_modules/@legendapp/spark-ui/src/index.android.tsx +12 -7
  202. package/vendor/node_modules/@legendapp/spark-ui/src/index.ios.tsx +12 -7
  203. package/vendor/node_modules/@legendapp/spark-ui/src/index.web.tsx +35 -13
  204. package/vendor/node_modules/@legendapp/spark-ui/src/mobile-input.tsx +2 -2
  205. package/vendor/node_modules/@legendapp/spark-ui/src/native-select/NativeSegmentedControlNativeComponent.ts +3 -1
  206. package/vendor/node_modules/@legendapp/spark-ui/src/popover/PopoverNativeComponent.ts +20 -0
  207. package/vendor/node_modules/@legendapp/spark-ui/src/popover/index.tsx +45 -0
  208. package/vendor/node_modules/@legendapp/spark-ui/src/progress/ProgressIndicatorNativeComponent.ts +13 -0
  209. package/vendor/node_modules/@legendapp/spark-ui/src/progress/index.tsx +32 -0
  210. package/vendor/node_modules/@legendapp/spark-ui/src/radio-group/RadioGroupNativeComponent.ts +17 -0
  211. package/vendor/node_modules/@legendapp/spark-ui/src/sheet/SheetNativeComponent.ts +15 -0
  212. package/vendor/node_modules/@legendapp/spark-ui/src/sheet/index.tsx +38 -0
  213. package/vendor/node_modules/@legendapp/spark-ui/src/sidebar/SidebarItemNativeComponent.ts +9 -1
  214. package/vendor/node_modules/@legendapp/spark-ui/src/sidebar/SidebarNativeComponent.ts +17 -2
  215. package/vendor/node_modules/@legendapp/spark-ui/src/sidebar/index.tsx +106 -22
  216. package/vendor/node_modules/@legendapp/spark-ui/src/table/TableNativeComponent.ts +22 -0
  217. package/vendor/node_modules/@legendapp/spark-ui/src/table/index.tsx +118 -0
  218. package/vendor/node_modules/@legendapp/spark-ui/src/types.ts +39 -6
  219. package/vendor/node_modules/@legendapp/spark-ui/uniwind.ts +3 -1
  220. package/vendor/node_modules/@legendapp/spark-ui/uniwind.web.ts +2 -1
  221. package/vendor/node_modules/@legendapp/spark-ui/windows/SparkUI/SparkUI.h +46 -15
  222. package/vendor/node_modules/@legendapp/spark-updates/package.json +3 -9
  223. package/vendor/node_modules/@legendapp/spark-webview/package.json +2 -2
  224. 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';