@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,38 @@
|
|
|
1
|
+
import { Activation } from "./Activation";
|
|
2
|
+
import { useEffect, useMemo, useState } from "react";
|
|
3
|
+
import { FlatList, Platform, SafeAreaView, StyleSheet, Text, View } from "react-native";
|
|
4
|
+
import { Button } from "@legendapp/spark/ui";
|
|
5
|
+
import { Lifecycle } from "./shared/Lifecycle";
|
|
6
|
+
import { useModel } from "./shared/useModel";
|
|
7
|
+
import { mountSerial } from "./shared/lifetime";
|
|
8
|
+
import { music, dirty } from "./store";
|
|
9
|
+
import { importTracks } from "./assets";
|
|
10
|
+
const time = (seconds: number) => `${Math.floor(seconds / 60)}:${String(Math.floor(seconds % 60)).padStart(2, "0")}`;
|
|
11
|
+
export default function App({ windowId = "main" }: { windowId?: string }) {
|
|
12
|
+
const state = useModel(music);
|
|
13
|
+
const [error, setError] = useState<string | null>(null);
|
|
14
|
+
const [importing, setImporting] = useState(false);
|
|
15
|
+
const commands = useMemo(() => [{ id: "import", title: "Import tracks…", key: "O", run: () => {
|
|
16
|
+
setImporting(true); void importTracks().then(music.add).catch(error => setError(String(error))).finally(() => setImporting(false));
|
|
17
|
+
} }], []);
|
|
18
|
+
useEffect(() => mountSerial("music-player", async retain => {
|
|
19
|
+
await music.load();
|
|
20
|
+
const timer = setInterval(() => { void music.tick(); }, 500);
|
|
21
|
+
await retain(Promise.resolve({ remove: async () => { clearInterval(timer); await music.dispose(); } }));
|
|
22
|
+
}, setError), []);
|
|
23
|
+
const current = state.tracks.find(track => track.id === state.currentId);
|
|
24
|
+
return <SafeAreaView style={styles.root}>
|
|
25
|
+
<Activation windowId={windowId} onError={setError} />
|
|
26
|
+
<Lifecycle title="Music" windowId={windowId} flush={music.flush} dirty={dirty} commands={commands} onError={setError} />
|
|
27
|
+
<Text style={styles.title}>Music</Text>
|
|
28
|
+
<Text>{["macos", "windows"].includes(Platform.OS) ? "Tracks stay in their original location. Keep those files available." : "Imported audio is stored on this device."}</Text>
|
|
29
|
+
<View style={styles.toolbar}><Button disabled={!state.ready || importing} onPress={commands[0]!.run}>{importing ? "Importing…" : "Import tracks"}</Button></View>
|
|
30
|
+
{error || state.error ? <Text accessibilityRole="alert" style={styles.error}>{error ?? state.error}</Text> : null}
|
|
31
|
+
<FlatList data={state.tracks} keyExtractor={track => track.id} extraData={[state.currentId, state.busy]} renderItem={({ item }) => <View style={[styles.track, item.id === state.currentId && styles.current]}><Text style={styles.name} numberOfLines={2}>{item.name}</Text><Button disabled={state.busy} onPress={() => { void music.play(item.id); }}>Play track</Button></View>} ListEmptyComponent={<Text style={styles.empty}>Import a few audio files to start your queue.</Text>} />
|
|
32
|
+
<View style={styles.player}><Text style={styles.now}>{current?.name ?? "Nothing playing"}</Text><Text accessibilityLiveRegion="none">{time(state.position)} / {time(state.status.duration)}</Text>
|
|
33
|
+
<View style={styles.toolbar}><Button disabled={state.busy || !state.tracks.length} onPress={() => { void (state.status.playing ? music.pause() : music.play()); }}>{state.status.playing ? "Pause" : "Play"}</Button><Button disabled={state.busy || !current || state.status.duration <= 0} onPress={() => { void music.seek(state.status.currentTime - 10); }}>Back 10 seconds</Button><Button disabled={state.busy || !current || state.status.duration <= 0} onPress={() => { void music.seek(Math.min(state.status.duration, state.status.currentTime + 10)); }}>Forward 10 seconds</Button><Button disabled={state.busy || !current || state.status.duration <= 0} onPress={() => { void music.next(); }}>Next track</Button></View>
|
|
34
|
+
<Text>{state.dirty ? "Saving playback position…" : "Queue and position saved"}</Text>
|
|
35
|
+
</View>
|
|
36
|
+
</SafeAreaView>;
|
|
37
|
+
}
|
|
38
|
+
const styles = StyleSheet.create({ root: { flex: 1, padding: 20, gap: 12, backgroundColor: "#faf9f6" }, title: { fontSize: 28, fontWeight: "600", color: "#222" }, toolbar: { flexDirection: "row", flexWrap: "wrap", gap: 8 }, track: { flexDirection: "row", alignItems: "center", padding: 12, gap: 12, borderBottomWidth: 1, borderColor: "#ddd" }, name: { flex: 1, fontSize: 16, color: "#222" }, current: { backgroundColor: "#dce9ef" }, player: { padding: 16, gap: 12, backgroundColor: "white", borderRadius: 8 }, now: { fontSize: 18, fontWeight: "600", color: "#222" }, empty: { padding: 24, color: "#555" }, error: { color: "#a32020" } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { openFileDialog } from "@legendapp/spark/dialogs";
|
|
2
|
+
import type { Track } from "./model";
|
|
3
|
+
export async function importTracks(): Promise<Track[]> {
|
|
4
|
+
const paths = await openFileDialog({ allowedFileTypes: ["mp3", "m4a", "wav", "aac", "flac", "ogg"], allowsMultipleSelection: true });
|
|
5
|
+
return (paths ?? []).map(uri => ({ id: uri, uri, name: uri.split(/[\\/]/).pop()! }));
|
|
6
|
+
}
|
|
7
|
+
export const resolveTrack = async (track: Track) => ({ uri: track.uri, release() {} });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./assets.desktop";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as Picker from "expo-document-picker";
|
|
2
|
+
import * as Files from "expo-file-system/legacy";
|
|
3
|
+
import type { Track } from "./model";
|
|
4
|
+
export async function importTracks(): Promise<Track[]> {
|
|
5
|
+
const result = await Picker.getDocumentAsync({ type: "audio/*", multiple: true, copyToCacheDirectory: true });
|
|
6
|
+
if (result.canceled) return [];
|
|
7
|
+
if (!Files.documentDirectory) throw new Error("App document storage is unavailable");
|
|
8
|
+
const directory = `${Files.documentDirectory}music/`;
|
|
9
|
+
await Files.makeDirectoryAsync(directory, { intermediates: true });
|
|
10
|
+
const tracks: Track[] = [];
|
|
11
|
+
for (const asset of result.assets) {
|
|
12
|
+
const id = `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
13
|
+
const uri = `${directory}${id}-${asset.name.replace(/[^a-zA-Z0-9._-]/g, "_")}`;
|
|
14
|
+
await Files.copyAsync({ from: asset.uri, to: uri }); tracks.push({ id, name: asset.name, uri });
|
|
15
|
+
}
|
|
16
|
+
return tracks;
|
|
17
|
+
}
|
|
18
|
+
export const resolveTrack = async (track: Track) => ({ uri: track.uri, release() {} });
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { projectId } from "./shared/identity";
|
|
2
|
+
import type { Track } from "./model";
|
|
3
|
+
async function database() {
|
|
4
|
+
return new Promise<IDBDatabase>((resolve, reject) => {
|
|
5
|
+
const request = indexedDB.open(`spark-music-${projectId}`, 1);
|
|
6
|
+
request.onupgradeneeded = () => request.result.createObjectStore("audio");
|
|
7
|
+
request.onsuccess = () => resolve(request.result); request.onerror = () => reject(request.error);
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
async function store(id: string, file: File) {
|
|
11
|
+
const db = await database();
|
|
12
|
+
try { await new Promise<void>((resolve, reject) => {
|
|
13
|
+
const transaction = db.transaction("audio", "readwrite"); transaction.objectStore("audio").put(file, id);
|
|
14
|
+
transaction.oncomplete = () => resolve(); transaction.onerror = () => reject(transaction.error); transaction.onabort = () => reject(transaction.error ?? new Error("Audio import was aborted"));
|
|
15
|
+
}); } finally { db.close(); }
|
|
16
|
+
}
|
|
17
|
+
export async function importTracks(): Promise<Track[]> {
|
|
18
|
+
const files = await new Promise<File[]>(resolve => {
|
|
19
|
+
const input = document.createElement("input"); input.type = "file"; input.multiple = true; input.accept = "audio/*";
|
|
20
|
+
input.oncancel = () => resolve([]); input.onchange = () => resolve(Array.from(input.files ?? [])); input.click();
|
|
21
|
+
});
|
|
22
|
+
const tracks: Track[] = [];
|
|
23
|
+
for (const file of files) {
|
|
24
|
+
const id = crypto.randomUUID(); await store(id, file); tracks.push({ id, uri: `library:${id}`, name: file.name });
|
|
25
|
+
}
|
|
26
|
+
return tracks;
|
|
27
|
+
}
|
|
28
|
+
export async function resolveTrack(track: Track) {
|
|
29
|
+
const db = await database();
|
|
30
|
+
try {
|
|
31
|
+
const blob = await new Promise<Blob>((resolve, reject) => {
|
|
32
|
+
const request = db.transaction("audio").objectStore("audio").get(track.id);
|
|
33
|
+
request.onsuccess = () => request.result instanceof Blob ? resolve(request.result) : reject(new Error("Audio is missing from browser storage. Import the file again.")); request.onerror = () => reject(request.error);
|
|
34
|
+
});
|
|
35
|
+
const uri = URL.createObjectURL(blob); return { uri, release() { URL.revokeObjectURL(uri); } };
|
|
36
|
+
} finally { db.close(); }
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./assets.desktop";
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { AudioPlayer, AudioStatus } from "@legendapp/spark/audio";
|
|
2
|
+
export type Track = { id: string; name: string; uri: string };
|
|
3
|
+
export type Library = { version: 1; tracks: Track[]; currentId: string | null; position: number };
|
|
4
|
+
export function decodeLibrary(value: unknown): Library {
|
|
5
|
+
const data = value as Library;
|
|
6
|
+
if (data?.version !== 1 || !Array.isArray(data.tracks) || !data.tracks.every(track => track && typeof track.id === "string" && typeof track.name === "string" && typeof track.uri === "string") || !Number.isFinite(data.position) || data.position < 0 || (data.currentId !== null && typeof data.currentId !== "string")) throw new Error("Unsupported music library format");
|
|
7
|
+
return data;
|
|
8
|
+
}
|
|
9
|
+
const stopped: AudioStatus = { playing: false, currentTime: 0, duration: 0, didJustFinish: false, error: null, volume: 1 };
|
|
10
|
+
export class MusicModel {
|
|
11
|
+
private state = { version: 1 as const, tracks: [] as Track[], currentId: null as string | null, position: 0, status: stopped, ready: false, busy: false, dirty: false, error: null as string | null };
|
|
12
|
+
private listeners = new Set<() => void>();
|
|
13
|
+
private player?: AudioPlayer;
|
|
14
|
+
private release?: () => void;
|
|
15
|
+
private loading?: Promise<void>;
|
|
16
|
+
private polling = false;
|
|
17
|
+
private lastSave = 0;
|
|
18
|
+
private finishedPlayback = false;
|
|
19
|
+
private revision = 0;
|
|
20
|
+
private activeOperation?: Promise<void>;
|
|
21
|
+
private disposing?: Promise<void>;
|
|
22
|
+
constructor(private records: { load(): Promise<{ value: Library | null; recovered: boolean }>; save(value: Library): Promise<void> }, private createPlayer: (track: Track) => Promise<{ player: AudioPlayer; release(): void }>) {}
|
|
23
|
+
getSnapshot = () => this.state;
|
|
24
|
+
subscribe = (listener: () => void) => { this.listeners.add(listener); return () => { this.listeners.delete(listener); }; };
|
|
25
|
+
private update(patch: Partial<typeof this.state>) { this.state = { ...this.state, ...patch }; for (const listener of this.listeners) listener(); }
|
|
26
|
+
private changed(patch: Partial<typeof this.state>) { this.revision++; this.update({ ...patch, dirty: true }); }
|
|
27
|
+
load = () => this.loading ??= (async () => {
|
|
28
|
+
try { const saved = await this.records.load(); this.update({ ...saved.value, ready: true, error: saved.recovered ? "Recovered the previous saved queue." : null }); }
|
|
29
|
+
catch (error) { this.update({ error: String(error) }); }
|
|
30
|
+
})();
|
|
31
|
+
add = async (tracks: Track[]) => { if (!this.state.ready) return; const ids = new Set(this.state.tracks.map(track => track.id)); this.changed({ tracks: [...this.state.tracks, ...tracks.filter(track => !ids.has(track.id) && !!ids.add(track.id))] }); await this.flush(); };
|
|
32
|
+
private async operation(action: () => Promise<void>) {
|
|
33
|
+
if (this.disposing) await this.disposing;
|
|
34
|
+
if (this.state.busy || !this.state.ready) return;
|
|
35
|
+
this.update({ busy: true, error: null });
|
|
36
|
+
const pending = action(); this.activeOperation = pending;
|
|
37
|
+
try { await pending; } catch (error) { this.update({ error: String(error) }); }
|
|
38
|
+
finally { this.activeOperation = undefined; this.update({ busy: false }); }
|
|
39
|
+
}
|
|
40
|
+
play = (id = this.state.currentId ?? this.state.tracks[0]?.id) => this.operation(async () => {
|
|
41
|
+
const track = this.state.tracks.find(track => track.id === id); if (!track) return;
|
|
42
|
+
if (!this.player || id !== this.state.currentId) {
|
|
43
|
+
const next = await this.createPlayer(track);
|
|
44
|
+
try { if (this.player) await this.player.remove(); } catch (error) { await next.player.remove(); next.release(); throw error; }
|
|
45
|
+
this.release?.(); this.player = next.player; this.release = next.release;
|
|
46
|
+
const position = id === this.state.currentId ? this.state.position : 0;
|
|
47
|
+
this.changed({ currentId: id!, position, status: stopped });
|
|
48
|
+
if (position > 0) await this.player.seekTo(position);
|
|
49
|
+
}
|
|
50
|
+
if (this.state.status.didJustFinish) await this.player.seekTo(0);
|
|
51
|
+
this.finishedPlayback = false;
|
|
52
|
+
await this.player.play(); await this.tick(); await this.flush();
|
|
53
|
+
});
|
|
54
|
+
pause = () => this.operation(async () => { await this.player?.pause(); await this.tick(); await this.flush(); });
|
|
55
|
+
seek = (seconds: number) => this.operation(async () => { if (this.player) { await this.player.seekTo(Math.max(0, seconds)); await this.tick(); await this.flush(); } });
|
|
56
|
+
next = () => { const index = this.state.tracks.findIndex(track => track.id === this.state.currentId); const track = this.state.tracks[index + 1]; return track ? this.play(track.id) : this.pause(); };
|
|
57
|
+
tick = async () => {
|
|
58
|
+
if (!this.player || this.polling) return;
|
|
59
|
+
this.polling = true; const player = this.player;
|
|
60
|
+
try {
|
|
61
|
+
const status = await player.getStatus(); if (player !== this.player) return;
|
|
62
|
+
if (status.currentTime !== this.state.position) this.changed({ position: status.currentTime });
|
|
63
|
+
this.update({ status, ...(status.error ? { error: status.error } : {}) });
|
|
64
|
+
if (status.didJustFinish && !this.state.busy && !this.finishedPlayback) { this.finishedPlayback = true; void this.next(); }
|
|
65
|
+
if (Date.now() - this.lastSave > 5000) { this.lastSave = Date.now(); await this.flush(); }
|
|
66
|
+
} catch (error) { this.update({ error: String(error) }); }
|
|
67
|
+
finally { this.polling = false; }
|
|
68
|
+
};
|
|
69
|
+
flush = async () => {
|
|
70
|
+
if (!this.state.ready) return false;
|
|
71
|
+
if (!this.state.dirty) return true;
|
|
72
|
+
try {
|
|
73
|
+
while (this.state.dirty) {
|
|
74
|
+
const revision = this.revision;
|
|
75
|
+
const { tracks, currentId, position } = this.state;
|
|
76
|
+
await this.records.save({ version: 1, tracks, currentId, position });
|
|
77
|
+
if (revision === this.revision) this.update({ dirty: false });
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
catch (error) { this.update({ error: String(error) }); return false; }
|
|
82
|
+
};
|
|
83
|
+
dispose = () => this.disposing ??= (async () => {
|
|
84
|
+
try {
|
|
85
|
+
await this.activeOperation?.catch(() => {}); await this.flush();
|
|
86
|
+
const player = this.player, release = this.release;
|
|
87
|
+
this.player = undefined; this.release = undefined;
|
|
88
|
+
try { await player?.remove(); } finally { release?.(); this.update({ status: stopped }); }
|
|
89
|
+
} finally { this.disposing = undefined; }
|
|
90
|
+
})();
|
|
91
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createAudioPlayer } from "@legendapp/spark/audio";
|
|
2
|
+
import { records } from "./shared/storage";
|
|
3
|
+
import { resolveTrack } from "./assets";
|
|
4
|
+
import { MusicModel, decodeLibrary } from "./model";
|
|
5
|
+
export const music = new MusicModel(records("music", decodeLibrary), async track => {
|
|
6
|
+
const source = await resolveTrack(track);
|
|
7
|
+
try { return { player: await createAudioPlayer({ uri: source.uri, title: track.name }), release: source.release }; }
|
|
8
|
+
catch (error) { source.release(); throw error; }
|
|
9
|
+
});
|
|
10
|
+
export const dirty = () => music.getSnapshot().dirty;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { readTextFile } from "@legendapp/spark/dialogs";
|
|
2
|
+
import { OpenFiles } from "./shared/OpenFiles";
|
|
3
|
+
import { notes } from "./store";
|
|
4
|
+
const open = async (path: string) => { await notes.load(); if (!notes.getSnapshot().ready) throw new Error("Notes storage is unavailable"); const text = await readTextFile(path); notes.create(text); };
|
|
5
|
+
export function Activation({ windowId, onError }: { windowId: string; onError(message: string): void }) { return <OpenFiles windowId={windowId} onFile={open} onError={onError} />; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Activation } from "./Activation.desktop";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function Activation(_props: { windowId: string; onError(message: string): void }) { return null; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Activation } from "./Activation.desktop";
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Activation } from "./Activation";
|
|
2
|
+
import { memo, useEffect, useMemo, useRef, useState, useContext } from "react";
|
|
3
|
+
import { FlatList, Pressable, SafeAreaView, StyleSheet, TextInput, useWindowDimensions, View } from "react-native";
|
|
4
|
+
import { Button } from "@legendapp/spark/ui";
|
|
5
|
+
import { io } from "./shared/io";
|
|
6
|
+
import { Lifecycle } from "./shared/Lifecycle";
|
|
7
|
+
import { useModel } from "./shared/useModel";
|
|
8
|
+
import { notes, dirty } from "./store";
|
|
9
|
+
import { title, type Note } from "./model";
|
|
10
|
+
import { desktop, openNote, openSettings, showNotebook, restoreSession, watchSession, flushSession } from "./Desktop";
|
|
11
|
+
import { requestSearch, onSearch } from "./search";
|
|
12
|
+
import { Text, ThemeContext, usePalette } from "./Theme";
|
|
13
|
+
const Row = memo(function Row({ note, selected }: { note: Note; selected: boolean }) {
|
|
14
|
+
const palette = useContext(ThemeContext);
|
|
15
|
+
return <Pressable accessibilityRole="button" accessibilityState={{ selected }} onPress={() => notes.select(note.id)} style={[styles.row, { borderColor: palette.border }, selected && { backgroundColor: palette.selected }]}>
|
|
16
|
+
<Text numberOfLines={1} style={styles.noteTitle}>{title(note)}</Text>
|
|
17
|
+
<Text numberOfLines={1}>{note.text.split("\n").slice(1).join(" ") || "Empty note"}</Text>
|
|
18
|
+
</Pressable>;
|
|
19
|
+
});
|
|
20
|
+
export default function App({ windowId = "main", windowProps }: { windowId?: string; windowProps?: { noteId?: string; settings?: boolean } }) {
|
|
21
|
+
const state = useModel(notes);
|
|
22
|
+
const palette = usePalette(state.theme ?? "system");
|
|
23
|
+
const { width } = useWindowDimensions();
|
|
24
|
+
const search = useRef<TextInput>(null);
|
|
25
|
+
const [query, setQuery] = useState("");
|
|
26
|
+
const [trash, setTrash] = useState(false);
|
|
27
|
+
const [settings, setSettings] = useState(false);
|
|
28
|
+
const [error, setError] = useState<string | null>(null);
|
|
29
|
+
const [searchRequested, setSearchRequested] = useState(0);
|
|
30
|
+
const selected = state.notes.find(note => note.id === (windowProps?.noteId ?? state.selectedId) && !note.deleted);
|
|
31
|
+
const isSettings = windowProps?.settings || settings;
|
|
32
|
+
const visible = useMemo(() => state.notes.filter(note => note.deleted === trash && note.text.toLowerCase().includes(query.toLowerCase())), [state.notes, query, trash]);
|
|
33
|
+
// Native menu/shortcut registrations retain these callbacks; read current model at invocation.
|
|
34
|
+
const commands = useMemo(() => {
|
|
35
|
+
const run = (action: () => void | Promise<unknown>) => () => { setError(null); void Promise.resolve().then(action).catch(error => setError(String(error))); };
|
|
36
|
+
const current = () => windowProps?.settings ? undefined : notes.getSnapshot().notes.find(note => note.id === (windowProps?.noteId ?? notes.getSnapshot().selectedId) && !note.deleted);
|
|
37
|
+
return [
|
|
38
|
+
{ id: "new", title: "New note", key: "N", run: run(async () => { setSettings(false); setTrash(false); setQuery(""); const id = notes.create(); if (id && (windowProps?.noteId || windowProps?.settings)) await openNote(id); }) },
|
|
39
|
+
{ id: "save", title: "Save notes", key: "S", run: run(async () => { await notes.flush(); }) },
|
|
40
|
+
{ id: "open", title: "Import text…", key: "O", run: run(async () => { const file = await io.open(); if (file) { const id = notes.create(file.text); if (id && (windowProps?.noteId || windowProps?.settings)) await openNote(id); } }) },
|
|
41
|
+
{ id: "search", title: "Search notes", key: "F", run: run(async () => { if (desktop) await showNotebook(); requestSearch(); }) },
|
|
42
|
+
{ id: "delete", title: "Delete note", key: "Shift+Backspace", run: run(() => { const note = current(); if (note) notes.setDeleted(note.id, true); }) },
|
|
43
|
+
...(desktop ? [{ id: "window", title: "Open in new window", key: "Shift+N", run: run(async () => { const note = current(); if (note) await openNote(note.id); }) }] : []),
|
|
44
|
+
{ id: "settings", title: "Settings…", key: ",", run: run(async () => { if (desktop) await openSettings(); else setSettings(value => !value); }) },
|
|
45
|
+
];
|
|
46
|
+
}, [windowProps?.noteId, windowProps?.settings]);
|
|
47
|
+
useEffect(() => { void notes.load(); }, []);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (windowId !== "main") return;
|
|
50
|
+
return onSearch(() => { setSettings(false); setTrash(false); notes.select(null); setSearchRequested(value => value + 1); });
|
|
51
|
+
}, [windowId]);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (!desktop || windowId !== "main") return;
|
|
54
|
+
void restoreSession().catch(error => setError(String(error)));
|
|
55
|
+
const subscription = watchSession(setError);
|
|
56
|
+
return () => subscription.remove();
|
|
57
|
+
}, [windowId]);
|
|
58
|
+
useEffect(() => { if (searchRequested) search.current?.focus(); }, [searchRequested]);
|
|
59
|
+
const sidebar = !windowProps?.noteId && (width >= 720 || !selected);
|
|
60
|
+
const fieldStyle = { color: palette.text, backgroundColor: palette.surface, borderColor: palette.border };
|
|
61
|
+
return <ThemeContext.Provider value={palette}><SafeAreaView style={[styles.root, { backgroundColor: palette.background }]}>
|
|
62
|
+
<Activation windowId={windowId} onError={setError} />
|
|
63
|
+
<Lifecycle title={isSettings ? "Notes Settings" : selected ? `${title(selected)} — Notes` : "Notes"} windowId={windowId} flush={notes.flush} quit={desktop ? flushSession : notes.flush} dirty={dirty} commands={commands} onError={setError} />
|
|
64
|
+
<View style={styles.header}><Text style={styles.heading}>{isSettings ? "Settings" : "Notes"}</Text><Text accessibilityLiveRegion="polite">{state.saving ? "Saving…" : state.dirty ? "Changes pending" : state.ready ? "Saved on this device" : "Opening notes…"}</Text>{!isSettings ? <Button onPress={commands.find(command => command.id === "settings")!.run}>Settings</Button> : null}</View>
|
|
65
|
+
{state.recovered ? <Text style={styles.notice}>Recovered the previous saved snapshot after an incomplete or unreadable write.</Text> : null}
|
|
66
|
+
{error ? <View style={styles.notice}><Text accessibilityRole="alert">{error}</Text><Button onPress={() => setError(null)}>Dismiss</Button></View> : null}
|
|
67
|
+
{state.error ? <View style={styles.notice}><Text accessibilityRole="alert">{state.error}</Text>{state.ready ? <Button onPress={() => { void notes.flush(); }}>Retry save</Button> : <Text>Storage could not be opened. Restart after resolving the storage problem.</Text>}</View> : null}
|
|
68
|
+
{isSettings ? <View style={styles.editorPane}><Text style={styles.noteTitle}>Appearance</Text><Text>Choose a theme for every Notes window.</Text><View style={styles.toolbar}>{(["system", "light", "dark"] as const).map(theme => <Button key={theme} disabled={!state.ready || (state.theme ?? "system") === theme} onPress={() => notes.setTheme(theme)}>{`${theme === "system" ? "System" : theme === "light" ? "Light" : "Dark"}${(state.theme ?? "system") === theme ? " ✓" : ""}`}</Button>)}</View>{!desktop ? <Button onPress={() => setSettings(false)}>Back to notes</Button> : null}</View> : <View style={styles.body}>
|
|
69
|
+
{sidebar ? <View style={[styles.sidebar, { borderColor: palette.border }, width < 720 && { width: "100%" }]}>
|
|
70
|
+
<TextInput ref={search} accessibilityLabel="Search notes" placeholder="Search notes" placeholderTextColor={palette.text} value={query} onChangeText={setQuery} style={[styles.search, fieldStyle]} />
|
|
71
|
+
<View style={styles.toolbar}><Button disabled={!state.ready} onPress={commands[0]!.run}>New note</Button><Button disabled={!state.ready} onPress={commands[2]!.run}>Import text</Button><Button onPress={commands.find(command => command.id === "search")!.run}>Search</Button><Button onPress={() => setTrash(value => !value)}>{trash ? "Show notes" : "Recently deleted"}</Button></View>
|
|
72
|
+
<FlatList data={visible} keyExtractor={note => note.id} extraData={state.selectedId} renderItem={({ item }) => trash ? <View style={styles.row}><Text>{title(item)}</Text><Button onPress={() => notes.setDeleted(item.id, false)}>Restore</Button></View> : <Row note={item} selected={item.id === state.selectedId} />} ListEmptyComponent={<Text style={styles.notice}>{query ? "No matching notes" : trash ? "No deleted notes" : "Create your first note"}</Text>} />
|
|
73
|
+
</View> : null}
|
|
74
|
+
{(!sidebar || width >= 720) ? selected ? <View style={styles.editorPane}>
|
|
75
|
+
<View style={styles.toolbar}>
|
|
76
|
+
{width < 720 && !windowProps?.noteId ? <Button onPress={() => notes.select(null)}>Back to notes</Button> : null}
|
|
77
|
+
<Button onPress={() => { void io.save({ name: `${title(selected).replace(/[^a-zA-Z0-9 _-]/g, "_")}.md` }, selected.text, "", true).catch(error => setError(String(error))); }}>Export text</Button>
|
|
78
|
+
<Button onPress={commands.find(command => command.id === "delete")!.run}>Delete note</Button>
|
|
79
|
+
{desktop ? <Button onPress={commands.find(command => command.id === "window")!.run}>Open in new window</Button> : null}
|
|
80
|
+
</View>
|
|
81
|
+
<TextInput key={selected.id} accessibilityLabel="Note text" testID="note-text" multiline value={selected.text} onChangeText={text => notes.edit(selected.id, text)} textAlignVertical="top" style={[styles.editor, fieldStyle]} autoFocus />
|
|
82
|
+
</View> : <View style={styles.editorPane}><Text>{windowProps?.noteId ? "This note was deleted. Restore it from Recently deleted in the main window." : "Select a note to begin."}</Text></View> : null}
|
|
83
|
+
</View>}
|
|
84
|
+
</SafeAreaView></ThemeContext.Provider>;
|
|
85
|
+
}
|
|
86
|
+
const styles = StyleSheet.create({
|
|
87
|
+
root: { flex: 1 }, header: { padding: 20, gap: 6 }, heading: { fontSize: 28, fontWeight: "600" },
|
|
88
|
+
body: { flex: 1, flexDirection: "row" }, sidebar: { width: 320, borderRightWidth: 1 },
|
|
89
|
+
toolbar: { flexDirection: "row", flexWrap: "wrap", gap: 8, padding: 12 }, search: { padding: 12, margin: 12, borderWidth: 1, borderRadius: 6 },
|
|
90
|
+
row: { padding: 16, gap: 6, borderBottomWidth: 1 }, noteTitle: { fontSize: 16, fontWeight: "600" },
|
|
91
|
+
editorPane: { flex: 1, padding: 12 }, editor: { flex: 1, minHeight: 180, padding: 16, fontSize: 17, borderWidth: 1, borderRadius: 6 }, notice: { padding: 12 },
|
|
92
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { getDisplays, listWindows, openWindow, setWindowFrame, showWindow, onWindowEvent } from "@legendapp/spark/windows";
|
|
2
|
+
import { notes } from "./store";
|
|
3
|
+
import { WindowSession } from "./window-session";
|
|
4
|
+
export const desktop = true;
|
|
5
|
+
const session = new WindowSession(notes, {
|
|
6
|
+
list: listWindows,
|
|
7
|
+
workAreas: async () => (await getDisplays()).map(display => display.workArea),
|
|
8
|
+
show: showWindow,
|
|
9
|
+
frame: setWindowFrame,
|
|
10
|
+
open: window => openWindow({ id: window.id, title: window.id === "settings" ? "Notes Settings" : "Notes", width: window.frame.width, height: window.frame.height, props: window.id === "settings" ? { settings: true } : { noteId: window.noteId } }),
|
|
11
|
+
});
|
|
12
|
+
export const openNote = (noteId: string) => session.openNote(noteId);
|
|
13
|
+
export const openSettings = () => session.openSettings();
|
|
14
|
+
export const showNotebook = () => showWindow("main");
|
|
15
|
+
export const restoreSession = session.restore;
|
|
16
|
+
export const flushSession = session.quit;
|
|
17
|
+
export function watchSession(onError: (message: string) => void) {
|
|
18
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
19
|
+
const subscription = onWindowEvent(event => {
|
|
20
|
+
if (!session.known(event.windowId) || !["move", "resize", "closed"].includes(event.type)) return;
|
|
21
|
+
clearTimeout(timer);
|
|
22
|
+
timer = setTimeout(() => { void session.restore().then(session.capture).catch(error => onError(String(error))); }, 150);
|
|
23
|
+
});
|
|
24
|
+
return { remove() { clearTimeout(timer); subscription.remove(); } };
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Desktop.desktop";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const desktop = false;
|
|
2
|
+
export async function openNote(_noteId: string) {}
|
|
3
|
+
export async function showNotebook() {}
|
|
4
|
+
export async function openSettings() {}
|
|
5
|
+
export async function restoreSession() {}
|
|
6
|
+
export async function flushSession() { return true; }
|
|
7
|
+
export function watchSession(_onError: (message: string) => void) { return { remove() {} }; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Desktop.desktop";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createContext, useContext, useEffect, type ComponentProps } from "react";
|
|
2
|
+
import { Appearance, Platform, Text as NativeText, useColorScheme } from "react-native";
|
|
3
|
+
import type { Theme } from "./session";
|
|
4
|
+
const light = { background: "#faf9f6", surface: "#ffffff", text: "#222222", border: "#d8d5cf", selected: "#dce9ef" };
|
|
5
|
+
const dark = { background: "#191919", surface: "#252525", text: "#eeeeee", border: "#505050", selected: "#29475b" };
|
|
6
|
+
export const ThemeContext = createContext(light);
|
|
7
|
+
export function usePalette(theme: Theme) {
|
|
8
|
+
const system = useColorScheme();
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (Platform.OS !== "web") Appearance.setColorScheme(theme === "system" ? null : theme);
|
|
11
|
+
}, [theme]);
|
|
12
|
+
return (theme === "system" ? system : theme) === "dark" ? dark : light;
|
|
13
|
+
}
|
|
14
|
+
export function Text(props: ComponentProps<typeof NativeText>) {
|
|
15
|
+
const palette = useContext(ThemeContext);
|
|
16
|
+
return <NativeText {...props} style={[{ color: palette.text }, props.style]} />;
|
|
17
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { decodeWindows, type SavedWindow, type Theme } from "./session";
|
|
2
|
+
export type Note = { id: string; text: string; updatedAt: number; deleted: boolean };
|
|
3
|
+
export type Notebook = { version: 1; notes: Note[]; selectedId: string | null; theme?: Theme; windows?: SavedWindow[] };
|
|
4
|
+
export function decodeNotebook(value: unknown): Notebook {
|
|
5
|
+
const data = value as Notebook;
|
|
6
|
+
if (data?.version !== 1 || !Array.isArray(data.notes) || !data.notes.every(note => note && typeof note.id === "string" && typeof note.text === "string" && Number.isFinite(note.updatedAt) && typeof note.deleted === "boolean") || new Set(data.notes.map(note => note.id)).size !== data.notes.length || (data.selectedId !== null && typeof data.selectedId !== "string")) throw new Error("Unsupported notes format");
|
|
7
|
+
if (data.theme !== undefined && !["system", "light", "dark"].includes(data.theme)) throw new Error("Unsupported theme");
|
|
8
|
+
decodeWindows(data.windows);
|
|
9
|
+
return data;
|
|
10
|
+
}
|
|
11
|
+
export type NotesState = Notebook & { ready: boolean; dirty: boolean; saving: boolean; error: string | null; recovered: boolean };
|
|
12
|
+
export class NotesModel {
|
|
13
|
+
private state: NotesState = { version: 1, notes: [], selectedId: null, ready: false, dirty: false, saving: false, error: null, recovered: false };
|
|
14
|
+
private listeners = new Set<() => void>();
|
|
15
|
+
private timer: ReturnType<typeof setTimeout> | undefined;
|
|
16
|
+
private revision = 0;
|
|
17
|
+
private loading?: Promise<void>;
|
|
18
|
+
private saving?: Promise<boolean>;
|
|
19
|
+
constructor(private records: { load(): Promise<{ value: Notebook | null; recovered: boolean }>; save(value: Notebook): Promise<void> }) {}
|
|
20
|
+
subscribe = (listener: () => void) => { this.listeners.add(listener); return () => { this.listeners.delete(listener); }; };
|
|
21
|
+
getSnapshot = () => this.state;
|
|
22
|
+
private update(patch: Partial<NotesState>) { this.state = { ...this.state, ...patch }; for (const listener of this.listeners) listener(); }
|
|
23
|
+
load = () => this.loading ??= (async () => {
|
|
24
|
+
try { const saved = await this.records.load(); this.update({ ...saved.value, ready: true, recovered: saved.recovered }); }
|
|
25
|
+
catch (error) { this.update({ error: String(error) }); }
|
|
26
|
+
})();
|
|
27
|
+
private change(patch: Partial<Notebook>) {
|
|
28
|
+
if (!this.state.ready) return;
|
|
29
|
+
this.revision++; this.update({ ...patch, dirty: true });
|
|
30
|
+
clearTimeout(this.timer); this.timer = setTimeout(() => { void this.flush(); }, 250);
|
|
31
|
+
}
|
|
32
|
+
setTheme = (theme: Theme) => { if (theme !== (this.state.theme ?? "system")) this.change({ theme }); };
|
|
33
|
+
setWindows = (windows: SavedWindow[]) => { if (JSON.stringify(windows) !== JSON.stringify(this.state.windows ?? [])) this.change({ windows }); };
|
|
34
|
+
create = (text = "") => {
|
|
35
|
+
if (!this.state.ready) return;
|
|
36
|
+
const id = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
37
|
+
this.change({ notes: [{ id, text, updatedAt: Date.now(), deleted: false }, ...this.state.notes], selectedId: id });
|
|
38
|
+
return id;
|
|
39
|
+
};
|
|
40
|
+
select = (selectedId: string | null) => { if (selectedId !== this.state.selectedId) this.change({ selectedId }); };
|
|
41
|
+
edit = (id: string, text: string) => {
|
|
42
|
+
const note = this.state.notes.find(item => item.id === id);
|
|
43
|
+
if (!note || note.text === text || note.deleted) return;
|
|
44
|
+
this.change({ notes: this.state.notes.map(item => item.id === id ? { ...item, text, updatedAt: Date.now() } : item) });
|
|
45
|
+
};
|
|
46
|
+
setDeleted = (id: string, deleted: boolean) => this.change({ notes: this.state.notes.map(note => note.id === id ? { ...note, deleted, updatedAt: Date.now() } : note), selectedId: this.state.selectedId === id && deleted ? null : this.state.selectedId });
|
|
47
|
+
flush = (): Promise<boolean> => {
|
|
48
|
+
clearTimeout(this.timer);
|
|
49
|
+
if (this.saving) return this.saving.then(ok => ok ? this.flush() : false);
|
|
50
|
+
if (!this.state.ready) return Promise.resolve(false);
|
|
51
|
+
if (!this.state.dirty) return Promise.resolve(true);
|
|
52
|
+
const revision = this.revision;
|
|
53
|
+
const { notes, selectedId, theme, windows } = this.state;
|
|
54
|
+
this.update({ saving: true, error: null });
|
|
55
|
+
this.saving = this.records.save({ version: 1, notes, selectedId, theme, windows }).then(() => {
|
|
56
|
+
this.update({ dirty: revision !== this.revision }); return true;
|
|
57
|
+
}, error => { this.update({ error: String(error) }); return false; }).finally(() => { this.saving = undefined; this.update({ saving: false }); });
|
|
58
|
+
return this.saving.then(ok => ok && this.state.dirty ? this.flush() : ok);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export const title = (note: Note) => note.text.split("\n").find(line => line.trim())?.replace(/^#+\s*/, "").slice(0, 80) || "Untitled note";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type Theme = "system" | "light" | "dark";
|
|
2
|
+
export type Frame = { x: number; y: number; width: number; height: number };
|
|
3
|
+
export type SavedWindow = { id: string; noteId?: string; frame: Frame };
|
|
4
|
+
export function decodeWindows(value: unknown): SavedWindow[] {
|
|
5
|
+
if (value === undefined) return [];
|
|
6
|
+
if (!Array.isArray(value) || !value.every(item => item && typeof item.id === "string" && /^(main|settings|note-[a-zA-Z0-9_-]+)$/.test(item.id) && (item.noteId === undefined || typeof item.noteId === "string") && item.frame && ["x", "y", "width", "height"].every(key => Number.isFinite(item.frame[key])) && item.frame.width >= 100 && item.frame.height >= 100 && item.frame.width <= 20000 && item.frame.height <= 20000) || new Set(value.map(item => item.id)).size !== value.length) throw new Error("Unsupported window session");
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
/** Both platforms return frames/work areas in their own matching coordinate system. */
|
|
10
|
+
export function fitFrame(frame: Frame, workAreas: Frame[]): Frame {
|
|
11
|
+
if (!workAreas.length) return frame;
|
|
12
|
+
const overlap = (area: Frame) => Math.max(0, Math.min(frame.x + frame.width, area.x + area.width) - Math.max(frame.x, area.x)) * Math.max(0, Math.min(frame.y + frame.height, area.y + area.height) - Math.max(frame.y, area.y));
|
|
13
|
+
const area = workAreas.reduce((best, current) => overlap(current) > overlap(best) ? current : best);
|
|
14
|
+
const width = Math.min(frame.width, area.width), height = Math.min(frame.height, area.height);
|
|
15
|
+
return { x: Math.max(area.x, Math.min(frame.x, area.x + area.width - width)), y: Math.max(area.y, Math.min(frame.y, area.y + area.height - height)), width, height };
|
|
16
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { fitFrame, type Frame, type SavedWindow } from "./session";
|
|
2
|
+
import type { NotesModel } from "./model";
|
|
3
|
+
export type WindowHost = {
|
|
4
|
+
list(): Promise<{ id: string; frame: Frame }[]>;
|
|
5
|
+
workAreas(): Promise<Frame[]>;
|
|
6
|
+
open(window: SavedWindow): Promise<unknown>;
|
|
7
|
+
show(id: string): Promise<unknown>;
|
|
8
|
+
frame(id: string, frame: Frame): Promise<unknown>;
|
|
9
|
+
};
|
|
10
|
+
/** One controller per JS runtime; all React windows share its session and writer. */
|
|
11
|
+
export class WindowSession {
|
|
12
|
+
private noteIds = new Map<string, string>();
|
|
13
|
+
private restored?: Promise<void>;
|
|
14
|
+
private quitting = false;
|
|
15
|
+
private queue: Promise<void> = Promise.resolve();
|
|
16
|
+
constructor(private notes: NotesModel, private host: WindowHost) {}
|
|
17
|
+
known = (id: string) => id === "main" || id === "settings" || this.noteIds.has(id);
|
|
18
|
+
async openNote(noteId: string) {
|
|
19
|
+
await this.restore();
|
|
20
|
+
const id = `note-${noteId}`;
|
|
21
|
+
this.noteIds.set(id, noteId);
|
|
22
|
+
if ((await this.host.list()).some(window => window.id === id)) await this.host.show(id);
|
|
23
|
+
else await this.host.open({ id, noteId, frame: { x: 0, y: 0, width: 700, height: 600 } });
|
|
24
|
+
await this.capture();
|
|
25
|
+
}
|
|
26
|
+
async openSettings() {
|
|
27
|
+
await this.restore();
|
|
28
|
+
if ((await this.host.list()).some(window => window.id === "settings")) await this.host.show("settings");
|
|
29
|
+
else await this.host.open({ id: "settings", frame: { x: 0, y: 0, width: 460, height: 360 } });
|
|
30
|
+
await this.capture();
|
|
31
|
+
}
|
|
32
|
+
capture = () => {
|
|
33
|
+
const task = this.queue.then(async () => {
|
|
34
|
+
if (this.quitting) return;
|
|
35
|
+
const windows = await this.host.list();
|
|
36
|
+
this.notes.setWindows(windows.filter(window => this.known(window.id)).map(window => ({ id: window.id, noteId: this.noteIds.get(window.id), frame: window.frame })));
|
|
37
|
+
});
|
|
38
|
+
this.queue = task.catch(() => {});
|
|
39
|
+
return task;
|
|
40
|
+
};
|
|
41
|
+
restore = () => this.restored ??= (async () => {
|
|
42
|
+
await this.notes.load();
|
|
43
|
+
if (!this.notes.getSnapshot().ready) return;
|
|
44
|
+
const saved = [...(this.notes.getSnapshot().windows ?? [])];
|
|
45
|
+
const areas = await this.host.workAreas();
|
|
46
|
+
for (const window of saved) {
|
|
47
|
+
if (window.id !== "main" && window.id !== "settings" && !this.notes.getSnapshot().notes.some(note => note.id === window.noteId && !note.deleted)) continue;
|
|
48
|
+
if (window.noteId) this.noteIds.set(window.id, window.noteId);
|
|
49
|
+
if (window.id !== "main" && !(await this.host.list()).some(item => item.id === window.id)) await this.host.open(window);
|
|
50
|
+
await this.host.frame(window.id, fitFrame(window.frame, areas));
|
|
51
|
+
}
|
|
52
|
+
await this.capture();
|
|
53
|
+
})();
|
|
54
|
+
quit = async () => {
|
|
55
|
+
await this.restore();
|
|
56
|
+
await this.capture();
|
|
57
|
+
const ok = await this.notes.flush();
|
|
58
|
+
// Native quit may close windows individually. Keep their last complete session.
|
|
59
|
+
if (ok) this.quitting = true;
|
|
60
|
+
return ok;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { Uniwind } from "uniwind";
|
|
3
|
+
import { ScrollView, Text, View } from "react-native";
|
|
4
|
+
import { Button, TextInput, Select } from "@legendapp/spark/ui/uniwind";
|
|
5
|
+
import * as Clipboard from "@legendapp/spark/clipboard";
|
|
6
|
+
import * as SecureStore from "@legendapp/spark/secure-storage";
|
|
7
|
+
import * as Linking from "@legendapp/spark/links";
|
|
8
|
+
|
|
9
|
+
const themes = [{ label: "System", value: "system" }, { label: "Light", value: "light" }, { label: "Dark", value: "dark" }];
|
|
10
|
+
|
|
11
|
+
export default function Settings() {
|
|
12
|
+
const [name, setName] = useState("");
|
|
13
|
+
const [theme, setTheme] = useState("system");
|
|
14
|
+
const [status, setStatus] = useState("Preferences are held in memory for this demo.");
|
|
15
|
+
const [busy, setBusy] = useState(false);
|
|
16
|
+
async function action(work: () => Promise<string>) {
|
|
17
|
+
setBusy(true);
|
|
18
|
+
try { setStatus(await work()); } catch (error) { setStatus(error instanceof Error ? error.message : String(error)); }
|
|
19
|
+
finally { setBusy(false); }
|
|
20
|
+
}
|
|
21
|
+
function changeTheme(value: string) {
|
|
22
|
+
if (value !== "system" && value !== "light" && value !== "dark") return;
|
|
23
|
+
Uniwind.setTheme(value);
|
|
24
|
+
setTheme(value);
|
|
25
|
+
}
|
|
26
|
+
return <ScrollView contentInsetAdjustmentBehavior="always" className="flex-1 bg-background" contentContainerClassName="grow items-center p-4 sm:p-6">
|
|
27
|
+
<View className="w-full max-w-2xl gap-3 rounded-xl border border-border bg-surface p-4 sm:p-6" testID="settings-panel">
|
|
28
|
+
<Text accessibilityRole="header" className="text-3xl font-semibold text-foreground">Settings</Text>
|
|
29
|
+
<Text className="text-base text-muted">One screen shared across mobile, web, and desktop.</Text>
|
|
30
|
+
<Text className="mt-2 text-base font-semibold text-foreground">Display name</Text>
|
|
31
|
+
<TextInput accessibilityLabel="Display name" defaultValue="" onChangeText={setName} className="w-full" testID="settings-name" />
|
|
32
|
+
<Text className="mt-2 text-base font-semibold text-foreground">Appearance preference</Text>
|
|
33
|
+
<Select accessibilityLabel="Appearance preference" options={themes} value={theme} onValueChange={changeTheme} className="w-full" testID="settings-theme" />
|
|
34
|
+
<Text className="text-base text-muted">Hello {name || "there"}. Preferred appearance: {theme}.</Text>
|
|
35
|
+
<View className="mt-3 flex-row flex-wrap gap-3">
|
|
36
|
+
<Button className="w-full sm:w-56" disabled={busy} onPress={() => void action(async () => {
|
|
37
|
+
if (!await Clipboard.setStringAsync(JSON.stringify({ name, theme }))) throw new Error("The browser did not permit clipboard access.");
|
|
38
|
+
return "Copied preferences.";
|
|
39
|
+
})}>Copy preferences</Button>
|
|
40
|
+
<Button className="w-full sm:w-56" disabled={busy} onPress={() => void action(async () => {
|
|
41
|
+
if (!await SecureStore.isAvailableAsync()) return "Secure storage is unavailable on this platform.";
|
|
42
|
+
const key = `settings-demo-${Date.now()}`;
|
|
43
|
+
// A disposable synthetic value; no real credentials are entered or displayed.
|
|
44
|
+
try {
|
|
45
|
+
await SecureStore.setItemAsync(key, "demo");
|
|
46
|
+
if (await SecureStore.getItemAsync(key) !== "demo") throw new Error("Secure storage check failed.");
|
|
47
|
+
return "Secure storage verified; demo value removed.";
|
|
48
|
+
} finally { await SecureStore.deleteItemAsync(key); }
|
|
49
|
+
})}>Check secure storage</Button>
|
|
50
|
+
<Button className="w-full sm:w-56" disabled={busy} onPress={() => void action(async () => {
|
|
51
|
+
await Linking.openURL("https://legendapp.com"); return "Opened the Legend website.";
|
|
52
|
+
})}>Open Legend website</Button>
|
|
53
|
+
</View>
|
|
54
|
+
<Text accessibilityLiveRegion="polite" className="mt-3 text-sm text-foreground" testID="settings-status">{status}</Text>
|
|
55
|
+
</View>
|
|
56
|
+
</ScrollView>;
|
|
57
|
+
}
|