Plug-ins: invisible notices are refused, and batch steps show their notice

A filter's `notice` made only of default-ignorable characters that the
host keeps as they are (U+034F combining grapheme joiner, the Hangul
fillers, variation selectors, invisible operators, tags and the like) was
accepted and showed an empty status message. Such a notice now refuses the
output, as one of only zero-width characters already did. The visible
character must also fall within the part the status bar shows: a notice
whose visible text comes after the 200-character cut is refused instead of
showing only the ellipsis. Text with a visible character keeps these
characters, and its bidirectional ones are still escaped.

A painted live effect that returned `notice` was refused and drew its
input unchanged, while the docs said the key is ignored. The painted
decoder now ignores a top-level `notice` and still refuses any other
unknown top-level key; the message and its catalog rows say so.

A plug-in step of an action or a `command.batch` now shows its notice in
the status bar too; when several steps report one, the last shows. The
run's result carries `pluginName`, the name of the plug-in that ran, next
to `notice`, so the status bar names the right plug-in even when a later
step of the batch removes or replaces it. The `plugin.run` and plug-in
command params text lists the new keys.

Docs: docs/plugins.md, docs/mcp.md.
This commit is contained in:
dotCooCoo committed 2026-11-22 02:58:47 -08:00
1 parent 875bde4841
commit 891dc8006d
35 files changed
+187 -61

No files matched your search

