Add a stable native-host JS-API on window.gitmost so the gitmost.app WKWebView wrapper can hand a recorded audio file to the current page as an audio block without depending on editor internals (atoms/Tiptap/Yjs). - page-editor.tsx: register/tear down window.gitmost only while an editable page editor is mounted (ready=true, version=1). insertRecording validates mime/size, decodes base64 in 4-char-aligned chunks, rejects oversized payloads before decoding (too-large), reuses the existing uploadAudioAction pipeline, resolves machine-readable error codes (no-editor/bad-type/too-large/insert-failed) and never throws. Cleanup is identity-guarded so an unmounting PageEditor cannot disable a newer live registration. - editor-ext audio-upload: return the uploaded attachment from the upload fn so the bridge can report success + attachmentId. Backward compatible: existing fire-and-forget callers ignore the return value; the error path still swallows and returns undefined (no re-throw). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level
parserOptionsproperty like this:
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
- Replace
plugin:@typescript-eslint/recommendedtoplugin:@typescript-eslint/recommended-type-checkedorplugin:@typescript-eslint/strict-type-checked - Optionally add
plugin:@typescript-eslint/stylistic-type-checked - Install eslint-plugin-react and add
plugin:react/recommended&plugin:react/jsx-runtimeto theextendslist