Skip to main content

Module asset_picker

Module asset_picker 

Source
Expand description

素材选择 modal(封面上「从素材库选择」)。 素材选择 modal(封面/头像「从素材库选择」、正文编辑器「素材库」插图共用)。

网格展示素材库(默认最新排序,支持文件名/alt 搜索)。 单选模式(默认):单击选中即回填并关闭,供封面/头像使用。 多选模式(multi: true,正文插图):单击切换勾选态(跨页/搜索保留), 底部确认栏按勾选顺序批量回填。 内嵌「上传新图」入口(复用 upload_image_file),上传成功后留在网格中供用户选择 (多选模式下自动加入选中集——上传即意图)。 纯 Dioxus 组件,不触碰 Tiptap;数据加载仅在 WASM 前端发生。

Re-exports§

pub use AssetPickerModal_completions::Component::AssetPickerModal;

Structs§

AssetPickerModalProps
Properties for the AssetPickerModal component.
AssetSelection
素材选中载荷:on_select 的回传单元。

Constants§

ASSETS_PER_PAGE 🔒
每页素材数,与素材管理页及服务端列表接口保持一致。
EXIT_ANIM_MS 🔒
关闭过渡时长,与 input.css 的 modal-overlay / modal-panel 过渡保持一致。

Functions§

AssetPickerModal
素材选择 modal。
toggle_selection 🔒
切换素材勾选态:已选(按 URL 判重)则移除,未选则按点击顺序追加。