@legendapp/spark 0.0.1-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -0
- package/app.ts +1 -0
- package/audio.ts +1 -0
- package/auth-session.ts +1 -0
- package/bin/spark.cjs +5 -0
- package/clipboard.ts +1 -0
- package/config-plugin.cjs +1 -0
- package/config.cjs +1 -0
- package/config.d.cts +1 -0
- package/context-menu.ts +1 -0
- package/dialogs.ts +2 -0
- package/drag-drop.ts +1 -0
- package/expo-config.cjs +1 -0
- package/expo-metro.cjs +1 -0
- package/files.ts +1 -0
- package/global-shortcuts.ts +1 -0
- package/init-template.cjs +2 -0
- package/links.ts +1 -0
- package/menus.ts +1 -0
- package/message-dialog.ts +1 -0
- package/metro-gate.cjs +1 -0
- package/metro.cjs +1 -0
- package/native.cjs +1 -0
- package/notifications.ts +1 -0
- package/package.json +161 -0
- package/processes.ts +1 -0
- package/runtime-entry.cjs +1 -0
- package/schema.json +305 -0
- package/secure-storage.ts +1 -0
- package/settings.ts +1 -0
- package/shortcuts.ts +1 -0
- package/sqlite.ts +1 -0
- package/system.ts +1 -0
- package/tray.ts +1 -0
- package/ui-uniwind.ts +1 -0
- package/ui.ts +1 -0
- package/universal.cjs +1 -0
- package/updates.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-audio/RNSparkAudio.podspec +18 -0
- package/vendor/node_modules/@legendapp/spark-audio/macos/RNSparkAudio.h +4 -0
- package/vendor/node_modules/@legendapp/spark-audio/macos/RNSparkAudio.mm +154 -0
- package/vendor/node_modules/@legendapp/spark-audio/package.json +49 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/NativeSparkAudio.ts +3 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/desktop.ts +39 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/index.android.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/index.ios.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/index.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/index.web.ts +42 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/index.windows.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/media-session-unavailable.ts +5 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/media-session.ts +25 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/media-session.web.ts +35 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/media-types.ts +32 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/mobile.ts +38 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/status-listeners.ts +22 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/types.ts +21 -0
- package/vendor/node_modules/@legendapp/spark-audio/windows/ExperimentalFeatures.props +33 -0
- package/vendor/node_modules/@legendapp/spark-audio/windows/LICENSE +25 -0
- package/vendor/node_modules/@legendapp/spark-audio/windows/SparkAudio/ReactPackageProvider.cpp +20 -0
- package/vendor/node_modules/@legendapp/spark-audio/windows/SparkAudio/ReactPackageProvider.h +24 -0
- package/vendor/node_modules/@legendapp/spark-audio/windows/SparkAudio/ReactPackageProvider.idl +9 -0
- package/vendor/node_modules/@legendapp/spark-audio/windows/SparkAudio/SparkAudio.cpp +2 -0
- package/vendor/node_modules/@legendapp/spark-audio/windows/SparkAudio/SparkAudio.def +3 -0
- package/vendor/node_modules/@legendapp/spark-audio/windows/SparkAudio/SparkAudio.h +146 -0
- package/vendor/node_modules/@legendapp/spark-audio/windows/SparkAudio/SparkAudio.rc +0 -0
- package/vendor/node_modules/@legendapp/spark-audio/windows/SparkAudio/SparkAudio.vcxproj +143 -0
- package/vendor/node_modules/@legendapp/spark-audio/windows/SparkAudio/SparkAudio.vcxproj.filters +44 -0
- package/vendor/node_modules/@legendapp/spark-audio/windows/SparkAudio/pch.cpp +1 -0
- package/vendor/node_modules/@legendapp/spark-audio/windows/SparkAudio/pch.h +30 -0
- package/vendor/node_modules/@legendapp/spark-audio/windows/SparkAudio/resource.h +5 -0
- package/vendor/node_modules/@legendapp/spark-audio/windows/SparkAudio/targetver.h +8 -0
- package/vendor/node_modules/@legendapp/spark-audio/windows/SparkAudio.sln +43 -0
- package/vendor/node_modules/@legendapp/spark-auth-session/package.json +41 -0
- package/vendor/node_modules/@legendapp/spark-auth-session/src/core.ts +68 -0
- package/vendor/node_modules/@legendapp/spark-auth-session/src/index.android.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-auth-session/src/index.ios.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-auth-session/src/index.ts +22 -0
- package/vendor/node_modules/@legendapp/spark-auth-session/src/index.web.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-auth-session/src/mobile.ts +52 -0
- package/vendor/node_modules/@legendapp/spark-auth-session/src/types.ts +38 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/add-desktop.js +164 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/build-mode.js +7 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/build.js +278 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/commands.js +107 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/create.js +99 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/credentials.js +69 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/dev-command.js +81 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/dev.js +408 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/examples.js +43 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/executable.js +19 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/expo-dev-extension.cjs +51 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/expo-dev-patch.cjs +38 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/expo-dev-preload.cjs +19 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/expo-metro.cjs +41 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/expo-native.cjs +10 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/expo-node.js +21 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/go-profile.js +20 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/helpers.js +79 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/index.js +263 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/init-template.cjs +25 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/local.js +124 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/macos-release.js +7 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/metro-gate.cjs +33 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/metro.cjs +63 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/metro.js +25 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/npm-bin/npm +6 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/npm-bin/npm.cmd +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/pack-archive.js +23 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/package-manager.js +45 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/package.js +199 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/platform.js +34 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/process.js +57 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/project.js +324 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/release.js +42 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/release.json +37 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/runner-install.js +138 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-entry.cjs +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/sdk-install.js +66 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/sdk-transfer.js +113 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/session-status.js +22 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/signing.js +175 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/universal.cjs +28 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/updates.js +110 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/windows-associations.js +45 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/windows-associations.ps1 +57 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/windows-geometry.js +33 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/windows-metro.js +112 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/windows.js +141 -0
- package/vendor/node_modules/@legendapp/spark-cli/package.json +22 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/App.tsx +29 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/app.json +11 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/assets/icon.png +0 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/desktop.config.json +19 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/gitignore +8 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/index.ts +5 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/metro.config.js +3 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/package.json +55 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/tsconfig.json +10 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/diff-lite/App.tsx +34 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/diff-lite/Git.macos.tsx +13 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/diff-lite/Git.tsx +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/diff-lite/compare.ts +12 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/document-editor/App.tsx +34 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/document-editor/Integration.macos.tsx +57 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/document-editor/Integration.tsx +13 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/document-editor/Integration.web.tsx +14 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/document-editor/Integration.windows.tsx +57 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/document-editor/document.ts +58 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/document-editor/io.desktop.ts +24 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/document-editor/io.macos.ts +7 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/document-editor/io.ts +31 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/document-editor/io.web.ts +21 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/document-editor/io.windows.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/document-editor/sessions.ts +8 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/document-editor/useDocument.ts +6 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/Lifecycle.desktop.tsx +31 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/Lifecycle.macos.tsx +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/Lifecycle.tsx +14 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/Lifecycle.web.tsx +20 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/Lifecycle.windows.tsx +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/OpenFiles.desktop.tsx +28 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/OpenFiles.macos.tsx +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/OpenFiles.tsx +2 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/OpenFiles.windows.tsx +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/document.ts +58 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/io.desktop.ts +24 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/io.macos.ts +7 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/io.ts +31 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/io.web.ts +21 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/io.windows.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/lifecycle-types.ts +10 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/lifetime.ts +23 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/records.ts +51 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/storage.ts +6 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/useModel.ts +6 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/music-lite/Activation.desktop.tsx +4 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/music-lite/Activation.macos.tsx +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/music-lite/Activation.tsx +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/music-lite/Activation.windows.tsx +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/music-lite/App.tsx +38 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/music-lite/assets.desktop.ts +7 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/music-lite/assets.macos.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/music-lite/assets.ts +18 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/music-lite/assets.web.ts +37 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/music-lite/assets.windows.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/music-lite/model.ts +91 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/music-lite/store.ts +10 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/notes-lite/Activation.desktop.tsx +5 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/notes-lite/Activation.macos.tsx +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/notes-lite/Activation.tsx +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/notes-lite/Activation.windows.tsx +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/notes-lite/App.tsx +92 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/notes-lite/Desktop.desktop.ts +25 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/notes-lite/Desktop.macos.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/notes-lite/Desktop.ts +7 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/notes-lite/Desktop.windows.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/notes-lite/Theme.tsx +17 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/notes-lite/model.ts +61 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/notes-lite/search.ts +3 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/notes-lite/session.ts +16 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/notes-lite/store.ts +4 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/notes-lite/window-session.ts +62 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/App.tsx +57 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/app.json +15 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/assets/icon.png +0 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/desktop.config.json +62 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/gitignore +10 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/global.css +31 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/index.ts +4 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/metro.config.js +7 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/package.json +70 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/react-native.config.js +2 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/tsconfig.json +10 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/uniwind-types.d.ts +10 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/App.tsx +16 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/app.json +11 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/assets/icon.png +0 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/desktop.config.json +10 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/gitignore +8 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/index.ts +3 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/metro.config.js +3 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/package.json +56 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/react-native.config.js +2 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/tsconfig.json +10 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/RNDesktopClipboard.podspec +16 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/macos/RNDesktopClipboard.h +4 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/macos/RNDesktopClipboard.mm +87 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/package.json +52 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/react-native.config.js +6 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/src/NativeDesktopClipboard.ts +6 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/src/desktop.ts +39 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/src/expo.ts +12 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/src/formats.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/src/index.android.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/src/index.ios.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/src/index.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/src/index.web.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/src/index.windows.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/windows/ExperimentalFeatures.props +33 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/windows/LICENSE +25 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/windows/SparkClipboard/ReactPackageProvider.cpp +20 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/windows/SparkClipboard/ReactPackageProvider.h +24 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/windows/SparkClipboard/ReactPackageProvider.idl +9 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/windows/SparkClipboard/SparkClipboard.cpp +2 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/windows/SparkClipboard/SparkClipboard.def +3 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/windows/SparkClipboard/SparkClipboard.h +119 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/windows/SparkClipboard/SparkClipboard.rc +0 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/windows/SparkClipboard/SparkClipboard.vcxproj +143 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/windows/SparkClipboard/SparkClipboard.vcxproj.filters +44 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/windows/SparkClipboard/pch.cpp +1 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/windows/SparkClipboard/pch.h +30 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/windows/SparkClipboard/resource.h +5 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/windows/SparkClipboard/targetver.h +8 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/windows/SparkClipboard.sln +43 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/RNContextMenu.podspec +16 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/macos/RNContextMenu.h +9 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/macos/RNContextMenu.mm +160 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/package.json +46 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/react-native.config.js +6 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/src/NativeContextMenu.ts +8 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/src/index.ts +29 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/windows/ExperimentalFeatures.props +33 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/windows/LICENSE +25 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/windows/SparkContextMenu/ReactPackageProvider.cpp +20 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/windows/SparkContextMenu/ReactPackageProvider.h +24 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/windows/SparkContextMenu/ReactPackageProvider.idl +9 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/windows/SparkContextMenu/SparkContextMenu.cpp +2 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/windows/SparkContextMenu/SparkContextMenu.def +3 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/windows/SparkContextMenu/SparkContextMenu.h +112 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/windows/SparkContextMenu/SparkContextMenu.rc +0 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/windows/SparkContextMenu/SparkContextMenu.vcxproj +143 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/windows/SparkContextMenu/SparkContextMenu.vcxproj.filters +44 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/windows/SparkContextMenu/pch.cpp +1 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/windows/SparkContextMenu/pch.h +30 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/windows/SparkContextMenu/resource.h +5 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/windows/SparkContextMenu/targetver.h +8 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/windows/SparkContextMenu.sln +43 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/RNDesktopApp.podspec +15 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/RNDesktopApp.h +4 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/RNDesktopApp.mm +34 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkDesktop.h +23 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkDesktop.mm +135 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkWindow.mm +81 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/package.json +39 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/react-native.config.js +6 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/NativeDesktopApp.ts +8 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/api.ts +42 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/index.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/index.windows.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/app.plugin.cjs +75 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/config.cjs +161 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/config.d.cts +13 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/entitlements.cjs +23 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/expo.cjs +26 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/fabric-lifecycle.cjs +125 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/helpers.cjs +20 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/identity.cjs +28 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/keyboard-events.cjs +44 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/package.json +19 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/schema.json +305 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/updates.cjs +24 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/windows.plugin.cjs +72 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/AppDelegate.mm +79 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/package.json +13 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/windows/SparkComponentGeometry.h +9 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/windows/application.inc +647 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/windows/notifications.inc +60 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/windows/runtime.inc +63 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/windows/runtimes.inc +162 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/RNDesktopLinks.podspec +17 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/common/AuthLoopback.h +121 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/macos/RNDesktopLinks.h +4 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/macos/RNDesktopLinks.mm +79 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/package.json +53 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/react-native.config.js +6 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/src/NativeDesktopLinks.ts +6 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/src/api.ts +37 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/src/expo.ts +5 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/src/index.android.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/src/index.ios.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/src/index.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/src/index.web.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/src/index.windows.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/windows/ExperimentalFeatures.props +33 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/windows/LICENSE +25 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/windows/SparkLinks/ReactPackageProvider.cpp +20 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/windows/SparkLinks/ReactPackageProvider.h +24 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/windows/SparkLinks/ReactPackageProvider.idl +9 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/windows/SparkLinks/SparkLinks.cpp +2 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/windows/SparkLinks/SparkLinks.def +3 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/windows/SparkLinks/SparkLinks.h +128 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/windows/SparkLinks/SparkLinks.rc +0 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/windows/SparkLinks/SparkLinks.vcxproj +143 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/windows/SparkLinks/SparkLinks.vcxproj.filters +44 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/windows/SparkLinks/pch.cpp +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/windows/SparkLinks/pch.h +30 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/windows/SparkLinks/resource.h +5 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/windows/SparkLinks/targetver.h +8 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/windows/SparkLinks.sln +43 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/RNDesktopShortcuts.podspec +16 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/macos/RNDesktopShortcuts.h +4 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/macos/RNDesktopShortcuts.mm +56 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/package.json +43 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/src/NativeDesktopShortcuts.ts +8 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/src/accelerator.ts +22 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/src/api.ts +20 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/src/index.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/src/index.windows.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/RNDesktopWindows.podspec +17 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/RNDesktopWindows.h +4 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/RNDesktopWindows.mm +210 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/package.json +44 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/NativeDesktopWindowManager.ts +6 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/api.ts +79 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/index.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/index.windows.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows-options.ts +11 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/RNDesktopDrag.podspec +20 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/macos/RNDesktopDragView.h +4 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/macos/RNDesktopDragView.mm +94 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/package.json +44 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/react-native.config.js +6 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/src/DesktopDragViewNativeComponent.ts +16 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/src/contracts.ts +28 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/src/index.tsx +17 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/windows/ExperimentalFeatures.props +33 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/windows/LICENSE +25 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/windows/SparkDragDrop/ReactPackageProvider.cpp +21 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/windows/SparkDragDrop/ReactPackageProvider.h +24 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/windows/SparkDragDrop/ReactPackageProvider.idl +9 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/windows/SparkDragDrop/SparkDragDrop.cpp +2 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/windows/SparkDragDrop/SparkDragDrop.def +3 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/windows/SparkDragDrop/SparkDragDrop.h +209 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/windows/SparkDragDrop/SparkDragDrop.rc +0 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/windows/SparkDragDrop/SparkDragDrop.vcxproj +143 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/windows/SparkDragDrop/SparkDragDrop.vcxproj.filters +44 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/windows/SparkDragDrop/pch.cpp +1 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/windows/SparkDragDrop/pch.h +30 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/windows/SparkDragDrop/resource.h +5 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/windows/SparkDragDrop/targetver.h +8 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/windows/SparkDragDrop.sln +43 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/RNFileDialog.podspec +17 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/ios/RNFileDialog.h +9 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/ios/RNFileDialog.mm +259 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/package.json +43 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/src/NativeFileDialog.ts +13 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/src/index.ts +89 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/src/index.windows.ts +15 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/src/options.ts +16 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/windows/ExperimentalFeatures.props +33 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/windows/LICENSE +25 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/windows/SparkFileDialog/ReactPackageProvider.cpp +20 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/windows/SparkFileDialog/ReactPackageProvider.h +24 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/windows/SparkFileDialog/ReactPackageProvider.idl +9 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/windows/SparkFileDialog/SparkFileDialog.cpp +2 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/windows/SparkFileDialog/SparkFileDialog.def +3 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/windows/SparkFileDialog/SparkFileDialog.h +128 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/windows/SparkFileDialog/SparkFileDialog.rc +0 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/windows/SparkFileDialog/SparkFileDialog.vcxproj +143 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/windows/SparkFileDialog/SparkFileDialog.vcxproj.filters +44 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/windows/SparkFileDialog/pch.cpp +1 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/windows/SparkFileDialog/pch.h +30 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/windows/SparkFileDialog/resource.h +5 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/windows/SparkFileDialog/targetver.h +8 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/windows/SparkFileDialog.sln +43 -0
- package/vendor/node_modules/@legendapp/spark-file-system/RNDesktopFileSystem.podspec +17 -0
- package/vendor/node_modules/@legendapp/spark-file-system/macos/RNDesktopFileSystem.h +4 -0
- package/vendor/node_modules/@legendapp/spark-file-system/macos/RNDesktopFileSystem.mm +211 -0
- package/vendor/node_modules/@legendapp/spark-file-system/package.json +47 -0
- package/vendor/node_modules/@legendapp/spark-file-system/react-native.config.js +6 -0
- package/vendor/node_modules/@legendapp/spark-file-system/src/NativeDesktopFileSystem.ts +8 -0
- package/vendor/node_modules/@legendapp/spark-file-system/src/handles.ts +45 -0
- package/vendor/node_modules/@legendapp/spark-file-system/src/index.ts +61 -0
- package/vendor/node_modules/@legendapp/spark-file-system/src/path.ts +9 -0
- package/vendor/node_modules/@legendapp/spark-file-system/windows/ExperimentalFeatures.props +33 -0
- package/vendor/node_modules/@legendapp/spark-file-system/windows/LICENSE +25 -0
- package/vendor/node_modules/@legendapp/spark-file-system/windows/SparkFileSystem/ReactPackageProvider.cpp +20 -0
- package/vendor/node_modules/@legendapp/spark-file-system/windows/SparkFileSystem/ReactPackageProvider.h +24 -0
- package/vendor/node_modules/@legendapp/spark-file-system/windows/SparkFileSystem/ReactPackageProvider.idl +9 -0
- package/vendor/node_modules/@legendapp/spark-file-system/windows/SparkFileSystem/SparkFileSystem.cpp +2 -0
- package/vendor/node_modules/@legendapp/spark-file-system/windows/SparkFileSystem/SparkFileSystem.def +3 -0
- package/vendor/node_modules/@legendapp/spark-file-system/windows/SparkFileSystem/SparkFileSystem.h +295 -0
- package/vendor/node_modules/@legendapp/spark-file-system/windows/SparkFileSystem/SparkFileSystem.rc +0 -0
- package/vendor/node_modules/@legendapp/spark-file-system/windows/SparkFileSystem/SparkFileSystem.vcxproj +144 -0
- package/vendor/node_modules/@legendapp/spark-file-system/windows/SparkFileSystem/SparkFileSystem.vcxproj.filters +45 -0
- package/vendor/node_modules/@legendapp/spark-file-system/windows/SparkFileSystem/Trash.h +52 -0
- package/vendor/node_modules/@legendapp/spark-file-system/windows/SparkFileSystem/pch.cpp +1 -0
- package/vendor/node_modules/@legendapp/spark-file-system/windows/SparkFileSystem/pch.h +30 -0
- package/vendor/node_modules/@legendapp/spark-file-system/windows/SparkFileSystem/resource.h +5 -0
- package/vendor/node_modules/@legendapp/spark-file-system/windows/SparkFileSystem/targetver.h +8 -0
- package/vendor/node_modules/@legendapp/spark-file-system/windows/SparkFileSystem.sln +43 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/RNDesktopGlobalShortcuts.podspec +17 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/macos/RNDesktopGlobalShortcuts.h +3 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/macos/RNDesktopGlobalShortcuts.mm +65 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/package.json +46 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/react-native.config.js +6 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/src/NativeDesktopGlobalShortcuts.ts +3 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/src/accelerator.ts +22 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/src/index.ts +16 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/windows/ExperimentalFeatures.props +33 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/windows/LICENSE +25 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/windows/SparkGlobalShortcuts/ReactPackageProvider.cpp +20 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/windows/SparkGlobalShortcuts/ReactPackageProvider.h +24 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/windows/SparkGlobalShortcuts/ReactPackageProvider.idl +9 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/windows/SparkGlobalShortcuts/SparkGlobalShortcuts.cpp +2 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/windows/SparkGlobalShortcuts/SparkGlobalShortcuts.def +3 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/windows/SparkGlobalShortcuts/SparkGlobalShortcuts.h +80 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/windows/SparkGlobalShortcuts/SparkGlobalShortcuts.rc +0 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/windows/SparkGlobalShortcuts/SparkGlobalShortcuts.vcxproj +143 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/windows/SparkGlobalShortcuts/SparkGlobalShortcuts.vcxproj.filters +44 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/windows/SparkGlobalShortcuts/pch.cpp +1 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/windows/SparkGlobalShortcuts/pch.h +30 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/windows/SparkGlobalShortcuts/resource.h +5 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/windows/SparkGlobalShortcuts/targetver.h +8 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/windows/SparkGlobalShortcuts.sln +43 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/RNDesktopMessageDialog.podspec +17 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/macos/RNDesktopMessageDialog.h +3 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/macos/RNDesktopMessageDialog.mm +36 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/package.json +46 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/react-native.config.js +6 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/src/NativeDesktopMessageDialog.ts +3 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/src/index.ts +13 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/windows/ExperimentalFeatures.props +33 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/windows/LICENSE +25 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/windows/SparkMessageDialog/ReactPackageProvider.cpp +20 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/windows/SparkMessageDialog/ReactPackageProvider.h +24 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/windows/SparkMessageDialog/ReactPackageProvider.idl +9 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/windows/SparkMessageDialog/SparkMessageDialog.cpp +2 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/windows/SparkMessageDialog/SparkMessageDialog.def +3 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/windows/SparkMessageDialog/SparkMessageDialog.h +145 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/windows/SparkMessageDialog/SparkMessageDialog.rc +0 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/windows/SparkMessageDialog/SparkMessageDialog.vcxproj +143 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/windows/SparkMessageDialog/SparkMessageDialog.vcxproj.filters +44 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/windows/SparkMessageDialog/pch.cpp +1 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/windows/SparkMessageDialog/pch.h +30 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/windows/SparkMessageDialog/resource.h +5 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/windows/SparkMessageDialog/targetver.h +8 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/windows/SparkMessageDialog.sln +43 -0
- package/vendor/node_modules/@legendapp/spark-native-menu/RNNativeMenu.podspec +17 -0
- package/vendor/node_modules/@legendapp/spark-native-menu/ios/RNNativeMenu.h +10 -0
- package/vendor/node_modules/@legendapp/spark-native-menu/ios/RNNativeMenu.mm +632 -0
- package/vendor/node_modules/@legendapp/spark-native-menu/package.json +41 -0
- package/vendor/node_modules/@legendapp/spark-native-menu/src/NativeMenu.ts +13 -0
- package/vendor/node_modules/@legendapp/spark-native-menu/src/api.ts +128 -0
- package/vendor/node_modules/@legendapp/spark-native-menu/src/index.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-native-menu/src/index.windows.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-native-menu/src/windows-menus.ts +43 -0
- package/vendor/node_modules/@legendapp/spark-notifications/RNDesktopNotifications.podspec +17 -0
- package/vendor/node_modules/@legendapp/spark-notifications/macos/RNDesktopNotifications.h +4 -0
- package/vendor/node_modules/@legendapp/spark-notifications/macos/RNDesktopNotifications.mm +111 -0
- package/vendor/node_modules/@legendapp/spark-notifications/package.json +46 -0
- package/vendor/node_modules/@legendapp/spark-notifications/react-native.config.js +6 -0
- package/vendor/node_modules/@legendapp/spark-notifications/src/NativeDesktopNotifications.ts +4 -0
- package/vendor/node_modules/@legendapp/spark-notifications/src/index.ts +53 -0
- package/vendor/node_modules/@legendapp/spark-notifications/windows/ExperimentalFeatures.props +33 -0
- package/vendor/node_modules/@legendapp/spark-notifications/windows/LICENSE +25 -0
- package/vendor/node_modules/@legendapp/spark-notifications/windows/SparkNotifications/ReactPackageProvider.cpp +20 -0
- package/vendor/node_modules/@legendapp/spark-notifications/windows/SparkNotifications/ReactPackageProvider.h +24 -0
- package/vendor/node_modules/@legendapp/spark-notifications/windows/SparkNotifications/ReactPackageProvider.idl +9 -0
- package/vendor/node_modules/@legendapp/spark-notifications/windows/SparkNotifications/SparkNotifications.cpp +2 -0
- package/vendor/node_modules/@legendapp/spark-notifications/windows/SparkNotifications/SparkNotifications.def +3 -0
- package/vendor/node_modules/@legendapp/spark-notifications/windows/SparkNotifications/SparkNotifications.h +132 -0
- package/vendor/node_modules/@legendapp/spark-notifications/windows/SparkNotifications/SparkNotifications.rc +0 -0
- package/vendor/node_modules/@legendapp/spark-notifications/windows/SparkNotifications/SparkNotifications.vcxproj +143 -0
- package/vendor/node_modules/@legendapp/spark-notifications/windows/SparkNotifications/SparkNotifications.vcxproj.filters +44 -0
- package/vendor/node_modules/@legendapp/spark-notifications/windows/SparkNotifications/pch.cpp +1 -0
- package/vendor/node_modules/@legendapp/spark-notifications/windows/SparkNotifications/pch.h +30 -0
- package/vendor/node_modules/@legendapp/spark-notifications/windows/SparkNotifications/resource.h +5 -0
- package/vendor/node_modules/@legendapp/spark-notifications/windows/SparkNotifications/targetver.h +8 -0
- package/vendor/node_modules/@legendapp/spark-notifications/windows/SparkNotifications.sln +43 -0
- package/vendor/node_modules/@legendapp/spark-processes/RNDesktopProcesses.podspec +17 -0
- package/vendor/node_modules/@legendapp/spark-processes/macos/RNDesktopProcesses.h +3 -0
- package/vendor/node_modules/@legendapp/spark-processes/macos/RNDesktopProcesses.mm +153 -0
- package/vendor/node_modules/@legendapp/spark-processes/package.json +46 -0
- package/vendor/node_modules/@legendapp/spark-processes/react-native.config.js +6 -0
- package/vendor/node_modules/@legendapp/spark-processes/src/NativeDesktopProcesses.ts +3 -0
- package/vendor/node_modules/@legendapp/spark-processes/src/index.ts +39 -0
- package/vendor/node_modules/@legendapp/spark-processes/windows/ExperimentalFeatures.props +33 -0
- package/vendor/node_modules/@legendapp/spark-processes/windows/LICENSE +25 -0
- package/vendor/node_modules/@legendapp/spark-processes/windows/SparkProcesses/ReactPackageProvider.cpp +20 -0
- package/vendor/node_modules/@legendapp/spark-processes/windows/SparkProcesses/ReactPackageProvider.h +24 -0
- package/vendor/node_modules/@legendapp/spark-processes/windows/SparkProcesses/ReactPackageProvider.idl +9 -0
- package/vendor/node_modules/@legendapp/spark-processes/windows/SparkProcesses/SparkProcesses.cpp +2 -0
- package/vendor/node_modules/@legendapp/spark-processes/windows/SparkProcesses/SparkProcesses.def +3 -0
- package/vendor/node_modules/@legendapp/spark-processes/windows/SparkProcesses/SparkProcesses.h +171 -0
- package/vendor/node_modules/@legendapp/spark-processes/windows/SparkProcesses/SparkProcesses.rc +0 -0
- package/vendor/node_modules/@legendapp/spark-processes/windows/SparkProcesses/SparkProcesses.vcxproj +143 -0
- package/vendor/node_modules/@legendapp/spark-processes/windows/SparkProcesses/SparkProcesses.vcxproj.filters +44 -0
- package/vendor/node_modules/@legendapp/spark-processes/windows/SparkProcesses/pch.cpp +1 -0
- package/vendor/node_modules/@legendapp/spark-processes/windows/SparkProcesses/pch.h +30 -0
- package/vendor/node_modules/@legendapp/spark-processes/windows/SparkProcesses/resource.h +5 -0
- package/vendor/node_modules/@legendapp/spark-processes/windows/SparkProcesses/targetver.h +8 -0
- package/vendor/node_modules/@legendapp/spark-processes/windows/SparkProcesses.sln +43 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/RNDesktopSecureStorage.podspec +17 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/macos/RNDesktopSecureStorage.h +4 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/macos/RNDesktopSecureStorage.mm +53 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/package.json +52 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/react-native.config.js +6 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/src/NativeDesktopSecureStorage.ts +6 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/src/desktop.ts +24 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/src/expo.ts +14 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/src/index.android.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/src/index.ios.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/src/index.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/src/index.web.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/src/index.windows.ts +2 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/src/options.ts +6 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/src/unavailable.ts +5 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/windows/ExperimentalFeatures.props +33 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/windows/LICENSE +25 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/windows/SparkSecureStorage/ReactPackageProvider.cpp +20 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/windows/SparkSecureStorage/ReactPackageProvider.h +24 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/windows/SparkSecureStorage/ReactPackageProvider.idl +9 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/windows/SparkSecureStorage/SparkSecureStorage.cpp +2 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/windows/SparkSecureStorage/SparkSecureStorage.def +3 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/windows/SparkSecureStorage/SparkSecureStorage.h +48 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/windows/SparkSecureStorage/SparkSecureStorage.rc +0 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/windows/SparkSecureStorage/SparkSecureStorage.vcxproj +143 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/windows/SparkSecureStorage/SparkSecureStorage.vcxproj.filters +44 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/windows/SparkSecureStorage/pch.cpp +1 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/windows/SparkSecureStorage/pch.h +30 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/windows/SparkSecureStorage/resource.h +5 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/windows/SparkSecureStorage/targetver.h +8 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/windows/SparkSecureStorage.sln +43 -0
- package/vendor/node_modules/@legendapp/spark-settings/package.json +13 -0
- package/vendor/node_modules/@legendapp/spark-settings/src/filename.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-settings/src/filename.windows.ts +9 -0
- package/vendor/node_modules/@legendapp/spark-settings/src/index.ts +19 -0
- package/vendor/node_modules/@legendapp/spark-settings/src/store.ts +37 -0
- package/vendor/node_modules/@legendapp/spark-sqlite/package.json +16 -0
- package/vendor/node_modules/@legendapp/spark-sqlite/src/index.ts +7 -0
- package/vendor/node_modules/@legendapp/spark-system/RNDesktopSystem.podspec +17 -0
- package/vendor/node_modules/@legendapp/spark-system/macos/RNDesktopSystem.h +3 -0
- package/vendor/node_modules/@legendapp/spark-system/macos/RNDesktopSystem.mm +108 -0
- package/vendor/node_modules/@legendapp/spark-system/package.json +46 -0
- package/vendor/node_modules/@legendapp/spark-system/react-native.config.js +6 -0
- package/vendor/node_modules/@legendapp/spark-system/src/NativeDesktopSystem.ts +3 -0
- package/vendor/node_modules/@legendapp/spark-system/src/index.ts +35 -0
- package/vendor/node_modules/@legendapp/spark-system/windows/ExperimentalFeatures.props +33 -0
- package/vendor/node_modules/@legendapp/spark-system/windows/LICENSE +25 -0
- package/vendor/node_modules/@legendapp/spark-system/windows/SparkSystem/ReactPackageProvider.cpp +20 -0
- package/vendor/node_modules/@legendapp/spark-system/windows/SparkSystem/ReactPackageProvider.h +24 -0
- package/vendor/node_modules/@legendapp/spark-system/windows/SparkSystem/ReactPackageProvider.idl +9 -0
- package/vendor/node_modules/@legendapp/spark-system/windows/SparkSystem/SparkSystem.cpp +2 -0
- package/vendor/node_modules/@legendapp/spark-system/windows/SparkSystem/SparkSystem.def +3 -0
- package/vendor/node_modules/@legendapp/spark-system/windows/SparkSystem/SparkSystem.h +154 -0
- package/vendor/node_modules/@legendapp/spark-system/windows/SparkSystem/SparkSystem.rc +0 -0
- package/vendor/node_modules/@legendapp/spark-system/windows/SparkSystem/SparkSystem.vcxproj +143 -0
- package/vendor/node_modules/@legendapp/spark-system/windows/SparkSystem/SparkSystem.vcxproj.filters +44 -0
- package/vendor/node_modules/@legendapp/spark-system/windows/SparkSystem/pch.cpp +1 -0
- package/vendor/node_modules/@legendapp/spark-system/windows/SparkSystem/pch.h +30 -0
- package/vendor/node_modules/@legendapp/spark-system/windows/SparkSystem/resource.h +5 -0
- package/vendor/node_modules/@legendapp/spark-system/windows/SparkSystem/targetver.h +8 -0
- package/vendor/node_modules/@legendapp/spark-system/windows/SparkSystem.sln +43 -0
- package/vendor/node_modules/@legendapp/spark-tray/RNDesktopTray.podspec +17 -0
- package/vendor/node_modules/@legendapp/spark-tray/macos/RNDesktopTray.h +4 -0
- package/vendor/node_modules/@legendapp/spark-tray/macos/RNDesktopTray.mm +63 -0
- package/vendor/node_modules/@legendapp/spark-tray/package.json +46 -0
- package/vendor/node_modules/@legendapp/spark-tray/react-native.config.js +6 -0
- package/vendor/node_modules/@legendapp/spark-tray/src/NativeDesktopTray.ts +4 -0
- package/vendor/node_modules/@legendapp/spark-tray/src/index.ts +46 -0
- package/vendor/node_modules/@legendapp/spark-tray/windows/ExperimentalFeatures.props +33 -0
- package/vendor/node_modules/@legendapp/spark-tray/windows/LICENSE +25 -0
- package/vendor/node_modules/@legendapp/spark-tray/windows/SparkTray/ReactPackageProvider.cpp +20 -0
- package/vendor/node_modules/@legendapp/spark-tray/windows/SparkTray/ReactPackageProvider.h +24 -0
- package/vendor/node_modules/@legendapp/spark-tray/windows/SparkTray/ReactPackageProvider.idl +9 -0
- package/vendor/node_modules/@legendapp/spark-tray/windows/SparkTray/SparkTray.cpp +2 -0
- package/vendor/node_modules/@legendapp/spark-tray/windows/SparkTray/SparkTray.def +3 -0
- package/vendor/node_modules/@legendapp/spark-tray/windows/SparkTray/SparkTray.h +133 -0
- package/vendor/node_modules/@legendapp/spark-tray/windows/SparkTray/SparkTray.rc +0 -0
- package/vendor/node_modules/@legendapp/spark-tray/windows/SparkTray/SparkTray.vcxproj +143 -0
- package/vendor/node_modules/@legendapp/spark-tray/windows/SparkTray/SparkTray.vcxproj.filters +44 -0
- package/vendor/node_modules/@legendapp/spark-tray/windows/SparkTray/pch.cpp +1 -0
- package/vendor/node_modules/@legendapp/spark-tray/windows/SparkTray/pch.h +30 -0
- package/vendor/node_modules/@legendapp/spark-tray/windows/SparkTray/resource.h +5 -0
- package/vendor/node_modules/@legendapp/spark-tray/windows/SparkTray/targetver.h +8 -0
- package/vendor/node_modules/@legendapp/spark-tray/windows/SparkTray.sln +43 -0
- package/vendor/node_modules/@legendapp/spark-ui/RNSparkUI.podspec +17 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkButton.h +4 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkButton.mm +51 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkSelect.h +4 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkSelect.mm +53 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkTextInput.h +4 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkTextInput.mm +45 -0
- package/vendor/node_modules/@legendapp/spark-ui/package.json +61 -0
- package/vendor/node_modules/@legendapp/spark-ui/react-native.config.js +5 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/SparkButtonNativeComponent.ts +12 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/SparkSelectNativeComponent.ts +10 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/SparkTextInputNativeComponent.ts +9 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/index.android.tsx +25 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/index.ios.tsx +30 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/index.tsx +27 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/index.web.tsx +23 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/index.windows.tsx +42 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/select.ts +7 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/types.ts +28 -0
- package/vendor/node_modules/@legendapp/spark-ui/uniwind.ts +8 -0
- package/vendor/node_modules/@legendapp/spark-ui/uniwind.web.ts +17 -0
- package/vendor/node_modules/@legendapp/spark-ui/windows/ExperimentalFeatures.props +33 -0
- package/vendor/node_modules/@legendapp/spark-ui/windows/LICENSE +25 -0
- package/vendor/node_modules/@legendapp/spark-ui/windows/SparkUI/ReactPackageProvider.cpp +21 -0
- package/vendor/node_modules/@legendapp/spark-ui/windows/SparkUI/ReactPackageProvider.h +24 -0
- package/vendor/node_modules/@legendapp/spark-ui/windows/SparkUI/ReactPackageProvider.idl +9 -0
- package/vendor/node_modules/@legendapp/spark-ui/windows/SparkUI/SparkAppearance.h +61 -0
- package/vendor/node_modules/@legendapp/spark-ui/windows/SparkUI/SparkUI.cpp +2 -0
- package/vendor/node_modules/@legendapp/spark-ui/windows/SparkUI/SparkUI.def +3 -0
- package/vendor/node_modules/@legendapp/spark-ui/windows/SparkUI/SparkUI.h +181 -0
- package/vendor/node_modules/@legendapp/spark-ui/windows/SparkUI/SparkUI.rc +0 -0
- package/vendor/node_modules/@legendapp/spark-ui/windows/SparkUI/SparkUI.vcxproj +144 -0
- package/vendor/node_modules/@legendapp/spark-ui/windows/SparkUI/SparkUI.vcxproj.filters +44 -0
- package/vendor/node_modules/@legendapp/spark-ui/windows/SparkUI/pch.cpp +1 -0
- package/vendor/node_modules/@legendapp/spark-ui/windows/SparkUI/pch.h +30 -0
- package/vendor/node_modules/@legendapp/spark-ui/windows/SparkUI/resource.h +5 -0
- package/vendor/node_modules/@legendapp/spark-ui/windows/SparkUI/targetver.h +8 -0
- package/vendor/node_modules/@legendapp/spark-ui/windows/SparkUI.sln +43 -0
- package/vendor/node_modules/@legendapp/spark-updates/RNDesktopUpdates.podspec +18 -0
- package/vendor/node_modules/@legendapp/spark-updates/Sparkle.podspec.json +39 -0
- package/vendor/node_modules/@legendapp/spark-updates/macos/RNDesktopUpdates.h +4 -0
- package/vendor/node_modules/@legendapp/spark-updates/macos/RNDesktopUpdates.mm +72 -0
- package/vendor/node_modules/@legendapp/spark-updates/package.json +44 -0
- package/vendor/node_modules/@legendapp/spark-updates/src/NativeDesktopUpdates.ts +4 -0
- package/vendor/node_modules/@legendapp/spark-updates/src/index.ts +23 -0
- package/vendor/node_modules/@legendapp/spark-webview/package.json +15 -0
- package/vendor/node_modules/@legendapp/spark-webview/src/index.ts +2 -0
- package/vendor/node_modules/@legendapp/spark-window-options/index.cjs +25 -0
- package/vendor/node_modules/@legendapp/spark-window-options/index.d.ts +12 -0
- package/vendor/node_modules/@legendapp/spark-window-options/package.json +12 -0
- package/webview.ts +1 -0
- package/windows.ts +1 -0
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
#import "RNDesktopFileSystem.h"
|
|
2
|
+
#import <RNDesktopApp/SparkDesktop.h>
|
|
3
|
+
#import <fcntl.h>
|
|
4
|
+
#import <unistd.h>
|
|
5
|
+
#import <stdlib.h>
|
|
6
|
+
#import <sys/stat.h>
|
|
7
|
+
#import <errno.h>
|
|
8
|
+
#import <math.h>
|
|
9
|
+
#import <CoreServices/CoreServices.h>
|
|
10
|
+
|
|
11
|
+
@interface SparkRecursiveWatch : NSObject
|
|
12
|
+
@property FSEventStreamRef stream;
|
|
13
|
+
@property NSString *path;
|
|
14
|
+
@property (copy) void (^changed)(void);
|
|
15
|
+
- (void)stop;
|
|
16
|
+
@end
|
|
17
|
+
@implementation SparkRecursiveWatch
|
|
18
|
+
- (void)stop { if (_stream) { FSEventStreamStop(_stream); FSEventStreamInvalidate(_stream); FSEventStreamRelease(_stream); _stream = NULL; } }
|
|
19
|
+
- (void)dealloc { [self stop]; }
|
|
20
|
+
@end
|
|
21
|
+
static void RecursiveChanges(ConstFSEventStreamRef stream, void *info, size_t count, void *paths, const FSEventStreamEventFlags flags[], const FSEventStreamEventId ids[]) {
|
|
22
|
+
SparkRecursiveWatch *watch = (__bridge SparkRecursiveWatch *)info;
|
|
23
|
+
NSArray *changed = (__bridge NSArray *)paths;
|
|
24
|
+
for (NSUInteger i = 0; i < count; i++) {
|
|
25
|
+
NSString *path = changed[i];
|
|
26
|
+
if ([watch.path isEqual:@"/"] || (flags[i] & (kFSEventStreamEventFlagMustScanSubDirs | kFSEventStreamEventFlagRootChanged)) || [path isEqual:watch.path] || [path hasPrefix:[watch.path stringByAppendingString:@"/"]] || [watch.path hasPrefix:[path stringByAppendingString:@"/"]]) { watch.changed(); break; }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@interface SparkOpenFile : NSObject
|
|
31
|
+
@property int descriptor;
|
|
32
|
+
@end
|
|
33
|
+
@implementation SparkOpenFile
|
|
34
|
+
- (instancetype)init { if (self = [super init]) _descriptor = -1; return self; }
|
|
35
|
+
- (void)dealloc { if (_descriptor >= 0) close(_descriptor); }
|
|
36
|
+
@end
|
|
37
|
+
|
|
38
|
+
@interface RNDesktopFileSystem ()
|
|
39
|
+
@property dispatch_queue_t ioQueue;
|
|
40
|
+
@property NSMutableDictionary<NSString *, SparkOpenFile *> *files;
|
|
41
|
+
@property NSMutableDictionary<NSString *, dispatch_source_t> *watches;
|
|
42
|
+
@property NSMutableDictionary<NSString *, SparkRecursiveWatch *> *recursiveWatches;
|
|
43
|
+
@end
|
|
44
|
+
static NSURL *FileURL(id value) {
|
|
45
|
+
if (![value isKindOfClass:NSString.class] || ![value length]) return nil;
|
|
46
|
+
if ([value hasPrefix:@"file://"]) return [NSURL URLWithString:value];
|
|
47
|
+
return [value hasPrefix:@"/"] ? [NSURL fileURLWithPath:value] : nil;
|
|
48
|
+
}
|
|
49
|
+
@implementation RNDesktopFileSystem
|
|
50
|
+
RCT_EXPORT_MODULE(NativeDesktopFileSystem)
|
|
51
|
+
+ (BOOL)requiresMainQueueSetup { return NO; }
|
|
52
|
+
- (instancetype)init { if (self = [super init]) { _ioQueue = dispatch_queue_create("spark.files", DISPATCH_QUEUE_SERIAL); _files = [NSMutableDictionary new]; _watches = [NSMutableDictionary new]; _recursiveWatches = [NSMutableDictionary new]; } return self; }
|
|
53
|
+
- (NSArray<NSString *> *)supportedEvents { return @[@"change"]; }
|
|
54
|
+
- (void)call:(NSString *)method args:(NSString *)json resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
|
55
|
+
dispatch_async(self.ioQueue, ^{
|
|
56
|
+
NSDictionary *args = SparkArgs(json); NSFileManager *fm = NSFileManager.defaultManager;
|
|
57
|
+
NSError *error = nil; id result = NSNull.null;
|
|
58
|
+
if ([@[@"readChunk", @"writeChunk", @"flushFile", @"closeFile"] containsObject:method]) {
|
|
59
|
+
NSString *identifier = args[@"id"]; SparkOpenFile *file = self.files[identifier];
|
|
60
|
+
if ([method isEqual:@"closeFile"]) { [self.files removeObjectForKey:identifier]; resolve(@"null"); return; }
|
|
61
|
+
if (!file) { reject(@"E_CLOSED", @"Unknown or closed file handle", nil); return; }
|
|
62
|
+
if ([method isEqual:@"flushFile"]) { if (fsync(file.descriptor)) error = [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:nil]; }
|
|
63
|
+
else {
|
|
64
|
+
double position = [args[@"offset"] doubleValue];
|
|
65
|
+
if (![args[@"offset"] isKindOfClass:NSNumber.class] || !isfinite(position) || position < 0 || floor(position) != position || position > 9007199254740991.0) { SparkInvalid(reject, @"Invalid file offset"); return; }
|
|
66
|
+
if ([method isEqual:@"readChunk"]) {
|
|
67
|
+
double size = [args[@"length"] doubleValue];
|
|
68
|
+
if (!isfinite(size) || size < 1 || size > 1048576 || floor(size) != size || position + size > 9007199254740991.0) { SparkInvalid(reject, @"Invalid chunk length"); return; }
|
|
69
|
+
NSMutableData *data = [NSMutableData dataWithLength:(NSUInteger)size]; ssize_t count;
|
|
70
|
+
do { count = pread(file.descriptor, data.mutableBytes, data.length, (off_t)position); } while (count < 0 && errno == EINTR);
|
|
71
|
+
if (count < 0) error = [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:nil];
|
|
72
|
+
else { data.length = count; result = [data base64EncodedStringWithOptions:0]; }
|
|
73
|
+
} else {
|
|
74
|
+
NSString *base64 = args[@"base64"];
|
|
75
|
+
if (![base64 isKindOfClass:NSString.class] || base64.length > 1398104) { SparkInvalid(reject, @"Chunk exceeds 1 MiB"); return; }
|
|
76
|
+
NSData *data = [[NSData alloc] initWithBase64EncodedString:base64 options:0];
|
|
77
|
+
if (!data || data.length > 1048576 || position + data.length > 9007199254740991.0) { SparkInvalid(reject, @"Invalid chunk"); return; }
|
|
78
|
+
NSUInteger written = 0;
|
|
79
|
+
while (written < data.length) {
|
|
80
|
+
ssize_t count = pwrite(file.descriptor, (const char *)data.bytes + written, data.length - written, (off_t)position + written);
|
|
81
|
+
if (count < 0 && errno == EINTR) continue;
|
|
82
|
+
if (count <= 0) { error = [NSError errorWithDomain:NSPOSIXErrorDomain code:count < 0 ? errno : EIO userInfo:nil]; break; }
|
|
83
|
+
written += count;
|
|
84
|
+
}
|
|
85
|
+
result = @(written);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
} else if ([method isEqual:@"directory"]) {
|
|
89
|
+
NSString *kind = args[@"kind"];
|
|
90
|
+
NSURL *base;
|
|
91
|
+
if ([kind isEqual:@"data"]) base = [fm URLForDirectory:NSApplicationSupportDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:YES error:&error];
|
|
92
|
+
else if ([kind isEqual:@"cache"]) base = [fm URLForDirectory:NSCachesDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:YES error:&error];
|
|
93
|
+
else if ([kind isEqual:@"temp"]) base = [NSURL fileURLWithPath:NSTemporaryDirectory() isDirectory:YES];
|
|
94
|
+
else { SparkInvalid(reject, @"Unknown directory kind"); return; }
|
|
95
|
+
NSURL *url = [base URLByAppendingPathComponent:SparkNamespace() isDirectory:YES];
|
|
96
|
+
if (!error) [fm createDirectoryAtURL:url withIntermediateDirectories:YES attributes:nil error:&error];
|
|
97
|
+
result = url.path;
|
|
98
|
+
} else if ([method isEqual:@"unwatch"]) {
|
|
99
|
+
[self.recursiveWatches[args[@"id"]] stop]; [self.recursiveWatches removeObjectForKey:args[@"id"]];
|
|
100
|
+
dispatch_source_t source = self.watches[args[@"id"]];
|
|
101
|
+
if (source) { dispatch_source_cancel(source); [self.watches removeObjectForKey:args[@"id"]]; }
|
|
102
|
+
} else {
|
|
103
|
+
NSURL *url = FileURL(args[@"path"]);
|
|
104
|
+
if (!url || !url.isFileURL || (url.host.length && ![url.host isEqual:@"localhost"])) { SparkInvalid(reject, @"Expected an absolute local path or file URL"); return; }
|
|
105
|
+
if ([method isEqual:@"openFile"]) {
|
|
106
|
+
NSString *mode = args[@"mode"]; int flags;
|
|
107
|
+
if ([mode isEqual:@"read"]) flags = O_RDONLY;
|
|
108
|
+
else if ([mode isEqual:@"readWrite"]) flags = O_RDWR;
|
|
109
|
+
else if ([mode isEqual:@"write"]) flags = O_WRONLY | O_CREAT;
|
|
110
|
+
else if ([mode isEqual:@"createNew"]) flags = O_WRONLY | O_CREAT | O_EXCL;
|
|
111
|
+
else { SparkInvalid(reject, @"Invalid file mode"); return; }
|
|
112
|
+
int fd = open(url.fileSystemRepresentation, flags | O_CLOEXEC | O_NONBLOCK, 0666);
|
|
113
|
+
if (fd < 0) error = [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:nil];
|
|
114
|
+
else {
|
|
115
|
+
struct stat info; int code = 0;
|
|
116
|
+
if (fstat(fd, &info)) code = errno;
|
|
117
|
+
else if (!S_ISREG(info.st_mode)) code = EINVAL;
|
|
118
|
+
else if ([mode isEqual:@"write"] && ftruncate(fd, 0)) code = errno;
|
|
119
|
+
if (code) { close(fd); error = [NSError errorWithDomain:NSPOSIXErrorDomain code:code userInfo:nil]; }
|
|
120
|
+
else { SparkOpenFile *file = [SparkOpenFile new]; file.descriptor = fd; NSString *identifier = NSUUID.UUID.UUIDString; self.files[identifier] = file; result = identifier; }
|
|
121
|
+
}
|
|
122
|
+
} else if ([method isEqual:@"trash"]) { [fm trashItemAtURL:url resultingItemURL:nil error:&error]; }
|
|
123
|
+
else if ([method isEqual:@"readText"]) result = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:&error];
|
|
124
|
+
else if ([method isEqual:@"readBytes"]) {
|
|
125
|
+
NSData *data = [NSData dataWithContentsOfURL:url options:0 error:&error];
|
|
126
|
+
result = [data base64EncodedStringWithOptions:0];
|
|
127
|
+
}
|
|
128
|
+
else if ([method isEqual:@"writeText"]) [args[@"text"] writeToURL:url atomically:YES encoding:NSUTF8StringEncoding error:&error];
|
|
129
|
+
else if ([method isEqual:@"writeBytes"]) {
|
|
130
|
+
NSData *data = [[NSData alloc] initWithBase64EncodedString:args[@"base64"] options:0];
|
|
131
|
+
if (!data) { SparkInvalid(reject, @"Invalid base64 data"); return; }
|
|
132
|
+
[data writeToURL:url options:NSDataWritingAtomic error:&error];
|
|
133
|
+
}
|
|
134
|
+
else if ([method isEqual:@"mkdir"]) [fm createDirectoryAtURL:url withIntermediateDirectories:[args[@"recursive"] boolValue] attributes:nil error:&error];
|
|
135
|
+
else if ([method isEqual:@"remove"]) {
|
|
136
|
+
BOOL directory = NO;
|
|
137
|
+
if (![fm fileExistsAtPath:url.path isDirectory:&directory]) { resolve(@"false"); return; }
|
|
138
|
+
if (directory && ![args[@"recursive"] boolValue] && [fm contentsOfDirectoryAtPath:url.path error:&error].count) {
|
|
139
|
+
reject(@"E_NOT_EMPTY", @"Directory is not empty; pass recursive: true", nil); return;
|
|
140
|
+
}
|
|
141
|
+
if (!error) result = @([fm removeItemAtURL:url error:&error]);
|
|
142
|
+
}
|
|
143
|
+
else if ([method isEqual:@"copy"] || [method isEqual:@"move"]) {
|
|
144
|
+
NSURL *to = FileURL(args[@"to"]);
|
|
145
|
+
if (!to || !to.isFileURL || (to.host.length && ![to.host isEqual:@"localhost"])) { SparkInvalid(reject, @"Expected an absolute destination"); return; }
|
|
146
|
+
if ([method isEqual:@"copy"]) [fm copyItemAtURL:url toURL:to error:&error];
|
|
147
|
+
else [fm moveItemAtURL:url toURL:to error:&error];
|
|
148
|
+
}
|
|
149
|
+
else if ([method isEqual:@"stat"]) {
|
|
150
|
+
NSDictionary *attrs = [fm attributesOfItemAtPath:url.path error:&error];
|
|
151
|
+
if (attrs) result = @{ @"size": attrs[NSFileSize], @"modifiedAt": @([attrs[NSFileModificationDate] timeIntervalSince1970] * 1000),
|
|
152
|
+
@"type": [attrs[NSFileType] isEqual:NSFileTypeDirectory] ? @"directory" : [attrs[NSFileType] isEqual:NSFileTypeSymbolicLink] ? @"symlink" : @"file" };
|
|
153
|
+
}
|
|
154
|
+
else if ([method isEqual:@"list"]) {
|
|
155
|
+
NSArray *names = [fm contentsOfDirectoryAtPath:url.path error:&error];
|
|
156
|
+
result = [names sortedArrayUsingSelector:@selector(compare:)];
|
|
157
|
+
}
|
|
158
|
+
else if ([method isEqual:@"watch"]) {
|
|
159
|
+
NSString *watchID = args[@"id"];
|
|
160
|
+
if (self.watches[watchID] || self.recursiveWatches[watchID]) { SparkInvalid(reject, @"Watch id already exists"); return; }
|
|
161
|
+
if ([args[@"recursive"] boolValue]) {
|
|
162
|
+
BOOL directory = NO;
|
|
163
|
+
if (![fm fileExistsAtPath:url.path isDirectory:&directory] || !directory) { SparkInvalid(reject, @"Recursive watch requires an existing directory"); return; }
|
|
164
|
+
SparkRecursiveWatch *watch = [SparkRecursiveWatch new];
|
|
165
|
+
// Keep real filesystem paths: Foundation can strip /private while a path
|
|
166
|
+
// exists, then preserve it after deletion, breaking event comparisons.
|
|
167
|
+
char *resolved = realpath(url.fileSystemRepresentation, NULL);
|
|
168
|
+
if (!resolved) { SparkReject(reject, [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:nil]); return; }
|
|
169
|
+
watch.path = [NSString stringWithUTF8String:resolved]; free(resolved);
|
|
170
|
+
__weak RNDesktopFileSystem *weakSelf = self;
|
|
171
|
+
watch.changed = ^{ [weakSelf sendEventWithName:@"change" body:@{ @"id": watchID, @"path": url.path }]; };
|
|
172
|
+
FSEventStreamContext context = {0, (__bridge void *)watch, NULL, NULL, NULL};
|
|
173
|
+
// Observe the parent too, keeping deletion/replacement of the root visible.
|
|
174
|
+
NSArray *roots = @[[watch.path stringByDeletingLastPathComponent]];
|
|
175
|
+
watch.stream = FSEventStreamCreate(NULL, RecursiveChanges, &context, (__bridge CFArrayRef)roots, kFSEventStreamEventIdSinceNow, 0.05,
|
|
176
|
+
kFSEventStreamCreateFlagUseCFTypes | kFSEventStreamCreateFlagFileEvents | kFSEventStreamCreateFlagWatchRoot | kFSEventStreamCreateFlagNoDefer);
|
|
177
|
+
if (!watch.stream) { reject(@"E_WATCH", @"Could not create directory watcher", nil); return; }
|
|
178
|
+
FSEventStreamSetDispatchQueue(watch.stream, self.ioQueue);
|
|
179
|
+
if (!FSEventStreamStart(watch.stream)) { [watch stop]; reject(@"E_WATCH", @"Could not start directory watcher", nil); return; }
|
|
180
|
+
self.recursiveWatches[watchID] = watch; resolve(@"null"); return;
|
|
181
|
+
}
|
|
182
|
+
// Observe the parent so replacing a file atomically does not lose its watch.
|
|
183
|
+
BOOL isDirectory = NO;
|
|
184
|
+
[fm fileExistsAtPath:url.path isDirectory:&isDirectory];
|
|
185
|
+
NSURL *observed = isDirectory ? url : [url URLByDeletingLastPathComponent];
|
|
186
|
+
int fd = open(observed.fileSystemRepresentation, O_EVTONLY);
|
|
187
|
+
if (fd < 0) { SparkReject(reject, [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:nil]); return; }
|
|
188
|
+
dispatch_source_t source = dispatch_source_create(DISPATCH_SOURCE_TYPE_VNODE, fd,
|
|
189
|
+
DISPATCH_VNODE_WRITE | DISPATCH_VNODE_DELETE | DISPATCH_VNODE_RENAME | DISPATCH_VNODE_EXTEND | DISPATCH_VNODE_ATTRIB,
|
|
190
|
+
self.ioQueue);
|
|
191
|
+
__weak RNDesktopFileSystem *weakSelf = self;
|
|
192
|
+
dispatch_source_set_event_handler(source, ^{
|
|
193
|
+
RNDesktopFileSystem *strongSelf = weakSelf;
|
|
194
|
+
if (strongSelf) [strongSelf sendEventWithName:@"change" body:@{ @"id": watchID, @"path": url.path }];
|
|
195
|
+
});
|
|
196
|
+
dispatch_source_set_cancel_handler(source, ^{ close(fd); });
|
|
197
|
+
self.watches[watchID] = source; dispatch_resume(source);
|
|
198
|
+
}
|
|
199
|
+
else { SparkInvalid(reject, @"Unknown filesystem operation"); return; }
|
|
200
|
+
}
|
|
201
|
+
if (error) SparkReject(reject, error); else resolve(SparkJSON(result));
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
- (void)invalidate {
|
|
205
|
+
dispatch_async(self.ioQueue, ^{ [self.files removeAllObjects]; for (SparkRecursiveWatch *watch in self.recursiveWatches.allValues) [watch stop]; [self.recursiveWatches removeAllObjects]; for (dispatch_source_t source in self.watches.allValues) dispatch_source_cancel(source); [self.watches removeAllObjects]; });
|
|
206
|
+
[super invalidate];
|
|
207
|
+
}
|
|
208
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params {
|
|
209
|
+
return std::make_shared<facebook::react::NativeDesktopFileSystemSpecJSI>(params);
|
|
210
|
+
}
|
|
211
|
+
@end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@legendapp/spark-file-system",
|
|
3
|
+
"version": "0.0.1-next.2",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"main": "src/index.ts",
|
|
6
|
+
"react-native": "src/index.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"src",
|
|
9
|
+
"macos",
|
|
10
|
+
"*.podspec",
|
|
11
|
+
"windows",
|
|
12
|
+
"react-native.config.js"
|
|
13
|
+
],
|
|
14
|
+
"peerDependencies": {
|
|
15
|
+
"react": "19.1.4",
|
|
16
|
+
"react-native": "0.81.6"
|
|
17
|
+
},
|
|
18
|
+
"codegenConfig": {
|
|
19
|
+
"name": "RNDesktopFileSystemSpec",
|
|
20
|
+
"type": "modules",
|
|
21
|
+
"jsSrcsDir": "src",
|
|
22
|
+
"ios": {
|
|
23
|
+
"modulesProvider": {
|
|
24
|
+
"NativeDesktopFileSystem": "RNDesktopFileSystem"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"spark": {
|
|
29
|
+
"sdk": true,
|
|
30
|
+
"nativeModules": [
|
|
31
|
+
"NativeDesktopFileSystem"
|
|
32
|
+
],
|
|
33
|
+
"pod": "RNDesktopFileSystem",
|
|
34
|
+
"platforms": [
|
|
35
|
+
"macos",
|
|
36
|
+
"windows"
|
|
37
|
+
],
|
|
38
|
+
"requires": [
|
|
39
|
+
"@legendapp/spark-desktop-app"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@legendapp/spark-desktop-app": "0.0.1-next.2",
|
|
44
|
+
"base64-js": "1.5.1"
|
|
45
|
+
},
|
|
46
|
+
"private": true
|
|
47
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Expo Desktop currently invokes the Apple autolinker with --platform ios.
|
|
2
|
+
// Its generated Podfile identifies macOS explicitly; ordinary iOS apps use Expo backends.
|
|
3
|
+
module.exports = { dependency: { platforms: {
|
|
4
|
+
ios: process.env.SPARK_DESKTOP_AUTOLINK === "macos" ? {} : null,
|
|
5
|
+
android: null,
|
|
6
|
+
} } };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TurboModule } from "react-native";
|
|
2
|
+
import { TurboModuleRegistry } from "react-native";
|
|
3
|
+
export interface Spec extends TurboModule {
|
|
4
|
+
call(method: string, args: string): Promise<string>;
|
|
5
|
+
addListener(eventName: string): void;
|
|
6
|
+
removeListeners(count: number): void;
|
|
7
|
+
}
|
|
8
|
+
export default TurboModuleRegistry.getEnforcing<Spec>("NativeDesktopFileSystem");
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { fromByteArray, toByteArray } from "base64-js";
|
|
2
|
+
export const MAX_CHUNK_SIZE = 1024 * 1024;
|
|
3
|
+
export type FileMode = "read" | "readWrite" | "write" | "createNew";
|
|
4
|
+
export type FileHandle = {
|
|
5
|
+
read(length: number, offset: number): Promise<Uint8Array>;
|
|
6
|
+
write(bytes: Uint8Array, offset: number): Promise<number>;
|
|
7
|
+
flush(): Promise<void>;
|
|
8
|
+
close(): Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
export type FileCall = <T>(method: string, args: object) => Promise<T>;
|
|
11
|
+
function offset(value: number) { if (!Number.isSafeInteger(value) || value < 0) throw new RangeError("Offset must be a nonnegative safe integer"); }
|
|
12
|
+
function length(value: number) { if (!Number.isInteger(value) || value < 1 || value > MAX_CHUNK_SIZE) throw new RangeError("Chunk size must be between 1 byte and 1 MiB"); }
|
|
13
|
+
function aborted(signal?: AbortSignal) { if (signal?.aborted) throw signal.reason ?? new Error("File operation aborted"); }
|
|
14
|
+
/** Positional I/O: handles have no shared cursor. Calls are serialized natively. */
|
|
15
|
+
export async function createFileHandle(call: FileCall, path: string, mode: FileMode = "read"): Promise<FileHandle> {
|
|
16
|
+
if (!["read", "readWrite", "write", "createNew"].includes(mode)) throw new TypeError("Invalid file mode");
|
|
17
|
+
const id = await call<string>("openFile", { path, mode });
|
|
18
|
+
let closing: Promise<void> | undefined;
|
|
19
|
+
const active = () => { if (closing) throw new Error("File handle is closed"); };
|
|
20
|
+
return {
|
|
21
|
+
async read(size, position) { active(); length(size); offset(position); if (!Number.isSafeInteger(position + size)) throw new RangeError("Read range exceeds safe integer bounds"); return toByteArray(await call<string>("readChunk", { id, length: size, offset: position })); },
|
|
22
|
+
async write(bytes, position) { active(); if (!(bytes instanceof Uint8Array)) throw new TypeError("Expected Uint8Array"); offset(position); if (!Number.isSafeInteger(position + bytes.byteLength)) throw new RangeError("Write range exceeds safe integer bounds"); if (!bytes.length) return 0; length(bytes.length); return call<number>("writeChunk", { id, base64: fromByteArray(bytes), offset: position }); },
|
|
23
|
+
async flush() { active(); await call("flushFile", { id }); },
|
|
24
|
+
close() { return closing ??= call<void>("closeFile", { id }); },
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export type ReadChunksOptions = { offset?: number; chunkSize?: number; signal?: AbortSignal };
|
|
28
|
+
export async function* iterateFile(open: () => Promise<FileHandle>, options: ReadChunksOptions = {}) {
|
|
29
|
+
let position = options.offset ?? 0; offset(position); const size = options.chunkSize ?? 64 * 1024; length(size); aborted(options.signal);
|
|
30
|
+
const file = await open();
|
|
31
|
+
try {
|
|
32
|
+
for (;;) { aborted(options.signal); const bytes = await file.read(size, position); aborted(options.signal); if (!bytes.length) break; position += bytes.length; yield bytes; }
|
|
33
|
+
} finally { await file.close(); }
|
|
34
|
+
}
|
|
35
|
+
export async function writeFileChunks(open: () => Promise<FileHandle>, chunks: AsyncIterable<Uint8Array> | Iterable<Uint8Array>, signal?: AbortSignal) {
|
|
36
|
+
aborted(signal); const file = await open(); let position = 0;
|
|
37
|
+
try {
|
|
38
|
+
for await (const bytes of chunks) {
|
|
39
|
+
aborted(signal);
|
|
40
|
+
if (!(bytes instanceof Uint8Array)) throw new TypeError("Expected Uint8Array chunks");
|
|
41
|
+
for (let start = 0; start < bytes.length; start += MAX_CHUNK_SIZE) { aborted(signal); const part = bytes.subarray(start, start + MAX_CHUNK_SIZE); position += await file.write(part, position); }
|
|
42
|
+
}
|
|
43
|
+
aborted(signal); await file.flush(); return position;
|
|
44
|
+
} finally { await file.close(); }
|
|
45
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { NativeEventEmitter, Platform } from "react-native";
|
|
2
|
+
import Native from "./NativeDesktopFileSystem";
|
|
3
|
+
import { absolutePath } from "./path";
|
|
4
|
+
export type FileStat = { type: "file" | "directory" | "symlink"; size: number; modifiedAt: number };
|
|
5
|
+
async function call<T = void>(method: string, args: object): Promise<T> {
|
|
6
|
+
return JSON.parse(await Native.call(method, JSON.stringify(args))) as T;
|
|
7
|
+
}
|
|
8
|
+
function absolute(path: string) {
|
|
9
|
+
return absolutePath(path, Platform.OS);
|
|
10
|
+
}
|
|
11
|
+
export const getDirectory = (kind: "data" | "cache" | "temp") => call<string>("directory", { kind });
|
|
12
|
+
export const readText = (path: string) => call<string>("readText", { path: absolute(path) });
|
|
13
|
+
export const writeText = (path: string, text: string) => call("writeText", { path: absolute(path), text });
|
|
14
|
+
/** Binary data uses base64 across the bridge; it does not require Node or Buffer. */
|
|
15
|
+
export const readBase64 = (path: string) => call<string>("readBytes", { path: absolute(path) });
|
|
16
|
+
export const writeBase64 = (path: string, base64: string) => call("writeBytes", { path: absolute(path), base64 });
|
|
17
|
+
export const stat = (path: string) => call<FileStat>("stat", { path: absolute(path) });
|
|
18
|
+
export async function exists(path: string) {
|
|
19
|
+
try { await stat(path); return true; } catch (error) {
|
|
20
|
+
if ((error as { code?: string }).code === "E_NOT_FOUND") return false;
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export const list = (path: string) => call<string[]>("list", { path: absolute(path) });
|
|
25
|
+
export const mkdir = (path: string, options: { recursive?: boolean } = {}) => call("mkdir", { path: absolute(path), recursive: options.recursive ?? true });
|
|
26
|
+
export const remove = (path: string, options: { recursive?: boolean } = {}) => call<boolean>("remove", { path: absolute(path), recursive: options.recursive ?? false });
|
|
27
|
+
export const copy = (path: string, to: string) => call("copy", { path: absolute(path), to: absolute(to) });
|
|
28
|
+
export const move = (path: string, to: string) => call("move", { path: absolute(path), to: absolute(to) });
|
|
29
|
+
let nextWatch = 0;
|
|
30
|
+
const emitter = new NativeEventEmitter(Native);
|
|
31
|
+
export type WatchOptions = { recursive?: boolean };
|
|
32
|
+
/** Invalidation, not an exact change log. Recursive watches require a directory.
|
|
33
|
+
* Re-read the watched path after a callback; events may be coalesced. */
|
|
34
|
+
export async function watch(path: string, listener: (path: string) => void, options: WatchOptions = {}) {
|
|
35
|
+
if (options.recursive !== undefined && typeof options.recursive !== "boolean") throw new TypeError("recursive must be a boolean");
|
|
36
|
+
const id = `watch-${Date.now()}-${++nextWatch}`;
|
|
37
|
+
let removed = false;
|
|
38
|
+
const subscription = emitter.addListener("change", (event: { id: string; path: string }) => {
|
|
39
|
+
if (!removed && event.id === id) listener(event.path);
|
|
40
|
+
});
|
|
41
|
+
try { await call("watch", { path: absolute(path), id, recursive: options.recursive ?? false }); }
|
|
42
|
+
catch (error) { subscription.remove(); throw error; }
|
|
43
|
+
return { async remove() {
|
|
44
|
+
if (removed) return;
|
|
45
|
+
removed = true; subscription.remove(); await call("unwatch", { id });
|
|
46
|
+
} };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
import { createFileHandle, iterateFile, writeFileChunks, type FileMode, type ReadChunksOptions } from "./handles";
|
|
50
|
+
export type { FileHandle, FileMode, ReadChunksOptions } from "./handles";
|
|
51
|
+
/** read/readWrite require an existing regular file. write truncates; createNew fails if it exists. */
|
|
52
|
+
export const openFile = (path: string, options: { mode?: FileMode } = {}) => createFileHandle(call, absolute(path), options.mode);
|
|
53
|
+
/** Pull-based binary stream; closes the handle on EOF, error, abort, or early loop exit. */
|
|
54
|
+
export const readChunks = (path: string, options: ReadChunksOptions = {}) => iterateFile(() => openFile(path), options);
|
|
55
|
+
/** Writes sequentially, splitting large chunks. Failure leaves a partial file; use a temporary file + move for publication. */
|
|
56
|
+
export const writeChunks = (path: string, chunks: AsyncIterable<Uint8Array> | Iterable<Uint8Array>, options: { mode?: "write" | "createNew"; signal?: AbortSignal } = {}) => {
|
|
57
|
+
if (options.mode !== undefined && options.mode !== "write" && options.mode !== "createNew") throw new TypeError("Streaming writes require write or createNew mode");
|
|
58
|
+
return writeFileChunks(() => openFile(path, { mode: options.mode ?? "write" }), chunks, options.signal);
|
|
59
|
+
};
|
|
60
|
+
/** Move to the OS Trash/Recycle Bin. Never falls back to permanent deletion. */
|
|
61
|
+
export const trash = (path: string) => call<void>("trash", { path: absolute(path) });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Drive-qualified and UNC paths are absolute on Windows; C:foo and \foo are not. */
|
|
2
|
+
export function absolutePath(path: string, platform: string) {
|
|
3
|
+
const windows = /^(?:[a-z]:[\\/]|\\\\[^\\/]+[\\/][^\\/]+)/i.test(path);
|
|
4
|
+
if (typeof path !== "string" || path.includes("\0") ||
|
|
5
|
+
!(path.startsWith("file://") || (platform === "windows" ? windows : path.startsWith("/")))) {
|
|
6
|
+
throw new Error("Expected an absolute path or file URL");
|
|
7
|
+
}
|
|
8
|
+
return path;
|
|
9
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
3
|
+
|
|
4
|
+
<PropertyGroup Label="Microsoft.ReactNative Experimental Features">
|
|
5
|
+
<!--
|
|
6
|
+
Required for building a New Architecture project.
|
|
7
|
+
|
|
8
|
+
Library projects can change this value to test against Old and New
|
|
9
|
+
Architectures when building the library project's local sln file.
|
|
10
|
+
|
|
11
|
+
Otherwise this value will be decided by the consuming RNW app.
|
|
12
|
+
|
|
13
|
+
See https://microsoft.github.io/react-native-windows/docs/new-architecture
|
|
14
|
+
-->
|
|
15
|
+
<RnwNewArch>true</RnwNewArch>
|
|
16
|
+
|
|
17
|
+
<!--
|
|
18
|
+
Changes compilation to assume use of Microsoft.ReactNative NuGet packages
|
|
19
|
+
instead of building the framework from source. Defaults to true.
|
|
20
|
+
|
|
21
|
+
This is set during library project creation and is used when building
|
|
22
|
+
the library project's local sln file.
|
|
23
|
+
|
|
24
|
+
Otherwise this value will be decided by the consuming RNW app.
|
|
25
|
+
|
|
26
|
+
See https://microsoft.github.io/react-native-windows/docs/nuget
|
|
27
|
+
-->
|
|
28
|
+
<UseExperimentalNuget>true</UseExperimentalNuget>
|
|
29
|
+
|
|
30
|
+
<ReactExperimentalFeaturesSet>true</ReactExperimentalFeaturesSet>
|
|
31
|
+
</PropertyGroup>
|
|
32
|
+
|
|
33
|
+
</Project>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Portions derived from React Native:
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2015-present, Facebook, Inc.
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#include "pch.h"
|
|
2
|
+
|
|
3
|
+
#include "ReactPackageProvider.h"
|
|
4
|
+
#if __has_include("ReactPackageProvider.g.cpp")
|
|
5
|
+
#include "ReactPackageProvider.g.cpp"
|
|
6
|
+
#endif
|
|
7
|
+
|
|
8
|
+
#include "SparkFileSystem.h"
|
|
9
|
+
|
|
10
|
+
using namespace winrt::Microsoft::ReactNative;
|
|
11
|
+
|
|
12
|
+
namespace winrt::SparkFileSystem::implementation
|
|
13
|
+
{
|
|
14
|
+
|
|
15
|
+
void ReactPackageProvider::CreatePackage(IReactPackageBuilder const &packageBuilder) noexcept
|
|
16
|
+
{
|
|
17
|
+
AddAttributedModules(packageBuilder, true);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
} // namespace winrt::SparkFileSystem::implementation
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include "ReactPackageProvider.g.h"
|
|
4
|
+
|
|
5
|
+
using namespace winrt::Microsoft::ReactNative;
|
|
6
|
+
|
|
7
|
+
namespace winrt::SparkFileSystem::implementation
|
|
8
|
+
{
|
|
9
|
+
|
|
10
|
+
struct ReactPackageProvider : ReactPackageProviderT<ReactPackageProvider>
|
|
11
|
+
{
|
|
12
|
+
ReactPackageProvider() = default;
|
|
13
|
+
|
|
14
|
+
void CreatePackage(IReactPackageBuilder const &packageBuilder) noexcept;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
} // namespace winrt::SparkFileSystem::implementation
|
|
18
|
+
|
|
19
|
+
namespace winrt::SparkFileSystem::factory_implementation
|
|
20
|
+
{
|
|
21
|
+
|
|
22
|
+
struct ReactPackageProvider : ReactPackageProviderT<ReactPackageProvider, implementation::ReactPackageProvider> {};
|
|
23
|
+
|
|
24
|
+
} // namespace winrt::SparkFileSystem::factory_implementation
|