nitro-ui-macos 0.0.0 → 0.0.1

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 (128) hide show
  1. package/CONTRIBUTING.md +56 -0
  2. package/LICENSE +3 -3
  3. package/PARITY.md +373 -0
  4. package/README.md +144 -5
  5. package/native/nitro-core/Package.swift +78 -0
  6. package/native/nitro-ui-core/Package.swift +112 -0
  7. package/native/nitro-ui-core/Sources/NitroUICoreMac/AnimationFrameDisplayLink.swift +127 -0
  8. package/native/nitro-ui-core/Sources/NitroUICoreMac/HybridAnimationFrameScheduler.swift +91 -0
  9. package/native/nitro-ui-core/Sources/NitroUICoreMac/HybridLinking.swift +18 -0
  10. package/native/nitro-ui-dev/Package.swift +102 -0
  11. package/native/nitro-ui-dev/Sources/NitroUIDevMac/DevBundleLoad.swift +14 -0
  12. package/native/nitro-ui-dev/Sources/NitroUIDevMac/DevBundleLoader.swift +85 -0
  13. package/native/nitro-ui-dev/Sources/NitroUIDevMac/DevLauncher.swift +192 -0
  14. package/native/nitro-ui-dev/Sources/NitroUIDevMac/DevMenu.swift +172 -0
  15. package/native/nitro-ui-dev/Sources/NitroUIDevMac/DevServerBrowser.swift +86 -0
  16. package/native/nitro-ui-dev/Sources/NitroUIDevMac/DevSession.swift +151 -0
  17. package/native/nitro-ui-dev/Sources/NitroUIDevMac/DevShortcuts.swift +85 -0
  18. package/native/nitro-ui-dev/Sources/NitroUIDevMac/DevToast.swift +85 -0
  19. package/native/nitro-ui-dev/Sources/NitroUIDevMac/DevTools.swift +141 -0
  20. package/native/nitro-ui-dev/Sources/NitroUIDevMac/ErrorModels.swift +97 -0
  21. package/native/nitro-ui-dev/Sources/NitroUIDevMac/ErrorOverlay.swift +698 -0
  22. package/native/nitro-ui-dev/Sources/NitroUIDevMac/HybridDevBundles.swift +64 -0
  23. package/native/nitro-ui-dev/Sources/NitroUIDevMac/HybridDevErrors.swift +56 -0
  24. package/native/nitro-ui-dev/Sources/NitroUIDevMac/HybridDevLoadingView.swift +27 -0
  25. package/native/nitro-ui-dev/Sources/NitroUIDevMac/HybridDevMenu.swift +40 -0
  26. package/native/nitro-ui-dev/Sources/NitroUIDevMac/HybridDevToast.swift +19 -0
  27. package/native/nitro-ui-dev/Sources/NitroUIDevMac/LauncherWindowController.swift +217 -0
  28. package/native/nitro-ui-dev/Sources/NitroUIDevMac/LoadingOverlay.swift +104 -0
  29. package/native/nitro-ui-dev/Sources/NitroUIDevMac/RegisterDevLoader.swift +22 -0
  30. package/native/nitro-ui-dev/Sources/NitroUIDevMac/SavedBundles.swift +70 -0
  31. package/native/nitro-ui-glass/Package.swift +103 -0
  32. package/native/nitro-ui-glass/macos/HybridLiquidGlass.swift +5 -0
  33. package/native/nitro-ui-glass/macos/HybridNativeLiquidGlassContainerView.swift +40 -0
  34. package/native/nitro-ui-glass/macos/HybridNativeLiquidGlassView.swift +80 -0
  35. package/native/nitro-ui-glass/macos/LiquidGlassEffectView.swift +181 -0
  36. package/native/nitro-ui-glass/macos/LiquidGlassSupport.swift +17 -0
  37. package/native/nitro-ui-navigation/Package.swift +105 -0
  38. package/native/nitro-ui-navigation/Sources/NitroUINavigationMac/HybridNavigationScreen.swift +199 -0
  39. package/native/nitro-ui-navigation/Sources/NitroUINavigationMac/HybridNavigationSharedElement.swift +17 -0
  40. package/native/nitro-ui-navigation/Sources/NitroUINavigationMac/HybridNavigationSplit.swift +889 -0
  41. package/native/nitro-ui-navigation/Sources/NitroUINavigationMac/HybridNavigationStack.swift +404 -0
  42. package/native/nitro-ui-navigation/Sources/NitroUINavigationMac/HybridNavigationTabs.swift +186 -0
  43. package/native/nitro-ui-navigation/Sources/NitroUINavigationMac/MacStackContainerController.swift +260 -0
  44. package/native/nitro-ui-navigation/Sources/NitroUINavigationMac/NavigationSharedElementView.swift +28 -0
  45. package/native/nitro-ui-renderer/Package.swift +105 -0
  46. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Animations/HybridAnimator.swift +502 -0
  47. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Animations/NitroAnimationContext.swift +54 -0
  48. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Animations/View+Animations.swift +35 -0
  49. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/AssetFonts.swift +36 -0
  50. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/FlippedView.swift +360 -0
  51. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/HybridContainerView.swift +28 -0
  52. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/HybridFonts.swift +7 -0
  53. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/HybridLabel.swift +127 -0
  54. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/HybridMaskedView.swift +185 -0
  55. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/HybridScrollView.swift +255 -0
  56. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/HybridScrollViewContent.swift +22 -0
  57. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/HybridView.swift +18 -0
  58. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/Image/HybridImage.swift +281 -0
  59. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/Image/HybridImageFactory.swift +132 -0
  60. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/Image/HybridImageLoader.swift +149 -0
  61. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/Image/HybridImageView.swift +601 -0
  62. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/Image/ImagePixelSupport.swift +418 -0
  63. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/LabelView.swift +198 -0
  64. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/List/HybridListView.swift +177 -0
  65. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/List/NativeListCell.swift +98 -0
  66. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/List/NativeListContentView.swift +12 -0
  67. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/List/NativeListFenwickTree.swift +94 -0
  68. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/List/NativeListScrollView.swift +1100 -0
  69. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/List/NativeListSnapshot.swift +24 -0
  70. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/List/NativeListUpdate.swift +11 -0
  71. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/List/NativeListView.swift +260 -0
  72. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/NativeContainerView.swift +443 -0
  73. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/NitroViewProtocols.swift +275 -0
  74. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/ShadowLayers.swift +338 -0
  75. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/TextInput/HybridTextInput.swift +252 -0
  76. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/TextInput/NitroTextInputView.swift +447 -0
  77. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Components/View.swift +660 -0
  78. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/CustomViewController.swift +254 -0
  79. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/DesktopHostDelegate.swift +14 -0
  80. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Extensions.swift +102 -0
  81. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Gestures/GestureRecognizerDelegate.swift +24 -0
  82. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Gestures/HybridGestureRecognizer.swift +41 -0
  83. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Gestures/HybridLongPressGestureRecognizer.swift +172 -0
  84. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Gestures/HybridPanGestureRecognizer.swift +193 -0
  85. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Gestures/HybridTapGestureRecognizer.swift +165 -0
  86. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/HybridAppearance.swift +75 -0
  87. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/HybridApplication.swift +29 -0
  88. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/HybridKeyboard.swift +26 -0
  89. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/HybridScreen.swift +29 -0
  90. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/HybridViewController.swift +232 -0
  91. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/HybridWindow.swift +61 -0
  92. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/HybridWindowScene.swift +17 -0
  93. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/LayoutNode.swift +73 -0
  94. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/NSColor+rgba.swift +29 -0
  95. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/RegisterRootCallback.swift +27 -0
  96. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/RuntimeReloadableAppDelegate.swift +7 -0
  97. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/SafeAreaInsetsListeners.swift +26 -0
  98. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/SizeListeners.swift +27 -0
  99. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/UIErrorHandler.swift +15 -0
  100. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/ViewController.swift +6 -0
  101. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/Window.swift +156 -0
  102. package/native/nitro-ui-renderer/Sources/NitroUIRendererMac/WindowScene.swift +23 -0
  103. package/native/nitro-ui-runtime/Package.swift +67 -0
  104. package/native/nitro-ui-runtime/Sources/NitroUIRuntimeMac/DevLoader.swift +16 -0
  105. package/native/nitro-ui-runtime/Sources/NitroUIRuntimeMac/NitroUIAppDelegate.swift +253 -0
  106. package/package.json +57 -8
  107. package/src/Platform.ts +43 -0
  108. package/src/bin.js +18 -0
  109. package/src/build.ts +453 -0
  110. package/src/bundleWorker.ts +80 -0
  111. package/src/cli.ts +157 -0
  112. package/src/config.ts +233 -0
  113. package/src/create.ts +67 -0
  114. package/src/files.ts +70 -0
  115. package/src/index.ts +1 -0
  116. package/src/init.ts +301 -0
  117. package/src/inlinePlatform.ts +140 -0
  118. package/src/modules.ts +385 -0
  119. package/src/packageApp.ts +103 -0
  120. package/src/packageDirectory.ts +61 -0
  121. package/src/preload.ts +40 -0
  122. package/src/prepare.ts +433 -0
  123. package/src/run.ts +41 -0
  124. package/src/runApp.ts +81 -0
  125. package/src/start.ts +152 -0
  126. package/src/toolchain.ts +83 -0
  127. package/src/versions.ts +103 -0
  128. package/templates/AppIcon.icns +0 -0
