@legendapp/spark 0.0.1 → 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 (141) hide show
  1. package/native.d.cts +6 -3
  2. package/package.json +36 -28
  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-enriched-markdown@1.1.1.patch +141 -10
  24. package/patches/react-native-fast-image@10.9.9.patch +131 -0
  25. package/patches/react-native-graph@1.4.0.patch +157 -0
  26. package/patches/react-native-keyboard-controller@1.22.9.patch +16 -0
  27. package/patches/react-native-masked-view-masked-view@0.3.2.patch +140 -0
  28. package/patches/react-native-mmkv@4.3.2.patch +40 -0
  29. package/patches/react-native-nitro-fetch@1.9.0.patch +130 -0
  30. package/patches/react-native-nitro-zxing@0.3.0.patch +13 -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/sentry-react-native@8.32.0.patch +76 -0
  41. package/skills/spark/UPGRADING.md +122 -3
  42. package/vendor/node_modules/@legendapp/spark-ai/package.json +5 -5
  43. package/vendor/node_modules/@legendapp/spark-audio/package.json +5 -5
  44. package/vendor/node_modules/@legendapp/spark-audio/src/index.macos.ts +1 -0
  45. package/vendor/node_modules/@legendapp/spark-auth-session/package.json +6 -6
  46. package/vendor/node_modules/@legendapp/spark-auth-session/src/index.macos.ts +1 -0
  47. package/vendor/node_modules/@legendapp/spark-cli/dist/add-desktop.js +2 -2
  48. package/vendor/node_modules/@legendapp/spark-cli/dist/build.js +17 -5
  49. package/vendor/node_modules/@legendapp/spark-cli/dist/cli-arguments.js +4 -2
  50. package/vendor/node_modules/@legendapp/spark-cli/dist/create.js +8 -4
  51. package/vendor/node_modules/@legendapp/spark-cli/dist/dependency-pins.js +45 -1
  52. package/vendor/node_modules/@legendapp/spark-cli/dist/dev.js +15 -3
  53. package/vendor/node_modules/@legendapp/spark-cli/dist/examples.js +2 -2
  54. package/vendor/node_modules/@legendapp/spark-cli/dist/expo-dev-patch.cjs +3 -3
  55. package/vendor/node_modules/@legendapp/spark-cli/dist/expo-dev-preload.cjs +3 -0
  56. package/vendor/node_modules/@legendapp/spark-cli/dist/index.js +26 -7
  57. package/vendor/node_modules/@legendapp/spark-cli/dist/metro.cjs +3 -1
  58. package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.cjs +20 -5
  59. package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.d.cts +1 -0
  60. package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.cjs +10 -2
  61. package/vendor/node_modules/@legendapp/spark-cli/dist/native-patch-preflight.js +3 -3
  62. package/vendor/node_modules/@legendapp/spark-cli/dist/project.js +28 -10
  63. package/vendor/node_modules/@legendapp/spark-cli/dist/release-runner-root.js +108 -0
  64. package/vendor/node_modules/@legendapp/spark-cli/dist/release.json +13 -13
  65. package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-input-cache.js +140 -0
  66. package/vendor/node_modules/@legendapp/spark-cli/dist/watchman.js +12 -0
  67. package/vendor/node_modules/@legendapp/spark-cli/dist/windows-geometry.js +2 -2
  68. package/vendor/node_modules/@legendapp/spark-cli/dist/windows.js +1 -1
  69. package/vendor/node_modules/@legendapp/spark-cli/package.json +3 -3
  70. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/desktop.config.json +1 -1
  71. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/package.json +27 -25
  72. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/desktop.config.json +1 -1
  73. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/package.json +35 -33
  74. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/package.json +29 -27
  75. package/vendor/node_modules/@legendapp/spark-clipboard/package.json +5 -5
  76. package/vendor/node_modules/@legendapp/spark-clipboard/src/index.macos.ts +1 -0
  77. package/vendor/node_modules/@legendapp/spark-codex/package.json +4 -4
  78. package/vendor/node_modules/@legendapp/spark-commands/package.json +7 -7
  79. package/vendor/node_modules/@legendapp/spark-context-menu/package.json +4 -4
  80. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkDesktop.mm +7 -2
  81. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkTestDriver.mm +64 -2
  82. package/vendor/node_modules/@legendapp/spark-desktop-app/package.json +3 -3
  83. package/vendor/node_modules/@legendapp/spark-desktop-config/accessibility-state.cjs +2 -2
  84. package/vendor/node_modules/@legendapp/spark-desktop-config/app.plugin.cjs +12 -0
  85. package/vendor/node_modules/@legendapp/spark-desktop-config/autolinking.cjs +7 -6
  86. package/vendor/node_modules/@legendapp/spark-desktop-config/config.d.cts +1 -1
  87. package/vendor/node_modules/@legendapp/spark-desktop-config/fabric-lifecycle.cjs +1 -1
  88. package/vendor/node_modules/@legendapp/spark-desktop-config/keyboard-events.cjs +2 -2
  89. package/vendor/node_modules/@legendapp/spark-desktop-config/macos-host.cjs +39 -0
  90. package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.cjs +73 -20
  91. package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.d.cts +2 -1
  92. package/vendor/node_modules/@legendapp/spark-desktop-config/package.json +8 -6
  93. package/vendor/node_modules/@legendapp/spark-desktop-config/rtl-scroll-view.cjs +2 -2
  94. package/vendor/node_modules/@legendapp/spark-desktop-config/rtl-text-alignment.cjs +2 -2
  95. package/vendor/node_modules/@legendapp/spark-desktop-config/rtl-text-input-alignment.cjs +2 -2
  96. package/vendor/node_modules/@legendapp/spark-desktop-config/text-input-accessibility.cjs +2 -2
  97. package/vendor/node_modules/@legendapp/spark-desktop-host/macos/AppDelegate.h +6 -0
  98. package/vendor/node_modules/@legendapp/spark-desktop-host/macos/Main.storyboard +684 -0
  99. package/vendor/node_modules/@legendapp/spark-desktop-host/macos/main.m +5 -0
  100. package/vendor/node_modules/@legendapp/spark-desktop-host/package.json +3 -2
  101. package/vendor/node_modules/@legendapp/spark-desktop-links/package.json +5 -5
  102. package/vendor/node_modules/@legendapp/spark-desktop-links/src/index.macos.ts +1 -0
  103. package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/package.json +4 -4
  104. package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/RNWindowManager.mm +68 -17
  105. package/vendor/node_modules/@legendapp/spark-desktop-windows/package.json +5 -5
  106. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/macos-adapter.ts +2 -1
  107. package/vendor/node_modules/@legendapp/spark-documents/package.json +9 -9
  108. package/vendor/node_modules/@legendapp/spark-drag-drop/package.json +4 -4
  109. package/vendor/node_modules/@legendapp/spark-file-dialog/package.json +4 -4
  110. package/vendor/node_modules/@legendapp/spark-file-system/macos/RNDesktopFileSystem.mm +14 -5
  111. package/vendor/node_modules/@legendapp/spark-file-system/package.json +4 -4
  112. package/vendor/node_modules/@legendapp/spark-file-system/src/index.ts +1 -1
  113. package/vendor/node_modules/@legendapp/spark-global-shortcuts/package.json +4 -4
  114. package/vendor/node_modules/@legendapp/spark-html/package.json +4 -4
  115. package/vendor/node_modules/@legendapp/spark-markdown/package.json +4 -4
  116. package/vendor/node_modules/@legendapp/spark-message-dialog/package.json +4 -4
  117. package/vendor/node_modules/@legendapp/spark-native-menu/package.json +4 -4
  118. package/vendor/node_modules/@legendapp/spark-notifications/package.json +4 -4
  119. package/vendor/node_modules/@legendapp/spark-processes/macos/RNDesktopProcesses.mm +110 -19
  120. package/vendor/node_modules/@legendapp/spark-processes/package.json +4 -4
  121. package/vendor/node_modules/@legendapp/spark-processes/src/index.ts +17 -3
  122. package/vendor/node_modules/@legendapp/spark-processes/src/types.ts +6 -0
  123. package/vendor/node_modules/@legendapp/spark-rich-text/package.json +4 -4
  124. package/vendor/node_modules/@legendapp/spark-secure-storage/package.json +5 -5
  125. package/vendor/node_modules/@legendapp/spark-secure-storage/src/index.macos.ts +1 -0
  126. package/vendor/node_modules/@legendapp/spark-settings/package.json +3 -3
  127. package/vendor/node_modules/@legendapp/spark-settings-ui/package.json +6 -6
  128. package/vendor/node_modules/@legendapp/spark-sqlite/package.json +12 -5
  129. package/vendor/node_modules/@legendapp/spark-system/package.json +4 -4
  130. package/vendor/node_modules/@legendapp/spark-tray/package.json +4 -4
  131. package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSidebarSplitViewComponent.mm +82 -18
  132. package/vendor/node_modules/@legendapp/spark-ui/package.json +6 -6
  133. package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SidebarSplitViewNativeComponent.ts +4 -0
  134. package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/index.tsx +11 -9
  135. package/vendor/node_modules/@legendapp/spark-ui/src/index.android.tsx +20 -10
  136. package/vendor/node_modules/@legendapp/spark-ui/src/index.ios.tsx +15 -10
  137. package/vendor/node_modules/@legendapp/spark-ui/src/index.macos.tsx +1 -0
  138. package/vendor/node_modules/@legendapp/spark-updates/package.json +4 -4
  139. package/vendor/node_modules/@legendapp/spark-webview/package.json +11 -4
  140. package/vendor/node_modules/@legendapp/spark-window-options/package.json +1 -1
  141. package/camera.ts +0 -13
