Add a dropdown for resource selection and adopt it in the 'Image' node (#4543)

* Add a dropdown for resource selection and adopt it in the Image node

* Route every image upload through a new ResourceUpload handler with desktop support and migrate wired 'Image' node inputs

* Show each resource's user count in the resource picker dropdown

* Send a picked resource file to the document that requested it, list every non-font resource in the picker, and link sibling message docs
This commit is contained in:
Keavon Chambers
2026-09-18 18:14:24 -07:00
committed by GitHub
parent cb30348215
commit f90bef159c
34 changed files with 774 additions and 180 deletions
+16
View File
@@ -240,6 +240,22 @@ impl EditorWrapper {
cfg!(debug_assertions)
}
/// The file extensions of raster images the editor decodes itself (web only; on desktop, dropped files are imported natively and this is never called)
#[cfg(all(feature = "web", not(feature = "native")))]
#[wasm_bindgen(js_name = rasterImageExtensions)]
pub fn raster_image_extensions(&self) -> Vec<String> {
editor::messages::portfolio::resource_upload::utility_types::RASTER_IMAGE_EXTENSIONS
.iter()
.map(|extension| extension.to_string())
.collect()
}
#[cfg(feature = "native")]
#[wasm_bindgen(js_name = rasterImageExtensions)]
pub fn raster_image_extensions(&self) -> Vec<String> {
log::error!("rasterImageExtensions is unavailable on desktop, where dropped files are imported natively");
Vec::new()
}
/// Load persisted browser storage state (web only; on desktop, persistence is handled natively and this is never triggered)
#[cfg(all(feature = "web", not(feature = "native")))]
#[wasm_bindgen(js_name = loadPersistedState)]