@@ -0,0 +1,56 @@
1
+ # Contributing to nitro-ui-macos
2
+
3
+ This document explains how to keep `nitro-ui-macos` and `nitro-ui-desktop` in sync with new upstream NitroUI releases without modifying upstream NitroUI files.
4
+
5
+ ## Upgrading to a new NitroUI version
6
+
7
+ 1. **Audit upstream changes from npm tarballs**
8
+
9
+ Run the upstream diff script against the target NitroUI version (it defaults `--from` to `SUPPORTED_NITRO_UI_VERSION` in `packages/nitro-ui-macos/src/versions.ts`):
10
+
11
+ ```sh
12
+ bun scripts/macos/check-upstream.ts <target-version>
13
+ ```
14
+
15
+ To compare two arbitrary npm versions:
16
+
17
+ ```sh
18
+ bun scripts/macos/check-upstream.ts 0.3.0 --from 0.2.1
19
+ ```
20
+
21
+ The script downloads the official npm tarballs for each NitroUI package and reports:
22
+ - Added, removed, or changed `.nitro.ts` spec members across `nitro-ui-core`, `nitro-ui-runtime`, `nitro-networking`, `nitro-ui-dev`, `nitro-ui-glass`, `nitro-ui-navigation`, and `nitro-ui-renderer`
23
+ - Changes in shared Swift or C++ files linked by `packages/nitro-ui-macos/src/prepare.ts`
24
+ - Changes in iOS Swift files alongside their macOS counterparts in `packages/nitro-ui-macos/native/`
25
+ - Changes in upstream `Package.swift` manifests
26
+ - Changes in bundler files overridden by `nitro-ui-macos` (`inlinePlatform.ts`, `dev.ts`, `release.ts`)
27
+ - Any `nitro-core` version bump across the packages
28
+
29
+ The script exits with a non-zero code whenever relevant changes exist and exits `0` when no Mac update work is needed.
30
+
31
+ 2. **Update Mac overlays and bundler shims**
32
+
33
+ - Apply any required Swift/AppKit changes in `packages/nitro-ui-macos/native/`.
34
+ - Update `packages/nitro-ui-macos/src/prepare.ts` if upstream `Package.swift` targets, linked shared files, or C++ flags changed.
35
+ - Update `packages/nitro-ui-macos/src/inlinePlatform.ts`, `src/start.ts`, or `src/build.ts` if upstream `nitro-ui-bundler` changed its CLI flags or `inlinePlatform` plugin contract.
36
+ - Update `packages/nitro-ui-macos/PARITY.md` for every added, removed, or renamed `.nitro.ts` spec member.
37
+
38
+ 3. **Bump exact pinned versions**
39
+
40
+ - Update `SUPPORTED_NITRO_UI_VERSION` and `SUPPORTED_NITRO_CORE_VERSION` in `packages/nitro-ui-macos/src/versions.ts`.
41
+ - Update dependency versions in `packages/nitro-ui-macos/package.json` and `packages/nitro-ui-desktop/package.json`.
42
+ - Re-run `nitrogen` in `packages/nitro-ui-desktop` (`bun run --cwd packages/nitro-ui-desktop specs`) if `nitro-core` / `nitrogen` changed.
43
+
44
+ 4. **Verify everything**
45
+
46
+ - Run `bun run --cwd packages/nitro-ui-macos typecheck` and `bun test packages/nitro-ui-macos/test` (this includes the `PARITY.md` drift check and cross-platform iOS/Android import safety checks).
47
+ - Run `bun run --cwd packages/nitro-ui-desktop typecheck`.
48
+ - Build `apps/macos-example` in Debug and Release (`bun run --cwd apps/macos-example nitro-ui-macos build` and `--release`) and run its self-test suite (`NITRO_MACOS_SELF_TEST=1`).
49
+ - Pack tarballs for `nitro-ui-macos` and `nitro-ui-desktop` and verify a fresh consumer app created with `create-nitro-ui@<target-version>` builds cleanly.
50
+
51
+ ## Note on upstream CI workflows
52
+
53
+ Upstream workflows (`.github/workflows/typecheck.yml`, `app.yml`, and `platforms.yml`) are left untouched so this branch stays cleanly rebaseable against upstream `main`:
54
+
55
+ - On pull requests in forks where `NUCLEO_LICENSE_KEY` or `ADC_API_KEY` secrets are not configured, upstream's `docs` typecheck job and `harness` Android job may fail due to missing upstream secrets.
56
+ - macOS desktop verification runs in its own isolated workflow: `.github/workflows/macos-desktop.yml`.
package/LICENSE CHANGED
@@ -5,9 +5,9 @@ Copyright (c) 2026 Margelo
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
7
7
  in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
- of the Software, and to permit persons to whom the Software is furnished to do
10
- so, subject to the following conditions:
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
11
 
12
12
  The above copyright notice and this permission notice shall be included in all
13
13
  copies or substantial portions of the Software.