@@ -0,0 +1,5 @@
1
+ #import <Cocoa/Cocoa.h>
2
+
3
+ int main(int argc, const char *argv[]) {
4
+ return NSApplicationMain(argc, argv);
5
+ }
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@legendapp/spark-desktop-host",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "AppDelegate.mm",
7
+ "macos",
7
8
  "windows",
8
9
  "SparkCustomize.mm"
9
10
  ],
10
11
  "dependencies": {
11
- "@legendapp/spark-desktop-app": "0.0.1"
12
+ "@legendapp/spark-desktop-app": "0.0.3"
12
13
  },
13
14
  "private": true
14
15
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-desktop-links",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "license": "MIT",
5
5
  "main": "src/index",
6
6
  "react-native": "src/index",
@@ -13,9 +13,9 @@
13
13
  "common"
14
14
  ],
15
15
  "peerDependencies": {
16
- "react": "^19.1.0",
17
- "react-native": "0.81.6",
18
- "expo-linking": "~8.0.12"
16
+ "react": "^19.2.0",
17
+ "react-native": "0.83.10",
18
+ "expo-linking": "~55.0.17"
19
19
  },
20
20
  "codegenConfig": {
21
21
  "name": "RNDesktopLinksSpec",
@@ -42,7 +42,7 @@
42
42
  ]
