diff --git a/crates/engine/src/cmd/plugin.rs b/crates/engine/src/cmd/plugin.rs index a41f3a5250..30515fcb45 100644 --- a/crates/engine/src/cmd/plugin.rs +++ b/crates/engine/src/cmd/plugin.rs @@ -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 { "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.), format? and extensions? (an exporter's or importer's format id, plugin., 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.., 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.), format? and extensions? (an exporter's or importer's format id, plugin., 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.., 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 ), diff --git a/crates/engine/src/cmd/plugin/context.rs b/crates/engine/src/cmd/plugin/context.rs new file mode 100644 index 0000000000..2078828eba --- /dev/null +++ b/crates/engine/src/cmd/plugin/context.rs @@ -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 { + 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 { + 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::>()?) + } + 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::>()?) + } + ContextSection::Swatches => { + let rows = swatches().map(|(w, g)| row(super::super::swatch::swatch_json(w, g))); + Value::Array(rows.collect::>()?) + } + }; + 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, + /// 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> { + let mut out = Vec::new(); + let mut stack: Vec<(&Node, Option, 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 { + let d = &st.doc; + let at = |id: Option| 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)) +} diff --git a/crates/engine/src/cmd/swatch.rs b/crates/engine/src/cmd/swatch.rs index 8137e561cf..9916ba569c 100644 --- a/crates/engine/src/cmd/swatch.rs +++ b/crates/engine/src/cmd/swatch.rs @@ -1012,18 +1012,28 @@ fn swatch_list(s: &mut Session, p: &Value) -> Result { 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 = ungrouped.chain(grouped).collect(); + let swatches: Vec = listed_swatches(d, only.is_none(), groups.clone()).map(|(w, g)| swatch_json(w, g)).collect(); let groups: Vec = groups.iter().map(|g| json!({"name": g.name, "swatches": g.swatches.iter().map(|w| &w.name).collect::>()})).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)> + '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 { s.edit("Sort Swatches", |d, _| { // [None] and other bracketed specials stay first, like the reference app. diff --git a/crates/engine/src/tests/plugins.rs b/crates/engine/src/tests/plugins.rs index 5440387521..855952fcb2 100644 --- a/crates/engine/src/tests/plugins.rs +++ b/crates/engine/src/tests/plugins.rs @@ -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 = 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 = 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 diff --git a/crates/engine/tests/plugin_fuzz.rs b/crates/engine/tests/plugin_fuzz.rs index 18e0cb1f84..33bc8bc299 100644 --- a/crates/engine/tests/plugin_fuzz.rs +++ b/crates/engine/tests/plugin_fuzz.rs @@ -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::(), + 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::(), + ) { + 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; diff --git a/crates/plugins/src/lib.rs b/crates/plugins/src/lib.rs index b401e9ca1a..df4c9a0a23 100644 --- a/crates/plugins/src/lib.rs +++ b/crates/plugins/src/lib.rs @@ -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}; diff --git a/crates/plugins/src/manifest.rs b/crates/plugins/src/manifest.rs index b9e36cfd24..f20756e149 100644 --- a/crates/plugins/src/manifest.rs +++ b/crates/plugins/src/manifest.rs @@ -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::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, + /// 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, /// 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 { + 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>(d: D) -> std::result::Result, 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. diff --git a/crates/plugins/src/permissions.rs b/crates/plugins/src/permissions.rs index a07b7a7a64..82f8db8641 100644 --- a/crates/plugins/src/permissions.rs +++ b/crates/plugins/src/permissions.rs @@ -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. diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index e8ec516fc8..31e6f30818 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -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 Промяна на начина, по който се рисуват обектите, към които е приложен ефектът му diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index a0dbd8cea5..9870f880c0 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 28e456bfe6..1e152091b2 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 91ed97bc3c..8da0ceca13 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -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í diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 99662e9bff..34e2a28984 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 885bb8723b..3810951d8d 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 51ceed3fa6..bea601b6ec 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -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 προϋπολογισμός εντολών diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 09ef92ffd3..c3583a807a 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index f4ef358178..52be55651e 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 0fc092cfc9..b1c56002d2 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 560885a3e5..50abd6fed7 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -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 તૈયાર diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 55eb284ac4..8bf19ba7e7 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -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 प्लग-इन की अनुमति प्लग-इन स्टोर से हटाई नहीं जा सकती diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 6b0daccf0c..273609ed89 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index daa5f64783..3192fc4476 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index b3ebc9a39d..8e8d1abb62 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 1e67573a95..1dc697d1d3 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -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 命令予算 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 8065d66a56..d53fa5c3b1 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -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 ინსტრუქციების ბიუჯეტი diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index b1a5bbaa7c..113e5f0147 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -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 명령어 예산 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 1173896511..414d7f2982 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 825a448bd4..a15eda9804 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 6790c365d3..3d59e8a61b 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index c250274cee..65539e3647 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -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 бюджет инструкций diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 9f73cbf1de..20c82885ef 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 8d63ee7823..94de30a7e3 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 88f6a5b582..1ef88a68e4 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -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 бюджет інструкцій diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 3cbd55b072..0aba1ddbb0 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -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 diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index a406d78a47..abac760a5f 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -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 指令预算 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 37665d319f..940cafa660 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -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 指令預算 diff --git a/crates/ui-egui/src/io/open.rs b/crates/ui-egui/src/io/open.rs index ac6619b5e6..04771e26ff 100644 --- a/crates/ui-egui/src/io/open.rs +++ b/crates/ui-egui/src/io/open.rs @@ -262,12 +262,17 @@ pub fn install_plugin(app: &mut VectorcraftApp, p: &Value) -> Result 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