package/PARITY.md ADDED
@@ -0,0 +1,373 @@
1
+ # NitroUI 0.3.0 macOS Feature Parity
2
+
3
+ This matrix tracks every member of every Nitrogen spec in NitroUI `0.3.0` (`nitro-ui-core`, `nitro-ui-runtime`, `nitro-networking`, `nitro-ui-dev`, `nitro-ui-glass`, `nitro-ui-navigation`, and `nitro-ui-renderer`) and compares `nitro-ui-macos` against iOS.
4
+
5
+ `test/parity.test.ts` parses every `.nitro.ts` spec in these packages and fails if any spec member is missing from or drifts out of this document.
6
+
7
+ Status legend:
8
+ - `works`: matches iOS behavior directly on macOS
9
+ - `Mac equivalent`: implemented using native AppKit / macOS semantics
10
+ - `no-op by design`: accepted cleanly without throwing where the concept does not apply to macOS
11
+ - `missing`: not implemented
12
+
13
+ ## nitro-ui-core
14
+
15
+ | Spec | Member | Status | Notes |
16
+ | --- | --- | --- | --- |
17
+ | `AnimationFrameScheduler` | `constructor` | `works` | CoreVideo display link with main-display and timer fallbacks |
18
+ | `AnimationFrameScheduler` | `requestAnimationFrame()` | `works` | Falls back to `CGMainDisplayID()` when display is asleep and 60 Hz timer on headless hosts; resets link state on start failure |
19
+ | `AnimationFrameScheduler` | `cancelAnimationFrame()` | `works` | Cancels pending callback and stops display link when idle |
20
+ | `Linking` | `static openURL()` | `works` | Opens URLs through `NSWorkspace.shared.open` |
21
+ | `Logger` | `static debug()` | `works` | Shared Apple `os.Logger` implementation |
22
+ | `Logger` | `static info()` | `works` | Shared Apple `os.Logger` implementation |
23
+ | `Logger` | `static warn()` | `works` | Shared Apple `os.Logger` implementation |
24
+ | `Logger` | `static error()` | `works` | Shared Apple `os.Logger` implementation |
25
+ | `NativeURL` | `static parse()` | `works` | Shared C++ Ada URL parser |
26
+ | `NativeURL` | `static canParse()` | `works` | Shared C++ Ada URL parser |
27
+ | `NativeURL` | `origin` | `works` | Shared C++ Ada URL implementation |
28
+ | `NativeURL` | `href` | `works` | Shared C++ Ada URL implementation |
29
+ | `NativeURL` | `setHref()` | `works` | Shared C++ Ada URL implementation |
30
+ | `NativeURL` | `protocol` | `works` | Shared C++ Ada URL implementation |
31
+ | `NativeURL` | `username` | `works` | Shared C++ Ada URL implementation |
32
+ | `NativeURL` | `password` | `works` | Shared C++ Ada URL implementation |
33
+ | `NativeURL` | `host` | `works` | Shared C++ Ada URL implementation |
34
+ | `NativeURL` | `hostname` | `works` | Shared C++ Ada URL implementation |
35
+ | `NativeURL` | `port` | `works` | Shared C++ Ada URL implementation |
36
+ | `NativeURL` | `pathname` | `works` | Shared C++ Ada URL implementation |
37
+ | `NativeURL` | `search` | `works` | Shared C++ Ada URL implementation |
38
+ | `NativeURL` | `hash` | `works` | Shared C++ Ada URL implementation |
39
+ | `NativeURLSearchParams` | `constructor` | `works` | Shared C++ Ada URLSearchParams implementation |
40
+ | `NativeURLSearchParams` | `size` | `works` | Shared C++ Ada URLSearchParams implementation |
41
+ | `NativeURLSearchParams` | `reset()` | `works` | Shared C++ Ada URLSearchParams implementation |
42
+ | `NativeURLSearchParams` | `append()` | `works` | Shared C++ Ada URLSearchParams implementation |
43
+ | `NativeURLSearchParams` | `remove()` | `works` | Shared C++ Ada URLSearchParams implementation |
44
+ | `NativeURLSearchParams` | `get()` | `works` | Shared C++ Ada URLSearchParams implementation |
45
+ | `NativeURLSearchParams` | `getAll()` | `works` | Shared C++ Ada URLSearchParams implementation |
46
+ | `NativeURLSearchParams` | `has()` | `works` | Shared C++ Ada URLSearchParams implementation |
47
+ | `NativeURLSearchParams` | `set()` | `works` | Shared C++ Ada URLSearchParams implementation |
48
+ | `NativeURLSearchParams` | `sort()` | `works` | Shared C++ Ada URLSearchParams implementation |
49
+ | `NativeURLSearchParams` | `serialize()` | `works` | Shared C++ Ada URLSearchParams implementation |
50
+ | `NativeURLSearchParams` | `entry()` | `works` | Shared C++ Ada URLSearchParams implementation |
51
+ | `Performance` | `constructor` | `works` | Shared Apple monotonic clock |
52
+ | `Performance` | `timeOrigin` | `works` | Shared Apple monotonic clock |
53
+ | `Performance` | `now()` | `works` | Shared Apple monotonic clock |
54
+ | `Platform` | `static OS` | `Mac equivalent` | Native spec returns `.ios` for unmodified 0.3.0 dev server protocol; JS bundler plugin replaces static and runtime `Platform.OS` with `'macos'` |
55
+ | `Timers` | `constructor` | `works` | Shared Apple dispatch timers |
56
+ | `Timers` | `setTimeout()` | `works` | Shared Apple dispatch timers |
57
+ | `Timers` | `clearTimeout()` | `works` | Shared Apple dispatch timers |
58
+ | `Timers` | `setInterval()` | `works` | Shared Apple dispatch timers |
59
+ | `Timers` | `clearInterval()` | `works` | Shared Apple dispatch timers |
60
+
61
+ ## nitro-ui-runtime
62
+
63
+ `nitro-ui-runtime` defines no `.nitro.ts` HybridObject specs. Its runtime surface is composed of the Hermes JS engine (`JSRuntime.swift`, `PreparedJavaScript.swift`, `NitroUIRuntimeCxx`) and the host application delegate:
64
+
65
+ | Component | Status | Notes |
66
+ | --- | --- | --- |
67
+ | `JSRuntime` / `PreparedJavaScript` / `NitroUIRuntimeCxx` | `works` | Linked directly from upstream `nitro-ui-runtime@0.3.0` |
68
+ | `NitroUIAppDelegate` | `Mac equivalent` | AppKit `NSApplicationDelegate` lifecycle, main menu, reopen, runtime reload, and Debug `DevLoader` hook |
69
+ | JS globals (`console`, `URL`, `fetch`, `WebSocket`, timers, `requestAnimationFrame`, `performance`, microtasks) | `works` | Installed identically via upstream `nitro-ui-runtime` JS entry |
70
+
71
+ ## nitro-networking
72
+
73
+ | Spec | Member | Status | Notes |
74
+ | --- | --- | --- | --- |
75
+ | `FetchCancellation` | `constructor` | `works` | Shared Apple `URLSession` networking |
76
+ | `FetchCancellation` | `cancelled` | `works` | Shared Apple `URLSession` networking |
77
+ | `FetchCancellation` | `cancel()` | `works` | Shared Apple `URLSession` networking |
78
+ | `Networking` | `static fetch()` | `works` | Shared Apple `URLSession` networking |
79
+ | `Response` | `headers` | `works` | Shared Apple `URLSession` networking |
80
+ | `Response` | `headerEntries` | `works` | Shared Apple `URLSession` networking |
81
+ | `Response` | `status` | `works` | Shared Apple `URLSession` networking |
82
+ | `Response` | `ok` | `works` | Shared Apple `URLSession` networking |
83
+ | `Response` | `statusText` | `works` | Shared Apple `URLSession` networking |
84
+ | `Response` | `url` | `works` | Shared Apple `URLSession` networking |
85
+ | `Response` | `redirected` | `works` | Shared Apple `URLSession` networking |
86
+ | `Response` | `type` | `works` | Shared Apple `URLSession` networking |
87
+ | `Response` | `bodyUsed` | `works` | Shared Apple `URLSession` networking |
88
+ | `Response` | `arrayBuffer()` | `works` | Shared Apple `URLSession` networking |
89
+ | `Response` | `json()` | `works` | Shared Apple `URLSession` networking |
90
+ | `Response` | `text()` | `works` | Shared Apple `URLSession` networking |
91
+ | `Response` | `readBodyChunk()` | `works` | Shared Apple `URLSession` networking |
92
+ | `Response` | `cancelBody()` | `works` | Shared Apple `URLSession` networking |
93
+ | `WebSocket` | `constructor` | `works` | Shared Apple `URLSessionWebSocketTask` |
94
+ | `WebSocket` | `send()` | `works` | Shared Apple `URLSessionWebSocketTask` |
95
+ | `WebSocket` | `close()` | `works` | Shared Apple `URLSessionWebSocketTask` |
96
+ | `WebSocket` | `addOnOpenedListener()` | `works` | Shared Apple `URLSessionWebSocketTask` |
97
+ | `WebSocket` | `addOnMessageReceivedListener()` | `works` | Shared Apple `URLSessionWebSocketTask` |
98
+ | `WebSocket` | `addOnClosedListener()` | `works` | Shared Apple `URLSessionWebSocketTask` |
99
+ | `WebSocket` | `addOnErrorListener()` | `works` | Shared Apple `URLSessionWebSocketTask` |
100
+
101
+ ## nitro-ui-dev
102
+
103
+ Compiled and linked in Debug builds only; completely omitted from Release builds.
104
+
105
+ | Spec | Member | Status | Notes |
106
+ | --- | --- | --- | --- |
107
+ | `DevBundles` | `static getServerURL()` | `Mac equivalent` | Reads `-NitroUIDevServerURL`, Bonjour selection, or cached server URL |
108
+ | `DevBundles` | `static isSavedBundle()` | `Mac equivalent` | Reports whether the active bundle came from local Debug cache |
109
+ | `DevBundles` | `static hasAppBundle()` | `Mac equivalent` | Reports whether `app.js` evaluated in the current session |
110
+ | `DevBundles` | `static showLauncher()` | `Mac equivalent` | Shows AppKit Dev Server launcher window with Bonjour discovery, cached bundles, and Retry |
111
+ | `DevBundles` | `static openAfterRestart()` | `Mac equivalent` | Stores pending server URL and triggers full runtime reload |
112
+ | `DevBundles` | `static hideLauncher()` | `Mac equivalent` | Closes the AppKit Dev Server launcher window |
113
+ | `DevErrors` | `static setOnReload()` | `Mac equivalent` | Registers reload callback invoked by `Cmd+R` and Error Overlay Reload button |
114
+ | `DevErrors` | `static configure()` | `Mac equivalent` | Configures dev server base URL for source-map symbolication and open-in-editor |
115
+ | `DevErrors` | `static show()` | `Mac equivalent` | Presents AppKit Error Overlay with symbolicated stack frames, syntax-highlighted code frame, and Open in Editor |
116
+ | `DevErrors` | `static hide()` | `Mac equivalent` | Dismisses Error Overlay and warning banner |
117
+ | `DevErrors` | `static showBuildError()` | `Mac equivalent` | Displays blocking build error sheet until the bundler recovers |
118
+ | `DevErrors` | `static hideBuildError()` | `Mac equivalent` | Clears blocking build error overlay |
119
+ | `DevLoadingView` | `static showReload()` | `Mac equivalent` | Shows AppKit loading HUD pill while fetching bundles |
120
+ | `DevLoadingView` | `static showRefresh()` | `Mac equivalent` | Shows AppKit refreshing HUD pill during Fast Refresh |
121
+ | `DevLoadingView` | `static hide()` | `Mac equivalent` | Hides the loading HUD pill |
122
+ | `DevMenu` | `static setOnSwitchServer()` | `Mac equivalent` | Wires Change Dev Server action |
123
+ | `DevMenu` | `static setConnected()` | `Mac equivalent` | Updates connection indicator in the AppKit Dev Menu panel |
124
+ | `DevMenu` | `static toggle()` | `Mac equivalent` | Toggles AppKit Dev Menu panel (`Cmd+D` or terminal `m`) |
125
+ | `DevMenu` | `static hide()` | `Mac equivalent` | Hides the AppKit Dev Menu panel |
126
+ | `DevToast` | `static show()` | `Mac equivalent` | Displays floating AppKit status pill with optional click handler |
127
+ | `DevToast` | `static hide()` | `Mac equivalent` | Dismisses the status pill |
128
+
129
+ ## nitro-ui-glass
130
+
131
+ | Spec | Member | Status | Notes |
132
+ | --- | --- | --- | --- |
133
+ | `LiquidGlass` | `static isSupported` | `works` | True on macOS 26+ when `NSGlassEffectView` is available |
134
+ | `NativeLiquidGlassContainerView` | `constructor` | `works` | Backed by `NSGlassEffectContainerView` on macOS 26+ (fallback container on 13-15) |
135
+ | `NativeLiquidGlassContainerView` | `spacing` | `works` | Configures container spacing |
136
+ | `NativeLiquidGlassView` | `constructor` | `works` | Backed by `NSGlassEffectView` on macOS 26+ (fallback view on 13-15) |
137
+ | `NativeLiquidGlassView` | `effect` | `works` | Supports `regular`, `clear`, and `none` |
138
+ | `NativeLiquidGlassView` | `interactive` | `works` | Configures interactive glass effect |
139
+ | `NativeLiquidGlassView` | `tintColor` | `works` | Applies RGBA tint color |
140
+ | `NativeLiquidGlassView` | `colorScheme` | `works` | Overrides appearance (`light`, `dark`, `system`) |
141
+ | `NativeLiquidGlassView` | `animated` | `works` | Animates effect transitions |
142
+ | `NativeLiquidGlassView` | `animationDuration` | `works` | Controls transition duration |
143
+
144
+ ## nitro-ui-navigation
145
+
146
+ | Spec | Member | Status | Notes |
147
+ | --- | --- | --- | --- |
148
+ | `NavigationScreen` | `constructor` | `works` | Owns a `HybridViewController` with adaptive `.windowBackgroundColor` |
149
+ | `NavigationScreen` | `viewController` | `works` | Returns the screen's `HybridViewController` |
150
+ | `NavigationScreen` | `headerShown` | `Mac equivalent` | Controls stack toolbar back button and window title visibility |
151
+ | `NavigationScreen` | `presentation` | `Mac equivalent` | Supports `card` (stack push) and `modal` (AppKit sheet) |
152
+ | `NavigationScreen` | `onAndroidBackPress` | `no-op by design` | Android-only back press handler (same as iOS) |
153
+ | `NavigationScreen` | `androidBackTransition` | `no-op by design` | Android-only predictive back transition (same as iOS) |
154
+ | `NavigationScreen` | `title` | `works` | Updates window title and tab label |
155
+ | `NavigationScreen` | `headerTintColor` | `Mac equivalent` | Tints the stack toolbar Back button |
156
+ | `NavigationScreen` | `sharedElementId` | `Mac equivalent` | Drives AppKit zoom snapshot transitions between matching `NavigationSharedElement` views in `NavigationStack` |
157
+ | `NavigationScreen` | `tabBarImage` | `Mac equivalent` | Sets `NSTabViewItem.image` from `Image` or `ImageLoader` |
158
+ | `NavigationScreen` | `tabBarSFSymbol` | `Mac equivalent` | Sets `NSTabViewItem.image` from macOS SF Symbols |
159
+ | `NavigationScreen` | `tabBarBadge` | `Mac equivalent` | Appends badge text to the `NSTabViewItem` label |
160
+ | `NavigationScreen` | `sheetAllowedDetents` | `Mac equivalent` | Validates detents and sizes the presented AppKit sheet height proportionally |
161
+ | `NavigationScreen` | `sheetInitialDetentIndex` | `Mac equivalent` | Selects the initial detent fraction (including `-1` for tallest) |
162
+ | `NavigationScreen` | `sheetGrabberVisible` | `Mac equivalent` | Displays a centered top grabber pill inside the AppKit sheet |
163
+ | `NavigationScreen` | `sheetCornerRadius` | `Mac equivalent` | Applies corner radius clipping to the AppKit sheet content view |
164
+ | `NavigationSharedElement` | `constructor` | `Mac equivalent` | Backed by `NavigationSharedElementView` (`FlippedView` marker) |
165
+ | `NavigationSharedElement` | `sharedElementId` | `Mac equivalent` | Identifies source and destination views for `NavigationStack` shared-element transitions |
166
+ | `NavigationSplit` | `constructor` | `Mac equivalent` | Native `NSSplitViewController` with sidebar, detail, and inspector columns |
167
+ | `NavigationSplit` | `attachTo()` | `Mac equivalent` | Attaches split controller and window toolbar |
168
+ | `NavigationSplit` | `removeFromParent()` | `Mac equivalent` | Detaches split controller and cleans up toolbar/observers |
169
+ | `NavigationSplit` | `isCollapsed` | `works` | Reports collapsed narrow-width state |
170
+ | `NavigationSplit` | `addOnCollapsedChangedListener()` | `works` | Emits collapse state changes on window resize |
171
+ | `NavigationSplit` | `addOnPopListener()` | `works` | Emits stack pops in split columns |
172
+ | `NavigationSplit` | `restoreScreens()` | `works` | Restores column screens after collapse transitions |
173
+ | `NavigationSplit` | `prefersCollapsed` | `works` | Forces collapsed or expanded layout |
174
+ | `NavigationSplit` | `preferredDisplayMode` | `Mac equivalent` | Maps `detailOnly` / `sidebarBesideDetail` / `automatic` to sidebar collapse |
175
+ | `NavigationSplit` | `displayMode` | `Mac equivalent` | Reports active split display mode |
176
+ | `NavigationSplit` | `addOnDisplayModeChangedListener()` | `works` | Emits display mode changes when sidebar toggles |
177
+ | `NavigationSplit` | `showSidebar()` | `works` | Expands the sidebar column |
178
+ | `NavigationSplit` | `hideSidebar()` | `works` | Collapses the sidebar column |
179
+ | `NavigationSplit` | `preferredSplitBehavior` | `no-op by design` | macOS `NSSplitViewController` always tiles sidebar beside detail; property is stored without throwing |
180
+ | `NavigationSplit` | `showsSidebarToggle` | `works` | Shows or hides the toolbar sidebar toggle button |
181
+ | `NavigationSplit` | `preferredSidebarWidth` | `works` | Sets target sidebar width within bounds |
182
+ | `NavigationSplit` | `minimumSidebarWidth` | `works` | Sets `NSSplitViewItem.minimumThickness` |
183
+ | `NavigationSplit` | `maximumSidebarWidth` | `works` | Sets `NSSplitViewItem.maximumThickness` |
184
+ | `NavigationSplit` | `inspectorVisible` | `works` | Shows or hides the trailing inspector column |
185
+ | `NavigationSplit` | `addOnInspectorHiddenListener()` | `works` | Fires when the inspector column closes |
186
+ | `NavigationSplit` | `preferredInspectorWidth` | `works` | Configures inspector column width |
187
+ | `NavigationSplit` | `minimumDetailWidth` | `works` | Sets detail column minimum thickness and collapse threshold |
188
+ | `NavigationStack` | `constructor` | `Mac equivalent` | Native `MacStackContainerController` supporting push/pop, `Cmd+[`, `Esc`, modal sheets, and shared-element transitions |
189
+ | `NavigationStack` | `attachTo()` | `Mac equivalent` | Attaches stack container and manages unified window toolbar |
190
+ | `NavigationStack` | `removeFromParent()` | `Mac equivalent` | Dismisses sheets, clears owned toolbar, and detaches |
191
+ | `NavigationStack` | `addOnPopListener()` | `works` | Emits pop count on back button, shortcut, or sheet dismissal |
192
+ | `NavigationTabs` | `constructor` | `Mac equivalent` | Native `NSTabViewController` (`.segmentedControlOnTop`) with adaptive background |
193
+ | `NavigationTabs` | `attachTo()` | `Mac equivalent` | Attaches tab view controller to parent |
194
+ | `NavigationTabs` | `removeFromParent()` | `Mac equivalent` | Detaches tab view controller |
195
+ | `NavigationTabs` | `selectedIndex` | `works` | Gets and sets selected tab index |
196
+ | `NavigationTabs` | `addOnTabSelectedListener()` | `works` | Emits user-initiated tab changes |
197
+
198
+ ## nitro-ui-renderer
199
+
200
+ | Spec | Member | Status | Notes |
201
+ | --- | --- | --- | --- |
202
+ | `Animator` | `startAnimation()` | `works` | Starts curve or spring Core Animation session with optional delay and completion |
203
+ | `Animator` | `pauseAnimation()` | `works` | Freezes layer presentation timing |
204
+ | `Animator` | `stopAnimation()` | `works` | Stops animation either syncing model to presented values or snapping to target |
205
+ | `Appearance` | `constructor` | `works` | Observes `NSApp.effectiveAppearance` |
206
+ | `Appearance` | `getColorScheme()` | `works` | Returns `'light'` or `'dark'` |
207
+ | `Appearance` | `addOnColorSchemeChangedListener()` | `works` | Emits appearance changes |
208
+ | `Appearance` | `setColorScheme()` | `works` | Sets `NSApp.appearance` (`light`, `dark`, or system default) |
209
+ | `Application` | `static supportsShadows` | `works` | Returns `true` |
210
+ | `Application` | `static createView()` | `works` | Creates a `HybridContainerView` |
211
+ | `Application` | `static createTextInput()` | `works` | Creates single-line or multiline `HybridTextInput` |
212
+ | `Application` | `static registerRoot()` | `works` | Registers root scene factory callback |
213
+ | `Application` | `static reloadRuntime()` | `works` | Triggers `NitroUIAppDelegate.reloadRuntime()` |
214
+ | `ContainerView` | `constructor` | `works` | `NativeContainerView` supporting solid fills, gradients, shadows, corners, borders |
215
+ | `ContainerView` | `setBackgroundGradient()` | `works` | `CAGradientLayer` with animated color, location, startPoint, endPoint, frame, and corner transitions |
216
+ | `ContainerView` | `setBoxShadows()` | `works` | GPU `shadowPath` for outset opaque shadows and Retina raster fallback for inset/translucent shadows; animates GPU shadow color, radius, and path |
217
+ | `Fonts` | `static registerFont()` | `works` | Registers bundled/file fonts via CoreText (`CTFontManagerRegisterFontsForURL`) |
218
+ | `GestureRecognizer` | `numberOfTouches` | `Mac equivalent` | Reports active mouse pointer count (`0` or `1`) |
219
+ | `GestureRecognizer` | `isEnabled` | `works` | Enables or disables recognition |
220
+ | `GestureRecognizer` | `state` | `works` | Maps `NSGestureRecognizer.State` to Nitro gesture state |
221
+ | `LongPressGestureRecognizer` | `constructor` | `Mac equivalent` | Mouse press-and-hold recognizer |
222
+ | `LongPressGestureRecognizer` | `minimumPressDuration` | `works` | Configures hold duration |
223
+ | `LongPressGestureRecognizer` | `allowableMovement` | `works` | Configures movement tolerance in points |
224
+ | `LongPressGestureRecognizer` | `numberOfTapsRequired` | `works` | Configures required clicks |
225
+ | `LongPressGestureRecognizer` | `numberOfTouchesRequired` | `Mac equivalent` | Enforced; values > 1 never trigger on 1-pointer mouse input |
226
+ | `LongPressGestureRecognizer` | `gestureRecognizerShouldBegin` | `works` | Calls JS predicate before beginning |
227
+ | `LongPressGestureRecognizer` | `onLongPress` | `works` | Fires state transitions |
228
+ | `PanGestureRecognizer` | `constructor` | `Mac equivalent` | Mouse drag pan recognizer |
229
+ | `PanGestureRecognizer` | `maximumNumberOfTouches` | `Mac equivalent` | Enforced against single-pointer mouse input |
230
+ | `PanGestureRecognizer` | `minimumNumberOfTouches` | `Mac equivalent` | Enforced against single-pointer mouse input |
231
+ | `PanGestureRecognizer` | `translation()` | `works` | Returns pan delta in points |
232
+ | `PanGestureRecognizer` | `velocity()` | `works` | Returns pan velocity in points/second |
233
+ | `PanGestureRecognizer` | `gestureRecognizerShouldBegin` | `works` | Calls JS predicate before beginning |
234
+ | `PanGestureRecognizer` | `onPan` | `works` | Fires state transitions |
235
+ | `TapGestureRecognizer` | `constructor` | `Mac equivalent` | Click recognizer with transform-aware hit testing, AXPress, and Space/Return keyboard activation |
236
+ | `TapGestureRecognizer` | `numberOfTapsRequired` | `works` | Configures single/multi-click count |
237
+ | `TapGestureRecognizer` | `numberOfTouchesRequired` | `Mac equivalent` | Enforced; values > 1 never trigger on 1-pointer mouse click |
238
+ | `TapGestureRecognizer` | `gestureRecognizerShouldBegin` | `works` | Calls JS predicate before beginning |
239
+ | `TapGestureRecognizer` | `onTap` | `works` | Fires on click, AXPress, or focused Space/Return |
240
+ | `Image` | `width` | `works` | Image width in points |
241
+ | `Image` | `height` | `works` | Image height in points |
242
+ | `Image` | `toRawPixelData()` | `works` | Synchronous raw pixel extraction |
243
+ | `Image` | `toRawPixelDataAsync()` | `works` | Asynchronous raw pixel extraction |
244
+ | `Image` | `toEncodedImageData()` | `works` | PNG, JPG, and HEIC encoding |
245
+ | `Image` | `toEncodedImageDataAsync()` | `works` | Async PNG, JPG, and HEIC encoding |
246
+ | `Image` | `toBase64Async()` | `works` | Async base64 encoding |
247
+ | `Image` | `resize()` | `works` | CoreGraphics resize |
248
+ | `Image` | `resizeAsync()` | `works` | Async CoreGraphics resize |
249
+ | `Image` | `rotate()` | `works` | CoreGraphics rotation |
250
+ | `Image` | `rotateAsync()` | `works` | Async CoreGraphics rotation |
251
+ | `Image` | `crop()` | `works` | CoreGraphics crop |
252
+ | `Image` | `cropAsync()` | `works` | Async CoreGraphics crop |
253
+ | `Image` | `mirrorHorizontally()` | `works` | CoreGraphics horizontal flip |
254
+ | `Image` | `mirrorHorizontallyAsync()` | `works` | Async horizontal flip |
255
+ | `Image` | `saveToFileAsync()` | `works` | Writes encoded image to disk |
256
+ | `Image` | `saveToTemporaryFileAsync()` | `works` | Writes encoded image to temporary file |
257
+ | `Image` | `renderInto()` | `works` | Renders image into a new canvas |
258
+ | `Image` | `renderIntoAsync()` | `works` | Async renderInto |
259
+ | `ImageFactory` | `static createBlankImage()` | `works` | Creates blank solid/transparent image |
260
+ | `ImageFactory` | `static createBlankImageAsync()` | `works` | Async blank image creation |
261
+ | `ImageFactory` | `static loadFromFile()` | `works` | Loads image from file path |
262
+ | `ImageFactory` | `static loadFromFileAsync()` | `works` | Async file load |
263
+ | `ImageFactory` | `static loadFromResources()` | `works` | Loads bundled image / asset catalog resource |
264
+ | `ImageFactory` | `static loadFromResourcesAsync()` | `works` | Async bundled resource load |
265
+ | `ImageFactory` | `static hasResource()` | `works` | Checks whether resource exists in bundle / Assets.car |
266
+ | `ImageFactory` | `static loadFromSymbol()` | `works` | Loads macOS SF Symbol |
267
+ | `ImageFactory` | `static loadFromRawPixelData()` | `works` | Creates image from raw pixels |
268
+ | `ImageFactory` | `static loadFromRawPixelDataAsync()` | `works` | Async raw pixel load |
269
+ | `ImageFactory` | `static loadFromEncodedImageData()` | `works` | Decodes PNG/JPG/WebP/HEIC buffer |
270
+ | `ImageFactory` | `static loadFromEncodedImageDataAsync()` | `works` | Async encoded buffer decode |
271
+ | `ImageLoader` | `constructor` | `works` | Async image loader with view lifecycle binding |
272
+ | `ImageLoader` | `loadImage()` | `works` | Loads image asynchronously |
273
+ | `ImageLoader` | `requestImage()` | `works` | Requests decode sized for an `ImageView` |
274
+ | `ImageLoader` | `dropImage()` | `works` | Cancels/detaches image request for an `ImageView` |
275
+ | `ImageView` | `constructor` | `works` | `NitroImageView` with `.image` accessibility role |
276
+ | `ImageView` | `setDropShadows()` | `works` | Multi-stage drop shadow chain with animated color, radius, and offset changes |
277
+ | `ImageView` | `setTintColor()` | `works` | Alpha-masked tint rendering with Core Animation support during `View.animate` |
278
+ | `ImageView` | `image` | `works` | Accepts `Image` or `ImageLoader` |
279
+ | `ImageView` | `resizeMode` | `works` | Supports `cover`, `contain`, `center`, `stretch` |
280
+ | `ImageView` | `decodeSize` | `works` | Honors `original` vs view-sized downsampling |
281
+ | `ImageView` | `recyclingKey` | `works` | Resets stale content on list cell reuse |
282
+ | `Keyboard` | `static dismiss()` | `Mac equivalent` | Resigns text first responder when `keepFocus` is false; resolves cleanly when `keepFocus` is true (hardware keyboard) |
283
+ | `Label` | `constructor` | `works` | TextKit-backed `LabelView` with `.staticText` accessibility role |
284
+ | `Label` | `text` | `works` | Sets label text and accessibility value/label |
285
+ | `Label` | `color` | `works` | Sets RGBA text color |
286
+ | `Label` | `fontSize` | `works` | Sets point font size |
287
+ | `Label` | `fontWeight` | `works` | Sets system or custom font weight |
288
+ | `Label` | `font` | `works` | Sets named/registered font family |
289
+ | `Label` | `lineHeight` | `works` | Configures minimum/maximum line height |
290
+ | `Label` | `textAlign` | `works` | Supports `start`, `center`, `end`, `justify` with RTL awareness |
291
+ | `Label` | `numberOfLines` | `works` | Caps displayed line count |
292
+ | `Label` | `ellipsizeMode` | `works` | Supports `head`, `middle`, `tail`, `clip` |
293
+ | `ListView` | `constructor` | `works` | Virtualized Fenwick-tree AppKit list with `.list` and `.row` accessibility roles |
294
+ | `ListView` | `setHorizontal()` | `works` | Switches between vertical and horizontal scrolling |
295
+ | `ListView` | `setRefreshControl()` | `Mac equivalent` | Supports macOS trackpad overscroll pull-to-refresh firing `onRefresh` and displays a native `NSProgressIndicator` pill |
296
+ | `ListView` | `clearRefreshControl()` | `works` | Removes pull-to-refresh handler and indicator |
297
+ | `ListView` | `setEstimatedItemSize()` | `works` | Sets estimated extent for unmeasured rows |
298
+ | `ListView` | `setAnchorItemId()` | `works` | Keeps scroll position anchored to a specific item ID |
299
+ | `ListView` | `setContentPadding()` | `works` | Applies edge padding around list content |
300
+ | `ListView` | `showsVerticalScrollIndicator` | `works` | Toggles vertical scroller |
301
+ | `ListView` | `showsHorizontalScrollIndicator` | `works` | Toggles horizontal scroller |
302
+ | `ListView` | `applySnapshot()` | `works` | Diffs items, recycles cells, and animates updates |
303
+ | `ListView` | `clearDataSource()` | `works` | Clears all items and disconnects cell renderer |
304
+ | `MaskedView` | `constructor` | `works` | Masks child view layer with mask child's alpha channel |
305
+ | `Screen` | `size` | `works` | Reports `NSScreen.frame.size` |
306
+ | `Screen` | `displayScale` | `works` | Reports `NSScreen.backingScaleFactor` |
307
+ | `Screen` | `brightness` | `no-op by design` | Returns `NaN`; AppKit exposes no public display brightness API |
308
+ | `ScrollView` | `constructor` | `works` | Flipped `NSScrollView` with nested scroll chaining |
309
+ | `ScrollView` | `showsVerticalScrollIndicator` | `works` | Toggles vertical scroller |
310
+ | `ScrollView` | `showsHorizontalScrollIndicator` | `works` | Toggles horizontal scroller |
311
+ | `ScrollView` | `contentInsetAdjustmentBehavior` | `works` | Applies safe-area insets for `automatic`, `scrollableAxes`, `always`, `never` |
312
+ | `ScrollView` | `isNestedScrollingEnabled` | `no-op by design` | Android-only nested scroll flag (same as iOS) |
313
+ | `ScrollViewContent` | `constructor` | `works` | Document view inside `ScrollView` |
314
+ | `TextInput` | `multiline` | `works` | Single-line or multiline `NSTextView` with `.textField`/`.textArea` accessibility roles |
315
+ | `TextInput` | `text` | `works` | Current text string |
316
+ | `TextInput` | `selectedTextRange` | `works` | Gets and sets UTF-16 selection range |
317
+ | `TextInput` | `markedTextRange` | `works` | Reports active IME marked text range |
318
+ | `TextInput` | `placeholder` | `works` | Sets placeholder text and accessibility placeholder |
319
+ | `TextInput` | `isFocused` | `works` | Reports first responder state |
320
+ | `TextInput` | `setText()` | `works` | Programmatic controlled text update |
321
+ | `TextInput` | `setOnBeforeTextChange()` | `works` | Synchronous edit filter callback |
322
+ | `TextInput` | `focus()` | `works` | Makes editor first responder |
323
+ | `TextInput` | `blur()` | `works` | Resigns first responder |
324
+ | `TextInput` | `addOnTextChangedListener()` | `works` | Emits text changes |
325
+ | `TextInput` | `addOnSelectionChangedListener()` | `works` | Emits selection and marked-text changes |
326
+ | `TextInput` | `addOnLayoutInvalidatedListener()` | `works` | Emits intrinsic content size invalidations |
327
+ | `View` | `constructor` | `works` | Flipped layer-backed `NSView` |
328
+ | `View` | `parent` | `works` | Weak parent view reference |
329
+ | `View` | `safeAreaInsets` | `works` | Reports `NSView.safeAreaInsets` |
330
+ | `View` | `layoutNodePtr` | `works` | Binds Starlight layout node pointer |
331
+ | `View` | `clipsToBounds` | `works` | Controls `CALayer.masksToBounds` |
332
+ | `View` | `backgroundColor` | `works` | Reads packed RGBA fill |
333
+ | `View` | `setBackgroundColor()` | `works` | Sets and animates solid RGBA background |
334
+ | `View` | `opacity` | `works` | Sets and animates `alphaValue` / layer opacity |
335
+ | `View` | `setHidden()` | `works` | Toggles `NSView.isHidden` |
336
+ | `View` | `borderWidth` | `works` | Sets and animates `CALayer.borderWidth` |
337
+ | `View` | `borderColor` | `works` | Reads packed RGBA border color |
338
+ | `View` | `setBorderColor()` | `works` | Sets and animates `CALayer.borderColor` |
339
+ | `View` | `cornerRadius` | `works` | Sets and animates corner radius (synced to gradient and image content layers) |
340
+ | `View` | `maskedCorners` | `works` | Configures per-corner rounding mask |
341
+ | `View` | `cornerCurve` | `works` | Supports `circular` and `continuous` corner curves |
342
+ | `View` | `setTranslation()` | `works` | Sets and animates 3D translation |
343
+ | `View` | `translation` | `works` | Reads current translation |
344
+ | `View` | `setScale()` | `works` | Sets and animates 3D scale |
345
+ | `View` | `scale` | `works` | Reads current scale |
346
+ | `View` | `setRotation()` | `works` | Sets and animates Z rotation in degrees |
347
+ | `View` | `rotation` | `works` | Reads current rotation in degrees |
348
+ | `View` | `getFrame()` | `works` | Returns view frame in parent coordinates |
349
+ | `View` | `getFrameInWindow()` | `works` | Returns transformed frame in window coordinates |
350
+ | `View` | `setFrame()` | `works` | Applies and animates frame bounds and position |
351
+ | `View` | `appendChild()` | `works` | Appends child subview |
352
+ | `View` | `insertBefore()` | `works` | Inserts child subview before sibling |
353
+ | `View` | `removeChild()` | `works` | Removes child subview |
354
+ | `View` | `afterUpdate()` | `works` | Commit hook after prop updates |
355
+ | `View` | `setGestureRecognizers()` | `works` | Attaches recognizers and exposes tappable views as `.button` AX elements with keyboard focus |
356
+ | `View` | `isUserInteractionEnabled` | `works` | Controls hit testing and accessibility interactivity |
357
+ | `View` | `animate()` | `works` | Starts curve `HybridAnimator` recording layer changes |
358
+ | `View` | `animateSpring()` | `works` | Starts spring `HybridAnimator` recording layer changes |
359
+ | `ViewController` | `constructor` | `works` | `CustomViewController` (`NSViewController`) |
360
+ | `ViewController` | `view` | `works` | Root `HybridView` |
361
+ | `ViewController` | `keyboardInset` | `no-op by design` | Always returns `0`; macOS uses a hardware keyboard |
362
+ | `ViewController` | `addOnKeyboardInsetChangedListener()` | `no-op by design` | Returns removable subscription without emitting; macOS has no docked software keyboard |
363
+ | `ViewController` | `addOnSafeAreaInsetsChangedListener()` | `works` | Emits `safeAreaInsets` changes |
364
+ | `ViewController` | `addOnSizeChangedListener()` | `works` | Emits root view size changes |
365
+ | `ViewController` | `present()` | `works` | Presents modal child controller with optional fade animation |
366
+ | `ViewController` | `dismiss()` | `works` | Dismisses presented controller with completion callback |
367
+ | `ViewController` | `addOnKeyPressedListener()` | `works` | Handles key + modifier shortcuts across the controller hierarchy |
368
+ | `Window` | `constructor` | `works` | Creates a `NitroWindow` (`NSWindow`) |
369
+ | `Window` | `screen` | `works` | Returns the window's `HybridScreen` |
370
+ | `Window` | `makeKeyAndVisible()` | `works` | Calls `makeKeyAndOrderFront(nil)` |
371
+ | `Window` | `showSplashScreen()` | `Mac equivalent` | Overlays a macOS `.storyboardc`, `.nib`, or bundled image resource over the window; throws if missing |
372
+ | `Window` | `hideSplashScreen()` | `Mac equivalent` | Lays out committed views and removes the splash overlay |
373
+ | `WindowScene` | `windows` | `works` | Returns managed windows for the scene |
package/README.md CHANGED
@@ -1,9 +1,148 @@
1
+ > [!IMPORTANT]
2
+ > This is an unofficial community project. It is not made by or affiliated with Margelo or the NitroUI team. If the NitroUI team wants this package name, I will transfer it to them.
3
+
1
4
  # nitro-ui-macos
