mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-03 08:49:37 -06:00
Merge main into #1652
This commit is contained in:
+5
-1
File diff suppressed because one or more lines are too long
@@ -110,7 +110,7 @@ impl Expr {
|
||||
let v = vars.get_by_id(variable)?;
|
||||
let c = vars.collection_by_id(&v.collection)?;
|
||||
let mut at = modes.clone();
|
||||
at.insert(c.id.clone(), c.find_mode(mode)?.id.clone());
|
||||
at.insert(c.id.clone(), c.mode_by_id(mode)?.id.clone());
|
||||
return vars.resolve(&v.id, &at);
|
||||
}
|
||||
Expr::Op { op, args } => (*op, args),
|
||||
@@ -159,7 +159,7 @@ impl Expr {
|
||||
let var = vars.get_by_id(variable);
|
||||
let mode = var
|
||||
.and_then(|v| vars.collection_by_id(&v.collection))
|
||||
.and_then(|c| c.find_mode(mode))
|
||||
.and_then(|c| c.mode_by_id(mode))
|
||||
.map_or("(missing mode)", |m| m.name.as_str());
|
||||
format!("{}[{}]", Expr::var(variable.clone()).display_at(vars, depth + 1), name_arg(mode))
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ impl Expr {
|
||||
Expr::InMode { variable, mode } => {
|
||||
let v = vars.get_by_id(variable).ok_or_else(|| format!("No variable `{variable}`"))?;
|
||||
let c = vars.collection_by_id(&v.collection).ok_or_else(|| format!("No variable collection `{}`", v.collection))?;
|
||||
return c.find_mode(mode).map(|_| v.kind).ok_or_else(|| format!("{} has no mode `{mode}`", c.name));
|
||||
return c.mode_by_id(mode).map(|_| v.kind).ok_or_else(|| format!("{} has no mode `{mode}`", c.name));
|
||||
}
|
||||
Expr::Op { op, args } => (*op, args),
|
||||
};
|
||||
|
||||
@@ -223,9 +223,14 @@ impl Collection {
|
||||
self.modes.first().map(|m| &m.id)
|
||||
}
|
||||
|
||||
/// The mode with id `key`, else the one named `key`.
|
||||
/// The mode with id `key`, else the one named `key` (what someone typed).
|
||||
pub fn find_mode(&self, key: &str) -> Option<&Mode> {
|
||||
self.modes.iter().find(|m| m.id == key).or_else(|| self.modes.iter().find(|m| m.name == key))
|
||||
self.mode_by_id(key).or_else(|| self.modes.iter().find(|m| m.name == key))
|
||||
}
|
||||
|
||||
/// The mode with id `id` exactly: a stored reference, which no mode's name stands in for (#1613).
|
||||
pub fn mode_by_id(&self, id: &str) -> Option<&Mode> {
|
||||
self.modes.iter().find(|m| m.id == id)
|
||||
}
|
||||
|
||||
/// The mode the collection is in under `modes` (collection → chosen mode): the chosen one if it
|
||||
@@ -356,8 +361,10 @@ pub struct Variables {
|
||||
}
|
||||
|
||||
impl Variables {
|
||||
pub fn get(&self, id: &str) -> Option<&Variable> {
|
||||
self.variables.iter().find(|v| v.id == id || v.name == id)
|
||||
/// The variable a person named: the one with id `key`, else the one named `key`. A stored
|
||||
/// reference goes through [`get_by_id`](Self::get_by_id) instead.
|
||||
pub fn get(&self, key: &str) -> Option<&Variable> {
|
||||
self.get_by_id(key).or_else(|| self.variables.iter().find(|v| v.name == key))
|
||||
}
|
||||
|
||||
/// Look up an already resolved variable id (a stored binding or alias): exact ids only, so a
|
||||
@@ -366,11 +373,14 @@ impl Variables {
|
||||
self.variables.iter().find(|v| v.id == id)
|
||||
}
|
||||
|
||||
pub fn collection(&self, id: &str) -> Option<&Collection> {
|
||||
self.collections.iter().find(|c| c.id == id || c.name == id)
|
||||
/// The collection a person named: the one with id `key`, else the one named `key`. A stored
|
||||
/// reference goes through [`collection_by_id`](Self::collection_by_id) instead.
|
||||
pub fn collection(&self, key: &str) -> Option<&Collection> {
|
||||
self.collection_by_id(key).or_else(|| self.collections.iter().find(|c| c.name == key))
|
||||
}
|
||||
|
||||
/// Look up a stored collection reference by exact id, without matching collection names.
|
||||
/// [`get_by_id`](Self::get_by_id) for collections: a stored collection id (a variable's own, a
|
||||
/// prototype action's, a library record's) never matches another collection's name (#1613).
|
||||
pub fn collection_by_id(&self, id: &str) -> Option<&Collection> {
|
||||
self.collections.iter().find(|c| c.id == id)
|
||||
}
|
||||
|
||||
@@ -282,6 +282,26 @@ fn variables_resolve_stored_ids_never_by_name() {
|
||||
// A deleted id stays unresolved instead of picking up the variable named like it.
|
||||
assert_eq!(v.resolve("VariableID:9", &modes), None);
|
||||
assert_eq!(v.resolve("VariableID:4", &modes), None);
|
||||
// What a person types: an id wins over a name, and a name still finds its variable (#1613).
|
||||
assert_eq!(v.get("VariableID:2").map(|x| x.name.as_str()), Some("surface"));
|
||||
assert_eq!(v.get("surface").map(|x| x.id.as_str()), Some("VariableID:2"));
|
||||
assert!(v.get_by_id("surface").is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn collections_and_modes_resolve_stored_ids_never_by_name() {
|
||||
let mut v = Variables::default();
|
||||
let coll = |id: &str, name: &str, modes: Vec<Mode>| Collection { id: id.into(), name: name.into(), modes, extends: None };
|
||||
let mode = |id: &str, name: &str| Mode { id: id.into(), name: name.into() };
|
||||
v.collections.push(coll("c1", "c2", vec![mode("m1", "m2")]));
|
||||
v.collections.push(coll("c2", "Theme", vec![mode("m2", "Dark"), mode("m3", "m9")]));
|
||||
assert_eq!(v.collection("c2").map(|c| c.name.as_str()), Some("Theme"), "an id wins over a name");
|
||||
assert_eq!(v.collection("Theme").map(|c| c.id.as_str()), Some("c2"));
|
||||
assert!(v.collection_by_id("Theme").is_none() && v.collection_by_id("c9").is_none());
|
||||
let theme = v.collection_by_id("c2").unwrap();
|
||||
assert_eq!(theme.mode_by_id("m2").map(|m| m.name.as_str()), Some("Dark"));
|
||||
assert!(theme.mode_by_id("m9").is_none(), "a deleted mode id isn't the mode named like it");
|
||||
assert_eq!(theme.find_mode("Dark").map(|m| m.id.as_str()), Some("m2"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -127,7 +127,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
spec!(
|
||||
"edit.pasteDesignLayers",
|
||||
"Paste design layers",
|
||||
"{html (the clipboard's HTML) | data (base64 of the clipboard's design data, at most 256 MB), parent?, x?, y?} layers copied from another design app (a .fig canvas in the clipboard's HTML), read like a .fig file (best effort, with `warnings`), pasted as edit.paste pastes",
|
||||
"{html (the clipboard's HTML) | data (base64 of the clipboard's design data, at most 256 MB), parent?, x?, y?} layers copied from another design app (a .fig canvas in the clipboard's HTML), read like a .fig file (best effort, with `warnings`), pasted as edit.paste pastes; `missingImages`: the names of pasted layers whose image the clipboard didn't carry (they show the missing-image placeholder)",
|
||||
true,
|
||||
paste_design_layers
|
||||
),
|
||||
|
||||
@@ -134,12 +134,39 @@ pub(super) fn paste_design_layers(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
layers_generation,
|
||||
};
|
||||
let mut out = paste(s, p)?;
|
||||
let pasted: Vec<NodeId> = out["ids"].as_array().map(|a| a.iter().filter_map(crate::params::id_of).collect()).unwrap_or_default();
|
||||
let missing = layers_missing_images(s.doc()?, &pasted);
|
||||
if !missing.is_empty() {
|
||||
out["missingImages"] = json!(missing);
|
||||
}
|
||||
if !other.issues.is_empty() {
|
||||
out["warnings"] = json!(other.issues);
|
||||
}
|
||||
Ok(out)
|
||||
}
|
||||
|
||||
/// The most layers [`layers_missing_images`] names.
|
||||
const MAX_MISSING_NAMED: usize = 20;
|
||||
|
||||
/// The names of the layers under `ids` with an image fill or stroke whose image the paste didn't
|
||||
/// carry (#1646): it shows the importer's missing-image placeholder, or nothing at all.
|
||||
fn layers_missing_images(doc: &figcraft_doc::Document, ids: &[NodeId]) -> Vec<String> {
|
||||
let missing = |p: &figcraft_color::Paint| match &p.kind {
|
||||
figcraft_color::PaintKind::Image(img) => doc.images.get(&img.image).is_none_or(figcraft_format::rest::is_missing_image),
|
||||
_ => false,
|
||||
};
|
||||
let mut names: Vec<String> = Vec::new();
|
||||
for n in ids.iter().flat_map(|i| doc.subtree(*i)).filter_map(|i| doc.node(i)) {
|
||||
if n.fills.iter().chain(&n.strokes).any(missing) && !names.contains(&n.name) {
|
||||
names.push(n.name.clone());
|
||||
if names.len() == MAX_MISSING_NAMED {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
names
|
||||
}
|
||||
|
||||
pub(super) fn copy(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let ids = req_targets("edit.copy", s, p)?;
|
||||
copy_to_clipboard(s, "edit.copy", &ids)?;
|
||||
|
||||
@@ -262,7 +262,7 @@ fn set_mode(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
.or_else(|| published_collections(&lib).find(|c| c.name == key))
|
||||
.ok_or_else(|| bad(cmd, format!("\"{}\" publishes no variable collection `{key}`", link.name)))?;
|
||||
let m = req_string(cmd, p, "mode")?;
|
||||
let mode = coll.modes.iter().find(|x| x.id == m || x.name == m).map(|x| x.id.clone()).ok_or_else(|| bad(cmd, "no such mode"))?;
|
||||
let mode = coll.find_mode(&m).map(|x| x.id.clone()).ok_or_else(|| bad(cmd, "no such mode"))?;
|
||||
let key = coll.id.clone();
|
||||
let map = import_variables(s.doc_mut()?, &lib, &BTreeSet::new(), &BTreeSet::from([key.clone()]), false);
|
||||
let local = map.collections.get(&key).cloned().ok_or_else(|| EngineError::Other("the collection didn't import".into()))?;
|
||||
|
||||
@@ -981,7 +981,7 @@ pub fn var_set(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let var = doc.variables.get(&v).cloned().ok_or_else(|| bad(cmd, "no such variable"))?;
|
||||
let coll = doc.variables.collection_by_id(&var.collection).cloned().ok_or_else(|| bad(cmd, "variable has no collection"))?;
|
||||
let mode = match string(p, "mode") {
|
||||
Some(m) => coll.modes.iter().find(|x| x.id == m || x.name == m).map(|x| x.id.clone()).ok_or_else(|| bad(cmd, "no such mode"))?,
|
||||
Some(m) => coll.find_mode(&m).map(|x| x.id.clone()).ok_or_else(|| bad(cmd, "no such mode"))?,
|
||||
None => coll.default_mode().cloned().ok_or_else(|| bad(cmd, "collection has no modes"))?,
|
||||
};
|
||||
let raw = get(p, "value").ok_or_else(|| bad(cmd, "invalid value"))?;
|
||||
|
||||
@@ -111,7 +111,7 @@ fn string_values(vars: &Variables, id: &str) -> Vec<String> {
|
||||
if !seen.insert(id.clone()) {
|
||||
continue;
|
||||
}
|
||||
let Some(var) = vars.get(&id) else { continue };
|
||||
let Some(var) = vars.get_by_id(&id) else { continue };
|
||||
for v in var.values.values() {
|
||||
match v {
|
||||
VariableValue::String(s) => out.push(s.clone()),
|
||||
|
||||
@@ -429,6 +429,8 @@ mod paint_tests;
|
||||
#[cfg(test)]
|
||||
mod panels_behaviour_tests;
|
||||
#[cfg(test)]
|
||||
mod paste_missing_image_tests;
|
||||
#[cfg(test)]
|
||||
mod path_read_caps_tests;
|
||||
#[cfg(test)]
|
||||
mod pdf_print_tests;
|
||||
@@ -523,6 +525,8 @@ mod sketch_import_tests;
|
||||
#[cfg(test)]
|
||||
mod slot_tests;
|
||||
#[cfg(test)]
|
||||
mod stored_ids_tests;
|
||||
#[cfg(test)]
|
||||
mod stroke_style_tests;
|
||||
#[cfg(test)]
|
||||
mod style_tests;
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
//! Layers pasted from another design app whose image the clipboard doesn't carry (#1646): the
|
||||
//! paste names them (`missingImages`), and they keep their image's name. Design data made by our
|
||||
//! own `.fig` export: its canvas alone, as a clipboard carries it, and the whole file with images.
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
use base64::Engine as _;
|
||||
use serde_json::{Value, json};
|
||||
|
||||
use crate::Session;
|
||||
use crate::params::id_of;
|
||||
|
||||
/// A `.fig` export of a page with "Photo" (an image fill) and "Plain" (a solid fill).
|
||||
fn exported() -> Vec<u8> {
|
||||
let mut s = Session::new();
|
||||
let photo = id_of(&s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 80, "height": 60})).unwrap()["id"]).unwrap();
|
||||
let plain = id_of(&s.execute("shape.rectangle", &json!({"x": 100, "y": 0, "width": 80, "height": 60})).unwrap()["id"]).unwrap();
|
||||
let mut png = Vec::new();
|
||||
image::RgbaImage::from_pixel(4, 4, image::Rgba([200, 40, 40, 255]))
|
||||
.write_to(&mut std::io::Cursor::new(&mut png), image::ImageFormat::Png)
|
||||
.unwrap();
|
||||
let doc = s.doc_mut().unwrap();
|
||||
let (hash, _, _) = figcraft_format::add_image(doc, png).unwrap();
|
||||
let n = doc.get_mut(photo).unwrap();
|
||||
n.name = "Photo".into();
|
||||
n.fills = vec![figcraft_color::Paint::image(hash, figcraft_color::ImageScaleMode::Fill)];
|
||||
doc.get_mut(plain).unwrap().name = "Plain".into();
|
||||
let r = s.execute("file.export", &json!({"format": "fig"})).unwrap();
|
||||
base64::engine::general_purpose::STANDARD.decode(r["data"].as_str().unwrap()).unwrap()
|
||||
}
|
||||
|
||||
/// Just the canvas of a `.fig` file: the design data a clipboard carries, without the images.
|
||||
fn canvas_only(fig: &[u8]) -> Vec<u8> {
|
||||
let mut z = zip::ZipArchive::new(std::io::Cursor::new(fig)).unwrap();
|
||||
let mut out = Vec::new();
|
||||
z.by_name("canvas.fig").unwrap().read_to_end(&mut out).unwrap();
|
||||
out
|
||||
}
|
||||
|
||||
fn paste(data: &[u8]) -> Value {
|
||||
let mut s = Session::new();
|
||||
s.execute("edit.pasteDesignLayers", &json!({"data": base64::engine::general_purpose::STANDARD.encode(data)})).unwrap()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn layers_whose_image_the_clipboard_lacks_are_named() {
|
||||
let fig = exported();
|
||||
let r = paste(&canvas_only(&fig));
|
||||
assert_eq!(r["missingImages"], json!(["Photo"]), "{r}");
|
||||
assert!(r["warnings"].as_array().unwrap().iter().any(|w| w.as_str().unwrap().contains("missing-image placeholder")), "{r}");
|
||||
// With its images, nothing is missing.
|
||||
let r = paste(&fig);
|
||||
assert!(r.get("missingImages").is_none(), "{r}");
|
||||
}
|
||||
@@ -66,15 +66,17 @@ pub fn set_variable(doc: &mut Document, node: NodeId, variable: &str, value: &Va
|
||||
/// on the page's top-level frames that chose another mode of it (modes chosen deeper inside still
|
||||
/// win), then re-apply bindings. False for an unknown collection or mode.
|
||||
pub fn set_mode(doc: &mut Document, frame: NodeId, collection: &str, mode: &str) -> bool {
|
||||
let Some(id) = doc.variables.collection(collection).map(|c| c.id.clone()) else { return false };
|
||||
set_mode_by_id(doc, frame, &id, mode)
|
||||
let Some(c) = doc.variables.collection(collection) else { return false };
|
||||
let Some(m) = c.find_mode(mode) else { return false };
|
||||
let (collection, mode) = (c.id.clone(), m.id.clone());
|
||||
set_mode_by_id(doc, frame, &collection, &mode)
|
||||
}
|
||||
|
||||
/// Switch a stored collection id to `mode`, without matching another collection's name.
|
||||
/// Otherwise behaves like [`set_mode`].
|
||||
/// Switch a stored collection id to a stored mode id (a prototype action's), without matching
|
||||
/// another collection's or mode's name (#1613). Otherwise behaves like [`set_mode`].
|
||||
pub fn set_mode_by_id(doc: &mut Document, frame: NodeId, collection: &str, mode: &str) -> bool {
|
||||
let Some(c) = doc.variables.collection_by_id(collection) else { return false };
|
||||
let Some(mode) = c.find_mode(mode).map(|m| m.id.clone()) else {
|
||||
let Some(mode) = c.mode_by_id(mode).map(|m| m.id.clone()) else {
|
||||
return false;
|
||||
};
|
||||
let cid = c.id.clone();
|
||||
|
||||
@@ -315,8 +315,9 @@ fn stored_variable_ids_resolve_only_incoming_action_and_expression_names() {
|
||||
let actions = &doc.node(frame).unwrap().interactions[0].actions;
|
||||
let Action::SetVariable { variable, expr: Some(expr), .. } = &actions[0] else { panic!("no set variable") };
|
||||
assert_eq!(variable, &target);
|
||||
// A JSON expression is command input: it still accepts names, even one that resembles an id.
|
||||
assert_eq!(expr.eval(&doc.variables, &Default::default()), Some(VariableValue::Number(100.0)));
|
||||
// A JSON expression is command input: it accepts names, but an exact id comes first, so the
|
||||
// variable renamed to target's id doesn't take its place (#1613).
|
||||
assert_eq!(expr.eval(&doc.variables, &Default::default()), Some(VariableValue::Number(5.0)));
|
||||
let Action::Conditional { blocks } = &actions[1] else { panic!("no conditional") };
|
||||
assert_eq!(blocks[0].condition.as_ref().unwrap().eval(&doc.variables, &Default::default()), Some(VariableValue::Boolean(true)));
|
||||
let Action::SetVariable { value: stored, .. } = &blocks[0].actions[0] else { panic!("no nested set variable") };
|
||||
@@ -332,15 +333,19 @@ fn stored_variable_ids_switch_only_the_prototype_collection() {
|
||||
shadow.id = "shadow".into();
|
||||
shadow.name = theme.id.clone();
|
||||
doc.variables.collections.insert(0, shadow);
|
||||
assert!(crate::proto_run::set_mode_by_id(&mut doc, frame, &theme.id, "Dark"));
|
||||
let dark = theme.find_mode("Dark").unwrap().id.clone();
|
||||
assert!(!crate::proto_run::set_mode_by_id(&mut doc, frame, &theme.id, "Dark"), "a stored mode is an id, not a name");
|
||||
assert!(crate::proto_run::set_mode_by_id(&mut doc, frame, &theme.id, &dark));
|
||||
assert_eq!(fill_hex(&doc, r).as_deref(), Some("000000"));
|
||||
let page = doc.page_of(frame).unwrap();
|
||||
assert!(!doc.node(page).unwrap().var_modes.contains_key("shadow"));
|
||||
// The public name-accepting wrapper keeps its existing lookup behavior.
|
||||
// The name-accepting wrapper takes an exact id before a name (#1613).
|
||||
assert!(set_mode(&mut doc, frame, &theme.id, "Light"));
|
||||
assert!(!doc.node(page).unwrap().var_modes.contains_key("shadow"));
|
||||
assert!(set_mode(&mut doc, frame, "shadow", "Light"), "the other collection by its id");
|
||||
assert!(doc.node(page).unwrap().var_modes.contains_key("shadow"));
|
||||
doc.variables.collections.retain(|c| c.id != theme.id);
|
||||
let before = doc.clone();
|
||||
assert!(!crate::proto_run::set_mode_by_id(&mut doc, frame, &theme.id, "Dark"));
|
||||
assert!(!crate::proto_run::set_mode_by_id(&mut doc, frame, &theme.id, &dark));
|
||||
assert_eq!(doc, before);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
//! A variable renamed to another one's id never takes its place (#1613), beside #1618's tests:
|
||||
//! an id a person types (`variable.bind`, `variable.set`) finds the variable with that exact id
|
||||
//! before one named like it, and the Tailwind export and expressions read the stored id. Names still
|
||||
//! work where a person types them.
|
||||
|
||||
use figcraft_doc::VariableValue;
|
||||
use figcraft_doc::proto::Expr;
|
||||
use serde_json::{Value, json};
|
||||
|
||||
use crate::Session;
|
||||
use crate::components::tests::ex;
|
||||
|
||||
/// The issue's document: Theme with `shadow`, `surface` and `alias` (→ surface), then `shadow`
|
||||
/// renamed to surface's id with Web code syntax `--shadow`. Ids of shadow, surface and alias.
|
||||
fn renamed_like_an_id() -> (Session, String, String, String) {
|
||||
let mut s = Session::new();
|
||||
ex(&mut s, "variable.createCollection", json!({"name": "Theme"}));
|
||||
let id = |v: Value| v["id"].as_str().unwrap().to_string();
|
||||
let shadow = id(ex(&mut s, "variable.create", json!({"collection": "Theme", "name": "shadow", "type": "color", "value": "#FF0000"})));
|
||||
let surface = id(ex(&mut s, "variable.create", json!({"collection": "Theme", "name": "surface", "type": "color", "value": "#0D99FF"})));
|
||||
let alias = id(ex(&mut s, "variable.create", json!({"collection": "Theme", "name": "alias", "type": "color", "value": {"alias": "surface"}})));
|
||||
ex(&mut s, "variable.update", json!({"variable": shadow, "name": surface, "codeSyntax": {"WEB": "--shadow"}}));
|
||||
(s, shadow, surface, alias)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn exported_aliases_point_at_the_stored_id() {
|
||||
let (mut s, ..) = renamed_like_an_id();
|
||||
let css = ex(&mut s, "variable.export", json!({"format": "css"}))["text"].as_str().unwrap().to_string();
|
||||
assert!(css.contains("--alias: var(--surface);"), "{css}");
|
||||
let tw = ex(&mut s, "variable.export", json!({"format": "tailwind"}))["text"].as_str().unwrap().to_string();
|
||||
assert!(tw.contains("var(--color-surface)") && !tw.contains("var(--shadow)"), "{tw}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn dev_inspect_names_the_bound_variable() {
|
||||
let (mut s, _, surface, _) = renamed_like_an_id();
|
||||
let r = ex(&mut s, "shape.rectangle", json!({"x": 0, "y": 0, "width": 10, "height": 10}));
|
||||
let r = crate::params::id_of(&r["id"]).unwrap();
|
||||
ex(&mut s, "variable.bind", json!({"ids": [r.0], "field": "fill", "variable": surface}));
|
||||
let doc = s.doc().unwrap();
|
||||
let found = crate::devinspect::bound_variable(doc, doc.node(r).unwrap(), "fill").unwrap();
|
||||
assert_eq!(found.name, "surface");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn expressions_read_and_show_the_stored_variable() {
|
||||
let (mut s, _, surface, _) = renamed_like_an_id();
|
||||
ex(&mut s, "variable.addMode", json!({"collection": "Theme", "name": "Dark"}));
|
||||
ex(&mut s, "variable.set", json!({"variable": surface, "mode": "Dark", "value": "#00FF00"}));
|
||||
let vars = &s.doc().unwrap().variables;
|
||||
let theme = vars.collection("Theme").unwrap().clone();
|
||||
let dark = theme.find_mode("Dark").unwrap().id.clone();
|
||||
let e = Expr::InMode { variable: surface.clone(), mode: dark };
|
||||
assert!(matches!(e.eval(vars, &Default::default()), Some(VariableValue::Color(c)) if c.to_hex() == "00FF00"));
|
||||
assert_eq!(e.display(vars), "surface[Dark]");
|
||||
assert_eq!(Expr::var(surface).display(vars), "surface");
|
||||
}
|
||||
@@ -258,10 +258,11 @@ fn stored_variable_ids_keep_remapped_import_aliases() {
|
||||
let alias = vars.get("alias").unwrap();
|
||||
assert_eq!(alias.values.values().next(), Some(&VariableValue::Alias(target.clone())));
|
||||
assert_eq!(vars.resolve(&alias.id, &Default::default()), Some(VariableValue::Number(5.0)));
|
||||
// The command's alias argument remains name-accepting, unlike the import's remapped id.
|
||||
// The command's alias argument accepts names, but an exact id comes first (#1613): the
|
||||
// variable renamed to target's id doesn't take its place.
|
||||
ex(&mut s, "variable.set", json!({"variable": "alias", "value": {"alias": target}}));
|
||||
let vars = &s.doc().unwrap().variables;
|
||||
assert_eq!(vars.resolve(&vars.get("alias").unwrap().id, &Default::default()), Some(VariableValue::Number(100.0)));
|
||||
assert_eq!(vars.resolve(&vars.get("alias").unwrap().id, &Default::default()), Some(VariableValue::Number(5.0)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -30,8 +30,12 @@ pub mod kiwi;
|
||||
#[cfg(test)]
|
||||
mod layer_cap_tests;
|
||||
mod map;
|
||||
#[cfg(test)]
|
||||
mod missing_image_tests;
|
||||
mod network;
|
||||
#[cfg(test)]
|
||||
mod paste_style_tests;
|
||||
#[cfg(test)]
|
||||
mod prop_value_tests;
|
||||
#[cfg(test)]
|
||||
mod slot_tests;
|
||||
|
||||
@@ -259,7 +259,7 @@ impl<'d> Exporter<'d> {
|
||||
}
|
||||
}
|
||||
|
||||
/// A reference to variable `var` (its stored id) as variable data.
|
||||
/// A reference to variable `var` (a stored id: no name stands in for it, #1613) as variable data.
|
||||
fn alias(&mut self, var: &str) -> Option<Kv<'static>> {
|
||||
let found = self.doc.variables.get_by_id(var).and_then(|v| Some((v.kind, *self.var_ids.get(v.id.as_str())?)));
|
||||
let Some((kind, local)) = found else {
|
||||
|
||||
@@ -91,10 +91,6 @@ pub(super) fn adapt_warning(w: String) -> Option<String> {
|
||||
if w.contains("geometry=paths") {
|
||||
return None;
|
||||
}
|
||||
if w.contains("without image data") {
|
||||
let count = w.split_whitespace().next().unwrap_or("Some");
|
||||
return Some(format!("{count} image fill(s) whose image isn't in the file show a grey placeholder"));
|
||||
}
|
||||
Some(w.replace("the variables JSON", "the file").replace("the file JSON", "the file"))
|
||||
}
|
||||
|
||||
@@ -351,7 +347,10 @@ impl<'a> Mapper<'a> {
|
||||
/// the reference has neither or the asset names nothing (or ambiguously) in the file.
|
||||
/// Original code for this importer: the field names are those of the schema each file embeds.
|
||||
fn resource_id(&self, v: &Kv) -> Option<String> {
|
||||
if let Some(g) = v.get("guid").and_then(guid).filter(|g| *g != NO_STYLE) {
|
||||
// A guid names the resource when this file holds a node by it. One from another file (the
|
||||
// library a style or collection came from, as a paste carries) names nothing here: the
|
||||
// asset it also names finds the file's copy (#1638).
|
||||
if let Some(g) = v.get("guid").and_then(guid).filter(|g| *g != NO_STYLE && self.nodes.contains_key(g)) {
|
||||
return Some(g);
|
||||
}
|
||||
let asset = v.get("assetRef")?;
|
||||
|
||||
@@ -33,10 +33,17 @@ impl<'a> Mapper<'a> {
|
||||
|
||||
/// The style node a layer links in `key` (or the older `legacy` field), recorded for the REST
|
||||
/// `styles` map under `slot`.
|
||||
/// A link to a style the file doesn't hold leaves the layer its own values (the colours it
|
||||
/// stored with it), with a note.
|
||||
pub(super) fn style(&mut self, v: &View<'a>, key: &str, legacy: &str, slot: &str, out: &mut Obj) -> Option<&'a Kv<'a>> {
|
||||
let id = self.style_link(v, key, legacy)?;
|
||||
let node = *self.nodes.get(&id)?;
|
||||
node.get("styleType").and_then(Kv::str)?;
|
||||
let found = self.style_link(v, key, legacy).and_then(|id| Some((self.nodes.get(&id).copied()?, id)));
|
||||
let Some((node, id)) = found.filter(|(n, _)| n.get("styleType").and_then(Kv::str).is_some()) else {
|
||||
let named = |l: &Kv| l.get("assetRef").is_some() || l.get("guid").and_then(guid).is_some_and(|g| g != NO_STYLE);
|
||||
if v.get(key).is_some_and(named) || v.get(legacy).and_then(guid).is_some_and(|g| g != NO_STYLE) {
|
||||
self.warn("links to shared styles that aren't in the file kept the layers' own values");
|
||||
}
|
||||
return None;
|
||||
};
|
||||
out.insert(slot.into(), json!(id));
|
||||
if !self.styles.contains_key(&id) {
|
||||
let name = node.get("name").and_then(Kv::str).unwrap_or("Style");
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
//! Design data whose image fill names an image it doesn't carry, as a clipboard copied from
|
||||
//! another design app does (#1646): the fill keeps the image's name, so the image can be put back
|
||||
//! under it; the layer shows the missing-image placeholder (light grey with darker stripes, not a
|
||||
//! grey a design could have chosen); and the import says so, once per image. Built in code and
|
||||
//! read as `edit.pasteDesignLayers` reads a clipboard's design data.
|
||||
|
||||
use figcraft_doc::Document;
|
||||
use figcraft_doc::color::PaintKind;
|
||||
|
||||
use super::kiwi::Kv;
|
||||
use super::tests::{arr, canvas, e, node, o, schema, xy};
|
||||
use super::try_import;
|
||||
use crate::rest::{is_missing_image, missing_image_placeholder};
|
||||
|
||||
const HASH: [u8; 20] = [0x5a; 20];
|
||||
|
||||
fn image_fill() -> Kv<'static> {
|
||||
o(vec![("type", e("IMAGE")), ("image", o(vec![("hash", Kv::Bytes(HASH.to_vec()))])), ("imageScaleMode", e("FILL"))])
|
||||
}
|
||||
|
||||
/// Two layers filled with the same image, which the data doesn't carry.
|
||||
fn pasted() -> (Document, Vec<String>) {
|
||||
let nodes = vec![
|
||||
node(0, None, "DOCUMENT", "Document", vec![]),
|
||||
node(1, Some((0, "!")), "CANVAS", "Page", vec![]),
|
||||
node(10, Some((1, "!")), "RECTANGLE", "Hero", vec![("size", xy(200.0, 100.0)), ("fillPaints", arr(vec![image_fill()]))]),
|
||||
node(11, Some((1, "\"")), "RECTANGLE", "Hero copy", vec![("size", xy(200.0, 100.0)), ("fillPaints", arr(vec![image_fill()]))]),
|
||||
];
|
||||
let bytes = canvas(&schema(), &o(vec![("nodeChanges", arr(nodes))]));
|
||||
try_import(&bytes, "Pasted layers").expect("design data").expect("it imports")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_missing_image_keeps_its_name_and_shows_as_missing() {
|
||||
let (doc, warnings) = pasted();
|
||||
let hex: String = HASH.iter().map(|b| format!("{b:02x}")).collect();
|
||||
for name in ["Hero", "Hero copy"] {
|
||||
let layer = doc.nodes().find(|n| n.name == name).unwrap();
|
||||
let Some(PaintKind::Image(img)) = layer.fills.first().map(|p| &p.kind) else { panic!("{name}: {:?}", layer.fills) };
|
||||
assert_eq!(img.image, hex, "{name}: the image's own name, so it can come back under it");
|
||||
assert!(doc.images.get(&img.image).is_some_and(is_missing_image), "{name}: the missing-image placeholder");
|
||||
}
|
||||
let note = "image fills whose image isn't in the file show a missing-image placeholder and keep its name";
|
||||
assert_eq!(warnings.iter().filter(|w| w.starts_with(note)).count(), 1, "{warnings:?}");
|
||||
assert!(!warnings.iter().any(|w| w.contains("without image data")), "the REST JSON note isn't given too: {warnings:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_placeholder_reads_as_missing_not_as_grey() {
|
||||
let png = image::load_from_memory(missing_image_placeholder().unwrap()).unwrap().to_rgba8();
|
||||
// Two tones (their anti-aliased edges between): darker stripes over a light ground, not one
|
||||
// flat grey.
|
||||
let count = |c: u8| png.pixels().filter(|p| p.0 == [c, c, c, 0xFF]).count();
|
||||
let all = png.pixels().count();
|
||||
let (ground, stripe) = (count(0xE6), count(0xB4));
|
||||
assert!(ground > all / 2 && stripe > all / 8 && ground + stripe > all * 3 / 4, "{ground} ground, {stripe} stripe of {all}");
|
||||
// A real image of one colour is never taken for the placeholder.
|
||||
let flat = figcraft_doc::ImageData { bytes: std::sync::Arc::new(vec![1, 2, 3]), width: 64, height: 64 };
|
||||
assert!(!is_missing_image(&flat));
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
//! Layers pasted from another design app whose paints come from a shared paint style (#1638): the
|
||||
//! clipboard links the style by the guid it has in the library it came from, which this payload
|
||||
//! doesn't hold, and by its library asset, whose copy it does hold. The layers (a component's
|
||||
//! glyph and the same glyph in an instance of it) take the style's colour and stay linked to it.
|
||||
//! A link to a style the payload doesn't hold at all keeps the colour stored with the layer, with
|
||||
//! a note. Built in code and read as `edit.pasteDesignLayers` reads a clipboard's design data.
|
||||
|
||||
use figcraft_doc::{Document, Node};
|
||||
|
||||
use super::kiwi::Kv;
|
||||
use super::tests::{arr, canvas, e, g, node, o, s, schema, solid, xy};
|
||||
use super::try_import;
|
||||
|
||||
/// A style link by `guid` (absent from the payload) and, given, the library asset `key`.
|
||||
fn link(guid: u64, asset: Option<&str>) -> Kv<'static> {
|
||||
let mut fields = vec![("guid", g(guid))];
|
||||
if let Some(key) = asset {
|
||||
fields.push(("assetRef", o(vec![("key", s(key)), ("version", s("7"))])));
|
||||
}
|
||||
o(fields)
|
||||
}
|
||||
|
||||
/// The pasted payload: on the internal page, the file's copy of library style "Red" (#FF4040);
|
||||
/// on the page, component "Icon" whose "Glyph" stores stale black and links the style, an
|
||||
/// instance of it, and "Lost", which stores #1F1F1F and links a style the payload doesn't hold.
|
||||
fn pasted() -> (Document, Vec<String>) {
|
||||
let nodes = vec![
|
||||
node(0, None, "DOCUMENT", "Document", vec![]),
|
||||
node(1, Some((0, "!")), "CANVAS", "Page", vec![]),
|
||||
node(2, Some((0, "~")), "CANVAS", "Internal", vec![("internalOnly", Kv::Bool(true))]),
|
||||
node(
|
||||
10,
|
||||
Some((2, "!")),
|
||||
"RECTANGLE",
|
||||
"Red",
|
||||
vec![("styleType", e("FILL")), ("key", s("lib-red")), ("version", s("7")), ("fillPaints", arr(vec![solid(1.0, 0.25, 0.25)]))],
|
||||
),
|
||||
node(20, Some((1, "!")), "SYMBOL", "Icon", vec![("size", xy(24.0, 24.0))]),
|
||||
node(
|
||||
21,
|
||||
Some((20, "!")),
|
||||
"RECTANGLE",
|
||||
"Glyph",
|
||||
vec![("size", xy(16.0, 16.0)), ("fillPaints", arr(vec![solid(0.0, 0.0, 0.0)])), ("styleIdForFill", link(99, Some("lib-red")))],
|
||||
),
|
||||
node(30, Some((1, "\"")), "INSTANCE", "Icon copy", vec![("size", xy(24.0, 24.0)), ("symbolData", o(vec![("symbolID", g(20))]))]),
|
||||
node(
|
||||
40,
|
||||
Some((1, "#")),
|
||||
"RECTANGLE",
|
||||
"Lost",
|
||||
vec![("size", xy(16.0, 16.0)), ("fillPaints", arr(vec![solid(0.12, 0.12, 0.12)])), ("styleIdForFill", link(98, None))],
|
||||
),
|
||||
];
|
||||
let bytes = canvas(&schema(), &o(vec![("nodeChanges", arr(nodes))]));
|
||||
try_import(&bytes, "Pasted layers").expect("design data").expect("it imports")
|
||||
}
|
||||
|
||||
fn fill_hex(n: &Node) -> Option<String> {
|
||||
n.fills.first()?.solid_color().map(|c| c.to_hex())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_library_paint_style_colours_the_component_and_its_instance() {
|
||||
let (doc, _) = pasted();
|
||||
let glyphs: Vec<&Node> = doc.nodes().filter(|n| n.name == "Glyph").collect();
|
||||
assert_eq!(glyphs.len(), 2, "the component's glyph and the instance's");
|
||||
for glyph in glyphs {
|
||||
assert_eq!(fill_hex(glyph).as_deref(), Some("FF4040"), "the style's colour, not the stale black");
|
||||
let style = glyph.styles.fill.as_deref().and_then(|id| doc.style(id)).expect("linked to the style");
|
||||
assert_eq!(style.name, "Red");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_style_the_paste_doesnt_hold_keeps_the_stored_colour() {
|
||||
let (doc, warnings) = pasted();
|
||||
let lost = doc.nodes().find(|n| n.name == "Lost").unwrap();
|
||||
assert_eq!(fill_hex(lost).as_deref(), Some("1F1F1F"), "the colour stored with the layer, not black");
|
||||
assert!(lost.styles.fill.is_none());
|
||||
assert!(warnings.iter().any(|w| w.contains("shared styles that aren't in the file")), "{warnings:?}");
|
||||
}
|
||||
@@ -59,7 +59,7 @@ message TextData string characters, uint[] characterStyleIDs, NodeChange[] style
|
||||
message Path WindingRule windingRule, uint commandsBlob
|
||||
message GUIDPath GUID[] guids
|
||||
message SymbolData GUID symbolID, NodeChange[] symbolOverrides
|
||||
message StyleId GUID guid
|
||||
message StyleId GUID guid, AssetRef assetRef
|
||||
message PropValue bool boolValue, TextData textValue
|
||||
message PropDef GUID id, string name, PropValue initialValue, PropType type
|
||||
message PropAssignment GUID defID, PropValue value
|
||||
@@ -92,7 +92,7 @@ pub(super) fn f(x: f64) -> Kv<'static> {
|
||||
pub(super) fn u(x: u64) -> Kv<'static> {
|
||||
Kv::Uint(x)
|
||||
}
|
||||
fn e(n: &'static str) -> Kv<'static> {
|
||||
pub(super) fn e(n: &'static str) -> Kv<'static> {
|
||||
Kv::Enum(n)
|
||||
}
|
||||
pub(super) fn s(x: impl Into<String>) -> Kv<'static> {
|
||||
|
||||
+43
-13
@@ -7,7 +7,7 @@
|
||||
//! corners, constraints, auto layout, layout grids, export settings, text with styled runs,
|
||||
//! vectors from `fillGeometry` / `strokeGeometry`, components, component sets, instances and
|
||||
//! component properties (slots included) are imported. Image fills keep their `imageRef` as the
|
||||
//! image key and show a grey placeholder unless an [`ImageResolver`] supplies the bytes (nothing is fetched).
|
||||
//! image key and show a missing-image placeholder unless an [`ImageResolver`] supplies the bytes (nothing is fetched).
|
||||
//! Prototyping comes along: interactions (triggers, actions, transitions, easing), flows,
|
||||
//! scrolling and the prototype device. Variables come from the local variables response
|
||||
//! (`GET /v1/files/:key/variables/local`), embedded next to the file JSON or passed separately
|
||||
@@ -1003,7 +1003,7 @@ impl<'a> Ctx<'a> {
|
||||
}
|
||||
|
||||
/// The document image key for an `imageRef`: its bytes when the resolver has them, else a
|
||||
/// grey placeholder stored under the `imageRef` itself when that name can legitimately be an
|
||||
/// missing-image placeholder stored under the `imageRef` itself when that name can legitimately be an
|
||||
/// archive member (`is_valid_key`) and claims no content hash (`claims_content_hash`: the
|
||||
/// placeholder's bytes don't hash to it); any other name shares the `rest-image-missing`
|
||||
/// placeholder.
|
||||
@@ -1016,6 +1016,11 @@ impl<'a> Ctx<'a> {
|
||||
Some((hash, _, _)) => hash,
|
||||
None => {
|
||||
self.missing_images += 1;
|
||||
// A design file's (or a paste's) image fill names its image by hash: one note per
|
||||
// fill, counted, read the same in every language.
|
||||
if self.fig_sources.is_some() {
|
||||
self.warn("image fills whose image isn't in the file show a missing-image placeholder and keep its name");
|
||||
}
|
||||
// An `imageRef` arrives from an untrusted file, and keys become archive member
|
||||
// names on save: a name that can't legitimately be one must not reach the map,
|
||||
// nor one claiming a content hash the placeholder's bytes don't have.
|
||||
@@ -1024,9 +1029,11 @@ impl<'a> Ctx<'a> {
|
||||
let key = if named { candidate } else { MISSING_IMAGE };
|
||||
let key = key.to_string();
|
||||
if !self.doc.images.contains_key(&key)
|
||||
&& let Some(png) = placeholder_png()
|
||||
&& let Some(png) = missing_image_placeholder()
|
||||
{
|
||||
self.doc.images.insert(key.clone(), ImageData { bytes: Arc::new(png), width: PLACEHOLDER_SIDE, height: PLACEHOLDER_SIDE });
|
||||
self.doc
|
||||
.images
|
||||
.insert(key.clone(), ImageData { bytes: Arc::new(png.to_vec()), width: PLACEHOLDER_SIDE, height: PLACEHOLDER_SIDE });
|
||||
}
|
||||
key
|
||||
}
|
||||
@@ -1046,6 +1053,8 @@ impl<'a> Ctx<'a> {
|
||||
|
||||
/// Cross-references that need every layer imported first.
|
||||
fn finish(&mut self) {
|
||||
// A `.fig` import (its sources are taken below) noted each missing image already.
|
||||
let fig = self.fig_sources.is_some();
|
||||
self.resolve_swap_defaults();
|
||||
// Variants share their set's property definitions.
|
||||
for (set, defs) in std::mem::take(&mut self.set_defs) {
|
||||
@@ -1079,11 +1088,11 @@ impl<'a> Ctx<'a> {
|
||||
flows.push(Flow { name, start: id, description: String::new() });
|
||||
}
|
||||
}
|
||||
if self.missing_images > 0 {
|
||||
if self.missing_images > 0 && !fig {
|
||||
let n = self.missing_images;
|
||||
let (s, verb) = if n == 1 { ("", "shows") } else { ("s", "show") };
|
||||
self.warn(format!(
|
||||
"{n} image{s} without image data {verb} a grey placeholder, named by its imageRef when that can legitimately name a file and by the shared name otherwise (put the downloaded images, named by imageRef, in an `images` folder next to the JSON)"
|
||||
"{n} image{s} without image data {verb} a missing-image placeholder, named by its imageRef when that can legitimately name a file and by the shared name otherwise (put the downloaded images, named by imageRef, in an `images` folder next to the JSON)"
|
||||
));
|
||||
}
|
||||
let unused = self.style_meta.keys().filter(|k| !self.doc.styles.iter().any(|s| s.id == **k)).count();
|
||||
@@ -1465,12 +1474,33 @@ fn sane(p: &BezPath) -> bool {
|
||||
}
|
||||
|
||||
/// Side of the placeholder image (large enough that scaling it up stays flat).
|
||||
const PLACEHOLDER_SIDE: u32 = 64;
|
||||
const PLACEHOLDER_SIDE: u32 = 256;
|
||||
|
||||
/// A light-grey PNG standing in for image fills whose bytes aren't available.
|
||||
fn placeholder_png() -> Option<Vec<u8>> {
|
||||
let img = image::RgbaImage::from_pixel(PLACEHOLDER_SIDE, PLACEHOLDER_SIDE, image::Rgba([0xD9, 0xD9, 0xD9, 0xFF]));
|
||||
let mut out = Vec::new();
|
||||
img.write_to(&mut std::io::Cursor::new(&mut out), image::ImageFormat::Png).ok()?;
|
||||
Some(out)
|
||||
/// The PNG standing in for image fills whose bytes aren't available (#1646): light grey crossed
|
||||
/// by darker diagonal stripes, so it reads as an image that is missing, not as a grey the design
|
||||
/// chose. Made once; [`is_missing_image`] recognises it.
|
||||
pub fn missing_image_placeholder() -> Option<&'static [u8]> {
|
||||
static PNG: std::sync::OnceLock<Option<Vec<u8>>> = std::sync::OnceLock::new();
|
||||
PNG.get_or_init(|| {
|
||||
// Stripes 6 px wide every 18 px across the diagonal, their edges anti-aliased, so they
|
||||
// stay clean when a fill scales the picture up.
|
||||
let (period, width) = (18.0f32, 6.0f32);
|
||||
let (ground, stripe) = ([0xE6u8, 0xE6, 0xE6], [0xB4u8, 0xB4, 0xB4]);
|
||||
let img = image::RgbaImage::from_fn(PLACEHOLDER_SIDE, PLACEHOLDER_SIDE, |x, y| {
|
||||
let t = ((x + y) as f32 + 1.0) / std::f32::consts::SQRT_2 % period;
|
||||
let inside = if t < width { t.min(width - t) + 0.5 } else { 0.5 - (t - width).min(period - t) };
|
||||
let k = inside.clamp(0.0, 1.0);
|
||||
let mix = |i: usize| (f32::from(ground[i]) + (f32::from(stripe[i]) - f32::from(ground[i])) * k).round() as u8;
|
||||
image::Rgba([mix(0), mix(1), mix(2), 0xFF])
|
||||
});
|
||||
let mut out = Vec::new();
|
||||
img.write_to(&mut std::io::Cursor::new(&mut out), image::ImageFormat::Png).ok()?;
|
||||
Some(out)
|
||||
})
|
||||
.as_deref()
|
||||
}
|
||||
|
||||
/// `data` is the placeholder an import stored for an image it didn't have.
|
||||
pub fn is_missing_image(data: &ImageData) -> bool {
|
||||
missing_image_placeholder().is_some_and(|png| data.bytes.as_slice() == png)
|
||||
}
|
||||
|
||||
@@ -443,7 +443,7 @@ impl Ctx<'_> {
|
||||
let vars = &self.doc.variables;
|
||||
let found = parts.filter(|(id, _)| self.var_kinds.contains_key(*id)).and_then(|(id, mode)| {
|
||||
let v = vars.get_by_id(id)?;
|
||||
let m = vars.collection_by_id(&v.collection)?.modes.iter().find(|m| m.id == mode)?;
|
||||
let m = vars.collection_by_id(&v.collection)?.mode_by_id(mode)?;
|
||||
Some(Expr::InMode { variable: v.id.clone(), mode: m.id.clone() })
|
||||
});
|
||||
if found.is_none() {
|
||||
|
||||
@@ -811,6 +811,8 @@ status = "draft — needs native review"
|
||||
"Main menu" = "القائمة الرئيسية"
|
||||
"Make a component" = "إنشاء مكوّن"
|
||||
"Make slot" = "إنشاء خانة محتوى"
|
||||
"Pasted design layers" = "طبقات تصميم ملصقة"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "لُصقت طبقات التصميم؛ لم تحمل الحافظة صور: {layers}"
|
||||
"Scroll wheel zoom" = "التكبير بعجلة التمرير"
|
||||
"Slot name" = "اسم خانة المحتوى"
|
||||
"Mar" = "مارس"
|
||||
@@ -1710,6 +1712,7 @@ status = "draft — needs native review"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "تتجاوز قائمة أحجام مسارات الشبكة 1000 إدخال؛ تستخدم المسارات الأحجام الافتراضية المتساوية"
|
||||
"hidden" = "مخفي"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "تعرض تعبئات الصور التي ليست صورتها في الملف عنصرًا نائبًا لصورة مفقودة وتحتفظ باسمها"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "مرشحات الصورة ملتبسة لوجود حاويتي المرشحات معًا؛ تم تخطي تحويل المرشحات"
|
||||
"image filters use FigCraft's approximate renderer" = "تستخدم مرشحات الصورة مصيّر FigCraft التقريبي"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "تم تخطي خصائص استبدال النسخة المثيلة التي لا يوجد مكوّنها الافتراضي في الملف"
|
||||
@@ -1729,6 +1732,7 @@ status = "draft — needs native review"
|
||||
"layers without a position were placed at their parent's origin" = "وُضعت الطبقات التي ليس لها موضع عند نقطة أصل العنصر الأب"
|
||||
"layers without a type were skipped" = "تم تخطي الطبقات التي ليس لها نوع"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "حاوية مرشحات الصورة القديمة غير مدعومة؛ تم تخطي تحويل المرشحات"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "احتفظت الروابط إلى أنماط مشتركة غير موجودة في الملف بقيم الطبقات نفسها"
|
||||
"locked" = "مقفل"
|
||||
"malformed image filters container was skipped" = "تم تخطي حاوية مرشحات الصورة غير السليمة"
|
||||
"malformed image paintFilter container was skipped" = "تم تخطي حاوية paintFilter غير السليمة للصورة"
|
||||
|
||||
@@ -779,6 +779,8 @@ status = "draft — needs native review"
|
||||
"Main menu" = "প্রধান মেনু"
|
||||
"Make a component" = "একটি কম্পোনেন্ট তৈরি করুন"
|
||||
"Make slot" = "স্লট তৈরি করুন"
|
||||
"Pasted design layers" = "পেস্ট করা ডিজাইন লেয়ার"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "ডিজাইন লেয়ার পেস্ট হয়েছে; ক্লিপবোর্ডে এগুলোর ছবি ছিল না: {layers}"
|
||||
"Scroll wheel zoom" = "স্ক্রল হুইল দিয়ে জুম"
|
||||
"Slot name" = "স্লটের নাম"
|
||||
"Mar" = "মার্চ"
|
||||
@@ -1654,6 +1656,7 @@ status = "draft — needs native review"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "গ্রিড ট্র্যাক সাইজিং তালিকা ১০০০ এন্ট্রি অতিক্রম করেছে; ট্র্যাকগুলো ডিফল্ট সমান সাইজিং ব্যবহার করে"
|
||||
"hidden" = "লুকানো"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "যে ছবি-ফিলের ছবি ফাইলে নেই সেগুলো অনুপস্থিত-ছবির প্লেসহোল্ডার দেখায় এবং তার নাম রাখে"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "ছবির ফিল্টারগুলো দ্ব্যর্থক কারণ উভয় ফিল্টার কন্টেইনার উপস্থিত রয়েছে; ফিল্টার রূপান্তর বাদ দেওয়া হয়েছে"
|
||||
"image filters use FigCraft's approximate renderer" = "ছবির ফিল্টারগুলো FigCraft-এর অনুমানমূলক রেন্ডারার ব্যবহার করে"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "ইনস্ট্যান্স সোয়াপ প্রপার্টি যার ডিফল্ট কম্পোনেন্ট ফাইলে নেই তা বাদ দেওয়া হয়েছে"
|
||||
@@ -1671,6 +1674,7 @@ status = "draft — needs native review"
|
||||
"layers without a position were placed at their parent's origin" = "অবস্থান ছাড়া লেয়ারগুলো তাদের প্যারেন্টের মূল অবস্থানে রাখা হয়েছে"
|
||||
"layers without a type were skipped" = "ধরন ছাড়া লেয়ারগুলো বাদ দেওয়া হয়েছে"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "লিগ্যাসি ইমেজ ফিল্টার কন্টেইনার অসমর্থিত; ফিল্টার রূপান্তর বাদ দেওয়া হয়েছে"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "ফাইলে নেই এমন শেয়ার করা স্টাইলের লিংক থাকা লেয়ারগুলো নিজেদের মান রেখেছে"
|
||||
"locked" = "লক করা"
|
||||
"malformed image filters container was skipped" = "ত্রুটিপূর্ণ ইমেজ ফিল্টার কন্টেইনার বাদ দেওয়া হয়েছে"
|
||||
"malformed image paintFilter container was skipped" = "ত্রুটিপূর্ণ ইমেজ paintFilter কন্টেইনার বাদ দেওয়া হয়েছে"
|
||||
|
||||
@@ -764,6 +764,8 @@ status = "draft — needs native review"
|
||||
"Main menu" = "Hlavní nabídka"
|
||||
"Make a component" = "Vytvořit komponentu"
|
||||
"Make slot" = "Vytvořit slot"
|
||||
"Pasted design layers" = "Vložené návrhové vrstvy"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "Návrhové vrstvy vloženy; schránka neobsahovala obrázky těchto vrstev: {layers}"
|
||||
"Scroll wheel zoom" = "Přibližování kolečkem myši"
|
||||
"Slot name" = "Název slotu"
|
||||
"Mar" = "března"
|
||||
@@ -1619,6 +1621,7 @@ status = "draft — needs native review"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "seznam velikostí stop mřížky přesahuje 1000 položek; stopy používají výchozí stejnou velikost"
|
||||
"hidden" = "skryté"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "obrazové výplně, jejichž obrázek v souboru není, ukazují zástupný symbol chybějícího obrázku a ponechávají jeho název"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "filtry obrázku jsou nejednoznačné, protože jsou přítomny oba kontejnery filtrů; převod filtrů byl přeskočen"
|
||||
"image filters use FigCraft's approximate renderer" = "filtry obrázku používají přibližné vykreslování FigCraftu"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "vlastnosti výměny instance, jejichž výchozí komponenta není v souboru, byly přeskočeny"
|
||||
@@ -1636,6 +1639,7 @@ status = "draft — needs native review"
|
||||
"layers without a position were placed at their parent's origin" = "vrstvy bez pozice byly umístěny do počátku nadřazeného prvku"
|
||||
"layers without a type were skipped" = "vrstvy bez typu byly přeskočeny"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "starší kontejner filtrů obrázku není podporován; převod filtrů byl přeskočen"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "odkazy na sdílené styly, které v souboru nejsou, ponechaly vrstvám jejich vlastní hodnoty"
|
||||
"locked" = "zamknuté"
|
||||
"malformed image filters container was skipped" = "poškozený kontejner filtrů obrázku byl přeskočen"
|
||||
"malformed image paintFilter container was skipped" = "poškozený kontejner paintFilter obrázku byl přeskočen"
|
||||
|
||||
@@ -743,6 +743,8 @@ status = "draft — needs native review"
|
||||
"Main component deleted" = "Hauptkomponente gelöscht"
|
||||
"Main menu" = "Hauptmenü"
|
||||
"Make slot" = "Slot erstellen"
|
||||
"Pasted design layers" = "Eingefügte Designebenen"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "Designebenen eingefügt; die Zwischenablage enthielt die Bilder von {layers} nicht"
|
||||
"Scroll wheel zoom" = "Mit dem Mausrad zoomen"
|
||||
"Slot name" = "Slot-Name"
|
||||
"Margin" = "Rand"
|
||||
@@ -1580,6 +1582,7 @@ status = "draft — needs native review"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "die Liste der Rasterspurgrößen hat mehr als 1000 Einträge; die Spuren verwenden die standardmäßige gleiche Größe"
|
||||
"hidden" = "ausgeblendet"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "Bildfüllungen, deren Bild nicht in der Datei ist, zeigen einen Platzhalter für ein fehlendes Bild und behalten seinen Namen"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "Bildfilter sind mehrdeutig, weil beide Filtercontainer vorhanden sind; die Filterumwandlung wurde übersprungen"
|
||||
"image filters use FigCraft's approximate renderer" = "Bildfilter verwenden die näherungsweise Darstellung von FigCraft"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "Instanztausch-Eigenschaften, deren Standardkomponente nicht in der Datei ist, wurden übersprungen"
|
||||
@@ -1596,6 +1599,7 @@ status = "draft — needs native review"
|
||||
"layers without a position were placed at their parent's origin" = "Ebenen ohne Position wurden am Ursprung ihres übergeordneten Elements platziert"
|
||||
"layers without a type were skipped" = "Ebenen ohne Typ wurden übersprungen"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "der veraltete Bildfiltercontainer wird nicht unterstützt; die Filterumwandlung wurde übersprungen"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "Verweise auf gemeinsame Stile, die nicht in der Datei sind, behielten die eigenen Werte der Ebenen"
|
||||
"locked" = "gesperrt"
|
||||
"malformed image filters container was skipped" = "fehlerhafter Bildfiltercontainer wurde übersprungen"
|
||||
"malformed image paintFilter container was skipped" = "fehlerhafter paintFilter-Container des Bildes wurde übersprungen"
|
||||
|
||||
@@ -820,6 +820,8 @@ name = "English"
|
||||
"Main menu" = "Main menu"
|
||||
"Make a component" = "Make a component"
|
||||
"Make slot" = "Make slot"
|
||||
"Pasted design layers" = "Pasted design layers"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "Pasted design layers; the clipboard didn't carry the images of: {layers}"
|
||||
"Scroll wheel zoom" = "Scroll wheel zoom"
|
||||
"Slot name" = "Slot name"
|
||||
"Mar" = "Mar"
|
||||
@@ -1729,6 +1731,7 @@ name = "English"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing"
|
||||
"hidden" = "hidden"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "image fills whose image isn't in the file show a missing-image placeholder and keep its name"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "image filters are ambiguous because both filter containers are present; filter conversion was skipped"
|
||||
"image filters use FigCraft's approximate renderer" = "image filters use FigCraft's approximate renderer"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "instance swap properties whose default component isn't in the file were skipped"
|
||||
@@ -1751,6 +1754,7 @@ name = "English"
|
||||
"layers without a type were skipped" = "layers without a type were skipped"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "legacy image filter container is unsupported; filter conversion was skipped"
|
||||
"linked vector region fill styles keep resolved appearance; live style links were left out" = "linked vector region fill styles keep resolved appearance; live style links were left out"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "links to shared styles that aren't in the file kept the layers' own values"
|
||||
"locked" = "locked"
|
||||
"malformed image filters container was skipped" = "malformed image filters container was skipped"
|
||||
"malformed image paintFilter container was skipped" = "malformed image paintFilter container was skipped"
|
||||
|
||||
@@ -32,6 +32,8 @@ status = "draft — needs native review"
|
||||
"Connector" = "Conector"
|
||||
"Couldn't download the variables" = "No se pudieron descargar las variables"
|
||||
"Couldn't download {name}" = "No se pudo descargar {name}"
|
||||
"Pasted design layers" = "Capas de diseño pegadas"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "Capas de diseño pegadas; el portapapeles no traía las imágenes de: {layers}"
|
||||
"Relative to" = "Relativa a"
|
||||
"Scroll wheel zoom" = "Zoom con la rueda del ratón"
|
||||
"Trigger layer" = "Capa que la abre"
|
||||
@@ -1698,6 +1700,7 @@ status = "draft — needs native review"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "la lista de tamaños de pista de cuadrícula supera las 1000 entradas; las pistas usan el tamaño igual predeterminado"
|
||||
"hidden" = "oculta"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "los rellenos de imagen cuya imagen no está en el archivo muestran un marcador de imagen ausente y conservan su nombre"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "los filtros de imagen son ambiguos porque están los dos contenedores de filtros; se omitió la conversión de filtros"
|
||||
"image filters use FigCraft's approximate renderer" = "los filtros de imagen usan el renderizado aproximado de FigCraft"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "se omitieron las propiedades de intercambio de instancia cuyo componente predeterminado no está en el archivo"
|
||||
@@ -1717,6 +1720,7 @@ status = "draft — needs native review"
|
||||
"layers without a position were placed at their parent's origin" = "las capas sin posición se colocaron en el origen de su elemento padre"
|
||||
"layers without a type were skipped" = "se omitieron las capas sin tipo"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "el contenedor antiguo de filtros de imagen no es compatible; se omitió la conversión de filtros"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "los vínculos a estilos compartidos que no están en el archivo conservaron los valores propios de las capas"
|
||||
"locked" = "bloqueada"
|
||||
"malformed image filters container was skipped" = "se omitió el contenedor de filtros de imagen mal formado"
|
||||
"malformed image paintFilter container was skipped" = "se omitió el contenedor paintFilter de imagen mal formado"
|
||||
|
||||
@@ -781,6 +781,8 @@ status = "draft — needs native review"
|
||||
"Main menu" = "Päävalikko"
|
||||
"Make a component" = "Luo komponentti"
|
||||
"Make slot" = "Luo sisältöpaikka"
|
||||
"Pasted design layers" = "Liitetyt suunnittelutasot"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "Suunnittelutasot liitetty; leikepöydällä ei ollut näiden kuvia: {layers}"
|
||||
"Scroll wheel zoom" = "Zoomaus hiiren rullalla"
|
||||
"Slot name" = "Sisältöpaikan nimi"
|
||||
"Mar" = "maalisk."
|
||||
@@ -1659,6 +1661,7 @@ status = "draft — needs native review"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "ruudukon kokomääritysten luettelo ylittää 1000 kohdetta; osat käyttävät oletuksen mukaista tasakokoa"
|
||||
"hidden" = "kätketty"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "kuvatäytöt, joiden kuvaa ei ole tiedostossa, näyttävät puuttuvan kuvan paikkamerkin ja säilyttävät sen nimen"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "kuvasuotimet ovat monitulkintaisia, koska molemmat suodinsäilöt ovat läsnä; suotimien muunnos ohitettiin"
|
||||
"image filters use FigCraft's approximate renderer" = "kuvasuotimet käyttävät FigCraftin likimääräistä renderöijää"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "ilmentymän vaihto-ominaisuudet ohitettiin, koska niiden oletuskomponenttia ei ole tiedostossa"
|
||||
@@ -1676,6 +1679,7 @@ status = "draft — needs native review"
|
||||
"layers without a position were placed at their parent's origin" = "tasot, joilta puuttuu sijainti, sijoitettiin emotasonsa origoon"
|
||||
"layers without a type were skipped" = "tasot, joilta puuttuu tyyppi, ohitettiin"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "vanhaa kuvasuodinsäilöä ei tueta; suotimien muunnos ohitettiin"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "linkit jaettuihin tyyleihin, joita tiedostossa ei ole, säilyttivät tasojen omat arvot"
|
||||
"locked" = "lukittu"
|
||||
"malformed image filters container was skipped" = "virheellinen image filters -säilö ohitettiin"
|
||||
"malformed image paintFilter container was skipped" = "virheellinen image paintFilter -säilö ohitettiin"
|
||||
|
||||
@@ -781,6 +781,8 @@ status = "draft — needs native review"
|
||||
"Main menu" = "Menu principal"
|
||||
"Make a component" = "Créer un composant"
|
||||
"Make slot" = "Créer un emplacement"
|
||||
"Pasted design layers" = "Calques de design collés"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "Calques de design collés ; le presse-papiers ne contenait pas les images de : {layers}"
|
||||
"Scroll wheel zoom" = "Zoom avec la molette"
|
||||
"Slot name" = "Nom de l'emplacement"
|
||||
"Mar" = "mars"
|
||||
@@ -1662,6 +1664,7 @@ status = "draft — needs native review"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "la liste de dimensionnement des pistes de grille dépasse 1 000 entrées ; les pistes utilisent le dimensionnement égal par défaut"
|
||||
"hidden" = "masqué"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "les remplissages d'image dont l'image n'est pas dans le fichier affichent un espace réservé d'image manquante et gardent son nom"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "les filtres d’image sont ambigus, car les deux conteneurs de filtres sont présents ; la conversion des filtres a été ignorée"
|
||||
"image filters use FigCraft's approximate renderer" = "les filtres d’image utilisent le rendu approximatif de FigCraft"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "les propriétés de permutation d’instance dont le composant par défaut n’est pas dans le fichier ont été ignorées"
|
||||
@@ -1679,6 +1682,7 @@ status = "draft — needs native review"
|
||||
"layers without a position were placed at their parent's origin" = "les calques sans position ont été placés à l’origine de leur parent"
|
||||
"layers without a type were skipped" = "les calques sans type ont été ignorés"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "l’ancien conteneur de filtres d’image n’est pas pris en charge ; la conversion des filtres a été ignorée"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "les liens vers des styles partagés absents du fichier ont gardé les valeurs propres des calques"
|
||||
"locked" = "verrouillé"
|
||||
"malformed image filters container was skipped" = "le conteneur de filtres d’image mal formé a été ignoré"
|
||||
"malformed image paintFilter container was skipped" = "le conteneur paintFilter d’image mal formé a été ignoré"
|
||||
|
||||
@@ -9,6 +9,8 @@ status = "draft — needs native review"
|
||||
|
||||
[ui]
|
||||
"Add a connected shape" = "Tambahkan bentuk yang terhubung"
|
||||
"Pasted design layers" = "Lapisan desain yang ditempel"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "Lapisan desain ditempel; papan klip tidak membawa gambar dari: {layers}"
|
||||
"Relative to" = "Relatif terhadap"
|
||||
"Scroll wheel zoom" = "Zoom dengan roda gulir"
|
||||
"Trigger layer" = "Layer pemicu"
|
||||
@@ -1623,6 +1625,7 @@ status = "draft — needs native review"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "daftar ukuran track grid melebihi 1000 entri; track memakai ukuran sama besar bawaan"
|
||||
"hidden" = "tersembunyi"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "isian gambar yang gambarnya tidak ada di file menampilkan placeholder gambar hilang dan mempertahankan namanya"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "filter gambar ambigu karena kedua kontainer filter ada; konversi filter dilewati"
|
||||
"image filters use FigCraft's approximate renderer" = "filter gambar memakai perenderan perkiraan FigCraft"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "properti tukar instance yang component bawaannya tidak ada di file dilewati"
|
||||
@@ -1640,6 +1643,7 @@ status = "draft — needs native review"
|
||||
"layers without a position were placed at their parent's origin" = "layer tanpa posisi ditempatkan di titik asal induknya"
|
||||
"layers without a type were skipped" = "layer tanpa tipe dilewati"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "kontainer filter gambar versi lama tidak didukung; konversi filter dilewati"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "tautan ke gaya bersama yang tidak ada di file mempertahankan nilai lapisan itu sendiri"
|
||||
"locked" = "terkunci"
|
||||
"malformed image filters container was skipped" = "kontainer filter gambar yang rusak dilewati"
|
||||
"malformed image paintFilter container was skipped" = "kontainer paintFilter gambar yang rusak dilewati"
|
||||
|
||||
@@ -754,6 +754,8 @@ status = "draft — needs native review"
|
||||
"Main menu" = "Menu principale"
|
||||
"Make a component" = "Crea un componente"
|
||||
"Make slot" = "Crea slot"
|
||||
"Pasted design layers" = "Livelli di design incollati"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "Livelli di design incollati; gli appunti non contenevano le immagini di: {layers}"
|
||||
"Scroll wheel zoom" = "Zoom con la rotella del mouse"
|
||||
"Slot name" = "Nome dello slot"
|
||||
"Mar" = "mar"
|
||||
@@ -1597,6 +1599,7 @@ status = "draft — needs native review"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "l'elenco di dimensionamento delle tracce della griglia supera 1000 voci; le tracce usano il dimensionamento uniforme predefinito"
|
||||
"hidden" = "nascosto"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "i riempimenti immagine la cui immagine non è nel file mostrano un segnaposto di immagine mancante e ne mantengono il nome"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "i filtri immagine sono ambigui perché sono presenti entrambi i contenitori di filtri; la conversione dei filtri è stata saltata"
|
||||
"image filters use FigCraft's approximate renderer" = "i filtri immagine usano il renderer approssimato di FigCraft"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "le proprietà di scambio istanza il cui componente predefinito non è nel file sono state saltate"
|
||||
@@ -1614,6 +1617,7 @@ status = "draft — needs native review"
|
||||
"layers without a position were placed at their parent's origin" = "i livelli senza posizione sono stati posti all'origine del loro genitore"
|
||||
"layers without a type were skipped" = "i livelli senza tipo sono stati saltati"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "il contenitore di filtri immagine legacy non è supportato; la conversione dei filtri è stata saltata"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "i collegamenti a stili condivisi che non sono nel file hanno mantenuto i valori propri dei livelli"
|
||||
"locked" = "bloccato"
|
||||
"malformed image filters container was skipped" = "il contenitore di filtri immagine malformato è stato saltato"
|
||||
"malformed image paintFilter container was skipped" = "il contenitore paintFilter dell'immagine malformato è stato saltato"
|
||||
|
||||
@@ -775,6 +775,8 @@ status = "draft — needs native review"
|
||||
"Main menu" = "メインメニュー"
|
||||
"Make a component" = "コンポーネントを作成"
|
||||
"Make slot" = "スロットにする"
|
||||
"Pasted design layers" = "貼り付けたデザインレイヤー"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "デザインレイヤーを貼り付けました。クリップボードに次の画像がありませんでした: {layers}"
|
||||
"Scroll wheel zoom" = "スクロールホイールでズーム"
|
||||
"Slot name" = "スロット名"
|
||||
"Mar" = "3月"
|
||||
@@ -1643,6 +1645,7 @@ status = "draft — needs native review"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "グリッドトラックのサイズ指定リストが 1000 項目を超えるため、トラックはデフォルトの均等サイズを使用"
|
||||
"hidden" = "非表示"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "ファイルに画像がない画像塗りは、画像欠落のプレースホルダーを表示し、その名前を保持します"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "両方のフィルターコンテナがあり画像フィルターが曖昧なため、フィルターの変換をスキップ"
|
||||
"image filters use FigCraft's approximate renderer" = "画像フィルターは FigCraft の近似レンダリングで描画"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "デフォルトのコンポーネントがファイルにないインスタンスの入れ替えプロパティをスキップ"
|
||||
@@ -1660,6 +1663,7 @@ status = "draft — needs native review"
|
||||
"layers without a position were placed at their parent's origin" = "位置のないレイヤーは親の原点に配置"
|
||||
"layers without a type were skipped" = "タイプのないレイヤーをスキップ"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "旧形式の画像フィルターコンテナは未対応のため、フィルターの変換をスキップ"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "ファイルにない共有スタイルへのリンクは、レイヤー自身の値を保持しました"
|
||||
"locked" = "ロック中"
|
||||
"malformed image filters container was skipped" = "不正な画像フィルターコンテナをスキップ"
|
||||
"malformed image paintFilter container was skipped" = "不正な画像の paintFilter コンテナをスキップ"
|
||||
|
||||
@@ -788,6 +788,8 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
|
||||
"Main menu" = "მთავარი მენიუ"
|
||||
"Make a component" = "შექმენით კომპონენტი"
|
||||
"Make slot" = "სლოტად გადაქცევა"
|
||||
"Pasted design layers" = "ჩასმული დიზაინის ფენები"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "დიზაინის ფენები ჩაისვა; ბუფერში არ იყო შემდეგის სურათები: {layers}"
|
||||
"Scroll wheel zoom" = "მასშტაბირება გადახვევის ბორბლით"
|
||||
"Slot name" = "სლოტის სახელი"
|
||||
"Mar" = "მარ"
|
||||
@@ -1680,6 +1682,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "ბადის ტრეკების ზომების სია 1000 ჩანაწერს აღემატება; ტრეკები ნაგულისხმევ თანაბარ ზომებს იყენებს"
|
||||
"hidden" = "დამალული"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "სურათის შევსებები, რომელთა სურათი ფაილში არ არის, აჩვენებს დაკარგული სურათის ჩანაცვლებას და ინარჩუნებს მის სახელს"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "გამოსახულების ფილტრები ორაზროვანია, რადგან ფილტრების ორივე კონტეინერია მოცემული; ფილტრების გარდაქმნა გამოტოვებულია"
|
||||
"image filters use FigCraft's approximate renderer" = "გამოსახულების ფილტრები FigCraft-ის მიახლოებითი რენდერით გამოისახება"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "ინსტანსის ჩანაცვლების თვისებები, რომელთა ნაგულისხმევი კომპონენტი ფაილში არ არის, გამოტოვებულია"
|
||||
@@ -1697,6 +1700,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
|
||||
"layers without a position were placed at their parent's origin" = "პოზიციის გარეშე შრეები მშობლის საწყის წერტილში განთავსდა"
|
||||
"layers without a type were skipped" = "ტიპის გარეშე შრეები გამოტოვებულია"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "გამოსახულების ფილტრების ძველი კონტეინერი მხარდაუჭერელია; ფილტრების გარდაქმნა გამოტოვებულია"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "ფაილში არარსებულ საერთო სტილებზე ბმულებმა შეინარჩუნეს ფენების საკუთარი მნიშვნელობები"
|
||||
"locked" = "ჩაკეტილი"
|
||||
"malformed image filters container was skipped" = "გამოსახულების ფილტრების დაზიანებული კონტეინერი გამოტოვებულია"
|
||||
"malformed image paintFilter container was skipped" = "გამოსახულების paintFilter-ის დაზიანებული კონტეინერი გამოტოვებულია"
|
||||
|
||||
@@ -739,6 +739,8 @@ status = "draft — needs native review"
|
||||
"Main component deleted" = "메인 컴포넌트가 삭제됨"
|
||||
"Main menu" = "메인 메뉴"
|
||||
"Make slot" = "슬롯으로 만들기"
|
||||
"Pasted design layers" = "붙여넣은 디자인 레이어"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "디자인 레이어를 붙여넣었습니다. 클립보드에 다음 이미지가 없었습니다: {layers}"
|
||||
"Scroll wheel zoom" = "스크롤 휠로 확대/축소"
|
||||
"Slot name" = "슬롯 이름"
|
||||
"Margin" = "여백"
|
||||
@@ -1571,6 +1573,7 @@ status = "draft — needs native review"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "그리드 트랙 크기 목록이 1000개 항목을 넘어 트랙은 기본 균등 크기를 사용함"
|
||||
"hidden" = "숨김"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "파일에 이미지가 없는 이미지 채우기는 누락된 이미지 자리 표시자를 표시하고 그 이름을 유지합니다"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "필터 컨테이너가 둘 다 있어 이미지 필터가 모호하므로 필터 변환을 건너뜀"
|
||||
"image filters use FigCraft's approximate renderer" = "이미지 필터는 FigCraft의 근사 렌더링을 사용함"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "기본 컴포넌트가 파일에 없는 인스턴스 교체 속성을 건너뜀"
|
||||
@@ -1587,6 +1590,7 @@ status = "draft — needs native review"
|
||||
"layers without a position were placed at their parent's origin" = "위치가 없는 레이어는 상위 요소의 원점에 배치됨"
|
||||
"layers without a type were skipped" = "유형이 없는 레이어를 건너뜀"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "레거시 이미지 필터 컨테이너는 지원되지 않아 필터 변환을 건너뜀"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "파일에 없는 공유 스타일에 대한 링크는 레이어 자체 값을 유지했습니다"
|
||||
"locked" = "잠김"
|
||||
"malformed image filters container was skipped" = "잘못된 형식의 이미지 필터 컨테이너를 건너뜀"
|
||||
"malformed image paintFilter container was skipped" = "잘못된 형식의 이미지 paintFilter 컨테이너를 건너뜀"
|
||||
|
||||
@@ -781,6 +781,8 @@ status = "draft — needs native review"
|
||||
"Main menu" = "Hoofdmenu"
|
||||
"Make a component" = "Maak een component"
|
||||
"Make slot" = "Slot maken"
|
||||
"Pasted design layers" = "Geplakte ontwerplagen"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "Ontwerplagen geplakt; het klembord bevatte de afbeeldingen van {layers} niet"
|
||||
"Scroll wheel zoom" = "Zoomen met scrollwiel"
|
||||
"Slot name" = "Slotnaam"
|
||||
"Mar" = "mrt."
|
||||
@@ -1659,6 +1661,7 @@ status = "draft — needs native review"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "de lijst met maten voor rastertracks bevat meer dan 1000 items; de tracks gebruiken de standaard gelijke maat"
|
||||
"hidden" = "verborgen"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "afbeeldingsvullingen waarvan de afbeelding niet in het bestand staat, tonen een plaatsaanduiding voor een ontbrekende afbeelding en behouden de naam"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "afbeeldingsfilters zijn dubbelzinnig omdat beide filtercontainers aanwezig zijn; filterconversie is overgeslagen"
|
||||
"image filters use FigCraft's approximate renderer" = "afbeeldingsfilters gebruiken de benaderende renderer van FigCraft"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "instance-swap-eigenschappen waarvan de standaardcomponent niet in het bestand zit, zijn overgeslagen"
|
||||
@@ -1676,6 +1679,7 @@ status = "draft — needs native review"
|
||||
"layers without a position were placed at their parent's origin" = "lagen zonder positie zijn op de oorsprong van het bovenliggende element geplaatst"
|
||||
"layers without a type were skipped" = "lagen zonder type zijn overgeslagen"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "Verouderde container voor beeldfilters wordt niet ondersteund; filterconversie is overgeslagen"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "koppelingen naar gedeelde stijlen die niet in het bestand staan, hielden de eigen waarden van de lagen"
|
||||
"locked" = "vergrendeld"
|
||||
"malformed image filters container was skipped" = "misvormde container met afbeeldingsfilters is overgeslagen"
|
||||
"malformed image paintFilter container was skipped" = "onjuist gevormde image paintFilter-container is overgeslagen"
|
||||
|
||||
@@ -783,6 +783,8 @@ name = "Polski"
|
||||
"Main menu" = "Menu główne"
|
||||
"Make a component" = "Utwórz komponent"
|
||||
"Make slot" = "Utwórz gniazdo (slot)"
|
||||
"Pasted design layers" = "Wklejone warstwy projektu"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "Wklejono warstwy projektu; schowek nie zawierał obrazów warstw: {layers}"
|
||||
"Scroll wheel zoom" = "Powiększanie kółkiem myszy"
|
||||
"Slot name" = "Nazwa gniazda"
|
||||
"Mar" = "Mar"
|
||||
@@ -1669,6 +1671,7 @@ name = "Polski"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "lista rozmiarów ścieżek siatki przekracza 1000 pozycji; ścieżki używają domyślnego równego rozmiaru"
|
||||
"hidden" = "ukryty"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "wypełnienia obrazem, których obrazu nie ma w pliku, pokazują symbol zastępczy brakującego obrazu i zachowują jego nazwę"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "filtry obrazu są niejednoznaczne, ponieważ obecne są oba kontenery filtrów; konwersja filtrów została pominięta"
|
||||
"image filters use FigCraft's approximate renderer" = "filtry obrazu używają przybliżonego renderera FigCraft"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "właściwości podmiany instancji, których domyślny komponent nie znajduje się w pliku, zostały pominięte"
|
||||
@@ -1686,6 +1689,7 @@ name = "Polski"
|
||||
"layers without a position were placed at their parent's origin" = "warstwy bez określonej pozycji zostały umieszczone w punkcie początkowym rodzica"
|
||||
"layers without a type were skipped" = "warstwy bez typu zostały pominięte"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "przestarzały kontener filtrów obrazu jest nieobsługiwany; konwersja filtrów została pominięta"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "odwołania do współdzielonych stylów, których nie ma w pliku, zachowały własne wartości warstw"
|
||||
"locked" = "Zablokowane"
|
||||
"malformed image filters container was skipped" = "nieprawidłowy kontener filtrów obrazu został pominięty"
|
||||
"malformed image paintFilter container was skipped" = "nieprawidłowy kontener filtrów malowania (paintFilter) został pominięty"
|
||||
|
||||
@@ -738,6 +738,8 @@ status = "draft — needs native review"
|
||||
"Main component deleted" = "Componente principal excluído"
|
||||
"Main menu" = "Menu principal"
|
||||
"Make slot" = "Transformar em slot"
|
||||
"Pasted design layers" = "Camadas de design coladas"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "Camadas de design coladas; a área de transferência não trouxe as imagens de: {layers}"
|
||||
"Scroll wheel zoom" = "Zoom com a roda do mouse"
|
||||
"Slot name" = "Nome do slot"
|
||||
"Margin" = "Margem"
|
||||
@@ -1569,6 +1571,7 @@ status = "draft — needs native review"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "a lista de dimensionamento de faixas da grade passa de 1000 entradas; as faixas usam o dimensionamento igual padrão"
|
||||
"hidden" = "oculta"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "preenchimentos de imagem cuja imagem não está no arquivo mostram um marcador de imagem ausente e mantêm seu nome"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "os filtros de imagem são ambíguos porque os dois contêineres de filtro estão presentes; a conversão dos filtros foi ignorada"
|
||||
"image filters use FigCraft's approximate renderer" = "os filtros de imagem usam a renderização aproximada do FigCraft"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "propriedades de troca de instância cujo componente padrão não está no arquivo foram ignoradas"
|
||||
@@ -1585,6 +1588,7 @@ status = "draft — needs native review"
|
||||
"layers without a position were placed at their parent's origin" = "camadas sem posição foram colocadas na origem do elemento pai"
|
||||
"layers without a type were skipped" = "camadas sem tipo foram ignoradas"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "o contêiner legado de filtros de imagem não é compatível; a conversão dos filtros foi ignorada"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "vínculos para estilos compartilhados que não estão no arquivo mantiveram os valores próprios das camadas"
|
||||
"locked" = "bloqueada"
|
||||
"malformed image filters container was skipped" = "o contêiner de filtros de imagem malformado foi ignorado"
|
||||
"malformed image paintFilter container was skipped" = "o contêiner paintFilter de imagem malformado foi ignorado"
|
||||
|
||||
@@ -783,6 +783,8 @@ name = "Русский"
|
||||
"Main menu" = "Главное меню"
|
||||
"Make a component" = "Создать компонент"
|
||||
"Make slot" = "Сделать слотом"
|
||||
"Pasted design layers" = "Вставленные слои дизайна"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "Слои дизайна вставлены; в буфере обмена не было изображений слоёв: {layers}"
|
||||
"Scroll wheel zoom" = "Масштабирование колесом мыши"
|
||||
"Slot name" = "Имя слота"
|
||||
"Mar" = "мар."
|
||||
@@ -1669,6 +1671,7 @@ name = "Русский"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "список размеров треков сетки превышает 1000 записей; треки получают стандартный равный размер"
|
||||
"hidden" = "скрыто"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "заливки изображением, чьего изображения нет в файле, показывают заглушку отсутствующего изображения и сохраняют его имя"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "фильтры изображения неоднозначны, так как есть оба контейнера фильтров; преобразование фильтров пропущено"
|
||||
"image filters use FigCraft's approximate renderer" = "фильтры изображения отрисовываются приблизительно средствами FigCraft"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "свойства замены экземпляра, компонент по умолчанию которых отсутствует в файле, пропущены"
|
||||
@@ -1686,6 +1689,7 @@ name = "Русский"
|
||||
"layers without a position were placed at their parent's origin" = "слои без положения размещены в начале координат родителя"
|
||||
"layers without a type were skipped" = "слои без типа пропущены"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "устаревший контейнер фильтров изображения не поддерживается; преобразование фильтров пропущено"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "ссылки на общие стили, которых нет в файле, сохранили собственные значения слоёв"
|
||||
"locked" = "заблокировано"
|
||||
"malformed image filters container was skipped" = "повреждённый контейнер фильтров изображения пропущен"
|
||||
"malformed image paintFilter container was skipped" = "повреждённый контейнер paintFilter изображения пропущен"
|
||||
|
||||
@@ -818,6 +818,8 @@ name = "Svenska"
|
||||
"Main menu" = "Huvudmeny"
|
||||
"Make a component" = "Skapa en komponent"
|
||||
"Make slot" = "Gör till plats"
|
||||
"Pasted design layers" = "Inklistrade designlager"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "Designlager inklistrade; urklippet innehöll inte bilderna för: {layers}"
|
||||
"Scroll wheel zoom" = "Zooma med scrollhjulet"
|
||||
"Slot name" = "Platsens namn"
|
||||
"Mar" = "Mar"
|
||||
@@ -1726,6 +1728,7 @@ name = "Svenska"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "listan över storlekar på rutnätsspår har fler än 1000 poster; spåren får standardstorleken med lika stora spår"
|
||||
"hidden" = "dold"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "bildfyllningar vars bild inte finns i filen visar en platshållare för saknad bild och behåller dess namn"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "bildfiltren är tvetydiga eftersom båda filterbehållarna finns; filterkonverteringen hoppades över"
|
||||
"image filters use FigCraft's approximate renderer" = "bildfilter använder FigCrafts ungefärliga rendering"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "egenskaper för instansbyte vars standardkomponent inte finns i filen hoppades över"
|
||||
@@ -1748,6 +1751,7 @@ name = "Svenska"
|
||||
"layers without a type were skipped" = "lager utan typ hoppades över"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "den äldre bildfilterbehållaren stöds inte; filterkonverteringen hoppades över"
|
||||
"linked vector region fill styles keep resolved appearance; live style links were left out" = "länkade fyllningsstilar i vektorregioner behåller sitt beräknade utseende; levande stillänkar utelämnades"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "länkar till delade stilar som inte finns i filen behöll lagrens egna värden"
|
||||
"locked" = "låst"
|
||||
"malformed image filters container was skipped" = "en felaktig bildfilterbehållare hoppades över"
|
||||
"malformed image paintFilter container was skipped" = "en felaktig paintFilter-behållare för bild hoppades över"
|
||||
|
||||
@@ -777,6 +777,8 @@ status = "draft — needs native review"
|
||||
"Main menu" = "เมนูหลัก"
|
||||
"Make a component" = "สร้างคอมโพเนนต์"
|
||||
"Make slot" = "สร้างสล็อต"
|
||||
"Pasted design layers" = "เลเยอร์ดีไซน์ที่วาง"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "วางเลเยอร์ดีไซน์แล้ว คลิปบอร์ดไม่มีภาพของ: {layers}"
|
||||
"Scroll wheel zoom" = "ซูมด้วยล้อเลื่อนเมาส์"
|
||||
"Slot name" = "ชื่อสล็อต"
|
||||
"Mar" = "มี.ค."
|
||||
@@ -1648,6 +1650,7 @@ status = "draft — needs native review"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "รายการขนาดแทร็กกริดเกิน 1000 รายการ: แทร็กใช้ขนาดเท่ากันตามค่าเริ่มต้น"
|
||||
"hidden" = "ซ่อนอยู่"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "การเติมภาพที่ภาพไม่อยู่ในไฟล์จะแสดงตัวยึดตำแหน่งภาพที่หายไปและเก็บชื่อไว้"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "ตัวกรองรูปภาพกำกวมเพราะมีคอนเทนเนอร์ตัวกรองทั้งสองแบบ: ข้ามการแปลงตัวกรอง"
|
||||
"image filters use FigCraft's approximate renderer" = "ตัวกรองรูปภาพใช้ตัวเรนเดอร์โดยประมาณของ FigCraft"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "ข้ามพร็อพเพอร์ตีสลับอินสแตนซ์ที่คอมโพเนนต์เริ่มต้นไม่อยู่ในไฟล์"
|
||||
@@ -1665,6 +1668,7 @@ status = "draft — needs native review"
|
||||
"layers without a position were placed at their parent's origin" = "เลเยอร์ที่ไม่มีตำแหน่งถูกวางที่จุดกำเนิดของตัวแม่"
|
||||
"layers without a type were skipped" = "ข้ามเลเยอร์ที่ไม่มีชนิด"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "ไม่รองรับคอนเทนเนอร์ตัวกรองรูปภาพแบบเก่า: ข้ามการแปลงตัวกรอง"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "ลิงก์ไปยังสไตล์ที่ใช้ร่วมกันซึ่งไม่มีในไฟล์ใช้ค่าของเลเยอร์เอง"
|
||||
"locked" = "ล็อกอยู่"
|
||||
"malformed image filters container was skipped" = "ข้ามคอนเทนเนอร์ตัวกรองรูปภาพที่รูปแบบผิด"
|
||||
"malformed image paintFilter container was skipped" = "ข้ามคอนเทนเนอร์ paintFilter ของรูปภาพที่รูปแบบผิด"
|
||||
|
||||
@@ -768,6 +768,8 @@ name = "Türkçe"
|
||||
"Main menu" = "Ana menü"
|
||||
"Make a component" = "Bileşen yap"
|
||||
"Make slot" = "Yuva yap"
|
||||
"Pasted design layers" = "Yapıştırılan tasarım katmanları"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "Tasarım katmanları yapıştırıldı; pano şunların görsellerini taşımıyordu: {layers}"
|
||||
"Scroll wheel zoom" = "Kaydırma tekerleğiyle yakınlaştırma"
|
||||
"Slot name" = "Yuva adı"
|
||||
"Mar" = "Mar"
|
||||
@@ -1623,6 +1625,7 @@ name = "Türkçe"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "ızgara izi boyutlandırma listesi 1000 girdiyi aşıyor; izler varsayılan eşit boyutlandırmayı kullanır"
|
||||
"hidden" = "gizli"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "görseli dosyada olmayan görsel dolguları eksik görsel yer tutucusu gösterir ve adını korur"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "iki filtre kapsayıcısı da bulunduğu için görüntü filtreleri belirsiz; filtre dönüştürme atlandı"
|
||||
"image filters use FigCraft's approximate renderer" = "görüntü filtreleri FigCraft'ın yaklaşık işlemesini kullanır"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "varsayılan bileşeni dosyada olmayan örnek değiştirme özellikleri atlandı"
|
||||
@@ -1640,6 +1643,7 @@ name = "Türkçe"
|
||||
"layers without a position were placed at their parent's origin" = "konumu olmayan katmanlar üst öğelerinin başlangıç noktasına yerleştirildi"
|
||||
"layers without a type were skipped" = "türü olmayan katmanlar atlandı"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "eski görüntü filtresi kapsayıcısı desteklenmiyor; filtre dönüştürme atlandı"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "dosyada olmayan paylaşılan stillere bağlantılar katmanların kendi değerlerini korudu"
|
||||
"locked" = "kilitli"
|
||||
"malformed image filters container was skipped" = "bozuk görüntü filtreleri kapsayıcısı atlandı"
|
||||
"malformed image paintFilter container was skipped" = "bozuk görüntü paintFilter kapsayıcısı atlandı"
|
||||
|
||||
@@ -755,6 +755,8 @@ status = "draft — needs native review"
|
||||
"Main menu" = "Trình đơn chính"
|
||||
"Make a component" = "Tạo thành phần"
|
||||
"Make slot" = "Tạo ô chứa"
|
||||
"Pasted design layers" = "Các lớp thiết kế đã dán"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "Đã dán các lớp thiết kế; bộ nhớ tạm không có hình ảnh của: {layers}"
|
||||
"Scroll wheel zoom" = "Thu phóng bằng con lăn chuột"
|
||||
"Slot name" = "Tên ô chứa"
|
||||
"Mar" = "Thg 3"
|
||||
@@ -1598,6 +1600,7 @@ status = "draft — needs native review"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "danh sách kích thước dải lưới vượt quá 1000 mục; các dải sẽ dùng kích thước đều nhau mặc định"
|
||||
"hidden" = "đã ẩn"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "các phần tô hình ảnh có hình ảnh không có trong tệp hiển thị phần giữ chỗ hình ảnh bị thiếu và giữ tên của nó"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "bộ lọc hình ảnh không rõ ràng do có cả hai vùng chứa bộ lọc; đã bỏ qua chuyển đổi bộ lọc"
|
||||
"image filters use FigCraft's approximate renderer" = "bộ lọc hình ảnh sử dụng bộ kết xuất xấp xỉ của FigCraft"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "đã bỏ qua các thuộc tính hoán đổi bản thể có thành phần mặc định không nằm trong tệp"
|
||||
@@ -1615,6 +1618,7 @@ status = "draft — needs native review"
|
||||
"layers without a position were placed at their parent's origin" = "các lớp không có vị trí đã được đặt tại gốc tọa độ của lớp cha"
|
||||
"layers without a type were skipped" = "đã bỏ qua các lớp không có loại"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "vùng chứa bộ lọc hình ảnh kiểu cũ không được hỗ trợ; đã bỏ qua chuyển đổi bộ lọc"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "các liên kết đến kiểu dùng chung không có trong tệp đã giữ giá trị riêng của các lớp"
|
||||
"locked" = "đã khóa"
|
||||
"malformed image filters container was skipped" = "đã bỏ qua vùng chứa bộ lọc hình ảnh bị lỗi định dạng"
|
||||
"malformed image paintFilter container was skipped" = "đã bỏ qua vùng chứa paintFilter hình ảnh bị lỗi định dạng"
|
||||
|
||||
@@ -744,6 +744,8 @@ status = "draft — needs native review"
|
||||
"Main component deleted" = "主组件已删除"
|
||||
"Main menu" = "主菜单"
|
||||
"Make slot" = "设为插槽"
|
||||
"Pasted design layers" = "粘贴的设计图层"
|
||||
"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "已粘贴设计图层;剪贴板未包含以下图层的图像:{layers}"
|
||||
"Scroll wheel zoom" = "滚轮缩放"
|
||||
"Slot name" = "插槽名称"
|
||||
"Margin" = "边距"
|
||||
@@ -1579,6 +1581,7 @@ status = "draft — needs native review"
|
||||
"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "网格轨道尺寸列表超过 1000 个条目;轨道使用默认的等分尺寸"
|
||||
"hidden" = "已隐藏"
|
||||
"iOS" = "iOS"
|
||||
"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "图像不在文件中的图像填充会显示缺失图像占位图并保留其名称"
|
||||
"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "两个滤镜容器同时存在,图片滤镜有歧义;已跳过滤镜转换"
|
||||
"image filters use FigCraft's approximate renderer" = "图片滤镜使用 FigCraft 的近似渲染"
|
||||
"instance swap properties whose default component isn't in the file were skipped" = "已跳过默认组件不在文件中的实例替换属性"
|
||||
@@ -1595,6 +1598,7 @@ status = "draft — needs native review"
|
||||
"layers without a position were placed at their parent's origin" = "没有位置的图层已放在其父级的原点"
|
||||
"layers without a type were skipped" = "已跳过没有类型的图层"
|
||||
"legacy image filter container is unsupported; filter conversion was skipped" = "不支持旧版图片滤镜容器;已跳过滤镜转换"
|
||||
"links to shared styles that aren't in the file kept the layers' own values" = "指向文件中不存在的共享样式的链接保留了图层自身的值"
|
||||
"locked" = "已锁定"
|
||||
"malformed image filters container was skipped" = "已跳过格式错误的图片滤镜容器"
|
||||
"malformed image paintFilter container was skipped" = "已跳过格式错误的图片 paintFilter 容器"
|
||||
|
||||
@@ -35,10 +35,15 @@ impl Report {
|
||||
/// a native file's `repairs` are shown by the engine's own message, and an SVG opened without
|
||||
/// notes has nothing to report. `params` are the command's, for the file's name.
|
||||
pub fn from_result(command: &str, params: &Value, result: &Value) -> Option<Self> {
|
||||
if !matches!(command, "file.open" | "file.openRecent" | "file.import") {
|
||||
if !matches!(command, "file.open" | "file.openRecent" | "file.import" | "edit.pasteDesignLayers") {
|
||||
return None;
|
||||
}
|
||||
let warnings = result.get("warnings").and_then(Value::as_array)?;
|
||||
// A paste is reported when something was left out or changed, as an import into the page.
|
||||
let pasted = command == "edit.pasteDesignLayers";
|
||||
if pasted && warnings.is_empty() {
|
||||
return None;
|
||||
}
|
||||
let file_name = params.get("path").and_then(Value::as_str).and_then(|p| std::path::Path::new(p).file_name()).and_then(|n| n.to_str());
|
||||
if command != "file.import" && warnings.is_empty() && file_name.is_some_and(|n| n.to_ascii_lowercase().ends_with(".svg")) {
|
||||
return None;
|
||||
@@ -56,14 +61,14 @@ impl Report {
|
||||
.and_then(Value::as_str)
|
||||
.or(file_name)
|
||||
.or_else(|| params.get("name").and_then(Value::as_str))
|
||||
.unwrap_or(tr("Imported document"));
|
||||
.unwrap_or(if pasted { tr("Pasted design layers") } else { tr("Imported document") });
|
||||
let mut report = Self {
|
||||
name: name.chars().take(512).collect(),
|
||||
pages: count("pages"),
|
||||
layers: count("layers"),
|
||||
images: count("images"),
|
||||
appended,
|
||||
placed: command == "file.import" && !appended,
|
||||
placed: (command == "file.import" && !appended) || pasted,
|
||||
uid: 0,
|
||||
notes: Vec::new(),
|
||||
shown: Vec::new(),
|
||||
|
||||
@@ -556,7 +556,7 @@ fn table(app: &mut FigApp, ui: &mut Ui, view: &View, st: &mut Editor) {
|
||||
crate::widgets::select_all_on_focus(ui, &r, &st.query);
|
||||
let note = Rect::from_min_max(pos2(field.max.x + 16.0, sr.min.y + 8.0), pos2(sr.max.x - 16.0, sr.max.y - 8.0));
|
||||
let mut bar = ui.new_child(UiBuilder::new().max_rect(note).layout(egui::Layout::right_to_left(egui::Align::Center)));
|
||||
let text = match (view.library, coll.extends.as_deref().and_then(|p| view.vars.collection(p))) {
|
||||
let text = match (view.library, coll.extends.as_deref().and_then(|p| view.vars.collection_by_id(p))) {
|
||||
(Some((lib, name)), _) => {
|
||||
let tip = tr("A collection of this file with these modes and variables: override their values per mode and add variables of its own");
|
||||
if widgets::button(&mut bar, tr("Extend collection"), false, true).on_hover_text(tip).clicked() {
|
||||
@@ -801,7 +801,7 @@ fn value_cell(app: &mut FigApp, ui: &mut Ui, view: &View, v: &Variable, coll: &C
|
||||
}
|
||||
}
|
||||
if let VariableValue::Alias(target) = val {
|
||||
let full = view.vars.get(target).map(|x| x.name.as_str()).unwrap_or(tr("Missing variable"));
|
||||
let full = view.vars.get_by_id(target).map(|x| x.name.as_str()).unwrap_or(tr("Missing variable"));
|
||||
let resp = ui.interact(body, id.with("alias"), if editable { Sense::click() } else { Sense::hover() });
|
||||
let resp = if editable { resp.on_hover_text(tr("Change alias")) } else { resp };
|
||||
ui.painter().rect_filled(body, CornerRadius::same(5), t.field);
|
||||
@@ -968,7 +968,7 @@ fn create_row(app: &mut FigApp, ui: &mut Ui, view: &View, coll: &Collection, st:
|
||||
/// The details of one of this file's variables: name, description, where pickers offer it and
|
||||
/// whether publishing the file as a library leaves it out.
|
||||
fn details(app: &mut FigApp, ctx: &Context, vars: &Variables, st: &mut Editor) {
|
||||
let Some(v) = st.details.as_ref().filter(|_| st.library.is_none()).and_then(|id| vars.get(id)).cloned() else {
|
||||
let Some(v) = st.details.as_ref().filter(|_| st.library.is_none()).and_then(|id| vars.get_by_id(id)).cloned() else {
|
||||
st.details = None;
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -202,3 +202,15 @@ fn a_file_opened_from_base64_data_has_a_summary_too() {
|
||||
// Shown as a sentence, worked out once when the report opens.
|
||||
assert!(report.shown.iter().any(|n| n == "Layers without a type were skipped"), "{:?}", report.shown);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_paste_that_left_something_out_is_reported_like_an_import() {
|
||||
let note = "image fills whose image isn't in the file show a missing-image placeholder and keep its name";
|
||||
let result = json!({"ids": [], "warnings": [note], "missingImages": ["Hero"]});
|
||||
let report = Report::from_result("edit.pasteDesignLayers", &json!({"html": "<span></span>"}), &result).unwrap();
|
||||
assert_eq!(report.name, "Pasted design layers");
|
||||
assert!(report.placed && !report.appended, "placed on the current page");
|
||||
assert_eq!(report.notes.len(), 1);
|
||||
// A paste that left nothing out opens no report.
|
||||
assert!(Report::from_result("edit.pasteDesignLayers", &json!({}), &json!({"ids": [], "warnings": []})).is_none());
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
use serde_json::Value;
|
||||
|
||||
use super::{FigApp, dev_mode_refuses, json, trn};
|
||||
use crate::i18n::trf;
|
||||
|
||||
/// Run a menu item: some open dialogs or use platform services, the rest go to the engine.
|
||||
/// Paste: the system clipboard wins when it holds something newer than our own copy (layers copied
|
||||
@@ -28,12 +31,17 @@ pub fn paste(app: &mut FigApp, event_text: Option<&str>, at: Option<(f64, f64)>)
|
||||
params["x"] = json!(x);
|
||||
params["y"] = json!(y);
|
||||
}
|
||||
if let Some(r) = app.run("edit.pasteDesignLayers", params) {
|
||||
// A paste the user made: what was left out shows in the import report.
|
||||
if let Some(r) = app.run_user("edit.pasteDesignLayers", params) {
|
||||
// The pasted layers are now our copy: text another app puts on the clipboard later is newer.
|
||||
app.ui.last_copy = Some(app.services.clipboard_get_text().unwrap_or_default());
|
||||
app.ui.last_copy_generation = app.session.clipboard.layers_generation;
|
||||
let missing: Vec<&str> = r["missingImages"].as_array().map(|a| a.iter().filter_map(Value::as_str).collect()).unwrap_or_default();
|
||||
let left_out = r["warnings"].as_array().map_or(0, Vec::len);
|
||||
if left_out > 0 {
|
||||
if !missing.is_empty() {
|
||||
// Name the layers: an image the clipboard didn't carry is easy to miss among them.
|
||||
app.toast(trf("Pasted design layers; the clipboard didn't carry the images of: {layers}", &[("layers", &missing.join(", "))]));
|
||||
} else if left_out > 0 {
|
||||
app.toast(trn("Pasted design layers; {n} kinds of content were left out", left_out, &[]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -904,7 +904,7 @@ fn publish_form(app: &mut FigApp, ui: &mut Ui, w: f32, doc: &Document) {
|
||||
if !all.collections.is_empty() {
|
||||
crate::widgets::sublabels(ui, tr("Variable collections"), None);
|
||||
for c in &all.collections {
|
||||
let name = doc.variables.collection(c).map(|x| x.name.as_str()).unwrap_or_default();
|
||||
let name = doc.variables.collection_by_id(c).map(|x| x.name.as_str()).unwrap_or_default();
|
||||
if check(ui, format!("v{c}"), def.collections.contains(c), name) {
|
||||
include.push(json!(c));
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@ pub fn ops_for(kind: Option<VariableType>) -> &'static [ExprOp] {
|
||||
fn with_op(s: &Simple, op: ExprOp, vars: &Variables) -> Simple {
|
||||
let rhs = match (op, &s.rhs) {
|
||||
(ExprOp::Not, _) => Rhs::Nothing,
|
||||
(_, Rhs::Nothing) => Rhs::Value(vars.get(&s.var).map_or(VariableValue::Boolean(true), |v| start_value(vars, v))),
|
||||
(_, Rhs::Nothing) => Rhs::Value(vars.get_by_id(&s.var).map_or(VariableValue::Boolean(true), |v| start_value(vars, v))),
|
||||
(_, r) => r.clone(),
|
||||
};
|
||||
Simple { var: s.var.clone(), op, rhs }
|
||||
@@ -479,7 +479,7 @@ fn condition_editor(app: &mut FigApp, ui: &mut Ui, cx: &Cx, slot: &Slot, b: usiz
|
||||
|
||||
fn builder_row(app: &mut FigApp, ui: &mut Ui, cx: &Cx, slot: &Slot, b: usize, s: &Simple) {
|
||||
let vars = &cx.doc.variables;
|
||||
let var = vars.get(&s.var);
|
||||
let var = vars.get_by_id(&s.var);
|
||||
let kind = var.map(|v| v.kind);
|
||||
row(ui, 32.0, |ui| {
|
||||
let w = ui.available_width();
|
||||
@@ -507,7 +507,7 @@ fn builder_row(app: &mut FigApp, ui: &mut Ui, cx: &Cx, slot: &Slot, b: usize, s:
|
||||
Rhs::Nothing => {}
|
||||
Rhs::Variable(other) => {
|
||||
let (rect, _) = ui.allocate_exact_size(vec2(side, FIELD_H), Sense::hover());
|
||||
let name = vars.get(other).map_or(tr("Missing variable"), |v| v.name.as_str());
|
||||
let name = vars.get_by_id(other).map_or(tr("Missing variable"), |v| v.name.as_str());
|
||||
match widgets::bound_field(ui, slot.id("proto_cond_rhs_var").with(b), Lead::None, rect, name) {
|
||||
Some(BindEvent::Open(at)) => crate::variable_ui::open_proto(ui, VarSlot { slot: slot.clone(), part: VarPart::Rhs(b) }, kind, at),
|
||||
Some(BindEvent::Detach) => {
|
||||
@@ -569,7 +569,7 @@ fn literal_field(ui: &mut Ui, id: Id, cur: &VariableValue, w: f32) -> Option<Var
|
||||
/// computed by an expression when the action runs (`count + 1`, `"Hi " + name`).
|
||||
fn set_variable_fields(app: &mut FigApp, ui: &mut Ui, cx: &Cx, slot: &Slot, variable: &str, value: &Value, expr: Option<&Expr>) {
|
||||
let vars = &cx.doc.variables;
|
||||
let var = vars.get(variable);
|
||||
let var = vars.get_by_id(variable);
|
||||
widgets::sublabels(ui, tr("Variable"), None);
|
||||
row(ui, 32.0, |ui| {
|
||||
let name = var.map_or(tr("Choose variable"), |v| v.name.as_str());
|
||||
@@ -694,19 +694,19 @@ where
|
||||
pub fn pick_variable(app: &mut FigApp, vs: &VarSlot, id: &str) {
|
||||
let Ok(doc) = app.session.ds().map(|d| d.doc.clone()) else { return };
|
||||
let vars = &doc.variables;
|
||||
let Some(picked) = vars.get(id) else { return };
|
||||
let Some(picked) = vars.get_by_id(id) else { return };
|
||||
let current = doc.node(vs.slot.node).and_then(|n| n.interactions.get(vs.slot.k)).and_then(|it| action_at(&it.actions, &vs.slot.path));
|
||||
match (vs.part, current) {
|
||||
(VarPart::SetVariable, Some(Action::SetVariable { variable, value, expr })) => {
|
||||
// Another type starts from the new variable's value.
|
||||
let same = vars.get(variable).is_some_and(|v| v.kind == picked.kind);
|
||||
let same = vars.get_by_id(variable).is_some_and(|v| v.kind == picked.kind);
|
||||
let (value, expr) = if same { (value.clone(), expr.clone()) } else { (value_json(&start_value(vars, picked)), None) };
|
||||
set_action(app, &vs.slot, Action::SetVariable { variable: picked.id.clone(), value, expr });
|
||||
}
|
||||
(VarPart::Lhs(b), Some(Action::Conditional { blocks })) => {
|
||||
let cur = blocks.get(b).and_then(|x| x.condition.as_ref()).and_then(simple);
|
||||
let next = match cur {
|
||||
Some(s) if vars.get(&s.var).is_some_and(|v| v.kind == picked.kind) => Simple { var: picked.id.clone(), ..s },
|
||||
Some(s) if vars.get_by_id(&s.var).is_some_and(|v| v.kind == picked.kind) => Simple { var: picked.id.clone(), ..s },
|
||||
_ => Simple { var: picked.id.clone(), op: ExprOp::Equals, rhs: Rhs::Value(start_value(vars, picked)) },
|
||||
};
|
||||
set_condition(app, &vs.slot, b, &next.expr());
|
||||
|
||||
@@ -198,14 +198,14 @@ pub(crate) fn action_summary(doc: &Document, a: &Action) -> String {
|
||||
match a {
|
||||
Action::OpenUrl { url } if !url.is_empty() => trf("Open link {url}", &[("url", url)]),
|
||||
Action::SetVariable { variable, expr, .. } => {
|
||||
let name = vars.get(variable).map_or(variable.as_str(), |v| v.name.as_str());
|
||||
let name = vars.get_by_id(variable).map_or(variable.as_str(), |v| v.name.as_str());
|
||||
match expr {
|
||||
Some(e) => trf("Set {name} to {value}", &[("name", &name), ("value", &e.display(vars))]),
|
||||
None => trf("Set variable {name}", &[("name", &name)]),
|
||||
}
|
||||
}
|
||||
Action::SetVariableMode { collection, mode } => {
|
||||
let c = vars.collection(collection);
|
||||
let c = vars.collection_by_id(collection);
|
||||
let mode = c.and_then(|c| c.modes.iter().find(|m| &m.id == mode)).map_or(mode.as_str(), |m| m.name.as_str());
|
||||
trf("Set {name} to {value}", &[("name", &c.map_or(collection.as_str(), |c| c.name.as_str())), ("value", &mode)])
|
||||
}
|
||||
@@ -1060,7 +1060,7 @@ pub(crate) fn action_fields(app: &mut FigApp, ui: &mut Ui, doc: &Document, page:
|
||||
}
|
||||
Action::SetVariableMode { collection, mode } => {
|
||||
let colls = &doc.variables.collections;
|
||||
let current = doc.variables.collection(collection);
|
||||
let current = doc.variables.collection_by_id(collection);
|
||||
widgets::sublabels(ui, tr("Collection"), None);
|
||||
row(ui, 32.0, |ui| {
|
||||
let resp = widgets::dropdown(ui, current.map_or(tr("Choose collection"), |c| c.name.as_str()), ui.available_width(), None);
|
||||
|
||||
@@ -82,7 +82,7 @@ pub fn section(app: &mut FigApp, ui: &mut Ui, doc: &Arc<Document>, ids: &[NodeId
|
||||
.style
|
||||
.as_ref()
|
||||
.and_then(|id| doc.style(id).map(|s| s.name.as_str()))
|
||||
.or_else(|| group.variable.as_ref().and_then(|id| doc.variables.get(id).map(|v| v.name.as_str())));
|
||||
.or_else(|| group.variable.as_ref().and_then(|id| doc.variables.get_by_id(id).map(|v| v.name.as_str())));
|
||||
if let Some(name) = linked_name {
|
||||
let response = widgets::dropdown(ui, name, width, None);
|
||||
toggle(app, group.targets.clone(), Some(&response));
|
||||
|
||||
@@ -288,7 +288,7 @@ mod variable_tests {
|
||||
/// The name of the variable `field` of the text layer is bound to.
|
||||
fn bound_to(&self, field: &str) -> Option<String> {
|
||||
let doc = self.app.session.doc().unwrap();
|
||||
doc.node(self.text).unwrap().bound.get(field).and_then(|v| doc.variables.get(v)).map(|v| v.name.clone())
|
||||
doc.node(self.text).unwrap().bound.get(field).and_then(|v| doc.variables.get_by_id(v)).map(|v| v.name.clone())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ pub fn bound_name(doc: &Document, ids: &[NodeId], field: &str) -> Option<String>
|
||||
if !it.all(|v| v.as_ref() == Some(&first)) {
|
||||
return None;
|
||||
}
|
||||
doc.variables.get(&first).map(|v| v.name.clone())
|
||||
doc.variables.get_by_id(&first).map(|v| v.name.clone())
|
||||
}
|
||||
|
||||
/// A variable a picker offers: one of this file's, or a published one of an enabled library.
|
||||
@@ -397,7 +397,7 @@ pub fn picker(app: &mut FigApp, ctx: &egui::Context) {
|
||||
// variables never lead back to this file's).
|
||||
let (scope, own) = match &p.target {
|
||||
Target::Bind { ids, field } => (ids.first().and_then(|id| figcraft_engine::cmd::variables::field_scope(&doc, *id, field)), None),
|
||||
Target::Alias { variable, .. } => (None, doc.variables.get(variable)),
|
||||
Target::Alias { variable, .. } => (None, doc.variables.get_by_id(variable)),
|
||||
Target::Proto(_) | Target::Style { .. } => (None, None),
|
||||
};
|
||||
// A style's fields offer variables scoped to one of the properties the field sets.
|
||||
|
||||
@@ -77,7 +77,9 @@ fn counter_then_conditional_navigation() {
|
||||
fn set_variable_mode_recolours_bound_layers() {
|
||||
let (mut doc, a, _, button) = setup();
|
||||
let theme = doc.variables.collection("Theme").unwrap().id.clone();
|
||||
on_click(&mut doc, button, vec![Action::SetVariableMode { collection: theme.clone(), mode: "Dark".into() }]);
|
||||
// Actions store mode ids (commands and imports turn names into them).
|
||||
let dark = doc.variables.collection("Theme").unwrap().find_mode("Dark").unwrap().id.clone();
|
||||
on_click(&mut doc, button, vec![Action::SetVariableMode { collection: theme.clone(), mode: dark }]);
|
||||
let hex = |p: &Presenter| p.doc.as_ref().and_then(|d| d.node(a)?.fills.first()?.solid_color()).map(|c| c.to_hex());
|
||||
let mut p = Presenter::new(a);
|
||||
p.sync(&Arc::new(doc), 0.0);
|
||||
@@ -118,7 +120,8 @@ fn stored_variable_ids_keep_player_collection_identity() {
|
||||
if missing {
|
||||
doc.variables.collections.retain(|c| c.id != theme.id);
|
||||
}
|
||||
on_click(&mut doc, button, vec![Action::SetVariableMode { collection: theme.id.clone(), mode: "Dark".into() }]);
|
||||
let dark = theme.find_mode("Dark").unwrap().id.clone();
|
||||
on_click(&mut doc, button, vec![Action::SetVariableMode { collection: theme.id.clone(), mode: dark }]);
|
||||
let mut p = Presenter::new(a);
|
||||
p.sync(&Arc::new(doc), 0.0);
|
||||
assert_eq!(p.fire(button, 0, None, 1.0), !missing);
|
||||
|
||||
@@ -97,7 +97,7 @@ fn current_paint(app: &FigApp, target: &PickerTarget) -> Option<Paint> {
|
||||
}
|
||||
PickerTarget::Effect { ids, index, secondary } => doc.node(*ids.first()?)?.effects.get(*index)?.color(*secondary).map(Paint::solid),
|
||||
PickerTarget::TextRange { id, start, .. } => range_fills(doc, *id, *start)?.into_iter().next(),
|
||||
PickerTarget::Variable { id, mode } => match doc.variables.get(id)?.values.get(mode)? {
|
||||
PickerTarget::Variable { id, mode } => match doc.variables.get_by_id(id)?.values.get(mode)? {
|
||||
figcraft_doc::VariableValue::Color(c) => {
|
||||
let mut p = Paint::solid(c.with_alpha(1.0));
|
||||
p.opacity = c.a;
|
||||
|
||||
@@ -667,7 +667,7 @@ fn binding_cell(ui: &mut Ui, doc: &Document, style: &Style, field: &str, kind: f
|
||||
let t = Tokens::get(ui.ctx());
|
||||
let row = ui.min_rect();
|
||||
let row = Rect::from_min_max(pos2(row.min.x, row.max.y - ROW_H), row.max);
|
||||
let Some(name) = style.bound.get(field).map(|v| doc.variables.get(v).map_or(v.as_str(), |x| x.name.as_str())) else {
|
||||
let Some(name) = style.bound.get(field).map(|v| doc.variables.get_by_id(v).map_or(v.as_str(), |x| x.name.as_str())) else {
|
||||
let b = Rect::from_center_size(pos2(row.max.x - 13.0, row.center().y), vec2(20.0, 20.0));
|
||||
if ui.rect_contains_pointer(row) && menu_icon(ui, b, Icon::Variable, tr("Apply variable"), false).clicked() {
|
||||
crate::variable_ui::open_style(ui, &style.id, field, kind, row.left_bottom());
|
||||
@@ -732,7 +732,7 @@ fn text_binding(ui: &mut Ui, binding: TextBinding<'_>, out: &mut Frame) {
|
||||
|
||||
/// The text style's variable name for `field`, or None when the field is not bound.
|
||||
fn bound_name(doc: &Document, style: &Style, field: &str) -> Option<String> {
|
||||
style.bound.get(field).map(|v| doc.variables.get(v).map_or_else(|| v.clone(), |x| x.name.clone()))
|
||||
style.bound.get(field).map(|v| doc.variables.get_by_id(v).map_or_else(|| v.clone(), |x| x.name.clone()))
|
||||
}
|
||||
|
||||
/// Redefines the text style `def` through `f`; the edit is queued only when it changes the style.
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ layers}]` with `--json`); their text renders in a fallback font.
|
||||
Every subcommand that reads a file also takes the public REST API file JSON (the response of
|
||||
`GET /v1/files/:key` or of its nodes endpoint, written to a `.json` file): it is imported on the fly.
|
||||
Image fills come from `images/<imageRef>.png` (or `.jpg`, …) next to the JSON when present, else a
|
||||
grey placeholder. `.fig` files are read the same way (best effort, images from the file itself), and
|
||||
missing-image placeholder (light grey with darker diagonal stripes). `.fig` files are read the same way (best effort, images from the file itself), and
|
||||
so are `.sketch` files saved by Sketch 48 or newer;
|
||||
`info` lists what wasn't imported as `note:` lines.
|
||||
|
||||
|
||||
@@ -12,11 +12,8 @@ cursors, selections, text carets, cursor chat and spotlights shown live ([`colla
|
||||
|
||||
| Feature | Figma | FigCraft | Hours |
|
||||
|---|---|---|---|
|
||||
| Real-time co-editing | yes | **core built, no networking** (#103): client-scoped ids, per-property change sets with fractional positions, server ordering and validation, optimistic clients, binary messages; randomized multi-client convergence tests over real commands. Live sessions over the network landed (`crates/collab-net`): the WebSocket transport (keep-alive, size and rate limits, reconnect with backoff), hosting from the app (this machine or the local network) with invite links, live cursors with name tags, selections, avatars and follow, `collab.*` commands. Document sync between apps works over them (the host's server orders every batch; guests open the host's file as a new tab). Sessions are per document: each open file has its own or none, several run at once (host one, join another, publish a third) and keep syncing behind the tab in front, and closing a file ends its session only. Revert to saved is refused until the document leaves its live session; its access checks and sync association stay intact. Undo is per person (only your own steps, others' later writes left alone), refused edits roll back with a toast, and a reconnect resumes as the same client with what it missed (or a snapshot) and sends what was made offline. The browser build joins (same messages through the browser's WebSocket API); `figcraft://` invite links open the desktop app and join. Styles, variables, collections, modes and comments made in a session take ids from their creator's space (the server checks it), so concurrent creations all survive; modes, per-mode values and replies inside one entry still resolve last-writer-wins. A standalone `figcraft-server` keeps many files, persists them (a snapshot plus a log, compacted), loses nothing confirmed across a restart (apps resume as the same participants) and takes files published from the app (File ▸ Publish to server…). The desktop app and the CLI open `wss://` links too (TLS through a reverse proxy), and releases ship the server for Linux with a deployment guide (systemd, Caddy, nginx, Docker) and `install.sh`. A server can be open to the public: anyone publishes without the key, within limits per address, and files nobody opens expire. Message limits follow the server's `max_file_mb`, so files above 64 MiB publish and open (the client takes at most 1 GiB from a server, and the server warns when large limits meet open publishing, #705); a damaged generation field in a file's log no longer drops the edits flushed to it (#687). Image entries are checked as they apply: a key must be a plain name (letters, digits, `-`, `_`; it becomes `images/<key>` in a saved file), bytes under a content-hash key must hash to it (lowercase sha256), a side is at most 65 535 px and the decoded bytes at most 256 MiB (what the importers read), a key's bytes can't be replaced and an image a layer shows can't be removed, so no collaborator can poison the shared image store or balloon memory; snapshots and server logs from before these checks open without the images they refuse (#1086). The batches kept for apps that reconnect are bounded in bytes by default (64 MiB; `max_log_mb` on `figcraft-server`), and an app further behind catches up with a snapshot (#1069). Left: server archives beyond Linux | 25–55 |
|
||||
| Real-time co-editing | yes | **core built, no networking** (#103): client-scoped ids, per-property change sets with fractional positions, server ordering and validation, optimistic clients, binary messages; randomized multi-client convergence tests over real commands. Live sessions over the network landed (`crates/collab-net`): the WebSocket transport (keep-alive, size and rate limits, reconnect with backoff), hosting from the app (this machine or the local network) with invite links, live cursors with name tags, selections, avatars and follow, `collab.*` commands. Document sync between apps works over them (the host's server orders every batch; guests open the host's file as a new tab). Sessions are per document: each open file has its own or none, several run at once (host one, join another, publish a third) and keep syncing behind the tab in front, and closing a file ends its session only. Revert to saved is refused until the document leaves its live session; its access checks and sync association stay intact. Undo is per person (only your own steps, others' later writes left alone), refused edits roll back with a toast, and a reconnect resumes as the same client with what it missed (or a snapshot) and sends what was made offline. The browser build joins (same messages through the browser's WebSocket API); `figcraft://` invite links open the desktop app and join. Styles, variables, collections, modes and comments made in a session take ids from their creator's space (the server checks it), so concurrent creations all survive; modes, per-mode values and replies inside one entry still resolve last-writer-wins. A standalone `figcraft-server` keeps many files, persists them (a snapshot plus a log, compacted), loses nothing confirmed across a restart (apps resume as the same participants) and takes files published from the app (File ▸ Publish to server…). The desktop app and the CLI open `wss://` links too (TLS through a reverse proxy), and releases ship the server for Linux with a deployment guide (systemd, Caddy, nginx, Docker) and `install.sh`. A server can be open to the public: anyone publishes without the key, within limits per address, and files nobody opens expire. Message limits follow the server's `max_file_mb`, so files above 64 MiB publish and open (the client takes at most 1 GiB from a server, and the server warns when large limits meet open publishing, #705); a damaged generation field in a file's log no longer drops the edits flushed to it (#687). Image entries are checked as they apply: a key must be a plain name (letters, digits, `-`, `_`; it becomes `images/<key>` in a saved file), bytes under a content-hash key must hash to it (lowercase sha256), a side is at most 65 535 px and the decoded bytes at most 256 MiB (what the importers read), a key's bytes can't be replaced and an image a layer shows can't be removed, so no collaborator can poison the shared image store or balloon memory; snapshots and server logs from before these checks open without the images they refuse (#1086). Placing a layer among its siblings is a binary search, so large pastes and reorders in one batch no longer take quadratic time (#1065). Left: server archives beyond Linux | 25–55 |
|
||||
| Real-time co-editing | yes | **core built, no networking** (#103): client-scoped ids, per-property change sets with fractional positions, server ordering and validation, optimistic clients, binary messages; randomized multi-client convergence tests over real commands. Live sessions over the network landed (`crates/collab-net`): the WebSocket transport (keep-alive, size and rate limits, reconnect with backoff), hosting from the app (this machine or the local network) with invite links, live cursors with name tags, selections, avatars and follow, `collab.*` commands. Document sync between apps works over them (the host's server orders every batch; guests open the host's file as a new tab). Sessions are per document: each open file has its own or none, several run at once (host one, join another, publish a third) and keep syncing behind the tab in front, and closing a file ends its session only. Revert to saved is refused until the document leaves its live session; its access checks and sync association stay intact. Undo is per person (only your own steps, others' later writes left alone), refused edits roll back with a toast, and a reconnect resumes as the same client with what it missed (or a snapshot) and sends what was made offline. The browser build joins (same messages through the browser's WebSocket API); `figcraft://` invite links open the desktop app and join. Styles, variables, collections, modes and comments made in a session take ids from their creator's space (the server checks it), so concurrent creations all survive; modes, per-mode values and replies inside one entry still resolve last-writer-wins. A standalone `figcraft-server` keeps many files, persists them (a snapshot plus a log, compacted), loses nothing confirmed across a restart (apps resume as the same participants) and takes files published from the app (File ▸ Publish to server…). The desktop app and the CLI open `wss://` links too (TLS through a reverse proxy), and releases ship the server for Linux with a deployment guide (systemd, Caddy, nginx, Docker) and `install.sh`. A server can be open to the public: anyone publishes without the key, within limits per address, and files nobody opens expire. Message limits follow the server's `max_file_mb`, so files above 64 MiB publish and open (the client takes at most 1 GiB from a server, and the server warns when large limits meet open publishing, #705); a damaged generation field in a file's log no longer drops the edits flushed to it (#687). Image entries are checked as they apply: a key must be a plain name (letters, digits, `-`, `_`; it becomes `images/<key>` in a saved file), bytes under a content-hash key must hash to it (lowercase sha256), a side is at most 65 535 px and the decoded bytes at most 256 MiB (what the importers read), a key's bytes can't be replaced and an image a layer shows can't be removed, so no collaborator can poison the shared image store or balloon memory; snapshots and server logs from before these checks open without the images they refuse (#1086). A refused batch's fixes take time linear in the batch: each deleted layer is restored once and each entry fix looked up once (#1063). Left: server archives beyond Linux | 25–55 |
|
||||
| Live cursors, selections, viewports; follow / observation mode; spotlight | yes | **done, in live sessions**: named cursors, selection outlines, avatars (an AI agent attached over MCP also shows its avatar and an outline around the layers it last edited or selected while it works, in or out of a session, #1416), follow (click an avatar), others' text carets and selected characters with their names, a note when two people type in one layer; spotlight (your avatar's menu, `collab.spotlight`): everyone follows your view and page, people who join later too, anyone who moves their view stops following and a banner offers to follow again, a newer spotlight takes over. Left: polish (no accounts, so anyone in the session can spotlight) | 2–4 |
|
||||
| Live cursors, selections, viewports; follow / observation mode; spotlight | yes | **done, in live sessions**: named cursors (one name for live sessions and comments: Preferences ▸ Your name, also in the Share popover and the Join dialog, kept in the browser too; a rename shows at once in the sessions you're in, #1380), selection outlines, avatars, follow (click an avatar), others' text carets and selected characters with their names, a note when two people type in one layer; spotlight (your avatar's menu, `collab.spotlight`): everyone follows your view and page, people who join later too, anyone who moves their view stops following and a banner offers to follow again, a newer spotlight takes over. Left: polish (no accounts, so anyone in the session can spotlight) | 2–4 |
|
||||
| Real-time co-editing | yes | **core built, no networking** (#103): client-scoped ids, per-property change sets with fractional positions, server ordering and validation, optimistic clients, binary messages; randomized multi-client convergence tests over real commands. Live sessions over the network landed (`crates/collab-net`): the WebSocket transport (keep-alive, size and rate limits, reconnect with backoff), hosting from the app (this machine or the local network) with invite links, live cursors with name tags, selections, avatars and follow, `collab.*` commands. Document sync between apps works over them (the host's server orders every batch; guests open the host's file as a new tab). Sessions are per document: each open file has its own or none, several run at once (host one, join another, publish a third) and keep syncing behind the tab in front, and closing a file ends its session only. Revert to saved is refused until the document leaves its live session; its access checks and sync association stay intact. Undo is per person (only your own steps, others' later writes left alone), refused edits roll back with a toast, and a reconnect resumes as the same client with what it missed (or a snapshot) and sends what was made offline. The browser build joins (same messages through the browser's WebSocket API); `figcraft://` invite links open the desktop app and join. Styles, variables, collections, modes and comments made in a session take ids from their creator's space (the server checks it), so concurrent creations all survive; modes, per-mode values and replies inside one entry still resolve last-writer-wins. A standalone `figcraft-server` keeps many files, persists them (a snapshot plus a log, compacted), loses nothing confirmed across a restart (apps resume as the same participants) and takes files published from the app (File ▸ Publish to server…). The desktop app and the CLI open `wss://` links too (TLS through a reverse proxy), and releases ship the server for Linux with a deployment guide (systemd, Caddy, nginx, Docker) and `install.sh`. A server can be open to the public: anyone publishes without the key, within limits per address, and files nobody opens expire. Message limits follow the server's `max_file_mb`, so files above 64 MiB publish and open (the client takes at most 1 GiB from a server, and the server warns when large limits meet open publishing, #705); a damaged generation field in a file's log no longer drops the edits flushed to it (#687). Image entries are checked as they apply: a key must be a plain name (letters, digits, `-`, `_`; it becomes `images/<key>` in a saved file), bytes under a content-hash key must hash to it (lowercase sha256), a side is at most 65 535 px and the decoded bytes at most 256 MiB (what the importers read), a key's bytes can't be replaced and an image a layer shows can't be removed, so no collaborator can poison the shared image store or balloon memory; snapshots and server logs from before these checks open without the images they refuse (#1086). The batches kept for apps that reconnect are bounded in bytes by default (64 MiB; `max_log_mb` on `figcraft-server`), and an app further behind catches up with a snapshot (#1069). Placing a layer among its siblings is a binary search, so large pastes and reorders in one batch no longer take quadratic time (#1065). A refused batch's fixes take time linear in the batch: each deleted layer is restored once and each entry fix looked up once (#1063). Left: server archives beyond Linux | 25–55 |
|
||||
| Live cursors, selections, viewports; follow / observation mode; spotlight | yes | **done, in live sessions**: named cursors (one name for live sessions and comments: Preferences ▸ Your name, also in the Share popover and the Join dialog, kept in the browser too; a rename shows at once in the sessions you're in, #1380), selection outlines, avatars (an AI agent attached over MCP also shows its avatar and an outline around the layers it last edited or selected while it works, in or out of a session, #1416), follow (click an avatar), others' text carets and selected characters with their names, a note when two people type in one layer; spotlight (your avatar's menu, `collab.spotlight`): everyone follows your view and page, people who join later too, anyone who moves their view stops following and a banner offers to follow again, a newer spotlight takes over. Left: polish (no accounts, so anyone in the session can spotlight) | 2–4 |
|
||||
| Cursor chat, audio, high-fives | yes | **partial, in live sessions**: cursor chat (`/` opens a bubble at your pointer; everyone sees it as you type, it fades a few seconds after the last change, Enter sends and Escape takes it back, 100 characters; `collab.cursorChat` for agents); sent as ephemeral presence the host checks and rate-limits, never stored. No audio, high-fives or emote reactions | 2–5 |
|
||||
| Share links, permissions (view / edit), teams and projects | yes | **partial**: sharing with a join code from the Share popover (online: the file goes to the server in Preferences and the server names its edit, comment and view links with short codes; local network: the app hosts and the code carries its address; one field joins with a code or a link, in the popover and on the home screen, and the Join dialog then shows the join until its file is ready (Cancel), or why it failed (Try again, #1381); the browser build also joins from a link in its URL's fragment, `#join=…`, which never reaches the web host's logs, capped at 6 KiB and checked like a `figcraft://` link (#712; unit-tested, not run in a browser), and shares online and publishes to a server as the desktop app does, though not on the local network (#917; the owner token of a file it puts on an open server lasts as long as the page)); `figcraft-server` share links per file with edit, comment or view access (a viewer sees changes and presence, a "View only" badge and only the moving tools; a commenter also adds, replies to, reacts to and resolves comment threads, with a "Can comment" badge and the comment tool, #1525; the server refuses their other edits), revocable at once, tokens stored as hashes; managed from the app's Share popover (first links), the server's command line or a managing connection. On a server open to the public, whoever published a file manages it with its owner token (links, name, removal: `collab.manageFile`), which the app remembers: Home ▸ Online lists your online files (open again as owner, start and stop sharing, copy the code, rename, remove, forget), with one request per server for what became of them; anyone in a file can report it, and the operator blocks addresses. The person hosting a session, or a file's owner, removes someone from it (right-click their avatar, `collab.removePerson`): they are disconnected and their address can't join that file again while it runs. The list is per computer: no accounts, teams or projects | 8–17 |
|
||||
| Comments: pins on frames and layers, threads, reactions, @mentions, resolve, unread, search and filters, links, in the presenter | yes (shared) | **done, local**: stored in the file, your name from Preferences (an AI agent attached over MCP comments as its own name, marked Agent); a behaviour suite from the documentation (pinning and following layers, threads, own edits and deletes, mentions, reactions, C and Shift+C, stepping, filters, saving, copy and paste); restoring a version keeps them. `comment.list` (CLI, MCP) gives each message its `mentions` (`{name, known, you}`, by the highlighting rule). In a live session threads sync and anyone in it can reply, react and resolve (no accounts: a name is who you are) | (shared once multiplayer lands) |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Components, variants, styles and variables parity
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-30 · **Change:** minor (colour variables can be calculated from other colours per mode — `{alpha}` replaces a colour's alpha, `{mix}` blends two — and follow them (#1280); stored variable and collection references keep their identity when another object is named like their id (follow-up to #1542); a component set's property rows fit the 240 px right panel: variant values wrap two to a line there and every + and − stays in view; opening a file contacts no team library server it names until you check it (#1097); an explicit variables file path (`variable.import`, the `variables` of `file.open` and `file.import`) is refused past 256 MiB or when it isn't a regular file, as the sibling `variables.json` already was (part of #1114); component properties keep the order they were made in when one is renamed, and Make slot asks for the slot's name first (#1536, #1537); components can't contain their own instances, directly or through others (#1084); the instance-swap menus have a search field (#1338); an instance-swap property's default menu scrolls (#1338); variables on a text style's fields from the style editor; instance-swap properties in the component playground; duplicating or Alt-dragging a main component makes an instance of it (#892); a bound colour variable's alpha applies once (#802); variables import reads `variables` outside `meta` and warns when it imports none (#790); variant properties reorder by drag; library files saved right after a read are read again; Hide when publishing note corrected; size and resizing overrides of layers inside instances (#731); variables export in the browser as a download; core editor leftovers: component playground, variables inside styles; layers and assets panels behaviour suite and fixes; extended collections tail; styles and variables behaviour suite and fixes; components behaviour suite and fixes; team libraries on the server, library usage and swapping a library; extended collections, variables import/export, gradient stops and variant properties bound to variables) · **Target:** Figma Design (desktop app 126.10.7)
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-30 · **Change:** minor (a typed or stored variable, collection or mode id names only the object with that id (#1613); colour variables can be calculated from other colours per mode — `{alpha}` replaces a colour's alpha, `{mix}` blends two — and follow them (#1280); stored variable and collection references keep their identity when another object is named like their id (follow-up to #1542); a component set's property rows fit the 240 px right panel: variant values wrap two to a line there and every + and − stays in view; opening a file contacts no team library server it names until you check it (#1097); an explicit variables file path (`variable.import`, the `variables` of `file.open` and `file.import`) is refused past 256 MiB or when it isn't a regular file, as the sibling `variables.json` already was (part of #1114); component properties keep the order they were made in when one is renamed, and Make slot asks for the slot's name first (#1536, #1537); components can't contain their own instances, directly or through others (#1084); the instance-swap menus have a search field (#1338); an instance-swap property's default menu scrolls (#1338); variables on a text style's fields from the style editor; instance-swap properties in the component playground; duplicating or Alt-dragging a main component makes an instance of it (#892); a bound colour variable's alpha applies once (#802); variables import reads `variables` outside `meta` and warns when it imports none (#790); variant properties reorder by drag; library files saved right after a read are read again; Hide when publishing note corrected; size and resizing overrides of layers inside instances (#731); variables export in the browser as a download; core editor leftovers: component playground, variables inside styles; layers and assets panels behaviour suite and fixes; extended collections tail; styles and variables behaviour suite and fixes; components behaviour suite and fixes; team libraries on the server, library usage and swapping a library; extended collections, variables import/export, gradient stops and variant properties bound to variables) · **Target:** Figma Design (desktop app 126.10.7)
|
||||
|
||||
Design systems are why teams adopt Figma. **Components: breadth ~96%, ready ~72%. Styles and
|
||||
variables: breadth ~95%, ready ~76% (estimated).** QA'd with a synthetic design system of ~300
|
||||
@@ -78,6 +78,7 @@ updates with overrides kept: `library_tests.rs`, `components_scale_tests.rs`.
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-10-30 | minor | M3, #1613: a variable, collection or mode named like another one's id no longer takes its place where an id is stored or typed (expressions, prototype mode switches, font family variables, the panels' labels); names still work where a person types them. Grade unchanged. |
|
||||
| 2026-10-30 | minor | M3, #1280: a colour variable can be calculated from others, per mode: `{"alpha": {"variable", "opacity"}}` is that variable's colour with its alpha replaced (replace, not multiply, so re-editing the source's alpha never compounds), `{"mix": {"from", "to", "t"}}` blends two operands (`{"variable"}` or `{"literal"}`) per channel over the stored values in the document's colour profile, alpha included (converting the profile keeps a mix's ends exact and moves its colours in between slightly). Calculations resolve lazily like aliases, so bound layers, mode switches, instances and undo follow their sources; they compose (a calculation of a calculation), a loop is refused when it is set, and one resolve consults at most 32 variables. Files keep them; REST, CSS, Penpot and `.fig` exports write the colour they show in each of their collection's modes (other collections in their default modes, so a CSS calculation doesn't follow another collection's `data-` mode); deleting a source leaves its readers on the colour they showed; library import and swap re-point their operands. The panel shows them read-only (swatch and formula) and can swap one for an alias or detach it to its colour. Tests: `engine/src/variables_colour_tests.rs`, `doc/src/tests.rs`. Left: editing calculations in the panel; files using them need this build to open. Numbers unchanged |
|
||||
| 2026-10-30 | minor | M3, follow-up to #1542: stored variable and collection references use exact ids in export, library copies and swaps, imported aliases, alias deletion and cycle checks, Dev Inspect, the library mode picker, and prototype actions and expressions. Interaction edits resolve only incoming names and leave stored references alone. Command arguments still accept names as before. Tests: the `stored_variable_ids_*` tests in the doc, engine, format and ui-egui present and responsive suites. Numbers unchanged |
|
||||
| 2026-10-30 | minor | M8: the component set's Properties section fits the narrowest right panel: variant values wrap onto more lines and every + and − button stays visible. Grade unchanged. |
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
# Hardware and platform parity
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-30 · **Change:** minor (`doc.list` gives AI agents and plugins the open files' names, not their paths (#1117); a batch keeps one undo snapshot, not one per step (#1099); one depth cap bounds a whole render, pattern sources included, and render threads get 8 MiB stacks (#1082); in the browser an internal error that stops the page keeps its unsaved files, which open again on reload (#1123); the portable Windows zip keeps its settings, recovery copies and plugins in `config\` beside the executable, starting with an installed copy's preferences; the window starts on other graphics when its first ones fail before the first frame: Direct3D 12 compiles with FXC and no device compiles wgpu's indirect-validation shaders, then Vulkan, OpenGL and lower requirements on the power-saving GPU (#965, #1438); large images on the canvas draw from a smaller copy, so two 16k images no longer lag (#1483); macOS: the Quit menu and ⌘Q ask about unsaved changes (#857); egui/eframe 0.37 dependency migration; hidden-window screenshot deadlines; zoom previews; hidden windows answer control requests; macOS file opening, the Windows start-up message, Linux packaging; copy and paste in the browser; Windows QA pass; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; pen pressure for the Pencil and brushes on Windows and from browser styluses; macOS: quitting ends the process once everything is kept, avoiding the Touch Bar teardown crash (#781); Linux and BSD clipboard: images under Wayland, reads time out; minimised windows under Wayland; window controls on Wayland without server decorations; canvas textures on device pixels; copy and paste in the browser; Windows QA pass; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; pen pressure for the Pencil and brushes on Windows and from browser styluses) · **Target:** Figma Design (desktop app 126.10.7)
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-30 · **Change:** minor (`doc.list` gives AI agents and plugins the open files' names, not their paths (#1117); a batch keeps one undo snapshot, not one per step (#1099); one depth cap bounds a whole render, pattern sources included, and render threads get 8 MiB stacks (#1082); in the browser an internal error that stops the page keeps its unsaved files, which open again on reload (#1123); the portable Windows zip keeps its settings, recovery copies and plugins in `config\` beside the executable, starting with an installed copy's preferences; the window starts on other graphics when its first ones fail before the first frame: Direct3D 12 compiles with FXC and no device compiles wgpu's indirect-validation shaders, then Vulkan, OpenGL and lower requirements on the power-saving GPU (#965, #1438); large images on the canvas draw from a smaller copy, so two 16k images no longer lag (#1483); macOS: the Quit menu and ⌘Q ask about unsaved changes (#857); egui/eframe 0.37 dependency migration; hidden-window screenshot deadlines; zoom previews; hidden windows answer control requests; macOS file opening, the Windows start-up message, Linux packaging; copy and paste in the browser; Windows QA pass; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; pen pressure for the Pencil and brushes on Windows and from browser styluses; macOS: quitting ends the process once everything is kept, avoiding the Touch Bar teardown crash (#781); Linux and BSD clipboard: images under Wayland, reads time out; minimised windows under Wayland; window controls on Wayland without server decorations; canvas textures on device pixels) · **Target:** Figma Design (desktop app 126.10.7)
|
||||
|
||||
How FigCraft uses hardware and which platforms it runs on, against Figma. Figma's desktop app is
|
||||
Electron with a GPU helper process; its canvas renders on the GPU (WebGL, with WebGPU rolling out
|
||||
@@ -40,8 +40,7 @@ Nothing has been timed against Figma on the same document (needs `.fig` import).
|
||||
| Platform | Figma | FigCraft | Notes |
|
||||
|---|---|---|---|
|
||||
| macOS | desktop app (Intel and Apple silicon) | universal `.dmg`, signed and notarized (v0.2.0) | where nearly all QA happens. Quitting ends the process once the preferences, recovery copies and live sessions are taken care of: the window's teardown crashed on Macs with a Touch Bar (#781); the Quit menu and ⌘Q ask about unsaved changes like the main window's close button (#857), and like it close the main window only: with several windows open, each quit closes one; a quit that never asked — killed or crashed — still leaves recovery copies for the next start |
|
||||
| Windows x64 / arm64 | desktop app | `.msi` and portable zip for x64, x86 and arm64 | built in CI; Windows: QA pass done 2026-10-11, findings in PR. The portable zip keeps its settings in `config\` beside `figcraft.exe` (a `portable` file there), taking an installed copy's preferences on its first start (#1320) |
|
||||
| Windows x64 / arm64 | desktop app | `.msi` and portable zip for x64, x86 and arm64 | built in CI; Windows: QA pass done 2026-10-11, findings in PR. Draws with Direct3D 12 (FXC shaders) or OpenGL; when the graphics fail before the first frame it starts again on Vulkan, then OpenGL, then the power-saving GPU with lower limits (#965) |
|
||||
| Windows x64 / arm64 | desktop app | `.msi` and portable zip for x64, x86 and arm64 | built in CI; Windows: QA pass done 2026-10-11, findings in PR. The portable zip keeps its settings in `config\` beside `figcraft.exe` (a `portable` file there), taking an installed copy's preferences on its first start (#1320). Draws with Direct3D 12 (FXC shaders) or OpenGL; when the graphics fail before the first frame it starts again on Vulkan, then OpenGL, then the power-saving GPU with lower limits (#965) |
|
||||
| Linux | none (browser only) | AppImage, `.deb`, `.rpm`, Flatpak, tarball, x86_64 and aarch64; riscv64 tarball | CI tests run here. Clipboard (also the BSDs): reads run on a helper thread that gives up after 2 s, and images copied in other apps paste under Wayland through the data-control protocol (#693). Under Wayland the app can't tell its window is minimised, so control requests that need a drawn frame may still wait there (#720). None of this run on a Linux desktop here. On a Wayland compositor without server-side decorations (GNOME) the window gets winit's Adwaita controls (#592: checked by its author in a GNOME Wayland session; KDE not run) |
|
||||
| FreeBSD | none | tarball | |
|
||||
| Web | primary (figma.com) | `figcraft-web` (WASM, WebGPU/WebGL2), web zip | no accessibility tree; file access through the browser; copy and paste through the system clipboard (copies written from the copy event, pastes read from the paste event; no pasting images from other apps); an internal error stops the page (a panic can't be caught there), but its unsaved files are kept in the page's local storage (about 5 MB) and open again on reload (#1123) |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Localization parity
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-30 · **Change:** minor (Bosnian draft catalog, one/few/other plurals; German terminology corrections (M10): gradient stops, OpenType stylistic sets and the Home-screen preference; partial review, catalog remains a draft; Arabic draft catalog, count-neutral plurals and web font gate; Thai draft catalog and Thai UI fonts; a missing translation fails no check: `cargo xtask i18n-report` lists them; Vietnamese draft catalog; string counts re-measured: 2,352 entries; Russian and Turkish catalogs reviewed by native speakers, Russian one/few/many plurals; Czech and Indonesian drafts; the Japanese draft completed; counts re-measured; Windows UI language from the first preferred language; draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog; macOS finds its downloadable CJK system fonts (#406); string counts re-measured: 2,272 entries, the drafts at 95–99%; Swedish command labels and menu wordings; Russian, Swedish, Turkish, Czech and Indonesian listed; a duplicated paragraph removed; draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog) · **Target:** Figma Design (desktop app 126.10.7)
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-29 · **Change:** minor (Bosnian draft catalog, one/few/other plurals; German terminology corrections (M10): gradient stops, OpenType stylistic sets and the Home-screen preference; partial review, catalog remains a draft; Arabic draft catalog, count-neutral plurals and web font gate; Thai draft catalog and Thai UI fonts; a missing translation fails no check: `cargo xtask i18n-report` lists them; Vietnamese draft catalog; string counts re-measured: 2,352 entries; Russian and Turkish catalogs reviewed by native speakers, Russian one/few/many plurals; Czech and Indonesian drafts; the Japanese draft completed; counts re-measured; Windows UI language from the first preferred language; draft catalogs catch up: every draft translates every string again; Simplified Chinese draft catalog; macOS finds its downloadable CJK system fonts (#406); string counts re-measured: 2,272 entries, the drafts at 95–99%; Swedish command labels and menu wordings; Russian, Swedish, Turkish, Czech and Indonesian listed; a duplicated paragraph removed) · **Target:** Figma Design (desktop app 126.10.7)
|
||||
|
||||
FigCraft's interface has a localization layer with an English catalog, a Russian catalog reviewed
|
||||
by a native speaker, and Spanish (with a Latin American overlay), French, German, Brazilian
|
||||
|
||||
+5
-3
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,106 @@
|
||||
//! Progress docs damaged by merges: a table row that appears twice, or a status line (`**Change:**
|
||||
//! kind (…; …)`) that lists the same item twice. Both happen when a merge keeps both sides of a
|
||||
//! conflict; they are never wanted.
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::path::Path;
|
||||
|
||||
/// Checks `ROADMAP.md` and `docs/*.md` under `root`; prints each repeat and returns whether there
|
||||
/// were none.
|
||||
pub fn check(root: &Path) -> bool {
|
||||
let mut files = vec![root.join("ROADMAP.md")];
|
||||
if let Ok(rd) = std::fs::read_dir(root.join("docs")) {
|
||||
let mut docs: Vec<_> = rd.flatten().map(|e| e.path()).filter(|p| p.extension().is_some_and(|e| e == "md")).collect();
|
||||
docs.sort();
|
||||
files.extend(docs);
|
||||
}
|
||||
let mut found = Vec::new();
|
||||
for f in &files {
|
||||
let Ok(text) = std::fs::read_to_string(f) else { continue };
|
||||
let name = f.strip_prefix(root).map(|r| r.to_string_lossy().replace('\\', "/")).unwrap_or_default();
|
||||
found.extend(repeats(&text).into_iter().map(|r| format!("{name}:{r}")));
|
||||
}
|
||||
if found.is_empty() {
|
||||
eprintln!("docs: ok");
|
||||
return true;
|
||||
}
|
||||
eprintln!("docs: repeated rows or status items (left by a merge?):\n {}", found.join("\n "));
|
||||
false
|
||||
}
|
||||
|
||||
/// `line: what` for each table row that repeats an earlier one (header rows apart: tables share
|
||||
/// them) and each status-line item listed twice.
|
||||
fn repeats(text: &str) -> Vec<String> {
|
||||
let lines: Vec<&str> = text.lines().collect();
|
||||
let separator = |l: &str| l.starts_with('|') && l.chars().all(|c| matches!(c, '|' | '-' | ':' | ' '));
|
||||
let mut out = Vec::new();
|
||||
let mut rows: HashMap<&str, usize> = HashMap::new();
|
||||
for (i, l) in lines.iter().enumerate() {
|
||||
let header = lines.get(i + 1).is_some_and(|n| separator(n));
|
||||
if l.starts_with('|') && !separator(l) && !header {
|
||||
match rows.get(l) {
|
||||
Some(first) => out.push(format!("{}: the table row of line {first} again", i + 1)),
|
||||
None => {
|
||||
rows.insert(l, i + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if let Some(body) = status_items(l) {
|
||||
let mut seen = Vec::new();
|
||||
for item in body {
|
||||
if seen.contains(&item) {
|
||||
out.push(format!("{}: status item listed twice: {}", i + 1, item.chars().take(100).collect::<String>()));
|
||||
} else {
|
||||
seen.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
/// The items of a status line's `**Change:** kind (…)`, split at `; ` outside brackets. `None`
|
||||
/// for other lines, or when the brackets never close.
|
||||
fn status_items(line: &str) -> Option<Vec<&str>> {
|
||||
let open = line.find("**Change:**").and_then(|i| line[i..].find('(').map(|o| i + o))?;
|
||||
let mut depth = 0usize;
|
||||
let mut items = Vec::new();
|
||||
let mut start = open + 1;
|
||||
for (j, c) in line.char_indices().skip_while(|(j, _)| *j < open) {
|
||||
match c {
|
||||
'(' | '[' => depth += 1,
|
||||
')' | ']' => {
|
||||
depth = depth.saturating_sub(1);
|
||||
if depth == 0 {
|
||||
items.push(&line[start..j]);
|
||||
return Some(items);
|
||||
}
|
||||
}
|
||||
';' if depth == 1 && line[j..].starts_with("; ") => {
|
||||
items.push(&line[start..j]);
|
||||
start = j + 2;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::repeats;
|
||||
|
||||
#[test]
|
||||
fn repeated_rows_and_status_items_are_found_and_headers_are_not() {
|
||||
let doc = "**Change:** minor (a (x; y); b; a (x; y)) · **Target:** t\n\n\
|
||||
| Item | Status |\n|---|---|\n| one | done |\n| two | done |\n\n\
|
||||
| Item | Status |\n|---|---|\n| one | done |\n";
|
||||
let found = repeats(doc);
|
||||
assert_eq!(found.len(), 2, "{found:?}");
|
||||
assert!(found[0].starts_with("1: status item listed twice: a (x; y)"), "{found:?}");
|
||||
assert!(found[1].starts_with("10: the table row of line 5 again"), "{found:?}");
|
||||
// Distinct items, and a parenthesis that never closes, are left alone.
|
||||
assert!(repeats("**Change:** minor (a; b (c; c)) · x\n| a | b |\n| a | c |\n").is_empty());
|
||||
assert!(repeats("**Change:** minor (a; a (never closed\n").is_empty());
|
||||
}
|
||||
}
|
||||
+8
-2
@@ -1,11 +1,14 @@
|
||||
//! Project tasks: `cargo xtask <task>`.
|
||||
//!
|
||||
//! - `ci` fmt check, clippy -D warnings, tests, the translation report, layers, assets, wasm check
|
||||
//! - `ci` fmt check, clippy -D warnings, tests, the translation report, layers, assets, docs, wasm
|
||||
//! check
|
||||
//! - `test` the workspace tests (nextest when installed) and doctests
|
||||
//! - `i18n-report` the UI strings, command labels and menu wordings each language lacks (never fails
|
||||
//! on them: a missing translation reads English)
|
||||
//! - `layers` crate dependency layering check
|
||||
//! - `assets` every file under assets/ and docs/ has a row in ATTRIBUTION.md
|
||||
//! - `docs` no table row twice and no status-line item listed twice in ROADMAP.md and docs/*.md
|
||||
//! (what a merge that keeps both sides leaves)
|
||||
//! - `parity` menu-catalog coverage → docs/parity-checklist.md
|
||||
//! - `version` print the version, or `version set X.Y.Z`
|
||||
//! - `icon` regenerate the app icon PNGs/ICO from assets/app-icon/figcraft.svg (needs resvg)
|
||||
@@ -16,6 +19,7 @@
|
||||
//! - `bench` release-build timings at 1k/10k/50k layers (`bench 1000,10000` for other sizes) and
|
||||
//! with a synthetic design system used by 2,000 instances
|
||||
|
||||
mod docs_check;
|
||||
mod icon;
|
||||
mod layers;
|
||||
|
||||
@@ -43,6 +47,7 @@ fn main() -> ExitCode {
|
||||
"i18n-report" => i18n_report(),
|
||||
"layers" => layers::check(&root()),
|
||||
"assets" => assets(),
|
||||
"docs" => docs_check::check(&root()),
|
||||
"parity" => parity(),
|
||||
"version" => version(args.get(1).map(String::as_str), args.get(2).map(String::as_str)),
|
||||
"icon" => icon::generate(&root()),
|
||||
@@ -50,7 +55,7 @@ fn main() -> ExitCode {
|
||||
"plugins" => plugins(),
|
||||
"bench" => bench(args.get(1).map_or("1000,10000,50000", String::as_str)),
|
||||
_ => {
|
||||
eprintln!("tasks: ci, test, i18n-report, layers, assets, parity, version [set X.Y.Z], icon, wasm, plugins, bench [SIZES]");
|
||||
eprintln!("tasks: ci, test, i18n-report, layers, assets, docs, parity, version [set X.Y.Z], icon, wasm, plugins, bench [SIZES]");
|
||||
task == "help"
|
||||
}
|
||||
};
|
||||
@@ -64,6 +69,7 @@ fn ci() -> bool {
|
||||
&& i18n_report()
|
||||
&& layers::check(&root())
|
||||
&& assets()
|
||||
&& docs_check::check(&root())
|
||||
&& wasm()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user