From 43813db855a6be9ff0bede754595cd181d24c0cd Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 21 Nov 2026 10:46:44 -0800 Subject: [PATCH 01/61] Scripts: paths, path points and colors for scripts Document.pathItems lists a document's paths and makes empty paths, rectangles, rounded rectangles, ellipses, polygons and stars with the parameter order and defaults of the PathItems help page. A PathItem reads and changes its points, closed state, fill rule, area, length, fill and stroke colors, stroke options and overprint, and translates, rotates and resizes. PathPoints and PathPoint read and set each point's anchor, handles and type. RGBColor, CMYKColor, GrayColor, LabColor and NoColor make colors; a gradient, spot or pattern paint reads as GradientColor, SpotColor or PatternColor. Each change runs an existing command (path.create, the shape.* commands, path.setAnchors, path.close, path.setFillRule, paint.setFill, paint.setStroke, stroke.set, object.setOverprint, object.move, object.rotate, object.scale) inside the run's one undo step, and puts back the selection and the paint for new art. A value that changes nothing runs no command; a bad value throws and changes nothing. path.setAnchors now makes an anchor a corner when it is given `smooth: false`; before, the key was ignored and handles in line made it smooth. --- crates/engine/src/cmd/create.rs | 3 +- crates/engine/src/cmd/path.rs | 2 +- crates/engine/src/script/dom.rs | 22 +- crates/engine/src/script/dom/colors.rs | 154 +++ crates/engine/src/script/dom/paths.rs | 1223 +++++++++++++++++ crates/engine/src/tests.rs | 1 + crates/engine/src/tests/script_dom.rs | 8 +- crates/engine/src/tests/script_dom_paths.rs | 602 ++++++++ .../tests/it/script_host_vs_scriptcheck.rs | 39 +- docs/mcp.md | 50 +- docs/target-app-parity.md | 3 +- 11 files changed, 2090 insertions(+), 17 deletions(-) create mode 100644 crates/engine/src/script/dom/colors.rs create mode 100644 crates/engine/src/script/dom/paths.rs create mode 100644 crates/engine/src/tests/script_dom_paths.rs diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index 0ce38be40b..103eb44f8d 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -850,7 +850,8 @@ pub(crate) fn anchor_from_json(v: &Value, cmd: &str) -> Result { }; let mut anchor = Anchor::with_handles(p, handle("in")?, handle("out")?); match v.get("smooth").filter(|b| !b.is_null()) { - None | Some(Value::Bool(false)) => {} + None => {} + Some(Value::Bool(false)) => anchor.kind = AnchorKind::Corner, Some(Value::Bool(true)) => anchor.kind = AnchorKind::Smooth, Some(_) => return Err(bad(cmd, "anchor `smooth` must be true or false")), } diff --git a/crates/engine/src/cmd/path.rs b/crates/engine/src/cmd/path.rs index d32594d92d..d747f34989 100644 --- a/crates/engine/src/cmd/path.rs +++ b/crates/engine/src/cmd/path.rs @@ -68,7 +68,7 @@ pub fn specs() -> Vec { "Set Anchors", [], None, - "{id, subpaths: [{anchors: [{x,y,in?,out?}], closed}]} replace a path's geometry", + "{id, subpaths: [{anchors: [{x,y,in?,out?,smooth?: bool (left out: smooth when both handles are pulled out and in line)}], closed}]} replace a path's geometry", has_doc, set_anchors ), diff --git a/crates/engine/src/script/dom.rs b/crates/engine/src/script/dom.rs index b986dfcf2d..03b236c0e1 100644 --- a/crates/engine/src/script/dom.rs +++ b/crates/engine/src/script/dom.rs @@ -38,6 +38,9 @@ use vectorcraft_js::{Data, HostClass, HostError, HostFunction, HostItem, HostMem use super::{HISTORY_LOST, Host, Link, Savepoint, command, command_value, current, data_size}; use crate::{DocState, Document, NodeId, NodeKind, Session}; +mod colors; +mod paths; + /// The error for a member read or called with no document open. pub const NO_ACTIVE_DOCUMENT: &str = "No active document"; /// The error for an object that was deleted, or that came from an earlier run. @@ -91,6 +94,8 @@ const ARTBOARD_COORDS: &str = "CoordinateSystem.ARTBOARDCOORDINATESYSTEM"; pub(super) struct State { coords: Cell, items: RefCell>, + /// The last list of a document's paths ([`paths`]), kept while that document is unchanged. + paths: RefCell>, saving: Cell, } @@ -151,7 +156,7 @@ fn method(link: &Link, f: Member) -> HostMember { } /// A member the help pages list that is not available yet: reading or assigning it throws, after -/// the check that a document or page item `this` is still there. +/// the check that a document, page item or path point `this` is still there. fn later(link: &Link, class: &'static str, name: &'static str) -> (String, HostMember) { let message = format!("{class}.{name} is not available yet"); let l = link.clone(); @@ -162,9 +167,12 @@ fn later(link: &Link, class: &'static str, name: &'static str) -> (String, HostM "Document" => { doc_of(&h, arg(&a, 0), "Document")?; } - "PageItem" => { + "PageItem" | "PathItem" => { item_of(&h, arg(&a, 0))?; } + "PathPoint" => { + paths::this_point(&h, &a)?; + } _ => {} } Err(HostError::Error(message.clone())) @@ -1740,9 +1748,10 @@ pub(super) fn install(realm: &mut Realm, link: &Link) -> std::result::Result<(), ("convertCoordinate", method(l, doc_convert)), ("pageItems", get(l, doc_page_items)), ("selection", property(l, doc_selection, doc_set_selection)), + ("pathItems", get(l, paths::doc_path_items)), ]); document.extend( - ["layers", "artboards", "pathItems", "groupItems", "textFrames", "swatches", "symbols", "views", "activeLayer", "saveAs", "close"] + ["layers", "artboards", "groupItems", "textFrames", "swatches", "symbols", "views", "activeLayer", "saveAs", "close"] .into_iter() .map(|m| later(l, "Document", m)), ); @@ -1809,7 +1818,12 @@ pub(super) fn install(realm: &mut Realm, link: &Link) -> std::result::Result<(), .map(|m| later(l, "PageItem", m)), ); classes.push(class("PageItem", None, page_item, None)); - classes.extend(ITEM_CLASSES.iter().map(|c| class(c, Some("PageItem"), Vec::new(), None))); + classes.extend( + ITEM_CLASSES.iter().map(|c| class(c, Some("PageItem"), if *c == "PathItem" { paths::path_item_members(l) } else { Vec::new() }, None)), + ); + classes.extend(paths::classes(l)); + classes.extend(colors::classes(l)); + paths::install_enums(realm)?; classes.push(class("Layer", None, named(vec![("typename", get(l, layer_typename)), ("name", get(l, layer_name))]), None)); realm.define_host_classes(classes, vec![("app".into(), host_ref("Application", &[]))]) } diff --git a/crates/engine/src/script/dom/colors.rs b/crates/engine/src/script/dom/colors.rs new file mode 100644 index 0000000000..40421c5d38 --- /dev/null +++ b/crates/engine/src/script/dom/colors.rs @@ -0,0 +1,154 @@ +//! The color classes of the script object model, as the help pages +//! , +//! , +//! , +//! and +//! describe them. +//! +//! A color is plain data: `new RGBColor()` gives an object with `typename` and its components, +//! which the script can change, and reading `fillColor` or `strokeColor` gives a new one each time. +//! Components are checked when a color is assigned to an object, and a value out of range throws a +//! `RangeError` with nothing changed. +//! +//! VectorCraft's own rules, which the help pages do not state: components left out count as 0; +//! `new cmykColor()` is the same as `new CMYKColor()`; `LabColor.l` is 0 to 100 and `a` and `b` +//! are -128 to 128. `GrayColor.gray` runs from 0 (black) to 100 (white), as the GrayColor page +//! says. `GradientColor`, `SpotColor` and `PatternColor` can be read from an object but not +//! assigned yet. + +use std::rc::Rc; + +use serde_json::Value; +use vectorcraft_color::{Color, Paint}; +use vectorcraft_js::{Data, HostClass, HostError, HostFunction}; + +use super::{Link, current, num, text}; + +/// The classes whose objects can be read from a fill or stroke but not assigned yet. +const LATER: &[&str] = &["GradientColor", "SpotColor", "PatternColor"]; + +/// The components of each color class, with the value `new` gives them. +const CLASSES: &[(&str, &[&str])] = &[ + ("RGBColor", &["red", "green", "blue"]), + ("CMYKColor", &["cyan", "magenta", "yellow", "black"]), + ("GrayColor", &["gray"]), + ("LabColor", &["l", "a", "b"]), + ("NoColor", &[]), + ("GradientColor", &[]), + ("SpotColor", &["tint"]), + ("PatternColor", &[]), +]; + +fn color_object(class: &str, values: &[(&str, f64)]) -> Data { + let mut items = vec![("typename".to_string(), text(class))]; + items.extend(values.iter().map(|(k, v)| ((*k).to_string(), num(*v)))); + Data::Object(items) +} + +/// A component as the script sees it: `v` times `scale`, rounded to 4 decimals. +fn shown(v: f32, scale: f64) -> f64 { + (f64::from(v) * scale * 1e4).round() / 1e4 +} + +/// The color object for a solid color. +fn of_color(c: &Color) -> Data { + match *c { + Color::Rgb { r, g, b } => color_object("RGBColor", &[("red", shown(r, 255.0)), ("green", shown(g, 255.0)), ("blue", shown(b, 255.0))]), + Color::Cmyk { c, m, y, k } => color_object( + "CMYKColor", + &[("cyan", shown(c, 100.0)), ("magenta", shown(m, 100.0)), ("yellow", shown(y, 100.0)), ("black", shown(k, 100.0))], + ), + Color::Gray { k } => color_object("GrayColor", &[("gray", shown(1.0 - k, 100.0))]), + Color::Lab { l, a, b } => color_object("LabColor", &[("l", shown(l, 1.0)), ("a", shown(a, 1.0)), ("b", shown(b, 1.0))]), + } +} + +/// What reading `fillColor` or `strokeColor` gives for `paint`: a new color object, a `SpotColor` +/// with its `tint` for a color linked to a global or spot swatch. +pub(super) fn of_paint(paint: &Paint) -> Data { + match paint { + Paint::None => color_object("NoColor", &[]), + Paint::Solid { swatch: Some(_), tint, .. } => color_object("SpotColor", &[("tint", shown(*tint, 100.0))]), + Paint::Solid { color, .. } => of_color(color), + Paint::Gradient(_) => color_object("GradientColor", &[]), + Paint::Pattern { .. } => color_object("PatternColor", &[]), + } +} + +/// The component `key` of color object `o`, from `min` to `max` (0 when it is left out). +fn component(o: &[(String, Data)], class: &str, key: &str, min: f64, max: f64) -> std::result::Result { + match o.iter().find(|(k, _)| k == key).map(|(_, v)| v) { + None | Some(Data::Undefined) => Ok(0.0), + Some(Data::Number(n)) if n.is_finite() && (min..=max).contains(n) => Ok(*n), + Some(Data::Number(_)) => Err(HostError::Range(format!("{class}.{key} must be from {min} to {max}"))), + Some(_) => Err(HostError::Type(format!("{class}.{key} must be a number"))), + } +} + +#[allow(clippy::cast_possible_truncation)] +fn unit(v: f64, scale: f64) -> f32 { + (v / scale) as f32 +} + +/// The color a script assigned, checked: `None` for a `NoColor`. `what` names the property. +pub(super) fn assigned(d: &Data, what: &str) -> std::result::Result, HostError> { + let Data::Object(o) = d else { return Err(HostError::Type(format!("{what} must be a color object"))) }; + let class = match o.iter().find(|(k, _)| k == "typename").map(|(_, v)| v) { + Some(Data::String(s)) => s.as_str(), + _ => return Err(HostError::Type(format!("{what} must be a color object"))), + }; + let c = |key: &str, min: f64, max: f64| component(o, class, key, min, max); + Ok(Some(match class { + "NoColor" => return Ok(None), + "RGBColor" => { + Color::Rgb { r: unit(c("red", 0.0, 255.0)?, 255.0), g: unit(c("green", 0.0, 255.0)?, 255.0), b: unit(c("blue", 0.0, 255.0)?, 255.0) } + } + "CMYKColor" => Color::Cmyk { + c: unit(c("cyan", 0.0, 100.0)?, 100.0), + m: unit(c("magenta", 0.0, 100.0)?, 100.0), + y: unit(c("yellow", 0.0, 100.0)?, 100.0), + k: unit(c("black", 0.0, 100.0)?, 100.0), + }, + "GrayColor" => Color::Gray { k: unit(100.0 - c("gray", 0.0, 100.0)?, 100.0) }, + "LabColor" => Color::Lab { l: unit(c("l", 0.0, 100.0)?, 1.0), a: unit(c("a", -128.0, 128.0)?, 1.0), b: unit(c("b", -128.0, 128.0)?, 1.0) }, + l if LATER.contains(&l) => return Err(HostError::Error(format!("assigning a {l} is not available yet"))), + _ => return Err(HostError::Type(format!("{what} must be a color object"))), + })) +} + +/// `color` as `paint.setFill` and `paint.setStroke` take it. +pub(super) fn param(color: &Color) -> Value { + serde_json::to_value(color).unwrap_or(Value::Null) +} + +/// The constructors of the color classes, and `cmykColor`. +pub(super) fn classes(link: &Link) -> Vec { + let make = |name: &str, components: &'static [&'static str]| { + let l = link.clone(); + let class = name.to_string(); + let f: HostFunction = Rc::new(move |_| { + current(&l)?.charge_call(64)?; + let zeros: Vec<(&str, f64)> = components.iter().map(|k| (*k, if *k == "tint" { 100.0 } else { 0.0 })).collect(); + Ok(color_object(&class, &zeros)) + }); + f + }; + let mut out: Vec = CLASSES + .iter() + .map(|(name, components)| HostClass { + name: (*name).into(), + parent: None, + members: Vec::new(), + index: None, + construct: Some(make(name, components)), + }) + .collect(); + out.push(HostClass { + name: "cmykColor".into(), + parent: None, + members: Vec::new(), + index: None, + construct: Some(make("CMYKColor", CLASSES[1].1)), + }); + out +} diff --git a/crates/engine/src/script/dom/paths.rs b/crates/engine/src/script/dom/paths.rs new file mode 100644 index 0000000000..ac643ce370 --- /dev/null +++ b/crates/engine/src/script/dom/paths.rs @@ -0,0 +1,1223 @@ +//! Paths and their points in the script object model, as the help pages +//! , +//! , +//! and +//! describe them. +//! +//! A `PathPoints` object holds its path's handle, and a `PathPoint` the path's handle and the +//! point's index, counted across the path's subpaths in order. Each read looks the path up again. +//! Every change runs one command (`path.setAnchors` for the geometry), inside the run's one undo +//! step, and a change that changes nothing runs no command. +//! +//! VectorCraft's own rules, which the help pages do not state: +//! - `Document.pathItems` lists the document's paths in the order of `pageItems`, paths inside +//! groups and compound paths included. +//! - A change to the geometry or paint of a path that is hidden or locked, or that is in a hidden +//! or locked layer or group, throws `Cannot edit` with nothing changed. +//! - A path in a compound path or compound shape reads that owner's paint, which the paint +//! commands change in its place. A paint or stroke change leaves the paint for new art, the +//! active proxy and the recent colors as they were. +//! - `closed` is true when every subpath of the path is closed, and assigning it opens or closes +//! them all. +//! - `pathItems.add()` makes a path with no points on top of the active layer, painted as new art +//! is. `filled` and `stroked` set to true give a path with no fill or stroke new art's fill or +//! stroke (solid, gradient or pattern), or black when new art has none. `PathPoints.add()` adds +//! a corner point with no handles at the last point, or at `[0, 0]` on a path with no points. +//! Removing the last points leaves the path, with no points. +//! - A point whose index is past the end of its path throws `Stale path point`. +//! - Shape creators take sizes and radii that are finite and not negative; `sides` is a whole +//! number from 3 to 1000 and `points` one from 2 to 1000. `inscribed` true throws an error that +//! says it is not available yet. `rotateAbout` and `scaleAbout` default to +//! `Transformation.CENTER`. +//! - The transforms take one setting for fill and stroke patterns, so `changeFillPatterns` and +//! `changeStrokePattern` given as different values throw an error; gradients move with the art, +//! so `changeFillGradients` false throws an error that says it is not available yet. + +use std::rc::Rc; + +use serde_json::{Value, json}; +use vectorcraft_color::{Color, Paint}; +use vectorcraft_doc::pattern::pattern_paint; +use vectorcraft_doc::{GraphicStyle, LineCap, LineJoin}; +use vectorcraft_geom::path::{Anchor, AnchorKind, FillRule, PathData, SubPath}; +use vectorcraft_geom::{Point, Rect}; +use vectorcraft_js::{Data, HostClass, HostError, HostItem, HostMember, Realm, RunError, host_ref}; +use vectorcraft_tools::params::gradient_params; + +use super::{ + Answer, Coords, Doc, Item, Link, NOT_FOUND, STALE_ITEM, arg, boolean, class, colors, command, coordinate, doc_of, edit_item, editable, find_doc, + float, frame, get, given, handle_of, id_of, id_parts, item_of, item_rect, later, method, named, num, number, on_doc, pair, point, property, + this_doc, typename_of, whole, with_doc, +}; +use crate::{DocState, NodeId, NodeKind}; + +/// The error of a point whose index is past the end of its path. +pub const STALE_POINT: &str = "Stale path point"; +/// The most points `setEntirePath` takes. +pub const MAX_POINTS: usize = 100_000; +/// The most lengths `strokeDashes` takes. +pub const MAX_DASHES: usize = 64; +/// The largest stroke weight a script may set, in points. +pub const MAX_STROKE_WIDTH: f64 = 1000.0; + +/// The enumerations of paths, as frozen objects whose members are `"Name.MEMBER"` strings. +pub(super) const ENUMS: &[(&str, &[&str])] = &[ + ("PointType", &["CORNER", "SMOOTH"]), + ("PathPointSelection", &["ANCHORPOINT", "LEFTDIRECTION", "LEFTRIGHTPOINT", "NOSELECTION", "RIGHTDIRECTION"]), + ("StrokeCap", &["BUTTENDCAP", "PROJECTINGENDCAP", "ROUNDENDCAP"]), + ("StrokeJoin", &["BEVELENDJOIN", "MITERENDJOIN", "ROUNDENDJOIN"]), + ("PolarityValues", &["NEGATIVE", "POSITIVE"]), + ("Transformation", &["BOTTOM", "BOTTOMLEFT", "BOTTOMRIGHT", "CENTER", "DOCUMENTORIGIN", "LEFT", "RIGHT", "TOP", "TOPLEFT", "TOPRIGHT"]), +]; + +/// Adds the enumerations of [`ENUMS`] to `realm`. +pub(super) fn install_enums(realm: &mut Realm) -> std::result::Result<(), RunError> { + for (name, members) in ENUMS { + let items = members.iter().map(|m| (m.to_string(), HostItem::Value(Data::String(format!("{name}.{m}"))))).collect(); + realm.define_host_object(name, items)?; + } + Ok(()) +} + +fn cannot_edit(id: NodeId) -> HostError { + HostError::Error(format!("Cannot edit PathItem {}: it, or a layer or group it is in, is hidden or locked", id.0)) +} + +/// The path `d` names, which must still be in its document. +fn path_of(h: &super::Host, d: &Data) -> std::result::Result { + let item = item_of(h, d)?; + let is_path = with_doc(h, item.doc, |_, st| st.doc.node(item.id).is_some_and(|n| matches!(n.kind, NodeKind::Path { .. }))); + if is_path { Ok(item) } else { Err(HostError::Type("this is not a PathItem".into())) } +} + +fn this_path(h: &super::Host, a: &[Data]) -> std::result::Result { + path_of(h, arg(a, 0)) +} + +/// The path of the run `run`, document `uid` and id parts `high` and `low`, as a handle gives them. +fn path_at(h: &super::Host, run: f64, uid: f64, high: f64, low: f64) -> std::result::Result { + let doc = find_doc(h, run, uid).ok_or_else(|| HostError::Error(STALE_ITEM.into()))?; + let id = id_of(high, low).ok_or_else(|| HostError::Error(STALE_ITEM.into()))?; + path_of(h, &path_ref(h, Item { doc, id })) +} + +/// Reads the path of `item` with `f`. +fn read_path(h: &super::Host, item: Item, f: impl FnOnce(&DocState, &crate::doc::Node, &PathData) -> T) -> std::result::Result { + with_doc(h, item.doc, |_, st| match st.doc.node(item.id) { + Some(n) => match n.path_data() { + Some(pd) => Ok(f(st, n, pd)), + None => Err(HostError::Type("this is not a PathItem".into())), + }, + None => Err(HostError::Error(STALE_ITEM.into())), + }) +} + +fn path_ref(h: &super::Host, item: Item) -> Data { + let [high, low] = id_parts(item.id); + host_ref("PathItem", &[float(h.run), float(item.doc.uid), high, low]) +} + +/// How many points a path has, across its subpaths. +fn point_count(pd: &PathData) -> usize { + pd.subpaths.iter().map(|sp| sp.anchors.len()).sum() +} + +/// The subpath and the place in it of point `i`. +fn locate(pd: &PathData, mut i: usize) -> Option<(usize, usize)> { + for (s, sp) in pd.subpaths.iter().enumerate() { + if i < sp.anchors.len() { + return Some((s, i)); + } + i -= sp.anchors.len(); + } + None +} + +fn anchor_json(a: &Anchor) -> Value { + json!({"x": a.p.x, "y": a.p.y, "in": [a.h_in.x, a.h_in.y], "out": [a.h_out.x, a.h_out.y], "smooth": a.kind == AnchorKind::Smooth}) +} + +/// Gives the path of `item` the subpaths `subs` with `path.setAnchors`, unless it has them. +fn write_path(h: &super::Host, item: Item, subs: Vec) -> std::result::Result<(), HostError> { + let (same, ok) = read_path(h, item, |st, _, pd| (pd.subpaths == subs, editable(&st.doc, item.id)))?; + if same { + return Ok(()); + } + if !ok { + return Err(cannot_edit(item.id)); + } + let subpaths: Vec = + subs.iter().map(|sp| json!({"anchors": sp.anchors.iter().map(anchor_json).collect::>(), "closed": sp.closed})).collect(); + edit_item(h, item, "path.setAnchors", &json!({"id": item.id.0, "subpaths": subpaths}))?; + Ok(()) +} + +/// Runs `id` with `params` and `ids: [item]` on the item, which must be one the user could edit. +/// The paint for new art, the active Fill or Stroke proxy, the last color and gradient and the +/// recent colors, which `paint.setFill`, `paint.setStroke` and `stroke.set` also set, are put +/// back afterwards, so the edit changes only the path. +fn edit_path(h: &super::Host, item: Item, id: &str, mut params: Value) -> std::result::Result { + let ok = with_doc(h, item.doc, |_, st| editable(&st.doc, item.id)); + if !ok { + return Err(cannot_edit(item.id)); + } + if let Some(o) = params.as_object_mut() { + o.insert("ids".into(), json!([item.id.0])); + } + keeping_paint(h, || edit_item(h, item, id, ¶ms)) +} + +/// Runs `f`, then puts back the paint for new art, the active Fill or Stroke proxy, the last color +/// and gradient and the recent colors as they were before it. +fn keeping_paint(h: &super::Host, f: impl FnOnce() -> T) -> T { + let kept = { + let s = h.session.borrow(); + (s.paint.clone(), s.fill_active, s.last_solid, s.last_gradient.clone(), s.recent_colors.clone()) + }; + let r = f(); + let mut s = h.session.borrow_mut(); + (s.paint, s.fill_active, s.last_solid, s.last_gradient, s.recent_colors) = kept; + r +} + +// ---- Document.pathItems ---- + +/// The ids of a document's paths, in the order of its page items. +fn path_items(h: &super::Host, st: &DocState) -> Rc> { + if let Some((uid, doc, ids)) = &*h.dom.paths.borrow() + && *uid == st.uid + && std::sync::Arc::ptr_eq(doc, &st.doc) + { + return ids.clone(); + } + let all = super::page_items(h, st); + let ids: Rc> = + Rc::new(all.iter().copied().filter(|i| st.doc.node(*i).is_some_and(|n| matches!(n.kind, NodeKind::Path { .. }))).collect()); + *h.dom.paths.borrow_mut() = Some((st.uid, st.doc.clone(), ids.clone())); + ids +} + +pub(super) fn doc_path_items(h: &super::Host, a: &[Data]) -> Answer { + let doc = this_doc(h, a)?; + Ok(host_ref("PathItems", &[float(h.run), float(doc.uid)])) +} + +fn items_doc(h: &super::Host, a: &[Data]) -> std::result::Result { + doc_of(h, arg(a, 0), "PathItems") +} + +fn items_length(h: &super::Host, a: &[Data]) -> Answer { + let doc = items_doc(h, a)?; + Ok(num(float(with_doc(h, doc, |_, st| path_items(h, st).len()) as u64))) +} + +fn items_parent(h: &super::Host, a: &[Data]) -> Answer { + let doc = items_doc(h, a)?; + Ok(host_ref("Document", &[float(h.run), float(doc.uid)])) +} + +fn items_at(h: &super::Host, a: &[Data]) -> Answer { + let doc = items_doc(h, a)?; + let Data::Number(n) = arg(a, 1) else { return Ok(Data::Undefined) }; + let Some(i) = whole(*n).and_then(|i| usize::try_from(i).ok()) else { return Ok(Data::Undefined) }; + Ok(with_doc(h, doc, |_, st| path_items(h, st).get(i).map_or(Data::Undefined, |id| super::item_ref(h, st, *id)))) +} + +fn items_by_name(h: &super::Host, a: &[Data]) -> Answer { + let doc = items_doc(h, a)?; + let Data::String(name) = arg(a, 1) else { return Err(HostError::Type("give a name, as a string".into())) }; + with_doc(h, doc, |_, st| { + let ids = path_items(h, st); + h.charge_call(ids.len() as u64)?; + let id = ids.iter().find(|i| st.doc.node(**i).and_then(|n| n.name.as_deref()) == Some(name.as_str())); + id.map(|id| super::item_ref(h, st, *id)).ok_or_else(|| HostError::Error(NOT_FOUND.into())) + }) +} + +fn items_index(h: &super::Host, a: &[Data]) -> Answer { + match arg(a, 1) { + Data::String(_) => items_by_name(h, a), + Data::Number(_) => match items_at(h, a)? { + Data::Undefined => Err(HostError::Error(NOT_FOUND.into())), + d => Ok(d), + }, + _ => Err(HostError::Type("give a name or an index".into())), + } +} + +/// `pathItems.removeAll()`: deletes every path of the document in one command. A hidden or locked +/// path, or one in a hidden or locked layer or group, stops it before anything is deleted. +fn items_remove_all(h: &super::Host, a: &[Data]) -> Answer { + let doc = items_doc(h, a)?; + let (ids, refused) = with_doc(h, doc, |_, st| { + let ids = path_items(h, st); + let refused: Vec = ids.iter().filter(|i| !editable(&st.doc, **i)).map(|i| i.0).take(20).collect(); + (ids, refused) + }); + if !refused.is_empty() { + let list = refused.iter().map(u64::to_string).collect::>().join(", "); + return Err(HostError::Error(format!("cannot delete hidden or locked paths: {list}"))); + } + if !ids.is_empty() { + on_doc(h, doc.uid, true, |h| command(h, "edit.clear", &json!({"ids": ids.iter().map(|i| i.0).collect::>()})))?; + } + Ok(Data::Undefined) +} + +/// The id in the result of a command that made an object. +fn made_id(r: &Data) -> std::result::Result { + let id = match r { + Data::Object(o) => o.iter().find(|(k, _)| k == "id").and_then(|(_, v)| if let Data::Number(n) = v { whole(*n) } else { None }), + _ => None, + }; + id.map(NodeId).ok_or_else(|| HostError::Error("the path was not made".into())) +} + +/// Runs the command `id` that makes a path in `doc`, the selection kept, and reverses the new +/// path's direction when `reversed`. → the new path. +fn make(h: &super::Host, doc: Doc, id: &str, params: &Value, reversed: bool) -> Answer { + let made = on_doc(h, doc.uid, true, |h| { + let id = made_id(&command(h, id, params)?)?; + if reversed { + command(h, "path.reverse", &json!({"ids": [id.0]}))?; + } + Ok(id) + })?; + let s = h.session.borrow(); + let st = s.documents().iter().find(|d| d.uid == doc.uid).ok_or_else(|| HostError::Error(super::STALE_DOCUMENT.into()))?; + Ok(super::item_ref(h, st, made)) +} + +/// Argument `i`, or `default` when it is left out. +fn number_or(a: &[Data], i: usize, default: f64, what: &str) -> std::result::Result { + given(arg(a, i)).map_or(Ok(default), |d| number(d, what)) +} + +/// A size or radius: finite and not negative. +fn size(a: &[Data], i: usize, default: Option, what: &str) -> std::result::Result { + let v = match (given(arg(a, i)), default) { + (Some(d), _) => number(d, what)?, + (None, Some(v)) => v, + (None, None) => return Err(HostError::Type(format!("{what} must be a finite number"))), + }; + if !(0.0..=super::MAX_SIZE).contains(&v) { + return Err(HostError::Range(format!("{what} must be from 0 to 3999856 points"))); + } + Ok(v) +} + +/// A whole number argument from `min` to `max`. +fn count(a: &[Data], i: usize, default: f64, min: f64, max: f64, what: &str) -> std::result::Result { + let v = number_or(a, i, default, what)?; + if v.fract() != 0.0 || !(min..=max).contains(&v) { + return Err(HostError::Range(format!("{what} must be a whole number from {min} to {max}"))); + } + Ok(v) +} + +fn flag(a: &[Data], i: usize, what: &str) -> std::result::Result { + given(arg(a, i)).map_or(Ok(false), |d| boolean(d, what)) +} + +/// The top-left corner, in document coordinates, of a box whose top-left corner the script gives. +fn corner(h: &super::Host, doc: Doc, left: f64, top: f64) -> std::result::Result { + with_doc(h, doc, |_, st| Ok(frame(st)?.to_document(h.dom.coords.get(), [left, top]))) +} + +/// `rectangle(top, left, width, height, reversed?)`. +fn items_rectangle(h: &super::Host, a: &[Data]) -> Answer { + let doc = items_doc(h, a)?; + let top = coordinate(arg(a, 1), "top")?; + let left = coordinate(arg(a, 2), "left")?; + let (w, ht) = (size(a, 3, None, "width")?, size(a, 4, None, "height")?); + let reversed = flag(a, 5, "reversed")?; + let p = corner(h, doc, left, top)?; + make(h, doc, "shape.rectangle", &json!({"x": p.x, "y": p.y, "width": w, "height": ht}), reversed) +} + +/// The anchors of a rectangle `r` with elliptical corners of radii `rx` and `ry`, clockwise on the +/// page from the top of the left side. +fn rounded(r: Rect, rx: f64, ry: f64) -> Vec { + const K: f64 = 0.552_284_749_830_793_4; + let (rx, ry) = (rx.min(r.width() / 2.0), ry.min(r.height() / 2.0)); + let (kx, ky) = (rx * K, ry * K); + let a = |p: Point, h_in: Point, h_out: Point| Anchor { p, h_in, h_out, kind: AnchorKind::Corner }; + let (x0, y0, x1, y1) = (r.x0, r.y0, r.x1, r.y1); + let mut out = vec![ + a(Point::new(x0, y0 + ry), Point::new(x0, y0 + ry), Point::new(x0, y0 + ry - ky)), + a(Point::new(x0 + rx, y0), Point::new(x0 + rx - kx, y0), Point::new(x0 + rx, y0)), + a(Point::new(x1 - rx, y0), Point::new(x1 - rx, y0), Point::new(x1 - rx + kx, y0)), + a(Point::new(x1, y0 + ry), Point::new(x1, y0 + ry - ky), Point::new(x1, y0 + ry)), + a(Point::new(x1, y1 - ry), Point::new(x1, y1 - ry), Point::new(x1, y1 - ry + ky)), + a(Point::new(x1 - rx, y1), Point::new(x1 - rx + kx, y1), Point::new(x1 - rx, y1)), + a(Point::new(x0 + rx, y1), Point::new(x0 + rx, y1), Point::new(x0 + rx - kx, y1)), + a(Point::new(x0, y1 - ry), Point::new(x0, y1 - ry + ky), Point::new(x0, y1 - ry)), + ]; + out.dedup_by(|b, a| { + b.p.distance(a.p) < 1e-9 && { + a.h_out = b.h_out; + true + } + }); + if out.len() > 1 + && out.first().zip(out.last()).is_some_and(|(f, l)| f.p.distance(l.p) < 1e-9) + && let Some(l) = out.pop() + && let Some(f) = out.first_mut() + { + f.h_in = l.h_in; + } + out +} + +/// `roundedRectangle(top, left, width, height, horizontalRadius = 15, verticalRadius = 20, +/// reversed = false)`: a closed path with `path.create`. +fn items_rounded_rectangle(h: &super::Host, a: &[Data]) -> Answer { + let doc = items_doc(h, a)?; + let top = coordinate(arg(a, 1), "top")?; + let left = coordinate(arg(a, 2), "left")?; + let (w, ht) = (size(a, 3, None, "width")?, size(a, 4, None, "height")?); + let (rx, ry) = (size(a, 5, Some(15.0), "horizontalRadius")?, size(a, 6, Some(20.0), "verticalRadius")?); + let reversed = flag(a, 7, "reversed")?; + let p = corner(h, doc, left, top)?; + let anchors: Vec = rounded(Rect::new(p.x, p.y, p.x + w, p.y + ht), rx, ry).iter().map(anchor_json).collect(); + make(h, doc, "path.create", &json!({"anchors": anchors, "closed": true}), reversed) +} + +/// `ellipse(top = 100, left = 100, width = 50, height = 100, reversed = false, inscribed)`. +fn items_ellipse(h: &super::Host, a: &[Data]) -> Answer { + let doc = items_doc(h, a)?; + let top = given(arg(a, 1)).map_or(Ok(100.0), |d| coordinate(d, "top"))?; + let left = given(arg(a, 2)).map_or(Ok(100.0), |d| coordinate(d, "left"))?; + let (w, ht) = (size(a, 3, Some(50.0), "width")?, size(a, 4, Some(100.0), "height")?); + let reversed = flag(a, 5, "reversed")?; + if flag(a, 6, "inscribed")? { + return Err(HostError::Error("ellipse with inscribed true is not available yet".into())); + } + let p = corner(h, doc, left, top)?; + make(h, doc, "shape.ellipse", &json!({"x": p.x, "y": p.y, "width": w, "height": ht}), reversed) +} + +/// The center of a polygon or star, in document coordinates. +fn center(h: &super::Host, doc: Doc, a: &[Data]) -> std::result::Result { + let x = given(arg(a, 1)).map_or(Ok(200.0), |d| coordinate(d, "centerX"))?; + let y = given(arg(a, 2)).map_or(Ok(300.0), |d| coordinate(d, "centerY"))?; + corner(h, doc, x, y) +} + +/// `polygon(centerX = 200, centerY = 300, radius = 50, sides = 8, reversed = false)`. +fn items_polygon(h: &super::Host, a: &[Data]) -> Answer { + let doc = items_doc(h, a)?; + let c = center(h, doc, a)?; + let r = size(a, 3, Some(50.0), "radius")?; + let sides = count(a, 4, 8.0, 3.0, 1000.0, "sides")?; + let reversed = flag(a, 5, "reversed")?; + make(h, doc, "shape.polygon", &json!({"cx": c.x, "cy": c.y, "radius": r, "sides": sides}), reversed) +} + +/// `star(centerX = 200, centerY = 300, radius = 50, innerRadius = 20, points = 5, reversed = +/// false)`. +fn items_star(h: &super::Host, a: &[Data]) -> Answer { + let doc = items_doc(h, a)?; + let c = center(h, doc, a)?; + let r1 = size(a, 3, Some(50.0), "radius")?; + let r2 = size(a, 4, Some(20.0), "innerRadius")?; + let points = count(a, 5, 5.0, 2.0, 1000.0, "points")?; + let reversed = flag(a, 6, "reversed")?; + make(h, doc, "shape.star", &json!({"cx": c.x, "cy": c.y, "radius1": r1, "radius2": r2, "points": points}), reversed) +} + +/// `pathItems.add()`: a path with no points, from `path.create` with empty path data, painted as +/// new art. When new art has no fill and no stroke, the black stroke `path.create` gives an open +/// path is set back to none in the same step. +fn items_add(h: &super::Host, a: &[Data]) -> Answer { + let doc = items_doc(h, a)?; + let made = on_doc(h, doc.uid, true, |h| { + let unpainted = { + let ap = h.session.borrow().new_art(); + ap.fill_paint().is_none() && ap.stroke_paint().is_none() + }; + let id = made_id(&command(h, "path.create", &json!({"d": ""}))?)?; + if unpainted { + keeping_paint(h, || command(h, "paint.setStroke", &json!({"none": true, "ids": [id.0]})))?; + } + Ok(id) + })?; + let s = h.session.borrow(); + let st = s.documents().iter().find(|d| d.uid == doc.uid).ok_or_else(|| HostError::Error(super::STALE_DOCUMENT.into()))?; + Ok(super::item_ref(h, st, made)) +} + +// ---- PathItem geometry ---- + +fn path_points(h: &super::Host, a: &[Data]) -> Answer { + let item = this_path(h, a)?; + let [high, low] = id_parts(item.id); + Ok(host_ref("PathPoints", &[float(h.run), float(item.doc.uid), high, low])) +} + +fn path_closed(h: &super::Host, a: &[Data]) -> Answer { + let item = this_path(h, a)?; + read_path(h, item, |_, _, pd| Data::Bool(!pd.subpaths.is_empty() && pd.subpaths.iter().all(|sp| sp.closed))) +} + +fn path_set_closed(h: &super::Host, a: &[Data]) -> Answer { + let closed = boolean(arg(a, 1), "closed")?; + let item = this_path(h, a)?; + let subs = read_path(h, item, |_, _, pd| pd.subpaths.iter().map(|sp| SubPath { anchors: sp.anchors.clone(), closed }).collect())?; + write_path(h, item, subs)?; + Ok(Data::Undefined) +} + +/// Whether the path fills by the even-odd rule: its compound path's rule when it is a member of one, +/// as `path.setFillRule` sets it there. +fn path_evenodd(h: &super::Host, a: &[Data]) -> Answer { + let item = this_path(h, a)?; + read_path(h, item, |st, n, _| { + let owner = st.doc.parent_of(item.id).and_then(|p| st.doc.node(p)).filter(|p| matches!(p.kind, NodeKind::Compound { .. })).unwrap_or(n); + Data::Bool(matches!(owner.kind, NodeKind::Path { rule: FillRule::EvenOdd, .. } | NodeKind::Compound { rule: FillRule::EvenOdd, .. })) + }) +} + +fn path_set_evenodd(h: &super::Host, a: &[Data]) -> Answer { + let on = boolean(arg(a, 1), "evenodd")?; + let item = this_path(h, a)?; + if path_evenodd(h, a)? != Data::Bool(on) { + edit_path(h, item, "path.setFillRule", json!({"rule": if on { "evenOdd" } else { "nonZero" }}))?; + } + Ok(Data::Undefined) +} + +/// The area in square points: negative when the path runs counterclockwise on the page. +fn path_area(h: &super::Host, a: &[Data]) -> Answer { + let item = this_path(h, a)?; + read_path(h, item, |_, _, pd| num(pd.subpaths.iter().map(SubPath::signed_area).sum())) +} + +fn path_length(h: &super::Host, a: &[Data]) -> Answer { + let item = this_path(h, a)?; + read_path(h, item, |_, _, pd| num(pd.length())) +} + +fn path_guides(h: &super::Host, a: &[Data]) -> Answer { + let item = this_path(h, a)?; + read_path(h, item, |_, n, _| Data::Bool(matches!(n.kind, NodeKind::Path { guide: true, .. }))) +} + +fn path_clipping(h: &super::Host, a: &[Data]) -> Answer { + let item = this_path(h, a)?; + read_path(h, item, |_, n, _| Data::Bool(matches!(n.kind, NodeKind::Path { clipping: true, .. }))) +} + +/// `setEntirePath([[x, y], ...])`: corner points with no handles in place of every point, in one +/// subpath that stays closed when the path was. +fn path_set_entire(h: &super::Host, a: &[Data]) -> Answer { + let item = this_path(h, a)?; + let Data::Array(list) = arg(a, 1) else { return Err(HostError::Type("setEntirePath needs an array of [x, y] points".into())) }; + if list.len() > MAX_POINTS { + return Err(HostError::Range(format!("setEntirePath takes at most {MAX_POINTS} points"))); + } + let script: Vec<[f64; 2]> = list.iter().map(|d| point(d, "each point")).collect::>()?; + let (f, closed) = read_path(h, item, |st, _, pd| (frame(st), !pd.subpaths.is_empty() && pd.subpaths.iter().all(|sp| sp.closed)))?; + let (f, c) = (f?, h.dom.coords.get()); + let anchors: Vec = script.iter().map(|p| Anchor::corner(f.to_document(c, *p))).collect(); + let subs = if anchors.is_empty() { Vec::new() } else { vec![SubPath::new(anchors, closed)] }; + write_path(h, item, subs)?; + Ok(Data::Undefined) +} + +// ---- PathItem paint ---- + +/// The top fill's paint and the top stroke's paint, width, cap, join, miter limit, dashes and +/// offset, and the overprint flags of both. +struct Look { + fill: Paint, + fill_overprint: bool, + stroke: Paint, + width: f64, + cap: LineCap, + join: LineJoin, + miter: f64, + dashes: Vec, + offset: f64, + stroke_overprint: bool, +} + +/// The look of `item`, read from its compound path or compound shape when it is a member of one, +/// since the paint commands paint that owner in its place. +fn look(h: &super::Host, item: Item) -> std::result::Result { + read_path(h, item, |st, n, _| { + let d = &st.doc; + let owner = d + .parent_of(item.id) + .and_then(|p| d.node(p)) + .filter(|p| matches!(p.kind, NodeKind::Compound { .. }) || p.is_compound_shape()) + .unwrap_or(n); + let ap = &owner.appearance; + let fill = ap.fill(); + let stroke = ap.stroke(); + Look { + fill: fill.map_or(Paint::None, |f| f.paint.clone()), + fill_overprint: fill.is_some_and(|f| f.overprint), + stroke: stroke.map_or(Paint::None, |s| s.paint.clone()), + width: stroke.map_or(0.0, |s| s.width), + cap: stroke.map_or(LineCap::default(), |s| s.cap), + join: stroke.map_or(LineJoin::default(), |s| s.join), + miter: stroke.map_or(10.0, |s| s.miter_limit), + dashes: stroke.and_then(|s| s.dash.as_ref()).map_or_else(Vec::new, |d| d.pattern.clone()), + offset: stroke.and_then(|s| s.dash.as_ref()).map_or(0.0, |d| d.offset), + stroke_overprint: stroke.is_some_and(|s| s.overprint), + } + }) +} + +fn this_look(h: &super::Host, a: &[Data]) -> std::result::Result<(Item, Look), HostError> { + let item = this_path(h, a)?; + Ok((item, look(h, item)?)) +} + +fn path_filled(h: &super::Host, a: &[Data]) -> Answer { + Ok(Data::Bool(!this_look(h, a)?.1.fill.is_none())) +} + +fn path_stroked(h: &super::Host, a: &[Data]) -> Answer { + Ok(Data::Bool(!this_look(h, a)?.1.stroke.is_none())) +} + +/// Sets the fill (`fill`) or the stroke to `color`, or to none, with `paint.setFill` or +/// `paint.setStroke`. +fn set_paint(h: &super::Host, item: Item, fill: bool, color: Option) -> std::result::Result<(), HostError> { + let id = if fill { "paint.setFill" } else { "paint.setStroke" }; + let params = match color { + Some(c) => json!({"color": colors::param(&c)}), + None => json!({"none": true}), + }; + edit_path(h, item, id, params)?; + Ok(()) +} + +/// The paint new art gets for its fill or stroke, as `paint.setFill` or `paint.setStroke` params for +/// the path `item`: a solid color, linked to its global or spot swatch while the document has that +/// swatch; a gradient, a placed one moved onto the path's bounds as new art takes it; or a pattern. +/// A fill or stroke of none gives black. A pattern that its swatch does not give as new art has it +/// (its own placement, or a pattern the document does not have) throws an error. +fn new_art_params(h: &super::Host, item: Item, fill: bool) -> std::result::Result { + let mut ap = h.session.borrow().new_art(); + let top = |ap: &vectorcraft_doc::Appearance| if fill { ap.fill_paint() } else { ap.stroke_paint() }; + let what = if fill { "filled" } else { "stroked" }; + let paint = top(&ap); + match &paint { + Paint::None => Ok(json!({"color": colors::param(&Color::BLACK)})), + Paint::Solid { color, swatch: Some(name), tint } => { + let linked = read_path(h, item, |st, _, _| st.doc.swatch(name).is_some())?; + Ok(match linked { + true if *tint < 1.0 => json!({"swatch": name, "tint": f64::from(*tint) * 100.0}), + true => json!({"swatch": name}), + false => json!({"color": colors::param(color)}), + }) + } + Paint::Solid { color, .. } => Ok(json!({"color": colors::param(color)})), + Paint::Gradient(g) => { + let mut g = g.clone(); + if g.geom.is_some() || g.freeform.is_some() { + match read_path(h, item, |_, n, _| n.geometric_bounds())? { + Some(b) => { + ap.rebase_gradients(GraphicStyle::UNIT_BOX, b); + if let Paint::Gradient(placed) = top(&ap) { + g = placed; + } + } + None => (g.geom, g.freeform) = (None, None), + } + } + Ok(json!({"gradient": gradient_params(&g), "keepModel": true})) + } + Paint::Pattern { pattern, .. } => { + let given = read_path(h, item, |st, _, _| { + let d = &st.doc; + d.swatch(pattern).map(|sw| sw.paint.clone()).or_else(|| d.pattern(pattern).map(|_| pattern_paint(pattern))) + })?; + match given { + Some(p) if p == paint => Ok(json!({"swatch": pattern})), + Some(_) => Err(HostError::Error(format!( + "Cannot set {what}: new art's pattern `{pattern}` has a placement of its own, which is not available yet" + ))), + None => Err(HostError::Error(format!("Cannot set {what}: new art's pattern `{pattern}` is not in this document"))), + } + } + } +} + +fn set_painted(h: &super::Host, a: &[Data], fill: bool) -> Answer { + let on = boolean(arg(a, 1), if fill { "filled" } else { "stroked" })?; + let (item, look) = this_look(h, a)?; + let now = if fill { !look.fill.is_none() } else { !look.stroke.is_none() }; + if now != on { + let params = if on { new_art_params(h, item, fill)? } else { json!({"none": true}) }; + edit_path(h, item, if fill { "paint.setFill" } else { "paint.setStroke" }, params)?; + } + Ok(Data::Undefined) +} + +fn path_set_filled(h: &super::Host, a: &[Data]) -> Answer { + set_painted(h, a, true) +} + +fn path_set_stroked(h: &super::Host, a: &[Data]) -> Answer { + set_painted(h, a, false) +} + +fn path_fill_color(h: &super::Host, a: &[Data]) -> Answer { + Ok(colors::of_paint(&this_look(h, a)?.1.fill)) +} + +fn path_stroke_color(h: &super::Host, a: &[Data]) -> Answer { + Ok(colors::of_paint(&this_look(h, a)?.1.stroke)) +} + +fn set_color(h: &super::Host, a: &[Data], fill: bool) -> Answer { + let color = colors::assigned(arg(a, 1), if fill { "fillColor" } else { "strokeColor" })?; + let (item, look) = this_look(h, a)?; + let now = if fill { &look.fill } else { &look.stroke }; + let same = match (&color, now) { + (None, Paint::None) => true, + (Some(c), Paint::Solid { color, swatch: None, .. }) => c == color, + _ => false, + }; + if !same { + set_paint(h, item, fill, color)?; + } + Ok(Data::Undefined) +} + +fn path_set_fill_color(h: &super::Host, a: &[Data]) -> Answer { + set_color(h, a, true) +} + +fn path_set_stroke_color(h: &super::Host, a: &[Data]) -> Answer { + set_color(h, a, false) +} + +/// Runs `stroke.set` with `params` on the path, unless `same`. +fn set_stroke_option(h: &super::Host, item: Item, same: bool, params: Value) -> Answer { + if !same { + edit_path(h, item, "stroke.set", params)?; + } + Ok(Data::Undefined) +} + +fn path_stroke_width(h: &super::Host, a: &[Data]) -> Answer { + Ok(num(this_look(h, a)?.1.width)) +} + +fn path_set_stroke_width(h: &super::Host, a: &[Data]) -> Answer { + let w = number(arg(a, 1), "strokeWidth")?; + if !(0.0..=MAX_STROKE_WIDTH).contains(&w) { + return Err(HostError::Range("strokeWidth must be from 0 to 1000 points".into())); + } + let (item, look) = this_look(h, a)?; + set_stroke_option(h, item, (look.width - w).abs() < 1e-9, json!({"weight": w})) +} + +const CAPS: &[(LineCap, &str, &str)] = &[ + (LineCap::Butt, "StrokeCap.BUTTENDCAP", "butt"), + (LineCap::Round, "StrokeCap.ROUNDENDCAP", "round"), + (LineCap::Square, "StrokeCap.PROJECTINGENDCAP", "square"), +]; + +const JOINS: &[(LineJoin, &str, &str)] = &[ + (LineJoin::Bevel, "StrokeJoin.BEVELENDJOIN", "bevel"), + (LineJoin::Round, "StrokeJoin.ROUNDENDJOIN", "round"), + (LineJoin::Miter, "StrokeJoin.MITERENDJOIN", "miter"), +]; + +fn path_stroke_cap(h: &super::Host, a: &[Data]) -> Answer { + let cap = this_look(h, a)?.1.cap; + Ok(Data::String(CAPS.iter().find(|c| c.0 == cap).map_or("StrokeCap.BUTTENDCAP", |c| c.1).into())) +} + +fn path_set_stroke_cap(h: &super::Host, a: &[Data]) -> Answer { + let found = match arg(a, 1) { + Data::String(s) => CAPS.iter().find(|c| c.1 == s), + _ => None, + }; + let Some(&(cap, _, name)) = found else { return Err(HostError::Type("strokeCap must be a StrokeCap value".into())) }; + let (item, look) = this_look(h, a)?; + set_stroke_option(h, item, look.cap == cap, json!({"cap": name})) +} + +fn path_stroke_join(h: &super::Host, a: &[Data]) -> Answer { + let join = this_look(h, a)?.1.join; + Ok(Data::String(JOINS.iter().find(|j| j.0 == join).map_or("StrokeJoin.MITERENDJOIN", |j| j.1).into())) +} + +fn path_set_stroke_join(h: &super::Host, a: &[Data]) -> Answer { + let found = match arg(a, 1) { + Data::String(s) => JOINS.iter().find(|j| j.1 == s), + _ => None, + }; + let Some(&(join, _, name)) = found else { return Err(HostError::Type("strokeJoin must be a StrokeJoin value".into())) }; + let (item, look) = this_look(h, a)?; + set_stroke_option(h, item, look.join == join, json!({"join": name})) +} + +fn path_miter(h: &super::Host, a: &[Data]) -> Answer { + Ok(num(this_look(h, a)?.1.miter)) +} + +fn path_set_miter(h: &super::Host, a: &[Data]) -> Answer { + let v = number(arg(a, 1), "strokeMiterLimit")?; + if !(1.0..=500.0).contains(&v) { + return Err(HostError::Range("strokeMiterLimit must be from 1 to 500".into())); + } + let (item, look) = this_look(h, a)?; + set_stroke_option(h, item, (look.miter - v).abs() < 1e-9, json!({"miterLimit": v})) +} + +fn path_dashes(h: &super::Host, a: &[Data]) -> Answer { + Ok(Data::Array(this_look(h, a)?.1.dashes.into_iter().map(num).collect())) +} + +/// `strokeDashes = [lengths]`: at most [`MAX_DASHES`] finite lengths that are not negative and +/// not all 0; `[]` or `{}` gives a solid line. +fn path_set_dashes(h: &super::Host, a: &[Data]) -> Answer { + let lengths: Vec = match arg(a, 1) { + Data::Object(o) if o.is_empty() => Vec::new(), + Data::Array(list) if list.len() > MAX_DASHES => return Err(HostError::Range(format!("strokeDashes takes at most {MAX_DASHES} lengths"))), + Data::Array(list) => list.iter().map(|d| number(d, "each dash length")).collect::>()?, + _ => return Err(HostError::Type("strokeDashes must be an array of lengths".into())), + }; + if lengths.iter().any(|l| !(0.0..=MAX_STROKE_WIDTH * 1000.0).contains(l)) { + return Err(HostError::Range("each dash length must be from 0 to 1000000 points".into())); + } + if !lengths.is_empty() && lengths.iter().all(|l| *l == 0.0) { + return Err(HostError::Range("strokeDashes needs a length that is not 0".into())); + } + let (item, look) = this_look(h, a)?; + let dash = if lengths.is_empty() { Value::Null } else { json!(lengths) }; + set_stroke_option(h, item, look.dashes == lengths, json!({"dash": dash})) +} + +fn path_dash_offset(h: &super::Host, a: &[Data]) -> Answer { + Ok(num(this_look(h, a)?.1.offset)) +} + +fn path_set_dash_offset(h: &super::Host, a: &[Data]) -> Answer { + let v = number(arg(a, 1), "strokeDashOffset")?; + if v.abs() > MAX_STROKE_WIDTH * 1000.0 { + return Err(HostError::Range("strokeDashOffset must be from -1000000 to 1000000 points".into())); + } + let (item, look) = this_look(h, a)?; + if look.dashes.is_empty() && v != 0.0 { + return Err(HostError::Error("strokeDashOffset needs strokeDashes first".into())); + } + set_stroke_option(h, item, (look.offset - v).abs() < 1e-9, json!({"dashOffset": v})) +} + +fn path_fill_overprint(h: &super::Host, a: &[Data]) -> Answer { + Ok(Data::Bool(this_look(h, a)?.1.fill_overprint)) +} + +fn path_stroke_overprint(h: &super::Host, a: &[Data]) -> Answer { + Ok(Data::Bool(this_look(h, a)?.1.stroke_overprint)) +} + +fn set_overprint(h: &super::Host, a: &[Data], fill: bool) -> Answer { + let key = if fill { "fill" } else { "stroke" }; + let on = boolean(arg(a, 1), if fill { "fillOverprint" } else { "strokeOverprint" })?; + let (item, look) = this_look(h, a)?; + let (now, paint) = if fill { (look.fill_overprint, &look.fill) } else { (look.stroke_overprint, &look.stroke) }; + if now != on { + if paint.is_none() { + return Err(HostError::Error(format!("the path has no {key} to overprint"))); + } + edit_path(h, item, "object.setOverprint", json!({key: on}))?; + } + Ok(Data::Undefined) +} + +fn path_set_fill_overprint(h: &super::Host, a: &[Data]) -> Answer { + set_overprint(h, a, true) +} + +fn path_set_stroke_overprint(h: &super::Host, a: &[Data]) -> Answer { + set_overprint(h, a, false) +} + +// ---- PathItem transforms ---- + +/// The point of the path's geometric bounds `r`, in document coordinates, that a `Transformation` +/// value names (left out: the center). +fn about(h: &super::Host, item: Item, d: &Data, r: Rect) -> std::result::Result { + let name = match d { + Data::Undefined => "Transformation.CENTER", + Data::String(s) => s.as_str(), + _ => return Err(HostError::Type("give a Transformation value".into())), + }; + let (cx, cy) = ((r.x0 + r.x1) / 2.0, (r.y0 + r.y1) / 2.0); + Ok(match name.strip_prefix("Transformation.").unwrap_or("") { + "CENTER" => Point::new(cx, cy), + "TOP" => Point::new(cx, r.y0), + "BOTTOM" => Point::new(cx, r.y1), + "LEFT" => Point::new(r.x0, cy), + "RIGHT" => Point::new(r.x1, cy), + "TOPLEFT" => Point::new(r.x0, r.y0), + "TOPRIGHT" => Point::new(r.x1, r.y0), + "BOTTOMLEFT" => Point::new(r.x0, r.y1), + "BOTTOMRIGHT" => Point::new(r.x1, r.y1), + "DOCUMENTORIGIN" => with_doc(h, item.doc, |_, st| Ok::<_, HostError>(frame(st)?.to_document(Coords::Document, [0.0, 0.0])))?, + _ => return Err(HostError::Type("give a Transformation value".into())), + }) +} + +/// The `objects` and `patterns` options of a transform command from the four flags from `i`: +/// objects, fill patterns, fill gradients and stroke patterns, each left out or true or false. +fn transform_options(a: &[Data], i: usize, params: &mut Value) -> std::result::Result<(), HostError> { + let names = ["changePositions", "changeFillPatterns", "changeFillGradients", "changeStrokePattern"]; + let mut flags = [None; 4]; + for (k, name) in names.iter().enumerate() { + flags[k] = given(arg(a, i + k)).map(|d| boolean(d, name)).transpose()?; + } + if flags[2] == Some(false) { + return Err(HostError::Error(format!("{} false is not available yet: gradients move with the art", names[2]))); + } + if let (Some(f), Some(s)) = (flags[1], flags[3]) + && f != s + { + return Err(HostError::Error(format!("{} and {} must be the same here", names[1], names[3]))); + } + if let Some(o) = params.as_object_mut() { + if let Some(b) = flags[0] { + o.insert("objects".into(), json!(b)); + } + if let Some(b) = flags[1].or(flags[3]) { + o.insert("patterns".into(), json!(b)); + } + } + Ok(()) +} + +/// `translate(deltaX = 0, deltaY = 0, transformObjects?, transformFillPatterns?, ...)`. +fn path_translate(h: &super::Host, a: &[Data]) -> Answer { + let dx = given(arg(a, 1)).map_or(Ok(0.0), |d| coordinate(d, "deltaX"))?; + let dy = given(arg(a, 2)).map_or(Ok(0.0), |d| coordinate(d, "deltaY"))?; + let item = this_path(h, a)?; + let mut params = json!({"dx": dx, "dy": if h.dom.coords.get() == Coords::Document { -dy } else { dy }}); + transform_options(a, 3, &mut params)?; + if dx != 0.0 || dy != 0.0 { + edit_path(h, item, "object.move", params)?; + } + Ok(Data::Undefined) +} + +/// `rotate(angle, changePositions?, ..., rotateAbout?)`: counterclockwise on the page for a +/// positive angle. +fn path_rotate(h: &super::Host, a: &[Data]) -> Answer { + let angle = number(arg(a, 1), "angle")?; + let item = this_path(h, a)?; + let (r, _) = item_rect(h, item, false)?; + let origin = about(h, item, arg(a, 6), r)?; + let mut params = json!({"angle": angle, "origin": [origin.x, origin.y]}); + transform_options(a, 2, &mut params)?; + if angle.rem_euclid(360.0) != 0.0 { + edit_path(h, item, "object.rotate", params)?; + } + Ok(Data::Undefined) +} + +/// `resize(scaleX, scaleY, changePositions?, ..., changeLineWidths?, scaleAbout?)`: 100 is 100%; +/// `changeLineWidths` scales the stroke weight by that percent. +fn path_resize(h: &super::Host, a: &[Data]) -> Answer { + let sx = number(arg(a, 1), "scaleX")?; + let sy = number(arg(a, 2), "scaleY")?; + if sx == 0.0 || sy == 0.0 || sx.abs() > 100_000.0 || sy.abs() > 100_000.0 { + return Err(HostError::Range("scaleX and scaleY must not be 0 and at most 100000 percent".into())); + } + let widths = given(arg(a, 7)).map(|d| number(d, "changeLineWidths")).transpose()?; + if widths.is_some_and(|w| !(0.0..=100_000.0).contains(&w)) { + return Err(HostError::Range("changeLineWidths must be from 0 to 100000 percent".into())); + } + let item = this_path(h, a)?; + let (r, _) = item_rect(h, item, false)?; + let origin = about(h, item, arg(a, 8), r)?; + let mut params = json!({"sx": sx, "sy": sy, "origin": [origin.x, origin.y], "basis": "page", "strokes": false}); + transform_options(a, 3, &mut params)?; + let width = look(h, item)?.width; + let new_width = widths.map(|w| width * w / 100.0); + if new_width.is_some_and(|w| w > MAX_STROKE_WIDTH) { + return Err(HostError::Range("changeLineWidths would make the stroke weight more than 1000 points".into())); + } + if sx != 100.0 || sy != 100.0 { + edit_path(h, item, "object.scale", params)?; + } + if let Some(w) = new_width + && (w - width).abs() > 1e-9 + { + edit_path(h, item, "stroke.set", json!({"weight": w}))?; + } + Ok(Data::Undefined) +} + +// ---- PathPoints ---- + +fn points_path(h: &super::Host, a: &[Data]) -> std::result::Result { + let Some(handle) = handle_of(arg(a, 0), "PathPoints") else { return Err(HostError::Type("this is not a PathPoints".into())) }; + let [run, uid, high, low] = handle.as_slice() else { return Err(HostError::Type("this is not a PathPoints".into())) }; + path_at(h, *run, *uid, *high, *low) +} + +fn points_length(h: &super::Host, a: &[Data]) -> Answer { + let item = points_path(h, a)?; + read_path(h, item, |_, _, pd| num(float(point_count(pd) as u64))) +} + +fn points_parent(h: &super::Host, a: &[Data]) -> Answer { + let item = points_path(h, a)?; + Ok(path_ref(h, item)) +} + +fn point_ref(h: &super::Host, item: Item, i: usize) -> Data { + let [high, low] = id_parts(item.id); + host_ref("PathPoint", &[float(h.run), float(item.doc.uid), high, low, float(i as u64)]) +} + +fn points_at(h: &super::Host, a: &[Data]) -> Answer { + let item = points_path(h, a)?; + let Data::Number(n) = arg(a, 1) else { return Ok(Data::Undefined) }; + let Some(i) = whole(*n).and_then(|i| usize::try_from(i).ok()) else { return Ok(Data::Undefined) }; + let n = read_path(h, item, |_, _, pd| point_count(pd))?; + Ok(if i < n { point_ref(h, item, i) } else { Data::Undefined }) +} + +/// `index(key)`: the points are not named, so a key that is not a number throws `Not found`. +fn points_index(h: &super::Host, a: &[Data]) -> Answer { + match arg(a, 1) { + Data::Number(_) => match points_at(h, a)? { + Data::Undefined => Err(HostError::Error(NOT_FOUND.into())), + d => Ok(d), + }, + _ => Err(HostError::Error(NOT_FOUND.into())), + } +} + +fn points_add(h: &super::Host, a: &[Data]) -> Answer { + let item = points_path(h, a)?; + let (mut subs, n, origin) = read_path(h, item, |st, _, pd| { + let origin = frame(st).map(|f| f.to_document(h.dom.coords.get(), [0.0, 0.0])); + (pd.subpaths.clone(), point_count(pd), origin) + })?; + if n >= MAX_POINTS { + return Err(HostError::Range(format!("PathPoints.add takes a path to at most {MAX_POINTS} points"))); + } + let p = match subs.iter().rev().find_map(|sp| sp.anchors.last()) { + Some(last) => last.p, + None => origin?, + }; + match subs.last_mut() { + Some(sp) => sp.anchors.push(Anchor::corner(p)), + None => subs.push(SubPath::new(vec![Anchor::corner(p)], false)), + } + write_path(h, item, subs)?; + Ok(point_ref(h, item, n)) +} + +fn points_remove_all(h: &super::Host, a: &[Data]) -> Answer { + let item = points_path(h, a)?; + write_path(h, item, Vec::new())?; + Ok(Data::Undefined) +} + +// ---- PathPoint ---- + +/// The path and the index of the point `this` names, which must still be in the path. +pub(super) fn this_point(h: &super::Host, a: &[Data]) -> std::result::Result<(Item, usize), HostError> { + let Some(handle) = handle_of(arg(a, 0), "PathPoint") else { return Err(HostError::Type("this is not a PathPoint".into())) }; + let [run, uid, high, low, i] = handle.as_slice() else { return Err(HostError::Type("this is not a PathPoint".into())) }; + let item = path_at(h, *run, *uid, *high, *low)?; + let i = whole(*i).and_then(|i| usize::try_from(i).ok()).ok_or_else(|| HostError::Error(STALE_POINT.into()))?; + let n = read_path(h, item, |_, _, pd| point_count(pd))?; + if i >= n { + return Err(HostError::Error(STALE_POINT.into())); + } + Ok((item, i)) +} + +/// Reads the anchor `this` names with `f`, given the frame and the coordinate system. +fn read_point(h: &super::Host, a: &[Data], f: impl FnOnce(&super::Frame, Coords, &Anchor) -> Data) -> Answer { + let (item, i) = this_point(h, a)?; + let c = h.dom.coords.get(); + read_path(h, item, |st, _, pd| { + let fr = frame(st)?; + let anchor = locate(pd, i).and_then(|(s, j)| pd.subpaths.get(s).and_then(|sp| sp.anchors.get(j))); + anchor.map(|an| f(&fr, c, an)).ok_or_else(|| HostError::Error(STALE_POINT.into())) + })? +} + +/// Changes the anchor `this` names with `f`, given the point the script assigned in document +/// coordinates (for a point property) or the value itself. +fn edit_point(h: &super::Host, a: &[Data], f: impl FnOnce(&mut Anchor)) -> Answer { + let (item, i) = this_point(h, a)?; + let mut subs = read_path(h, item, |_, _, pd| pd.subpaths.clone())?; + let (s, j) = read_path(h, item, |_, _, pd| locate(pd, i))?.ok_or_else(|| HostError::Error(STALE_POINT.into()))?; + if let Some(an) = subs.get_mut(s).and_then(|sp| sp.anchors.get_mut(j)) { + f(an); + } + write_path(h, item, subs)?; + Ok(Data::Undefined) +} + +/// The point the script assigned to a point property, in document coordinates. +fn assigned_point(h: &super::Host, a: &[Data], what: &str) -> std::result::Result { + let p = point(arg(a, 1), what)?; + let (item, _) = this_point(h, a)?; + let fr = with_doc(h, item.doc, |_, st| frame(st))?; + Ok(fr.to_document(h.dom.coords.get(), p)) +} + +fn pt_anchor(h: &super::Host, a: &[Data]) -> Answer { + read_point(h, a, |f, c, an| pair(f.to_script(c, an.p))) +} + +fn pt_set_anchor(h: &super::Host, a: &[Data]) -> Answer { + let p = assigned_point(h, a, "anchor")?; + edit_point(h, a, |an| an.p = p) +} + +fn pt_left(h: &super::Host, a: &[Data]) -> Answer { + read_point(h, a, |f, c, an| pair(f.to_script(c, an.h_in))) +} + +fn pt_set_left(h: &super::Host, a: &[Data]) -> Answer { + let p = assigned_point(h, a, "leftDirection")?; + edit_point(h, a, |an| an.h_in = p) +} + +fn pt_right(h: &super::Host, a: &[Data]) -> Answer { + read_point(h, a, |f, c, an| pair(f.to_script(c, an.h_out))) +} + +fn pt_set_right(h: &super::Host, a: &[Data]) -> Answer { + let p = assigned_point(h, a, "rightDirection")?; + edit_point(h, a, |an| an.h_out = p) +} + +fn pt_type(h: &super::Host, a: &[Data]) -> Answer { + read_point(h, a, |_, _, an| Data::String(if an.kind == AnchorKind::Smooth { "PointType.SMOOTH" } else { "PointType.CORNER" }.into())) +} + +fn pt_set_type(h: &super::Host, a: &[Data]) -> Answer { + let kind = match arg(a, 1) { + Data::String(s) if s == "PointType.CORNER" => AnchorKind::Corner, + Data::String(s) if s == "PointType.SMOOTH" => AnchorKind::Smooth, + _ => return Err(HostError::Type("pointType must be a PointType value".into())), + }; + edit_point(h, a, |an| an.kind = kind) +} + +fn pt_parent(h: &super::Host, a: &[Data]) -> Answer { + let (item, _) = this_point(h, a)?; + Ok(path_ref(h, item)) +} + +/// `remove()`: deletes the point; a subpath left with no points goes too. +fn pt_remove(h: &super::Host, a: &[Data]) -> Answer { + let (item, i) = this_point(h, a)?; + let mut subs = read_path(h, item, |_, _, pd| pd.subpaths.clone())?; + let (s, j) = read_path(h, item, |_, _, pd| locate(pd, i))?.ok_or_else(|| HostError::Error(STALE_POINT.into()))?; + if let Some(sp) = subs.get_mut(s) { + sp.anchors.remove(j); + if sp.anchors.is_empty() { + subs.remove(s); + } + } + write_path(h, item, subs)?; + Ok(Data::Undefined) +} + +// ---- Registration ---- + +/// The members `PathItem` adds to `PageItem`'s. +pub(super) fn path_item_members(l: &Link) -> Vec<(String, HostMember)> { + let mut m = named(vec![ + ("pathPoints", get(l, path_points)), + ("closed", property(l, path_closed, path_set_closed)), + ("evenodd", property(l, path_evenodd, path_set_evenodd)), + ("area", get(l, path_area)), + ("length", get(l, path_length)), + ("guides", get(l, path_guides)), + ("clipping", get(l, path_clipping)), + ("setEntirePath", method(l, path_set_entire)), + ("filled", property(l, path_filled, path_set_filled)), + ("fillColor", property(l, path_fill_color, path_set_fill_color)), + ("fillOverprint", property(l, path_fill_overprint, path_set_fill_overprint)), + ("stroked", property(l, path_stroked, path_set_stroked)), + ("strokeColor", property(l, path_stroke_color, path_set_stroke_color)), + ("strokeOverprint", property(l, path_stroke_overprint, path_set_stroke_overprint)), + ("strokeWidth", property(l, path_stroke_width, path_set_stroke_width)), + ("strokeCap", property(l, path_stroke_cap, path_set_stroke_cap)), + ("strokeJoin", property(l, path_stroke_join, path_set_stroke_join)), + ("strokeMiterLimit", property(l, path_miter, path_set_miter)), + ("strokeDashes", property(l, path_dashes, path_set_dashes)), + ("strokeDashOffset", property(l, path_dash_offset, path_set_dash_offset)), + ("translate", method(l, path_translate)), + ("rotate", method(l, path_rotate)), + ("resize", method(l, path_resize)), + ]); + m.extend(["selectedPathPoints", "polarity", "resolution"].into_iter().map(|n| later(l, "PathItem", n))); + m +} + +/// `PathItems`, `PathPoints` and `PathPoint`. +pub(super) fn classes(l: &Link) -> Vec { + vec![ + class( + "PathItems", + None, + named(vec![ + ("typename", typename_of("PathItems")), + ("length", get(l, items_length)), + ("parent", get(l, items_parent)), + ("index", method(l, items_index)), + ("getByName", method(l, items_by_name)), + ("removeAll", method(l, items_remove_all)), + ("add", method(l, items_add)), + ("rectangle", method(l, items_rectangle)), + ("roundedRectangle", method(l, items_rounded_rectangle)), + ("ellipse", method(l, items_ellipse)), + ("polygon", method(l, items_polygon)), + ("star", method(l, items_star)), + ]), + Some(super::function(l, items_at)), + ), + class( + "PathPoints", + None, + named(vec![ + ("typename", typename_of("PathPoints")), + ("length", get(l, points_length)), + ("parent", get(l, points_parent)), + ("index", method(l, points_index)), + ("add", method(l, points_add)), + ("removeAll", method(l, points_remove_all)), + ]), + Some(super::function(l, points_at)), + ), + class( + "PathPoint", + None, + { + let mut m = named(vec![ + ("typename", typename_of("PathPoint")), + ("parent", get(l, pt_parent)), + ("anchor", property(l, pt_anchor, pt_set_anchor)), + ("leftDirection", property(l, pt_left, pt_set_left)), + ("rightDirection", property(l, pt_right, pt_set_right)), + ("pointType", property(l, pt_type, pt_set_type)), + ("remove", method(l, pt_remove)), + ]); + m.push(later(l, "PathPoint", "selected")); + m + }, + None, + ), + ] +} diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index adcaefd59d..a611da1857 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -173,6 +173,7 @@ mod script_console; mod script_dialogs; mod script_dollar; mod script_dom; +mod script_dom_paths; mod script_engines; mod script_folder; mod script_include; diff --git a/crates/engine/src/tests/script_dom.rs b/crates/engine/src/tests/script_dom.rs index 67bd373e2d..fc2cd6ce67 100644 --- a/crates/engine/src/tests/script_dom.rs +++ b/crates/engine/src/tests/script_dom.rs @@ -646,9 +646,11 @@ fn a_startup_preset_alone_gives_its_first_size() { #[test] fn page_item_members_not_built_yet_throw_on_read_and_assignment() { let (mut s, _, _) = doc(); - for source in - ["app.activeDocument.pageItems[0].blendingMode;", "app.activeDocument.pageItems[0].uuid = 'x';", "app.activeDocument.pageItems[0].rotate(5);"] - { + for source in [ + "app.activeDocument.pageItems[0].blendingMode;", + "app.activeDocument.pageItems[0].uuid = 'x';", + "app.activeDocument.pageItems[0].transform(5);", + ] { assert!(failure(&mut s, source).contains("is not available yet"), "{source}"); } assert!(failure(&mut s, "app.activeDocument.layers = 1;").contains("Document.layers is not available yet")); diff --git a/crates/engine/src/tests/script_dom_paths.rs b/crates/engine/src/tests/script_dom_paths.rs new file mode 100644 index 0000000000..9d9c0c5f7a --- /dev/null +++ b/crates/engine/src/tests/script_dom_paths.rs @@ -0,0 +1,602 @@ +//! The script object model's paths, path points and colors. + +use serde_json::{Value, json}; +use vectorcraft_color::{Color, Paint}; +use vectorcraft_doc::{LineCap, LineJoin}; +use vectorcraft_geom::path::AnchorKind; + +use crate::*; + +fn run(s: &mut Session, source: &str) -> Result { + s.execute("script.run", &json!({"source": source, "name": "t.js"})) +} + +/// What the run logged. +fn log(s: &mut Session, source: &str) -> Vec { + let r = run(s, source).unwrap_or_else(|e| panic!("{source}: {e}")); + r["log"].as_array().cloned().unwrap_or_default() +} + +/// The message of the run's failure. +fn failure(s: &mut Session, source: &str) -> String { + run(s, source).map(|r| panic!("{source} ran: {r}")).unwrap_err().to_string() +} + +fn rect(s: &mut Session, x: f64, y: f64, w: f64, h: f64) -> NodeId { + NodeId(s.execute("shape.rectangle", &json!({"x": x, "y": y, "width": w, "height": h})).unwrap()["id"].as_u64().unwrap()) +} + +/// A 400 × 300 pt document with two rectangles. +fn doc() -> (Session, NodeId, NodeId) { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + let a = rect(&mut s, 10.0, 20.0, 30.0, 40.0); + let b = rect(&mut s, 100.0, 100.0, 50.0, 50.0); + s.execute("select.none", &json!({})).unwrap(); + (s, a, b) +} + +fn undo_steps(s: &Session) -> usize { + s.active().unwrap().history.undo.len() +} + +/// The layers of the active document, to show that a failed run changed nothing. +fn art(s: &Session) -> String { + format!("{:?}", s.active().unwrap().doc.layers) +} + +fn node(s: &Session, id: NodeId) -> crate::doc::Node { + s.active().unwrap().doc.node(id).unwrap().clone() +} + +/// Each number of `v` rounded to 3 decimals, in place. +fn rounded(v: &Value) -> Value { + match v { + Value::Number(n) => { + let r = (n.as_f64().unwrap() * 1000.0).round() / 1000.0; + if r.fract() == 0.0 { json!(r as i64) } else { json!(r) } + } + Value::Array(a) => Value::Array(a.iter().map(rounded).collect()), + v => v.clone(), + } +} + +#[test] +fn path_items_are_live_and_list_only_paths() { + let (mut s, a, b) = doc(); + s.execute("object.setProps", &json!({"ids": [a.0], "name": "first"})).unwrap(); + s.execute("text.create", &json!({"x": 10, "y": 250, "text": "hi"})).unwrap(); + s.execute("select.set", &json!({"ids": [b.0]})).unwrap(); + s.execute("object.group", &json!({})).unwrap(); + s.execute("select.none", &json!({})).unwrap(); + let out = log( + &mut s, + "var d = app.activeDocument, p = d.pathItems;\ + vc.log(p.length); vc.log(d.pageItems.length); vc.log(p.typename); vc.log(p.parent.typename);\ + vc.log(p[0].typename); vc.log(p[1].parent.typename); vc.log(p.getByName('first').name);\ + vc.log(p[2] === undefined && p[-1] === undefined);\ + var r = p.rectangle(100, 10, 5, 5); vc.log(p.length); vc.log(p[2].typename);", + ); + let expected = [json!(2), json!(4), json!("PathItems"), json!("Document"), json!("PathItem"), json!("GroupItem"), json!("first"), json!(true)]; + assert_eq!(out[..8], expected); + assert_eq!(out[8..], [json!(3), json!("PathItem")]); + assert!(failure(&mut s, "app.activeDocument.pathItems.getByName('none');").contains("Not found")); + assert!(failure(&mut s, "app.activeDocument.pathItems.index('none');").contains("Not found")); +} + +#[test] +fn path_items_remove_all_refuses_locked_paths_and_changes_nothing() { + let (mut s, a, _) = doc(); + s.execute("object.setProps", &json!({"ids": [a.0], "locked": true})).unwrap(); + let before = art(&s); + let e = failure(&mut s, "app.activeDocument.pathItems.removeAll();"); + assert!(e.contains("hidden or locked paths"), "{e}"); + assert_eq!(art(&s), before); + s.execute("object.setProps", &json!({"ids": [a.0], "locked": false})).unwrap(); + log(&mut s, "app.activeDocument.pathItems.removeAll();"); + assert_eq!(log(&mut s, "vc.log(app.activeDocument.pathItems.length);"), vec![json!(0)]); +} + +#[test] +fn shape_creators_use_documented_defaults_and_y_up() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + let steps = undo_steps(&s); + let out = log( + &mut s, + "var p = app.activeDocument.pathItems;\ + vc.log(p.rectangle(250, 10, 30, 40).geometricBounds);\ + vc.log(p.ellipse().geometricBounds);\ + var g = p.polygon(); vc.log(g.pathPoints.length); var b = g.geometricBounds; vc.log([(b[0] + b[2]) / 2, b[1]]);\ + vc.log(p.star().pathPoints.length); vc.log(p.star(0, 0, 10, 5, 7).pathPoints.length);\ + var r = p.roundedRectangle(250, 10, 100, 60); vc.log(r.pathPoints.length); vc.log(r.geometricBounds); vc.log(r.closed);\ + vc.log(p.roundedRectangle(250, 10, 100, 60, 0, 0).pathPoints.length);\ + vc.log(p.length);", + ); + let out: Vec = out.iter().map(rounded).collect(); + assert_eq!(out[0], json!([10, 250, 40, 210])); + assert_eq!(out[1], json!([100, 100, 150, 0])); + assert_eq!(out[2], json!(8)); + assert_eq!(out[3], json!([200, 350]), "the polygon is centered on (200, 300) and reaches 50 pt up"); + assert_eq!(out[4], json!(10)); + assert_eq!(out[5], json!(14)); + assert_eq!(out[6], json!(8)); + assert_eq!(out[7], json!([10, 250, 110, 190])); + assert_eq!(out[8], json!(true)); + assert_eq!(out[9], json!(4), "corners of radius 0 leave four points"); + assert_eq!(out[10], json!(7)); + assert_eq!(undo_steps(&s), steps + 1, "one undo step for the run"); + assert!(s.active().unwrap().selection.objects.is_empty(), "the selection stays as it was"); +} + +#[test] +fn shape_creators_reject_bad_sizes_without_change() { + let (mut s, _, _) = doc(); + let before = art(&s); + let steps = undo_steps(&s); + for (source, part) in [ + ("app.activeDocument.pathItems.rectangle(10, 10, -5, 10);", "width"), + ("app.activeDocument.pathItems.rectangle(10, 10, 5);", "height"), + ("app.activeDocument.pathItems.rectangle();", "top"), + ("app.activeDocument.pathItems.ellipse(0, 0, NaN);", "finite"), + ("app.activeDocument.pathItems.polygon(0, 0, 10, 2);", "sides"), + ("app.activeDocument.pathItems.polygon(0, 0, 10, 5.5);", "sides"), + ("app.activeDocument.pathItems.star(0, 0, 10, 5, 1001);", "points"), + ("app.activeDocument.pathItems.star(0, 0, 10, -5);", "innerRadius"), + ("app.activeDocument.pathItems.roundedRectangle(0, 0, 10, 10, -1);", "horizontalRadius"), + ("app.activeDocument.pathItems.rectangle(0, 0, 10, 10, 'yes');", "reversed"), + ("app.activeDocument.pathItems.rectangle(1e12, 0, 10, 10);", "outside the canvas"), + ] { + let e = failure(&mut s, source); + assert!(e.contains(part), "{source}: {e}"); + } + assert_eq!(art(&s), before); + assert_eq!(undo_steps(&s), steps); +} + +#[test] +fn set_entire_path_replaces_points_and_keeps_closed() { + let (mut s, a, _) = doc(); + let out = log( + &mut s, + "var p = app.activeDocument.pathItems[0];\ + p.setEntirePath([[0, 0], [10, 0], [10, 10]]); vc.log(p.pathPoints.length); vc.log(p.closed); vc.log(p.pathPoints[2].anchor);\ + var n = app.activeDocument.pathItems.add(); vc.log(n.pathPoints.length); vc.log(n.closed);\ + n.setEntirePath([[50, 50], [60, 50]]); vc.log(n.pathPoints.length); vc.log(n.closed); vc.log(n.length);\ + n.closed = true; vc.log(n.closed);", + ); + assert_eq!(out, vec![json!(3), json!(true), json!([10, 10]), json!(0), json!(false), json!(2), json!(false), json!(10), json!(true)]); + let n = node(&s, a); + let pd = n.path_data().unwrap(); + assert_eq!(pd.subpaths.len(), 1); + assert!(pd.subpaths[0].closed); + assert!(pd.subpaths[0].anchors.iter().all(|an| an.h_in == an.p && an.h_out == an.p && an.kind == AnchorKind::Corner)); +} + +#[test] +fn hostile_set_entire_path_input_is_bounded() { + let (mut s, _, _) = doc(); + let before = art(&s); + for (source, part) in [ + ("var a = []; for (var i = 0; i < 100001; i++) a.push([i % 100, 1]); app.activeDocument.pathItems[0].setEntirePath(a);", "at most"), + ("app.activeDocument.pathItems[0].setEntirePath([[0, 0], [NaN, 1]]);", "finite"), + ("app.activeDocument.pathItems[0].setEntirePath([[0, 0], [1]]);", "two numbers"), + ("app.activeDocument.pathItems[0].setEntirePath('0,0');", "array"), + ("app.activeDocument.pathItems[0].setEntirePath([[0, 1e13]]);", "outside the canvas"), + ( + "var o = {}; Object.defineProperty(o, 0, {get: function () { return 1; }}); app.activeDocument.pathItems[0].setEntirePath([o]);", + "two numbers", + ), + ] { + let e = failure(&mut s, source); + assert!(e.contains(part), "{source}: {e}"); + } + assert_eq!(art(&s), before); +} + +#[test] +fn path_point_setters_edit_one_anchor() { + let (mut s, a, _) = doc(); + let anchors_before = node(&s, a).path_data().unwrap().subpaths[0].anchors.to_vec(); + let out = log( + &mut s, + "var pp = app.activeDocument.pathItems[0].pathPoints, q = pp[1];\ + vc.log(pp.length); vc.log(pp.typename); vc.log(q.typename); vc.log(q.parent.typename); vc.log(q.anchor);\ + q.anchor = [45, 285]; vc.log(q.anchor); vc.log(q.leftDirection); vc.log(q.rightDirection);\ + q.rightDirection = [55, 285]; q.leftDirection = [35, 285]; vc.log(q.pointType);\ + q.pointType = PointType.SMOOTH; vc.log(q.pointType); q.pointType = PointType.CORNER; vc.log(q.pointType);\ + vc.log(pp.index(1).anchor);", + ); + assert_eq!(out[0], json!(4)); + assert_eq!(out[1], json!("PathPoints")); + assert_eq!(out[2], json!("PathPoint")); + assert_eq!(out[3], json!("PathItem")); + assert_eq!(out[5], json!([45, 285])); + assert_eq!(out[6], json!([40, 280]), "moving the anchor leaves its handles"); + assert_eq!(out[8], json!("PointType.CORNER"), "moving handles leaves the point type"); + assert_eq!(out[9], json!("PointType.SMOOTH")); + assert_eq!(out[10], json!("PointType.CORNER"), "a corner with handles in line stays a corner"); + assert_eq!(out[11], json!([45, 285])); + let anchors = node(&s, a).path_data().unwrap().subpaths[0].anchors.to_vec(); + for i in [0, 2, 3] { + assert_eq!(anchors[i], anchors_before[i], "point {i} did not change"); + } + assert!(failure(&mut s, "app.activeDocument.pathItems[0].pathPoints.index('a');").contains("Not found")); + assert!(failure(&mut s, "app.activeDocument.pathItems[0].pathPoints[0].pointType = 'SMOOTH';").contains("PointType")); + assert!(failure(&mut s, "app.activeDocument.pathItems[0].pathPoints[0].anchor = [1, 'x'];").contains("finite")); + assert_eq!(log(&mut s, "vc.log(app.activeDocument.pathItems[0].pathPoints.getByName === undefined);"), vec![json!(true)]); +} + +#[test] +fn path_point_wrapper_goes_stale_after_remove() { + let (mut s, _, _) = doc(); + let out = log( + &mut s, + "var p = app.activeDocument.pathItems[0], pp = p.pathPoints, last = pp[3];\ + pp[0].remove(); vc.log(pp.length); vc.log(pp[0].anchor);\ + try { last.anchor; } catch (e) { vc.log(e.message); } try { last.selected; } catch (e) { vc.log(e.message); }\ + var n = pp.add(); vc.log(pp.length); vc.log(n.anchor);\ + pp.removeAll(); vc.log(pp.length); vc.log(app.activeDocument.pathItems.length);\ + p.remove(); try { pp.length; } catch (e) { vc.log(e.message); } try { p.closed; } catch (e) { vc.log(e.message); }\ + try { p.polarity; } catch (e) { vc.log(e.message); }", + ); + assert_eq!( + out, + vec![ + json!(3), + json!([40, 280]), + json!("Stale path point"), + json!("Stale path point"), + json!(4), + json!([10, 240]), + json!(0), + json!(2), + json!("Stale page item"), + json!("Stale page item"), + json!("Stale page item") + ] + ); +} + +#[test] +fn fill_color_round_trips_rgb_cmyk_gray_lab() { + let (mut s, a, _) = doc(); + let out = log( + &mut s, + "var p = app.activeDocument.pathItems[0], c = new RGBColor(); vc.log(c.typename); vc.log([c.red, c.green, c.blue]);\ + c.red = 255; c.blue = 128; p.fillColor = c; var f = p.fillColor; vc.log([f.typename, f.red, f.green, f.blue]);\ + var k = new cmykColor(); k.cyan = 10; k.black = 50; p.strokeColor = k; var t = p.strokeColor; vc.log([t.typename, t.cyan, t.black]);\ + var g = new GrayColor(); g.gray = 25; p.fillColor = g; vc.log([p.fillColor.typename, p.fillColor.gray]);\ + var l = new LabColor(); l.l = 50; l.a = -20; l.b = 30; p.strokeColor = l; vc.log([p.strokeColor.l, p.strokeColor.a, p.strokeColor.b]);", + ); + assert_eq!(out[0], json!("RGBColor")); + assert_eq!(out[1], json!([0, 0, 0])); + assert_eq!(rounded(&out[2]), json!(["RGBColor", 255, 0, 128])); + assert_eq!(rounded(&out[3]), json!(["CMYKColor", 10, 50])); + assert_eq!(rounded(&out[4]), json!(["GrayColor", 25])); + assert_eq!(rounded(&out[5]), json!([50, -20, 30])); + let n = node(&s, a); + match n.appearance.fill_paint() { + Paint::Solid { color: Color::Gray { k }, .. } => assert!((k - 0.75).abs() < 1e-6, "gray 25 is 75% black ink, got {k}"), + p => panic!("fill is {p:?}"), + } +} + +#[test] +fn no_color_unfills_and_unstrokes() { + let (mut s, a, _) = doc(); + let out = log( + &mut s, + "var p = app.activeDocument.pathItems[0]; vc.log([p.filled, p.stroked]);\ + p.fillColor = new NoColor(); p.stroked = false; vc.log([p.filled, p.stroked, p.fillColor.typename]);\ + p.filled = true; vc.log(p.filled);", + ); + assert_eq!(out, vec![json!([true, true]), json!([false, false, "NoColor"]), json!(true)]); + let n = node(&s, a); + assert!(n.appearance.stroke_paint().is_none()); + assert!(!n.appearance.fill_paint().is_none()); +} + +#[test] +fn path_paint_edits_leave_new_art_and_recent_colors() { + let (mut s, _, _) = doc(); + let (paint, active, last, recent) = (s.paint.clone(), s.fill_active, s.last_solid, s.recent_colors.clone()); + log( + &mut s, + "var p = app.activeDocument.pathItems[0], c = new RGBColor(); c.red = 200; c.green = 10; c.blue = 30;\ + p.fillColor = c; p.strokeColor = c; p.strokeWidth = 7; p.strokeCap = StrokeCap.ROUNDENDCAP; p.filled = false;", + ); + assert_eq!(s.paint, paint, "the paint for new art"); + assert_eq!(s.fill_active, active); + assert_eq!(s.last_solid, last); + assert_eq!(s.recent_colors, recent); +} + +#[test] +fn compound_path_members_read_the_paint_they_are_given() { + let (mut s, a, b) = doc(); + s.execute("select.set", &json!({"ids": [a.0, b.0]})).unwrap(); + s.execute("object.compoundPath.make", &json!({})).unwrap(); + s.execute("select.none", &json!({})).unwrap(); + let out = log( + &mut s, + "var p = app.activeDocument.pathItems[0], c = new RGBColor(); c.red = 200; p.fillColor = c; p.strokeWidth = 4;\ + vc.log([p.fillColor.red, p.fillColor.green, p.strokeWidth]); vc.log(app.activeDocument.pathItems[1].fillColor.red);\ + p.evenodd = true; vc.log([p.evenodd, app.activeDocument.pathItems[1].evenodd]);", + ); + assert_eq!(rounded(&out[0]), json!([200, 0, 4])); + assert_eq!(rounded(&out[1]), json!(200), "the compound path paints every member"); + assert_eq!(out[2], json!([true, true]), "the compound path holds the fill rule"); +} + +#[test] +fn a_spot_color_reads_as_a_spot_color_and_keeps_its_link() { + let (mut s, a) = doc_with_paints(); + s.execute("paint.setFill", &json!({"ids": [a.0], "swatch": "Ink", "tint": 40})).unwrap(); + let before = node(&s, a).appearance.fill_paint(); + let out = log(&mut s, "var p = app.activeDocument.pathItems[0]; vc.log([p.fillColor.typename, p.fillColor.tint]);"); + assert_eq!(rounded(&out[0]), json!(["SpotColor", 40])); + assert!(failure(&mut s, "var p = app.activeDocument.pathItems[0]; p.fillColor = p.fillColor;").contains("SpotColor is not available yet")); + assert_eq!(node(&s, a).appearance.fill_paint(), before, "the fill stays linked to its swatch"); +} + +#[test] +fn filled_true_on_a_filled_path_runs_no_command() { + let (mut s, _, _) = doc(); + let steps = undo_steps(&s); + log( + &mut s, + "var p = app.activeDocument.pathItems[0]; p.filled = true; p.stroked = true; p.fillColor = p.fillColor;\ + p.strokeWidth = p.strokeWidth; p.strokeCap = p.strokeCap; p.closed = true; p.evenodd = false; p.strokeDashes = [];\ + p.pathPoints[0].anchor = p.pathPoints[0].anchor; p.translate(0, 0); p.rotate(360); p.resize(100, 100);", + ); + assert_eq!(undo_steps(&s), steps, "values that change nothing add no step"); +} + +#[test] +fn an_added_point_follows_the_last_point_before_an_empty_subpath() { + let (mut s, a, _) = doc(); + let subpaths = json!([{"anchors": [{"x": 10, "y": 20}, {"x": 40, "y": 20}], "closed": false}, {"anchors": [], "closed": false}]); + s.execute("path.setAnchors", &json!({"id": a.0, "subpaths": subpaths})).unwrap(); + assert!(node(&s, a).path_data().is_some_and(|pd| pd.subpaths.len() == 2), "the empty subpath is kept"); + let out = log( + &mut s, + "var pp = app.activeDocument.pathItems[0].pathPoints; var n = pp.add(); vc.log(pp.length); vc.log(n.anchor); vc.log(pp[1].anchor);", + ); + assert_eq!(out[0], json!(3)); + assert_eq!(out[1], out[2], "the new point is at the last point"); +} + +#[test] +fn transforms_change_the_path_and_not_the_selected_one() { + let (mut s, a, b) = doc(); + s.execute("select.set", &json!({"ids": [b.0]})).unwrap(); + let (before_a, before_b) = (node(&s, a).geometric_bounds(), node(&s, b).geometric_bounds()); + log(&mut s, "var p = app.activeDocument.pathItems[0]; p.translate(5, 0); p.rotate(90); p.resize(50, 50);"); + assert_ne!(node(&s, a).geometric_bounds(), before_a, "the path the script named changes"); + assert_eq!(node(&s, b).geometric_bounds(), before_b, "the selected path stays"); + assert_eq!(s.active().unwrap().selection.objects, [b], "the selection stays"); +} + +#[test] +fn an_added_path_takes_new_art_without_a_fill_or_stroke() { + let (mut s, _, _) = doc(); + s.execute("paint.setFill", &json!({"none": true})).unwrap(); + s.execute("paint.setStroke", &json!({"none": true})).unwrap(); + let unpainted = |s: &Session| { + let ap = s.new_art(); + matches!(ap.fill_paint(), Paint::None) && matches!(ap.stroke_paint(), Paint::None) + }; + assert!(unpainted(&s)); + let (steps, recent) = (undo_steps(&s), s.recent_colors.clone()); + let out = log(&mut s, "var n = app.activeDocument.pathItems.add(); vc.log(n.filled); vc.log(n.stroked); vc.log(n.pathPoints.length);"); + assert_eq!(out, [json!(false), json!(false), json!(0)]); + assert_eq!(undo_steps(&s), steps + 1, "one step for the run"); + assert!(unpainted(&s), "new art keeps no fill and no stroke"); + assert_eq!(s.recent_colors, recent); + s.execute("paint.setStroke", &json!({"color": "#ff0000"})).unwrap(); + let out = log(&mut s, "var n = app.activeDocument.pathItems.add(); vc.log(n.filled); vc.log(n.stroked); vc.log(n.strokeColor.red);"); + assert_eq!(out, [json!(false), json!(true), json!(255)], "a new-art stroke stays"); +} + +/// [`doc`] with pattern `Dots` and spot swatch `Ink`, and path `a` with no fill or stroke. +fn doc_with_paints() -> (Session, NodeId) { + let (mut s, a, _) = doc(); + let dot = rect(&mut s, 0.0, 0.0, 10.0, 10.0); + s.execute("object.pattern.make", &json!({"ids": [dot.0], "name": "Dots", "width": 20, "height": 20, "edit": false})).unwrap(); + s.execute("select.set", &json!({"ids": [dot.0]})).unwrap(); + s.execute("edit.clear", &json!({})).unwrap(); + s.execute("swatch.new", &json!({"name": "Ink", "color": "#2a6fb0", "spot": true})).unwrap(); + s.execute("paint.setFill", &json!({"ids": [a.0], "none": true})).unwrap(); + s.execute("paint.setStroke", &json!({"ids": [a.0], "none": true})).unwrap(); + s.execute("select.none", &json!({})).unwrap(); + (s, a) +} + +#[test] +fn filled_and_stroked_true_give_the_new_art_paint() { + let kinds = [ + json!({"color": "#00ff00"}), + json!({"swatch": "Ink", "tint": 40}), + json!({"gradient": {"kind": "radial", "stops": [{"offset": 0, "color": "#ff0000"}, {"offset": 1, "color": "#0000ff"}]}}), + json!({"swatch": "Dots"}), + ]; + for fill in [true, false] { + for params in &kinds { + let (mut s, a) = doc_with_paints(); + s.execute(if fill { "paint.setFill" } else { "paint.setStroke" }, params).unwrap(); + let new_art = s.new_art(); + let want = if fill { new_art.fill_paint() } else { new_art.stroke_paint() }; + assert!(!matches!(want, Paint::None), "{params}: new art takes the paint"); + log(&mut s, if fill { "app.activeDocument.pathItems[0].filled = true;" } else { "app.activeDocument.pathItems[0].stroked = true;" }); + let n = node(&s, a); + let got = if fill { n.appearance.fill_paint() } else { n.appearance.stroke_paint() }; + assert_eq!(crate::cmd::gradient::unplaced(&got), want, "fill {fill}, {params}"); + } + } +} + +#[test] +fn filled_true_throws_for_a_new_art_pattern_it_cannot_give() { + let placed = vectorcraft_color::Paint::Pattern { pattern: "Dots".into(), xf: vectorcraft_geom::Affine::scale(2.0) }; + for (paint, says) in [(placed, "placement of its own"), (vectorcraft_doc::pattern::pattern_paint("Gone"), "not in this document")] { + for fill in [true, false] { + let (mut s, _) = doc_with_paints(); + if fill { + s.paint.fill = paint.clone(); + } else { + (s.paint.stroke, s.paint.stroke_width) = (paint.clone(), 1.0); + } + let (before, steps) = (art(&s), undo_steps(&s)); + let e = failure( + &mut s, + if fill { "app.activeDocument.pathItems[0].filled = true;" } else { "app.activeDocument.pathItems[0].stroked = true;" }, + ); + assert!(e.contains(says), "{e}"); + assert_eq!((art(&s), undo_steps(&s)), (before, steps), "nothing changes"); + } + } +} + +#[test] +fn stroke_options_map_to_stroke_set() { + let (mut s, a, _) = doc(); + let out = log( + &mut s, + "var p = app.activeDocument.pathItems[0];\ + p.strokeWidth = 4; p.strokeCap = StrokeCap.ROUNDENDCAP; p.strokeJoin = StrokeJoin.BEVELENDJOIN; p.strokeMiterLimit = 7;\ + p.strokeDashes = [6, 3]; p.strokeDashOffset = 2; p.evenodd = true; p.fillOverprint = true;\ + vc.log([p.strokeWidth, p.strokeCap, p.strokeJoin, p.strokeMiterLimit, p.strokeDashes, p.strokeDashOffset, p.evenodd, p.fillOverprint]);\ + p.strokeDashes = {}; vc.log(p.strokeDashes);", + ); + assert_eq!(out[0], json!([4, "StrokeCap.ROUNDENDCAP", "StrokeJoin.BEVELENDJOIN", 7, [6, 3], 2, true, true])); + assert_eq!(out[1], json!([])); + let n = node(&s, a); + let st = n.appearance.stroke().unwrap(); + assert_eq!((st.width, st.cap, st.join, st.miter_limit, st.dash.is_none()), (4.0, LineCap::Round, LineJoin::Bevel, 7.0, true)); + for (source, part) in [ + ("app.activeDocument.pathItems[0].strokeMiterLimit = 600;", "strokeMiterLimit"), + ("app.activeDocument.pathItems[0].strokeCap = 'round';", "StrokeCap"), + ("app.activeDocument.pathItems[0].strokeJoin = StrokeCap.ROUNDENDCAP;", "StrokeJoin"), + ("app.activeDocument.pathItems[0].strokeWidth = -1;", "strokeWidth"), + ("app.activeDocument.pathItems[0].strokeDashes = [0, 0];", "not 0"), + ("app.activeDocument.pathItems[0].strokeDashes = [1, -2];", "dash length"), + ("var d = []; for (var i = 0; i < 65; i++) d.push(1); app.activeDocument.pathItems[0].strokeDashes = d;", "at most 64"), + ("app.activeDocument.pathItems[0].strokeDashOffset = 3;", "strokeDashes first"), + ] { + let e = failure(&mut s, source); + assert!(e.contains(part), "{source}: {e}"); + } +} + +#[test] +fn bad_color_components_throw_and_change_nothing() { + let (mut s, _, _) = doc(); + let before = art(&s); + for (source, part) in [ + ("var c = new RGBColor(); c.red = 300; app.activeDocument.pathItems[0].fillColor = c;", "RGBColor.red"), + ("var c = new CMYKColor(); c.cyan = NaN; app.activeDocument.pathItems[0].fillColor = c;", "finite"), + ("var c = new CMYKColor(); c.cyan = -1; app.activeDocument.pathItems[0].fillColor = c;", "CMYKColor.cyan"), + ("var c = new GrayColor(); c.gray = '5'; app.activeDocument.pathItems[0].fillColor = c;", "GrayColor.gray"), + ("var c = new LabColor(); c.a = 200; app.activeDocument.pathItems[0].strokeColor = c;", "LabColor.a"), + ("app.activeDocument.pathItems[0].fillColor = {typename: 'Foo'};", "color object"), + ("app.activeDocument.pathItems[0].fillColor = 5;", "color object"), + ("app.activeDocument.pathItems[0].fillColor = new GradientColor();", "not available yet"), + ("app.activeDocument.pathItems[0].strokeColor = new SpotColor();", "not available yet"), + ] { + let e = failure(&mut s, source); + assert!(e.contains(part), "{source}: {e}"); + } + assert_eq!(art(&s), before); +} + +#[test] +fn locked_paths_and_wrong_objects_are_refused() { + let (mut s, a, _) = doc(); + s.execute("object.setProps", &json!({"ids": [a.0], "locked": true})).unwrap(); + let before = art(&s); + for (source, part) in [ + ("app.activeDocument.pathItems[0].fillColor = new NoColor();", "Cannot edit PathItem"), + ("app.activeDocument.pathItems[0].setEntirePath([[0, 0], [1, 1]]);", "Cannot edit PathItem"), + ("app.activeDocument.pathItems[0].pathPoints[0].anchor = [1, 1];", "Cannot edit PathItem"), + ("app.activeDocument.pathItems[0].strokeWidth = 3;", "Cannot edit PathItem"), + ("app.activeDocument.pathItems[0].translate(5, 5);", "Cannot edit PathItem"), + ] { + let e = failure(&mut s, source); + assert!(e.contains(part), "{source}: {e}"); + } + assert_eq!(art(&s), before); + s.execute("text.create", &json!({"x": 10, "y": 250, "text": "hi"})).unwrap(); + let e = failure(&mut s, "var t = app.activeDocument.pageItems[2]; Object.getOwnPropertyDescriptor(PathItem.prototype, 'closed').get.call(t);"); + assert!(e.contains("not a PathItem"), "{e}"); + let e = failure(&mut s, "Object.getOwnPropertyDescriptor(PathPoint.prototype, 'anchor').get.call({});"); + assert!(e.contains("not a PathPoint"), "{e}"); +} + +#[test] +fn rotate_positive_is_counterclockwise_and_transforms_move_and_scale() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + let out = log( + &mut s, + "var n = app.activeDocument.pathItems.add(); n.setEntirePath([[100, 100], [110, 100]]);\ + n.rotate(90, true, true, true, true, Transformation.LEFT); vc.log(n.pathPoints[1].anchor);\ + n.translate(5, 10); vc.log(n.pathPoints[0].anchor);\ + var r = app.activeDocument.pathItems.rectangle(250, 10, 30, 40); r.strokeWidth = 2;\ + r.resize(200, 50, true, true, true, true, 300, Transformation.TOPLEFT); vc.log(r.geometricBounds); vc.log(r.strokeWidth);", + ); + let out: Vec = out.iter().map(rounded).collect(); + assert_eq!(out[0], json!([100, 110]), "a positive angle turns counterclockwise"); + assert_eq!(out[1], json!([105, 110]), "translate moves up for a positive deltaY"); + assert_eq!(out[2], json!([10, 250, 70, 230])); + assert_eq!(out[3], json!(6)); + assert!(failure(&mut s, "app.activeDocument.pathItems[0].rotate(10, true, true, true, true, 'CENTER');").contains("Transformation")); + assert!(failure(&mut s, "app.activeDocument.pathItems[0].resize(0, 100);").contains("scaleX")); + assert!(failure(&mut s, "app.activeDocument.pathItems[0].translate(1, 2, 'no');").contains("changePositions")); + let before = art(&s); + for (source, part) in [ + ("app.activeDocument.pathItems[0].translate(1, 2, true, true, false);", "changeFillGradients false"), + ("app.activeDocument.pathItems[0].rotate(10, true, true, true, false);", "must be the same"), + ("app.activeDocument.pathItems.ellipse(10, 10, 5, 5, false, true);", "inscribed"), + ( + "var ps = app.activeDocument.pathItems;\ + for (var i = 0; i < ps.length; i++) { if (ps[i].strokeWidth == 6) ps[i].resize(150, 100, true, true, true, true, 20000); }", + "more than 1000 points", + ), + ] { + let e = failure(&mut s, source); + assert!(e.contains(part), "{source}: {e}"); + } + assert_eq!(art(&s), before); +} + +#[test] +fn area_sign_follows_direction() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + let out = log( + &mut s, + "var n = app.activeDocument.pathItems.add(); n.setEntirePath([[0, 0], [10, 0], [10, 10], [0, 10]]); n.closed = true;\ + vc.log(n.area); vc.log(n.length);\ + var r = app.activeDocument.pathItems.rectangle(100, 0, 10, 10), q = app.activeDocument.pathItems.rectangle(100, 0, 10, 10, true);\ + vc.log(r.area + q.area); vc.log(Math.abs(r.area));", + ); + let out: Vec = out.iter().map(rounded).collect(); + assert_eq!(out, vec![json!(-100), json!(40), json!(0), json!(100)]); +} + +#[test] +fn many_path_edits_are_one_undo_step() { + let (mut s, a, b) = doc(); + let steps = undo_steps(&s); + log( + &mut s, + "var p = app.activeDocument.pathItems, c = new RGBColor(); c.green = 200;\ + for (var i = 0; i < p.length; i++) { p[i].fillColor = c; p[i].strokeWidth = 3; p[i].pathPoints[0].anchor = [0, 0]; }", + ); + assert_eq!(undo_steps(&s), steps + 1); + s.execute("edit.undo", &json!({})).unwrap(); + for id in [a, b] { + assert!((node(&s, id).appearance.stroke_width() - 1.0).abs() < 1e-9); + } +} diff --git a/crates/engine/tests/it/script_host_vs_scriptcheck.rs b/crates/engine/tests/it/script_host_vs_scriptcheck.rs index ef7c97e951..828a97f585 100644 --- a/crates/engine/tests/it/script_host_vs_scriptcheck.rs +++ b/crates/engine/tests/it/script_host_vs_scriptcheck.rs @@ -75,7 +75,8 @@ const INSIDE: &[(&str, &str)] = &[ "", "app Application CoordinateSystem Document DocumentArtboardLayout DocumentColorSpace DocumentPresetType \ DocumentPreviewMode DocumentRasterResolution DocumentTransparencyGrid Documents ElementPlacement Layer PageItem \ - PageItems RulerUnits ZOrderMethod", + PageItems PathItem PathItems PathPoint PathPointSelection PathPoints PointType PolarityValues RulerUnits StrokeCap \ + StrokeJoin Transformation ZOrderMethod", ), ("Application.", "prototype"), ( @@ -89,7 +90,7 @@ const INSIDE: &[(&str, &str)] = &[ ( "Document.prototype.", "activeLayer activeLayer= artboards artboards= close close= constructor convertCoordinate documentColorSpace \ - groupItems groupItems= height layers layers= name pageItems parent pathItems pathItems= rulerOrigin rulerOrigin= \ + groupItems groupItems= height layers layers= name pageItems parent pathItems rulerOrigin rulerOrigin= \ rulerUnits saveAs saveAs= selection selection= swatches swatches= symbols symbols= textFrames textFrames= typename \ views views= width", ), @@ -107,6 +108,25 @@ const INSIDE: &[(&str, &str)] = &[ transform= translate translate= typename uRL uRL= uuid uuid= visibilityVariable visibilityVariable= visibleBounds \ width width= wrapInside wrapInside= wrapOffset wrapOffset= wrapped wrapped= zOrder zOrderPosition", ), + ("PathItems.", "prototype"), + ("PathItems.prototype.", "add constructor ellipse getByName index length parent polygon rectangle removeAll roundedRectangle star typename"), + ("PathItem.", "prototype"), + ( + "PathItem.prototype.", + "area clipping closed closed= constructor evenodd evenodd= fillColor fillColor= fillOverprint fillOverprint= filled \ + filled= guides length pathPoints polarity polarity= resize resolution resolution= rotate selectedPathPoints \ + selectedPathPoints= setEntirePath strokeCap strokeCap= strokeColor strokeColor= strokeDashOffset strokeDashOffset= \ + strokeDashes strokeDashes= strokeJoin strokeJoin= strokeMiterLimit strokeMiterLimit= strokeOverprint strokeOverprint= \ + strokeWidth strokeWidth= stroked stroked= translate", + ), + ("PathPoints.", "prototype"), + ("PathPoints.prototype.", "add constructor index length parent removeAll typename"), + ("PathPoint.", "prototype"), + ( + "PathPoint.prototype.", + "anchor anchor= constructor leftDirection leftDirection= parent pointType pointType= remove rightDirection \ + rightDirection= selected selected= typename", + ), ("CoordinateSystem.", "ARTBOARDCOORDINATESYSTEM DOCUMENTCOORDINATESYSTEM"), ("DocumentArtboardLayout.", "Column GridByCol GridByRow RLGridByCol RLGridByRow RLRow Row"), ("DocumentColorSpace.", "CMYK RGB"), @@ -119,14 +139,21 @@ const INSIDE: &[(&str, &str)] = &[ TransparencyGridNone TransparencyGridOrange TransparencyGridPurple TransparencyGridRed", ), ("ElementPlacement.", "INSIDE PLACEAFTER PLACEATBEGINNING PLACEATEND PLACEBEFORE"), + ("PathPointSelection.", "ANCHORPOINT LEFTDIRECTION LEFTRIGHTPOINT NOSELECTION RIGHTDIRECTION"), + ("PointType.", "CORNER SMOOTH"), + ("PolarityValues.", "NEGATIVE POSITIVE"), ("RulerUnits.", "Centimeters Inches Millimeters Picas Pixels Points Qs Unknown"), + ("StrokeCap.", "BUTTENDCAP PROJECTINGENDCAP ROUNDENDCAP"), + ("StrokeJoin.", "BEVELENDJOIN MITERENDJOIN ROUNDENDJOIN"), + ("Transformation.", "BOTTOM BOTTOMLEFT BOTTOMRIGHT CENTER DOCUMENTORIGIN LEFT RIGHT TOP TOPLEFT TOPRIGHT"), ("ZOrderMethod.", "BRINGFORWARD BRINGTOFRONT SENDBACKWARD SENDTOBACK"), ]; -/// The classes the host adds with nothing but a prototype and its constructor: `DocumentPreset` -/// and the page item types. -const BARE_CLASSES: &str = "BlendItem CompoundPathItem DocumentPreset EnvelopeItem GraphItem GroupItem IntertwineItem MeshItem PathItem \ - PlacedDocumentItem PlacedItem RasterItem RepeatItem SymbolItem TextFrame"; +/// The classes the host adds with nothing but a prototype and its constructor: `DocumentPreset`, +/// the page item types other than `PathItem`, and the color classes. +const BARE_CLASSES: &str = "BlendItem CMYKColor CompoundPathItem DocumentPreset EnvelopeItem GradientColor GraphItem GrayColor GroupItem \ + IntertwineItem LabColor MeshItem NoColor PatternColor PlacedDocumentItem PlacedItem RGBColor RasterItem RepeatItem SpotColor \ + SymbolItem TextFrame cmykColor"; /// The name the checker does not read, which also stands for its members: `vc` is VectorCraft's /// own API, and what `vc.run` does depends on the command it runs. diff --git a/docs/mcp.md b/docs/mcp.md index c305916f6f..44d375ae2c 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2675,7 +2675,55 @@ app through the global object `vc`, and writes to the Script Console and runs ot Document and PageItem pages list, such as `Document.layers`, `PageItem.blendingMode`, `PageItem.rotate` and `app.beep`, throw an error that says they are not available yet when they are read or assigned. Other members those pages list, such as `app.version` and `Document.save()`, and the members of the pages of the page-item kinds - themselves, such as a path's fill, are not defined yet and read as `undefined`. + themselves, such as a text frame's `contents`, are not defined yet and read as `undefined`. +- `Document.pathItems` (https://ai-scripting.docsforadobe.dev/jsobjref/PathItems/) lists the document's paths in the + order of `pageItems`, paths inside groups and compound paths included, with `length`, `[i]`, `index(key)`, + `getByName(name)`, `removeAll()`, `add()` (a path with no points, from `path.create`, painted as new art; when new + art has no fill and no stroke, the path has neither), and the shape creators + `rectangle(top, left, width, height, reversed?)`, `roundedRectangle(top, left, width, height, horizontalRadius = 15, + verticalRadius = 20, reversed?)`, `ellipse(top = 100, left = 100, width = 50, height = 100, reversed?, inscribed?)`, + `polygon(centerX = 200, centerY = 300, radius = 50, sides = 8, reversed?)` and `star(centerX = 200, centerY = 300, + radius = 50, innerRadius = 20, points = 5, reversed?)`, which run `shape.rectangle`, `path.create`, + `shape.ellipse`, `shape.polygon` and `shape.star` (and `path.reverse` for `reversed`) and paint the new path as new + art is painted. A `PathItem` (https://ai-scripting.docsforadobe.dev/jsobjref/PathItem/) adds to the page item + members `pathPoints`, `closed`, `evenodd`, `area` (negative for a path that runs counterclockwise), `length`, + `guides`, `clipping`, `setEntirePath(points)`, `filled`, `fillColor`, `fillOverprint`, `stroked`, `strokeColor`, + `strokeOverprint`, `strokeWidth`, `strokeCap`, `strokeJoin`, `strokeMiterLimit` (1 to 500), `strokeDashes`, + `strokeDashOffset`, `translate(deltaX?, deltaY?, ...)`, `rotate(angle, ..., rotateAbout?)` (counterclockwise for a + positive angle) and `resize(scaleX, scaleY, ..., changeLineWidths?, scaleAbout?)`. The geometry changes through + `path.setAnchors`, the fill and stroke through `paint.setFill` and `paint.setStroke`, the stroke options through + `stroke.set`, the fill rule through `path.setFillRule`, overprint through `object.setOverprint` and the transforms + through `object.move`, `object.rotate` and `object.scale`. `pathPoints` + (https://ai-scripting.docsforadobe.dev/jsobjref/PathPoints/) has `length`, `[i]`, `index(i)`, `add()` and + `removeAll()`, and each `PathPoint` (https://ai-scripting.docsforadobe.dev/jsobjref/PathPoint/) has `anchor`, + `leftDirection` (the handle into the point), `rightDirection` (the handle out of it), `pointType`, `parent` and + `remove()`. `new RGBColor()` (0 to 255), `new CMYKColor()` (0 to 100), `new GrayColor()` (0 to 100, 0 black and 100 + white, as https://ai-scripting.docsforadobe.dev/jsobjref/GrayColor/ gives it), `new LabColor()` and `new NoColor()` + (https://ai-scripting.docsforadobe.dev/jsobjref/NoColor/) make plain color objects; assigning a `NoColor` removes + the fill or stroke. The enumerations `PointType`, `PathPointSelection`, `StrokeCap`, `StrokeJoin`, `PolarityValues` + and `Transformation` hold strings such as `"StrokeCap.ROUNDENDCAP"`. + VectorCraft's own rules: a point's index counts across the path's subpaths; `closed` is true when every subpath is + closed, and assigning it opens or closes them all; `setEntirePath` takes at most 100,000 points and gives corner + points with no handles, keeping the path closed when it was; moving `anchor` leaves its handles where they are, and + `pointType` changes only the type; `PathPoints.add()` adds a corner point at the last point, or at `[0, 0]`; a point + whose index is past the end of its path throws `Stale path point`. Color components left out count as 0, `new + cmykColor()` makes a `CMYKColor`, `LabColor.l` is 0 to 100 and `a` and `b` are -128 to 128, and a component out of + range throws a `RangeError` when the color is assigned, with nothing changed. Reading `fillColor` or `strokeColor` + gives a new object each time, a `GradientColor`, `SpotColor` or `PatternColor` among them (a color linked to a + global or spot swatch reads as a `SpotColor` with its `tint`); assigning one of those throws an error that says it is not available yet. `filled = true` on a path without a fill gives it the fill new + art gets (a color, gradient or pattern), or black when new art has none, and `stroked = true` does the same with the + stroke; a new-art pattern with a placement of its own, or one missing from the document, throws an error. Sizes and + radii are finite and not negative, `sides` is a whole number from 3 to 1000, `points` one from 2 to 1000, + `strokeWidth` 0 to 1000 points (a `changeLineWidths` that would scale it past 1000 throws), `strokeDashes` at most + 64 lengths that are not all 0 (`[]` or `{}` for a solid line), and `rotateAbout` and `scaleAbout` default to + `Transformation.CENTER`. The transforms take one setting for fill and stroke patterns, so `changeFillPatterns` and + `changeStrokePattern` given as different values throw an error, and `changeFillGradients` false and `ellipse` with + `inscribed` true throw an error that says they are not available yet. A change to the geometry or paint of a path + that is hidden or locked, or that is in a hidden or locked layer or group, throws `Cannot edit` with nothing + changed. A path in a compound path or compound shape reads the fill, stroke and overprint of that compound path or + shape, which the paint commands paint in its place. A change to a path's paint or stroke leaves the paint for new + art, the active Fill or Stroke proxy and Recent Colors as they were. `selectedPathPoints`, `PathPoint.selected`, + `transform`, `polarity`, the gradient stops and the document's default paint are not available yet. - `$.write(...values)` writes the values to the Script Console with no separator, each as `String(value)` gives it, and `$.writeln(...values)` does the same and ends the line. Each call counts as a host call. - `$.evalFile(path, timeout?)` runs the file `path` names, relative to the file being run, in the same global diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 3b252b56a6..81abb83e94 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1024,7 +1024,8 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Synthetic input validates complete gestures before queue mutation: at most 256 drag steps, 16 clicks and 1,024 pending events; up to 64 control requests per frame, with later requests retained for the next frame (#1709). - The control server writes each reply through a 64 KiB buffer. On Windows 11 it sends the 17 MB `document.inspect` reply of a document with 50,000 objects on one layer to a client over loopback in 0.09 s instead of 34 s. - Scripts: File › Scripts › Other Script… and `script.run` run a JavaScript file against the open documents as one transaction with one undo step for each changed document. A failed or stopped run puts every document back. `crates/engine/src/tests/script_run.rs`. - - Scripts: the global `app` gives the open documents, new documents from a startup preset and a `DocumentPreset`, the active document, each document's selection and its page items with their names, notes, visibility, lock, opacity, position, size, bounds and stacking order, and moves and copies them into or beside other objects, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/Application/, https://ai-scripting.docsforadobe.dev/jsobjref/Documents/, https://ai-scripting.docsforadobe.dev/jsobjref/DocumentPreset/, https://ai-scripting.docsforadobe.dev/jsobjref/Document/, https://ai-scripting.docsforadobe.dev/jsobjref/PageItems/, https://ai-scripting.docsforadobe.dev/jsobjref/PageItem/ and https://ai-scripting.docsforadobe.dev/jsobjref/GroupItem/ describe them; each change runs a command inside the run's transaction (`docs/mcp.md`). Layers, paths, type and the other classes are not there yet. `crates/engine/src/tests/script_dom.rs`. + - Scripts: the global `app` gives the open documents, new documents from a startup preset and a `DocumentPreset`, the active document, each document's selection and its page items with their names, notes, visibility, lock, opacity, position, size, bounds and stacking order, and moves and copies them into or beside other objects, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/Application/, https://ai-scripting.docsforadobe.dev/jsobjref/Documents/, https://ai-scripting.docsforadobe.dev/jsobjref/DocumentPreset/, https://ai-scripting.docsforadobe.dev/jsobjref/Document/, https://ai-scripting.docsforadobe.dev/jsobjref/PageItems/, https://ai-scripting.docsforadobe.dev/jsobjref/PageItem/ and https://ai-scripting.docsforadobe.dev/jsobjref/GroupItem/ describe them; each change runs a command inside the run's transaction (`docs/mcp.md`). Layers, type and the other classes are not there yet. `crates/engine/src/tests/script_dom.rs`. + - Scripts: `Document.pathItems` lists the paths and makes rectangles, rounded rectangles, ellipses, polygons, stars and empty paths with the defaults the help page https://ai-scripting.docsforadobe.dev/jsobjref/PathItems/ gives; each path's points, closed state, fill rule, area, length, fill and stroke colors, stroke options and transforms read and change as https://ai-scripting.docsforadobe.dev/jsobjref/PathItem/, https://ai-scripting.docsforadobe.dev/jsobjref/PathPoints/ and https://ai-scripting.docsforadobe.dev/jsobjref/PathPoint/ describe them, and `RGBColor`, `CMYKColor`, `GrayColor`, `LabColor` and `NoColor` make colors (`docs/mcp.md`). Gradient stops and the document's default paint are not there yet. `crates/engine/src/tests/script_dom_paths.rs`. - Scripts: Window › Script Console shows each run's `$.write` and `$.writeln` output, `vc.log` entries, uncaught error with the script's name, line and column, and a report of its time, host calls and slowest commands, keeping at most 2,048 lines and counting the lines it dropped. `script.run`'s report carries the same data, and `script.console`, `script.console.clear` and `ui.copyScriptConsole` read, clear and copy it. `crates/engine/src/tests/script_console.rs`. - Scripts: the status bar translates its own words around a failed run's error and the app's own error messages, and shows text the script threw itself (a value, an error it made, or an error whose name or message it changed) as it is, even when that text reads like one of the app's messages. `script.run`'s report gives `messageOrigin` (`script` or `built-in`), and the advice about objects other applications give their scripts follows only the app's own reference errors. VectorCraft's own rule. `crates/js/src/interp_tests.rs`, `crates/engine/src/tests/script_run.rs`, `crates/ui-egui/src/chrome/tests.rs`. - Scripts: the `$` object has the other members the Dollar object page lists (https://extendscript.docsforadobe.dev/extendscript-tools-features/dollar-object/), from `$.about()` to `$.version`, and scripts have the global `localize(object, ...values)` (https://extendscript.docsforadobe.dev/extendscript-tools-features/localizing-extendscript-strings/), `toSource(value)` and `Object.prototype.toSource()`. Each run starts with the interface's locale, and what a script changes in `$` lasts only for that run. `crates/engine/src/tests/script_dollar.rs`, `crates/js/src/extension_tests.rs`. From 55f615d0c92ae33ecd0ab754806a4efc5889e5d8 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 21 Nov 2026 13:32:25 -0800 Subject: [PATCH 02/61] Scripts: write path point edits with one command, keep colors exact - Changes to a path's points (closed, setEntirePath, pathPoints and each PathPoint) wait in the object model and are written by one path.setAnchors before any other member or command, before another path's points change, and when the script ends. A loop over 2,000 points now runs one command and makes one undo step. A path aligned to the pixel grid is written at each change so its points read snapped. - A color component reads with the fewest decimals, at least 4, that give the stored value back, so assigning a color read from a path leaves the path unchanged (RGB, CMYK, Gray and Lab, fill and stroke). - add() and the shape creators put the new path on top of the active layer whatever the drawing mode, and leave the mode as it was. - fillOverprint and strokeOverprint change the top fill or stroke only. - filled = true on a compound path member places the new-art gradient on the compound path's bounds. - An identity rotate or resize checks its arguments and runs no command, on an empty path too. - Tests for each of these, and for setAnchors reading smooth false as a corner. Docs: docs/mcp.md, docs/gaps.md, docs/roadmap.md, docs/target-app-parity.md. --- crates/engine/src/script/dom.rs | 39 ++- crates/engine/src/script/dom/colors.rs | 21 +- crates/engine/src/script/dom/paths.rs | 288 +++++++++++++------- crates/engine/src/script/mod.rs | 24 +- crates/engine/src/tests/script_dom_paths.rs | 220 ++++++++++++++- docs/gaps.md | 7 +- docs/mcp.md | 21 +- docs/roadmap.md | 2 +- docs/target-app-parity.md | 2 +- 9 files changed, 504 insertions(+), 120 deletions(-) diff --git a/crates/engine/src/script/dom.rs b/crates/engine/src/script/dom.rs index 03b236c0e1..c33b3cd47f 100644 --- a/crates/engine/src/script/dom.rs +++ b/crates/engine/src/script/dom.rs @@ -88,14 +88,17 @@ const DOCUMENT_COORDS: &str = "CoordinateSystem.DOCUMENTCOORDINATESYSTEM"; const ARTBOARD_COORDS: &str = "CoordinateSystem.ARTBOARDCOORDINATESYSTEM"; /// What the object model keeps for one run: its coordinate system, the last list of a document's -/// page items, kept while that document is unchanged, and whether a call's own savepoint -/// ([`atomically`]) is open. +/// page items, kept while that document is unchanged, the point changes of a path not written yet, +/// and whether a call's own savepoint ([`atomically`]) is open. #[derive(Default)] pub(super) struct State { coords: Cell, items: RefCell>, /// The last list of a document's paths ([`paths`]), kept while that document is unchanged. paths: RefCell>, + /// A path and its subpaths with the point changes the run has made to it and not written yet + /// ([`flush`]). + pending: RefCell)>>, saving: Cell, } @@ -134,15 +137,34 @@ type Answer = std::result::Result; /// A member function: the run's host and the call's arguments, `this` first. type Member = fn(&Host, &[Data]) -> Answer; +/// A member function that first writes the point changes waiting in [`State`] ([`flush`]). fn function(link: &Link, f: Member) -> HostFunction { + call(link, f, true) +} + +/// A member function of the points of a path, which reads and adds to the point changes waiting in +/// [`State`] instead of writing them first. +fn point_function(link: &Link, f: Member) -> HostFunction { + call(link, f, false) +} + +fn call(link: &Link, f: Member, flushing: bool) -> HostFunction { let l = link.clone(); Rc::new(move |a: Vec| { let h = current(&l)?; h.charge_call(16 + a.iter().map(data_size).sum::())?; + if flushing { + flush(&h)?; + } f(&h, &a) }) } +/// Writes the point changes of a path that wait in [`State`] with one command ([`paths::flush`]). +pub(super) fn flush(h: &Host) -> std::result::Result<(), HostError> { + paths::flush(h) +} + fn get(link: &Link, f: Member) -> HostMember { HostMember::Get(function(link, f)) } @@ -155,6 +177,19 @@ fn method(link: &Link, f: Member) -> HostMember { HostMember::Method(function(link, f)) } +/// [`get`], [`property`] and [`method`] for a member of the points of a path ([`point_function`]). +fn point_get(link: &Link, f: Member) -> HostMember { + HostMember::Get(point_function(link, f)) +} + +fn point_property(link: &Link, g: Member, s: Member) -> HostMember { + HostMember::Property { get: point_function(link, g), set: point_function(link, s) } +} + +fn point_method(link: &Link, f: Member) -> HostMember { + HostMember::Method(point_function(link, f)) +} + /// A member the help pages list that is not available yet: reading or assigning it throws, after /// the check that a document, page item or path point `this` is still there. fn later(link: &Link, class: &'static str, name: &'static str) -> (String, HostMember) { diff --git a/crates/engine/src/script/dom/colors.rs b/crates/engine/src/script/dom/colors.rs index 40421c5d38..34c1496054 100644 --- a/crates/engine/src/script/dom/colors.rs +++ b/crates/engine/src/script/dom/colors.rs @@ -45,9 +45,24 @@ fn color_object(class: &str, values: &[(&str, f64)]) -> Data { Data::Object(items) } -/// A component as the script sees it: `v` times `scale`, rounded to 4 decimals. +/// A component as the script sees it: `exact` rounded to the fewest decimals, from 4 to 9, that +/// `back` turns into the stored `v` again, else `exact` itself, so that assigning a color read +/// from an object gives that object the same color. +fn shown_as(exact: f64, v: f32, back: impl Fn(f64) -> f32) -> f64 { + let mut scale = 1e4; + for _ in 4..=9 { + let r = (exact * scale).round() / scale; + if back(r) == v { + return r; + } + scale *= 10.0; + } + exact +} + +/// A component stored as `v`, from 0 to 1, that the script sees times `scale`. fn shown(v: f32, scale: f64) -> f64 { - (f64::from(v) * scale * 1e4).round() / 1e4 + shown_as(f64::from(v) * scale, v, |r| unit(r, scale)) } /// The color object for a solid color. @@ -58,7 +73,7 @@ fn of_color(c: &Color) -> Data { "CMYKColor", &[("cyan", shown(c, 100.0)), ("magenta", shown(m, 100.0)), ("yellow", shown(y, 100.0)), ("black", shown(k, 100.0))], ), - Color::Gray { k } => color_object("GrayColor", &[("gray", shown(1.0 - k, 100.0))]), + Color::Gray { k } => color_object("GrayColor", &[("gray", shown_as((1.0 - f64::from(k)) * 100.0, k, |g| unit(100.0 - g, 100.0)))]), Color::Lab { l, a, b } => color_object("LabColor", &[("l", shown(l, 1.0)), ("a", shown(a, 1.0)), ("b", shown(b, 1.0))]), } } diff --git a/crates/engine/src/script/dom/paths.rs b/crates/engine/src/script/dom/paths.rs index ac643ce370..29b0c909be 100644 --- a/crates/engine/src/script/dom/paths.rs +++ b/crates/engine/src/script/dom/paths.rs @@ -6,8 +6,10 @@ //! //! A `PathPoints` object holds its path's handle, and a `PathPoint` the path's handle and the //! point's index, counted across the path's subpaths in order. Each read looks the path up again. -//! Every change runs one command (`path.setAnchors` for the geometry), inside the run's one undo -//! step, and a change that changes nothing runs no command. +//! Every change runs one command inside the run's one undo step, and a change that changes nothing +//! runs no command. Changes to the points of one path wait in the run's [`super::State`] and are +//! written together with one `path.setAnchors` ([`flush`]) before any other member, command or +//! path's points are read or changed, and when the script ends. //! //! VectorCraft's own rules, which the help pages do not state: //! - `Document.pathItems` lists the document's paths in the order of `pageItems`, paths inside @@ -15,12 +17,14 @@ //! - A change to the geometry or paint of a path that is hidden or locked, or that is in a hidden //! or locked layer or group, throws `Cannot edit` with nothing changed. //! - A path in a compound path or compound shape reads that owner's paint, which the paint -//! commands change in its place. A paint or stroke change leaves the paint for new art, the -//! active proxy and the recent colors as they were. +//! commands change in its place, and a gradient that `filled = true` gives it is placed on that +//! owner's bounds. A paint or stroke change leaves the paint for new art, the active proxy and +//! the recent colors as they were. `fillOverprint` and `strokeOverprint` read and change the top +//! fill or stroke only. //! - `closed` is true when every subpath of the path is closed, and assigning it opens or closes //! them all. -//! - `pathItems.add()` makes a path with no points on top of the active layer, painted as new art -//! is. `filled` and `stroked` set to true give a path with no fill or stroke new art's fill or +//! - `pathItems.add()` and the shape creators make their path on top of the active layer, whatever +//! the drawing mode, painted as new art is; `add()` makes a path with no points. `filled` and `stroked` set to true give a path with no fill or stroke new art's fill or //! stroke (solid, gradient or pattern), or black when new art has none. `PathPoints.add()` adds //! a corner point with no handles at the last point, or at `[0, 0]` on a path with no points. //! Removing the last points leaves the path, with no points. @@ -28,7 +32,8 @@ //! - Shape creators take sizes and radii that are finite and not negative; `sides` is a whole //! number from 3 to 1000 and `points` one from 2 to 1000. `inscribed` true throws an error that //! says it is not available yet. `rotateAbout` and `scaleAbout` default to -//! `Transformation.CENTER`. +//! `Transformation.CENTER`. A transform that leaves the path where it is (`rotate(360)`, +//! `resize(100, 100)`) checks its arguments and runs no command, on a path with no points too. //! - The transforms take one setting for fill and stroke patterns, so `changeFillPatterns` and //! `changeStrokePattern` given as different values throw an error; gradients move with the art, //! so `changeFillGradients` false throws an error that says it is not available yet. @@ -46,8 +51,8 @@ use vectorcraft_tools::params::gradient_params; use super::{ Answer, Coords, Doc, Item, Link, NOT_FOUND, STALE_ITEM, arg, boolean, class, colors, command, coordinate, doc_of, edit_item, editable, find_doc, - float, frame, get, given, handle_of, id_of, id_parts, item_of, item_rect, later, method, named, num, number, on_doc, pair, point, property, - this_doc, typename_of, whole, with_doc, + float, frame, get, given, handle_of, id_of, id_parts, item_of, item_rect, later, method, named, num, number, on_doc, pair, point, point_get, + point_method, point_property, property, this_doc, typename_of, whole, with_doc, }; use crate::{DocState, NodeId, NodeKind}; @@ -117,14 +122,14 @@ fn path_ref(h: &super::Host, item: Item) -> Data { host_ref("PathItem", &[float(h.run), float(item.doc.uid), high, low]) } -/// How many points a path has, across its subpaths. -fn point_count(pd: &PathData) -> usize { - pd.subpaths.iter().map(|sp| sp.anchors.len()).sum() +/// How many points a path with the subpaths `subs` has. +fn point_count(subs: &[SubPath]) -> usize { + subs.iter().map(|sp| sp.anchors.len()).sum() } -/// The subpath and the place in it of point `i`. -fn locate(pd: &PathData, mut i: usize) -> Option<(usize, usize)> { - for (s, sp) in pd.subpaths.iter().enumerate() { +/// The subpath and the place in it of point `i`, among the subpaths `subs`. +fn locate(subs: &[SubPath], mut i: usize) -> Option<(usize, usize)> { + for (s, sp) in subs.iter().enumerate() { if i < sp.anchors.len() { return Some((s, i)); } @@ -137,14 +142,69 @@ fn anchor_json(a: &Anchor) -> Value { json!({"x": a.p.x, "y": a.p.y, "in": [a.h_in.x, a.h_in.y], "out": [a.h_out.x, a.h_out.y], "smooth": a.kind == AnchorKind::Smooth}) } -/// Gives the path of `item` the subpaths `subs` with `path.setAnchors`, unless it has them. -fn write_path(h: &super::Host, item: Item, subs: Vec) -> std::result::Result<(), HostError> { - let (same, ok) = read_path(h, item, |st, _, pd| (pd.subpaths == subs, editable(&st.doc, item.id)))?; - if same { - return Ok(()); +fn same_path(a: Item, b: Item) -> bool { + a.doc.uid == b.doc.uid && a.id == b.id +} + +/// Reads the subpaths of the path of `item` with `f`, its waiting point changes included. +fn read_points(h: &super::Host, item: Item, f: impl FnOnce(&[SubPath]) -> T) -> std::result::Result { + if let Some((waiting, subs)) = &*h.dom.pending.borrow() + && same_path(*waiting, item) + { + return Ok(f(subs)); } - if !ok { - return Err(cannot_edit(item.id)); + read_path(h, item, |_, _, pd| f(&pd.subpaths)) +} + +/// Changes the subpaths of the path of `item` with `f`. The change waits in [`super::State`] with +/// the path's other point changes until [`flush`] writes them. The first change of a path writes +/// the waiting changes of another path first, and throws `Cannot edit` when the path is hidden or +/// locked, unless it changes nothing. A path that is aligned to the pixel grid, or is in an object +/// that is, is written at once, so that its points read as the grid snaps them. +fn edit_points(h: &super::Host, item: Item, f: impl FnOnce(&mut Vec) -> T) -> std::result::Result { + if let Some((waiting, subs)) = &mut *h.dom.pending.borrow_mut() + && same_path(*waiting, item) + { + return Ok(f(subs)); + } + flush(h)?; + let mut subs = read_path(h, item, |_, _, pd| pd.subpaths.clone())?; + let r = f(&mut subs); + let (same, ok, aligned) = read_path(h, item, |st, _, pd| { + let d = &st.doc; + let aligned = d.ancestry(item.id).is_some_and(|a| a.iter().chain([&item.id]).any(|i| d.node(*i).is_some_and(|n| n.extras().pixel_aligned))); + (pd.subpaths == subs, editable(d, item.id), aligned) + })?; + if !same { + if !ok { + return Err(cannot_edit(item.id)); + } + *h.dom.pending.borrow_mut() = Some((item, subs)); + if aligned { + flush(h)?; + } + } + Ok(r) +} + +/// Gives the path of `item` the subpaths `subs` ([`edit_points`]). +fn write_path(h: &super::Host, item: Item, subs: Vec) -> std::result::Result<(), HostError> { + edit_points(h, item, |s| *s = subs) +} + +/// Writes the waiting point changes of a path ([`edit_points`]) with one `path.setAnchors`, unless +/// the path has those points already. +pub(super) fn flush(h: &super::Host) -> std::result::Result<(), HostError> { + let Some((item, subs)) = h.dom.pending.borrow_mut().take() else { return Ok(()) }; + let same = { + let s = h.session.borrow(); + let node = s.documents().iter().find(|d| d.uid == item.doc.uid).and_then(|st| st.doc.node(item.id)); + node.and_then(|n| n.path_data()).map(|pd| pd.subpaths == subs) + }; + match same { + Some(true) => return Ok(()), + Some(false) => {} + None => return Err(HostError::Error(STALE_ITEM.into())), } let subpaths: Vec = subs.iter().map(|sp| json!({"anchors": sp.anchors.iter().map(anchor_json).collect::>(), "closed": sp.closed})).collect(); @@ -152,7 +212,23 @@ fn write_path(h: &super::Host, item: Item, subs: Vec) -> std::result::R Ok(()) } -/// Runs `id` with `params` and `ids: [item]` on the item, which must be one the user could edit. +/// The object whose paint the path `n` with id `id` shows: its compound path or compound shape +/// when it is a member of one, since the paint commands paint that owner in its place. +fn paint_owner<'a>(d: &'a crate::Document, id: NodeId, n: &'a crate::doc::Node) -> &'a crate::doc::Node { + d.parent_of(id).and_then(|p| d.node(p)).filter(|p| matches!(p.kind, NodeKind::Compound { .. }) || p.is_compound_shape()).unwrap_or(n) +} + +/// Runs `f` with the drawing mode set to normal, so that the paths it makes go on top of the active +/// layer, then puts the drawing mode back. +fn drawing_normally(h: &super::Host, f: impl FnOnce() -> T) -> T { + let kept = std::mem::replace(&mut h.session.borrow_mut().draw_mode, crate::DrawMode::Normal); + let r = f(); + h.session.borrow_mut().draw_mode = kept; + r +} + +/// Runs `id` with `params` and `ids: [item]` (unless `params` names its `ids`) on the item, which +/// must be one the user could edit. /// The paint for new art, the active Fill or Stroke proxy, the last color and gradient and the /// recent colors, which `paint.setFill`, `paint.setStroke` and `stroke.set` also set, are put /// back afterwards, so the edit changes only the path. @@ -162,7 +238,7 @@ fn edit_path(h: &super::Host, item: Item, id: &str, mut params: Value) -> std::r return Err(cannot_edit(item.id)); } if let Some(o) = params.as_object_mut() { - o.insert("ids".into(), json!([item.id.0])); + o.entry("ids").or_insert_with(|| json!([item.id.0])); } keeping_paint(h, || edit_item(h, item, id, ¶ms)) } @@ -273,11 +349,11 @@ fn made_id(r: &Data) -> std::result::Result { id.map(NodeId).ok_or_else(|| HostError::Error("the path was not made".into())) } -/// Runs the command `id` that makes a path in `doc`, the selection kept, and reverses the new -/// path's direction when `reversed`. → the new path. +/// Runs the command `id` that makes a path in `doc` on top of the active layer, the selection kept, +/// and reverses the new path's direction when `reversed`. → the new path. fn make(h: &super::Host, doc: Doc, id: &str, params: &Value, reversed: bool) -> Answer { let made = on_doc(h, doc.uid, true, |h| { - let id = made_id(&command(h, id, params)?)?; + let id = made_id(&drawing_normally(h, || command(h, id, params))?)?; if reversed { command(h, "path.reverse", &json!({"ids": [id.0]}))?; } @@ -426,8 +502,8 @@ fn items_star(h: &super::Host, a: &[Data]) -> Answer { make(h, doc, "shape.star", &json!({"cx": c.x, "cy": c.y, "radius1": r1, "radius2": r2, "points": points}), reversed) } -/// `pathItems.add()`: a path with no points, from `path.create` with empty path data, painted as -/// new art. When new art has no fill and no stroke, the black stroke `path.create` gives an open +/// `pathItems.add()`: a path with no points on top of the active layer, from `path.create` with +/// empty path data, painted as new art. When new art has no fill and no stroke, the black stroke `path.create` gives an open /// path is set back to none in the same step. fn items_add(h: &super::Host, a: &[Data]) -> Answer { let doc = items_doc(h, a)?; @@ -436,7 +512,7 @@ fn items_add(h: &super::Host, a: &[Data]) -> Answer { let ap = h.session.borrow().new_art(); ap.fill_paint().is_none() && ap.stroke_paint().is_none() }; - let id = made_id(&command(h, "path.create", &json!({"d": ""}))?)?; + let id = made_id(&drawing_normally(h, || command(h, "path.create", &json!({"d": ""})))?)?; if unpainted { keeping_paint(h, || command(h, "paint.setStroke", &json!({"none": true, "ids": [id.0]})))?; } @@ -457,14 +533,13 @@ fn path_points(h: &super::Host, a: &[Data]) -> Answer { fn path_closed(h: &super::Host, a: &[Data]) -> Answer { let item = this_path(h, a)?; - read_path(h, item, |_, _, pd| Data::Bool(!pd.subpaths.is_empty() && pd.subpaths.iter().all(|sp| sp.closed))) + read_points(h, item, |subs| Data::Bool(!subs.is_empty() && subs.iter().all(|sp| sp.closed))) } fn path_set_closed(h: &super::Host, a: &[Data]) -> Answer { let closed = boolean(arg(a, 1), "closed")?; let item = this_path(h, a)?; - let subs = read_path(h, item, |_, _, pd| pd.subpaths.iter().map(|sp| SubPath { anchors: sp.anchors.clone(), closed }).collect())?; - write_path(h, item, subs)?; + edit_points(h, item, |subs| subs.iter_mut().for_each(|sp| sp.closed = closed))?; Ok(Data::Undefined) } @@ -517,8 +592,9 @@ fn path_set_entire(h: &super::Host, a: &[Data]) -> Answer { return Err(HostError::Range(format!("setEntirePath takes at most {MAX_POINTS} points"))); } let script: Vec<[f64; 2]> = list.iter().map(|d| point(d, "each point")).collect::>()?; - let (f, closed) = read_path(h, item, |st, _, pd| (frame(st), !pd.subpaths.is_empty() && pd.subpaths.iter().all(|sp| sp.closed)))?; - let (f, c) = (f?, h.dom.coords.get()); + let f = with_doc(h, item.doc, |_, st| frame(st))?; + let closed = read_points(h, item, |subs| !subs.is_empty() && subs.iter().all(|sp| sp.closed))?; + let c = h.dom.coords.get(); let anchors: Vec = script.iter().map(|p| Anchor::corner(f.to_document(c, *p))).collect(); let subs = if anchors.is_empty() { Vec::new() } else { vec![SubPath::new(anchors, closed)] }; write_path(h, item, subs)?; @@ -546,13 +622,7 @@ struct Look { /// since the paint commands paint that owner in its place. fn look(h: &super::Host, item: Item) -> std::result::Result { read_path(h, item, |st, n, _| { - let d = &st.doc; - let owner = d - .parent_of(item.id) - .and_then(|p| d.node(p)) - .filter(|p| matches!(p.kind, NodeKind::Compound { .. }) || p.is_compound_shape()) - .unwrap_or(n); - let ap = &owner.appearance; + let ap = &paint_owner(&st.doc, item.id, n).appearance; let fill = ap.fill(); let stroke = ap.stroke(); Look { @@ -597,7 +667,8 @@ fn set_paint(h: &super::Host, item: Item, fill: bool, color: Option) -> s /// The paint new art gets for its fill or stroke, as `paint.setFill` or `paint.setStroke` params for /// the path `item`: a solid color, linked to its global or spot swatch while the document has that -/// swatch; a gradient, a placed one moved onto the path's bounds as new art takes it; or a pattern. +/// swatch; a gradient, a placed one moved onto the bounds of the path or of the compound path or +/// compound shape whose paint it shows, as new art takes it; or a pattern. /// A fill or stroke of none gives black. A pattern that its swatch does not give as new art has it /// (its own placement, or a pattern the document does not have) throws an error. fn new_art_params(h: &super::Host, item: Item, fill: bool) -> std::result::Result { @@ -619,7 +690,7 @@ fn new_art_params(h: &super::Host, item: Item, fill: bool) -> std::result::Resul Paint::Gradient(g) => { let mut g = g.clone(); if g.geom.is_some() || g.freeform.is_some() { - match read_path(h, item, |_, n, _| n.geometric_bounds())? { + match read_path(h, item, |st, n, _| paint_owner(&st.doc, item.id, n).geometric_bounds())? { Some(b) => { ap.rebase_gradients(GraphicStyle::UNIT_BOX, b); if let Paint::Gradient(placed) = top(&ap) { @@ -827,10 +898,15 @@ fn set_overprint(h: &super::Host, a: &[Data], fill: bool) -> Answer { let (item, look) = this_look(h, a)?; let (now, paint) = if fill { (look.fill_overprint, &look.fill) } else { (look.stroke_overprint, &look.stroke) }; if now != on { - if paint.is_none() { + // The top fill or stroke of the object `look` reads, as `item` names it to the command. + let top = read_path(h, item, |st, n, _| { + let owner = paint_owner(&st.doc, item.id, n); + owner.appearance.items.iter().rposition(|i| i.is_fill() == fill).map(|index| (owner.id, index)) + })?; + let (Some((owner, index)), false) = (top, paint.is_none()) else { return Err(HostError::Error(format!("the path has no {key} to overprint"))); - } - edit_path(h, item, "object.setOverprint", json!({key: on}))?; + }; + edit_path(h, item, "object.setOverprint", json!({key: on, "item": index, "ids": [owner.0]}))?; } Ok(Data::Undefined) } @@ -845,16 +921,23 @@ fn path_set_stroke_overprint(h: &super::Host, a: &[Data]) -> Answer { // ---- PathItem transforms ---- -/// The point of the path's geometric bounds `r`, in document coordinates, that a `Transformation` -/// value names (left out: the center). -fn about(h: &super::Host, item: Item, d: &Data, r: Rect) -> std::result::Result { +/// The member of `Transformation` that `d` names (left out: `CENTER`). +fn about_name(d: &Data) -> std::result::Result<&'static str, HostError> { let name = match d { Data::Undefined => "Transformation.CENTER", Data::String(s) => s.as_str(), _ => return Err(HostError::Type("give a Transformation value".into())), }; + let members = ENUMS.iter().find(|(e, _)| *e == "Transformation").map_or(&[][..], |(_, m)| *m); + let member = name.strip_prefix("Transformation.").and_then(|m| members.iter().find(|x| **x == m)); + member.copied().ok_or_else(|| HostError::Type("give a Transformation value".into())) +} + +/// The point of the path's geometric bounds `r`, in document coordinates, that the `Transformation` +/// member `name` ([`about_name`]) names. +fn about(h: &super::Host, item: Item, name: &str, r: Rect) -> std::result::Result { let (cx, cy) = ((r.x0 + r.x1) / 2.0, (r.y0 + r.y1) / 2.0); - Ok(match name.strip_prefix("Transformation.").unwrap_or("") { + Ok(match name { "CENTER" => Point::new(cx, cy), "TOP" => Point::new(cx, r.y0), "BOTTOM" => Point::new(cx, r.y1), @@ -914,11 +997,13 @@ fn path_translate(h: &super::Host, a: &[Data]) -> Answer { fn path_rotate(h: &super::Host, a: &[Data]) -> Answer { let angle = number(arg(a, 1), "angle")?; let item = this_path(h, a)?; - let (r, _) = item_rect(h, item, false)?; - let origin = about(h, item, arg(a, 6), r)?; - let mut params = json!({"angle": angle, "origin": [origin.x, origin.y]}); + let place = about_name(arg(a, 6))?; + let mut params = json!({"angle": angle}); transform_options(a, 2, &mut params)?; if angle.rem_euclid(360.0) != 0.0 { + let (r, _) = item_rect(h, item, false)?; + let origin = about(h, item, place, r)?; + params["origin"] = json!([origin.x, origin.y]); edit_path(h, item, "object.rotate", params)?; } Ok(Data::Undefined) @@ -937,9 +1022,8 @@ fn path_resize(h: &super::Host, a: &[Data]) -> Answer { return Err(HostError::Range("changeLineWidths must be from 0 to 100000 percent".into())); } let item = this_path(h, a)?; - let (r, _) = item_rect(h, item, false)?; - let origin = about(h, item, arg(a, 8), r)?; - let mut params = json!({"sx": sx, "sy": sy, "origin": [origin.x, origin.y], "basis": "page", "strokes": false}); + let place = about_name(arg(a, 8))?; + let mut params = json!({"sx": sx, "sy": sy, "basis": "page", "strokes": false}); transform_options(a, 3, &mut params)?; let width = look(h, item)?.width; let new_width = widths.map(|w| width * w / 100.0); @@ -947,6 +1031,9 @@ fn path_resize(h: &super::Host, a: &[Data]) -> Answer { return Err(HostError::Range("changeLineWidths would make the stroke weight more than 1000 points".into())); } if sx != 100.0 || sy != 100.0 { + let (r, _) = item_rect(h, item, false)?; + let origin = about(h, item, place, r)?; + params["origin"] = json!([origin.x, origin.y]); edit_path(h, item, "object.scale", params)?; } if let Some(w) = new_width @@ -967,7 +1054,7 @@ fn points_path(h: &super::Host, a: &[Data]) -> std::result::Result Answer { let item = points_path(h, a)?; - read_path(h, item, |_, _, pd| num(float(point_count(pd) as u64))) + read_points(h, item, |subs| num(float(point_count(subs) as u64))) } fn points_parent(h: &super::Host, a: &[Data]) -> Answer { @@ -984,7 +1071,7 @@ fn points_at(h: &super::Host, a: &[Data]) -> Answer { let item = points_path(h, a)?; let Data::Number(n) = arg(a, 1) else { return Ok(Data::Undefined) }; let Some(i) = whole(*n).and_then(|i| usize::try_from(i).ok()) else { return Ok(Data::Undefined) }; - let n = read_path(h, item, |_, _, pd| point_count(pd))?; + let n = read_points(h, item, point_count)?; Ok(if i < n { point_ref(h, item, i) } else { Data::Undefined }) } @@ -1001,22 +1088,19 @@ fn points_index(h: &super::Host, a: &[Data]) -> Answer { fn points_add(h: &super::Host, a: &[Data]) -> Answer { let item = points_path(h, a)?; - let (mut subs, n, origin) = read_path(h, item, |st, _, pd| { - let origin = frame(st).map(|f| f.to_document(h.dom.coords.get(), [0.0, 0.0])); - (pd.subpaths.clone(), point_count(pd), origin) - })?; + let origin = with_doc(h, item.doc, |_, st| frame(st).map(|f| f.to_document(h.dom.coords.get(), [0.0, 0.0]))); + let (n, last) = read_points(h, item, |subs| (point_count(subs), subs.iter().rev().find_map(|sp| sp.anchors.last()).map(|a| a.p)))?; if n >= MAX_POINTS { return Err(HostError::Range(format!("PathPoints.add takes a path to at most {MAX_POINTS} points"))); } - let p = match subs.iter().rev().find_map(|sp| sp.anchors.last()) { - Some(last) => last.p, + let p = match last { + Some(p) => p, None => origin?, }; - match subs.last_mut() { + edit_points(h, item, |subs| match subs.last_mut() { Some(sp) => sp.anchors.push(Anchor::corner(p)), None => subs.push(SubPath::new(vec![Anchor::corner(p)], false)), - } - write_path(h, item, subs)?; + })?; Ok(point_ref(h, item, n)) } @@ -1034,7 +1118,7 @@ pub(super) fn this_point(h: &super::Host, a: &[Data]) -> std::result::Result<(It let [run, uid, high, low, i] = handle.as_slice() else { return Err(HostError::Type("this is not a PathPoint".into())) }; let item = path_at(h, *run, *uid, *high, *low)?; let i = whole(*i).and_then(|i| usize::try_from(i).ok()).ok_or_else(|| HostError::Error(STALE_POINT.into()))?; - let n = read_path(h, item, |_, _, pd| point_count(pd))?; + let n = read_points(h, item, point_count)?; if i >= n { return Err(HostError::Error(STALE_POINT.into())); } @@ -1045,9 +1129,9 @@ pub(super) fn this_point(h: &super::Host, a: &[Data]) -> std::result::Result<(It fn read_point(h: &super::Host, a: &[Data], f: impl FnOnce(&super::Frame, Coords, &Anchor) -> Data) -> Answer { let (item, i) = this_point(h, a)?; let c = h.dom.coords.get(); - read_path(h, item, |st, _, pd| { - let fr = frame(st)?; - let anchor = locate(pd, i).and_then(|(s, j)| pd.subpaths.get(s).and_then(|sp| sp.anchors.get(j))); + let fr = with_doc(h, item.doc, |_, st| frame(st))?; + read_points(h, item, |subs| { + let anchor = locate(subs, i).and_then(|(s, j)| subs.get(s).and_then(|sp| sp.anchors.get(j))); anchor.map(|an| f(&fr, c, an)).ok_or_else(|| HostError::Error(STALE_POINT.into())) })? } @@ -1056,12 +1140,13 @@ fn read_point(h: &super::Host, a: &[Data], f: impl FnOnce(&super::Frame, Coords, /// coordinates (for a point property) or the value itself. fn edit_point(h: &super::Host, a: &[Data], f: impl FnOnce(&mut Anchor)) -> Answer { let (item, i) = this_point(h, a)?; - let mut subs = read_path(h, item, |_, _, pd| pd.subpaths.clone())?; - let (s, j) = read_path(h, item, |_, _, pd| locate(pd, i))?.ok_or_else(|| HostError::Error(STALE_POINT.into()))?; - if let Some(an) = subs.get_mut(s).and_then(|sp| sp.anchors.get_mut(j)) { - f(an); - } - write_path(h, item, subs)?; + edit_points(h, item, |subs| { + if let Some((s, j)) = locate(subs, i) + && let Some(an) = subs.get_mut(s).and_then(|sp| sp.anchors.get_mut(j)) + { + f(an); + } + })?; Ok(Data::Undefined) } @@ -1121,15 +1206,16 @@ fn pt_parent(h: &super::Host, a: &[Data]) -> Answer { /// `remove()`: deletes the point; a subpath left with no points goes too. fn pt_remove(h: &super::Host, a: &[Data]) -> Answer { let (item, i) = this_point(h, a)?; - let mut subs = read_path(h, item, |_, _, pd| pd.subpaths.clone())?; - let (s, j) = read_path(h, item, |_, _, pd| locate(pd, i))?.ok_or_else(|| HostError::Error(STALE_POINT.into()))?; - if let Some(sp) = subs.get_mut(s) { - sp.anchors.remove(j); - if sp.anchors.is_empty() { - subs.remove(s); + edit_points(h, item, |subs| { + if let Some((s, j)) = locate(subs, i) + && let Some(sp) = subs.get_mut(s) + { + sp.anchors.remove(j); + if sp.anchors.is_empty() { + subs.remove(s); + } } - } - write_path(h, item, subs)?; + })?; Ok(Data::Undefined) } @@ -1138,14 +1224,14 @@ fn pt_remove(h: &super::Host, a: &[Data]) -> Answer { /// The members `PathItem` adds to `PageItem`'s. pub(super) fn path_item_members(l: &Link) -> Vec<(String, HostMember)> { let mut m = named(vec![ - ("pathPoints", get(l, path_points)), - ("closed", property(l, path_closed, path_set_closed)), + ("pathPoints", point_get(l, path_points)), + ("closed", point_property(l, path_closed, path_set_closed)), ("evenodd", property(l, path_evenodd, path_set_evenodd)), ("area", get(l, path_area)), ("length", get(l, path_length)), ("guides", get(l, path_guides)), ("clipping", get(l, path_clipping)), - ("setEntirePath", method(l, path_set_entire)), + ("setEntirePath", point_method(l, path_set_entire)), ("filled", property(l, path_filled, path_set_filled)), ("fillColor", property(l, path_fill_color, path_set_fill_color)), ("fillOverprint", property(l, path_fill_overprint, path_set_fill_overprint)), @@ -1193,13 +1279,13 @@ pub(super) fn classes(l: &Link) -> Vec { None, named(vec![ ("typename", typename_of("PathPoints")), - ("length", get(l, points_length)), - ("parent", get(l, points_parent)), - ("index", method(l, points_index)), - ("add", method(l, points_add)), - ("removeAll", method(l, points_remove_all)), + ("length", point_get(l, points_length)), + ("parent", point_get(l, points_parent)), + ("index", point_method(l, points_index)), + ("add", point_method(l, points_add)), + ("removeAll", point_method(l, points_remove_all)), ]), - Some(super::function(l, points_at)), + Some(super::point_function(l, points_at)), ), class( "PathPoint", @@ -1207,12 +1293,12 @@ pub(super) fn classes(l: &Link) -> Vec { { let mut m = named(vec![ ("typename", typename_of("PathPoint")), - ("parent", get(l, pt_parent)), - ("anchor", property(l, pt_anchor, pt_set_anchor)), - ("leftDirection", property(l, pt_left, pt_set_left)), - ("rightDirection", property(l, pt_right, pt_set_right)), - ("pointType", property(l, pt_type, pt_set_type)), - ("remove", method(l, pt_remove)), + ("parent", point_get(l, pt_parent)), + ("anchor", point_property(l, pt_anchor, pt_set_anchor)), + ("leftDirection", point_property(l, pt_left, pt_set_left)), + ("rightDirection", point_property(l, pt_right, pt_set_right)), + ("pointType", point_property(l, pt_type, pt_set_type)), + ("remove", point_method(l, pt_remove)), ]); m.push(later(l, "PathPoint", "selected")); m diff --git a/crates/engine/src/script/mod.rs b/crates/engine/src/script/mod.rs index d228ff848f..37c4b8711d 100644 --- a/crates/engine/src/script/mod.rs +++ b/crates/engine/src/script/mod.rs @@ -1309,6 +1309,8 @@ fn command(host: &Host, id: &str, params: &Value) -> std::result::Result std::result::Result<(Data, Value), HostError> { + // Point changes that wait in the object model are written before any command runs. + dom::flush(host)?; let id = id.to_string(); let params = params.clone(); let session = host.session.clone(); @@ -1352,6 +1354,7 @@ fn command_value(host: &Host, id: &str, params: &Value) -> std::result::Result<( /// A bounded snapshot of the active document, or `null` with none open. A snapshot past the limits /// of a crossing throws a `RangeError`. fn vc_document(host: &Host) -> std::result::Result { + dom::flush(host)?; let s = host.session.borrow(); let Some(st) = s.active() else { return Ok(Data::Null) }; let ids: Vec = st.selection.objects.iter().take(1_000).map(|i| i.0).collect(); @@ -2472,6 +2475,7 @@ fn run_slice(s: &mut Session, job: &mut Job) -> std::result::Result std::result::Result std::result::Result RunError { + let message = match e { + HostError::Error(m) | HostError::Type(m) | HostError::Range(m) | HostError::Syntax(m) | HostError::Abort(m) => m, + HostError::Marked { error, .. } => return end_flush_error(*error), + HostError::Wait => "a host function waited for its result where the run cannot pause".into(), + }; + RunError { kind: RunErrorKind::Limit(LimitKind::Host), message, line: 0, column: 0, authored: false } +} + /// Tests: removes the session's running job while the session keeps its hold on it. → whether a /// job was removed. #[cfg(test)] diff --git a/crates/engine/src/tests/script_dom_paths.rs b/crates/engine/src/tests/script_dom_paths.rs index 9d9c0c5f7a..004c02f4fc 100644 --- a/crates/engine/src/tests/script_dom_paths.rs +++ b/crates/engine/src/tests/script_dom_paths.rs @@ -344,13 +344,229 @@ fn a_spot_color_reads_as_a_spot_color_and_keeps_its_link() { fn filled_true_on_a_filled_path_runs_no_command() { let (mut s, _, _) = doc(); let steps = undo_steps(&s); - log( + let r = run( &mut s, "var p = app.activeDocument.pathItems[0]; p.filled = true; p.stroked = true; p.fillColor = p.fillColor;\ p.strokeWidth = p.strokeWidth; p.strokeCap = p.strokeCap; p.closed = true; p.evenodd = false; p.strokeDashes = [];\ p.pathPoints[0].anchor = p.pathPoints[0].anchor; p.translate(0, 0); p.rotate(360); p.resize(100, 100);", - ); + ) + .unwrap(); assert_eq!(undo_steps(&s), steps, "values that change nothing add no step"); + assert_eq!(r["slowestCommands"], json!([]), "and run no command"); +} + +#[test] +fn identity_transforms_of_an_empty_path_do_nothing() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + log( + &mut s, + "var n = app.activeDocument.pathItems.add(); n.rotate(360); n.rotate(0, true, true, true, true, Transformation.TOPLEFT);\ + n.resize(100, 100); n.resize(100, 100, true, true, true, true, 100, Transformation.BOTTOM); n.translate(0, 0);", + ); + for source in [ + "app.activeDocument.pathItems[0].rotate(360, true, true, true, true, 'CENTER');", + "app.activeDocument.pathItems[0].resize(100, 100, true, true, true, true, 100, 'x');", + ] { + assert!(failure(&mut s, source).contains("Transformation"), "{source}"); + } +} + +/// The paint of the fill (`fill`) or stroke of `id`. +fn paint_of(s: &Session, id: NodeId, fill: bool) -> Paint { + let n = node(s, id); + if fill { n.appearance.fill_paint() } else { n.appearance.stroke_paint() } +} + +#[test] +fn a_color_read_from_a_path_assigns_back_unchanged() { + let colors = [ + "var c = new RGBColor(); c.red = 0.00001; c.green = 200.123456789; c.blue = 1 / 3;", + "var c = new CMYKColor(); c.cyan = 100 / 3; c.magenta = 0.00001; c.yellow = 99.99999; c.black = 12.3456789;", + "var c = new GrayColor(); c.gray = 100 / 3;", + "var c = new GrayColor(); c.gray = 99.99999;", + "var c = new LabColor(); c.l = 12.3456789; c.a = -0.00001; c.b = 127.99999;", + ]; + for color in colors { + for prop in ["fillColor", "strokeColor"] { + let (mut s, a, _) = doc(); + log(&mut s, &format!("{color} app.activeDocument.pathItems[0].{prop} = c;")); + let (before, steps) = (paint_of(&s, a, prop == "fillColor"), undo_steps(&s)); + let r = run(&mut s, &format!("var p = app.activeDocument.pathItems[0]; p.{prop} = p.{prop};")).unwrap(); + assert_eq!(paint_of(&s, a, prop == "fillColor"), before, "{color} {prop}"); + assert_eq!((undo_steps(&s), &r["slowestCommands"]), (steps, &json!([])), "{color} {prop}"); + } + } + let (mut s, _, _) = doc(); + let out = log( + &mut s, + "var p = app.activeDocument.pathItems[0], c = new RGBColor(); c.red = 200; c.green = 0.5; p.fillColor = c;\ + var g = new GrayColor(); g.gray = 25; p.strokeColor = g; vc.log([p.fillColor.red, p.fillColor.green, p.strokeColor.gray]);", + ); + assert_eq!(out, vec![json!([200, 0.5, 25])], "whole and short values read as they were given"); +} + +#[test] +fn many_point_edits_run_one_command() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + let anchors: Vec = (0..2000).map(|i| json!({"x": f64::from(i) * 0.1, "y": 100})).collect(); + let id = NodeId(s.execute("path.create", &json!({"anchors": anchors, "closed": false})).unwrap()["id"].as_u64().unwrap()); + let steps = undo_steps(&s); + let r = run( + &mut s, + "var p = app.activeDocument.pathItems[0], pp = p.pathPoints;\ + for (var i = 0; i < pp.length; i++) { var a = pp[i].anchor; pp[i].rightDirection = [a[0] + 1, a[1]]; pp[i].anchor = [a[0], a[1] + 5]; }\ + vc.log(pp[1999].anchor); vc.log(pp[1999].rightDirection); pp[0].remove(); vc.log(pp.length); vc.log(p.pathPoints[0].anchor);", + ) + .unwrap(); + let out: Vec = r["log"].as_array().unwrap().iter().map(rounded).collect(); + assert_eq!(out, vec![json!([199.9, 205]), json!([200.9, 200]), json!(1999), json!([0.1, 205])]); + assert_eq!( + r["slowestCommands"].as_array().map(|c| c.iter().map(|c| (c["id"].clone(), c["calls"].clone())).collect::>()), + Some(vec![(json!("path.setAnchors"), json!(1))]), + "one command writes every point" + ); + let pd = node(&s, id).path_data().unwrap().clone(); + assert_eq!(pd.subpaths[0].anchors.len(), 1999); + assert!(pd.subpaths[0].anchors.iter().all(|a| (a.h_out.x - a.p.x - 1.0).abs() < 1e-9 && (a.h_out.y - a.p.y - 5.0).abs() < 1e-9)); + assert_eq!(undo_steps(&s), steps + 1); +} + +#[test] +fn point_edits_are_written_before_the_next_other_member_reads() { + let (mut s, a, _) = doc(); + let out = log( + &mut s, + "var p = app.activeDocument.pathItems[0], q = app.activeDocument.pathItems[1];\ + p.pathPoints[0].anchor = [0, 300]; vc.log(p.geometricBounds); q.pathPoints[0].anchor = [90, 210];\ + p.pathPoints[1].anchor = [50, 300]; vc.log(q.geometricBounds); vc.log(p.geometricBounds);", + ); + let out: Vec = out.iter().map(rounded).collect(); + assert_eq!(out, vec![json!([0, 300, 40, 240]), json!([90, 210, 150, 150]), json!([0, 300, 50, 240])]); + assert_eq!(node(&s, a).path_data().unwrap().subpaths[0].anchors[1].p, vectorcraft_geom::Point::new(50.0, 0.0)); +} + +#[test] +fn closed_and_set_entire_path_join_the_point_edits_in_one_command() { + let (mut s, a, _) = doc(); + let r = run( + &mut s, + "var p = app.activeDocument.pathItems[0]; p.setEntirePath([[0, 300], [40, 300], [40, 240]]); p.closed = false;\ + p.pathPoints[1].anchor = [50, 300]; vc.log(p.closed); p.closed = true; p.setEntirePath([[0, 300], [60, 300], [60, 240]]); vc.log(p.closed);", + ) + .unwrap(); + assert_eq!(r["log"], json!([false, true])); + assert_eq!( + r["slowestCommands"].as_array().map(|c| c.iter().map(|c| (c["id"].clone(), c["calls"].clone())).collect::>()), + Some(vec![(json!("path.setAnchors"), json!(1))]), + "one command writes every change" + ); + let pd = node(&s, a).path_data().unwrap().clone(); + assert!(pd.subpaths[0].closed); + assert_eq!(pd.subpaths[0].anchors.iter().map(|a| (a.p.x, a.p.y)).collect::>(), vec![(0.0, 0.0), (60.0, 0.0), (60.0, 60.0)]); +} + +#[test] +fn point_edits_of_a_pixel_aligned_path_read_as_the_grid_snaps_them() { + let (mut s, a, _) = doc(); + s.execute("select.set", &json!({"ids": [a.0]})).unwrap(); + s.execute("object.setPixelAligned", &json!({})).unwrap(); + s.execute("select.none", &json!({})).unwrap(); + let out = log( + &mut s, + "var p = app.activeDocument.pathItems[0]; p.setEntirePath([[10.3, 280.3], [40.3, 280.3], [40.3, 240.3], [10.3, 240.3]]);\ + vc.log(p.pathPoints[0].anchor); p.pathPoints[1].anchor = [40.4, 280.3]; vc.log(p.pathPoints[1].anchor);", + ); + let anchors = node(&s, a).path_data().unwrap().subpaths[0].anchors.to_vec(); + let stored = |i: usize| rounded(&json!([anchors[i].p.x, 300.0 - anchors[i].p.y])); + assert_ne!(rounded(&out[0]), json!([10.3, 280.3]), "the grid moves the point"); + assert_eq!((rounded(&out[0]), rounded(&out[1])), (stored(0), stored(1)), "points read as the path has them"); +} + +#[test] +fn added_paths_go_on_top_of_the_layer_whatever_the_drawing_mode() { + for mode in ["behind", "inside"] { + let (mut s, a, _) = doc(); + s.execute("select.set", &json!({"ids": [a.0]})).unwrap(); + s.execute("view.drawMode", &json!({"mode": mode})).unwrap(); + let drawing = s.draw_mode; + log( + &mut s, + "var d = app.activeDocument; d.pathItems.add().name = 'n'; d.pathItems.rectangle(10, 10, 5, 5).name = 'r';\ + d.pathItems.roundedRectangle(10, 10, 5, 5).name = 'q';", + ); + let st = s.active().unwrap(); + let children = st.doc.layers[0].children().unwrap(); + let names: Vec> = children.iter().rev().take(3).map(|c| c.name.as_deref()).collect(); + assert_eq!(names, [Some("q"), Some("r"), Some("n")], "{mode}: the new paths are on top of the layer"); + assert_eq!(s.draw_mode, drawing, "{mode}: the drawing mode stays"); + } +} + +#[test] +fn overprint_changes_the_top_fill_or_stroke_only() { + let (mut s, a, _) = doc(); + s.execute("select.set", &json!({"ids": [a.0]})).unwrap(); + s.execute("appearance.addFill", &json!({})).unwrap(); + s.execute("appearance.addStroke", &json!({})).unwrap(); + s.execute("select.none", &json!({})).unwrap(); + let out = log( + &mut s, + "var p = app.activeDocument.pathItems[0]; p.fillOverprint = true; p.strokeOverprint = true; vc.log([p.fillOverprint, p.strokeOverprint]);", + ); + assert_eq!(out, vec![json!([true, true])]); + let items = node(&s, a).appearance.items.clone(); + for fill in [true, false] { + let flags: Vec = items.iter().filter(|i| i.is_fill() == fill).map(|i| i.overprint()).collect(); + assert!(flags.len() >= 2, "{flags:?}"); + let (top, lower) = flags.split_last().unwrap(); + assert!(*top && lower.iter().all(|f| !f), "fill {fill}: only the top row overprints: {flags:?}"); + } +} + +#[test] +fn filled_true_on_a_compound_member_places_the_gradient_on_the_compound() { + for member in 0..2 { + let (mut s, a, b) = doc(); + s.execute("select.set", &json!({"ids": [a.0, b.0]})).unwrap(); + let compound = NodeId(s.execute("object.compoundPath.make", &json!({})).unwrap()["id"].as_u64().unwrap()); + s.execute("paint.setFill", &json!({"ids": [compound.0], "none": true})).unwrap(); + s.execute("select.none", &json!({})).unwrap(); + let stops = json!([{"offset": 0, "color": "#ff0000"}, {"offset": 1, "color": "#0000ff"}]); + s.execute("paint.setFill", &json!({"gradient": {"kind": "linear", "stops": stops}})).unwrap(); + if let Paint::Gradient(g) = &mut s.paint.fill { + g.geom = Some(vectorcraft_color::GradientGeom { + start: vectorcraft_geom::Point::new(0.0, 0.5), + end: vectorcraft_geom::Point::new(1.0, 0.5), + aspect: 1.0, + focal: None, + }); + } + log(&mut s, &format!("app.activeDocument.pathItems[{member}].filled = true;")); + let b = node(&s, compound).geometric_bounds().unwrap(); + let Paint::Gradient(g) = node(&s, compound).appearance.fill_paint() else { panic!("member {member}: the compound has a gradient") }; + let geom = g.geom.unwrap(); + assert!((geom.start.x - b.x0).abs() < 1e-6 && (geom.end.x - b.x1).abs() < 1e-6, "member {member}: {geom:?} spans {b:?}"); + } +} + +#[test] +fn set_anchors_reads_smooth_false_as_a_corner() { + let (mut s, a, _) = doc(); + let anchor = |smooth: Value| { + let mut v = json!({"x": 20, "y": 20, "in": [10, 20], "out": [30, 20]}); + if !smooth.is_null() { + v["smooth"] = smooth; + } + v + }; + for (smooth, kind, read) in [(json!(false), AnchorKind::Corner, "PointType.CORNER"), (Value::Null, AnchorKind::Smooth, "PointType.SMOOTH")] { + let subpaths = json!([{"anchors": [anchor(smooth.clone()), {"x": 60, "y": 20}], "closed": false}]); + s.execute("path.setAnchors", &json!({"id": a.0, "subpaths": subpaths})).unwrap(); + assert_eq!(node(&s, a).path_data().unwrap().subpaths[0].anchors[0].kind, kind, "smooth {smooth}"); + assert_eq!(log(&mut s, "vc.log(app.activeDocument.pathItems[0].pathPoints[0].pointType);"), vec![json!(read)], "smooth {smooth}"); + } } #[test] diff --git a/docs/gaps.md b/docs/gaps.md index cd23b3096c..d8184b1a9b 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -807,9 +807,10 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi ## G6 Automation and scripting -- **Missing:** the rest of the document object model for scripts (layers, artboards, paths, type and the - other classes) and the `#engine` script directive (#1183 is open). Scripts have `app`, the open documents, new - documents, each document's selection and its page items. File › Scripts › Other Script… and `script.run` run JavaScript files over the command registry, `#targetengine` +- **Missing:** the rest of the document object model for scripts (layers, artboards, type, the selected path + points, gradient stops and the other classes) and the `#engine` script directive (#1183 is open). Scripts have + `app`, the open documents, new documents, each document's selection and its page items, and `Document.pathItems` + makes paths and reads and changes their points, colors, stroke options and transforms. File › Scripts › Other Script… and `script.run` run JavaScript files over the command registry, `#targetengine` runs a script in a named engine whose globals last between runs, File › Scripts lists the scripts of the Scripts folder, and Window › Script Console shows their output, errors and run reports. Actions, Batch, Variables (text, visibility, image and graph), data set CSV import and diff --git a/docs/mcp.md b/docs/mcp.md index 44d375ae2c..6c5e64789d 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2685,7 +2685,8 @@ app through the global object `vc`, and writes to the Script Console and runs ot `polygon(centerX = 200, centerY = 300, radius = 50, sides = 8, reversed?)` and `star(centerX = 200, centerY = 300, radius = 50, innerRadius = 20, points = 5, reversed?)`, which run `shape.rectangle`, `path.create`, `shape.ellipse`, `shape.polygon` and `shape.star` (and `path.reverse` for `reversed`) and paint the new path as new - art is painted. A `PathItem` (https://ai-scripting.docsforadobe.dev/jsobjref/PathItem/) adds to the page item + art is painted. `add()` and the shape creators put the new path on top of the active layer whatever the drawing + mode, which stays as it was. A `PathItem` (https://ai-scripting.docsforadobe.dev/jsobjref/PathItem/) adds to the page item members `pathPoints`, `closed`, `evenodd`, `area` (negative for a path that runs counterclockwise), `length`, `guides`, `clipping`, `setEntirePath(points)`, `filled`, `fillColor`, `fillOverprint`, `stroked`, `strokeColor`, `strokeOverprint`, `strokeWidth`, `strokeCap`, `strokeJoin`, `strokeMiterLimit` (1 to 500), `strokeDashes`, @@ -2693,7 +2694,11 @@ app through the global object `vc`, and writes to the Script Console and runs ot positive angle) and `resize(scaleX, scaleY, ..., changeLineWidths?, scaleAbout?)`. The geometry changes through `path.setAnchors`, the fill and stroke through `paint.setFill` and `paint.setStroke`, the stroke options through `stroke.set`, the fill rule through `path.setFillRule`, overprint through `object.setOverprint` and the transforms - through `object.move`, `object.rotate` and `object.scale`. `pathPoints` + through `object.move`, `object.rotate` and `object.scale`. Changes to the points of a path (`closed`, + `setEntirePath`, `pathPoints` and each `PathPoint`) are written together with one `path.setAnchors` before the + script uses any other member or command, or the points of another path, and when the script ends; a path aligned + to the pixel grid, or in an object that is, is written at each change, so its points read as the grid snaps them. + `pathPoints` (https://ai-scripting.docsforadobe.dev/jsobjref/PathPoints/) has `length`, `[i]`, `index(i)`, `add()` and `removeAll()`, and each `PathPoint` (https://ai-scripting.docsforadobe.dev/jsobjref/PathPoint/) has `anchor`, `leftDirection` (the handle into the point), `rightDirection` (the handle out of it), `pointType`, `parent` and @@ -2708,15 +2713,19 @@ app through the global object `vc`, and writes to the Script Console and runs ot `pointType` changes only the type; `PathPoints.add()` adds a corner point at the last point, or at `[0, 0]`; a point whose index is past the end of its path throws `Stale path point`. Color components left out count as 0, `new cmykColor()` makes a `CMYKColor`, `LabColor.l` is 0 to 100 and `a` and `b` are -128 to 128, and a component out of - range throws a `RangeError` when the color is assigned, with nothing changed. Reading `fillColor` or `strokeColor` - gives a new object each time, a `GradientColor`, `SpotColor` or `PatternColor` among them (a color linked to a + range throws a `RangeError` when the color is assigned, with nothing changed. A component reads with the fewest + decimals, at least 4, that give the stored value back, so assigning a color read from a path leaves the path as it + was. Reading `fillColor` or `strokeColor` gives a new object each time, a `GradientColor`, `SpotColor` or `PatternColor` among them (a color linked to a global or spot swatch reads as a `SpotColor` with its `tint`); assigning one of those throws an error that says it is not available yet. `filled = true` on a path without a fill gives it the fill new art gets (a color, gradient or pattern), or black when new art has none, and `stroked = true` does the same with the - stroke; a new-art pattern with a placement of its own, or one missing from the document, throws an error. Sizes and + stroke; a new-art gradient goes on the bounds of the path, or of the compound path or compound shape whose paint + it shows, and a new-art pattern with a placement of its own, or one missing from the document, throws an error. + `fillOverprint` and `strokeOverprint` read and change the top fill or stroke only. Sizes and radii are finite and not negative, `sides` is a whole number from 3 to 1000, `points` one from 2 to 1000, `strokeWidth` 0 to 1000 points (a `changeLineWidths` that would scale it past 1000 throws), `strokeDashes` at most 64 lengths that are not all 0 (`[]` or `{}` for a solid line), and `rotateAbout` and `scaleAbout` default to - `Transformation.CENTER`. The transforms take one setting for fill and stroke patterns, so `changeFillPatterns` and + `Transformation.CENTER`. A transform that leaves the path where it is, such as `rotate(360)` or + `resize(100, 100)`, checks its arguments and runs no command, on a path with no points too. The transforms take one setting for fill and stroke patterns, so `changeFillPatterns` and `changeStrokePattern` given as different values throw an error, and `changeFillGradients` false and `ellipse` with `inscribed` true throw an error that says they are not available yet. A change to the geometry or paint of a path that is hidden or locked, or that is in a hidden or locked layer or group, throws `Cannot edit` with nothing diff --git a/docs/roadmap.md b/docs/roadmap.md index 3ddf3459a4..28192e13b9 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -196,7 +196,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | M10 | Brushes, symbols, patterns, Repeat | 🟡 pattern swatches (5 tile types, Pattern Options, editing mode, SVG ``/PDF export) and live Repeat (radial/grid/mirror) done; interactive selected mirror axis implemented (focused and native checks passed; full CI blocked by an unrelated text test); symbol libraries done (Window › Symbol Libraries, six generated libraries (Basic Shapes, UI Frames, Map Markers, Inventory Icons, Skill Icons, Weather Icons), User Defined, Other Library…, Save Symbols); brush libraries done (Window › Brush Libraries, fifteen generated libraries including Tech Circuit, Decorative, Engraving, Arrows, Stipple, Pressure Sensitive, Ink and Wash, Bristle Brushes and Dry Media, User Defined, Other Library…, Save Brushes); symbol editing shows draggable 9-slice guides (#5280), with guides outside the artwork still unsupported; brushes/symbols in progress | 23–37 | | M11 | Artboards & views (selected-set deletion shared by Artboards menu, trash and Properties, retaining artboard 1 when all are selected; Artboard deletion keys keep the first of an all-selected set and protect artwork; history prunes invalid indices while preserving valid multiselection (history tests and full workspace CI pass); click-to-fit objects with the Artboard tool (#1227), artboard escape routing and document setup modal handoff done; artboard panel/tool with Move Artwork for X/Y fields and Artboard Options, Trim View (hiding the guides and the grid while it is on, #8363), middle-button pan, print tiling and the status bar's artboard navigator with synchronized Artboard tool selection done; Window › Arrange › Tile and Consolidate All Windows done; multiple windows, presentation polish) (cached canvas reprojection preserves scale during resize, rotation and DPI changes; regression-tested and contributor-confirmed 2026-10-19; estimates unchanged) (cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission; regression-tested; estimates unchanged); status-bar pointer coordinates follow the active ruler origin and General units | 🟡; Artboard Options shares existing presets and orientation controls and can fit artwork without moving it; artwork fitting includes all drawn document art across artboards and off-board; artwork bounds are cached by active document and revision, and selection uses the shared bounds cache across artboards | 15–25 | | M12 | Advanced color & art (CMYK/ICC, separations, Gradient Mesh, Live Paint, Image Trace, Graphs) | 🟡 Gradient Mesh, Live Paint, Image Trace (junction-returning pieces retain their positioned boundaries; a simpler contour walk with identical output; an edge's sub-pixel shift is the same from either side; notches read only their own piece; collapsed loops keep few segments; large images trace with a warning; Auto Color keeps rare distinct colours; quick presets trace at once and the Image Trace button opens the adjustment controls; Properties reopens them; tiny fitted contours retain islands and holes; Create Strokes: exact crop EDT, Guo–Hall thinning and maximal-disc graph simplification; 15 presets, the 14 documented ones each with an enhanced version; Ignore Color (manual picker and canvas eyedropper from original pixels, no canvas View change, missed pixels keep the pick armed, Preview/Undo retained; #8068), Shapes, Auto Grouping and Gradients options; measured in `image-trace-quality.md`; closed outlines retain their interior after straightening; the Flat Logo mode places edges to a fraction of a pixel, restores sharp corners, snaps lines and circles, and refuses gradients; live trace result bounds and selection highlights exclude the retained bitmap except in source-image views), Recolor Artwork, colour management (ICC, soft proofing, separations preview), Graphs (all 9 tools, Graph Data/Type, group-selected series colours persist through regenerate/save/open) done; Graph Design and Marker designs, Transpose and Switch x/y, `\|` label line breaks, the pie options, drop shadows, the legend across the top, overlapping widths, First Row/Column in Front, filled lines, kept label formatting and the Graph Data worksheet done; graph Column designs pending; Vector Halftone Preview keeps the selection box without drawing dot selection marks (#6369); Live Paint Bucket fills faces crossed in one drag (#6373) | 6–10 | -| M13 | Automation (Actions ✅ record/playback, persisted; variables, scripting, batch) | 🟡 MCP `add_text` exposes existing vertical point, area and path type; `script.run` and File › Scripts › Other Script… run JavaScript files, and Window › Script Console shows their output; scripts have `app`, the open documents, new documents, each document's selection and its page items; the rest of the script document model (layers, artboards, paths, type and the other classes) and batch work remain | 18–27 | +| M13 | Automation (Actions ✅ record/playback, persisted; variables, scripting, batch) | 🟡 MCP `add_text` exposes existing vertical point, area and path type; `script.run` and File › Scripts › Other Script… run JavaScript files, and Window › Script Console shows their output; scripts have `app`, the open documents, new documents, each document's selection and its page items, and `Document.pathItems` makes paths and reads and changes their points, colors, stroke options and transforms; the rest of the script document model (layers, artboards, type, the selected path points, gradient stops and the other classes) and batch work remain | 18–27 | | M14 | 1.0 polish (Asset Export tile context menus implemented for G12; preferences, shortcut editor, workspaces, accessibility, packaging for all OSes) (status messages and readouts use stable responsive allocations sized for localized labels and ordinary coordinates; sample widths cached by language/unit/DPI; regression-tested and contributor-confirmed 2026-10-19; estimates unchanged) | 🟡 Icon-strip flyouts resize on their free edges and retain sizes (#5713); interim macOS cursor delivery (#2292) uses existing artwork and host-owned AppKit cursors; headless coverage only, native menu/focus/handback and display validation pending. Dock groups collapse to their tabs by a double-click on a tab (UI.8); Preferences › General › Constrain Angle acts for the arrow keys, Shift drags and new objects (#394, 2026-10-21); numeric-field pointer selection and focus regression-tested (#1326; a release more than 1 pt from the press keeps the caret, a tap within 1 pt selects all, #6659); RPM runtime capabilities and glibc floor checked (#1275; real-distro install/start-up pending), Eyedropper cursor with precise-setting checks (#1269), Preferences, shortcut editor (chords with Shift and a punctuation key fire as typed; other apps' text shortcut sets imported), workspaces (each keeps its layout changes until Reset , UI.7), Window › Help Bar shown or hidden apart from the status bar and kept in saved workspaces, panels docked by dragging into any dock group (as tabs or a top/bottom split) or into the icon column, and closed from a dock tab's context menu (UI.6), a custom title bar on Windows/Linux with a Home button, content-sized dialogs, menus that scroll when longer than the window and macOS native menu dismissal done (M14.8), and native macOS save sheets with a Format menu (#866); titled PDF exports set `DisplayDocTitle` for viewers and accessibility checkers (#3646) and give the document language as the catalog's `/Lang` (#3644); accessibility and broader Windows/Linux packaging/QA pending; floating tab groups collapse into the side icon rail and opened rail panels fold back into it (#5925, in part), with pointer and native-window regression coverage; estimates unchanged; numeric spinner arrows keep repeating while held with the mouse (#6307); Swatches item context menus tested in all five views and rendered layouts inspected; Linux full CI passed, Windows engine baseline limitations documented (G12); Graphic Styles item context menus in thumbnail and list views with Options, Duplicate, Delete, Redefine, Break Link (#8755); Appearance panel row context menus for strokes, fills, effects, and root object row (Duplicate, Delete, Hide/Show, Edit Effect…, Clear Appearance, Reduce to Basic Appearance) with secondary click row selection (#8809); Character Styles and Paragraph Styles item context menus (panels::text_styles::tests::right_click_context_menu_*); Window > Toolbars > Compact Tools offers optional denser main Tools spacing in one or two columns, with the existing layout still the default (#7234) | 18–28 | | — | Interaction fidelity pass (every tool's modifiers, Properties panel per context, isolation, nuance; width-point creation and adjoining adjustment regression-tested; dialog layout reviewed) | ⬜ (new ruler-guide Alt orientation implemented; existing-guide Escape cancellation regression-tested; broader pass remains) | 60–90 | | — | Hardening at scale (big-file corpus, fuzzing, cross-platform + browser QA) | 🟡 PngSuite integrity and bounded fetching verified (#1729); real-world corpus/manual QA remain | 50–80 | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 81abb83e94..72ed713051 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1025,7 +1025,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - The control server writes each reply through a 64 KiB buffer. On Windows 11 it sends the 17 MB `document.inspect` reply of a document with 50,000 objects on one layer to a client over loopback in 0.09 s instead of 34 s. - Scripts: File › Scripts › Other Script… and `script.run` run a JavaScript file against the open documents as one transaction with one undo step for each changed document. A failed or stopped run puts every document back. `crates/engine/src/tests/script_run.rs`. - Scripts: the global `app` gives the open documents, new documents from a startup preset and a `DocumentPreset`, the active document, each document's selection and its page items with their names, notes, visibility, lock, opacity, position, size, bounds and stacking order, and moves and copies them into or beside other objects, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/Application/, https://ai-scripting.docsforadobe.dev/jsobjref/Documents/, https://ai-scripting.docsforadobe.dev/jsobjref/DocumentPreset/, https://ai-scripting.docsforadobe.dev/jsobjref/Document/, https://ai-scripting.docsforadobe.dev/jsobjref/PageItems/, https://ai-scripting.docsforadobe.dev/jsobjref/PageItem/ and https://ai-scripting.docsforadobe.dev/jsobjref/GroupItem/ describe them; each change runs a command inside the run's transaction (`docs/mcp.md`). Layers, type and the other classes are not there yet. `crates/engine/src/tests/script_dom.rs`. - - Scripts: `Document.pathItems` lists the paths and makes rectangles, rounded rectangles, ellipses, polygons, stars and empty paths with the defaults the help page https://ai-scripting.docsforadobe.dev/jsobjref/PathItems/ gives; each path's points, closed state, fill rule, area, length, fill and stroke colors, stroke options and transforms read and change as https://ai-scripting.docsforadobe.dev/jsobjref/PathItem/, https://ai-scripting.docsforadobe.dev/jsobjref/PathPoints/ and https://ai-scripting.docsforadobe.dev/jsobjref/PathPoint/ describe them, and `RGBColor`, `CMYKColor`, `GrayColor`, `LabColor` and `NoColor` make colors (`docs/mcp.md`). Gradient stops and the document's default paint are not there yet. `crates/engine/src/tests/script_dom_paths.rs`. + - Scripts: `Document.pathItems` lists the paths and makes rectangles, rounded rectangles, ellipses, polygons, stars and empty paths with the defaults the help page https://ai-scripting.docsforadobe.dev/jsobjref/PathItems/ gives; each path's points, closed state, fill rule, area, length, fill and stroke colors, stroke options and transforms read and change as https://ai-scripting.docsforadobe.dev/jsobjref/PathItem/, https://ai-scripting.docsforadobe.dev/jsobjref/PathPoints/ and https://ai-scripting.docsforadobe.dev/jsobjref/PathPoint/ describe them, and `RGBColor`, `CMYKColor`, `GrayColor`, `LabColor` and `NoColor` make colors (`docs/mcp.md`). The transforms move gradients with the art: `changeFillGradients` false throws an error, as do `changeFillPatterns` and `changeStrokePattern` given as different values, and `transform` is not there yet (`docs/mcp.md` lists these limits). Gradient stops and the document's default paint are not there yet. `crates/engine/src/tests/script_dom_paths.rs`. - Scripts: Window › Script Console shows each run's `$.write` and `$.writeln` output, `vc.log` entries, uncaught error with the script's name, line and column, and a report of its time, host calls and slowest commands, keeping at most 2,048 lines and counting the lines it dropped. `script.run`'s report carries the same data, and `script.console`, `script.console.clear` and `ui.copyScriptConsole` read, clear and copy it. `crates/engine/src/tests/script_console.rs`. - Scripts: the status bar translates its own words around a failed run's error and the app's own error messages, and shows text the script threw itself (a value, an error it made, or an error whose name or message it changed) as it is, even when that text reads like one of the app's messages. `script.run`'s report gives `messageOrigin` (`script` or `built-in`), and the advice about objects other applications give their scripts follows only the app's own reference errors. VectorCraft's own rule. `crates/js/src/interp_tests.rs`, `crates/engine/src/tests/script_run.rs`, `crates/ui-egui/src/chrome/tests.rs`. - Scripts: the `$` object has the other members the Dollar object page lists (https://extendscript.docsforadobe.dev/extendscript-tools-features/dollar-object/), from `$.about()` to `$.version`, and scripts have the global `localize(object, ...values)` (https://extendscript.docsforadobe.dev/extendscript-tools-features/localizing-extendscript-strings/), `toSource(value)` and `Object.prototype.toSource()`. Each run starts with the interface's locale, and what a script changes in `$` lasts only for that run. `crates/engine/src/tests/script_dollar.rs`, `crates/js/src/extension_tests.rs`. From 1548547fc1cc9579cf89bca212c29dbcfa0aaf09 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 21 Nov 2026 14:42:22 -0800 Subject: [PATCH 03/61] Scripts: ask before keeping a run whose last point changes pass the growth allowance Point changes a script leaves waiting are written when its script ends. When that write went past the growth allowance in a run that can ask, the run was kept at once without asking. The run now waits with its script finished: Continue keeps it, and Stop puts every document back as a stopped run does. --- crates/engine/src/script/mod.rs | 69 ++++++++++++++++++++------- crates/engine/src/tests/script_run.rs | 50 ++++++++++++++++++- 2 files changed, 101 insertions(+), 18 deletions(-) diff --git a/crates/engine/src/script/mod.rs b/crates/engine/src/script/mod.rs index 37c4b8711d..82d013e076 100644 --- a/crates/engine/src/script/mod.rs +++ b/crates/engine/src/script/mod.rs @@ -1093,6 +1093,8 @@ struct Job { name: String, /// The file-access scope `script.run` came in, which every slice runs in. scope: crate::file_access::ScopeHandle, + /// The script has ended, and the run waits for the person's growth answer before it is kept. + finished: bool, } /// The `Data` for a JSON value, within `limits`. When it does not fit, the error is the place in @@ -1888,7 +1890,7 @@ impl Session { if h.waiting.replace(false) { h.continues.set(h.continues.get() + 1); h.allowance_objects.set(h.allowance_objects.get().saturating_add(growth_objects())); - h.allowance_bytes.set(h.allowance_bytes.get().saturating_add(GROWTH_BYTES)); + h.allowance_bytes.set(h.allowance_bytes.get().saturating_add(growth_bytes())); } }); } @@ -2026,7 +2028,7 @@ impl Session { bytes_kept: Cell::new(0), bridge: Cell::new(0), allowance_objects: Cell::new(growth_objects()), - allowance_bytes: Cell::new(GROWTH_BYTES), + allowance_bytes: Cell::new(growth_bytes()), continues: Cell::new(0), waiting: Cell::new(false), log: RefCell::new(Vec::new()), @@ -2130,7 +2132,7 @@ impl Session { } let scope = crate::file_access::ScopeHandle::capture(); let (run, line_name) = (host.run, host.name.clone()); - let job = Job { realm, host, link, engine, world: World::working(self), start_uids: open, name: name.clone(), scope }; + let job = Job { realm, host, link, engine, world: World::working(self), start_uids: open, name: name.clone(), scope, finished: false }; let id = NEXT_JOB.fetch_add(1, std::sync::atomic::Ordering::Relaxed); JOBS.with(|jobs| jobs.borrow_mut().insert(id, job)); self.script_key = Some(JobKey { id, run, name: line_name }); @@ -2159,6 +2161,17 @@ impl Session { self.script_key = Some(key); return None; } + // A run whose script ended past its growth allowance is kept once the person lets it go on, + // and put back when they stop it. + if job.finished { + if self.script_stop.is_set() { + let kind = LimitKind::Interrupted; + let e = + RunError { kind: RunErrorKind::Limit(kind), message: format!("limit reached: {kind:?}"), line: 0, column: 0, authored: false }; + return Some(self.script_failed(job, &e)); + } + return Some(self.script_ended(job)); + } // A stop while a dialog waits ends the run there; the interpreter cannot go on from the call. if job.realm.waits() { let kind = LimitKind::Interrupted; @@ -2178,24 +2191,35 @@ impl Session { self.script_key = Some(key); None } - Ok(Ok(Progress::Done(_))) if job.host.dialogs.unused() > 0 => { - let n = job.host.dialogs.unused(); - let kind = LimitKind::Host; - let message = if n == 1 { - format!("`answers` has {n} answer the script did not use") - } else { - format!("`answers` has {n} answers the script did not use") - }; - Some(self.script_failed(job, &RunError { kind: RunErrorKind::Limit(kind), message, line: 0, column: 0, authored: false })) - } - Ok(Ok(Progress::Done(_))) => { - let r = self.script_commit(job); - self.trim_histories(); - Some(r) + // The point changes written as the script ended went past the growth allowance. + Ok(Ok(Progress::Done(_))) if job.host.waiting.get() => { + job.finished = true; + JOBS.with(|jobs| jobs.borrow_mut().insert(key.id, job)); + self.script_key = Some(key); + None } + Ok(Ok(Progress::Done(_))) => Some(self.script_ended(job)), } } + /// Ends the run whose script has ended: it fails when answers it was given went unused, and is + /// kept otherwise. + fn script_ended(&mut self, job: Job) -> Result { + let n = job.host.dialogs.unused(); + if n > 0 { + let kind = LimitKind::Host; + let message = if n == 1 { + format!("`answers` has {n} answer the script did not use") + } else { + format!("`answers` has {n} answers the script did not use") + }; + return self.script_failed(job, &RunError { kind: RunErrorKind::Limit(kind), message, line: 0, column: 0, authored: false }); + } + let r = self.script_commit(job); + self.trim_histories(); + r + } + fn script_failed(&mut self, job: Job, e: &RunError) -> Result { job.host.dialogs.stopped(); job.host.disk.borrow_mut().picker = None; @@ -2531,6 +2555,15 @@ fn growth_objects() -> u64 { GROWTH_OBJECTS } +/// The bytes of new document data a run may keep before it is asked to continue or stop. +fn growth_bytes() -> u64 { + #[cfg(test)] + if let Some(n) = TEST_GROWTH_BYTES.with(Cell::get) { + return n; + } + GROWTH_BYTES +} + /// The limits of a command's result on its way to the script. fn result_limits() -> DataLimits { #[cfg(test)] @@ -2548,6 +2581,8 @@ thread_local! { pub(crate) static PANIC_IN_SLICE: Cell = const { Cell::new(false) }; /// Tests: the objects a run may add in place of [`GROWTH_OBJECTS`]. pub(crate) static TEST_GROWTH: Cell> = const { Cell::new(None) }; + /// Tests: the bytes a run may keep in place of [`GROWTH_BYTES`]. + pub(crate) static TEST_GROWTH_BYTES: Cell> = const { Cell::new(None) }; /// Tests: the heap of a named engine in place of [`ENGINE_HEAP_BYTES`]. pub(crate) static TEST_ENGINE_HEAP: Cell> = const { Cell::new(None) }; /// Tests: the bytes of source maps a named engine keeps, in place of [`KEPT_MAP_BYTES`]. diff --git a/crates/engine/src/tests/script_run.rs b/crates/engine/src/tests/script_run.rs index 02176c38c9..48f4aa02f9 100644 --- a/crates/engine/src/tests/script_run.rs +++ b/crates/engine/src/tests/script_run.rs @@ -5,7 +5,7 @@ use std::cell::Cell; use serde_json::{Value, json}; -use crate::script::{PANIC_IN_SLICE, TEST_GROWTH, TEST_RESULT_BYTES}; +use crate::script::{PANIC_IN_SLICE, TEST_GROWTH, TEST_GROWTH_BYTES, TEST_RESULT_BYTES}; use crate::*; fn rect(x: i64) -> Value { @@ -1020,6 +1020,54 @@ fn a_person_can_let_a_growing_run_go_on_or_stop_it() { assert_eq!(state(&s), before); } +#[test] +fn point_changes_written_as_the_script_ends_wait_for_the_growth_answer() { + // The point change waits in the object model until the script ends. + let source = "app.activeDocument.pathItems[0].pathPoints[0].anchor = [3, -4];"; + let mut s = two_docs(); + let start = s.documents()[1].doc.clone(); + assert_eq!(run(&mut s, source).unwrap()["ok"], true); + let added = start.retained_bytes_each(&s.documents()[1].doc).1 as u64; + assert!(added >= 3, "{added}"); + // The change goes past this allowance and stays within twice it. + TEST_GROWTH_BYTES.with(|g| g.set(Some(added * 2 / 3))); + let run_to_the_question = |s: &mut Session| { + s.script_frames = true; + run(s, source).unwrap(); + for _ in 0..1_000 { + if s.script_waiting() { + break; + } + assert!(s.script_pump().is_none()); + } + assert!(s.script_waiting()); + assert!(s.script_pump().is_none()); + assert!(s.script_running()); + }; + let mut s = two_docs(); + let before = state(&s); + let undo = s.documents()[1].history.undo.len(); + run_to_the_question(&mut s); + assert_eq!(state(&s), before); + s.script_continue(); + assert!(!s.script_waiting()); + let done = s.script_pump().expect("the run ends once it may go on"); + assert_eq!(done.unwrap()["ok"], true); + assert_eq!(s.documents()[1].history.undo.len(), undo + 1); + assert_ne!(state(&s), before); + + let mut s = two_docs(); + let before = state(&s); + run_to_the_question(&mut s); + assert_eq!(s.execute("script.stop", &json!({})).unwrap()["stopped"], true); + let ended = s.script_pump().expect("a stopped run ends"); + TEST_GROWTH_BYTES.with(|g| g.set(None)); + assert!(ended.is_err()); + assert_eq!(s.script_report().unwrap()["kind"], "stopped"); + assert!(!s.script_running()); + assert_eq!(state(&s), before); +} + #[test] fn a_run_waiting_to_grow_stops_at_the_next_slice_once_its_work_is_canceled() { TEST_GROWTH.with(|g| g.set(Some(20))); From 07d673898f156ffa517319b02cb3cc3a97966697 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 21 Nov 2026 15:14:52 -0800 Subject: [PATCH 04/61] Scripts: a path point read before its path's points are removed is stale A PathPoint kept its index, so after `remove()` of an earlier point it read and changed the point that moved into its place. A point read before the script removed a point of its path (`remove()`, `removeAll()`) or replaced its points (`setEntirePath`) now throws `Stale path point`. --- crates/engine/src/script/dom.rs | 6 +++- crates/engine/src/script/dom/paths.rs | 33 +++++++++++++++++---- crates/engine/src/tests/script_dom_paths.rs | 26 ++++++++++++++++ docs/mcp.md | 4 ++- 4 files changed, 62 insertions(+), 7 deletions(-) diff --git a/crates/engine/src/script/dom.rs b/crates/engine/src/script/dom.rs index 456d9d88b1..2e09f8cb5d 100644 --- a/crates/engine/src/script/dom.rs +++ b/crates/engine/src/script/dom.rs @@ -89,7 +89,8 @@ const ARTBOARD_COORDS: &str = "CoordinateSystem.ARTBOARDCOORDINATESYSTEM"; /// What the object model keeps for one run: its coordinate system, the last list of a document's /// page items, kept while that document is unchanged, the point changes of a path not written yet, -/// and whether a call's own savepoint ([`atomically`]) is open. +/// how many times it removed or replaced each path's points, and whether a call's own savepoint +/// ([`atomically`]) is open. #[derive(Default)] pub(super) struct State { coords: Cell, @@ -99,6 +100,9 @@ pub(super) struct State { /// A path and its subpaths with the point changes the run has made to it and not written yet /// ([`flush`]). pending: RefCell)>>, + /// How many times the run has removed or replaced points of each path, by document uid and + /// path id ([`paths`]). + point_cuts: RefCell>, saving: Cell, } diff --git a/crates/engine/src/script/dom/paths.rs b/crates/engine/src/script/dom/paths.rs index 29b0c909be..44c2304b38 100644 --- a/crates/engine/src/script/dom/paths.rs +++ b/crates/engine/src/script/dom/paths.rs @@ -28,7 +28,9 @@ //! stroke (solid, gradient or pattern), or black when new art has none. `PathPoints.add()` adds //! a corner point with no handles at the last point, or at `[0, 0]` on a path with no points. //! Removing the last points leaves the path, with no points. -//! - A point whose index is past the end of its path throws `Stale path point`. +//! - A point whose index is past the end of its path throws `Stale path point`, and so does a +//! point read before the run removed a point of its path or replaced its points +//! (`PathPoint.remove()`, `PathPoints.removeAll()`, `setEntirePath`). //! - Shape creators take sizes and radii that are finite and not negative; `sides` is a whole //! number from 3 to 1000 and `points` one from 2 to 1000. `inscribed` true throws an error that //! says it is not available yet. `rotateAbout` and `scaleAbout` default to @@ -56,7 +58,8 @@ use super::{ }; use crate::{DocState, NodeId, NodeKind}; -/// The error of a point whose index is past the end of its path. +/// The error of a point whose index is past the end of its path, or that was read before the run +/// removed or replaced points of its path. pub const STALE_POINT: &str = "Stale path point"; /// The most points `setEntirePath` takes. pub const MAX_POINTS: usize = 100_000; @@ -598,6 +601,7 @@ fn path_set_entire(h: &super::Host, a: &[Data]) -> Answer { let anchors: Vec = script.iter().map(|p| Anchor::corner(f.to_document(c, *p))).collect(); let subs = if anchors.is_empty() { Vec::new() } else { vec![SubPath::new(anchors, closed)] }; write_path(h, item, subs)?; + cut_points(h, item); Ok(Data::Undefined) } @@ -1064,7 +1068,20 @@ fn points_parent(h: &super::Host, a: &[Data]) -> Answer { fn point_ref(h: &super::Host, item: Item, i: usize) -> Data { let [high, low] = id_parts(item.id); - host_ref("PathPoint", &[float(h.run), float(item.doc.uid), high, low, float(i as u64)]) + host_ref("PathPoint", &[float(h.run), float(item.doc.uid), high, low, float(i as u64), float(point_cuts(h, item))]) +} + +/// How many times the run has removed or replaced points of `item`. +fn point_cuts(h: &super::Host, item: Item) -> u64 { + h.dom.point_cuts.borrow().get(&(item.doc.uid, item.id.0)).copied().unwrap_or(0) +} + +/// Notes that the run removed or replaced points of `item`, which makes the points read before +/// stale. +fn cut_points(h: &super::Host, item: Item) { + let mut cuts = h.dom.point_cuts.borrow_mut(); + let n = cuts.entry((item.doc.uid, item.id.0)).or_insert(0); + *n = n.saturating_add(1); } fn points_at(h: &super::Host, a: &[Data]) -> Answer { @@ -1107,16 +1124,21 @@ fn points_add(h: &super::Host, a: &[Data]) -> Answer { fn points_remove_all(h: &super::Host, a: &[Data]) -> Answer { let item = points_path(h, a)?; write_path(h, item, Vec::new())?; + cut_points(h, item); Ok(Data::Undefined) } // ---- PathPoint ---- -/// The path and the index of the point `this` names, which must still be in the path. +/// The path and the index of the point `this` names, which must still be in the path, with no +/// point of the path removed or replaced since `this` was read. pub(super) fn this_point(h: &super::Host, a: &[Data]) -> std::result::Result<(Item, usize), HostError> { let Some(handle) = handle_of(arg(a, 0), "PathPoint") else { return Err(HostError::Type("this is not a PathPoint".into())) }; - let [run, uid, high, low, i] = handle.as_slice() else { return Err(HostError::Type("this is not a PathPoint".into())) }; + let [run, uid, high, low, i, cuts] = handle.as_slice() else { return Err(HostError::Type("this is not a PathPoint".into())) }; let item = path_at(h, *run, *uid, *high, *low)?; + if whole(*cuts) != Some(point_cuts(h, item)) { + return Err(HostError::Error(STALE_POINT.into())); + } let i = whole(*i).and_then(|i| usize::try_from(i).ok()).ok_or_else(|| HostError::Error(STALE_POINT.into()))?; let n = read_points(h, item, point_count)?; if i >= n { @@ -1216,6 +1238,7 @@ fn pt_remove(h: &super::Host, a: &[Data]) -> Answer { } } })?; + cut_points(h, item); Ok(Data::Undefined) } diff --git a/crates/engine/src/tests/script_dom_paths.rs b/crates/engine/src/tests/script_dom_paths.rs index 004c02f4fc..5aff4e48d1 100644 --- a/crates/engine/src/tests/script_dom_paths.rs +++ b/crates/engine/src/tests/script_dom_paths.rs @@ -258,6 +258,32 @@ fn path_point_wrapper_goes_stale_after_remove() { ); } +#[test] +fn points_read_before_a_removal_or_replacement_go_stale() { + let (mut s, _, _) = doc(); + let out = log( + &mut s, + "var p = app.activeDocument.pathItems[0], q = app.activeDocument.pathItems[1];\ + var second = p.pathPoints[1], other = q.pathPoints[1]; p.pathPoints[0].remove();\ + try { second.anchor = [0, 0]; } catch (e) { vc.log(e.message); } try { second.anchor; } catch (e) { vc.log(e.message); }\ + vc.log(other.anchor); var first = p.pathPoints[0]; vc.log(first.anchor);\ + p.setEntirePath([[1, 1], [2, 2], [3, 3]]); try { first.anchor; } catch (e) { vc.log(e.message); }\ + var again = p.pathPoints[0]; vc.log(again.anchor); p.pathPoints.removeAll(); try { again.anchor; } catch (e) { vc.log(e.message); }", + ); + assert_eq!( + out, + vec![ + json!("Stale path point"), + json!("Stale path point"), + json!([150, 200]), + json!([40, 280]), + json!("Stale path point"), + json!([1, 1]), + json!("Stale path point") + ] + ); +} + #[test] fn fill_color_round_trips_rgb_cmyk_gray_lab() { let (mut s, a, _) = doc(); diff --git a/docs/mcp.md b/docs/mcp.md index 7d1ff6defe..4b82232fb6 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2715,7 +2715,9 @@ app through the global object `vc`, and writes to the Script Console and runs ot closed, and assigning it opens or closes them all; `setEntirePath` takes at most 100,000 points and gives corner points with no handles, keeping the path closed when it was; moving `anchor` leaves its handles where they are, and `pointType` changes only the type; `PathPoints.add()` adds a corner point at the last point, or at `[0, 0]`; a point - whose index is past the end of its path throws `Stale path point`. Color components left out count as 0, `new + whose index is past the end of its path throws `Stale path point`, and so does a point read before the script removed + a point of its path (`remove()`, `removeAll()`) or replaced its points (`setEntirePath`). Color components left out + count as 0, `new cmykColor()` makes a `CMYKColor`, `LabColor.l` is 0 to 100 and `a` and `b` are -128 to 128, and a component out of range throws a `RangeError` when the color is assigned, with nothing changed. A component reads with the fewest decimals, at least 4, that give the stored value back, so assigning a color read from a path leaves the path as it From bd945697e8088dc8e167787b7b91d183b7003465 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 21 Nov 2026 18:06:28 -0800 Subject: [PATCH 05/61] Scripts: a path point read before a command changes its path is stale A PathPoint read before vc.run('path.setAnchors', ...) replaced its path's points stayed valid, so a later write changed the replacement's point at the same index. The object model now keeps each path whose points the script read and checks it after every command and when a point is used. When the path's points differ from the ones it last saw, or the path is gone, the points read before throw `Stale path point`. This covers any command run with vc.run, an undo, and a change that a later command reverses. Points stay valid through the object model's own changes to the path or to an object that holds it, such as translate(). docs/mcp.md and the module doc state the rule. --- crates/engine/src/script/dom.rs | 32 ++++-- crates/engine/src/script/dom/paths.rs | 106 +++++++++++++++++++- crates/engine/src/script/mod.rs | 3 + crates/engine/src/tests/script_dom_paths.rs | 38 +++++++ docs/mcp.md | 5 +- 5 files changed, 173 insertions(+), 11 deletions(-) diff --git a/crates/engine/src/script/dom.rs b/crates/engine/src/script/dom.rs index 2e09f8cb5d..dd47eb00f3 100644 --- a/crates/engine/src/script/dom.rs +++ b/crates/engine/src/script/dom.rs @@ -89,8 +89,8 @@ const ARTBOARD_COORDS: &str = "CoordinateSystem.ARTBOARDCOORDINATESYSTEM"; /// What the object model keeps for one run: its coordinate system, the last list of a document's /// page items, kept while that document is unchanged, the point changes of a path not written yet, -/// how many times it removed or replaced each path's points, and whether a call's own savepoint -/// ([`atomically`]) is open. +/// how many times each path's points went stale and each path as the run last saw its points, and +/// whether a call's own savepoint ([`atomically`]) is open. #[derive(Default)] pub(super) struct State { coords: Cell, @@ -100,9 +100,18 @@ pub(super) struct State { /// A path and its subpaths with the point changes the run has made to it and not written yet /// ([`flush`]). pending: RefCell)>>, - /// How many times the run has removed or replaced points of each path, by document uid and - /// path id ([`paths`]). + /// How many times the points the run read of each path went stale, by document uid and path id + /// ([`paths`]). point_cuts: RefCell>, + /// Each path whose points the run read, as the run last saw it, by document uid and path id + /// ([`paths`]). + point_nodes: RefCell>>, + /// Each document, by uid, as it was when the run last looked at all the paths in it whose + /// points it read ([`paths`]). + point_docs: RefCell>>, + /// The item the object model is changing ([`edit_item`]), whose points stay valid through the + /// change. + editing: Cell>, saving: Cell, } @@ -169,6 +178,12 @@ pub(super) fn flush(h: &Host) -> std::result::Result<(), HostError> { paths::flush(h) } +/// Notes the changes a command made to the points of the paths the run has read +/// ([`paths::see_all_points`]). +pub(super) fn see_points(h: &Host) { + paths::see_all_points(h) +} + fn get(link: &Link, f: Member) -> HostMember { HostMember::Get(function(link, f)) } @@ -621,9 +636,14 @@ fn on_doc( Ok(v) } -/// Runs `id` with `params` on the item's document, its selection kept. +/// Runs `id` with `params` on the item's document, its selection kept. The points the run read of +/// the item's paths stay valid through the change ([`paths::see_all_points`]). fn edit_item(h: &Host, item: Item, id: &str, params: &Value) -> std::result::Result { - on_doc(h, item.doc.uid, true, |h| command(h, id, params)) + paths::see_all_points(h); + let kept = h.dom.editing.replace(Some(item)); + let r = on_doc(h, item.doc.uid, true, |h| command(h, id, params)); + h.dom.editing.set(kept); + r } /// Reads the document of `doc` with `f`. diff --git a/crates/engine/src/script/dom/paths.rs b/crates/engine/src/script/dom/paths.rs index 44c2304b38..32401db1d0 100644 --- a/crates/engine/src/script/dom/paths.rs +++ b/crates/engine/src/script/dom/paths.rs @@ -30,7 +30,10 @@ //! Removing the last points leaves the path, with no points. //! - A point whose index is past the end of its path throws `Stale path point`, and so does a //! point read before the run removed a point of its path or replaced its points -//! (`PathPoint.remove()`, `PathPoints.removeAll()`, `setEntirePath`). +//! (`PathPoint.remove()`, `PathPoints.removeAll()`, `setEntirePath`), or before anything other +//! than the object model changed the path's points (a command run with `vc.run`, such as +//! `path.setAnchors`, `object.move` or `edit.undo`). Points stay valid through the object +//! model's other changes to the path or to an object that holds it, such as `translate()`. //! - Shape creators take sizes and radii that are finite and not negative; `sides` is a whole //! number from 3 to 1000 and `points` one from 2 to 1000. `inscribed` true throws an error that //! says it is not available yet. `rotateAbout` and `scaleAbout` default to @@ -41,6 +44,7 @@ //! so `changeFillGradients` false throws an error that says it is not available yet. use std::rc::Rc; +use std::sync::Arc; use serde_json::{Value, json}; use vectorcraft_color::{Color, Paint}; @@ -1071,19 +1075,113 @@ fn point_ref(h: &super::Host, item: Item, i: usize) -> Data { host_ref("PathPoint", &[float(h.run), float(item.doc.uid), high, low, float(i as u64), float(point_cuts(h, item))]) } -/// How many times the run has removed or replaced points of `item`. +/// How many times the points read of `item` have gone stale, after [`see_points`] notes a change +/// made to them since the run last saw them. fn point_cuts(h: &super::Host, item: Item) -> u64 { - h.dom.point_cuts.borrow().get(&(item.doc.uid, item.id.0)).copied().unwrap_or(0) + let key = (item.doc.uid, item.id.0); + see_points(h, key, || false); + h.dom.point_cuts.borrow().get(&key).copied().unwrap_or(0) } /// Notes that the run removed or replaced points of `item`, which makes the points read before /// stale. fn cut_points(h: &super::Host, item: Item) { + cut_key(h, (item.doc.uid, item.id.0)); +} + +/// [`cut_points`] for the path of document uid and path id `key`. +fn cut_key(h: &super::Host, key: (u64, u64)) { let mut cuts = h.dom.point_cuts.borrow_mut(); - let n = cuts.entry((item.doc.uid, item.id.0)).or_insert(0); + let n = cuts.entry(key).or_insert(0); *n = n.saturating_add(1); } +/// The node of `id` in `d`, as the document holds it. +fn node_arc(d: &crate::Document, id: NodeId) -> Option<&Arc> { + let at = d.index_path(id)?; + let (first, rest) = at.split_first()?; + let mut cur = d.layers.get(*first)?; + for &i in rest { + cur = cur.children()?.get(i)?; + } + Some(cur) +} + +/// Keeps the path of document uid and path id `key` as it is now, the first time the run reads its +/// points and after each later look. When its points differ from the ones the run last saw, the +/// points read before go stale, unless `own`: the object model made the change +/// ([`see_all_points`]), which `own` is asked only after a change. The kept node is shared with +/// the document, so a node whose pointer is unchanged has unchanged points, and any change to it +/// makes a new node. +fn see_points(h: &super::Host, key: (u64, u64), own: impl FnOnce() -> bool) { + let node = { + let s = h.session.borrow(); + s.documents().iter().find(|d| d.uid == key.0).and_then(|st| node_arc(&st.doc, NodeId(key.1)).cloned()) + }; + // A path that is gone makes its points stale, so that an undo that brings it back leaves them + // stale. + let Some(node) = node else { + if h.dom.point_nodes.borrow_mut().remove(&key).is_some() { + cut_key(h, key); + } + return; + }; + let changed = match h.dom.point_nodes.borrow_mut().insert(key, node.clone()) { + Some(old) => !Arc::ptr_eq(&old, &node) && old.path_data().map(|pd| &pd.subpaths) != node.path_data().map(|pd| &pd.subpaths), + None => false, + }; + if changed && !own() { + cut_key(h, key); + } +} + +/// [`see_points`] for each path whose points the run has read, after each command, so that a +/// change that a later command reverses still makes the points stale. Paths under the object that +/// the object model is changing ([`super::State`]), or that object itself, take the change as the +/// object model's own, and their points stay valid. A document that is the one the run last looked +/// at is skipped, as are its paths. +pub(super) fn see_all_points(h: &super::Host) { + let keys: Vec<(u64, u64)> = { + let seen = h.dom.point_nodes.borrow(); + if seen.is_empty() { + return; + } + let s = h.session.borrow(); + let mut docs = h.dom.point_docs.borrow_mut(); + // The documents that changed since the last look, kept as they are now. + let mut changed = std::collections::HashSet::new(); + for (uid, _) in seen.keys() { + if changed.contains(uid) { + continue; + } + match s.documents().iter().find(|d| d.uid == *uid) { + Some(st) if docs.get(uid).is_some_and(|d| Arc::ptr_eq(d, &st.doc)) => {} + Some(st) => { + docs.insert(*uid, st.doc.clone()); + changed.insert(*uid); + } + None => { + docs.remove(uid); + changed.insert(*uid); + } + } + } + seen.keys().copied().filter(|(uid, _)| changed.contains(uid)).collect() + }; + let editing = h.dom.editing.get(); + for (uid, id) in keys { + let own = || match editing { + Some(e) if e.doc.uid == uid => { + let s = h.session.borrow(); + let id = NodeId(id); + id == e.id || s.documents().iter().find(|d| d.uid == uid).and_then(|st| st.doc.ancestry(id)).is_some_and(|a| a.contains(&e.id)) + } + _ => false, + }; + see_points(h, (uid, id), own); + } +} + fn points_at(h: &super::Host, a: &[Data]) -> Answer { let item = points_path(h, a)?; let Data::Number(n) = arg(a, 1) else { return Ok(Data::Undefined) }; diff --git a/crates/engine/src/script/mod.rs b/crates/engine/src/script/mod.rs index 82d013e076..3019b147b8 100644 --- a/crates/engine/src/script/mod.rs +++ b/crates/engine/src/script/mod.rs @@ -1350,6 +1350,9 @@ fn command_value(host: &Host, id: &str, params: &Value) -> std::result::Result<( return Err(HostError::Abort(HISTORY_LOST.to_string())); } } + if crossed.is_ok() { + dom::see_points(host); + } crossed.map(|data| (data, value)) } diff --git a/crates/engine/src/tests/script_dom_paths.rs b/crates/engine/src/tests/script_dom_paths.rs index 5aff4e48d1..2dbf3263b9 100644 --- a/crates/engine/src/tests/script_dom_paths.rs +++ b/crates/engine/src/tests/script_dom_paths.rs @@ -284,6 +284,44 @@ fn points_read_before_a_removal_or_replacement_go_stale() { ); } +#[test] +fn points_read_before_a_command_changes_the_path_go_stale() { + let (mut s, a, _) = doc(); + let source = format!( + "function A(x, y) {{ return {{x: x, y: y, in: [x, y], out: [x, y], smooth: false}}; }}\ + var p = app.activeDocument.pathItems[0], id = {id}, first = p.pathPoints[1];\ + vc.run('path.setAnchors', {{id: id, subpaths: [{{anchors: [A(0, 0), A(20, 0), A(20, 20), A(0, 20)], closed: true}}]}});\ + try {{ first.anchor = [1, 1]; }} catch (e) {{ vc.log(e.message); }} try {{ first.anchor; }} catch (e) {{ vc.log(e.message); }}\ + var second = p.pathPoints[1]; vc.log(second.anchor);\ + vc.run('stroke.set', {{ids: [id], weight: 3}}); vc.log(second.anchor);\ + p.translate(5, 0); vc.log(second.anchor);\ + vc.run('object.move', {{ids: [id], dx: 5, dy: 0}}); try {{ second.anchor; }} catch (e) {{ vc.log(e.message); }}\ + var third = p.pathPoints[1]; vc.log(third.anchor);\ + vc.run('object.move', {{ids: [id], dx: 5, dy: 0}}); vc.run('edit.undo');\ + try {{ third.anchor; }} catch (e) {{ vc.log(e.message); }} vc.log(p.pathPoints.length);\ + var fourth = p.pathPoints[1]; vc.run('edit.clear', {{ids: [id]}}); vc.run('edit.undo');\ + try {{ fourth.anchor; }} catch (e) {{ vc.log(e.message); }} vc.log(p.pathPoints.length);", + id = a.0 + ); + let out = log(&mut s, &source); + assert_eq!( + out, + vec![ + json!("Stale path point"), + json!("Stale path point"), + json!([20, 300]), + json!([20, 300]), + json!([25, 300]), + json!("Stale path point"), + json!([30, 300]), + json!("Stale path point"), + json!(4), + json!("Stale path point"), + json!(4) + ] + ); +} + #[test] fn fill_color_round_trips_rgb_cmyk_gray_lab() { let (mut s, a, _) = doc(); diff --git a/docs/mcp.md b/docs/mcp.md index 4b82232fb6..9371a4857d 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2716,7 +2716,10 @@ app through the global object `vc`, and writes to the Script Console and runs ot points with no handles, keeping the path closed when it was; moving `anchor` leaves its handles where they are, and `pointType` changes only the type; `PathPoints.add()` adds a corner point at the last point, or at `[0, 0]`; a point whose index is past the end of its path throws `Stale path point`, and so does a point read before the script removed - a point of its path (`remove()`, `removeAll()`) or replaced its points (`setEntirePath`). Color components left out + a point of its path (`remove()`, `removeAll()`) or replaced its points (`setEntirePath`), or before anything other + than the object model changed the path's points (a command run with `vc.run`, such as `path.setAnchors`, + `object.move` or `edit.undo`); points stay valid through the object model's other changes to the path or to an + object that holds it, such as `translate()`. Color components left out count as 0, `new cmykColor()` makes a `CMYKColor`, `LabColor.l` is 0 to 100 and `a` and `b` are -128 to 128, and a component out of range throws a `RangeError` when the color is assigned, with nothing changed. A component reads with the fewest From bb931b5df738740dfe129c5eb4e6df5e96ba6802 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 21 Nov 2026 18:23:50 -0800 Subject: [PATCH 06/61] Scripts: file.new rejects rows that are not a whole number from 1 to 1000 artboardLayout.rows rounded a fractional count and lowered a count over 1000 to 1000, so file.new made a different grid from the one asked for. It now throws for both, and docs/mcp.md states the range. --- crates/engine/src/cmd/newdoc.rs | 18 +++++++++++++++--- crates/engine/src/tests/newdoc.rs | 2 ++ crates/engine/src/tests/script_dom.rs | 2 +- docs/mcp.md | 2 +- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/cmd/newdoc.rs b/crates/engine/src/cmd/newdoc.rs index 983ef4041d..ee2767d1df 100644 --- a/crates/engine/src/cmd/newdoc.rs +++ b/crates/engine/src/cmd/newdoc.rs @@ -371,12 +371,24 @@ impl DocSettings { return Ok(()); } let o = l.as_object().ok_or_else(|| bad(cmd, "artboardLayout must be {layout?, columns?, spacing?, rightToLeft?}"))?; - let count = |v: &Value| v.as_f64().filter(|c| c.is_finite() && *c >= 1.0).map(|c| c.round().min(MAX_ARTBOARDS as f64) as u32); for (k, v) in o { match k.as_str() { "layout" => self.layout = v.as_str().and_then(ArtboardLayout::parse).ok_or_else(bad_layout)?, - "columns" => self.columns = count(v).ok_or_else(|| bad(cmd, "artboardLayout.columns must be 1 or more"))?, - "rows" => self.rows = count(v).ok_or_else(|| bad(cmd, "artboardLayout.rows must be 1 or more"))?, + "columns" => { + self.columns = v + .as_f64() + .filter(|c| c.is_finite() && *c >= 1.0) + .ok_or_else(|| bad(cmd, "artboardLayout.columns must be 1 or more"))? + .round() + .min(MAX_ARTBOARDS as f64) as u32 + } + "rows" => { + self.rows = v + .as_f64() + .filter(|r| r.fract() == 0.0 && (1.0..=MAX_ARTBOARDS as f64).contains(r)) + .map(|r| r as u32) + .ok_or_else(|| bad(cmd, format!("artboardLayout.rows must be a whole number from 1 to {MAX_ARTBOARDS}")))? + } "spacing" => { self.spacing = v .as_f64() diff --git a/crates/engine/src/tests/newdoc.rs b/crates/engine/src/tests/newdoc.rs index edf27aaf2a..a438430379 100644 --- a/crates/engine/src/tests/newdoc.rs +++ b/crates/engine/src/tests/newdoc.rs @@ -161,6 +161,8 @@ fn ppi_overprint_preview_and_bad_params() { json!({"artboardLayout": {"layout": "spiral"}}), json!({"artboardLayout": {"columns": 0}}), json!({"artboardLayout": {"rows": 0}}), + json!({"artboardLayout": {"layout": "gridByColumn", "rows": 1.5}}), + json!({"artboardLayout": {"layout": "gridByColumn", "rows": 1001}}), json!({"artboardLayout": {"tiles": 2}}), json!({"units": "furlongs"}), json!({"width": 160000, "artboards": 1000}), diff --git a/crates/engine/src/tests/script_dom.rs b/crates/engine/src/tests/script_dom.rs index 774ff2b165..e1288b233c 100644 --- a/crates/engine/src/tests/script_dom.rs +++ b/crates/engine/src/tests/script_dom.rs @@ -483,7 +483,7 @@ fn file_new_takes_the_rows_of_a_grid_by_column() { assert_eq!((by_row.rows, by_row.to_json()["artboardLayout"].get("rows")), (0, None), "{layout}"); } let e = s.execute("file.new", &json!({"artboardLayout": {"layout": "gridByColumn", "rows": 0}})).unwrap_err().to_string(); - assert!(e.contains("rows must be 1 or more"), "{e}"); + assert!(e.contains("rows must be a whole number from 1 to 1000"), "{e}"); for layout in ["gridByRow", "row", "column"] { let e = s.execute("file.new", &json!({"artboardLayout": {"layout": layout, "rows": 2}})).unwrap_err().to_string(); assert!(e.contains("rows needs the gridByColumn layout"), "{layout}: {e}"); diff --git a/docs/mcp.md b/docs/mcp.md index 9371a4857d..3b2ec0f6b1 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -8918,7 +8918,7 @@ and goes back to Document Setup, whose OK runs `document.setup`; its Cancel goes `file.new` takes everything New Document sets: `preset` (a name from `file.newPresets`), `name`, `width`/`height` (points, or lengths such as `"210 mm"`), `units`, `orientation`, `artboards` with `artboardLayout {layout, columns, -rows, spacing, rightToLeft}` (`rows` gives a `gridByColumn` layout that many rows, at most one for each artboard, in place of `columns`, and is +rows, spacing, rightToLeft}` (`rows`, a whole number from 1 to 1000, gives a `gridByColumn` layout that many rows, at most one for each artboard, in place of `columns`, and is an error with another layout; a preset keeps the rows, and `file.newPresets` lists them as set even when there are fewer artboards, until `columns` without `rows`, or another layout, is given; New Document's Columns shows the columns the rows give the current number of artboards, and New Document drops the rows when Columns or the layout changes), From 74fefce46fdeaf76acb857d58f0bce7f77b71ba8 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 21 Nov 2026 18:50:26 -0800 Subject: [PATCH 07/61] Scripts: assigning selected keeps other objects' direct-selected anchors Setting a page item's `selected` rebuilt the selection with select.set, which selects every object whole, so the direct-selected anchors and segments of the other selected objects were lost. When another object has some, the selection is now rebuilt the way an edit restores it, with only the item added or removed. --- crates/engine/src/script/dom.rs | 22 +++++++++++++++++++++- crates/engine/src/tests/script_dom.rs | 15 +++++++++++++++ docs/mcp.md | 3 ++- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/script/dom.rs b/crates/engine/src/script/dom.rs index dd47eb00f3..6544309c8c 100644 --- a/crates/engine/src/script/dom.rs +++ b/crates/engine/src/script/dom.rs @@ -1373,7 +1373,27 @@ fn item_set_selected(h: &Host, a: &[Data]) -> Answer { } else { ids.retain(|i| *i != item.id); } - set_selection(h, item.doc, ids) + // The direct-selected anchors and segments of the other objects stay selected. + let partial = with_doc(h, item.doc, |_, st| { + let sel = &st.selection; + let plain = sel.target.is_none() && sel.symbol_part.is_none() && sel.on_path_member.is_none() && sel.slices.is_empty(); + (plain && ids.iter().any(|i| sel.anchors.contains_key(i) || sel.segments.contains_key(i))).then(|| { + let mut next = sel.clone(); + next.objects.clone_from(&ids); + next.anchors.retain(|i, _| ids.contains(i)); + next.segments.retain(|i, _| ids.contains(i)); + next.key = next.key.filter(|k| ids.contains(k)); + next.key_anchor = next.key_anchor.filter(|(k, _)| ids.contains(k)); + (st.doc.clone(), next) + }) + }); + match partial { + Some((doc, next)) => { + on_doc(h, item.doc.uid, false, |h| restore_selection(h, &doc, &next))?; + Ok(Data::Undefined) + } + None => set_selection(h, item.doc, ids), + } } /// The item's geometric bounds (`visual`: its visible bounds) in document coordinates and the diff --git a/crates/engine/src/tests/script_dom.rs b/crates/engine/src/tests/script_dom.rs index e1288b233c..36a06aa78e 100644 --- a/crates/engine/src/tests/script_dom.rs +++ b/crates/engine/src/tests/script_dom.rs @@ -536,6 +536,21 @@ fn an_edit_keeps_direct_selected_anchors() { assert!(s.journal.iter().any(|(id, _)| id == "select.anchorsMany"), "the journal holds the restore"); } +#[test] +fn selecting_an_item_keeps_the_direct_selected_anchors_of_others() { + let (mut s, a, b) = doc(); + s.execute("select.anchors", &json!({"id": a.0, "anchors": [[0, 1]], "mode": "set"})).unwrap(); + s.execute("select.add", &json!({"ids": [b.0]})).unwrap(); + let anchors = s.active().unwrap().selection.anchors.clone(); + assert!(anchors.contains_key(&a)); + log(&mut s, "app.activeDocument.pageItems[1].selected = false;"); + let sel = &s.active().unwrap().selection; + assert_eq!((sel.objects.clone(), sel.anchors.clone()), (vec![a], anchors.clone())); + log(&mut s, "app.activeDocument.pageItems[1].selected = true;"); + let sel = &s.active().unwrap().selection; + assert_eq!((sel.objects.clone(), sel.anchors.get(&a)), (vec![a, b], anchors.get(&a))); +} + #[test] fn an_edit_keeps_the_order_of_a_mixed_selection() { let (mut s, a, b) = doc(); diff --git a/docs/mcp.md b/docs/mcp.md index 3b2ec0f6b1..e59fa68b9d 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2672,7 +2672,8 @@ app through the global object `vc`, and writes to the Script Console and runs ot `Not found`; and `app.activeDocument` with no document open throws `No active document`. `Document.selection` takes one page item, a list of at most 10,000, `null` or `[]`, and an object that cannot be selected throws `Cannot select` with - nothing changed. `getIsFileOpen` compares the path with the open documents' files as text (in a Windows path, + nothing changed. Assigning a page item's `selected` leaves the direct-selected anchors and segments of the other + selected objects selected. `getIsFileOpen` compares the path with the open documents' files as text (in a Windows path, letter case is ignored and `\` matches `/`) and does not resolve the path it is given. A document counts only when the automation read roots allow its file, and that check can look the document's file up on disk. A path with `..`, a network path, a NUL character or more than 4,096 bytes throws an error. Some members the Application, From 262090d75a065873e87a84411ccf2b044c785e80 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 23 Nov 2026 11:06:19 -0800 Subject: [PATCH 08/61] Scripts: path points read and set their selection, and guides can be assigned PathPoint.selected and PathItem.selectedPathPoints threw an error that said they were not available yet, and PathItem.guides could only be read. selected now reads PathPointSelection.ANCHORPOINT for a selected anchor point and NOSELECTION otherwise, and assigning either adds or removes the point with select.anchorsMany, keeping the other selected objects and anchors. Every point of a path selected as a whole counts as selected. Direction handles cannot be selected on their own, so the handle values throw an error. selectedPathPoints lists the selected points in pathPoints order. Assigning guides makes the path a guide or a path again with view.guides.make or view.guides.release, keeping the selection; a value that is not a boolean throws a TypeError, and a clipping path cannot be made a guide. A value the point or path already has runs no command. https://ai-scripting.docsforadobe.dev/jsobjref/PathPoint/ https://ai-scripting.docsforadobe.dev/jsobjref/PathItem/ --- crates/engine/src/script/dom/paths.rs | 146 ++++++++++++++++-- crates/engine/src/tests/script_dom_paths.rs | 99 ++++++++++++ .../tests/it/script_host_vs_scriptcheck.rs | 4 +- docs/gaps.md | 4 +- docs/mcp.md | 26 +++- docs/roadmap.md | 2 +- docs/target-app-parity.md | 2 +- 7 files changed, 254 insertions(+), 29 deletions(-) diff --git a/crates/engine/src/script/dom/paths.rs b/crates/engine/src/script/dom/paths.rs index 32401db1d0..a3b75cc6ff 100644 --- a/crates/engine/src/script/dom/paths.rs +++ b/crates/engine/src/script/dom/paths.rs @@ -39,6 +39,11 @@ //! says it is not available yet. `rotateAbout` and `scaleAbout` default to //! `Transformation.CENTER`. A transform that leaves the path where it is (`rotate(360)`, //! `resize(100, 100)`) checks its arguments and runs no command, on a path with no points too. +//! - `PathPoint.selected` and `selectedPathPoints` count every point of a path selected as a whole +//! as a selected anchor point, and not the endpoints of selected segments; a path in a selected +//! group is not selected as a whole. Direction handles are not selected on their own, so +//! `LEFTDIRECTION`, `RIGHTDIRECTION` and `LEFTRIGHTPOINT` throw an error that says they are not +//! available yet. A clipping path cannot be made a guide. //! - The transforms take one setting for fill and stroke patterns, so `changeFillPatterns` and //! `changeStrokePattern` given as different values throw an error; gradients move with the art, //! so `changeFillGradients` false throws an error that says it is not available yet. @@ -585,6 +590,39 @@ fn path_guides(h: &super::Host, a: &[Data]) -> Answer { read_path(h, item, |_, n, _| Data::Bool(matches!(n.kind, NodeKind::Path { guide: true, .. }))) } +/// `guides = true` makes the path a guide with `view.guides.make`, and `false` makes it a path again +/// with `view.guides.release`; the selection stays as it was. A clipping path cannot be a guide. +fn path_set_guides(h: &super::Host, a: &[Data]) -> Answer { + let on = boolean(arg(a, 1), "guides")?; + let item = this_path(h, a)?; + let (now, clipping) = read_path(h, item, |_, n, _| match &n.kind { + NodeKind::Path { guide, clipping, .. } => (*guide, *clipping), + _ => (false, false), + })?; + if now == on { + return Ok(Data::Undefined); + } + if !with_doc(h, item.doc, |_, st| editable(&st.doc, item.id)) { + return Err(cannot_edit(item.id)); + } + if !on { + edit_path(h, item, "view.guides.release", json!({}))?; + return Ok(Data::Undefined); + } + if clipping { + return Err(HostError::Error(format!("Cannot make PathItem {} a guide: it is a clipping path", item.id.0))); + } + see_all_points(h); + let kept = h.dom.editing.replace(Some(item)); + let r = on_doc(h, item.doc.uid, true, |h| { + command(h, "select.set", &json!({"ids": [item.id.0]}))?; + command(h, "view.guides.make", &json!({})) + }); + h.dom.editing.set(kept); + r?; + Ok(Data::Undefined) +} + fn path_clipping(h: &super::Host, a: &[Data]) -> Answer { let item = this_path(h, a)?; read_path(h, item, |_, n, _| Data::Bool(matches!(n.kind, NodeKind::Path { clipping: true, .. }))) @@ -1323,6 +1361,86 @@ fn pt_parent(h: &super::Host, a: &[Data]) -> Answer { Ok(path_ref(h, item)) } +/// The point at index `i` of `subs` is a selected anchor point of the path `id` in `sel`: every +/// point of a path selected as a whole is, and of a path with direct-selected anchors only those +/// anchors are. The endpoints of selected segments are not. +fn anchor_selected(sel: &crate::doc::Selection, id: NodeId, subs: &[SubPath], i: usize) -> bool { + if !sel.contains(id) || sel.segments.contains_key(&id) { + return false; + } + match sel.partial(id) { + None => true, + Some(picked) => locate(subs, i).is_some_and(|r| picked.contains(&r)), + } +} + +/// `selected`: `PathPointSelection.ANCHORPOINT` when the point is a selected anchor point +/// ([`anchor_selected`]), otherwise `PathPointSelection.NOSELECTION`. +fn pt_selected(h: &super::Host, a: &[Data]) -> Answer { + let (item, i) = this_point(h, a)?; + let on = read_path(h, item, |st, _, pd| anchor_selected(&st.selection, item.id, &pd.subpaths, i))?; + Ok(Data::String(if on { "PathPointSelection.ANCHORPOINT" } else { "PathPointSelection.NOSELECTION" }.into())) +} + +/// The `PathPointSelection` values that select a point's direction handles. +const HANDLE_SELECTIONS: &[&str] = &["PathPointSelection.LEFTDIRECTION", "PathPointSelection.RIGHTDIRECTION", "PathPointSelection.LEFTRIGHTPOINT"]; + +/// `selected = PathPointSelection.ANCHORPOINT` adds the point to the direct-selected anchors, and +/// `NOSELECTION` removes it, with `select.anchorsMany`; the other selected objects and anchors stay +/// selected. A value the point has already runs no command. Direction handles cannot be selected, +/// so `LEFTDIRECTION`, `RIGHTDIRECTION` and `LEFTRIGHTPOINT` throw an error. +fn pt_set_selected(h: &super::Host, a: &[Data]) -> Answer { + let on = match arg(a, 1) { + Data::String(s) if s == "PathPointSelection.ANCHORPOINT" => true, + Data::String(s) if s == "PathPointSelection.NOSELECTION" => false, + Data::String(s) if HANDLE_SELECTIONS.contains(&s.as_str()) => { + return Err(HostError::Error(format!("PathPoint.selected = {s} is not available yet: only anchor points can be selected"))); + } + _ => return Err(HostError::Type("selected must be a PathPointSelection value".into())), + }; + let (item, i) = this_point(h, a)?; + let (now, at, selectable) = with_doc(h, item.doc, |_, st| { + let subs = st.doc.node(item.id).and_then(|n| n.path_data()).map_or(&[][..], |pd| &pd.subpaths[..]); + let selectable = crate::cmd::select::is_selectable(&st.doc, st.isolation, &st.doc.locked_artboards(), item.id); + (anchor_selected(&st.selection, item.id, subs, i), locate(subs, i), selectable) + }); + if now == on { + return Ok(Data::Undefined); + } + let Some((s, j)) = at else { return Err(HostError::Error(STALE_POINT.into())) }; + if on && !selectable { + return Err(HostError::Error(format!("Cannot select PathItem {}", item.id.0))); + } + let params = json!({"items": [{"id": item.id.0, "anchors": [[s, j]]}], "mode": if on { "add" } else { "subtract" }}); + on_doc(h, item.doc.uid, false, |h| command(h, "select.anchorsMany", ¶ms))?; + Ok(Data::Undefined) +} + +/// `selectedPathPoints`: the points that are selected anchor points ([`anchor_selected`]), in the +/// order of `pathPoints`. +fn path_selected_points(h: &super::Host, a: &[Data]) -> Answer { + let item = this_path(h, a)?; + let picked: Vec = read_path(h, item, |st, _, pd| { + let sel = &st.selection; + if !sel.contains(item.id) || sel.segments.contains_key(&item.id) { + return Vec::new(); + } + let mut out = Vec::new(); + let mut first = 0; + for (s, sp) in pd.subpaths.iter().enumerate() { + let n = sp.anchors.len(); + out.extend((0..n).filter(|j| sel.partial(item.id).is_none_or(|p| p.contains(&(s, *j)))).map(|j| first + j)); + first += n; + } + out + })?; + h.charge_call(picked.len() as u64)?; + let [high, low] = id_parts(item.id); + let cuts = float(point_cuts(h, item)); + let points = picked.into_iter().map(|i| host_ref("PathPoint", &[float(h.run), float(item.doc.uid), high, low, float(i as u64), cuts])).collect(); + Ok(Data::Array(points)) +} + /// `remove()`: deletes the point; a subpath left with no points goes too. fn pt_remove(h: &super::Host, a: &[Data]) -> Answer { let (item, i) = this_point(h, a)?; @@ -1350,7 +1468,7 @@ pub(super) fn path_item_members(l: &Link) -> Vec<(String, HostMember)> { ("evenodd", property(l, path_evenodd, path_set_evenodd)), ("area", get(l, path_area)), ("length", get(l, path_length)), - ("guides", get(l, path_guides)), + ("guides", property(l, path_guides, path_set_guides)), ("clipping", get(l, path_clipping)), ("setEntirePath", point_method(l, path_set_entire)), ("filled", property(l, path_filled, path_set_filled)), @@ -1368,8 +1486,9 @@ pub(super) fn path_item_members(l: &Link) -> Vec<(String, HostMember)> { ("translate", method(l, path_translate)), ("rotate", method(l, path_rotate)), ("resize", method(l, path_resize)), + ("selectedPathPoints", get(l, path_selected_points)), ]); - m.extend(["selectedPathPoints", "polarity", "resolution"].into_iter().map(|n| later(l, "PathItem", n))); + m.extend(["polarity", "resolution"].into_iter().map(|n| later(l, "PathItem", n))); m } @@ -1411,19 +1530,16 @@ pub(super) fn classes(l: &Link) -> Vec { class( "PathPoint", None, - { - let mut m = named(vec![ - ("typename", typename_of("PathPoint")), - ("parent", point_get(l, pt_parent)), - ("anchor", point_property(l, pt_anchor, pt_set_anchor)), - ("leftDirection", point_property(l, pt_left, pt_set_left)), - ("rightDirection", point_property(l, pt_right, pt_set_right)), - ("pointType", point_property(l, pt_type, pt_set_type)), - ("remove", point_method(l, pt_remove)), - ]); - m.push(later(l, "PathPoint", "selected")); - m - }, + named(vec![ + ("typename", typename_of("PathPoint")), + ("parent", point_get(l, pt_parent)), + ("anchor", point_property(l, pt_anchor, pt_set_anchor)), + ("leftDirection", point_property(l, pt_left, pt_set_left)), + ("rightDirection", point_property(l, pt_right, pt_set_right)), + ("pointType", point_property(l, pt_type, pt_set_type)), + ("selected", property(l, pt_selected, pt_set_selected)), + ("remove", point_method(l, pt_remove)), + ]), None, ), ] diff --git a/crates/engine/src/tests/script_dom_paths.rs b/crates/engine/src/tests/script_dom_paths.rs index 2dbf3263b9..abe9a1374a 100644 --- a/crates/engine/src/tests/script_dom_paths.rs +++ b/crates/engine/src/tests/script_dom_paths.rs @@ -880,3 +880,102 @@ fn many_path_edits_are_one_undo_step() { assert!((node(&s, id).appearance.stroke_width() - 1.0).abs() < 1e-9); } } + +fn selected_anchors(s: &Session, id: NodeId) -> Option> { + s.active().unwrap().selection.anchors.get(&id).map(|set| set.iter().copied().collect()) +} + +#[test] +fn path_point_selected_selects_and_deselects_anchor_points() { + let (mut s, a, b) = doc(); + s.execute("select.set", &json!({"ids": [b.0]})).unwrap(); + let steps = undo_steps(&s); + let out = log( + &mut s, + "var p = app.activeDocument.pathItems[0], pp = p.pathPoints;\ + vc.log(pp[1].selected); vc.log(p.selectedPathPoints.length);\ + pp[1].selected = PathPointSelection.ANCHORPOINT; pp[2].selected = PathPointSelection.ANCHORPOINT;\ + vc.log(pp[1].selected); vc.log(pp[0].selected); vc.log(p.selected);\ + var sp = p.selectedPathPoints; vc.log(sp.length); vc.log(sp[1].anchor.join() == pp[2].anchor.join());", + ); + assert_eq!( + out, + vec![ + json!("PathPointSelection.NOSELECTION"), + json!(0), + json!("PathPointSelection.ANCHORPOINT"), + json!("PathPointSelection.NOSELECTION"), + json!(true), + json!(2), + json!(true) + ] + ); + assert_eq!(selected_anchors(&s, a), Some(vec![(0, 1), (0, 2)])); + assert!(s.active().unwrap().selection.contains(b), "the other selected object stays selected"); + assert_eq!(undo_steps(&s), steps, "a selection change is not an undo step"); + let r = run( + &mut s, + "var pp = app.activeDocument.pathItems[0].pathPoints;\ + pp[1].selected = PathPointSelection.ANCHORPOINT; pp[0].selected = PathPointSelection.NOSELECTION;", + ) + .unwrap(); + assert_eq!((undo_steps(&s), &r["slowestCommands"]), (steps, &json!([])), "a value the point has runs no command"); + log(&mut s, "app.activeDocument.pathItems[0].pathPoints[1].selected = PathPointSelection.NOSELECTION;"); + assert_eq!(selected_anchors(&s, a), Some(vec![(0, 2)])); +} + +#[test] +fn a_path_selected_as_a_whole_has_every_point_selected() { + let (mut s, a, _) = doc(); + s.execute("select.set", &json!({"ids": [a.0]})).unwrap(); + let out = log( + &mut s, + "var p = app.activeDocument.pathItems[0]; vc.log(p.selectedPathPoints.length); vc.log(p.pathPoints[3].selected);\ + p.pathPoints[0].selected = PathPointSelection.NOSELECTION; vc.log(p.selectedPathPoints.length);\ + vc.log(app.activeDocument.pathItems[1].selectedPathPoints.length);", + ); + assert_eq!(out, vec![json!(4), json!("PathPointSelection.ANCHORPOINT"), json!(3), json!(0)]); + assert_eq!(selected_anchors(&s, a), Some(vec![(0, 1), (0, 2), (0, 3)])); +} + +#[test] +fn path_point_selected_refuses_handles_bad_values_and_locked_paths() { + let (mut s, a, _) = doc(); + let e = failure(&mut s, "app.activeDocument.pathItems[0].pathPoints[0].selected = PathPointSelection.LEFTDIRECTION;"); + assert!(e.contains("not available yet"), "{e}"); + let e = failure(&mut s, "app.activeDocument.pathItems[0].pathPoints[0].selected = true;"); + assert!(e.contains("PathPointSelection"), "{e}"); + s.execute("object.setProps", &json!({"ids": [a.0], "locked": true})).unwrap(); + let e = failure(&mut s, "app.activeDocument.pathItems[0].pathPoints[0].selected = PathPointSelection.ANCHORPOINT;"); + assert!(e.contains("Cannot select"), "{e}"); + assert!(s.active().unwrap().selection.is_empty()); +} + +fn is_guide(s: &Session, id: NodeId) -> bool { + matches!(node(s, id).kind, NodeKind::Path { guide: true, .. }) +} + +#[test] +fn assigning_guides_makes_and_releases_a_guide() { + let (mut s, a, b) = doc(); + s.execute("select.set", &json!({"ids": [b.0]})).unwrap(); + let steps = undo_steps(&s); + let out = log(&mut s, "var p = app.activeDocument.pathItems[0]; p.guides = true; vc.log(p.guides);"); + assert_eq!(out, vec![json!(true)]); + assert!(is_guide(&s, a)); + assert_eq!(s.active().unwrap().selection.objects, vec![b], "the selection stays as it was"); + assert_eq!(undo_steps(&s), steps + 1); + let r = run(&mut s, "app.activeDocument.pathItems[0].guides = true;").unwrap(); + assert_eq!((undo_steps(&s), &r["slowestCommands"]), (steps + 1, &json!([])), "a value the path has runs no command"); + log(&mut s, "app.activeDocument.pathItems[0].guides = false;"); + assert!(!is_guide(&s, a)); + assert_eq!(s.active().unwrap().selection.objects, vec![b]); + let e = failure(&mut s, "app.activeDocument.pathItems[0].guides = 1;"); + assert!(e.contains("guides"), "{e}"); + assert!(!is_guide(&s, a)); + // A path in a group becomes a guide on its own. + s.execute("select.set", &json!({"ids": [b.0]})).unwrap(); + s.execute("object.group", &json!({})).unwrap(); + log(&mut s, "app.activeDocument.pathItems[1].guides = true;"); + assert!(is_guide(&s, b) && !is_guide(&s, a)); +} diff --git a/crates/engine/tests/it/script_host_vs_scriptcheck.rs b/crates/engine/tests/it/script_host_vs_scriptcheck.rs index 24417b2c21..aba7f93c69 100644 --- a/crates/engine/tests/it/script_host_vs_scriptcheck.rs +++ b/crates/engine/tests/it/script_host_vs_scriptcheck.rs @@ -122,8 +122,8 @@ const INSIDE: &[(&str, &str)] = &[ ( "PathItem.prototype.", "area clipping closed closed= constructor evenodd evenodd= fillColor fillColor= fillOverprint fillOverprint= filled \ - filled= guides length pathPoints polarity polarity= resize resolution resolution= rotate selectedPathPoints \ - selectedPathPoints= setEntirePath strokeCap strokeCap= strokeColor strokeColor= strokeDashOffset strokeDashOffset= \ + filled= guides guides= length pathPoints polarity polarity= resize resolution resolution= rotate selectedPathPoints \ + setEntirePath strokeCap strokeCap= strokeColor strokeColor= strokeDashOffset strokeDashOffset= \ strokeDashes strokeDashes= strokeJoin strokeJoin= strokeMiterLimit strokeMiterLimit= strokeOverprint strokeOverprint= \ strokeWidth strokeWidth= stroked stroked= translate", ), diff --git a/docs/gaps.md b/docs/gaps.md index d8184b1a9b..ab16cd29ed 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -807,8 +807,8 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi ## G6 Automation and scripting -- **Missing:** the rest of the document object model for scripts (layers, artboards, type, the selected path - points, gradient stops and the other classes) and the `#engine` script directive (#1183 is open). Scripts have +- **Missing:** the rest of the document object model for scripts (layers, artboards, type, gradient + stops and the other classes) and the `#engine` script directive (#1183 is open). Scripts have `app`, the open documents, new documents, each document's selection and its page items, and `Document.pathItems` makes paths and reads and changes their points, colors, stroke options and transforms. File › Scripts › Other Script… and `script.run` run JavaScript files over the command registry, `#targetengine` runs a script in a named engine whose globals last between runs, diff --git a/docs/mcp.md b/docs/mcp.md index e3d4e634ed..a9b066a528 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2700,8 +2700,8 @@ app through the global object `vc`, and writes to the Script Console and runs ot art is painted. `add()` and the shape creators put the new path on top of the active layer whatever the drawing mode, which stays as it was. A `PathItem` (https://ai-scripting.docsforadobe.dev/jsobjref/PathItem/) adds to the page item members `pathPoints`, `closed`, `evenodd`, `area` (negative for a path that runs counterclockwise), `length`, - `guides`, `clipping`, `setEntirePath(points)`, `filled`, `fillColor`, `fillOverprint`, `stroked`, `strokeColor`, - `strokeOverprint`, `strokeWidth`, `strokeCap`, `strokeJoin`, `strokeMiterLimit` (1 to 500), `strokeDashes`, + `guides`, `clipping`, `selectedPathPoints`, `setEntirePath(points)`, `filled`, `fillColor`, `fillOverprint`, + `stroked`, `strokeColor`, `strokeOverprint`, `strokeWidth`, `strokeCap`, `strokeJoin`, `strokeMiterLimit` (1 to 500), `strokeDashes`, `strokeDashOffset`, `translate(deltaX?, deltaY?, ...)`, `rotate(angle, ..., rotateAbout?)` (counterclockwise for a positive angle) and `resize(scaleX, scaleY, ..., changeLineWidths?, scaleAbout?)`. The geometry changes through `path.setAnchors`, the fill and stroke through `paint.setFill` and `paint.setStroke`, the stroke options through @@ -2713,9 +2713,14 @@ app through the global object `vc`, and writes to the Script Console and runs ot `pathPoints` (https://ai-scripting.docsforadobe.dev/jsobjref/PathPoints/) has `length`, `[i]`, `index(i)`, `add()` and `removeAll()`, and each `PathPoint` (https://ai-scripting.docsforadobe.dev/jsobjref/PathPoint/) has `anchor`, - `leftDirection` (the handle into the point), `rightDirection` (the handle out of it), `pointType`, `parent` and - `remove()`. `new RGBColor()` (0 to 255), `new CMYKColor()` (0 to 100), `new GrayColor()` (0 to 100, 0 black and 100 - white, as https://ai-scripting.docsforadobe.dev/jsobjref/GrayColor/ gives it), `new LabColor()` and `new NoColor()` + `leftDirection` (the handle into the point), `rightDirection` (the handle out of it), `pointType`, `selected`, + `parent` and `remove()`. Assigning `guides` makes the path a guide with `view.guides.make` (`true`) or a path again + with `view.guides.release` (`false`), with the selection kept; a value that is not a boolean throws a `TypeError`. + `PathPoint.selected` reads `PathPointSelection.ANCHORPOINT` for a selected anchor point and + `PathPointSelection.NOSELECTION` otherwise; assigning `ANCHORPOINT` adds the point to the direct-selected anchors and + `NOSELECTION` removes it, through `select.anchorsMany`, with the other selected objects and anchors kept. + `selectedPathPoints` lists the points that read `ANCHORPOINT`, in the order of `pathPoints`. `new RGBColor()` (0 to + 255), `new CMYKColor()` (0 to 100), `new GrayColor()` (0 to 100, 0 black and 100 white, as https://ai-scripting.docsforadobe.dev/jsobjref/GrayColor/ gives it), `new LabColor()` and `new NoColor()` (https://ai-scripting.docsforadobe.dev/jsobjref/NoColor/) make plain color objects; assigning a `NoColor` removes the fill or stroke. The enumerations `PointType`, `PathPointSelection`, `StrokeCap`, `StrokeJoin`, `PolarityValues` and `Transformation` hold strings such as `"StrokeCap.ROUNDENDCAP"`. @@ -2727,7 +2732,12 @@ app through the global object `vc`, and writes to the Script Console and runs ot a point of its path (`remove()`, `removeAll()`) or replaced its points (`setEntirePath`), or before anything other than the object model changed the path's points (a command run with `vc.run`, such as `path.setAnchors`, `object.move` or `edit.undo`); points stay valid through the object model's other changes to the path or to an - object that holds it, such as `translate()`. Color components left out + object that holds it, such as `translate()`. Every point of a path selected as a whole is a selected anchor point, + and the endpoints of selected segments are not; a path is selected as a whole only when it is itself selected, not + when a group that holds it is. Direction handles are not selected on their own, so assigning `LEFTDIRECTION`, + `RIGHTDIRECTION` or `LEFTRIGHTPOINT` to `selected` throws an error that says it is not available yet, and selecting + a point of a path that cannot be selected throws `Cannot select`. A clipping path cannot be made a guide, and + `guides = true` on one throws an error. Color components left out count as 0, `new cmykColor()` makes a `CMYKColor`, `LabColor.l` is 0 to 100 and `a` and `b` are -128 to 128, and a component out of range throws a `RangeError` when the color is assigned, with nothing changed. A component reads with the fewest @@ -2748,8 +2758,8 @@ app through the global object `vc`, and writes to the Script Console and runs ot that is hidden or locked, or that is in a hidden or locked layer or group, throws `Cannot edit` with nothing changed. A path in a compound path or compound shape reads the fill, stroke and overprint of that compound path or shape, which the paint commands paint in its place. A change to a path's paint or stroke leaves the paint for new - art, the active Fill or Stroke proxy and Recent Colors as they were. `selectedPathPoints`, `PathPoint.selected`, - `transform`, `polarity`, the gradient stops and the document's default paint are not available yet. + art, the active Fill or Stroke proxy and Recent Colors as they were. `transform`, `polarity`, the gradient stops and + the document's default paint are not available yet. - `$.write(...values)` writes the values to the Script Console with no separator, each as `String(value)` gives it, and `$.writeln(...values)` does the same and ends the line. Each call counts as a host call. - `$.evalFile(path, timeout?)` runs the file `path` names, relative to the file being run, in the same global diff --git a/docs/roadmap.md b/docs/roadmap.md index 28192e13b9..48cb17110f 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -196,7 +196,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | M10 | Brushes, symbols, patterns, Repeat | 🟡 pattern swatches (5 tile types, Pattern Options, editing mode, SVG ``/PDF export) and live Repeat (radial/grid/mirror) done; interactive selected mirror axis implemented (focused and native checks passed; full CI blocked by an unrelated text test); symbol libraries done (Window › Symbol Libraries, six generated libraries (Basic Shapes, UI Frames, Map Markers, Inventory Icons, Skill Icons, Weather Icons), User Defined, Other Library…, Save Symbols); brush libraries done (Window › Brush Libraries, fifteen generated libraries including Tech Circuit, Decorative, Engraving, Arrows, Stipple, Pressure Sensitive, Ink and Wash, Bristle Brushes and Dry Media, User Defined, Other Library…, Save Brushes); symbol editing shows draggable 9-slice guides (#5280), with guides outside the artwork still unsupported; brushes/symbols in progress | 23–37 | | M11 | Artboards & views (selected-set deletion shared by Artboards menu, trash and Properties, retaining artboard 1 when all are selected; Artboard deletion keys keep the first of an all-selected set and protect artwork; history prunes invalid indices while preserving valid multiselection (history tests and full workspace CI pass); click-to-fit objects with the Artboard tool (#1227), artboard escape routing and document setup modal handoff done; artboard panel/tool with Move Artwork for X/Y fields and Artboard Options, Trim View (hiding the guides and the grid while it is on, #8363), middle-button pan, print tiling and the status bar's artboard navigator with synchronized Artboard tool selection done; Window › Arrange › Tile and Consolidate All Windows done; multiple windows, presentation polish) (cached canvas reprojection preserves scale during resize, rotation and DPI changes; regression-tested and contributor-confirmed 2026-10-19; estimates unchanged) (cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission; regression-tested; estimates unchanged); status-bar pointer coordinates follow the active ruler origin and General units | 🟡; Artboard Options shares existing presets and orientation controls and can fit artwork without moving it; artwork fitting includes all drawn document art across artboards and off-board; artwork bounds are cached by active document and revision, and selection uses the shared bounds cache across artboards | 15–25 | | M12 | Advanced color & art (CMYK/ICC, separations, Gradient Mesh, Live Paint, Image Trace, Graphs) | 🟡 Gradient Mesh, Live Paint, Image Trace (junction-returning pieces retain their positioned boundaries; a simpler contour walk with identical output; an edge's sub-pixel shift is the same from either side; notches read only their own piece; collapsed loops keep few segments; large images trace with a warning; Auto Color keeps rare distinct colours; quick presets trace at once and the Image Trace button opens the adjustment controls; Properties reopens them; tiny fitted contours retain islands and holes; Create Strokes: exact crop EDT, Guo–Hall thinning and maximal-disc graph simplification; 15 presets, the 14 documented ones each with an enhanced version; Ignore Color (manual picker and canvas eyedropper from original pixels, no canvas View change, missed pixels keep the pick armed, Preview/Undo retained; #8068), Shapes, Auto Grouping and Gradients options; measured in `image-trace-quality.md`; closed outlines retain their interior after straightening; the Flat Logo mode places edges to a fraction of a pixel, restores sharp corners, snaps lines and circles, and refuses gradients; live trace result bounds and selection highlights exclude the retained bitmap except in source-image views), Recolor Artwork, colour management (ICC, soft proofing, separations preview), Graphs (all 9 tools, Graph Data/Type, group-selected series colours persist through regenerate/save/open) done; Graph Design and Marker designs, Transpose and Switch x/y, `\|` label line breaks, the pie options, drop shadows, the legend across the top, overlapping widths, First Row/Column in Front, filled lines, kept label formatting and the Graph Data worksheet done; graph Column designs pending; Vector Halftone Preview keeps the selection box without drawing dot selection marks (#6369); Live Paint Bucket fills faces crossed in one drag (#6373) | 6–10 | -| M13 | Automation (Actions ✅ record/playback, persisted; variables, scripting, batch) | 🟡 MCP `add_text` exposes existing vertical point, area and path type; `script.run` and File › Scripts › Other Script… run JavaScript files, and Window › Script Console shows their output; scripts have `app`, the open documents, new documents, each document's selection and its page items, and `Document.pathItems` makes paths and reads and changes their points, colors, stroke options and transforms; the rest of the script document model (layers, artboards, type, the selected path points, gradient stops and the other classes) and batch work remain | 18–27 | +| M13 | Automation (Actions ✅ record/playback, persisted; variables, scripting, batch) | 🟡 MCP `add_text` exposes existing vertical point, area and path type; `script.run` and File › Scripts › Other Script… run JavaScript files, and Window › Script Console shows their output; scripts have `app`, the open documents, new documents, each document's selection and its page items, and `Document.pathItems` makes paths and reads and changes their points, colors, stroke options and transforms; the rest of the script document model (layers, artboards, type, gradient stops and the other classes) and batch work remain | 18–27 | | M14 | 1.0 polish (Asset Export tile context menus implemented for G12; preferences, shortcut editor, workspaces, accessibility, packaging for all OSes) (status messages and readouts use stable responsive allocations sized for localized labels and ordinary coordinates; sample widths cached by language/unit/DPI; regression-tested and contributor-confirmed 2026-10-19; estimates unchanged) | 🟡 Icon-strip flyouts resize on their free edges and retain sizes (#5713); interim macOS cursor delivery (#2292) uses existing artwork and host-owned AppKit cursors; headless coverage only, native menu/focus/handback and display validation pending. Dock groups collapse to their tabs by a double-click on a tab (UI.8); Preferences › General › Constrain Angle acts for the arrow keys, Shift drags and new objects (#394, 2026-10-21); numeric-field pointer selection and focus regression-tested (#1326; a release more than 1 pt from the press keeps the caret, a tap within 1 pt selects all, #6659); RPM runtime capabilities and glibc floor checked (#1275; real-distro install/start-up pending), Eyedropper cursor with precise-setting checks (#1269), Preferences, shortcut editor (chords with Shift and a punctuation key fire as typed; other apps' text shortcut sets imported), workspaces (each keeps its layout changes until Reset , UI.7), Window › Help Bar shown or hidden apart from the status bar and kept in saved workspaces, panels docked by dragging into any dock group (as tabs or a top/bottom split) or into the icon column, and closed from a dock tab's context menu (UI.6), a custom title bar on Windows/Linux with a Home button, content-sized dialogs, menus that scroll when longer than the window and macOS native menu dismissal done (M14.8), and native macOS save sheets with a Format menu (#866); titled PDF exports set `DisplayDocTitle` for viewers and accessibility checkers (#3646) and give the document language as the catalog's `/Lang` (#3644); accessibility and broader Windows/Linux packaging/QA pending; floating tab groups collapse into the side icon rail and opened rail panels fold back into it (#5925, in part), with pointer and native-window regression coverage; estimates unchanged; numeric spinner arrows keep repeating while held with the mouse (#6307); Swatches item context menus tested in all five views and rendered layouts inspected; Linux full CI passed, Windows engine baseline limitations documented (G12); Graphic Styles item context menus in thumbnail and list views with Options, Duplicate, Delete, Redefine, Break Link (#8755); Appearance panel row context menus for strokes, fills, effects, and root object row (Duplicate, Delete, Hide/Show, Edit Effect…, Clear Appearance, Reduce to Basic Appearance) with secondary click row selection (#8809); Character Styles and Paragraph Styles item context menus (panels::text_styles::tests::right_click_context_menu_*); Window > Toolbars > Compact Tools offers optional denser main Tools spacing in one or two columns, with the existing layout still the default (#7234) | 18–28 | | — | Interaction fidelity pass (every tool's modifiers, Properties panel per context, isolation, nuance; width-point creation and adjoining adjustment regression-tested; dialog layout reviewed) | ⬜ (new ruler-guide Alt orientation implemented; existing-guide Escape cancellation regression-tested; broader pass remains) | 60–90 | | — | Hardening at scale (big-file corpus, fuzzing, cross-platform + browser QA) | 🟡 PngSuite integrity and bounded fetching verified (#1729); real-world corpus/manual QA remain | 50–80 | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 72ed713051..7be0c39261 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1025,7 +1025,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - The control server writes each reply through a 64 KiB buffer. On Windows 11 it sends the 17 MB `document.inspect` reply of a document with 50,000 objects on one layer to a client over loopback in 0.09 s instead of 34 s. - Scripts: File › Scripts › Other Script… and `script.run` run a JavaScript file against the open documents as one transaction with one undo step for each changed document. A failed or stopped run puts every document back. `crates/engine/src/tests/script_run.rs`. - Scripts: the global `app` gives the open documents, new documents from a startup preset and a `DocumentPreset`, the active document, each document's selection and its page items with their names, notes, visibility, lock, opacity, position, size, bounds and stacking order, and moves and copies them into or beside other objects, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/Application/, https://ai-scripting.docsforadobe.dev/jsobjref/Documents/, https://ai-scripting.docsforadobe.dev/jsobjref/DocumentPreset/, https://ai-scripting.docsforadobe.dev/jsobjref/Document/, https://ai-scripting.docsforadobe.dev/jsobjref/PageItems/, https://ai-scripting.docsforadobe.dev/jsobjref/PageItem/ and https://ai-scripting.docsforadobe.dev/jsobjref/GroupItem/ describe them; each change runs a command inside the run's transaction (`docs/mcp.md`). Layers, type and the other classes are not there yet. `crates/engine/src/tests/script_dom.rs`. - - Scripts: `Document.pathItems` lists the paths and makes rectangles, rounded rectangles, ellipses, polygons, stars and empty paths with the defaults the help page https://ai-scripting.docsforadobe.dev/jsobjref/PathItems/ gives; each path's points, closed state, fill rule, area, length, fill and stroke colors, stroke options and transforms read and change as https://ai-scripting.docsforadobe.dev/jsobjref/PathItem/, https://ai-scripting.docsforadobe.dev/jsobjref/PathPoints/ and https://ai-scripting.docsforadobe.dev/jsobjref/PathPoint/ describe them, and `RGBColor`, `CMYKColor`, `GrayColor`, `LabColor` and `NoColor` make colors (`docs/mcp.md`). The transforms move gradients with the art: `changeFillGradients` false throws an error, as do `changeFillPatterns` and `changeStrokePattern` given as different values, and `transform` is not there yet (`docs/mcp.md` lists these limits). Gradient stops and the document's default paint are not there yet. `crates/engine/src/tests/script_dom_paths.rs`. + - Scripts: `Document.pathItems` lists the paths and makes rectangles, rounded rectangles, ellipses, polygons, stars and empty paths with the defaults the help page https://ai-scripting.docsforadobe.dev/jsobjref/PathItems/ gives; each path's points, closed state, fill rule, area, length, guide state, selected points, fill and stroke colors, stroke options and transforms read and change as https://ai-scripting.docsforadobe.dev/jsobjref/PathItem/, https://ai-scripting.docsforadobe.dev/jsobjref/PathPoints/ and https://ai-scripting.docsforadobe.dev/jsobjref/PathPoint/ describe them, and `RGBColor`, `CMYKColor`, `GrayColor`, `LabColor` and `NoColor` make colors (`docs/mcp.md`). The transforms move gradients with the art: `changeFillGradients` false throws an error, as do `changeFillPatterns` and `changeStrokePattern` given as different values, and `transform` is not there yet (`docs/mcp.md` lists these limits). Gradient stops and the document's default paint are not there yet. `crates/engine/src/tests/script_dom_paths.rs`. - Scripts: Window › Script Console shows each run's `$.write` and `$.writeln` output, `vc.log` entries, uncaught error with the script's name, line and column, and a report of its time, host calls and slowest commands, keeping at most 2,048 lines and counting the lines it dropped. `script.run`'s report carries the same data, and `script.console`, `script.console.clear` and `ui.copyScriptConsole` read, clear and copy it. `crates/engine/src/tests/script_console.rs`. - Scripts: the status bar translates its own words around a failed run's error and the app's own error messages, and shows text the script threw itself (a value, an error it made, or an error whose name or message it changed) as it is, even when that text reads like one of the app's messages. `script.run`'s report gives `messageOrigin` (`script` or `built-in`), and the advice about objects other applications give their scripts follows only the app's own reference errors. VectorCraft's own rule. `crates/js/src/interp_tests.rs`, `crates/engine/src/tests/script_run.rs`, `crates/ui-egui/src/chrome/tests.rs`. - Scripts: the `$` object has the other members the Dollar object page lists (https://extendscript.docsforadobe.dev/extendscript-tools-features/dollar-object/), from `$.about()` to `$.version`, and scripts have the global `localize(object, ...values)` (https://extendscript.docsforadobe.dev/extendscript-tools-features/localizing-extendscript-strings/), `toSource(value)` and `Object.prototype.toSource()`. Each run starts with the interface's locale, and what a script changes in `$` lasts only for that run. `crates/engine/src/tests/script_dollar.rs`, `crates/js/src/extension_tests.rs`. From dd748796249d63527774b005a7dbe184e1f19e44 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 23 Nov 2026 11:56:32 -0800 Subject: [PATCH 09/61] Scripts: guides refuse compound members and locked guides in both directions Assigning PathItem.guides on a path inside a compound path made every path in that compound a guide, because Make Guides acts on the compound that holds a selected member; it now throws an error that says it is not available yet, as duplicate and zOrder do for compound members. While guides are locked, assigning false threw and assigning true succeeded; now either value throws when it would change the path. A path that cannot be selected, for example one outside the isolated group or on a locked artboard, throws Cannot edit before any command runs. Assigning the value a path already has runs no command and throws no error. These are VectorCraft's own rules, and docs/mcp.md lists them with the other rules of its own. Tests cover a compound path member, a clipping path, a locked and a hidden path, the guide lock in both directions, a path in a group of two, and the TypeError name for a value that is not a boolean. --- crates/engine/src/script/dom/paths.rs | 24 +++++++- crates/engine/src/tests/script_dom_paths.rs | 65 +++++++++++++++++++-- docs/mcp.md | 7 ++- 3 files changed, 86 insertions(+), 10 deletions(-) diff --git a/crates/engine/src/script/dom/paths.rs b/crates/engine/src/script/dom/paths.rs index a3b75cc6ff..bf61be91a5 100644 --- a/crates/engine/src/script/dom/paths.rs +++ b/crates/engine/src/script/dom/paths.rs @@ -43,7 +43,9 @@ //! as a selected anchor point, and not the endpoints of selected segments; a path in a selected //! group is not selected as a whole. Direction handles are not selected on their own, so //! `LEFTDIRECTION`, `RIGHTDIRECTION` and `LEFTRIGHTPOINT` throw an error that says they are not -//! available yet. A clipping path cannot be made a guide. +//! available yet. A clipping path cannot be made a guide. Assigning `guides` on a path inside a +//! compound path throws an error that says it is not available yet, on a path that cannot be +//! edited or selected throws `Cannot edit`, and while guides are locked throws an error. //! - The transforms take one setting for fill and stroke patterns, so `changeFillPatterns` and //! `changeStrokePattern` given as different values throw an error; gradients move with the art, //! so `changeFillGradients` false throws an error that says it is not available yet. @@ -590,8 +592,13 @@ fn path_guides(h: &super::Host, a: &[Data]) -> Answer { read_path(h, item, |_, n, _| Data::Bool(matches!(n.kind, NodeKind::Path { guide: true, .. }))) } +/// The error of assigning `guides` on a path inside a compound path. +pub const COMPOUND_MEMBER_GUIDES: &str = "Changing guides on a path inside a compound path is not available yet"; + /// `guides = true` makes the path a guide with `view.guides.make`, and `false` makes it a path again -/// with `view.guides.release`; the selection stays as it was. A clipping path cannot be a guide. +/// with `view.guides.release`; the selection stays as it was. A clipping path cannot be a guide, a +/// path inside a compound path throws [`COMPOUND_MEMBER_GUIDES`], and while guides are locked both +/// values throw an error. fn path_set_guides(h: &super::Host, a: &[Data]) -> Answer { let on = boolean(arg(a, 1), "guides")?; let item = this_path(h, a)?; @@ -602,9 +609,20 @@ fn path_set_guides(h: &super::Host, a: &[Data]) -> Answer { if now == on { return Ok(Data::Undefined); } - if !with_doc(h, item.doc, |_, st| editable(&st.doc, item.id)) { + let (member, editable, selectable) = with_doc(h, item.doc, |_, st| { + let member = st.doc.parent_of(item.id).and_then(|p| st.doc.node(p)).is_some_and(|p| matches!(p.kind, NodeKind::Compound { .. })); + let selectable = crate::cmd::select::is_selectable(&st.doc, st.isolation, &st.doc.locked_artboards(), item.id); + (member, editable(&st.doc, item.id), selectable) + }); + if member { + return Err(HostError::Error(COMPOUND_MEMBER_GUIDES.into())); + } + if !editable || (on && !selectable) { return Err(cannot_edit(item.id)); } + if h.session.borrow().menu.guides_locked { + return Err(HostError::Error(format!("Cannot change guides on PathItem {}: guides are locked", item.id.0))); + } if !on { edit_path(h, item, "view.guides.release", json!({}))?; return Ok(Data::Undefined); diff --git a/crates/engine/src/tests/script_dom_paths.rs b/crates/engine/src/tests/script_dom_paths.rs index abe9a1374a..b8fdf6673d 100644 --- a/crates/engine/src/tests/script_dom_paths.rs +++ b/crates/engine/src/tests/script_dom_paths.rs @@ -938,6 +938,15 @@ fn a_path_selected_as_a_whole_has_every_point_selected() { assert_eq!(selected_anchors(&s, a), Some(vec![(0, 1), (0, 2), (0, 3)])); } +#[test] +fn a_path_in_a_selected_group_is_not_selected_as_a_whole() { + let (mut s, a, b) = doc(); + s.execute("select.set", &json!({"ids": [a.0, b.0]})).unwrap(); + s.execute("object.group", &json!({})).unwrap(); + let out = log(&mut s, "var ps = app.activeDocument.pathItems; vc.log([ps[0].selectedPathPoints.length, ps[1].selectedPathPoints.length]);"); + assert_eq!(out, vec![json!([0, 0])]); +} + #[test] fn path_point_selected_refuses_handles_bad_values_and_locked_paths() { let (mut s, a, _) = doc(); @@ -970,12 +979,58 @@ fn assigning_guides_makes_and_releases_a_guide() { log(&mut s, "app.activeDocument.pathItems[0].guides = false;"); assert!(!is_guide(&s, a)); assert_eq!(s.active().unwrap().selection.objects, vec![b]); - let e = failure(&mut s, "app.activeDocument.pathItems[0].guides = 1;"); - assert!(e.contains("guides"), "{e}"); + let out = log(&mut s, "try { app.activeDocument.pathItems[0].guides = 1; } catch (e) { vc.log(e.name); }"); + assert_eq!(out, vec![json!("TypeError")]); assert!(!is_guide(&s, a)); - // A path in a group becomes a guide on its own. - s.execute("select.set", &json!({"ids": [b.0]})).unwrap(); + // A path in a group becomes a guide on its own; the other path in the group stays a path. + s.execute("select.set", &json!({"ids": [a.0, b.0]})).unwrap(); s.execute("object.group", &json!({})).unwrap(); + s.execute("select.none", &json!({})).unwrap(); log(&mut s, "app.activeDocument.pathItems[1].guides = true;"); - assert!(is_guide(&s, b) && !is_guide(&s, a)); + assert!(is_guide(&s, a) != is_guide(&s, b), "only the assigned path in the group is a guide"); +} + +#[test] +fn assigning_guides_refuses_compound_members_clipping_paths_and_paths_that_cannot_be_edited() { + let (mut s, a, b) = doc(); + s.execute("select.set", &json!({"ids": [a.0, b.0]})).unwrap(); + s.execute("object.compoundPath.make", &json!({})).unwrap(); + s.execute("select.none", &json!({})).unwrap(); + let before = art(&s); + let e = failure(&mut s, "app.activeDocument.pathItems[0].guides = true;"); + assert!(e.contains("compound path"), "{e}"); + assert_eq!((art(&s), is_guide(&s, a), is_guide(&s, b)), (before, false, false), "no member of the compound path changed"); + + let (mut s, a, b) = doc(); + s.execute("select.set", &json!({"ids": [a.0, b.0]})).unwrap(); + s.execute("object.clippingMask.make", &json!({})).unwrap(); + s.execute("select.none", &json!({})).unwrap(); + let before = art(&s); + let e = failure(&mut s, "var ps = app.activeDocument.pathItems; for (var i = 0; i < ps.length; i++) if (ps[i].clipping) ps[i].guides = true;"); + assert!(e.contains("clipping path"), "{e}"); + assert_eq!(art(&s), before); + + for cmd in ["object.lock", "object.hide"] { + let (mut s, a, _) = doc(); + s.execute("select.set", &json!({"ids": [a.0]})).unwrap(); + s.execute(cmd, &json!({})).unwrap(); + s.execute("select.none", &json!({})).unwrap(); + let e = failure(&mut s, "app.activeDocument.pathItems[0].guides = true;"); + assert!(e.contains("Cannot edit"), "{cmd}: {e}"); + assert!(!is_guide(&s, a), "{cmd}"); + } +} + +#[test] +fn assigning_guides_throws_in_both_directions_while_guides_are_locked() { + let (mut s, a, b) = doc(); + log(&mut s, "app.activeDocument.pathItems[0].guides = true;"); + assert!(is_guide(&s, a)); + s.set_guides_locked(true); + let steps = undo_steps(&s); + let e = failure(&mut s, "app.activeDocument.pathItems[0].guides = false;"); + assert!(e.contains("guides are locked"), "{e}"); + let e = failure(&mut s, "app.activeDocument.pathItems[1].guides = true;"); + assert!(e.contains("guides are locked"), "{e}"); + assert_eq!((is_guide(&s, a), is_guide(&s, b), undo_steps(&s)), (true, false, steps)); } diff --git a/docs/mcp.md b/docs/mcp.md index a9b066a528..78a863a2b1 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2720,7 +2720,8 @@ app through the global object `vc`, and writes to the Script Console and runs ot `PathPointSelection.NOSELECTION` otherwise; assigning `ANCHORPOINT` adds the point to the direct-selected anchors and `NOSELECTION` removes it, through `select.anchorsMany`, with the other selected objects and anchors kept. `selectedPathPoints` lists the points that read `ANCHORPOINT`, in the order of `pathPoints`. `new RGBColor()` (0 to - 255), `new CMYKColor()` (0 to 100), `new GrayColor()` (0 to 100, 0 black and 100 white, as https://ai-scripting.docsforadobe.dev/jsobjref/GrayColor/ gives it), `new LabColor()` and `new NoColor()` + 255), `new CMYKColor()` (0 to 100), `new GrayColor()` (0 to 100, 0 black and 100 white, as + https://ai-scripting.docsforadobe.dev/jsobjref/GrayColor/ gives it), `new LabColor()` and `new NoColor()` (https://ai-scripting.docsforadobe.dev/jsobjref/NoColor/) make plain color objects; assigning a `NoColor` removes the fill or stroke. The enumerations `PointType`, `PathPointSelection`, `StrokeCap`, `StrokeJoin`, `PolarityValues` and `Transformation` hold strings such as `"StrokeCap.ROUNDENDCAP"`. @@ -2737,7 +2738,9 @@ app through the global object `vc`, and writes to the Script Console and runs ot when a group that holds it is. Direction handles are not selected on their own, so assigning `LEFTDIRECTION`, `RIGHTDIRECTION` or `LEFTRIGHTPOINT` to `selected` throws an error that says it is not available yet, and selecting a point of a path that cannot be selected throws `Cannot select`. A clipping path cannot be made a guide, and - `guides = true` on one throws an error. Color components left out + `guides = true` on one throws an error; assigning `guides` on a path inside a compound path throws an error that says + it is not available yet, on a path that is hidden, locked or cannot be selected throws `Cannot edit`, and while + guides are locked throws an error for either value. Color components left out count as 0, `new cmykColor()` makes a `CMYKColor`, `LabColor.l` is 0 to 100 and `a` and `b` are -128 to 128, and a component out of range throws a `RangeError` when the color is assigned, with nothing changed. A component reads with the fewest From fbc057f8b0ee3f5cbca178e9c114b3c873f6a5ea Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 23 Nov 2026 12:36:17 -0800 Subject: [PATCH 10/61] Scripts: points of a path in a selected group read as selected PathPoint.selected and PathItem.selectedPathPoints now count a path as selected as a whole when a group or compound path that holds it is selected, as the canvas shows its anchors. Assigning PathPointSelection.NOSELECTION to a point of such a path throws an error that says it is not available yet, and ANCHORPOINT on it runs no command, so the selection is not left holding both the group and one of its paths. Selecting a point of a guide while guides are locked throws an error instead of running a selection that the guide lock undoes. Assigning guides = false on a path that cannot be selected (outside the isolated object) throws Cannot edit, as guides = true does. Reading PathPoint.selected no longer writes the point changes waiting for its path unless they add or remove points, so a loop that reads selected and moves the selected anchors writes the path once. --- crates/engine/src/script/dom/paths.rs | 79 ++++++++++++---- crates/engine/src/tests/script_dom_paths.rs | 100 ++++++++++++++++++-- docs/mcp.md | 16 ++-- 3 files changed, 162 insertions(+), 33 deletions(-) diff --git a/crates/engine/src/script/dom/paths.rs b/crates/engine/src/script/dom/paths.rs index bf61be91a5..db0352750b 100644 --- a/crates/engine/src/script/dom/paths.rs +++ b/crates/engine/src/script/dom/paths.rs @@ -41,11 +41,13 @@ //! `resize(100, 100)`) checks its arguments and runs no command, on a path with no points too. //! - `PathPoint.selected` and `selectedPathPoints` count every point of a path selected as a whole //! as a selected anchor point, and not the endpoints of selected segments; a path in a selected -//! group is not selected as a whole. Direction handles are not selected on their own, so -//! `LEFTDIRECTION`, `RIGHTDIRECTION` and `LEFTRIGHTPOINT` throw an error that says they are not -//! available yet. A clipping path cannot be made a guide. Assigning `guides` on a path inside a -//! compound path throws an error that says it is not available yet, on a path that cannot be -//! edited or selected throws `Cannot edit`, and while guides are locked throws an error. +//! group or compound path is selected as a whole. Direction handles are not selected on their +//! own, so `LEFTDIRECTION`, `RIGHTDIRECTION` and `LEFTRIGHTPOINT` throw an error that says they +//! are not available yet, and so does `NOSELECTION` on a point of a path in a selected group or +//! compound path. Selecting a point of a guide while guides are locked throws an error. A +//! clipping path cannot be made a guide. Assigning `guides` on a path inside a compound path +//! throws an error that says it is not available yet, on a path that cannot be edited or +//! selected throws `Cannot edit` for both values, and while guides are locked throws an error. //! - The transforms take one setting for fill and stroke patterns, so `changeFillPatterns` and //! `changeStrokePattern` given as different values throw an error; gradients move with the art, //! so `changeFillGradients` false throws an error that says it is not available yet. @@ -617,7 +619,7 @@ fn path_set_guides(h: &super::Host, a: &[Data]) -> Answer { if member { return Err(HostError::Error(COMPOUND_MEMBER_GUIDES.into())); } - if !editable || (on && !selectable) { + if !editable || !selectable { return Err(cannot_edit(item.id)); } if h.session.borrow().menu.guides_locked { @@ -1379,10 +1381,20 @@ fn pt_parent(h: &super::Host, a: &[Data]) -> Answer { Ok(path_ref(h, item)) } +/// Whether the path `id` is not selected itself but a group or compound path that holds it is, +/// which selects the path as a whole. +fn held_selected(d: &crate::Document, sel: &crate::doc::Selection, id: NodeId) -> bool { + !sel.contains(id) && d.ancestry(id).is_some_and(|a| a.iter().any(|i| *i != id && sel.contains(*i) && d.node(*i).is_some_and(|n| !n.is_layer()))) +} + /// The point at index `i` of `subs` is a selected anchor point of the path `id` in `sel`: every -/// point of a path selected as a whole is, and of a path with direct-selected anchors only those -/// anchors are. The endpoints of selected segments are not. -fn anchor_selected(sel: &crate::doc::Selection, id: NodeId, subs: &[SubPath], i: usize) -> bool { +/// point of a path selected as a whole is (a path is when a group or compound path that holds it +/// is selected, `held`), and of a path with direct-selected anchors only those anchors are. The +/// endpoints of selected segments are not. +fn anchor_selected(sel: &crate::doc::Selection, id: NodeId, held: bool, subs: &[SubPath], i: usize) -> bool { + if held { + return true; + } if !sel.contains(id) || sel.segments.contains_key(&id) { return false; } @@ -1392,11 +1404,27 @@ fn anchor_selected(sel: &crate::doc::Selection, id: NodeId, subs: &[SubPath], i: } } +/// Whether the subpaths `a` and `b` have the same number of points in the same subpaths, so that a +/// point index names the same anchor in both. +fn same_layout(a: &[SubPath], b: &[SubPath]) -> bool { + a.len() == b.len() && a.iter().zip(b).all(|(x, y)| x.anchors.len() == y.anchors.len()) +} + /// `selected`: `PathPointSelection.ANCHORPOINT` when the point is a selected anchor point -/// ([`anchor_selected`]), otherwise `PathPointSelection.NOSELECTION`. +/// ([`anchor_selected`]), otherwise `PathPointSelection.NOSELECTION`. The point changes waiting in +/// [`super::State`] are written first only when they add or remove points of this path, since +/// the selection names anchors by their place in the document's path. fn pt_selected(h: &super::Host, a: &[Data]) -> Answer { let (item, i) = this_point(h, a)?; - let on = read_path(h, item, |st, _, pd| anchor_selected(&st.selection, item.id, &pd.subpaths, i))?; + let moved = match &*h.dom.pending.borrow() { + Some((waiting, subs)) if same_path(*waiting, item) => !read_path(h, item, |_, _, pd| same_layout(subs, &pd.subpaths))?, + _ => false, + }; + if moved { + super::flush(h)?; + } + let on = + read_path(h, item, |st, _, pd| anchor_selected(&st.selection, item.id, held_selected(&st.doc, &st.selection, item.id), &pd.subpaths, i))?; Ok(Data::String(if on { "PathPointSelection.ANCHORPOINT" } else { "PathPointSelection.NOSELECTION" }.into())) } @@ -1406,7 +1434,9 @@ const HANDLE_SELECTIONS: &[&str] = &["PathPointSelection.LEFTDIRECTION", "PathPo /// `selected = PathPointSelection.ANCHORPOINT` adds the point to the direct-selected anchors, and /// `NOSELECTION` removes it, with `select.anchorsMany`; the other selected objects and anchors stay /// selected. A value the point has already runs no command. Direction handles cannot be selected, -/// so `LEFTDIRECTION`, `RIGHTDIRECTION` and `LEFTRIGHTPOINT` throw an error. +/// so `LEFTDIRECTION`, `RIGHTDIRECTION` and `LEFTRIGHTPOINT` throw an error, and so does +/// `NOSELECTION` on a path selected through a group or compound path that holds it, and +/// `ANCHORPOINT` on a guide while guides are locked. fn pt_set_selected(h: &super::Host, a: &[Data]) -> Answer { let on = match arg(a, 1) { Data::String(s) if s == "PathPointSelection.ANCHORPOINT" => true, @@ -1417,18 +1447,30 @@ fn pt_set_selected(h: &super::Host, a: &[Data]) -> Answer { _ => return Err(HostError::Type("selected must be a PathPointSelection value".into())), }; let (item, i) = this_point(h, a)?; - let (now, at, selectable) = with_doc(h, item.doc, |_, st| { - let subs = st.doc.node(item.id).and_then(|n| n.path_data()).map_or(&[][..], |pd| &pd.subpaths[..]); + let (now, at, selectable, held, guide) = with_doc(h, item.doc, |_, st| { + let node = st.doc.node(item.id); + let subs = node.and_then(|n| n.path_data()).map_or(&[][..], |pd| &pd.subpaths[..]); + let guide = node.is_some_and(|n| matches!(n.kind, NodeKind::Path { guide: true, .. })); let selectable = crate::cmd::select::is_selectable(&st.doc, st.isolation, &st.doc.locked_artboards(), item.id); - (anchor_selected(&st.selection, item.id, subs, i), locate(subs, i), selectable) + let held = held_selected(&st.doc, &st.selection, item.id); + (anchor_selected(&st.selection, item.id, held, subs, i), locate(subs, i), selectable, held, guide) }); if now == on { return Ok(Data::Undefined); } let Some((s, j)) = at else { return Err(HostError::Error(STALE_POINT.into())) }; + if held { + return Err(HostError::Error(format!( + "PathPoint.selected = PathPointSelection.NOSELECTION is not available yet on PathItem {}: the group or compound path that holds it is selected", + item.id.0 + ))); + } if on && !selectable { return Err(HostError::Error(format!("Cannot select PathItem {}", item.id.0))); } + if on && guide && h.session.borrow().menu.guides_locked { + return Err(HostError::Error(format!("Cannot select PathItem {}: guides are locked", item.id.0))); + } let params = json!({"items": [{"id": item.id.0, "anchors": [[s, j]]}], "mode": if on { "add" } else { "subtract" }}); on_doc(h, item.doc.uid, false, |h| command(h, "select.anchorsMany", ¶ms))?; Ok(Data::Undefined) @@ -1440,14 +1482,15 @@ fn path_selected_points(h: &super::Host, a: &[Data]) -> Answer { let item = this_path(h, a)?; let picked: Vec = read_path(h, item, |st, _, pd| { let sel = &st.selection; - if !sel.contains(item.id) || sel.segments.contains_key(&item.id) { + let held = held_selected(&st.doc, sel, item.id); + if !held && (!sel.contains(item.id) || sel.segments.contains_key(&item.id)) { return Vec::new(); } let mut out = Vec::new(); let mut first = 0; for (s, sp) in pd.subpaths.iter().enumerate() { let n = sp.anchors.len(); - out.extend((0..n).filter(|j| sel.partial(item.id).is_none_or(|p| p.contains(&(s, *j)))).map(|j| first + j)); + out.extend((0..n).filter(|j| held || sel.partial(item.id).is_none_or(|p| p.contains(&(s, *j)))).map(|j| first + j)); first += n; } out @@ -1555,7 +1598,7 @@ pub(super) fn classes(l: &Link) -> Vec { ("leftDirection", point_property(l, pt_left, pt_set_left)), ("rightDirection", point_property(l, pt_right, pt_set_right)), ("pointType", point_property(l, pt_type, pt_set_type)), - ("selected", property(l, pt_selected, pt_set_selected)), + ("selected", HostMember::Property { get: super::point_function(l, pt_selected), set: super::function(l, pt_set_selected) }), ("remove", point_method(l, pt_remove)), ]), None, diff --git a/crates/engine/src/tests/script_dom_paths.rs b/crates/engine/src/tests/script_dom_paths.rs index b8fdf6673d..43ce225e82 100644 --- a/crates/engine/src/tests/script_dom_paths.rs +++ b/crates/engine/src/tests/script_dom_paths.rs @@ -939,12 +939,39 @@ fn a_path_selected_as_a_whole_has_every_point_selected() { } #[test] -fn a_path_in_a_selected_group_is_not_selected_as_a_whole() { - let (mut s, a, b) = doc(); - s.execute("select.set", &json!({"ids": [a.0, b.0]})).unwrap(); - s.execute("object.group", &json!({})).unwrap(); - let out = log(&mut s, "var ps = app.activeDocument.pathItems; vc.log([ps[0].selectedPathPoints.length, ps[1].selectedPathPoints.length]);"); - assert_eq!(out, vec![json!([0, 0])]); +fn a_path_in_a_selected_group_or_compound_path_is_selected_as_a_whole() { + for make in ["object.group", "object.compoundPath.make"] { + let (mut s, a, b) = doc(); + s.execute("select.set", &json!({"ids": [a.0, b.0]})).unwrap(); + s.execute(make, &json!({})).unwrap(); + let sel = format!("{:?}", s.active().unwrap().selection); + let steps = undo_steps(&s); + let out = log( + &mut s, + "var ps = app.activeDocument.pathItems; vc.log([ps[0].selectedPathPoints.length, ps[1].selectedPathPoints.length]);\ + vc.log(ps[0].pathPoints[2].selected); ps[0].pathPoints[2].selected = PathPointSelection.ANCHORPOINT;\ + try { ps[0].pathPoints[2].selected = PathPointSelection.NOSELECTION; } catch (e) { vc.log(e.message); }", + ); + assert_eq!(out[..2], [json!([4, 4]), json!("PathPointSelection.ANCHORPOINT")], "{make}"); + assert!(out[2].as_str().is_some_and(|m| m.contains("not available yet")), "{make}: {out:?}"); + assert_eq!(format!("{:?}", s.active().unwrap().selection), sel, "{make}: the selection stays as it was"); + assert_eq!(undo_steps(&s), steps, "{make}"); + } +} + +#[test] +fn reading_selected_while_moving_points_writes_the_path_once() { + let (mut s, a, _) = doc(); + s.execute("select.set", &json!({"ids": [a.0]})).unwrap(); + let r = run( + &mut s, + "var pp = app.activeDocument.pathItems[0].pathPoints;\ + for (var i = 0; i < pp.length; i++) if (pp[i].selected == PathPointSelection.ANCHORPOINT) pp[i].anchor = [pp[i].anchor[0] + 1, pp[i].anchor[1]];", + ) + .unwrap(); + let calls: Vec = + r["slowestCommands"].as_array().unwrap().iter().filter(|c| c["id"] == "path.setAnchors").map(|c| c["calls"].as_u64().unwrap()).collect(); + assert_eq!(calls, vec![1], "{r}"); } #[test] @@ -960,6 +987,60 @@ fn path_point_selected_refuses_handles_bad_values_and_locked_paths() { assert!(s.active().unwrap().selection.is_empty()); } +/// The ways an editable path cannot be selected: on a locked artboard, and outside the isolated +/// object. +const UNSELECTABLE: [&str; 2] = ["locked artboard", "isolation"]; + +/// Makes the paths of [`doc`] other than `b` editable but not selectable, as `case` names. +fn lock_out(s: &mut Session, case: &str, b: NodeId) { + if case == "isolation" { + s.execute("object.isolate", &json!({"id": b.0})).unwrap(); + } else { + s.execute("artboard.setProps", &json!({"index": 0, "locked": true})).unwrap(); + } +} + +#[test] +fn path_point_selected_refuses_paths_on_locked_artboards_and_outside_isolation() { + for case in UNSELECTABLE { + let (mut s, a, b) = doc(); + lock_out(&mut s, case, b); + let e = failure(&mut s, "app.activeDocument.pathItems[0].pathPoints[0].selected = PathPointSelection.ANCHORPOINT;"); + assert!(e.contains("Cannot select"), "{case}: {e}"); + assert!(!s.active().unwrap().selection.contains(a), "{case}"); + } +} + +#[test] +fn selecting_a_point_of_a_guide_throws_while_guides_are_locked() { + let (mut s, a, _) = doc(); + log(&mut s, "app.activeDocument.pathItems[0].guides = true;"); + s.set_guides_locked(true); + let e = failure(&mut s, "app.activeDocument.pathItems[0].pathPoints[0].selected = PathPointSelection.ANCHORPOINT;"); + assert!(e.contains("guides are locked"), "{e}"); + assert!(!s.active().unwrap().selection.contains(a)); +} + +#[test] +fn assigning_guides_refuses_paths_that_cannot_be_selected() { + for case in UNSELECTABLE { + let (mut s, a, b) = doc(); + lock_out(&mut s, case, b); + let e = failure(&mut s, "app.activeDocument.pathItems[0].guides = true;"); + assert!(e.contains("Cannot edit"), "{case}: {e}"); + assert!(!is_guide(&s, a), "{case}"); + } + // A guide is on no locked artboard, so only isolation keeps a guide from being released. + let (mut s, a, b) = doc(); + log(&mut s, "app.activeDocument.pathItems[0].guides = true;"); + assert!(is_guide(&s, a)); + lock_out(&mut s, "isolation", b); + let steps = undo_steps(&s); + let e = failure(&mut s, "app.activeDocument.pathItems[0].guides = false;"); + assert!(e.contains("Cannot edit"), "{e}"); + assert_eq!((is_guide(&s, a), undo_steps(&s)), (true, steps), "the guide stays a guide"); +} + fn is_guide(s: &Session, id: NodeId) -> bool { matches!(node(s, id).kind, NodeKind::Path { guide: true, .. }) } @@ -986,8 +1067,11 @@ fn assigning_guides_makes_and_releases_a_guide() { s.execute("select.set", &json!({"ids": [a.0, b.0]})).unwrap(); s.execute("object.group", &json!({})).unwrap(); s.execute("select.none", &json!({})).unwrap(); - log(&mut s, "app.activeDocument.pathItems[1].guides = true;"); - assert!(is_guide(&s, a) != is_guide(&s, b), "only the assigned path in the group is a guide"); + log(&mut s, "var p = app.activeDocument.pathItems[1]; p.name = 'assigned'; p.guides = true;"); + let (assigned, other) = if node(&s, a).name.as_deref() == Some("assigned") { (a, b) } else { (b, a) }; + assert_eq!(node(&s, assigned).name.as_deref(), Some("assigned")); + assert_eq!((is_guide(&s, assigned), is_guide(&s, other)), (true, false), "only the assigned path in the group is a guide"); + assert!(s.active().unwrap().selection.is_empty(), "the selection stays as it was"); } #[test] diff --git a/docs/mcp.md b/docs/mcp.md index 78a863a2b1..103c6f7ee8 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2734,13 +2734,15 @@ app through the global object `vc`, and writes to the Script Console and runs ot than the object model changed the path's points (a command run with `vc.run`, such as `path.setAnchors`, `object.move` or `edit.undo`); points stay valid through the object model's other changes to the path or to an object that holds it, such as `translate()`. Every point of a path selected as a whole is a selected anchor point, - and the endpoints of selected segments are not; a path is selected as a whole only when it is itself selected, not - when a group that holds it is. Direction handles are not selected on their own, so assigning `LEFTDIRECTION`, - `RIGHTDIRECTION` or `LEFTRIGHTPOINT` to `selected` throws an error that says it is not available yet, and selecting - a point of a path that cannot be selected throws `Cannot select`. A clipping path cannot be made a guide, and - `guides = true` on one throws an error; assigning `guides` on a path inside a compound path throws an error that says - it is not available yet, on a path that is hidden, locked or cannot be selected throws `Cannot edit`, and while - guides are locked throws an error for either value. Color components left out + and the endpoints of selected segments are not; a path in a selected group or compound path is selected as a whole. + Direction handles are not selected on their own, so assigning `LEFTDIRECTION`, `RIGHTDIRECTION` or `LEFTRIGHTPOINT` + to `selected` throws an error that says it is not available yet, and so does assigning `NOSELECTION` to a point of a + path in a selected group or compound path. Selecting a point of a path that cannot be selected throws `Cannot + select`, and selecting a point of a guide while guides are locked throws an error. A clipping path cannot be made a + guide, and `guides = true` on one throws an error; assigning `guides` on a path inside a compound path throws an + error that says it is not available yet, assigning either value on a path that is hidden, locked or cannot be + selected throws `Cannot edit`, and assigning either value while guides are locked throws an error. Color + components left out count as 0, `new cmykColor()` makes a `CMYKColor`, `LabColor.l` is 0 to 100 and `a` and `b` are -128 to 128, and a component out of range throws a `RangeError` when the color is assigned, with nothing changed. A component reads with the fewest From 496ac0c785e928c33b3f39c0cf251ecd06863007 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 23 Nov 2026 13:14:01 -0800 Subject: [PATCH 11/61] Scripts: state the segment and no-change rules of selected and guides Assigning PathPointSelection.ANCHORPOINT to a point of a path with selected segments replaces that path's segment selection, as select.anchorsMany does for any anchor pick on such a path; the module doc, the setter's doc and docs/mcp.md now say so. docs/mcp.md also says that changing PathPoint.selected adds no undo step, and that assigning guides the value a path already has runs no command, which is why a hidden, locked or compound-member path, or locked guides, throw only for the other value. The touched lines of the PathItem paragraph are rewrapped to its width. New tests cover a point added by the script and selected in the same run, selectedPathPoints after an added point, a path with a selected segment, and assigning guides its current value while guides are locked. --- crates/engine/src/script/dom/paths.rs | 27 +++++++++------- crates/engine/src/tests/script_dom_paths.rs | 34 +++++++++++++++++++++ docs/mcp.md | 33 ++++++++++---------- 3 files changed, 67 insertions(+), 27 deletions(-) diff --git a/crates/engine/src/script/dom/paths.rs b/crates/engine/src/script/dom/paths.rs index db0352750b..ddd0853d3a 100644 --- a/crates/engine/src/script/dom/paths.rs +++ b/crates/engine/src/script/dom/paths.rs @@ -44,10 +44,12 @@ //! group or compound path is selected as a whole. Direction handles are not selected on their //! own, so `LEFTDIRECTION`, `RIGHTDIRECTION` and `LEFTRIGHTPOINT` throw an error that says they //! are not available yet, and so does `NOSELECTION` on a point of a path in a selected group or -//! compound path. Selecting a point of a guide while guides are locked throws an error. A -//! clipping path cannot be made a guide. Assigning `guides` on a path inside a compound path -//! throws an error that says it is not available yet, on a path that cannot be edited or -//! selected throws `Cannot edit` for both values, and while guides are locked throws an error. +//! compound path. Selecting a point of a path with selected segments replaces that path's +//! segment selection. Selecting a point of a guide while guides are locked throws an error. A +//! clipping path cannot be made a guide. Assigning `guides` a value the path does not have +//! throws an error that says it is not available yet on a path inside a compound path, throws +//! `Cannot edit` on a path that cannot be edited or selected, and throws an error while guides +//! are locked; assigning the value the path has runs no command. //! - The transforms take one setting for fill and stroke patterns, so `changeFillPatterns` and //! `changeStrokePattern` given as different values throw an error; gradients move with the art, //! so `changeFillGradients` false throws an error that says it is not available yet. @@ -598,9 +600,10 @@ fn path_guides(h: &super::Host, a: &[Data]) -> Answer { pub const COMPOUND_MEMBER_GUIDES: &str = "Changing guides on a path inside a compound path is not available yet"; /// `guides = true` makes the path a guide with `view.guides.make`, and `false` makes it a path again -/// with `view.guides.release`; the selection stays as it was. A clipping path cannot be a guide, a -/// path inside a compound path throws [`COMPOUND_MEMBER_GUIDES`], and while guides are locked both -/// values throw an error. +/// with `view.guides.release`; the selection stays as it was. A value the path has already runs no +/// command and throws no error. Otherwise a clipping path cannot be a guide, a path inside a +/// compound path throws [`COMPOUND_MEMBER_GUIDES`], and while guides are locked both values throw +/// an error. fn path_set_guides(h: &super::Host, a: &[Data]) -> Answer { let on = boolean(arg(a, 1), "guides")?; let item = this_path(h, a)?; @@ -1433,10 +1436,12 @@ const HANDLE_SELECTIONS: &[&str] = &["PathPointSelection.LEFTDIRECTION", "PathPo /// `selected = PathPointSelection.ANCHORPOINT` adds the point to the direct-selected anchors, and /// `NOSELECTION` removes it, with `select.anchorsMany`; the other selected objects and anchors stay -/// selected. A value the point has already runs no command. Direction handles cannot be selected, -/// so `LEFTDIRECTION`, `RIGHTDIRECTION` and `LEFTRIGHTPOINT` throw an error, and so does -/// `NOSELECTION` on a path selected through a group or compound path that holds it, and -/// `ANCHORPOINT` on a guide while guides are locked. +/// selected, except that selecting an anchor of a path with selected segments replaces that path's +/// segment selection, as `select.anchorsMany` does. A value the point has already runs no command. +/// Direction handles cannot be selected, so `LEFTDIRECTION`, `RIGHTDIRECTION` and +/// `LEFTRIGHTPOINT` throw an error, and so does `NOSELECTION` on a path selected through a group or +/// compound path that holds it, and `ANCHORPOINT` on a guide while guides are locked. The setter +/// writes the waiting point changes first, as every member that is not a point function does. fn pt_set_selected(h: &super::Host, a: &[Data]) -> Answer { let on = match arg(a, 1) { Data::String(s) if s == "PathPointSelection.ANCHORPOINT" => true, diff --git a/crates/engine/src/tests/script_dom_paths.rs b/crates/engine/src/tests/script_dom_paths.rs index 43ce225e82..17d9969387 100644 --- a/crates/engine/src/tests/script_dom_paths.rs +++ b/crates/engine/src/tests/script_dom_paths.rs @@ -974,6 +974,38 @@ fn reading_selected_while_moving_points_writes_the_path_once() { assert_eq!(calls, vec![1], "{r}"); } +#[test] +fn selection_reads_and_writes_see_points_the_script_added() { + let (mut s, a, _) = doc(); + let out = log( + &mut s, + "var p = app.activeDocument.pathItems[0], q = p.pathPoints.add(); q.selected = PathPointSelection.ANCHORPOINT;\ + vc.log(q.selected); vc.log(p.selectedPathPoints.length);", + ); + assert_eq!(out, vec![json!("PathPointSelection.ANCHORPOINT"), json!(1)]); + assert_eq!(selected_anchors(&s, a), Some(vec![(0, 4)])); + s.execute("select.set", &json!({"ids": [a.0]})).unwrap(); + let out = log(&mut s, "var p = app.activeDocument.pathItems[0]; p.pathPoints.add(); vc.log([p.selectedPathPoints.length, p.pathPoints.length]);"); + assert_eq!(out, vec![json!([6, 6])]); +} + +#[test] +fn selecting_a_point_of_a_path_with_selected_segments_replaces_the_segments() { + let (mut s, a, _) = doc(); + s.execute("select.segments", &json!({"id": a.0, "segments": [[0, 1]], "mode": "set"})).unwrap(); + let out = log( + &mut s, + "var p = app.activeDocument.pathItems[0]; vc.log(p.selectedPathPoints.length);\ + p.pathPoints[1].selected = PathPointSelection.NOSELECTION;", + ); + assert_eq!(out, vec![json!(0)]); + assert!(s.active().unwrap().selection.segments.contains_key(&a), "a value the point has leaves the segments selected"); + log(&mut s, "app.activeDocument.pathItems[0].pathPoints[0].selected = PathPointSelection.ANCHORPOINT;"); + let sel = &s.active().unwrap().selection; + assert!(!sel.segments.contains_key(&a)); + assert_eq!(selected_anchors(&s, a), Some(vec![(0, 0)])); +} + #[test] fn path_point_selected_refuses_handles_bad_values_and_locked_paths() { let (mut s, a, _) = doc(); @@ -1117,4 +1149,6 @@ fn assigning_guides_throws_in_both_directions_while_guides_are_locked() { let e = failure(&mut s, "app.activeDocument.pathItems[1].guides = true;"); assert!(e.contains("guides are locked"), "{e}"); assert_eq!((is_guide(&s, a), is_guide(&s, b), undo_steps(&s)), (true, false, steps)); + log(&mut s, "var ps = app.activeDocument.pathItems; ps[0].guides = true; ps[1].guides = false;"); + assert_eq!((is_guide(&s, a), is_guide(&s, b), undo_steps(&s)), (true, false, steps), "a value the path has runs no command"); } diff --git a/docs/mcp.md b/docs/mcp.md index 103c6f7ee8..319609005f 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2701,15 +2701,16 @@ app through the global object `vc`, and writes to the Script Console and runs ot mode, which stays as it was. A `PathItem` (https://ai-scripting.docsforadobe.dev/jsobjref/PathItem/) adds to the page item members `pathPoints`, `closed`, `evenodd`, `area` (negative for a path that runs counterclockwise), `length`, `guides`, `clipping`, `selectedPathPoints`, `setEntirePath(points)`, `filled`, `fillColor`, `fillOverprint`, - `stroked`, `strokeColor`, `strokeOverprint`, `strokeWidth`, `strokeCap`, `strokeJoin`, `strokeMiterLimit` (1 to 500), `strokeDashes`, - `strokeDashOffset`, `translate(deltaX?, deltaY?, ...)`, `rotate(angle, ..., rotateAbout?)` (counterclockwise for a - positive angle) and `resize(scaleX, scaleY, ..., changeLineWidths?, scaleAbout?)`. The geometry changes through - `path.setAnchors`, the fill and stroke through `paint.setFill` and `paint.setStroke`, the stroke options through - `stroke.set`, the fill rule through `path.setFillRule`, overprint through `object.setOverprint` and the transforms - through `object.move`, `object.rotate` and `object.scale`. Changes to the points of a path (`closed`, - `setEntirePath`, `pathPoints` and each `PathPoint`) are written together with one `path.setAnchors` before the - script uses any other member or command, or the points of another path, and when the script ends; a path aligned - to the pixel grid, or in an object that is, is written at each change, so its points read as the grid snaps them. + `stroked`, `strokeColor`, `strokeOverprint`, `strokeWidth`, `strokeCap`, `strokeJoin`, `strokeMiterLimit` (1 to + 500), `strokeDashes`, `strokeDashOffset`, `translate(deltaX?, deltaY?, ...)`, `rotate(angle, ..., rotateAbout?)` + (counterclockwise for a positive angle) and `resize(scaleX, scaleY, ..., changeLineWidths?, scaleAbout?)`. The + geometry changes through `path.setAnchors`, the fill and stroke through `paint.setFill` and `paint.setStroke`, the + stroke options through `stroke.set`, the fill rule through `path.setFillRule`, overprint through + `object.setOverprint` and the transforms through `object.move`, `object.rotate` and `object.scale`. Changes to the + points of a path (`closed`, `setEntirePath`, `pathPoints` and each `PathPoint`) are written together with one + `path.setAnchors` before the script uses any other member or command, or the points of another path, and when the + script ends; a path aligned to the pixel grid, or in an object that is, is written at each change, so its points + read as the grid snaps them. `pathPoints` (https://ai-scripting.docsforadobe.dev/jsobjref/PathPoints/) has `length`, `[i]`, `index(i)`, `add()` and `removeAll()`, and each `PathPoint` (https://ai-scripting.docsforadobe.dev/jsobjref/PathPoint/) has `anchor`, @@ -2737,13 +2738,13 @@ app through the global object `vc`, and writes to the Script Console and runs ot and the endpoints of selected segments are not; a path in a selected group or compound path is selected as a whole. Direction handles are not selected on their own, so assigning `LEFTDIRECTION`, `RIGHTDIRECTION` or `LEFTRIGHTPOINT` to `selected` throws an error that says it is not available yet, and so does assigning `NOSELECTION` to a point of a - path in a selected group or compound path. Selecting a point of a path that cannot be selected throws `Cannot - select`, and selecting a point of a guide while guides are locked throws an error. A clipping path cannot be made a - guide, and `guides = true` on one throws an error; assigning `guides` on a path inside a compound path throws an - error that says it is not available yet, assigning either value on a path that is hidden, locked or cannot be - selected throws `Cannot edit`, and assigning either value while guides are locked throws an error. Color - components left out - count as 0, `new + path in a selected group or compound path. Selecting a point of a path with selected segments replaces that path's + segment selection. Changing `selected` adds no undo step. Selecting a point of a path that cannot be selected + throws `Cannot select`, and selecting a point of a guide while guides are locked throws an error. A clipping path + cannot be made a guide, and `guides = true` on one throws an error. Assigning `guides` the value a path already + has runs no command. Assigning the other value throws an error that says it is not available yet on a path inside + a compound path, throws `Cannot edit` on a path that is hidden, locked or cannot be selected, and throws an error + while guides are locked. Color components left out count as 0, `new cmykColor()` makes a `CMYKColor`, `LabColor.l` is 0 to 100 and `a` and `b` are -128 to 128, and a component out of range throws a `RangeError` when the color is assigned, with nothing changed. A component reads with the fewest decimals, at least 4, that give the stored value back, so assigning a color read from a path leaves the path as it From a278d6a837885531f878d72d1ac0773f052e1f2b Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 24 Nov 2026 21:51:12 -0800 Subject: [PATCH 12/61] Scripts: a path in a selected group reads as selected with its own picks too When a group or compound path is selected together with one of its paths, and that path also has its own anchor or segment pick, selectedPathPoints and PathPoint.selected now report the path as selected as a whole, as docs/mcp.md says for a path in a selected group. Before, the path's own pick was reported instead. --- crates/engine/src/script/dom/paths.rs | 6 +++--- crates/engine/src/tests/script_dom_paths.rs | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/script/dom/paths.rs b/crates/engine/src/script/dom/paths.rs index ddd0853d3a..0942ebe880 100644 --- a/crates/engine/src/script/dom/paths.rs +++ b/crates/engine/src/script/dom/paths.rs @@ -1384,10 +1384,10 @@ fn pt_parent(h: &super::Host, a: &[Data]) -> Answer { Ok(path_ref(h, item)) } -/// Whether the path `id` is not selected itself but a group or compound path that holds it is, -/// which selects the path as a whole. +/// Whether a group or compound path that holds the path `id` is selected, which selects the path +/// as a whole whatever the path's own selection is. fn held_selected(d: &crate::Document, sel: &crate::doc::Selection, id: NodeId) -> bool { - !sel.contains(id) && d.ancestry(id).is_some_and(|a| a.iter().any(|i| *i != id && sel.contains(*i) && d.node(*i).is_some_and(|n| !n.is_layer()))) + d.ancestry(id).is_some_and(|a| a.iter().any(|i| *i != id && sel.contains(*i) && d.node(*i).is_some_and(|n| !n.is_layer()))) } /// The point at index `i` of `subs` is a selected anchor point of the path `id` in `sel`: every diff --git a/crates/engine/src/tests/script_dom_paths.rs b/crates/engine/src/tests/script_dom_paths.rs index 17d9969387..bb73f4175d 100644 --- a/crates/engine/src/tests/script_dom_paths.rs +++ b/crates/engine/src/tests/script_dom_paths.rs @@ -959,6 +959,20 @@ fn a_path_in_a_selected_group_or_compound_path_is_selected_as_a_whole() { } } +#[test] +fn a_path_in_a_selected_group_reads_as_a_whole_when_its_own_anchors_are_also_picked() { + let (mut s, a, b) = doc(); + s.execute("select.set", &json!({"ids": [a.0, b.0]})).unwrap(); + s.execute("object.group", &json!({})).unwrap(); + let group = s.active().unwrap().doc.parent_of(a).unwrap(); + s.execute("select.set", &json!({"ids": [group.0, a.0]})).unwrap(); + s.execute("select.anchorsMany", &json!({"items": [{"id": a.0, "anchors": [[0, 1]]}], "mode": "subtract"})).unwrap(); + assert!(s.active().unwrap().selection.contains(group), "the group stays selected"); + assert!(s.active().unwrap().selection.partial(a).is_some(), "the path has its own anchor selection"); + let out = log(&mut s, "var p = app.activeDocument.pathItems[0]; vc.log([p.selectedPathPoints.length, p.pathPoints[1].selected]);"); + assert_eq!(out, vec![json!([4, "PathPointSelection.ANCHORPOINT"])]); +} + #[test] fn reading_selected_while_moving_points_writes_the_path_once() { let (mut s, a, _) = doc(); From ab85d735c949791cf49d2b1bc6b5172af8f30cdf Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 24 Nov 2026 22:00:02 -0800 Subject: [PATCH 13/61] New Document: Columns follows a preset's rows in the framework dialog The New Document dialog that main moved to the framework showed a preset's stored column count for a grid by column made with file.new's rows, and kept the rows when the layout or Columns changed. Columns now shows the columns those rows give the current number of artboards, a new layout keeps that count, and a new column count replaces the rows, as the dialog did before the move. --- crates/ui-egui/src/dialogs/new_document.rs | 53 ++++++++++++++++++++-- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/dialogs/new_document.rs b/crates/ui-egui/src/dialogs/new_document.rs index e60e9e0b3a..eb37e9674d 100644 --- a/crates/ui-egui/src/dialogs/new_document.rs +++ b/crates/ui-egui/src/dialogs/new_document.rs @@ -469,6 +469,31 @@ fn advanced(ui: &mut egui::Ui, s: &mut DocSettings) { } } +/// The columns Columns shows: those a grid by column made with `file.new`'s `rows` gives the +/// current number of artboards, otherwise the stored count, at least 1 and at most the artboards. +fn shown_columns(s: &DocSettings) -> u32 { + if s.layout == ArtboardLayout::GridByColumn && s.rows > 0 { + return u32::try_from(s.grid_columns()).unwrap_or(MAX_ARTBOARDS); + } + s.columns.max(1).min(s.artboards.max(1)) +} + +/// Sets the artboard layout. A new layout replaces the rows of a preset made with `file.new`'s +/// `rows` with the column count Columns showed for them. +fn set_layout(s: &mut DocSettings, layout: ArtboardLayout) { + if s.rows > 0 { + s.columns = shown_columns(s); + s.rows = 0; + } + s.layout = layout; +} + +/// Sets the column count, which replaces the rows of a preset made with `file.new`'s `rows`. +fn set_columns(s: &mut DocSettings, columns: u32) { + s.rows = 0; + s.columns = columns; +} + /// More Settings' pop-up: the artboard layout, spacing and columns. All three are off with one /// artboard, Columns also for the row and column layouts; columns stay within the artboards. fn more_settings(ui: &mut egui::Ui, s: &mut DocSettings, lengths: LengthUnits) { @@ -479,7 +504,7 @@ fn more_settings(ui: &mut egui::Ui, s: &mut DocSettings, lengths: LengthUnits) { Field::new(layout.clone()).show(ui, |ui, _| { let entries: Vec> = ArtboardLayout::ALL.iter().map(|l| Entry::new(*l, text(tl!(l.label())))).collect(); if let Some(l) = Segmented::new(layout.clone(), Bind::given(s.layout), &entries).enabled(several).show(ui).value().copied() { - s.layout = l; + set_layout(s, l); } }); let rtl = Checkbox::new(Bind::given(s.right_to_left)).label(right_to_left).enabled(several).show(ui); @@ -494,10 +519,10 @@ fn more_settings(ui: &mut egui::Ui, s: &mut DocSettings, lengths: LengthUnits) { }); Field::new(columns.clone()).show(ui, |ui, _| { let n = f64::from(s.artboards.max(1)); - let shown = f64::from(s.columns.max(1)).min(n); + let shown = f64::from(shown_columns(s)); let field = NumberField::new(columns.clone(), Bind::given(Some(shown))).range(1.0..=n).step(1.0).commit_decimals(0).enabled(several && grid); if let Some(v) = field.show(ui).value().copied().flatten().filter(|v| v.is_finite()) { - s.columns = v.round().clamp(1.0, n) as u32; + set_columns(s, v.round().clamp(1.0, n) as u32); } }); } @@ -1005,4 +1030,26 @@ mod tests { assert!(!dir.join("Print.vectorcraft").exists()); let _ = std::fs::remove_dir_all(&dir); } + + /// A preset made with `file.new`'s `rows`: Columns shows the columns those rows give the + /// current artboards, and a new layout keeps them while a new column count replaces the rows. + #[test] + fn columns_follow_a_presets_rows_until_the_layout_or_columns_change() { + let made = |layout, artboards| DocSettings { layout, artboards, columns: 2, rows: 4, ..DocSettings::default() }; + for (artboards, shown) in [(5, 2), (9, 3), (2, 1)] { + assert_eq!(shown_columns(&made(ArtboardLayout::GridByColumn, artboards)), shown, "{artboards} artboards"); + } + assert_eq!(shown_columns(&made(ArtboardLayout::GridByRow, 9)), 2, "a grid by row shows the stored columns"); + for to in [ArtboardLayout::GridByRow, ArtboardLayout::Row, ArtboardLayout::Column] { + let mut s = made(ArtboardLayout::GridByColumn, 9); + set_layout(&mut s, to); + assert_eq!((s.layout, s.columns, s.rows), (to, 3, 0), "{to:?}"); + } + let mut s = made(ArtboardLayout::GridByRow, 9); + set_layout(&mut s, ArtboardLayout::GridByColumn); + assert_eq!((s.columns, s.rows, shown_columns(&s)), (2, 0, 2), "the columns a grid by row showed stay"); + let mut s = made(ArtboardLayout::GridByColumn, 9); + set_columns(&mut s, 5); + assert_eq!((s.columns, s.rows, shown_columns(&s)), (5, 0, 5)); + } } From e97b0b49ae6d94acaad0ed4a2fe75832bf32ce13 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 25 Nov 2026 00:31:11 -0800 Subject: [PATCH 14/61] Scripts: Document default fill and stroke members and scaleFactor A script that read or assigned a document's defaultFillColor, defaultStrokeWidth or another default paint member, or read scaleFactor, got undefined. The twelve default members now read and set the fill, stroke and stroke options of the next object drawn, and scaleFactor reads 1. - appearance.setNewArt sets new art's fill, stroke and stroke options whatever is selected, leaving the selection, its art, the active proxy and Recent Colors as they were. Every value is checked before anything changes. - The default members run it only when the value changes. A bad value throws an error with nothing changed. - paths.rs shares its dash length checks with defaultStrokeDashes. --- crates/engine/src/cmd/newart.rs | 131 ++++++++++- crates/engine/src/script/dom.rs | 2 + crates/engine/src/script/dom/defaults.rs | 212 ++++++++++++++++++ crates/engine/src/script/dom/paths.rs | 26 ++- crates/engine/src/tests.rs | 1 + crates/engine/src/tests/newart.rs | 69 ++++++ .../engine/src/tests/script_dom_defaults.rs | 144 ++++++++++++ .../tests/it/script_host_vs_scriptcheck.rs | 9 +- docs/mcp.md | 23 +- docs/target-app-parity.md | 3 +- 10 files changed, 605 insertions(+), 15 deletions(-) create mode 100644 crates/engine/src/script/dom/defaults.rs create mode 100644 crates/engine/src/tests/script_dom_defaults.rs diff --git a/crates/engine/src/cmd/newart.rs b/crates/engine/src/cmd/newart.rs index a42088e7e3..56e7e4dfe8 100644 --- a/crates/engine/src/cmd/newart.rs +++ b/crates/engine/src/cmd/newart.rs @@ -6,7 +6,8 @@ //! and strokes, effects, opacity and blend mode, and the link to the style) or, with the Appearance //! panel's New Art Has Basic Appearance off, the whole appearance of the last selection. With the //! option on (the default) an inherited appearance gives new art its top stroke's options only, -//! and a change of selection loads only the proxies. `paint.default` resets it. +//! and a change of selection loads only the proxies. `paint.default` resets it, and +//! `appearance.setNewArt` sets its fill, stroke and stroke options whatever is selected. //! //! A document whose Default Graphic Style no longer has the shipped look (a New Document profile //! redefined it) gives the reset that style's fills, strokes and effects instead, and `file.new` @@ -20,7 +21,7 @@ use vectorcraft_doc::{Appearance, AppearanceItem, ColorMode, DEFAULT_GRAPHIC_STY use vectorcraft_tools::PaintDefaults; use super::gradient::unplaced; -use super::{CommandSpec, Result, Session, always, cmd, switch_or}; +use super::{CommandSpec, Result, Session, always, bad, cmd, switch_or}; pub fn specs() -> Vec { vec![ @@ -42,9 +43,135 @@ pub fn specs() -> Vec { always, describe ), + cmd!( + "appearance.setNewArt", + "Set New Art Appearance", + [], + None, + "{fill?: {color?, none?, swatch?, tint?, gradient?, keepModel?} (a paint as paint.setFill takes it), stroke?: (a paint, as fill), weight?: 0..1000 pt, cap?: butt|round|square, join?: miter|round|bevel, miterLimit?: 1..500, dash?: [lengths, each 0..1000000 pt, at most 64, not all 0]|null (null: a solid line), dashOffset?: -1000000..1000000 pt (with a dash pattern), fillOverprint?: bool, strokeOverprint?: bool} set the fill, stroke and stroke options the next object drawn gets, whatever is selected: the selection and its art, the active proxy and the recent colors stay as they are. A stroke painted on new art without one gets a 1 pt weight unless `weight` is given. A bad value is an error with nothing changed, and so is any change while New Art Has Basic Appearance is off and an object is selected (new art takes that object's appearance then) → {changed: whether the next object drawn looks different}", + always, + set_new_art + ), ] } +/// The most dash and gap lengths `appearance.setNewArt` takes. +const MAX_DASHES: usize = 64; +/// The largest dash, gap or dash offset `appearance.setNewArt` takes, in points. +const MAX_DASH_LENGTH: f64 = 1_000_000.0; + +/// `appearance.setNewArt`: new art's fill, stroke and stroke options, every value checked before +/// anything changes. +fn set_new_art(s: &mut Session, p: &Value) -> Result { + const C: &str = "appearance.setNewArt"; + let paint = |key: &str, fill: bool| -> Result> { + let Some(v) = p.get(key) else { return Ok(None) }; + if !v.is_object() { + return Err(bad(C, format!("{key} must be a paint object (color, none, swatch or gradient), got {v}"))); + } + if v.get("tint").is_some() && v.get("swatch").is_none() { + return Err(bad(C, format!("{key}: `tint` goes with a global or spot `swatch`"))); + } + let given = super::paint::paint_from(s, v)?.ok_or_else(|| bad(C, format!("{key}: give color, none, swatch or gradient")))?; + if !fill && matches!(&given, Paint::Gradient(g) if g.gradient.dither) && v.get("swatch").and_then(Value::as_str).is_none() { + return Err(bad(C, "`dither` applies to gradient fills")); + } + Ok(Some(unplaced(&given))) + }; + let (fill, stroke) = (paint("fill", true)?, paint("stroke", false)?); + let number = |key: &str, min: f64, max: f64| -> Result<()> { + match p.get(key) { + None => Ok(()), + Some(v) if v.as_f64().is_some_and(|n| n.is_finite() && (min..=max).contains(&n)) => Ok(()), + Some(v) => Err(bad(C, format!("{key} must be a number from {min} to {max}, got {v}"))), + } + }; + number("weight", 0.0, 1000.0)?; + number("miterLimit", 1.0, 500.0)?; + number("dashOffset", -MAX_DASH_LENGTH, MAX_DASH_LENGTH)?; + for key in ["cap", "join"] { + if p.get(key).is_some_and(|v| !v.is_string()) { + return Err(bad(C, format!("{key} must be a name"))); + } + } + match p.get("dash") { + None | Some(Value::Null) => {} + Some(Value::Array(a)) if a.len() > MAX_DASHES => return Err(bad(C, format!("dash takes at most {MAX_DASHES} lengths"))), + Some(Value::Array(a)) => { + if !a.iter().all(|v| v.as_f64().is_some_and(|n| n.is_finite() && (0.0..=MAX_DASH_LENGTH).contains(&n))) { + return Err(bad(C, format!("each dash length must be a number from 0 to {MAX_DASH_LENGTH}"))); + } + if !a.is_empty() && a.iter().all(|v| v.as_f64() == Some(0.0)) { + return Err(bad(C, "dash needs a length that is not 0")); + } + } + Some(v) => return Err(bad(C, format!("dash must be a list of lengths or null, got {v}"))), + } + let flag = |key: &str| -> Result> { + p.get(key).map(|v| v.as_bool().ok_or_else(|| bad(C, format!("{key} must be true or false, got {v}")))).transpose() + }; + let (fill_overprint, stroke_overprint) = (flag("fillOverprint")?, flag("strokeOverprint")?); + let options: serde_json::Map = + ["weight", "cap", "join", "miterLimit", "dash", "dashOffset"].iter().filter_map(|k| Some((k.to_string(), p.get(*k)?.clone()))).collect(); + let change = super::stroke::StrokeChange::parse(&Value::Object(options), C)?; + let dashed = match p.get("dash") { + Some(Value::Array(a)) => !a.is_empty(), + Some(_) => false, + None => s.new_art().stroke().is_some_and(|st| st.dash.is_some()), + }; + if p.get("dashOffset").and_then(Value::as_f64).is_some_and(|o| o != 0.0) && !dashed { + return Err(bad(C, "dashOffset needs a dash pattern")); + } + let nothing = fill.is_none() && stroke.is_none() && change.is_empty() && fill_overprint.is_none() && stroke_overprint.is_none(); + if !nothing && !s.prefs.new_art_basic && !s.bucket_paints() && s.active().is_some_and(|st| !st.selection.subjects().is_empty()) { + return Err(bad( + C, + "with New Art Has Basic Appearance off, new art takes the selected object's appearance: deselect it or turn the option on", + )); + } + let look = |s: &Session| { + let (opacity, blend, style) = s.new_art_transparency(); + (s.new_art(), opacity, blend, style.map(str::to_string)) + }; + let (before, was) = (s.paint.clone(), look(s)); + if let Some(f) = fill { + s.paint.fill = f; + } + if let Some(st) = stroke { + if !st.is_none() && s.paint.stroke.is_none() && s.paint.stroke_width == 0.0 { + s.paint.stroke_width = 1.0; + } + s.paint.stroke = st; + } + if let Some(w) = change.weight { + s.paint.stroke_width = w; + } + if !change.is_empty() + && let Some(st) = s.new_art_stroke_mut() + { + change.apply(st); + } + if let Some(on) = fill_overprint { + let t = s.new_art_template_mut(); + if t.fill().is_none() { + t.items.insert(0, AppearanceItem::Fill(FillLayer::new(Paint::None))); + } + if let Some(f) = t.fill_mut() { + f.overprint = on; + } + } + if let Some(on) = stroke_overprint + && let Some(st) = s.new_art_stroke_mut() + { + st.overprint = on; + } + let changed = look(s) != was; + if !changed { + s.paint = before; + } + Ok(json!({ "changed": changed })) +} + /// `t` reduced to a basic appearance: an empty fill under its top stroke (options kept, without /// its own transparency or effects). fn basic_of(t: &Appearance) -> Appearance { diff --git a/crates/engine/src/script/dom.rs b/crates/engine/src/script/dom.rs index 8b2267a5d8..8cc774bd92 100644 --- a/crates/engine/src/script/dom.rs +++ b/crates/engine/src/script/dom.rs @@ -39,6 +39,7 @@ use super::{HISTORY_LOST, Host, Link, Savepoint, command, command_value, current use crate::{DocState, Document, NodeId, NodeKind, Session}; mod colors; +mod defaults; mod paths; /// The error for a member read or called with no document open. @@ -1928,6 +1929,7 @@ pub(super) fn install(realm: &mut Realm, link: &Link) -> std::result::Result<(), ("selection", property(l, doc_selection, doc_set_selection)), ("pathItems", get(l, paths::doc_path_items)), ]); + document.extend(defaults::document_members(l)); document.extend( ["layers", "artboards", "groupItems", "textFrames", "swatches", "symbols", "views", "activeLayer", "saveAs", "close"] .into_iter() diff --git a/crates/engine/src/script/dom/defaults.rs b/crates/engine/src/script/dom/defaults.rs new file mode 100644 index 0000000000..fe8eb5c3f3 --- /dev/null +++ b/crates/engine/src/script/dom/defaults.rs @@ -0,0 +1,212 @@ +//! A document's default fill and stroke in the script object model, the `Document` members whose +//! names start with `default` that the help page +//! describes, and `scaleFactor`. +//! +//! The defaults are what the next object drawn gets ([`crate::Session::new_art`]), the same for +//! every open document, as the help page says of these global settings. Reading one reads new +//! art's top fill or stroke, and assigning one runs `appearance.setNewArt`, which leaves the +//! selection, its art, the active proxy and the recent colors as they were. A value that changes +//! nothing runs no command, and a bad value throws an error with nothing changed. +//! +//! VectorCraft's own rules, which the help page does not state: +//! - A color is new art's fill or stroke itself: assigning a color also makes `defaultFilled` or +//! `defaultStroked` true, and assigning a `NoColor` makes it false. `defaultFilled` or +//! `defaultStroked` set to true with no default fill or stroke gives black. +//! - An RGB color is stored in the color mode of the document in front, as `paint.setFill` stores +//! it. +//! - `defaultStrokeWidth` is 0 to 1000 points, a dash or gap 0 to 1,000,000 points (at most 64 of +//! them, not all 0), and `defaultStrokeDashOffset` -1,000,000 to 1,000,000 points, which needs a +//! dash pattern unless it is 0. +//! - While New Art Has Basic Appearance is off and an object is selected, assigning a default +//! throws an error, since new art then takes that object's appearance. +//! - `scaleFactor` is 1: VectorCraft draws every document at its own size. + +use serde_json::{Value, json}; +use vectorcraft_color::{Color, Paint}; +use vectorcraft_doc::{Appearance, LineCap, LineJoin}; +use vectorcraft_js::{Data, HostError, HostMember}; + +use super::paths::{CAPS, JOINS, MAX_STROKE_WIDTH, dash_lengths}; +use super::{Answer, Host, Link, arg, boolean, colors, command, get, num, number, property, this_doc}; + +/// New art's appearance, after the check that the document `this` names is still open. +fn new_art(h: &Host, a: &[Data]) -> std::result::Result { + this_doc(h, a)?; + Ok(h.session.borrow().new_art()) +} + +/// Runs `appearance.setNewArt` with `params`, unless `same`. +fn set(h: &Host, same: bool, params: Value) -> Answer { + if !same { + command(h, "appearance.setNewArt", ¶ms)?; + } + Ok(Data::Undefined) +} + +fn top_paint(ap: &Appearance, fill: bool) -> Paint { + if fill { ap.fill_paint() } else { ap.stroke_paint() } +} + +fn default_color(h: &Host, a: &[Data], fill: bool) -> Answer { + Ok(colors::of_paint(&top_paint(&new_art(h, a)?, fill))) +} + +fn set_default_color(h: &Host, a: &[Data], fill: bool) -> Answer { + let what = if fill { "defaultFillColor" } else { "defaultStrokeColor" }; + let color = colors::assigned(arg(a, 1), what)?; + let now = top_paint(&new_art(h, a)?, fill); + let same = match (&color, &now) { + (None, Paint::None) => true, + (Some(c), Paint::Solid { color, swatch: None, .. }) => c == color, + _ => false, + }; + let paint = match color { + Some(c) => json!({"color": colors::param(&c)}), + None => json!({"none": true}), + }; + let key = if fill { "fill" } else { "stroke" }; + set(h, same, json!({ key: paint })) +} + +fn default_painted(h: &Host, a: &[Data], fill: bool) -> Answer { + Ok(Data::Bool(!top_paint(&new_art(h, a)?, fill).is_none())) +} + +fn set_default_painted(h: &Host, a: &[Data], fill: bool) -> Answer { + let on = boolean(arg(a, 1), if fill { "defaultFilled" } else { "defaultStroked" })?; + let now = !top_paint(&new_art(h, a)?, fill).is_none(); + let paint = if on { json!({"color": colors::param(&Color::BLACK)}) } else { json!({"none": true}) }; + let key = if fill { "fill" } else { "stroke" }; + set(h, now == on, json!({ key: paint })) +} + +fn default_overprint(h: &Host, a: &[Data], fill: bool) -> Answer { + let ap = new_art(h, a)?; + Ok(Data::Bool(if fill { ap.fill().is_some_and(|f| f.overprint) } else { ap.stroke().is_some_and(|s| s.overprint) })) +} + +fn set_default_overprint(h: &Host, a: &[Data], fill: bool) -> Answer { + let (key, what) = if fill { ("fillOverprint", "defaultFillOverprint") } else { ("strokeOverprint", "defaultStrokeOverprint") }; + let on = boolean(arg(a, 1), what)?; + let now = default_overprint(h, a, fill)? == Data::Bool(on); + set(h, now, json!({ key: on })) +} + +/// New art's top stroke option `f` reads, or `none` when new art has no stroke. +fn stroke_option(h: &Host, a: &[Data], none: T, f: impl FnOnce(&vectorcraft_doc::StrokeLayer) -> T) -> std::result::Result { + Ok(new_art(h, a)?.stroke().map_or(none, f)) +} + +fn default_stroke_width(h: &Host, a: &[Data]) -> Answer { + this_doc(h, a)?; + Ok(num(h.session.borrow().paint.stroke_width)) +} + +fn set_default_stroke_width(h: &Host, a: &[Data]) -> Answer { + let w = number(arg(a, 1), "defaultStrokeWidth")?; + if !(0.0..=MAX_STROKE_WIDTH).contains(&w) { + return Err(HostError::Range("defaultStrokeWidth must be from 0 to 1000 points".into())); + } + this_doc(h, a)?; + let now = h.session.borrow().paint.stroke_width; + set(h, (now - w).abs() < 1e-9, json!({"weight": w})) +} + +fn default_cap(h: &Host, a: &[Data]) -> Answer { + let cap = stroke_option(h, a, LineCap::default(), |s| s.cap)?; + Ok(Data::String(CAPS.iter().find(|c| c.0 == cap).map_or("StrokeCap.BUTTENDCAP", |c| c.1).into())) +} + +fn set_default_cap(h: &Host, a: &[Data]) -> Answer { + let found = match arg(a, 1) { + Data::String(s) => CAPS.iter().find(|c| c.1 == s), + _ => None, + }; + let Some(&(cap, _, name)) = found else { return Err(HostError::Type("defaultStrokeCap must be a StrokeCap value".into())) }; + let now = stroke_option(h, a, LineCap::default(), |s| s.cap)?; + set(h, now == cap, json!({"cap": name})) +} + +fn default_join(h: &Host, a: &[Data]) -> Answer { + let join = stroke_option(h, a, LineJoin::default(), |s| s.join)?; + Ok(Data::String(JOINS.iter().find(|j| j.0 == join).map_or("StrokeJoin.MITERENDJOIN", |j| j.1).into())) +} + +fn set_default_join(h: &Host, a: &[Data]) -> Answer { + let found = match arg(a, 1) { + Data::String(s) => JOINS.iter().find(|j| j.1 == s), + _ => None, + }; + let Some(&(join, _, name)) = found else { return Err(HostError::Type("defaultStrokeJoin must be a StrokeJoin value".into())) }; + let now = stroke_option(h, a, LineJoin::default(), |s| s.join)?; + set(h, now == join, json!({"join": name})) +} + +fn default_miter(h: &Host, a: &[Data]) -> Answer { + Ok(num(stroke_option(h, a, 10.0, |s| s.miter_limit)?)) +} + +fn set_default_miter(h: &Host, a: &[Data]) -> Answer { + let v = number(arg(a, 1), "defaultStrokeMiterLimit")?; + if !(1.0..=500.0).contains(&v) { + return Err(HostError::Range("defaultStrokeMiterLimit must be from 1 to 500".into())); + } + let now = stroke_option(h, a, 10.0, |s| s.miter_limit)?; + set(h, (now - v).abs() < 1e-9, json!({"miterLimit": v})) +} + +fn dashes(h: &Host, a: &[Data]) -> std::result::Result, HostError> { + stroke_option(h, a, Vec::new(), |s| s.dash.as_ref().map_or_else(Vec::new, |d| d.pattern.clone())) +} + +fn default_dashes(h: &Host, a: &[Data]) -> Answer { + Ok(Data::Array(dashes(h, a)?.into_iter().map(num).collect())) +} + +fn set_default_dashes(h: &Host, a: &[Data]) -> Answer { + let lengths = dash_lengths(arg(a, 1), "defaultStrokeDashes")?; + let now = dashes(h, a)?; + let dash = if lengths.is_empty() { Value::Null } else { json!(lengths) }; + set(h, now == lengths, json!({"dash": dash})) +} + +fn default_dash_offset(h: &Host, a: &[Data]) -> Answer { + Ok(num(stroke_option(h, a, 0.0, |s| s.dash.as_ref().map_or(0.0, |d| d.offset))?)) +} + +fn set_default_dash_offset(h: &Host, a: &[Data]) -> Answer { + let v = number(arg(a, 1), "defaultStrokeDashOffset")?; + if v.abs() > MAX_STROKE_WIDTH * 1000.0 { + return Err(HostError::Range("defaultStrokeDashOffset must be from -1000000 to 1000000 points".into())); + } + if dashes(h, a)?.is_empty() && v != 0.0 { + return Err(HostError::Error("defaultStrokeDashOffset needs defaultStrokeDashes first".into())); + } + let now = stroke_option(h, a, 0.0, |s| s.dash.as_ref().map_or(0.0, |d| d.offset))?; + set(h, (now - v).abs() < 1e-9, json!({"dashOffset": v})) +} + +fn scale_factor(h: &Host, a: &[Data]) -> Answer { + this_doc(h, a)?; + Ok(num(1.0)) +} + +/// The `Document` members of this module. +pub(super) fn document_members(l: &Link) -> Vec<(String, HostMember)> { + let members: Vec<(&str, HostMember)> = vec![ + ("defaultFillColor", property(l, |h, a| default_color(h, a, true), |h, a| set_default_color(h, a, true))), + ("defaultFilled", property(l, |h, a| default_painted(h, a, true), |h, a| set_default_painted(h, a, true))), + ("defaultFillOverprint", property(l, |h, a| default_overprint(h, a, true), |h, a| set_default_overprint(h, a, true))), + ("defaultStrokeColor", property(l, |h, a| default_color(h, a, false), |h, a| set_default_color(h, a, false))), + ("defaultStroked", property(l, |h, a| default_painted(h, a, false), |h, a| set_default_painted(h, a, false))), + ("defaultStrokeOverprint", property(l, |h, a| default_overprint(h, a, false), |h, a| set_default_overprint(h, a, false))), + ("defaultStrokeWidth", property(l, default_stroke_width, set_default_stroke_width)), + ("defaultStrokeCap", property(l, default_cap, set_default_cap)), + ("defaultStrokeJoin", property(l, default_join, set_default_join)), + ("defaultStrokeMiterLimit", property(l, default_miter, set_default_miter)), + ("defaultStrokeDashes", property(l, default_dashes, set_default_dashes)), + ("defaultStrokeDashOffset", property(l, default_dash_offset, set_default_dash_offset)), + ("scaleFactor", get(l, scale_factor)), + ]; + members.into_iter().map(|(k, m)| (k.to_string(), m)).collect() +} diff --git a/crates/engine/src/script/dom/paths.rs b/crates/engine/src/script/dom/paths.rs index 32401db1d0..29b5e44719 100644 --- a/crates/engine/src/script/dom/paths.rs +++ b/crates/engine/src/script/dom/paths.rs @@ -797,13 +797,15 @@ fn path_set_stroke_width(h: &super::Host, a: &[Data]) -> Answer { set_stroke_option(h, item, (look.width - w).abs() < 1e-9, json!({"weight": w})) } -const CAPS: &[(LineCap, &str, &str)] = &[ +/// Each stroke cap, its `StrokeCap` value and its name in `stroke.set`. +pub(super) const CAPS: &[(LineCap, &str, &str)] = &[ (LineCap::Butt, "StrokeCap.BUTTENDCAP", "butt"), (LineCap::Round, "StrokeCap.ROUNDENDCAP", "round"), (LineCap::Square, "StrokeCap.PROJECTINGENDCAP", "square"), ]; -const JOINS: &[(LineJoin, &str, &str)] = &[ +/// Each stroke join, its `StrokeJoin` value and its name in `stroke.set`. +pub(super) const JOINS: &[(LineJoin, &str, &str)] = &[ (LineJoin::Bevel, "StrokeJoin.BEVELENDJOIN", "bevel"), (LineJoin::Round, "StrokeJoin.ROUNDENDJOIN", "round"), (LineJoin::Miter, "StrokeJoin.MITERENDJOIN", "miter"), @@ -856,21 +858,27 @@ fn path_dashes(h: &super::Host, a: &[Data]) -> Answer { Ok(Data::Array(this_look(h, a)?.1.dashes.into_iter().map(num).collect())) } -/// `strokeDashes = [lengths]`: at most [`MAX_DASHES`] finite lengths that are not negative and -/// not all 0; `[]` or `{}` gives a solid line. -fn path_set_dashes(h: &super::Host, a: &[Data]) -> Answer { - let lengths: Vec = match arg(a, 1) { +/// The dash and gap lengths a script assigned to `what`: at most [`MAX_DASHES`] finite lengths +/// that are not negative and not all 0; `[]` or `{}` gives a solid line. +pub(super) fn dash_lengths(d: &Data, what: &str) -> std::result::Result, HostError> { + let lengths: Vec = match d { Data::Object(o) if o.is_empty() => Vec::new(), - Data::Array(list) if list.len() > MAX_DASHES => return Err(HostError::Range(format!("strokeDashes takes at most {MAX_DASHES} lengths"))), + Data::Array(list) if list.len() > MAX_DASHES => return Err(HostError::Range(format!("{what} takes at most {MAX_DASHES} lengths"))), Data::Array(list) => list.iter().map(|d| number(d, "each dash length")).collect::>()?, - _ => return Err(HostError::Type("strokeDashes must be an array of lengths".into())), + _ => return Err(HostError::Type(format!("{what} must be an array of lengths"))), }; if lengths.iter().any(|l| !(0.0..=MAX_STROKE_WIDTH * 1000.0).contains(l)) { return Err(HostError::Range("each dash length must be from 0 to 1000000 points".into())); } if !lengths.is_empty() && lengths.iter().all(|l| *l == 0.0) { - return Err(HostError::Range("strokeDashes needs a length that is not 0".into())); + return Err(HostError::Range(format!("{what} needs a length that is not 0"))); } + Ok(lengths) +} + +/// `strokeDashes = [lengths]`, as [`dash_lengths`] takes them. +fn path_set_dashes(h: &super::Host, a: &[Data]) -> Answer { + let lengths = dash_lengths(arg(a, 1), "strokeDashes")?; let (item, look) = this_look(h, a)?; let dash = if lengths.is_empty() { Value::Null } else { json!(lengths) }; set_stroke_option(h, item, look.dashes == lengths, json!({"dash": dash})) diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index a611da1857..6826625700 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -173,6 +173,7 @@ mod script_console; mod script_dialogs; mod script_dollar; mod script_dom; +mod script_dom_defaults; mod script_dom_paths; mod script_engines; mod script_folder; diff --git a/crates/engine/src/tests/newart.rs b/crates/engine/src/tests/newart.rs index 583a5f43d8..ef0f0c8b50 100644 --- a/crates/engine/src/tests/newart.rs +++ b/crates/engine/src/tests/newart.rs @@ -299,3 +299,72 @@ fn fill_line_gives_a_new_line_the_current_fill() { assert_ne!(s.paint.fill, Paint::None); assert!(s.execute("shape.line", &json!({"x1": 0, "y1": 0, "x2": 1, "y2": 1, "fill": "yes"})).is_err()); } + +/// `appearance.setNewArt` sets what the next object gets while the selection keeps its own look. +#[test] +fn set_new_art_changes_the_next_object_and_not_the_selection() { + let mut s = session(); + let picked = rect(&mut s, 20.0); + run(&mut s, "select.set", json!({"ids": [picked.0]})); + let (look, undo, recent, active) = (node(&s, picked).appearance, undo_len(&s), s.recent_colors.clone(), s.fill_active); + let r = run( + &mut s, + "appearance.setNewArt", + json!({"fill": {"color": "#ff0000"}, "stroke": {"none": true}, "weight": 4, "cap": "round", "dash": [3, 1], "dashOffset": 1, "fillOverprint": true}), + ); + assert_eq!(r, json!({"changed": true})); + assert_eq!(node(&s, picked).appearance, look, "the selected art kept its look"); + assert_eq!(s.doc().unwrap().selection.objects, vec![picked]); + assert_eq!((undo_len(&s), &s.recent_colors, s.fill_active), (undo, &recent, active)); + run(&mut s, "select.none", json!({})); + let id = rect(&mut s, 200.0); + let ap = node(&s, id).appearance; + let (fill, st) = (ap.fill().unwrap(), ap.stroke().unwrap()); + assert_eq!(fill.paint, Paint::solid(vectorcraft_color::Color::rgb(1.0, 0.0, 0.0))); + assert!(fill.overprint); + assert_eq!((st.paint.clone(), st.width, st.cap), (Paint::None, 4.0, LineCap::Round)); + assert_eq!(st.dash, Some(Dash { pattern: vec![3.0, 1.0], offset: 1.0, ..Default::default() })); + // The same values again change nothing. + assert_eq!(run(&mut s, "appearance.setNewArt", json!({"weight": 4, "cap": "round"})), json!({"changed": false})); +} + +#[test] +fn set_new_art_refuses_bad_values_with_nothing_changed() { + let mut s = session(); + let before = s.paint.clone(); + for params in [ + json!({"weight": -1}), + json!({"weight": 1001}), + json!({"weight": "3"}), + json!({"miterLimit": 0.5}), + json!({"cap": "flat"}), + json!({"join": 2}), + json!({"dash": [0, 0]}), + json!({"dash": [-1]}), + json!({"dash": "4 2"}), + json!({"dashOffset": 2}), + json!({"fill": "#ff0000"}), + json!({"fill": {}}), + json!({"fill": {"color": "#ff0000"}, "weight": -1}), + json!({"stroke": {"tint": 50, "color": "#000000"}}), + json!({"fillOverprint": "yes"}), + json!({"widht": 3}), + ] { + assert!(s.execute("appearance.setNewArt", ¶ms).is_err(), "accepted {params}"); + assert_eq!(s.paint, before, "changed new art for {params}"); + } +} + +#[test] +fn set_new_art_refuses_while_new_art_takes_the_selected_look() { + let mut s = session(); + let picked = rect(&mut s, 20.0); + run(&mut s, "appearance.setNewArtBasic", json!({"on": false})); + run(&mut s, "select.set", json!({"ids": [picked.0]})); + let before = s.paint.clone(); + assert!(s.execute("appearance.setNewArt", &json!({"weight": 7})).is_err()); + assert_eq!(s.paint, before); + run(&mut s, "select.none", json!({})); + assert_eq!(run(&mut s, "appearance.setNewArt", json!({"weight": 7})), json!({"changed": true})); + assert_eq!(s.new_art().stroke().unwrap().width, 7.0); +} diff --git a/crates/engine/src/tests/script_dom_defaults.rs b/crates/engine/src/tests/script_dom_defaults.rs new file mode 100644 index 0000000000..cc6c53eb4e --- /dev/null +++ b/crates/engine/src/tests/script_dom_defaults.rs @@ -0,0 +1,144 @@ +//! The script object model's document defaults for new art and `scaleFactor`. + +use serde_json::{Value, json}; +use vectorcraft_color::{Color, Paint}; +use vectorcraft_doc::LineCap; + +use crate::*; + +fn run(s: &mut Session, source: &str) -> Result { + s.execute("script.run", &json!({"source": source, "name": "t.js"})) +} + +/// What the run logged. +fn log(s: &mut Session, source: &str) -> Vec { + let r = run(s, source).unwrap_or_else(|e| panic!("{source}: {e}")); + r["log"].as_array().cloned().unwrap_or_default() +} + +/// A 400 × 300 pt document with one rectangle, selected. +fn doc() -> (Session, NodeId) { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + let r = s.execute("shape.rectangle", &json!({"x": 10, "y": 20, "width": 30, "height": 40})).unwrap(); + let id = NodeId(r["id"].as_u64().unwrap()); + s.execute("select.set", &json!({"ids": [id.0]})).unwrap(); + (s, id) +} + +fn undo_steps(s: &Session) -> usize { + s.active().unwrap().history.undo.len() +} + +fn node(s: &Session, id: NodeId) -> crate::doc::Node { + s.active().unwrap().doc.node(id).unwrap().clone() +} + +#[test] +fn a_wider_default_stroke_goes_to_the_next_path_drawn() { + let (mut s, picked) = doc(); + let (look, steps) = (node(&s, picked).appearance, undo_steps(&s)); + let r = run(&mut s, "var d = app.activeDocument; var w = d.defaultStrokeWidth; d.defaultStrokeWidth += 1; vc.log(d.defaultStrokeWidth > w);") + .unwrap(); + assert_eq!(r["log"], json!([true])); + assert_eq!(undo_steps(&s), steps, "a default alone is no undo step"); + assert_eq!(node(&s, picked).appearance, look, "the selected path kept its stroke"); + let wider = s.new_art().stroke().unwrap().width; + let out = log(&mut s, "var p = app.activeDocument.pathItems.rectangle(200, 100, 50, 50); vc.log(p.strokeWidth);"); + assert_eq!(out.iter().map(Value::as_f64).collect::>(), vec![Some(wider)]); + assert!(wider > 1.0); +} + +#[test] +fn a_bad_default_throws_and_changes_nothing() { + let (mut s, _) = doc(); + let before = s.paint.clone(); + for (source, name) in [ + ("app.activeDocument.defaultStrokeWidth = -1", "RangeError"), + ("app.activeDocument.defaultStrokeWidth = 1001", "RangeError"), + ("app.activeDocument.defaultStrokeWidth = 'wide'", "TypeError"), + ("app.activeDocument.defaultStrokeMiterLimit = 0", "RangeError"), + ("app.activeDocument.defaultStrokeCap = 'round'", "TypeError"), + ("app.activeDocument.defaultStrokeJoin = 1", "TypeError"), + ("app.activeDocument.defaultStrokeDashes = [0, 0]", "RangeError"), + ("app.activeDocument.defaultStrokeDashes = '4 2'", "TypeError"), + ("app.activeDocument.defaultStrokeDashOffset = 3", "Error"), + ("app.activeDocument.defaultFillColor = 5", "TypeError"), + ("var c = new RGBColor(); c.red = 300; app.activeDocument.defaultStrokeColor = c", "RangeError"), + ("app.activeDocument.defaultFilled = 1", "TypeError"), + ("app.activeDocument.defaultStrokeOverprint = 'yes'", "TypeError"), + ] { + let out = log(&mut s, &format!("try {{ {source}; vc.log('ran'); }} catch (e) {{ vc.log(e.name); }}")); + assert_eq!(out, vec![json!(name)], "{source}"); + assert_eq!(s.paint, before, "{source} changed new art"); + } +} + +#[test] +fn default_colors_and_flags_read_back_and_paint_the_next_path() { + let (mut s, picked) = doc(); + let look = node(&s, picked).appearance; + let out = log( + &mut s, + "var d = app.activeDocument, c = new RGBColor(); c.red = 255;\ + d.defaultFillColor = c; vc.log(d.defaultFillColor.typename); vc.log(d.defaultFillColor.red); vc.log(d.defaultFilled);\ + d.defaultStroked = false; vc.log(d.defaultStroked); vc.log(d.defaultStrokeColor.typename);\ + d.defaultStrokeColor = new GrayColor(); vc.log(d.defaultStroked);\ + d.defaultFillColor = new NoColor(); vc.log(d.defaultFilled); d.defaultFilled = true; vc.log(d.defaultFilled);\ + d.defaultFillColor = c;", + ); + assert_eq!(out, vec![json!("RGBColor"), json!(255), json!(true), json!(false), json!("NoColor"), json!(true), json!(false), json!(true)]); + assert_eq!(node(&s, picked).appearance, look); + let id = NodeId(s.execute("shape.rectangle", &json!({"x": 200, "y": 20, "width": 30, "height": 40})).unwrap()["id"].as_u64().unwrap()); + let ap = node(&s, id).appearance; + assert_eq!(ap.fill_paint(), Paint::solid(Color::rgb(1.0, 0.0, 0.0))); + assert!(!ap.stroke_paint().is_none()); +} + +#[test] +fn default_stroke_options_read_back_and_a_same_value_runs_no_command() { + let (mut s, _) = doc(); + let out = log( + &mut s, + "var d = app.activeDocument; d.defaultStrokeCap = StrokeCap.ROUNDENDCAP; d.defaultStrokeJoin = StrokeJoin.BEVELENDJOIN;\ + d.defaultStrokeMiterLimit = 7; d.defaultStrokeDashes = [6, 2]; d.defaultStrokeDashOffset = 1;\ + d.defaultStrokeOverprint = true; d.defaultFillOverprint = true;\ + vc.log([d.defaultStrokeCap, d.defaultStrokeJoin, d.defaultStrokeMiterLimit, d.defaultStrokeDashes, d.defaultStrokeDashOffset,\ + d.defaultStrokeOverprint, d.defaultFillOverprint]);", + ); + assert_eq!(out, vec![json!(["StrokeCap.ROUNDENDCAP", "StrokeJoin.BEVELENDJOIN", 7, [6, 2], 1, true, true])]); + let st = s.new_art().stroke().unwrap().clone(); + assert_eq!((st.cap, st.miter_limit, st.overprint), (LineCap::Round, 7.0, true)); + let r = run( + &mut s, + "var d = app.activeDocument; d.defaultStrokeCap = StrokeCap.ROUNDENDCAP; d.defaultStrokeMiterLimit = 7;\ + d.defaultStrokeDashes = [6, 2]; d.defaultStrokeOverprint = true; d.defaultStrokeWidth = d.defaultStrokeWidth;\ + d.defaultFillColor = d.defaultFillColor;", + ) + .unwrap(); + assert_eq!(r["slowestCommands"], json!([]), "the same values run no command"); + // `{}` and `[]` give a solid line. + assert_eq!(log(&mut s, "var d = app.activeDocument; d.defaultStrokeDashes = {}; vc.log(d.defaultStrokeDashes.length);"), vec![json!(0)]); +} + +#[test] +fn scale_factor_is_one_and_read_only() { + let (mut s, _) = doc(); + let out = log(&mut s, "var d = app.activeDocument; vc.log(d.scaleFactor); d.scaleFactor = 4; vc.log(d.scaleFactor);"); + assert_eq!(out, vec![json!(1), json!(1)]); +} + +#[test] +fn defaults_refuse_while_new_art_takes_the_selected_look() { + let (mut s, _) = doc(); + s.execute("appearance.setNewArtBasic", &json!({"on": false})).unwrap(); + s.execute("select.none", &json!({})).unwrap(); + s.execute("select.all", &json!({})).unwrap(); + let before = s.paint.clone(); + let out = log( + &mut s, + "try { app.activeDocument.defaultStrokeWidth = 9; } catch (e) { vc.log(e.message.indexOf('New Art Has Basic Appearance') >= 0); }", + ); + assert_eq!(out, vec![json!(true)]); + assert_eq!(s.paint, before); +} diff --git a/crates/engine/tests/it/script_host_vs_scriptcheck.rs b/crates/engine/tests/it/script_host_vs_scriptcheck.rs index 24417b2c21..3c67918b7e 100644 --- a/crates/engine/tests/it/script_host_vs_scriptcheck.rs +++ b/crates/engine/tests/it/script_host_vs_scriptcheck.rs @@ -97,9 +97,14 @@ const INSIDE: &[(&str, &str)] = &[ ("Document.", "prototype"), ( "Document.prototype.", - "activeLayer activeLayer= artboards artboards= close close= constructor convertCoordinate documentColorSpace \ + "activeLayer activeLayer= artboards artboards= close close= constructor convertCoordinate defaultFillColor \ + defaultFillColor= defaultFillOverprint defaultFillOverprint= defaultFilled defaultFilled= defaultStrokeCap \ + defaultStrokeCap= defaultStrokeColor defaultStrokeColor= defaultStrokeDashOffset defaultStrokeDashOffset= \ + defaultStrokeDashes defaultStrokeDashes= defaultStrokeJoin defaultStrokeJoin= defaultStrokeMiterLimit \ + defaultStrokeMiterLimit= defaultStrokeOverprint defaultStrokeOverprint= defaultStrokeWidth defaultStrokeWidth= \ + defaultStroked defaultStroked= documentColorSpace \ groupItems groupItems= height layers layers= name pageItems parent pathItems rulerOrigin rulerOrigin= \ - rulerUnits saveAs saveAs= selection selection= swatches swatches= symbols symbols= textFrames textFrames= typename \ + rulerUnits saveAs saveAs= scaleFactor selection selection= swatches swatches= symbols symbols= textFrames textFrames= typename \ views views= width", ), ("Layer.", "prototype"), diff --git a/docs/mcp.md b/docs/mcp.md index e3d4e634ed..ee0e5b2372 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2749,7 +2749,22 @@ app through the global object `vc`, and writes to the Script Console and runs ot changed. A path in a compound path or compound shape reads the fill, stroke and overprint of that compound path or shape, which the paint commands paint in its place. A change to a path's paint or stroke leaves the paint for new art, the active Fill or Stroke proxy and Recent Colors as they were. `selectedPathPoints`, `PathPoint.selected`, - `transform`, `polarity`, the gradient stops and the document's default paint are not available yet. + `transform`, `polarity` and the gradient stops are not available yet. +- A `Document`'s default paint members (https://ai-scripting.docsforadobe.dev/jsobjref/Document/) read and set what + the next object drawn gets, as `appearance.newArt` reports it, the same for every open document: `defaultFillColor`, + `defaultFilled`, `defaultFillOverprint`, `defaultStrokeColor`, `defaultStroked`, `defaultStrokeOverprint`, + `defaultStrokeWidth`, `defaultStrokeCap`, `defaultStrokeJoin`, `defaultStrokeMiterLimit`, `defaultStrokeDashes` + (`[]` or `{}` for a solid line) and `defaultStrokeDashOffset`. Assigning one runs `appearance.setNewArt`, which + leaves the selection, its art, the active Fill or Stroke proxy and Recent Colors as they were and adds no undo step. + A value that changes nothing runs no command, and a bad value throws an error with nothing changed. VectorCraft's + own rules: assigning a color also makes `defaultFilled` or `defaultStroked` true, and a `NoColor` makes it false; + `defaultFilled` or `defaultStroked` set to true with no fill or stroke gives black; an RGB color is stored in the + front document's color mode, as `paint.setFill` stores it; `defaultStrokeWidth` is 0 to 1000 points, a dash or gap 0 + to 1,000,000 points (at most 64, not all 0), and `defaultStrokeDashOffset` -1,000,000 to 1,000,000 points, which + needs a dash pattern unless it is 0; while New Art Has Basic Appearance is off and an object is selected, assigning + a default throws an error, since new art then takes that object's appearance. `scaleFactor` + (https://www.indesignjs.de/indesignapi/illustrator/illustrator.d.ts lists it as read-only) is always 1, since + VectorCraft draws every document at its own size; after an assignment it still reads 1. - `$.write(...values)` writes the values to the Script Console with no separator, each as `String(value)` gives it, and `$.writeln(...values)` does the same and ends the line. Each call counts as a host call. - `$.evalFile(path, timeout?)` runs the file `path` names, relative to the file being run, in the same global @@ -8810,6 +8825,12 @@ colorized) changes nothing. With the option off (`appearance.setNewArtBasic {on: whole appearance of the last selected object. `appearance.newArt` reports what the next object gets; `paint.default` resets it. `appearance.setNewArtBasic` rejects an `on` value that is not a boolean. Omitting `on` toggles the current preference. +`appearance.setNewArt {fill?, stroke?, weight?, cap?, join?, miterLimit?, dash?, dashOffset?, fillOverprint?, +strokeOverprint?}` sets new art's fill, stroke and stroke options whatever is selected, and leaves the selection, its +art, the active proxy and Recent Colors as they were. `fill` and `stroke` take a paint as `paint.setFill` does; a +stroke painted on new art without one gets a 1 pt weight unless `weight` is given. Every value is checked before +anything changes, and any change while New Art Has Basic Appearance is off and an object is selected is an error. It +returns `{changed}`, false when the next object would look the same. ```json {"name":"run_command","arguments":{"command":"select.none","params":{}}} diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 72ed713051..56b8b1d8fd 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1025,7 +1025,8 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - The control server writes each reply through a 64 KiB buffer. On Windows 11 it sends the 17 MB `document.inspect` reply of a document with 50,000 objects on one layer to a client over loopback in 0.09 s instead of 34 s. - Scripts: File › Scripts › Other Script… and `script.run` run a JavaScript file against the open documents as one transaction with one undo step for each changed document. A failed or stopped run puts every document back. `crates/engine/src/tests/script_run.rs`. - Scripts: the global `app` gives the open documents, new documents from a startup preset and a `DocumentPreset`, the active document, each document's selection and its page items with their names, notes, visibility, lock, opacity, position, size, bounds and stacking order, and moves and copies them into or beside other objects, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/Application/, https://ai-scripting.docsforadobe.dev/jsobjref/Documents/, https://ai-scripting.docsforadobe.dev/jsobjref/DocumentPreset/, https://ai-scripting.docsforadobe.dev/jsobjref/Document/, https://ai-scripting.docsforadobe.dev/jsobjref/PageItems/, https://ai-scripting.docsforadobe.dev/jsobjref/PageItem/ and https://ai-scripting.docsforadobe.dev/jsobjref/GroupItem/ describe them; each change runs a command inside the run's transaction (`docs/mcp.md`). Layers, type and the other classes are not there yet. `crates/engine/src/tests/script_dom.rs`. - - Scripts: `Document.pathItems` lists the paths and makes rectangles, rounded rectangles, ellipses, polygons, stars and empty paths with the defaults the help page https://ai-scripting.docsforadobe.dev/jsobjref/PathItems/ gives; each path's points, closed state, fill rule, area, length, fill and stroke colors, stroke options and transforms read and change as https://ai-scripting.docsforadobe.dev/jsobjref/PathItem/, https://ai-scripting.docsforadobe.dev/jsobjref/PathPoints/ and https://ai-scripting.docsforadobe.dev/jsobjref/PathPoint/ describe them, and `RGBColor`, `CMYKColor`, `GrayColor`, `LabColor` and `NoColor` make colors (`docs/mcp.md`). The transforms move gradients with the art: `changeFillGradients` false throws an error, as do `changeFillPatterns` and `changeStrokePattern` given as different values, and `transform` is not there yet (`docs/mcp.md` lists these limits). Gradient stops and the document's default paint are not there yet. `crates/engine/src/tests/script_dom_paths.rs`. + - Scripts: `Document.pathItems` lists the paths and makes rectangles, rounded rectangles, ellipses, polygons, stars and empty paths with the defaults the help page https://ai-scripting.docsforadobe.dev/jsobjref/PathItems/ gives; each path's points, closed state, fill rule, area, length, fill and stroke colors, stroke options and transforms read and change as https://ai-scripting.docsforadobe.dev/jsobjref/PathItem/, https://ai-scripting.docsforadobe.dev/jsobjref/PathPoints/ and https://ai-scripting.docsforadobe.dev/jsobjref/PathPoint/ describe them, and `RGBColor`, `CMYKColor`, `GrayColor`, `LabColor` and `NoColor` make colors (`docs/mcp.md`). The transforms move gradients with the art: `changeFillGradients` false throws an error, as do `changeFillPatterns` and `changeStrokePattern` given as different values, and `transform` is not there yet (`docs/mcp.md` lists these limits). Gradient stops are not there yet. `crates/engine/src/tests/script_dom_paths.rs`. + - Scripts: a document's `default*` members (https://ai-scripting.docsforadobe.dev/jsobjref/Document/) read and set the fill, stroke and stroke options of the next object drawn through `appearance.setNewArt`, leaving the selection and its art as they were, and `scaleFactor` reads 1 (`docs/mcp.md`). `crates/engine/src/tests/script_dom_defaults.rs`. - Scripts: Window › Script Console shows each run's `$.write` and `$.writeln` output, `vc.log` entries, uncaught error with the script's name, line and column, and a report of its time, host calls and slowest commands, keeping at most 2,048 lines and counting the lines it dropped. `script.run`'s report carries the same data, and `script.console`, `script.console.clear` and `ui.copyScriptConsole` read, clear and copy it. `crates/engine/src/tests/script_console.rs`. - Scripts: the status bar translates its own words around a failed run's error and the app's own error messages, and shows text the script threw itself (a value, an error it made, or an error whose name or message it changed) as it is, even when that text reads like one of the app's messages. `script.run`'s report gives `messageOrigin` (`script` or `built-in`), and the advice about objects other applications give their scripts follows only the app's own reference errors. VectorCraft's own rule. `crates/js/src/interp_tests.rs`, `crates/engine/src/tests/script_run.rs`, `crates/ui-egui/src/chrome/tests.rs`. - Scripts: the `$` object has the other members the Dollar object page lists (https://extendscript.docsforadobe.dev/extendscript-tools-features/dollar-object/), from `$.about()` to `$.version`, and scripts have the global `localize(object, ...values)` (https://extendscript.docsforadobe.dev/extendscript-tools-features/localizing-extendscript-strings/), `toSource(value)` and `Object.prototype.toSource()`. Each run starts with the interface's locale, and what a script changes in `$` lasts only for that run. `crates/engine/src/tests/script_dollar.rs`, `crates/js/src/extension_tests.rs`. From f5afa0b84a470580fc7d81aed2ec6bc5042d08cf Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 25 Nov 2026 10:06:44 -0800 Subject: [PATCH 15/61] Scripts: review fixes for the document defaults and the object model - appearance.setNewArt is listed among the commands a plug-in may call, so every_command_is_reviewed passes. - appearance.setNewArt refuses `tint` on a pattern that has no swatch entry, and its help and docs/mcp.md say an omitted `weight` keeps the stored weight. - The dash checks of appearance.setNewArt, strokeDashes and defaultStrokeDashes share one helper. - defaultStrokeWidth, defaultStrokeMiterLimit and defaultStrokeDashOffset compare exactly, so a slightly different value reaches new art. - An RGB default in a CMYK document is compared in the document's color mode, and a color read back from a path or a default (a Gray too small for its value to name) assigns back without a command. - addDocument starts from the profile's built-in first preset even when a saved preset has the same name. - A saved preset's rows are read as at most 1000. - The page item and path lists are kept for each open document, the selection list stops at its limit, the typename of a removed PathPoint and of a stale PathPoints or PathItems throws, and an item edit whose selection cannot be restored is undone with it. - A path's subpath starts are counted once and kept while its points keep their layout, so reading or setting each of its points in turn no longer walks every subpath for each point. - A run that ended while waiting for a growth answer is checked against its allowance again before it is kept. - docs/mcp.md says which file limits apply to reading a profile's file. --- crates/engine/src/cmd/newart.rs | 48 ++++- crates/engine/src/cmd/newdoc.rs | 11 +- crates/engine/src/cmd/plugin_call/reviewed.rs | 1 + crates/engine/src/script/dom.rs | 88 +++++++-- crates/engine/src/script/dom/colors.rs | 18 ++ crates/engine/src/script/dom/defaults.rs | 12 +- crates/engine/src/script/dom/paths.rs | 178 ++++++++++++++---- crates/engine/src/script/mod.rs | 11 ++ crates/engine/src/tests/newart.rs | 15 ++ crates/engine/src/tests/newdoc.rs | 8 + crates/engine/src/tests/script_dom.rs | 14 +- .../engine/src/tests/script_dom_defaults.rs | 35 +++- crates/engine/src/tests/script_dom_paths.rs | 66 ++++++- docs/mcp.md | 9 +- 14 files changed, 425 insertions(+), 89 deletions(-) diff --git a/crates/engine/src/cmd/newart.rs b/crates/engine/src/cmd/newart.rs index a2c117a1ee..96e8ffcb4a 100644 --- a/crates/engine/src/cmd/newart.rs +++ b/crates/engine/src/cmd/newart.rs @@ -63,7 +63,7 @@ pub fn specs() -> Vec { "Set New Art Appearance", [], None, - "{fill?: {color?, none?, swatch?, tint?, gradient?, keepModel?} (a paint as paint.setFill takes it), stroke?: (a paint, as fill), weight?: 0..1000 pt, cap?: butt|round|square, join?: miter|round|bevel, miterLimit?: 1..500, dash?: [lengths, each 0..1000000 pt, at most 64, not all 0]|null (null: a solid line), dashOffset?: -1000000..1000000 pt (with a dash pattern), fillOverprint?: bool, strokeOverprint?: bool} set the fill, stroke and stroke options the next object drawn gets, whatever is selected: the selection and its art, the active proxy and the recent colors stay as they are. A stroke painted on new art without one gets a 1 pt weight unless `weight` is given. A bad value is an error with nothing changed, and so is any change while New Art Has Basic Appearance is off and an object is selected (new art takes that object's appearance then) → {changed: whether the next object drawn looks different}", + "{fill?: {color?, none?, swatch?, tint?, gradient?, keepModel?} (a paint as paint.setFill takes it), stroke?: (a paint, as fill), weight?: 0..1000 pt, cap?: butt|round|square, join?: miter|round|bevel, miterLimit?: 1..500, dash?: [lengths, each 0..1000000 pt, at most 64, not all 0]|null (null: a solid line), dashOffset?: -1000000..1000000 pt (with a dash pattern), fillOverprint?: bool, strokeOverprint?: bool} set the fill, stroke and stroke options the next object drawn gets, whatever is selected: the selection and its art, the active proxy and the recent colors stay as they are. Without `weight` the stored stroke weight stays; a stroke painted on new art without one gets 1 pt only when that stored weight is 0. A bad value is an error with nothing changed, and so is any change while New Art Has Basic Appearance is off and an object is selected (new art takes that object's appearance then) → {changed: whether the next object drawn looks different}", always, set_new_art ), @@ -75,6 +75,38 @@ const MAX_DASHES: usize = 64; /// The largest dash, gap or dash offset `appearance.setNewArt` takes, in points. const MAX_DASH_LENGTH: f64 = 1_000_000.0; +/// What [`dash_fault`] finds wrong with a list of dash and gap lengths. +#[derive(Clone, Copy, Debug, PartialEq)] +pub(crate) enum DashFault { + /// More than [`MAX_DASHES`] lengths. + TooMany, + /// A length that is not a number from 0 to [`MAX_DASH_LENGTH`]. + OutOfRange, + /// Lengths that are all 0. + AllZero, +} + +/// What is wrong with the dash and gap lengths `lengths`, which `appearance.setNewArt` and the +/// scripts' `strokeDashes` and `defaultStrokeDashes` check the same way; `None` when they are good. +/// An empty list (a solid line) is good. +pub(crate) fn dash_fault(lengths: &[f64]) -> Option { + if lengths.len() > MAX_DASHES { + Some(DashFault::TooMany) + } else if !lengths.iter().all(|n| n.is_finite() && (0.0..=MAX_DASH_LENGTH).contains(n)) { + Some(DashFault::OutOfRange) + } else if !lengths.is_empty() && lengths.iter().all(|n| *n == 0.0) { + Some(DashFault::AllZero) + } else { + None + } +} + +/// `c` as `appearance.setNewArt` stores it without `keepModel`: an RGB color in the color mode of +/// the document in front. +pub(crate) fn stored_color(s: &Session, c: vectorcraft_color::Color) -> vectorcraft_color::Color { + super::paint::new_color(s, &json!({}), c) +} + /// `appearance.setNewArt`: new art's fill, stroke and stroke options, every value checked before /// anything changes. fn set_new_art(s: &mut Session, p: &Value) -> Result { @@ -84,7 +116,8 @@ fn set_new_art(s: &mut Session, p: &Value) -> Result { if !v.is_object() { return Err(bad(C, format!("{key} must be a paint object (color, none, swatch or gradient), got {v}"))); } - if v.get("tint").is_some() && v.get("swatch").is_none() { + let pattern_only = |name: &str| s.doc().is_ok_and(|st| st.doc.swatch(name).is_none() && st.doc.pattern(name).is_some()); + if v.get("tint").is_some() && v.get("swatch").and_then(Value::as_str).is_none_or(pattern_only) { return Err(bad(C, format!("{key}: `tint` goes with a global or spot `swatch`"))); } let given = super::paint::paint_from(s, v)?.ok_or_else(|| bad(C, format!("{key}: give color, none, swatch or gradient")))?; @@ -113,11 +146,12 @@ fn set_new_art(s: &mut Session, p: &Value) -> Result { None | Some(Value::Null) => {} Some(Value::Array(a)) if a.len() > MAX_DASHES => return Err(bad(C, format!("dash takes at most {MAX_DASHES} lengths"))), Some(Value::Array(a)) => { - if !a.iter().all(|v| v.as_f64().is_some_and(|n| n.is_finite() && (0.0..=MAX_DASH_LENGTH).contains(&n))) { - return Err(bad(C, format!("each dash length must be a number from 0 to {MAX_DASH_LENGTH}"))); - } - if !a.is_empty() && a.iter().all(|v| v.as_f64() == Some(0.0)) { - return Err(bad(C, "dash needs a length that is not 0")); + let lengths: Option> = a.iter().map(Value::as_f64).collect(); + match lengths.map_or(Some(DashFault::OutOfRange), |l| dash_fault(&l)) { + None => {} + Some(DashFault::TooMany) => return Err(bad(C, format!("dash takes at most {MAX_DASHES} lengths"))), + Some(DashFault::OutOfRange) => return Err(bad(C, format!("each dash length must be a number from 0 to {MAX_DASH_LENGTH}"))), + Some(DashFault::AllZero) => return Err(bad(C, "dash needs a length that is not 0")), } } Some(v) => return Err(bad(C, format!("dash must be a list of lengths or null, got {v}"))), diff --git a/crates/engine/src/cmd/newdoc.rs b/crates/engine/src/cmd/newdoc.rs index 1efa443bd5..b628fbbf0e 100644 --- a/crates/engine/src/cmd/newdoc.rs +++ b/crates/engine/src/cmd/newdoc.rs @@ -171,8 +171,9 @@ pub struct DocSettings { pub layout: ArtboardLayout, /// Columns of a grid layout. pub columns: u32, - /// Rows of a grid by column, in place of `columns` when more than 0. - #[serde(skip_serializing_if = "is_zero")] + /// Rows of a grid by column, in place of `columns` when more than 0, up to `MAX_ARTBOARDS` (a + /// saved or Recent preset's larger value is read as `MAX_ARTBOARDS`). + #[serde(skip_serializing_if = "is_zero", deserialize_with = "de_rows")] pub rows: u32, /// Space between artboards, points: 0 to `MAX_SPACING` (a saved or Recent preset's value /// outside that range is read as the nearer end). @@ -594,6 +595,12 @@ fn de_artboards<'de, D: serde::Deserializer<'de>>(d: D) -> std::result::Result>(d: D) -> std::result::Result { + Ok(u32::deserialize(d)?.min(MAX_ARTBOARDS)) +} + /// A saved or Recent preset's artboard spacing, kept to 0 to [`MAX_SPACING`] points. fn de_spacing<'de, D: serde::Deserializer<'de>>(d: D) -> std::result::Result { Ok(f64::deserialize(d)?.clamp(0.0, MAX_SPACING)) diff --git a/crates/engine/src/cmd/plugin_call/reviewed.rs b/crates/engine/src/cmd/plugin_call/reviewed.rs index ec7d3ac989..083647fed4 100644 --- a/crates/engine/src/cmd/plugin_call/reviewed.rs +++ b/crates/engine/src/cmd/plugin_call/reviewed.rs @@ -103,6 +103,7 @@ pub(super) const ALLOWED: &[&str] = &[ "appearance.removeItem", "appearance.setActiveItem", "appearance.setItem", + "appearance.setNewArt", "appearance.showAllHidden", "appearance.targetContents", "appearance.transfer", diff --git a/crates/engine/src/script/dom.rs b/crates/engine/src/script/dom.rs index 8cc774bd92..5acf370734 100644 --- a/crates/engine/src/script/dom.rs +++ b/crates/engine/src/script/dom.rs @@ -96,12 +96,15 @@ const ARTBOARD_COORDS: &str = "CoordinateSystem.ARTBOARDCOORDINATESYSTEM"; #[derive(Default)] pub(super) struct State { coords: Cell, - items: RefCell>, - /// The last list of a document's paths ([`paths`]), kept while that document is unchanged. - paths: RefCell>, + items: RefCell>, + /// The last list of each document's paths ([`paths`]), kept while that document is unchanged. + paths: RefCell>, /// A path and its subpaths with the point changes the run has made to it and not written yet /// ([`flush`]). pending: RefCell)>>, + /// The index of the first point of each subpath of the path whose points the run read last, + /// and what they were counted from ([`paths`]). + point_starts: RefCell>)>>, /// How many times the points the run read of each path went stale, by document uid and path id /// ([`paths`]). point_cuts: RefCell>, @@ -148,6 +151,24 @@ fn atomically(h: &Host, f: impl FnOnce(&Host) -> std::result::Result, Rc>); +/// The most documents whose lists [`State`] keeps at once, the least recently listed going first. +const KEPT_LISTS: usize = 8; + +/// The list kept in `lists` for the document `st`, while that document is unchanged. +fn kept_list(lists: &RefCell>, st: &DocState) -> Option>> { + lists.borrow().iter().find(|(uid, doc, _)| *uid == st.uid && Arc::ptr_eq(doc, &st.doc)).map(|(_, _, ids)| ids.clone()) +} + +/// Keeps `ids` in `lists` as the list of the document `st`, in place of the one it had. +fn keep_list(lists: &RefCell>, st: &DocState, ids: &Rc>) { + let mut l = lists.borrow_mut(); + l.retain(|(uid, ..)| *uid != st.uid); + if l.len() >= KEPT_LISTS { + l.remove(0); + } + l.push((st.uid, st.doc.clone(), ids.clone())); +} + type Answer = std::result::Result; /// A member function: the run's host and the call's arguments, `this` first. @@ -396,13 +417,11 @@ fn item_ref(h: &Host, st: &DocState, id: NodeId) -> Data { } } -/// The ids of a document's page items in paint order ([`State`] keeps the last list). +/// The ids of a document's page items in paint order ([`State`] keeps the last list of each +/// document). fn page_items(h: &Host, st: &DocState) -> Rc> { - if let Some((uid, doc, ids)) = &*h.dom.items.borrow() - && *uid == st.uid - && Arc::ptr_eq(doc, &st.doc) - { - return ids.clone(); + if let Some(ids) = kept_list(&h.dom.items, st) { + return ids; } fn walk(nodes: &[Arc], out: &mut Vec) { for n in nodes { @@ -420,7 +439,7 @@ fn page_items(h: &Host, st: &DocState) -> Rc> { let mut ids = Vec::new(); walk(&st.doc.layers, &mut ids); let ids = Rc::new(ids); - *h.dom.items.borrow_mut() = Some((st.uid, st.doc.clone(), ids.clone())); + keep_list(&h.dom.items, st, &ids); ids } @@ -639,12 +658,13 @@ fn on_doc( Ok(v) } -/// Runs `id` with `params` on the item's document, its selection kept. The points the run read of -/// the item's paths stay valid through the change ([`paths::see_all_points`]). +/// Runs `id` with `params` on the item's document, its selection kept, as one change: when the +/// selection cannot be put back, the edit is undone too. The points the run read of the item's +/// paths stay valid through the change ([`paths::see_all_points`]). fn edit_item(h: &Host, item: Item, id: &str, params: &Value) -> std::result::Result { paths::see_all_points(h); let kept = h.dom.editing.replace(Some(item)); - let r = on_doc(h, item.doc.uid, true, |h| command(h, id, params)); + let r = atomically(h, |h| on_doc(h, item.doc.uid, true, |h| command(h, id, params))); h.dom.editing.set(kept); r } @@ -934,6 +954,22 @@ fn startup_preset(name: &str) -> Option<(Option<&'static str>, Option<&'static s }) } +/// The `file.newPresets` fields `addDocument` gives `file.new`: those of the profile's first +/// built-in preset with `presetSettings` over them. +const BUILT_IN_SETTINGS: &[&str] = &[ + "width", + "height", + "units", + "artboards", + "artboardLayout", + "bleed", + "backgroundContents", + "colorMode", + "rasterEffectsPpi", + "previewMode", + "alignNewObjectsToPixelGrid", +]; + /// `documents.addDocument(startupPreset, presetSettings?, showOptionsDialog?)`: a new document from /// the New Document profile `startupPreset` names, with the settings `presetSettings` gives in /// place of the profile's. @@ -977,15 +1013,26 @@ fn docs_add_document(h: &Host, a: &[Data]) -> Answer { Some(Data::Bool(true)) => return Err(HostError::Error(DIALOG_UNAVAILABLE.into())), Some(_) => return Err(HostError::Type("showOptionsDialog must be true or false".into())), } - // The document starts from the first preset of the profile's category (Print: Letter). - let first = profile.and_then(|n| crate::cmd::newdoc::category(&h.session.borrow(), n)?.into_iter().next()); - if let Some(first) = first { - p.insert("preset".into(), json!(first.name)); - } - p.insert("profile".into(), profile.map_or(Value::Null, |n| json!(n))); if let Some(m) = mode { p.entry("colorMode").or_insert_with(|| json!(m)); } + // The document starts from the first built-in preset of the profile's category (Print: + // Letter) with `presetSettings` over it, given in full so that a saved preset of the same name + // does not stand in for it. Settings `file.new` refuses are left for it to report. + let first = profile.and_then(|n| crate::cmd::newdoc::category(&h.session.borrow(), n)?.into_iter().next()); + if let Some(first) = first { + p.insert("preset".into(), json!(first.name)); + if let Ok(full) = first.with_params(&Value::Object(p.clone()), "file.new") + && let Value::Object(settings) = full.to_json() + { + for key in BUILT_IN_SETTINGS { + if let Some(v) = settings.get(*key) { + p.insert((*key).into(), v.clone()); + } + } + } + } + p.insert("profile".into(), profile.map_or(Value::Null, |n| json!(n))); // A profile whose file could not be read throws, and the document `file.new` made with the // defaults is put back, with the Recent sizes as they were. atomically(h, |h| { @@ -1193,7 +1240,8 @@ fn doc_selection(h: &Host, a: &[Data]) -> Answer { fn selection_of(h: &Host, uid: u64) -> Answer { let s = h.session.borrow(); let st = s.documents().iter().find(|d| d.uid == uid).ok_or_else(|| HostError::Error(STALE_DOCUMENT.into()))?; - let ids: Vec = st.selection.objects.iter().copied().filter(|i| st.doc.node(*i).and_then(typename).is_some()).collect(); + let ids: Vec = + st.selection.objects.iter().copied().filter(|i| st.doc.node(*i).and_then(typename).is_some()).take(MAX_LISTED + 1).collect(); if ids.is_empty() { return Ok(Data::Null); } diff --git a/crates/engine/src/script/dom/colors.rs b/crates/engine/src/script/dom/colors.rs index 34c1496054..41726c938f 100644 --- a/crates/engine/src/script/dom/colors.rs +++ b/crates/engine/src/script/dom/colors.rs @@ -90,6 +90,24 @@ pub(super) fn of_paint(paint: &Paint) -> Data { } } +/// Whether assigning the color object `d`, read as `assigned`, leaves the paint `now` as it is: a +/// `NoColor` on no paint, or on an unlinked color either a color equal to it once `store` makes +/// it what the document stores, or the components reading `now` gives (a Gray value read back can +/// stand for an ink amount that no Gray value names exactly). +pub(super) fn unchanged(d: &Data, assigned: Option, now: &Paint, store: impl FnOnce(Color) -> Color) -> bool { + match (assigned, now) { + (None, Paint::None) => true, + (Some(c), Paint::Solid { color, swatch: None, .. }) => store(c) == *color || shows(d, &of_color(color)), + _ => false, + } +} + +/// Whether the color object `d` has the class and every component of `shown`. +fn shows(d: &Data, shown: &Data) -> bool { + let (Data::Object(a), Data::Object(b)) = (d, shown) else { return false }; + b.iter().all(|(k, v)| a.iter().any(|(n, w)| n == k && w == v)) +} + /// The component `key` of color object `o`, from `min` to `max` (0 when it is left out). fn component(o: &[(String, Data)], class: &str, key: &str, min: f64, max: f64) -> std::result::Result { match o.iter().find(|(k, _)| k == key).map(|(_, v)| v) { diff --git a/crates/engine/src/script/dom/defaults.rs b/crates/engine/src/script/dom/defaults.rs index fe8eb5c3f3..861c5acbd1 100644 --- a/crates/engine/src/script/dom/defaults.rs +++ b/crates/engine/src/script/dom/defaults.rs @@ -55,11 +55,7 @@ fn set_default_color(h: &Host, a: &[Data], fill: bool) -> Answer { let what = if fill { "defaultFillColor" } else { "defaultStrokeColor" }; let color = colors::assigned(arg(a, 1), what)?; let now = top_paint(&new_art(h, a)?, fill); - let same = match (&color, &now) { - (None, Paint::None) => true, - (Some(c), Paint::Solid { color, swatch: None, .. }) => c == color, - _ => false, - }; + let same = colors::unchanged(arg(a, 1), color, &now, |c| crate::cmd::newart::stored_color(&h.session.borrow(), c)); let paint = match color { Some(c) => json!({"color": colors::param(&c)}), None => json!({"none": true}), @@ -109,7 +105,7 @@ fn set_default_stroke_width(h: &Host, a: &[Data]) -> Answer { } this_doc(h, a)?; let now = h.session.borrow().paint.stroke_width; - set(h, (now - w).abs() < 1e-9, json!({"weight": w})) + set(h, now == w, json!({"weight": w})) } fn default_cap(h: &Host, a: &[Data]) -> Answer { @@ -152,7 +148,7 @@ fn set_default_miter(h: &Host, a: &[Data]) -> Answer { return Err(HostError::Range("defaultStrokeMiterLimit must be from 1 to 500".into())); } let now = stroke_option(h, a, 10.0, |s| s.miter_limit)?; - set(h, (now - v).abs() < 1e-9, json!({"miterLimit": v})) + set(h, now == v, json!({"miterLimit": v})) } fn dashes(h: &Host, a: &[Data]) -> std::result::Result, HostError> { @@ -183,7 +179,7 @@ fn set_default_dash_offset(h: &Host, a: &[Data]) -> Answer { return Err(HostError::Error("defaultStrokeDashOffset needs defaultStrokeDashes first".into())); } let now = stroke_option(h, a, 0.0, |s| s.dash.as_ref().map_or(0.0, |d| d.offset))?; - set(h, (now - v).abs() < 1e-9, json!({"dashOffset": v})) + set(h, now == v, json!({"dashOffset": v})) } fn scale_factor(h: &Host, a: &[Data]) -> Answer { diff --git a/crates/engine/src/script/dom/paths.rs b/crates/engine/src/script/dom/paths.rs index 2b0419234f..d3faca29a3 100644 --- a/crates/engine/src/script/dom/paths.rs +++ b/crates/engine/src/script/dom/paths.rs @@ -69,7 +69,7 @@ use vectorcraft_tools::params::gradient_params; use super::{ Answer, Coords, Doc, Item, Link, NOT_FOUND, STALE_ITEM, arg, boolean, class, colors, command, coordinate, doc_of, edit_item, editable, find_doc, float, frame, get, given, handle_of, id_of, id_parts, item_of, item_rect, later, method, named, num, number, on_doc, pair, point, point_get, - point_method, point_property, property, this_doc, typename_of, whole, with_doc, + point_method, point_property, property, this_doc, whole, with_doc, }; use crate::{DocState, NodeId, NodeKind}; @@ -140,9 +140,63 @@ fn path_ref(h: &super::Host, item: Item) -> Data { host_ref("PathItem", &[float(h.run), float(item.doc.uid), high, low]) } -/// How many points a path with the subpaths `subs` has. -fn point_count(subs: &[SubPath]) -> usize { - subs.iter().map(|sp| sp.anchors.len()).sum() +/// The index of the first point of each subpath of `subs`, followed by the number of points. +fn starts(subs: &[SubPath]) -> Vec { + let mut out = Vec::with_capacity(subs.len() + 1); + let mut n = 0; + for sp in subs { + out.push(n); + n += sp.anchors.len(); + } + out.push(n); + out +} + +/// The subpath and the place in it of point `i`, given the [`starts`] of a path's subpaths. +fn locate_at(starts: &[usize], i: usize) -> Option<(usize, usize)> { + if i >= *starts.last()? { + return None; + } + let s = starts.partition_point(|first| *first <= i).checked_sub(1)?; + Some((s, i - starts.get(s)?)) +} + +/// What the [`starts`] that [`super::State`] keeps were counted from: a path's node as its document +/// holds it, by document uid, or the waiting point changes of a path ([`edit_points`]). +pub(super) enum Counted { + Node(u64, Arc), + Waiting(Item), +} + +/// The [`starts`] of the path of `item`, its waiting point changes included. They are kept while +/// the path's node is the same one, or until the waiting changes add or remove points. +fn point_starts(h: &super::Host, item: Item) -> std::result::Result>, HostError> { + let waiting = matches!(&*h.dom.pending.borrow(), Some((w, _)) if same_path(*w, item)); + if waiting { + if let Some((Counted::Waiting(k), kept)) = &*h.dom.point_starts.borrow() + && same_path(*k, item) + { + return Ok(kept.clone()); + } + let counted = Rc::new(read_points(h, item, starts)?); + *h.dom.point_starts.borrow_mut() = Some((Counted::Waiting(item), counted.clone())); + return Ok(counted); + } + let node = with_doc(h, item.doc, |_, st| node_arc(&st.doc, item.id).cloned()).ok_or_else(|| HostError::Error(STALE_ITEM.into()))?; + if let Some((Counted::Node(uid, kept_node), kept)) = &*h.dom.point_starts.borrow() + && *uid == item.doc.uid + && Arc::ptr_eq(kept_node, &node) + { + return Ok(kept.clone()); + } + let counted = Rc::new(starts(&node.path_data().ok_or_else(|| HostError::Type("this is not a PathItem".into()))?.subpaths)); + *h.dom.point_starts.borrow_mut() = Some((Counted::Node(item.doc.uid, node), counted.clone())); + Ok(counted) +} + +/// How many points the path of `item` has, its waiting point changes included ([`point_starts`]). +fn points_of(h: &super::Host, item: Item) -> std::result::Result { + Ok(point_starts(h, item)?.last().copied().unwrap_or(0)) } /// The subpath and the place in it of point `i`, among the subpaths `subs`. @@ -180,6 +234,7 @@ fn read_points(h: &super::Host, item: Item, f: impl FnOnce(&[SubPath]) -> T) /// locked, unless it changes nothing. A path that is aligned to the pixel grid, or is in an object /// that is, is written at once, so that its points read as the grid snaps them. fn edit_points(h: &super::Host, item: Item, f: impl FnOnce(&mut Vec) -> T) -> std::result::Result { + forget_waiting_starts(h); if let Some((waiting, subs)) = &mut *h.dom.pending.borrow_mut() && same_path(*waiting, item) { @@ -205,6 +260,33 @@ fn edit_points(h: &super::Host, item: Item, f: impl FnOnce(&mut Vec) Ok(r) } +/// Drops the [`starts`] that [`super::State`] keeps of waiting point changes, which a change can +/// make wrong. +fn forget_waiting_starts(h: &super::Host) { + let mut kept = h.dom.point_starts.borrow_mut(); + if matches!(&*kept, Some((Counted::Waiting(_), _))) { + *kept = None; + } +} + +/// Changes the anchor at index `i` of the path of `item` with `f` ([`edit_points`]). The change +/// adds and removes no points, so the [`starts`] of the path stay kept. +fn edit_anchor(h: &super::Host, item: Item, i: usize, f: impl FnOnce(&mut Anchor)) -> std::result::Result<(), HostError> { + let counted = point_starts(h, item)?; + let at = locate_at(&counted, i); + edit_points(h, item, |subs| { + if let Some((s, j)) = at + && let Some(an) = subs.get_mut(s).and_then(|sp| sp.anchors.get_mut(j)) + { + f(an); + } + })?; + if matches!(&*h.dom.pending.borrow(), Some((w, _)) if same_path(*w, item)) { + *h.dom.point_starts.borrow_mut() = Some((Counted::Waiting(item), counted)); + } + Ok(()) +} + /// Gives the path of `item` the subpaths `subs` ([`edit_points`]). fn write_path(h: &super::Host, item: Item, subs: Vec) -> std::result::Result<(), HostError> { edit_points(h, item, |s| *s = subs) @@ -214,6 +296,7 @@ fn write_path(h: &super::Host, item: Item, subs: Vec) -> std::result::R /// the path has those points already. pub(super) fn flush(h: &super::Host) -> std::result::Result<(), HostError> { let Some((item, subs)) = h.dom.pending.borrow_mut().take() else { return Ok(()) }; + forget_waiting_starts(h); let same = { let s = h.session.borrow(); let node = s.documents().iter().find(|d| d.uid == item.doc.uid).and_then(|st| st.doc.node(item.id)); @@ -278,16 +361,13 @@ fn keeping_paint(h: &super::Host, f: impl FnOnce() -> T) -> T { /// The ids of a document's paths, in the order of its page items. fn path_items(h: &super::Host, st: &DocState) -> Rc> { - if let Some((uid, doc, ids)) = &*h.dom.paths.borrow() - && *uid == st.uid - && std::sync::Arc::ptr_eq(doc, &st.doc) - { - return ids.clone(); + if let Some(ids) = super::kept_list(&h.dom.paths, st) { + return ids; } let all = super::page_items(h, st); let ids: Rc> = Rc::new(all.iter().copied().filter(|i| st.doc.node(*i).is_some_and(|n| matches!(n.kind, NodeKind::Path { .. }))).collect()); - *h.dom.paths.borrow_mut() = Some((st.uid, st.doc.clone(), ids.clone())); + super::keep_list(&h.dom.paths, st, &ids); ids } @@ -300,6 +380,12 @@ fn items_doc(h: &super::Host, a: &[Data]) -> std::result::Result doc_of(h, arg(a, 0), "PathItems") } +/// `typename` of the paths of a document that is still open. +fn items_typename(h: &super::Host, a: &[Data]) -> Answer { + items_doc(h, a)?; + Ok(Data::String("PathItems".into())) +} + fn items_length(h: &super::Host, a: &[Data]) -> Answer { let doc = items_doc(h, a)?; Ok(num(float(with_doc(h, doc, |_, st| path_items(h, st).len()) as u64))) @@ -818,12 +904,7 @@ fn set_color(h: &super::Host, a: &[Data], fill: bool) -> Answer { let color = colors::assigned(arg(a, 1), if fill { "fillColor" } else { "strokeColor" })?; let (item, look) = this_look(h, a)?; let now = if fill { &look.fill } else { &look.stroke }; - let same = match (&color, now) { - (None, Paint::None) => true, - (Some(c), Paint::Solid { color, swatch: None, .. }) => c == color, - _ => false, - }; - if !same { + if !colors::unchanged(arg(a, 1), color, now, |c| c) { set_paint(h, item, fill, color)?; } Ok(Data::Undefined) @@ -928,13 +1009,13 @@ pub(super) fn dash_lengths(d: &Data, what: &str) -> std::result::Result Data::Array(list) => list.iter().map(|d| number(d, "each dash length")).collect::>()?, _ => return Err(HostError::Type(format!("{what} must be an array of lengths"))), }; - if lengths.iter().any(|l| !(0.0..=MAX_STROKE_WIDTH * 1000.0).contains(l)) { - return Err(HostError::Range("each dash length must be from 0 to 1000000 points".into())); + use crate::cmd::newart::DashFault; + match crate::cmd::newart::dash_fault(&lengths) { + None => Ok(lengths), + Some(DashFault::TooMany) => Err(HostError::Range(format!("{what} takes at most {MAX_DASHES} lengths"))), + Some(DashFault::OutOfRange) => Err(HostError::Range("each dash length must be from 0 to 1000000 points".into())), + Some(DashFault::AllZero) => Err(HostError::Range(format!("{what} needs a length that is not 0"))), } - if !lengths.is_empty() && lengths.iter().all(|l| *l == 0.0) { - return Err(HostError::Range(format!("{what} needs a length that is not 0"))); - } - Ok(lengths) } /// `strokeDashes = [lengths]`, as [`dash_lengths`] takes them. @@ -1129,9 +1210,15 @@ fn points_path(h: &super::Host, a: &[Data]) -> std::result::Result Answer { + points_path(h, a)?; + Ok(Data::String("PathPoints".into())) +} + fn points_length(h: &super::Host, a: &[Data]) -> Answer { let item = points_path(h, a)?; - read_points(h, item, |subs| num(float(point_count(subs) as u64))) + Ok(num(float(points_of(h, item)? as u64))) } fn points_parent(h: &super::Host, a: &[Data]) -> Answer { @@ -1255,7 +1342,7 @@ fn points_at(h: &super::Host, a: &[Data]) -> Answer { let item = points_path(h, a)?; let Data::Number(n) = arg(a, 1) else { return Ok(Data::Undefined) }; let Some(i) = whole(*n).and_then(|i| usize::try_from(i).ok()) else { return Ok(Data::Undefined) }; - let n = read_points(h, item, point_count)?; + let n = points_of(h, item)?; Ok(if i < n { point_ref(h, item, i) } else { Data::Undefined }) } @@ -1273,18 +1360,33 @@ fn points_index(h: &super::Host, a: &[Data]) -> Answer { fn points_add(h: &super::Host, a: &[Data]) -> Answer { let item = points_path(h, a)?; let origin = with_doc(h, item.doc, |_, st| frame(st).map(|f| f.to_document(h.dom.coords.get(), [0.0, 0.0]))); - let (n, last) = read_points(h, item, |subs| (point_count(subs), subs.iter().rev().find_map(|sp| sp.anchors.last()).map(|a| a.p)))?; + let mut counted = point_starts(h, item)?; + let n = counted.last().copied().unwrap_or(0); if n >= MAX_POINTS { return Err(HostError::Range(format!("PathPoints.add takes a path to at most {MAX_POINTS} points"))); } + let last = read_points(h, item, |subs| subs.iter().rev().find_map(|sp| sp.anchors.last()).map(|a| a.p))?; let p = match last { Some(p) => p, None => origin?, }; + // The kept starts are dropped, so that `counted` is their only copy and grows in place. + *h.dom.point_starts.borrow_mut() = None; edit_points(h, item, |subs| match subs.last_mut() { Some(sp) => sp.anchors.push(Anchor::corner(p)), None => subs.push(SubPath::new(vec![Anchor::corner(p)], false)), })?; + if matches!(&*h.dom.pending.borrow(), Some((w, _)) if same_path(*w, item)) { + let grown = Rc::make_mut(&mut counted); + if grown.len() > 1 { + if let Some(total) = grown.last_mut() { + *total += 1; + } + } else { + *grown = vec![0, 1]; + } + *h.dom.point_starts.borrow_mut() = Some((Counted::Waiting(item), counted)); + } Ok(point_ref(h, item, n)) } @@ -1307,8 +1409,7 @@ pub(super) fn this_point(h: &super::Host, a: &[Data]) -> std::result::Result<(It return Err(HostError::Error(STALE_POINT.into())); } let i = whole(*i).and_then(|i| usize::try_from(i).ok()).ok_or_else(|| HostError::Error(STALE_POINT.into()))?; - let n = read_points(h, item, point_count)?; - if i >= n { + if i >= points_of(h, item)? { return Err(HostError::Error(STALE_POINT.into())); } Ok((item, i)) @@ -1319,8 +1420,9 @@ fn read_point(h: &super::Host, a: &[Data], f: impl FnOnce(&super::Frame, Coords, let (item, i) = this_point(h, a)?; let c = h.dom.coords.get(); let fr = with_doc(h, item.doc, |_, st| frame(st))?; + let at = locate_at(&point_starts(h, item)?, i); read_points(h, item, |subs| { - let anchor = locate(subs, i).and_then(|(s, j)| subs.get(s).and_then(|sp| sp.anchors.get(j))); + let anchor = at.and_then(|(s, j)| subs.get(s).and_then(|sp| sp.anchors.get(j))); anchor.map(|an| f(&fr, c, an)).ok_or_else(|| HostError::Error(STALE_POINT.into())) })? } @@ -1329,13 +1431,7 @@ fn read_point(h: &super::Host, a: &[Data], f: impl FnOnce(&super::Frame, Coords, /// coordinates (for a point property) or the value itself. fn edit_point(h: &super::Host, a: &[Data], f: impl FnOnce(&mut Anchor)) -> Answer { let (item, i) = this_point(h, a)?; - edit_points(h, item, |subs| { - if let Some((s, j)) = locate(subs, i) - && let Some(an) = subs.get_mut(s).and_then(|sp| sp.anchors.get_mut(j)) - { - f(an); - } - })?; + edit_anchor(h, item, i, f)?; Ok(Data::Undefined) } @@ -1392,6 +1488,12 @@ fn pt_parent(h: &super::Host, a: &[Data]) -> Answer { Ok(path_ref(h, item)) } +/// `typename` of a point that is still on its path. +fn pt_typename(h: &super::Host, a: &[Data]) -> Answer { + this_point(h, a)?; + Ok(Data::String("PathPoint".into())) +} + /// Whether a group or compound path that holds the path `id` is selected, which selects the path /// as a whole whatever the path's own selection is. fn held_selected(d: &crate::Document, sel: &crate::doc::Selection, id: NodeId) -> bool { @@ -1573,7 +1675,7 @@ pub(super) fn classes(l: &Link) -> Vec { "PathItems", None, named(vec![ - ("typename", typename_of("PathItems")), + ("typename", get(l, items_typename)), ("length", get(l, items_length)), ("parent", get(l, items_parent)), ("index", method(l, items_index)), @@ -1592,7 +1694,7 @@ pub(super) fn classes(l: &Link) -> Vec { "PathPoints", None, named(vec![ - ("typename", typename_of("PathPoints")), + ("typename", point_get(l, points_typename)), ("length", point_get(l, points_length)), ("parent", point_get(l, points_parent)), ("index", point_method(l, points_index)), @@ -1605,7 +1707,7 @@ pub(super) fn classes(l: &Link) -> Vec { "PathPoint", None, named(vec![ - ("typename", typename_of("PathPoint")), + ("typename", point_get(l, pt_typename)), ("parent", point_get(l, pt_parent)), ("anchor", point_property(l, pt_anchor, pt_set_anchor)), ("leftDirection", point_property(l, pt_left, pt_set_left)), diff --git a/crates/engine/src/script/mod.rs b/crates/engine/src/script/mod.rs index 9bdd211b3f..f2e4144e43 100644 --- a/crates/engine/src/script/mod.rs +++ b/crates/engine/src/script/mod.rs @@ -2227,6 +2227,17 @@ impl Session { RunError { kind: RunErrorKind::Limit(kind), message: format!("limit reached: {kind:?}"), line: 0, column: 0, authored: false }; return Some(self.script_failed(job, &e)); } + // One more allowance may still leave the growth past it: the person is asked again + // while they may be, and past that the run ends unkept. + if let Err(HostError::Abort(message)) = job.host.charge_growth(0, 0) { + let e = RunError { kind: RunErrorKind::Limit(LimitKind::Host), message, line: 0, column: 0, authored: false }; + return Some(self.script_failed(job, &e)); + } + if job.host.waiting.get() { + JOBS.with(|jobs| jobs.borrow_mut().insert(key.id, job)); + self.script_key = Some(key); + return None; + } return Some(self.script_ended(job)); } // A stop while a dialog waits ends the run there; the interpreter cannot go on from the call. diff --git a/crates/engine/src/tests/newart.rs b/crates/engine/src/tests/newart.rs index 231d2681da..40613d1e3c 100644 --- a/crates/engine/src/tests/newart.rs +++ b/crates/engine/src/tests/newart.rs @@ -1,6 +1,8 @@ //! The new-art template (M3.65): Stroke panel options and graphic styles chosen with nothing //! selected, New Art Has Basic Appearance and `paint.default`. +use std::sync::Arc; + use serde_json::{Value, json}; use vectorcraft_color::{BlendMode, Paint}; use vectorcraft_doc::{Appearance, Dash, LineCap, Node}; @@ -396,6 +398,19 @@ fn set_new_art_refuses_bad_values_with_nothing_changed() { } } +#[test] +fn set_new_art_refuses_a_tint_on_a_pattern_without_a_swatch_entry() { + let mut s = session(); + let id = rect(&mut s, 20.0); + let name = run(&mut s, "object.pattern.make", json!({"ids": [id.0], "edit": false}))["name"].as_str().unwrap().to_string(); + run(&mut s, "select.none", json!({})); + Arc::make_mut(&mut s.doc_mut().unwrap().doc).remove_swatch(&name); + let before = s.paint.clone(); + assert!(s.execute("appearance.setNewArt", &json!({"fill": {"swatch": name, "tint": 50}})).is_err(), "accepted a tint on {name}"); + assert_eq!(s.paint, before); + assert_eq!(run(&mut s, "appearance.setNewArt", json!({"fill": {"swatch": name}})), json!({"changed": true})); +} + #[test] fn set_new_art_refuses_while_new_art_takes_the_selected_look() { let mut s = session(); diff --git a/crates/engine/src/tests/newdoc.rs b/crates/engine/src/tests/newdoc.rs index 1cb2025325..e09d19ecce 100644 --- a/crates/engine/src/tests/newdoc.rs +++ b/crates/engine/src/tests/newdoc.rs @@ -1037,3 +1037,11 @@ fn the_new_layer_takes_an_id_no_profile_art_has() { // Ids given out later skip the symbol's art too. assert!(d.peek_next_id() > d.layers[0].id.0 && d.peek_next_id() > next); } + +#[test] +fn a_saved_presets_rows_are_read_within_the_artboard_limit() { + let rows = |n: u32| serde_json::from_value::(json!({"rows": n})).unwrap().rows; + assert_eq!(rows(1001), crate::cmd::newdoc::MAX_ARTBOARDS, "file.new takes the listed rows again"); + assert_eq!(rows(0), 0, "0 stays: columns in their place"); + assert_eq!(rows(12), 12, "more rows than artboards stay"); +} diff --git a/crates/engine/src/tests/script_dom.rs b/crates/engine/src/tests/script_dom.rs index 69ba1973db..b317349fcc 100644 --- a/crates/engine/src/tests/script_dom.rs +++ b/crates/engine/src/tests/script_dom.rs @@ -805,6 +805,16 @@ fn note_is_the_attributes_note() { assert!(failure(&mut s, "app.activeDocument.pageItems[0].note = new Array(5000).join('n');").contains("too long")); } +#[test] +fn a_profile_starts_from_its_built_in_preset_and_not_a_saved_one_of_the_same_name() { + let mut s = Session::new(); + s.execute("file.newPresets.save", &json!({"name": "Letter", "width": 100, "height": 50, "units": "Millimeters", "colorMode": "rgb"})).unwrap(); + let out = log(&mut s, "var d = app.documents.addDocument('Print'); vc.log([d.width, d.height, d.documentColorSpace]);"); + assert_eq!(out, vec![json!([612, 792, "DocumentColorSpace.CMYK"])]); + let out = log(&mut s, "var p = new DocumentPreset(); p.width = 300; var d = app.documents.addDocument('Print', p); vc.log([d.width, d.height]);"); + assert_eq!(out, vec![json!([300, 792])], "presetSettings goes over the built-in preset"); +} + #[test] fn document_preset_applies_only_its_given_fields() { let mut s = Session::new(); @@ -1019,8 +1029,8 @@ fn get_is_file_open_cannot_probe_outside_script_scope() { let (mut s, _, _) = doc(); let path = std::env::temp_dir().join(format!("vc-dom-open-{}.svg", std::process::id())); s.execute("document.save", &json!({"path": path.to_string_lossy()})).unwrap(); - let p = path.to_string_lossy().replace('\\', "\\\\"); - let query = format!("vc.log(app.getIsFileOpen('{p}')); vc.log(app.getIsFileOpen('{p}.other'));"); + let (p, other) = (json!(path.to_string_lossy()), json!(format!("{}.other", path.to_string_lossy()))); + let query = format!("vc.log(app.getIsFileOpen({p})); vc.log(app.getIsFileOpen({other}));"); let out = log(&mut s, &query); assert_eq!(out, vec![json!(true), json!(false)]); // Read roots that leave out the document's file: the same path does not count. diff --git a/crates/engine/src/tests/script_dom_defaults.rs b/crates/engine/src/tests/script_dom_defaults.rs index cc6c53eb4e..a3bdc447e0 100644 --- a/crates/engine/src/tests/script_dom_defaults.rs +++ b/crates/engine/src/tests/script_dom_defaults.rs @@ -38,15 +38,14 @@ fn node(s: &Session, id: NodeId) -> crate::doc::Node { fn a_wider_default_stroke_goes_to_the_next_path_drawn() { let (mut s, picked) = doc(); let (look, steps) = (node(&s, picked).appearance, undo_steps(&s)); - let r = run(&mut s, "var d = app.activeDocument; var w = d.defaultStrokeWidth; d.defaultStrokeWidth += 1; vc.log(d.defaultStrokeWidth > w);") - .unwrap(); - assert_eq!(r["log"], json!([true])); + let wider = s.paint.stroke_width + 1.0; + let r = run(&mut s, "var d = app.activeDocument; d.defaultStrokeWidth += 1; vc.log(d.defaultStrokeWidth);").unwrap(); + assert_eq!(r["log"][0].as_f64(), Some(wider)); assert_eq!(undo_steps(&s), steps, "a default alone is no undo step"); assert_eq!(node(&s, picked).appearance, look, "the selected path kept its stroke"); - let wider = s.new_art().stroke().unwrap().width; + assert_eq!(s.new_art().stroke().unwrap().width, wider); let out = log(&mut s, "var p = app.activeDocument.pathItems.rectangle(200, 100, 50, 50); vc.log(p.strokeWidth);"); assert_eq!(out.iter().map(Value::as_f64).collect::>(), vec![Some(wider)]); - assert!(wider > 1.0); } #[test] @@ -121,6 +120,32 @@ fn default_stroke_options_read_back_and_a_same_value_runs_no_command() { assert_eq!(log(&mut s, "var d = app.activeDocument; d.defaultStrokeDashes = {}; vc.log(d.defaultStrokeDashes.length);"), vec![json!(0)]); } +#[test] +fn a_slightly_different_number_reaches_new_art() { + let (mut s, _) = doc(); + log(&mut s, "var d = app.activeDocument; d.defaultStrokeWidth = 1; d.defaultStrokeMiterLimit = 7; d.defaultStrokeDashes = [6, 2];"); + log( + &mut s, + "var d = app.activeDocument; d.defaultStrokeWidth = 1.0000000005; d.defaultStrokeMiterLimit = 7.0000000005;\ + d.defaultStrokeDashOffset = 0.0000000005;", + ); + let st = s.new_art().stroke().unwrap().clone(); + assert_eq!(st.width, 1.000_000_000_5); + assert_eq!(st.miter_limit, 7.000_000_000_5); + assert_eq!(st.dash.map(|d| d.offset), Some(0.000_000_000_5)); +} + +#[test] +fn an_rgb_default_in_a_cmyk_document_runs_no_command_the_second_time() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 400, "height": 300, "colorMode": "cmyk"})).unwrap(); + let set = "var d = app.activeDocument, c = new RGBColor(); c.red = 200; c.green = 40; c.blue = 90; d.defaultFillColor = c;"; + let first = run(&mut s, set).unwrap(); + assert_ne!(first["slowestCommands"], json!([]), "the first assignment changes new art"); + let again = run(&mut s, set).unwrap(); + assert_eq!(again["slowestCommands"], json!([]), "the same RGB value runs no command"); +} + #[test] fn scale_factor_is_one_and_read_only() { let (mut s, _) = doc(); diff --git a/crates/engine/src/tests/script_dom_paths.rs b/crates/engine/src/tests/script_dom_paths.rs index bb73f4175d..ce088ea01c 100644 --- a/crates/engine/src/tests/script_dom_paths.rs +++ b/crates/engine/src/tests/script_dom_paths.rs @@ -282,6 +282,25 @@ fn points_read_before_a_removal_or_replacement_go_stale() { json!("Stale path point") ] ); + let out = log( + &mut s, + "var p = app.activeDocument.pathItems[1], pt = p.pathPoints[0]; vc.log(pt.typename); pt.remove();\ + try { vc.log(pt.typename); } catch (e) { vc.log(e.message); }", + ); + assert_eq!(out, vec![json!("PathPoint"), json!("Stale path point")]); + // The points of a removed path, and collections kept from an earlier run, throw on typename as on + // their other members. + let out = log( + &mut s, + "var p = app.activeDocument.pathItems[0], pp = p.pathPoints; vc.log([pp.typename, app.activeDocument.pathItems.typename]); p.remove();\ + var a = '', b = ''; try { pp.length; } catch (e) { a = e.message; } try { pp.typename; } catch (e) { b = e.message; } vc.log(a !== '' && a === b);", + ); + assert_eq!(out, vec![json!(["PathPoints", "PathItems"]), json!(true)]); + run(&mut s, "#targetengine keep\nvar items = app.activeDocument.pathItems, pts = items[0].pathPoints;").unwrap(); + for (member, message) in [("items.typename", "Stale document"), ("pts.typename", "Stale")] { + let e = failure(&mut s, &format!("#targetengine keep\n{member};")); + assert!(e.contains(message), "{member}: {e}"); + } } #[test] @@ -468,6 +487,14 @@ fn a_color_read_from_a_path_assigns_back_unchanged() { var g = new GrayColor(); g.gray = 25; p.strokeColor = g; vc.log([p.fillColor.red, p.fillColor.green, p.strokeColor.gray]);", ); assert_eq!(out, vec![json!([200, 0.5, 25])], "whole and short values read as they were given"); + // A Gray ink amount too small for its Gray value to name: assigning the color read back changes nothing. + let (mut s, a, _) = doc(); + let k = f32::from_bits(0x1f00_0000); + std::sync::Arc::make_mut(&mut s.doc_mut().unwrap().doc).node_mut(a).unwrap().appearance.set_fill(Paint::solid(Color::Gray { k })); + let steps = undo_steps(&s); + let r = run(&mut s, "var p = app.activeDocument.pathItems[0]; p.fillColor = p.fillColor;").unwrap(); + assert_eq!(paint_of(&s, a, true), Paint::solid(Color::Gray { k })); + assert_eq!((undo_steps(&s), &r["slowestCommands"]), (steps, &json!([]))); } #[test] @@ -869,16 +896,49 @@ fn area_sign_follows_direction() { fn many_path_edits_are_one_undo_step() { let (mut s, a, b) = doc(); let steps = undo_steps(&s); + let look = |s: &Session| [a, b].map(|id| (node(s, id).appearance, node(s, id).path_data().map(|pd| pd.subpaths.clone()))); + let before = look(&s); log( &mut s, "var p = app.activeDocument.pathItems, c = new RGBColor(); c.green = 200;\ for (var i = 0; i < p.length; i++) { p[i].fillColor = c; p[i].strokeWidth = 3; p[i].pathPoints[0].anchor = [0, 0]; }", ); assert_eq!(undo_steps(&s), steps + 1); + assert_ne!(look(&s), before); s.execute("edit.undo", &json!({})).unwrap(); - for id in [a, b] { - assert!((node(&s, id).appearance.stroke_width() - 1.0).abs() < 1e-9); - } + assert_eq!(look(&s), before, "one Undo puts back the fill, the stroke width and the anchor of both paths"); +} + +#[test] +fn point_indexes_follow_subpaths_through_edits_adds_and_removals() { + let (mut s, a, _) = doc(); + let source = format!( + "function A(x) {{ return {{x: x, y: 5, in: [x, 5], out: [x, 5], smooth: false}}; }}\ + function xs() {{ var out = []; for (var i = 0; i < pp.length; i++) out.push(pp[i].anchor[0]); return out; }}\ + var p = app.activeDocument.pathItems[0], pp = p.pathPoints;\ + vc.run('path.setAnchors', {{id: {id}, subpaths: [{{anchors: [A(0), A(1)], closed: false}}, {{anchors: [A(10), A(11), A(12)], closed: false}},\ + {{anchors: [A(20)], closed: false}}]}});\ + vc.log(xs()); pp[3].anchor = [50, pp[3].anchor[1]]; vc.log([pp[3].anchor[0], pp[4].anchor[0], pp[5].anchor[0]]);\ + pp.add(); vc.log([pp.length, pp[6].anchor[0]]);\ + pp[0].remove(); vc.log(xs()); pp[0].remove(); vc.log(xs()); pp[4].anchor = [70, 0]; vc.log(xs());", + id = a.0 + ); + let out = log(&mut s, &source); + let out: Vec = out.iter().map(rounded).collect(); + assert_eq!( + out, + vec![ + json!([0, 1, 10, 11, 12, 20]), + json!([50, 12, 20]), + json!([7, 20]), + json!([1, 10, 50, 12, 20, 20]), + json!([10, 50, 12, 20, 20]), + json!([10, 50, 12, 20, 70]), + ] + ); + let subs = node(&s, a).path_data().unwrap().subpaths.clone(); + let xs: Vec> = subs.iter().map(|sp| sp.anchors.iter().map(|an| (an.p.x * 1000.0).round() / 1000.0).collect()).collect(); + assert_eq!(xs, vec![vec![10.0, 50.0, 12.0], vec![20.0, 70.0]]); } fn selected_anchors(s: &Session, id: NodeId) -> Option> { diff --git a/docs/mcp.md b/docs/mcp.md index 504525c265..b0e133b490 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -9147,8 +9147,9 @@ resets it. `appearance.setNewArtBasic` rejects an `on` value that is not a boolean. Omitting `on` toggles the current preference. `appearance.setNewArt {fill?, stroke?, weight?, cap?, join?, miterLimit?, dash?, dashOffset?, fillOverprint?, strokeOverprint?}` sets new art's fill, stroke and stroke options whatever is selected, and leaves the selection, its -art, the active proxy and Recent Colors as they were. `fill` and `stroke` take a paint as `paint.setFill` does; a -stroke painted on new art without one gets a 1 pt weight unless `weight` is given. Every value is checked before +art, the active proxy and Recent Colors as they were. `fill` and `stroke` take a paint as `paint.setFill` does, and +`tint` only with a global or spot `swatch`. Without `weight` the stored stroke weight stays; a stroke painted on new +art without one gets 1 pt only when that stored weight is 0. Every value is checked before anything changes, and any change while New Art Has Basic Appearance is off and an object is selected is an error. It returns `{changed}`, false when the next object would look the same. @@ -9462,8 +9463,8 @@ runs, as `document.open` reads its file when it runs. A file larger than 64 MiB When the file cannot be read, is too large or is not a native document, or the request's read roots leave out the folder (whether or not the file exists), the document starts with the defaults and `file.new`'s result carries `profileError: {profile, reason}`; the desktop app shows the reason in the status bar, and -a script's `app.documents.addDocument` throws it. A script's file access limits do not apply to reading the profile's -file. The +a script's `app.documents.addDocument` throws it. Reading the profile's file is not limited to the script's folder (the +`File` and `Folder` rule in [Script engines](#script-engines)), but the request's automation read roots still apply. The reason given when the read roots leave out the folder does not name the folder's path. Color profiles the profile's file carries are installed when they are missing, as `document.open` installs them, and each one that can't be used adds a line to `file.new`'s `warnings`. The new document's links find their files through relative paths from the From 7baaac6391a82805e363761c85718024463d424d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 25 Nov 2026 18:24:19 -0800 Subject: [PATCH 16/61] Scripts: read a new path's id from the command's own result pathItems.add() and the shape constructors read the new path's id from the script's copy of the command result, where it is a number. An id above 2^53 was rounded there, so the constructor could return another path, or fail after the path was made. They now read the id as an integer from the command's result. --- crates/engine/src/script/dom/paths.rs | 34 +++++++++++++++++---------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/crates/engine/src/script/dom/paths.rs b/crates/engine/src/script/dom/paths.rs index d3faca29a3..026d990a5c 100644 --- a/crates/engine/src/script/dom/paths.rs +++ b/crates/engine/src/script/dom/paths.rs @@ -67,9 +67,9 @@ use vectorcraft_js::{Data, HostClass, HostError, HostItem, HostMember, Realm, Ru use vectorcraft_tools::params::gradient_params; use super::{ - Answer, Coords, Doc, Item, Link, NOT_FOUND, STALE_ITEM, arg, boolean, class, colors, command, coordinate, doc_of, edit_item, editable, find_doc, - float, frame, get, given, handle_of, id_of, id_parts, item_of, item_rect, later, method, named, num, number, on_doc, pair, point, point_get, - point_method, point_property, property, this_doc, whole, with_doc, + Answer, Coords, Doc, Item, Link, NOT_FOUND, STALE_ITEM, arg, boolean, class, colors, command, command_value, coordinate, doc_of, edit_item, + editable, find_doc, float, frame, get, given, handle_of, id_of, id_parts, item_of, item_rect, later, method, named, num, number, on_doc, pair, + point, point_get, point_method, point_property, property, this_doc, whole, with_doc, }; use crate::{DocState, NodeId, NodeKind}; @@ -444,20 +444,17 @@ fn items_remove_all(h: &super::Host, a: &[Data]) -> Answer { Ok(Data::Undefined) } -/// The id in the result of a command that made an object. -fn made_id(r: &Data) -> std::result::Result { - let id = match r { - Data::Object(o) => o.iter().find(|(k, _)| k == "id").and_then(|(_, v)| if let Data::Number(n) = v { whole(*n) } else { None }), - _ => None, - }; - id.map(NodeId).ok_or_else(|| HostError::Error("the path was not made".into())) +/// The id in the result of a command that made an object, read from the command's own result so +/// that an id above 2^53 stays exact. +fn made_id(r: &Value) -> std::result::Result { + r["id"].as_u64().map(NodeId).ok_or_else(|| HostError::Error("the path was not made".into())) } /// Runs the command `id` that makes a path in `doc` on top of the active layer, the selection kept, /// and reverses the new path's direction when `reversed`. → the new path. fn make(h: &super::Host, doc: Doc, id: &str, params: &Value, reversed: bool) -> Answer { let made = on_doc(h, doc.uid, true, |h| { - let id = made_id(&drawing_normally(h, || command(h, id, params))?)?; + let id = made_id(&drawing_normally(h, || command_value(h, id, params))?.1)?; if reversed { command(h, "path.reverse", &json!({"ids": [id.0]}))?; } @@ -616,7 +613,7 @@ fn items_add(h: &super::Host, a: &[Data]) -> Answer { let ap = h.session.borrow().new_art(); ap.fill_paint().is_none() && ap.stroke_paint().is_none() }; - let id = made_id(&drawing_normally(h, || command(h, "path.create", &json!({"d": ""})))?)?; + let id = made_id(&drawing_normally(h, || command_value(h, "path.create", &json!({"d": ""})))?.1)?; if unpainted { keeping_paint(h, || command(h, "paint.setStroke", &json!({"none": true, "ids": [id.0]})))?; } @@ -1720,3 +1717,16 @@ pub(super) fn classes(l: &Link) -> Vec { ), ] } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn a_made_id_above_two_to_the_53_stays_exact() { + assert_eq!(made_id(&json!({"id": 9_007_199_254_740_993_u64})), Ok(NodeId(9_007_199_254_740_993))); + assert_eq!(made_id(&json!({"id": 7})), Ok(NodeId(7))); + assert!(made_id(&json!({"id": 1.5})).is_err()); + assert!(made_id(&json!({})).is_err()); + } +} From 9ed5e06ff3ec424b727068875cd77d9a3e15f86a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 17:12:28 -0800 Subject: [PATCH 17/61] Dependencies: craft-libs f762f98a, with the status-bar zoom look and the compass clear of the scroll bars - Every craft-libs crate moves from 610c86792a to f762f98a (craft-libs main), which adds the fixed corner-widget inset, the ruler corner's plus, popover padding, and a native window's move recorded once. - The status bar's Zoom field uses ZoomField::status_bar, so it draws without an outline in the status bar's look. - The Rotate View compass is placed in CanvasScrollbars::clear_of instead of a copy of the scroll bars' sizes. - The tools' corner-widget inset is public, and a test holds it equal to CornerWidgets::INSET, the inset the canvas draws the widgets at. --- Cargo.lock | 170 ++++++++++----------- Cargo.toml | 70 ++++----- apps/vectorcraft-web/Cargo.toml | 2 +- crates/tools/src/corners.rs | 5 +- crates/ui-egui/src/canvas.rs | 7 +- crates/ui-egui/src/canvas/widgets/tests.rs | 6 + crates/ui-egui/src/chrome/status_bar.rs | 23 ++- xtask/src/pdf_deps.rs | 2 +- 8 files changed, 155 insertions(+), 130 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 520647b95d..c36c00d090 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1239,7 +1239,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-automation", "craft-behavior", @@ -1280,7 +1280,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "crc32fast", "flate2", @@ -1291,7 +1291,7 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "block2 0.6.2", "objc2 0.6.5", @@ -1302,7 +1302,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "rustix 1.1.6", ] @@ -1310,7 +1310,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1335,7 +1335,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1353,7 +1353,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-behavior", "craft-docpath", @@ -1371,7 +1371,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "crc32fast", "flate2", @@ -1380,7 +1380,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "egui", ] @@ -1388,7 +1388,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "md-5", "rayon", @@ -1397,12 +1397,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-behavior", "craft-cms", @@ -1422,7 +1422,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-control-protocol", "craft-platform", @@ -1433,7 +1433,7 @@ dependencies = [ [[package]] name = "craft-control-protocol" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "getrandom 0.3.4", "serde_json", @@ -1443,7 +1443,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "rayon", ] @@ -1451,7 +1451,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "block2 0.6.2", "craft-appkit", @@ -1477,7 +1477,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "blake3", "craft-ecproj-format", @@ -1493,7 +1493,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "serde", ] @@ -1501,7 +1501,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1520,7 +1520,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-codepage", "encoding_rs", @@ -1532,7 +1532,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "serde", "serde_json", @@ -1542,12 +1542,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1562,7 +1562,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1581,7 +1581,7 @@ dependencies = [ [[package]] name = "craft-font-os-windows" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "windows-registry", "windows-sys 0.61.2", @@ -1590,7 +1590,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "cap-primitives", "craft-atomic", @@ -1613,12 +1613,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "gif", ] @@ -1626,7 +1626,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "flate2", ] @@ -1634,7 +1634,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1647,7 +1647,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "chrono", "fixed_decimal", @@ -1675,7 +1675,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-dds", "craft-jpeg", @@ -1702,7 +1702,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1720,7 +1720,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "thiserror 2.0.21", ] @@ -1728,7 +1728,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1739,7 +1739,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-host", "craft-i18n", @@ -1754,7 +1754,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-behavior", "craft-i18n", @@ -1768,7 +1768,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-behavior", "craft-host", @@ -1786,7 +1786,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1798,7 +1798,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "encoding_rs", "image", @@ -1809,7 +1809,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "chrono", "craft-codepage", @@ -1819,7 +1819,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-behavior", "craft-keymap", @@ -1835,7 +1835,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "flate2", "serde", @@ -1846,7 +1846,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1858,7 +1858,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "async-channel", "async-io", @@ -1889,7 +1889,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1898,7 +1898,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-behavior", "craft-host", @@ -1922,7 +1922,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1933,7 +1933,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-eps", "flate2", @@ -1947,7 +1947,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "encoding_rs", "flate2", @@ -1958,7 +1958,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "dispatch2", "egui", @@ -1971,7 +1971,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1990,7 +1990,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-atomic", "craft-host", @@ -2007,7 +2007,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "fax", "hayro-ccitt", @@ -2018,7 +2018,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-image-codecs", "craft-xml", @@ -2039,7 +2039,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-behavior", "craft-keymap", @@ -2051,7 +2051,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2076,7 +2076,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2091,7 +2091,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-atomic", "craft-behavior", @@ -2106,7 +2106,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "serde", "thiserror 2.0.21", @@ -2116,7 +2116,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "serde", "thiserror 2.0.21", @@ -2125,7 +2125,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-behavior", "craft-keymap", @@ -2140,12 +2140,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2159,7 +2159,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-behavior", "craft-i18n", @@ -2175,7 +2175,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "accesskit", "craft-behavior", @@ -2213,7 +2213,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2224,7 +2224,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-behavior", "craft-host", @@ -2242,7 +2242,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-behavior", "craft-host", @@ -2263,7 +2263,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-behavior", "craft-host", @@ -2284,7 +2284,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-behavior", "craft-host", @@ -2303,7 +2303,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "base64 0.22.1", "chrono", @@ -2335,7 +2335,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "flate2", "serde", @@ -2346,7 +2346,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2356,7 +2356,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "js-sys", "serde_json", @@ -2367,7 +2367,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "winsafe", ] @@ -2375,7 +2375,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "craft-appkit", "craft-atomic", @@ -2407,7 +2407,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "quick-xml 0.41.0", "serde", @@ -3762,7 +3762,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "brotli", "hayro-postscript", @@ -3771,7 +3771,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3789,7 +3789,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3807,12 +3807,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "flate2", "hayro-ccitt", @@ -4795,7 +4795,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4952,7 +4952,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" dependencies = [ "arrayvec", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index a0fb986dcc..4551280d71 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,46 +11,46 @@ rust-version = "1.95" repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } # The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON. -craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } # `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile. -craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853", features = ["pcraft-pixels"] } +craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb", features = ["pcraft-pixels"] } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } # The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names # the members it imports. -craft = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } # Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui # without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes. -craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } @@ -193,13 +193,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } emath = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } epaint = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index e8b56c29a9..305ed6a65e 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -27,7 +27,7 @@ log = { workspace = true } # `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback. eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] } # The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft. -craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/crates/tools/src/corners.rs b/crates/tools/src/corners.rs index 3d02e37aa0..a958422e6d 100644 --- a/crates/tools/src/corners.rs +++ b/crates/tools/src/corners.rs @@ -21,8 +21,9 @@ use crate::{Action, Overlay, PointerEvent, ToolContext}; pub const DIALOG: &str = "corners"; /// Widgets sit at least this far inside their corner along each side of a right angle (screen px; -/// √2 times it along the bisector, at any angle), further in once the radius is. -const MIN_INSET_PX: f64 = 10.0; +/// √2 times it along the bisector, at any angle), further in once the radius is. The canvas draws the +/// widgets at the framework's `CornerWidgets::INSET`, which the UI's tests hold equal to this value. +pub const MIN_INSET_PX: f64 = 10.0; /// Corners with a side shorter than this on screen (px) hide their widgets. const MIN_SIDE_PX: f64 = 3.0 * MIN_INSET_PX; diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 9a7734e494..ab89a47115 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -404,15 +404,12 @@ fn compass(app: &VectorcraftApp, ui: &mut Ui, space: &CanvasSpace) -> Option egui::Rect { if app.ui.screen_mode >= 2 { return rect; } - let env = Env::of(ui); - let strip = env.tokens.size.icon.md + env.tokens.space.gap.tight; - egui::Rect::from_min_max(rect.min, egui::pos2((rect.right() - strip).max(rect.left()), rect.bottom())) + CanvasScrollbars::clear_of(ui, rect, false, false) } /// The scroll bars along the right and bottom edges (Normal and Full Screen with Menu Bar): the view diff --git a/crates/ui-egui/src/canvas/widgets/tests.rs b/crates/ui-egui/src/canvas/widgets/tests.rs index 68e70867bd..63721050d6 100644 --- a/crates/ui-egui/src/canvas/widgets/tests.rs +++ b/crates/ui-egui/src/canvas/widgets/tests.rs @@ -101,6 +101,12 @@ fn corner_widgets_hide_above_the_preference_angle() { assert!(corners(&app, app.session.tool_id(), app.view_info().zoom).is_none()); } +/// The tools hit-test corner widgets at the inset the canvas draws them at. +#[test] +fn corner_widgets_are_hit_tested_at_the_inset_they_are_drawn_at() { + assert_eq!(vectorcraft_tools::corners::MIN_INSET_PX, f64::from(CornerWidgets::INSET)); +} + /// #1232: the pointer within 5 screen points of a corner widget gives the cut of the corner it controls, in the /// layer colour, with Direct Selection, the Selection tool and the Rectangle tool. It gives none with a mouse button /// down (a press on the widget or a pan), during a drag from the widget, off the canvas, away from the widgets, or diff --git a/crates/ui-egui/src/chrome/status_bar.rs b/crates/ui-egui/src/chrome/status_bar.rs index 51834cb232..1a3df7737b 100644 --- a/crates/ui-egui/src/chrome/status_bar.rs +++ b/crates/ui-egui/src/chrome/status_bar.rs @@ -241,7 +241,7 @@ fn show_navigation(p: &mut Navigation<'_>, ui: &mut Ui) { let (view, document) = (p.view, p.document); let zoom = Field::new(tl!("Zoom")) .side(SideLabel::new().kind(LabelKind::Hidden)) - .show(ui, |ui, _| ZoomField::new(tl!("Zoom"), view, document).scrub(true).show(ui)); + .show(ui, |ui, _| ZoomField::new(tl!("Zoom"), view, document).scrub(true).status_bar().show(ui)); // The field edits the canvas view, whose zoom is divided by UI Scaling; `view.setZoom` takes the view's zoom. if let Some(zoom) = zoom.inner { if let Some(view) = zoom.view.committed() { @@ -500,6 +500,27 @@ mod tests { } } + /// The Zoom field draws in the status bar's look: no outline while it does not have the focus. + #[test] + fn the_zoom_field_draws_in_the_status_bars_look() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.run("file.new", json!({"width": 300, "height": 200})).unwrap(); + app.view_mut().unwrap().rect = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(600.0, 400.0)); + let mut panel = Panel::new(app, status_bar); + panel.room(egui::vec2(1200.0, 300.0)); + panel.frame(); + let field = panel.rect("Zoom"); + let (shapes, _) = panel.paint_at(1.0); + let outlines = shapes + .iter() + .filter(|shape| match shape { + egui::Shape::Rect(rect) => rect.stroke.width > 0.0 && rect.stroke.color.a() > 0 && rect.rect.intersects(field), + _ => false, + }) + .count(); + assert_eq!(outlines, 0, "the status bar's Zoom field draws no outline"); + } + #[test] fn with_no_document_the_artboard_navigator_shows_a_dash() { let app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index 1b04ed6518..cbe18b7dcf 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "610c86792a02aa3d416926ee44e3ec3788dea853"; +const REV: &str = "f762f98a988b8a94a0031f428d4256eb38c87adb"; const PACKAGES: &[(&str, &str, &str)] = &[ ("craft-pdf", "0.1.0", REV), ("krilla", "0.8.2", REV), From 19fecfb74964916a8189830473948a8d49315119 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 18:09:21 -0800 Subject: [PATCH 18/61] Dependencies: craft-libs 81bca5c8e2 Every craft-libs crate moves from f762f98a to 81bca5c8e2 (craft-libs main). The new rev adds the title bar's item gap, docking of part of a collapsed column, the tool rail's footer rule, disabled accessibility nodes that ignore actions, and built-in themes that load without a cycle search. VectorCraft builds on it without other changes. --- Cargo.lock | 170 ++++++++++++++++---------------- Cargo.toml | 70 ++++++------- apps/vectorcraft-web/Cargo.toml | 2 +- xtask/src/pdf_deps.rs | 2 +- 4 files changed, 122 insertions(+), 122 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c36c00d090..f742ccdb7a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1239,7 +1239,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-automation", "craft-behavior", @@ -1280,7 +1280,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "crc32fast", "flate2", @@ -1291,7 +1291,7 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "block2 0.6.2", "objc2 0.6.5", @@ -1302,7 +1302,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "rustix 1.1.6", ] @@ -1310,7 +1310,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1335,7 +1335,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1353,7 +1353,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-behavior", "craft-docpath", @@ -1371,7 +1371,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "crc32fast", "flate2", @@ -1380,7 +1380,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "egui", ] @@ -1388,7 +1388,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "md-5", "rayon", @@ -1397,12 +1397,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-behavior", "craft-cms", @@ -1422,7 +1422,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-control-protocol", "craft-platform", @@ -1433,7 +1433,7 @@ dependencies = [ [[package]] name = "craft-control-protocol" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "getrandom 0.3.4", "serde_json", @@ -1443,7 +1443,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "rayon", ] @@ -1451,7 +1451,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "block2 0.6.2", "craft-appkit", @@ -1477,7 +1477,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "blake3", "craft-ecproj-format", @@ -1493,7 +1493,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "serde", ] @@ -1501,7 +1501,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1520,7 +1520,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-codepage", "encoding_rs", @@ -1532,7 +1532,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "serde", "serde_json", @@ -1542,12 +1542,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1562,7 +1562,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1581,7 +1581,7 @@ dependencies = [ [[package]] name = "craft-font-os-windows" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "windows-registry", "windows-sys 0.61.2", @@ -1590,7 +1590,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "cap-primitives", "craft-atomic", @@ -1613,12 +1613,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "gif", ] @@ -1626,7 +1626,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "flate2", ] @@ -1634,7 +1634,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1647,7 +1647,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "chrono", "fixed_decimal", @@ -1675,7 +1675,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-dds", "craft-jpeg", @@ -1702,7 +1702,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1720,7 +1720,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "thiserror 2.0.21", ] @@ -1728,7 +1728,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1739,7 +1739,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-host", "craft-i18n", @@ -1754,7 +1754,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-behavior", "craft-i18n", @@ -1768,7 +1768,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-behavior", "craft-host", @@ -1786,7 +1786,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1798,7 +1798,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "encoding_rs", "image", @@ -1809,7 +1809,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "chrono", "craft-codepage", @@ -1819,7 +1819,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-behavior", "craft-keymap", @@ -1835,7 +1835,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "flate2", "serde", @@ -1846,7 +1846,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1858,7 +1858,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "async-channel", "async-io", @@ -1889,7 +1889,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1898,7 +1898,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-behavior", "craft-host", @@ -1922,7 +1922,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1933,7 +1933,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-eps", "flate2", @@ -1947,7 +1947,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "encoding_rs", "flate2", @@ -1958,7 +1958,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "dispatch2", "egui", @@ -1971,7 +1971,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1990,7 +1990,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-atomic", "craft-host", @@ -2007,7 +2007,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "fax", "hayro-ccitt", @@ -2018,7 +2018,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-image-codecs", "craft-xml", @@ -2039,7 +2039,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-behavior", "craft-keymap", @@ -2051,7 +2051,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2076,7 +2076,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2091,7 +2091,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-atomic", "craft-behavior", @@ -2106,7 +2106,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "serde", "thiserror 2.0.21", @@ -2116,7 +2116,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "serde", "thiserror 2.0.21", @@ -2125,7 +2125,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-behavior", "craft-keymap", @@ -2140,12 +2140,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2159,7 +2159,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-behavior", "craft-i18n", @@ -2175,7 +2175,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "accesskit", "craft-behavior", @@ -2213,7 +2213,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2224,7 +2224,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-behavior", "craft-host", @@ -2242,7 +2242,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-behavior", "craft-host", @@ -2263,7 +2263,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-behavior", "craft-host", @@ -2284,7 +2284,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-behavior", "craft-host", @@ -2303,7 +2303,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "base64 0.22.1", "chrono", @@ -2335,7 +2335,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "flate2", "serde", @@ -2346,7 +2346,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2356,7 +2356,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "js-sys", "serde_json", @@ -2367,7 +2367,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "winsafe", ] @@ -2375,7 +2375,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "craft-appkit", "craft-atomic", @@ -2407,7 +2407,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "quick-xml 0.41.0", "serde", @@ -3762,7 +3762,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "brotli", "hayro-postscript", @@ -3771,7 +3771,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3789,7 +3789,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3807,12 +3807,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "flate2", "hayro-ccitt", @@ -4795,7 +4795,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4952,7 +4952,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=f762f98a988b8a94a0031f428d4256eb38c87adb#f762f98a988b8a94a0031f428d4256eb38c87adb" +source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" dependencies = [ "arrayvec", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index 4551280d71..21419659e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,46 +11,46 @@ rust-version = "1.95" repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } # The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON. -craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } # `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile. -craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb", features = ["pcraft-pixels"] } +craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8", features = ["pcraft-pixels"] } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } # The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names # the members it imports. -craft = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } # Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui # without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes. -craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } @@ -193,13 +193,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } emath = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } epaint = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index 305ed6a65e..45f012ea3e 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -27,7 +27,7 @@ log = { workspace = true } # `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback. eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] } # The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft. -craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "f762f98a988b8a94a0031f428d4256eb38c87adb", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index cbe18b7dcf..752b3dfcb7 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "f762f98a988b8a94a0031f428d4256eb38c87adb"; +const REV: &str = "81bca5c8e27893341003716a1a740ef05ae88dd8"; const PACKAGES: &[(&str, &str, &str)] = &[ ("craft-pdf", "0.1.0", REV), ("krilla", "0.8.2", REV), From 0d5850f616e46c7258df6cd5c6ed9b702823313d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 18:41:43 -0800 Subject: [PATCH 19/61] Scripts: build on main's optional item bounds and painting-tool check main's item_rect now gives no bounds for an empty object, and the Live Paint Bucket check became tool_paints for the fill and the stroke. rotate and resize leave a path without bounds unchanged, and appearance.setNewArt uses the same inheritance test as paint.rs. --- crates/engine/src/cmd/newart.rs | 6 +++++- crates/engine/src/script/dom.rs | 4 +--- crates/engine/src/script/dom/defaults.rs | 12 ++---------- crates/engine/src/script/dom/paths.rs | 23 +++++++++++++++-------- crates/engine/src/tests/script_dom.rs | 8 +++++--- 5 files changed, 28 insertions(+), 25 deletions(-) diff --git a/crates/engine/src/cmd/newart.rs b/crates/engine/src/cmd/newart.rs index 2637927046..f9563ee886 100644 --- a/crates/engine/src/cmd/newart.rs +++ b/crates/engine/src/cmd/newart.rs @@ -172,7 +172,11 @@ fn set_new_art(s: &mut Session, p: &Value) -> Result { return Err(bad(C, "dashOffset needs a dash pattern")); } let nothing = fill.is_none() && stroke.is_none() && change.is_empty() && fill_overprint.is_none() && stroke_overprint.is_none(); - if !nothing && !s.prefs.new_art_basic && !s.bucket_paints() && s.active().is_some_and(|st| !st.selection.subjects().is_empty()) { + if !nothing + && !s.prefs.new_art_basic + && !(s.tool_paints(false) && s.tool_paints(true)) + && s.active().is_some_and(|st| !st.selection.subjects().is_empty()) + { return Err(bad( C, "with New Art Has Basic Appearance off, new art takes the selected object's appearance: deselect it or turn the option on", diff --git a/crates/engine/src/script/dom.rs b/crates/engine/src/script/dom.rs index 39c22665fd..b02050c5c5 100644 --- a/crates/engine/src/script/dom.rs +++ b/crates/engine/src/script/dom.rs @@ -2868,9 +2868,7 @@ fn classes(link: &Link) -> Vec { ]); document.extend(defaults::document_members(l)); document.extend( - ["layers", "artboards", "groupItems", "swatches", "symbols", "activeLayer", "saveAs", "close"] - .into_iter() - .map(|m| later(l, "Document", m)), + ["layers", "artboards", "groupItems", "swatches", "symbols", "activeLayer", "saveAs", "close"].into_iter().map(|m| later(l, "Document", m)), ); document.extend(variables::document_members(l)); document.push(("tags".into(), get(l, tags::doc_tags), MemberInfo { collection: true, ..typed("Tags") })); diff --git a/crates/engine/src/script/dom/defaults.rs b/crates/engine/src/script/dom/defaults.rs index 4b8e24cbb3..9080d30dd7 100644 --- a/crates/engine/src/script/dom/defaults.rs +++ b/crates/engine/src/script/dom/defaults.rs @@ -192,18 +192,10 @@ pub(super) fn document_members(l: &Link) -> Vec { named(vec![ ("defaultFillColor", property(l, |h, a| default_color(h, a, true), |h, a| set_default_color(h, a, true)), typed("Color")), ("defaultFilled", property(l, |h, a| default_painted(h, a, true), |h, a| set_default_painted(h, a, true)), typed("boolean")), - ( - "defaultFillOverprint", - property(l, |h, a| default_overprint(h, a, true), |h, a| set_default_overprint(h, a, true)), - typed("boolean"), - ), + ("defaultFillOverprint", property(l, |h, a| default_overprint(h, a, true), |h, a| set_default_overprint(h, a, true)), typed("boolean")), ("defaultStrokeColor", property(l, |h, a| default_color(h, a, false), |h, a| set_default_color(h, a, false)), typed("Color")), ("defaultStroked", property(l, |h, a| default_painted(h, a, false), |h, a| set_default_painted(h, a, false)), typed("boolean")), - ( - "defaultStrokeOverprint", - property(l, |h, a| default_overprint(h, a, false), |h, a| set_default_overprint(h, a, false)), - typed("boolean"), - ), + ("defaultStrokeOverprint", property(l, |h, a| default_overprint(h, a, false), |h, a| set_default_overprint(h, a, false)), typed("boolean")), ( "defaultStrokeWidth", property(l, default_stroke_width, set_default_stroke_width), diff --git a/crates/engine/src/script/dom/paths.rs b/crates/engine/src/script/dom/paths.rs index 503e5c3ffe..356afe8b99 100644 --- a/crates/engine/src/script/dom/paths.rs +++ b/crates/engine/src/script/dom/paths.rs @@ -67,9 +67,9 @@ use vectorcraft_js::{Data, HostClass, HostError, HostItem, HostMember, MemberInf use vectorcraft_tools::params::gradient_params; use super::{ - Answer, Coords, Described, Doc, Item, Link, NOT_FOUND, STALE_ITEM, arg, boolean, class, colors, command, command_value, coordinate, doc_of, edit_item, - editable, find_doc, float, frame, get, given, handle_of, id_of, id_parts, item_of, item_rect, later, method, named, num, number, on_doc, pair, - point, point_get, point_method, point_property, property, returns, this_doc, typed, whole, with_doc, + Answer, Coords, Described, Doc, Item, Link, NOT_FOUND, STALE_ITEM, arg, boolean, class, colors, command, command_value, coordinate, doc_of, + edit_item, editable, find_doc, float, frame, get, given, handle_of, id_of, id_parts, item_of, item_rect, later, method, named, num, number, + on_doc, pair, point, point_get, point_method, point_property, property, returns, this_doc, typed, whole, with_doc, }; use crate::{DocState, NodeId, NodeKind}; @@ -1155,8 +1155,9 @@ fn path_rotate(h: &super::Host, a: &[Data]) -> Answer { let place = about_name(arg(a, 6))?; let mut params = json!({"angle": angle}); transform_options(a, 2, &mut params)?; - if angle.rem_euclid(360.0) != 0.0 { - let (r, _) = item_rect(h, item, false)?; + if angle.rem_euclid(360.0) != 0.0 + && let (Some(r), _) = item_rect(h, item, false)? + { let origin = about(h, item, place, r)?; params["origin"] = json!([origin.x, origin.y]); edit_path(h, item, "object.rotate", params)?; @@ -1185,8 +1186,9 @@ fn path_resize(h: &super::Host, a: &[Data]) -> Answer { if new_width.is_some_and(|w| w > MAX_STROKE_WIDTH) { return Err(HostError::Range("changeLineWidths would make the stroke weight more than 1000 points".into())); } - if sx != 100.0 || sy != 100.0 { - let (r, _) = item_rect(h, item, false)?; + if (sx != 100.0 || sy != 100.0) + && let (Some(r), _) = item_rect(h, item, false)? + { let origin = about(h, item, place, r)?; params["origin"] = json!([origin.x, origin.y]); edit_path(h, item, "object.scale", params)?; @@ -1637,7 +1639,12 @@ fn pt_remove(h: &super::Host, a: &[Data]) -> Answer { pub(super) fn path_item_members(l: &Link) -> Vec { let transform = |first: &[(&'static str, &'static str)]| { let mut args: Vec<(&str, &str)> = first.to_vec(); - args.extend([("changePositions", "boolean"), ("changeFillPatterns", "boolean"), ("changeFillGradients", "boolean"), ("changeStrokePattern", "boolean")]); + args.extend([ + ("changePositions", "boolean"), + ("changeFillPatterns", "boolean"), + ("changeFillGradients", "boolean"), + ("changeStrokePattern", "boolean"), + ]); args }; let mut resize = transform(&[("scaleX", "number"), ("scaleY", "number")]); diff --git a/crates/engine/src/tests/script_dom.rs b/crates/engine/src/tests/script_dom.rs index 35d5c8e6a9..cf96155be9 100644 --- a/crates/engine/src/tests/script_dom.rs +++ b/crates/engine/src/tests/script_dom.rs @@ -1243,9 +1243,11 @@ fn a_startup_preset_alone_gives_its_first_size() { #[test] fn page_item_members_not_built_yet_throw_on_read_and_assignment() { let (mut s, _, _) = doc(); - for source in - ["app.activeDocument.pageItems[0].isIsolated;", "app.activeDocument.pageItems[0].uuid = 'x';", "app.activeDocument.pageItems[0].transform(5);"] - { + for source in [ + "app.activeDocument.pageItems[0].isIsolated;", + "app.activeDocument.pageItems[0].uuid = 'x';", + "app.activeDocument.pageItems[0].transform(5);", + ] { assert!(failure(&mut s, source).contains("is not available yet"), "{source}"); } assert!(failure(&mut s, "app.activeDocument.layers = 1;").contains("Document.layers is not available yet")); From 3496bbc6a272c113f0c15ac5d7d3dc4deb0a3fb7 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 19:36:20 -0800 Subject: [PATCH 20/61] Dependencies: craft-libs 07a8c471ed --- Cargo.lock | 170 ++++++++++++++++---------------- Cargo.toml | 70 ++++++------- apps/vectorcraft-web/Cargo.toml | 2 +- xtask/src/pdf_deps.rs | 2 +- 4 files changed, 122 insertions(+), 122 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f742ccdb7a..8b0e5c3750 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1239,7 +1239,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-automation", "craft-behavior", @@ -1280,7 +1280,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "crc32fast", "flate2", @@ -1291,7 +1291,7 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "block2 0.6.2", "objc2 0.6.5", @@ -1302,7 +1302,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "rustix 1.1.6", ] @@ -1310,7 +1310,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1335,7 +1335,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1353,7 +1353,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-behavior", "craft-docpath", @@ -1371,7 +1371,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "crc32fast", "flate2", @@ -1380,7 +1380,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "egui", ] @@ -1388,7 +1388,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "md-5", "rayon", @@ -1397,12 +1397,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-behavior", "craft-cms", @@ -1422,7 +1422,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-control-protocol", "craft-platform", @@ -1433,7 +1433,7 @@ dependencies = [ [[package]] name = "craft-control-protocol" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "getrandom 0.3.4", "serde_json", @@ -1443,7 +1443,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "rayon", ] @@ -1451,7 +1451,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "block2 0.6.2", "craft-appkit", @@ -1477,7 +1477,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "blake3", "craft-ecproj-format", @@ -1493,7 +1493,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "serde", ] @@ -1501,7 +1501,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1520,7 +1520,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-codepage", "encoding_rs", @@ -1532,7 +1532,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "serde", "serde_json", @@ -1542,12 +1542,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1562,7 +1562,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1581,7 +1581,7 @@ dependencies = [ [[package]] name = "craft-font-os-windows" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "windows-registry", "windows-sys 0.61.2", @@ -1590,7 +1590,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "cap-primitives", "craft-atomic", @@ -1613,12 +1613,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "gif", ] @@ -1626,7 +1626,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "flate2", ] @@ -1634,7 +1634,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1647,7 +1647,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "chrono", "fixed_decimal", @@ -1675,7 +1675,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-dds", "craft-jpeg", @@ -1702,7 +1702,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1720,7 +1720,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "thiserror 2.0.21", ] @@ -1728,7 +1728,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1739,7 +1739,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-host", "craft-i18n", @@ -1754,7 +1754,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-behavior", "craft-i18n", @@ -1768,7 +1768,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-behavior", "craft-host", @@ -1786,7 +1786,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1798,7 +1798,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "encoding_rs", "image", @@ -1809,7 +1809,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "chrono", "craft-codepage", @@ -1819,7 +1819,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-behavior", "craft-keymap", @@ -1835,7 +1835,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "flate2", "serde", @@ -1846,7 +1846,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1858,7 +1858,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "async-channel", "async-io", @@ -1889,7 +1889,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1898,7 +1898,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-behavior", "craft-host", @@ -1922,7 +1922,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1933,7 +1933,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-eps", "flate2", @@ -1947,7 +1947,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "encoding_rs", "flate2", @@ -1958,7 +1958,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "dispatch2", "egui", @@ -1971,7 +1971,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1990,7 +1990,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-atomic", "craft-host", @@ -2007,7 +2007,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "fax", "hayro-ccitt", @@ -2018,7 +2018,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-image-codecs", "craft-xml", @@ -2039,7 +2039,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-behavior", "craft-keymap", @@ -2051,7 +2051,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2076,7 +2076,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2091,7 +2091,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-atomic", "craft-behavior", @@ -2106,7 +2106,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "serde", "thiserror 2.0.21", @@ -2116,7 +2116,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "serde", "thiserror 2.0.21", @@ -2125,7 +2125,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-behavior", "craft-keymap", @@ -2140,12 +2140,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2159,7 +2159,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-behavior", "craft-i18n", @@ -2175,7 +2175,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "accesskit", "craft-behavior", @@ -2213,7 +2213,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2224,7 +2224,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-behavior", "craft-host", @@ -2242,7 +2242,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-behavior", "craft-host", @@ -2263,7 +2263,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-behavior", "craft-host", @@ -2284,7 +2284,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-behavior", "craft-host", @@ -2303,7 +2303,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "base64 0.22.1", "chrono", @@ -2335,7 +2335,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "flate2", "serde", @@ -2346,7 +2346,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2356,7 +2356,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "js-sys", "serde_json", @@ -2367,7 +2367,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "winsafe", ] @@ -2375,7 +2375,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "craft-appkit", "craft-atomic", @@ -2407,7 +2407,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "quick-xml 0.41.0", "serde", @@ -3762,7 +3762,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "brotli", "hayro-postscript", @@ -3771,7 +3771,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3789,7 +3789,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3807,12 +3807,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "flate2", "hayro-ccitt", @@ -4795,7 +4795,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4952,7 +4952,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=81bca5c8e27893341003716a1a740ef05ae88dd8#81bca5c8e27893341003716a1a740ef05ae88dd8" +source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" dependencies = [ "arrayvec", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index 21419659e6..bc004dc7fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,46 +11,46 @@ rust-version = "1.95" repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } # The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON. -craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } # `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile. -craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8", features = ["pcraft-pixels"] } +craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8", features = ["pcraft-pixels"] } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } # The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names # the members it imports. -craft = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } # Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui # without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes. -craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } @@ -193,13 +193,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } emath = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } epaint = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index 45f012ea3e..2b3b0cb826 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -27,7 +27,7 @@ log = { workspace = true } # `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback. eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] } # The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft. -craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "81bca5c8e27893341003716a1a740ef05ae88dd8", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index 752b3dfcb7..0d0e715893 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "81bca5c8e27893341003716a1a740ef05ae88dd8"; +const REV: &str = "07a8c471ed71791b35fb4baf736248d022abead8"; const PACKAGES: &[(&str, &str, &str)] = &[ ("craft-pdf", "0.1.0", REV), ("krilla", "0.8.2", REV), From cc7d17d70c69aacebbd9a6300b3a0aaaefc49bdd Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 20:49:41 -0800 Subject: [PATCH 21/61] Dependencies: craft-libs 8bea6009f9 Moves every craft-libs crate from 07a8c471ed to craft-libs main at 8bea6009f9. --- Cargo.lock | 170 ++++++++++++++++---------------- Cargo.toml | 70 ++++++------- apps/vectorcraft-web/Cargo.toml | 2 +- xtask/src/pdf_deps.rs | 2 +- 4 files changed, 122 insertions(+), 122 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8b0e5c3750..0ecda8546c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1239,7 +1239,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-automation", "craft-behavior", @@ -1280,7 +1280,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "crc32fast", "flate2", @@ -1291,7 +1291,7 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "block2 0.6.2", "objc2 0.6.5", @@ -1302,7 +1302,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "rustix 1.1.6", ] @@ -1310,7 +1310,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1335,7 +1335,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1353,7 +1353,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-behavior", "craft-docpath", @@ -1371,7 +1371,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "crc32fast", "flate2", @@ -1380,7 +1380,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "egui", ] @@ -1388,7 +1388,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "md-5", "rayon", @@ -1397,12 +1397,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-behavior", "craft-cms", @@ -1422,7 +1422,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-control-protocol", "craft-platform", @@ -1433,7 +1433,7 @@ dependencies = [ [[package]] name = "craft-control-protocol" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "getrandom 0.3.4", "serde_json", @@ -1443,7 +1443,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "rayon", ] @@ -1451,7 +1451,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "block2 0.6.2", "craft-appkit", @@ -1477,7 +1477,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "blake3", "craft-ecproj-format", @@ -1493,7 +1493,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "serde", ] @@ -1501,7 +1501,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1520,7 +1520,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-codepage", "encoding_rs", @@ -1532,7 +1532,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "serde", "serde_json", @@ -1542,12 +1542,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1562,7 +1562,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1581,7 +1581,7 @@ dependencies = [ [[package]] name = "craft-font-os-windows" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "windows-registry", "windows-sys 0.61.2", @@ -1590,7 +1590,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "cap-primitives", "craft-atomic", @@ -1613,12 +1613,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "gif", ] @@ -1626,7 +1626,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "flate2", ] @@ -1634,7 +1634,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1647,7 +1647,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "chrono", "fixed_decimal", @@ -1675,7 +1675,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-dds", "craft-jpeg", @@ -1702,7 +1702,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1720,7 +1720,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "thiserror 2.0.21", ] @@ -1728,7 +1728,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1739,7 +1739,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-host", "craft-i18n", @@ -1754,7 +1754,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-behavior", "craft-i18n", @@ -1768,7 +1768,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-behavior", "craft-host", @@ -1786,7 +1786,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1798,7 +1798,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "encoding_rs", "image", @@ -1809,7 +1809,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "chrono", "craft-codepage", @@ -1819,7 +1819,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-behavior", "craft-keymap", @@ -1835,7 +1835,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "flate2", "serde", @@ -1846,7 +1846,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1858,7 +1858,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "async-channel", "async-io", @@ -1889,7 +1889,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1898,7 +1898,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-behavior", "craft-host", @@ -1922,7 +1922,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1933,7 +1933,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-eps", "flate2", @@ -1947,7 +1947,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "encoding_rs", "flate2", @@ -1958,7 +1958,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "dispatch2", "egui", @@ -1971,7 +1971,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1990,7 +1990,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-atomic", "craft-host", @@ -2007,7 +2007,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "fax", "hayro-ccitt", @@ -2018,7 +2018,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-image-codecs", "craft-xml", @@ -2039,7 +2039,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-behavior", "craft-keymap", @@ -2051,7 +2051,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2076,7 +2076,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2091,7 +2091,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-atomic", "craft-behavior", @@ -2106,7 +2106,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "serde", "thiserror 2.0.21", @@ -2116,7 +2116,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "serde", "thiserror 2.0.21", @@ -2125,7 +2125,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-behavior", "craft-keymap", @@ -2140,12 +2140,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2159,7 +2159,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-behavior", "craft-i18n", @@ -2175,7 +2175,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "accesskit", "craft-behavior", @@ -2213,7 +2213,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2224,7 +2224,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-behavior", "craft-host", @@ -2242,7 +2242,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-behavior", "craft-host", @@ -2263,7 +2263,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-behavior", "craft-host", @@ -2284,7 +2284,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-behavior", "craft-host", @@ -2303,7 +2303,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "base64 0.22.1", "chrono", @@ -2335,7 +2335,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "flate2", "serde", @@ -2346,7 +2346,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2356,7 +2356,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "js-sys", "serde_json", @@ -2367,7 +2367,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "winsafe", ] @@ -2375,7 +2375,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "craft-appkit", "craft-atomic", @@ -2407,7 +2407,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "quick-xml 0.41.0", "serde", @@ -3762,7 +3762,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "brotli", "hayro-postscript", @@ -3771,7 +3771,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3789,7 +3789,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3807,12 +3807,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "flate2", "hayro-ccitt", @@ -4795,7 +4795,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4952,7 +4952,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=07a8c471ed71791b35fb4baf736248d022abead8#07a8c471ed71791b35fb4baf736248d022abead8" +source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" dependencies = [ "arrayvec", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index bc004dc7fe..8aa545a1bf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,46 +11,46 @@ rust-version = "1.95" repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } # The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON. -craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } # `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile. -craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8", features = ["pcraft-pixels"] } +craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57", features = ["pcraft-pixels"] } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } # The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names # the members it imports. -craft = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } # Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui # without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes. -craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } @@ -193,13 +193,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } emath = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } epaint = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index 2b3b0cb826..c59556472e 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -27,7 +27,7 @@ log = { workspace = true } # `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback. eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] } # The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft. -craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "07a8c471ed71791b35fb4baf736248d022abead8", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index 0d0e715893..f238101022 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "07a8c471ed71791b35fb4baf736248d022abead8"; +const REV: &str = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57"; const PACKAGES: &[(&str, &str, &str)] = &[ ("craft-pdf", "0.1.0", REV), ("krilla", "0.8.2", REV), From ff47fc8699748d8a5ffb55cb8a58069a4ec8c3f0 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 21:58:54 -0800 Subject: [PATCH 22/61] Transparency: transparency.info reports the selected symbol part that transparency.set edits With an object of a dynamic symbol instance selected by Direct Selection, transparency.set without ids changes that object's opacity and blend mode for the instance, and the Transparency panel shows those values. The transparency.info command still reported the instance's own opacity and blend mode. Without ids or id it now returns the panel's values (Session::transparency_info), so it reports the part's opacity and blend mode with the instance's isolate and knockout. With ids or id it still reports those objects. --- crates/engine/src/cmd/opacitymask.rs | 16 +++++++++++----- crates/engine/src/tests/dynamic_symbols.rs | 22 ++++++++++++++++++++++ docs/mcp.md | 4 +++- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/cmd/opacitymask.rs b/crates/engine/src/cmd/opacitymask.rs index 5fb3df4e32..a64d038d8f 100644 --- a/crates/engine/src/cmd/opacitymask.rs +++ b/crates/engine/src/cmd/opacitymask.rs @@ -105,7 +105,7 @@ pub fn specs() -> Vec { "Transparency Info", [], None, - "{id?|ids?} → {ids, opacity: 0..100, blend, isolate, knockout: \"on\"|\"off\"|\"neutral\", knockoutShape, editingMask, pageIsolatedBlending, pageKnockoutGroup} the Transparency panel's values for `ids`, the selection, or the object whose mask is being edited. A value is null where those objects differ (or there are none); editingMask is the id of the object whose mask is being edited, or null; the page values are the document's", + "{id?|ids?} → {ids, opacity: 0..100, blend, isolate, knockout: \"on\"|\"off\"|\"neutral\", knockoutShape, editingMask, pageIsolatedBlending, pageKnockoutGroup} the Transparency panel's values for `ids`, the selection, or the object whose mask is being edited. A value is null where those objects differ (or there are none). Without ids or id, with an object of a dynamic symbol instance selected by Direct Selection, opacity and blend are that object's for this instance, as transparency.set changes them; editingMask is the id of the object whose mask is being edited, or null; the page values are the document's", has_doc, info ), @@ -489,10 +489,16 @@ impl Session { fn info(s: &mut Session, p: &Value) -> Result { let st = s.doc()?; - let ids = transparency_targets(s, p)?; - // The points `transparency.set` with the same `ids` (or none) fades. - let points = if p.get("ids").is_none() && p.get("id").is_none() { s.mesh_points_picked() } else { super::paint::picked_mesh_points_of(s, &ids) }; - let i = TransparencyInfo::of(&st.doc, ids).with_mesh_points(&st.doc, points); + // Without `ids` or `id`, the values `transparency.set` without them edits: those of the panel, + // whose picked mesh points and selected dynamic symbol part take the opacity (and the part the + // blend mode). + let i = if p.get("ids").is_none() && p.get("id").is_none() { + s.transparency_info() + } else { + let ids = transparency_targets(s, p)?; + let points = super::paint::picked_mesh_points_of(s, &ids); + TransparencyInfo::of(&st.doc, ids).with_mesh_points(&st.doc, points) + }; Ok(json!({ "ids": i.ids.iter().map(|id| id.0).collect::>(), "opacity": i.opacity, diff --git a/crates/engine/src/tests/dynamic_symbols.rs b/crates/engine/src/tests/dynamic_symbols.rs index 2f88f5acc9..e406c1b4f2 100644 --- a/crates/engine/src/tests/dynamic_symbols.rs +++ b/crates/engine/src/tests/dynamic_symbols.rs @@ -1184,6 +1184,28 @@ fn opacity_and_blend_on_a_picked_object_go_through_transparency_set() { assert!((node(&t, static_inst).opacity - 0.4).abs() < 1e-6); } +#[test] +fn transparency_info_reports_the_picked_object_that_transparency_set_edits() { + let mut s = session(); + let inst = pair(&mut s, "dynamic"); + s.execute("transparency.set", &json!({"ids": [inst.0], "opacity": 75, "blend": "screen", "isolate": true, "knockout": "on"})).unwrap(); + s.execute("symbol.instance.selectPart", &json!({"id": inst.0, "path": [1]})).unwrap(); + s.execute("transparency.set", &json!({"opacity": 50, "blend": "multiply"})).unwrap(); + let shown = |v: &Value| (v["ids"].clone(), v["opacity"].as_f64(), v["blend"].clone(), v["isolate"].clone(), v["knockout"].clone()); + // Without ids, the picked object's opacity and blend mode, and the instance's isolate and knockout. + let info = s.execute("transparency.info", &json!({})).unwrap(); + assert_eq!(shown(&info), (json!([inst.0]), Some(50.0), json!("Multiply"), json!(true), json!("on"))); + let panel = s.transparency_info(); + assert_eq!((panel.opacity, panel.blend.map(vectorcraft_color::BlendMode::label)), (Some(50.0), Some("Multiply"))); + // The other object of the art draws as the symbol does. + s.execute("symbol.instance.selectPart", &json!({"id": inst.0, "path": [0]})).unwrap(); + let info = s.execute("transparency.info", &json!({})).unwrap(); + assert_eq!(shown(&info), (json!([inst.0]), Some(100.0), json!("Normal"), json!(true), json!("on"))); + // With the instance's id, the instance itself, as transparency.set with that id edits it. + let info = s.execute("transparency.info", &json!({"id": inst.0})).unwrap(); + assert_eq!(shown(&info), (json!([inst.0]), Some(75.0), json!("Screen"), json!(true), json!("on"))); +} + #[test] fn select_part_refuses_hidden_and_locked_objects_of_the_art() { let mut s = session(); diff --git a/docs/mcp.md b/docs/mcp.md index ad6a5f95be..9b98785ddc 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5066,7 +5066,9 @@ already walks Image Trace. Short agent entry points: `paint.setFill` and `paint.setStroke` (solid, none, gradient or pattern) and `paint.invert` and `paint.complement` on a solid color change that object's fill or stroke for this instance only when `ids`, `id` and `item` are omitted. `transparency.set` with opacity and/or blend does the same when `ids`, `id` and `item` are omitted; with `ids` or - `id` it edits those objects, so the instance's id changes the instance. `appearance.copyFrom` takes the source's + `id` it edits those objects, so the instance's id changes the instance. `transparency.info` without `ids` or `id` + reports that object's opacity and blend mode for this instance, with the instance's isolate and knockout values; with + the instance's id it reports the instance. `appearance.copyFrom` takes the source's fill and stroke (including a gradient or pattern) for this instance only when `ids` is omitted and `reverse`, `append` and `defaultsOnly` are false or omitted, and only for each paint the Eyedropper Options pick up and apply; a paint disabled in either tree stays as it was. With `ids`, and `reverse` false or omitted, it copies From c0704b7bb02d93766e1281dffd77a9e7de37de97 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 22:31:01 -0800 Subject: [PATCH 23/61] Pathfinder: Shape Modes buttons dim while they are off With nothing selected the four Shape Modes buttons are off, but their icon was drawn through a glyph that paints the icon's own colors and ignores the off color, so they stayed at full strength while the Pathfinders row dimmed. The buttons now show the set icon, and the glyph is used only while members with different modes are selected, where it adds the question mark and the buttons are on. --- crates/ui-egui/src/panels/pathfinder.rs | 5 +++- .../ui-egui/src/panels/tests_icon_buttons.rs | 28 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/panels/pathfinder.rs b/crates/ui-egui/src/panels/pathfinder.rs index d1ee58262d..1855261d6e 100644 --- a/crates/ui-egui/src/panels/pathfinder.rs +++ b/crates/ui-egui/src/panels/pathfinder.rs @@ -136,9 +136,12 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { Row::new().gap(Gap::Item).show(ui, |ui, _| { for ((icon, label, op), mode) in SHAPE_MODES.into_iter().zip(ShapeMode::ALL) { let glyph = ShapeModeGlyph { icon: IconId::new(icon), mixed }; + // The glyph paints the icon in its own inks, so it is used only for the question mark (mixed modes + // keep the buttons on). Otherwise the button paints the set icon, dimmed while it is off. + let spec = if mixed { IconSpec::glyph(&glyph) } else { IconSpec::svg(IconId::new(icon)) }; let value = if mixed { Mixed::Mixed } else { Mixed::Same(shared == Some(mode)) }; let out = ToggleButton::new(tl!(label).to_string(), Bind::given(value)) - .icon(IconSpec::glyph(&glyph)) + .icon(spec) .icon_only() .enabled(count >= 2) .tooltip(tip(label)) diff --git a/crates/ui-egui/src/panels/tests_icon_buttons.rs b/crates/ui-egui/src/panels/tests_icon_buttons.rs index b7a1ee607e..ff498339a4 100644 --- a/crates/ui-egui/src/panels/tests_icon_buttons.rs +++ b/crates/ui-egui/src/panels/tests_icon_buttons.rs @@ -54,6 +54,34 @@ fn the_align_panel_icons_fill_their_square() { assert_full_size(align::show, &names); } +/// The colors the icon meshes inside `rect` are tinted with, sorted and without repeats. +fn icon_tints(shapes: &[Shape], rect: Rect) -> Vec<[u8; 4]> { + let mut tints: Vec<[u8; 4]> = shapes + .iter() + .filter_map(|shape| match shape { + Shape::Mesh(mesh) if mesh.texture_id != TextureId::default() && rect.contains_rect(mesh.calc_bounds()) => Some(mesh), + _ => None, + }) + .flat_map(|mesh| mesh.vertices.iter().map(|v| v.color.to_array())) + .collect(); + tints.sort_unstable(); + tints.dedup(); + tints +} + +#[test] +fn the_shape_modes_dim_with_the_pathfinders_while_they_are_off() { + let mut app = app_with_rect(); + run(&mut app, "select.none", json!({})); + let mut panel = Panel::new(app, pathfinder::show); + let (shapes, _) = panel.paint_at(2.0); + let off = icon_tints(&shapes, panel.rect("Divide")); + assert!(!off.is_empty(), "no icon drawn for Divide"); + for (_, name, _) in pathfinder::SHAPE_MODES { + assert_eq!(icon_tints(&shapes, panel.rect(name)), off, "{name} is off and should be painted as the off Divide button is"); + } +} + #[test] fn the_pathfinder_panel_icons_fill_their_square() { let names: Vec<&str> = pathfinder::SHAPE_MODES.iter().chain(&pathfinder::PATHFINDERS).map(|r| r.1).collect(); From a88b5ebe7e19379fcbcd25aa083dd6880eab7c8d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 22:31:06 -0800 Subject: [PATCH 24/61] Dependencies: craft-libs 869c9704d9 Moves every craft-libs crate to 869c9704d9. The Image Trace test reads the dimmed Stroke row's slider by role, since the row now holds a slider and a number box under one name. --- Cargo.toml | 70 +++++++++---------- apps/vectorcraft-web/Cargo.toml | 2 +- .../ui-egui/src/panels/image_trace/tests.rs | 3 +- 3 files changed, 38 insertions(+), 37 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8aa545a1bf..2396b9cb2f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,46 +11,46 @@ rust-version = "1.95" repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } # The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON. -craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } # `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile. -craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57", features = ["pcraft-pixels"] } +craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59", features = ["pcraft-pixels"] } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } # The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names # the members it imports. -craft = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } # Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui # without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes. -craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } @@ -193,13 +193,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } emath = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } epaint = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index c59556472e..f8748d719d 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -27,7 +27,7 @@ log = { workspace = true } # `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback. eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] } # The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft. -craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/crates/ui-egui/src/panels/image_trace/tests.rs b/crates/ui-egui/src/panels/image_trace/tests.rs index 29ed937ca9..1c7a51edc3 100644 --- a/crates/ui-egui/src/panels/image_trace/tests.rs +++ b/crates/ui-egui/src/panels/image_trace/tests.rs @@ -860,7 +860,8 @@ fn create_strokes_traces_again_and_keeps_one_kind_on() { for s in ["Create:", "Fills", "Strokes", "Stroke"] { assert!(panel.shows(s), "{s}"); } - assert_eq!(panel.value("Stroke").as_deref().and_then(number), Some(10.0)); + // The dimmed row holds a slider and a number box under one name: read the slider. + assert_eq!(panel.value_role("Stroke", craft::ui::contract::Role::SLIDER).as_deref().and_then(number), Some(10.0)); // Fills alone can't be turned off. panel.click("Fills"); assert_eq!(create(&panel), (Some(json!(true)), Some(json!(false)))); From 57e0e6297113b699636ea116b7204ed573642efd Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 22:34:52 -0800 Subject: [PATCH 25/61] Links: rows of images on layers show their thumbnails The rows' thumbnail lookup searched only the objects outside the layer tree, so every linked or embedded image on a layer drew an empty box. A row now finds its object by the layer tree's index first, then among the objects outside the tree. --- crates/ui-egui/src/panels/links.rs | 9 +++++++-- crates/ui-egui/src/panels/tests_links.rs | 25 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/panels/links.rs b/crates/ui-egui/src/panels/links.rs index ba3723a24e..5d69953674 100644 --- a/crates/ui-egui/src/panels/links.rs +++ b/crates/ui-egui/src/panels/links.rs @@ -118,6 +118,12 @@ impl Cache { pub(super) fn nested_node(&self, id: u64) -> Option<&Arc> { self.nested.binary_search_by_key(&id, |(n, _)| *n).ok().and_then(|i| self.nested.get(i)).map(|(_, n)| n) } + + /// The object of row `id` of `doc`, for its thumbnail: by the layer tree's index, or, for an + /// object outside the layer tree, as [`cached`] collected it. + pub(super) fn row_node(&self, doc: &vectorcraft_doc::Document, id: NodeId) -> Option> { + super::layers::node_arc(doc, id).or_else(|| self.nested_node(id.0).cloned()) + } } /// What a footer button, a row menu item or a panel menu row does to the selected rows. @@ -762,9 +768,8 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { let rows: &[Value] = cache.list["links"].as_array().map_or(&[], Vec::as_slice); let by_id: HashMap = rows.iter().filter_map(|r| Some((r["id"].as_u64()?, r))).collect(); let row_ids: Vec = rows.iter().filter_map(|r| r["id"].as_u64()).collect(); - // `lookup` gives the objects outside the layer tree. let thumbs = super::layers::link_thumbnails(ui.ctx()); - let nodes = super::layers::NodeThumbs::new(&doc, |id| cache.nested_node(id.0).cloned()); + let nodes = super::layers::NodeThumbs::new(&doc, |id| cache.row_node(&doc, id)); let (thumbs, nodes) = (&thumbs, &nodes); let ppp = ui.ctx().pixels_per_point(); diff --git a/crates/ui-egui/src/panels/tests_links.rs b/crates/ui-egui/src/panels/tests_links.rs index e817ac9f36..af34acbd8e 100644 --- a/crates/ui-egui/src/panels/tests_links.rs +++ b/crates/ui-egui/src/panels/tests_links.rs @@ -405,6 +405,31 @@ fn a_row_in_a_stored_brushs_art_finds_its_object() { assert!(matches!(found[0].1.kind, vectorcraft_doc::NodeKind::Image(_)), "{:?}", found[0].1.kind); } +/// The rows of a linked and an embedded image in the layer tree find their objects, and their +/// thumbnails show the images. +#[test] +fn the_rows_of_images_in_the_layer_tree_have_thumbnails() { + use craft::ui::primitives::textures::{ThumbRender, ThumbRequest, ThumbSource as _}; + let dir = Folder::new("tree-thumbs"); + let (app, linked, embedded) = app(&dir); + let h = rig(app); + let st = h.state().session.active().unwrap(); + let doc = std::sync::Arc::new(st.doc.clone()); + let cache = std::sync::Arc::clone(&h.state().ui.links.cache); + let thumbs = super::layers::NodeThumbs::new(&doc, |id| cache.row_node(&doc, id)); + let request = ThumbRequest::for_cell(24.0, 1.0); + for id in [linked, embedded] { + let node = cache.row_node(&doc, vectorcraft_doc::NodeId(id)).unwrap_or_else(|| panic!("row {id} finds its object")); + assert!(matches!(node.kind, vectorcraft_doc::NodeKind::Image(_)), "{:?}", node.kind); + let key = super::layers::NodeThumb { uid: st.uid, node: vectorcraft_doc::NodeId(id) }; + match thumbs.render(&key, &request) { + ThumbRender::Ready(img) => assert!(img.pixels.iter().any(|p| p.a() > 0), "row {id}'s thumbnail shows the image"), + ThumbRender::Later(_) => {} + _ => panic!("row {id}'s thumbnail is blank"), + } + } +} + #[test] fn edit_original_and_show_in_folder_hand_the_file_to_the_system() { let dir = Folder::new("open"); From fe968bfd338f4481442757cc8e331095212e161c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 22:43:57 -0800 Subject: [PATCH 26/61] Dependencies: Cargo.lock takes craft-libs 869c9704d9 --- Cargo.lock | 170 ++++++++++++++++++++++++++--------------------------- 1 file changed, 85 insertions(+), 85 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0ecda8546c..41bd07d3fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1239,7 +1239,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-automation", "craft-behavior", @@ -1280,7 +1280,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "crc32fast", "flate2", @@ -1291,7 +1291,7 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "block2 0.6.2", "objc2 0.6.5", @@ -1302,7 +1302,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "rustix 1.1.6", ] @@ -1310,7 +1310,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1335,7 +1335,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1353,7 +1353,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-behavior", "craft-docpath", @@ -1371,7 +1371,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "crc32fast", "flate2", @@ -1380,7 +1380,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "egui", ] @@ -1388,7 +1388,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "md-5", "rayon", @@ -1397,12 +1397,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-behavior", "craft-cms", @@ -1422,7 +1422,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-control-protocol", "craft-platform", @@ -1433,7 +1433,7 @@ dependencies = [ [[package]] name = "craft-control-protocol" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "getrandom 0.3.4", "serde_json", @@ -1443,7 +1443,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "rayon", ] @@ -1451,7 +1451,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "block2 0.6.2", "craft-appkit", @@ -1477,7 +1477,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "blake3", "craft-ecproj-format", @@ -1493,7 +1493,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "serde", ] @@ -1501,7 +1501,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1520,7 +1520,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-codepage", "encoding_rs", @@ -1532,7 +1532,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "serde", "serde_json", @@ -1542,12 +1542,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1562,7 +1562,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1581,7 +1581,7 @@ dependencies = [ [[package]] name = "craft-font-os-windows" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "windows-registry", "windows-sys 0.61.2", @@ -1590,7 +1590,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "cap-primitives", "craft-atomic", @@ -1613,12 +1613,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "gif", ] @@ -1626,7 +1626,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "flate2", ] @@ -1634,7 +1634,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1647,7 +1647,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "chrono", "fixed_decimal", @@ -1675,7 +1675,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-dds", "craft-jpeg", @@ -1702,7 +1702,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1720,7 +1720,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "thiserror 2.0.21", ] @@ -1728,7 +1728,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1739,7 +1739,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-host", "craft-i18n", @@ -1754,7 +1754,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-behavior", "craft-i18n", @@ -1768,7 +1768,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-behavior", "craft-host", @@ -1786,7 +1786,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1798,7 +1798,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "encoding_rs", "image", @@ -1809,7 +1809,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "chrono", "craft-codepage", @@ -1819,7 +1819,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-behavior", "craft-keymap", @@ -1835,7 +1835,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "flate2", "serde", @@ -1846,7 +1846,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1858,7 +1858,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "async-channel", "async-io", @@ -1889,7 +1889,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1898,7 +1898,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-behavior", "craft-host", @@ -1922,7 +1922,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1933,7 +1933,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-eps", "flate2", @@ -1947,7 +1947,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "encoding_rs", "flate2", @@ -1958,7 +1958,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "dispatch2", "egui", @@ -1971,7 +1971,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1990,7 +1990,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-atomic", "craft-host", @@ -2007,7 +2007,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "fax", "hayro-ccitt", @@ -2018,7 +2018,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-image-codecs", "craft-xml", @@ -2039,7 +2039,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-behavior", "craft-keymap", @@ -2051,7 +2051,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2076,7 +2076,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2091,7 +2091,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-atomic", "craft-behavior", @@ -2106,7 +2106,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "serde", "thiserror 2.0.21", @@ -2116,7 +2116,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "serde", "thiserror 2.0.21", @@ -2125,7 +2125,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-behavior", "craft-keymap", @@ -2140,12 +2140,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2159,7 +2159,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-behavior", "craft-i18n", @@ -2175,7 +2175,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "accesskit", "craft-behavior", @@ -2213,7 +2213,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2224,7 +2224,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-behavior", "craft-host", @@ -2242,7 +2242,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-behavior", "craft-host", @@ -2263,7 +2263,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-behavior", "craft-host", @@ -2284,7 +2284,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-behavior", "craft-host", @@ -2303,7 +2303,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "base64 0.22.1", "chrono", @@ -2335,7 +2335,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "flate2", "serde", @@ -2346,7 +2346,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2356,7 +2356,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "js-sys", "serde_json", @@ -2367,7 +2367,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "winsafe", ] @@ -2375,7 +2375,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "craft-appkit", "craft-atomic", @@ -2407,7 +2407,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "quick-xml 0.41.0", "serde", @@ -3762,7 +3762,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "brotli", "hayro-postscript", @@ -3771,7 +3771,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3789,7 +3789,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3807,12 +3807,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "flate2", "hayro-ccitt", @@ -4795,7 +4795,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4952,7 +4952,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=8bea6009f99f1d7ba955a672ebebf38fe4ec2c57#8bea6009f99f1d7ba955a672ebebf38fe4ec2c57" +source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" dependencies = [ "arrayvec", "kurbo 0.13.1", From 0488c58928647b78ee57c5170ba9ac40a7ade6ba Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sun, 29 Nov 2026 07:48:25 +0100 Subject: [PATCH 27/61] Pin VectorCraft to current craft-libs and its matching egui Keep native and web manifests, the lockfile, and the PDF source guard on the same craft-libs revision. Align the egui patch revision with craft-libs to retain one crate source. --- Cargo.lock | 198 ++++++++++++++++---------------- Cargo.toml | 98 ++++++++-------- apps/vectorcraft-web/Cargo.toml | 2 +- xtask/src/pdf_deps.rs | 2 +- 4 files changed, 150 insertions(+), 150 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 41bd07d3fd..6023090b50 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1239,7 +1239,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-automation", "craft-behavior", @@ -1280,7 +1280,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "crc32fast", "flate2", @@ -1291,7 +1291,7 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "block2 0.6.2", "objc2 0.6.5", @@ -1302,7 +1302,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "rustix 1.1.6", ] @@ -1310,7 +1310,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1335,7 +1335,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1353,7 +1353,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-behavior", "craft-docpath", @@ -1371,7 +1371,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "crc32fast", "flate2", @@ -1380,7 +1380,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "egui", ] @@ -1388,7 +1388,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "md-5", "rayon", @@ -1397,12 +1397,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-behavior", "craft-cms", @@ -1422,7 +1422,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-control-protocol", "craft-platform", @@ -1433,7 +1433,7 @@ dependencies = [ [[package]] name = "craft-control-protocol" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "getrandom 0.3.4", "serde_json", @@ -1443,7 +1443,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "rayon", ] @@ -1451,7 +1451,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "block2 0.6.2", "craft-appkit", @@ -1477,7 +1477,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "blake3", "craft-ecproj-format", @@ -1493,7 +1493,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "serde", ] @@ -1501,7 +1501,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1520,7 +1520,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-codepage", "encoding_rs", @@ -1532,7 +1532,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "serde", "serde_json", @@ -1542,12 +1542,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1562,7 +1562,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1581,7 +1581,7 @@ dependencies = [ [[package]] name = "craft-font-os-windows" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "windows-registry", "windows-sys 0.61.2", @@ -1590,7 +1590,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "cap-primitives", "craft-atomic", @@ -1613,12 +1613,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "gif", ] @@ -1626,7 +1626,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "flate2", ] @@ -1634,7 +1634,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1647,7 +1647,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "chrono", "fixed_decimal", @@ -1675,7 +1675,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-dds", "craft-jpeg", @@ -1702,7 +1702,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1720,7 +1720,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "thiserror 2.0.21", ] @@ -1728,7 +1728,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1739,7 +1739,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-host", "craft-i18n", @@ -1754,7 +1754,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-behavior", "craft-i18n", @@ -1768,7 +1768,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-behavior", "craft-host", @@ -1786,7 +1786,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1798,7 +1798,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "encoding_rs", "image", @@ -1809,7 +1809,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "chrono", "craft-codepage", @@ -1819,7 +1819,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-behavior", "craft-keymap", @@ -1835,7 +1835,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "flate2", "serde", @@ -1846,7 +1846,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1858,7 +1858,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "async-channel", "async-io", @@ -1889,7 +1889,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1898,7 +1898,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-behavior", "craft-host", @@ -1922,7 +1922,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1933,7 +1933,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-eps", "flate2", @@ -1947,7 +1947,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "encoding_rs", "flate2", @@ -1958,7 +1958,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "dispatch2", "egui", @@ -1971,7 +1971,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1990,7 +1990,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-atomic", "craft-host", @@ -2007,7 +2007,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "fax", "hayro-ccitt", @@ -2018,7 +2018,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-image-codecs", "craft-xml", @@ -2039,7 +2039,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-behavior", "craft-keymap", @@ -2051,7 +2051,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2076,7 +2076,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2091,7 +2091,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-atomic", "craft-behavior", @@ -2106,7 +2106,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "serde", "thiserror 2.0.21", @@ -2116,7 +2116,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "serde", "thiserror 2.0.21", @@ -2125,7 +2125,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-behavior", "craft-keymap", @@ -2140,12 +2140,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2159,7 +2159,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-behavior", "craft-i18n", @@ -2175,7 +2175,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "accesskit", "craft-behavior", @@ -2213,7 +2213,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2224,7 +2224,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-behavior", "craft-host", @@ -2242,7 +2242,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-behavior", "craft-host", @@ -2263,7 +2263,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-behavior", "craft-host", @@ -2284,7 +2284,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-behavior", "craft-host", @@ -2303,7 +2303,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "base64 0.22.1", "chrono", @@ -2335,7 +2335,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "flate2", "serde", @@ -2346,7 +2346,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2356,7 +2356,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "js-sys", "serde_json", @@ -2367,7 +2367,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "winsafe", ] @@ -2375,7 +2375,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "craft-appkit", "craft-atomic", @@ -2407,7 +2407,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "quick-xml 0.41.0", "serde", @@ -2752,7 +2752,7 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "ecolor" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081" +source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" dependencies = [ "bytemuck", "emath", @@ -2785,7 +2785,7 @@ dependencies = [ [[package]] name = "eframe" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081" +source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" dependencies = [ "ahash", "bytemuck", @@ -2820,7 +2820,7 @@ dependencies = [ [[package]] name = "egui" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081" +source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" dependencies = [ "accesskit", "ahash", @@ -2839,7 +2839,7 @@ dependencies = [ [[package]] name = "egui-wgpu" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081" +source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" dependencies = [ "ahash", "bytemuck", @@ -2858,7 +2858,7 @@ dependencies = [ [[package]] name = "egui-winit" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081" +source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" dependencies = [ "accesskit_winit", "arboard", @@ -2883,7 +2883,7 @@ dependencies = [ [[package]] name = "egui_extras" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081" +source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" dependencies = [ "ahash", "egui", @@ -2897,7 +2897,7 @@ dependencies = [ [[package]] name = "egui_glow" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081" +source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" dependencies = [ "bytemuck", "egui", @@ -2910,7 +2910,7 @@ dependencies = [ [[package]] name = "egui_kittest" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081" +source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" dependencies = [ "dify", "eframe", @@ -2936,7 +2936,7 @@ checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be" [[package]] name = "emath" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081" +source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" dependencies = [ "bytemuck", ] @@ -3017,7 +3017,7 @@ dependencies = [ [[package]] name = "epaint" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081" +source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" dependencies = [ "ahash", "bytemuck", @@ -3043,7 +3043,7 @@ dependencies = [ [[package]] name = "epaint_default_fonts" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081" +source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" [[package]] name = "equivalent" @@ -3762,7 +3762,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "brotli", "hayro-postscript", @@ -3771,7 +3771,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3789,7 +3789,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3807,12 +3807,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "flate2", "hayro-ccitt", @@ -4795,7 +4795,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4952,7 +4952,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=869c9704d9fdce1c3341fe8e16030e12b85e1d59#869c9704d9fdce1c3341fe8e16030e12b85e1d59" +source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" dependencies = [ "arrayvec", "kurbo 0.13.1", @@ -10762,14 +10762,14 @@ dependencies = [ [[patch.unused]] name = "egui_demo_lib" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081" +source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" [[patch.unused]] name = "egui_inspection" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081" +source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" [[patch.unused]] name = "egui_system_font_provider" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=932a73b28560acb1a695533307b2cd0d66a42081#932a73b28560acb1a695533307b2cd0d66a42081" +source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" diff --git a/Cargo.toml b/Cargo.toml index 2396b9cb2f..7ffa6409eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,46 +11,46 @@ rust-version = "1.95" repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } # The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON. -craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } # `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile. -craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59", features = ["pcraft-pixels"] } +craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e", features = ["pcraft-pixels"] } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } # The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names # the members it imports. -craft = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } # Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui # without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes. -craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } @@ -193,25 +193,25 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59" } -ecolor = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } -emath = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } -epaint = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } -epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } -egui = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } -egui-winit = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } -egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } -egui_glow = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } -egui_extras = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } -egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } -egui_system_font_provider = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } -eframe = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } -egui_demo_lib = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } -egui_inspection = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +ecolor = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } +emath = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } +epaint = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } +epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } +egui = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } +egui-winit = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } +egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } +egui_glow = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } +egui_extras = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } +egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } +egui_system_font_provider = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } +eframe = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } +egui_demo_lib = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } +egui_inspection = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index f8748d719d..3d626ea472 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -27,7 +27,7 @@ log = { workspace = true } # `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback. eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] } # The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft. -craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "869c9704d9fdce1c3341fe8e16030e12b85e1d59", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index f238101022..2bac79d96d 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "8bea6009f99f1d7ba955a672ebebf38fe4ec2c57"; +const REV: &str = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e"; const PACKAGES: &[(&str, &str, &str)] = &[ ("craft-pdf", "0.1.0", REV), ("krilla", "0.8.2", REV), From 5881c0c3f632854f26bdf6ec0a24a8497d00de0c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 22:53:58 -0800 Subject: [PATCH 28/61] Arrange: tests cover the settings chosen in Replace with Top Object and Sort Objects Replace with Top Object and Sort Objects bind their dialogs' values to the fields the preview and OK read, as Arrange in Grid, Set Size of Each and Randomize Opacity do, but no test covered those two. The new tests pick Bounds and Keep Original in Replace with Top Object and Large to Small in Sort Objects with the dialog's own controls, then check the dialog's values, the preview and the document after OK. Each fails when its dialog's values are not bound. --- crates/ui-egui/src/addons/arrange/tests.rs | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/crates/ui-egui/src/addons/arrange/tests.rs b/crates/ui-egui/src/addons/arrange/tests.rs index 420bfdb01d..98eeb7c282 100644 --- a/crates/ui-egui/src/addons/arrange/tests.rs +++ b/crates/ui-egui/src/addons/arrange/tests.rs @@ -1,3 +1,4 @@ +use craft::ui::contract::Role; use serde_json::json; use vectorcraft_doc::NodeId; use vectorcraft_engine::Session; @@ -109,6 +110,58 @@ fn real_opacity_edits_drive_validation_confirmation_and_cancel() { assert!((opacity(&panel, a) - 0.8).abs() < 1e-6 && (opacity(&panel, b) - 0.8).abs() < 1e-6); } +/// The objects of the first layer, from the back. +fn stacking(panel: &Harness) -> Vec { + panel.app().session.doc().unwrap().doc.layers[0].children().unwrap().iter().map(|n| n.id).collect() +} + +#[test] +fn real_replace_edits_reach_the_preview_and_confirmed_copies() { + let (app, a, b) = app(); + let mut panel = Harness::new(app, crate::tests::picks::dialogs); + click(&mut panel.app(), "Replace with Top Object…"); + panel.frame(); + panel.click_role("Size", Role::COMBO_BOX); + panel.click("Bounds"); + panel.click_role("Keep Original", Role::CHECK_BOX); + panel.frame(); + let id = host::dialog_id(&panel.app()); + let fields = host::read(&panel.app(), id, |f| (f.text("fit").map(str::to_owned), f.bool("keep"))); + assert_eq!(fields, (Some("bounds".to_owned()), Some(true))); + // The copies of the top object: every object other than the two rectangles, with its bounds. + let copies = |panel: &Harness| { + let ids: Vec = stacking(panel).into_iter().filter(|id| ![a, b].contains(id)).collect(); + let app = panel.app(); + ids.into_iter().map(|id| bounds(&app, id)).collect::>() + }; + let preview = copies(&panel); + assert_eq!(preview, vec![bounds(&panel.app(), a)], "one copy, fitted to the kept original's bounds"); + panel.click("OK"); + panel.frame(); + assert_eq!(copies(&panel), preview); + assert_eq!(stacking(&panel).len(), 3, "Keep Original leaves the original in place"); + assert!(!panel.app().any_dialog_open()); +} + +#[test] +fn real_sort_edits_reach_the_preview_and_confirmed_stacking() { + let (app, a, b) = app(); + let mut panel = Harness::new(app, crate::tests::picks::dialogs); + click(&mut panel.app(), "Sort Objects…"); + panel.frame(); + assert_eq!(stacking(&panel), vec![a, b], "the smaller area is already at the back"); + panel.click_role("Order", Role::COMBO_BOX); + panel.click("Large to Small"); + panel.frame(); + let id = host::dialog_id(&panel.app()); + assert_eq!(host::read(&panel.app(), id, |f| f.text("order").map(str::to_owned)), Some("descending".to_owned())); + assert_eq!(stacking(&panel), vec![b, a], "the preview puts the larger area at the back"); + panel.click("OK"); + panel.frame(); + assert_eq!(stacking(&panel), vec![b, a]); + assert!(!panel.app().any_dialog_open()); +} + #[test] fn set_size_of_each_sets_the_sides_ticked() { let (mut app, a, b) = app(); From 92b009d819375f5c1ef39e913e99fbf2deb1ec6d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 22:56:23 -0800 Subject: [PATCH 29/61] Panels: menu rows show their names instead of command ids MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The menus of Swatches, Brushes, Symbols, Graphic Styles, Appearance, Paragraph, OpenType, Align, Glyphs, Pathfinder, Links, Actions, Asset Export, Image Trace, Separations, Tabs, Flattener Preview, Color Themes and CSS Properties showed 137 rows by their command ids, such as "ui.swatches.newSwatch" and "brush.new". A panel menu row takes its label from the command catalog, which lists the keymap's commands and the menu bar's rows only; the panels' own commands, and commands with params, have no entry there. Each panel's menu states now name its rows, as Stroke and Transform already did. Symbols' New Symbol… and Symbol Options… rows share one command and showed one name, and the Links menu's four Select rows all read Select by Link Status; each now shows its own name. The Paragraph menu's East Asian rows are named too. A test opens every panel menu in a frame of the whole app and fails on a row that shows its command id, or on two rows of one menu level that show the same name, with the East Asian and Indic options off and on. --- .../ui-egui/src/addons/select/link_status.rs | 9 ++- crates/ui-egui/src/panels.rs | 12 ++++ crates/ui-egui/src/panels/actions/menu.rs | 8 +-- crates/ui-egui/src/panels/align.rs | 8 +-- crates/ui-egui/src/panels/appearance.rs | 4 +- crates/ui-egui/src/panels/asset_export.rs | 55 ++++++++++----- crates/ui-egui/src/panels/brushes.rs | 19 +++++ crates/ui-egui/src/panels/color_themes.rs | 1 + crates/ui-egui/src/panels/css_properties.rs | 14 ++-- .../ui-egui/src/panels/flattener_preview.rs | 6 +- crates/ui-egui/src/panels/glyphs.rs | 1 + crates/ui-egui/src/panels/graphic_styles.rs | 13 ++++ crates/ui-egui/src/panels/image_trace.rs | 1 + crates/ui-egui/src/panels/links.rs | 47 +++++++------ crates/ui-egui/src/panels/opentype.rs | 2 +- crates/ui-egui/src/panels/paragraph.rs | 38 +++++----- crates/ui-egui/src/panels/pathfinder.rs | 2 +- crates/ui-egui/src/panels/separations.rs | 2 +- crates/ui-egui/src/panels/swatches/actions.rs | 21 ++++++ crates/ui-egui/src/panels/symbols.rs | 40 ++++++----- crates/ui-egui/src/panels/tabs.rs | 4 +- crates/ui-egui/src/panels/tests_menu_names.rs | 69 +++++++++++++++++++ 22 files changed, 275 insertions(+), 101 deletions(-) create mode 100644 crates/ui-egui/src/panels/tests_menu_names.rs diff --git a/crates/ui-egui/src/addons/select/link_status.rs b/crates/ui-egui/src/addons/select/link_status.rs index 8e0d033cb6..fcc3b3a071 100644 --- a/crates/ui-egui/src/addons/select/link_status.rs +++ b/crates/ui-egui/src/addons/select/link_status.rs @@ -80,11 +80,14 @@ pub(crate) fn rows() -> Vec { } /// Dims the Select row of each status no image or placed document has ([`enabled`]), in the states of -/// the commands the Links panel's menu shows. +/// the commands the Links panel's menu shows, and names each row and its Shift alternate for its status: the +/// catalog's label for the command is Select by Link Status's. pub(crate) fn states(app: &VectorcraftApp, states: &mut CommandStates) { - for &(status, ..) in &STATUSES { + for &(status, label, _) in &STATUSES { let params = json!({ "status": status }); - states.set(CommandRef::with_params(COMMAND, params.clone()), CommandState::new().enabled(enabled(app, ¶ms))); + let state = CommandState::new().enabled(enabled(app, ¶ms)).title(crate::i18n::t(label)); + states.set(CommandRef::with_params(COMMAND, with_shift(params.clone())), state.clone()); + states.set(CommandRef::with_params(COMMAND, params), state); } } diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index f41407b29d..2ebca9a8bc 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -614,6 +614,16 @@ pub(crate) fn panel_menu_states(app: &VectorcraftApp, states: &mut CommandStates crate::canvas::task_bar::menu_states(app, states); } +/// Names the panel menu rows `rows` in `states`, each by its English label shown in the UI language: a row the menu bar +/// and the keymap do not list has no catalog label, and shows its command id without one. The state set for a row +/// keeps its enabled and checked flags. +pub(crate) fn name_rows<'a>(states: &mut CommandStates, rows: impl IntoIterator) { + for (command, label) in rows { + let state = states.get(&command).cloned().unwrap_or_default(); + states.set(command, state.title(crate::i18n::t(label))); + } +} + /// Runs panel menu command `id` when a panel runs it itself; `None` otherwise. pub(crate) fn run_menu_command(app: &mut VectorcraftApp, id: &str, params: &Value) -> Option> { if id == "ui.libraryPanel.add" { @@ -1318,6 +1328,8 @@ mod tests_links; #[cfg(test)] mod tests_maskview; #[cfg(test)] +mod tests_menu_names; +#[cfg(test)] mod tests_panel_rows; #[cfg(test)] mod tests_panel_spacing; diff --git a/crates/ui-egui/src/panels/actions/menu.rs b/crates/ui-egui/src/panels/actions/menu.rs index 5d0d26583e..7c6c783c1a 100644 --- a/crates/ui-egui/src/panels/actions/menu.rs +++ b/crates/ui-egui/src/panels/actions/menu.rs @@ -145,17 +145,17 @@ pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { set(Row::Panel(C::InsertStop), recording || has); set(Row::Panel(C::InsertMenuItem), recording || has); set(Row::Panel(C::InsertPath), (recording || has) && f.path); - set(Row::SelectObject, recording || has); - set(Row::Options, has); set(Row::Panel(C::PlaybackOptions), true); set(Row::Panel(C::Save), f.current.is_some()); set(Row::Panel(C::Load), can_load(app)); set(Row::Panel(C::Replace), can_load(app) && f.idle); set(Row::Panel(C::ClearAll), f.idle && f.sets > 0); set(Row::Panel(C::Reset), f.idle); - // The framework's labels differ from the panel's own words on these rows. - let titled = |row: Row, title: &str, enabled: bool| (row.command(), CommandState::new().enabled(enabled).title(title.to_string())); + // The framework's labels differ from the panel's own words on these rows, and the panel's own rows have none. + let titled = |row: Row, title: &str, enabled: bool| (row.command(), CommandState::new().enabled(enabled).title(crate::i18n::t(title))); for (command, state) in [ + titled(Row::SelectObject, "Select Object…", recording || has), + titled(Row::Options, "Action Options…", has), titled(Row::Panel(C::Play), "Play Current Selection", has || f.waiting), titled(Row::Panel(C::InsertPath), "Insert Select Path", (recording || has) && f.path), titled(Row::Panel(C::ClearAll), "Clear Actions", f.idle && f.sets > 0), diff --git a/crates/ui-egui/src/panels/align.rs b/crates/ui-egui/src/panels/align.rs index 5a630eaa13..1eeb293edc 100644 --- a/crates/ui-egui/src/panels/align.rs +++ b/crates/ui-egui/src/panels/align.rs @@ -604,13 +604,13 @@ pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { let hidden = part_hidden(app, HIDE_OPTIONS); let prefs = &app.session.prefs; states.set(CommandRef::new("ui.align.hideOptions"), CommandState::new().title(if hidden { tl!("Show Options") } else { tl!("Hide Options") })); - states.set(CommandRef::new("ui.align.usePreviewBounds"), CommandState::new().checked(prefs.use_preview_bounds)); - states.set(CommandRef::new("ui.align.cancelKeyObject"), CommandState::new().enabled(align_to(app) == AlignTo::Key)); + states.set(CommandRef::new("ui.align.usePreviewBounds"), CommandState::new().checked(prefs.use_preview_bounds).title(tl!("Use Preview Bounds"))); + states.set(CommandRef::new("ui.align.cancelKeyObject"), CommandState::new().enabled(align_to(app) == AlignTo::Key).title(tl!("Cancel Key Object"))); // The key choice is named for what the key is: Align to Key Anchor while it is an anchor point. let key = CommandState::new().enabled(can_choose(app, AlignTo::Key)).checked(shown_align_to(app) == AlignTo::Key); states.set(CommandRef::new("align.toKeyObject"), key.title(align_to_icon_name(AlignTo::Key, key_is_anchor(app)).1)); - states.set(CommandRef::new("ui.align.glyphBoundsPoint"), CommandState::new().checked(prefs.align_glyph_bounds_point)); - states.set(CommandRef::new("ui.align.glyphBoundsArea"), CommandState::new().checked(prefs.align_glyph_bounds_area)); + states.set(CommandRef::new("ui.align.glyphBoundsPoint"), CommandState::new().checked(prefs.align_glyph_bounds_point).title(tl!("Point Text"))); + states.set(CommandRef::new("ui.align.glyphBoundsArea"), CommandState::new().checked(prefs.align_glyph_bounds_area).title(tl!("Area Text"))); } /// Runs the Align panel menu command `id`; `None` when `id` is not one of them. The glyph-bounds diff --git a/crates/ui-egui/src/panels/appearance.rs b/crates/ui-egui/src/panels/appearance.rs index 7bce287424..c4470a4f92 100644 --- a/crates/ui-egui/src/panels/appearance.rs +++ b/crates/ui-egui/src/panels/appearance.rs @@ -1898,8 +1898,8 @@ pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { let enabled = |on: bool| CommandState::new().enabled(on); states.set("appearance.addFill", enabled(has)); states.set("appearance.addStroke", enabled(has)); - states.set(DUPLICATE_ITEM, enabled(has && sel.editable())); - states.set(REMOVE_ITEM, enabled(has && sel.deletable())); + states.set(DUPLICATE_ITEM, enabled(has && sel.editable()).title(tl!("Duplicate Item"))); + states.set(REMOVE_ITEM, enabled(has && sel.deletable()).title(tl!("Remove Item"))); states.set("appearance.clear", enabled(has)); states.set("appearance.reduceToBasic", enabled(any_subject_needs_reduction(app))); states.set(new_art_basic(app), enabled(true).checked(app.session.prefs.new_art_basic)); diff --git a/crates/ui-egui/src/panels/asset_export.rs b/crates/ui-egui/src/panels/asset_export.rs index 043918e3b5..048d8dcfb0 100644 --- a/crates/ui-egui/src/panels/asset_export.rs +++ b/crates/ui-egui/src/panels/asset_export.rs @@ -824,25 +824,46 @@ pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { let facts = Facts::of(app); for panel_row in menu_rows(app) { let PanelRow::Command(command) = panel_row else { continue }; - let Some(f) = &facts else { - states.set(command, CommandState::new().enabled(false)); - continue; + let row = command.id.strip_prefix(PREFIX).unwrap_or_default(); + let state = match (&facts, row) { + (None, _) => CommandState::new().enabled(false), + (Some(f), "add" | "add3D") => CommandState::new().enabled(f.has_art), + (Some(f), "selectAll") => CommandState::new().enabled(!f.all.is_empty()), + (Some(f), "remove") => CommandState::new().enabled(!f.sel.is_empty()), + (Some(f), "subfolders") => CommandState::new().checked(f.subfolders), + (Some(f), "openLocation") => CommandState::new().checked(f.open_location), + (Some(f), "applyPreset") => CommandState::new().checked(f.applied == command.params["name"].as_str().unwrap_or_default()), + (Some(f), "saveChanges" | "deletePreset") => CommandState::new().enabled(f.saved), + (Some(f), "exportPreset") => CommandState::new().enabled(f.known), + _ => CommandState::new(), }; - let state = match command.id.strip_prefix(PREFIX).unwrap_or_default() { - "add" | "add3D" => CommandState::new().enabled(f.has_art), - "selectAll" => CommandState::new().enabled(!f.all.is_empty()), - "remove" => CommandState::new().enabled(!f.sel.is_empty()), - "subfolders" => CommandState::new().checked(f.subfolders), - "openLocation" => CommandState::new().checked(f.open_location), - "applyPreset" => { - let name = command.params["name"].as_str().unwrap_or_default().to_string(); - CommandState::new().checked(f.applied == name).title(name) - } - "saveChanges" | "deletePreset" => CommandState::new().enabled(f.saved), - "exportPreset" => CommandState::new().enabled(f.known), - _ => continue, + let title = match row { + "applyPreset" => command.params["name"].as_str().unwrap_or_default().to_string(), + "add" if command.params["multiple"] == true => tl!("Add Selected Artwork as Multiple Assets").to_string(), + row => tl!(menu_label(row)).to_string(), }; - states.set(command, state); + states.set(command, state.title(title)); + } +} + +/// The English label of the panel menu's row `row` (`ui.assetExport.`); Add Selected Artwork as Multiple Assets +/// and the presets' rows are named by [`menu_states`]. +fn menu_label(row: &str) -> &'static str { + match row { + "add" => "Add Selected Artwork as One Asset", + "add3D" => "Export 3D Object", + "selectAll" => "Select All Assets", + "remove" => "Remove Selected Assets", + "exportForScreens" => "Export for Screens…", + "formatSettings" => "Format Settings…", + "subfolders" => "Create Sub-folders", + "openLocation" => "Open Location after Export", + "savePresetAs" => "Save As Preset…", + "saveChanges" => "Save Changes", + "deletePreset" => "Delete Preset", + "importPreset" => "Import Preset…", + "exportPreset" => "Export Preset…", + _ => "", } } diff --git a/crates/ui-egui/src/panels/brushes.rs b/crates/ui-egui/src/panels/brushes.rs index 7c1d4cfa96..d8075d4c66 100644 --- a/crates/ui-egui/src/panels/brushes.rs +++ b/crates/ui-egui/src/panels/brushes.rs @@ -767,6 +767,25 @@ pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { states.set(CommandRef::new(THUMBNAIL_VIEW), on(true).checked(!view.list)); states.set(CommandRef::new(LIST_VIEW), on(true).checked(view.list)); states.set(CommandRef::new(SAVE_LIBRARY), on(!list.is_empty())); + let names = [ + (new_brush("calligraphic"), "New Calligraphic Brush"), + (new_brush("bristle"), "New Bristle Brush"), + (new_brush("art"), "New Art Brush from Selection"), + (new_brush("scatter"), "New Scatter Brush from Selection"), + (new_brush("pattern"), "New Pattern Brush from Selection"), + (CommandRef::new(DUPLICATE), "Duplicate Brush"), + (CommandRef::new(DELETE_BRUSH), "Delete Brush"), + (CommandRef::new(SELECT_UNUSED), "Select All Unused"), + (CommandRef::new(THUMBNAIL_VIEW), "Thumbnail View"), + (CommandRef::new(LIST_VIEW), "List View"), + (CommandRef::new(SAVE_LIBRARY), "Save Brush Library…"), + ]; + super::name_rows(states, names); + for (ty, label) in KINDS { + let title = crate::i18n::fmt(tl!("Show {kind} Brushes"), &[("kind", tl!(label))]); + let state = states.get(&show_kind(ty)).cloned().unwrap_or_default(); + states.set(show_kind(ty), state.title(title)); + } } /// Runs the panel menu's own row `id`; `None` for an id that is not one of them. diff --git a/crates/ui-egui/src/panels/color_themes.rs b/crates/ui-egui/src/panels/color_themes.rs index 6399ec1372..3d1b32f037 100644 --- a/crates/ui-egui/src/panels/color_themes.rs +++ b/crates/ui-egui/src/panels/color_themes.rs @@ -412,6 +412,7 @@ pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { for id in [SAVE, ADD_TO_SWATCHES, EDIT, DELETE] { states.set(CommandRef::new(id), CommandState::new().enabled(enabled(app, id))); } + super::name_rows(states, [(CommandRef::new(SAVE), "Save Theme"), (CommandRef::new(ADD_TO_SWATCHES), "Add to Swatches")]); states.set(CommandRef::new(SHOW_FIND), CommandState::new().checked(app.ui.color_themes_panel.show_find)); } diff --git a/crates/ui-egui/src/panels/css_properties.rs b/crates/ui-egui/src/panels/css_properties.rs index 91683cc016..d076d8a515 100644 --- a/crates/ui-egui/src/panels/css_properties.rs +++ b/crates/ui-egui/src/panels/css_properties.rs @@ -285,17 +285,17 @@ pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { let panel = &app.ui.css_properties_panel; let selection = app.session.active().map(|st| !st.selection.is_empty()); let (has_doc, selected) = (selection.is_some(), selection == Some(true)); - states.set(CommandRef::new(COPY_SELECTED), CommandState::new().enabled(selected)); - states.set(CommandRef::new(EXPORT_SELECTED), CommandState::new().enabled(selected)); - states.set(CommandRef::new(EXPORT_ALL), CommandState::new().enabled(has_doc)); - states.set(CommandRef::new(GENERATE), CommandState::new().enabled(has_doc).checked(panel.all)); + states.set(CommandRef::new(COPY_SELECTED), CommandState::new().enabled(selected).title(tl!("Copy Selected Style"))); + states.set(CommandRef::new(EXPORT_SELECTED), CommandState::new().enabled(selected).title(tl!("Export Selected CSS…"))); + states.set(CommandRef::new(EXPORT_ALL), CommandState::new().enabled(has_doc).title(tl!("Export All…"))); + states.set(CommandRef::new(GENERATE), CommandState::new().enabled(has_doc).checked(panel.all).title(tl!("Generate CSS"))); for units in CssUnits::ALL { - states.set(units_ref(units), CommandState::new().checked(panel.options.units == units)); + states.set(units_ref(units), CommandState::new().checked(panel.options.units == units).title(units.name())); } let mut options = panel.options.clone(); - for name in FLAGS { + for (name, label) in FLAGS.into_iter().zip([tl!("Absolute Position"), tl!("Width and Height"), tl!("Unnamed Objects"), tl!("Rasterize Unsupported Art")]) { let on = flag_mut(&mut options, name).is_some_and(|on| *on); - states.set(option_ref(name), CommandState::new().checked(on)); + states.set(option_ref(name), CommandState::new().checked(on).title(label)); } } diff --git a/crates/ui-egui/src/panels/flattener_preview.rs b/crates/ui-egui/src/panels/flattener_preview.rs index 82703526b1..6b37957e6f 100644 --- a/crates/ui-egui/src/panels/flattener_preview.rs +++ b/crates/ui-egui/src/panels/flattener_preview.rs @@ -397,8 +397,10 @@ pub(crate) fn menu_rows(_app: &VectorcraftApp) -> Vec { /// The states of the menu's rows: Refresh needs a document, Show Options is checked while the options show. pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { - states.set(CommandRef::new(REFRESH), CommandState::new().enabled(app.session.active().is_some())); - states.set(CommandRef::new(SHOW_OPTIONS), CommandState::new().checked(app.ui.flattener_preview.show_options)); + states.set(CommandRef::new(REFRESH), CommandState::new().enabled(app.session.active().is_some()).title(tl!("Refresh"))); + states.set(CommandRef::new(SHOW_OPTIONS), CommandState::new().checked(app.ui.flattener_preview.show_options).title(tl!("Show Options"))); + states.set(CommandRef::new(FIT_IN_WINDOW), CommandState::new().title(tl!("Fit in Window"))); + states.set(CommandRef::new(SAVE_PRESET), CommandState::new().title(tl!("Save Transparency Flattener Preset…"))); } /// Runs a menu row; `None` for an id that is not this panel's. diff --git a/crates/ui-egui/src/panels/glyphs.rs b/crates/ui-egui/src/panels/glyphs.rs index e595eb55fa..e639ae3ea4 100644 --- a/crates/ui-egui/src/panels/glyphs.rs +++ b/crates/ui-egui/src/panels/glyphs.rs @@ -1395,6 +1395,7 @@ pub(crate) fn menu_rows(app: &VectorcraftApp) -> Vec { /// The row titles of a category, which are the panel's words, with the check on the shown one. A /// form no face of the selection has a feature for is disabled ([`form_faces`]). pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { + states.set(CommandRef::new("ui.glyphs.useTextFont"), CommandState::new().title(tl!("Use the Selected Text's Font"))); let (_, _, face) = browsed_face(app); let cats = categories(face.as_deref()); let current = current_category(app, &cats); diff --git a/crates/ui-egui/src/panels/graphic_styles.rs b/crates/ui-egui/src/panels/graphic_styles.rs index c102a1ecdc..d9250ad7ee 100644 --- a/crates/ui-egui/src/panels/graphic_styles.rs +++ b/crates/ui-egui/src/panels/graphic_styles.rs @@ -872,6 +872,19 @@ pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { for (v, _) in View::ALL { states.set(view_ref(v), CommandState::new().checked(app.ui.graphic_styles_view == v)); } + let names = [ + ("new", "New Graphic Style…"), + ("duplicate", "Duplicate Graphic Style"), + ("merge", "Merge Graphic Styles"), + ("delete", "Delete Graphic Style"), + ("selectUnused", "Select All Unused"), + ("square", "Use Square for Previews"), + ("text", "Use Text for Previews"), + ("options", "Graphic Style Options…"), + ]; + let rows = names.into_iter().map(|(row, label)| (CommandRef::new(id(row)), label)); + let views = View::ALL.into_iter().map(|(v, label)| (view_ref(v), label)); + crate::panels::name_rows(states, rows.chain(views).chain([(override_ref(app), "Override Character Color")])); } /// Run the panel-menu row `id` (an id under `ui.graphicStyles`). diff --git a/crates/ui-egui/src/panels/image_trace.rs b/crates/ui-egui/src/panels/image_trace.rs index 08dcd9f42e..372d3117aa 100644 --- a/crates/ui-egui/src/panels/image_trace.rs +++ b/crates/ui-egui/src/panels/image_trace.rs @@ -1086,6 +1086,7 @@ pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { let state = states.get(&command).cloned().unwrap_or_else(CommandState::new).enabled(enabled); states.set(command, state); } + states.set(CommandRef::new("ui.imageTrace.reset"), CommandState::new().title(tl!("Reset to Default"))); } /// The panel's own menu commands. diff --git a/crates/ui-egui/src/panels/links.rs b/crates/ui-egui/src/panels/links.rs index ba3723a24e..8078af2984 100644 --- a/crates/ui-egui/src/panels/links.rs +++ b/crates/ui-egui/src/panels/links.rs @@ -1049,14 +1049,14 @@ fn link_info(ui: &mut Ui, app: &VectorcraftApp, info: Option<(u64, &Value)>, uni reveal } -/// A command row with the state its panel-menu row shows. -fn entry(app: &VectorcraftApp, f: &Facts, id: &str, params: Value, a: Act) -> (CommandRef, CommandState) { - (CommandRef::with_params(id, params), CommandState::new().enabled(can(app, a, f, None))) +/// A command row named `label` with the state its panel-menu row shows. +fn entry(app: &VectorcraftApp, f: &Facts, id: &str, params: Value, a: Act, label: &str) -> (CommandRef, CommandState) { + (CommandRef::with_params(id, params), CommandState::new().enabled(can(app, a, f, None)).title(tl!(label))) } -/// A command row that is always enabled and checked or not. -fn option_entry(id: &str, params: Value, checked: bool) -> (CommandRef, CommandState) { - (CommandRef::with_params(id, params), CommandState::new().enabled(true).checked(checked)) +/// A command row named `label` that is always enabled and checked or not. +fn option_entry(id: &str, params: Value, checked: bool, label: &str) -> (CommandRef, CommandState) { + (CommandRef::with_params(id, params), CommandState::new().enabled(true).checked(checked).title(tl!(label))) } /// The panel menu's command rows with their states, in the groups the menu separates: the link @@ -1067,29 +1067,32 @@ fn groups(app: &VectorcraftApp) -> [Vec<(CommandRef, CommandState)>; 6] { let selected = selected_links(app); let f = Facts::of(&cache.list, &selected); let o = &app.ui.links.options; - let e = |id: &str, params: Value, a: Act| entry(app, &f, id, params, a); + let e = |id: &str, params: Value, a: Act, label: &str| entry(app, &f, id, params, a, label); [ vec![ - e("ui.relinkDialog", json!({ "ids": f.all() }), Act::Relink), - e("ui.links.relinkToFolder", Value::Null, Act::RelinkToFolder), - e("ui.findLinksInFolder", json!({ "ids": f.linked() }), Act::FindInFolder), - e("ui.links.goTo", Value::Null, Act::GoTo), - e("ui.links.update", Value::Null, Act::Update), - e("links.editOriginal", f.file_row(), Act::Edit), + e("ui.relinkDialog", json!({ "ids": f.all() }), Act::Relink, "Relink…"), + e("ui.links.relinkToFolder", Value::Null, Act::RelinkToFolder, "Relink to Folder…"), + e("ui.findLinksInFolder", json!({ "ids": f.linked() }), Act::FindInFolder, "Find in Folder…"), + e("ui.links.goTo", Value::Null, Act::GoTo, "Go To Link"), + e("ui.links.update", Value::Null, Act::Update, "Update Link"), + e("links.editOriginal", f.file_row(), Act::Edit, "Edit Original"), ], vec![ - e("ui.links.embed", Value::Null, Act::Embed), - e("ui.links.unembed", Value::Null, Act::Unembed), - e("ui.placementOptionsDialog", json!({ "ids": f.all() }), Act::Placement), - e("links.reveal", f.file_row(), Act::Reveal), + e("ui.links.embed", Value::Null, Act::Embed, "Embed Image(s)"), + e("ui.links.unembed", Value::Null, Act::Unembed, "Unembed…"), + e("ui.placementOptionsDialog", json!({ "ids": f.all() }), Act::Placement, "Placement Options…"), + e("links.reveal", f.file_row(), Act::Reveal, "Show in Folder"), ], - SHOW.iter().map(|(k, _)| option_entry("ui.links.show", json!({ "show": k }), o.show == *k)).collect(), - SORT.iter().map(|(k, _)| option_entry("ui.links.sort", json!({ "sort": k }), o.sort == Some(*k))).collect(), - vec![e("links.copyInfo", json!({ "ids": f.all() }), Act::CopyInfo)], + SHOW.iter().map(|(k, label)| option_entry("ui.links.show", json!({ "show": k }), o.show == *k, label)).collect(), + SORT.iter().map(|(k, label)| option_entry("ui.links.sort", json!({ "sort": k }), o.sort == Some(*k), label)).collect(), + vec![e("links.copyInfo", json!({ "ids": f.all() }), Act::CopyInfo, "Copy Info")], THUMBS .iter() - .map(|(k, size, _)| option_entry("ui.links.thumbnails", json!({ "size": k }), o.thumb == *size)) - .chain([option_entry("ui.links.linkInfo", Value::Null, o.info), option_entry("ui.links.dcs", Value::Null, o.dcs)]) + .map(|(k, size, label)| option_entry("ui.links.thumbnails", json!({ "size": k }), o.thumb == *size, label)) + .chain([ + option_entry("ui.links.linkInfo", Value::Null, o.info, "Show Link Info"), + option_entry("ui.links.dcs", Value::Null, o.dcs, "Show DCS Transparency Interactions"), + ]) .collect(), ] } diff --git a/crates/ui-egui/src/panels/opentype.rs b/crates/ui-egui/src/panels/opentype.rs index b0025b5f82..41788bfded 100644 --- a/crates/ui-egui/src/panels/opentype.rs +++ b/crates/ui-egui/src/panels/opentype.rs @@ -447,7 +447,7 @@ pub(crate) fn menu_rows(app: &VectorcraftApp) -> Vec { pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { let style = text_style(app); let has = style.is_some(); - states.set(CommandRef::new(RESET), CommandState::new().enabled(has)); + states.set(CommandRef::new(RESET), CommandState::new().enabled(has).title(tl!("Reset OpenType Features"))); let sets = style.map(|(st, _)| set_entries(app, &st)).unwrap_or_default(); for (set, flag, on) in &sets { if let Some(tag) = flag.tag() { diff --git a/crates/ui-egui/src/panels/paragraph.rs b/crates/ui-egui/src/panels/paragraph.rs index b987c8af99..8bc176f74d 100644 --- a/crates/ui-egui/src/panels/paragraph.rs +++ b/crates/ui-egui/src/panels/paragraph.rs @@ -923,7 +923,7 @@ fn composers() -> [(&'static str, Composer); 4] { ] } -/// The Paragraph panel menu's rows; the labels and chords come from the commands' catalogue entries. +/// The Paragraph panel menu's rows; [`menu_states`] names them, and the chords come from the commands' catalogue entries. pub(crate) fn menu_rows(app: &VectorcraftApp) -> Vec { let cmd = |r: CommandRef| PanelRow::Command(r); let mut rows = vec![ @@ -965,34 +965,38 @@ pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { let has = style.is_some(); let title = if app.ui.paragraph_hide_options { tl!("Show Options") } else { tl!("Hide Options") }; states.set(show_ref(), CommandState::new().title(title)); - let mut put = |r: CommandRef, enabled: bool, checked: Option| states.set(r, state(enabled, checked)); + // Each row is named here: the rows take params the catalog's rows do not list. `title` is shown as given. + let mut put = |r: CommandRef, enabled: bool, checked: Option, title: &str| states.set(r, state(enabled, checked).title(title)); // Quotation marks, hyphens, full stops and commas at a line's ends hang outside the margin. - put(toggle_ref("romanHangingPunctuation"), has, Some(style.as_ref().is_some_and(|(_, p)| p.roman_hanging))); - put(CommandRef::new("ui.justification"), has, None); - put(CommandRef::new("ui.hyphenation"), has, None); + let hanging = Some(style.as_ref().is_some_and(|(_, p)| p.roman_hanging)); + put(toggle_ref("romanHangingPunctuation"), has, hanging, tl!("Roman Hanging Punctuation")); + put(CommandRef::new("ui.justification"), has, None, tl!("Justification…")); + put(CommandRef::new("ui.hyphenation"), has, None, tl!("Hyphenation…")); if app.session.prefs.show_east_asian_options { let top_to_top = style.as_ref().is_some_and(|(_, p)| p.leading_model == LeadingModel::EmBoxTop); - put(set_ref("leadingModel", "emBoxTop"), has, Some(top_to_top)); - put(set_ref("leadingModel", "romanBaseline"), has, Some(has && !top_to_top)); + put(set_ref("leadingModel", "emBoxTop"), has, Some(top_to_top), tl!("Top-to-Top Leading")); + put(set_ref("leadingModel", "romanBaseline"), has, Some(has && !top_to_top), tl!("Bottom-to-Bottom Leading")); let hang = style.as_ref().map(|(_, p)| p.burasagari); - for (_, b, key) in burasagari_rows() { - put(set_ref("burasagari", key), has, Some(hang == Some(b))); + for (label, b, key) in burasagari_rows() { + put(set_ref("burasagari", key), has, Some(hang == Some(b)), label); } - put(toggle_ref("kurikaeshiMojiShori"), has, Some(shared_para(app, |p| p.kurikaeshi_moji_shori) == Some(true))); + let repeat = Some(shared_para(app, |p| p.kurikaeshi_moji_shori) == Some(true)); + put(toggle_ref("kurikaeshiMojiShori"), has, repeat, tl!("Kurikaeshi Moji Shori")); let kinsoku_type = shared_para(app, |p| p.kinsoku_type); - for (_, t, key) in kinsoku_types() { - put(set_ref("kinsokuType", key), has, Some(kinsoku_type == Some(t))); + for (label, t, key) in kinsoku_types() { + put(set_ref("kinsokuType", key), has, Some(kinsoku_type == Some(t)), label); } // Inseparable pairs stay on one line; only with a kinsoku set. let (kinsoku_on, bunri) = bunri_kinshi_item(app); - put(toggle_ref("bunriKinshi"), has && kinsoku_on, Some(bunri)); - put(toggle_ref("koreanLineBreakAnywhere"), has, Some(shared_para(app, |p| p.korean_line_break_anywhere) == Some(true))); + put(toggle_ref("bunriKinshi"), has && kinsoku_on, Some(bunri), tl!("Bunri-Kinshi")); + let anywhere = Some(shared_para(app, |p| p.korean_line_break_anywhere) == Some(true)); + put(toggle_ref("koreanLineBreakAnywhere"), has, anywhere, tl!("Korean Line Break Anywhere")); } let composer = shared_composer(app); - for (_, c) in composers() { - put(set_ref("composer", composer_id(c)), has, Some(composer == Some(c))); + for (label, c) in composers() { + put(set_ref("composer", composer_id(c)), has, Some(composer == Some(c)), label); } - put(reset_ref(), has, None); + put(reset_ref(), has, None, tl!("Reset Panel")); } /// Runs a `ui.paragraph.*` command; `None` for any other id. diff --git a/crates/ui-egui/src/panels/pathfinder.rs b/crates/ui-egui/src/panels/pathfinder.rs index d1ee58262d..f7ca2a08e4 100644 --- a/crates/ui-egui/src/panels/pathfinder.rs +++ b/crates/ui-egui/src/panels/pathfinder.rs @@ -187,7 +187,7 @@ pub(crate) fn menu_rows(_app: &VectorcraftApp) -> Vec { /// The states of the panel's own menu commands; the others read the commands' own rules. pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { - states.set(CommandRef::new("ui.pathfinder.trap"), CommandState::new().enabled(operands(app) >= 2)); + states.set(CommandRef::new("ui.pathfinder.trap"), CommandState::new().enabled(operands(app) >= 2).title(tl!("Trap…"))); } /// Runs the panel's own menu commands; `None` for any other id. diff --git a/crates/ui-egui/src/panels/separations.rs b/crates/ui-egui/src/panels/separations.rs index 691bd720fc..845552dd76 100644 --- a/crates/ui-egui/src/panels/separations.rs +++ b/crates/ui-egui/src/panels/separations.rs @@ -446,7 +446,7 @@ pub(crate) fn menu_rows(_app: &VectorcraftApp) -> Vec { /// Show All Plates is available while the separations preview is on. pub(crate) fn menu_states(_app: &VectorcraftApp, states: &mut CommandStates) { - states.set(SHOW_ALL_PLATES, CommandState::new().enabled(proof::view().separations.is_some())); + states.set(SHOW_ALL_PLATES, CommandState::new().enabled(proof::view().separations.is_some()).title(tl!("Show All Plates"))); } /// Runs the panel's own menu command `id`; `None` for any other id. Show All Plates turns the diff --git a/crates/ui-egui/src/panels/swatches/actions.rs b/crates/ui-egui/src/panels/swatches/actions.rs index 13d912b40c..7fd324a517 100644 --- a/crates/ui-egui/src/panels/swatches/actions.rs +++ b/crates/ui-egui/src/panels/swatches/actions.rs @@ -197,6 +197,27 @@ pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { for (v, _) in View::ALL { states.set(view_ref(v), CommandState::new().checked(v == app.ui.swatches_view)); } + let names = [ + ("newSwatch", "New Swatch…"), + ("newColorGroup", "New Color Group…"), + ("duplicate", "Duplicate Swatch"), + ("merge", "Merge Swatches"), + ("delete", "Delete Swatch"), + ("editGroup", "Edit or Apply Color Group…"), + ("ungroup", "Ungroup Color Group"), + ("groupOptions", "Color Group Options…"), + ("selectUnused", "Select All Unused"), + ("addUsedColors", "Add Used Colors"), + ("addSelectedColors", "Add Selected Colors"), + ("sortByName", "Sort by Name"), + ("sortByKind", "Sort by Kind"), + ("showFind", "Show Find Field"), + ("showRecent", "Show Recent Colors"), + ("options", "Swatch Options…"), + ("spotColors", "Spot Colors…"), + ]; + let views = View::ALL.into_iter().map(|(v, label)| (view_ref(v), label)); + crate::panels::name_rows(states, names.into_iter().map(|(row, label)| (CommandRef::new(id(row)), label)).chain(views)); } /// Runs panel menu row `id` (`ui.swatches.`); `None` for another panel's id. diff --git a/crates/ui-egui/src/panels/symbols.rs b/crates/ui-egui/src/panels/symbols.rs index c257f30d0a..e8dbf1a468 100644 --- a/crates/ui-egui/src/panels/symbols.rs +++ b/crates/ui-egui/src/panels/symbols.rs @@ -774,39 +774,43 @@ fn menu_lines(app: &VectorcraftApp) -> Vec { let picked = !marked(app).is_empty(); let inst = instance_flags(app); let name = json!({ "name": sel }); - let row = |id: &str, params: Value, enabled: bool| MenuLine::Command(CommandRef::with_params(id, params), CommandState::new().enabled(enabled)); + // Each row is named here: several share a command (New Symbol… and Symbol Options…), and most take params that + // the catalog's rows do not list. + let row = |id: &str, params: Value, enabled: bool, label: &str| { + MenuLine::Command(CommandRef::with_params(id, params), CommandState::new().enabled(enabled).title(tl!(label))) + }; let view = app.ui.symbols_view; - let views = View::ALL.iter().map(|&(v, _)| { + let views = View::ALL.iter().map(|&(v, label)| { let params = json!({ "panel": "symbols", "view": v }); - MenuLine::Command(CommandRef::with_params("ui.panelView", params), CommandState::new().checked(view == v)) + MenuLine::Command(CommandRef::with_params("ui.panelView", params), CommandState::new().checked(view == v).title(tl!(label))) }); let mut lines = vec![ // Shift on New Symbol… and Redefine Symbol keeps the selected art as ordinary art // ([`fired_params`]). - row("ui.symbolOptions", json!({}), has_sel), - row("symbol.update", name.clone(), has_sel && sel.is_some()), - row("symbol.duplicate", name.clone(), sel.is_some()), + row("ui.symbolOptions", json!({}), has_sel, "New Symbol…"), + row("symbol.update", name.clone(), has_sel && sel.is_some(), "Redefine Symbol"), + row("symbol.duplicate", name.clone(), sel.is_some(), "Duplicate Symbol"), // Asks first, as the panel's button does; the menu row has no Alt shortcut. - row(ROW_DELETE, Value::Null, sel.is_some() || picked), - row("ui.symbolOptions", json!({ "edit": true, "name": sel }), sel.is_some()), + row(ROW_DELETE, Value::Null, sel.is_some() || picked, "Delete Symbol"), + row("ui.symbolOptions", json!({ "edit": true, "name": sel }), sel.is_some(), "Symbol Options…"), // The selected instance's symbol, else the symbol selected in the panel. - row("symbol.edit", if inst.any { json!({}) } else { name.clone() }, inst.any || sel.is_some()), - row("symbol.place", name.clone(), sel.is_some()), - row("symbol.replace", name.clone(), inst.any && sel.is_some()), - row("symbol.breakLink", json!({}), inst.any), - row("symbol.instance.reset", json!({}), inst.changed), - row("symbol.instance.resetTransform", json!({}), inst.transformed), - row("symbol.selectInstances", name, sel.is_some()), + row("symbol.edit", if inst.any { json!({}) } else { name.clone() }, inst.any || sel.is_some(), "Edit Symbol"), + row("symbol.place", name.clone(), sel.is_some(), "Place Symbol Instance"), + row("symbol.replace", name.clone(), inst.any && sel.is_some(), "Replace Symbol"), + row("symbol.breakLink", json!({}), inst.any, "Break Link to Symbol"), + row("symbol.instance.reset", json!({}), inst.changed, "Reset Symbol Instance"), + row("symbol.instance.resetTransform", json!({}), inst.transformed, "Reset Transformation"), + row("symbol.selectInstances", name, sel.is_some(), "Select All Instances"), MenuLine::Separator, // Select All Unused (#4918): the symbols nothing places show selected, and Delete Symbol // deletes them all. - row(ROW_SELECT_UNUSED, Value::Null, symbols > 0), + row(ROW_SELECT_UNUSED, Value::Null, symbols > 0, "Select All Unused"), // The document's symbols in name order, as one undo step. - row("symbol.sortByName", json!({}), symbols > 1), + row("symbol.sortByName", json!({}), symbols > 1, "Sort by Name"), MenuLine::Separator, ]; lines.extend(views); - lines.extend([MenuLine::Separator, MenuLine::Libraries, row(ROW_SAVE_LIBRARY, Value::Null, symbols > 0)]); + lines.extend([MenuLine::Separator, MenuLine::Libraries, row(ROW_SAVE_LIBRARY, Value::Null, symbols > 0, "Save Symbol Library…")]); lines } diff --git a/crates/ui-egui/src/panels/tabs.rs b/crates/ui-egui/src/panels/tabs.rs index 47a0508f5d..fbea360c43 100644 --- a/crates/ui-egui/src/panels/tabs.rs +++ b/crates/ui-egui/src/panels/tabs.rs @@ -840,8 +840,8 @@ pub(crate) fn menu_rows(_app: &VectorcraftApp) -> Vec { /// Enable or disable the panel menu's commands as [`can`] says. pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { - for id in COMMANDS { - states.set(CommandRef::new(id), CommandState::new().enabled(can(app, id))); + for (id, label) in COMMANDS.into_iter().zip([tl!("Clear All Tabs"), tl!("Delete Tab"), tl!("Repeat Tab")]) { + states.set(CommandRef::new(id), CommandState::new().enabled(can(app, id)).title(label)); } } diff --git a/crates/ui-egui/src/panels/tests_menu_names.rs b/crates/ui-egui/src/panels/tests_menu_names.rs new file mode 100644 index 0000000000..7e3e10550e --- /dev/null +++ b/crates/ui-egui/src/panels/tests_menu_names.rs @@ -0,0 +1,69 @@ +//! Panel menus: every command row shows a name of its own, never its command id. + +use craft::ui::runtime::commands; + +use super::tests_appearance::app_with_rect; +use super::*; + +/// The command rows of `rows`, each with the level it is on (0 for the menu, then one number per submenu), submenus' +/// rows included. A row with a Shift alternate brings the alternate's command too. +fn command_rows(rows: &[PanelRow], level: usize, next: &mut usize, out: &mut Vec<(usize, CommandRef)>) { + for row in rows { + match row { + PanelRow::Command(command) => out.push((level, command.clone())), + PanelRow::Alternated(command, alternate) => { + out.push((level, command.clone())); + *next += 1; + out.push((*next, alternate.command.clone())); + } + PanelRow::Submenu(_, rows) => { + *next += 1; + command_rows(rows, *next, next, out); + } + _ => {} + } + } +} + +/// What is wrong with the rows of every panel menu in a frame of the whole app: a row whose label is empty or is its +/// command id, and two rows of one menu that show the same label. +fn unnamed_rows(app: &mut VectorcraftApp) -> Vec { + let ctx = app.ui_ctx.clone().expect("the app has a window"); + let screen_rect = Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1400.0, 900.0))); + for k in 0..2 { + crate::testing::app_frame(app, &ctx, egui::RawInput { time: Some(f64::from(k)), screen_rect, ..Default::default() }); + } + let mut wrong = Vec::new(); + for menu in PANEL_MENUS { + let mut rows = Vec::new(); + command_rows(&(menu.rows)(app), 0, &mut 0, &mut rows); + let mut seen: Vec<(usize, String, String)> = Vec::new(); + for (level, command) in rows { + let label = commands::resolve(&ctx, command.clone()).label.to_string(); + if label.trim().is_empty() || label == command.id { + wrong.push(format!("{}: {} shows its id", menu.id, command.key())); + } else if let Some((_, other, _)) = seen.iter().find(|(at, key, shown)| *at == level && *shown == label && *key != command.key()) { + wrong.push(format!("{}: {} and {other} both show {label:?}", menu.id, command.key())); + } + seen.push((level, command.key(), label)); + } + } + wrong +} + +#[test] +fn panel_menu_rows_show_names_not_command_ids() { + let mut app = app_with_rect(); + let wrong = unnamed_rows(&mut app); + assert!(wrong.is_empty(), "{} rows:\n{}", wrong.len(), wrong.join("\n")); +} + +/// The rows the East Asian and Indic options add to the Paragraph, OpenType and Glyphs menus are named too. +#[test] +fn panel_menu_rows_with_the_east_asian_options_show_names() { + let mut app = app_with_rect(); + app.session.prefs.show_east_asian_options = true; + app.session.prefs.show_indic_options = true; + let wrong = unnamed_rows(&mut app); + assert!(wrong.is_empty(), "{} rows:\n{}", wrong.len(), wrong.join("\n")); +} From 148541971f35062d8803791b5007db41566cd7a6 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 21:58:32 -0800 Subject: [PATCH 30/61] UI: Fidelity applies only once committed in freehand Tool Options and the Contextual Task Bar The Contextual Task Bar ran tool.setOption for the Smooth tool's Fidelity on every typed proposal, so a value typed and then canceled with Escape stayed set on the tool. The bar now sets the option only when the field commits the value. In the freehand Tool Options dialog, Escape during a Fidelity slider drag left the dragged value in the dialog. The draft now follows the drag unrounded, takes the rounded value when the drag ends, and gets the value from before the drag back on Escape, including a value above the slider's end that the field allows. The dialog's Fidelity field reads its edit events with landed(), as the variation fields do. Follow-up to #9753. --- crates/ui-egui/src/canvas/task_bar.rs | 6 +- crates/ui-egui/src/dialogs/freehand.rs | 22 ++++-- crates/ui-egui/src/dialogs/freehand/tests.rs | 73 ++++++++++++++++++++ crates/ui-egui/src/tests/taskbar.rs | 26 +++++++ 4 files changed, 118 insertions(+), 9 deletions(-) diff --git a/crates/ui-egui/src/canvas/task_bar.rs b/crates/ui-egui/src/canvas/task_bar.rs index a1613565bb..56657ef670 100644 --- a/crates/ui-egui/src/canvas/task_bar.rs +++ b/crates/ui-egui/src/canvas/task_bar.rs @@ -464,10 +464,12 @@ pub(super) fn task_bar(app: &mut VectorcraftApp, ui: &mut Ui, space: &CanvasSpac .show(ui, space.view.rect, |ui, _| { for (label, icon, cmd, params) in &offer.actions { if *cmd == TASK_BAR_FIDELITY { - // The Smooth tool's Fidelity, labeled, sets the tool's option as it is typed or stepped. + // The Smooth tool's Fidelity, labeled, sets the tool's option once a typed or stepped value is + // committed; Escape leaves the option as it was. if let Some(v) = offer.fidelity { Text::new(*label).show(ui); - if let Some(x) = crate::dialogs::freehand::fidelity_field(ui, "task-bar-fidelity", v, "smooth").filter(|x| *x != v) { + let events = crate::dialogs::freehand::fidelity_field(ui, "task-bar-fidelity", v, "smooth"); + if let Some(x) = events.committed().and_then(|typed| typed.to_owned()).filter(|x| *x != v) { run = Some(("tool.setOption", json!({"tool": "smooth", "values": {"fidelity": x}}))); } } diff --git a/crates/ui-egui/src/dialogs/freehand.rs b/crates/ui-egui/src/dialogs/freehand.rs index 34d4e39fe5..7de36ba00e 100644 --- a/crates/ui-egui/src/dialogs/freehand.rs +++ b/crates/ui-egui/src/dialogs/freehand.rs @@ -19,6 +19,7 @@ // PLAN: the imports below assume `craft_ui` paths as the framework's own code uses them; `ui::brush_settings` // of the draw crate is where `TipEllipse` and `TipAngle` live. +use craft::behavior::EditEvents; use craft::draw::ui::brush_settings::{TipAngle, TipEllipse}; use craft::ui::contract::{Bind, Props as _, Show as _, ShowContainer as _}; use craft::ui::display::{Picture, PictureSize}; @@ -116,9 +117,10 @@ fn fidelity_round(v: f64) -> f64 { } /// The Fidelity field of tool `tool`, showing `v` to two decimals from the tool's lowest Fidelity to -/// 100 and stepping by [`fidelity_step`], named by the label drawn just before it. Returns the value -/// typed or stepped to. The Contextual Task Bar shows the Smooth tool's. -pub(crate) fn fidelity_field(ui: &mut Ui, id: &str, v: f64, tool: &str) -> Option { +/// 100 and stepping by [`fidelity_step`], named by the label drawn just before it. Returns the field's +/// edit events: the value typed or stepped to as a proposal, then its commit, or the cancel that +/// restores `v`. The Contextual Task Bar shows the Smooth tool's. +pub(crate) fn fidelity_field(ui: &mut Ui, id: &str, v: f64, tool: &str) -> EditEvents> { let min = vectorcraft_tools::draw2::min_fidelity(tool); NumberField::new(tl!("Fidelity"), Bind::given(Some(v))) .id_salt(id.to_owned()) @@ -128,8 +130,7 @@ pub(crate) fn fidelity_field(ui: &mut Ui, id: &str, v: f64, tool: &str) -> Optio .stepper(|v, dir, scale| fidelity_step(v, f64::from(dir) * scale)) .show(ui) .edit - .value() - .and_then(|typed| typed.to_owned()) + .events } /// The Fidelity row: a logarithmic slider from the tool's lowest Fidelity to [`FIDELITY_MAX`] with the field at its @@ -145,10 +146,17 @@ fn fidelity_row(ui: &mut Ui, fields: &mut DialogFields, tool: &str) -> Response .label(tl!("Fidelity")) .id_salt("fidelity-slider") .show(ui); - if let Some(x) = slid.value() { + // The draft follows a drag unrounded, as a rounded value would end the slider's gesture, and takes the rounded + // value once the drag ends. Escape puts back the value from before the drag or the typing, which the field + // allows above the slider's end. + if let Some(x) = slid.events.committed() { set = Some(fidelity_round(*x).clamp(min, FIDELITY_MAX)); + } else if let Some(x) = slid.events.value() { + set = Some(x.clamp(min, FIDELITY_MAX)); + } else if let Some(x) = slid.events.landed() { + set = Some(*x); } - if let Some(x) = fidelity_field(ui, "fidelity-field", v, tool) { + if let Some(x) = fidelity_field(ui, "fidelity-field", v, tool).landed().and_then(|typed| typed.to_owned()) { set = Some(x); } }); diff --git a/crates/ui-egui/src/dialogs/freehand/tests.rs b/crates/ui-egui/src/dialogs/freehand/tests.rs index d9e4e32dfe..790d5742e1 100644 --- a/crates/ui-egui/src/dialogs/freehand/tests.rs +++ b/crates/ui-egui/src/dialogs/freehand/tests.rs @@ -416,3 +416,76 @@ fn the_blob_brush_size_offers_the_stylus_wheel() { let text = shown_text(&mut app); assert!(text.contains("Stylus Wheel"), "it shows again on the next open: {text}"); } + +/// The Fidelity the open Tool Options dialog holds, `None` once it is closed. +fn draft_fidelity(panel: &crate::tests::panel_harness::Panel) -> Option { + panel.app().dialogs().and_then(|d| d.with(|host| host.get::().and_then(|dialog| dialog.fields().number("fidelity")))) +} + +/// The Smooth tool's Fidelity slider and field: a drag or a typed value that Escape cancels leaves the dialog's Fidelity +/// and the tool's as they were; a finished drag or a typed value left with Tab sets the dialog's, and OK sets the tool's. +#[test] +fn a_canceled_fidelity_drag_or_typed_value_leaves_the_dialog_and_the_tool() { + use craft::ui::contract::Role; + use egui::{Key, Modifiers, vec2}; + let mut app = app(); + app.run("tool.setOption", json!({"tool": "smooth", "values": {"fidelity": 2.5}})).unwrap(); + let original = app.session.tool_options_of("smooth"); + let document = app.session.active().unwrap().doc.clone(); + let mut panel = crate::tests::panel_harness::Panel::new(app, crate::tests::picks::dialogs); + panel.room(vec2(1000.0, 1200.0)); + crate::toolbar::open_options(&mut panel.app(), "smooth").unwrap(); + panel.frame(); + assert_eq!(draft_fidelity(&panel), Some(2.5)); + + // On the track, above the Accurate and Smooth marks. + let track = |panel: &crate::tests::panel_harness::Panel| { + let r = panel.rect_role("Fidelity", Role::SLIDER); + egui::pos2(r.center().x, r.top() + 5.0) + }; + let from = track(&panel); + panel.drag_hold_between(from, from + vec2(60.0, 0.0)); + assert_ne!(draft_fidelity(&panel), Some(2.5), "the dialog's Fidelity follows the drag"); + panel.key(Key::Escape, Modifiers::NONE); + panel.release(); + assert_eq!(draft_fidelity(&panel), Some(2.5), "Escape puts back the Fidelity from before the drag"); + + panel.click_role("Fidelity", Role::SPIN_BUTTON); + panel.key(Key::A, Modifiers::COMMAND); + panel.type_text("7"); + panel.key(Key::Escape, Modifiers::NONE); + assert_eq!(panel.app().session.tool_options_of("smooth"), original, "the canceled typed value leaves the tool"); + if draft_fidelity(&panel).is_none() { + crate::toolbar::open_options(&mut panel.app(), "smooth").unwrap(); + panel.frame(); + } + assert_eq!(draft_fidelity(&panel), Some(2.5), "the dialog shows the Fidelity from before the typing"); + + let from = track(&panel); + panel.drag_hold_between(from, from + vec2(60.0, 0.0)); + panel.release(); + let dragged = draft_fidelity(&panel).unwrap(); + assert!(dragged > 2.5, "a finished drag sets the dialog's Fidelity: {dragged}"); + assert_eq!(dragged, fidelity_round(dragged), "to the slider's step"); + panel.click_role("Fidelity", Role::SPIN_BUTTON); + panel.key(Key::A, Modifiers::COMMAND); + panel.type_text("7"); + panel.key(Key::Tab, Modifiers::NONE); + assert_eq!(draft_fidelity(&panel), Some(7.0), "a typed value left with Tab sets the dialog's Fidelity"); + assert_eq!(panel.app().session.tool_options_of("smooth"), original, "the tool keeps its Fidelity until OK"); + panel.click("OK"); + panel.frame(); + assert_eq!(draft_fidelity(&panel), None, "OK closes the dialog"); + assert_eq!(panel.app().session.tool_options_of("smooth")["fidelity"].as_f64(), Some(7.0)); + assert_eq!(panel.app().session.active().unwrap().doc, document); + + panel.app().run("tool.setOption", json!({"tool": "smooth", "values": {"fidelity": 50}})).unwrap(); + crate::toolbar::open_options(&mut panel.app(), "smooth").unwrap(); + panel.frame(); + let from = track(&panel); + panel.drag_hold_between(from, from - vec2(60.0, 0.0)); + assert!(draft_fidelity(&panel).is_some_and(|x| x <= FIDELITY_MAX), "the drag runs along the slider"); + panel.key(Key::Escape, Modifiers::NONE); + panel.release(); + assert_eq!(draft_fidelity(&panel), Some(50.0), "Escape puts back a Fidelity above the slider's end"); +} diff --git a/crates/ui-egui/src/tests/taskbar.rs b/crates/ui-egui/src/tests/taskbar.rs index 3a56b8dad8..1995432740 100644 --- a/crates/ui-egui/src/tests/taskbar.rs +++ b/crates/ui-egui/src/tests/taskbar.rs @@ -1584,6 +1584,32 @@ fn the_smooth_tool_shows_fidelity_and_tool_options_for_a_path() { }); } +/// The Smooth tool's Fidelity field sets the tool's Fidelity only once a typed value is committed: while it is typed +/// and after Escape the tool keeps its Fidelity, and Enter sets it without an undo step. +#[test] +fn the_smooth_tools_fidelity_is_set_only_when_the_typed_value_is_committed() { + let mut app = app(); + let path = id(app.run("shape.ellipse", json!({"x": 60, "y": 60, "width": 120, "height": 80})).unwrap()); + select(&mut app, &[path]); + app.run("tool.select", json!({"tool": "smooth"})).unwrap(); + app.run("tool.setOption", json!({"tool": "smooth", "values": {"fidelity": 2.5}})).unwrap(); + let undo = app.session.active().unwrap().history.undo.len(); + on_canvas(&mut app, |rig| { + let field = rig.field_after("Fidelity:"); + rig.fx.click_at(field); + rig.fx.key(Key::A, Modifiers::COMMAND); + rig.fx.type_text("7"); + rig.settle(); + assert_eq!(rig.app().session.tool_options()["fidelity"].as_f64(), Some(2.5), "a value being typed leaves the tool"); + rig.fx.key(Key::Escape, Modifiers::NONE); + rig.settle(); + assert_eq!(rig.app().session.tool_options()["fidelity"].as_f64(), Some(2.5), "Escape leaves the tool's Fidelity"); + rig.enter_value(field, "7"); + }); + assert_eq!(app.session.tool_options()["fidelity"].as_f64(), Some(7.0), "Enter sets it"); + assert_eq!(app.session.active().unwrap().history.undo.len(), undo); +} + /// The Smooth tool's "Fidelity:" label is a framework text in the bar: a label node in the access tree, drawn on one /// line with its baseline on the Fidelity field's. #[test] From dc6ba53e6e8ffb50719c60035f450ac7d8fd0133 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 23:06:27 -0800 Subject: [PATCH 31/61] Tool options: tests cover a canceled field edit that keeps the dialog open The Live Paint Bucket Width test and the nullable length test pressed Escape, which closes the modal, and then reopened it, so they passed with the number and length rows still reading only proposals. Each test now also types a value, adds text that does not parse, and leaves the field with Tab. The dialog stays open, and the row must hold the opening value again (4 px, and null). --- crates/ui-egui/src/dialogs/option_form.rs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/dialogs/option_form.rs b/crates/ui-egui/src/dialogs/option_form.rs index 7b127c08ef..fde3f40932 100644 --- a/crates/ui-egui/src/dialogs/option_form.rs +++ b/crates/ui-egui/src/dialogs/option_form.rs @@ -507,6 +507,15 @@ pub(super) mod tests { crate::toolbar::open_options(&mut panel.app(), "livePaintBucket").unwrap(); panel.frame(); assert_eq!(fields(&panel.app()), before); + panel.click_role("Width", Role::SPIN_BUTTON); + panel.key(Key::A, Modifiers::COMMAND); + panel.type_text("9"); + assert_eq!(fields(&panel.app())["width"], 9.0, "typing proposes the width"); + panel.type_text("x"); + panel.key(Key::Tab, Modifiers::NONE); + panel.frame(); + assert!(is_open(&panel.app()), "leaving the field keeps the dialog open"); + assert_eq!(fields(&panel.app()), before, "leaving the field on text that is not a number restores the opening width"); if commit { panel.click_role("Width", Role::SPIN_BUTTON); panel.key(Key::A, Modifiers::COMMAND); @@ -530,7 +539,7 @@ pub(super) mod tests { /// Normal Gap Options supplies numeric points. This hosted row fixture separately checks /// the nullable length helper's contract, including restoring an empty opening value. #[test] - fn a_nullable_length_row_restores_null_on_escape() { + fn a_nullable_length_row_restores_null_when_its_typing_is_canceled() { static NULL_LENGTH: OptionSpec = OptionSpec { key: "nullableLengthTest", title: || "Nullable Length".into(), @@ -555,6 +564,15 @@ pub(super) mod tests { open(&mut panel.app(), &NULL_LENGTH, Map::from_iter([("length".into(), Value::Null)]), Value::Null).unwrap(); panel.frame(); assert_eq!(fields(&panel.app())["length"], Value::Null); + panel.click_role("Length", Role::SPIN_BUTTON); + panel.key(Key::A, Modifiers::COMMAND); + panel.type_text("9 pt"); + assert_eq!(fields(&panel.app())["length"], 9.0); + panel.type_text("x"); + panel.key(Key::Tab, Modifiers::NONE); + panel.frame(); + assert!(is_open(&panel.app()), "leaving the field keeps the dialog open"); + assert_eq!(fields(&panel.app())["length"], Value::Null, "leaving the field on text that is not a length restores null"); } /// Whether `a` and `b` are the same value, numbers by their value. From 7b7ad0bd0e2bbb0f6725291a82ea7f907fedf2b8 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 23:07:01 -0800 Subject: [PATCH 32/61] Brush Options: test that a canceled Bristle slider drag leaves the brush as it was For each of the five Bristle sliders, a held drag ended with Escape restores the open dialog's field, and OK then keeps the brush and the undo history unchanged. A released drag is kept by OK in one undo step. --- .../src/dialogs/brush_options/tests.rs | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/crates/ui-egui/src/dialogs/brush_options/tests.rs b/crates/ui-egui/src/dialogs/brush_options/tests.rs index 7e6fdf0952..a63d0cef53 100644 --- a/crates/ui-egui/src/dialogs/brush_options/tests.rs +++ b/crates/ui-egui/src/dialogs/brush_options/tests.rs @@ -362,6 +362,52 @@ fn canceled_pattern_scale_edits_do_not_reach_the_brush() { assert_eq!(panel.app().run("brush.get", json!({"name": "Diamonds"})).unwrap(), original); } +/// Bristle Brush Options' sliders: a held drag ended with Escape leaves the open dialog's field as it +/// opened, and OK then leaves the brush as it was; a released drag is kept by OK. +#[test] +fn canceled_bristle_slider_drags_do_not_reach_the_brush() { + use crate::tests::panel_harness::Panel; + use craft::ui::contract::Role; + use egui::{Key, Modifiers}; + + for (key, label, _) in BRISTLE { + let mut app = app(); + let params = json!({"length": 150.0, "density": 50.0, "thickness": 50.0, "opacity": 50.0, "stiffness": 50.0}); + app.run("brush.options", json!({"name": "Bristle Round", "params": params})).unwrap(); + let original = app.run("brush.get", json!({"name": "Bristle Round"})).unwrap(); + let undo = app.session.active().unwrap().history.undo.len(); + let mut panel = Panel::new(app, draw_hosted_options); + panel.room(egui::vec2(1000.0, 1000.0)); + open(&mut panel.app(), "Bristle Round"); + panel.frame(); + let initial = fields_of(&panel.app()).number(key).unwrap(); + panel.drag_hold_role(label, Role::SLIDER, egui::vec2(40.0, 0.0)); + assert_ne!(fields_of(&panel.app()).number(key), Some(initial), "the held drag previews another {key}"); + panel.key(Key::Escape, Modifiers::NONE); + panel.release(); + assert!(is_open(&panel.app())); + assert_eq!(fields_of(&panel.app()).number(key), Some(initial), "the canceled drag restores the opening {key}"); + panel.click("OK"); + panel.frame(); + assert!(!is_open(&panel.app())); + assert_eq!(panel.app().run("brush.get", json!({"name": "Bristle Round"})).unwrap(), original, "OK after a canceled {key} drag"); + assert_eq!(panel.app().session.active().unwrap().history.undo.len(), undo); + + open(&mut panel.app(), "Bristle Round"); + panel.frame(); + panel.drag_hold_role(label, Role::SLIDER, egui::vec2(40.0, 0.0)); + panel.release(); + let accepted = fields_of(&panel.app()).number(key).unwrap(); + assert_ne!(accepted, initial); + panel.click("OK"); + panel.frame(); + assert_eq!(panel.app().run("brush.get", json!({"name": "Bristle Round"})).unwrap()[key], accepted); + assert_eq!(panel.app().session.active().unwrap().history.undo.len(), undo + 1); + panel.app().run("edit.undo", json!({})).unwrap(); + assert_eq!(panel.app().run("brush.get", json!({"name": "Bristle Round"})).unwrap(), original); + } +} + /// What a step of the table expects at a JSON pointer of the saved brush. enum Expect { Is(Value), From 8254c2f6d4522a5d3781f89a9cd9db91226fa688 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 23:10:00 -0800 Subject: [PATCH 33/61] Slices: a refused OK keeps Slice Options and Divide Slices open with what was typed Both dialogs closed on OK before the app checked the document and slices they opened with, so a refusal (the selection changed, the document was reverted, or the command failed) went to the status line and the typed values were lost. They now open through the held-OK host: the check and the command run while the dialog waits, a refusal shows its reason under the rows with the values kept, and OK applies once the opening slices are selected again. --- crates/ui-egui/src/app.rs | 1 - crates/ui-egui/src/dialogs/host.rs | 1 - crates/ui-egui/src/dialogs/object_dialogs.rs | 4 +- crates/ui-egui/src/dialogs/slices.rs | 119 +++++++++++-------- crates/ui-egui/src/lib.rs | 2 - 5 files changed, 69 insertions(+), 58 deletions(-) diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 283c1bd6a8..97fca4f235 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -246,7 +246,6 @@ impl VectorcraftApp { three_d_dialog: None, three_d: Default::default(), export_dialogs: Default::default(), - slice_dialogs: Default::default(), package_document: None, web_export: Default::default(), flattener_preview: Default::default(), diff --git a/crates/ui-egui/src/dialogs/host.rs b/crates/ui-egui/src/dialogs/host.rs index 67c6683f73..38c572c1c9 100644 --- a/crates/ui-egui/src/dialogs/host.rs +++ b/crates/ui-egui/src/dialogs/host.rs @@ -207,7 +207,6 @@ pub(crate) fn pump(app: &mut VectorcraftApp, ctx: &egui::Context) { super::graph_design::pump, super::perspective_grid::pump, super::perspective_presets::pump, - super::slices::pump, super::blend_options::pump, super::saved_names::pump, super::object_mosaic::pump, diff --git a/crates/ui-egui/src/dialogs/object_dialogs.rs b/crates/ui-egui/src/dialogs/object_dialogs.rs index df0c1be3ed..465fdcb850 100644 --- a/crates/ui-egui/src/dialogs/object_dialogs.rs +++ b/crates/ui-egui/src/dialogs/object_dialogs.rs @@ -4,8 +4,7 @@ use super::path_ops::PathOp; use super::simplify_slider::StripKind; use super::{ blend_options, dimension, flare_options, graph_data, graph_design, graph_type, indexed_color, live_paint_gaps, object_mosaic, option_form, - path_ops, perspective_grid, perspective_presets, saved_names, shapes, simplify_slider, slices, smooth_slider, transform, transform_each, - width_point, + path_ops, perspective_grid, perspective_presets, saved_names, shapes, simplify_slider, smooth_slider, transform, transform_each, width_point, }; use crate::VectorcraftApp; @@ -58,7 +57,6 @@ pub(crate) fn pump(app: &mut VectorcraftApp, ctx: &egui::Context) { graph_design::pump(app, ctx); perspective_grid::pump(app, ctx); perspective_presets::pump(app, ctx); - slices::pump(app, ctx); blend_options::pump(app, ctx); saved_names::pump(app, ctx); object_mosaic::pump(app, ctx); diff --git a/crates/ui-egui/src/dialogs/slices.rs b/crates/ui-egui/src/dialogs/slices.rs index ae99272163..8695ac0574 100644 --- a/crates/ui-egui/src/dialogs/slices.rs +++ b/crates/ui-egui/src/dialogs/slices.rs @@ -24,12 +24,6 @@ pub const OPTIONS: &str = "sliceOptions"; /// The dialog kind of Divide Slices. pub const DIVIDE: &str = "divideSlices"; -#[derive(Default)] -pub(crate) struct SliceDialogs { - options: Option, - divide: Option, -} - /// The document, its revert count and the effective slice selection used when opening either dialog. #[derive(PartialEq)] struct Target { @@ -134,12 +128,8 @@ pub fn open_options(app: &mut VectorcraftApp) -> Result { kinds.push(SliceKind::HtmlText); } let dialog = SliceOptionsDialog::new(options_of(&map)).kinds(&kinds); - app.dialogs().ok_or("no window")?.with(|host| { - host.open(dialog); - // Replacing a still-open dialog leaves its Cancel behind. - let _ = host.take::(); - }); - app.slice_dialogs.options = Some(source); + crate::dialogs::host::open_held(app, dialog, move |app, o: &SliceOptions| apply(app, &source, "object.slice.options", options_json(o))) + .ok_or("no window")?; Ok(Value::Null) } @@ -152,44 +142,27 @@ pub fn open_divide(app: &mut VectorcraftApp) -> Result { let source = Target::new(st.uid, st.reverts, selected); let (w, h) = first.map_or((50.0, 50.0), |r| (r.width() / 2.0, r.height() / 2.0)); let dialog = DivideSlicesDialog::new(DivideSlices::new(Some(DivideBy::Count(2)), Some(DivideBy::Count(2)))).lengths(lengths).start_sizes(h, w); - app.dialogs().ok_or("no window")?.with(|host| { - host.open(dialog); - let _ = host.take::(); - }); - app.slice_dialogs.divide = Some(source); + crate::dialogs::host::open_held(app, dialog, move |app, d: &DivideSlices| apply(app, &source, "object.slice.divide", divide_json(d))) + .ok_or("no window")?; Ok(Value::Null) } -/// Run the answer of whichever slice dialog closed with OK. The framework dialogs hold no answer, so a -/// refusal goes to the status line and the dialog is already closed. -pub(crate) fn pump(app: &mut VectorcraftApp, _ctx: &egui::Context) { - let Some(host) = app.dialogs() else { return }; - let (options, divide) = host.with(|h| (h.take::(), h.take::())); - let answers = [ - options.and_then(|r| { - let source = app.slice_dialogs.options.take(); - r.ok().map(|o| (source, "object.slice.options", options_json(&o))) - }), - divide.and_then(|r| { - let source = app.slice_dialogs.divide.take(); - r.ok().map(|d| (source, "object.slice.divide", divide_json(&d))) - }), - ]; - for (source, cmd, params) in answers.into_iter().flatten() { - if source.as_ref().is_some_and(|source| source.reverted(app)) { - app.status(tl!("The document was reverted. Reopen this dialog to continue.")); - } else if !source.is_some_and(|source| Some(source) == Target::current(app)) { - app.status(tl!("The slice selection changed while the dialog was open.")); - } else if let Err(e) = app.run(cmd, params) { - app.status(e); - } +/// Runs a slice dialog's OK on the document and slices it opened with. A refusal keeps the dialog open with +/// what was typed and the reason under its rows. +fn apply(app: &mut VectorcraftApp, source: &Target, cmd: &str, params: Value) -> Result<(), String> { + if source.reverted(app) { + return Err(tl!("The document was reverted. Reopen this dialog to continue.").to_owned()); } + if Target::current(app).as_ref() != Some(source) { + return Err(tl!("The slice selection changed while the dialog was open.").to_owned()); + } + app.run(cmd, params).map(|_| ()) } #[cfg(test)] mod tests { use super::*; - use craft::ui::dialog::{DialogHost, DialogId}; + use craft::ui::dialog::{DialogHost, DialogId, HeldOk}; use vectorcraft_doc::NodeId; use vectorcraft_engine::Session; @@ -217,12 +190,20 @@ mod tests { host(app, |h| h.set_json_field(&ctx, id, field, value)).unwrap(); } - /// OK on the open dialog, then the frame's pump runs its answer; whether OK was enabled. + /// OK on the open dialog, then the frame's pump runs its held answer, and an accepted answer closes the + /// dialog; whether OK was enabled. fn ok(app: &mut VectorcraftApp) -> bool { let (ctx, (id, _)) = (app.ui_ctx.clone().unwrap(), the_dialog(app)); - let enabled = host(app, |h| h.confirm_by_id(&ctx, id)); + let closed = host(app, |h| h.confirm_by_id(&ctx, id)); + if !closed && host(app, |h| h.held_state(id)) != Some(HeldOk::Waiting) { + return false; + } crate::dialogs::host::pump(app, &ctx); - enabled + if host(app, |h| h.held_state(id)) == Some(HeldOk::Accepted) { + host(app, |h| h.confirm_by_id(&ctx, id)); + crate::dialogs::host::pump(app, &ctx); + } + true } fn add_slice(app: &mut VectorcraftApp, x: f64) -> NodeId { @@ -235,15 +216,33 @@ mod tests { app.run("object.slice.select", json!({"slices": [id.0]})).unwrap(); } + /// The reason the open dialog shows for its refused OK, if it has one. + fn refusal(app: &VectorcraftApp) -> Option { + let (id, _) = the_dialog(app); + match host(app, |h| h.held_state(id)) { + Some(HeldOk::Refused(reason)) => Some(reason.as_str().to_string()), + _ => None, + } + } + + /// Whether either slice dialog is open. + fn slice_dialog_open(app: &VectorcraftApp) -> bool { + host(app, |h| h.is_open::() || h.is_open::()) + } + + /// The field each dialog's test types into, and the value typed. + fn draft(divide: bool) -> (&'static str, Value) { + if divide { ("columns", json!(3)) } else { ("name", json!("Original")) } + } + fn check_changed_selection(dialog: &str, divide: bool) { let mut app = app(); let source = app.session.active().unwrap().doc.slice_ids()[0]; let destination = add_slice(&mut app, 80.0); select_slice(&mut app, source); app.run(dialog, json!({})).unwrap(); - if !divide { - set(&app, "name", json!("Original")); - } + let (field, typed) = draft(divide); + set(&app, field, typed.clone()); select_slice(&mut app, destination); let st = app.session.active().unwrap(); let undo = st.history.undo.len(); @@ -253,7 +252,22 @@ mod tests { let st = app.session.active().unwrap(); assert_eq!(*st.doc, *document, "the changed selection is untouched"); assert_eq!(st.history.undo.len(), undo); - assert_eq!(app.ui.status, "The slice selection changed while the dialog was open."); + assert!(slice_dialog_open(&app), "the refused dialog stays open"); + assert_eq!(refusal(&app).as_deref(), Some("The slice selection changed while the dialog was open.")); + assert_eq!(the_dialog(&app).1[field], typed, "the refused dialog keeps what was typed"); + + // With the opening slice selected again, the same draft applies. + select_slice(&mut app, source); + assert!(ok(&mut app)); + assert!(!slice_dialog_open(&app), "the accepted dialog closes"); + let st = app.session.active().unwrap(); + assert_eq!(st.history.undo.len(), undo + 1, "the accepted OK is one undo step"); + if divide { + assert_eq!(st.doc.slices.len(), document.slices.len() + 6, "the opening slice is divided into six cells"); + } else { + assert_eq!(st.doc.slice_options(source).unwrap().name, "Original"); + assert_eq!(st.doc.slice_options(destination).unwrap().name, "", "the other slice keeps its options"); + } } #[test] @@ -267,7 +281,7 @@ mod tests { } /// Opens `dialog` on the saved document's slice, edits the document, reverts it and reselects the same slice id; - /// OK then leaves the restored document as it is and reports the revert. Returns the app and the slice. + /// OK then leaves the restored document as it is and the dialog open with the reason. Returns the app and the slice. fn check_refused_after_file_revert(dialog: &str, divide: bool, tag: &str) -> (VectorcraftApp, NodeId) { let mut app = app(); let slice = app.session.active().unwrap().doc.slice_ids()[0]; @@ -292,7 +306,8 @@ mod tests { let st = app.session.active().unwrap(); assert_eq!(*st.doc, *restored, "OK leaves the restored document's slices unchanged"); assert_eq!(st.history.undo.len(), undo); - assert_eq!(app.ui.status, "The document was reverted. Reopen this dialog to continue."); + assert!(slice_dialog_open(&app), "the refused dialog stays open"); + assert_eq!(refusal(&app).as_deref(), Some("The document was reverted. Reopen this dialog to continue.")); (app, slice) } @@ -332,6 +347,8 @@ mod tests { let st = app.session.active().unwrap(); assert_eq!(st.doc.slice_options(to).unwrap().name, ""); assert_eq!(st.history.undo.len(), undo); + assert_eq!(refusal(&app).as_deref(), Some("The slice selection changed while the dialog was open."), "the refused dialog stays open"); + assert_eq!(the_dialog(&app).1["name"], "Source", "the refused dialog keeps what was typed"); } #[test] @@ -342,7 +359,7 @@ mod tests { select_slice(&mut app, other); app.run("object.slice.options", json!({})).unwrap(); let ctx = app.ui_ctx.clone().unwrap(); - pump(&mut app, &ctx); + crate::dialogs::host::pump(&mut app, &ctx); set(&app, "name", json!("Replacement")); assert!(ok(&mut app)); diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 4062cc4302..3cd948fce0 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -288,8 +288,6 @@ pub struct VectorcraftApp { pub(crate) three_d: panels::three_d::Model, /// The open export option dialogs and what runs after each. pub(crate) export_dialogs: dialogs::export_host::ExportDialogs, - /// The document and selection used by each open slice dialog. - pub(crate) slice_dialogs: dialogs::slices::SliceDialogs, /// The drawing and loaded contents the open Package dialog saves and collects. pub(crate) package_document: Option<(u64, u64)>, /// Save for Web's renders and colour table. From 6f3703bbab1fdb2ed28256206695f5f6b2dcb5fc Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sun, 29 Nov 2026 08:38:26 +0100 Subject: [PATCH 34/61] Advance shared PDF pin and honor Standard-mode Tab hiding Keep the native and web craft-libs pins, Cargo.lock and PDF source checks on 57c8c8d4. Preserve the matching egui pin. Consult the shared Standard-mode chrome state for visibility and for show-panel requests; the dock already honors that state when drawing. --- Cargo.lock | 170 ++++++++++++++-------------- Cargo.toml | 70 ++++++------ apps/vectorcraft-web/Cargo.toml | 2 +- crates/ui-egui/src/panel_docking.rs | 9 +- xtask/src/pdf_deps.rs | 2 +- 5 files changed, 128 insertions(+), 125 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6023090b50..4910ae4bb8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1239,7 +1239,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-automation", "craft-behavior", @@ -1280,7 +1280,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "crc32fast", "flate2", @@ -1291,7 +1291,7 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "block2 0.6.2", "objc2 0.6.5", @@ -1302,7 +1302,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "rustix 1.1.6", ] @@ -1310,7 +1310,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1335,7 +1335,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1353,7 +1353,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-behavior", "craft-docpath", @@ -1371,7 +1371,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "crc32fast", "flate2", @@ -1380,7 +1380,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "egui", ] @@ -1388,7 +1388,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "md-5", "rayon", @@ -1397,12 +1397,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-behavior", "craft-cms", @@ -1422,7 +1422,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-control-protocol", "craft-platform", @@ -1433,7 +1433,7 @@ dependencies = [ [[package]] name = "craft-control-protocol" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "getrandom 0.3.4", "serde_json", @@ -1443,7 +1443,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "rayon", ] @@ -1451,7 +1451,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "block2 0.6.2", "craft-appkit", @@ -1477,7 +1477,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "blake3", "craft-ecproj-format", @@ -1493,7 +1493,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "serde", ] @@ -1501,7 +1501,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1520,7 +1520,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-codepage", "encoding_rs", @@ -1532,7 +1532,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "serde", "serde_json", @@ -1542,12 +1542,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1562,7 +1562,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1581,7 +1581,7 @@ dependencies = [ [[package]] name = "craft-font-os-windows" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "windows-registry", "windows-sys 0.61.2", @@ -1590,7 +1590,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "cap-primitives", "craft-atomic", @@ -1613,12 +1613,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "gif", ] @@ -1626,7 +1626,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "flate2", ] @@ -1634,7 +1634,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1647,7 +1647,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "chrono", "fixed_decimal", @@ -1675,7 +1675,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-dds", "craft-jpeg", @@ -1702,7 +1702,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1720,7 +1720,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "thiserror 2.0.21", ] @@ -1728,7 +1728,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1739,7 +1739,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-host", "craft-i18n", @@ -1754,7 +1754,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-behavior", "craft-i18n", @@ -1768,7 +1768,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-behavior", "craft-host", @@ -1786,7 +1786,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1798,7 +1798,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "encoding_rs", "image", @@ -1809,7 +1809,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "chrono", "craft-codepage", @@ -1819,7 +1819,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-behavior", "craft-keymap", @@ -1835,7 +1835,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "flate2", "serde", @@ -1846,7 +1846,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1858,7 +1858,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "async-channel", "async-io", @@ -1889,7 +1889,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1898,7 +1898,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-behavior", "craft-host", @@ -1922,7 +1922,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1933,7 +1933,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-eps", "flate2", @@ -1947,7 +1947,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "encoding_rs", "flate2", @@ -1958,7 +1958,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "dispatch2", "egui", @@ -1971,7 +1971,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1990,7 +1990,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-atomic", "craft-host", @@ -2007,7 +2007,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "fax", "hayro-ccitt", @@ -2018,7 +2018,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-image-codecs", "craft-xml", @@ -2039,7 +2039,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-behavior", "craft-keymap", @@ -2051,7 +2051,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2076,7 +2076,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2091,7 +2091,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-atomic", "craft-behavior", @@ -2106,7 +2106,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "serde", "thiserror 2.0.21", @@ -2116,7 +2116,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "serde", "thiserror 2.0.21", @@ -2125,7 +2125,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-behavior", "craft-keymap", @@ -2140,12 +2140,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2159,7 +2159,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-behavior", "craft-i18n", @@ -2175,7 +2175,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "accesskit", "craft-behavior", @@ -2213,7 +2213,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2224,7 +2224,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-behavior", "craft-host", @@ -2242,7 +2242,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-behavior", "craft-host", @@ -2263,7 +2263,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-behavior", "craft-host", @@ -2284,7 +2284,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-behavior", "craft-host", @@ -2303,7 +2303,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "base64 0.22.1", "chrono", @@ -2335,7 +2335,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "flate2", "serde", @@ -2346,7 +2346,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2356,7 +2356,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "js-sys", "serde_json", @@ -2367,7 +2367,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "winsafe", ] @@ -2375,7 +2375,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "craft-appkit", "craft-atomic", @@ -2407,7 +2407,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "quick-xml 0.41.0", "serde", @@ -3762,7 +3762,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "brotli", "hayro-postscript", @@ -3771,7 +3771,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3789,7 +3789,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3807,12 +3807,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "flate2", "hayro-ccitt", @@ -4795,7 +4795,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4952,7 +4952,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=db0b5931e2855ef86b4ab0a4de77fb4f82ee810e#db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" +source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" dependencies = [ "arrayvec", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index 7ffa6409eb..c00cdc10bf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,46 +11,46 @@ rust-version = "1.95" repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } # The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON. -craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } # `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile. -craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e", features = ["pcraft-pixels"] } +craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3", features = ["pcraft-pixels"] } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } # The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names # the members it imports. -craft = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } # Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui # without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes. -craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } @@ -193,13 +193,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } emath = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } epaint = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index 3d626ea472..6947954a79 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -27,7 +27,7 @@ log = { workspace = true } # `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback. eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] } # The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft. -craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/crates/ui-egui/src/panel_docking.rs b/crates/ui-egui/src/panel_docking.rs index 451bb131cc..74a5586b04 100644 --- a/crates/ui-egui/src/panel_docking.rs +++ b/crates/ui-egui/src/panel_docking.rs @@ -226,20 +226,23 @@ fn settle(app: &mut VectorcraftApp) { /// last pass left it, and Presentation Mode is off? With no window yet nothing hides them. pub(crate) fn panels_shown(app: &VectorcraftApp) -> bool { let chrome = app.ui_ctx.as_ref().map(|ctx| chrome_state(ctx, egui::ViewportId::ROOT)).unwrap_or_default(); - !chrome.hidden && !chrome.panels_hidden && app.ui.screen_mode < 3 + !chrome.hidden && !chrome.chrome_hidden && !chrome.panels_hidden && app.ui.screen_mode < 3 } /// Whether Tab hides the main window's panels, toolbars and Control bar (Shift+Tab leaves the /// toolbars). pub(crate) fn tab_hidden(app: &VectorcraftApp) -> bool { - app.ui_ctx.as_ref().is_some_and(|ctx| chrome_state(ctx, egui::ViewportId::ROOT).hidden) + app.ui_ctx.as_ref().is_some_and(|ctx| { + let chrome = chrome_state(ctx, egui::ViewportId::ROOT); + chrome.hidden || chrome.chrome_hidden + }) } /// Ends Tab and Shift+Tab hiding the panels in the main window; nothing while they show. pub(crate) fn show_panels(app: &VectorcraftApp) { let Some(ctx) = &app.ui_ctx else { return }; let chrome = chrome_state(ctx, egui::ViewportId::ROOT); - if chrome.hidden || chrome.panels_hidden { + if chrome.hidden || chrome.chrome_hidden || chrome.panels_hidden { request_chrome_toggle(ctx, egui::ViewportId::ROOT, ChromeToggle::ShowPanels); } } diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index 2bac79d96d..29758d7de0 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "db0b5931e2855ef86b4ab0a4de77fb4f82ee810e"; +const REV: &str = "57c8c8d48819e98d483e65a623c1a1b77a7091d3"; const PACKAGES: &[(&str, &str, &str)] = &[ ("craft-pdf", "0.1.0", REV), ("krilla", "0.8.2", REV), From de7f1fc144f5015dfd2d4caf8b2de3bc79e006b1 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 00:07:51 -0800 Subject: [PATCH 35/61] New Document: a test checks that a typed Artboards count keeps the preset until committed Artboards is the one numeric field in Preset Details without a cancel test. The new test types a count over the preset's 5, checks that the dialog still shows the preset and its settings, presses Escape, and creates the document with the preset's settings. --- crates/ui-egui/src/dialogs/new_document.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/ui-egui/src/dialogs/new_document.rs b/crates/ui-egui/src/dialogs/new_document.rs index 8e770d3da7..0723f554c0 100644 --- a/crates/ui-egui/src/dialogs/new_document.rs +++ b/crates/ui-egui/src/dialogs/new_document.rs @@ -980,6 +980,10 @@ mod tests { canceled_detail_number("Height", "150"); } #[test] + fn canceled_new_document_artboards_preserve_preset() { + canceled_detail_number("Artboards", "3"); + } + #[test] fn canceled_new_document_bleed_preserves_preset() { canceled_detail_number("Top", "3"); } From 452bf2013d796b6245a6799a00e7833b59c2f76d Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sun, 29 Nov 2026 09:34:32 +0100 Subject: [PATCH 36/61] Constrain the paragraph Tabs action row to the form width Wrap the action buttons against the offered form width. Keep the accessibility lookup and pointer-click regression at both viewport sizes, and assert that the click target is inside the viewport. --- crates/ui-egui/src/dialogs/para_style_options.rs | 4 +++- crates/ui-egui/src/dialogs/para_style_options/tests.rs | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/dialogs/para_style_options.rs b/crates/ui-egui/src/dialogs/para_style_options.rs index 8522ee741c..609fca1dce 100644 --- a/crates/ui-egui/src/dialogs/para_style_options.rs +++ b/crates/ui-egui/src/dialogs/para_style_options.rs @@ -609,7 +609,9 @@ fn tabs_buttons(unit: Unit) -> Param { let (rows, _, _) = tab_rows(fields); let can_add = new_tab_position(&rows, unit).is_some(); let (mut add, mut delete, mut clear) = (false, false, false); - let line = Row::new().wrap(true).show(ui, |ui, _| { + // Wrap against the form's offered width rather than measuring an intrinsic-width + // strip that may be clipped by the property group on small screens. + let line = Row::new().fill_width().wrap(true).show(ui, |ui, _| { add = clicked(&Button::new(tl!("Add")).enabled(can_add).show(ui)); delete = clicked(&Button::new(tl!("Delete Tab")).enabled(!rows.is_empty()).show(ui)); clear = clicked(&Button::new(tl!("Clear All Tabs")).enabled(!rows.is_empty()).show(ui)); diff --git a/crates/ui-egui/src/dialogs/para_style_options/tests.rs b/crates/ui-egui/src/dialogs/para_style_options/tests.rs index 22802313ce..39d26bfb1a 100644 --- a/crates/ui-egui/src/dialogs/para_style_options/tests.rs +++ b/crates/ui-egui/src/dialogs/para_style_options/tests.rs @@ -576,9 +576,13 @@ fn clear_all_tabs_can_be_clicked_in_a_narrow_viewport() { } let out = frame(&mut app, vec![]); let nodes = out.platform_output.accesskit_update.unwrap().nodes; - let clear = nodes.iter().find(|(_, node)| node.role() == Role::Button && node.label() == Some("Clear All Tabs")).unwrap(); + let clear = nodes + .iter() + .find(|(_, node)| node.role() == Role::Button && node.label() == Some("Clear All Tabs")) + .unwrap_or_else(|| panic!("Clear All Tabs is missing at {width} points")); let bounds = clear.1.bounds().unwrap(); let at = pos2(((bounds.x0 + bounds.x1) * 0.5) as f32, ((bounds.y0 + bounds.y1) * 0.5) as f32); + assert!(screen.contains(at), "Clear All Tabs at {bounds:?} is outside the {width}-point viewport"); assert_eq!(tab_rows(&app).len(), 2); frame(&mut app, vec![Event::PointerMoved(at)]); From b0f821f2db7378632b03b785ce1f3807d29ce4cb Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 00:39:56 -0800 Subject: [PATCH 37/61] Graph Type: test that typed numbers and text reach the draft only on commit The Column Width and Prefix rows write the draft only when their edit is committed. The existing dialog test still passed with either row reading every proposal while typing, so a new test types into each row, checks that the draft keeps its value, then presses Tab and checks that the typed value is in the draft. --- crates/ui-egui/src/dialogs/graph_type.rs | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/crates/ui-egui/src/dialogs/graph_type.rs b/crates/ui-egui/src/dialogs/graph_type.rs index 962b569dd7..1d75fd7b97 100644 --- a/crates/ui-egui/src/dialogs/graph_type.rs +++ b/crates/ui-egui/src/dialogs/graph_type.rs @@ -1219,6 +1219,40 @@ mod tests { } } + /// A number or text row leaves the draft alone while its text is still being typed, and writes + /// the typed value once Tab commits it. + #[test] + fn typed_number_and_text_rows_reach_the_draft_only_when_committed() { + use crate::tests::panel_harness::Panel; + use craft::ui::contract::Role; + use egui::{Key, Modifiers}; + + let mut app = app_with_graph("column"); + app.run(COMMAND, json!({"columnWidth": 80, "prefix": "USD"})).unwrap(); + let mut panel = Panel::new(app, crate::tests::picks::dialogs); + panel.room(egui::vec2(900.0, 900.0)); + open(&mut panel.app()).unwrap(); + panel.frame(); + panel.click_role("Column Width", Role::SPIN_BUTTON); + panel.key(Key::A, Modifiers::COMMAND); + panel.type_text("140"); + panel.frame(); + assert_eq!(field(&panel.app(), "columnWidth"), json!(80.0), "a number being typed is not in the draft"); + panel.key(Key::Tab, Modifiers::NONE); + panel.frame(); + assert_eq!(field(&panel.app(), "columnWidth"), json!(140.0), "Tab commits the typed number"); + set(&panel.app(), PAGE, json!("valueAxis")).unwrap(); + panel.frame(); + panel.click_role("Prefix", Role::TEXT_INPUT); + panel.key(Key::A, Modifiers::COMMAND); + panel.type_text("EUR"); + panel.frame(); + assert_eq!(field(&panel.app(), "prefix"), json!("USD"), "text being typed is not in the draft"); + panel.key(Key::Tab, Modifiers::NONE); + panel.frame(); + assert_eq!(field(&panel.app(), "prefix"), json!("EUR"), "Tab commits the typed text"); + } + /// Object › Graph › Type… opens the dialog on the selected graph's options, on its Graph /// Options page; each page the type has can be shown, and Override Calculated Values of the /// right axis takes input only while that axis has a scale of its own. From 4b7ac6969205008150daad4751e8f5ba39cf9d53 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 00:42:20 -0800 Subject: [PATCH 38/61] Scripts: fix path handles after main's revert count and review findings on path edits PathItem handles carry the document's revert count, as page item handles on main do, so path members find their path again. setEntirePath and the path point setters throw a RangeError for a point off the canvas. Opening a path whose closing segment is selected keeps the edit. pathItems.add() leaves new art's paint as it was with New Art Has Basic Appearance off. addDocument reports settings the built-in preset refuses. appearance.setNewArt refuses a swatch that is not a name. Writing one path's points looks only at that path afterwards. --- crates/engine/src/cmd/newart.rs | 3 + crates/engine/src/script/dom.rs | 32 +++++-- crates/engine/src/script/dom/paths.rs | 93 ++++++++++++++------- crates/engine/src/tests/newart.rs | 10 +++ crates/engine/src/tests/script_dom.rs | 5 ++ crates/engine/src/tests/script_dom_paths.rs | 60 +++++++++++++ 6 files changed, 164 insertions(+), 39 deletions(-) diff --git a/crates/engine/src/cmd/newart.rs b/crates/engine/src/cmd/newart.rs index f9563ee886..c7398db1da 100644 --- a/crates/engine/src/cmd/newart.rs +++ b/crates/engine/src/cmd/newart.rs @@ -116,6 +116,9 @@ fn set_new_art(s: &mut Session, p: &Value) -> Result { if !v.is_object() { return Err(bad(C, format!("{key} must be a paint object (color, none, swatch or gradient), got {v}"))); } + if v.get("swatch").is_some_and(|w| !w.is_string()) { + return Err(bad(C, format!("{key}: `swatch` must be a swatch name"))); + } let pattern_only = |name: &str| s.doc().is_ok_and(|st| st.doc.swatch(name).is_none() && st.doc.pattern(name).is_some()); if v.get("tint").is_some() && v.get("swatch").and_then(Value::as_str).is_none_or(pattern_only) { return Err(bad(C, format!("{key}: `tint` goes with a global or spot `swatch`"))); diff --git a/crates/engine/src/script/dom.rs b/crates/engine/src/script/dom.rs index db83366b2c..facf010415 100644 --- a/crates/engine/src/script/dom.rs +++ b/crates/engine/src/script/dom.rs @@ -115,6 +115,9 @@ mod colors; mod defaults; mod paths; +#[cfg(test)] +pub(crate) use paths::POINT_LOOKS; + /// The error for a member read or called with no document open. pub const NO_ACTIVE_DOCUMENT: &str = "No active document"; /// The error for an object that was deleted, or that came from an earlier run. @@ -185,9 +188,12 @@ pub(super) struct State { /// How many times the points the run read of each path went stale, by document uid and path id /// ([`paths`]). point_cuts: RefCell>, - /// Each path whose points the run read, as the run last saw it, by document uid and path id - /// ([`paths`]). - point_nodes: RefCell>>, + /// Each path whose points the run read, as the run last saw it, by document uid and then path + /// id ([`paths`]). + point_nodes: RefCell>>>, + /// The path whose points the object model is writing with `path.setAnchors`, the only path + /// that command changes ([`paths`]). + one_path: Cell>, /// Each document, by uid, as it was when the run last looked at all the paths in it whose /// points it read ([`paths`]). point_docs: RefCell>>, @@ -741,6 +747,12 @@ fn restore_selection(h: &Host, doc: &Document, before: &crate::doc::Selection) - return Ok(()); } let partial = |id: &NodeId| before.anchors.contains_key(id) || before.segments.contains_key(id); + // Anchors and segments the change removed (a path opened or given fewer points) are left out. + let left = |id: &NodeId, p: usize, test: &dyn Fn(&vectorcraft_geom::path::SubPath) -> bool| { + doc.node(*id).and_then(|n| n.path_data()).is_some_and(|pd| pd.subpaths.get(p).is_some_and(test)) + }; + let anchor_left = |id: &NodeId, p: usize, k: usize| left(id, p, &|sp| k < sp.anchors.len()); + let segment_left = |id: &NodeId, p: usize, k: usize| left(id, p, &|sp| sp.has_segment(k, true)); let kept: Vec = before.objects.iter().copied().filter(keep).collect(); if kept.is_empty() { command(h, "select.none", &json!({}))?; @@ -753,7 +765,7 @@ fn restore_selection(h: &Host, doc: &Document, before: &crate::doc::Selection) - .iter() .map(|i| { let anchors: Vec<[usize; 2]> = match before.anchors.get(i) { - Some(a) => a.iter().map(|(p, k)| [*p, *k]).collect(), + Some(a) => a.iter().filter(|(p, k)| anchor_left(i, *p, *k)).map(|(p, k)| [*p, *k]).collect(), // A path with only segments selected gets them back below, with no anchors. None if before.segments.contains_key(i) => Vec::new(), None => doc.node(*i).and_then(|n| n.path_data()).map(|p| p.anchors().map(|(s, k, _)| [s, k]).collect()).unwrap_or_default(), @@ -764,7 +776,10 @@ fn restore_selection(h: &Host, doc: &Document, before: &crate::doc::Selection) - command(h, "select.anchorsMany", &json!({"items": items, "mode": "set"}))?; } for (i, segments) in before.segments.iter().filter(|(i, _)| keep(i)) { - let segments: Vec<[usize; 2]> = segments.iter().map(|(p, k)| [*p, *k]).collect(); + let segments: Vec<[usize; 2]> = segments.iter().filter(|(p, k)| segment_left(i, *p, *k)).map(|(p, k)| [*p, *k]).collect(); + if segments.is_empty() { + continue; + } command(h, "select.segments", &json!({"id": i.0, "segments": segments, "mode": "add"}))?; } let guides: Vec = doc.ruler_guides().into_iter().filter_map(|g| g.id).collect(); @@ -1366,13 +1381,12 @@ fn docs_add_document(h: &Host, a: &[Data]) -> Answer { } // The document starts from the first built-in preset of the profile's category (Print: // Letter) with `presetSettings` over it, given in full so that a saved preset of the same name - // does not stand in for it. Settings `file.new` refuses are left for it to report. + // does not stand in for it. Settings the built-in preset refuses are an error. let first = profile.and_then(|n| crate::cmd::newdoc::category(&h.session.borrow(), n)?.into_iter().next()); if let Some(first) = first { p.insert("preset".into(), json!(first.name)); - if let Ok(full) = first.with_params(&Value::Object(p.clone()), "file.new") - && let Value::Object(settings) = full.to_json() - { + let full = first.with_params(&Value::Object(p.clone()), "file.new").map_err(|e| HostError::Error(e.to_string()))?; + if let Value::Object(settings) = full.to_json() { for key in BUILT_IN_SETTINGS { if let Some(v) = settings.get(*key) { p.insert((*key).into(), v.clone()); diff --git a/crates/engine/src/script/dom/paths.rs b/crates/engine/src/script/dom/paths.rs index 356afe8b99..e9510871c4 100644 --- a/crates/engine/src/script/dom/paths.rs +++ b/crates/engine/src/script/dom/paths.rs @@ -136,8 +136,11 @@ fn read_path(h: &super::Host, item: Item, f: impl FnOnce(&DocState, &crate::d } fn path_ref(h: &super::Host, item: Item) -> Data { - let [high, low] = id_parts(item.id); - host_ref("PathItem", &[float(h.run), float(item.doc.uid), high, low]) + let s = h.session.borrow(); + match s.documents().iter().find(|d| d.uid == item.doc.uid) { + Some(st) => host_ref("PathItem", &super::node_handle(h, st, item.id)), + None => Data::Null, + } } /// The index of the first point of each subpath of `subs`, followed by the number of points. @@ -309,7 +312,12 @@ pub(super) fn flush(h: &super::Host) -> std::result::Result<(), HostError> { } let subpaths: Vec = subs.iter().map(|sp| json!({"anchors": sp.anchors.iter().map(anchor_json).collect::>(), "closed": sp.closed})).collect(); - edit_item(h, item, "path.setAnchors", &json!({"id": item.id.0, "subpaths": subpaths}))?; + // Changes made before this one are looked at in full first. + see_all_points(h); + let kept = h.dom.one_path.replace(Some(item)); + let r = edit_item(h, item, "path.setAnchors", &json!({"id": item.id.0, "subpaths": subpaths})); + h.dom.one_path.set(kept); + r?; Ok(()) } @@ -605,20 +613,25 @@ fn items_star(h: &super::Host, a: &[Data]) -> Answer { /// `pathItems.add()`: a path with no points on top of the active layer, from `path.create` with /// empty path data, painted as new art. When new art has no fill and no stroke, the black stroke `path.create` gives an open -/// path is set back to none in the same step. +/// path is set back to none in the same step, and new art keeps the paint it had before. fn items_add(h: &super::Host, a: &[Data]) -> Answer { let doc = items_doc(h, a)?; - let made = on_doc(h, doc.uid, true, |h| { - let unpainted = { - let ap = h.session.borrow().new_art(); - ap.fill_paint().is_none() && ap.stroke_paint().is_none() - }; - let id = made_id(&drawing_normally(h, || command_value(h, "path.create", &json!({"d": ""})))?.1)?; - if unpainted { - keeping_paint(h, || command(h, "paint.setStroke", &json!({"none": true, "ids": [id.0]})))?; - } - Ok(id) - })?; + let add = |h: &super::Host, unpainted: bool| { + on_doc(h, doc.uid, true, |h| { + let id = made_id(&drawing_normally(h, || command_value(h, "path.create", &json!({"d": ""})))?.1)?; + if unpainted { + command(h, "paint.setStroke", &json!({"none": true, "ids": [id.0]}))?; + } + Ok(id) + }) + }; + let unpainted = { + let ap = h.session.borrow().new_art(); + ap.fill_paint().is_none() && ap.stroke_paint().is_none() + }; + // Selecting the new path loads its temporary stroke into new art, and putting the selection + // back does not undo that, so new art's paint from before the path is put back. + let made = if unpainted { keeping_paint(h, || add(h, true))? } else { add(h, false)? }; let s = h.session.borrow(); let st = s.documents().iter().find(|d| d.uid == doc.uid).ok_or_else(|| HostError::Error(super::STALE_DOCUMENT.into()))?; Ok(super::item_ref(h, st, made)) @@ -746,7 +759,8 @@ fn path_set_entire(h: &super::Host, a: &[Data]) -> Answer { let f = with_doc(h, item.doc, |_, st| frame(st))?; let closed = read_points(h, item, |subs| !subs.is_empty() && subs.iter().all(|sp| sp.closed))?; let c = h.dom.coords.get(); - let anchors: Vec = script.iter().map(|p| Anchor::corner(f.to_document(c, *p))).collect(); + let anchors: Vec = + script.iter().map(|p| on_canvas(f.to_document(c, *p), "each point").map(Anchor::corner)).collect::>()?; let subs = if anchors.is_empty() { Vec::new() } else { vec![SubPath::new(anchors, closed)] }; write_path(h, item, subs)?; cut_points(h, item); @@ -1251,6 +1265,12 @@ fn cut_key(h: &super::Host, key: (u64, u64)) { *n = n.saturating_add(1); } +#[cfg(test)] +thread_local! { + /// How many times this thread looked at a path's points ([`see_points`]), for the tests. + pub(crate) static POINT_LOOKS: std::cell::Cell = const { std::cell::Cell::new(0) }; +} + /// The node of `id` in `d`, as the document holds it. fn node_arc(d: &crate::Document, id: NodeId) -> Option<&Arc> { let at = d.index_path(id)?; @@ -1269,6 +1289,8 @@ fn node_arc(d: &crate::Document, id: NodeId) -> Option<&Arc> { /// the document, so a node whose pointer is unchanged has unchanged points, and any change to it /// makes a new node. fn see_points(h: &super::Host, key: (u64, u64), own: impl FnOnce() -> bool) { + #[cfg(test)] + POINT_LOOKS.with(|n| n.set(n.get() + 1)); let node = { let s = h.session.borrow(); s.documents().iter().find(|d| d.uid == key.0).and_then(|st| node_arc(&st.doc, NodeId(key.1)).cloned()) @@ -1276,12 +1298,12 @@ fn see_points(h: &super::Host, key: (u64, u64), own: impl FnOnce() -> bool) { // A path that is gone makes its points stale, so that an undo that brings it back leaves them // stale. let Some(node) = node else { - if h.dom.point_nodes.borrow_mut().remove(&key).is_some() { + if h.dom.point_nodes.borrow_mut().get_mut(&key.0).and_then(|paths| paths.remove(&key.1)).is_some() { cut_key(h, key); } return; }; - let changed = match h.dom.point_nodes.borrow_mut().insert(key, node.clone()) { + let changed = match h.dom.point_nodes.borrow_mut().entry(key.0).or_default().insert(key.1, node.clone()) { Some(old) => !Arc::ptr_eq(&old, &node) && old.path_data().map(|pd| &pd.subpaths) != node.path_data().map(|pd| &pd.subpaths), None => false, }; @@ -1294,34 +1316,35 @@ fn see_points(h: &super::Host, key: (u64, u64), own: impl FnOnce() -> bool) { /// change that a later command reverses still makes the points stale. Paths under the object that /// the object model is changing ([`super::State`]), or that object itself, take the change as the /// object model's own, and their points stay valid. A document that is the one the run last looked -/// at is skipped, as are its paths. +/// at is skipped, as are its paths. While the object model writes one path's points +/// ([`super::State`]'s `one_path`), only that path is looked at in its document. pub(super) fn see_all_points(h: &super::Host) { let keys: Vec<(u64, u64)> = { let seen = h.dom.point_nodes.borrow(); - if seen.is_empty() { + if seen.values().all(|paths| paths.is_empty()) { return; } let s = h.session.borrow(); let mut docs = h.dom.point_docs.borrow_mut(); + let one = h.dom.one_path.get(); + let mut keys = Vec::new(); // The documents that changed since the last look, kept as they are now. - let mut changed = std::collections::HashSet::new(); - for (uid, _) in seen.keys() { - if changed.contains(uid) { - continue; - } + for (uid, paths) in seen.iter().filter(|(_, paths)| !paths.is_empty()) { match s.documents().iter().find(|d| d.uid == *uid) { - Some(st) if docs.get(uid).is_some_and(|d| Arc::ptr_eq(d, &st.doc)) => {} + Some(st) if docs.get(uid).is_some_and(|d| Arc::ptr_eq(d, &st.doc)) => continue, Some(st) => { docs.insert(*uid, st.doc.clone()); - changed.insert(*uid); } None => { docs.remove(uid); - changed.insert(*uid); } } + match one { + Some(item) if item.doc.uid == *uid => keys.extend(paths.contains_key(&item.id.0).then_some((*uid, item.id.0))), + _ => keys.extend(paths.keys().map(|id| (*uid, *id))), + } } - seen.keys().copied().filter(|(uid, _)| changed.contains(uid)).collect() + keys }; let editing = h.dom.editing.get(); for (uid, id) in keys { @@ -1439,7 +1462,17 @@ fn assigned_point(h: &super::Host, a: &[Data], what: &str) -> std::result::Resul let p = point(arg(a, 1), what)?; let (item, _) = this_point(h, a)?; let fr = with_doc(h, item.doc, |_, st| frame(st))?; - Ok(fr.to_document(h.dom.coords.get(), p)) + on_canvas(fr.to_document(h.dom.coords.get(), p), what) +} + +/// `p`, a point a script gave in document coordinates, when it is on the canvas (within +/// [`crate::MAX_COORD`] of the origin); a `RangeError` otherwise. +fn on_canvas(p: Point, what: &str) -> std::result::Result { + if p.x.is_finite() && p.y.is_finite() && p.x.abs() <= crate::MAX_COORD && p.y.abs() <= crate::MAX_COORD { + Ok(p) + } else { + Err(HostError::Range(format!("{what} is outside the canvas"))) + } } fn pt_anchor(h: &super::Host, a: &[Data]) -> Answer { diff --git a/crates/engine/src/tests/newart.rs b/crates/engine/src/tests/newart.rs index e92ac41e19..a19f5ff6ab 100644 --- a/crates/engine/src/tests/newart.rs +++ b/crates/engine/src/tests/newart.rs @@ -448,6 +448,16 @@ fn set_new_art_refuses_a_tint_on_a_pattern_without_a_swatch_entry() { assert_eq!(run(&mut s, "appearance.setNewArt", json!({"fill": {"swatch": name}})), json!({"changed": true})); } +#[test] +fn set_new_art_refuses_a_swatch_that_is_not_a_name() { + let mut s = session(); + let before = s.paint.clone(); + for p in [json!({"fill": {"swatch": 7, "color": "#ff0000"}}), json!({"stroke": {"swatch": null, "color": "#ff0000"}})] { + assert!(s.execute("appearance.setNewArt", &p).is_err(), "accepted {p}"); + assert_eq!(s.paint, before, "{p} changed new art"); + } +} + #[test] fn set_new_art_refuses_while_new_art_takes_the_selected_look() { let mut s = session(); diff --git a/crates/engine/src/tests/script_dom.rs b/crates/engine/src/tests/script_dom.rs index 05a7e8cf10..15a1ee1320 100644 --- a/crates/engine/src/tests/script_dom.rs +++ b/crates/engine/src/tests/script_dom.rs @@ -1504,6 +1504,11 @@ fn document_preset_applies_only_its_given_fields() { assert!(e.contains(part), "{source}: {e}"); } assert_eq!(s.documents().len(), 2, "a refused preset makes no document"); + // A saved preset with the built-in preset's name does not make the refused settings fit. + s.execute("file.newPresets.save", &json!({"name": "Letter", "artboardLayout": "column"})).unwrap(); + let e = failure(&mut s, "var p = new DocumentPreset(); p.width = 1000000; p.numArtboards = 5; app.documents.addDocument('Print', p);"); + assert!(e.contains("don't fit"), "{e}"); + assert_eq!(s.documents().len(), 2, "settings the built-in preset refuses make no document"); } #[test] diff --git a/crates/engine/src/tests/script_dom_paths.rs b/crates/engine/src/tests/script_dom_paths.rs index ce088ea01c..fe02779654 100644 --- a/crates/engine/src/tests/script_dom_paths.rs +++ b/crates/engine/src/tests/script_dom_paths.rs @@ -194,6 +194,21 @@ fn hostile_set_entire_path_input_is_bounded() { assert_eq!(art(&s), before); } +#[test] +fn points_off_the_canvas_throw_where_they_are_given() { + let (mut s, _, _) = doc(); + let before = art(&s); + for source in [ + "app.activeDocument.pathItems[0].setEntirePath([[0, 0], [7000000, 1]]);", + "app.activeDocument.pathItems[0].pathPoints[0].anchor = [7000000, 1];", + "app.activeDocument.pathItems[0].pathPoints[0].leftDirection = [1, -7000000];", + ] { + let out = log(&mut s, &format!("try {{ {source} vc.log('kept'); }} catch (e) {{ vc.log(e.name); }}")); + assert_eq!(out, vec![json!("RangeError")], "{source}"); + assert_eq!(art(&s), before, "{source}"); + } +} + #[test] fn path_point_setters_edit_one_anchor() { let (mut s, a, _) = doc(); @@ -524,6 +539,24 @@ fn many_point_edits_run_one_command() { assert_eq!(undo_steps(&s), steps + 1); } +#[test] +fn editing_one_point_on_each_of_many_paths_looks_at_each_path_a_few_times() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + for i in 0..300 { + rect(&mut s, f64::from(i % 30) * 10.0, f64::from(i / 30) * 10.0, 5.0, 5.0); + } + s.execute("select.none", &json!({})).unwrap(); + let start = crate::script::dom::POINT_LOOKS.with(|n| n.get()); + log( + &mut s, + "var ps = app.activeDocument.pathItems;\ + for (var i = 0; i < ps.length; i++) { var q = ps[i].pathPoints[0]; var a = q.anchor; q.anchor = [a[0] + 1, a[1]]; }", + ); + let looks = crate::script::dom::POINT_LOOKS.with(|n| n.get()) - start; + assert!(looks < 3000, "{looks} looks at paths for 300 one-point edits"); +} + #[test] fn point_edits_are_written_before_the_next_other_member_reads() { let (mut s, a, _) = doc(); @@ -706,6 +739,19 @@ fn an_added_path_takes_new_art_without_a_fill_or_stroke() { assert_eq!(out, [json!(false), json!(true), json!(255)], "a new-art stroke stays"); } +#[test] +fn an_added_path_leaves_new_art_unpainted_with_basic_appearance_off() { + let (mut s, _, _) = doc(); + s.execute("paint.setFill", &json!({"none": true})).unwrap(); + s.execute("paint.setStroke", &json!({"none": true})).unwrap(); + s.prefs.new_art_basic = false; + let paint = s.paint.clone(); + let out = log(&mut s, "var n = app.activeDocument.pathItems.add(); vc.log(n.stroked);"); + assert_eq!(out, [json!(false)]); + assert!(s.active().unwrap().selection.is_empty()); + assert_eq!(s.paint, paint, "new art keeps no fill and no stroke"); +} + /// [`doc`] with pattern `Dots` and spot swatch `Ink`, and path `a` with no fill or stroke. fn doc_with_paints() -> (Session, NodeId) { let (mut s, a, _) = doc(); @@ -1093,6 +1139,20 @@ fn path_point_selected_refuses_handles_bad_values_and_locked_paths() { assert!(s.active().unwrap().selection.is_empty()); } +#[test] +fn opening_a_path_with_its_closing_segment_selected_keeps_the_edit() { + let (mut s, a, b) = doc(); + s.execute("select.segments", &json!({"id": a.0, "segments": [[0, 3]], "mode": "set"})).unwrap(); + s.execute("select.segments", &json!({"id": b.0, "segments": [[0, 0], [0, 3]], "mode": "add"})).unwrap(); + log(&mut s, "var p = app.activeDocument.pathItems; p[0].closed = false; p[1].closed = false;"); + for id in [a, b] { + assert!(!node(&s, id).path_data().unwrap().subpaths[0].closed, "{id:?} stayed closed"); + } + let sel = &s.active().unwrap().selection; + assert_eq!(sel.segments.get(&b).map(|g| g.iter().copied().collect::>()), Some(vec![(0, 0)])); + assert!(sel.segments.get(&a).is_none_or(|g| g.is_empty()), "{:?}", sel.segments); +} + /// The ways an editable path cannot be selected: on a locked artboard, and outside the isolated /// object. const UNSELECTABLE: [&str; 2] = ["locked artboard", "isolation"]; From b0b10c610963f9b6cd44fb1df5b4a94840a38bf2 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 00:46:50 -0800 Subject: [PATCH 39/61] Panels: tests compare the menu rows' flags now that rows are named Four tests compared a panel menu row's whole state with one that had no name, and failed once the rows were named: the Symbols view rows, the Paragraph composer rows, the Links panel's Select rows and OpenType's Reset row. They now compare the enabled and checked flags, or the state with its name. The Links test also checks each Select row's Shift alternate. Two lines in Align and CSS Properties are split to fit the 150-column width. --- .../src/addons/select/link_status/tests.rs | 22 ++++++++++++------- crates/ui-egui/src/panels/align.rs | 3 ++- crates/ui-egui/src/panels/css_properties.rs | 3 ++- crates/ui-egui/src/panels/opentype.rs | 2 +- crates/ui-egui/src/panels/paragraph/tests.rs | 6 +++-- crates/ui-egui/src/panels/symbols/tests.rs | 2 +- 6 files changed, 24 insertions(+), 14 deletions(-) diff --git a/crates/ui-egui/src/addons/select/link_status/tests.rs b/crates/ui-egui/src/addons/select/link_status/tests.rs index 1dfbc67c40..dd1c374021 100644 --- a/crates/ui-egui/src/addons/select/link_status/tests.rs +++ b/crates/ui-egui/src/addons/select/link_status/tests.rs @@ -178,14 +178,20 @@ fn menu_items_are_on_for_the_statuses_present_and_shift_adds() { { assert_eq!(item(label).enabled, on, "{label}"); } - // The Links panel's rows follow the statuses present, per status. - let enabled_of = |app: &VectorcraftApp| { + // The Links panel's rows follow the statuses present, per status, and each row and its Shift alternate is named + // for its status. + let enabled_of = |app: &VectorcraftApp, shift: bool| { let mut all = CommandStates::new(); states(app, &mut all); - STATUSES.map(|(status, ..)| all.get(&CommandRef::with_params(COMMAND, json!({ "status": status }))).cloned()) + STATUSES.map(|(status, ..)| { + let p = json!({ "status": status }); + all.get(&CommandRef::with_params(COMMAND, if shift { with_shift(p) } else { p })).cloned() + }) }; - let on = Some(CommandState::new().enabled(true)); - assert_eq!(enabled_of(&app), [on.clone(), on.clone(), on.clone(), Some(CommandState::new().enabled(false))]); + let named = |on: bool, label: &str| Some(CommandState::new().enabled(on).title(label)); + let want = [named(true, "Select Linked"), named(true, "Select Embedded"), named(true, "Select Missing"), named(false, "Select Modified")]; + assert_eq!(enabled_of(&app, false), want); + assert_eq!(enabled_of(&app, true), want, "the Shift alternates"); // The item's params run as the menu runs them: Shift's alternate is `with_shift` of them. let run = |app: &mut VectorcraftApp, status: &str, shift: bool| { let p = json!({ "status": status }); @@ -207,9 +213,9 @@ fn menu_items_are_on_for_the_statuses_present_and_shift_adds() { app.run("select.set", json!({"ids": [harbour]})).unwrap(); app.run("edit.clear", json!({})).unwrap(); refresh(&mut app, 1.0); - let after = enabled_of(&app); - assert_eq!(after[2], Some(CommandState::new().enabled(false)), "no missing image is left"); - assert_eq!(after[1], on, "the embedded one stays"); + let after = enabled_of(&app, false); + assert_eq!(after[2], named(false, "Select Missing"), "no missing image is left"); + assert_eq!(after[1], named(true, "Select Embedded"), "the embedded one stays"); } /// A missing link kept only in a symbol's art can't be selected: Select Missing stays off and diff --git a/crates/ui-egui/src/panels/align.rs b/crates/ui-egui/src/panels/align.rs index 1eeb293edc..65d777899d 100644 --- a/crates/ui-egui/src/panels/align.rs +++ b/crates/ui-egui/src/panels/align.rs @@ -605,7 +605,8 @@ pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { let prefs = &app.session.prefs; states.set(CommandRef::new("ui.align.hideOptions"), CommandState::new().title(if hidden { tl!("Show Options") } else { tl!("Hide Options") })); states.set(CommandRef::new("ui.align.usePreviewBounds"), CommandState::new().checked(prefs.use_preview_bounds).title(tl!("Use Preview Bounds"))); - states.set(CommandRef::new("ui.align.cancelKeyObject"), CommandState::new().enabled(align_to(app) == AlignTo::Key).title(tl!("Cancel Key Object"))); + let cancel = CommandState::new().enabled(align_to(app) == AlignTo::Key).title(tl!("Cancel Key Object")); + states.set(CommandRef::new("ui.align.cancelKeyObject"), cancel); // The key choice is named for what the key is: Align to Key Anchor while it is an anchor point. let key = CommandState::new().enabled(can_choose(app, AlignTo::Key)).checked(shown_align_to(app) == AlignTo::Key); states.set(CommandRef::new("align.toKeyObject"), key.title(align_to_icon_name(AlignTo::Key, key_is_anchor(app)).1)); diff --git a/crates/ui-egui/src/panels/css_properties.rs b/crates/ui-egui/src/panels/css_properties.rs index d076d8a515..13743fb641 100644 --- a/crates/ui-egui/src/panels/css_properties.rs +++ b/crates/ui-egui/src/panels/css_properties.rs @@ -293,7 +293,8 @@ pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { states.set(units_ref(units), CommandState::new().checked(panel.options.units == units).title(units.name())); } let mut options = panel.options.clone(); - for (name, label) in FLAGS.into_iter().zip([tl!("Absolute Position"), tl!("Width and Height"), tl!("Unnamed Objects"), tl!("Rasterize Unsupported Art")]) { + let labels = [tl!("Absolute Position"), tl!("Width and Height"), tl!("Unnamed Objects"), tl!("Rasterize Unsupported Art")]; + for (name, label) in FLAGS.into_iter().zip(labels) { let on = flag_mut(&mut options, name).is_some_and(|on| *on); states.set(option_ref(name), CommandState::new().checked(on).title(label)); } diff --git a/crates/ui-egui/src/panels/opentype.rs b/crates/ui-egui/src/panels/opentype.rs index 41788bfded..8715d02401 100644 --- a/crates/ui-egui/src/panels/opentype.rs +++ b/crates/ui-egui/src/panels/opentype.rs @@ -872,7 +872,7 @@ mod tests { assert_eq!(text_style(&app).unwrap().0.features, ["smcp"]); app.session.execute("select.set", &json!({"ids": []})).unwrap(); assert!(!menu_rows(&app).iter().any(|row| matches!(row, PanelRow::Submenu(..))), "the submenu is left out with no text selected"); - assert_eq!(state_of(&app, &CommandRef::new(RESET)), Some(CommandState::new().enabled(false))); + assert_eq!(state_of(&app, &CommandRef::new(RESET)), Some(CommandState::new().enabled(false).title("Reset OpenType Features"))); assert_eq!(run(&mut app, "ui.openType.nothing", &json!({})), None); } diff --git a/crates/ui-egui/src/panels/paragraph/tests.rs b/crates/ui-egui/src/panels/paragraph/tests.rs index 5a589acd8e..75310b3f35 100644 --- a/crates/ui-egui/src/panels/paragraph/tests.rs +++ b/crates/ui-egui/src/panels/paragraph/tests.rs @@ -10,9 +10,11 @@ fn selected(app: &VectorcraftApp) -> Vec { row.map(|r| r.0).into_iter().collect() } -/// Whether `states` holds `r` with exactly the state `state(enabled, checked)` makes. +/// Whether `states` holds `r` with the enabled and checked flags `state(enabled, checked)` makes. The row's name is +/// checked in `tests_menu_names`. fn has_state(states: &CommandStates, r: &CommandRef, enabled: bool, checked: Option) -> bool { - format!("{:?}", states.get(r)) == format!("{:?}", Some(&state(enabled, checked))) + let want = state(enabled, checked); + states.get(r).is_some_and(|s| s.is_enabled() == want.is_enabled() && s.is_checked() == want.is_checked()) } fn editing_text(text: &str) -> (VectorcraftApp, Value) { diff --git a/crates/ui-egui/src/panels/symbols/tests.rs b/crates/ui-egui/src/panels/symbols/tests.rs index baf277937a..262f1d7cdb 100644 --- a/crates/ui-egui/src/panels/symbols/tests.rs +++ b/crates/ui-egui/src/panels/symbols/tests.rs @@ -253,7 +253,7 @@ fn checked_view(app: &VectorcraftApp) -> Vec<&'static str> { menu_states(app, &mut states); let checked = |view: &str| { let row = CommandRef::with_params("ui.panelView", json!({"panel": "symbols", "view": view})); - states.get(&row) == Some(&CommandState::new().checked(true)) + states.get(&row).is_some_and(|s| s.is_enabled() && s.is_checked() == Some(true)) }; ["thumbnail", "smallList", "largeList"].into_iter().filter(|&view| checked(view)).collect() } From 4ce921dd1b3778e7dd3f12f7516ffd25911aa10b Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 00:59:38 -0800 Subject: [PATCH 40/61] Export for Screens: the items sit in a framed view, and checked items show selected The Artboards and Assets panes drew their list and grid with no frame and only as tall as their items, so with one artboard the view buttons, Clear Selection and Prefix sat right under the thumbnail with empty space below. The views were also shown without a selection, and the grid draws a tile's check from the tile's selection, so a checked artboard had no outline and its check box drew empty. - The list and the grid sit on a sunken surface with control padding, and keep their height (9 rows, 4 tiles) when fewer items are shown. - The checked items are bound as the view's selection, so they draw the selection outline and a checked box. The lead and anchor are kept per tab from pass to pass; the checks still decide which items are exported. --- .../ui-egui/src/dialogs/export_for_screens.rs | 46 +++++++++---- crates/ui-egui/src/dialogs/tests_screens.rs | 64 +++++++++++++++++++ 2 files changed, 98 insertions(+), 12 deletions(-) diff --git a/crates/ui-egui/src/dialogs/export_for_screens.rs b/crates/ui-egui/src/dialogs/export_for_screens.rs index bef9fda0f9..bfedfd4d7d 100644 --- a/crates/ui-egui/src/dialogs/export_for_screens.rs +++ b/crates/ui-egui/src/dialogs/export_for_screens.rs @@ -30,13 +30,13 @@ use std::borrow::Cow; use std::sync::Arc; -use craft::behavior::{ColumnKey, ColumnWidth, DisplayOrder, GesturePhase, IconId, ItemSource, SelectionChange}; +use craft::behavior::{ColumnKey, ColumnWidth, DisplayOrder, GesturePhase, IconId, ItemSource, Selection, SelectionChange}; use craft::host::PickRequest; use craft::ui::buttons::Button; use craft::ui::choice::{Checkbox, Radio, RadioGroup, Segmented}; use craft::ui::contract::{ - Bind, CollectionEvent, ColumnSpec, Entry, Props as _, Show as _, ShowCollection as _, ShowContainer as _, SpaceAction, SweepApply, SweepStep, - ToggleColumn, + Bind, CollectionEvent, ColumnSpec, Entry, Pad, Props as _, Show as _, ShowCollection as _, ShowContainer as _, SpaceAction, SweepApply, + SweepStep, ToggleColumn, }; use craft::ui::dialog::{DialogId, DialogResult, DialogStack, FieldRefusal, HeldAnswer, HeldOk, StackDialog, dialog_id}; use craft::ui::display::{Shade, Text}; @@ -46,6 +46,7 @@ use craft::ui::patterns::form_dialogs::{FormDialog, PathRow}; use craft::ui::primitives::{ContentPainterCx, fit_rect}; use craft::ui::runtime::env::Label; use craft::ui::runtime::focus::Initial; +use craft::ui::style::SurfaceKind; use craft::ui::tabs::{Tab, TabKind, TabStrip}; use craft::ui::text::TextField; use craft::ui::tile_grid::{Tile, TileGrid, TilePartEvent}; @@ -93,10 +94,11 @@ const SETTABLE: [&str; 20] = [ /// The check column of the list view and its name column. const CHECK: ColumnKey = ColumnKey::new("check"); const NAME: ColumnKey = ColumnKey::new("name"); -/// Rows of the list view and of the grid view the items pane shows before it scrolls, a pane as tall as the options -/// column's first sections. +/// How many items the list view and the grid view hold before they scroll, and how tall they are with fewer: a +/// missing item counts a control row, so the pane stays about as tall as the options column's first sections with +/// one artboard. The framework counts a grid's items, not its rows of tiles. const LIST_ROWS: u16 = 9; -const GRID_ROWS: u16 = 3; +const GRID_ITEMS: u16 = 4; /// The longest side of an artboard thumbnail, in pixels. const THUMB_PX: u32 = 92; @@ -219,6 +221,7 @@ pub fn open(app: &mut VectorcraftApp) { pending: None, renaming_in: None, rename: None, + leads: Default::default(), held: HeldAnswer::new(), }; if let Some(dialogs) = app.dialogs() { @@ -541,6 +544,8 @@ pub(crate) struct ExportForScreensDialog { renaming_in: Option<(u64, u64)>, /// A committed artboard name: ((document uid, reverts), artboard id, name), for the pump to run. rename: Option<((u64, u64), u32, String)>, + /// The lead and anchor of the Artboards and the Assets view, by tab. + leads: [Selection; 2], held: HeldAnswer>, } @@ -616,7 +621,7 @@ impl ExportForScreensDialog { let checked = |at: usize| on.get(at).copied().unwrap_or(false); let shelf = Shelf { items: &items, enabled: text(fields, "select") != "full", reveal: None, caption: &caption, checked: &checked, paint: &paint }; - let picks = shelf.show(ui, text(fields, "view") == "list"); + let picks = shelf.show(ui, text(fields, "view") == "list", &mut self.leads[0]); for key in picks.toggled { if let Some(b) = items.index_of(&key).and_then(|at| on.get_mut(at)) { *b ^= true; @@ -654,7 +659,7 @@ impl ExportForScreensDialog { let checked = |at: usize| items.0.get(at).is_some_and(|(id, _)| on.contains(id)); let reveal = fields.get("__scrollTo").and_then(Value::as_u64).filter(|id| items.index_of(id).is_some()); let shelf = Shelf { items: &items, enabled: true, reveal, caption: &caption, checked: &checked, paint: &paint }; - let picks = shelf.show(ui, text(fields, "view") == "list"); + let picks = shelf.show(ui, text(fields, "view") == "list", &mut self.leads[1]); for id in picks.toggled { if on.contains(&id) { on.retain(|a| *a != id); @@ -724,23 +729,30 @@ struct Shelf<'a> { } impl Shelf<'_> { - /// Shows the items as a list of rows (`list`) or a grid of tiles → what the user did to them. - fn show(self, ui: &mut Ui, list: bool) -> Picks { + /// Shows the items as a list of rows (`list`) or a grid of tiles in a sunken frame, with the checked items + /// selected → what the user did to them. `lead` holds the selection's lead and anchor from pass to pass; its + /// items are the checked ones. + fn show(self, ui: &mut Ui, list: bool, lead: &mut Selection) -> Picks { let Shelf { items, enabled, reveal, caption, checked, paint } = self; let mut picks = Picks::default(); let rename = reveal.is_none(); let at = |key: &u64| items.index_of(key).unwrap_or(usize::MAX); let state = |at: usize| if checked(at) { ToggleState::On } else { ToggleState::Off }; + let mut selection = Selection::new((0..items.len()).filter(|at| checked(*at)).map(|at| items.key(at)).collect(), lead.lead, lead.anchor); if list { let columns = vec![ColumnSpec::toggle(CHECK, Label::Empty, ToggleColumn::default()), ColumnSpec::new(NAME, Label::Empty, ColumnWidth::fill(1.0))]; let mut view = List::::new(tl!("Export for Screens")) + .surface(SurfaceKind::Sunken) + .pad(Pad::Control) .header(false) .space(SpaceAction::ToggleCell) .columns(columns) .rename(rename) .enabled(enabled) - .max_rows(LIST_ROWS); + .min_rows(LIST_ROWS) + .max_rows(LIST_ROWS) + .selection(Bind::bound(&mut selection)); if rename { view = view.rename_column(NAME); } @@ -763,7 +775,15 @@ impl Shelf<'_> { } } } else { - let mut grid = TileGrid::::new(tl!("Export for Screens")).checks(true).rename(rename).enabled(enabled).max_rows(GRID_ROWS); + let mut grid = TileGrid::::new(tl!("Export for Screens")) + .surface(SurfaceKind::Sunken) + .pad(Pad::Control) + .checks(true) + .rename(rename) + .enabled(enabled) + .min_rows(GRID_ITEMS) + .max_rows(GRID_ITEMS) + .selection(Bind::bound(&mut selection)); if let Some(key) = reveal { grid = grid.reveal(key); } @@ -778,6 +798,8 @@ impl Shelf<'_> { } } } + // A click picks the item it lands on as the lead; the checks alone say which items are selected. + (lead.lead, lead.anchor) = (selection.lead, selection.anchor); picks } } diff --git a/crates/ui-egui/src/dialogs/tests_screens.rs b/crates/ui-egui/src/dialogs/tests_screens.rs index b4ae88d15a..8e6c139a68 100644 --- a/crates/ui-egui/src/dialogs/tests_screens.rs +++ b/crates/ui-egui/src/dialogs/tests_screens.rs @@ -1670,3 +1670,67 @@ fn the_format_rows_fit_the_right_column_at_the_default_and_least_window_sizes() } } } + +/// The items pane, in the grid and in the list, with one artboard and with many: the artboards sit in a sunken frame +/// at least one and a half tiles or five rows tall, the view buttons and the prefix sit under the frame, and the checked +/// artboards are the selected ones. +#[test] +fn the_artboards_sit_in_a_framed_view_as_tall_as_the_pane_and_the_checked_ones_are_selected() { + for (boards, view) in [(1, "grid"), (1, "list"), (12, "grid"), (12, "list")] { + let (mut app, _) = app(boards, false); + let mut w = Window::default(); + w.run(&mut app, vec![]); + open(&mut app); + set(&mut app, "view", json!(view)); + let shown = |w: &mut Window, app: &mut VectorcraftApp| { + w.run(app, vec![]); + let out = w.run(app, vec![]); + let nodes = out.platform_output.accesskit_update.map(|u| u.nodes).unwrap_or_default(); + (out.shapes, nodes) + }; + let rect = |n: &egui::accesskit::Node| { + n.bounds().map(|b| egui::Rect::from_min_max(egui::pos2(b.x0 as f32, b.y0 as f32), egui::pos2(b.x1 as f32, b.y1 as f32))) + }; + let (shapes, nodes) = shown(&mut w, &mut app); + let find = |label: &str, role: Role| { + nodes + .iter() + .find(|(_, n)| n.label() == Some(label) && n.role() == role) + .and_then(|(_, n)| rect(n)) + .unwrap_or_else(|| panic!("{view}: no {role:?} {label:?}")) + }; + let pane = nodes + .iter() + .find(|(_, n)| n.label() == Some("Export for Screens") && matches!(n.role(), Role::ListBox | Role::List)) + .and_then(|(_, n)| rect(n)) + .unwrap_or_else(|| panic!("{boards} {view}: no items view")); + let clear = find("Clear Selection", Role::Button); + let tile = find("1 Artboard 1", Role::ListItem); + // The frame: a filled or outlined rectangle that holds the items view. + fn rects(shape: &egui::Shape, out: &mut Vec) { + match shape { + egui::Shape::Rect(r) => out.push(r.clone()), + egui::Shape::Vec(v) => v.iter().for_each(|s| rects(s, out)), + _ => {} + } + } + let mut painted = Vec::new(); + shapes.iter().for_each(|c| rects(&c.shape, &mut painted)); + let near: Vec<_> = painted.iter().filter(|r| r.rect.expand(4.0).contains_rect(pane) && pane.expand(4.0).contains_rect(r.rect)).collect(); + let framed = near.iter().any(|r| r.stroke.width > 0.0 || r.fill.a() > 0); + assert!(framed, "{boards} {view}: the items view at {pane:?} has a frame: {near:?}"); + assert!(clear.top() >= pane.bottom(), "{boards} {view}: Clear Selection {clear:?} is under the items {pane:?}"); + // One and a half tiles tall in the grid, five rows in the list, whatever the count of artboards. + let least = if view == "grid" { 1.5 } else { 5.0 } * tile.height(); + assert!(pane.height() >= least, "{boards} {view}: the items view {pane:?} is at least {least} tall (an item is {tile:?})"); + let selected = |nodes: &[(egui::accesskit::NodeId, egui::accesskit::Node)]| { + nodes.iter().find(|(_, n)| n.label() == Some("1 Artboard 1") && n.role() == Role::ListItem).and_then(|(_, n)| n.is_selected()) + }; + assert_eq!(selected(&nodes), Some(true), "{boards} {view}: the checked artboard is selected"); + let mut off = vec![true; boards]; + off[0] = false; + set(&mut app, "boards", json!(off)); + let (_, nodes) = shown(&mut w, &mut app); + assert_ne!(selected(&nodes), Some(true), "{boards} {view}: an artboard that is not checked is not selected"); + } +} From c1bc3a2d502117a09d43b76a0e1effb350fc584b Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 01:02:30 -0800 Subject: [PATCH 41/61] Appearance: a narrow group shows the Stroke and Fill labels whole In a 220 pt floating group the paint rows' links were cut to "S" and "F": each row gives its trailing parts their full width first, and the stroke weight was the Stroke panel's regular-size field with its presets list. A paint row's weight is now a small field without the presets list; its arrows, the arrow keys and the wheel still step it, stopping at each preset. Fill rows reserve the same room, so the swatches stay in one column. --- crates/ui-egui/src/panels/appearance.rs | 15 ++++++---- crates/ui-egui/src/panels/appearance/tests.rs | 28 +++++++++++++++++++ crates/ui-egui/src/panels/stroke.rs | 21 ++++++++++++-- 3 files changed, 56 insertions(+), 8 deletions(-) diff --git a/crates/ui-egui/src/panels/appearance.rs b/crates/ui-egui/src/panels/appearance.rs index 7bce287424..bdb561f5f6 100644 --- a/crates/ui-egui/src/panels/appearance.rs +++ b/crates/ui-egui/src/panels/appearance.rs @@ -44,7 +44,7 @@ use craft::ui::primitives::IconSpec; use craft::ui::runtime::commands::{CommandRef, CommandState, CommandStates}; use craft::ui::runtime::env::Label; use craft::ui::sections::{FooterAction, FooterBar}; -use craft::ui::text::NumberOutput; +use craft::ui::text::{NumberField, NumberOutput}; use egui::{Rect, Ui, vec2}; use serde_json::{Value, json}; use vectorcraft_color::{BlendMode, Paint}; @@ -860,11 +860,9 @@ fn item_row<'r>(cx: &'r RowCx<'_>, key: RowKey, i: usize) -> ListRow<'r> { if let Some(st) = stroke_layer { let target = if new_art { WeightTarget::Shown } else { WeightTarget::Item(i) }; let pass = cx.pass; - row = row.trailing_field(stroke::weight_number(cx.app, Some(st.width)), move |out| { - pass.borrow_mut().acts.push(Act::Weight(target, Box::new(out))) - }); + row = row.trailing_field(row_weight(cx.app, Some(st.width)), move |out| pass.borrow_mut().acts.push(Act::Weight(target, Box::new(out)))); } else { - row = row.trailing_space(stroke::weight_number(cx.app, None)); + row = row.trailing_space(row_weight(cx.app, None)); } let painted = if new_art { Painted::NewArt { fill } } else { Painted::Item(i) }; let pass = cx.pass; @@ -892,6 +890,13 @@ fn paint_swatch(fill: bool, paint: &Paint) -> Swatch { .tooltip(tl!("Click to choose a swatch, Shift-click to mix a colour")) } +/// The weight field of a stroke row, or the room it takes in a fill row: the Stroke panel's field as a small control, +/// as the row's swatch is, without the presets list (a step still stops at each preset), so the row's label shows +/// whole in the narrowest group. +fn row_weight(app: &VectorcraftApp, weight: Option) -> NumberField<'static> { + stroke::steps_weight(app, weight).size(ControlSize::Sm) +} + /// A stroke row's notes after the weight: its brush and "Dashed". fn stroke_notes(st: &vectorcraft_doc::StrokeLayer) -> Option { let dashed = st.dash.as_ref().is_some_and(|d| d.is_dashed()).then_some(tl!("Dashed")); diff --git a/crates/ui-egui/src/panels/appearance/tests.rs b/crates/ui-egui/src/panels/appearance/tests.rs index 97a76b420f..5e5a4fc5b4 100644 --- a/crates/ui-egui/src/panels/appearance/tests.rs +++ b/crates/ui-egui/src/panels/appearance/tests.rs @@ -677,6 +677,34 @@ fn an_appearance_row_held_across_file_revert_is_not_dropped_on_the_footer() { assert_eq!(items(&panel), before + 1, "a drag started after the revert still duplicates the row"); } +/// A floating group at the narrowest panel width shows the "Stroke:" and "Fill:" links whole, as wide as a wide group +/// shows them: the stroke weight beside them is a small field inside the panel, and the stroke and fill swatches still +/// stand in one column. +#[test] +fn the_narrowest_group_shows_the_stroke_and_fill_labels_whole() { + use crate::panel_docking::PANEL_MIN_WIDTH; + use crate::tests::panel_harness::{Place, floated}; + let one = |shown: &crate::tests::panel_harness::Shown, name: &str, width: f32| { + let rects = shown.rects(name); + assert_eq!(rects.len(), 1, "one {name:?} at {width} pt: {rects:?}"); + rects[0] + }; + let links = |width: f32| { + let shown = floated(app_with_a_selected_rectangle(), "appearance", "en", Place::Floating(width), &["Stroke:", "Fill:"]); + let [stroke, fill] = ["Stroke:", "Fill:"].map(|name| one(&shown, name, width).width()); + let [stroke_well, fill_well] = ["Stroke swatch", "Fill swatch"].map(|name| one(&shown, name, width).left()); + assert!((stroke_well - fill_well).abs() < 0.5, "the swatches stand at {stroke_well} and {fill_well} pt at {width} pt"); + let weight = one(&shown, "Weight", width); + assert!(shown.body.contains_rect(weight), "the weight field {weight:?} stands inside the panel {:?} at {width} pt", shown.body); + ([stroke, fill], format!("stroke swatch at {stroke_well} pt, weight {weight:?}")) + }; + let (wide, _) = links(400.0); + let (narrow, row) = links(PANEL_MIN_WIDTH); + for (at, name) in ["Stroke:", "Fill:"].iter().enumerate() { + assert!(narrow[at] >= wide[at] - 0.5, "{name:?} is {} pt wide at {PANEL_MIN_WIDTH} pt and {} pt at 400 pt ({row})", narrow[at], wide[at]); + } +} + /// The panel's subject is the `Arc` the document holds for the selected object, a targeted group /// or a targeted layer, not a copy of it; nothing with nothing selected. #[test] diff --git a/crates/ui-egui/src/panels/stroke.rs b/crates/ui-egui/src/panels/stroke.rs index 15b3e438cc..7ea1db6e49 100644 --- a/crates/ui-egui/src/panels/stroke.rs +++ b/crates/ui-egui/src/panels/stroke.rs @@ -301,10 +301,19 @@ static BLANK_WEIGHT_STOPS: [f64; 2] = [0.25, 0.5]; /// 0 pt); Shift or Page steps the grid by ten. // PLAN: the sheet names `NumberField<'static, f64>`; `NumberField::length` takes `Option`. pub(crate) fn weight_number(app: &VectorcraftApp, weight: Option) -> NumberField<'static> { + let field = steps_weight(app, weight); + match weight_ladder(app) { + Some(l) => field.presets(&l.rows), + None => field, + } +} + +/// [`weight_number`] without the presets list: a plain step still stops at each preset. +pub(crate) fn steps_weight(app: &VectorcraftApp, weight: Option) -> NumberField<'static> { let unit = app.session.stroke_unit(); let lengths = crate::fields::bare_points(LengthUnits::new(UnitKind::Points, shown_kind(unit), 72.0), app.session.prefs.numbers_without_units_are_points); - let ladder = LADDERS.iter().find(|(u, _)| *u == unit).or_else(|| LADDERS.iter().find(|(u, _)| *u == Unit::Points)).map(|(_, l)| l); + let ladder = weight_ladder(app); let field = NumberField::length(tl!("Weight"), Bind::given(weight), lengths).range(0.0..=1000.0).step_arrows(StepArrows::Leading).scrub_by_label(); // The stepper steps the number the field shows; the ladders are in points. @@ -315,12 +324,18 @@ pub(crate) fn weight_number(app: &VectorcraftApp, weight: Option) -> Number match ladder { // A blank weight (the selected objects differ) steps in points from 0.25 pt, whatever the unit's ladder: up // gives 0.5 pt, down 0 pt (#5349). - Some(l) if weight.is_none() => field.presets(&l.rows).stepper(in_points(&BLANK_WEIGHT_STOPS, true)), - Some(l) => field.presets(&l.rows).stepper(in_points(&l.stops, false)), + Some(_) if weight.is_none() => field.stepper(in_points(&BLANK_WEIGHT_STOPS, true)), + Some(l) => field.stepper(in_points(&l.stops, false)), None => field, } } +/// The ladder of the stroke unit the session shows, or of points. +fn weight_ladder(app: &VectorcraftApp) -> Option<&'static Ladder> { + let unit = app.session.stroke_unit(); + LADDERS.iter().find(|(u, _)| *u == unit).or_else(|| LADDERS.iter().find(|(u, _)| *u == Unit::Points)).map(|(_, l)| l) +} + /// Sends a weight edit of `out` to `target`: a scrub or slider drag is one undo step, a typed, stepped or picked /// value commits at once, and while the Type tool edits text the weight goes to the selected characters. pub(crate) fn apply_weight(app: &mut VectorcraftApp, out: &NumberOutput, target: WeightTarget) { From 31c0f6466a31a0aa50f18fd338fb01f5321fa1d1 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 01:18:05 -0800 Subject: [PATCH 42/61] Import PDF: a page number the Page field refuses goes back to the shown page The Page field in Import PDF and Place PDF read the typed number with `value()`, so a number typed before text the field then refused on Tab stayed as the chosen page while the field showed the page from before the edit, and OK placed that page. The field now reads `landed()`, as the DXF import options' Scale field does since #9747. DXF import options gains a test for its Scale field that refuses text on Tab and checks the import uses the restored scale; the Escape test from #9747 passed with `value()` as well. --- crates/ui-egui/src/dialogs/dxf_import.rs | 14 ++++++++++ crates/ui-egui/src/dialogs/import_pdf.rs | 2 +- .../ui-egui/src/dialogs/tests_import_pdf.rs | 26 +++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/dialogs/dxf_import.rs b/crates/ui-egui/src/dialogs/dxf_import.rs index 55e39a119a..59d5dddca0 100644 --- a/crates/ui-egui/src/dialogs/dxf_import.rs +++ b/crates/ui-egui/src/dialogs/dxf_import.rs @@ -537,6 +537,20 @@ mod tests { assert_eq!(host::fields(&panel.app(), KIND)["scale"], 1.0); } + #[test] + fn a_scale_the_field_refuses_on_tab_imports_the_scale_it_restores() { + let mut panel = actual_dialog(); + panel.click("Scale"); + panel.key(Key::A, Modifiers::COMMAND); + panel.type_text("2"); + assert_eq!(host::fields(&panel.app(), KIND)["scale"], 2.0); + panel.type_text("*"); + panel.key(Key::Tab, Modifiers::NONE); + assert!(host::is_open(&panel.app(), KIND)); + assert_eq!(host::fields(&panel.app(), KIND)["scale"], 1.0, "the refused text restores the scale from before the edit"); + accept_and_check_width(&mut panel, Unit::Millimeters, 100.0 * Unit::Millimeters.points()); + } + #[test] fn actual_layout_and_unit_enter_and_scale_blur_import_the_accepted_choices() { let mut panel = actual_dialog(); diff --git a/crates/ui-egui/src/dialogs/import_pdf.rs b/crates/ui-egui/src/dialogs/import_pdf.rs index df899ee1c3..f539897c25 100644 --- a/crates/ui-egui/src/dialogs/import_pdf.rs +++ b/crates/ui-egui/src/dialogs/import_pdf.rs @@ -441,7 +441,7 @@ fn pages_body(ui: &mut egui::Ui, s: &mut State, preview: Option<&(Revision, Arc< Text::new(crate::i18n::fmt(tl!("of {count}"), &[("count", &count.to_string())])).shade(Shade::Muted).show(ui); let next = nav(ui, "chevron-right", tl!("Next Page"), (current + 1).min(count), current < count); let last = nav(ui, "chevrons-right", tl!("Last Page"), count, current < count); - to = first.or(previous).or(next).or(last).or(typed.value().copied().flatten().map(|v| v as usize)); + to = first.or(previous).or(next).or(last).or(typed.edit.events.landed().copied().flatten().map(|v| v as usize)); }); if let Some(page) = to { s.page = page.clamp(1, count.max(1)); diff --git a/crates/ui-egui/src/dialogs/tests_import_pdf.rs b/crates/ui-egui/src/dialogs/tests_import_pdf.rs index 622756a1bd..3b96687a49 100644 --- a/crates/ui-egui/src/dialogs/tests_import_pdf.rs +++ b/crates/ui-egui/src/dialogs/tests_import_pdf.rs @@ -678,3 +678,29 @@ fn an_empty_password_still_asks_for_the_password() { assert!(!import_pdf::offer_place_password(&mut app, &p), "a given password is placed with"); assert!(!is_open(&app)); } + +/// A page number the Page field refuses when Tab leaves it goes back to the page shown before the edit, and OK places +/// that page. +#[test] +fn a_page_the_field_refuses_on_tab_places_the_page_it_restores() { + use crate::tests::panel_harness::Panel; + use egui::{Key, Modifiers}; + + let mut panel = Panel::new(app(), crate::tests::picks::dialogs); + panel.room(egui::vec2(1000.0, 800.0)); + place(&mut panel.app(), &three_pages(), json!({"at": [100, 120], "link": false})).unwrap(); + panel.frame(); + panel.click("Page"); + panel.key(Key::A, Modifiers::COMMAND); + panel.type_text("2"); + assert_eq!(field(&panel.app(), "page"), 2); + panel.type_text("*"); + panel.key(Key::Tab, Modifiers::NONE); + assert!(is_open(&panel.app())); + assert_eq!(field(&panel.app(), "page"), 1, "the refused text restores the page from before the edit"); + panel.click("OK"); + panel.frame(); + assert!(!is_open(&panel.app())); + let (_, bounds) = placed(&panel.app()); + assert_eq!((bounds.width(), bounds.height()), (100.0, 100.0), "the first page is placed"); +} From 988edeabc6be352a9b057215b3e74f0f8d520bef Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 01:47:52 -0800 Subject: [PATCH 43/61] Export for Screens: Space flips only the item it is pressed on The items pane selects every checked item. Space on a selected item flips that item and then the other selected items to its new value, so Space on one checked artboard unchecked every checked artboard. The pane now keeps only the flips of the first item a pass reports, which is the lead item for Space. A test moves to a checked artboard with the arrow keys, runs a frame and presses Space in the grid and the list. --- .../ui-egui/src/dialogs/export_for_screens.rs | 5 +++++ crates/ui-egui/src/dialogs/tests_screens.rs | 20 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/crates/ui-egui/src/dialogs/export_for_screens.rs b/crates/ui-egui/src/dialogs/export_for_screens.rs index bfedfd4d7d..decb345a71 100644 --- a/crates/ui-egui/src/dialogs/export_for_screens.rs +++ b/crates/ui-egui/src/dialogs/export_for_screens.rs @@ -800,6 +800,11 @@ impl Shelf<'_> { } // A click picks the item it lands on as the lead; the checks alone say which items are selected. (lead.lead, lead.anchor) = (selection.lead, selection.anchor); + // Space on a selected item flips that item first and then the other selected items to the same value. The + // selection here is every checked item, so only the first item's flips are kept. + if let Some(&first) = picks.toggled.first() { + picks.toggled.retain(|key| *key == first); + } picks } } diff --git a/crates/ui-egui/src/dialogs/tests_screens.rs b/crates/ui-egui/src/dialogs/tests_screens.rs index 8e6c139a68..48a6c0255f 100644 --- a/crates/ui-egui/src/dialogs/tests_screens.rs +++ b/crates/ui-egui/src/dialogs/tests_screens.rs @@ -1734,3 +1734,23 @@ fn the_artboards_sit_in_a_framed_view_as_tall_as_the_pane_and_the_checked_ones_a assert_ne!(selected(&nodes), Some(true), "{boards} {view}: an artboard that is not checked is not selected"); } } + +/// With two artboards checked, the arrow keys move to a checked one and, a frame later, Space unchecks only that one, +/// in the grid and in the list. +#[test] +fn space_on_a_checked_artboard_flips_only_its_own_check() { + for (view, back) in [("grid", egui::Key::ArrowLeft), ("list", egui::Key::ArrowUp)] { + let (mut app, _) = app(3, false); + let mut w = Window::default(); + w.names(&mut app); + open(&mut app); + set(&mut app, "view", json!(view)); + set(&mut app, "boards", json!([true, true, false])); + w.press(&mut app, "3 Artboard 3", Role::ListItem); + assert_eq!(field(&app, "boards"), json!([true, true, false]), "{view}: a click on the third artboard leaves the checks"); + w.key(&mut app, back); + w.run(&mut app, vec![]); + w.key(&mut app, egui::Key::Space); + assert_eq!(field(&app, "boards"), json!([true, false, false]), "{view}: Space unchecks only the second artboard"); + } +} From cfa2bbb878e0fe1c6017fdbdbf8f53ff7ba8df02 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 02:37:49 -0800 Subject: [PATCH 44/61] Dialogs: a style options dialog keeps its tab through its first measuring run With the current craft-libs, the first show of a properties dialog is a measuring run that can end before the dialog's body runs, and it then sets the first tab as the shown one. A tab picked before the first frame (Tabs in Paragraph Style Options) was lost, so the Tabs pane and its Clear All Tabs button were not shown. The style options dialogs now keep the tab that was shown before a measuring run. --- crates/ui-egui/src/dialogs/char_style_options.rs | 10 +++++++++- crates/ui-egui/src/dialogs/para_style_options/tests.rs | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/dialogs/char_style_options.rs b/crates/ui-egui/src/dialogs/char_style_options.rs index 584964e0c4..3e8a78a618 100644 --- a/crates/ui-egui/src/dialogs/char_style_options.rs +++ b/crates/ui-egui/src/dialogs/char_style_options.rs @@ -1126,7 +1126,15 @@ macro_rules! style_dialog { } fn show(&mut self, ui: &mut egui::Ui, stack: &craft::ui::dialog::DialogStack) -> Option> { - craft::ui::dialog::StackDialog::show(&mut self.inner, ui, stack) + // A measuring run can end without running the dialog's body and then sets the first tab as the + // shown one. The dialog keeps the tab that was shown before that run. + let measuring = craft::ui::runtime::measure::active(ui.ctx()); + let tab = self.inner.tab(); + let shown = craft::ui::dialog::StackDialog::show(&mut self.inner, ui, stack); + if measuring && self.inner.tab() != tab { + let _ = craft::ui::dialog::StackDialog::set_json_field(&mut self.inner, ui.ctx(), "tab", serde_json::json!(tab)); + } + shown } fn key(&self) -> Option<&str> { diff --git a/crates/ui-egui/src/dialogs/para_style_options/tests.rs b/crates/ui-egui/src/dialogs/para_style_options/tests.rs index 39d26bfb1a..d9ed8b9ed7 100644 --- a/crates/ui-egui/src/dialogs/para_style_options/tests.rs +++ b/crates/ui-egui/src/dialogs/para_style_options/tests.rs @@ -574,6 +574,8 @@ fn clear_all_tabs_can_be_clicked_in_a_narrow_viewport() { for _ in 0..5 { frame(&mut app, vec![]); } + // The dialog's first frames measure it before its body runs; the Tabs pane picked before them stays shown. + assert_eq!(fields(&app)["tab"], json!("tabs"), "the dialog left Tabs in its first frames at {width} points"); let out = frame(&mut app, vec![]); let nodes = out.platform_output.accesskit_update.unwrap().nodes; let clear = nodes From 7d9cd73f5fff98a907fdf51c2e9d2d32b01b4e2d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 02:37:49 -0800 Subject: [PATCH 45/61] Toolbars: Rename Button works on a button whose command is dimmed A context menu owned by a disabled button takes no clicks with the current craft-libs, so Rename Button... on a dimmed button opened no dialog. The row around the button now owns the menu, and a right click on the button opens it. --- crates/ui-egui/src/custom_toolbars.rs | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/crates/ui-egui/src/custom_toolbars.rs b/crates/ui-egui/src/custom_toolbars.rs index 9622364483..e9e58f7e6b 100644 --- a/crates/ui-egui/src/custom_toolbars.rs +++ b/crates/ui-egui/src/custom_toolbars.rs @@ -32,6 +32,7 @@ use craft::ui::buttons::{Button, IconButton}; use craft::ui::contract::{Bind, PopupKind, Props as _, Show as _, ShowContainer as _, Trigger}; use craft::ui::dialog::DialogResult; use craft::ui::display::{Divider, Shade, Text}; +use craft::ui::layout_components::Row; use craft::ui::menu::{Menu, MenuItem}; use craft::ui::patterns::form_dialogs::{ DialogFields, FieldValue, HostedListManager, HostedParamDialog, ListManagerAction, ListManagerChoice, ListManagerEntry, ListManagerWords, Param, @@ -895,21 +896,29 @@ fn command_button(app: &VectorcraftApp, ui: &mut egui::Ui, bar: &str, look: &Com (Some(t), Some(keys)) => format!("{} {keys}", t.name), (Some(t), None) => t.name.clone(), }; - let button = match &look.text { - Some(t) => Button::command(t.command.clone()).label(look.said()), - None => Button::new(look.said()).enabled(false), - }; - // The face paints the label; the accessible name stays `said`. - let button = if look.own.is_some() { button.painted(look.label().to_string()) } else { button }; - let response = button.tooltip(tip).show(ui).response; + let mut response = None; + // A menu owned by a dimmed button takes no clicks, so the row around the button owns the menu and a right + // click on the button opens it: Rename Button… and the rest work while the command is dimmed. + let row = Row::new() + .show(ui, |ui, _| { + let button = match &look.text { + Some(t) => Button::command(t.command.clone()).label(look.said()), + None => Button::new(look.said()).enabled(false), + }; + // The face paints the label; the accessible name stays `said`. + let button = if look.own.is_some() { button.painted(look.label().to_string()) } else { button }; + response = Some(button.tooltip(tip.clone()).show(ui).response); + }) + .output; if measuring { return; } + let Some(response) = response else { return }; let (i, n) = place; let moved = |at: usize| CommandRef::with_params("toolbar.addCommand", json!({ "command": look.id, "toolbar": bar, "at": at })); let removed = CommandRef::with_params("toolbar.removeCommand", json!({ "command": look.id, "toolbar": bar })); let renamed = CommandRef::with_params("toolbar.renameCommand", json!({ "command": look.id, "toolbar": bar })); - Menu::context(look.name().to_string(), &response).show(ui, |ui, _| { + Menu::context(look.name().to_string(), &row).opened_by(&response, Trigger::Context).show(ui, |ui, _| { MenuItem::command(moved(i.saturating_sub(1))).label(tl!("Move Up")).enabled(i > 0).show(ui); MenuItem::command(moved(i + 1)).label(tl!("Move Down")).enabled(i + 1 < n).show(ui); MenuItem::command(renamed.clone()).label(tl!("Rename Button…")).show(ui); From 85d7248548e51a90697d3f468e8927ba52c0af9a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 02:37:49 -0800 Subject: [PATCH 46/61] Window: Tab reads Standard Screen Mode's hidden chrome In Standard Screen Mode the shell records Tab's hide as the chrome hidden, not as everything hidden. The Tab command and the tool lookup read only the second, so a second Tab hid again instead of showing the panels. Both now use panel_docking::tab_hidden. --- crates/ui-egui/src/menus/run.rs | 2 +- crates/ui-egui/src/menus/tests.rs | 17 ++++++++++++++++- crates/ui-egui/src/palette.rs | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index d0020042ba..11975b7c24 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -738,7 +738,7 @@ fn run_ui_part6(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option { - let hidden = craft::ui::shell::chrome_state(&ctx, egui::ViewportId::ROOT).hidden; + let hidden = crate::panel_docking::tab_hidden(app); request_chrome_toggle(&ctx, egui::ViewportId::ROOT, if hidden { ChromeToggle::ShowPanels } else { ChromeToggle::Panels }); Ok(json!(hidden)) } diff --git a/crates/ui-egui/src/menus/tests.rs b/crates/ui-egui/src/menus/tests.rs index adaa0b488c..120c80aadd 100644 --- a/crates/ui-egui/src/menus/tests.rs +++ b/crates/ui-egui/src/menus/tests.rs @@ -262,6 +262,21 @@ fn help_f1_opens_discover_without_a_document() { assert!(crate::panel_docking::showing(&app.ui, "discover")); } +/// In Standard Screen Mode Tab hides the panels, the toolbars and the Control bar, and the next Tab +/// shows them again. +#[test] +fn a_second_tab_shows_what_the_first_hid() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), crate::Services::default()); + let ctx = crate::testing::ui_context(); + app.ui_ctx = Some(ctx.clone()); + assert_eq!(app.run("window.dock", json!({})).unwrap(), json!(false)); + app_frame(&mut app, &ctx, vec![]); + assert!(crate::panel_docking::tab_hidden(&app)); + assert_eq!(app.run("window.dock", json!({})).unwrap(), json!(true), "the second Tab shows what the first hid"); + app_frame(&mut app, &ctx, vec![]); + assert!(!crate::panel_docking::tab_hidden(&app)); +} + /// With the toolbars hidden by Tab, choosing a tool in Help, or a tool's link in a tutorial Help /// shows, marks nothing and the status bar says why. #[test] @@ -314,7 +329,7 @@ fn discover_says_why_a_tool_cannot_be_marked() { // Tab hides the toolbars in the shell's next pass. app.run("window.dock", json!({})).unwrap(); app_frame(&mut app, &ctx, vec![]); - assert!(craft::ui::shell::chrome_state(&ctx, egui::ViewportId::ROOT).hidden); + assert!(crate::panel_docking::tab_hidden(&app)); let reason = app.run("learn.locateTool", json!({"tool": "rectangle"})).unwrap()["reason"].as_str().unwrap().to_string(); let found = app.run("help.discover.search", json!({"query": "rectangle"})).unwrap(); diff --git a/crates/ui-egui/src/palette.rs b/crates/ui-egui/src/palette.rs index 9079b40a5d..6deacc0c01 100644 --- a/crates/ui-egui/src/palette.rs +++ b/crates/ui-egui/src/palette.rs @@ -534,7 +534,7 @@ fn tool_home(app: &VectorcraftApp, tool: &str) -> String { None => name.to_string(), }; // Tab hides every toolbar with the panels, as the main window's shell left it. - let tab_hidden = app.ui_ctx.as_ref().is_some_and(|ctx| craft::ui::shell::chrome_state(ctx, egui::ViewportId::ROOT).hidden); + let tab_hidden = crate::panel_docking::tab_hidden(app); let toolbars_shown = app.ui.screen_mode < 3 && !tab_hidden; let main = crate::toolbar::slots(app).into_iter().map(|(_, s)| s).find(|s| s.contains(&tool)); // A group torn off into a strip shows each of its tools on its own button. From 5ce0ab2e0df833442d40c88ce9426a333e116f57 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 02:37:49 -0800 Subject: [PATCH 47/61] Tests: Save Options radio test measures the check box with its label The check box and the text of its label are two accessibility nodes with the same name. The test now takes the bounds of every node so named on the same line, so it measures the gap from the check box row and not from its label text. --- crates/ui-egui/src/dialogs/save_options/tests.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/crates/ui-egui/src/dialogs/save_options/tests.rs b/crates/ui-egui/src/dialogs/save_options/tests.rs index 8656fe3bf0..750e5b1130 100644 --- a/crates/ui-egui/src/dialogs/save_options/tests.rs +++ b/crates/ui-egui/src/dialogs/save_options/tests.rs @@ -532,14 +532,15 @@ fn labelled_controls(app: &mut VectorcraftApp) -> Vec<(String, egui::Rect)> { .collect() } -/// The bounds of the control labelled `label` in `controls`, with or without a final colon. +/// The bounds of the control labelled `label` in `controls`, with or without a final colon. A check box and the text of +/// its label are two nodes with the same name side by side, so the bounds take in every node so named on the first +/// one's line. fn control(controls: &[(String, egui::Rect)], label: &str) -> egui::Rect { let bare = |l: &str| l.trim_end_matches(':').to_string(); - controls - .iter() - .find(|(l, _)| bare(l) == bare(label)) - .map(|(_, r)| *r) - .unwrap_or_else(|| panic!("no control labelled {label:?} in {:?}", controls.iter().map(|(l, _)| l).collect::>())) + let named: Vec = controls.iter().filter(|(l, _)| bare(l) == bare(label)).map(|(_, r)| *r).collect(); + let first = + *named.first().unwrap_or_else(|| panic!("no control labelled {label:?} in {:?}", controls.iter().map(|(l, _)| l).collect::>())); + named.iter().filter(|r| r.top() < first.bottom() && first.top() < r.bottom()).fold(first, |all, r| all.union(*r)) } /// The All and Range radios stand right under the artboard check box, and EPS's Transparent and Opaque radios right From 951e552a76601257d9f457f893a1bcdea95d5d1f Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 02:43:57 -0800 Subject: [PATCH 48/61] Symbols: Symbol Options and Replace Symbol that change nothing add no undo step symbol.options recorded an undo step and moved the revision whenever any option was passed, unless only alignToPixelGrid was given with the value the symbol already had. A newName equal to the current name, or a registration, export type, 9-slice, type or pixel grid value the symbol already has, now leaves the document and its undo history as they are. symbol.replace with the symbol the instances already show recorded an undo step too. It now records one only when an instance changes. Both run through colorcmds::edit_if_changed, as the Symbol Shifter and the other symbolism tools do. --- crates/engine/src/cmd/brushsym.rs | 4 +- crates/engine/src/cmd/brushsym/symbols.rs | 19 ++++---- crates/engine/src/tests/brushsym.rs | 55 +++++++++++++++++++++++ docs/mcp.md | 7 +-- 4 files changed, 69 insertions(+), 16 deletions(-) diff --git a/crates/engine/src/cmd/brushsym.rs b/crates/engine/src/cmd/brushsym.rs index 3828d67d0c..bd6cb220e5 100644 --- a/crates/engine/src/cmd/brushsym.rs +++ b/crates/engine/src/cmd/brushsym.rs @@ -225,7 +225,7 @@ pub fn specs() -> Vec { "Symbol Options…", [], None, - "{name?, newName?, registration?: 0..8, exportType?: movieClip|graphic, nineSlice?: bool, nineSliceGuides?: array, type?: static|dynamic, alignToPixelGrid?: bool} rename a symbol (its instances and the graphics and Map Art maps on 3D objects follow the new name) and/or set Symbol Options › Registration, Export Type, 9-slice guides (nineSliceGuides [left, top, right, bottom] fractions in from each edge, each -16..16, with left + right < 1 and top + bottom < 1), Symbol Type (a dynamic symbol's instances may change the appearance of objects in its art and stay linked; making it static drops those changes) and Align to Pixel Grid (on: the horizontal and vertical straight segments of the paths in the symbol's art snap to whole points, or half points for an odd centered stroke, at the symbol's natural size, its stroke weights become whole points, and every instance placed at that size, reflected across one axis or not, moves to whole points and goes back to them after each move; a scaled, rotated (a half turn included) or sheared instance, and an instance in another symbol's art, is left where it is; the art snaps again after it is edited); alignToPixelGrid alone with the value the symbol already has changes nothing and adds no undo step; default name: current → {name, registration, exportType, nineSlice, type, alignToPixelGrid}", + "{name?, newName?, registration?: 0..8, exportType?: movieClip|graphic, nineSlice?: bool, nineSliceGuides?: array, type?: static|dynamic, alignToPixelGrid?: bool} rename a symbol (its instances and the graphics and Map Art maps on 3D objects follow the new name) and/or set Symbol Options › Registration, Export Type, 9-slice guides (nineSliceGuides [left, top, right, bottom] fractions in from each edge, each -16..16, with left + right < 1 and top + bottom < 1), Symbol Type (a dynamic symbol's instances may change the appearance of objects in its art and stay linked; making it static drops those changes) and Align to Pixel Grid (on: the horizontal and vertical straight segments of the paths in the symbol's art snap to whole points, or half points for an odd centered stroke, at the symbol's natural size, its stroke weights become whole points, and every instance placed at that size, reflected across one axis or not, moves to whole points and goes back to them after each move; a scaled, rotated (a half turn included) or sheared instance, and an instance in another symbol's art, is left where it is; the art snaps again after it is edited); values the symbol already has, newName included, change nothing and add no undo step; default name: current → {name, registration, exportType, nineSlice, type, alignToPixelGrid}", has_doc, symbol_options ), @@ -289,7 +289,7 @@ pub fn specs() -> Vec { "Replace Symbol", [], None, - "{name, ids?|id?} swap the symbol of the selected instances (an instance given a different symbol drops its appearance changes; one given its own symbol keeps them) → {ids}", + "{name, ids?|id?} swap the symbol of the selected instances (an instance given a different symbol drops its appearance changes; one given its own symbol keeps them; when every instance already shows the symbol, nothing changes and no undo step is recorded) → {ids}", has_selection, symbol_replace ), diff --git a/crates/engine/src/cmd/brushsym/symbols.rs b/crates/engine/src/cmd/brushsym/symbols.rs index ac85e71de4..9e39d49d9e 100644 --- a/crates/engine/src/cmd/brushsym/symbols.rs +++ b/crates/engine/src/cmd/brushsym/symbols.rs @@ -347,13 +347,8 @@ pub(super) fn symbol_options(s: &mut Session, p: &Value) -> Result { let dynamic = type_param(p, C)?; let pixel = pixel_grid_param(p, C)?; let new_name = str_param(p, "newName").map(str::trim).filter(|n| !n.is_empty()).map(str::to_string); - if new_name.is_none() && export.is_none() && reg.is_none() && nine.is_none() && dynamic.is_none() { - match pixel { - None => return Err(bad(C, "pass newName, registration, exportType, nineSlice, type and/or alignToPixelGrid")), - // Align to Pixel Grid alone, already as asked: nothing changes and no undo step is added. - Some(on) if on == s.doc()?.doc.symbol_pixel_aligned(&name) => return Ok(options_json(&s.doc()?.doc, &name)), - Some(_) => {} - } + if new_name.is_none() && export.is_none() && reg.is_none() && nine.is_none() && dynamic.is_none() && pixel.is_none() { + return Err(bad(C, "pass newName, registration, exportType, nineSlice, type and/or alignToPixelGrid")); } if let Some(ref n) = new_name && n != &name @@ -362,7 +357,8 @@ pub(super) fn symbol_options(s: &mut Session, p: &Value) -> Result { return Err(bad(C, format!("a symbol named `{n}` already exists"))); } let final_name = new_name.clone().unwrap_or_else(|| name.clone()); - s.edit("Symbol Options", |d, _| { + // Values the symbol already has leave the document as it is, and no undo step is added. + crate::cmd::colorcmds::edit_if_changed(s, "Symbol Options", |before, d| { if let Some(ref n) = new_name && n != &name { @@ -439,7 +435,7 @@ pub(super) fn symbol_options(s: &mut Session, p: &Value) -> Result { if let Some(on) = pixel { d.set_symbol_pixel_aligned(&final_name, on); } - Ok(()) + Ok(((), before != &*d)) })?; Ok(options_json(&s.doc()?.doc, &final_name)) } @@ -859,7 +855,8 @@ pub(super) fn symbol_replace(s: &mut Session, p: &Value) -> Result { if ids.is_empty() { return Err(EngineError::Other("no symbol instances selected".into())); } - s.edit("Replace Symbol", |d, _| { + // Instances that already show the symbol leave the document as it is, and no undo step is added. + crate::cmd::colorcmds::edit_if_changed(s, "Replace Symbol", |before, d| { let new = natural_size(d, &name); for id in &ids { let (old, other) = match d.node(*id).map(|n| &n.kind) { @@ -877,7 +874,7 @@ pub(super) fn symbol_replace(s: &mut Session, p: &Value) -> Result { } } fit_overrides(d, &ids); - Ok(()) + Ok(((), ids.iter().any(|id| before.node(*id) != d.node(*id)))) })?; Ok(json!({ "ids": ids_json(&ids) })) } diff --git a/crates/engine/src/tests/brushsym.rs b/crates/engine/src/tests/brushsym.rs index 032e3ddb8c..03eb4ec5e8 100644 --- a/crates/engine/src/tests/brushsym.rs +++ b/crates/engine/src/tests/brushsym.rs @@ -3048,6 +3048,61 @@ fn symbol_export_type_defaults_to_movie_clip_and_round_trips() { assert!(s.execute("symbol.options", &json!({"name": "Renamed"})).is_err()); } +/// `symbol.options` whose values are the ones the symbol already has changes neither the document +/// nor its revision, and records no undo step. +#[test] +fn symbol_options_that_change_nothing_record_no_undo_step() { + let mut s = session(); + make_symbol(&mut s); + let state = |s: &Session| { + let st = s.doc().unwrap(); + (st.doc.clone(), st.revision, st.history.undo.len()) + }; + let unchanged = [ + json!({"name": "Box", "newName": "Box"}), + json!({"name": "Box", "newName": " Box "}), + json!({"name": "Box", "registration": 4}), + json!({"name": "Box", "exportType": "movieClip"}), + json!({"name": "Box", "nineSlice": false}), + json!({"name": "Box", "type": "static"}), + json!({"name": "Box", "alignToPixelGrid": false}), + json!({"name": "Box", "newName": "Box", "registration": 4, "exportType": "movieClip", "type": "static", "alignToPixelGrid": false}), + ]; + let before = state(&s); + for p in &unchanged { + assert_eq!(s.execute("symbol.options", p).unwrap()["name"], "Box"); + assert_eq!(state(&s), before, "{p} changes nothing"); + } + s.execute("symbol.options", &json!({"name": "Box", "registration": 0, "exportType": "graphic", "type": "dynamic"})).unwrap(); + assert_eq!(undo_steps(&s), before.2 + 1, "changed options are one undo step"); + let before = state(&s); + let r = s.execute("symbol.options", &json!({"name": "Box", "registration": 0, "exportType": "graphic", "type": "dynamic"})).unwrap(); + assert_eq!((r["registration"].clone(), r["exportType"].clone(), r["type"].clone()), (json!(0), json!("graphic"), json!("dynamic"))); + assert_eq!(state(&s), before, "setting the options again changes nothing"); + s.execute("symbol.options", &json!({"name": "Box", "newName": "Logo"})).unwrap(); + assert_eq!(undo_steps(&s), before.2 + 1, "a rename is one undo step"); +} + +/// `symbol.replace` with the symbol the instances already show changes neither the document nor +/// its revision, and records no undo step. +#[test] +fn symbol_replace_with_the_same_symbol_records_no_undo_step() { + let mut s = session(); + let (inst, _, _) = make_symbol(&mut s); + rect(&mut s, 0.0, 0.0, 20.0, 20.0); + s.execute("symbol.new", &json!({"name": "Small"})).unwrap(); + let state = |s: &Session| { + let st = s.doc().unwrap(); + (st.doc.clone(), st.revision, st.history.undo.len()) + }; + let before = state(&s); + assert_eq!(s.execute("symbol.replace", &json!({"name": "Box", "ids": [inst.0]})).unwrap()["ids"], json!([inst.0])); + assert_eq!(state(&s), before, "replacing an instance with its own symbol changes nothing"); + s.execute("symbol.replace", &json!({"name": "Small", "ids": [inst.0]})).unwrap(); + assert!(matches!(&node(&s, inst).kind, NodeKind::SymbolInstance { symbol, .. } if symbol == "Small")); + assert_eq!(undo_steps(&s), before.2 + 1, "replacing it with another symbol is one undo step"); +} + #[test] fn sprayer_command_creates_a_symbol_set_and_alt_removes() { let mut s = session(); diff --git a/docs/mcp.md b/docs/mcp.md index d698534089..4e8d51da8b 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -4968,8 +4968,8 @@ already walks Image Trace. Short agent entry points: placed at that size, reflected across one axis or not, moves to whole points and goes back to them after every move; VectorCraft leaves a scaled, rotated (a half turn included) or sheared instance, and an instance in another symbol's art, where it is, snaps the art again after it is edited, and does not count - instances in `select.object.notAlignedToPixelGrid`; `alignToPixelGrid` alone with the value the symbol already has - adds no undo step), + instances in `select.object.notAlignedToPixelGrid`; values the symbol already has, `newName` included, do not change + the document or its revision and add no undo step), `symbol.place {name?, x?, y?}` (on top of the current layer; in Draw Behind directly below the bottommost selected object, beside the compound path that holds it, or at the bottom of the current layer with nothing selected, above a clipping path; `symbol.placeFromDocument` and `symbol.addFromLibrary` with `place` stack the instance the same @@ -4979,7 +4979,8 @@ already walks Image Trace. Short agent entry points: undo step, and a symbol with the same name but other art or Symbol Options is added under a free name; an error when that document is no longer open; plug-ins cannot call it), `symbol.breakLink {ids?}` (the art keeps the instance's opacity mask and its bounding box, square after `object.resetBoundingBox`; a hidden or locked instance's - art stays hidden or locked and is not selected), `symbol.replace`, + art stays hidden or locked and is not selected), `symbol.replace` (instances that already show the symbol do not + change the document or its revision, and add no undo step), `symbol.update {name, ids?|id?, keepArt?: false}` (Redefine Symbol: the selection, or `ids`, becomes the symbol's art and an instance of it in one undo step; with `keepArt: true` the art stays ordinary art in its place, with its ids, and stays selected unless it is hidden or locked, and the result's `id` is null; a `keepArt` other than true or false is an error; art that holds an instance of the symbol (opacity masks included), directly or through the art From d4d8da454404607ab510165dd2f7421cf03bb9d1 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 29 Nov 2026 06:43:03 -0500 Subject: [PATCH 49/61] chore(ci): allow manual workflow_dispatch for SonarCloud (#10070) --- .github/workflows/sonarcloud.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 90cf166ed7..4cd4eb6387 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -1,6 +1,7 @@ name: SonarCloud on: + workflow_dispatch: push: branches: [main] pull_request: From 36ec203ef5a058bc22823ff8835eb402c8a5cc55 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sun, 29 Nov 2026 12:44:11 +0100 Subject: [PATCH 50/61] Pin current craft-libs and its matching egui revision --- Cargo.lock | 198 ++++++++++++++++---------------- Cargo.toml | 98 ++++++++-------- apps/vectorcraft-web/Cargo.toml | 2 +- xtask/src/pdf_deps.rs | 2 +- 4 files changed, 150 insertions(+), 150 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4910ae4bb8..c4f93bacb0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1239,7 +1239,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-automation", "craft-behavior", @@ -1280,7 +1280,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "crc32fast", "flate2", @@ -1291,7 +1291,7 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "block2 0.6.2", "objc2 0.6.5", @@ -1302,7 +1302,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "rustix 1.1.6", ] @@ -1310,7 +1310,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1335,7 +1335,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1353,7 +1353,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-behavior", "craft-docpath", @@ -1371,7 +1371,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "crc32fast", "flate2", @@ -1380,7 +1380,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "egui", ] @@ -1388,7 +1388,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "md-5", "rayon", @@ -1397,12 +1397,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-behavior", "craft-cms", @@ -1422,7 +1422,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-control-protocol", "craft-platform", @@ -1433,7 +1433,7 @@ dependencies = [ [[package]] name = "craft-control-protocol" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "getrandom 0.3.4", "serde_json", @@ -1443,7 +1443,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "rayon", ] @@ -1451,7 +1451,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "block2 0.6.2", "craft-appkit", @@ -1477,7 +1477,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "blake3", "craft-ecproj-format", @@ -1493,7 +1493,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "serde", ] @@ -1501,7 +1501,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1520,7 +1520,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-codepage", "encoding_rs", @@ -1532,7 +1532,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "serde", "serde_json", @@ -1542,12 +1542,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1562,7 +1562,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1581,7 +1581,7 @@ dependencies = [ [[package]] name = "craft-font-os-windows" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "windows-registry", "windows-sys 0.61.2", @@ -1590,7 +1590,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "cap-primitives", "craft-atomic", @@ -1613,12 +1613,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "gif", ] @@ -1626,7 +1626,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "flate2", ] @@ -1634,7 +1634,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1647,7 +1647,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "chrono", "fixed_decimal", @@ -1675,7 +1675,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-dds", "craft-jpeg", @@ -1702,7 +1702,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1720,7 +1720,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "thiserror 2.0.21", ] @@ -1728,7 +1728,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1739,7 +1739,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-host", "craft-i18n", @@ -1754,7 +1754,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-behavior", "craft-i18n", @@ -1768,7 +1768,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-behavior", "craft-host", @@ -1786,7 +1786,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1798,7 +1798,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "encoding_rs", "image", @@ -1809,7 +1809,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "chrono", "craft-codepage", @@ -1819,7 +1819,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-behavior", "craft-keymap", @@ -1835,7 +1835,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "flate2", "serde", @@ -1846,7 +1846,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1858,7 +1858,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "async-channel", "async-io", @@ -1889,7 +1889,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1898,7 +1898,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-behavior", "craft-host", @@ -1922,7 +1922,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1933,7 +1933,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-eps", "flate2", @@ -1947,7 +1947,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "encoding_rs", "flate2", @@ -1958,7 +1958,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "dispatch2", "egui", @@ -1971,7 +1971,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1990,7 +1990,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-atomic", "craft-host", @@ -2007,7 +2007,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "fax", "hayro-ccitt", @@ -2018,7 +2018,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-image-codecs", "craft-xml", @@ -2039,7 +2039,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-behavior", "craft-keymap", @@ -2051,7 +2051,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2076,7 +2076,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2091,7 +2091,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-atomic", "craft-behavior", @@ -2106,7 +2106,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "serde", "thiserror 2.0.21", @@ -2116,7 +2116,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "serde", "thiserror 2.0.21", @@ -2125,7 +2125,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-behavior", "craft-keymap", @@ -2140,12 +2140,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2159,7 +2159,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-behavior", "craft-i18n", @@ -2175,7 +2175,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "accesskit", "craft-behavior", @@ -2213,7 +2213,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2224,7 +2224,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-behavior", "craft-host", @@ -2242,7 +2242,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-behavior", "craft-host", @@ -2263,7 +2263,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-behavior", "craft-host", @@ -2284,7 +2284,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-behavior", "craft-host", @@ -2303,7 +2303,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "base64 0.22.1", "chrono", @@ -2335,7 +2335,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "flate2", "serde", @@ -2346,7 +2346,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2356,7 +2356,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "js-sys", "serde_json", @@ -2367,7 +2367,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "winsafe", ] @@ -2375,7 +2375,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "craft-appkit", "craft-atomic", @@ -2407,7 +2407,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "quick-xml 0.41.0", "serde", @@ -2752,7 +2752,7 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "ecolor" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" +source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" dependencies = [ "bytemuck", "emath", @@ -2785,7 +2785,7 @@ dependencies = [ [[package]] name = "eframe" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" +source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" dependencies = [ "ahash", "bytemuck", @@ -2820,7 +2820,7 @@ dependencies = [ [[package]] name = "egui" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" +source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" dependencies = [ "accesskit", "ahash", @@ -2839,7 +2839,7 @@ dependencies = [ [[package]] name = "egui-wgpu" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" +source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" dependencies = [ "ahash", "bytemuck", @@ -2858,7 +2858,7 @@ dependencies = [ [[package]] name = "egui-winit" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" +source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" dependencies = [ "accesskit_winit", "arboard", @@ -2883,7 +2883,7 @@ dependencies = [ [[package]] name = "egui_extras" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" +source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" dependencies = [ "ahash", "egui", @@ -2897,7 +2897,7 @@ dependencies = [ [[package]] name = "egui_glow" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" +source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" dependencies = [ "bytemuck", "egui", @@ -2910,7 +2910,7 @@ dependencies = [ [[package]] name = "egui_kittest" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" +source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" dependencies = [ "dify", "eframe", @@ -2936,7 +2936,7 @@ checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be" [[package]] name = "emath" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" +source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" dependencies = [ "bytemuck", ] @@ -3017,7 +3017,7 @@ dependencies = [ [[package]] name = "epaint" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" +source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" dependencies = [ "ahash", "bytemuck", @@ -3043,7 +3043,7 @@ dependencies = [ [[package]] name = "epaint_default_fonts" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" +source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" [[package]] name = "equivalent" @@ -3762,7 +3762,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "brotli", "hayro-postscript", @@ -3771,7 +3771,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3789,7 +3789,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3807,12 +3807,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "flate2", "hayro-ccitt", @@ -4795,7 +4795,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4952,7 +4952,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=57c8c8d48819e98d483e65a623c1a1b77a7091d3#57c8c8d48819e98d483e65a623c1a1b77a7091d3" +source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" dependencies = [ "arrayvec", "kurbo 0.13.1", @@ -10762,14 +10762,14 @@ dependencies = [ [[patch.unused]] name = "egui_demo_lib" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" +source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" [[patch.unused]] name = "egui_inspection" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" +source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" [[patch.unused]] name = "egui_system_font_provider" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=5dded1756441dfcc6d84ab43be370df2d89843b7#5dded1756441dfcc6d84ab43be370df2d89843b7" +source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443" diff --git a/Cargo.toml b/Cargo.toml index c00cdc10bf..1dfeb423a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,46 +11,46 @@ rust-version = "1.95" repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } # The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON. -craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } # `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile. -craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3", features = ["pcraft-pixels"] } +craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6", features = ["pcraft-pixels"] } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } # The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names # the members it imports. -craft = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } # Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui # without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes. -craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } @@ -193,25 +193,25 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3" } -ecolor = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } -emath = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } -epaint = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } -epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } -egui = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } -egui-winit = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } -egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } -egui_glow = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } -egui_extras = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } -egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } -egui_system_font_provider = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } -eframe = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } -egui_demo_lib = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } -egui_inspection = { git = "https://github.com/storytold/egui.git", rev = "5dded1756441dfcc6d84ab43be370df2d89843b7" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +ecolor = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } +emath = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } +epaint = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } +epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } +egui = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } +egui-winit = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } +egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } +egui_glow = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } +egui_extras = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } +egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } +egui_system_font_provider = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } +eframe = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } +egui_demo_lib = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } +egui_inspection = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index 6947954a79..7f84c95338 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -27,7 +27,7 @@ log = { workspace = true } # `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback. eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] } # The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft. -craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "57c8c8d48819e98d483e65a623c1a1b77a7091d3", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index 29758d7de0..6dafe7147a 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "57c8c8d48819e98d483e65a623c1a1b77a7091d3"; +const REV: &str = "27c2cbf821ccf3842f789484f0234460cfcd07a6"; const PACKAGES: &[(&str, &str, &str)] = &[ ("craft-pdf", "0.1.0", REV), ("krilla", "0.8.2", REV), From 267b55bfa52697d6437c9a908053d1c390304c2c Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sun, 29 Nov 2026 13:40:19 +0100 Subject: [PATCH 51/61] Read retained paint chunks in UI label tests Collect painted swatch labels from retained paint chunks as well as flat shapes. Keep the localized-label and physical pointer assertions unchanged in scope. --- crates/ui-egui/src/panels/library_panel/tests.rs | 14 ++++++-------- crates/ui-egui/src/tests/labels.rs | 1 + 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/crates/ui-egui/src/panels/library_panel/tests.rs b/crates/ui-egui/src/panels/library_panel/tests.rs index 272ffc1df8..a08ea664f8 100644 --- a/crates/ui-egui/src/panels/library_panel/tests.rs +++ b/crates/ui-egui/src/panels/library_panel/tests.rs @@ -767,14 +767,12 @@ fn built_in_library_swatches_are_listed_in_the_ui_language() { let panel = shown(&app); app.run("ui.libraryPanel", json!({"panel": panel, "view": "smallList"})).unwrap(); let draw = |app: &mut VectorcraftApp, ui: &mut Ui| show(app, ui, &panel); - let mut texts = vec![]; - for _ in 0..2 { - let out = draw_frame(&mut app, &ctx, &draw, vec![]); - texts = - out.shapes.iter().filter_map(|c| if let egui::Shape::Text(t) = &c.shape { Some(t.galley.text().to_string()) } else { None }).collect(); - } - assert!(texts.iter().any(|t| t == "Argile") && texts.iter().any(|t| t == "Argile 1"), "{texts:?}"); - assert!(!texts.iter().any(|t| t == "Clay" || t == "Clay 1"), "{texts:?}"); + draw_frame(&mut app, &ctx, &draw, vec![]); + let out = draw_frame(&mut app, &ctx, &draw, vec![]); + let painted = crate::tests_labels::shapes_text(&out); + let texts: Vec<_> = painted.lines().collect(); + assert!(texts.contains(&"Argile") && texts.contains(&"Argile 1"), "{texts:?}"); + assert!(!texts.contains(&"Clay") && !texts.contains(&"Clay 1"), "{texts:?}"); let lib = SwatchLibraries::get(&app, "earth-tones").unwrap().1; // The browser's Find matches the shown name and the stored one. let rows = SwatchLibraries::rows(&lib, "earth-tones"); diff --git a/crates/ui-egui/src/tests/labels.rs b/crates/ui-egui/src/tests/labels.rs index 70cd282490..7213bc8b4a 100644 --- a/crates/ui-egui/src/tests/labels.rs +++ b/crates/ui-egui/src/tests/labels.rs @@ -34,6 +34,7 @@ pub(crate) fn shapes_text(out: &egui::FullOutput) -> String { out.push('\n'); } Shape::Vec(v) => v.iter().for_each(|s| collect(s, out)), + Shape::PaintChunk(shapes) => shapes.iter().for_each(|clipped| collect(&clipped.shape, out)), _ => {} } } From dd93247cbf4a8773ab0f3cad35f4fb2236a9aa38 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 04:41:14 -0800 Subject: [PATCH 52/61] Scripts: tests index page items topmost first and check the preset fallback Cause of the script_dom and script_dom_paths failures: main's 9872e6b6795 ("page items report their own members, and lists start with the topmost object") made pageItems, pathItems and the selection list art topmost first. The branch's tests still indexed the objects bottom first, so pageItems[1] and pathItems[0] named the other object. The tests now make the objects in the order the lists read them, and index them topmost first. The own-members test asked about rotate, which this branch makes available, so it now asks about transform, which is not available yet. The fallback test for addDocument relied on five 1,000,000 pt artboards not fitting, but a new DocumentPreset puts them in one column. It now unsets the layout so the built-in preset puts them in one row, and the test fails when addDocument falls back to the saved preset of the same name. --- crates/engine/src/tests/script_dom.rs | 15 +++++++++++---- crates/engine/src/tests/script_dom_paths.rs | 8 +++++--- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/crates/engine/src/tests/script_dom.rs b/crates/engine/src/tests/script_dom.rs index 15a1ee1320..5d6b14da3b 100644 --- a/crates/engine/src/tests/script_dom.rs +++ b/crates/engine/src/tests/script_dom.rs @@ -1081,10 +1081,11 @@ fn selecting_an_item_keeps_the_direct_selected_anchors_of_others() { s.execute("select.add", &json!({"ids": [b.0]})).unwrap(); let anchors = s.active().unwrap().selection.anchors.clone(); assert!(anchors.contains_key(&a)); - log(&mut s, "app.activeDocument.pageItems[1].selected = false;"); + // Lists start with the topmost object, so `b` is `pageItems[0]`. + log(&mut s, "app.activeDocument.pageItems[0].selected = false;"); let sel = &s.active().unwrap().selection; assert_eq!((sel.objects.clone(), sel.anchors.clone()), (vec![a], anchors.clone())); - log(&mut s, "app.activeDocument.pageItems[1].selected = true;"); + log(&mut s, "app.activeDocument.pageItems[0].selected = true;"); let sel = &s.active().unwrap().selection; assert_eq!((sel.objects.clone(), sel.anchors.get(&a)), (vec![a, b], anchors.get(&a))); } @@ -1506,7 +1507,13 @@ fn document_preset_applies_only_its_given_fields() { assert_eq!(s.documents().len(), 2, "a refused preset makes no document"); // A saved preset with the built-in preset's name does not make the refused settings fit. s.execute("file.newPresets.save", &json!({"name": "Letter", "artboardLayout": "column"})).unwrap(); - let e = failure(&mut s, "var p = new DocumentPreset(); p.width = 1000000; p.numArtboards = 5; app.documents.addDocument('Print', p);"); + // With the layout unset, the built-in preset puts the five 1,000,000 pt artboards in one row, + // which does not fit, while the saved preset would put them in one column. + let e = failure( + &mut s, + "var p = new DocumentPreset(); p.width = 1000000; p.numArtboards = 5;\ + p.artboardLayout = undefined; p.artboardRowsOrCols = undefined; app.documents.addDocument('Print', p);", + ); assert!(e.contains("don't fit"), "{e}"); assert_eq!(s.documents().len(), 2, "settings the built-in preset refuses make no document"); } @@ -2181,7 +2188,7 @@ fn page_items_report_their_available_members_as_their_own() { vc.log([p.hasOwnProperty('opacity'), p.hasOwnProperty('typename'), p.hasOwnProperty('duplicate'),\ Object.prototype.hasOwnProperty.call(p, 'name'), p.propertyIsEnumerable('opacity'), d.hasOwnProperty('selection'),\ app.hasOwnProperty('activeDocument')]);\ - vc.log([p.hasOwnProperty('isIsolated'), p.hasOwnProperty('rotate'), d.hasOwnProperty('layers'),\ + vc.log([p.hasOwnProperty('isIsolated'), p.hasOwnProperty('transform'), d.hasOwnProperty('layers'),\ p.hasOwnProperty('nosuch'), p.hasOwnProperty('hasOwnProperty'), p.hasOwnProperty('constructor')]);\ vc.log([keys.indexOf('opacity') >= 0, keys.indexOf('typename') >= 0, keys.indexOf('duplicate'), keys.indexOf('isIsolated')]);", ); diff --git a/crates/engine/src/tests/script_dom_paths.rs b/crates/engine/src/tests/script_dom_paths.rs index fe02779654..ddf2b6188f 100644 --- a/crates/engine/src/tests/script_dom_paths.rs +++ b/crates/engine/src/tests/script_dom_paths.rs @@ -26,12 +26,13 @@ fn rect(s: &mut Session, x: f64, y: f64, w: f64, h: f64) -> NodeId { NodeId(s.execute("shape.rectangle", &json!({"x": x, "y": y, "width": w, "height": h})).unwrap()["id"].as_u64().unwrap()) } -/// A 400 × 300 pt document with two rectangles. +/// A 400 × 300 pt document with two rectangles, `a` above `b`. Lists start with the topmost +/// object, so `a` is `pathItems[0]` and `b` is `pathItems[1]`. fn doc() -> (Session, NodeId, NodeId) { let mut s = Session::new(); s.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); - let a = rect(&mut s, 10.0, 20.0, 30.0, 40.0); let b = rect(&mut s, 100.0, 100.0, 50.0, 50.0); + let a = rect(&mut s, 10.0, 20.0, 30.0, 40.0); s.execute("select.none", &json!({})).unwrap(); (s, a, b) } @@ -880,7 +881,8 @@ fn locked_paths_and_wrong_objects_are_refused() { } assert_eq!(art(&s), before); s.execute("text.create", &json!({"x": 10, "y": 250, "text": "hi"})).unwrap(); - let e = failure(&mut s, "var t = app.activeDocument.pageItems[2]; Object.getOwnPropertyDescriptor(PathItem.prototype, 'closed').get.call(t);"); + // The text is the topmost object, and lists start with the topmost object. + let e = failure(&mut s, "var t = app.activeDocument.pageItems[0]; Object.getOwnPropertyDescriptor(PathItem.prototype, 'closed').get.call(t);"); assert!(e.contains("not a PathItem"), "{e}"); let e = failure(&mut s, "Object.getOwnPropertyDescriptor(PathPoint.prototype, 'anchor').get.call({});"); assert!(e.contains("not a PathPoint"), "{e}"); From 98a8cda0273b79dbd66fda2846c733b943b88a16 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sun, 29 Nov 2026 14:25:08 +0100 Subject: [PATCH 53/61] Track retained paint in VectorCraft menu and readout tests Keep the existing pointer and text expectations on composed paint output. Preserve paint order and apply the retained transforms and clipping when finding drawn controls. --- crates/ui-egui/src/tests/labels.rs | 35 ++++++---- crates/ui-egui/src/tests/selectall.rs | 21 +++--- crates/ui-egui/src/tests/slices.rs | 8 +-- crates/ui-egui/src/tests/trace_runs.rs | 9 +-- .../tests/image_trace_ignore_sampler.rs | 1 + crates/ui-egui/tests/panel_readout_copy.rs | 64 ++++++++++--------- 6 files changed, 69 insertions(+), 69 deletions(-) diff --git a/crates/ui-egui/src/tests/labels.rs b/crates/ui-egui/src/tests/labels.rs index 7213bc8b4a..ea2a08be62 100644 --- a/crates/ui-egui/src/tests/labels.rs +++ b/crates/ui-egui/src/tests/labels.rs @@ -25,22 +25,33 @@ pub(crate) fn painted_text(app: &mut VectorcraftApp, mut f: impl FnMut(&mut Vect shapes_text(&out) } -/// Every string a frame painted, one per line. -pub(crate) fn shapes_text(out: &egui::FullOutput) -> String { - fn collect(s: &Shape, out: &mut String) { - match s { - Shape::Text(t) => { - out.push_str(t.galley.text()); - out.push('\n'); - } - Shape::Vec(v) => v.iter().for_each(|s| collect(s, out)), - Shape::PaintChunk(shapes) => shapes.iter().for_each(|clipped| collect(&clipped.shape, out)), +/// Text shapes in paint order, with their composed window transform. +pub(crate) fn text_shapes(out: &egui::FullOutput) -> Vec<(&egui::epaint::TextShape, egui::emath::TSTransform)> { + use egui::emath::TSTransform; + + fn collect<'a>(shape: &'a Shape, transform: TSTransform, out: &mut Vec<(&'a egui::epaint::TextShape, TSTransform)>) { + match shape { + Shape::Text(text) => out.push((text, transform)), + Shape::Vec(shapes) => shapes.iter().for_each(|shape| collect(shape, transform, out)), + Shape::PaintChunk(shapes) => shapes.iter().for_each(|clipped| { + collect(&clipped.shape, transform * clipped.transform_after_tessellation, out); + }), _ => {} } } + let mut text = Vec::new(); + for clipped in &out.shapes { + collect(&clipped.shape, clipped.transform_after_tessellation, &mut text); + } + text +} + +/// Every string a frame painted, one per line. +pub(crate) fn shapes_text(out: &egui::FullOutput) -> String { let mut text = String::new(); - for c in &out.shapes { - collect(&c.shape, &mut text); + for (shape, _) in text_shapes(out) { + text.push_str(shape.galley.text()); + text.push('\n'); } text } diff --git a/crates/ui-egui/src/tests/selectall.rs b/crates/ui-egui/src/tests/selectall.rs index ed97ffcdb7..d7ae5f9b04 100644 --- a/crates/ui-egui/src/tests/selectall.rs +++ b/crates/ui-egui/src/tests/selectall.rs @@ -297,13 +297,11 @@ fn the_clipboard_keys_in_a_focused_field_edit_its_text() { /// The rectangle of the text `text` painted last in a frame's output. fn text_rect(out: &egui::FullOutput, text: &str) -> Rect { - out.shapes - .iter() + crate::tests_labels::text_shapes(out) + .into_iter() .rev() - .find_map(|s| match &s.shape { - egui::Shape::Text(t) if t.galley.text() == text => Some(t.galley.rect.translate(t.pos.to_vec2())), - _ => None, - }) + .find(|(shape, ..)| shape.galley.text() == text) + .map(|(shape, transform)| transform * shape.galley.rect.translate(shape.pos.to_vec2())) .unwrap_or_else(|| panic!("no {text:?} painted")) } @@ -567,12 +565,11 @@ fn panel_text_copied_before_the_art_formats_are_written_stays_on_the_clipboard() /// The centre of the text `label` painted last (in the topmost layer) in a frame's output; with /// `title`, the first one painted (the menu bar's). fn text_at(out: &egui::FullOutput, label: &str, title: bool) -> Pos2 { - let mut shapes: Box> = if title { Box::new(out.shapes.iter()) } else { Box::new(out.shapes.iter().rev()) }; - shapes - .find_map(|s| match &s.shape { - egui::Shape::Text(t) if t.galley.text().trim() == label => Some(Rect::from_min_size(t.pos, t.galley.size()).center()), - _ => None, - }) + let shapes = crate::tests_labels::text_shapes(out); + let label_matches = |(shape, _): &(&egui::epaint::TextShape, egui::emath::TSTransform)| shape.galley.text().trim() == label; + let found = if title { shapes.into_iter().find(label_matches) } else { shapes.into_iter().rev().find(label_matches) }; + found + .map(|(shape, transform)| transform * Rect::from_min_size(shape.pos, shape.galley.size()).center()) .unwrap_or_else(|| panic!("no {label:?} painted")) } diff --git a/crates/ui-egui/src/tests/slices.rs b/crates/ui-egui/src/tests/slices.rs index c1c8244084..fe0999262d 100644 --- a/crates/ui-egui/src/tests/slices.rs +++ b/crates/ui-egui/src/tests/slices.rs @@ -18,13 +18,7 @@ fn frame_texts(app: &mut VectorcraftApp, ctx: &egui::Context) -> Vec { let raw = egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0))), ..Default::default() }; let mut out = ctx.run_ui(raw, |ui| crate::canvas::show(app, ui)); out.textures_delta.clear(); - out.shapes - .iter() - .filter_map(|c| match &c.shape { - egui::Shape::Text(t) => Some(t.galley.text().to_string()), - _ => None, - }) - .collect() + crate::tests_labels::text_shapes(&out).into_iter().map(|(shape, _)| shape.galley.text().to_string()).collect() } #[test] diff --git a/crates/ui-egui/src/tests/trace_runs.rs b/crates/ui-egui/src/tests/trace_runs.rs index 17a92f9785..48da48aad2 100644 --- a/crates/ui-egui/src/tests/trace_runs.rs +++ b/crates/ui-egui/src/tests/trace_runs.rs @@ -77,14 +77,7 @@ fn undos(app: &VectorcraftApp) -> usize { fn progress(app: &mut VectorcraftApp, ctx: &egui::Context, time: f64) -> String { let mut out = ctx.run_ui(egui::RawInput { time: Some(time), ..Default::default() }, |ui| export_progress::show(app, ui)); out.textures_delta.clear(); - let mut texts = String::new(); - for shape in out.shapes { - if let egui::epaint::Shape::Text(t) = shape.shape { - texts.push_str(t.galley.text()); - texts.push('\n'); - } - } - texts + crate::tests_labels::shapes_text(&out) } /// Object › Image Trace › Make traces in the background, the status bar saying so, and its result is diff --git a/crates/ui-egui/tests/image_trace_ignore_sampler.rs b/crates/ui-egui/tests/image_trace_ignore_sampler.rs index 2433e8d0b3..f9e6bff2ed 100644 --- a/crates/ui-egui/tests/image_trace_ignore_sampler.rs +++ b/crates/ui-egui/tests/image_trace_ignore_sampler.rs @@ -999,6 +999,7 @@ fn review_preset_assert_shown(app: &mut VectorcraftApp, ctx: &egui::Context, pre match shape { egui::Shape::Text(drawn) => out.push(drawn.galley.text().to_string()), egui::Shape::Vec(shapes) => shapes.iter().for_each(|shape| texts(shape, out)), + egui::Shape::PaintChunk(shapes) => shapes.iter().for_each(|clipped| texts(&clipped.shape, out)), _ => {} } } diff --git a/crates/ui-egui/tests/panel_readout_copy.rs b/crates/ui-egui/tests/panel_readout_copy.rs index e3145401ae..7c65f085e6 100644 --- a/crates/ui-egui/tests/panel_readout_copy.rs +++ b/crates/ui-egui/tests/panel_readout_copy.rs @@ -175,35 +175,44 @@ fn copies(out: &egui::FullOutput) -> Vec { out.platform_output.commands.iter().filter_map(|c| if let egui::OutputCommand::CopyText(s) = c { Some(s.clone()) } else { None }).collect() } -fn text_shape<'a>(shape: &'a Shape, text: &str) -> Option<&'a egui::epaint::TextShape> { - match shape { - Shape::Text(t) if t.galley.text() == text => Some(t), - Shape::Vec(v) => v.iter().rev().find_map(|s| text_shape(s, text)), - _ => None, +fn visible_paint(out: &egui::FullOutput) -> Vec<(&egui::epaint::TextShape, Rect, Pos2)> { + use egui::emath::TSTransform; + + fn collect<'a>(shape: &'a Shape, transform: TSTransform, clip: Rect, text: &mut Vec<(&'a egui::epaint::TextShape, Rect, Pos2)>) { + match shape { + Shape::Text(t) => { + let drawn = transform * t.galley.rect.translate(t.pos.to_vec2()); + let bounds = drawn.intersect(clip); + if bounds.is_positive() { + text.push((t, bounds, drawn.center())); + } + } + Shape::Vec(v) => v.iter().for_each(|s| collect(s, transform, clip, text)), + Shape::PaintChunk(v) => v.iter().for_each(|s| { + collect(&s.shape, transform * s.transform_after_tessellation, clip.intersect(transform * s.clip_rect), text); + }), + _ => {} + } } + + let mut text = Vec::new(); + for s in &out.shapes { + collect(&s.shape, s.transform_after_tessellation, s.clip_rect, &mut text); + } + text } fn painted(out: &egui::FullOutput, text: &str) -> (Rect, bool) { - out.shapes - .iter() + visible_paint(out) + .into_iter() .rev() - .find_map(|s| { - let t = text_shape(&s.shape, text)?; - let r = t.galley.rect.translate(t.pos.to_vec2()); - s.clip_rect.intersects(r).then_some((r.intersect(s.clip_rect), t.galley.elided)) - }) + .find(|(shape, ..)| shape.galley.text() == text) + .map(|(shape, bounds, _)| (bounds, shape.galley.elided)) .unwrap_or_else(|| panic!("fixture: no visible actual readout {text:?}")) } fn visible_text_count(out: &egui::FullOutput, text: &str) -> usize { - fn count(shape: &Shape, clip: Rect, text: &str) -> usize { - match shape { - Shape::Text(t) if t.galley.text() == text => usize::from(t.galley.rect.translate(t.pos.to_vec2()).intersect(clip).is_positive()), - Shape::Vec(v) => v.iter().map(|s| count(s, clip, text)).sum(), - _ => 0, - } - } - out.shapes.iter().map(|s| count(&s.shape, s.clip_rect, text)).sum() + visible_paint(out).into_iter().filter(|(shape, ..)| shape.galley.text() == text).count() } fn copy_at(a: &mut App, at: Pos2, value: &str) -> egui::FullOutput { @@ -626,15 +635,10 @@ fn location_node_rect(node: &egui::accesskit::Node) -> Rect { Rect::from_min_max(egui::pos2(b.x0 as f32, b.y0 as f32), egui::pos2(b.x1 as f32, b.y1 as f32)) } -fn shortened_location(shape: &Shape, rect: Rect, full: &str) -> bool { - match shape { - Shape::Text(t) => { - let painted = t.galley.rect.translate(t.pos.to_vec2()); - rect.contains(painted.center()) && t.galley.text().contains('…') && t.galley.text() != full - } - Shape::Vec(shapes) => shapes.iter().any(|s| shortened_location(s, rect, full)), - _ => false, - } +fn shortened_location(out: &egui::FullOutput, rect: Rect, full: &str) -> bool { + visible_paint(out) + .into_iter() + .any(|(shape, bounds, center)| rect.contains(center) && bounds.contains(center) && shape.galley.text().contains('…') && shape.galley.text() != full) } #[test] @@ -722,7 +726,7 @@ fn panel_readout_long_location_fits_and_copies_by_pointer_accessibility_and_keyb let location_rect = location_node_rect(node); assert!(body.contains_rect(location_rect), "{locale}: the fitted Location remains inside the panel"); assert!( - out.shapes.iter().any(|s| shortened_location(&s.shape, location_rect, location)), + shortened_location(&out, location_rect, location), "{locale}: the long path must actually be shortened on screen" ); let buttons: Vec<_> = From b3514b627778a7fc91e7a5aca9ebc85b3380d80b Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 29 Nov 2026 08:26:47 -0500 Subject: [PATCH 54/61] fix(packaging): resolve SonarCloud regex reliability findings in nightly-release-tests.py (#10076) --- packaging/nightly-release-tests.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packaging/nightly-release-tests.py b/packaging/nightly-release-tests.py index d8c86d36a2..9738b641bd 100755 --- a/packaging/nightly-release-tests.py +++ b/packaging/nightly-release-tests.py @@ -110,7 +110,7 @@ def assert_caller_secrets(source, job_name, names): for value, children in (*root.values(), *job.values()): outside_map = "\n".join([value or "", *children]) # Scan all remaining text: quoted braces can appear before a secret reference. - if re.search(r"(?im)^\s*environment:|\bsecrets\b", outside_map): + if re.search(r"(?im)(?:^\s*environment:)|(?:\bsecrets\b)", outside_map): raise ValueError("secret bindings belong only in the signer map") @@ -600,10 +600,13 @@ def app_workflows(): return {path.name: path.read_text() for path in sorted((ROOT / ".github/workflows").glob("*.y*ml"))} -WORKFLOW_KEY = re.compile(r'''("(?:[^"\\]|\\.)*"|'(?:[^']|'')*'|[^\s'"#{}\[\],:&*!|>%@`?-][^:#,{}]*?|-[^\s:#][^:#,{}]*?)\s*:(?:\s+(.*))?$''') +WORKFLOW_KEY = re.compile( + r'''((?:"(?:[^"\\]|\\.)*"|'(?:[^']|'')*')[ \t]*|[^\s'"#{}\[\],:&*!|>%@`?-][^:#,{}]*|-[^\s:#][^:#,{}]*):(?:[ \t]+(.*))?$''' +) def _workflow_key(text): + text = text.rstrip() if text.startswith('"'): return None if "\\" in text else text[1:-1] if text.startswith("'"): @@ -620,7 +623,10 @@ def _workflow_value(text): if text.startswith("'"): quoted = re.match(r"'((?:[^']|'')*)'\s*(?:#.*)?$", text) return None if quoted is None else quoted.group(1).replace("''", "'") - return re.split(r"\s+#", text, maxsplit=1)[0].strip() + for idx, ch in enumerate(text): + if ch == "#" and idx > 0 and text[idx - 1].isspace(): + return text[:idx].rstrip() + return text def _strip_comment(text): From 7a71837deac9f323eeb80fcf8b10ea481e2a7a43 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 05:51:46 -0800 Subject: [PATCH 55/61] Scripts: keep new-art defaults and direct selections through path edits - PathPoint.remove() renumbers the direct-selected anchors and segments after the removed point, and drops the removed anchor and the selected segments it ended, through selection commands after the points are written. A removed anchor no longer stays selected, and the same index no longer selects a different point. - pathItems.add() reads new art's paint after the target document is active, so a path added to a document in the back keeps the stroke that document's selection gives new art. - Paths a script draws put new art's paint back afterwards, so a defaultStrokeWidth the script set applies to every path it draws, not only the first. - appearance.setNewArt refuses a fill or stroke paint with a setting a paint does not take, such as opacity, instead of applying the rest. --- crates/engine/src/cmd/newart.rs | 5 + crates/engine/src/script/dom/paths.rs | 117 ++++++++++++++++---- crates/engine/src/tests/newart.rs | 3 + crates/engine/src/tests/script_dom_paths.rs | 56 ++++++++++ 4 files changed, 157 insertions(+), 24 deletions(-) diff --git a/crates/engine/src/cmd/newart.rs b/crates/engine/src/cmd/newart.rs index c7398db1da..f420054d11 100644 --- a/crates/engine/src/cmd/newart.rs +++ b/crates/engine/src/cmd/newart.rs @@ -72,6 +72,8 @@ pub fn specs() -> Vec { /// The most dash and gap lengths `appearance.setNewArt` takes. const MAX_DASHES: usize = 64; +/// The settings a `fill` or `stroke` paint of `appearance.setNewArt` takes. +const PAINT_KEYS: [&str; 6] = ["color", "none", "swatch", "tint", "gradient", "keepModel"]; /// The largest dash, gap or dash offset `appearance.setNewArt` takes, in points. const MAX_DASH_LENGTH: f64 = 1_000_000.0; @@ -116,6 +118,9 @@ fn set_new_art(s: &mut Session, p: &Value) -> Result { if !v.is_object() { return Err(bad(C, format!("{key} must be a paint object (color, none, swatch or gradient), got {v}"))); } + if let Some(k) = v.as_object().and_then(|o| o.keys().find(|k| !PAINT_KEYS.contains(&k.as_str()))) { + return Err(bad(C, format!("{key}: unknown setting `{k}` (a paint takes {})", PAINT_KEYS.join(", ")))); + } if v.get("swatch").is_some_and(|w| !w.is_string()) { return Err(bad(C, format!("{key}: `swatch` must be a swatch name"))); } diff --git a/crates/engine/src/script/dom/paths.rs b/crates/engine/src/script/dom/paths.rs index e9510871c4..27b449a5b9 100644 --- a/crates/engine/src/script/dom/paths.rs +++ b/crates/engine/src/script/dom/paths.rs @@ -459,14 +459,18 @@ fn made_id(r: &Value) -> std::result::Result { } /// Runs the command `id` that makes a path in `doc` on top of the active layer, the selection kept, -/// and reverses the new path's direction when `reversed`. → the new path. +/// and reverses the new path's direction when `reversed`. → the new path. Selecting the new path +/// and putting the selection back load the selected objects' paint and stroke width into new art, +/// so new art's paint from before, the defaults a script set included, is put back. fn make(h: &super::Host, doc: Doc, id: &str, params: &Value, reversed: bool) -> Answer { - let made = on_doc(h, doc.uid, true, |h| { - let id = made_id(&drawing_normally(h, || command_value(h, id, params))?.1)?; - if reversed { - command(h, "path.reverse", &json!({"ids": [id.0]}))?; - } - Ok(id) + let made = keeping_paint(h, || { + on_doc(h, doc.uid, true, |h| { + let id = made_id(&drawing_normally(h, || command_value(h, id, params))?.1)?; + if reversed { + command(h, "path.reverse", &json!({"ids": [id.0]}))?; + } + Ok(id) + }) })?; let s = h.session.borrow(); let st = s.documents().iter().find(|d| d.uid == doc.uid).ok_or_else(|| HostError::Error(super::STALE_DOCUMENT.into()))?; @@ -616,22 +620,23 @@ fn items_star(h: &super::Host, a: &[Data]) -> Answer { /// path is set back to none in the same step, and new art keeps the paint it had before. fn items_add(h: &super::Host, a: &[Data]) -> Answer { let doc = items_doc(h, a)?; - let add = |h: &super::Host, unpainted: bool| { + // New art's paint is read with the document active, since activating a document can load its + // selection's appearance into new art. Selecting the new path loads its temporary stroke into + // new art, and putting the selection back does not undo that, so new art's paint from before + // the path is put back. + let made = keeping_paint(h, || { on_doc(h, doc.uid, true, |h| { + let unpainted = { + let ap = h.session.borrow().new_art(); + ap.fill_paint().is_none() && ap.stroke_paint().is_none() + }; let id = made_id(&drawing_normally(h, || command_value(h, "path.create", &json!({"d": ""})))?.1)?; if unpainted { command(h, "paint.setStroke", &json!({"none": true, "ids": [id.0]}))?; } Ok(id) }) - }; - let unpainted = { - let ap = h.session.borrow().new_art(); - ap.fill_paint().is_none() && ap.stroke_paint().is_none() - }; - // Selecting the new path loads its temporary stroke into new art, and putting the selection - // back does not undo that, so new art's paint from before the path is put back. - let made = if unpainted { keeping_paint(h, || add(h, true))? } else { add(h, false)? }; + })?; let s = h.session.borrow(); let st = s.documents().iter().find(|d| d.uid == doc.uid).ok_or_else(|| HostError::Error(super::STALE_DOCUMENT.into()))?; Ok(super::item_ref(h, st, made)) @@ -1652,20 +1657,84 @@ fn path_selected_points(h: &super::Host, a: &[Data]) -> Answer { /// `remove()`: deletes the point; a subpath left with no points goes too. fn pt_remove(h: &super::Host, a: &[Data]) -> Answer { let (item, i) = this_point(h, a)?; - edit_points(h, item, |subs| { - if let Some((s, j)) = locate(subs, i) - && let Some(sp) = subs.get_mut(s) - { - sp.anchors.remove(j); - if sp.anchors.is_empty() { - subs.remove(s); - } + // A direct selection of the path's points is renumbered after the removal. + let selected = { + let s = h.session.borrow(); + let st = s.documents().iter().find(|d| d.uid == item.doc.uid).ok_or_else(|| HostError::Error(super::STALE_DOCUMENT.into()))?; + let sel = &st.selection; + (sel.anchors.contains_key(&item.id) || sel.segments.contains_key(&item.id)).then(|| sel.clone()) + }; + let removed = edit_points(h, item, |subs| { + let (s, j) = locate(subs, i)?; + let sp = subs.get_mut(s)?; + // The segment that closes a closed subpath ends at its first anchor. + let closing = (sp.closed && j == 0).then(|| sp.anchors.len() - 1); + sp.anchors.remove(j); + let gone = sp.anchors.is_empty(); + if gone { + subs.remove(s); } + Some((s, j, gone, closing)) })?; + if let (Some((s, j, gone, closing)), Some(mut sel)) = (removed, selected) { + // The points are written first, and the selection is then set with selection commands, + // which the journal records with the edit. + flush(h)?; + renumber_selected(&mut sel, item.id, s, j, gone, closing); + on_doc(h, item.doc.uid, false, |h| { + let doc = h.session.borrow().active().map(|st| st.doc.clone()).ok_or_else(|| HostError::Error(super::STALE_DOCUMENT.into()))?; + super::restore_selection(h, &doc, &sel) + })?; + } cut_points(h, item); Ok(Data::Undefined) } +/// Updates the direct selection `sel` of the path `id` after the anchor `j` of its subpath `s` was +/// removed, and the subpath with it when `gone`: the anchor, the segments it ended and their other +/// ends leave the selection, unless a segment still selected ends there, and the anchors, segments +/// and subpaths after it keep the points they selected. `closing` is the segment that closed the +/// subpath at the removed anchor, when it did. +fn renumber_selected(sel: &mut crate::doc::Selection, id: NodeId, s: usize, j: usize, gone: bool, closing: Option) { + // An anchor (or a segment, by its first anchor) after the removed one moves down one place. + let shift = |(p, k): (usize, usize), segment: bool| -> Option<(usize, usize)> { + match p.cmp(&s) { + std::cmp::Ordering::Less => Some((p, k)), + std::cmp::Ordering::Greater => Some((if gone { p - 1 } else { p }, k)), + std::cmp::Ordering::Equal if gone => None, + std::cmp::Ordering::Equal if k == j || (segment && (k + 1 == j || closing == Some(k))) => None, + std::cmp::Ordering::Equal => Some((p, if k > j { k - 1 } else { k })), + } + }; + // The other ends of the selected segments that the removal joins, in the new numbering: the + // anchor before the removed one and the one after it. + let mut ends: Vec<(usize, usize)> = Vec::new(); + if let Some(segments) = sel.segments.get_mut(&id) { + let cut: Vec<(usize, usize)> = segments.iter().copied().filter(|g| shift(*g, true).is_none() && g.0 == s && !gone).collect(); + for (p, k) in cut { + // Segment k runs from anchor k to anchor k + 1; one of the two is the removed one. + let other = if k == j { k + 1 } else { k }; + // The closing segment's other end is its first anchor, the old last one. + let other = if closing == Some(k) { k } else { other }; + ends.extend(shift((p, other), false)); + } + *segments = segments.iter().filter_map(|g| shift(*g, true)).collect(); + if segments.is_empty() { + sel.segments.remove(&id); + } + } + let kept_ends: Vec<(usize, usize)> = + sel.segments.get(&id).map(|g| g.iter().flat_map(|(p, k)| [(*p, *k), (*p, k + 1)]).collect()).unwrap_or_default(); + if let Some(anchors) = sel.anchors.get_mut(&id) { + *anchors = anchors.iter().filter_map(|a| shift(*a, false)).filter(|a| !ends.contains(a) || kept_ends.contains(a)).collect(); + } + if let Some((key, a)) = sel.key_anchor + && key == id + { + sel.key_anchor = shift(a, false).filter(|a| sel.anchors.get(&id).is_some_and(|set| set.contains(a))).map(|a| (key, a)); + } +} + // ---- Registration ---- /// The members `PathItem` adds to `PageItem`'s. diff --git a/crates/engine/src/tests/newart.rs b/crates/engine/src/tests/newart.rs index a19f5ff6ab..6737666046 100644 --- a/crates/engine/src/tests/newart.rs +++ b/crates/engine/src/tests/newart.rs @@ -429,6 +429,9 @@ fn set_new_art_refuses_bad_values_with_nothing_changed() { json!({"stroke": {"tint": 50, "color": "#000000"}}), json!({"fillOverprint": "yes"}), json!({"widht": 3}), + // A setting a paint does not take, here or nested in it, is refused too. + json!({"fill": {"color": "#ff0000", "opacity": 25}}), + json!({"stroke": {"none": true, "weight": 2}}), ] { assert!(s.execute("appearance.setNewArt", ¶ms).is_err(), "accepted {params}"); assert_eq!(s.paint, before, "changed new art for {params}"); diff --git a/crates/engine/src/tests/script_dom_paths.rs b/crates/engine/src/tests/script_dom_paths.rs index ddf2b6188f..d33246aba7 100644 --- a/crates/engine/src/tests/script_dom_paths.rs +++ b/crates/engine/src/tests/script_dom_paths.rs @@ -753,6 +753,62 @@ fn an_added_path_leaves_new_art_unpainted_with_basic_appearance_off() { assert_eq!(s.paint, paint, "new art keeps no fill and no stroke"); } +/// With Basic Appearance off, a path added to a document in the back takes the appearance of that +/// document's selection, which its activation loads into new art, even when new art in the +/// document in front has no paint. +#[test] +fn a_path_added_to_a_document_in_the_back_keeps_that_documents_stroke() { + let (mut s, a, _) = doc(); + s.execute("select.set", &json!({"ids": [a.0]})).unwrap(); + s.prefs.new_art_basic = false; + s.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + s.execute("select.none", &json!({})).unwrap(); + s.prefs.new_art_basic = true; + s.execute("paint.setFill", &json!({"none": true})).unwrap(); + s.execute("paint.setStroke", &json!({"none": true})).unwrap(); + s.prefs.new_art_basic = false; + assert!(s.new_art().stroke_paint().is_none()); + let out = log(&mut s, "var d = app.documents[1]; var n = d.pathItems.add(); vc.log(n.stroked); vc.log(app.activeDocument == d);"); + assert_eq!(out, [json!(true), json!(false)]); +} + +/// Drawing a path and putting the selection back keep the defaults a script set, so a second +/// path gets them too. +#[test] +fn every_path_a_script_draws_gets_its_default_stroke_width() { + let (mut s, a, _) = doc(); + s.execute("select.set", &json!({"ids": [a.0]})).unwrap(); + let out = log( + &mut s, + "var d = app.activeDocument; d.defaultStrokeWidth = 7;\ + var r1 = d.pathItems.rectangle(10, 10, 5, 5), r2 = d.pathItems.rectangle(20, 20, 5, 5);\ + vc.log([r1.strokeWidth, r2.strokeWidth, d.defaultStrokeWidth]);", + ); + assert_eq!(out, [json!([7, 7, 7])]); +} + +/// Removing a point renumbers the direct-selected anchors after it, and a removed selected anchor +/// leaves the selection. +#[test] +fn removing_a_point_keeps_the_direct_selection_on_the_same_anchors() { + let (mut s, a, _) = doc(); + s.execute("select.anchorsMany", &json!({"items": [{"id": a.0, "anchors": [[0, 3]]}], "mode": "set"})).unwrap(); + log(&mut s, "app.activeDocument.pathItems[0].pathPoints[3].remove();"); + // A path left with no selected anchor leaves the selection, as `select.anchorsMany` leaves it. + assert_eq!(selected_anchors(&s, a), None, "the removed anchor is not selected"); + assert!(!s.active().unwrap().selection.objects.contains(&a)); + s.execute("select.anchorsMany", &json!({"items": [{"id": a.0, "anchors": [[0, 2]]}], "mode": "set"})).unwrap(); + let at = node(&s, a).path_data().unwrap().subpaths[0].anchors[2].p; + log(&mut s, "app.activeDocument.pathItems[0].pathPoints[0].remove();"); + assert_eq!(selected_anchors(&s, a), Some(vec![(0, 1)]), "the selected anchor moved down one place"); + assert_eq!(node(&s, a).path_data().unwrap().subpaths[0].anchors[1].p, at); + // A selected segment that the removal joins leaves the selection with its other end. + s.execute("select.segments", &json!({"id": a.0, "segments": [[0, 0]], "mode": "set"})).unwrap(); + log(&mut s, "app.activeDocument.pathItems[0].pathPoints[1].remove();"); + assert_eq!(selected_anchors(&s, a), None, "the segment's other end is not selected"); + assert!(!s.active().unwrap().selection.objects.contains(&a)); +} + /// [`doc`] with pattern `Dots` and spot swatch `Ink`, and path `a` with no fill or stroke. fn doc_with_paints() -> (Session, NodeId) { let (mut s, a, _) = doc(); From fa1c0a8dc4d84ffa1050996e54cf88589f96ce29 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 06:01:24 -0800 Subject: [PATCH 56/61] Tests: read retained paint chunks in every ui-egui shape walk The pinned egui replays a region that did not change as one Shape::PaintChunk of clipped shapes. Test helpers that walked out.shapes by hand stopped at the chunk, so text, meshes, rects and lines painted inside it were missed. - Add painted_shapes and flat_painted_shapes next to text_shapes in tests/labels.rs. They open Shape::Vec and Shape::PaintChunk in paint order and compose each shape's transform and clip the same way. - Route every remaining hand-written text and shape walk in the ui-egui tests through text_shapes or these helpers, keeping each test's assertions and its first-painted or last-painted order. - panel_readout_copy: the Link Info Name check called the removed text_shape helper and did not compile; it now reads visible_paint. Format the file. --- crates/ui-egui/src/canvas/panes/tests.rs | 28 +++++----------- crates/ui-egui/src/canvas/tests.rs | 13 ++------ crates/ui-egui/src/chrome/tests.rs | 12 +------ crates/ui-egui/src/dialogs/new_document.rs | 13 +++----- crates/ui-egui/src/dialogs/tests_screens.rs | 30 +++++++---------- .../src/dialogs/tracing_presets/tests.rs | 19 ++++------- crates/ui-egui/src/doc_windows/tests.rs | 12 ++----- crates/ui-egui/src/export_progress.rs | 8 ++--- crates/ui-egui/src/menus/tests.rs | 16 +++------ crates/ui-egui/src/opening/tests.rs | 8 ++--- .../ui-egui/src/panel_docking/native_tests.rs | 13 +++----- crates/ui-egui/src/panel_docking/tests.rs | 9 +++-- crates/ui-egui/src/panels/tests_appearance.rs | 16 +++------ .../src/panels/tests_brush_libraries.rs | 11 +------ .../src/panels/tests_style_libraries.rs | 11 +------ .../src/panels/tests_symbol_libraries.rs | 11 +------ crates/ui-egui/src/placing/tests.rs | 8 ++--- crates/ui-egui/src/prefs_dialog/tests.rs | 2 +- crates/ui-egui/src/tests/background.rs | 11 +------ crates/ui-egui/src/tests/dialog_layout.rs | 14 +++----- crates/ui-egui/src/tests/document_drag.rs | 13 +++----- crates/ui-egui/src/tests/labels.rs | 33 +++++++++++++++++++ crates/ui-egui/src/tests/panel_harness.rs | 10 ++---- crates/ui-egui/src/tests/picks.rs | 14 +++----- crates/ui-egui/src/tests/removeanchors.rs | 6 ++-- crates/ui-egui/src/tests/retype_runs.rs | 8 ++--- crates/ui-egui/src/tests/ruler_origin.rs | 14 +++----- crates/ui-egui/src/tests/script_run.rs | 12 ++----- crates/ui-egui/src/tests/scrub.rs | 12 +++---- crates/ui-egui/src/toolbar/tests.rs | 28 +++++----------- crates/ui-egui/tests/panel_readout_copy.rs | 22 +++++-------- 31 files changed, 147 insertions(+), 290 deletions(-) diff --git a/crates/ui-egui/src/canvas/panes/tests.rs b/crates/ui-egui/src/canvas/panes/tests.rs index 4464e67326..d5c13920ef 100644 --- a/crates/ui-egui/src/canvas/panes/tests.rs +++ b/crates/ui-egui/src/canvas/panes/tests.rs @@ -38,20 +38,12 @@ fn frame(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec /// [`frame`] on a window `size` points large. fn frame_in(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec, size: egui::Vec2) -> Vec { - fn flat(s: Shape, out: &mut Vec) { - match s { - Shape::Vec(v) => v.into_iter().for_each(|s| flat(s, out)), - s => out.push(s), - } - } let raw = egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(Pos2::ZERO, size)), max_texture_side: Some(8192), events, ..Default::default() }; let mut out = ctx.run_ui(raw, |ui| app.canvas_area(ui)); // A pane's picture is uploaded once, maybe in this frame: [`wait_ready`] finds it later. note_uploads(&mut out.textures_delta); - let mut shapes = vec![]; - out.shapes.into_iter().for_each(|c| flat(c.shape, &mut shapes)); - shapes + crate::tests_labels::flat_painted_shapes(&out.shapes) } /// A texture's picture: its pixels and size. @@ -627,15 +619,10 @@ fn art_carried_through_a_tab_drops_into_a_third_documents_pane() { // A tab's title starts with its document's name (an inactive tab shows the name alone). let names: Vec = app.session.documents().iter().map(|d| d.title()).collect(); let titles = |out: egui::FullOutput| -> Vec { - let mut t: Vec<_> = out - .shapes - .iter() - .filter_map(|s| match &s.shape { - Shape::Text(t) if names.iter().any(|n| t.galley.text().starts_with(n.as_str())) => { - Some(egui::Rect::from_min_size(t.pos, t.galley.size())) - } - _ => None, - }) + let mut t: Vec<_> = crate::tests_labels::text_shapes(&out) + .into_iter() + .filter(|(t, _)| names.iter().any(|n| t.galley.text().starts_with(n.as_str()))) + .map(|(t, transform)| transform * egui::Rect::from_min_size(t.pos, t.galley.size())) .collect(); t.sort_by(|a, b| a.left().total_cmp(&b.left())); t @@ -1002,14 +989,15 @@ fn other_panes_draw_through_their_documents_profiles() { let fills = |out: &egui::FullOutput, rgb: [u8; 3]| { fn any(s: &Shape, f: &dyn Fn(Color32) -> bool) -> bool { match s { - Shape::Vec(v) => v.iter().any(|s| any(s, f)), Shape::Path(p) => f(p.fill), Shape::Rect(r) => f(r.fill), Shape::Mesh(m) if m.texture_id == egui::TextureId::default() => m.vertices.iter().any(|v| f(v.color)), _ => false, } } - out.shapes.iter().any(|c| any(&c.shape, &|c: Color32| c.a() == 255 && near([c.r(), c.g(), c.b()], rgb))) + crate::tests_labels::painted_shapes(&out.shapes) + .into_iter() + .any(|(s, ..)| any(s, &|c: Color32| c.a() == 255 && near([c.r(), c.g(), c.b()], rgb))) }; let ctx = crate::testing::ui_context(); let raw = || egui::RawInput { diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index 8b7cabc0cb..ae6956a288 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -956,17 +956,10 @@ fn shapes(app: &mut VectorcraftApp, ctx: &egui::Context) -> Vec { shapes } -/// The shapes of a frame's output, `Shape::Vec`s flattened: the canvas's picture slot holds the art's. +/// The shapes of a frame's output, `Shape::Vec`s and retained paint chunks flattened: the canvas's +/// picture slot holds the art's. fn flat_shapes(clipped: Vec) -> Vec { - fn flat(s: Shape, out: &mut Vec) { - match s { - Shape::Vec(v) => v.into_iter().for_each(|s| flat(s, out)), - s => out.push(s), - } - } - let mut v = vec![]; - clipped.into_iter().for_each(|c| flat(c.shape, &mut v)); - v + crate::tests_labels::flat_painted_shapes(&clipped) } /// One headless canvas frame → the shapes drawn ([`flat_shapes`]) and the textures uploaded by it diff --git a/crates/ui-egui/src/chrome/tests.rs b/crates/ui-egui/src/chrome/tests.rs index 8fe7f3e43f..67cc29b63f 100644 --- a/crates/ui-egui/src/chrome/tests.rs +++ b/crates/ui-egui/src/chrome/tests.rs @@ -3292,13 +3292,6 @@ struct StyleFace { /// The Style field of the settled bar. `textures` holds the textures the frames uploaded since the fixture began /// recording; the uploads of these frames are applied to it. fn style_face(bar: &mut Shown, textures: &mut std::collections::HashMap) -> StyleFace { - fn flat(shape: egui::Shape, out: &mut Vec) { - if let egui::Shape::Vec(shapes) = shape { - shapes.into_iter().for_each(|s| flat(s, out)); - } else { - out.push(shape); - } - } let field = bar.settle().named("Graphic Styles").rect; let mut paint = bar.fixture.take_paint().expect("the fixture records what it paints"); for (id, delta) in paint.textures_delta.set.iter().flat_map(|(id, deltas)| deltas.iter().map(move |delta| (id, delta))) { @@ -3320,10 +3313,7 @@ fn style_face(bar: &mut Shown, textures: &mut std::collections::HashMap) { - match s { - egui::Shape::Text(t) => out.push((t.galley.text().to_string(), t.visual_bounding_rect().center())), - egui::Shape::Vec(v) => v.iter().for_each(|s| texts(s, out)), - _ => {} - } - } let mut app = app(); open(&mut app); let out = laid_out(&mut app); + let drawn: Vec<(String, egui::Pos2)> = crate::tests_labels::text_shapes(&out) + .into_iter() + .map(|(t, transform)| (t.galley.text().to_string(), (transform * t.visual_bounding_rect()).center())) + .collect(); let nodes = out.platform_output.accesskit_update.map(|u| u.nodes).unwrap_or_default(); let bounds = |label: &str, role: egui::accesskit::Role| { let (_, n) = nodes.iter().find(|(_, n)| n.label() == Some(label) && n.role() == role).unwrap_or_else(|| panic!("no {role:?} {label}")); @@ -1104,8 +1101,6 @@ mod tests { // Artboards follows Landscape on its line, or wraps below it when the column has no room for it. assert!(landscape.x1 <= artboards.x0 || landscape.y1 <= artboards.y0, "Landscape {landscape:?} stays clear of Artboards {artboards:?}"); let group = bounds("Orientation", egui::accesskit::Role::RadioGroup); - let mut drawn = Vec::new(); - out.shapes.iter().for_each(|s| texts(&s.shape, &mut drawn)); let inside: Vec<_> = drawn .iter() .filter(|(_, at)| (group.x0..=group.x1).contains(&f64::from(at.x)) && (group.y0..=group.y1).contains(&f64::from(at.y))) diff --git a/crates/ui-egui/src/dialogs/tests_screens.rs b/crates/ui-egui/src/dialogs/tests_screens.rs index b4ae88d15a..8d5ebb9789 100644 --- a/crates/ui-egui/src/dialogs/tests_screens.rs +++ b/crates/ui-egui/src/dialogs/tests_screens.rs @@ -295,18 +295,15 @@ fn checked_artboards_read_as_a_range() { /// The rect the frame `shapes` paint `texture` over; `None` when none paints it. fn painted(shapes: &[egui::epaint::ClippedShape], texture: egui::TextureId) -> Option { - fn walk(shape: &egui::Shape, texture: egui::TextureId, out: &mut Option) { - match shape { - egui::Shape::Vec(all) => all.iter().for_each(|s| walk(s, texture, out)), - egui::Shape::Mesh(mesh) if mesh.texture_id == texture => { - let at = mesh.calc_bounds(); - *out = Some(out.map_or(at, |r| r.union(at))); - } - _ => {} + let mut out: Option = None; + for (shape, transform, _) in crate::tests_labels::painted_shapes(shapes) { + if let egui::Shape::Mesh(mesh) = shape + && mesh.texture_id == texture + { + let at = transform * mesh.calc_bounds(); + out = Some(out.map_or(at, |r| r.union(at))); } } - let mut out = None; - shapes.iter().for_each(|clipped| walk(&clipped.shape, texture, &mut out)); out } @@ -943,14 +940,11 @@ fn a_preset_export_reopens_on_its_rows() { } fn screen_text_at(out: &egui::FullOutput, label: &str) -> egui::Pos2 { - fn find(shape: &egui::Shape, label: &str) -> Option { - match shape { - egui::Shape::Text(t) if t.galley.text().trim() == label => Some(t.visual_bounding_rect().center()), - egui::Shape::Vec(v) => v.iter().find_map(|s| find(s, label)), - _ => None, - } - } - out.shapes.iter().find_map(|s| find(&s.shape, label)).unwrap_or_else(|| panic!("missing {label}: {}", crate::tests_labels::shapes_text(out))) + crate::tests_labels::text_shapes(out) + .into_iter() + .find(|(t, _)| t.galley.text().trim() == label) + .map(|(t, transform)| (transform * t.visual_bounding_rect()).center()) + .unwrap_or_else(|| panic!("missing {label}: {}", crate::tests_labels::shapes_text(out))) } /// First-directory entries of the big-endian TIFF chosen below: tag, type, count, inline value. diff --git a/crates/ui-egui/src/dialogs/tracing_presets/tests.rs b/crates/ui-egui/src/dialogs/tracing_presets/tests.rs index bfb3edf947..2cecc9332e 100644 --- a/crates/ui-egui/src/dialogs/tracing_presets/tests.rs +++ b/crates/ui-egui/src/dialogs/tracing_presets/tests.rs @@ -72,16 +72,6 @@ fn frame_texts(app: &VectorcraftApp, ctx: &egui::Context) -> Vec { /// The texts the dialogs paint with where each is drawn and its font, once they have faded in. fn frame_runs(app: &VectorcraftApp, ctx: &egui::Context) -> Vec<(String, egui::Rect, Option)> { - fn walk(s: &egui::Shape, out: &mut Vec<(String, egui::Rect, Option)>) { - match s { - egui::Shape::Text(t) => { - let font = t.galley.job.sections.first().map(|section| section.format.font_id.clone()); - out.push((t.galley.text().to_string(), t.galley.rect.translate(t.pos.to_vec2()), font)); - } - egui::Shape::Vec(v) => v.iter().for_each(|s| walk(s, out)), - _ => {} - } - } let dialogs = app.dialogs().expect("a window"); let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1200.0, 1200.0)); let mut texts = vec![]; @@ -89,8 +79,13 @@ fn frame_runs(app: &VectorcraftApp, ctx: &egui::Context) -> Vec<(String, egui::R let raw = egui::RawInput { screen_rect: Some(screen), time: Some(f64::from(k) * 0.25), ..Default::default() }; let mut out = ctx.run_ui(raw, |ui| dialogs.with(|host| host.run(ui))); out.textures_delta.clear(); - texts.clear(); - out.shapes.iter().for_each(|c| walk(&c.shape, &mut texts)); + texts = crate::tests_labels::text_shapes(&out) + .into_iter() + .map(|(t, transform)| { + let font = t.galley.job.sections.first().map(|section| section.format.font_id.clone()); + (t.galley.text().to_string(), transform * t.galley.rect.translate(t.pos.to_vec2()), font) + }) + .collect(); } texts } diff --git a/crates/ui-egui/src/doc_windows/tests.rs b/crates/ui-egui/src/doc_windows/tests.rs index 5033868701..4e7905cb9f 100644 --- a/crates/ui-egui/src/doc_windows/tests.rs +++ b/crates/ui-egui/src/doc_windows/tests.rs @@ -15,18 +15,10 @@ fn app_with(n: usize) -> VectorcraftApp { /// One headless frame of the canvas panel's body (the tabs and the canvas or panes) on a /// 1200 × 800 window, then the floating document windows, which egui draws inside the window, run -/// as the hosts run a frame → the shapes it drew, `Shape::Vec`s flattened. +/// as the hosts run a frame → the shapes it drew, `Shape::Vec`s and retained paint chunks flattened. fn frame(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec) -> Vec { - fn flat(s: Shape, out: &mut Vec) { - match s { - Shape::Vec(v) => v.into_iter().for_each(|s| flat(s, out)), - s => out.push(s), - } - } let out = run_frame(app, ctx, events); - let mut shapes = vec![]; - out.shapes.into_iter().for_each(|c| flat(c.shape, &mut shapes)); - shapes + crate::tests_labels::flat_painted_shapes(&out.shapes) } /// One headless frame of the canvas panel's body and the floating document windows on a 1200 × diff --git a/crates/ui-egui/src/export_progress.rs b/crates/ui-egui/src/export_progress.rs index 8ec6e39b37..81bf88811c 100644 --- a/crates/ui-egui/src/export_progress.rs +++ b/crates/ui-egui/src/export_progress.rs @@ -132,11 +132,9 @@ mod tests { let mut out = ctx.run_ui(egui::RawInput::default(), |ui| super::show(app, ui)); out.textures_delta.clear(); let mut texts = String::new(); - for shape in out.shapes { - if let egui::epaint::Shape::Text(t) = shape.shape { - texts.push_str(t.galley.text()); - texts.push('\n'); - } + for (t, _) in crate::tests_labels::text_shapes(&out) { + texts.push_str(t.galley.text()); + texts.push('\n'); } texts } diff --git a/crates/ui-egui/src/menus/tests.rs b/crates/ui-egui/src/menus/tests.rs index 120c80aadd..b21b2e8ccf 100644 --- a/crates/ui-egui/src/menus/tests.rs +++ b/crates/ui-egui/src/menus/tests.rs @@ -288,18 +288,10 @@ fn discover_says_why_a_tool_cannot_be_marked() { } fn texts(ctx: &egui::Context, app: &mut VectorcraftApp, events: Vec) -> Vec<(String, egui::Rect)> { let out = pass(ctx, app, events); - fn collect(s: &egui::Shape, out: &mut Vec<(String, egui::Rect)>) { - match s { - egui::Shape::Text(t) => out.push((t.galley.text().to_string(), t.visual_bounding_rect())), - egui::Shape::Vec(v) => v.iter().for_each(|s| collect(s, out)), - _ => {} - } - } - let mut texts = vec![]; - for c in &out.shapes { - collect(&c.shape, &mut texts); - } - texts + crate::tests_labels::text_shapes(&out) + .into_iter() + .map(|(t, transform)| (t.galley.text().to_string(), transform * t.visual_bounding_rect())) + .collect() } fn click(ctx: &egui::Context, app: &mut VectorcraftApp, label: &str) { texts(ctx, app, vec![]); diff --git a/crates/ui-egui/src/opening/tests.rs b/crates/ui-egui/src/opening/tests.rs index 68386b4c5d..cdb55375db 100644 --- a/crates/ui-egui/src/opening/tests.rs +++ b/crates/ui-egui/src/opening/tests.rs @@ -522,11 +522,9 @@ fn progress(app: &mut VectorcraftApp, ctx: &egui::Context) -> String { let mut out = ctx.run_ui(egui::RawInput::default(), |ui| crate::export_progress::show(app, ui)); out.textures_delta.clear(); let mut texts = String::new(); - for shape in out.shapes { - if let egui::epaint::Shape::Text(t) = shape.shape { - texts.push_str(t.galley.text()); - texts.push('\n'); - } + for (t, _) in crate::tests_labels::text_shapes(&out) { + texts.push_str(t.galley.text()); + texts.push('\n'); } texts } diff --git a/crates/ui-egui/src/panel_docking/native_tests.rs b/crates/ui-egui/src/panel_docking/native_tests.rs index eebf3d6a77..3ceb28ad9f 100644 --- a/crates/ui-egui/src/panel_docking/native_tests.rs +++ b/crates/ui-egui/src/panel_docking/native_tests.rs @@ -113,15 +113,10 @@ impl Host { }; let mut full = ctx.run_ui(input, |ui| (viewport.viewport_ui_cb)(ui)); full.textures_delta.clear(); - fn texts(s: &egui::Shape, out: &mut Vec<(String, Rect)>) { - match s { - egui::Shape::Text(t) => out.push((t.galley.text().to_string(), t.visual_bounding_rect())), - egui::Shape::Vec(v) => v.iter().for_each(|s| texts(s, out)), - _ => {} - } - } - let mut shown = Vec::new(); - full.shapes.iter().for_each(|c| texts(&c.shape, &mut shown)); + let shown: Vec<(String, Rect)> = crate::tests_labels::text_shapes(&full) + .into_iter() + .map(|(t, transform)| (t.galley.text().to_string(), transform * t.visual_bounding_rect())) + .collect(); let nodes = full.platform_output.accesskit_update.as_ref().map_or_else(Vec::new, |update| { let rect = |b: egui::accesskit::Rect| Rect::from_min_max(pos2(b.x0 as f32, b.y0 as f32), pos2(b.x1 as f32, b.y1 as f32)); update.nodes.iter().filter_map(|(_, node)| Some((node.label()?.to_string(), rect(node.bounds()?)))).collect() diff --git a/crates/ui-egui/src/panel_docking/tests.rs b/crates/ui-egui/src/panel_docking/tests.rs index f132c35145..3476f5c2b0 100644 --- a/crates/ui-egui/src/panel_docking/tests.rs +++ b/crates/ui-egui/src/panel_docking/tests.rs @@ -1080,11 +1080,10 @@ fn footer_strip_shows_no_rows(h: &mut Harness, case: &str) { egui::Shape::Mesh(m) => m.vertices.iter().all(|v| v.color.a() == 0), _ => false, }; - let showing: Vec = h - .shapes - .iter() - .filter(|c| !transparent(&c.shape)) - .map(|c| (c.shape.visual_bounding_rect(), c.clip_rect)) + let showing: Vec = crate::tests_labels::painted_shapes(&h.shapes) + .into_iter() + .filter(|(shape, ..)| !transparent(shape)) + .map(|(shape, transform, clip)| (transform * shape.visual_bounding_rect(), clip)) .filter(|(bounds, clip)| { let seen = clip.intersect(*bounds).intersect(strip); bounds.height() < 60.0 && bounds.top() < footer.top() && seen.is_positive() && seen.height() > 0.5 diff --git a/crates/ui-egui/src/panels/tests_appearance.rs b/crates/ui-egui/src/panels/tests_appearance.rs index a98ddb02d3..66ca13b1ee 100644 --- a/crates/ui-egui/src/panels/tests_appearance.rs +++ b/crates/ui-egui/src/panels/tests_appearance.rs @@ -43,18 +43,10 @@ pub(super) fn frame_raw( ) -> Vec<(String, egui::Rect)> { let mut out = ctx.run_ui(raw, |ui| f(app, ui)); out.textures_delta.clear(); - fn collect(s: &egui::Shape, out: &mut Vec<(String, egui::Rect)>) { - match s { - egui::Shape::Text(t) => out.push((t.galley.text().to_string(), t.visual_bounding_rect())), - egui::Shape::Vec(v) => v.iter().for_each(|s| collect(s, out)), - _ => {} - } - } - let mut texts = vec![]; - for c in &out.shapes { - collect(&c.shape, &mut texts); - } - texts + crate::tests_labels::text_shapes(&out) + .into_iter() + .map(|(t, transform)| (t.galley.text().to_string(), transform * t.visual_bounding_rect())) + .collect() } /// Click at `pos` over three frames of `f` (hover, press, release). diff --git a/crates/ui-egui/src/panels/tests_brush_libraries.rs b/crates/ui-egui/src/panels/tests_brush_libraries.rs index de00122189..06458f8e4a 100644 --- a/crates/ui-egui/src/panels/tests_brush_libraries.rs +++ b/crates/ui-egui/src/panels/tests_brush_libraries.rs @@ -20,20 +20,11 @@ fn app() -> VectorcraftApp { /// One frame of `draw` with `events`; the texts it painted. fn frame(ctx: &egui::Context, events: Vec, time: f64, mut draw: impl FnMut(&mut egui::Ui)) -> Vec { - fn texts(s: &egui::Shape, out: &mut Vec) { - match s { - egui::Shape::Text(t) => out.push(t.galley.text().to_string()), - egui::Shape::Vec(v) => v.iter().for_each(|s| texts(s, out)), - _ => {} - } - } let screen_rect = Some(Rect::from_min_size(Pos2::ZERO, vec2(1200.0, 800.0))); let input = egui::RawInput { events, time: Some(time), screen_rect, ..Default::default() }; let mut out = ctx.run_ui(input, &mut draw); out.textures_delta.clear(); - let mut v = vec![]; - out.shapes.iter().for_each(|c| texts(&c.shape, &mut v)); - v + crate::tests_labels::text_shapes(&out).into_iter().map(|(t, _)| t.galley.text().to_string()).collect() } fn undo_len(app: &VectorcraftApp) -> usize { diff --git a/crates/ui-egui/src/panels/tests_style_libraries.rs b/crates/ui-egui/src/panels/tests_style_libraries.rs index 5f7eea0e7b..e3eee634d5 100644 --- a/crates/ui-egui/src/panels/tests_style_libraries.rs +++ b/crates/ui-egui/src/panels/tests_style_libraries.rs @@ -25,21 +25,12 @@ fn app() -> VectorcraftApp { /// One frame of `draw` with `events` and `modifiers` held; the texts it painted. fn frame(ctx: &egui::Context, events: Vec, modifiers: Modifiers, time: f64, mut draw: impl FnMut(&mut egui::Ui)) -> Vec { - fn texts(s: &egui::Shape, out: &mut Vec) { - match s { - egui::Shape::Text(t) => out.push(t.galley.text().to_string()), - egui::Shape::Vec(v) => v.iter().for_each(|s| texts(s, out)), - _ => {} - } - } let screen_rect = Some(Rect::from_min_size(Pos2::ZERO, vec2(1200.0, 800.0))); let events = std::iter::once(Event::ModifiersChanged(modifiers)).chain(events).collect(); let input = egui::RawInput { events, time: Some(time), screen_rect, ..Default::default() }; let mut out = ctx.run_ui(input, &mut draw); out.textures_delta.clear(); - let mut v = vec![]; - out.shapes.iter().for_each(|c| texts(&c.shape, &mut v)); - v + crate::tests_labels::text_shapes(&out).into_iter().map(|(t, _)| t.galley.text().to_string()).collect() } fn undo_len(app: &VectorcraftApp) -> usize { diff --git a/crates/ui-egui/src/panels/tests_symbol_libraries.rs b/crates/ui-egui/src/panels/tests_symbol_libraries.rs index c5ca39e7ec..a0f42855b1 100644 --- a/crates/ui-egui/src/panels/tests_symbol_libraries.rs +++ b/crates/ui-egui/src/panels/tests_symbol_libraries.rs @@ -21,20 +21,11 @@ fn app() -> VectorcraftApp { /// One frame of `draw` with `events`; the texts it painted. fn frame(ctx: &egui::Context, events: Vec, time: f64, mut draw: impl FnMut(&mut egui::Ui)) -> Vec { - fn texts(s: &egui::Shape, out: &mut Vec) { - match s { - egui::Shape::Text(t) => out.push(t.galley.text().to_string()), - egui::Shape::Vec(v) => v.iter().for_each(|s| texts(s, out)), - _ => {} - } - } let screen_rect = Some(Rect::from_min_size(Pos2::ZERO, vec2(1200.0, 800.0))); let input = egui::RawInput { events, time: Some(time), screen_rect, ..Default::default() }; let mut out = ctx.run_ui(input, &mut draw); out.textures_delta.clear(); - let mut v = vec![]; - out.shapes.iter().for_each(|c| texts(&c.shape, &mut v)); - v + crate::tests_labels::text_shapes(&out).into_iter().map(|(t, _)| t.galley.text().to_string()).collect() } fn undo_len(app: &VectorcraftApp) -> usize { diff --git a/crates/ui-egui/src/placing/tests.rs b/crates/ui-egui/src/placing/tests.rs index 385b1b3803..fb75d86663 100644 --- a/crates/ui-egui/src/placing/tests.rs +++ b/crates/ui-egui/src/placing/tests.rs @@ -1951,11 +1951,9 @@ fn progress(app: &mut VectorcraftApp, ctx: &egui::Context) -> String { let mut out = ctx.run_ui(egui::RawInput::default(), |ui| crate::export_progress::show(app, ui)); out.textures_delta.clear(); let mut texts = String::new(); - for shape in out.shapes { - if let egui::epaint::Shape::Text(t) = shape.shape { - texts.push_str(t.galley.text()); - texts.push('\n'); - } + for (t, _) in crate::tests_labels::text_shapes(&out) { + texts.push_str(t.galley.text()); + texts.push('\n'); } texts } diff --git a/crates/ui-egui/src/prefs_dialog/tests.rs b/crates/ui-egui/src/prefs_dialog/tests.rs index 25c2d367f1..fc61192b84 100644 --- a/crates/ui-egui/src/prefs_dialog/tests.rs +++ b/crates/ui-egui/src/prefs_dialog/tests.rs @@ -1265,7 +1265,7 @@ fn access_frame(a: &mut VectorcraftApp, events: Vec) -> (Vec<(Strin script_access::show(a, &mut w.script_access, ui); a.prefs = Some(w); }); - (crate::tests_removeanchors::shapes_text(&out.shapes.iter().map(|c| c.shape.clone()).collect::>()), out) + (crate::tests_removeanchors::shapes_text(&crate::tests_labels::flat_painted_shapes(&out.shapes)), out) } /// The texts of General › Script File Access after the frames it lays itself out in. diff --git a/crates/ui-egui/src/tests/background.rs b/crates/ui-egui/src/tests/background.rs index a314413f8b..fe90152db4 100644 --- a/crates/ui-egui/src/tests/background.rs +++ b/crates/ui-egui/src/tests/background.rs @@ -362,19 +362,10 @@ fn quitting_waits_for_background_saves() { /// The status bar's texts in one headless frame. pub(super) fn status_bar_texts(app: &mut VectorcraftApp) -> Vec { - fn texts(s: &egui::Shape, out: &mut Vec) { - match s { - egui::Shape::Text(t) => out.push(t.galley.text().to_string()), - egui::Shape::Vec(v) => v.iter().for_each(|s| texts(s, out)), - _ => {} - } - } let ctx = crate::testing::ui_context(); let mut out = ctx.run_ui(egui::RawInput::default(), |ui| crate::chrome::status_bar(app, ui)); out.textures_delta.clear(); - let mut v = vec![]; - out.shapes.iter().for_each(|c| texts(&c.shape, &mut v)); - v + crate::tests_labels::text_shapes(&out).into_iter().map(|(t, _)| t.galley.text().to_string()).collect() } #[test] diff --git a/crates/ui-egui/src/tests/dialog_layout.rs b/crates/ui-egui/src/tests/dialog_layout.rs index 0caa8e7007..121e9a0350 100644 --- a/crates/ui-egui/src/tests/dialog_layout.rs +++ b/crates/ui-egui/src/tests/dialog_layout.rs @@ -48,21 +48,15 @@ fn step(h: &mut Window) { /// The texts the window paints with `command` run, each with where it was drawn, a field label's colon left off. fn texts(command: &str, params: Value) -> Vec<(String, Rect)> { - fn collect(s: &egui::Shape, out: &mut Vec<(String, Rect)>) { - match s { - egui::Shape::Text(t) => out.push((t.galley.text().trim().trim_end_matches(':').to_owned(), t.visual_bounding_rect())), - egui::Shape::Vec(v) => v.iter().for_each(|s| collect(s, out)), - _ => {} - } - } let mut h = window(); crate::menus::invoke(h.state_mut(), command, params); for _ in 0..6 { step(&mut h); } - let mut out = vec![]; - h.output().shapes.iter().for_each(|c| collect(&c.shape, &mut out)); - out + crate::tests_labels::text_shapes(h.output()) + .into_iter() + .map(|(t, transform)| (t.galley.text().trim().trim_end_matches(':').to_owned(), transform * t.visual_bounding_rect())) + .collect() } /// Where each painted `label` was drawn, top to bottom. diff --git a/crates/ui-egui/src/tests/document_drag.rs b/crates/ui-egui/src/tests/document_drag.rs index a18cb222a5..08744212f1 100644 --- a/crates/ui-egui/src/tests/document_drag.rs +++ b/crates/ui-egui/src/tests/document_drag.rs @@ -37,15 +37,10 @@ fn frame(app: &mut VectorcraftApp, ctx: &egui::Context, time: f64, events: Vec = app.session.documents().iter().map(|d| d.title()).collect(); - let mut titles: Vec<_> = out - .shapes - .iter() - .filter_map(|s| match &s.shape { - egui::Shape::Text(t) if names.iter().any(|n| t.galley.text().starts_with(n.as_str())) => { - Some(egui::Rect::from_min_size(t.pos, t.galley.size())) - } - _ => None, - }) + let mut titles: Vec<_> = crate::tests_labels::text_shapes(&out) + .into_iter() + .filter(|(t, _)| names.iter().any(|n| t.galley.text().starts_with(n.as_str()))) + .map(|(t, transform)| transform * egui::Rect::from_min_size(t.pos, t.galley.size())) .collect(); titles.sort_by(|a, b| a.left().total_cmp(&b.left())); titles diff --git a/crates/ui-egui/src/tests/labels.rs b/crates/ui-egui/src/tests/labels.rs index ea2a08be62..e9c07abee0 100644 --- a/crates/ui-egui/src/tests/labels.rs +++ b/crates/ui-egui/src/tests/labels.rs @@ -46,6 +46,39 @@ pub(crate) fn text_shapes(out: &egui::FullOutput) -> Vec<(&egui::epaint::TextSha text } +/// Every painted shape other than `Shape::Vec` and `Shape::PaintChunk` (whose members it lists +/// instead), in paint order, with its composed window transform and the clip rectangle it is drawn in. +pub(crate) fn painted_shapes(clipped: &[egui::epaint::ClippedShape]) -> Vec<(&Shape, egui::emath::TSTransform, egui::Rect)> { + use egui::emath::TSTransform; + + fn collect<'a>(shape: &'a Shape, transform: TSTransform, clip: egui::Rect, out: &mut Vec<(&'a Shape, TSTransform, egui::Rect)>) { + match shape { + Shape::Vec(shapes) => shapes.iter().for_each(|shape| collect(shape, transform, clip, out)), + Shape::PaintChunk(shapes) => shapes.iter().for_each(|clipped| { + collect(&clipped.shape, transform * clipped.transform_after_tessellation, clip.intersect(transform * clipped.clip_rect), out); + }), + shape => out.push((shape, transform, clip)), + } + } + let mut shapes = Vec::new(); + for clipped in clipped { + collect(&clipped.shape, clipped.transform_after_tessellation, clipped.clip_rect, &mut shapes); + } + shapes +} + +/// [`painted_shapes`] as owned shapes, each moved by its transform. +pub(crate) fn flat_painted_shapes(clipped: &[egui::epaint::ClippedShape]) -> Vec { + painted_shapes(clipped) + .into_iter() + .map(|(shape, transform, _)| { + let mut shape = shape.clone(); + shape.transform(transform); + shape + }) + .collect() +} + /// Every string a frame painted, one per line. pub(crate) fn shapes_text(out: &egui::FullOutput) -> String { let mut text = String::new(); diff --git a/crates/ui-egui/src/tests/panel_harness.rs b/crates/ui-egui/src/tests/panel_harness.rs index 9252b1cec6..0c7d427a68 100644 --- a/crates/ui-egui/src/tests/panel_harness.rs +++ b/crates/ui-egui/src/tests/panel_harness.rs @@ -397,14 +397,8 @@ impl Panel { let images = paint.textures_delta.set.iter().flat_map(|(id, deltas)| deltas.iter().map(move |delta| (*id, delta.image.clone()))).collect(); // The test reads the images; no renderer applies them. paint.textures_delta.clear(); - let mut shapes = Vec::new(); - let mut open: Vec = paint.shapes.into_iter().map(|clipped| clipped.shape).collect(); - while let Some(shape) = open.pop() { - match shape { - egui::Shape::Vec(nested) => open.extend(nested), - shape => shapes.push(shape), - } - } + // Last painted first. + let shapes = crate::tests_labels::flat_painted_shapes(&paint.shapes).into_iter().rev().collect(); (shapes, images) } diff --git a/crates/ui-egui/src/tests/picks.rs b/crates/ui-egui/src/tests/picks.rs index 755aefbc45..851d438904 100644 --- a/crates/ui-egui/src/tests/picks.rs +++ b/crates/ui-egui/src/tests/picks.rs @@ -261,19 +261,13 @@ fn frame( events: Vec, draw: &impl Fn(&mut VectorcraftApp, &mut egui::Ui), ) -> Vec<(String, Rect)> { - fn texts(s: &egui::Shape, out: &mut Vec<(String, Rect)>) { - match s { - egui::Shape::Text(t) => out.push((t.galley.text().to_string(), t.visual_bounding_rect())), - egui::Shape::Vec(v) => v.iter().for_each(|s| texts(s, out)), - _ => {} - } - } let raw = egui::RawInput { screen_rect: Some(Rect::from_min_size(Pos2::ZERO, vec2(SCREEN.0, SCREEN.1))), events, ..Default::default() }; // With the app's frame input, as the window's frames have it: its host carries the file service a dialog picks with. let out = crate::testing::part_frame(app, ctx, raw, |app, ui| draw(app, ui)); - let mut v = vec![]; - out.shapes.iter().for_each(|c| texts(&c.shape, &mut v)); - v + crate::tests_labels::text_shapes(&out) + .into_iter() + .map(|(t, transform)| (t.galley.text().to_string(), transform * t.visual_bounding_rect())) + .collect() } /// Where text `label` was drawn (menu items pad theirs). diff --git a/crates/ui-egui/src/tests/removeanchors.rs b/crates/ui-egui/src/tests/removeanchors.rs index 90c977f58f..64f6fc4eea 100644 --- a/crates/ui-egui/src/tests/removeanchors.rs +++ b/crates/ui-egui/src/tests/removeanchors.rs @@ -59,7 +59,7 @@ pub(crate) const CONTROL_ROOM: egui::Vec2 = vec2(2200.0, 900.0); pub(crate) fn control_frame(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec) -> Vec<(String, Rect)> { let raw = egui::RawInput { screen_rect: Some(Rect::from_min_size(Pos2::ZERO, CONTROL_ROOM)), events, ..Default::default() }; let out = crate::testing::part_frame(app, ctx, raw, chrome::control_bar); - shapes_text(&out.shapes.iter().map(|c| c.shape.clone()).collect::>()) + shapes_text(&crate::tests_labels::flat_painted_shapes(&out.shapes)) } pub(crate) fn click_control(app: &mut VectorcraftApp, ctx: &egui::Context, at: Pos2) { @@ -74,7 +74,7 @@ fn canvas_frame(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec>()) + shapes_text(&crate::tests_labels::flat_painted_shapes(&out.shapes)) } fn click_canvas(app: &mut VectorcraftApp, ctx: &egui::Context, at: Pos2, button: PointerButton) -> Vec<(String, Rect)> { @@ -92,7 +92,7 @@ pub(crate) fn properties_frame(app: &mut VectorcraftApp, width: f32) -> Vec<(Str crate::panels::properties::show(app, ui); }); out.textures_delta.clear(); - shapes_text(&out.shapes.iter().map(|c| c.shape.clone()).collect::>()) + shapes_text(&crate::tests_labels::flat_painted_shapes(&out.shapes)) } pub(crate) fn has(texts: &[(String, Rect)], label: &str) -> bool { diff --git a/crates/ui-egui/src/tests/retype_runs.rs b/crates/ui-egui/src/tests/retype_runs.rs index 8f27f1c572..aa10397dbd 100644 --- a/crates/ui-egui/src/tests/retype_runs.rs +++ b/crates/ui-egui/src/tests/retype_runs.rs @@ -39,11 +39,9 @@ fn has_type(app: &VectorcraftApp) -> bool { fn progress(app: &mut VectorcraftApp, ctx: &egui::Context, time: f64) -> String { let out = crate::testing::part_frame(app, ctx, egui::RawInput { time: Some(time), ..Default::default() }, export_progress::show); let mut texts = String::new(); - for shape in out.shapes { - if let egui::epaint::Shape::Text(t) = shape.shape { - texts.push_str(t.galley.text()); - texts.push('\n'); - } + for (t, _) in crate::tests_labels::text_shapes(&out) { + texts.push_str(t.galley.text()); + texts.push('\n'); } texts } diff --git a/crates/ui-egui/src/tests/ruler_origin.rs b/crates/ui-egui/src/tests/ruler_origin.rs index d731d7db76..d016e09d26 100644 --- a/crates/ui-egui/src/tests/ruler_origin.rs +++ b/crates/ui-egui/src/tests/ruler_origin.rs @@ -30,16 +30,10 @@ fn frame(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec, draw ..Default::default() }; let out = crate::testing::part_frame(app, ctx, raw, draw); - fn walk(s: &egui::Shape, v: &mut Vec<(String, Rect)>) { - match s { - egui::Shape::Text(t) => v.push((t.galley.text().to_string(), Rect::from_min_size(t.pos, t.galley.size()))), - egui::Shape::Vec(s) => s.iter().for_each(|s| walk(s, v)), - _ => {} - } - } - let mut texts = vec![]; - out.shapes.iter().for_each(|c| walk(&c.shape, &mut texts)); - texts + crate::tests_labels::text_shapes(&out) + .into_iter() + .map(|(t, transform)| (t.galley.text().to_string(), transform * Rect::from_min_size(t.pos, t.galley.size()))) + .collect() } /// How many fields show `v` points: painted as one run, or as its number with the unit as the next run on its row. diff --git a/crates/ui-egui/src/tests/script_run.rs b/crates/ui-egui/src/tests/script_run.rs index 9cb5757c6b..106bd96575 100644 --- a/crates/ui-egui/src/tests/script_run.rs +++ b/crates/ui-egui/src/tests/script_run.rs @@ -626,13 +626,6 @@ fn a_scripts_file_dialog_keeps_at_most_2048_picked_files() { /// The texts the open warning draws, after a few frames of the whole app. fn dialog_texts(app: &mut VectorcraftApp) -> Vec { - fn texts(s: &egui::Shape, out: &mut Vec) { - match s { - egui::Shape::Text(t) => out.push(t.galley.text().to_string()), - egui::Shape::Vec(v) => v.iter().for_each(|s| texts(s, out)), - _ => {} - } - } let ctx = app.ui_ctx.clone().unwrap(); let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1600.0, 4000.0)); let mut out = None; @@ -640,9 +633,8 @@ fn dialog_texts(app: &mut VectorcraftApp) -> Vec { let raw = egui::RawInput { time: Some(0.1 * f64::from(i)), screen_rect: Some(screen), ..Default::default() }; out = Some(crate::testing::app_frame(app, &ctx, raw)); } - let mut v = vec![]; - out.unwrap().shapes.iter().for_each(|c| texts(&c.shape, &mut v)); - v + let out = out.unwrap(); + crate::tests_labels::text_shapes(&out).into_iter().map(|(t, _)| t.galley.text().to_string()).collect() } /// The warning before a run lists the files the script writes, read without running it. diff --git a/crates/ui-egui/src/tests/scrub.rs b/crates/ui-egui/src/tests/scrub.rs index 39142a71e5..78cc74f86f 100644 --- a/crates/ui-egui/src/tests/scrub.rs +++ b/crates/ui-egui/src/tests/scrub.rs @@ -18,14 +18,10 @@ pub(super) fn window(app: &mut VectorcraftApp, ui: &mut egui::Ui) { fn app_frame(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec, text: &str) -> Option { let screen_rect = Some(Rect::from_min_size(Pos2::ZERO, vec2(1600.0, 900.0))); let out = crate::testing::app_frame(app, ctx, egui::RawInput { events, screen_rect, ..Default::default() }); - fn find(shape: &egui::Shape, text: &str) -> Option { - match shape { - egui::Shape::Text(t) if t.galley.text() == text => Some(t.galley.rect.translate(t.pos.to_vec2())), - egui::Shape::Vec(v) => v.iter().find_map(|s| find(s, text)), - _ => None, - } - } - out.shapes.iter().find_map(|s| find(&s.shape, text)) + crate::tests_labels::text_shapes(&out) + .into_iter() + .find(|(t, _)| t.galley.text() == text) + .map(|(t, transform)| transform * t.galley.rect.translate(t.pos.to_vec2())) } fn app_with_rect() -> (VectorcraftApp, egui::Context) { diff --git a/crates/ui-egui/src/toolbar/tests.rs b/crates/ui-egui/src/toolbar/tests.rs index 2495ec4d03..9ce6cca2e6 100644 --- a/crates/ui-egui/src/toolbar/tests.rs +++ b/crates/ui-egui/src/toolbar/tests.rs @@ -321,14 +321,7 @@ fn the_controls_under_the_tools_share_a_line_under_a_rule() { let proxy = named_rect(&nodes, "Fill and Stroke"); let screen_rect = Some(egui::Rect::from_min_size(Pos2::ZERO, egui::vec2(1200.0, 2000.0))); let out = crate::testing::app_frame(&mut app, &ctx, egui::RawInput { time: Some(1.0), screen_rect, ..Default::default() }); - let mut flat = Vec::new(); - let mut stack: Vec = out.shapes.into_iter().map(|clipped| clipped.shape).collect(); - while let Some(shape) = stack.pop() { - match shape { - egui::Shape::Vec(inner) => stack.extend(inner), - shape => flat.push(shape), - } - } + let flat = crate::tests_labels::flat_painted_shapes(&out.shapes); // A rule is a thin horizontal line or bar across most of the rail's width, between the tools and the controls. let between = |y: f32| y > last.bottom() && y < proxy.top(); let across = |left: f32, right: f32| right - left >= last.width() * 0.75 && left < last.right() && right > last.left(); @@ -595,20 +588,15 @@ fn a_short_tools_rail_shows_its_scroll_bar_at_rest() { let rail = nodes.iter().find(|n| n.role() == Role::Toolbar && n.label() == Some("Tools")).and_then(bounds).expect("the rail is drawn"); let screen_rect = Some(egui::Rect::from_min_size(Pos2::ZERO, egui::vec2(1200.0, height))); let out = crate::testing::app_frame(app, &ctx, egui::RawInput { time: Some(t0 + 0.2), screen_rect, ..Default::default() }); - let mut stack: Vec = out.shapes.into_iter().map(|clipped| clipped.shape).collect(); let mut found = 0; - while let Some(shape) = stack.pop() { - match shape { - egui::Shape::Vec(inner) => stack.extend(inner), - egui::Shape::Rect(r) => { - let b = r.rect; - let narrow = b.width() > 0.0 && b.width() <= rail.width() * 0.25 && b.height() >= b.width() * 3.0; - let at_end = rail.expand(0.5).contains_rect(b) && b.center().x > rail.center().x; - if narrow && at_end { - found += 1; - } + for shape in crate::tests_labels::flat_painted_shapes(&out.shapes) { + if let egui::Shape::Rect(r) = shape { + let b = r.rect; + let narrow = b.width() > 0.0 && b.width() <= rail.width() * 0.25 && b.height() >= b.width() * 3.0; + let at_end = rail.expand(0.5).contains_rect(b) && b.center().x > rail.center().x; + if narrow && at_end { + found += 1; } - _ => {} } } found diff --git a/crates/ui-egui/tests/panel_readout_copy.rs b/crates/ui-egui/tests/panel_readout_copy.rs index 7c65f085e6..47c72fcb30 100644 --- a/crates/ui-egui/tests/panel_readout_copy.rs +++ b/crates/ui-egui/tests/panel_readout_copy.rs @@ -353,12 +353,11 @@ fn copy_long_link_value(a: &mut App) { assert_eq!(names.len(), 1, "one actual full-name copy readout"); assert_eq!(names[0].1.description(), Some("Copy")); let area = location_node_rect(&names[0].1); - let (value, clipped) = out - .shapes - .iter() - .find_map(|s| { - let t = text_shape(&s.shape, &name)?; - let r = t.galley.rect.translate(t.pos.to_vec2()).intersect(s.clip_rect).intersect(area); + let (value, clipped) = visible_paint(&out) + .into_iter() + .filter(|(t, ..)| t.galley.text() == name) + .find_map(|(t, bounds, _)| { + let r = bounds.intersect(area); r.is_positive().then_some((r, t.galley.elided || r.width() < t.galley.rect.width())) }) .expect("the actual selected image's Link Info Name value"); @@ -636,9 +635,9 @@ fn location_node_rect(node: &egui::accesskit::Node) -> Rect { } fn shortened_location(out: &egui::FullOutput, rect: Rect, full: &str) -> bool { - visible_paint(out) - .into_iter() - .any(|(shape, bounds, center)| rect.contains(center) && bounds.contains(center) && shape.galley.text().contains('…') && shape.galley.text() != full) + visible_paint(out).into_iter().any(|(shape, bounds, center)| { + rect.contains(center) && bounds.contains(center) && shape.galley.text().contains('…') && shape.galley.text() != full + }) } #[test] @@ -725,10 +724,7 @@ fn panel_readout_long_location_fits_and_copies_by_pointer_accessibility_and_keyb let (location_id, node) = locations[0]; let location_rect = location_node_rect(node); assert!(body.contains_rect(location_rect), "{locale}: the fitted Location remains inside the panel"); - assert!( - shortened_location(&out, location_rect, location), - "{locale}: the long path must actually be shortened on screen" - ); + assert!(shortened_location(&out, location_rect, location), "{locale}: the long path must actually be shortened on screen"); let buttons: Vec<_> = nodes.iter().filter(|(_, n)| n.role() == Role::Button && n.label() == Some(vectorcraft_ui_egui::i18n::t("Copy Location"))).collect(); assert_eq!(buttons.len(), 1, "{locale}: one named native Copy Location button"); From 69e325e462c5f58e79e0e5248ae0322b815ac263 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sun, 29 Nov 2026 15:09:23 +0100 Subject: [PATCH 57/61] Pin craft-libs 186a229c for the VectorCraft release Carry the upstream properties-dialog tab retention and layout fixes into the tested release pin. Retain the same egui revision and dependency graph. --- Cargo.lock | 170 ++++++++++++++++---------------- Cargo.toml | 70 ++++++------- apps/vectorcraft-web/Cargo.toml | 2 +- xtask/src/pdf_deps.rs | 2 +- 4 files changed, 122 insertions(+), 122 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c4f93bacb0..4da7886c88 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1239,7 +1239,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-automation", "craft-behavior", @@ -1280,7 +1280,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "crc32fast", "flate2", @@ -1291,7 +1291,7 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "block2 0.6.2", "objc2 0.6.5", @@ -1302,7 +1302,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "rustix 1.1.6", ] @@ -1310,7 +1310,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1335,7 +1335,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1353,7 +1353,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-behavior", "craft-docpath", @@ -1371,7 +1371,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "crc32fast", "flate2", @@ -1380,7 +1380,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "egui", ] @@ -1388,7 +1388,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "md-5", "rayon", @@ -1397,12 +1397,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-behavior", "craft-cms", @@ -1422,7 +1422,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-control-protocol", "craft-platform", @@ -1433,7 +1433,7 @@ dependencies = [ [[package]] name = "craft-control-protocol" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "getrandom 0.3.4", "serde_json", @@ -1443,7 +1443,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "rayon", ] @@ -1451,7 +1451,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "block2 0.6.2", "craft-appkit", @@ -1477,7 +1477,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "blake3", "craft-ecproj-format", @@ -1493,7 +1493,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "serde", ] @@ -1501,7 +1501,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1520,7 +1520,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-codepage", "encoding_rs", @@ -1532,7 +1532,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "serde", "serde_json", @@ -1542,12 +1542,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1562,7 +1562,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1581,7 +1581,7 @@ dependencies = [ [[package]] name = "craft-font-os-windows" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "windows-registry", "windows-sys 0.61.2", @@ -1590,7 +1590,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "cap-primitives", "craft-atomic", @@ -1613,12 +1613,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "gif", ] @@ -1626,7 +1626,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "flate2", ] @@ -1634,7 +1634,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1647,7 +1647,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "chrono", "fixed_decimal", @@ -1675,7 +1675,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-dds", "craft-jpeg", @@ -1702,7 +1702,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1720,7 +1720,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "thiserror 2.0.21", ] @@ -1728,7 +1728,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1739,7 +1739,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-host", "craft-i18n", @@ -1754,7 +1754,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-behavior", "craft-i18n", @@ -1768,7 +1768,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-behavior", "craft-host", @@ -1786,7 +1786,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1798,7 +1798,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "encoding_rs", "image", @@ -1809,7 +1809,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "chrono", "craft-codepage", @@ -1819,7 +1819,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-behavior", "craft-keymap", @@ -1835,7 +1835,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "flate2", "serde", @@ -1846,7 +1846,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1858,7 +1858,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "async-channel", "async-io", @@ -1889,7 +1889,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1898,7 +1898,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-behavior", "craft-host", @@ -1922,7 +1922,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1933,7 +1933,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-eps", "flate2", @@ -1947,7 +1947,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "encoding_rs", "flate2", @@ -1958,7 +1958,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "dispatch2", "egui", @@ -1971,7 +1971,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1990,7 +1990,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-atomic", "craft-host", @@ -2007,7 +2007,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "fax", "hayro-ccitt", @@ -2018,7 +2018,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-image-codecs", "craft-xml", @@ -2039,7 +2039,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-behavior", "craft-keymap", @@ -2051,7 +2051,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2076,7 +2076,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2091,7 +2091,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-atomic", "craft-behavior", @@ -2106,7 +2106,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "serde", "thiserror 2.0.21", @@ -2116,7 +2116,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "serde", "thiserror 2.0.21", @@ -2125,7 +2125,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-behavior", "craft-keymap", @@ -2140,12 +2140,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2159,7 +2159,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-behavior", "craft-i18n", @@ -2175,7 +2175,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "accesskit", "craft-behavior", @@ -2213,7 +2213,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2224,7 +2224,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-behavior", "craft-host", @@ -2242,7 +2242,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-behavior", "craft-host", @@ -2263,7 +2263,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-behavior", "craft-host", @@ -2284,7 +2284,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-behavior", "craft-host", @@ -2303,7 +2303,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "base64 0.22.1", "chrono", @@ -2335,7 +2335,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "flate2", "serde", @@ -2346,7 +2346,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2356,7 +2356,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "js-sys", "serde_json", @@ -2367,7 +2367,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "winsafe", ] @@ -2375,7 +2375,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "craft-appkit", "craft-atomic", @@ -2407,7 +2407,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "quick-xml 0.41.0", "serde", @@ -3762,7 +3762,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "brotli", "hayro-postscript", @@ -3771,7 +3771,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3789,7 +3789,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3807,12 +3807,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "flate2", "hayro-ccitt", @@ -4795,7 +4795,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4952,7 +4952,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=27c2cbf821ccf3842f789484f0234460cfcd07a6#27c2cbf821ccf3842f789484f0234460cfcd07a6" +source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" dependencies = [ "arrayvec", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index 1dfeb423a9..d3057fb0af 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,46 +11,46 @@ rust-version = "1.95" repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } # The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON. -craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } # `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile. -craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6", features = ["pcraft-pixels"] } +craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", features = ["pcraft-pixels"] } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } # The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names # the members it imports. -craft = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } # Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui # without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes. -craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } @@ -193,13 +193,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } emath = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } epaint = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index 7f84c95338..c220474112 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -27,7 +27,7 @@ log = { workspace = true } # `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback. eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] } # The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft. -craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "27c2cbf821ccf3842f789484f0234460cfcd07a6", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index 6dafe7147a..f4f02f8627 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "27c2cbf821ccf3842f789484f0234460cfcd07a6"; +const REV: &str = "186a229c8da8db5916f8a863dfd894f1879af735"; const PACKAGES: &[(&str, &str, &str)] = &[ ("craft-pdf", "0.1.0", REV), ("krilla", "0.8.2", REV), From 3ad283b9b0b2b4cb81ba1c141edcfe02df22add9 Mon Sep 17 00:00:00 2001 From: ".CooCoo" Date: Sun, 29 Nov 2026 06:10:57 -0800 Subject: [PATCH 58/61] CI: ui-egui tests run on two shards (#10080) vectorcraft-ui-egui's tests were one leg that set the pull request run's length (33.2 min median over 20 runs: about 19 min compiling and 11.9 min running 5,288 tests). The gate now has six legs. Shards 1 and 2 each build vectorcraft-ui-egui's tests and run half of them with nextest's count partition. Each part also runs its own pinned slow tests, so the slowest tests do not land on one leg. Part 1 alone runs the doctests and the i18n report, and `cargo xtask ci warm` builds the split once. Before running, a part lists the tests and stops with an error when a pinned test name no longer exists. The xtask shard tests check that every test of a split runs on exactly one part. The nightly signing policy and its preparation doc list the new job names (`test N/6`). --- .github/nightly-signing-policy.json | 15 +- .github/workflows/ci.yml | 11 +- docs/nightly-release-preparation.md | 6 +- xtask/src/main.rs | 84 ++++++-- xtask/src/shards.rs | 291 ++++++++++++++++++++++++++-- 5 files changed, 365 insertions(+), 42 deletions(-) diff --git a/.github/nightly-signing-policy.json b/.github/nightly-signing-policy.json index 6b6099e7b6..6427f339db 100644 --- a/.github/nightly-signing-policy.json +++ b/.github/nightly-signing-policy.json @@ -38,27 +38,32 @@ "applicability": "required" }, { - "name": "gate / test 1/5 (ubuntu-24.04)", + "name": "gate / test 1/6 (ubuntu-24.04)", "app_id": 15368, "applicability": "required" }, { - "name": "gate / test 2/5 (ubuntu-24.04)", + "name": "gate / test 2/6 (ubuntu-24.04)", "app_id": 15368, "applicability": "required" }, { - "name": "gate / test 3/5 (ubuntu-24.04)", + "name": "gate / test 3/6 (ubuntu-24.04)", "app_id": 15368, "applicability": "required" }, { - "name": "gate / test 4/5 (ubuntu-24.04)", + "name": "gate / test 4/6 (ubuntu-24.04)", "app_id": 15368, "applicability": "required" }, { - "name": "gate / test 5/5 (ubuntu-24.04)", + "name": "gate / test 5/6 (ubuntu-24.04)", + "app_id": 15368, + "applicability": "required" + }, + { + "name": "gate / test 6/6 (ubuntu-24.04)", "app_id": 15368, "applicability": "required" }, diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7ae30d3ca..0954b5c35c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,11 +39,12 @@ jobs: dev-strip: true # The workspace crates also build without line tables. A panic still names its file and line. dev-debug: "0" - # Five legs instead of one: shards 1 to 4 each build and run the tests of their own crates, - # and shard 5 runs the other `cargo xtask ci` steps (xtask/src/shards.rs). `gate ()` - # passes only when all five did. On pushes to main, a `cache warm` leg builds what every - # shard builds and saves the dependency cache. - test-shards: 5 + # Six legs instead of one: shards 1 and 2 each build vectorcraft-ui-egui's tests and run + # half of them, shards 3 to 5 each build and run the tests of their own crates, and shard 6 + # runs the other `cargo xtask ci` steps (xtask/src/shards.rs). `gate ()` passes only + # when all six did. On pushes to main, a `cache warm` leg builds what every shard builds and + # saves the dependency cache. + test-shards: 6 shard-command: cargo xtask ci shard warm-command: cargo xtask ci warm # The dependency cache also keeps the compiled workspace crates and test executables, so a diff --git a/docs/nightly-release-preparation.md b/docs/nightly-release-preparation.md index 3d9d1fe494..c2b4917fad 100644 --- a/docs/nightly-release-preparation.md +++ b/docs/nightly-release-preparation.md @@ -78,9 +78,13 @@ Read on 2026-11-24; re-read anything that may have moved before `nightly-signer` | `manual_actors` / `automatic_signer_actors` | the five release managers / `[]` | release-managers team (id 19837241) members who can push; equals the producer caller's `manual-actors` | | `max_age_seconds`, `max_artifact_bytes` | `86400`, `2147483648` | Go-live checklist | | `platforms` | three rows | Learning Machines stable identities (Windows Authenticode publisher subject, Linux OpenPGP fingerprint, Apple Developer ID team `DJ6XS33FX8`) | -| `candidate_policy.required_workflows` | CI (`ci.yml`, workflow `380135806`), 8 jobs | Workflow list API; jobs that succeeded on recent main push runs | +| `candidate_policy.required_workflows` | CI (`ci.yml`, workflow `380135806`), 9 jobs | Workflow list API; jobs that succeeded on recent main push runs | | `candidate_policy.sonar` | `storytold` / `storytold_vectorcraft`, app `12526` | `sonar-project.properties`; the SonarCloud check on main commits | +The signer reads the policy from `nightly-signer`, so a candidate whose CI ran six test shards +(`test 1/6` to `test 6/6`) is admitted only after `nightly-signer` advances to a main commit with +this policy. Candidates whose CI ran five shards should be signed before that advance. + ## Ownership and interface - `.github/workflows/nightly.yml`: default-main registration of the unsigned producer, named diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 28f0622914..ba0ed79acf 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -23,7 +23,7 @@ mod version; mod web_fonts; use std::path::{Path, PathBuf}; -use std::process::{Command, ExitCode}; +use std::process::{Command, ExitCode, Stdio}; const USAGE: &str = "\ usage: cargo xtask @@ -264,12 +264,63 @@ fn has_nextest() -> bool { /// The workspace's unit and integration tests, without examples (clippy still checks those). /// nextest runs each test in its own process, in parallel across all test binaries. fn cmd_test() -> Result<(), String> { - test_packages(&["--workspace".to_owned()], "--workspace") + test_packages(&["--workspace".to_owned()], "--workspace", None) } -/// [`cmd_test`] for the packages `select` picks (`--workspace` or `-p` ids), shown as `shown`. -fn test_packages(select: &[String], shown: &str) -> Result<(), String> { +/// [`cmd_test`] for the packages `select` picks (`--workspace` or `-p` ids), shown as `shown`; +/// with `part`, only that part's share of their tests (xtask/src/shards.rs), which needs nextest. +fn test_packages(select: &[String], shown: &str, part: Option) -> Result<(), String> { const TARGETS: [&str; 3] = ["--lib", "--bins", "--tests"]; + if let Some(part) = part { + if !has_nextest() { + return Err(format!("cargo nextest run {shown}: a shard that runs part of a crate's tests needs cargo-nextest")); + } + let mut c = cargo(); + c.args(["nextest", "list", "--color", "never", "--message-format", "json"]).args(select).args(TARGETS); + let out = c.stderr(Stdio::inherit()).output().map_err(|e| format!("cargo nextest list {shown}: failed to spawn: {e}"))?; + if !out.status.success() { + return Err(format!("cargo nextest list {shown}: exited with {}", out.status)); + } + let missing = part.missing_pins(&String::from_utf8_lossy(&out.stdout)).map_err(|e| format!("cargo nextest list {shown}: {e}"))?; + if !missing.is_empty() { + return Err(format!( + "cargo nextest list {shown}: no test has the full name of pinned test(s) {} (update `pinned` in xtask/src/shards.rs)", + missing.join(", ") + )); + } + let command = |args: Vec| { + let mut c = cargo(); + c.args(["nextest", "run"]).args(select).args(TARGETS).args(&args); + let quoted = args.iter().map(|a| if a.contains(' ') { format!("'{a}'") } else { a.clone() }).collect::>().join(" "); + (c, format!("cargo nextest run {shown} --lib --bins --tests {quoted}")) + }; + let cpus = std::thread::available_parallelism().map_or(1, usize::from); + let pinned_threads = part.pins().max(1).min(cpus.saturating_sub(1).max(1)); + let counted_threads = if part.pins() == 0 { cpus } else { cpus.saturating_sub(pinned_threads).max(1) }; + let mut runs = part.runs().into_iter(); + let mut counted = runs.next().ok_or_else(|| format!("cargo nextest run {shown}: no counted run"))?; + counted.extend(["--test-threads".to_owned(), counted_threads.to_string()]); + let pinned = runs + .next() + .map(|mut args| { + args.extend(["--test-threads".to_owned(), pinned_threads.to_string()]); + let (mut c, what) = command(args); + eprintln!("$ {what}"); + c.spawn().map(|child| (child, what.clone())).map_err(|e| format!("{what}: failed to spawn: {e}")) + }) + .transpose()?; + let (c, what) = command(counted); + let counted_result = run(c, &what); + let pinned_result = match pinned { + None => Ok(()), + Some((mut child, what)) => match child.wait() { + Ok(status) if status.success() => Ok(()), + Ok(status) => Err(format!("{what}: exited with {status}")), + Err(e) => Err(format!("{what}: failed to wait: {e}")), + }, + }; + return counted_result.and(pinned_result); + } let mut c = cargo(); if has_nextest() { c.args(["nextest", "run"]).args(select).args(TARGETS); @@ -307,7 +358,8 @@ fn cmd_ci() -> Result<(), String> { /// `cargo xtask ci shard`: shard `GATE_SHARD` of `GATE_SHARDS` (1-based, as the shared gate /// workflow sets them). A test shard runs the shard checks, then the tests and doctests of its -/// crates, and the i18n report where it tests vectorcraft-ui-egui. The checks shard runs every +/// crates, and the i18n report where it tests vectorcraft-ui-egui; a part of a split runs its +/// share of the tests, and only part 1 the doctests and the report. The checks shard runs every /// other `ci` step and the shard checks. fn cmd_ci_shard() -> Result<(), String> { let number = |key: &str| -> Result { @@ -327,16 +379,22 @@ fn cmd_ci_shard() -> Result<(), String> { let checked = shards::run()?; let mut steps: Vec = Vec::new(); match &checked[shard - 1] { - shards::Shard::Tests(crates) => { + shards::Shard::Tests(crates, part) => { let names = shards::names(crates); - eprintln!("ci shard {shard}/{count}: the tests of {names}"); + let share = part.map(|p| format!(" (part {} of {})", p.index, p.split.parts())).unwrap_or_default(); + eprintln!("ci shard {shard}/{count}: the tests of {names}{share}"); let select = shards::select(crates); let shown = crates.iter().map(|m| format!("-p {}", m.name)).collect::>().join(" "); + let part = *part; let (s, w) = (select.clone(), shown.clone()); - steps.push(("test", Box::new(move || test_packages(&s, &w)))); + steps.push(("test", Box::new(move || test_packages(&s, &w, part)))); + // The doctests and the i18n report run once, on a split's first part. + let first = part.is_none_or(|p| p.is_first()); let (s, w) = (select.clone(), shown.clone()); - steps.push(("doctests", Box::new(move || doctest_packages(&s, &w)))); - if crates.iter().any(|m| m.name == "vectorcraft-ui-egui") { + if first { + steps.push(("doctests", Box::new(move || doctest_packages(&s, &w)))); + } + if first && crates.iter().any(|m| m.name == "vectorcraft-ui-egui") { steps.push(("i18n-report", Box::new(move || i18n_report_packages(&select, &shown)))); } } @@ -361,7 +419,11 @@ fn cmd_ci_warm() -> Result<(), String> { let checked = shards::run()?; let mut steps: Vec = Vec::new(); for shard in checked { - if let shards::Shard::Tests(crates) = shard { + // A split's later parts build the same tests as its first. + if let shards::Shard::Tests(crates, part) = shard { + if part.is_some_and(|p| !p.is_first()) { + continue; + } steps.push(( "build tests", Box::new(move || { diff --git a/xtask/src/shards.rs b/xtask/src/shards.rs index a885619b15..1baede03bd 100644 --- a/xtask/src/shards.rs +++ b/xtask/src/shards.rs @@ -10,6 +10,12 @@ //! its features in `cargo test --workspace`. Cargo resolves features over the packages a command //! selects, so a feature that only another crate's dev-dependencies turn on is off in a shard //! without that crate, and the tests behind it do not build. +//! +//! A [`Split`] runs the tests of its crates on several shards in a row ([`Group::Part`]). Each +//! part builds the same tests and runs its share of them: the tests its `pinned` list names, and +//! every other test of the crates by nextest's counted partition (`--partition count:/` +//! with the pinned tests filtered out, so each of them runs once). The doctests and the i18n +//! report run on part 1. use std::collections::{BTreeMap, BTreeSet}; @@ -20,15 +26,53 @@ use serde_json::Value; pub enum Group { /// The tests of these workspace crates (package names). Crates(&'static [&'static str]), + /// Part `k` (1-based) of a split's tests. Parts 1 to n of a split are consecutive shards. + Part(&'static Split, usize), /// The tests of every workspace member no other group names. Rest, /// The `cargo xtask ci` steps that are not tests. Checks, } +/// Crates whose tests run on several shards, one [`Group::Part`] each. +#[derive(Debug, PartialEq, Eq)] +pub struct Split { + /// The workspace crates (package names). + pub crates: &'static [&'static str], + /// For each part, the full names of the tests it runs outside the counted partition (the + /// slowest ones, spread so that no part waits on all of them). Its length is the part count. + pub pinned: &'static [&'static [&'static str]], +} + +impl Split { + /// How many shards the split runs on. + pub fn parts(&self) -> usize { + self.pinned.len() + } +} + +/// vectorcraft-ui-egui's tests, on two shards. The pinned tests took 23 to 74 s each in CI +/// (run 46256086023), and each part's pinned tests add up to about 120 to 130 s. +pub static UI_EGUI: Split = Split { + crates: &["vectorcraft-ui-egui"], + pinned: &[ + &[ + "panels::actions::tests_edits::every_listed_menu_item_runs_from_the_menu_what_its_step_holds", + "dialogs::revolve::tests::a_3d_row_sets_its_param_previews_and_applies_in_one_step", + "shortcuts::tests::alt_chords_type_special_characters_while_editing_text", + ], + &[ + "palette::tests::the_palette_leaves_out_the_commands_a_pick_cannot_run", + "chrome::tests::the_control_bar_leaves_members_out_in_its_priority_order", + "menus::tests::help_f1_opens_discover_without_a_document", + ], + ], +}; + /// The shards in order; `test-shards` in `.github/workflows/ci.yml` is its length. pub const GROUPS: &[Group] = &[ - Group::Crates(&["vectorcraft-ui-egui"]), + Group::Part(&UI_EGUI, 1), + Group::Part(&UI_EGUI, 2), Group::Crates(&["vectorcraft-engine"]), Group::Crates(&["vectorcraft", "vectorcraft-web", "vectorcraft-cli", "vectorcraft-mcp", "xtask"]), Group::Rest, @@ -45,13 +89,70 @@ pub struct Member { pub version: String, } -/// What one shard runs, with its crates resolved. +/// What one shard runs, with its crates resolved; a shard of a [`Split`] carries its part. #[derive(Debug, Clone, PartialEq, Eq)] pub enum Shard { - Tests(Vec), + Tests(Vec, Option), Checks, } +/// Part `index` (1-based) of `split`. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct Part { + pub split: &'static Split, + pub index: usize, +} + +impl Part { + /// The number of tests this part pins. + pub fn pins(&self) -> usize { + self.split.pinned[self.index - 1].len() + } + + /// The arguments `cargo nextest run` takes after the package and target selection, once for + /// each run this part makes: the counted share (`--partition count:/`, with every + /// pinned test filtered out when the split pins any), then the tests this part pins. + /// The counted run passes `--no-tests=pass`. The pinned run keeps nextest's default and + /// fails when no tests match. + pub fn runs(&self) -> Vec> { + let all: Vec<&str> = self.split.pinned.iter().flat_map(|p| p.iter().copied()).collect(); + let mut counted = vec!["--partition".to_owned(), format!("count:{}/{}", self.index, self.split.parts()), "--no-tests=pass".to_owned()]; + if !all.is_empty() { + counted.extend(["-E".to_owned(), format!("not ({})", exact(&all))]); + } + let mut runs = vec![counted]; + let own = self.split.pinned[self.index - 1]; + if !own.is_empty() { + runs.push(vec!["-E".to_owned(), exact(own)]); + } + runs + } + + /// The tests this part pins whose full names are absent from + /// `cargo nextest list --message-format json` output. Invalid listings return an error. + pub fn missing_pins(&self, list: &str) -> Result, String> { + let list: Value = serde_json::from_str(list).map_err(|e| format!("invalid JSON listing: {e}"))?; + let suites = list.get("rust-suites").and_then(Value::as_object).ok_or("JSON listing has no `rust-suites` map")?; + let mut listed = BTreeSet::new(); + for (binary, suite) in suites { + let tests = + suite.get("testcases").and_then(Value::as_object).ok_or_else(|| format!("JSON listing has no `testcases` map for `{binary}`"))?; + listed.extend(tests.keys().map(String::as_str)); + } + Ok(self.split.pinned[self.index - 1].iter().copied().filter(|p| !listed.contains(p)).collect()) + } + + /// Whether this part runs the doctests and the i18n report. + pub fn is_first(&self) -> bool { + self.index == 1 + } +} + +/// A filterset that matches each of `names` exactly. +fn exact(names: &[&str]) -> String { + names.iter().map(|n| format!("test(={n})")).collect::>().join(" | ") +} + /// The workspace members of `cargo metadata --no-deps` output, in its order. pub fn members(meta: &Value) -> Result, String> { let ids: BTreeSet<&str> = meta["workspace_members"].as_array().into_iter().flatten().filter_map(Value::as_str).collect(); @@ -72,22 +173,49 @@ pub fn members(meta: &Value) -> Result, String> { } /// Each group of `groups` with its crates: a named crate must be a workspace member and named -/// once, there must be exactly one [`Group::Rest`], and no test shard may be empty. +/// once, there must be exactly one [`Group::Rest`], and no test shard may be empty. A split's +/// parts 1 to n must be consecutive shards, with at least two parts, and no test pinned twice. pub fn assign(groups: &[Group], members: &[Member]) -> Result, String> { const WHERE: &str = "xtask/src/shards.rs › GROUPS"; let mut named: BTreeMap<&str, usize> = BTreeMap::new(); for (i, g) in groups.iter().enumerate() { - if let Group::Crates(names) = g { - if names.is_empty() { - return Err(format!("shard {} names no crates ({WHERE})", i + 1)); + let names = match g { + Group::Crates(names) => *names, + Group::Part(split, k) => { + let n = split.parts(); + if n < 2 { + return Err(format!("shard {} is a part of a split with {n} part(s), not 2 or more ({WHERE})", i + 1)); + } + // Part 1 of the split is shard `first` (0-based) when this shard is part k. + let in_order = (1..=n).contains(k) + && (i + 1).checked_sub(*k).is_some_and(|first| { + (1..=n).all(|p| matches!(groups.get(first + p - 1), Some(Group::Part(s, q)) if *s == *split && *q == p)) + }); + if !in_order { + return Err(format!("shard {} is part {k} of a split whose {n} parts are not shards 1 to {n} in a row ({WHERE})", i + 1)); + } + if *k > 1 { + continue; + } + let mut pinned = BTreeSet::new(); + for name in split.pinned.iter().flat_map(|p| p.iter()) { + if !pinned.insert(*name) { + return Err(format!("`{name}` is pinned to two parts of shard {}'s split ({WHERE})", i + 1)); + } + } + split.crates } - for name in *names { - if !members.iter().any(|m| m.name == *name) { - return Err(format!("shard {} names `{name}`, which is not a workspace member ({WHERE})", i + 1)); - } - if let Some(first) = named.insert(name, i) { - return Err(format!("`{name}` is in shard {} and shard {} ({WHERE})", first + 1, i + 1)); - } + Group::Rest | Group::Checks => continue, + }; + if names.is_empty() { + return Err(format!("shard {} names no crates ({WHERE})", i + 1)); + } + for name in names { + if !members.iter().any(|m| m.name == *name) { + return Err(format!("shard {} names `{name}`, which is not a workspace member ({WHERE})", i + 1)); + } + if let Some(first) = named.insert(name, i) { + return Err(format!("`{name}` is in shard {} and shard {} ({WHERE})", first + 1, i + 1)); } } } @@ -100,13 +228,14 @@ pub fn assign(groups: &[Group], members: &[Member]) -> Result, String .iter() .enumerate() .map(|(i, g)| match g { - Group::Crates(names) => Ok(Shard::Tests(pick(&|m| names.contains(&m.name.as_str())))), + Group::Crates(names) => Ok(Shard::Tests(pick(&|m| names.contains(&m.name.as_str())), None)), + Group::Part(split, index) => Ok(Shard::Tests(pick(&|m| split.crates.contains(&m.name.as_str())), Some(Part { split, index: *index }))), Group::Rest => { let rest = pick(&|m| !named.contains_key(m.name.as_str())); if rest.is_empty() { return Err(format!("shard {} takes the remaining crates, and there are none ({WHERE})", i + 1)); } - Ok(Shard::Tests(rest)) + Ok(Shard::Tests(rest, None)) } Group::Checks => Ok(Shard::Checks), }) @@ -184,7 +313,7 @@ pub fn check() -> Result, String> { let workspace = tree_features(&tree(&["--workspace".to_owned()])?, &members); let mut differences = Vec::new(); for (i, shard) in shards.iter().enumerate() { - if let Shard::Tests(crates) = shard { + if let Shard::Tests(crates, _) = shard { let alone = tree_features(&tree(&select(crates))?, &members); differences.extend(feature_differences(i + 1, crates, &workspace, &alone)); } @@ -206,7 +335,10 @@ pub fn run() -> Result, String> { let shards = check()?; for (i, shard) in shards.iter().enumerate() { match shard { - Shard::Tests(crates) => println!("shard {}/{}: tests of {} crate(s): {}", i + 1, shards.len(), crates.len(), names(crates)), + Shard::Tests(crates, part) => { + let share = part.map(|p| format!(", part {} of {}", p.index, p.split.parts())).unwrap_or_default(); + println!("shard {}/{}: tests of {} crate(s): {}{share}", i + 1, shards.len(), crates.len(), names(crates)) + } Shard::Checks => println!("shard {}/{}: the other ci steps", i + 1, shards.len()), } } @@ -224,11 +356,130 @@ mod tests { fn crates(shard: &Shard) -> Vec<&str> { match shard { - Shard::Tests(c) => c.iter().map(|m| m.name.as_str()).collect(), + Shard::Tests(c, _) => c.iter().map(|m| m.name.as_str()).collect(), Shard::Checks => Vec::new(), } } + /// The crates of each shard that runs a crate's tests from the start: a part after the first + /// runs a share of the same tests, so it is counted with part 1. + fn owners(shard: &Shard) -> Vec<&str> { + match shard { + Shard::Tests(_, Some(p)) if !p.is_first() => Vec::new(), + _ => crates(shard), + } + } + + /// The tests (binary ids and full names, in the order nextest lists them) that one `cargo nextest run` with + /// `args` from [`Part::runs`] runs, as nextest selects them: the `-E` filterset (`test(=…)` + /// terms joined by `|`, or `not (…)` of them) first, then `--partition count:/`, which + /// keeps the i-th (0-based) test the filter left in each binary when `i % n` is `k - 1`. + fn selected<'a>(args: &[String], tests: &[(&'a str, &'a str)]) -> Vec<(&'a str, &'a str)> { + let value = |flag: &str| args.iter().position(|a| a == flag).map(|i| args[i + 1].as_str()); + let filtered: Vec<(&str, &str)> = match value("-E") { + None => tests.to_vec(), + Some(expr) => { + let (negated, body) = expr.strip_prefix("not (").and_then(|e| e.strip_suffix(')')).map_or((false, expr), |b| (true, b)); + let names: Vec<&str> = body.split(" | ").map(|t| t.strip_prefix("test(=").and_then(|t| t.strip_suffix(')')).unwrap()).collect(); + tests.iter().copied().filter(|(_, t)| names.contains(t) != negated).collect() + } + }; + match value("--partition") { + None => filtered, + Some(p) => { + let (k, n) = p.strip_prefix("count:").and_then(|p| p.split_once('/')).unwrap(); + let (k, n): (usize, usize) = (k.parse().unwrap(), n.parse().unwrap()); + let mut counts = BTreeMap::new(); + filtered + .into_iter() + .filter(|(binary, _)| { + let count = counts.entry(*binary).or_insert(0); + let selected = *count % n == k - 1; + *count += 1; + selected + }) + .collect() + } + } + } + + /// The tests each part of `split` runs, over all of its runs. + fn share<'a>(split: &'static Split, tests: &[(&'a str, &'a str)]) -> Vec> { + (1..=split.parts()).map(|index| Part { split, index }.runs().iter().flat_map(|args| selected(args, tests)).collect()).collect() + } + + static SPLIT: Split = Split { crates: &["a"], pinned: &[&["a::slow1", "a::slow3"], &["a::slow2"]] }; + + #[test] + fn a_split_runs_on_its_parts_in_a_row() { + let ws = [m("a"), m("b")]; + let shards = assign(&[Group::Part(&SPLIT, 1), Group::Part(&SPLIT, 2), Group::Rest, Group::Checks], &ws).unwrap(); + assert_eq!(shards.iter().map(crates).collect::>(), [vec!["a"], vec!["a"], vec!["b"], vec![]]); + assert_eq!(shards[1], Shard::Tests(vec![m("a")], Some(Part { split: &SPLIT, index: 2 }))); + let apart = assign(&[Group::Part(&SPLIT, 1), Group::Rest, Group::Part(&SPLIT, 2)], &ws).unwrap_err(); + assert!(apart.contains("not shards 1 to 2 in a row"), "{apart}"); + let missing = assign(&[Group::Part(&SPLIT, 2), Group::Rest], &ws).unwrap_err(); + assert!(missing.contains("shard 1 is part 2"), "{missing}"); + let twice = assign(&[Group::Part(&SPLIT, 1), Group::Part(&SPLIT, 2), Group::Crates(&["a"]), Group::Rest], &ws).unwrap_err(); + assert!(twice.contains("`a` is in shard 1 and shard 3"), "{twice}"); + const ONE: Split = Split { crates: &["a"], pinned: &[&[]] }; + assert!(assign(&[Group::Part(&ONE, 1), Group::Rest], &ws).unwrap_err().contains("not 2 or more")); + const DOUBLE: Split = Split { crates: &["a"], pinned: &[&["a::t"], &["a::t"]] }; + assert!(assign(&[Group::Part(&DOUBLE, 1), Group::Part(&DOUBLE, 2), Group::Rest], &ws).unwrap_err().contains("pinned to two parts")); + } + + #[test] + fn every_test_of_a_split_runs_on_exactly_one_part() { + let tests = [ + ("a::lib", "a::t1"), + ("a::lib", "a::slow1"), + ("a::lib", "a::t2"), + ("a::lib", "a::t3"), + ("a::bin/a", "a::slow2"), + ("a::bin/a", "a::t4"), + ("a::bin/a", "a::t5"), + ("a::bin/a", "a::slow3"), + ]; + let parts = share(&SPLIT, &tests); + assert_eq!( + parts, + [ + vec![("a::lib", "a::t1"), ("a::lib", "a::t3"), ("a::bin/a", "a::t4"), ("a::lib", "a::slow1"), ("a::bin/a", "a::slow3")], + vec![("a::lib", "a::t2"), ("a::bin/a", "a::t5"), ("a::bin/a", "a::slow2")], + ] + ); + let mut all = parts.concat(); + all.sort_unstable(); + let mut want = tests.to_vec(); + want.sort_unstable(); + assert_eq!(all, want); + let (one, two) = (Part { split: &SPLIT, index: 1 }, Part { split: &SPLIT, index: 2 }); + assert_eq!( + one.runs(), + [ + vec![ + "--partition".to_owned(), + "count:1/2".to_owned(), + "--no-tests=pass".to_owned(), + "-E".to_owned(), + "not (test(=a::slow1) | test(=a::slow3) | test(=a::slow2))".to_owned(), + ], + vec!["-E".to_owned(), "test(=a::slow1) | test(=a::slow3)".to_owned()], + ] + ); + assert!(one.is_first() && !two.is_first()); + let list = r#"{"rust-suites":{"a::lib":{"testcases":{"a::t1":{},"a::slow1":{}}},"a::bin/a":{"testcases":{"a::slow2":{}}}}}"#; + assert_eq!(one.missing_pins(list).unwrap(), ["a::slow3"]); + assert!(two.missing_pins(list).unwrap().is_empty()); + assert!(one.missing_pins("invalid JSON").is_err()); + assert!(one.missing_pins("{}").is_err()); + assert!(one.missing_pins(r#"{"rust-suites":{"a::lib":{}}}"#).is_err()); + // A split that pins nothing passes no filterset, which nextest would reject as `not ()`. + static BARE: Split = Split { crates: &["a"], pinned: &[&[], &[]] }; + assert_eq!(Part { split: &BARE, index: 2 }.runs(), [vec!["--partition".to_owned(), "count:2/2".to_owned(), "--no-tests=pass".to_owned()]]); + assert_eq!(share(&BARE, &tests).concat().len(), tests.len()); + } + #[test] fn the_rest_shard_takes_every_crate_no_group_names() { let ws = [m("a"), m("b"), m("c"), m("d")]; @@ -259,7 +510,7 @@ mod tests { fn every_workspace_member_is_tested_on_exactly_one_shard() { let ws = members(&crate::metadata().unwrap()).unwrap(); let shards = assign(GROUPS, &ws).unwrap(); - let mut tested: Vec<&str> = shards.iter().flat_map(crates).collect(); + let mut tested: Vec<&str> = shards.iter().flat_map(owners).collect(); tested.sort_unstable(); let mut all: Vec<&str> = ws.iter().map(|m| m.name.as_str()).collect(); all.sort_unstable(); From 6a6fa5056cdb4c8bf6d6f7594f28dd5fafe25a65 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 06:20:45 -0800 Subject: [PATCH 59/61] CI: the two ui-egui shards take about the same time Each ui-egui part ran its pinned tests with --test-threads 3 beside its counted share with --test-threads 1. On the 4-CPU runners the pinned tests finished in about 40 s, and the counted share of about 2,640 tests then ran on one thread for 9 to 12 minutes (run 46267439238). A part now runs its counted share and then its pinned tests, one after the other, each with nextest's default thread count. The help F1 test moves to part 1's pinned list, which leaves the two parts with closer test totals. --- xtask/src/main.rs | 34 ++++++++-------------------------- xtask/src/shards.rs | 14 +++++--------- 2 files changed, 13 insertions(+), 35 deletions(-) diff --git a/xtask/src/main.rs b/xtask/src/main.rs index ba0ed79acf..7c2e587a7d 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -269,6 +269,8 @@ fn cmd_test() -> Result<(), String> { /// [`cmd_test`] for the packages `select` picks (`--workspace` or `-p` ids), shown as `shown`; /// with `part`, only that part's share of their tests (xtask/src/shards.rs), which needs nextest. +/// A part runs its counted share, then its pinned tests, each with nextest's default thread count. +/// Every run finishes before the first error is returned. fn test_packages(select: &[String], shown: &str, part: Option) -> Result<(), String> { const TARGETS: [&str; 3] = ["--lib", "--bins", "--tests"]; if let Some(part) = part { @@ -294,32 +296,12 @@ fn test_packages(select: &[String], shown: &str, part: Option) -> let quoted = args.iter().map(|a| if a.contains(' ') { format!("'{a}'") } else { a.clone() }).collect::>().join(" "); (c, format!("cargo nextest run {shown} --lib --bins --tests {quoted}")) }; - let cpus = std::thread::available_parallelism().map_or(1, usize::from); - let pinned_threads = part.pins().max(1).min(cpus.saturating_sub(1).max(1)); - let counted_threads = if part.pins() == 0 { cpus } else { cpus.saturating_sub(pinned_threads).max(1) }; - let mut runs = part.runs().into_iter(); - let mut counted = runs.next().ok_or_else(|| format!("cargo nextest run {shown}: no counted run"))?; - counted.extend(["--test-threads".to_owned(), counted_threads.to_string()]); - let pinned = runs - .next() - .map(|mut args| { - args.extend(["--test-threads".to_owned(), pinned_threads.to_string()]); - let (mut c, what) = command(args); - eprintln!("$ {what}"); - c.spawn().map(|child| (child, what.clone())).map_err(|e| format!("{what}: failed to spawn: {e}")) - }) - .transpose()?; - let (c, what) = command(counted); - let counted_result = run(c, &what); - let pinned_result = match pinned { - None => Ok(()), - Some((mut child, what)) => match child.wait() { - Ok(status) if status.success() => Ok(()), - Ok(status) => Err(format!("{what}: exited with {status}")), - Err(e) => Err(format!("{what}: failed to wait: {e}")), - }, - }; - return counted_result.and(pinned_result); + let mut result = Ok(()); + for args in part.runs() { + let (c, what) = command(args); + result = result.and(run(c, &what)); + } + return result; } let mut c = cargo(); if has_nextest() { diff --git a/xtask/src/shards.rs b/xtask/src/shards.rs index 1baede03bd..29f5281a84 100644 --- a/xtask/src/shards.rs +++ b/xtask/src/shards.rs @@ -15,7 +15,8 @@ //! part builds the same tests and runs its share of them: the tests its `pinned` list names, and //! every other test of the crates by nextest's counted partition (`--partition count:/` //! with the pinned tests filtered out, so each of them runs once). The doctests and the i18n -//! report run on part 1. +//! report run on part 1. A part runs its counted share and then its pinned tests, each with +//! nextest's default thread count, and runs both even when the first fails. use std::collections::{BTreeMap, BTreeSet}; @@ -51,8 +52,8 @@ impl Split { } } -/// vectorcraft-ui-egui's tests, on two shards. The pinned tests took 23 to 74 s each in CI -/// (run 46256086023), and each part's pinned tests add up to about 120 to 130 s. +/// vectorcraft-ui-egui's tests, on two shards. The pinned tests took 18 to 44 s each in CI +/// run 46267439238. pub static UI_EGUI: Split = Split { crates: &["vectorcraft-ui-egui"], pinned: &[ @@ -60,11 +61,11 @@ pub static UI_EGUI: Split = Split { "panels::actions::tests_edits::every_listed_menu_item_runs_from_the_menu_what_its_step_holds", "dialogs::revolve::tests::a_3d_row_sets_its_param_previews_and_applies_in_one_step", "shortcuts::tests::alt_chords_type_special_characters_while_editing_text", + "menus::tests::help_f1_opens_discover_without_a_document", ], &[ "palette::tests::the_palette_leaves_out_the_commands_a_pick_cannot_run", "chrome::tests::the_control_bar_leaves_members_out_in_its_priority_order", - "menus::tests::help_f1_opens_discover_without_a_document", ], ], }; @@ -104,11 +105,6 @@ pub struct Part { } impl Part { - /// The number of tests this part pins. - pub fn pins(&self) -> usize { - self.split.pinned[self.index - 1].len() - } - /// The arguments `cargo nextest run` takes after the package and target selection, once for /// each run this part makes: the counted share (`--partition count:/`, with every /// pinned test filtered out when the split pins any), then the tests this part pins. From 6ef6df34072e09bbd15e8ce7c2b889637695f75c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 06:45:32 -0800 Subject: [PATCH 60/61] Scripts: round artboard rows as main's New Document test expects, and drop pathItems= from the host table Cause of the CI failures on 212090fd7a2: - main's dialogs::new_document test a_presets_rows_reach_the_document_create_makes sets artboardLayout.rows to 3.6 and expects 4, but this branch refused a rows value that was not a whole number. rows now rounds like columns and is still refused outside 1 to 1000. - script_host_vs_scriptcheck listed Document.prototype.pathItems=, the setter of main's placeholder. This branch makes pathItems a read-only collection, like pageItems, so the row goes. --- crates/engine/src/cmd/newdoc.rs | 5 +++-- crates/engine/src/tests/newdoc.rs | 2 +- crates/engine/src/tests/script_dom.rs | 2 +- crates/engine/tests/it/script_host_vs_scriptcheck.rs | 2 +- docs/mcp.md | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/cmd/newdoc.rs b/crates/engine/src/cmd/newdoc.rs index e4355bf934..21f3661c89 100644 --- a/crates/engine/src/cmd/newdoc.rs +++ b/crates/engine/src/cmd/newdoc.rs @@ -395,9 +395,10 @@ impl DocSettings { "rows" => { self.rows = v .as_f64() - .filter(|r| r.fract() == 0.0 && (1.0..=MAX_ARTBOARDS as f64).contains(r)) + .map(f64::round) + .filter(|r| (1.0..=MAX_ARTBOARDS as f64).contains(r)) .map(|r| r as u32) - .ok_or_else(|| bad(cmd, format!("artboardLayout.rows must be a whole number from 1 to {MAX_ARTBOARDS}")))? + .ok_or_else(|| bad(cmd, format!("artboardLayout.rows must be from 1 to {MAX_ARTBOARDS}")))? } "spacing" => { self.spacing = v diff --git a/crates/engine/src/tests/newdoc.rs b/crates/engine/src/tests/newdoc.rs index cd8feca36d..ad2711558e 100644 --- a/crates/engine/src/tests/newdoc.rs +++ b/crates/engine/src/tests/newdoc.rs @@ -161,7 +161,7 @@ fn ppi_overprint_preview_and_bad_params() { json!({"artboardLayout": {"layout": "spiral"}}), json!({"artboardLayout": {"columns": 0}}), json!({"artboardLayout": {"rows": 0}}), - json!({"artboardLayout": {"layout": "gridByColumn", "rows": 1.5}}), + json!({"artboardLayout": {"layout": "gridByColumn", "rows": 0.4}}), json!({"artboardLayout": {"layout": "gridByColumn", "rows": 1001}}), json!({"artboardLayout": {"tiles": 2}}), json!({"units": "furlongs"}), diff --git a/crates/engine/src/tests/script_dom.rs b/crates/engine/src/tests/script_dom.rs index 5d6b14da3b..03cab27e93 100644 --- a/crates/engine/src/tests/script_dom.rs +++ b/crates/engine/src/tests/script_dom.rs @@ -1017,7 +1017,7 @@ fn file_new_takes_the_rows_of_a_grid_by_column() { let (plain, spaced) = (plain.with_params(&to_row, "file.new").unwrap(), spaced.with_params(&to_row, "file.new").unwrap()); assert_eq!(plain.grid_columns(), spaced.grid_columns()); let e = s.execute("file.new", &json!({"artboardLayout": {"layout": "gridByColumn", "rows": 0}})).unwrap_err().to_string(); - assert!(e.contains("rows must be a whole number from 1 to 1000"), "{e}"); + assert!(e.contains("rows must be from 1 to 1000"), "{e}"); for layout in ["gridByRow", "row", "column"] { let e = s.execute("file.new", &json!({"artboardLayout": {"layout": layout, "rows": 2}})).unwrap_err().to_string(); assert!(e.contains("rows needs the gridByColumn layout"), "{layout}: {e}"); diff --git a/crates/engine/tests/it/script_host_vs_scriptcheck.rs b/crates/engine/tests/it/script_host_vs_scriptcheck.rs index 513f27ccf9..d8b6c989d5 100644 --- a/crates/engine/tests/it/script_host_vs_scriptcheck.rs +++ b/crates/engine/tests/it/script_host_vs_scriptcheck.rs @@ -113,7 +113,7 @@ const INSIDE: &[(&str, &str)] = &[ defaultStrokeDashOffset= defaultStrokeDashes defaultStrokeDashes= defaultStrokeJoin defaultStrokeJoin= \ defaultStrokeMiterLimit defaultStrokeMiterLimit= defaultStrokeOverprint defaultStrokeOverprint= \ defaultStrokeWidth defaultStrokeWidth= defaultStroked defaultStroked= documentColorSpace groupItems \ - groupItems= height layers layers= name pageItems paragraphStyles parent pathItems pathItems= rulerOrigin \ + groupItems= height layers layers= name pageItems paragraphStyles parent pathItems rulerOrigin \ rulerOrigin= rulerUnits saveAs saveAs= scaleFactor selection selection= stories swatches swatches= \ symbols symbols= tags textFrames toString typename views width", ), diff --git a/docs/mcp.md b/docs/mcp.md index 823adc251f..7ed0eebae6 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -10497,7 +10497,7 @@ and goes back to Document Setup, whose OK runs `document.setup`; its Cancel goes `file.new` takes everything New Document sets: `preset` (a name from `file.newPresets`), `name`, `width`/`height` (points, or lengths such as `"210 mm"`), `units`, `orientation`, `artboards` with `artboardLayout {layout, columns, -rows, spacing, rightToLeft}` (`rows`, a whole number from 1 to 1000, gives a `gridByColumn` layout that many rows, at most one for each artboard, in place of `columns`, and is +rows, spacing, rightToLeft}` (`rows`, 1 to 1000 and rounded to a whole number, gives a `gridByColumn` layout that many rows, at most one for each artboard, in place of `columns`, and is an error with another layout; a preset keeps the rows, and `file.newPresets` lists them as set even when there are fewer artboards, until `columns` without `rows`, or another layout, is given; New Document's Columns shows the columns the rows give the current number of artboards, and New Document drops the rows when Columns or the layout changes), From b5affe3a0b412bb18fba9b9db6ca154f20388d68 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 07:11:52 -0800 Subject: [PATCH 61/61] CI: Desktop printing saves its Windows cache on main and builds the tests once The Windows leg found no cache on every pull request, because only a push or manual run on main saves one and the workflow had no push trigger. A push to main that touches the same paths now saves the entry that pull requests restore. Both test runs now select the app and the UI crate together, so Cargo resolves features once and the printps run reuses the first run's dependencies instead of rebuilding 94 crates. The first run keeps every app test (the binary's unit tests and `tests/it`). --- .github/workflows/print.yml | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/.github/workflows/print.yml b/.github/workflows/print.yml index 8cdaf0cb28..ac941b5098 100644 --- a/.github/workflows/print.yml +++ b/.github/workflows/print.yml @@ -7,9 +7,26 @@ on: - "apps/vectorcraft/Cargo.toml" - "apps/vectorcraft/src/printing.rs" - "apps/vectorcraft/src/printing/**" + - "crates/ui-egui/Cargo.toml" - "crates/ui-egui/src/print.rs" - "crates/ui-egui/src/tests/printps.rs" - ".github/workflows/print.yml" + # A push to main saves the Windows cache entry that pull requests restore. + push: + branches: [main] + paths: + - "Cargo.toml" + - "Cargo.lock" + - "apps/vectorcraft/Cargo.toml" + - "apps/vectorcraft/src/printing.rs" + - "apps/vectorcraft/src/printing/**" + - "crates/ui-egui/Cargo.toml" + - "crates/ui-egui/src/print.rs" + - "crates/ui-egui/src/tests/printps.rs" + - ".github/workflows/print.yml" + # A weekly run on main saves a fresh entry after a new stable Rust changes the cache key. + schedule: + - cron: "23 6 * * 1" workflow_dispatch: permissions: contents: read @@ -18,15 +35,14 @@ concurrency: group: print-${{ github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: - # Desktop printing on Windows, through the suite's shared gate. Pull requests restore the cache - # but never save one; a manual run on main saves the cache they restore. + # Desktop printing on Windows, through the suite's shared gate. Pushes to main, the weekly run and + # manual runs on main save the cache; pull requests restore it and never save one. windows: # Tracks @main so suite-wide CI fixes reach every app without a PR in each repository. uses: storytold/craft-common-actions/.github/workflows/gate.yml@main with: os: '["windows-2022"]' - # A change to Cargo.lock finds no cache (only main saves one) and builds everything cold: - # about 55 minutes for `-p vectorcraft` alone, then the UI crate's tests. + # A run that finds no cache builds everything cold, which took 76 to 126 minutes. timeout-minutes: 150 # As in ci.yml: test binaries without debug info or symbols, and workspace crates without # line tables. A panic still names its file and line. @@ -36,10 +52,14 @@ jobs: craft-fonts-ref: "" tools: "" targets: "" - # A filter that matches nothing still passes, so the printps run fails unless some test ran. + # Both test runs select the same two packages, so Cargo resolves features once and the + # second run reuses the first run's dependencies. The first runs every test of the app + # (`--bin vectorcraft --test it`), the second the UI crate's `tests::printps` tests. A filter + # that matches nothing still passes, so the printps run fails unless some test ran. command: | + set -o pipefail cargo clippy --locked -p vectorcraft --all-targets -- -D warnings - cargo test --locked -p vectorcraft + cargo test --locked -p vectorcraft -p vectorcraft-ui-egui --bin vectorcraft --test it log="$RUNNER_TEMP/printps.log" - cargo test --locked -p vectorcraft-ui-egui --lib -- tests::printps | tee "$log" + cargo test --locked -p vectorcraft -p vectorcraft-ui-egui --lib -- tests::printps | tee "$log" grep -Eq 'test result: ok\. [1-9][0-9]* passed' "$log" || { echo "::error::tests::printps matched no tests"; exit 1; }