2
5
 
3
- > [!IMPORTANT]
4
- > This is an unofficial community project. It is not made by or affiliated with Margelo or the NitroUI team.
5
- > If the NitroUI team wants this package name, I will transfer it to them.
6
+ Out-of-tree native macOS (AppKit) target, bundler platform plugin, and CLI for NitroUI applications. Add it to an existing NitroUI `0.3.0` app without modifying upstream packages or touching your iOS and Android builds.
7
+
8
+ For desktop-specific APIs (multiple windows, menus, tray icons, file dialogs, clipboard, notifications, global shortcuts, and native AppKit controls), install [`nitro-ui-desktop`](https://github.com/imranbarbhuiya/nitro-ui/blob/desktop/macos/packages/nitro-ui-desktop/README.md) alongside this package.
9
+
10
+ ## Supported versions
11
+
12
+ - **NitroUI**: `0.3.0` (exact)
13
+ - **nitro-core / nitrogen**: `1.0.0-alpha.nightly.137.gd4793c40b8b8` (exact)
14
+ - **Host toolchain**: macOS with Xcode 27+ and Swift 6.4+
15
+ - **Runtime**: Bun on `PATH` (projects may be installed with `bun`, `npm`, or `pnpm`)
16
+
17
+ `nitro-ui-macos prepare` checks the installed versions of NitroUI packages and `nitro-core` and stops with a clear error if they do not match the supported release.
18
+
19
+ ## Install
20
+
21
+ ### Create a new app
22
+
23
+ ```sh
24
+ bunx nitro-ui-macos create MyApp
25
+ cd MyApp
26
+ bun run macos:start
27
+ ```
28
+
29
+ In a second terminal:
30
+
31
+ ```sh
32
+ bun run macos
33
+ ```
34
+
35
+ ### Add macOS to an existing NitroUI 0.3.0 app
36
+
37
+ ```sh
38
+ bun add nitro-ui-macos
39
+ bunx nitro-ui-macos init
40
+ bun run macos:start
41
+ ```
42
+
43
+ In a second terminal:
44
+
45
+ ```sh
46
+ bun run macos
47
+ ```
48
+
49
+ If your project uses `npm` or `pnpm`, install `nitro-ui-macos` with your package manager and run `npx nitro-ui-macos init` or `pnpm exec nitro-ui-macos init`. The CLI wrapper delegates automatically to `bun` on `PATH`.
50
+
51
+ ## Commands
52
+
53
+ | Command | Description |
54
+ | --- | --- |
55
+ | `nitro-ui-macos create <AppName> [--no-install]` | Scaffolds a fresh NitroUI 0.3.0 app via `create-nitro-ui`, installs `nitro-ui-macos`, and initializes `macos/`. |
56
+ | `nitro-ui-macos init [--name <Name>] [--bundle-id <id>]` | Creates `macos/` (`config.json`, `Package.swift`, `Sources/<Product>/main.swift`, `Info.plist`, `Entitlements.plist`, `AppIcon.icns`), updates `.gitignore`, and adds `macos*` scripts to `package.json`. Existing files and scripts are never overwritten. |
57
+ | `nitro-ui-macos prepare [--clean]` | Validates installed NitroUI versions and `minimumMacOS`, discovers macOS-capable Nitro modules (dependencies and `Modules/*`), stages `.nitro/macos/native/` overlays, and generates `.nitro/macos/NitroUIApp/`. |
58
+ | `nitro-ui-macos start [--port <port>]` | Verifies the port is free and starts the installed `nitro-ui-bundler` dev server with the macOS platform plugin preloaded. |
59
+ | `nitro-ui-macos build [--release] [--arch arm64\|x86_64] [--jobs <n>] [--scratch-path <dir>] [--clean]` | Runs `prepare`, bundles JS and assets (and compiles the Static Hermes framework object in Release), builds the native app via `swift build`, stamps the macOS SDK version with `vtool`, compiles asset catalogs, and signs the `.app`. |
60
+ | `nitro-ui-macos run [--release] [--skip-build] [--jobs <n>] [--scratch-path <dir>] [--server <url>] [--no-dev-server] [-- <args...>]` | Verifies the dev server is reachable (in Debug unless `--no-dev-server` is passed), builds (unless `--skip-build`), and launches `macos/build/<config>/<Name>.app`. |
61
+ | `nitro-ui-macos package [--sign <identity>] [--notarize <keychain-profile>] [--jobs <n>] [--scratch-path <dir>] [--output <path.dmg>] [--no-dmg]` | Builds a Release `.app` and creates a `.dmg` via `hdiutil`. Uses ad-hoc signing by default; `--sign` enables hardened runtime signing and `--notarize` submits through `xcrun notarytool` and staples the ticket. |
62
+
63
+ By default, `swift build` picks its own parallel job count. Pass `--jobs <n>` (or `-j <n>`) to cap parallelism on shared machines, and `--scratch-path <dir>` to share a SwiftPM build cache across builds.
64
+
65
+ ## Platform detection in TypeScript
66
+
67
+ When bundling for macOS, `nitro-ui-macos` replaces `Platform.OS` with `'macos'` and resolves `Platform.select` to `macos`, falling back to `ios` when no `macos` key is provided. This applies to both inlined and dynamic uses of `Platform` imported from `nitro-ui-core` or `nitro-ui-macos`.
68
+
69
+ On iOS and Android, `Platform` from `nitro-ui-macos` delegates directly to `nitro-ui-core` and returns `'ios'` or `'android'` (including `Platform.select({ ios, android, macos })`), so cross-platform app code can import `Platform` from `nitro-ui-macos` everywhere without affecting mobile builds.
70
+
71
+ ```ts
72
+ import { Platform } from 'nitro-ui-macos'
73
+
74
+ const label = Platform.select({
75
+ ios: 'iOS',
76
+ android: 'Android',
77
+ macos: 'macOS',
78
+ })
79
+
80
+ if (Platform.OS === 'macos') {
81
+ // Typechecks cleanly
82
+ }
83
+ ```
84
+
85
+ ## Configuration
86
+
87
+ `macos/config.json` is owned by your app and validated with Zod:
88
+
89
+ ```json
90
+ {
91
+ "name": "MyApp",
92
+ "product": "MyApp",
93
+ "bundleId": "com.example.myapp",
94
+ "version": "1.0.0",
95
+ "buildNumber": "1",
96
+ "minimumMacOS": "13.0",
97
+ "icon": "macos/AppIcon.icns"
98
+ }
99
+ ```
100
+
101
+ `minimumMacOS` must match the `.macOS(...)` platform declaration in `macos/Package.swift`. `nitro-ui-macos prepare` checks that both agree and propagates the same deployment target to the generated `.nitro/macos/NitroUIApp/Package.swift`, `Info.plist` (`LSMinimumSystemVersion`), `vtool`, and `actool`.
102
+
103
+ ## How it works
104
+
105
+ 1. **Staging overlays**: `nitro-ui-macos prepare` symlinks the shared C++, Nitrogen-generated bridges, and cross-platform Swift sources from your installed upstream NitroUI packages into `.nitro/macos/native/`, then overlays the AppKit implementations shipped in `nitro-ui-macos/native/`. Upstream files in `node_modules` are never modified.
106
+ 2. **Bundling without a forked bundler**: `nitro-ui-macos start` and `build` load the installed `nitro-ui-bundler` with a Bun `--preload` hook (`nitro-ui-macos/preload`) that swaps in the macOS `inlinePlatform` transform so `Platform.OS` and `Platform.select` resolve for macOS while iOS and Android keep using unmodified `nitro-ui-bundler`.
107
+ 3. **App assembly**: `swift build` compiles the `macos/` SwiftPM executable linking `.nitro/macos/NitroUIApp` and any autolinked macOS modules. `build` then packages the `.app` bundle, stamps the macOS SDK version with `vtool` (required for macOS 26+ Liquid Glass), compiles `.xcassets` with `actool`, copies the app icon, and ad-hoc signs the bundle.
108
+
109
+ ## Autolinking native modules
110
+
111
+ `nitro-ui-macos prepare` discovers bare Nitro modules in your `package.json` dependencies and configured `app.json` `modules` globs (such as `Modules/*`):
112
+
113
+ - A module opts in to macOS by declaring `.macOS(...)` in its `Package.swift` `platforms` array (for example `nitro-mmkv` and `nitro-ui-desktop`).
114
+ - `nitro-ui-glass` is linked automatically through the `nitro-ui-macos` overlay.
115
+ - Modules without macOS support are skipped with a warning naming the package; calling them from JS fails cleanly at runtime.
116
+
117
+ ## What works
118
+
119
+ See the complete member-by-member NitroUI `0.3.0` matrix in [`PARITY.md`](https://github.com/imranbarbhuiya/nitro-ui/blob/desktop/macos/packages/nitro-ui-macos/PARITY.md) (verified automatically against every `.nitro.ts` spec).
120
+
121
+ - **AppKit renderer**: `View`, `Text`, `Image` (bitmaps, SVGs, WebP, SF Symbols, animated tintColor, drop shadows, corner radius), custom fonts, `ScrollView`, `TextInput` (IME marked text, undo, standard Edit menu, Tab focus ring), `ListView` (virtualized recycling, self-sizing, anchor alignment, animated snapshot mutations, trackpad overscroll pull-to-refresh), `MaskedView`, GPU and inset box shadows, animated gradients/shadows/borders/corners, tap/pan/long-press gestures, `Window.showSplashScreen`/`hideSplashScreen`, `Keyboard.dismiss` (blurring text first responder when `keepFocus` is false), accessibility roles/labels/`AXPress`, and keyboard focus/Tab order for inputs and pressables
122
+ - **Native macOS navigation**: `NavigationSplit`, `NavigationStack` (with `NavigationSharedElement` snapshot zoom transitions, `headerShown`, `headerTintColor`, modal sheet detents/grabber/cornerRadius), `NavigationTabs`, and `NavigationScreen`
123
+ - **Liquid Glass**: `nitro-ui-glass` via `NSGlassEffectView` and `NSGlassEffectContainerView` on macOS 26+ with automatic SDK version stamping
124
+ - **Core and networking**: `nitro-ui-core` (`Linking` via `NSWorkspace`, `Timers`, `AnimationFrameScheduler` via `CVDisplayLink` with asleep/headless fallback, `Logger`, `Performance`, `URL`), `nitro-networking` (`fetch`, `WebSocket`), and `nitro-mmkv`
125
+ - **Debug dev tools**: dev server connection, Fast Refresh, full reload (`Cmd+R`), adaptive Light/Dark AppKit dev menu (`Cmd+D`), error overlay with symbolicated stack traces and Open in Editor, loading HUD, connection retry launcher, and `-NitroUIDevServerURL` launch argument
126
+ - **Release builds**: Static Hermes native framework object, Hermes bytecode (`main.hbc`), asset catalogs, app icon, ad-hoc or Developer ID signing, `.dmg` creation, and notarization, with all dev code excluded from Release builds
127
+ - **Mobile compatibility**: unmodified iOS and Android builds in the same app
128
+
129
+ ## What does not work / limitations
130
+
131
+ - Requires exact NitroUI `0.3.0` and `nitro-core` `1.0.0-alpha.nightly.137.gd4793c40b8b8` (see [`CONTRIBUTING.md`](https://github.com/imranbarbhuiya/nitro-ui/blob/desktop/macos/packages/nitro-ui-macos/CONTRIBUTING.md) for upgrading to newer NitroUI releases)
132
+ - iOS-only Nitro modules that do not declare `.macOS(...)` in `Package.swift` are skipped on macOS
133
+ - No `.macos.ts(x)` file extension resolution (matching upstream NitroUI 0.3.0, which uses `Platform.OS` and `Platform.select`)
134
+ - Hardware/mobile-only APIs are intentional no-ops or return platform-appropriate values: `Screen.brightness` returns `NaN`, `Screen.displayCornerRadii` returns zeros, `WindowScene.homeIndicatorAutoHidden` and `statusBarStyle` are no-ops, `NavigationScreen` Android back hooks are no-ops, and `TextInput` touch-keyboard props (`keyboardType`, `returnKeyType`, `enablesReturnKeyAutomatically`, `textContentType`, `autoCapitalize`, `autoComplete`) are no-ops on macOS; full details are in [`PARITY.md`](https://github.com/imranbarbhuiya/nitro-ui/blob/desktop/macos/packages/nitro-ui-macos/PARITY.md)
135
+ - `package --sign` and `--notarize` wrap Apple's `codesign`, `notarytool`, and `stapler` tools and require your own Apple Developer ID certificate and notarytool keychain profile
136
+
137
+ ## Troubleshooting
138
+
139
+ - **`No macOS project found at .../macos/config.json`**: Run `nitro-ui-macos init` from your NitroUI app root before running `prepare`, `build`, or `run`.
140
+ - **`Unsupported Swift version ... (requires Swift 6.4+)`**: Select Xcode 27 or newer with `sudo xcode-select -s /Applications/Xcode.app/Contents/Developer` and check `swift --version`.
141
+ - **`Unsupported NitroUI version` / `nitro-core` mismatch**: Check that your app installs exact NitroUI `0.3.0` packages and `nitro-core` `1.0.0-alpha.nightly.137.gd4793c40b8b8`.
142
+ - **`minimumMacOS` mismatch between `macos/config.json` and `macos/Package.swift`**: Update the `.macOS(...)` version in `macos/Package.swift` to match `minimumMacOS` in `macos/config.json`.
143
+ - **`Port 8081 is already in use`**: Stop the existing dev server or pass `--port <port>` to `nitro-ui-macos start` (and `--server http://localhost:<port>` to `nitro-ui-macos run`).
144
+ - **`Dev server is not running at http://localhost:8081`**: Start it in another terminal with `bun run macos:start`, or launch with `--no-dev-server` to run the bundled JS directly.
6
145
 
7
- macOS (AppKit) support for NitroUI. The first usable release is in progress, and version 0.0.0 contains no code. Follow the work on the [desktop/macos branch](https://github.com/imranbarbhuiya/nitro-ui/tree/desktop/macos).
146
+ ## License
8
147
 
9
- [NitroUI](https://github.com/margelo/nitro-ui) is made by Margelo and licensed under MIT.
148
+ MIT. See [LICENSE](https://github.com/imranbarbhuiya/nitro-ui/blob/desktop/macos/packages/nitro-ui-macos/LICENSE).