mirror of
https://github.com/storytold/figcraft.git
synced 2026-10-29 21:06:50 -06:00
* M8: widgets take text input and a property menu Plugin API 4 (gap 6). A widget's text layer can be an editable field: a double-click edits it like any text, and when editing ends the value (cleaned, at most 1,000 characters) goes into the widget's state under the field's name and its plugin redraws, as one undo step. A widget can also carry a property menu of up to 8 actions, toggles and colour choices, shown in a small bar over it while it's selected. - widget.setText and widget.menu drive the same paths from scripts, the CLI and MCP; widget.insert/list also report fields and menu - descriptions, values and stored menus are validated as untrusted; an API 3 plugin drawing a field or menu is refused, older hosts refuse API 4 manifests; no new host imports - SDK reads the new events; the Counter example gains a label field and a menu (reset, steps of ten, a colour) - tests for fields, menus, canvas editing, rollback, forged data and live sync; junk sweep extended; labels in every command catalog - docs: plugins, mcp, gaps, target-app-parity, ROADMAP, roadmap * M8: widget property menu on egui 0.37 Id::new and Ui::id are deprecated in egui 0.37: the widget bar's area uses Id::unique and its buttons' interaction ids come from ui.scope_id(). * M11: a double-click a board object or a widget field takes, in a function of its own (Sonar)
26 lines
1000 B
Rust
26 lines
1000 B
Rust
//! FigCraft plugins: the manifest (`figcraft-plugin.json`) and the WebAssembly sandbox a plugin
|
|
//! runs in, and the widget descriptions a plugin hands back. The engine decides what a plugin may
|
|
//! do (its permissions, which commands it may call, one undo step per run, panel or widget
|
|
//! callback, where settings are kept); this crate only runs modules safely: a metered interpreter
|
|
//! with a memory cap, no WASI and a handful of host functions. See `docs/plugins.md`.
|
|
|
|
pub mod bundle;
|
|
pub mod manifest;
|
|
mod sandbox;
|
|
pub mod widget;
|
|
|
|
pub use manifest::{API_VERSION, Access, MANIFEST_FILE, Manifest, Panel, Param, ParamKind, Permissions, PluginCommand};
|
|
pub use sandbox::{ENTRY, Host, IMPORT_MODULE, Instance, Limits, PluginError, RunOutput, UiChange, check_module, run};
|
|
pub use widget::{MenuItem, MenuKind, WidgetKind, WidgetNode, WidgetRender};
|
|
|
|
#[cfg(test)]
|
|
mod bundle_tests;
|
|
#[cfg(test)]
|
|
mod save_file_tests;
|
|
#[cfg(test)]
|
|
mod tests;
|
|
#[cfg(test)]
|
|
mod v2_tests;
|
|
#[cfg(test)]
|
|
mod widget_tests;
|