feat: standalone save/load routing + VITE_DOC_SOURCE ydoc mode
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
07863da416
commit
8131bf9bac
19 changed files with 735 additions and 62 deletions
|
|
@ -394,6 +394,19 @@ extern "C" void kicadCollabOnModify()
|
|||
}
|
||||
|
||||
|
||||
// C++ → JS save notification (standalone-hardening save routing). Called from the
|
||||
// kicad fork's save chokepoint (PL_EDITOR_FRAME::SaveDrawingSheetFile) after a
|
||||
// successful write to MEMFS, so the web app can route the saved bytes onward
|
||||
// (API upload, local-disk write-back, download). No-op without a JS listener.
|
||||
extern "C" void kicadCollabOnSave( const char* aPath )
|
||||
{
|
||||
EM_ASM( {
|
||||
if( window.kicadCollab && window.kicadCollab.onSave )
|
||||
window.kicadCollab.onSave( UTF8ToString( $0 ) );
|
||||
}, aPath );
|
||||
}
|
||||
|
||||
|
||||
// JS pull of the full current model as an all-"added" delta, used to seed the Y.Doc on
|
||||
// join and to (re)baseline the differ. Idempotent.
|
||||
std::string kicadCollabSnapshot()
|
||||
|
|
|
|||
Loading…
Reference in a new issue