+8 -6
View File
@@ -359,9 +359,10 @@ impl FilterRun {
if let Some(cmd) = &self.command {
out["command"] = json!(cmd.id);
}
// Only an output that was applied reports its notice.
// Only an output that was applied reports its notice, with the name of the plug-in that ran.
if let Some(notice) = notice {
out["notice"] = json!(notice);
out["pluginName"] = json!(m.name);
}
Ok(out)
}
@@ -377,8 +378,9 @@ fn not_granted(name: &str, permission: Permission) -> EngineError {
/// parameters and `_context` (what it keeps with the document included), and applies its output as
/// one undo step ([`objects::apply_output`]; effect records as [`admit_effects`] admits them), with
/// what it keeps with the document from now on: the output handed in for this very run when there
/// is one ([`FilterRun::hand_in`]), else the plug-in's, run now. → `{plugin, ids, notice?}`: what it
/// made or changed, which is then selected, and the output's `notice` once it was applied.
/// is one ([`FilterRun::hand_in`]), else the plug-in's, run now. → `{plugin, ids, notice?,
/// pluginName?}`: what it made or changed, which is then selected, and the output's `notice` once it
/// was applied, with the plug-in's name.
fn run(s: &mut Session, p: &Value) -> Result<Value> {
// An output handed in is for this run only (the app hands it in just before), whatever it does.
let handed = s.plugin_output.take();
@@ -488,7 +490,7 @@ fn spec_of(p: &Plugin, c: &Command) -> &'static CommandSpec {
fields.push_str(own);
}
let params = format!(
"{{{fields}}} run “{label}”, a command of plug-in {}, on the selected paths and compound paths as plugin.run runs a filter, with _context.command {:?}: one undo step → {{plugin, command, ids, notice?}}",
"{{{fields}}} run “{label}”, a command of plug-in {}, on the selected paths and compound paths as plugin.run runs a filter, with _context.command {:?}: one undo step → {{plugin, command, ids, notice?, pluginName?}} (pluginName, the plug-in's name, comes with notice)",
m.id, c.id
);
let mut made = MADE.lock().unwrap_or_else(|e| e.into_inner());
@@ -521,7 +523,7 @@ fn unrouted(_: &mut Session, _: &Value) -> Result<Value> {
/// Runs plug-in command `id` (`plugin.<plug-in id>.<command id>`): a filter run of the plug-in on
/// `ids` (else the selection) with the command's own parameters, checked before it runs, and
/// `_context.command`, under the plug-in's permissions and budget, applied as one undo step named
/// after the command → `{plugin, command, ids, notice?}`. A run that fails (a trap, an exhausted
/// after the command → `{plugin, command, ids, notice?, pluginName?}`. A run that fails (a trap, an exhausted
/// budget, an output it may not make) leaves the document as it was, and the error names the
/// plug-in and the command.
pub(crate) fn run_command(s: &mut Session, id: &str, p: &Value) -> Result<Value> {
@@ -1293,7 +1295,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Run Plug-in",
[],
None,
"{id, params?: {…} (the plug-in's parameters; or give them as top-level keys; missing ones take their defaults, see plugin.info), ids?: [object id] (left out or null: the selection), …the plug-in's parameters as top-level keys} run an object filter on the selected paths and compound paths (inside selected groups and layers too; hidden, locked, guide and clipping paths, compound paths that clip a clip group and paths inside a group that clips one are left out): it may change, delete or add objects, as one undo step; the result is selected, except the objects it locked or made guides. A filter whose manifest lists inputs (type, image, symbolInstance; it lists doc.read in permissions, so plugin.install needs grant) is also given the selected objects of those kinds to read, in paint order from the bottom, with at most 16 MiB of pixels and 16 MiB of type runs per run (an object that doesn't fit what the objects before it left comes with pixelsOmitted or truncated; an image that reaches the decoder counts toward the pixels even when decoding fails); every object counts toward the input's half of the plug-in's memory cap, ids, bounds, transforms and names included, and an object whose fields besides its pixels and runs don't fit fails the run with a memory-budget error naming it and its size (a path or compound path fails it with the memory-budget error for a selection too large to hand over), and more than 100,000 of these objects fail it with an object-budget error: its output returns each as {id} or exactly as given, or the run is refused and nothing changes. With nothing selected it gets no objects (generators add theirs to the current layer). A filter with a commandAllowlist runs the commands it names while it runs (vc_call, see docs/plugins.md): its calls and its output are one undo step, and a run that fails or makes a call that fails changes nothing → {plugin, ids}",
"{id, params?: {…} (the plug-in's parameters; or give them as top-level keys; missing ones take their defaults, see plugin.info), ids?: [object id] (left out or null: the selection), …the plug-in's parameters as top-level keys} run an object filter on the selected paths and compound paths (inside selected groups and layers too; hidden, locked, guide and clipping paths, compound paths that clip a clip group and paths inside a group that clips one are left out): it may change, delete or add objects, as one undo step; the result is selected, except the objects it locked or made guides. A filter whose manifest lists inputs (type, image, symbolInstance; it lists doc.read in permissions, so plugin.install needs grant) is also given the selected objects of those kinds to read, in paint order from the bottom, with at most 16 MiB of pixels and 16 MiB of type runs per run (an object that doesn't fit what the objects before it left comes with pixelsOmitted or truncated; an image that reaches the decoder counts toward the pixels even when decoding fails); every object counts toward the input's half of the plug-in's memory cap, ids, bounds, transforms and names included, and an object whose fields besides its pixels and runs don't fit fails the run with a memory-budget error naming it and its size (a path or compound path fails it with the memory-budget error for a selection too large to hand over), and more than 100,000 of these objects fail it with an object-budget error: its output returns each as {id} or exactly as given, or the run is refused and nothing changes. With nothing selected it gets no objects (generators add theirs to the current layer). A filter with a commandAllowlist runs the commands it names while it runs (vc_call, see docs/plugins.md): its calls and its output are one undo step, and a run that fails or makes a call that fails changes nothing → {plugin, ids, notice?, pluginName?} (notice: the text the output reports in its notice key once applied, escaped and cut at 200 characters; pluginName: the plug-in's name, with it)",
has_doc,
run
),
+4 -2
View File
@@ -204,7 +204,7 @@ fn failing_plugins_leave_the_document_and_history_alone() {
}
/// A filter's output may report a `notice`, which `plugin.run` returns once the output is applied,
/// escaped and capped by the host. It needs no permission: a filter granted none reports one too.
/// escaped and capped by the host, with the plug-in's name as `pluginName`. It needs no permission: a filter granted none reports one too.
/// A `notice` that is not a string refuses the output, and the document and history stay as they
/// were.
#[test]
@@ -215,6 +215,7 @@ fn a_filter_s_notice_is_returned_once_its_output_is_applied() {
install(&mut s, &asking(quiet, "[]", &json!({"objects": [], "notice": "Nothing to tidy"})));
let r = run(&mut s, "plugin.run", json!({"id": quiet}));
assert_eq!((&r["plugin"], &r["notice"]), (&json!(quiet), &json!("Nothing to tidy")));
assert_eq!(r["pluginName"], json!(format!("Test {quiet}")));
let reading = |s: &mut Session, id: &str, output: &Value| {
let data = vectorcraft_format::base64_encode(&asking(id, r#"["doc.read"]"#, output));
run(s, "plugin.install", json!({"dataBase64": data, "grant": ["doc.read"], "replace": true}))
@@ -227,7 +228,8 @@ fn a_filter_s_notice_is_returned_once_its_output_is_applied() {
assert_eq!(shown.chars().count(), vectorcraft_plugins::objects::MAX_NOTICE_CHARS);
let plain = "test.engine.notice.plain";
reading(&mut s, plain, &json!({"objects": [{"id": id}]}));
assert!(run(&mut s, "plugin.run", json!({"id": plain, "ids": [id]})).get("notice").is_none());
let r = run(&mut s, "plugin.run", json!({"id": plain, "ids": [id]}));
assert!(r.get("notice").is_none() && r.get("pluginName").is_none(), "{r}");
let bad = "test.engine.notice.bad";
install(&mut s, &asking(bad, "[]", &json!({"objects": [], "notice": 3})));
let before = s.doc().unwrap().doc.clone();
+52 -4
View File
@@ -833,17 +833,65 @@ pub fn decode_output_with(bytes: &[u8], input: &[u8], read_only: &ReadOnlySpans)
/// The `notice` of output `v`: `None` when it has none (or `null`), else its text without the
/// white space around it, as [`crate::permissions::display_text`] shows plug-in text (control,
/// bidirectional formatting and separator characters escaped) and at most [`MAX_NOTICE_CHARS`]
/// characters. A `notice` that is not a string, or has no character besides white space, control
/// and zero-width ones, is an error.
/// characters. A `notice` that is not a string, or whose shown part has no character besides white
/// space, control characters and the default-ignorable characters the host does not escape, is an
/// error.
pub fn decode_notice(v: &Value) -> Result<Option<String>> {
let shows = |c: char| !c.is_whitespace() && !c.is_control() && !matches!(c, '\u{00AD}' | '\u{200B}'..='\u{200D}' | '\u{2060}' | '\u{FEFF}');
match v.get("notice") {
None | Some(Value::Null) => Ok(None),
Some(Value::String(s)) if s.chars().any(shows) => Ok(Some(crate::permissions::display_text(s.trim(), MAX_NOTICE_CHARS))),
Some(Value::String(s)) if shown_part_is_visible(s.trim()) => Ok(Some(crate::permissions::display_text(s.trim(), MAX_NOTICE_CHARS))),
Some(_) => Err(Error::Output("`notice` must be a string with visible text".into())),
}
}
/// Does the part of notice `s` that [`crate::permissions::display_text`] keeps within
/// [`MAX_NOTICE_CHARS`], escapes counted and room left for the `…` when it cuts, hold a character
/// that draws something?
fn shown_part_is_visible(s: &str) -> bool {
let shows = |c: char| !c.is_whitespace() && !c.is_control() && !draws_nothing(c);
let width = |c: char| crate::permissions::display_text(c.encode_utf8(&mut [0; 4]), usize::MAX).chars().count();
// Characters written through the end of `c`, and through the first visible character.
let mut used = 0;
let mut visible_by = None;
for c in s.chars() {
used += width(c);
if visible_by.is_none() && shows(c) {
visible_by = Some(used);
}
if used > MAX_NOTICE_CHARS {
break;
}
}
visible_by.is_some_and(|end| used <= MAX_NOTICE_CHARS || end < MAX_NOTICE_CHARS)
}
/// Is `c` one of Unicode's default-ignorable characters (soft hyphen, zero-width and invisible
/// characters, fillers, variation selectors, tags) that [`crate::permissions::display_text`] keeps
/// as it is, so it draws nothing? The bidirectional ones it escapes are not among them.
fn draws_nothing(c: char) -> bool {
matches!(
c,
'\u{00AD}'
| '\u{034F}'
| '\u{115F}'
| '\u{1160}'
| '\u{17B4}'
| '\u{17B5}'
| '\u{180B}'..='\u{180F}'
| '\u{200B}'..='\u{200D}'
| '\u{2060}'..='\u{2065}'
| '\u{206A}'..='\u{206F}'
| '\u{3164}'
| '\u{FE00}'..='\u{FE0F}'
| '\u{FEFF}'
| '\u{FFA0}'
| '\u{FFF0}'..='\u{FFF8}'
| '\u{1BCA0}'..='\u{1BCA3}'
| '\u{1D173}'..='\u{1D17A}'
| '\u{E0000}'..='\u{E0FFF}'
)
}
/// Parses a plug-in's objects: `{"objects": [...]}`, or `{"error": "message"}` when the plug-in
/// declined (the message reaches the user). A live effect's other keys don't matter.
pub fn decode(bytes: &[u8]) -> Result<Vec<OutObject>> {
+20 -1
View File
@@ -1196,9 +1196,28 @@ fn notice_is_escaped_capped_and_checked() {
// Escapes count toward the limit, so a notice of right-to-left overrides stays within it too.
let escaped = out(Some(json!("\u{202E}".repeat(10_000)))).unwrap().unwrap_or_default();
assert!(escaped.chars().count() <= MAX_NOTICE_CHARS && !escaped.contains('\u{202E}'), "{escaped}");
for bad in [json!(""), json!(" \t\n "), json!("\u{200B}\u{FEFF}"), json!(12), json!(["a"]), json!({"text": "a"}), json!(true)] {
for bad in [
json!(""),
json!(" \t\n "),
json!("\u{200B}\u{FEFF}"),
json!("\u{034F}"),
json!("\u{3164}\u{FE0F}\u{E0041}"),
// The visible text comes after the cut, so the status bar would show only the `…`.
json!(format!("{}AB", "\u{200B}".repeat(MAX_NOTICE_CHARS - 1))),
json!(format!("{}A", "\u{7}".repeat(MAX_NOTICE_CHARS / 8))),
json!(12),
json!(["a"]),
json!({"text": "a"}),
json!(true),
] {
assert!(matches!(out(Some(bad.clone())), Err(Error::Output(ref e)) if e.contains("`notice`")), "{bad}");
}
// Text with a visible character keeps the invisible ones, and its bidirectional ones escaped.
assert_eq!(out(Some(json!("\u{2067}Done\u{034F}"))).unwrap().as_deref(), Some("\\u{2067}Done\u{034F}"));
// A visible character in the last place the limit shows, whole or before the `…`, is enough.
let pad = "\u{200B}".repeat(MAX_NOTICE_CHARS - 2);
assert_eq!(out(Some(json!(format!("{pad}\u{200B}A")))).unwrap(), Some(format!("{pad}\u{200B}A")));
assert_eq!(out(Some(json!(format!("{pad}ABC")))).unwrap(), Some(format!("{pad}A…")));
// A decline is still a decline.
assert!(matches!(decode_output(br#"{"error": "No pens.", "notice": "Done"}"#), Err(Error::Failed(_))));
}
+4 -4
View File
@@ -47,8 +47,8 @@ pub enum Scope {
}
/// Parses and checks a painted result: `{"objects": [...]}`, or `{"error": "message"}` when the
/// plug-in declined. `rule` is the fill rule a piece without `fillRule` takes. Any other top-level
/// key, an unknown key in a piece, stroke or paint, a list or count past its limit, a number out of
/// plug-in declined. `rule` is the fill rule a piece without `fillRule` takes. A top-level `notice`
/// is ignored. Any other top-level key, an unknown key in a piece, stroke or paint, a list or count past its limit, a number out of
/// range or a paint of the wrong form refuses the whole result, naming the field.
pub fn decode(bytes: &[u8], scope: Scope, rule: FillRule) -> Result<Vec<Piece>> {
let v: Value = serde_json::from_slice(bytes).map_err(|e| out_err("output", format!("not JSON: {e}")))?;
@@ -56,8 +56,8 @@ pub fn decode(bytes: &[u8], scope: Scope, rule: FillRule) -> Result<Vec<Piece>>
return Err(e);
}
let top = v.as_object().ok_or_else(|| out_err("output", "expected {\"objects\": [...]}"))?;
if let Some(k) = top.keys().find(|k| !matches!(k.as_str(), "objects" | "error")) {
return Err(out_err(k, "a painted live effect returns only `objects`"));
if let Some(k) = top.keys().find(|k| !matches!(k.as_str(), "objects" | "error" | "notice")) {
return Err(out_err(k, "a painted live effect returns only `objects` and `notice`"));
}
let objects = top.get("objects").and_then(Value::as_array).ok_or_else(|| out_err("objects", "expected {\"objects\": [...]}"))?;
if objects.len() > MAX_OBJECTS {
+15
View File
@@ -154,6 +154,21 @@ fn faults_refuse_the_whole_result_by_field() {
assert_eq!(declined, Error::Failed("nothing to do".into()));
}
/// A top-level `notice` is ignored, as a filter-only key a live effect may hand back; other
/// unknown top-level keys still refuse the result.
#[test]
fn a_notice_is_ignored_and_other_top_level_keys_refused() {
let ok = json!({"path": square(), "fills": [red()]});
let decode_top = |top: Value| decode(&serde_json::to_vec(&top).unwrap(), Scope::Object, FillRule::NonZero);
let pieces = decode_top(json!({"objects": [ok], "notice": "Done"})).unwrap();
assert_eq!(pieces.len(), 1);
assert_eq!(decode_top(json!({"objects": [ok], "notice": 12})).unwrap().len(), 1);
for key in ["note", "notices", "message"] {
let e = decode_top(json!({"objects": [ok], key: "Done"})).unwrap_err().to_string();
assert!(e.contains(&format!("{key}:")) && e.contains("returns only `objects` and `notice`"), "{key}: {e}");
}
}
/// A key a paint does not have, at any level of it, refuses the result and is named; it is not
/// dropped.
#[test]
+15 -3
View File
@@ -1026,9 +1026,21 @@ fn plugin_notice_shows_after_the_plug_in_s_name_and_is_never_translated() {
app.status("");
assert!(app.run("plugin.run", json!({"id": bad})).is_err());
assert!(!app.ui.status.starts_with("Plug-in “"), "{}", app.ui.status);
for id in [id, bad] {
app.run("plugin.remove", json!({"id": id})).unwrap();
}
// A plug-in step of a batch, as an action plays it, shows its notice too.
app.status("");
app.replay("command.batch", json!({"commands": [{"command": "plugin.run", "params": {"id": id}}, {"command": "select.none"}]})).unwrap();
assert_eq!(app.ui.status, format!("Plug-in “Test {id}”: invalid array length"));
// A batch without a plug-in step leaves the status bar as it is.
app.status("kept");
app.run("command.batch", json!({"commands": [{"command": "select.none"}]})).unwrap();
assert_eq!(app.ui.status, "kept");
// The notice keeps the plug-in's name when a later step of the batch removes the plug-in.
app.status("");
let run_and_remove = json!({"commands": [{"command": "plugin.run", "params": {"id": id}}, {"command": "plugin.remove", "params": {"id": id}}]});
app.run("command.batch", run_and_remove).unwrap();
assert!(vectorcraft_plugins::registry::get(id).is_none());
assert_eq!(app.ui.status, format!("Plug-in “Test {id}”: invalid array length"));
app.run("plugin.remove", json!({"id": bad})).unwrap();
}
/// The message of an open that starts with a line about its linked files lists the open's notes on
+1 -1
View File
@@ -7763,7 +7763,7 @@ variable-list-end {0}, {1} {0} i {1}
@msg a list of {min_items} to {max_items} numbers una llista de {min_items} a {max_items} nombres
@msg a new object needs a `path` un objecte nou necessita un `path`
@msg a number un nombre
@msg a painted live effect returns only `objects` un efecte dinàmic de pintura només retorna `objects`
@msg a painted live effect returns only `objects` and `notice` un efecte dinàmic de pintura només retorna `objects` i `notice`
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` una peça d’un efecte dinàmic de pintura només té `path`, `fillRule`, `fills` i `strokes`
@msg a read-only object was left out s’ha omès un objecte de només lectura
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given s’ha omès un objecte de només lectura: retorneu-lo com a {{"id": …}} sol o tal com s’ha rebut
Can't render this file because it is too large.
+1 -1
View File
@@ -7373,7 +7373,7 @@ axis Y Axis osa Y
@msg a list of {min_items} to {max_items} numbers seznam {min_items} až {max_items} čísel
@msg a new object needs a `path` nový objekt potřebuje `path`
@msg a number číslo
@msg a painted live effect returns only `objects` malující živý efekt vrací jen `objects`
@msg a painted live effect returns only `objects` and `notice` malující živý efekt vrací jen `objects` a `notice`
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` část malujícího živého efektu má jen `path`, `fillRule`, `fills` a `strokes`
@msg a read-only object was left out objekt jen pro čtení byl vynechán
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given objekt jen pro čtení byl vynechán: vraťte ho jako samotné {{"id": …}} nebo tak, jak byl předán
Can't render this file because it is too large.
+1 -1
View File
@@ -604,7 +604,7 @@ liquify-list-end {0}, {1} {0} og {1}
@msg a list of {min_items} to {max_items} numbers en liste med {min_items} til {max_items} tal
@msg a new object needs a `path` et nyt objekt kræver en `path`
@msg a number et tal
@msg a painted live effect returns only `objects` en malet live-effekt returnerer kun `objects`
@msg a painted live effect returns only `objects` and `notice` en malet live-effekt returnerer kun `objects` og `notice`
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` et stykke fra en malet live-effekt har kun `path`, `fillRule`, `fills` og `strokes`
@msg a read-only object was left out et skrivebeskyttet objekt blev udeladt
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given et skrivebeskyttet objekt blev udeladt: returnér det, som {{"id": …}} alene eller som det blev givet
Can't render this file because it is too large.
+1 -1
View File
@@ -6956,7 +6956,7 @@ axis Y Axis Y-Achse
@msg a list of {min_items} to {max_items} numbers eine Liste von {min_items} bis {max_items} Zahlen
@msg a new object needs a `path` ein neues Objekt braucht einen `path`
@msg a number eine Zahl
@msg a painted live effect returns only `objects` ein malender Live-Effekt gibt nur `objects` zurück
@msg a painted live effect returns only `objects` and `notice` ein malender Live-Effekt gibt nur `objects` und `notice` zurück
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` ein Teil eines malenden Live-Effekts hat nur `path`, `fillRule`, `fills` und `strokes`
@msg a read-only object was left out ein schreibgeschütztes Objekt wurde weggelassen
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given ein schreibgeschütztes Objekt wurde weggelassen: Geben Sie es zurück, als {{"id": …}} allein oder so, wie es übergeben wurde
Can't render this file because it is too large.
+1 -1
View File
@@ -7363,7 +7363,7 @@ axis Y Axis Άξονας Y
@msg a list of {min_items} to {max_items} numbers λίστα {min_items} έως {max_items} αριθμών
@msg a new object needs a `path` ένα νέο αντικείμενο χρειάζεται `path`
@msg a number αριθμός
@msg a painted live effect returns only `objects` ένα ζωντανό εφέ βαφής επιστρέφει μόνο `objects`
@msg a painted live effect returns only `objects` and `notice` ένα ζωντανό εφέ βαφής επιστρέφει μόνο `objects` και `notice`
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` ένα κομμάτι ζωντανού εφέ βαφής έχει μόνο `path`, `fillRule`, `fills` και `strokes`
@msg a read-only object was left out παραλείφθηκε ένα αντικείμενο μόνο για ανάγνωση
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given παραλείφθηκε ένα αντικείμενο μόνο για ανάγνωση: επιστρέψτε το ως {{"id": …}} μόνο ή όπως δόθηκε
Can't render this file because it is too large.
+1 -1
View File
@@ -7349,7 +7349,7 @@ axis Y Axis Eje Y
@msg a list of {min_items} to {max_items} numbers una lista de {min_items} a {max_items} números
@msg a new object needs a `path` un objeto nuevo necesita un `path`
@msg a number un número
@msg a painted live effect returns only `objects` un efecto dinámico de pintura solo devuelve `objects`
@msg a painted live effect returns only `objects` and `notice` un efecto dinámico de pintura solo devuelve `objects` y `notice`
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` una pieza de un efecto dinámico de pintura solo tiene `path`, `fillRule`, `fills` y `strokes`
@msg a read-only object was left out se omitió un objeto de solo lectura
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given se omitió un objeto de solo lectura: devuélvalo como {{"id": …}} solo o tal como se recibió
Can't render this file because it is too large.
+1 -1
View File
@@ -7440,7 +7440,7 @@ axis Y Axis Y-akseli
@msg a list of {min_items} to {max_items} numbers {min_items}-{max_items} luvun luettelo
@msg a new object needs a `path` uusi objekti tarvitsee kentän `path`
@msg a number luku
@msg a painted live effect returns only `objects` maalaava live-tehoste palauttaa vain kentän `objects`
@msg a painted live effect returns only `objects` and `notice` maalaava live-tehoste palauttaa vain kentät `objects` ja `notice`
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` maalaavan live-tehosteen osalla on vain `path`, `fillRule`, `fills` ja `strokes`
@msg a read-only object was left out vain luku -objekti jätettiin pois
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given vain luku -objekti jätettiin pois: palauta se pelkkänä {{"id": …}}-muotona tai sellaisena kuin se annettiin
Can't render this file because it is too large.
+1 -1
View File
@@ -7369,7 +7369,7 @@ axis Y Axis Axe Y
@msg a list of {min_items} to {max_items} numbers une liste de {min_items} à {max_items} nombres
@msg a new object needs a `path` un nouvel objet nécessite un `path`
@msg a number un nombre
@msg a painted live effect returns only `objects` un effet dynamique de peinture renvoie seulement `objects`
@msg a painted live effect returns only `objects` and `notice` un effet dynamique de peinture renvoie seulement `objects` et `notice`
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` une pièce d’un effet dynamique de peinture a seulement `path`, `fillRule`, `fills` et `strokes`
@msg a read-only object was left out un objet en lecture seule a été omis
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given un objet en lecture seule a été omis : renvoyez-le, sous la forme {{"id": …}} seul ou tel qu’il a été fourni
Can't render this file because it is too large.
+1 -1
View File
@@ -6555,7 +6555,7 @@ arrowhead Feather पंख
@msg a list of {min_items} to {max_items} numbers {min_items} से {max_items} संख्याओं की एक सूची
@msg a new object needs a `path` नए ऑब्जेक्ट को `path` चाहिए
@msg a number एक संख्या
@msg a painted live effect returns only `objects` पेंट करने वाला लाइव इफ़ेक्ट केवल `objects` लौटाता है
@msg a painted live effect returns only `objects` and `notice` पेंट करने वाला लाइव इफ़ेक्ट केवल `objects` और `notice` लौटाता है
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` पेंट करने वाले लाइव इफ़ेक्ट के हिस्से में केवल `path`, `fillRule`, `fills` और `strokes` होते हैं
@msg a read-only object was left out एक केवल-पढ़ने योग्य ऑब्जेक्ट छोड़ दिया गया
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given एक केवल-पढ़ने योग्य ऑब्जेक्ट छोड़ दिया गया: इसे केवल {{"id": …}} के रूप में या जैसा दिया गया था वैसा लौटाएँ
Can't render this file because it is too large.
+1 -1
View File
@@ -7358,7 +7358,7 @@ axis Y Axis Y tengely
@msg a list of {min_items} to {max_items} numbers {min_items}-{max_items} számból álló lista
@msg a new object needs a `path` az új objektumhoz `path` kell
@msg a number szám
@msg a painted live effect returns only `objects` a festő élő effektus csak `objects` értéket ad vissza
@msg a painted live effect returns only `objects` and `notice` a festő élő effektus csak `objects` és `notice` értéket ad vissza
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` a festő élő effektus darabjának csak `path`, `fillRule`, `fills` és `strokes` kulcsa van
@msg a read-only object was left out kimaradt egy írásvédett objektum
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given kimaradt egy írásvédett objektum: adja vissza önmagában {{"id": …}} formában vagy úgy, ahogy megkapta
Can't render this file because it is too large.
+1 -1
View File
@@ -486,7 +486,7 @@
@msg a list of {min_items} to {max_items} numbers daftar berisi {min_items} sampai {max_items} angka
@msg a new object needs a `path` objek baru memerlukan `path`
@msg a number angka
@msg a painted live effect returns only `objects` efek langsung yang dicat hanya mengembalikan `objects`
@msg a painted live effect returns only `objects` and `notice` efek langsung yang dicat hanya mengembalikan `objects` dan `notice`
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` potongan efek langsung yang dicat hanya memiliki `path`, `fillRule`, `fills` dan `strokes`
@msg a read-only object was left out objek baca-saja dihilangkan
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given objek baca-saja dihilangkan: kembalikan objek itu, sebagai {{"id": …}} saja atau seperti yang diberikan
Can't render this file because it is too large.
+1 -1
View File
@@ -6995,7 +6995,7 @@ axis Y Axis Asse Y
@msg a list of {min_items} to {max_items} numbers un elenco da {min_items} a {max_items} numeri
@msg a new object needs a `path` un nuovo oggetto richiede un `path`
@msg a number un numero
@msg a painted live effect returns only `objects` un effetto dinamico di pittura restituisce solo `objects`
@msg a painted live effect returns only `objects` and `notice` un effetto dinamico di pittura restituisce solo `objects` e `notice`
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` un pezzo di un effetto dinamico di pittura ha solo `path`, `fillRule`, `fills` e `strokes`
@msg a read-only object was left out è stato omesso un oggetto di sola lettura
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given è stato omesso un oggetto di sola lettura: restituiscilo come {{"id": …}} da solo o così come è stato fornito
Can't render this file because it is too large.
+1 -1
View File
@@ -7070,7 +7070,7 @@ axis Y Axis Y 軸
@msg a list of {min_items} to {max_items} numbers {min_items} から {max_items} 個の数値のリスト
@msg a new object needs a `path` 新しいオブジェクトには `path` が必要です
@msg a number 数値
@msg a painted live effect returns only `objects` ペイント型のライブ効果が返すのは `objects` だけです
@msg a painted live effect returns only `objects` and `notice` ペイント型のライブ効果が返すのは `objects` と `notice` だけです
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` ペイント型のライブ効果のピースに使えるのは `path`、`fillRule`、`fills`、`strokes` だけです
@msg a read-only object was left out 読み取り専用のオブジェクトが省かれています
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given 読み取り専用のオブジェクトが省かれています: {{"id": …}} だけの形か、渡されたとおりの形で返してください
Can't render this file because it is too large.
+1 -1
View File
@@ -9476,7 +9476,7 @@ axis Y Axis Y ღერძი
@msg a list of {min_items} to {max_items} numbers {min_items}-დან {max_items}-მდე რიცხვის სია
@msg a new object needs a `path` ახალ ობიექტს სჭირდება `path`
@msg a number რიცხვი
@msg a painted live effect returns only `objects` მხატვრული ცოცხალი ეფექტი აბრუნებს მხოლოდ `objects`-ს
@msg a painted live effect returns only `objects` and `notice` მხატვრული ცოცხალი ეფექტი აბრუნებს მხოლოდ `objects`-სა და `notice`-ს
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` მხატვრული ცოცხალი ეფექტის ნაწილს აქვს მხოლოდ `path`, `fillRule`, `fills` და `strokes`
@msg a read-only object was left out გამოტოვებულია მხოლოდ წასაკითხი ობიექტი
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given გამოტოვებულია მხოლოდ წასაკითხი ობიექტი: დააბრუნეთ ის მხოლოდ {{"id": …}}-ის სახით ან ისე, როგორც მიიღეთ
Can't render this file because it is too large.
+1 -1
View File
@@ -6967,7 +6967,7 @@ axis Y Axis Y축
@msg a list of {min_items} to {max_items} numbers 숫자 {min_items}-{max_items}개의 목록
@msg a new object needs a `path` 새 개체에는 `path`가 필요합니다
@msg a number 숫자
@msg a painted live effect returns only `objects` 페인트형 라이브 효과는 `objects`만 반환합니다
@msg a painted live effect returns only `objects` and `notice` 페인트형 라이브 효과는 `objects`와 `notice`만 반환합니다
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` 페인트형 라이브 효과의 조각에는 `path`, `fillRule`, `fills`, `strokes`만 있습니다
@msg a read-only object was left out 읽기 전용 개체가 빠졌습니다
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given 읽기 전용 개체가 빠졌습니다: {{"id": …}}만 있는 형태나 받은 그대로 반환하십시오
Can't render this file because it is too large.
+1 -1
View File
@@ -450,7 +450,7 @@ liquify-list-end {0}, {1} {0} en {1}
@msg a list of {min_items} to {max_items} numbers een lijst met {min_items} tot {max_items} getallen
@msg a new object needs a `path` een nieuw object heeft een `path` nodig
@msg a number een getal
@msg a painted live effect returns only `objects` een geschilderd live-effect geeft alleen `objects` terug
@msg a painted live effect returns only `objects` and `notice` een geschilderd live-effect geeft alleen `objects` en `notice` terug
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` een stuk van een geschilderd live-effect heeft alleen `path`, `fillRule`, `fills` en `strokes`
@msg a read-only object was left out een alleen-lezen object is weggelaten
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given een alleen-lezen object is weggelaten: geef het terug, als alleen {{"id": …}} of zoals het is gegeven
Can't render this file because it is too large.
+1 -1
View File
@@ -7228,7 +7228,7 @@ axis Y Axis Oś Y
@msg a list of {min_items} to {max_items} numbers listą od {min_items} do {max_items} liczb
@msg a new object needs a `path` nowy obiekt wymaga `path`
@msg a number liczbą
@msg a painted live effect returns only `objects` malujący efekt dynamiczny zwraca tylko `objects`
@msg a painted live effect returns only `objects` and `notice` malujący efekt dynamiczny zwraca tylko `objects` i `notice`
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` element malującego efektu dynamicznego ma tylko `path`, `fillRule`, `fills` i `strokes`
@msg a read-only object was left out pominięto obiekt tylko do odczytu
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given pominięto obiekt tylko do odczytu: zwróć go jako samo {{"id": …}} lub w postaci, w jakiej został przekazany
Can't render this file because it is too large.
+1 -1
View File
@@ -7272,7 +7272,7 @@ axis Y Axis Eixo Y
@msg a list of {min_items} to {max_items} numbers uma lista de {min_items} a {max_items} números
@msg a new object needs a `path` um objeto novo precisa de um `path`
@msg a number um número
@msg a painted live effect returns only `objects` um efeito dinâmico de pintura retorna apenas `objects`
@msg a painted live effect returns only `objects` and `notice` um efeito dinâmico de pintura retorna apenas `objects` e `notice`
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` uma peça de um efeito dinâmico de pintura tem apenas `path`, `fillRule`, `fills` e `strokes`
@msg a read-only object was left out um objeto somente leitura foi omitido
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given um objeto somente leitura foi omitido: retorne-o como {{"id": …}} sozinho ou como foi recebido
Can't render this file because it is too large.
+1 -1
View File
@@ -6995,7 +6995,7 @@ axis Y Axis Ось Y
@msg a list of {min_items} to {max_items} numbers список из {min_items}-{max_items} чисел
@msg a new object needs a `path` новому объекту нужен `path`
@msg a number число
@msg a painted live effect returns only `objects` рисующий динамический эффект возвращает только `objects`
@msg a painted live effect returns only `objects` and `notice` рисующий динамический эффект возвращает только `objects` и `notice`
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` у части рисующего динамического эффекта есть только `path`, `fillRule`, `fills` и `strokes`
@msg a read-only object was left out пропущен объект только для чтения
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given пропущен объект только для чтения: верните его как один {{"id": …}} или в том виде, в каком он был передан
Can't render this file because it is too large.
+1 -1
View File
@@ -7385,7 +7385,7 @@ axis Y Axis Y-axel
@msg a list of {min_items} to {max_items} numbers en lista med {min_items} till {max_items} tal
@msg a new object needs a `path` ett nytt objekt behöver en `path`
@msg a number ett tal
@msg a painted live effect returns only `objects` en målande live-effekt returnerar bara `objects`
@msg a painted live effect returns only `objects` and `notice` en målande live-effekt returnerar bara `objects` och `notice`
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` en del av en målande live-effekt har bara `path`, `fillRule`, `fills` och `strokes`
@msg a read-only object was left out ett skrivskyddat objekt utelämnades
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given ett skrivskyddat objekt utelämnades: returnera det som enbart {{"id": …}} eller som det gavs
Can't render this file because it is too large.
+1 -1
View File
@@ -7445,7 +7445,7 @@ axis Y Axis Y ekseni
@msg a list of {min_items} to {max_items} numbers {min_items} ile {max_items} arasında sayıdan oluşan bir liste
@msg a new object needs a `path` yeni bir nesnenin `path` değerine ihtiyacı vardır
@msg a number bir sayı
@msg a painted live effect returns only `objects` boyama türü canlı efekt yalnızca `objects` döndürür
@msg a painted live effect returns only `objects` and `notice` boyama türü canlı efekt yalnızca `objects` ve `notice` döndürür
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` boyama türü canlı efektin bir parçasında yalnızca `path`, `fillRule`, `fills` ve `strokes` bulunur
@msg a read-only object was left out salt okunur bir nesne atlandı
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given salt okunur bir nesne atlandı: onu yalnızca {{"id": …}} olarak veya verildiği gibi döndürün
Can't render this file because it is too large.
+1 -1
View File
@@ -6977,7 +6977,7 @@ axis Y Axis Вісь Y
@msg a list of {min_items} to {max_items} numbers список із {min_items}-{max_items} чисел
@msg a new object needs a `path` новому об’єкту потрібен `path`
@msg a number число
@msg a painted live effect returns only `objects` малювальний динамічний ефект повертає лише `objects`
@msg a painted live effect returns only `objects` and `notice` малювальний динамічний ефект повертає лише `objects` і `notice`
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` частина малювального динамічного ефекту має лише `path`, `fillRule`, `fills` і `strokes`
@msg a read-only object was left out пропущено об’єкт лише для читання
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given пропущено об’єкт лише для читання: поверніть його як один {{"id": …}} або в тому вигляді, у якому його передано
Can't render this file because it is too large.
+1 -1
View File
@@ -7024,7 +7024,7 @@ axis Y Axis Trục Y
@msg a list of {min_items} to {max_items} numbers một danh sách gồm {min_items} đến {max_items} số
@msg a new object needs a `path` đối tượng mới cần một `path`
@msg a number một số
@msg a painted live effect returns only `objects` hiệu ứng động kiểu tô chỉ trả về `objects`
@msg a painted live effect returns only `objects` and `notice` hiệu ứng động kiểu tô chỉ trả về `objects` và `notice`
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` một phần của hiệu ứng động kiểu tô chỉ có `path`, `fillRule`, `fills` và `strokes`
@msg a read-only object was left out một đối tượng chỉ đọc đã bị bỏ sót
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given một đối tượng chỉ đọc đã bị bỏ sót: hãy trả lại nó dưới dạng chỉ {{"id": …}} hoặc như khi được nhận
Can't render this file because it is too large.
+1 -1
View File
@@ -7205,7 +7205,7 @@ axis Y Axis Y 轴
@msg a list of {min_items} to {max_items} numbers 包含 {min_items} 到 {max_items} 个数字的列表
@msg a new object needs a `path` 新对象需要 `path`
@msg a number 数字
@msg a painted live effect returns only `objects` 绘制型实时效果只返回 `objects`
@msg a painted live effect returns only `objects` and `notice` 绘制型实时效果只返回 `objects` 和 `notice`
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` 绘制型实时效果的片段只有 `path`、`fillRule`、`fills` 和 `strokes`
@msg a read-only object was left out 漏掉了一个只读对象
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given 漏掉了一个只读对象:请以单独的 {{"id": …}} 或原样返回它
Can't render this file because it is too large.
+1 -1
View File
@@ -7026,7 +7026,7 @@ axis Y Axis Y 軸
@msg a list of {min_items} to {max_items} numbers 包含 {min_items} 到 {max_items} 個數字的清單
@msg a new object needs a `path` 新物件需要 `path`
@msg a number 數字
@msg a painted live effect returns only `objects` 繪製型即時效果只傳回 `objects`
@msg a painted live effect returns only `objects` and `notice` 繪製型即時效果只傳回 `objects` 和 `notice`
@msg a painted live effect's piece has only `path`, `fillRule`, `fills` and `strokes` 繪製型即時效果的片段只有 `path`、`fillRule`、`fills` 和 `strokes`
@msg a read-only object was left out 漏掉了一個唯讀物件
@msg a read-only object was left out: return it, as {{"id": …}} alone or as it was given 漏掉了一個唯讀物件:請以單獨的 {{"id": …}} 或原樣傳回它
Can't render this file because it is too large.
+28 -6
View File
@@ -156,15 +156,29 @@ fn finish(app: &mut VectorcraftApp, r: Running, done: Option<Done>) {
}
/// Shows in the status bar the notice of the plug-in run that command `cmd` (`plugin.run` or a
/// plug-in command) applied, with result `r`: `Plug-in “name”: notice`, the plug-in's name escaped
/// and capped as prompts show it. The notice is shown as the run returned it (escaped and capped by
/// the host) and never translated. A result without a notice leaves the status bar as it is.
/// plug-in command) applied, with result `r`: `Plug-in “name”: notice`, the name of the plug-in that
/// ran (`pluginName`) escaped and capped as prompts show it. The notice is shown as the run returned
/// it (escaped and capped by the host) and never translated. A result without a notice leaves the
/// status bar as it is. For a `command.batch`, such as an action's steps, the last plug-in run among
/// its steps with a notice shows it.
pub fn show_notice(app: &mut VectorcraftApp, cmd: &str, r: &Value) {
if cmd != "plugin.run" && !vectorcraft_engine::cmd::plugin::is_command_id(cmd) {
let r = if cmd == "command.batch" {
match last_batch_notice(r) {
Some(step) => step,
None => return,
}
} else if cmd == "plugin.run" || vectorcraft_engine::cmd::plugin::is_command_id(cmd) {
r
} else {
return;
}
};
let (Some(notice), Some(id)) = (r.get("notice").and_then(Value::as_str), r.get("plugin").and_then(Value::as_str)) else { return };
let name = registry::get(id).map_or_else(|| id.to_string(), |p| p.manifest().name.trim().trim_end_matches('…').to_string());
let name = r
.get("pluginName")
.and_then(Value::as_str)
.map(str::to_string)
.or_else(|| registry::get(id).map(|p| p.manifest().name.clone()))
.map_or_else(|| id.to_string(), |name| name.trim().trim_end_matches('…').to_string());
let name = permissions::display_text(&name, permissions::MAX_SHOWN_NAME);
let status = format!("Plug-in “{name}”: {notice}");
let before = status.strip_suffix(notice).unwrap_or_default().to_string();
@@ -172,6 +186,14 @@ pub fn show_notice(app: &mut VectorcraftApp, cmd: &str, r: &Value) {
app.ui.status_kept = Some((before, notice.to_string(), String::new()));
}
/// The result of the last step of `command.batch` result `r` that a plug-in run with a notice gave
/// (`{plugin, ids, notice}`).
fn last_batch_notice(r: &Value) -> Option<&Value> {
r.get("results")?.as_array()?.iter().rev().find(|step| {
step.get("notice").is_some_and(Value::is_string) && step.get("plugin").is_some_and(Value::is_string) && step.get("ids").is_some()
})
}
/// The progress window's Cancel (also Esc): every filter running in the background stops (at once when it checks
/// `vc_cancelled`, else at the next slice of its budget) and changes nothing → `{cancelled: n}`.
pub fn cancel_all(app: &mut VectorcraftApp) -> Value {
+6 -5
View File
@@ -13250,10 +13250,10 @@ while it changes it, so installs, removals, grants and plug-in settings from two
be locked, `plugin.install` and `plugin.remove` fail and change nothing:
`plugin.install {path | dataBase64}` installs one, `plugin.list` / `plugin.info {id}` describe them (parameters,
schema, defaults). An object filter runs on the selected paths and compound paths with `plugin.run {id, params}` (one
undo step; it may change, delete or add objects, and the result is selected) → `{plugin, ids, notice?}`. `notice` is
the text the filter's output reports in its `notice` key, escaped and cut at 200 characters
([plug-ins](plugins.md#output)); it is returned only when the output was applied, and the desktop app shows it in the
status bar after the plug-in's name. A filter whose manifest lists `inputs`
undo step; it may change, delete or add objects, and the result is selected) → `{plugin, ids, notice?, pluginName?}`.
`notice` is the text the filter's output reports in its `notice` key, escaped and cut at 200 characters
([plug-ins](plugins.md#output)); it is returned only when the output was applied, with `pluginName`, the manifest name
of the plug-in that ran, and the desktop app shows it in the status bar after that name. A filter whose manifest lists `inputs`
(`type`, `image`, `symbolInstance`; `inputs` in its `plugin.list` entry) also lists `doc.read` in its `permissions`, so
installing it needs a person's approval. It is also given the selected objects of those kinds to read, in paint order from the
bottom, with at most 16 MiB of pixels and 16 MiB of type runs over one run (an object that doesn't fit what the objects
@@ -13371,7 +13371,8 @@ value or the folder the preference already holds, and the web build does not che
A filter or live effect may declare commands of its own ([plugins.md](plugins.md#commands)): each is the command
`plugin.<id>.<command>` while the plug-in is installed, listed by `command_list` and in its `plugin.list` entry
(`commands: [{id, command, label, params, paramsSchema}]`). Run it with `{ids?, params?}` (its parameters may also
be top-level keys) → `{plugin, command, ids, notice?}`, with `notice` as `plugin.run` returns it: the parameters are
be top-level keys) → `{plugin, command, ids, notice?, pluginName?}`, with `notice` and `pluginName` as `plugin.run`
returns them: the parameters are
checked before the plug-in runs, a run is one undo step named after the command, and a run that traps or runs out of its instruction budget returns an error that starts with the plug-in's
name and the command's label and leaves the document and the undo history as they were. For `plugin.run` and plug-in
commands, `ids` left out or null means the selection, and an `ids` that is not a list of object ids is an error.
+10 -5
View File
@@ -795,13 +795,17 @@ is worked out from the object alone.
To report what a run did, a filter or a plug-in command adds `notice`: one string, such as
`{"objects": [...], "notice": "Selected 12 objects"}`. It needs no permission and no host import. Once the output is
applied, the desktop app and the web build show it in the status bar as `Plug-in “name”: notice`, the plug-in's name
first, and `plugin.run` and the plug-in command return it as `notice` in their result. The host trims the white space around it, writes control, bidirectional and line
first, and `plugin.run` and the plug-in command return it as `notice` in their result, with the plug-in's name as
`pluginName`. The host trims the white space around it, writes control, bidirectional and line
separator characters as `\u{202E}` escapes and cuts it at 200 characters, escapes included, ending it with `…`. Each run
reports at most one notice, and a later status message replaces it. A `notice` that is not a string or has no visible
character refuses the whole output, and nothing changes. A run that declines, fails, is refused, is canceled or
reports at most one notice, and a later status message replaces it. A plug-in step of an action or a `command.batch`
shows its notice too; when several steps report one, the last of them shows. A `notice` that is not a string, or has no visible
character in the part the status bar shows, refuses the whole output, and nothing changes; white space, control characters and the invisible
characters that are not escaped (soft hyphen, zero-width and filler characters, variation selectors, tags) do not
count as visible. A run that declines, fails, is refused, is canceled or
finishes after the document changed shows none; an output that changes nothing still shows its notice. The status
bar translates the words around the notice, never the notice itself. A live effect's
`notice` is ignored, since it runs whenever its object is drawn. These limits are VectorCraft's own values. Hosts
`notice`, painted or not, is ignored without being checked, since the effect runs whenever its object is drawn. These limits are VectorCraft's own values. Hosts
from before `notice` ignore it.
For a **live effect**, the geometry of every returned object's `path` (their subpaths, in order) replaces the
@@ -822,7 +826,8 @@ is a piece drawn by itself, in the order returned, with paints of its own:
```
- `path` is required; `fillRule` defaults to the object's. `type` and `bounds` may be handed back as given and are
ignored. Any other key (`opacity`, `effects`, `guide`, `locked`, `name`, a top-level `documentData`…) refuses the
ignored, as is a top-level `notice`. Any other key (`opacity`, `effects`, `guide`, `locked`, `name`, a top-level
`documentData`…) refuses the
result, as does a key that a paint, its color, a gradient stop, a gradient's placement or a freeform point does not
have, such as `opacity` on a solid paint.
- `fills` and `strokes` take the forms a filter returns ([Input](#input)). A piece without `fills` (or `strokes`) is