@legendapp/spark 0.0.1-next.10
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/LICENSE +21 -0
- package/README.md +27 -0
- package/ai-codex.ts +1 -0
- package/ai.ts +1 -0
- package/app-documents.ts +1 -0
- package/app.ts +1 -0
- package/audio.ts +1 -0
- package/auth-session.ts +1 -0
- package/bin/spark.cjs +5 -0
- package/camera.ts +13 -0
- package/clipboard.ts +1 -0
- package/config-plugin.cjs +1 -0
- package/config-plugin.d.cts +2 -0
- package/config.cjs +1 -0
- package/config.d.cts +1 -0
- package/context-menu.ts +1 -0
- package/contracts.ts +2 -0
- package/customize.ts +2 -0
- package/diagnostics.ts +1 -0
- package/dialogs.ts +2 -0
- package/drag-drop.ts +1 -0
- package/expo-config.cjs +1 -0
- package/expo-config.d.cts +1 -0
- package/files.ts +1 -0
- package/global-shortcuts.ts +1 -0
- package/html.ts +1 -0
- package/init-template.cjs +2 -0
- package/links.ts +1 -0
- package/markdown.ts +1 -0
- package/menus.ts +1 -0
- package/metro-gate.cjs +1 -0
- package/metro.cjs +4 -0
- package/metro.d.cts +12 -0
- package/native.cjs +3 -0
- package/native.d.cts +6 -0
- package/notifications.ts +1 -0
- package/package.json +248 -0
- package/patches/camera/react-native-nitro-image.patch +320 -0
- package/patches/camera/react-native-nitro-modules.patch +50 -0
- package/patches/camera/react-native-vision-camera.patch +2662 -0
- package/patches/camera/upstream.json +22 -0
- package/patches/dependencies.json +14 -0
- package/patches/react-native-enriched-html@1.1.1.patch +854 -0
- package/patches/react-native-enriched-markdown@1.1.1.patch +7751 -0
- package/postinstall.cjs +1 -0
- package/processes.ts +1 -0
- package/runtime-entry.cjs +1 -0
- package/schema.json +636 -0
- package/secure-storage.ts +1 -0
- package/settings-observable.ts +1 -0
- package/settings-window.ts +1 -0
- package/settings.ts +1 -0
- package/shortcuts-commands.ts +1 -0
- package/shortcuts-keyboard.ts +3 -0
- package/shortcuts.ts +1 -0
- package/skills/spark/SKILL.md +56 -0
- package/skills/spark/UPGRADING.md +322 -0
- package/sqlite.ts +1 -0
- package/system.ts +1 -0
- package/tray.ts +1 -0
- package/ui-classnames.ts +1 -0
- package/ui-glass.ts +1 -0
- package/ui-search.ts +1 -0
- package/ui-sidebar.ts +1 -0
- package/ui-split-view.ts +1 -0
- package/ui-swipe.ts +1 -0
- package/ui-symbol.ts +1 -0
- package/ui-uniwind.ts +1 -0
- package/ui.ts +1 -0
- package/updates.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-ai/package.json +19 -0
- package/vendor/node_modules/@legendapp/spark-ai/src/availability.ts +17 -0
- package/vendor/node_modules/@legendapp/spark-ai/src/index.ts +15 -0
- package/vendor/node_modules/@legendapp/spark-ai/src/invocation-command.cjs +11 -0
- package/vendor/node_modules/@legendapp/spark-ai/src/invocation-command.d.cts +2 -0
- package/vendor/node_modules/@legendapp/spark-ai/src/invocations.ts +17 -0
- package/vendor/node_modules/@legendapp/spark-ai/src/output.ts +62 -0
- package/vendor/node_modules/@legendapp/spark-ai/src/run.ts +12 -0
- package/vendor/node_modules/@legendapp/spark-ai/src/types.ts +16 -0
- package/vendor/node_modules/@legendapp/spark-audio/RNSparkAudio.podspec +18 -0
- package/vendor/node_modules/@legendapp/spark-audio/macos/RNSparkAudio.h +5 -0
- package/vendor/node_modules/@legendapp/spark-audio/macos/RNSparkAudio.mm +256 -0
- package/vendor/node_modules/@legendapp/spark-audio/package.json +52 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/NativeSparkAudio.ts +7 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/desktop.ts +43 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/events.ts +11 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/hooks.ts +65 -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 +101 -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 +7 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/media-session.ts +58 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/media-session.web.ts +43 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/media-types.ts +59 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/mobile.ts +46 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/player.ts +97 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/status-listeners.ts +28 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/types.ts +26 -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 +193 -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 +42 -0
- package/vendor/node_modules/@legendapp/spark-auth-session/src/core.ts +86 -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 +38 -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 +108 -0
- package/vendor/node_modules/@legendapp/spark-auth-session/src/types.ts +49 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/add-desktop.js +207 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/build-mode.js +7 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/build.js +379 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/cli-arguments.js +61 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/commands.js +113 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/create.js +160 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/credentials.js +130 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/customize-ai.cjs +108 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/customize-artifacts.js +315 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/customize-cli.cjs +75 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/customize-github.cjs +133 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/customize-policy.cjs +102 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/customize-provider.cjs +2 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/customize-worker.cjs +273 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/dependency-pins.js +157 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/dev-command.js +92 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/dev.js +415 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/enriched-html-pins.js +128 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/errors.js +100 -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 +69 -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 +14 -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 +280 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/init-template.cjs +26 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/init-template.d.cts +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/js-runtime.cjs +96 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/json.js +16 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/local.js +124 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/macos-release.js +11 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/metro-gate.cjs +33 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/metro.cjs +84 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/metro.js +25 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.cjs +152 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.d.cts +15 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.cjs +184 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.d.cts +16 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/native-metadata.js +26 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/native-patch-preflight.js +88 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/native-preparation.js +88 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/notary-profiles.js +75 -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-config.js +43 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/package-manager.js +58 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/package.js +201 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/platform.js +48 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/process.js +64 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/project-version.js +12 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/project.js +419 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/release-driver.js +35 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/release.js +123 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/release.json +42 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/runner-install.js +254 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-bootstrap.ps1 +87 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-bootstrap.sh +107 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-downloads.tsv +13 -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 +71 -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 +26 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/signing.js +176 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/universal.cjs +29 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/updates.js +157 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/upgrade.js +102 -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 +137 -0
- package/vendor/node_modules/@legendapp/spark-cli/package.json +25 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/.claude/skills/spark/SKILL.md +9 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/AGENTS.md +4 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/App.tsx +23 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/CLAUDE.md +4 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/README.md +15 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/app.json +15 -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 +21 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/gitignore +9 -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 +102 -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 +59 -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 +59 -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 +27 -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 +25 -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 +23 -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 +27 -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 +47 -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 +15 -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 +63 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/.claude/skills/spark/SKILL.md +9 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/AGENTS.md +4 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/App.tsx +57 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/CLAUDE.md +4 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/README.md +15 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/app.json +19 -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 +64 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/gitignore +11 -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 +116 -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/.claude/skills/spark/SKILL.md +9 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/AGENTS.md +4 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/App.tsx +16 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/CLAUDE.md +4 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/README.md +15 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/app.json +15 -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 +9 -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 +103 -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 +81 -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 +63 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/src/expo.ts +22 -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/src/options.ts +8 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/src/types.ts +10 -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 +142 -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 +145 -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-codex/RNCodex.podspec +22 -0
- package/vendor/node_modules/@legendapp/spark-codex/cpp/HybridCodexAppServer.hpp +23 -0
- package/vendor/node_modules/@legendapp/spark-codex/cpp/HybridCodexAppServer.mm +1541 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitro.json +21 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/.gitattributes +1 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/ios/RNCodex+autolinking.rb +62 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/ios/RNCodex-Swift-Cxx-Bridge.cpp +17 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/ios/RNCodex-Swift-Cxx-Bridge.hpp +27 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/ios/RNCodex-Swift-Cxx-Umbrella.hpp +38 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/ios/RNCodexAutolinking.mm +35 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/ios/RNCodexAutolinking.swift +16 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/shared/c++/CodexAvailability.hpp +95 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/shared/c++/CodexRunResult.hpp +99 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/shared/c++/HybridCodexAppServerSpec.cpp +24 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/shared/c++/HybridCodexAppServerSpec.hpp +71 -0
- package/vendor/node_modules/@legendapp/spark-codex/package.json +35 -0
- package/vendor/node_modules/@legendapp/spark-codex/react-native.config.js +11 -0
- package/vendor/node_modules/@legendapp/spark-codex/src/Codex.nitro.ts +30 -0
- package/vendor/node_modules/@legendapp/spark-codex/src/index.ts +65 -0
- package/vendor/node_modules/@legendapp/spark-codex/src/native.ts +6 -0
- package/vendor/node_modules/@legendapp/spark-commands/package.json +21 -0
- package/vendor/node_modules/@legendapp/spark-commands/src/bindings.ts +90 -0
- package/vendor/node_modules/@legendapp/spark-commands/src/index.tsx +400 -0
- package/vendor/node_modules/@legendapp/spark-commands/src/router.ts +138 -0
- package/vendor/node_modules/@legendapp/spark-commands/src/storage.ts +20 -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 +159 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/package.json +47 -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 +113 -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 +27 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/cpp/SparkBinaryJSI.hpp +89 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/cpp/SparkBinaryWindows.hpp +22 -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 +60 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkBinaryJSI.h +48 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkDesktop.h +35 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkDesktop.mm +198 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkDesktopError.h +20 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkInstance.h +27 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkInstance.mm +207 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkLifecycle.h +26 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkLifecycle.mm +49 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkQuitCoordinator.h +9 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkQuitCoordinator.mm +70 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkTestDriver.h +44 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkTestDriver.mm +349 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkWindow.mm +86 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/recent-documents/RNRecentDocumentController.mm +55 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/package.json +41 -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 +121 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/contracts/accelerator.ts +40 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/contracts/index.ts +56 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/contracts/menu.ts +130 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/contracts/native-buffer.ts +22 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/contracts/path.ts +24 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/customize-hooks.ts +17 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/customize.ts +117 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/events.ts +75 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/index.ts +3 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/index.windows.ts +3 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/open-requests.ts +43 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/restoration.ts +11 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/transport.ts +10 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/accessibility-state.cjs +50 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/app.plugin.cjs +107 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/app.plugin.d.cts +3 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/autolinking.cjs +42 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/config.cjs +177 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/config.d.cts +113 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/customize-provider.cjs +16 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/customize.cjs +16 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/entitlements.cjs +23 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/expo.cjs +27 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/expo.d.cts +3 -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 +29 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/keyboard-events.cjs +44 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/lifecycle.cjs +20 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.cjs +106 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.d.cts +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/package.json +21 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/rtl-scroll-view.cjs +144 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/rtl-text-alignment.cjs +60 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/rtl-text-input-alignment.cjs +112 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/schema.json +636 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/test-driver.cjs +11 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/test-driver.d.cts +2 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/text-input-accessibility.cjs +47 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/updates.cjs +27 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/validation.cjs +36 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/windows.plugin.cjs +73 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/AppDelegate.mm +209 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/SparkCustomize.mm +517 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/package.json +14 -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 +849 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/windows/launch.inc +67 -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 +119 -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 +80 -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 +31 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/src/expo.ts +4 -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/src/native.ts +9 -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 +17 -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 +58 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/macos/keyboard-manager/RNKeyboardManager.h +12 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/macos/keyboard-manager/RNKeyboardManager.mm +307 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/package.json +46 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/src/NativeDesktopShortcuts.ts +8 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/src/api.ts +45 -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-shortcuts/src/keyboard-manager/NativeKeyboardManager.ts +12 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/src/keyboard-manager/codes.ts +108 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/src/keyboard-manager/index.ts +99 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/RNDesktopWindows.podspec +22 -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 +339 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/SparkWindowGeometry.h +63 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/LegendWindowRegistry.h +20 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/LegendWindowRegistry.mm +27 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/RNWindowManager.h +12 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/RNWindowManager.mm +3189 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/RNWindowManagerStartup.mm +31 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/SidebarStartupFallbacks.mm +14 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/package.json +48 -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 +192 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/diagnostics.ts +17 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/index.ts +3 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/index.windows.ts +3 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/macos-adapter.ts +55 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/macos.ts +51 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/transport.ts +41 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/types.ts +140 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/validation.ts +162 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/window-manager/NativeWindowManager.ts +28 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/WindowProvider.tsx +20 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/createWindowsNavigator.tsx +78 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/index.ts +6 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/primaryWindowLifecycle.ts +34 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/types.ts +11 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/usePrimaryWindowLifecycle.ts +18 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/useWindowFocusEffect.ts +17 -0
- package/vendor/node_modules/@legendapp/spark-documents/package.json +22 -0
- package/vendor/node_modules/@legendapp/spark-documents/src/controller.ts +97 -0
- package/vendor/node_modules/@legendapp/spark-documents/src/documentTransition.ts +13 -0
- package/vendor/node_modules/@legendapp/spark-documents/src/hooks.ts +139 -0
- package/vendor/node_modules/@legendapp/spark-documents/src/index.tsx +50 -0
- package/vendor/node_modules/@legendapp/spark-documents/src/reload.ts +39 -0
- package/vendor/node_modules/@legendapp/spark-documents/src/requests.ts +15 -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 +45 -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 +83 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/src/index.tsx +60 -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 +215 -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 +18 -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 +261 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/package.json +50 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/src/NativeFileDialog.ts +9 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/src/index.ts +36 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/src/native.ts +16 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/src/options.ts +74 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/src/types.ts +42 -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 +112 -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 +18 -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 +222 -0
- package/vendor/node_modules/@legendapp/spark-file-system/macos/SparkFileMutations.h +25 -0
- package/vendor/node_modules/@legendapp/spark-file-system/macos/SparkFileMutations.mm +216 -0
- package/vendor/node_modules/@legendapp/spark-file-system/macos/file-scanner/RNFileScanner.h +9 -0
- package/vendor/node_modules/@legendapp/spark-file-system/macos/file-scanner/RNFileScanner.mm +82 -0
- package/vendor/node_modules/@legendapp/spark-file-system/macos/file-scanner/RNFileScannerCore.h +47 -0
- package/vendor/node_modules/@legendapp/spark-file-system/macos/file-scanner/RNFileScannerCore.mm +306 -0
- package/vendor/node_modules/@legendapp/spark-file-system/package.json +49 -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/file-scanner/NativeFileScanner.ts +11 -0
- package/vendor/node_modules/@legendapp/spark-file-system/src/file-scanner/index.ts +93 -0
- package/vendor/node_modules/@legendapp/spark-file-system/src/handles.ts +79 -0
- package/vendor/node_modules/@legendapp/spark-file-system/src/index.ts +150 -0
- package/vendor/node_modules/@legendapp/spark-file-system/src/path.ts +1 -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 +371 -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 +146 -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 +18 -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 +68 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/package.json +47 -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/index.ts +45 -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 +81 -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-html/package.json +24 -0
- package/vendor/node_modules/@legendapp/spark-html/src/Html.tsx +22 -0
- package/vendor/node_modules/@legendapp/spark-html/src/HtmlInput.tsx +102 -0
- package/vendor/node_modules/@legendapp/spark-html/src/index.ts +4 -0
- package/vendor/node_modules/@legendapp/spark-html/src/types.ts +4 -0
- package/vendor/node_modules/@legendapp/spark-markdown/package.json +24 -0
- package/vendor/node_modules/@legendapp/spark-markdown/src/Markdown.tsx +25 -0
- package/vendor/node_modules/@legendapp/spark-markdown/src/MarkdownInput.tsx +111 -0
- package/vendor/node_modules/@legendapp/spark-markdown/src/index.ts +4 -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 +137 -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 +146 -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 +272 -0
- package/vendor/node_modules/@legendapp/spark-native-menu/package.json +46 -0
- package/vendor/node_modules/@legendapp/spark-native-menu/src/NativeMenu.ts +8 -0
- package/vendor/node_modules/@legendapp/spark-native-menu/src/api.ts +128 -0
- package/vendor/node_modules/@legendapp/spark-native-menu/src/hooks.ts +103 -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 +49 -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 +156 -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 +141 -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 +175 -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 +226 -0
- package/vendor/node_modules/@legendapp/spark-processes/package.json +47 -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 +135 -0
- package/vendor/node_modules/@legendapp/spark-processes/src/types.ts +34 -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 +220 -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 +145 -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-rich-text/package.json +18 -0
- package/vendor/node_modules/@legendapp/spark-rich-text/src/components.tsx +52 -0
- package/vendor/node_modules/@legendapp/spark-rich-text/src/index.ts +4 -0
- package/vendor/node_modules/@legendapp/spark-rich-text/src/types.ts +24 -0
- package/vendor/node_modules/@legendapp/spark-rich-text/src/useInputShortcuts.macos.ts +55 -0
- package/vendor/node_modules/@legendapp/spark-rich-text/src/useInputShortcuts.ts +13 -0
- package/vendor/node_modules/@legendapp/spark-rich-text/src/useInputValue.ts +14 -0
- package/vendor/node_modules/@legendapp/spark-rich-text/src/value.ts +16 -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 +62 -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 +26 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/src/expo.ts +13 -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 +7 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/src/unavailable.ts +8 -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 +20 -0
- package/vendor/node_modules/@legendapp/spark-settings/src/fileStorage.ts +11 -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 +17 -0
- package/vendor/node_modules/@legendapp/spark-settings/src/storage/index.ts +142 -0
- package/vendor/node_modules/@legendapp/spark-settings/src/store.ts +79 -0
- package/vendor/node_modules/@legendapp/spark-settings-ui/package.json +20 -0
- package/vendor/node_modules/@legendapp/spark-settings-ui/src/index.tsx +439 -0
- package/vendor/node_modules/@legendapp/spark-settings-ui/src/options.ts +10 -0
- package/vendor/node_modules/@legendapp/spark-sqlite/package.json +16 -0
- package/vendor/node_modules/@legendapp/spark-sqlite/src/database.ts +182 -0
- package/vendor/node_modules/@legendapp/spark-sqlite/src/index.ts +20 -0
- package/vendor/node_modules/@legendapp/spark-sqlite/src/types.ts +22 -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 +143 -0
- package/vendor/node_modules/@legendapp/spark-system/macos/SparkAppearancePreferences.h +9 -0
- package/vendor/node_modules/@legendapp/spark-system/macos/SparkAppearancePreferences.mm +31 -0
- package/vendor/node_modules/@legendapp/spark-system/macos/SparkDockTile.h +24 -0
- package/vendor/node_modules/@legendapp/spark-system/macos/SparkDockTile.mm +101 -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 +158 -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 +158 -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 +75 -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 +103 -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 +163 -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 +54 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkLayoutDirection.h +17 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkTextInput.h +4 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkTextInput.mm +58 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSidebarSplitViewComponent.h +15 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSidebarSplitViewComponent.mm +1554 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/glass-effect-view/RNGlassEffectView.mm +76 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/native-select/RNNativeSegmentedControl.h +15 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/native-select/RNNativeSegmentedControl.mm +198 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/native-select/RNNativeSelect.h +15 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/native-select/RNNativeSelect.mm +184 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/sf-symbol/RNSFSymbol.h +15 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/sf-symbol/RNSFSymbol.mm +159 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/sidebar/RNSidebar.h +18 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/sidebar/RNSidebar.mm +708 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/swipe-actions/RNSwipeActions.h +10 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/swipe-actions/RNSwipeActions.mm +446 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/text-input-search/RNTextInputSearch.h +15 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/text-input-search/RNTextInputSearch.mm +188 -0
- package/vendor/node_modules/@legendapp/spark-ui/package.json +74 -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 +12 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/SparkTextInputNativeComponent.ts +13 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SidebarSplitViewNativeComponent.ts +42 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/index.tsx +94 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/availability.ts +10 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/classnames/index.ts +8 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/control.ts +42 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/desktop.tsx +56 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/glass-effect-view/index.tsx +15 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/index.android.tsx +39 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/index.ios.tsx +59 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/index.tsx +1 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/index.web.tsx +54 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/index.windows.tsx +1 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/mobile-input.tsx +11 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/native-select/NativeSegmentedControlNativeComponent.ts +17 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/native-select/NativeSelectNativeComponent.ts +17 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/select.ts +9 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/sf-symbol/SFSymbolNativeComponent.ts +13 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/sf-symbol/index.tsx +27 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/sidebar/SidebarItemNativeComponent.ts +25 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/sidebar/SidebarNativeComponent.ts +29 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/sidebar/index.tsx +115 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/specialized.ts +22 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/swipe-actions/SwipeActionsNativeComponent.ts +11 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/swipe-actions/index.tsx +41 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/text-input-search/TextInputSearchNativeComponent.ts +33 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/text-input-search/index.tsx +34 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/types.ts +39 -0
- package/vendor/node_modules/@legendapp/spark-ui/uniwind.ts +10 -0
- package/vendor/node_modules/@legendapp/spark-ui/uniwind.web.ts +19 -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 +186 -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 +97 -0
- package/vendor/node_modules/@legendapp/spark-updates/macos/SparkUpdateState.h +39 -0
- package/vendor/node_modules/@legendapp/spark-updates/package.json +44 -0
- package/vendor/node_modules/@legendapp/spark-updates/src/NativeDesktopUpdates.ts +5 -0
- package/vendor/node_modules/@legendapp/spark-updates/src/index.ts +115 -0
- package/vendor/node_modules/@legendapp/spark-webview/package.json +15 -0
- package/vendor/node_modules/@legendapp/spark-webview/src/WebView.tsx +11 -0
- package/vendor/node_modules/@legendapp/spark-webview/src/adapter.ts +55 -0
- package/vendor/node_modules/@legendapp/spark-webview/src/index.ts +2 -0
- package/vendor/node_modules/@legendapp/spark-webview/src/types.ts +32 -0
- package/vendor/node_modules/@legendapp/spark-webview/src/view-props.ts +28 -0
- package/vendor/node_modules/@legendapp/spark-window-options/index.cjs +62 -0
- package/vendor/node_modules/@legendapp/spark-window-options/index.d.ts +25 -0
- package/vendor/node_modules/@legendapp/spark-window-options/package.json +12 -0
- package/webview.ts +1 -0
- package/windows-macos.ts +1 -0
- package/windows.ts +1 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
#import "RNSparkAudio.h"
|
|
2
|
+
#import <AVFoundation/AVFoundation.h>
|
|
3
|
+
#import <MediaPlayer/MediaPlayer.h>
|
|
4
|
+
/** Native observation exists only while the corresponding public status stream is observed. */
|
|
5
|
+
@interface SparkAudioObservation : NSObject
|
|
6
|
+
@property AVPlayer *player;
|
|
7
|
+
@property id timeObserver;
|
|
8
|
+
@property id endObserver;
|
|
9
|
+
@property NSArray<NSString *> *keys;
|
|
10
|
+
@property (copy) void (^notify)(void);
|
|
11
|
+
@property BOOL stopped;
|
|
12
|
+
- (instancetype)initWithPlayer:(AVPlayer *)player notify:(void (^)(void))notify;
|
|
13
|
+
- (instancetype)initWithPlayer:(AVPlayer *)player positionUpdates:(BOOL)positionUpdates notify:(void (^)(void))notify;
|
|
14
|
+
- (void)remove;
|
|
15
|
+
@end
|
|
16
|
+
@implementation SparkAudioObservation
|
|
17
|
+
- (instancetype)initWithPlayer:(AVPlayer *)player notify:(void (^)(void))notify {
|
|
18
|
+
return [self initWithPlayer:player positionUpdates:YES notify:notify];
|
|
19
|
+
}
|
|
20
|
+
- (instancetype)initWithPlayer:(AVPlayer *)player positionUpdates:(BOOL)positionUpdates notify:(void (^)(void))notify {
|
|
21
|
+
if (self = [super init]) {
|
|
22
|
+
self.player = player; self.notify = notify;
|
|
23
|
+
self.keys = positionUpdates ? @[@"status", @"timeControlStatus", @"volume", @"currentItem.status", @"currentItem.duration"] : @[@"status", @"currentItem.status"];
|
|
24
|
+
for (NSString *key in self.keys)
|
|
25
|
+
[player addObserver:self forKeyPath:key options:NSKeyValueObservingOptionNew context:nil];
|
|
26
|
+
__weak SparkAudioObservation *weakSelf = self;
|
|
27
|
+
if (positionUpdates) self.timeObserver = [player addPeriodicTimeObserverForInterval:CMTimeMake(1, 4) queue:dispatch_get_main_queue() usingBlock:^(CMTime time) {
|
|
28
|
+
SparkAudioObservation *owner = weakSelf; if (owner && !owner.stopped) owner.notify();
|
|
29
|
+
}];
|
|
30
|
+
if (positionUpdates) self.endObserver = [NSNotificationCenter.defaultCenter addObserverForName:AVPlayerItemDidPlayToEndTimeNotification object:player.currentItem queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification *event) {
|
|
31
|
+
SparkAudioObservation *owner = weakSelf; if (owner && !owner.stopped) owner.notify();
|
|
32
|
+
}];
|
|
33
|
+
}
|
|
34
|
+
return self;
|
|
35
|
+
}
|
|
36
|
+
- (void)observeValueForKeyPath:(NSString *)key ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
|
|
37
|
+
if (NSThread.isMainThread) { if (!self.stopped) self.notify(); }
|
|
38
|
+
else { __weak SparkAudioObservation *weakSelf = self; dispatch_async(dispatch_get_main_queue(), ^{ SparkAudioObservation *owner = weakSelf; if (owner && !owner.stopped) owner.notify(); }); }
|
|
39
|
+
}
|
|
40
|
+
- (void)remove {
|
|
41
|
+
if (self.stopped) return;
|
|
42
|
+
self.stopped = YES;
|
|
43
|
+
for (NSString *key in self.keys) [self.player removeObserver:self forKeyPath:key];
|
|
44
|
+
if (self.timeObserver) [self.player removeTimeObserver:self.timeObserver];
|
|
45
|
+
if (self.endObserver) [NSNotificationCenter.defaultCenter removeObserver:self.endObserver];
|
|
46
|
+
self.timeObserver = nil; self.endObserver = nil; self.notify = nil;
|
|
47
|
+
}
|
|
48
|
+
- (void)dealloc { [self remove]; }
|
|
49
|
+
@end
|
|
50
|
+
@interface RNSparkAudio ()
|
|
51
|
+
@property NSMutableDictionary<NSString *, AVPlayer *> *players;
|
|
52
|
+
@property NSString *activeID;
|
|
53
|
+
@property NSMutableDictionary<NSString *, NSDictionary *> *metadata;
|
|
54
|
+
@property NSMutableDictionary<NSString *, id> *targets;
|
|
55
|
+
@property NSString *sessionID;
|
|
56
|
+
@property NSMutableDictionary *session;
|
|
57
|
+
@property NSMutableDictionary<NSString *, SparkAudioObservation *> *observations;
|
|
58
|
+
@property NSMutableDictionary<NSString *, NSDictionary *> *lastStatuses;
|
|
59
|
+
@property NSMutableDictionary<NSString *, id> *endObservers;
|
|
60
|
+
@property NSMutableDictionary<NSString *, SparkAudioObservation *> *readiness;
|
|
61
|
+
@property NSMutableDictionary *readyRejects;
|
|
62
|
+
@property NSUInteger artworkGeneration;
|
|
63
|
+
@end
|
|
64
|
+
static NSDictionary *MediaInfo(NSDictionary *metadata) {
|
|
65
|
+
NSMutableDictionary *info = [NSMutableDictionary new];
|
|
66
|
+
if (metadata[@"title"]) info[MPMediaItemPropertyTitle] = metadata[@"title"];
|
|
67
|
+
if (metadata[@"artist"]) info[MPMediaItemPropertyArtist] = metadata[@"artist"];
|
|
68
|
+
if (metadata[@"albumTitle"]) info[MPMediaItemPropertyAlbumTitle] = metadata[@"albumTitle"];
|
|
69
|
+
return info;
|
|
70
|
+
}
|
|
71
|
+
static NSDictionary<NSString *, MPRemoteCommand *> *RemoteCommands() {
|
|
72
|
+
MPRemoteCommandCenter *center = MPRemoteCommandCenter.sharedCommandCenter;
|
|
73
|
+
return @{ @"play": center.playCommand, @"pause": center.pauseCommand, @"nextTrack": center.nextTrackCommand,
|
|
74
|
+
@"previousTrack": center.previousTrackCommand, @"seekTo": center.changePlaybackPositionCommand };
|
|
75
|
+
}
|
|
76
|
+
@interface RNSparkAudio ()
|
|
77
|
+
@end
|
|
78
|
+
@implementation RNSparkAudio
|
|
79
|
+
RCT_EXPORT_MODULE(NativeSparkAudio)
|
|
80
|
+
+ (BOOL)requiresMainQueueSetup { return YES; }
|
|
81
|
+
- (NSArray<NSString *> *)supportedEvents { return @[@"sparkMediaCommand", @"sparkAudioStatus"]; }
|
|
82
|
+
- (instancetype)init { if (self = [super init]) {
|
|
83
|
+
_players = [NSMutableDictionary new];
|
|
84
|
+
_metadata = [NSMutableDictionary new]; _targets = [NSMutableDictionary new];
|
|
85
|
+
_observations = [NSMutableDictionary new]; _lastStatuses = [NSMutableDictionary new]; _endObservers = [NSMutableDictionary new];
|
|
86
|
+
_readiness = [NSMutableDictionary new]; _readyRejects = [NSMutableDictionary new];
|
|
87
|
+
__weak RNSparkAudio *weakSelf = self;
|
|
88
|
+
[RemoteCommands() enumerateKeysAndObjectsUsingBlock:^(NSString *name, MPRemoteCommand *command, BOOL *stop) {
|
|
89
|
+
command.enabled = [@[@"play", @"pause", @"seekTo"] containsObject:name];
|
|
90
|
+
self.targets[name] = [command addTargetWithHandler:^MPRemoteCommandHandlerStatus(MPRemoteCommandEvent *event) {
|
|
91
|
+
RNSparkAudio *owner = weakSelf;
|
|
92
|
+
if (!owner) return MPRemoteCommandHandlerStatusNoSuchContent;
|
|
93
|
+
// Deliver on the main queue, serial with session updates and disposal.
|
|
94
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
95
|
+
if (owner.sessionID) {
|
|
96
|
+
if (![owner.session[@"commands"] containsObject:name]) return;
|
|
97
|
+
NSMutableDictionary *value = [@{@"command": name} mutableCopy];
|
|
98
|
+
if ([event isKindOfClass:MPChangePlaybackPositionCommandEvent.class]) value[@"position"] = @(((MPChangePlaybackPositionCommandEvent *)event).positionTime);
|
|
99
|
+
[owner sendEventWithName:@"sparkMediaCommand" body:@{@"id": owner.sessionID, @"value": value}];
|
|
100
|
+
} else {
|
|
101
|
+
AVPlayer *player = owner.players[owner.activeID ?: @""];
|
|
102
|
+
if ([name isEqual:@"play"]) [player play];
|
|
103
|
+
else if ([name isEqual:@"pause"]) [player pause];
|
|
104
|
+
else if ([event isKindOfClass:MPChangePlaybackPositionCommandEvent.class]) [player seekToTime:CMTimeMakeWithSeconds(((MPChangePlaybackPositionCommandEvent *)event).positionTime, 600)];
|
|
105
|
+
[owner publishPlayer:owner.activeID];
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
return MPRemoteCommandHandlerStatusSuccess;
|
|
109
|
+
}];
|
|
110
|
+
}];
|
|
111
|
+
} return self; }
|
|
112
|
+
- (NSDictionary *)statusForPlayer:(AVPlayer *)player {
|
|
113
|
+
double position = CMTimeGetSeconds(player.currentTime), duration = CMTimeGetSeconds(player.currentItem.duration);
|
|
114
|
+
if (!isfinite(position)) position = 0; if (!isfinite(duration)) duration = 0;
|
|
115
|
+
NSError *error = player.error ?: player.currentItem.error;
|
|
116
|
+
return @{ @"volume": @(player.volume), @"playing": @(player.timeControlStatus == AVPlayerTimeControlStatusPlaying), @"currentTime": @(position), @"duration": @(duration), @"didJustFinish": @(duration > 0 && position >= duration && player.rate == 0), @"error": error.localizedDescription ?: NSNull.null };
|
|
117
|
+
}
|
|
118
|
+
- (void)emitStatus:(NSString *)identifier {
|
|
119
|
+
AVPlayer *player = self.players[identifier]; if (!player || !self.observations[identifier]) return;
|
|
120
|
+
NSDictionary *status = [self statusForPlayer:player];
|
|
121
|
+
if ([self.lastStatuses[identifier] isEqual:status]) return;
|
|
122
|
+
self.lastStatuses[identifier] = status;
|
|
123
|
+
[self sendEventWithName:@"sparkAudioStatus" body:@{@"id": identifier, @"value": status}];
|
|
124
|
+
}
|
|
125
|
+
- (void)publishPlayer:(NSString *)identifier {
|
|
126
|
+
if (!identifier || self.sessionID || ![self.activeID isEqual:identifier]) return;
|
|
127
|
+
AVPlayer *player = self.players[identifier]; if (!player) return;
|
|
128
|
+
NSDictionary *status = [self statusForPlayer:player];
|
|
129
|
+
NSMutableDictionary *info = [MPNowPlayingInfoCenter.defaultCenter.nowPlayingInfo mutableCopy] ?: [NSMutableDictionary new];
|
|
130
|
+
info[MPMediaItemPropertyPlaybackDuration] = status[@"duration"]; info[MPNowPlayingInfoPropertyElapsedPlaybackTime] = status[@"currentTime"]; info[MPNowPlayingInfoPropertyPlaybackRate] = @(player.rate);
|
|
131
|
+
MPNowPlayingInfoCenter.defaultCenter.nowPlayingInfo = info;
|
|
132
|
+
MPNowPlayingInfoCenter.defaultCenter.playbackState = [status[@"playing"] boolValue] ? MPNowPlayingPlaybackStatePlaying : MPNowPlayingPlaybackStatePaused;
|
|
133
|
+
}
|
|
134
|
+
- (void)publishMetadata:(NSDictionary *)metadata {
|
|
135
|
+
NSMutableDictionary *info = [MediaInfo(metadata) mutableCopy];
|
|
136
|
+
MPNowPlayingInfoCenter.defaultCenter.nowPlayingInfo = info;
|
|
137
|
+
NSUInteger generation = ++self.artworkGeneration;
|
|
138
|
+
NSString *artwork = metadata[@"artworkUrl"];
|
|
139
|
+
if (!artwork.length) return;
|
|
140
|
+
NSURL *url = [artwork hasPrefix:@"/"] ? [NSURL fileURLWithPath:artwork] : [NSURL URLWithString:artwork];
|
|
141
|
+
__weak RNSparkAudio *weakSelf = self;
|
|
142
|
+
dispatch_async(dispatch_get_global_queue(QOS_CLASS_UTILITY, 0), ^{
|
|
143
|
+
NSData *data = [NSData dataWithContentsOfURL:url];
|
|
144
|
+
NSImage *image = data ? [[NSImage alloc] initWithData:data] : nil;
|
|
145
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
146
|
+
RNSparkAudio *owner = weakSelf;
|
|
147
|
+
if (!owner || generation != owner.artworkGeneration || !image) return;
|
|
148
|
+
NSMutableDictionary *current = [MPNowPlayingInfoCenter.defaultCenter.nowPlayingInfo mutableCopy];
|
|
149
|
+
current[MPMediaItemPropertyArtwork] = [[MPMediaItemArtwork alloc] initWithBoundsSize:image.size requestHandler:^NSImage *(CGSize size) { return image; }];
|
|
150
|
+
MPNowPlayingInfoCenter.defaultCenter.nowPlayingInfo = current;
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
- (void)publishSession {
|
|
155
|
+
NSMutableDictionary *info = [MPNowPlayingInfoCenter.defaultCenter.nowPlayingInfo mutableCopy] ?: [NSMutableDictionary new];
|
|
156
|
+
info[MPNowPlayingInfoPropertyElapsedPlaybackTime] = self.session[@"position"] ?: @0;
|
|
157
|
+
info[MPMediaItemPropertyPlaybackDuration] = self.session[@"duration"] ?: @0;
|
|
158
|
+
BOOL playing = [self.session[@"playbackState"] isEqual:@"playing"];
|
|
159
|
+
info[MPNowPlayingInfoPropertyPlaybackRate] = playing ? (self.session[@"playbackRate"] ?: @1) : @0;
|
|
160
|
+
MPNowPlayingInfoCenter.defaultCenter.nowPlayingInfo = info;
|
|
161
|
+
MPNowPlayingInfoCenter.defaultCenter.playbackState = playing ? MPNowPlayingPlaybackStatePlaying : [self.session[@"playbackState"] isEqual:@"stopped"] ? MPNowPlayingPlaybackStateStopped : MPNowPlayingPlaybackStatePaused;
|
|
162
|
+
[RemoteCommands() enumerateKeysAndObjectsUsingBlock:^(NSString *key, MPRemoteCommand *command, BOOL *stop) { command.enabled = [self.session[@"commands"] containsObject:key]; }];
|
|
163
|
+
}
|
|
164
|
+
- (void)call:(NSString *)method args:(NSString *)json resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
|
165
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
166
|
+
NSDictionary *args = [NSJSONSerialization JSONObjectWithData:[json dataUsingEncoding:NSUTF8StringEncoding] options:0 error:nil];
|
|
167
|
+
NSString *identifier = args[@"id"]; if (!identifier.length) { reject(@"E_AUDIO", @"Missing player id", nil); return; }
|
|
168
|
+
AVPlayer *player = self.players[identifier]; id result = NSNull.null;
|
|
169
|
+
if ([method hasPrefix:@"session"]) {
|
|
170
|
+
if ([method isEqual:@"sessionCreate"]) {
|
|
171
|
+
self.sessionID = identifier; self.session = [@{@"commands": @[@"play", @"pause"]} mutableCopy];
|
|
172
|
+
[self publishMetadata:args[@"metadata"] ?: @{}];
|
|
173
|
+
} else if (![self.sessionID isEqual:identifier] && [method isEqual:@"sessionRemove"]) { resolve(@"null"); return; }
|
|
174
|
+
else if (![self.sessionID isEqual:identifier]) { reject(@"E_CLOSED", @"Media session has been replaced", nil); return; }
|
|
175
|
+
if ([method isEqual:@"sessionCreate"] || [method isEqual:@"sessionUpdate"]) {
|
|
176
|
+
[self.session addEntriesFromDictionary:args];
|
|
177
|
+
if (args[@"metadata"]) [self publishMetadata:args[@"metadata"]];
|
|
178
|
+
[self publishSession];
|
|
179
|
+
} else if ([method isEqual:@"sessionRemove"]) {
|
|
180
|
+
self.sessionID = nil; self.session = nil; self.activeID = nil; ++self.artworkGeneration;
|
|
181
|
+
MPNowPlayingInfoCenter.defaultCenter.nowPlayingInfo = nil; MPNowPlayingInfoCenter.defaultCenter.playbackState = MPNowPlayingPlaybackStateStopped;
|
|
182
|
+
for (MPRemoteCommand *command in RemoteCommands().allValues) command.enabled = NO;
|
|
183
|
+
} else { reject(@"E_AUDIO", @"Unknown session operation", nil); return; }
|
|
184
|
+
} else if ([method isEqual:@"create"]) {
|
|
185
|
+
NSString *uri = args[@"uri"]; NSURL *url = [uri hasPrefix:@"/"] ? [NSURL fileURLWithPath:uri] : [NSURL URLWithString:uri];
|
|
186
|
+
if (!url || (!url.isFileURL && ![@[@"https", @"http"] containsObject:url.scheme])) { reject(@"E_AUDIO", @"Expected a local file or HTTP audio URL", nil); return; }
|
|
187
|
+
if (url.isFileURL && ![NSFileManager.defaultManager isReadableFileAtPath:url.path]) { reject(@"E_NOT_FOUND", @"Audio file is not readable", nil); return; }
|
|
188
|
+
self.players[identifier] = [AVPlayer playerWithURL:url]; self.metadata[identifier] = @{@"title": args[@"title"] ?: @"Music"};
|
|
189
|
+
__weak RNSparkAudio *weakSelf = self;
|
|
190
|
+
self.endObservers[identifier] = [NSNotificationCenter.defaultCenter addObserverForName:AVPlayerItemDidPlayToEndTimeNotification object:self.players[identifier].currentItem queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification *event) { [weakSelf publishPlayer:identifier]; }];
|
|
191
|
+
if (!self.sessionID) { self.activeID = identifier; [self publishMetadata:self.metadata[identifier]]; }
|
|
192
|
+
} else if (!player && [method isEqual:@"remove"]) { resolve(@"null"); return; }
|
|
193
|
+
else if (!player) { reject(@"E_AUDIO", @"Audio player is not available", nil); return; }
|
|
194
|
+
else if ([method isEqual:@"awaitReady"]) {
|
|
195
|
+
NSError *error = player.error ?: player.currentItem.error;
|
|
196
|
+
if (error) { reject(@"E_AUDIO", error.localizedDescription, error); return; }
|
|
197
|
+
if (player.currentItem.status == AVPlayerItemStatusReadyToPlay) { [self publishPlayer:identifier]; resolve(@"true"); return; }
|
|
198
|
+
if (self.readiness[identifier]) { reject(@"E_BUSY", @"Audio readiness is already pending", nil); return; }
|
|
199
|
+
__weak RNSparkAudio *weakSelf = self;
|
|
200
|
+
self.readyRejects[identifier] = reject;
|
|
201
|
+
self.readiness[identifier] = [[SparkAudioObservation alloc] initWithPlayer:player positionUpdates:NO notify:^{
|
|
202
|
+
RNSparkAudio *owner = weakSelf; AVPlayer *current = owner.players[identifier];
|
|
203
|
+
NSError *error = current.error ?: current.currentItem.error;
|
|
204
|
+
if (!owner || !current || (!error && current.currentItem.status != AVPlayerItemStatusReadyToPlay)) return;
|
|
205
|
+
[owner.readiness[identifier] remove]; [owner.readiness removeObjectForKey:identifier]; [owner.readyRejects removeObjectForKey:identifier];
|
|
206
|
+
if (error) reject(@"E_AUDIO", error.localizedDescription, error);
|
|
207
|
+
else { [owner publishPlayer:identifier]; resolve(@"true"); }
|
|
208
|
+
}];
|
|
209
|
+
// Readiness may have changed between the first check and installing KVO.
|
|
210
|
+
self.readiness[identifier].notify();
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
else if ([method isEqual:@"volume"]) { double volume = [args[@"volume"] doubleValue]; if (!isfinite(volume) || volume < 0 || volume > 1) { reject(@"E_AUDIO", @"Invalid volume", nil); return; } player.volume = volume; }
|
|
214
|
+
else if ([method isEqual:@"metadata"]) { self.metadata[identifier] = args[@"metadata"]; if (!self.sessionID && [self.activeID isEqual:identifier]) [self publishMetadata:self.metadata[identifier]]; }
|
|
215
|
+
else if ([method isEqual:@"play"]) {
|
|
216
|
+
if (!self.sessionID) { self.activeID = identifier; [self publishMetadata:self.metadata[identifier]]; for (NSString *key in RemoteCommands()) RemoteCommands()[key].enabled = [@[@"play", @"pause", @"seekTo"] containsObject:key]; }
|
|
217
|
+
[player play];
|
|
218
|
+
}
|
|
219
|
+
else if ([method isEqual:@"pause"]) [player pause];
|
|
220
|
+
else if ([method isEqual:@"seek"]) {
|
|
221
|
+
double seconds = [args[@"seconds"] doubleValue];
|
|
222
|
+
if (!isfinite(seconds) || seconds < 0) { reject(@"E_AUDIO", @"Invalid seek position", nil); return; }
|
|
223
|
+
[player seekToTime:CMTimeMakeWithSeconds(seconds, 600) toleranceBefore:kCMTimeZero toleranceAfter:kCMTimeZero completionHandler:^(BOOL finished) { dispatch_async(dispatch_get_main_queue(), ^{ if (finished) { [self publishPlayer:identifier]; [self emitStatus:identifier]; resolve(@"null"); } else reject(@"E_AUDIO", @"Seek was interrupted", nil); }); }]; return;
|
|
224
|
+
} else if ([method isEqual:@"status"]) {
|
|
225
|
+
result = [self statusForPlayer:player];
|
|
226
|
+
} else if ([method isEqual:@"statusUpdates"]) {
|
|
227
|
+
if ([args[@"enabled"] boolValue] && !self.observations[identifier]) {
|
|
228
|
+
__weak RNSparkAudio *weakSelf = self;
|
|
229
|
+
self.observations[identifier] = [[SparkAudioObservation alloc] initWithPlayer:player notify:^{ [weakSelf emitStatus:identifier]; }];
|
|
230
|
+
[self emitStatus:identifier];
|
|
231
|
+
} else if (![args[@"enabled"] boolValue]) { [self.observations[identifier] remove]; [self.observations removeObjectForKey:identifier]; [self.lastStatuses removeObjectForKey:identifier]; }
|
|
232
|
+
} else if ([method isEqual:@"remove"]) {
|
|
233
|
+
RCTPromiseRejectBlock cancelReady = self.readyRejects[identifier];
|
|
234
|
+
[self.readiness[identifier] remove]; [self.readiness removeObjectForKey:identifier]; [self.readyRejects removeObjectForKey:identifier];
|
|
235
|
+
if (cancelReady) cancelReady(@"E_CLOSED", @"Audio player was removed during loading", nil);
|
|
236
|
+
[self.observations[identifier] remove]; [self.observations removeObjectForKey:identifier]; [self.lastStatuses removeObjectForKey:identifier];
|
|
237
|
+
if (self.endObservers[identifier]) [NSNotificationCenter.defaultCenter removeObserver:self.endObservers[identifier]]; [self.endObservers removeObjectForKey:identifier];
|
|
238
|
+
[player pause]; [self.players removeObjectForKey:identifier]; [self.metadata removeObjectForKey:identifier]; if (!self.sessionID && [self.activeID isEqual:identifier]) { self.activeID = nil; ++self.artworkGeneration; MPNowPlayingInfoCenter.defaultCenter.nowPlayingInfo = nil; }
|
|
239
|
+
}
|
|
240
|
+
else { reject(@"E_AUDIO", @"Unknown audio operation", nil); return; }
|
|
241
|
+
if ([method isEqual:@"play"] || [method isEqual:@"pause"]) [self publishPlayer:identifier];
|
|
242
|
+
NSData *data = [NSJSONSerialization dataWithJSONObject:result options:NSJSONWritingFragmentsAllowed error:nil]; resolve([[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
- (void)invalidate { dispatch_async(dispatch_get_main_queue(), ^{
|
|
246
|
+
for (SparkAudioObservation *observation in self.readiness.allValues) [observation remove]; [self.readiness removeAllObjects];
|
|
247
|
+
for (RCTPromiseRejectBlock reject in self.readyRejects.allValues) reject(@"E_CLOSED", @"Audio module was invalidated during loading", nil); [self.readyRejects removeAllObjects];
|
|
248
|
+
for (SparkAudioObservation *observation in self.observations.allValues) [observation remove]; [self.observations removeAllObjects]; [self.lastStatuses removeAllObjects];
|
|
249
|
+
for (id token in self.endObservers.allValues) [NSNotificationCenter.defaultCenter removeObserver:token]; [self.endObservers removeAllObjects];
|
|
250
|
+
for (AVPlayer *player in self.players.allValues) [player pause];
|
|
251
|
+
[self.players removeAllObjects]; [self.metadata removeAllObjects]; ++self.artworkGeneration;
|
|
252
|
+
for (NSString *key in self.targets) [RemoteCommands()[key] removeTarget:self.targets[key]];
|
|
253
|
+
[self.targets removeAllObjects]; self.sessionID = nil; MPNowPlayingInfoCenter.defaultCenter.nowPlayingInfo = nil;
|
|
254
|
+
}); [super invalidate]; }
|
|
255
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params { return std::make_shared<facebook::react::NativeSparkAudioSpecJSI>(params); }
|
|
256
|
+
@end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@legendapp/spark-audio",
|
|
3
|
+
"version": "0.0.1-next.10",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"main": "src/index",
|
|
6
|
+
"react-native": "src/index",
|
|
7
|
+
"files": [
|
|
8
|
+
"src",
|
|
9
|
+
"macos",
|
|
10
|
+
"windows",
|
|
11
|
+
"*.podspec"
|
|
12
|
+
],
|
|
13
|
+
"peerDependencies": {
|
|
14
|
+
"react": "^19.1.0",
|
|
15
|
+
"react-native": "0.81.6",
|
|
16
|
+
"expo-audio": "1.1.1"
|
|
17
|
+
},
|
|
18
|
+
"peerDependenciesMeta": {
|
|
19
|
+
"expo-audio": {
|
|
20
|
+
"optional": true
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"codegenConfig": {
|
|
24
|
+
"name": "RNSparkAudioSpec",
|
|
25
|
+
"type": "modules",
|
|
26
|
+
"jsSrcsDir": "src",
|
|
27
|
+
"ios": {
|
|
28
|
+
"modulesProvider": {
|
|
29
|
+
"NativeSparkAudio": "RNSparkAudio"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"spark": {
|
|
34
|
+
"sdk": true,
|
|
35
|
+
"nativeModules": [
|
|
36
|
+
"NativeSparkAudio"
|
|
37
|
+
],
|
|
38
|
+
"pod": "RNSparkAudio",
|
|
39
|
+
"platforms": [
|
|
40
|
+
"macos",
|
|
41
|
+
"windows",
|
|
42
|
+
"ios",
|
|
43
|
+
"android",
|
|
44
|
+
"web"
|
|
45
|
+
],
|
|
46
|
+
"requires": []
|
|
47
|
+
},
|
|
48
|
+
"private": true,
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@legendapp/spark-desktop-app": "0.0.1-next.10"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TurboModuleRegistry, type TurboModule } from "react-native";
|
|
2
|
+
export interface Spec extends TurboModule {
|
|
3
|
+
call(method: string, args: string): Promise<string>;
|
|
4
|
+
addListener(eventName: string): void;
|
|
5
|
+
removeListeners(count: number): void;
|
|
6
|
+
}
|
|
7
|
+
export default TurboModuleRegistry.get<Spec>("NativeSparkAudio");
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { SparkError, invokeNative, parseNativeResult } from "@legendapp/spark-desktop-app/src/contracts";
|
|
2
|
+
import { playerHandle, validatePlayerOptions, waitForAudio } from "./player";
|
|
3
|
+
export { createMediaSession } from "./media-session";
|
|
4
|
+
export type * from "./media-types";
|
|
5
|
+
import Native from "./NativeSparkAudio";
|
|
6
|
+
import { onAudioEvent } from "./events";
|
|
7
|
+
import { validateSource, type AudioPlayer, type AudioSource, type AudioPlayerOptions, type AudioStatus } from "./types";
|
|
8
|
+
export type { AudioPlayer, AudioSource, AudioStatus, AudioPlayerOptions, Subscription } from "./types";
|
|
9
|
+
let sequence = 0;
|
|
10
|
+
export async function createAudioPlayer(source: AudioSource, options: AudioPlayerOptions = {}): Promise<AudioPlayer> {
|
|
11
|
+
validateSource(source); validatePlayerOptions(options);
|
|
12
|
+
options = { ...options };
|
|
13
|
+
source = { ...source };
|
|
14
|
+
if (!Native) throw new SparkError("E_MODULE_UNAVAILABLE", "Audio requires a client with @legendapp/spark-audio");
|
|
15
|
+
const native = Native, id = `audio-${Date.now()}-${++sequence}`;
|
|
16
|
+
const call = async (method: string, args = {}): Promise<unknown> => parseNativeResult(await invokeNative(() => native.call(method, JSON.stringify({ id, ...args }))), (value): value is unknown => true);
|
|
17
|
+
const command = async (method: string, args = {}) => { if (await call(method, args) !== null) throw new SparkError("E_INVALID_DATA", "Invalid audio command result"); };
|
|
18
|
+
try {
|
|
19
|
+
await command("create", source);
|
|
20
|
+
// The native promise settles on AVPlayer/MediaPlayer readiness; no JS polling.
|
|
21
|
+
await waitForAudio(async () => { const ready = await call("awaitReady"); if (ready !== true) throw new SparkError("E_INVALID_DATA", "Invalid audio readiness"); return true; }, options);
|
|
22
|
+
} catch (cause) {
|
|
23
|
+
try { await command("remove"); } catch (cleanup) { throw new SparkError("E_NATIVE", "Audio loading and cleanup failed", { cause: new AggregateError([cause, cleanup]) }); }
|
|
24
|
+
throw cause;
|
|
25
|
+
}
|
|
26
|
+
return playerHandle({
|
|
27
|
+
setVolume: volume => command("volume", { volume }),
|
|
28
|
+
setMetadata: metadata => command("metadata", { metadata: metadata ?? {} }),
|
|
29
|
+
play: () => command("play"), pause: () => command("pause"),
|
|
30
|
+
seekTo: seconds => command("seek", { seconds }),
|
|
31
|
+
getStatus: async () => await call("status") as AudioStatus,
|
|
32
|
+
addStatusListener(listener) {
|
|
33
|
+
let active = true;
|
|
34
|
+
const subscription = onAudioEvent("sparkAudioStatus", id, value => { if (active) listener(value as AudioStatus); });
|
|
35
|
+
void command("statusUpdates", { enabled: true }).catch(error => { if (active) console.error(error); });
|
|
36
|
+
return { remove() { active = false; subscription.remove(); void command("statusUpdates", { enabled: false }).catch(console.error); } };
|
|
37
|
+
},
|
|
38
|
+
remove: () => command("remove"),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { useAudioPlayer } from "./hooks";
|
|
43
|
+
export type { AudioPlayerState, AudioPlayerHookOptions } from "./hooks";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NativeEventEmitter } from "react-native";
|
|
2
|
+
import { SparkError, type Subscription } from "@legendapp/spark-desktop-app/src/contracts";
|
|
3
|
+
import Native from "./NativeSparkAudio";
|
|
4
|
+
|
|
5
|
+
/** Private audio transport. Install before native setup so readiness cannot lose events. */
|
|
6
|
+
export function onAudioEvent(name: "sparkAudioStatus" | "sparkMediaCommand", id: string, listener: (value: unknown) => void): Subscription {
|
|
7
|
+
if (!Native) throw new SparkError("E_MODULE_UNAVAILABLE", "The audio module is unavailable");
|
|
8
|
+
return new NativeEventEmitter(Native).addListener(name, (event: unknown) => {
|
|
9
|
+
if (event && typeof event === "object" && (event as { id?: unknown }).id === id) listener((event as { value?: unknown }).value);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
2
|
+
import { createAudioPlayer } from "./index";
|
|
3
|
+
import type { AudioPlayer, AudioPlayerOptions, AudioSource } from "./types";
|
|
4
|
+
|
|
5
|
+
export type AudioPlayerState = { status: "loading" } | { status: "ready"; player: AudioPlayer } | { status: "error"; error: unknown };
|
|
6
|
+
export interface AudioPlayerHookOptions extends AudioPlayerOptions {
|
|
7
|
+
/** Cleanup failures cannot update an unmounted component. The player permits retry. */
|
|
8
|
+
onCleanupError?(error: unknown, player: AudioPlayer): void;
|
|
9
|
+
}
|
|
10
|
+
type OwnedPlayer = { player: AudioPlayer; removing?: Promise<void> };
|
|
11
|
+
type Lifecycle = { tail: Promise<void>; owner?: OwnedPlayer };
|
|
12
|
+
/** Owns one player for this source. Creation occurs in an effect, never during render. */
|
|
13
|
+
export function useAudioPlayer(source: AudioSource, options: AudioPlayerHookOptions = {}): AudioPlayerState {
|
|
14
|
+
const { uri, title } = source;
|
|
15
|
+
const { loadTimeoutMs, signal, onCleanupError } = options;
|
|
16
|
+
const cleanupError = useRef(onCleanupError);
|
|
17
|
+
const lifecycleRef = useRef<Lifecycle | null>(null);
|
|
18
|
+
if (!lifecycleRef.current) lifecycleRef.current = { tail: Promise.resolve() };
|
|
19
|
+
const lifecycle = lifecycleRef.current;
|
|
20
|
+
useLayoutEffect(() => { cleanupError.current = onCleanupError; }, [onCleanupError]);
|
|
21
|
+
const [current, setCurrent] = useState<{ uri: string; title?: string; loadTimeoutMs?: number; signal?: AbortSignal; state: AudioPlayerState }>();
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
const controller = new AbortController();
|
|
24
|
+
let disposed = false, owned: OwnedPlayer | undefined;
|
|
25
|
+
const abort = () => controller.abort();
|
|
26
|
+
signal?.addEventListener("abort", abort, { once: true });
|
|
27
|
+
if (signal?.aborted) abort();
|
|
28
|
+
const set = (state: AudioPlayerState) => { if (!disposed) setCurrent({ uri, title, loadTimeoutMs, signal, state }); };
|
|
29
|
+
set({ status: "loading" });
|
|
30
|
+
const remove = (owner: OwnedPlayer) => {
|
|
31
|
+
if (!owner.removing) owner.removing = owner.player.remove().then(() => {
|
|
32
|
+
if (lifecycle.owner === owner) lifecycle.owner = undefined;
|
|
33
|
+
}).catch(error => {
|
|
34
|
+
try {
|
|
35
|
+
if (cleanupError.current) cleanupError.current(error, owner.player);
|
|
36
|
+
else console.error(error, owner.player);
|
|
37
|
+
} catch (callbackError) { console.error(callbackError); }
|
|
38
|
+
throw error;
|
|
39
|
+
}).finally(() => { owner.removing = undefined; });
|
|
40
|
+
return owner.removing;
|
|
41
|
+
};
|
|
42
|
+
const creation = lifecycle.tail.then(async () => {
|
|
43
|
+
if (disposed) return;
|
|
44
|
+
try {
|
|
45
|
+
if (lifecycle.owner) await remove(lifecycle.owner);
|
|
46
|
+
} catch (error) { set({ status: "error", error }); return; }
|
|
47
|
+
if (disposed) return;
|
|
48
|
+
try {
|
|
49
|
+
const player = await createAudioPlayer({ uri, title }, { loadTimeoutMs, signal: controller.signal });
|
|
50
|
+
owned = { player };
|
|
51
|
+
lifecycle.owner = owned;
|
|
52
|
+
if (!disposed) set({ status: "ready", player });
|
|
53
|
+
} catch (error) { set({ status: "error", error }); }
|
|
54
|
+
});
|
|
55
|
+
lifecycle.tail = creation;
|
|
56
|
+
return () => {
|
|
57
|
+
disposed = true;
|
|
58
|
+
controller.abort();
|
|
59
|
+
signal?.removeEventListener("abort", abort);
|
|
60
|
+
const cleanup = creation.then(async () => { if (owned) await remove(owned).catch(() => {}); });
|
|
61
|
+
lifecycle.tail = cleanup;
|
|
62
|
+
};
|
|
63
|
+
}, [uri, title, loadTimeoutMs, signal]);
|
|
64
|
+
return current && current.uri === uri && current.title === title && current.loadTimeoutMs === loadTimeoutMs && current.signal === signal ? current.state : { status: "loading" };
|
|
65
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./mobile";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./mobile";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./desktop";
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { SparkError } from "@legendapp/spark-desktop-app/src/contracts";
|
|
2
|
+
import { playerHandle, validatePlayerOptions, waitForAudio } from "./player";
|
|
3
|
+
import { hasExplicitMediaSession, claimPlayerMediaSession, ownsPlayerMediaSession, releasePlayerMediaSession } from "./media-session.web";
|
|
4
|
+
export { createMediaSession } from "./media-session.web";
|
|
5
|
+
export type * from "./media-types";
|
|
6
|
+
import { validateSource, type AudioPlayer, type AudioSource, type AudioPlayerOptions, type AudioStatus } from "./types";
|
|
7
|
+
export type { AudioPlayer, AudioSource, AudioStatus, AudioPlayerOptions, Subscription } from "./types";
|
|
8
|
+
export { useAudioPlayer } from "./hooks";
|
|
9
|
+
export type { AudioPlayerState, AudioPlayerHookOptions } from "./hooks";
|
|
10
|
+
|
|
11
|
+
const SEEK_TIMEOUT_MS = 10_000;
|
|
12
|
+
|
|
13
|
+
export async function createAudioPlayer(source: AudioSource, options: AudioPlayerOptions = {}): Promise<AudioPlayer> {
|
|
14
|
+
validateSource(source); validatePlayerOptions(options);
|
|
15
|
+
options = { ...options };
|
|
16
|
+
source = { ...source };
|
|
17
|
+
if (typeof Audio === "undefined") throw new SparkError("E_UNSUPPORTED_PLATFORM", "Browser audio is unavailable");
|
|
18
|
+
const audio = new Audio(source.uri);
|
|
19
|
+
audio.preload = "auto";
|
|
20
|
+
const media = typeof navigator === "undefined" ? undefined : navigator.mediaSession;
|
|
21
|
+
let cancelPendingSeek: ((error: SparkError) => void) | undefined;
|
|
22
|
+
let removeRequested = false;
|
|
23
|
+
const statusValue = (): AudioStatus => ({ playing: !audio.paused, currentTime: audio.currentTime, duration: Number.isFinite(audio.duration) ? audio.duration : 0, didJustFinish: audio.ended, error: audio.error?.message ?? null, volume: audio.volume });
|
|
24
|
+
async function dispose() {
|
|
25
|
+
audio.pause(); audio.removeAttribute("src"); audio.load();
|
|
26
|
+
if (media && ownsPlayerMediaSession(audio)) {
|
|
27
|
+
for (const action of ["play", "pause", "seekto"] as const) media.setActionHandler(action, null);
|
|
28
|
+
media.metadata = null; releasePlayerMediaSession(audio);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
await waitForAudio(async () => { if (audio.error) throw new SparkError("E_NATIVE", audio.error.message || "Could not load audio"); return audio.readyState >= 1; }, options, notify => {
|
|
33
|
+
audio.addEventListener("loadedmetadata", notify); audio.addEventListener("error", notify);
|
|
34
|
+
return { remove() { audio.removeEventListener("loadedmetadata", notify); audio.removeEventListener("error", notify); } };
|
|
35
|
+
});
|
|
36
|
+
if (media && !hasExplicitMediaSession()) {
|
|
37
|
+
claimPlayerMediaSession(audio);
|
|
38
|
+
media.metadata = new MediaMetadata({ title: source.title ?? "Music" });
|
|
39
|
+
media.setActionHandler("play", () => { void audio.play().catch(console.error); });
|
|
40
|
+
media.setActionHandler("pause", () => audio.pause());
|
|
41
|
+
media.setActionHandler("seekto", event => { if (event.seekTime !== undefined) audio.currentTime = event.seekTime; });
|
|
42
|
+
}
|
|
43
|
+
} catch (cause) {
|
|
44
|
+
try { await dispose(); } catch (cleanup) { throw new SparkError("E_NATIVE", "Audio loading and cleanup failed", { cause: new AggregateError([cause, cleanup]) }); }
|
|
45
|
+
throw cause;
|
|
46
|
+
}
|
|
47
|
+
const player = playerHandle({
|
|
48
|
+
async setVolume(volume) { audio.volume = volume; },
|
|
49
|
+
async setMetadata(metadata) {
|
|
50
|
+
const value = metadata ?? {};
|
|
51
|
+
if (media && ownsPlayerMediaSession(audio)) media.metadata = new MediaMetadata({ title: value.title, artist: value.artist, album: value.albumTitle, artwork: value.artworkUrl ? [{ src: value.artworkUrl }] : [] });
|
|
52
|
+
},
|
|
53
|
+
async play() { await audio.play(); }, async pause() { audio.pause(); },
|
|
54
|
+
async seekTo(seconds) {
|
|
55
|
+
if (removeRequested) throw new SparkError("E_CLOSED", "Audio player was removed during seek");
|
|
56
|
+
if (audio.error) throw new SparkError("E_NATIVE", audio.error.message || "Could not seek audio", { cause: audio.error });
|
|
57
|
+
if (!audio.seeking && audio.currentTime === seconds) return;
|
|
58
|
+
await new Promise<void>((resolve, reject) => {
|
|
59
|
+
let settled = false;
|
|
60
|
+
const finish = (error?: SparkError) => {
|
|
61
|
+
if (settled) return;
|
|
62
|
+
settled = true;
|
|
63
|
+
clearTimeout(timeout);
|
|
64
|
+
audio.removeEventListener("seeked", onSeeked);
|
|
65
|
+
audio.removeEventListener("error", onError);
|
|
66
|
+
audio.removeEventListener("emptied", onEmptied);
|
|
67
|
+
if (cancelPendingSeek === cancel) cancelPendingSeek = undefined;
|
|
68
|
+
if (error) reject(error); else resolve();
|
|
69
|
+
};
|
|
70
|
+
const onSeeked = () => { if (!audio.seeking) finish(); };
|
|
71
|
+
const onError = () => finish(new SparkError("E_NATIVE", audio.error?.message || "Could not seek audio", { cause: audio.error }));
|
|
72
|
+
const onEmptied = () => finish(new SparkError("E_CLOSED", "Audio source was removed during seek"));
|
|
73
|
+
const cancel = (error: SparkError) => finish(error);
|
|
74
|
+
const timeout = setTimeout(() => finish(new SparkError("E_TIMEOUT", "Browser audio seek did not complete before timeout")), SEEK_TIMEOUT_MS);
|
|
75
|
+
audio.addEventListener("seeked", onSeeked);
|
|
76
|
+
audio.addEventListener("error", onError);
|
|
77
|
+
audio.addEventListener("emptied", onEmptied);
|
|
78
|
+
cancelPendingSeek = cancel;
|
|
79
|
+
try { audio.currentTime = seconds; }
|
|
80
|
+
catch (cause) { finish(new SparkError("E_NATIVE", "Failed to seek browser audio", { cause })); }
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
async getStatus() { return statusValue(); },
|
|
84
|
+
addStatusListener(listener) {
|
|
85
|
+
const events = ["playing", "pause", "timeupdate", "ended", "durationchange", "volumechange", "error", "seeked"];
|
|
86
|
+
const notify = () => listener(statusValue());
|
|
87
|
+
for (const event of events) audio.addEventListener(event, notify);
|
|
88
|
+
notify();
|
|
89
|
+
return { remove() { for (const event of events) audio.removeEventListener(event, notify); } };
|
|
90
|
+
},
|
|
91
|
+
remove: dispose,
|
|
92
|
+
});
|
|
93
|
+
return {
|
|
94
|
+
...player,
|
|
95
|
+
remove() {
|
|
96
|
+
removeRequested = true;
|
|
97
|
+
cancelPendingSeek?.(new SparkError("E_CLOSED", "Audio player was removed during seek"));
|
|
98
|
+
return player.remove();
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./desktop";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SparkError } from "@legendapp/spark-desktop-app/src/contracts";
|
|
2
|
+
import { sessionOptions, type MediaSession, type MediaSessionOptions } from "./media-types";
|
|
3
|
+
/** Expo Audio cannot attach an external playback engine to its transport controls. */
|
|
4
|
+
export async function createMediaSession(options: MediaSessionOptions): Promise<MediaSession> {
|
|
5
|
+
sessionOptions(options);
|
|
6
|
+
throw new SparkError("E_UNSUPPORTED_PLATFORM", "Standalone media sessions require desktop or web; mobile uses the player's controls");
|
|
7
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import Native from "./NativeSparkAudio";
|
|
2
|
+
import { onAudioEvent } from "./events";
|
|
3
|
+
import { SparkError, invokeNative, parseNativeResult } from "@legendapp/spark-desktop-app/src/contracts";
|
|
4
|
+
import { sessionOptions, sessionSnapshot, validMediaCommand, type MediaCommand, type MediaSession, type MediaSessionOptions } from "./media-types";
|
|
5
|
+
let owner: (() => void) | undefined, sequence = 0;
|
|
6
|
+
let queue: Promise<unknown> = Promise.resolve();
|
|
7
|
+
function enqueue<T>(operation: () => Promise<T>): Promise<T> {
|
|
8
|
+
const result = queue.catch(() => {}).then(operation); queue = result; return result;
|
|
9
|
+
}
|
|
10
|
+
/** One explicit session owns system controls. New sessions replace the previous owner. */
|
|
11
|
+
export async function createMediaSession(options: MediaSessionOptions): Promise<MediaSession> {
|
|
12
|
+
const state = sessionOptions(options);
|
|
13
|
+
const { onCommand, onError = console.error } = options;
|
|
14
|
+
if (!Native) throw new SparkError("E_MODULE_UNAVAILABLE", "Media sessions require @legendapp/spark-audio");
|
|
15
|
+
const native = Native, id = `media-${Date.now()}-${++sequence}`;
|
|
16
|
+
let stopped = false, removed = false, ready = false, removal: Promise<void> | undefined;
|
|
17
|
+
const buffered: MediaCommand[] = [];
|
|
18
|
+
const call = async <T>(method: string, args: object, validate: (value: unknown) => value is T) => parseNativeResult(await invokeNative(() => native.call(method, JSON.stringify({ id, ...args }))), validate);
|
|
19
|
+
const command = async (method: string, args = {}) => { await call(method, args, (value): value is null => value === null); };
|
|
20
|
+
const stop = () => { stopped = true; buffered.length = 0; subscription.remove(); };
|
|
21
|
+
const deliver = (value: unknown) => {
|
|
22
|
+
if (stopped) return;
|
|
23
|
+
if (!validMediaCommand(value)) { stop(); onError(new SparkError("E_INVALID_DATA", "Invalid media command")); return; }
|
|
24
|
+
if (!ready) { if (buffered.length < 128) buffered.push(value); return; }
|
|
25
|
+
if (owner !== stop) return;
|
|
26
|
+
try { onCommand(value); } catch (error) { onError(error); }
|
|
27
|
+
};
|
|
28
|
+
const subscription = onAudioEvent("sparkMediaCommand", id, deliver);
|
|
29
|
+
try { await enqueue(async () => {
|
|
30
|
+
try { await command("sessionCreate", state); }
|
|
31
|
+
catch (cause) {
|
|
32
|
+
try { await command("sessionRemove"); } catch (cleanup) { throw new SparkError("E_NATIVE", "Media creation and cleanup failed", { cause: new AggregateError([cause, cleanup]) }); }
|
|
33
|
+
throw cause;
|
|
34
|
+
}
|
|
35
|
+
owner?.(); owner = stop; ready = true;
|
|
36
|
+
for (const value of buffered.splice(0)) deliver(value);
|
|
37
|
+
}); } catch (error) { stop(); throw error; }
|
|
38
|
+
return {
|
|
39
|
+
async update(patch) {
|
|
40
|
+
if (stopped || owner !== stop) throw new SparkError("E_CLOSED", "Media session has been removed or replaced");
|
|
41
|
+
const snapshot = sessionSnapshot(patch);
|
|
42
|
+
await enqueue(async () => {
|
|
43
|
+
if (owner !== stop) throw new SparkError("E_CLOSED", "Media session has been replaced");
|
|
44
|
+
await command("sessionUpdate", snapshot);
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
remove() {
|
|
48
|
+
if (removed) return Promise.resolve();
|
|
49
|
+
if (removal) return removal;
|
|
50
|
+
stop();
|
|
51
|
+
removal = enqueue(async () => {
|
|
52
|
+
if (owner === stop) { await command("sessionRemove"); owner = undefined; }
|
|
53
|
+
removed = true;
|
|
54
|
+
}).finally(() => { removal = undefined; });
|
|
55
|
+
return removal;
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|