43
43
  },
44
44
  "dependencies": {
45
- "@legendapp/spark-desktop-app": "0.0.1"
45
+ "@legendapp/spark-desktop-app": "0.0.3"
46
46
  },
47
47
  "peerDependenciesMeta": {
48
48
  "expo-linking": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-desktop-shortcuts",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "license": "MIT",
5
5
  "main": "src/index",
6
6
  "react-native": "src/index",
@@ -10,8 +10,8 @@
10
10
  "*.podspec"
11
11
  ],
12
12
  "peerDependencies": {
13
- "react": "^19.1.0",
14
- "react-native": "0.81.6"
13
+ "react": "^19.2.0",
14
+ "react-native": "0.83.10"
15
15
  },
16
16
  "codegenConfig": {
17
17
  "name": "RNDesktopShortcutsSpec",
@@ -40,7 +40,7 @@
40
40
  ]
41
41
  },
42
42
  "dependencies": {
43
- "@legendapp/spark-desktop-app": "0.0.1"
43
+ "@legendapp/spark-desktop-app": "0.0.3"
44
44
  },
45
45
  "private": true
46
46
  }
@@ -821,6 +821,7 @@ extern "C" void LegendPrecreateRestorableWindows(void)
821
821
  @property (nonatomic, strong) NSMutableDictionary<NSString *, NSArray<NSTitlebarAccessoryViewController *> *> *titlebarAccessoryControllers;
822
822
  @property (nonatomic, strong) NSMutableDictionary<NSString *, NSView *> *titlebarMaterialViews;
823
823
  @property (nonatomic, strong) NSMutableDictionary<NSString *, NSArray<NSDictionary *> *> *toolbarItemConfigs;
824
+ @property (nonatomic, strong, nullable) NSToolbarItem *movingToolbarItem;
824
825
  @property (nonatomic, strong) NSMutableDictionary<NSString *, CIFilter *> *windowBlurFilters;
825
826
  @property (nonatomic, strong) NSMutableDictionary<NSString *, NSDictionary *> *windowOptions;
826
827
  @property (nonatomic, strong) NSMutableSet<NSString *> *closeRequestIdentifiers;
@@ -1267,13 +1268,52 @@ RCT_EXPORT_MODULE(NativeWindowManager)
1267
1268
  }
1268
1269
  if (menuUpdate) return;
1269
1270
  }
1271
+ // Moving an item takes its control out of the window, which ends editing in a focused text field (ignored while
1272
+ // movingToolbarItem is set), so focus and selection are restored afterwards.
1273
+ NSText *editor = [window.firstResponder isKindOfClass:NSText.class] ? (NSText *)window.firstResponder : nil;
1274
+ NSControl *focused = [editor.delegate isKindOfClass:NSControl.class] ? (NSControl *)editor.delegate : nil;
1275
+ NSRange selection = editor.selectedRange;
1276
+ [self updateToolbar:toolbar previousConfigs:previousConfigs ?: @[]];
1277
+ if (focused && !focused.currentEditor) {
1278
+ [window layoutIfNeeded];
1279
+ if (focused.window == window && [window makeFirstResponder:focused]) focused.currentEditor.selectedRange = selection;
1280
+ }
1281
+ }
1270
1282
 
