mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-25 20:01:07 +01:00
Merge pull request #9088 from dotCooCoo/feat/plugin-api-document-info
Plug-ins: filters and plug-in commands read document information without a selection
This commit is contained in:
40 files changed
+756
-30
No files matched your search
@@ -43,6 +43,11 @@
|
||||
//! A filter whose manifest lists `inputs` (plug-in API level 2) is also given the selected type,
|
||||
//! images or symbol instances of those kinds, to read only: its output must return each of them
|
||||
//! unchanged ([`objects::decode_output_with`]).
|
||||
//!
|
||||
//! A filter, or a live effect's command, whose manifest lists `context` (plug-in API level 3) is
|
||||
//! also given the parts of the active document it names in `_context.document`, whether or not
|
||||
//! anything is selected: the settings, artboards, layers and swatches, as plain values
|
||||
//! ([`context`]).
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::sync::{Arc, Mutex, RwLock};
|
||||
@@ -56,6 +61,9 @@ use crate::store::{PluginLoad, StoreTurn};
|
||||
|
||||
use vectorcraft_plugins::permissions::{self, Grant, GrantToken, Permission};
|
||||
|
||||
mod context;
|
||||
pub use context::{CONTEXT_FUEL_PER_ITEM, MAX_CONTEXT_BYTES, MAX_CONTEXT_ITEMS};
|
||||
|
||||
/// What a plug-in error looks like to the user. A run the caller cancelled changed nothing.
|
||||
fn err(e: vectorcraft_plugins::Error) -> EngineError {
|
||||
match e {
|
||||
@@ -102,6 +110,9 @@ pub fn describe(p: &Plugin) -> Value {
|
||||
if !m.inputs.is_empty() {
|
||||
v["inputs"] = json!(m.inputs);
|
||||
}
|
||||
if !m.context.is_empty() {
|
||||
v["context"] = json!(m.context);
|
||||
}
|
||||
if m.paint_output {
|
||||
v["paintOutput"] = json!(true);
|
||||
}
|
||||
@@ -254,15 +265,25 @@ impl FilterRun {
|
||||
params["_context"]["mode"] = json!("command");
|
||||
params["_context"]["command"] = json!(cmd.id);
|
||||
}
|
||||
// The parts of the document its manifest asks for (`context`), selection or not. Each row
|
||||
// costs the run [`context::CONTEXT_FUEL_PER_ITEM`] instructions.
|
||||
let sections = m.context_sections();
|
||||
let mut charged = 0;
|
||||
if !sections.is_empty() && may.contains(&Permission::DocRead) {
|
||||
let given = context::document_context(st, §ions, c)?;
|
||||
params["_context"]["document"] = given.value;
|
||||
charged = (given.items as u64).saturating_mul(context::CONTEXT_FUEL_PER_ITEM);
|
||||
}
|
||||
let params = serde_json::to_vec(¶ms).map_err(|e| bad(c, e.to_string()))?;
|
||||
// The input and the parameters may use half the plug-in's memory together.
|
||||
let capacity = (plugin.limits().max_memory_bytes / 2).min(i32::MAX as usize).saturating_sub(params.len());
|
||||
let (input, read_only) = objects::encode_input_with(&st.doc, &inputs, &kinds, capacity).map_err(err)?;
|
||||
let document = (st.uid, st.revision);
|
||||
let limits = match s.prefs.plugin_instruction_budget {
|
||||
let mut limits = match s.prefs.plugin_instruction_budget {
|
||||
crate::PluginBudget::Normal => plugin.limits().clone(),
|
||||
crate::PluginBudget::Large => plugin.large_limits(),
|
||||
};
|
||||
limits.fuel_base = limits.fuel_base.saturating_sub(charged);
|
||||
Ok(FilterRun { plugin, command, input, params, inputs, read_only, parent, document, limits })
|
||||
}
|
||||
|
||||
@@ -296,11 +317,17 @@ impl FilterRun {
|
||||
}
|
||||
|
||||
/// The limits it runs under: the plug-in's, with the Plug-in Instruction Budget in force when
|
||||
/// it was made.
|
||||
/// it was made, less what its document context costs.
|
||||
pub fn limits(&self) -> &vectorcraft_plugins::Limits {
|
||||
&self.limits
|
||||
}
|
||||
|
||||
/// The parameters it hands the plug-in, `_context` included.
|
||||
#[cfg(test)]
|
||||
pub(crate) fn params_json(&self) -> Value {
|
||||
serde_json::from_slice(&self.params).unwrap_or(Value::Null)
|
||||
}
|
||||
|
||||
/// Does the plug-in call commands (its manifest's `commandAllowlist`)? Then it runs only in the
|
||||
/// session ([`FilterRun::run_with_calls`]).
|
||||
pub fn calls(&self) -> bool {
|
||||
@@ -1821,7 +1848,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"List Plug-ins",
|
||||
[],
|
||||
None,
|
||||
"{} → {plugins: [{id, name, version, kind: \"filter\"|\"effect\"|\"exporter\"|\"importer\", author, description, params (doc), paramsSchema, effect? (the effect id of a live effect: plugin.<id>), format? and extensions? (an exporter's or importer's format id, plugin.<id>, for document.export or document.open's importer, and its file extensions), budget?: \"heavy\" (a filter that may compute for longer, see plugin.install's allowHeavy), inputs?: [\"type\"|\"image\"|\"symbolInstance\"] (the objects besides paths a filter reads, see plugin.run), size, source, permissions: [name] (what it may do: the ones its manifest lists, else the ones its kind implies; progress: it may report its progress, see Cancel and write log lines; settings: it may keep settings of its own; cache: it may keep a cache of its own; commands: a filter may run the commands its commandAllowlist names, see docs/plugins.md), commandAllowlist?: [command id] (the commands a filter with the commands permission may run while it runs, with vc_call), hash (the module's SHA-256), api (the plug-in API level it was built for, 1 or 2), paintOutput?: true (a live effect whose pieces have paints of their own, see docs/plugins.md), cacheBytes (the bytes its cache holds; see plugin.clearCache), commands?: [{id, command (its command id, plugin.<id>.<command id>, which runs it), label, params (doc), paramsSchema, menu?: {path: [menu label], after?: item label (escaped), placed?: false (it stays in its plug-in's submenu: its label reads like a built-in item or submenu of that menu or another plug-in command placed there)} (the menu its manifest places it in, see docs/plugins.md)}] (the menu commands a filter or live effect adds)}], folder: the Additional Plug-ins Folder load report {folder, loaded, failed: [{file, error}], leftOut} | null (under automation read roots, a folder outside them is null, and a failed file and a plug-in's source outside them are named by their file name), safeMode: bool (no plug-in loads or runs, see plugin.safeMode), disabled: [{id, file, name, label}] (turned off for the next launch, see plugin.setEnabled)}",
|
||||
"{} → {plugins: [{id, name, version, kind: \"filter\"|\"effect\"|\"exporter\"|\"importer\", author, description, params (doc), paramsSchema, effect? (the effect id of a live effect: plugin.<id>), format? and extensions? (an exporter's or importer's format id, plugin.<id>, for document.export or document.open's importer, and its file extensions), budget?: \"heavy\" (a filter that may compute for longer, see plugin.install's allowHeavy), inputs?: [\"type\"|\"image\"|\"symbolInstance\"] (the objects besides paths a filter reads, see plugin.run), context?: [\"settings\"|\"artboards\"|\"layers\"|\"swatches\"] (the parts of the active document a filter's runs and its or a live effect's commands are given in _context.document, with or without a selection, see docs/plugins.md), size, source, permissions: [name] (what it may do: the ones its manifest lists, else the ones its kind implies; progress: it may report its progress, see Cancel and write log lines; settings: it may keep settings of its own; cache: it may keep a cache of its own; commands: a filter may run the commands its commandAllowlist names, see docs/plugins.md), commandAllowlist?: [command id] (the commands a filter with the commands permission may run while it runs, with vc_call), hash (the module's SHA-256), api (the plug-in API level it was built for, 1, 2 or 3), paintOutput?: true (a live effect whose pieces have paints of their own, see docs/plugins.md), cacheBytes (the bytes its cache holds; see plugin.clearCache), commands?: [{id, command (its command id, plugin.<id>.<command id>, which runs it), label, params (doc), paramsSchema, menu?: {path: [menu label], after?: item label (escaped), placed?: false (it stays in its plug-in's submenu: its label reads like a built-in item or submenu of that menu or another plug-in command placed there)} (the menu its manifest places it in, see docs/plugins.md)}] (the menu commands a filter or live effect adds)}], folder: the Additional Plug-ins Folder load report {folder, loaded, failed: [{file, error}], leftOut} | null (under automation read roots, a folder outside them is null, and a failed file and a plug-in's source outside them are named by their file name), safeMode: bool (no plug-in loads or runs, see plugin.safeMode), disabled: [{id, file, name, label}] (turned off for the next launch, see plugin.setEnabled)}",
|
||||
always,
|
||||
list
|
||||
),
|
||||
|
||||
@@ -0,0 +1,147 @@
|
||||
//! A plug-in run's document context (`_context.document`): the parts of the active document its
|
||||
//! manifest's `context` asks for ([`ContextSection`]), read when the run is prepared, with or
|
||||
//! without a selection. It holds plain values only: names, flags, rectangles and colors, never an
|
||||
//! object, a file path or a link target.
|
||||
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_doc::{ColorMode, LayerColor, Node, NodeKind};
|
||||
use vectorcraft_plugins::ContextSection;
|
||||
|
||||
use super::super::{Result, bad};
|
||||
use crate::DocState;
|
||||
|
||||
/// Most rows (artboards, layers and sublayers, and swatches together) a document context holds.
|
||||
pub const MAX_CONTEXT_ITEMS: usize = 10_000;
|
||||
|
||||
/// Most bytes the rows of a document context take as JSON.
|
||||
pub const MAX_CONTEXT_BYTES: usize = 4 * 1024 * 1024;
|
||||
|
||||
/// Instructions each row costs: they come off the run's instruction budget.
|
||||
pub const CONTEXT_FUEL_PER_ITEM: u64 = 1_000;
|
||||
|
||||
/// A document context, and the rows it holds.
|
||||
pub(super) struct DocumentContext {
|
||||
pub value: Value,
|
||||
pub items: usize,
|
||||
}
|
||||
|
||||
/// The document context of `sections` for a run of command `c` on `st`: `{revision}` and a key
|
||||
/// for each section asked for. A document with more than [`MAX_CONTEXT_ITEMS`] rows in them, or
|
||||
/// rows of more than [`MAX_CONTEXT_BYTES`], is an error, before any row is made in the first case.
|
||||
pub(super) fn document_context(st: &DocState, sections: &[ContextSection], c: &str) -> Result<DocumentContext> {
|
||||
let d = &st.doc;
|
||||
let layers = if sections.contains(&ContextSection::Layers) { layer_rows(d) } else { Vec::new() };
|
||||
let swatches = || super::super::swatch::listed_swatches(d, true, d.swatch_groups.iter().collect());
|
||||
let mut items = 0;
|
||||
for s in sections {
|
||||
items += match s {
|
||||
ContextSection::Settings => 0,
|
||||
ContextSection::Artboards => d.artboards.len(),
|
||||
ContextSection::Layers => layers.len(),
|
||||
ContextSection::Swatches => swatches().count(),
|
||||
};
|
||||
}
|
||||
let too_large = || {
|
||||
bad(
|
||||
c,
|
||||
format!(
|
||||
"the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes"
|
||||
),
|
||||
)
|
||||
};
|
||||
if items > MAX_CONTEXT_ITEMS {
|
||||
return Err(too_large());
|
||||
}
|
||||
let mut bytes = 0usize;
|
||||
let mut row = |v: Value| -> Result<Value> {
|
||||
bytes = bytes.saturating_add(serde_json::to_vec(&v).map_or(usize::MAX, |b| b.len() + 1));
|
||||
if bytes > MAX_CONTEXT_BYTES { Err(too_large()) } else { Ok(v) }
|
||||
};
|
||||
let active = active_artboard(st);
|
||||
let mut out = json!({"revision": st.revision});
|
||||
for s in sections {
|
||||
let value = match s {
|
||||
ContextSection::Settings => {
|
||||
let board = active.and_then(|i| d.artboards.get(i));
|
||||
row(json!({
|
||||
"name": st.title(),
|
||||
"colorMode": match d.color_mode {
|
||||
ColorMode::Rgb => "rgb",
|
||||
ColorMode::Cmyk => "cmyk",
|
||||
},
|
||||
"units": d.units.label(),
|
||||
"width": board.map(|a| a.rect.width()),
|
||||
"height": board.map(|a| a.rect.height()),
|
||||
"bleed": d.setup.bleed,
|
||||
"rasterEffectsPpi": d.raster_ppi(),
|
||||
"activeArtboard": board.map(|a| a.id),
|
||||
}))?
|
||||
}
|
||||
ContextSection::Artboards => {
|
||||
let rows = d.artboards.iter().enumerate().map(|(i, a)| {
|
||||
let r = a.rect;
|
||||
row(json!({"id": a.id, "index": i, "name": a.name, "rect": [r.x0, r.y0, r.x1, r.y1], "active": active == Some(i)}))
|
||||
});
|
||||
Value::Array(rows.collect::<Result<_>>()?)
|
||||
}
|
||||
ContextSection::Layers => {
|
||||
let rows = layers.iter().map(|l| {
|
||||
let n = l.node;
|
||||
row(json!({
|
||||
"id": n.id.0, "parentId": l.parent, "depth": l.depth, "name": n.display_name(),
|
||||
"visible": n.visible, "locked": n.locked, "template": l.template, "color": l.color.label_text(),
|
||||
"sublayers": l.sublayers, "current": st.active_layer == Some(n.id),
|
||||
}))
|
||||
});
|
||||
Value::Array(rows.collect::<Result<_>>()?)
|
||||
}
|
||||
ContextSection::Swatches => {
|
||||
let rows = swatches().map(|(w, g)| row(super::super::swatch::swatch_json(w, g)));
|
||||
Value::Array(rows.collect::<Result<_>>()?)
|
||||
}
|
||||
};
|
||||
out[s.name()] = value;
|
||||
}
|
||||
Ok(DocumentContext { value: out, items })
|
||||
}
|
||||
|
||||
/// Is `n` a layer or sublayer?
|
||||
fn is_layer(n: &Node) -> bool {
|
||||
matches!(n.kind, NodeKind::Layer { .. })
|
||||
}
|
||||
|
||||
/// A layer or sublayer, where it is in the layer tree, and what its row reports besides the
|
||||
/// node's own name and flags.
|
||||
struct LayerRow<'a> {
|
||||
node: &'a Node,
|
||||
/// Its parent layer's id; `None` for a top-level layer.
|
||||
parent: Option<u64>,
|
||||
/// 0 for a top-level layer, 1 for its sublayers, and so on.
|
||||
depth: usize,
|
||||
color: LayerColor,
|
||||
template: bool,
|
||||
/// The sublayers it holds directly.
|
||||
sublayers: usize,
|
||||
}
|
||||
|
||||
/// Every layer and sublayer of `d`, depth first in document order (bottom first within each
|
||||
/// parent). The walk keeps its own stack, so deep nesting can't overflow the thread's.
|
||||
fn layer_rows(d: &vectorcraft_doc::Document) -> Vec<LayerRow<'_>> {
|
||||
let mut out = Vec::new();
|
||||
let mut stack: Vec<(&Node, Option<u64>, usize)> = d.layers.iter().rev().map(|l| (l.as_ref(), None, 0)).collect();
|
||||
while let Some((node, parent, depth)) = stack.pop() {
|
||||
let NodeKind::Layer { color, template, children, .. } = &node.kind else { continue };
|
||||
let sublayers = children.iter().filter(|c| is_layer(c)).count();
|
||||
stack.extend(children.iter().rev().filter(|c| is_layer(c)).map(|c| (c.as_ref(), Some(node.id.0), depth + 1)));
|
||||
out.push(LayerRow { node, parent, depth, color: *color, template: *template, sublayers });
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
/// The index of the view's active artboard ([`DocState::active_artboard`]): when the document no
|
||||
/// longer has it, the artboard the document opened on, else the first; `None` with no artboards.
|
||||
fn active_artboard(st: &DocState) -> Option<usize> {
|
||||
let d = &st.doc;
|
||||
let at = |id: Option<u32>| id.and_then(|id| d.artboards.iter().position(|a| a.id == id));
|
||||
at(st.active_artboard).or_else(|| at(d.opened_artboard)).or((!d.artboards.is_empty()).then_some(0))
|
||||
}
|
||||
@@ -1012,18 +1012,28 @@ fn swatch_list(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
Some(g) => vec![d.swatch_groups.iter().find(|x| x.name == g).ok_or_else(|| bad("swatch.list", format!("no colour group `{g}`")))?],
|
||||
None => d.swatch_groups.iter().collect(),
|
||||
};
|
||||
// The built-in Registration swatch lists after None, as the panel shows it.
|
||||
let none = d.swatches.iter().take_while(|w| w.paint.is_none()).count();
|
||||
let (specials, rest) = d.swatches.split_at(none);
|
||||
let all = specials.iter().chain([vectorcraft_color::swatch::registration()]).chain(rest);
|
||||
let ungrouped = all.filter(|_| only.is_none()).map(|w| swatch_json(w, None));
|
||||
let grouped = groups.iter().flat_map(|g| g.swatches.iter().map(|w| swatch_json(w, Some(&g.name))));
|
||||
let swatches: Vec<Value> = ungrouped.chain(grouped).collect();
|
||||
let swatches: Vec<Value> = listed_swatches(d, only.is_none(), groups.clone()).map(|(w, g)| swatch_json(w, g)).collect();
|
||||
let groups: Vec<Value> =
|
||||
groups.iter().map(|g| json!({"name": g.name, "swatches": g.swatches.iter().map(|w| &w.name).collect::<Vec<_>>()})).collect();
|
||||
Ok(json!({"swatches": swatches, "groups": groups}))
|
||||
}
|
||||
|
||||
/// The swatches `swatch.list` lists, in its order, each with the name of the colour group it is
|
||||
/// in: with `ungrouped`, the swatches outside groups (the built-in Registration swatch after None,
|
||||
/// as the panel shows it), then those of `groups`.
|
||||
pub(super) fn listed_swatches<'a>(
|
||||
d: &'a Document,
|
||||
ungrouped: bool,
|
||||
groups: Vec<&'a SwatchGroup>,
|
||||
) -> impl Iterator<Item = (&'a Swatch, Option<&'a str>)> + 'a {
|
||||
let none = d.swatches.iter().take_while(|w| w.paint.is_none()).count();
|
||||
let (specials, rest) = d.swatches.split_at(none);
|
||||
let all = specials.iter().chain([vectorcraft_color::swatch::registration()]).chain(rest);
|
||||
let ungrouped = all.filter(move |_| ungrouped).map(|w| (w, None));
|
||||
let grouped = groups.into_iter().flat_map(|g| g.swatches.iter().map(move |w| (w, Some(g.name.as_str()))));
|
||||
ungrouped.chain(grouped)
|
||||
}
|
||||
|
||||
fn swatch_sort(s: &mut Session, _: &Value) -> Result<Value> {
|
||||
s.edit("Sort Swatches", |d, _| {
|
||||
// [None] and other bracketed specials stay first, like the reference app.
|
||||
|
||||
@@ -4629,6 +4629,168 @@ fn read_only_kind_field_and_omission_refuse_without_undo() {
|
||||
assert!(e.contains("`inputs` needs `api` 2"), "{e}");
|
||||
}
|
||||
|
||||
/// The manifest of a filter at `api` 3 with id `id` that asks for the document information
|
||||
/// `context` (a JSON list), with `doc.read` and `doc.write`, and `rest` (keys after a comma, or
|
||||
/// nothing).
|
||||
fn context_manifest(id: &str, context: &str, rest: &str) -> String {
|
||||
format!(r#"{{"id":"{id}","name":"Test {id}","kind":"filter","api":3,"permissions":["doc.read","doc.write"],"context":{context}{rest}}}"#)
|
||||
}
|
||||
|
||||
/// Installs `src` granted `doc.read` and `doc.write`, in place of any module with its id.
|
||||
fn install_reading(s: &mut Session, src: &str) -> Value {
|
||||
let data = vectorcraft_format::base64_encode(&wat::parse_str(src).unwrap());
|
||||
run(s, "plugin.install", json!({"dataBase64": data, "grant": ["doc.read", "doc.write"], "replace": true}))
|
||||
}
|
||||
|
||||
/// A filter at `api` 3 whose manifest lists `context` is given the document's settings, artboards,
|
||||
/// layers and swatches in `_context.document` with nothing selected: plain values, hidden and
|
||||
/// locked layers with their flags, the active artboard and the current layer marked, and the
|
||||
/// document's name without its folder. A filter that doesn't list `context` is given none, and one
|
||||
/// that lists it without `doc.read` or below `api` 3 doesn't install.
|
||||
#[test]
|
||||
fn an_unselected_filter_reads_the_document_context_it_asks_for() {
|
||||
use cmd::plugin::FilterRun;
|
||||
let mut s = session();
|
||||
run(&mut s, "artboard.new", json!({"x": 500, "y": 0, "width": 100, "height": 50}));
|
||||
let hidden = run(&mut s, "layer.new", json!({"name": "Hidden", "visible": false}))["id"].as_u64().unwrap();
|
||||
let locked = run(&mut s, "layer.newSublayer", json!({"parent": hidden, "name": "Locked", "locked": true}))["id"].as_u64().unwrap();
|
||||
run(&mut s, "layer.setCurrent", json!({"id": locked}));
|
||||
run(&mut s, "swatch.new", json!({"name": "Tone", "color": "#ff0000", "global": true}));
|
||||
run(&mut s, "select.none", json!({}));
|
||||
s.doc_mut().unwrap().path = Some("/private/folder/Poster.vectorcraft".into());
|
||||
let second = s.doc().unwrap().doc.artboards[1].id;
|
||||
s.doc_mut().unwrap().active_artboard = Some(second);
|
||||
let id = "test.engine.context";
|
||||
let all = r#"["settings","artboards","layers","swatches"]"#;
|
||||
let installed = install_reading(&mut s, &tpl::returning(&context_manifest(id, all, ""), r#"{"objects":[]}"#));
|
||||
assert_eq!(installed["context"], json!(["settings", "artboards", "layers", "swatches"]));
|
||||
let swatches = run(&mut s, "swatch.list", json!({}))["swatches"].clone();
|
||||
assert!(s.doc().unwrap().selection.objects.is_empty());
|
||||
let given = FilterRun::prepare(&s, &json!({"id": id})).unwrap().params_json()["_context"]["document"].clone();
|
||||
let st = s.doc().unwrap();
|
||||
let d = &st.doc;
|
||||
assert_eq!(given["revision"], json!(st.revision));
|
||||
let board = &d.artboards[1];
|
||||
let settings = json!({
|
||||
"name": "Poster.vectorcraft", "colorMode": "rgb", "units": d.units.label(), "width": board.rect.width(),
|
||||
"height": board.rect.height(), "bleed": d.setup.bleed, "rasterEffectsPpi": d.raster_ppi(), "activeArtboard": second,
|
||||
});
|
||||
assert_eq!(given["settings"], settings);
|
||||
let boards: Vec<Value> = d
|
||||
.artboards
|
||||
.iter()
|
||||
.enumerate()
|
||||
.map(|(i, a)| json!({"id": a.id, "index": i, "name": a.name, "rect": [a.rect.x0, a.rect.y0, a.rect.x1, a.rect.y1], "active": i == 1}))
|
||||
.collect();
|
||||
assert_eq!((boards.len(), &given["artboards"]), (2, &json!(boards)));
|
||||
let layers = given["layers"].as_array().unwrap();
|
||||
let rows: Vec<(String, u64, bool, bool, bool)> = layers
|
||||
.iter()
|
||||
.map(|l| {
|
||||
(l["name"].as_str().unwrap().to_string(), l["depth"].as_u64().unwrap(), l["visible"] == true, l["locked"] == true, l["current"] == true)
|
||||
})
|
||||
.collect();
|
||||
let bottom = d.layers[0].display_name();
|
||||
assert_eq!(rows, [(bottom, 0, true, false, false), ("Hidden".into(), 0, false, false, false), ("Locked".into(), 1, true, true, true)]);
|
||||
assert_eq!((&layers[0]["parentId"], &layers[1]["sublayers"], &layers[2]["parentId"]), (&Value::Null, &json!(1), &json!(hidden)));
|
||||
assert_eq!((&layers[1]["id"], &layers[2]["id"]), (&json!(hidden), &json!(locked)));
|
||||
assert_eq!(given["swatches"], swatches, "as swatch.list lists them");
|
||||
assert!(given["swatches"].as_array().unwrap().iter().any(|w| w["name"] == "Tone" && w["global"] == true));
|
||||
assert!(!given.to_string().contains("/private/folder"), "no path: {given}");
|
||||
// Only the sections asked for.
|
||||
let some = "test.engine.context.some";
|
||||
install_reading(&mut s, &tpl::returning(&context_manifest(some, r#"["layers"]"#, ""), r#"{"objects":[]}"#));
|
||||
let given = FilterRun::prepare(&s, &json!({"id": some})).unwrap().params_json()["_context"]["document"].clone();
|
||||
let keys: Vec<&String> = given.as_object().unwrap().keys().collect();
|
||||
assert_eq!(keys.len(), 2, "{keys:?}");
|
||||
assert!(given.get("layers").is_some() && given.get("revision").is_some());
|
||||
// A filter without `context` is given none.
|
||||
let legacy = "test.engine.context.legacy";
|
||||
install_reading(&mut s, &tpl::returning(&tpl::manifest(legacy, "filter", "{}"), r#"{"objects":[]}"#));
|
||||
assert!(FilterRun::prepare(&s, &json!({"id": legacy})).unwrap().params_json()["_context"].get("document").is_none());
|
||||
// Without `doc.read`, or below `api` 3, it doesn't install.
|
||||
let needs = "`context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read`";
|
||||
for manifest in [
|
||||
format!(r#"{{"id":"{some}","name":"x","kind":"filter","api":3,"permissions":["doc.write"],"context":["layers"]}}"#),
|
||||
format!(r#"{{"id":"{some}","name":"x","kind":"filter","api":2,"permissions":["doc.read"],"context":["layers"]}}"#),
|
||||
] {
|
||||
let data = vectorcraft_format::base64_encode(&wat::parse_str(tpl::returning(&manifest, r#"{"objects":[]}"#)).unwrap());
|
||||
let e = s.execute("plugin.install", &json!({"dataBase64": data, "grant": ["doc.read", "doc.write"], "replace": true})).unwrap_err();
|
||||
assert!(e.to_string().contains(needs), "{manifest}: {e}");
|
||||
}
|
||||
}
|
||||
|
||||
/// A plug-in command, of a filter or of a live effect, whose manifest lists `context` is given it
|
||||
/// too, with nothing selected.
|
||||
#[test]
|
||||
fn a_plugin_command_reads_the_document_context_without_a_selection() {
|
||||
let mut s = session();
|
||||
let made = json!({"objects": [{"path": triangle(), "name": "Saw layers"}]}).to_string();
|
||||
for (id, kind, permissions) in [
|
||||
("test.engine.context.command", "filter", r#"["doc.read","doc.write"]"#),
|
||||
("test.engine.context.effectcommand", "effect", r#"["doc.read","doc.write","effect.render"]"#),
|
||||
] {
|
||||
let manifest = format!(
|
||||
r#"{{"id":"{id}","name":"Test {id}","kind":"{kind}","api":3,"permissions":{permissions},"context":["layers"],"commands":[{{"id":"look","label":"Look"}}]}}"#
|
||||
);
|
||||
let src = tpl::when_given_else(&manifest, tpl::Given::Params, r#""layers":["#, &made, r#"{"objects":[]}"#);
|
||||
let data = vectorcraft_format::base64_encode(&wat::parse_str(src).unwrap());
|
||||
let grant: Vec<Value> = serde_json::from_str(permissions).unwrap();
|
||||
run(&mut s, "plugin.install", json!({"dataBase64": data, "grant": grant, "replace": true}));
|
||||
run(&mut s, "select.none", json!({}));
|
||||
let ids = run(&mut s, &format!("plugin.{id}.look"), json!({}))["ids"].clone();
|
||||
assert_eq!(ids.as_array().map(Vec::len), Some(1), "{kind}: {ids}");
|
||||
assert_eq!(node(&s, NodeId(ids[0].as_u64().unwrap())).name.as_deref(), Some("Saw layers"), "{kind}");
|
||||
}
|
||||
}
|
||||
|
||||
/// A document context holds at most [`cmd::plugin::MAX_CONTEXT_ITEMS`] rows in
|
||||
/// [`cmd::plugin::MAX_CONTEXT_BYTES`] bytes: past either, the run fails before the plug-in starts,
|
||||
/// with the document and undo history as they were. Each row comes off the run's instruction
|
||||
/// budget.
|
||||
#[test]
|
||||
fn the_document_context_is_capped_and_its_rows_cost_instructions() {
|
||||
use cmd::plugin::{CONTEXT_FUEL_PER_ITEM, FilterRun, MAX_CONTEXT_BYTES, MAX_CONTEXT_ITEMS};
|
||||
let mut s = session();
|
||||
let id = "test.engine.context.cap";
|
||||
install_reading(&mut s, &tpl::returning(&context_manifest(id, r#"["swatches"]"#, ""), r#"{"objects":[]}"#));
|
||||
let p = json!({"id": id});
|
||||
let listed = run(&mut s, "swatch.list", json!({}))["swatches"].as_array().unwrap().len();
|
||||
let add = |s: &mut Session, n: usize| {
|
||||
s.edit("Set up", |d, _| {
|
||||
let base = d.swatches.last().unwrap().clone();
|
||||
let at = d.swatches.len();
|
||||
d.swatches.extend((at..at + n).map(|i| vectorcraft_color::Swatch { name: format!("Many {i}"), ..base.clone() }));
|
||||
Ok(())
|
||||
})
|
||||
.unwrap();
|
||||
};
|
||||
add(&mut s, MAX_CONTEXT_ITEMS - listed);
|
||||
let full = FilterRun::prepare(&s, &p).unwrap();
|
||||
assert_eq!(full.params_json()["_context"]["document"]["swatches"].as_array().map(Vec::len), Some(MAX_CONTEXT_ITEMS));
|
||||
assert_eq!(full.limits().fuel_base, full.plugin().limits().fuel_base - MAX_CONTEXT_ITEMS as u64 * CONTEXT_FUEL_PER_ITEM);
|
||||
let too_large = "the document information the plug-in asks for is too large to hand over";
|
||||
add(&mut s, 1);
|
||||
let refused = |s: &mut Session| {
|
||||
let Err(e) = FilterRun::prepare(s, &p) else { panic!("prepared past the cap") };
|
||||
assert!(e.to_string().contains(too_large), "{e}");
|
||||
let (doc, undo) = (s.doc().unwrap().doc.clone(), s.doc().unwrap().history.undo.len());
|
||||
let e = s.execute("plugin.run", &p).unwrap_err().to_string();
|
||||
assert!(e.contains(too_large), "{e}");
|
||||
assert_eq!((&s.doc().unwrap().doc, s.doc().unwrap().history.undo.len()), (&doc, undo));
|
||||
};
|
||||
refused(&mut s);
|
||||
// A few rows past the byte cap are refused as well.
|
||||
run(&mut s, "edit.undo", json!({}));
|
||||
run(&mut s, "edit.undo", json!({}));
|
||||
s.edit("Set up", |d, _| {
|
||||
d.swatches.last_mut().unwrap().name = "n".repeat(MAX_CONTEXT_BYTES);
|
||||
Ok(())
|
||||
})
|
||||
.unwrap();
|
||||
refused(&mut s);
|
||||
}
|
||||
|
||||
/// A run past its memory budget fails before the plug-in starts, with the document and undo
|
||||
/// history as they were: a read-only object whose other fields don't fit, a path and a compound
|
||||
/// path that don't fit, and parameters past the input's half of the cap, with objects selected or
|
||||
|
||||
@@ -906,6 +906,77 @@ proptest! {
|
||||
vectorcraft_plugins::registry::revoke("fuzz.inputs");
|
||||
}
|
||||
|
||||
/// Manifests with a hostile `context` (unknown, repeated and oddly cased sections, long lists,
|
||||
/// junk of every type) with any `api`, kind and permissions parse to an error or to a filter, or
|
||||
/// a live effect with commands, at `api` 3 or later asking for each section once, whose
|
||||
/// `permissions` list `doc.read` so that installing it asks for approval. One that installs and
|
||||
/// echoes its input, with or without a selection, leaves the document as it was, and it still
|
||||
/// renders.
|
||||
#[test]
|
||||
fn hostile_manifest_context_never_crash(
|
||||
kind in prop::sample::select(vec!["filter", "effect", "exporter"]),
|
||||
commands in any::<bool>(),
|
||||
names in prop::collection::vec(prop::sample::select(vec!["settings", "artboards", "layers", "swatches", "Layers", "document", ""]), 0..6),
|
||||
long in prop::option::weighted(0.1, 5usize..300),
|
||||
context in prop::option::weighted(0.8, prop_oneof![Just(Value::Null), arb_junk()]),
|
||||
api in prop_oneof![2 => Just(json!(3)), 1 => Just(json!(2)), 1 => Just(json!(4)), 1 => arb_junk()],
|
||||
permissions in prop_oneof![Just(Value::Null), Just(json!([])), Just(json!(["doc.read", "doc.write"])), Just(json!(["doc.read", "effect.render"])), Just(json!(["doc.write"]))],
|
||||
select in any::<bool>(),
|
||||
) {
|
||||
let mut m = json!({"id": "fuzz.context", "name": "Context", "kind": kind, "api": api});
|
||||
if kind == "exporter" {
|
||||
m["extensions"] = json!(["fz"]);
|
||||
}
|
||||
if commands {
|
||||
m["commands"] = json!([{"id": "c", "label": "C"}]);
|
||||
}
|
||||
if !permissions.is_null() {
|
||||
m["permissions"] = permissions;
|
||||
}
|
||||
m["context"] = match (context, long) {
|
||||
(_, Some(n)) => json!(vec!["layers"; n]),
|
||||
(Some(Value::Null) | None, None) => json!(names),
|
||||
(Some(junk), None) => junk,
|
||||
};
|
||||
let text = m.to_string();
|
||||
let parsed = catch_quiet(|| vectorcraft_plugins::Manifest::parse(text.as_bytes()));
|
||||
let parsed = parsed.map_err(|msg| TestCaseError::fail(format!("panicked on {text}: {msg}")))?;
|
||||
if let Ok(man) = &parsed {
|
||||
let sections = man.context_sections();
|
||||
prop_assert_eq!(sections.len(), man.context.len(), "{}", text);
|
||||
prop_assert!(sections.iter().enumerate().all(|(i, k)| !sections[..i].contains(k)), "{}", text);
|
||||
let kind_ok = man.kind == Kind::Filter || (man.kind == Kind::Effect && !man.commands.is_empty());
|
||||
prop_assert!(sections.is_empty() || (kind_ok && man.api >= 3), "{}", text);
|
||||
let reads = man.permissions.as_ref().is_some_and(|p| p.iter().any(|n| n == "doc.read"));
|
||||
prop_assert!(sections.is_empty() || (man.asks_permissions() && reads), "{}", text);
|
||||
}
|
||||
let mut s = rich_session();
|
||||
s.allow_plugin_grants_from_requests();
|
||||
let module = wat::parse_str(tpl::module(&text, tpl::ECHO, "", 1)).unwrap();
|
||||
let data = vectorcraft_format::base64_encode(&module);
|
||||
let grant = json!(["doc.read", "doc.write", "state", "effect.render", "export.write"]);
|
||||
let before = s.doc().unwrap().doc.clone();
|
||||
let r = catch_quiet(|| {
|
||||
let installed = s.execute("plugin.install", &json!({"dataBase64": data, "grant": grant})).is_ok();
|
||||
let _ = s.execute(if select { "select.all" } else { "select.none" }, &json!({}));
|
||||
let ran = installed && s.execute("plugin.run", &json!({"id": "fuzz.context"})).is_ok();
|
||||
if installed {
|
||||
for c in s.commands().into_iter().filter(|c| c.id.starts_with("plugin.fuzz.context.")) {
|
||||
let _ = s.execute(c.id, &json!({}));
|
||||
}
|
||||
}
|
||||
(installed, ran)
|
||||
});
|
||||
let (installed, ran) = r.map_err(|msg| TestCaseError::fail(format!("panicked running {text}: {msg}")))?;
|
||||
prop_assert!(!installed || parsed.is_ok(), "a manifest that doesn't parse installed: {}", text);
|
||||
if ran {
|
||||
prop_assert!(s.doc().unwrap().doc.layers == before.layers, "an echo changed the document: {}", text);
|
||||
}
|
||||
renders(&s, &text)?;
|
||||
vectorcraft_plugins::registry::remove("fuzz.context");
|
||||
vectorcraft_plugins::registry::revoke("fuzz.context");
|
||||
}
|
||||
|
||||
/// A plug-in that calls the storage imports with hostile keys (`..`, separators, device names,
|
||||
/// control characters, too long), values, lengths up to about 1 MiB and pointers in and out of
|
||||
/// its memory runs to an output, or on a small budget to its instruction budget, never a panic;
|
||||
|
||||
@@ -53,7 +53,7 @@ pub mod wat;
|
||||
|
||||
pub use dialog::ParamUi;
|
||||
pub use host::{LogLevel, LogLine, Report};
|
||||
pub use manifest::{Budget, Command, InputKind, Kind, Manifest, MenuPlace, Param, ParamSpec};
|
||||
pub use manifest::{Budget, Command, ContextSection, InputKind, Kind, Manifest, MenuPlace, Param, ParamSpec};
|
||||
pub use runtime::{ABI_VERSION, HEAVY_FUEL, HEAVY_WALL_TIME_MS, LARGE_FUEL, Limits, Plugin, heavy_terms};
|
||||
#[doc(hidden)]
|
||||
pub use runtime::{BYTES_COPIED_PER_FUEL, FUEL_SLICE};
|
||||
|
||||
@@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
|
||||
use serde_json::{Map, Value, json};
|
||||
|
||||
use crate::dialog::ParamUi;
|
||||
use crate::permissions::{self, API_LEVEL, INPUTS_API, PROGRESS_API, Permission};
|
||||
use crate::permissions::{self, API_LEVEL, CONTEXT_API, INPUTS_API, PROGRESS_API, Permission};
|
||||
use crate::{Error, Result};
|
||||
|
||||
/// Longest manifest the host reads.
|
||||
@@ -164,6 +164,45 @@ impl InputKind {
|
||||
}
|
||||
}
|
||||
|
||||
/// A part of the active document a filter or a plug-in command asks to be given in
|
||||
/// `_context.document`, with or without a selection (its manifest's `context`, plug-in API level 3):
|
||||
/// plain values to read, never objects.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
pub enum ContextSection {
|
||||
/// The document's name (never its path), color mode, units, the active artboard's size, the
|
||||
/// bleed and the raster effects resolution.
|
||||
Settings,
|
||||
/// Every artboard's id, name and rectangle, and which one is active.
|
||||
Artboards,
|
||||
/// Every layer and sublayer: name, visibility, lock, nesting, and which one is current.
|
||||
Layers,
|
||||
/// Every swatch, as `swatch.list` lists it.
|
||||
Swatches,
|
||||
}
|
||||
|
||||
impl ContextSection {
|
||||
/// Every section, in the order the docs list them.
|
||||
pub const ALL: [ContextSection; 4] = [ContextSection::Settings, ContextSection::Artboards, ContextSection::Layers, ContextSection::Swatches];
|
||||
|
||||
/// Its name in `context`, which is also its key in `_context.document`.
|
||||
pub fn name(self) -> &'static str {
|
||||
match self {
|
||||
ContextSection::Settings => "settings",
|
||||
ContextSection::Artboards => "artboards",
|
||||
ContextSection::Layers => "layers",
|
||||
ContextSection::Swatches => "swatches",
|
||||
}
|
||||
}
|
||||
|
||||
/// The section named `name`.
|
||||
pub fn parse(name: &str) -> Option<ContextSection> {
|
||||
ContextSection::ALL.into_iter().find(|s| s.name() == name)
|
||||
}
|
||||
}
|
||||
|
||||
/// The error of a `context` that is not a list of distinct section names.
|
||||
const CONTEXT_LIST: &str = "`context` must list distinct sections: settings, artboards, layers or swatches";
|
||||
|
||||
/// How much one run of a plug-in may compute.
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
@@ -417,6 +456,12 @@ pub struct Manifest {
|
||||
/// lists them. Left out or empty, it is given paths and compound paths alone.
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty", deserialize_with = "input_names")]
|
||||
pub inputs: Vec<String>,
|
||||
/// The parts of the document a run is given in `_context.document`, by
|
||||
/// [`ContextSection::name`]: only a filter, or a live effect with `commands` (for its command
|
||||
/// runs), at `api` 3 or later whose `permissions` list `doc.read` lists them. Left out or empty,
|
||||
/// a run is given none.
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty", deserialize_with = "context_names")]
|
||||
pub context: Vec<String>,
|
||||
/// Parameters in declaration (dialog) order; a JSON object `{"name": spec, …}` in the manifest.
|
||||
#[serde(default, deserialize_with = "ordered_params", serialize_with = "params_as_object")]
|
||||
pub params: Vec<(String, Param)>,
|
||||
@@ -469,6 +514,7 @@ impl Manifest {
|
||||
api: 1,
|
||||
permissions: None,
|
||||
inputs: Vec::new(),
|
||||
context: Vec::new(),
|
||||
params: Vec::new(),
|
||||
extensions: Vec::new(),
|
||||
budget: Budget::Light,
|
||||
@@ -539,6 +585,7 @@ impl Manifest {
|
||||
return Err(Error::Manifest(format!("permission `{permission}` needs plug-in API level {PROGRESS_API}: give `api` {PROGRESS_API}")));
|
||||
}
|
||||
self.validate_inputs()?;
|
||||
self.validate_context()?;
|
||||
if self.paint_output && (self.kind != Kind::Effect || self.api < 2) {
|
||||
return Err(Error::Manifest("`paintOutput` is only for a live effect (`kind` \"effect\") at `api` 2".into()));
|
||||
}
|
||||
@@ -635,6 +682,33 @@ impl Manifest {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// `context` names each [`ContextSection`] at most once, and only a filter, or a live effect
|
||||
/// with commands, at `api` 3 or later lists any, with a `permissions` list that holds
|
||||
/// `doc.read`: installing it then asks the user to grant it ([`Manifest::asks_permissions`]).
|
||||
fn validate_context(&self) -> Result<()> {
|
||||
if self.context.is_empty() {
|
||||
return Ok(());
|
||||
}
|
||||
for (i, name) in self.context.iter().enumerate() {
|
||||
if ContextSection::parse(name).is_none() || self.context.get(..i).is_some_and(|before| before.contains(name)) {
|
||||
return Err(Error::Manifest(CONTEXT_LIST.into()));
|
||||
}
|
||||
}
|
||||
let runs = self.kind == Kind::Filter || (self.kind == Kind::Effect && !self.commands.is_empty());
|
||||
let reads = self.permissions.as_ref().is_some_and(|p| p.iter().any(|n| n == Permission::DocRead.name()));
|
||||
if !runs || self.api < CONTEXT_API || !reads {
|
||||
return Err(Error::Manifest(
|
||||
"`context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read`".into(),
|
||||
));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// The parts of the document it asks to be given (`context`).
|
||||
pub fn context_sections(&self) -> Vec<ContextSection> {
|
||||
self.context.iter().filter_map(|n| ContextSection::parse(n)).collect()
|
||||
}
|
||||
|
||||
/// A filter or a live effect lists at most [`MAX_COMMANDS`] commands, each with a distinct
|
||||
/// id, a printable label and parameters declared as the manifest's own are. A heavy filter
|
||||
/// lists none. The error names the command: its id, or its place in the list.
|
||||
@@ -850,6 +924,18 @@ fn input_names<'de, D: serde::Deserializer<'de>>(d: D) -> std::result::Result<Ve
|
||||
}
|
||||
}
|
||||
|
||||
/// Reads `context`: a list of names (`null`: none). Anything else is the error
|
||||
/// [`Manifest::validate_context`] gives a wrong entry.
|
||||
fn context_names<'de, D: serde::Deserializer<'de>>(d: D) -> std::result::Result<Vec<String>, D::Error> {
|
||||
match Value::deserialize(d)? {
|
||||
Value::Null => Ok(Vec::new()),
|
||||
Value::Array(names) => {
|
||||
names.into_iter().map(|n| if let Value::String(s) = n { Ok(s) } else { Err(serde::de::Error::custom(CONTEXT_LIST)) }).collect()
|
||||
}
|
||||
_ => Err(serde::de::Error::custom(CONTEXT_LIST)),
|
||||
}
|
||||
}
|
||||
|
||||
/// Reads the `commands` list one entry at a time from the manifest itself, so each command's
|
||||
/// `params` keep their declaration order and a repeated parameter is refused. A malformed entry
|
||||
/// is an error that names it (its id when the id comes before the fault, otherwise its place in
|
||||
@@ -1241,7 +1327,7 @@ mod tests {
|
||||
(r#"{"id":"a","name":"x","kind":"filter","api":1,"permissions":["progress"]}"#, "`progress` needs plug-in API level 2"),
|
||||
(r#"{"id":"a","name":"x","kind":"filter","permissions":["settings"]}"#, "`settings` needs plug-in API level 2"),
|
||||
(r#"{"id":"a","name":"x","kind":"filter","api":1,"permissions":["doc.read","cache"]}"#, "`cache` needs plug-in API level 2"),
|
||||
(r#"{"id":"a","name":"x","kind":"filter","api":3}"#, "`api` is 3"),
|
||||
(r#"{"id":"a","name":"x","kind":"filter","api":4}"#, "`api` is 4; this host implements plug-in API levels 1 to 3"),
|
||||
(r#"{"id":"a","name":"x","kind":"filter","api":0}"#, "`api` is 0"),
|
||||
(r#"{"id":"a","name":"x","kind":"filter","api":-1}"#, "manifest"),
|
||||
] {
|
||||
@@ -1297,6 +1383,51 @@ mod tests {
|
||||
assert!(Manifest::parse(long.as_bytes()).unwrap_err().to_string().contains("twice"));
|
||||
}
|
||||
|
||||
/// A filter, or a live effect with commands, at `api` 3 may ask for parts of the document
|
||||
/// (`context`), each once, with a `permissions` list holding `doc.read`, so installing it asks
|
||||
/// for approval. Left out or empty, it asks for none and isn't written back. Anything else is
|
||||
/// refused naming `context`.
|
||||
#[test]
|
||||
fn a_level_3_plugin_lists_the_document_context_it_reads() {
|
||||
let m = Manifest::parse(
|
||||
br#"{"id":"a","name":"x","kind":"filter","api":3,"permissions":["doc.read"],"context":["settings","artboards","layers","swatches"]}"#,
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(m.context_sections(), ContextSection::ALL);
|
||||
assert!(m.asks_permissions());
|
||||
assert_eq!(serde_json::to_value(&m).unwrap()["context"], json!(["settings", "artboards", "layers", "swatches"]));
|
||||
let effect = br#"{"id":"a","name":"x","kind":"effect","api":3,"permissions":["doc.read","effect.render"],"context":["layers"],"commands":[{"id":"c","label":"C"}]}"#;
|
||||
assert_eq!(Manifest::parse(effect).unwrap().context_sections(), [ContextSection::Layers]);
|
||||
for none in [r#"{"id":"a","name":"x","kind":"filter","context":[]}"#, r#"{"id":"a","name":"x","kind":"filter","api":3,"context":null}"#] {
|
||||
let m = Manifest::parse(none.as_bytes()).unwrap();
|
||||
assert!(m.context_sections().is_empty(), "{none}");
|
||||
assert!(serde_json::to_value(&m).unwrap().get("context").is_none(), "{none}");
|
||||
}
|
||||
let list = "`context` must list distinct sections";
|
||||
let needs = "`context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read`";
|
||||
for (bad, says) in [
|
||||
(r#"{"id":"a","name":"x","kind":"filter","api":3,"permissions":["doc.read"],"context":["paths"]}"#, list),
|
||||
(r#"{"id":"a","name":"x","kind":"filter","api":3,"permissions":["doc.read"],"context":["Layers"]}"#, list),
|
||||
(r#"{"id":"a","name":"x","kind":"filter","api":3,"permissions":["doc.read"],"context":["layers","layers"]}"#, list),
|
||||
(r#"{"id":"a","name":"x","kind":"filter","api":3,"permissions":["doc.read"],"context":"layers"}"#, list),
|
||||
(r#"{"id":"a","name":"x","kind":"filter","api":3,"permissions":["doc.read"],"context":[1]}"#, list),
|
||||
(r#"{"id":"a","name":"x","kind":"filter","api":3,"permissions":["doc.read"],"context":{"layers":true}}"#, list),
|
||||
(r#"{"id":"a","name":"x","kind":"filter","api":2,"permissions":["doc.read"],"context":["layers"]}"#, needs),
|
||||
(r#"{"id":"a","name":"x","kind":"filter","permissions":["doc.read"],"context":["layers"]}"#, needs),
|
||||
(r#"{"id":"a","name":"x","kind":"filter","api":3,"context":["layers"]}"#, needs),
|
||||
(r#"{"id":"a","name":"x","kind":"filter","api":3,"permissions":["doc.write"],"context":["layers"]}"#, needs),
|
||||
(r#"{"id":"a","name":"x","kind":"effect","api":3,"permissions":["doc.read","effect.render"],"context":["layers"]}"#, needs),
|
||||
(
|
||||
r#"{"id":"a","name":"x","kind":"exporter","extensions":["plt"],"api":3,"permissions":["doc.read","export.write"],"context":["layers"]}"#,
|
||||
needs,
|
||||
),
|
||||
(r#"{"id":"a","name":"x","kind":"importer","extensions":["plt"],"api":3,"permissions":["import.read"],"context":["layers"]}"#, needs),
|
||||
] {
|
||||
let e = Manifest::parse(bad.as_bytes()).unwrap_err().to_string();
|
||||
assert!(e.contains(says), "{bad}: {e}");
|
||||
}
|
||||
}
|
||||
|
||||
/// A live effect at `api` 2 may declare `"paintOutput": true`, and only that value; any other
|
||||
/// kind or level, and `false`, `null` or another type, is refused naming the key. Without the
|
||||
/// key, at any level, the effect returns geometry only.
|
||||
|
||||
@@ -15,8 +15,8 @@ use crate::{Error, Kind, Result};
|
||||
|
||||
/// The plug-in API level this host implements. A manifest's `api` (1 when left out) may be at most
|
||||
/// this. Level 2 adds the host imports ([`PROGRESS_API`]) and a live effect's `paintOutput`
|
||||
/// ([`crate::painted`]).
|
||||
pub const API_LEVEL: u32 = 2;
|
||||
/// ([`crate::painted`]); level 3 adds a manifest's `context` ([`CONTEXT_API`]).
|
||||
pub const API_LEVEL: u32 = 3;
|
||||
|
||||
/// The API level that adds the host imports ([`crate::host::IMPORTS`]) and the `progress`,
|
||||
/// `settings`, `cache` and `commands` permissions they need.
|
||||
@@ -29,6 +29,10 @@ pub const INPUTS_API: u32 = 2;
|
||||
/// is ignored.
|
||||
pub const MENU_API: u32 = 2;
|
||||
|
||||
/// The API level that adds a manifest's `context` ([`crate::ContextSection`]): the document's
|
||||
/// settings, artboards, layers and swatches, given to a run with or without a selection.
|
||||
pub const CONTEXT_API: u32 = 3;
|
||||
|
||||
/// Most permissions a manifest may list.
|
||||
pub const MAX_PERMISSIONS: usize = 16;
|
||||
|
||||
@@ -46,7 +50,8 @@ pub const RESERVED: &[&str] = &["ui.panel", "ui.tool"];
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
|
||||
pub enum Permission {
|
||||
/// Read the objects the host hands it: a filter's selected paths, the object a live effect is
|
||||
/// on, the document an exporter writes.
|
||||
/// on, the document an exporter writes; and the document information a manifest's `context`
|
||||
/// asks for ([`crate::ContextSection`]).
|
||||
#[serde(rename = "doc.read")]
|
||||
DocRead,
|
||||
/// Change, add and delete objects (a filter's output), as one undo step.
|
||||
|
||||
@@ -7370,6 +7370,7 @@ axis Y Axis Y ос
|
||||
Automation asked to install this plug-in. To install it, choose Object › Plug-ins › Install Plug-in… yourself. Автоматизация поиска инсталирането на тази приставка. За да я инсталирате, изберете Обект › Приставки › Инсталиране на приставка… сами.
|
||||
File SHA-256: {hash} SHA-256 на файла: {hash}
|
||||
Read the objects it is given Четене на обектите, които получава
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches Четене на обектите, които получава, както и на настройките, работните области, слоевете и образците на документа
|
||||
Change, add and delete objects in the document Промяна, добавяне и изтриване на обекти в документа
|
||||
Keep data of its own with the document Съхраняване на собствени данни в документа
|
||||
Change how the objects its effect is applied to are drawn Промяна на начина, по който се рисуват обектите, към които е приложен ефектът му
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -6727,6 +6727,7 @@ axis Y Axis Y osa
|
||||
@msg “{name}” is another module than the plug-in with id {_1} and would get the settings and cache kept for it: install it with `replace: true` once the user agrees „{name}” je drugi modul od dodatka s ID-om {_1} i dobio bi postavke i predmemoriju sačuvane za njega: instalirajte ga s `replace: true` kada korisnik pristane
|
||||
File SHA-256: {hash} SHA-256 datoteke: {hash}
|
||||
Read the objects it is given Čitati objekte koje dobije
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches Čitati objekte koje dobije, kao i postavke, radne ploče, slojeve i uzorke boja dokumenta
|
||||
Change, add and delete objects in the document Mijenjati, dodavati i brisati objekte u dokumentu
|
||||
Keep data of its own with the document Čuvati vlastite podatke uz dokument
|
||||
Change how the objects its effect is applied to are drawn Mijenjati kako se crtaju objekti na koje je primijenjen njegov efekt
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -7908,6 +7908,10 @@ variable-list-end {0}, {1} {0} i {1}
|
||||
@msg `inputs` lists `{shown}` twice `inputs` inclou `{shown}` dues vegades
|
||||
@msg `inputs` needs `api` 2 or later `inputs` requereix `api` 2 o posterior
|
||||
@msg `inputs` needs the permission `doc.read` `inputs` requereix el permís `doc.read`
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches Llegir els objectes que rep, i la configuració, els taulers, les capes i les mostres del document
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context` ha de llistar seccions diferents: settings, artboards, layers o swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` és per a un filtre, o un efecte dinàmic amb `commands`, amb `api` 3 o posterior i el permís `doc.read`
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes la informació del document que demana el complement és massa gran per passar-la: com a màxim {MAX_CONTEXT_ITEMS} taulers, capes i mostres en {MAX_CONTEXT_BYTES} bytes
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) pressupost de memòria (l’objecte {_1} necessita {size} bytes d’entrada, en queden {left})
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) pressupost d’objectes (més de {MAX_OBJECTS} objectes de només lectura)
|
||||
@msg instruction budget pressupost d’instruccions
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7521,6 +7521,10 @@ axis Y Axis osa Y
|
||||
@msg `inputs` lists `{shown}` twice `inputs` uvádí `{shown}` dvakrát
|
||||
@msg `inputs` needs `api` 2 or later `inputs` vyžaduje `api` 2 nebo vyšší
|
||||
@msg `inputs` needs the permission `doc.read` `inputs` vyžaduje oprávnění `doc.read`
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches Číst objekty, které dostane, a nastavení, pracovní plochy, vrstvy a vzorky dokumentu
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context` musí uvádět různé oddíly: settings, artboards, layers nebo swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` je pro filtr nebo živý efekt s `commands`, s `api` 3 nebo vyšším a s oprávněním `doc.read`
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes informace o dokumentu, které zásuvný modul požaduje, jsou příliš velké na předání: nejvýše {MAX_CONTEXT_ITEMS} pracovních ploch, vrstev a vzorků v {MAX_CONTEXT_BYTES} bajtech
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) rozpočet paměti (objekt {_1} potřebuje {size} bajtů vstupu, zbývá {left})
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) rozpočet objektů (více než {MAX_OBJECTS} objektů jen pro čtení)
|
||||
@msg instruction budget rozpočet instrukcí
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -718,6 +718,10 @@ liquify-list-end {0}, {1} {0} og {1}
|
||||
@msg `inputs` lists `{shown}` twice `inputs` angiver `{shown}` to gange
|
||||
@msg `inputs` needs `api` 2 or later `inputs` kræver `api` 2 eller nyere
|
||||
@msg `inputs` needs the permission `doc.read` `inputs` kræver tilladelsen `doc.read`
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches Læse de objekter, den får, og dokumentets indstillinger, tegneflader, lag og farveprøver
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context` skal angive forskellige afsnit: settings, artboards, layers eller swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` er til et filter eller en live-effekt med `commands`, ved `api` 3 eller senere og med tilladelsen `doc.read`
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes de dokumentoplysninger, som plug-in'et beder om, er for store til at blive overdraget: højst {MAX_CONTEXT_ITEMS} tegneflader, lag og farveprøver i {MAX_CONTEXT_BYTES} byte
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) hukommelsesbudget (objekt {_1} kræver {size} byte input, {left} tilbage)
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) objektbudget (mere end {MAX_OBJECTS} skrivebeskyttede objekter)
|
||||
@msg instruction budget instruktionsbudget
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7104,6 +7104,10 @@ axis Y Axis Y-Achse
|
||||
@msg `inputs` lists `{shown}` twice `inputs` führt `{shown}` doppelt auf
|
||||
@msg `inputs` needs `api` 2 or later `inputs` erfordert `api` 2 oder höher
|
||||
@msg `inputs` needs the permission `doc.read` `inputs` erfordert die Berechtigung `doc.read`
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches Die Objekte lesen, die es erhält, sowie die Einstellungen, Zeichenflächen, Ebenen und Farbfelder des Dokuments
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context` muss verschiedene Abschnitte aufführen: settings, artboards, layers oder swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` gilt für einen Filter oder einen Live-Effekt mit `commands`, mit `api` 3 oder höher und der Berechtigung `doc.read`
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes die Dokumentinformationen, die das Plug-in anfordert, sind zu groß zum Übergeben: höchstens {MAX_CONTEXT_ITEMS} Zeichenflächen, Ebenen und Farbfelder in {MAX_CONTEXT_BYTES} Byte
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) Speicherbudget (Objekt {_1} benötigt {size} Byte Eingabe, {left} verbleiben)
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) Objektbudget (mehr als {MAX_OBJECTS} schreibgeschützte Objekte)
|
||||
@msg instruction budget Anweisungsbudget
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7511,6 +7511,10 @@ axis Y Axis Άξονας Y
|
||||
@msg `inputs` lists `{shown}` twice το `inputs` αναφέρει το `{shown}` δύο φορές
|
||||
@msg `inputs` needs `api` 2 or later το `inputs` απαιτεί `api` 2 ή νεότερο
|
||||
@msg `inputs` needs the permission `doc.read` το `inputs` απαιτεί το δικαίωμα `doc.read`
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches Ανάγνωση των αντικειμένων που του δίνονται, καθώς και των ρυθμίσεων, των πινάκων σχεδίασης, των επιπέδων και των δειγμάτων χρωμάτων του εγγράφου
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches το `context` πρέπει να απαριθμεί διαφορετικές ενότητες: settings, artboards, layers ή swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` το `context` ισχύει για φίλτρο ή ζωντανό εφέ με `commands`, με `api` 3 ή νεότερο και το δικαίωμα `doc.read`
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes οι πληροφορίες εγγράφου που ζητά το πρόσθετο είναι πολύ μεγάλες για να παραδοθούν: το πολύ {MAX_CONTEXT_ITEMS} πίνακες σχεδίασης, επίπεδα και δείγματα χρωμάτων σε {MAX_CONTEXT_BYTES} byte
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) προϋπολογισμός μνήμης (το αντικείμενο {_1} χρειάζεται {size} byte εισόδου, απομένουν {left})
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) προϋπολογισμός αντικειμένων (περισσότερα από {MAX_OBJECTS} αντικείμενα μόνο για ανάγνωση)
|
||||
@msg instruction budget προϋπολογισμός εντολών
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7497,6 +7497,10 @@ axis Y Axis Eje Y
|
||||
@msg `inputs` lists `{shown}` twice `inputs` incluye `{shown}` dos veces
|
||||
@msg `inputs` needs `api` 2 or later `inputs` requiere `api` 2 o posterior
|
||||
@msg `inputs` needs the permission `doc.read` `inputs` requiere el permiso `doc.read`
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches Leer los objetos que recibe, y los ajustes, las mesas de trabajo, las capas y las muestras del documento
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context` debe enumerar secciones distintas: settings, artboards, layers o swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` es para un filtro, o un efecto dinámico con `commands`, con `api` 3 o posterior y el permiso `doc.read`
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes la información del documento que pide el plugin es demasiado grande para entregarla: como máximo {MAX_CONTEXT_ITEMS} mesas de trabajo, capas y muestras en {MAX_CONTEXT_BYTES} bytes
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) presupuesto de memoria (el objeto {_1} necesita {size} bytes de entrada, quedan {left})
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) presupuesto de objetos (más de {MAX_OBJECTS} objetos de solo lectura)
|
||||
@msg instruction budget presupuesto de instrucciones
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7588,6 +7588,10 @@ axis Y Axis Y-akseli
|
||||
@msg `inputs` lists `{shown}` twice `inputs` luettelee kohteen `{shown}` kahdesti
|
||||
@msg `inputs` needs `api` 2 or later `inputs` edellyttää `api`-tasoa 2 tai uudempaa
|
||||
@msg `inputs` needs the permission `doc.read` `inputs` edellyttää käyttöoikeutta `doc.read`
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches Lukea sille annetut objektit sekä asiakirjan asetukset, piirtoalustat, tasot ja värimallit
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context`-avaimen on lueteltava eri osiot: settings, artboards, layers tai swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` on suodattimelle tai reaaliaikaiselle tehosteelle, jolla on `commands`, tasolla `api` 3 tai uudempi ja käyttöoikeudella `doc.read`
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes laajennuksen pyytämät asiakirjan tiedot ovat liian suuret luovutettaviksi: enintään {MAX_CONTEXT_ITEMS} piirtoalustaa, tasoa ja värimallia {MAX_CONTEXT_BYTES} tavussa
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) muistibudjetti (objekti {_1} tarvitsee {size} tavua syötettä, jäljellä {left})
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) objektibudjetti (yli {MAX_OBJECTS} vain luku -objektia)
|
||||
@msg instruction budget käskybudjetti
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7518,6 +7518,10 @@ axis Y Axis Axe Y
|
||||
@msg `inputs` lists `{shown}` twice `inputs` mentionne `{shown}` deux fois
|
||||
@msg `inputs` needs `api` 2 or later `inputs` nécessite `api` 2 ou plus
|
||||
@msg `inputs` needs the permission `doc.read` `inputs` nécessite l’autorisation `doc.read`
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches Lire les objets qui lui sont transmis, ainsi que les paramètres, les plans de travail, les calques et les nuances du document
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context` doit lister des sections distinctes parmi settings, artboards, layers et swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` est réservé à un filtre, ou à un effet dynamique avec `commands`, avec `api` 3 ou plus et l’autorisation `doc.read`
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes les informations du document que demande le module externe sont trop volumineuses pour être transmises (au plus {MAX_CONTEXT_ITEMS} plans de travail, calques et nuances en {MAX_CONTEXT_BYTES} octets)
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) budget mémoire (l’objet {_1} nécessite {size} octets d’entrée, il en reste {left})
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) budget d’objets (plus de {MAX_OBJECTS} objets en lecture seule)
|
||||
@msg instruction budget budget d’instructions
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3073,6 +3073,7 @@
|
||||
Read Shortcut Set File શોર્ટકટ સેટ ફાઇલ વાંચો
|
||||
Read files you open in its format and make documents from them તમે ખોલો તે ફાઇલોને તેના ફોર્મેટમાં વાંચો અને તેમાંથી દસ્તાવેજ બનાવો
|
||||
Read the objects it is given આપેલી ઑબ્જેક્ટ્સ વાંચો
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches આપેલી ઑબ્જેક્ટ્સ અને દસ્તાવેજની સેટિંગ્સ, આર્ટબોર્ડ, લેયર્સ અને સ્વેચ વાંચો
|
||||
Reading the file… ફાઇલ વાંચી રહ્યું છે…
|
||||
Reads or sets environment variables એન્વાયર્નમેન્ટ વેરીએબલ વાંચે કે સેટ કરે છે
|
||||
Ready તૈયાર
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 72 and column 5.
|
@@ -6689,6 +6689,10 @@ arrowhead Feather पंख
|
||||
@msg `inputs` lists `{shown}` twice `inputs` में `{shown}` दो बार सूचीबद्ध है
|
||||
@msg `inputs` needs `api` 2 or later `inputs` के लिए `api` 2 या बाद का स्तर आवश्यक है
|
||||
@msg `inputs` needs the permission `doc.read` `inputs` के लिए अनुमति `doc.read` आवश्यक है
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches उसे दिए गए ऑब्जेक्ट्स, और डॉक्यूमेंट की सेटिंग्स, आर्टबोर्ड्स, लेयर्स और स्वॉचेस पढ़ना
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context` में अलग-अलग सेक्शन होने चाहिए: settings, artboards, layers या swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` केवल फ़िल्टर, या `commands` वाले लाइव इफ़ेक्ट के लिए है, `api` 3 या उसके बाद और अनुमति `doc.read` के साथ
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes प्लग-इन जो डॉक्यूमेंट जानकारी माँगता है वह सौंपने के लिए बहुत बड़ी है: {MAX_CONTEXT_BYTES} बाइट्स में अधिकतम {MAX_CONTEXT_ITEMS} आर्टबोर्ड्स, लेयर्स और स्वॉचेस
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) मेमोरी बजट (ऑब्जेक्ट {_1} को इनपुट के {size} बाइट चाहिए, {left} शेष हैं)
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) ऑब्जेक्ट बजट ({MAX_OBJECTS} से अधिक केवल-पठन ऑब्जेक्ट)
|
||||
@msg the plug-in's grant can't be removed from the plug-in store प्लग-इन की अनुमति प्लग-इन स्टोर से हटाई नहीं जा सकती
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7506,6 +7506,10 @@ axis Y Axis Y tengely
|
||||
@msg `inputs` lists `{shown}` twice az `inputs` kétszer sorolja fel ezt: `{shown}`
|
||||
@msg `inputs` needs `api` 2 or later az `inputs` használatához `api` 2 vagy újabb szükséges
|
||||
@msg `inputs` needs the permission `doc.read` az `inputs` használatához a(z) `doc.read` engedély szükséges
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches Olvashatja a kapott objektumokat, valamint a dokumentum beállításait, rajztábláit, rétegeit és színmintáit
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches a `context` csak különböző szakaszokat sorolhat fel: settings, artboards, layers vagy swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` a `context` szűrőhöz vagy `commands` kulccsal rendelkező élő effektushoz való, `api` 3 vagy újabb mellett, a(z) `doc.read` engedéllyel
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes a bővítmény által kért dokumentumadatok túl nagyok az átadáshoz: legfeljebb {MAX_CONTEXT_ITEMS} rajztábla, réteg és színminta {MAX_CONTEXT_BYTES} bájtban
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) memóriakeret (a(z) {_1} objektumnak {size} bájt bemenet kell, {left} maradt)
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) objektumkeret (több mint {MAX_OBJECTS} csak olvasható objektum)
|
||||
@msg instruction budget utasításkeret
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -600,6 +600,10 @@
|
||||
@msg `inputs` lists `{shown}` twice `inputs` mencantumkan `{shown}` dua kali
|
||||
@msg `inputs` needs `api` 2 or later `inputs` memerlukan `api` 2 atau lebih baru
|
||||
@msg `inputs` needs the permission `doc.read` `inputs` memerlukan izin `doc.read`
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches Membaca objek yang diberikan kepadanya, serta pengaturan, artboard, lapisan, dan sampel warna dokumen
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context` harus mencantumkan bagian yang berbeda: settings, artboards, layers, atau swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` untuk filter, atau efek langsung dengan `commands`, pada `api` 3 atau lebih baru dengan izin `doc.read`
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes informasi dokumen yang diminta plug-in terlalu besar untuk diserahkan: paling banyak {MAX_CONTEXT_ITEMS} artboard, lapisan, dan sampel warna dalam {MAX_CONTEXT_BYTES} byte
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) anggaran memori (objek {_1} memerlukan {size} byte masukan, tersisa {left})
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) anggaran objek (lebih dari {MAX_OBJECTS} objek baca-saja)
|
||||
@msg instruction budget anggaran instruksi
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7143,6 +7143,10 @@ axis Y Axis Asse Y
|
||||
@msg `inputs` lists `{shown}` twice `inputs` elenca `{shown}` due volte
|
||||
@msg `inputs` needs `api` 2 or later `inputs` richiede `api` 2 o successivo
|
||||
@msg `inputs` needs the permission `doc.read` `inputs` richiede l’autorizzazione `doc.read`
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches Leggere gli oggetti che riceve, e le impostazioni, le tavole da disegno, i livelli e i campioni del documento
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context` deve elencare sezioni distinte: settings, artboards, layers o swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` vale per un filtro, o un effetto dinamico con `commands`, con `api` 3 o successiva e l’autorizzazione `doc.read`
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes le informazioni sul documento chieste dal plug-in sono troppo grandi per essere passate: al massimo {MAX_CONTEXT_ITEMS} tavole da disegno, livelli e campioni in {MAX_CONTEXT_BYTES} byte
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) budget di memoria (l’oggetto {_1} richiede {size} byte di input, ne restano {left})
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) budget di oggetti (più di {MAX_OBJECTS} oggetti di sola lettura)
|
||||
@msg instruction budget budget di istruzioni
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7218,6 +7218,10 @@ axis Y Axis Y 軸
|
||||
@msg `inputs` lists `{shown}` twice `inputs` に `{shown}` が 2 回指定されています
|
||||
@msg `inputs` needs `api` 2 or later `inputs` には `api` 2 以上が必要です
|
||||
@msg `inputs` needs the permission `doc.read` `inputs` には権限 `doc.read` が必要です
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches 渡されたオブジェクトと、ドキュメントの設定、アートボード、レイヤー、スウォッチの読み取り
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context` には重複しないセクションを指定してください: settings、artboards、layers、swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` は、`api` 3 以降で権限 `doc.read` を持つフィルターまたは `commands` のあるライブ効果専用です
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes プラグインが求めるドキュメント情報が大きすぎて渡せません: アートボード、レイヤー、スウォッチは合わせて {MAX_CONTEXT_ITEMS} 個、{MAX_CONTEXT_BYTES} バイトまでです
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) メモリ予算 (オブジェクト {_1} には {size} バイトの入力が必要ですが、残りは {left} です)
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) オブジェクト予算 ({MAX_OBJECTS} 個を超える読み取り専用オブジェクト)
|
||||
@msg instruction budget 命令予算
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -9626,6 +9626,10 @@ axis Y Axis Y ღერძი
|
||||
@msg `inputs` lists `{shown}` twice `inputs`-ში `{shown}` ორჯერაა ჩამოთვლილი
|
||||
@msg `inputs` needs `api` 2 or later `inputs`-ს სჭირდება `api` 2 ან უფრო ახალი
|
||||
@msg `inputs` needs the permission `doc.read` `inputs`-ს სჭირდება ნებართვა `doc.read`
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches მიღებული ობიექტების და დოკუმენტის პარამეტრების, სამუშაო დაფების, შრეებისა და ფერის ნიმუშების წაკითხვა
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context`-ში განსხვავებული სექციები უნდა იყოს: settings, artboards, layers ან swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` განკუთვნილია ფილტრისთვის ან `commands`-ის მქონე ცოცხალი ეფექტისთვის, `api` 3-ზე ან უფრო ახალზე, ნებართვით `doc.read`
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes პლაგინის მიერ მოთხოვნილი დოკუმენტის ინფორმაცია ზედმეტად დიდია გადასაცემად: მაქსიმუმ {MAX_CONTEXT_ITEMS} სამუშაო დაფა, შრე და ფერის ნიმუში {MAX_CONTEXT_BYTES} ბაიტში
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) მეხსიერების ბიუჯეტი (ობიექტს {_1} სჭირდება შეყვანის {size} ბაიტი, დარჩენილია {left})
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) ობიექტების ბიუჯეტი ({MAX_OBJECTS}-ზე მეტი მხოლოდ წასაკითხი ობიექტი)
|
||||
@msg instruction budget ინსტრუქციების ბიუჯეტი
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7115,6 +7115,10 @@ axis Y Axis Y축
|
||||
@msg `inputs` lists `{shown}` twice `inputs`에 `{shown}`이(가) 두 번 나열되어 있습니다
|
||||
@msg `inputs` needs `api` 2 or later `inputs`에는 `api` 2 이상이 필요합니다
|
||||
@msg `inputs` needs the permission `doc.read` `inputs`에는 `doc.read` 권한이 필요합니다
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches 전달받은 개체와 문서의 설정, 아트보드, 레이어, 견본 읽기
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context`에는 서로 다른 섹션을 나열해야 합니다: settings, artboards, layers 또는 swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context`는 `api` 3 이상이고 `doc.read` 권한이 있는 필터 또는 `commands`가 있는 라이브 효과에만 쓸 수 있습니다
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes 플러그인이 요청한 문서 정보가 너무 커서 넘길 수 없습니다: 아트보드, 레이어, 견본은 {MAX_CONTEXT_BYTES}바이트 안에서 최대 {MAX_CONTEXT_ITEMS}개입니다
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) 메모리 예산(개체 {_1}에 입력 {size}바이트가 필요하지만 {left}바이트 남음)
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) 개체 예산(읽기 전용 개체 {MAX_OBJECTS}개 초과)
|
||||
@msg instruction budget 명령어 예산
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -563,6 +563,10 @@ liquify-list-end {0}, {1} {0} en {1}
|
||||
@msg `inputs` lists `{shown}` twice `inputs` noemt `{shown}` twee keer
|
||||
@msg `inputs` needs `api` 2 or later `inputs` vereist `api` 2 of hoger
|
||||
@msg `inputs` needs the permission `doc.read` `inputs` vereist de machtiging `doc.read`
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches De objecten lezen die het krijgt, en de instellingen, tekengebieden, lagen en stalen van het document
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context` moet verschillende secties noemen: settings, artboards, layers of swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` is voor een filter, of een live-effect met `commands`, bij `api` 3 of later en met de machtiging `doc.read`
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes de documentgegevens die de plug-in vraagt zijn te groot om door te geven: hoogstens {MAX_CONTEXT_ITEMS} tekengebieden, lagen en stalen in {MAX_CONTEXT_BYTES} bytes
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) geheugenbudget (object {_1} heeft {size} bytes invoer nodig, {left} over)
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) objectbudget (meer dan {MAX_OBJECTS} alleen-lezen objecten)
|
||||
@msg instruction budget instructiebudget
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7376,6 +7376,10 @@ axis Y Axis Oś Y
|
||||
@msg `inputs` lists `{shown}` twice `inputs` wymienia `{shown}` dwa razy
|
||||
@msg `inputs` needs `api` 2 or later `inputs` wymaga `api` 2 lub nowszego
|
||||
@msg `inputs` needs the permission `doc.read` `inputs` wymaga uprawnienia `doc.read`
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches Odczytywać obiekty, które otrzymuje, oraz ustawienia, obszary kompozycji, warstwy i próbki dokumentu
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context` musi wymieniać różne sekcje: settings, artboards, layers lub swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` dotyczy filtra albo efektu na żywo z `commands`, z `api` 3 lub nowszym i z uprawnieniem `doc.read`
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes informacje o dokumencie, o które prosi wtyczka, są zbyt duże, aby je przekazać: najwyżej {MAX_CONTEXT_ITEMS} obszarów kompozycji, warstw i próbek w {MAX_CONTEXT_BYTES} bajtach
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) budżet pamięci (obiekt {_1} wymaga {size} bajtów danych wejściowych, pozostało {left})
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) budżet obiektów (ponad {MAX_OBJECTS} obiektów tylko do odczytu)
|
||||
@msg instruction budget budżet instrukcji
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7420,6 +7420,10 @@ axis Y Axis Eixo Y
|
||||
@msg `inputs` lists `{shown}` twice `inputs` lista `{shown}` duas vezes
|
||||
@msg `inputs` needs `api` 2 or later `inputs` exige `api` 2 ou posterior
|
||||
@msg `inputs` needs the permission `doc.read` `inputs` exige a permissão `doc.read`
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches Ler os objetos que recebe, e as configurações, as mesas de trabalho, as camadas e as amostras do documento
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context` deve listar seções distintas: settings, artboards, layers ou swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` é para um filtro, ou um efeito dinâmico com `commands`, com `api` 3 ou posterior e a permissão `doc.read`
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes as informações do documento que o plug-in pede são grandes demais para serem entregues: no máximo {MAX_CONTEXT_ITEMS} mesas de trabalho, camadas e amostras em {MAX_CONTEXT_BYTES} bytes
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) orçamento de memória (o objeto {_1} precisa de {size} bytes de entrada, restam {left})
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) orçamento de objetos (mais de {MAX_OBJECTS} objetos somente leitura)
|
||||
@msg instruction budget orçamento de instruções
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7143,6 +7143,10 @@ axis Y Axis Ось Y
|
||||
@msg `inputs` lists `{shown}` twice в `inputs` `{shown}` указано дважды
|
||||
@msg `inputs` needs `api` 2 or later для `inputs` нужен `api` 2 или выше
|
||||
@msg `inputs` needs the permission `doc.read` для `inputs` нужно разрешение `doc.read`
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches Читать переданные ему объекты, а также параметры, монтажные области, слои и образцы документа
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context` должен перечислять разные разделы: settings, artboards, layers или swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` допустим только для фильтра или динамического эффекта с `commands`, с `api` 3 или выше и с разрешением `doc.read`
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes сведения о документе, которые запрашивает модуль, слишком велики для передачи: не более {MAX_CONTEXT_ITEMS} монтажных областей, слоев и образцов в {MAX_CONTEXT_BYTES} байтах
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) бюджет памяти (объекту {_1} нужно {size} байт входных данных, осталось {left})
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) бюджет объектов (более {MAX_OBJECTS} объектов только для чтения)
|
||||
@msg instruction budget бюджет инструкций
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7521,6 +7521,10 @@ axis Y Axis Y-axel
|
||||
@msg `inputs` lists `{shown}` twice `inputs` anger `{shown}` två gånger
|
||||
@msg `inputs` needs `api` 2 or later `inputs` kräver `api` 2 eller senare
|
||||
@msg `inputs` needs the permission `doc.read` `inputs` kräver behörigheten `doc.read`
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches Läsa objekten den får, och dokumentets inställningar, ritytor, lager och färgrutor
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context` måste ange olika avsnitt: settings, artboards, layers eller swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` gäller ett filter eller en liveeffekt med `commands`, med `api` 3 eller senare och behörigheten `doc.read`
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes dokumentinformationen som pluginet begär är för stor för att lämnas över: högst {MAX_CONTEXT_ITEMS} ritytor, lager och färgrutor på {MAX_CONTEXT_BYTES} byte
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) minnesbudget (objekt {_1} behöver {size} byte indata, {left} återstår)
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) objektbudget (fler än {MAX_OBJECTS} skrivskyddade objekt)
|
||||
@msg the plug-in's grant can't be removed from the plug-in store pluginets behörighet kan inte tas bort ur pluginlagret
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7593,6 +7593,10 @@ axis Y Axis Y ekseni
|
||||
@msg `inputs` lists `{shown}` twice `inputs` `{shown}` değerini iki kez listeliyor
|
||||
@msg `inputs` needs `api` 2 or later `inputs` için `api` 2 veya üstü gerekir
|
||||
@msg `inputs` needs the permission `doc.read` `inputs` için `doc.read` izni gerekir
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches Kendisine verilen nesneleri ve belgenin ayarlarını, çalışma yüzeylerini, katmanlarını ve renk örneklerini okuma
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context` farklı bölümleri listelemelidir: settings, artboards, layers veya swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` yalnızca `api` 3 veya sonrasında, `doc.read` izniyle bir filtre ya da `commands` içeren bir canlı efekt içindir
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes eklentinin istediği belge bilgileri aktarılamayacak kadar büyük: {MAX_CONTEXT_BYTES} bayt içinde en fazla {MAX_CONTEXT_ITEMS} çalışma yüzeyi, katman ve renk örneği
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) bellek bütçesi (nesne {_1} için {size} bayt girdi gerekiyor, {left} kaldı)
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) nesne bütçesi ({MAX_OBJECTS} adetten fazla salt okunur nesne)
|
||||
@msg instruction budget talimat bütçesi
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7125,6 +7125,10 @@ axis Y Axis Вісь Y
|
||||
@msg `inputs` lists `{shown}` twice в `inputs` `{shown}` указано двічі
|
||||
@msg `inputs` needs `api` 2 or later для `inputs` потрібен `api` 2 або новіший
|
||||
@msg `inputs` needs the permission `doc.read` для `inputs` потрібен дозвіл `doc.read`
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches Читати передані йому об’єкти, а також параметри, монтажні області, шари та зразки документа
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context` має перелічувати різні розділи: settings, artboards, layers або swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` дозволено лише для фільтра або динамічного ефекту з `commands`, з `api` 3 або вище та з дозволом `doc.read`
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes відомості про документ, які запитує модуль, завеликі для передавання: не більше {MAX_CONTEXT_ITEMS} монтажних областей, шарів і зразків у {MAX_CONTEXT_BYTES} байтах
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) бюджет пам’яті (об’єкту {_1} потрібно {size} байтів вхідних даних, залишилося {left})
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) бюджет об’єктів (понад {MAX_OBJECTS} об’єктів лише для читання)
|
||||
@msg instruction budget бюджет інструкцій
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7172,6 +7172,10 @@ axis Y Axis Trục Y
|
||||
@msg `inputs` lists `{shown}` twice `inputs` liệt kê `{shown}` hai lần
|
||||
@msg `inputs` needs `api` 2 or later `inputs` cần `api` 2 trở lên
|
||||
@msg `inputs` needs the permission `doc.read` `inputs` cần quyền `doc.read`
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches Đọc các đối tượng được trao cho nó, cùng các thiết lập, bảng vẽ, lớp và mẫu màu của tài liệu
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context` phải liệt kê các phần khác nhau: settings, artboards, layers hoặc swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` dành cho bộ lọc, hoặc hiệu ứng trực tiếp có `commands`, ở `api` 3 trở lên và có quyền `doc.read`
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes thông tin tài liệu mà plug-in yêu cầu quá lớn để chuyển giao: tối đa {MAX_CONTEXT_ITEMS} bảng vẽ, lớp và mẫu màu trong {MAX_CONTEXT_BYTES} byte
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) ngân sách bộ nhớ (đối tượng {_1} cần {size} byte đầu vào, còn lại {left})
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) ngân sách đối tượng (hơn {MAX_OBJECTS} đối tượng chỉ đọc)
|
||||
@msg instruction budget ngân sách lệnh
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7353,6 +7353,10 @@ axis Y Axis Y 轴
|
||||
@msg `inputs` lists `{shown}` twice `inputs` 列出了两次 `{shown}`
|
||||
@msg `inputs` needs `api` 2 or later `inputs` 需要 `api` 2 或更高
|
||||
@msg `inputs` needs the permission `doc.read` `inputs` 需要权限 `doc.read`
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches 读取交给它的对象,以及文档的设置、画板、图层和色板
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context` 必须列出互不相同的部分:settings、artboards、layers 或 swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` 仅适用于 `api` 3 或更高、具有权限 `doc.read` 的滤镜或带 `commands` 的实时效果
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes 增效工具请求的文档信息太大,无法传递:画板、图层和色板合计最多 {MAX_CONTEXT_ITEMS} 个,最多 {MAX_CONTEXT_BYTES} 字节
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) 内存预算(对象 {_1} 需要 {size} 字节的输入,剩余 {left})
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) 对象预算(超过 {MAX_OBJECTS} 个只读对象)
|
||||
@msg instruction budget 指令预算
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7174,6 +7174,10 @@ axis Y Axis Y 軸
|
||||
@msg `inputs` lists `{shown}` twice `inputs` 列出了兩次 `{shown}`
|
||||
@msg `inputs` needs `api` 2 or later `inputs` 需要 `api` 2 或更高
|
||||
@msg `inputs` needs the permission `doc.read` `inputs` 需要權限 `doc.read`
|
||||
Read the objects it is given, and the document's settings, artboards, layers and swatches 讀取交給它的物件,以及文件的設定、工作區域、圖層和色票
|
||||
@msg `context` must list distinct sections: settings, artboards, layers or swatches `context` 必須列出互不相同的部分:settings、artboards、layers 或 swatches
|
||||
@msg `context` is for a filter, or a live effect with `commands`, at `api` 3 or later with the permission `doc.read` `context` 僅適用於 `api` 3 或更高、具有權限 `doc.read` 的濾鏡或帶 `commands` 的即時效果
|
||||
@msg the document information the plug-in asks for is too large to hand over: at most {MAX_CONTEXT_ITEMS} artboards, layers and swatches in {MAX_CONTEXT_BYTES} bytes 增效模組要求的文件資訊太大,無法傳遞:工作區域、圖層和色票合計最多 {MAX_CONTEXT_ITEMS} 個,最多 {MAX_CONTEXT_BYTES} 位元組
|
||||
@msg memory budget (object {_1} needs {size} bytes of input, {left} left) 記憶體預算(物件 {_1} 需要 {size} 位元組的輸入,剩餘 {left})
|
||||
@msg object budget (more than {MAX_OBJECTS} read-only objects) 物件預算(超過 {MAX_OBJECTS} 個唯讀物件)
|
||||
@msg instruction budget 指令預算
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -262,12 +262,17 @@ pub fn install_plugin(app: &mut VectorcraftApp, p: &Value) -> Result<Value, Stri
|
||||
}
|
||||
|
||||
/// What permission `name` lets a plug-in do, in plain words in the UI language, with the ids of
|
||||
/// the `commands` it may call for `commands`; a name the app doesn't know is shown as it is.
|
||||
fn permission_words(name: &str, commands: &[String]) -> String {
|
||||
/// the `commands` it may call for `commands`, and for `doc.read` of a plug-in whose manifest asks
|
||||
/// for document information (`context`), that information too; a name the app doesn't know is
|
||||
/// shown as it is.
|
||||
fn permission_words(name: &str, commands: &[String], context: bool) -> String {
|
||||
let words = match permissions::Permission::parse(name) {
|
||||
Some(permissions::Permission::Commands) => {
|
||||
return crate::i18n::fmt(tl!("Run these commands on the document: {ids}"), &[("ids", &commands.join(", "))]);
|
||||
}
|
||||
Some(permissions::Permission::DocRead) if context => {
|
||||
tl!("Read the objects it is given, and the document's settings, artboards, layers and swatches")
|
||||
}
|
||||
Some(permissions::Permission::DocRead) => tl!("Read the objects it is given"),
|
||||
Some(permissions::Permission::DocWrite) => tl!("Change, add and delete objects in the document"),
|
||||
Some(permissions::Permission::State) => tl!("Keep data of its own with the document"),
|
||||
@@ -343,7 +348,8 @@ pub fn install_module(app: &mut VectorcraftApp, module: Value) -> Result<Value,
|
||||
.as_array()
|
||||
.map(|ids| ids.iter().filter_map(Value::as_str).map(|id| permissions::display_text(id, permissions::MAX_SHOWN_FIELD)).collect())
|
||||
.unwrap_or_default();
|
||||
lines.extend(asked.iter().filter_map(Value::as_str).map(|p| format!("• {}", permission_words(p, &commands))));
|
||||
let context = info["context"].as_array().is_some_and(|c| !c.is_empty());
|
||||
lines.extend(asked.iter().filter_map(Value::as_str).map(|p| format!("• {}", permission_words(p, &commands, context))));
|
||||
paragraphs.push(lines.join("\n"));
|
||||
install["grant"] = Value::Array(asked.clone());
|
||||
}
|
||||
|
||||
+10
-1
@@ -13557,7 +13557,16 @@ fit makes `plugin.run` return a memory-budget error naming the object and its si
|
||||
memory-budget error `the selection is too large to hand over`, and more than 100,000 of these objects make it return
|
||||
an object-budget error. Its output returns
|
||||
each of them as `{"id": …}` or exactly as given, otherwise `plugin.run` returns an error naming the object and the
|
||||
field, and the document and undo history are unchanged. A filter at plug-in API level 2 whose manifest lists the
|
||||
field, and the document and undo history are unchanged. A filter, or a live effect with commands, at plug-in API level 3
|
||||
whose manifest lists `context` (`settings`, `artboards`, `layers`, `swatches`; `context` in its `plugin.list` entry)
|
||||
also lists `doc.read` in its `permissions`, and each filter or command run is given those parts of the active document in
|
||||
`_context.document`, with or without a selection: the document's name without its folder, color mode, units, active
|
||||
artboard size, bleed and raster effects resolution; every artboard's id, name and rectangle; every layer and sublayer
|
||||
with its id, parent, depth, name, visibility, lock, template, color and whether it is current; and every swatch as
|
||||
`swatch.list` lists it. It holds no path and no object. More than 10,000 rows, or more than 4 MiB of them, make
|
||||
`plugin.run` and the command return an error before the plug-in starts, with nothing changed, and each row takes 1,000
|
||||
instructions from the run's budget (VectorCraft's own values; docs/plugins.md, Document information). This is narrower
|
||||
than `document.inspect`, which plug-ins can't call. A filter at plug-in API level 2 whose manifest lists the
|
||||
`commands` permission and a `commandAllowlist` (both in its `plugin.list` entry) runs the commands that list names
|
||||
while it runs, through `vc_call`: the calls and its output are one undo step, and a run that fails or makes a call that
|
||||
fails leaves the documents, selections and history as they were. Without `doc.read` every call fails. A command that
|
||||
|
||||
+64
-10
@@ -28,7 +28,7 @@ in `crates/engine/src/cmd/plugin.rs`).
|
||||
|
||||
| Command | Params | What it does |
|
||||
|---|---|---|
|
||||
| `plugin.list` | `{}` | `{"plugins": [{id, name, version, kind, author, description, params, paramsSchema, effect?, format?, extensions?, budget?, commands?, commandAllowlist?, size, source, api, paintOutput?, permissions, hash, cacheBytes}], "folder": report}` (`api` is the manifest's [plug-in API level](#permissions); `budget: "heavy"` for a [heavy filter](#heavy-filters); `commands` lists its [commands](#commands); `commandAllowlist` lists the commands it may [call](#command-calls); `paintOutput: true` marks a [painted live effect](#painted-live-effects); `permissions` lists what it [may do](#permissions), `hash` is the module's SHA-256; `cacheBytes` is the size of its [cache](#settings-and-cache)) |
|
||||
| `plugin.list` | `{}` | `{"plugins": [{id, name, version, kind, author, description, params, paramsSchema, effect?, format?, extensions?, budget?, commands?, commandAllowlist?, context?, size, source, api, paintOutput?, permissions, hash, cacheBytes}], "folder": report}` (`api` is the manifest's [plug-in API level](#permissions); `context` lists the [document information](#document-information) it reads; `budget: "heavy"` for a [heavy filter](#heavy-filters); `commands` lists its [commands](#commands); `commandAllowlist` lists the commands it may [call](#command-calls); `paintOutput: true` marks a [painted live effect](#painted-live-effects); `permissions` lists what it [may do](#permissions), `hash` is the module's SHA-256; `cacheBytes` is the size of its [cache](#settings-and-cache)) |
|
||||
| `plugin.info` | `{"id"}` | One plug-in: the `plugin.list` entry plus `manifest`, `defaults` and `lastError` (a live effect's last failure). |
|
||||
| `plugin.run` | `{"id", "params"?: {…}, "ids"?: [...]}` (plug-in params may also be top-level keys) | Runs an object filter on the selection (or `ids`; an `ids` that is not a list of object ids is an error). One undo step; the result is selected, except the objects it locked or made guides. An output that changes no object and none of the data it keeps with the document ([`documentData`](#output)) records no undo step and leaves the document unmodified. |
|
||||
| `plugin.install` | `{"path": "/x/y.wasm"}` (desktop) or `{"dataBase64": "…", "name"?}`, `"replace"?: bool`, `"allowHeavy": bool = false`, `"grant"?: [permission]`, `"hash"?: "sha256 hex"` | Validates and installs a module; returns its `plugin.list` entry. The desktop app and `vectorcraft-cli` keep it in the `Plug-ins` folder next to the preferences, so it is installed again after a restart (#2541). A module with other bytes than the plug-in installed with its id, or, with none installed, one whose id has [settings and a cache](#settings-and-cache) in the `Plug-ins` folder, installs only with `replace: true`, once the user agreed; it takes that plug-in's place and gets its settings and cache. The same module installs again without `replace`, and `replace: false` refuses a module whose id is installed. A [heavy filter](#heavy-filters) installs only with `allowHeavy: true`. A plug-in whose manifest lists [permissions](#permissions) installs only when `grant` lists every one of them, unless a grant is already recorded for a module with the same SHA-256. A request's `grant` and `allowHeavy` are refused except in a session started with `vectorcraft-cli --allow-plugin-grants`. With `hash`, a module whose SHA-256 differs is refused. A module whose `commandAllowlist` lists a command no plug-in may call is refused; ids no command has are listed as `unknownCommands` ([command calls](#command-calls)). |
|
||||
@@ -100,7 +100,8 @@ replaced by a module without it.
|
||||
command whose manifest places it in another menu.
|
||||
- **Runs.** The parameters are checked against the command's declarations before the plug-in runs. The plug-in runs
|
||||
through `vc_run` on the selection (or `ids`) as a filter run does, with `_context.mode` `"command"` and
|
||||
`_context.command` set to the command's id ([Parameters](#parameters)), under the plug-in's
|
||||
`_context.command` set to the command's id ([Parameters](#parameters)), and with the [document
|
||||
information](#document-information) its manifest's `context` lists, under the plug-in's
|
||||
[permissions](#permissions): a live effect with commands may also hold `doc.write` and `state`, which only its
|
||||
commands use. `ids` left out or null means the selection; an `ids` that is not a list of object ids is an error. One run
|
||||
is one undo step named after the command, and a run that changes nothing records none. A run that traps, runs out of its instruction budget or fails leaves the
|
||||
@@ -255,7 +256,7 @@ capability model proposed for PhotoCraft plug-ins
|
||||
|
||||
| Permission | Kinds | What it allows |
|
||||
|---|---|---|
|
||||
| `doc.read` | filter, effect, exporter | Read the objects it is given. |
|
||||
| `doc.read` | filter, effect, exporter | Read the objects it is given, and the [document information](#document-information) its `context` lists. |
|
||||
| `doc.write` | filter, effect with `commands` | Change, add and delete objects in the document. |
|
||||
| `state` | filter, effect with `commands` | Keep data of its own with the document (`documentData`). |
|
||||
| `effect.render` | effect | Change how the objects its effect is applied to are drawn. |
|
||||
@@ -382,13 +383,15 @@ capability model proposed for PhotoCraft plug-ins
|
||||
- The host enforces the grant on a filter run and a command run: without `doc.read` the filter is given no objects;
|
||||
without `state` its `documentData` is `null` and an output that sets it is refused; without `doc.write` an output that
|
||||
changes the document is refused. A refused output leaves the document as it was.
|
||||
- `api` is the plug-in API level the manifest is written for: `1` (the default) or `2`, which adds the [host
|
||||
- `api` is the plug-in API level the manifest is written for: `1` (the default); `2`, which adds the [host
|
||||
imports](#host-imports-api-level-2), a filter's `inputs` ([reading type, images and
|
||||
symbols](#reading-type-images-and-symbols)) and a live effect's [`paintOutput`](#painted-live-effects). A higher one
|
||||
is refused. `plugin.list` and `plugin.info` give it as `api`. `inputs` is not a permission: the objects it asks for
|
||||
are read under `doc.read`, which a filter that lists `inputs` must list in `permissions`, so installing it asks the
|
||||
user to grant them. A level 2 effect that declares `paintOutput` needs no other permission than `doc.read` and
|
||||
`effect.render`.
|
||||
symbols](#reading-type-images-and-symbols)) and a live effect's [`paintOutput`](#painted-live-effects); or `3`, which
|
||||
adds `context` ([document information](#document-information)). A higher one is refused. `plugin.list` and
|
||||
`plugin.info` give it as `api`. `inputs` is not a permission: the objects it asks for are read under `doc.read`, which
|
||||
a filter that lists `inputs` must list in `permissions`, so installing it asks the user to grant them. `context` is
|
||||
not a permission either: it is read under `doc.read` in the same way, and the install prompt says that the plug-in
|
||||
reads the document's settings, artboards, layers and swatches. A level 2 effect that declares `paintOutput` needs no
|
||||
other permission than `doc.read` and `effect.render`.
|
||||
- Parameter declarations are unchanged by permissions (`params`, below).
|
||||
|
||||
Every run gets a **fresh instance**, so no state survives between calls except what a plug-in writes to its
|
||||
@@ -634,6 +637,12 @@ the module's start function, in a run that isn't a filter's run on a document, o
|
||||
filter gets paths and compound paths alone, as before. An unknown, repeated or wrongly typed entry, `inputs` on
|
||||
another kind, below `api` 2, or without a `permissions` list that holds `doc.read`, is refused when the plug-in is
|
||||
installed, and so is `api` 2 on hosts from before it.
|
||||
- `context` (filters, and live effects with `commands`, at `api` 3 only): the parts of the active document a run reads
|
||||
in `_context.document`, any of `"settings"`, `"artboards"`, `"layers"` and `"swatches"`, each at most once
|
||||
(`"context": ["artboards", "layers"]`). Left out or `[]`, a run gets none, as before. An unknown, repeated or wrongly
|
||||
typed entry, `context` on another kind or on a live effect without commands, below `api` 3, or without a
|
||||
`permissions` list that holds `doc.read`, is refused when the plug-in is installed, and so is `api` 3 on hosts from
|
||||
before it ([document information](#document-information)).
|
||||
- `paintOutput` (live effects at `api` 2 only): `true` makes the effect return [painted pieces](#painted-live-effects)
|
||||
instead of geometry alone. `true` is the only value the key takes; `false`, `null`, another type, another kind or
|
||||
`api` 1 is refused when the module is installed, and the error names `paintOutput`. Without the key the effect returns
|
||||
@@ -808,6 +817,50 @@ the objects after it are written. An output lists at most 100,000 objects, so a
|
||||
objects fails with `plug-in exceeded its object budget (more than 100000 read-only objects)`. An echo of them counts
|
||||
toward the 64 MiB output cap.
|
||||
|
||||
### Document information
|
||||
|
||||
A filter, or a live effect with [commands](#commands), whose manifest lists `context` (plug-in API level 3) gets those
|
||||
parts of the active document in `_context.document` on each filter or command run, whether or not anything is
|
||||
selected. Drawing a live effect never gets them. The host reads them when the run starts, and they stay as read for
|
||||
the whole run. `revision` is the document's revision at that time, so a plug-in that [calls commands](#command-calls)
|
||||
can tell that a call changed the document. Only the sections the manifest lists are given:
|
||||
|
||||
```json
|
||||
"document": {"revision": 7,
|
||||
"settings": {"name": "Poster.vectorcraft", "colorMode": "cmyk", "units": "Millimeters", "width": 612, "height": 792,
|
||||
"bleed": [9, 9, 9, 9], "rasterEffectsPpi": 300, "activeArtboard": 1},
|
||||
"artboards": [{"id": 1, "index": 0, "name": "Front", "rect": [0, 0, 612, 792], "active": true}],
|
||||
"layers": [{"id": 2, "parentId": null, "depth": 0, "name": "Art", "visible": true, "locked": false, "template": false,
|
||||
"color": "Light Blue", "sublayers": 1, "current": false},
|
||||
{"id": 5, "parentId": 2, "depth": 1, "name": "Notes", "visible": false, "locked": true, "template": false,
|
||||
"color": "Red", "sublayers": 0, "current": true}],
|
||||
"swatches": [{"name": "Brand Red", "kind": "color", "group": null, "global": true, "spot": false,
|
||||
"color": {"model": "cmyk", "c": 0, "m": 0.9, "y": 0.8, "k": 0}, "hex": "#e8392c"}]}
|
||||
```
|
||||
|
||||
- `settings`: `name` is the document's name as its tab shows it, without its folder; `colorMode` is `"rgb"` or
|
||||
`"cmyk"`; `units` are the ruler units as `document.setup` names them; `width` and `height` are the active artboard's
|
||||
size in points (`null` without artboards); `bleed` is `[top, bottom, left, right]` in points; `rasterEffectsPpi` is
|
||||
the Document Raster Effects Settings resolution; `activeArtboard` is the active artboard's id.
|
||||
- `artboards`: every artboard in the Artboards panel's order, with its `id`, which stays the same when artboards are
|
||||
reordered, its `index` (its place now), `name`, `rect` (`[x0, y0, x1, y1]` in the document points `bounds` uses) and
|
||||
`active`.
|
||||
- `layers`: every layer and sublayer, depth first in document order: the bottom layer first, each layer followed by its
|
||||
sublayers, bottom first. `id` is the id layer commands take; `parentId` is the layer it is in (`null` at the top
|
||||
level); `depth` is 0 for a top-level layer. `visible`, `locked` and `template` are the layer's own settings, so a
|
||||
sublayer of a hidden layer keeps its own `visible`. `color` is the layer color's name or `#rrggbb`; `sublayers` counts
|
||||
the layers directly inside it; `current` marks the current layer. Objects are not listed.
|
||||
- `swatches`: every swatch as `swatch.list` lists it (the swatches outside color groups, with the built-in Registration
|
||||
swatch after None, then each color group's): `name`, `kind`, `group`, `global`, `spot`, and for a color its `color` and `hex` (and `tintOf` and `tint`
|
||||
for a tint). A gradient swatch gives its gradient's kind and a pattern swatch its pattern's name, not their art.
|
||||
|
||||
The document information holds no file path or folder, no linked file, font file or placed document, and nothing from
|
||||
another document. A document with more than 10,000 rows in the sections asked for (artboards, layers and sublayers,
|
||||
and swatches together), or whose rows take more than 4 MiB of JSON, fails the run before the plug-in starts, with `the
|
||||
document information the plug-in asks for is too large to hand over`, and the document stays as it was. Each row takes
|
||||
1,000 instructions from the run's [instruction budget](#instruction-budget-preference), and the document information
|
||||
counts toward the half of the memory cap that the input and the parameters share. These rules are VectorCraft's own.
|
||||
|
||||
### Parameters
|
||||
|
||||
`params` points at `params_len` bytes of UTF-8 JSON: the validated parameters, plus `_context`:
|
||||
@@ -821,7 +874,8 @@ toward the 64 MiB output cap.
|
||||
`command` is the command's id); `bounds` the selection's geometric bounds (a live effect: the reference box of the
|
||||
effect, the object's bounds or those of the previous effect's result); `artboard` (filters) the artboard under the
|
||||
selection's centre, else the first; `documentData` (filters) what the plug-in last kept with the document (`null` until
|
||||
it keeps something; see Output). A live effect's `item` says where it sits: `"object"` (one of the object's effects), or
|
||||
it keeps something; see Output); `document` (filters and commands whose manifest lists `context`) the [document
|
||||
information](#document-information) asked for. A live effect's `item` says where it sits: `"object"` (one of the object's effects), or
|
||||
`{"fill": i}` / `{"stroke": i}` (in the own effects of the object's `i`th fill or stroke, counted from the bottom as in
|
||||
`fills` and `strokes`). An export's `_context` is `{"mode": "export", "extension": "plt", "name": "Poster"}` instead:
|
||||
the extension of the file being written (one the exporter lists) and its name without the extension (the document's name
|
||||
|
||||
@@ -2699,6 +2699,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- **Bulk memory fuzz cases use the host's fuel constants:** `crates/engine/tests/plugin_fuzz.rs` samples runs around one slice of the instruction budget and lengths around the bytes one unit of fuel pays for with `vectorcraft_plugins`' own `FUEL_SLICE` and `BYTES_COPIED_PER_FUEL`, so the sampled cases move when either value changes. Regressions: `crates/engine/tests/plugin_fuzz.rs`. Scores and hours unchanged.
|
||||
- **Plug-in permissions (G17):** a manifest may list `permissions` (`doc.read`, `doc.write`, `state`, `effect.render`, `export.write`; the first three follow storytold/photocraft#662) and an `api` level; without the list a plug-in gets what its kind implies and installs as before. Install Plug-in… and File › Open show the name, id, version, file SHA-256 and each permission in plain words, with control and bidirectional characters escaped, and install nothing on Cancel; for a plug-in that lists permissions, `plugin.install` needs `grant` and folders install it only when it is granted. The grant is kept with the module's hash, a module asking for more asks again, and a filter run refuses output its permissions don't allow. Regressions: `crates/plugins/src/permissions.rs`, `crates/plugins/src/manifest.rs`, `crates/engine/src/tests/plugins.rs`, `crates/engine/tests/plugin_fuzz.rs`, `crates/ui-egui/src/tests/plugins.rs`. Scores and hours unchanged.
|
||||
- **Filter plug-ins read type, images and symbol instances (G17, #4333):** a filter at plug-in API level 2 lists `inputs` (`type`, `image`, `symbolInstance`) with `doc.read` in its `permissions`, so installing it asks for approval, and is also given the selected objects of those kinds, read only: type with its runs, character and paragraph attributes (no text past 256 KiB or 4,096 runs or paragraphs, or 16 MiB of runs over the input), images with their size, color mode and, when embedded and at most 1 MiB in base64 (16 MiB over the input), their RGBA pixels (a CMYK image's through the working CMYK profile; never a linked file's), and symbol instances with their symbol and transform. The objects come in paint order from the bottom, and an image that reaches the decoder counts toward the 16 MiB of pixels even when decoding fails. Every object counts toward the input's half of the memory cap; one whose fields besides its pixels and runs don't fit fails the run naming it and its size, a path or compound path that doesn't fit fails it too, and so do more than 100,000 of these objects. Its output returns each as `{id}` or exactly as given; any change or omission is refused before the document changes. Filters without `inputs` get the same input as before, except that compound paths that clip a clip group and paths inside a group that clips one are left out for every filter. Regressions: `crates/plugins/src/objects/tests.rs`, `crates/plugins/src/manifest.rs`, `crates/engine/src/tests/plugins.rs`, `crates/engine/tests/plugin_fuzz.rs`. Scores and hours unchanged.
|
||||
- **Plug-ins read document information without a selection (G17):** a filter, or a live effect with commands, at plug-in API level 3 lists `context` (`settings`, `artboards`, `layers`, `swatches`) with `doc.read` in its `permissions`, so installing it asks for approval and the prompt names the document information, and each filter or command run is given those sections in `_context.document` whether or not anything is selected: the document's name without its folder, color mode, units, active artboard size, bleed and raster effects resolution; every artboard's id, index, name, rectangle and whether it is active; every layer and sublayer with its id, parent, depth, name, own visibility, lock and template settings, color and whether it is current; and every swatch as `swatch.list` lists it, with the document's revision. No path, object or other document is given, and drawing a live effect gets none. More than 10,000 rows or 4 MiB of them fail the run before the plug-in starts, and each row takes 1,000 instructions from its budget (VectorCraft's own values). Regressions: `crates/plugins/src/manifest.rs`, `crates/engine/src/tests/plugins.rs`. Scores and hours unchanged.
|
||||
- **Plug-in grants cover one module (G17):** a grant counts only for the module with the id and SHA-256 it records. A module that lists permissions and has other bytes under the same id needs a new approval, even with the same permissions: `plugin.inspect` reports `needsApproval`, `plugin.install` refuses it without `grant`, Install Plug-in… and File › Open ask again, and the plug-in store and plug-in folders skip it. A module with a missing or empty permissions list needs no grant; without the list, it gets its kind's implied permissions. A grant with a malformed hash covers nothing. Regressions: `crates/plugins/src/permissions.rs`, `crates/engine/src/tests/plugins.rs`, `crates/ui-egui/src/tests/plugins.rs`. Scores and hours unchanged.
|
||||
- **Plug-in approval needs a person (G17):** a plug-in's permissions and heavy budget are approved in a dialog that only a person can confirm: the control channel, MCP and injected input are refused, and `plugin.install` takes `grant` or `allowHeavy` only with that approval. `vectorcraft-cli mcp` and `run` refuse them unless started with `--allow-plugin-grants`. Regressions: `crates/engine/src/tests/plugins.rs`, `crates/ui-egui/src/tests/automation.rs`, `apps/vectorcraft-cli/tests/it/cli.rs`. Scores and hours unchanged.
|
||||
- **A dialog's OK runs what it was opened for:** `ui.dialog.set`, and MCP's `answer_dialog` through it, can set a `__` field only when it is a control of that kind of dialog (a section or tab shown, a link between two fields, a name or search being typed). Every other `__` field, such as the `__command` and `__params` of a confirmation or the generic parameter dialog, a plug-in command dialog's `__command` and `__plugin`, or the paste a swatch conflict waits to finish, is refused with "the `<kind>` dialog cannot set protected field `<field>`"; the request sets no field, and with `action: "confirm"` OK does not run. Regressions: `crates/ui-egui/src/tests/automation.rs`, `crates/ui-egui/src/control/tests.rs`. Scores and hours unchanged.
|
||||
|
||||
Reference in new issue
Block a user