refactor: externalize local upload helpers

Add local-upload-runtime.js as a browser runtime module for upload and attachment helper functions, with sidebar fallback wrappers and a fixed runtime asset route.

While validating task479, fix the editor attachment delete path so DOM-selected local attachment links are mapped back to a Tiptap text selection before delete_selection(), preserving undo history and adjacent links.
This commit is contained in:
lix-2026
2026-05-24 22:42:53 +08:00
parent 418f8ff8b0
commit 0a03572601
10 changed files with 353 additions and 19 deletions
+4
View File
@@ -98,6 +98,10 @@ pub fn build_router(state: AppState) -> Router {
"/api/mnote-browser-runtime/resource-open-runtime.js",
get(web_shell::resource_open_runtime_asset),
)
.route(
"/api/mnote-browser-runtime/local-upload-runtime.js",
get(web_shell::local_upload_runtime_asset),
)
.route(
"/api/mnote-browser-runtime/tree-live-controller.js",
get(web_shell::tree_live_controller_runtime_asset),