1271
- while (toolbar.items.count > 0) {
1272
- [toolbar removeItemAtIndex:toolbar.items.count - 1];
1283
+ // Recreating an item resets its control (a search field loses its text and focus), so only changed items are replaced
1284
+ // and kept items that change position are moved: removed and inserted again as the same item.
1285
+ - (void)updateToolbar:(NSToolbar *)toolbar previousConfigs:(NSArray<NSDictionary *> *)previousConfigs
1286
+ {
1287
+ NSMutableDictionary<NSString *, NSDictionary *> *previousByIdentifier = [NSMutableDictionary new];
1288
+ for (NSDictionary *config in previousConfigs) {
1289
+ NSString *itemIdentifier = [self toolbarItemIdentifierForConfig:config];
1290
+ if (itemIdentifier.length > 0) previousByIdentifier[itemIdentifier] = config;
1273
1291
  }
1274
- for (NSToolbarItemIdentifier itemIdentifier in [self toolbarDefaultItemIdentifiers:toolbar]) {
1275
- [toolbar insertItemWithItemIdentifier:itemIdentifier atIndex:toolbar.items.count];
1292
+ NSMutableDictionary<NSString *, NSDictionary *> *nextByIdentifier = [NSMutableDictionary new];
1293
+ for (NSDictionary *config in self.toolbarItemConfigs[toolbar.identifier] ?: @[]) {
1294
+ NSString *itemIdentifier = [self toolbarItemIdentifierForConfig:config];
1295
+ if (itemIdentifier.length > 0) nextByIdentifier[itemIdentifier] = config;
1296
+ }
1297
+ NSArray<NSToolbarItemIdentifier> *identifiers = [self toolbarDefaultItemIdentifiers:toolbar];
1298
+ for (NSInteger index = (NSInteger)toolbar.items.count - 1; index >= 0; index--) {
1299
+ NSToolbarItemIdentifier itemIdentifier = toolbar.items[index].itemIdentifier;
1300
+ NSDictionary *previous = previousByIdentifier[itemIdentifier];
1301
+ NSDictionary *next = nextByIdentifier[itemIdentifier];
1302
+ BOOL unchanged = previous || next ? [previous isEqualToDictionary:next] : YES;
1303
+ if (![identifiers containsObject:itemIdentifier] || !unchanged) [toolbar removeItemAtIndex:index];
1304
+ }
1305
+ for (NSUInteger index = 0; index < identifiers.count; index++) {
1306
+ if (index < toolbar.items.count && [toolbar.items[index].itemIdentifier isEqual:identifiers[index]]) continue;
1307
+ for (NSUInteger later = index + 1; later < toolbar.items.count; later++) {
1308
+ if (![toolbar.items[later].itemIdentifier isEqual:identifiers[index]]) continue;
1309
+ self.movingToolbarItem = toolbar.items[later];
1310
+ [toolbar removeItemAtIndex:later];
1311
+ break;
1312
+ }
1313
+ [toolbar insertItemWithItemIdentifier:identifiers[index] atIndex:index];
1314
+ self.movingToolbarItem = nil;
1276
1315
  }
1316
+ while (toolbar.items.count > identifiers.count) [toolbar removeItemAtIndex:toolbar.items.count - 1];
1277
1317
  }
1278
1318
 
1279
1319
  - (NSArray<NSToolbarItemIdentifier> *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar
@@ -1310,7 +1350,7 @@ RCT_EXPORT_MODULE(NativeWindowManager)
1310
1350
  NSString *identifier = [representedObject[@"windowIdentifier"] isKindOfClass:NSString.class]
1311
1351
  ? representedObject[@"windowIdentifier"]
1312
1352
  : @"";
1313
- NSWindow *window = (NSWindow *)self.windows[identifier];
1353
+ NSWindow *window = [self windowForIdentifier:identifier];
1314
1354
  [window makeKeyAndOrderFront:nil];
1315
1355
  [window makeFirstResponder:searchField];
1316
1356
  }
@@ -1414,6 +1454,9 @@ RCT_EXPORT_MODULE(NativeWindowManager)
1414
1454
  itemForItemIdentifier:(NSToolbarItemIdentifier)itemIdentifier
1415
1455
  willBeInsertedIntoToolbar:(BOOL)flag
1416
1456
  {
1457
+ if ([self.movingToolbarItem.itemIdentifier isEqual:itemIdentifier]) {
1458
+ return self.movingToolbarItem;
1459
+ }
1417
1460
  NSDictionary *config = [self toolbarItemConfigForIdentifier:itemIdentifier toolbar:toolbar];
1418
1461
  if (!config) {
1419
1462
  return nil;
@@ -1905,7 +1948,7 @@ willBeInsertedIntoToolbar:(BOOL)flag
1905
1948
 
1906
1949
  - (void)controlTextDidEndEditing:(NSNotification *)notification
1907
1950
  {
1908
- if ([notification.object isKindOfClass:NSSearchField.class]) {
1951
+ if (!self.movingToolbarItem && [notification.object isKindOfClass:NSSearchField.class]) {
1909
1952
  NSSearchField *searchField = (NSSearchField *)notification.object;
1910
1953
  if (searchField.stringValue.length == 0) {
1911
1954
  id associatedItem = objc_getAssociatedObject(searchField, &LegendToolbarSearchItemKey);
@@ -1918,6 +1961,7 @@ willBeInsertedIntoToolbar:(BOOL)flag
1918
1961
 
1919
1962
  - (void)toolbarSearchSubmitted:(NSSearchField *)sender
1920
1963
  {
1964
+ if (self.movingToolbarItem) return;
1921
1965
  NSEvent *currentEvent = NSApp.currentEvent;
1922
1966
  BOOL shiftKey = currentEvent && ((currentEvent.modifierFlags & NSEventModifierFlagShift) != 0);
1923
1967
  [self sendToolbarSearchEventForField:sender submitted:YES shiftKey:shiftKey];
@@ -2410,9 +2454,7 @@ willBeInsertedIntoToolbar:(BOOL)flag
2410
2454
  #if TARGET_OS_OSX
2411
2455
  RCTExecuteOnMainQueue(^{
2412
2456
  NSString *targetIdentifier = [self normalizeIdentifier:identifier];
2413
- NSWindow *window = [targetIdentifier isEqualToString:@"main"]
2414
- ? [RNWindowManager getMainWindow]
2415
- : (NSWindow *)self.windows[targetIdentifier];
2457
+ NSWindow *window = [self windowForIdentifier:targetIdentifier];
2416
2458
  if (!window) {
2417
2459
  reject(@"E_NOT_FOUND", @"Window not found", nil);
2418
2460
  return;
@@ -2434,7 +2476,7 @@ willBeInsertedIntoToolbar:(BOOL)flag
2434
2476
  #if TARGET_OS_OSX
2435
2477
  RCTExecuteOnMainQueue(^{
2436
2478
  NSString *targetIdentifier = [self normalizeIdentifier:identifier];
2437
- NSWindow *window = (NSWindow *)self.windows[targetIdentifier];
2479
+ NSWindow *window = [self windowForIdentifier:targetIdentifier];
2438
2480
  if (!window) {
2439
2481
  resolve([self failureJson:@"Window not found"]);
2440
2482
  return;
@@ -2509,9 +2551,7 @@ willBeInsertedIntoToolbar:(BOOL)flag
2509
2551
  #if TARGET_OS_OSX
2510
2552
  RCTExecuteOnMainQueue(^{
2511
2553
  NSString *targetIdentifier = [self normalizeIdentifier:identifier];
2512
- NSWindow *window = [targetIdentifier isEqualToString:@"main"]
2513
- ? [RNWindowManager getMainWindow]
2514
- : (NSWindow *)self.windows[targetIdentifier];
2554
+ NSWindow *window = [self windowForIdentifier:targetIdentifier];
2515
2555
  if (!window) {
2516
2556
  reject(@"E_NOT_FOUND", @"Window not found", nil);
2517
2557
  return;
@@ -2648,7 +2688,7 @@ willBeInsertedIntoToolbar:(BOOL)flag
2648
2688
  #if TARGET_OS_OSX
2649
2689
  RCTExecuteOnMainQueue(^{
2650
2690
  NSString *targetIdentifier = [self normalizeIdentifier:identifier];
2651
- NSWindow *window = (NSWindow *)self.windows[targetIdentifier];
2691
+ NSWindow *window = [self windowForIdentifier:targetIdentifier];
2652
2692
  if (!window) {
2653
2693
  reject(@"E_NOT_FOUND", @"Window not found", nil);
2654
2694
  return;
@@ -2704,7 +2744,7 @@ willBeInsertedIntoToolbar:(BOOL)flag
2704
2744
  RCTExecuteOnMainQueue(^{
2705
2745
  NSString *targetIdentifier = [self normalizeIdentifier:identifier];
2706
2746
  NSDictionary *options = [self parseObjectJSON:optionsJson];
2707
- NSWindow *window = (NSWindow *)self.windows[targetIdentifier];
2747
+ NSWindow *window = [self windowForIdentifier:targetIdentifier];
2708
2748
  if (!window) {
2709
2749
  reject(@"E_NOT_FOUND", @"Window not found", nil);
2710
2750
  return;
@@ -2772,7 +2812,7 @@ willBeInsertedIntoToolbar:(BOOL)flag
2772
2812
  #if TARGET_OS_OSX
2773
2813
  RCTExecuteOnMainQueue(^{
2774
2814
  NSString *targetIdentifier = [self normalizeIdentifier:identifier];
2775
- NSWindow *window = (NSWindow *)self.windows[targetIdentifier];
2815
+ NSWindow *window = [self windowForIdentifier:targetIdentifier];
2776
2816
  if (!window) {
2777
2817
  reject(@"E_NOT_FOUND", @"Target window not found for blur animation", nil);
2778
2818
  return;
@@ -2862,7 +2902,11 @@ willBeInsertedIntoToolbar:(BOOL)flag
2862
2902
  // AppKit's window list includes precreated/restored document windows and has
2863
2903
  // no stable ordering. Both supported hosts own the main window on the delegate.
2864
2904
  id<RNWindowManagerRootViewFactoryProvider> delegate = (id)NSApplication.sharedApplication.delegate;
2865
- return [delegate respondsToSelector:@selector(window)] ? delegate.window : nil;
2905
+ NSWindow *window = [delegate respondsToSelector:@selector(window)] ? delegate.window : nil;
2906
+ if (window && !objc_getAssociatedObject(window, NSSelectorFromString(@"sparkWindowInstanceId"))) {
2907
+ objc_setAssociatedObject(window, NSSelectorFromString(@"sparkWindowInstanceId"), NSUUID.UUID.UUIDString, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
2908
+ }
2909
+ return window;
2866
2910
  }
2867
2911
 
2868
2912
  - (void)setupMainWindowObservers
@@ -3162,6 +3206,13 @@ willBeInsertedIntoToolbar:(BOOL)flag
3162
3206
  {
3163
3207
  return [identifier isKindOfClass:NSString.class] && identifier.length > 0 ? identifier : @"default";
3164
3208
  }
3209
+
3210
+ // The host owns "main", which reaches the registry only once RNDesktopWindows looks it up.
3211
+ - (NSWindow *)windowForIdentifier:(NSString *)identifier
3212
+ {
3213
+ NSWindow *window = (NSWindow *)self.windows[identifier];
3214
+ return window ?: ([identifier isEqualToString:@"main"] ? [RNWindowManager getMainWindow] : nil);
3215
+ }
3165
3216
  #endif
3166
3217
 
3167
3218
  - (void)invalidate
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-desktop-windows",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "license": "MIT",
5
5
  "main": "src/index",
6
6
  "react-native": "src/index",
@@ -10,8 +10,8 @@
10
10
  "*.podspec"
11
11
  ],
12
12
  "peerDependencies": {
13
- "react": "^19.1.0",
14
- "react-native": "0.81.6"
13
+ "react": "^19.2.0",
14
+ "react-native": "0.83.10"
15
15
  },
16
16
  "codegenConfig": {
17
17
  "name": "RNDesktopWindowsSpec",
@@ -40,8 +40,8 @@
40
40
  ]
41
41
  },
42
42
  "dependencies": {
43
- "@legendapp/spark-desktop-app": "0.0.1",
44
- "@legendapp/spark-window-options": "0.0.1",
43
+ "@legendapp/spark-desktop-app": "0.0.3",
44
+ "@legendapp/spark-window-options": "0.0.3",
45
45
  "@legendapp/state": "^3.0.0-beta.42"
46
46
  },
47
47
  "private": true
@@ -51,5 +51,6 @@ export async function createMacOSWindow(options: WindowOpenOptions): Promise<voi
51
51
  await macosCommand(() => macosNative().openWindow(JSON.stringify({ ...macosOptions(options), identifier: options.id, moduleName: options.component, initialProperties: options.props ?? {}, title: options.title, deferOrderFront: true, sparkOverlay: options.kind === "overlay" })));
52
52
  }
53
53
  export async function updateMacOSWindow(id: string, options: WindowUpdateOptions): Promise<void> {
54
- await macosCommand(() => macosNative().setWindowOptions(id, JSON.stringify(macosOptions(options))));
54
+ const native = macosNative(), json = JSON.stringify(macosOptions(options));
55
+ await macosCommand(() => id === "main" ? native.setMainWindowOptions(json) : native.setWindowOptions(id, json));
55
56
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-documents",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "main": "src/index.tsx",
@@ -8,15 +8,15 @@
8
8
  "src"
9
9
  ],
10
10
  "dependencies": {
11
- "@legendapp/spark-file-dialog": "0.0.1",
12
- "@legendapp/spark-file-system": "0.0.1",
13
- "@legendapp/spark-native-menu": "0.0.1",
14
- "@legendapp/spark-desktop-app": "0.0.1",
15
- "@legendapp/spark-desktop-windows": "0.0.1",
16
- "@legendapp/spark-desktop-links": "0.0.1"
11
+ "@legendapp/spark-file-dialog": "0.0.3",
12
+ "@legendapp/spark-file-system": "0.0.3",
13
+ "@legendapp/spark-native-menu": "0.0.3",
14
+ "@legendapp/spark-desktop-app": "0.0.3",
15
+ "@legendapp/spark-desktop-windows": "0.0.3",
16
+ "@legendapp/spark-desktop-links": "0.0.3"
17
17
  },
18
18
  "peerDependencies": {
19
- "react": "^19.1.0",
20
- "react-native": "0.81.6"
19
+ "react": "^19.2.0",
20
+ "react-native": "0.83.10"
21
21
  }
22
22
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-drag-drop",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "license": "MIT",
5
5
  "main": "src/index.tsx",
6
6
  "react-native": "src/index.tsx",
@@ -12,8 +12,8 @@
12
12
  "react-native.config.js"
13
13
  ],
14
14
  "peerDependencies": {
15
- "react": "^19.1.0",
16
- "react-native": "0.81.6"
15
+ "react": "^19.2.0",
16
+ "react-native": "0.83.10"
17
17
  },
18
18
  "codegenConfig": {
19
19
  "name": "RNDesktopDragSpec",
@@ -39,7 +39,7 @@
39
39
  ]
40
40
  },
41
41
  "dependencies": {
42
- "@legendapp/spark-desktop-app": "0.0.1"
42
+ "@legendapp/spark-desktop-app": "0.0.3"
43
43
  },
44
44
  "private": true
45
45
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-file-dialog",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "main": "src/index",
5
5
  "react-native": "src/index",
6
6
  "codegenConfig": {
@@ -18,8 +18,8 @@
18
18
  }
19
19
  },
20
20
  "peerDependencies": {
21
- "react": "^19.1.0",
22
- "react-native": "0.81.6"
21
+ "react": "^19.2.0",
22
+ "react-native": "0.83.10"
23
23
  },
24
24
  "license": "MIT",
25
25
  "files": [
@@ -45,6 +45,6 @@
45
45
  },
46
46
  "private": true,
47
47
  "dependencies": {
48
- "@legendapp/spark-desktop-app": "0.0.1"
48
+ "@legendapp/spark-desktop-app": "0.0.3"
49
49
  }
50
50
  }
@@ -170,19 +170,28 @@ RCT_EXPORT_MODULE(NativeDesktopFileSystem)
170
170
  NSString *watchID = args[@"id"];
171
171
  if (self.watches[watchID] || self.recursiveWatches[watchID]) { SparkInvalid(reject, @"Watch id already exists"); return; }
172
172
  if ([args[@"recursive"] boolValue]) {
173
- BOOL directory = NO;
174
- if (![fm fileExistsAtPath:url.path isDirectory:&directory] || !directory) { SparkInvalid(reject, @"Recursive watch requires an existing directory"); return; }
173
+ NSString *existing = url.path;
174
+ NSMutableArray<NSString *> *missing = [NSMutableArray new];
175
+ struct stat info;
176
+ while (stat(existing.fileSystemRepresentation, &info) != 0) {
177
+ if (errno != ENOENT) { SparkReject(reject, [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:nil]); return; }
178
+ [missing insertObject:existing.lastPathComponent atIndex:0];
179
+ existing = existing.stringByDeletingLastPathComponent;
180
+ }
181
+ if (!S_ISDIR(info.st_mode)) { SparkReject(reject, [NSError errorWithDomain:NSPOSIXErrorDomain code:ENOTDIR userInfo:nil]); return; }
175
182
  SparkRecursiveWatch *watch = [SparkRecursiveWatch new];
176
183
  // Keep real filesystem paths: Foundation can strip /private while a path
177
184
  // exists, then preserve it after deletion, breaking event comparisons.
178
- char *resolved = realpath(url.fileSystemRepresentation, NULL);
185
+ char *resolved = realpath(existing.fileSystemRepresentation, NULL);
179
186
  if (!resolved) { SparkReject(reject, [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:nil]); return; }
180
- watch.path = [NSString stringWithUTF8String:resolved]; free(resolved);
187
+ NSString *ancestor = [NSString stringWithUTF8String:resolved]; free(resolved);
188
+ watch.path = ancestor;
189
+ for (NSString *component in missing) watch.path = [watch.path stringByAppendingPathComponent:component];
181
190
  __weak RNDesktopFileSystem *weakSelf = self;
182
191
  watch.changed = ^{ [weakSelf sendEventWithName:@"change" body:@{ @"id": watchID, @"path": url.path }]; };
183
192
  FSEventStreamContext context = {0, (__bridge void *)watch, NULL, NULL, NULL};
184
193
  // Observe the parent too, keeping deletion/replacement of the root visible.
185
- NSArray *roots = @[[watch.path stringByDeletingLastPathComponent]];
194
+ NSArray *roots = @[[ancestor stringByDeletingLastPathComponent]];
186
195
  watch.stream = FSEventStreamCreate(NULL, RecursiveChanges, &context, (__bridge CFArrayRef)roots, kFSEventStreamEventIdSinceNow, 0.05,
187
196
  kFSEventStreamCreateFlagUseCFTypes | kFSEventStreamCreateFlagFileEvents | kFSEventStreamCreateFlagWatchRoot | kFSEventStreamCreateFlagNoDefer);
188
197
  if (!watch.stream) { reject(@"E_WATCH", @"Could not create directory watcher", nil); return; }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-file-system",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "license": "MIT",
5
5
  "main": "src/index.ts",
6
6
  "react-native": "src/index.ts",
@@ -12,8 +12,8 @@
12
12
  "react-native.config.js"
13
13
  ],
14
14
  "peerDependencies": {
15
- "react": "^19.1.0",
16
- "react-native": "0.81.6"
15
+ "react": "^19.2.0",
16
+ "react-native": "0.83.10"
17
17
  },
18
18
  "codegenConfig": {
19
19
  "name": "RNDesktopFileSystemSpec",
@@ -43,7 +43,7 @@
43
43
  ]
44
44
  },
45
45
  "dependencies": {
46
- "@legendapp/spark-desktop-app": "0.0.1"
46
+ "@legendapp/spark-desktop-app": "0.0.3"
47
47
  },
48
48
  "private": true
49
49
  }
@@ -105,7 +105,7 @@ export async function move(source: string, destination: string, options: CopyMov
105
105
  await call("move", { path: absolute(source), to: absolute(destination), overwrite: overwriteOption(options) });
106
106
  }
107
107
  let nextWatch = 0;
108
- /** Invalidation, not an exact change log. Recursive watches require a directory. */
108
+ /** Invalidation, not an exact change log. On macOS, recursive watches also observe directories created after registration. */
109
109
  export async function watch(path: string, listener: (path: string) => void, options: WatchOptions = {}): Promise<AsyncRegistration> {
110
110
  const location = absolute(path), recursive = recursiveOption(options, false);
111
111
  if (typeof listener !== "function") throw new SparkError("E_INVALID_ARGUMENT", "Expected a watch listener");
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-global-shortcuts",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "license": "MIT",
5
5
  "main": "src/index.ts",
6
6
  "react-native": "src/index.ts",
@@ -12,8 +12,8 @@
12
12
  "react-native.config.js"
13
13
  ],
14
14
  "peerDependencies": {
15
- "react": "^19.1.0",
16
- "react-native": "0.81.6"
15
+ "react": "^19.2.0",
16
+ "react-native": "0.83.10"
17
17
  },
18
18
  "codegenConfig": {
19
19
  "name": "RNDesktopGlobalShortcutsSpec",
@@ -41,7 +41,7 @@
41
41
  ]
42
42
  },
43
43
  "dependencies": {
44
- "@legendapp/spark-desktop-app": "0.0.1"
44
+ "@legendapp/spark-desktop-app": "0.0.3"
45
45
  },
46
46
  "private": true
47
47
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-html",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "main": "src/index.ts",
@@ -9,12 +9,12 @@
9
9
  "src"
10
10
  ],
11
11
  "peerDependencies": {
12
- "react": "^19.1.0",
13
- "react-native": "0.81.6",
12
+ "react": "^19.2.0",
13
+ "react-native": "0.83.10",
14
14
  "react-native-enriched-html": "1.1.1"
15
15
  },
16
16
  "dependencies": {
17
- "@legendapp/spark-rich-text": "0.0.1"
17
+ "@legendapp/spark-rich-text": "0.0.3"
18
18
  },
19
19
  "peerDependenciesMeta": {
20
20
  "react-native-enriched-html": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-markdown",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "main": "src/index.ts",
@@ -9,12 +9,12 @@
9
9
  "src"
10
10
  ],
11
11
  "peerDependencies": {
12
- "react": "^19.1.0",
13
- "react-native": "0.81.6",
12
+ "react": "^19.2.0",
13
+ "react-native": "0.83.10",
14
14
  "react-native-enriched-markdown": "1.1.1"
15
15
  },
16
16
  "dependencies": {
17
- "@legendapp/spark-rich-text": "0.0.1"
17
+ "@legendapp/spark-rich-text": "0.0.3"
18
18
  },
19
19
  "peerDependenciesMeta": {
20
20
  "react-native-enriched-markdown": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-message-dialog",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "license": "MIT",
5
5
  "main": "src/index.ts",
6
6
  "react-native": "src/index.ts",
@@ -12,8 +12,8 @@
12
12
  "react-native.config.js"
13
13
  ],
14
14
  "peerDependencies": {
15
- "react": "^19.1.0",
16
- "react-native": "0.81.6"
15
+ "react": "^19.2.0",
16
+ "react-native": "0.83.10"
17
17
  },
18
18
  "codegenConfig": {
19
19
  "name": "RNDesktopMessageDialogSpec",
@@ -40,7 +40,7 @@
40
40
  ]
41
41
  },
42
42
  "dependencies": {
43
- "@legendapp/spark-desktop-app": "0.0.1"
43
+ "@legendapp/spark-desktop-app": "0.0.3"
44
44
  },
45
45
  "private": true
46
46
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-native-menu",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "main": "src/index",
5
5
  "react-native": "src/index",
6
6
  "codegenConfig": {
@@ -18,8 +18,8 @@
18
18
  }
19
19
  },
20
20
  "peerDependencies": {
21
- "react": "^19.1.0",
22
- "react-native": "0.81.6"
21
+ "react": "^19.2.0",
22
+ "react-native": "0.83.10"
23
23
  },
24
24
  "license": "MIT",
25
25
  "files": [
@@ -41,6 +41,6 @@
41
41
  },
42
42
  "private": true,
43
43
  "dependencies": {
44
- "@legendapp/spark-desktop-app": "0.0.1"
44
+ "@legendapp/spark-desktop-app": "0.0.3"
45
45
  }
46
46
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-notifications",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "license": "MIT",
5
5
  "main": "src/index.ts",
6
6
  "react-native": "src/index.ts",
@@ -12,8 +12,8 @@
12
12
  "react-native.config.js"
13
13
  ],
14
14
  "peerDependencies": {
15
- "react": "^19.1.0",
16
- "react-native": "0.81.6"
15
+ "react": "^19.2.0",
16
+ "react-native": "0.83.10"
17
17
  },
18
18
  "codegenConfig": {
19
19
  "name": "RNDesktopNotificationsSpec",
@@ -40,7 +40,7 @@
40
40
  ]
41
41
  },
42
42
  "dependencies": {
43
- "@legendapp/spark-desktop-app": "0.0.1"
43
+ "@legendapp/spark-desktop-app": "0.0.3"
44
44
  },
45
45
  "private": true
46
46
  }