mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-22 21:48:12 +08:00
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:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user