@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,203 @@
1
+ diff --git a/Unistyles.podspec b/Unistyles.podspec
2
+ index adf83bf..ba3ba7f 100644
3
+ --- a/Unistyles.podspec
4
+ +++ b/Unistyles.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 => package["repository"], :tag => "#{s.version}" }
12
+
13
+ s.source_files = [
14
+ diff --git a/ios/Extensions.swift b/ios/Extensions.swift
15
+ index 9b38a32..a707de7 100644
16
+ --- a/ios/Extensions.swift
17
+ +++ b/ios/Extensions.swift
18
+ @@ -1,5 +1,7 @@
19
+ import Foundation
20
+
21
+ +#if os(iOS)
22
+ +
23
+ extension UIColor {
24
+ // int is universal way of color representation
25
+ // iOS API expects UIColor, so we need to translate it
26
+ @@ -11,3 +13,4 @@ extension UIColor {
27
+ return UIColor(red: red, green: green, blue: blue, alpha: 1.0)
28
+ }
29
+ }
30
+ +#endif
31
+ diff --git a/ios/NativePlatform+keyboard.swift b/ios/NativePlatform+keyboard.swift
32
+ index 0237e76..b95f651 100644
33
+ --- a/ios/NativePlatform+keyboard.swift
34
+ +++ b/ios/NativePlatform+keyboard.swift
35
+ @@ -1,3 +1,4 @@
36
+ +#if os(iOS)
37
+ import Foundation
38
+
39
+ struct KeyboardAnimation {
40
+ @@ -103,3 +104,5 @@ extension NativeIOSPlatform {
41
+ }
42
+ }
43
+ }
44
+ +
45
+ +#endif
46
+ diff --git a/ios/NativePlatform+macos.swift b/ios/NativePlatform+macos.swift
47
+ new file mode 100644
48
+ index 0000000..ac219cf
49
+ --- /dev/null
50
+ +++ b/ios/NativePlatform+macos.swift
51
+ @@ -0,0 +1,124 @@
52
+ +#if os(macOS)
53
+ +
54
+ +import AppKit
55
+ +import NitroModules
56
+ +
57
+ +// AppKit counterpart of NativeIOSPlatform: a desktop window has no safe-area, status bar,
58
+ +// navigation bar or software keyboard, so those report zero; the window is the "screen".
59
+ +class NativeMacOSPlatform: HybridNativePlatformSpec {
60
+ + var miniRuntime: UnistylesNativeMiniRuntime?
61
+ + var dependencyListeners: Array<(Array<UnistyleDependency>, UnistylesNativeMiniRuntime) -> Void> = []
62
+ + var observers: [NSObjectProtocol] = []
63
+ + var appearanceObservation: NSKeyValueObservation?
64
+ +
65
+ + override init() {
66
+ + super.init()
67
+ + self.miniRuntime = onMain { self.buildMiniRuntime() }
68
+ + let center = NotificationCenter.default
69
+ + for name in [NSWindow.didResizeNotification, NSWindow.didBecomeMainNotification, NSWindow.didChangeBackingPropertiesNotification] {
70
+ + observers.append(center.addObserver(forName: name, object: nil, queue: .main) { [weak self] _ in self?.onNativePlatformChange() })
71
+ + }
72
+ + appearanceObservation = NSApplication.shared.observe(\.effectiveAppearance) { [weak self] _, _ in
73
+ + DispatchQueue.main.async { self?.onNativePlatformChange() }
74
+ + }
75
+ + }
76
+ +
77
+ + deinit {
78
+ + observers.forEach { NotificationCenter.default.removeObserver($0) }
79
+ + }
80
+ +
81
+ + func onMain<T>(_ body: () -> T) -> T {
82
+ + Thread.isMainThread ? body() : DispatchQueue.main.sync(execute: body)
83
+ + }
84
+ +
85
+ + var mainWindow: NSWindow? { NSApplication.shared.mainWindow ?? NSApplication.shared.keyWindow ?? NSApplication.shared.windows.first { $0.isVisible } }
86
+ +
87
+ + func buildMiniRuntime() -> UnistylesNativeMiniRuntime {
88
+ + let screen = getScreenDimensions()
89
+ + return UnistylesNativeMiniRuntime(
90
+ + colorScheme: getColorScheme(),
91
+ + screen: screen,
92
+ + contentSizeCategory: getContentSizeCategory(),
93
+ + insets: getInsets(),
94
+ + pixelRatio: getPixelRatio(),
95
+ + fontScale: getFontScale(),
96
+ + rtl: getPrefersRtlDirection(),
97
+ + statusBar: getStatusBarDimensions(),
98
+ + navigationBar: getNavigationBarDimensions(),
99
+ + isPortrait: screen.height >= screen.width,
100
+ + isLandscape: screen.width > screen.height
101
+ + )
102
+ + }
103
+ +
104
+ + func getMiniRuntime() -> UnistylesNativeMiniRuntime { miniRuntime! }
105
+ +
106
+ + func getColorScheme() -> ColorScheme {
107
+ + onMain { NSApplication.shared.effectiveAppearance.bestMatch(from: [.darkAqua, .aqua]) == .darkAqua ? .dark : .light }
108
+ + }
109
+ +
110
+ + func getFontScale() -> Double { 1 }
111
+ +
112
+ + func getContentSizeCategory() -> String { "unspecified" }
113
+ +
114
+ + func getScreenDimensions() -> Dimensions {
115
+ + onMain {
116
+ + let size = mainWindow?.contentView?.bounds.size ?? NSScreen.main?.frame.size ?? .zero
117
+ + return Dimensions(width: size.width, height: size.height)
118
+ + }
119
+ + }
120
+ +
121
+ + func getOrientation() -> Orientation {
122
+ + let screen = getScreenDimensions()
123
+ + return screen.width > screen.height ? .landscape : .portrait
124
+ + }
125
+ +
126
+ + func getInsets() -> Insets { Insets(top: 0, bottom: 0, left: 0, right: 0, ime: 0) }
127
+ +
128
+ + func getPrefersRtlDirection() -> Bool {
129
+ + onMain { UserDefaults.standard.bool(forKey: "RCTI18nUtil_forceRTL") || NSApplication.shared.userInterfaceLayoutDirection == .rightToLeft }
130
+ + }
131
+ +
132
+ + func getStatusBarDimensions() -> Dimensions { Dimensions(width: 0, height: 0) }
133
+ +
134
+ + func getNavigationBarDimensions() -> Dimensions { Dimensions(width: 0, height: 0) }
135
+ +
136
+ + func getPixelRatio() -> Double {
137
+ + onMain { Double(mainWindow?.backingScaleFactor ?? NSScreen.main?.backingScaleFactor ?? 1) }
138
+ + }
139
+ +
140
+ + func setRootViewBackgroundColor(color: Double) throws {
141
+ + let value = Int(color)
142
+ + DispatchQueue.main.async {
143
+ + self.mainWindow?.backgroundColor = NSColor(red: CGFloat((value >> 16) & 0xFF) / 255, green: CGFloat((value >> 8) & 0xFF) / 255, blue: CGFloat(value & 0xFF) / 255, alpha: 1)
144
+ + }
145
+ + }
146
+ +
147
+ + func setStatusBarHidden(isHidden: Bool) throws {}
148
+ +
149
+ + func setNavigationBarHidden(isHidden: Bool) throws {}
150
+ +
151
+ + func setImmersiveMode(isEnabled: Bool) throws {}
152
+ +
153
+ + func registerPlatformListener(callback: @escaping (Array<UnistyleDependency>, UnistylesNativeMiniRuntime) -> Void) throws {
154
+ + dependencyListeners.append(callback)
155
+ + }
156
+ +
157
+ + // Desktop windows have no software keyboard, so the IME inset never changes.
158
+ + func registerImeListener(callback: @escaping (UnistylesNativeMiniRuntime) -> Void) throws {}
159
+ +
160
+ + func unregisterPlatformListeners() throws {
161
+ + dependencyListeners.removeAll()
162
+ + }
163
+ +
164
+ + func onNativePlatformChange() {
165
+ + guard let current = miniRuntime else { return }
166
+ + let next = buildMiniRuntime()
167
+ + let changed = UnistylesNativeMiniRuntime.diff(lhs: current, rhs: next)
168
+ + if !changed.isEmpty {
169
+ + miniRuntime = next
170
+ + dependencyListeners.forEach { $0(changed, next) }
171
+ + }
172
+ + }
173
+ +}
174
+ +
175
+ +#endif
176
+ diff --git a/ios/NativePlatform.swift b/ios/NativePlatform.swift
177
+ index d8b86a1..90288a2 100644
178
+ --- a/ios/NativePlatform.swift
179
+ +++ b/ios/NativePlatform.swift
180
+ @@ -8,6 +8,8 @@ public class NativePlatform {
181
+ public static func create() -> HybridNativePlatformSpec_cxx {
182
+ #if os(iOS)
183
+ let nativePlatform = NativeIOSPlatform()
184
+ + #elseif os(macOS)
185
+ + let nativePlatform = NativeMacOSPlatform()
186
+ #else
187
+ throw PlatformError.UnsupportedPlatform
188
+ #endif
189
+ diff --git a/ios/NativePlatformListener+ios.swift b/ios/NativePlatformListener+ios.swift
190
+ index ac7db8f..8968117 100644
191
+ --- a/ios/NativePlatformListener+ios.swift
192
+ +++ b/ios/NativePlatformListener+ios.swift
193
+ @@ -1,3 +1,4 @@
194
+ +#if os(iOS)
195
+ import Foundation
196
+ import Combine
197
+
198
+ @@ -65,3 +66,5 @@ extension NativeIOSPlatform {
199
+ }
200
+ }
201
+ }
202
+ +
203
+ +#endif
@@ -0,0 +1,13 @@
1
+ diff --git a/react-native-worklets-core.podspec b/react-native-worklets-core.podspec
2
+ index f5b58d7..c9bcfea 100644
3
+ --- a/react-native-worklets-core.podspec
4
+ +++ b/react-native-worklets-core.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 => "11.0" }
10
+ + s.platforms = { :ios => "11.0", :osx => "14.0" }
11
+ s.source = { :git => "https://github.com/margelo/react-native-worklets-core.git", :tag => "#{s.version}" }
12
+
13
+ s.source_files = "ios/**/*.{h,m,mm}", "cpp/**/*.{h,cpp}"
@@ -0,0 +1,16 @@
1
+ diff --git a/lib/module/views/NativeStackView.macos.js b/lib/module/views/NativeStackView.macos.js
2
+ new file mode 100644
3
+ index 0000000..c42b5d6
4
+ --- /dev/null
5
+ +++ b/lib/module/views/NativeStackView.macos.js
6
+ @@ -0,0 +1,2 @@
7
+ +// macOS has no native stack: use the JavaScript stack view, which draws headers with @react-navigation/elements.
8
+ +export * from "./NativeStackView.js";
9
+ diff --git a/src/views/NativeStackView.macos.tsx b/src/views/NativeStackView.macos.tsx
10
+ new file mode 100644
11
+ index 0000000..82511c8
12
+ --- /dev/null
13
+ +++ b/src/views/NativeStackView.macos.tsx
14
+ @@ -0,0 +1,2 @@
15
+ +// macOS has no native stack: use the JavaScript stack view, which draws headers with @react-navigation/elements.
16
+ +export * from './NativeStackView.tsx';