From a66d45422ae2923f598d97de7b6e90a145bb8f79 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 30 Nov 2026 05:04:21 -0800 Subject: [PATCH 1/8] Gradient: the stop popover keeps the swatch picked among swatches of one color The gradient stop popover's Swatches view found the picked swatch by its color, so of two swatches that draw alike it always took the first one: a click on the second spot color of the same color left the stop linked to the first, and the view showed the first as selected. A click on a swatch of the color the stop already had did nothing at all. - The view takes the picked cell's index from the palette (`SwatchPaletteOutput::picked_swatch`) and shows the stop's own swatch as selected (`SwatchPalette::selected_swatch`): its tint swatch, its global swatch at 100%, or the process swatch of its color, preferring the one last picked for that stop or point. - A click on the swatch already shown as the stop's changes nothing, so it keeps a gradient's link to its gradient swatch. - Recent Colors applies the color of the chip clicked, in its own model, when another chip draws the same color. --- crates/ui-egui/src/dialogs/gradient_stop.rs | 188 ++++++++++++++++++-- crates/ui-egui/src/panels.rs | 5 +- crates/ui-egui/src/panels/swatches/tests.rs | 19 ++ 3 files changed, 197 insertions(+), 15 deletions(-) diff --git a/crates/ui-egui/src/dialogs/gradient_stop.rs b/crates/ui-egui/src/dialogs/gradient_stop.rs index 5b2ee66107..a06be20bf4 100644 --- a/crates/ui-egui/src/dialogs/gradient_stop.rs +++ b/crates/ui-egui/src/dialogs/gradient_stop.rs @@ -260,11 +260,41 @@ fn recolor(mut stops: Vec, i: usize, color: Color, link: Option<(S stops } -/// Solid colours of the document's swatches (groups included), with their names. -fn swatch_colors(app: &VectorcraftApp) -> Vec<(String, Color)> { - let Some(st) = app.session.active() else { return vec![] }; - let d = &st.doc; - d.swatches.iter().chain(d.swatch_groups.iter().flat_map(|g| g.swatches.iter())).filter_map(|s| Some((s.name.clone(), s.paint.color()?))).collect() +/// Solid colours of the document's swatches (groups included), with their names, and the entry the target's colour +/// comes from: a linked colour's tint swatch for that tint, or its global swatch at 100%; an unlinked colour's process +/// swatch of that very colour. Where several entries qualify, `picked`, the swatch last picked in the popover for this +/// target, is the one. +fn swatch_colors(app: &VectorcraftApp, target: &Target, picked: Option<&(TargetKey, String)>) -> (Vec<(String, Color)>, Option) { + let Some(st) = app.session.active() else { return (vec![], None) }; + let picked = picked.filter(|(key, _)| key.matches(app, target)).map(|(_, name)| name.as_str()); + let (link, color) = match target { + Target::Stop(paint, i) => { + let stop = &paint.gradient.stops[*i]; + (stop.swatch.as_deref().map(|base| (base, stop.tint)), stop.color) + } + Target::Point(_, point, _) => (None, point.color), + }; + let mut colors = Vec::new(); + let mut selected = None; + for swatch in st.doc.swatches_iter() { + let Some(own) = swatch.paint.color() else { continue }; + // Picking this swatch would give the target the colour and link it has now. + let source = match (link, swatch.tint_of()) { + (Some((base, tint)), Some((of, own_tint))) => of == base && same_tint(tint, own_tint), + (Some((base, tint)), None) => swatch.global && swatch.name == base && same_tint(tint, 1.0), + (None, _) => !swatch.global && matches!(swatch.paint, Paint::Solid { color: c, swatch: None, .. } if c == color), + }; + if source && (selected.is_none() || picked == Some(swatch.name.as_str())) { + selected = Some(colors.len()); + } + colors.push((swatch.name.clone(), own)); + } + (colors, selected) +} + +/// Whether two tints are the same: stop commands carry a tint as a floating-point percentage. +fn same_tint(first: f32, second: f32) -> bool { + (first - second).abs() <= 2.0 * f32::EPSILON } /// The popover's two views. @@ -315,6 +345,8 @@ struct Feed { /// Percent: the stop's location or the point's spread. amount: f64, swatches: Vec<(String, Color)>, + /// The entry of `swatches` the target's colour comes from. + selected_swatch: Option, /// `swatches` as the palette draws them, in the same order. tiles: Vec<(Label, Srgba)>, shown: ColorPanelShown, @@ -344,6 +376,8 @@ pub(crate) struct GradientStopPopover { at: Pos2, panel: ColorPanelState, feed: Option, + /// The swatch last picked in the Swatches view and the stop or point it was picked for. + picked_swatch: Option<(TargetKey, String)>, /// The fields set from outside, applied at confirm. set: PopoverFields, filed: Filed, @@ -361,6 +395,7 @@ impl GradientStopPopover { at: Pos2::ZERO, panel: ColorPanelState::default(), feed: None, + picked_swatch: None, set: PopoverFields::default(), filed: Filed::default(), own_mode: None, @@ -517,11 +552,12 @@ fn swatches(ui: &mut Ui, feed: &Feed, filed: &mut Filed) { Notice::new(Tone::Info, tl!("The document has no colour swatches.").to_owned()).show(ui); return; } - let shown = SwatchPalette::new("Swatches", Bind::given(feed.current), &feed.tiles).show(ui); - let Some(picked) = shown.edit.as_ref().and_then(|edit| edit.value()) else { return }; - // The first swatch of that colour: the palette reports colours, not cells. - let at = feed.tiles.iter().position(|(_, c)| c.to_rgba() == picked.to_rgba()); - filed.swatch = at.and_then(|i| feed.swatches.get(i)).cloned(); + let shown = SwatchPalette::new("Swatches", Bind::given(feed.current), &feed.tiles).selected_swatch(feed.selected_swatch).show(ui); + // A click on a swatch other than the one shown as the target's, also one of the colour the target already has. A + // click on the one shown changes nothing. + if let Some(swatch) = shown.picked_swatch.filter(|i| Some(*i) != feed.selected_swatch).and_then(|i| feed.swatches.get(i)) { + filed.swatch = Some(swatch.clone()); + } } /// A percent field named `label` over `value`; the number the user entered in this pass. @@ -578,9 +614,13 @@ fn place(app: &VectorcraftApp, ctx: &egui::Context, anchor: Anchor) -> Pos2 { /// Pushes `target`'s values, the swatches, what the Color panel shows and the place into the open popover `id`. fn refresh(app: &VectorcraftApp, ctx: &egui::Context, id: DialogId, target: &Target) { let Some(dialogs) = app.dialogs() else { return }; - let Some(anchor) = dialogs.with(|host| host.get_by_id::(id).map(|popover| popover.anchor)) else { return }; + let Some((anchor, picked)) = + dialogs.with(|host| host.get_by_id::(id).map(|popover| (popover.anchor, popover.picked_swatch.clone()))) + else { + return; + }; let shown = crate::panels::color::shown(app, &crate::panels::color::target_now(app)); - let swatches = swatch_colors(app); + let (swatches, selected_swatch) = swatch_colors(app, target, picked.as_ref()); let feed = Feed { point: matches!(target, Target::Point(..)), color: target.color(), @@ -589,6 +629,7 @@ fn refresh(app: &VectorcraftApp, ctx: &egui::Context, id: DialogId, target: &Tar amount: f64::from(target.amount()) * 100.0, tiles: swatches.iter().map(|(name, c)| (Label::from(name.clone()), Srgba::from(c32(c)))).collect(), swatches, + selected_swatch, shown, }; let at = place(app, ctx, anchor); @@ -693,6 +734,13 @@ pub(crate) fn pump(app: &mut VectorcraftApp, ctx: &egui::Context) { && let Some(target) = selected(app) { pick_swatch(app, &target, &name, color); + // Swatches of one colour draw alike: the Swatches view shows the one picked, not the first of them. + let picked = selected(app).and_then(|target| TargetKey::of(app, &target)).map(|key| (key, name)); + dialogs.with(|host| { + if let Some(popover) = host.get_mut_by_id::(id) { + popover.picked_swatch = picked; + } + }); } for output in &filed.panels { // PLAN: assumed `panels::color::apply_output(app, &ColorPanelOutput)` (color-w9's decision). @@ -848,6 +896,122 @@ mod tests { } } + /// The popover over `app`, drawn and pumped each frame, open on stop 1 at its Swatches view. + fn swatches_view(app: VectorcraftApp) -> crate::tests::panel_harness::Panel { + let mut panel = crate::tests::panel_harness::Panel::new(app, |app, ui| { + app.dialogs().unwrap().with(|host| host.run(ui)); + host::pump(app, ui.ctx()); + }); + // The popover opens on the fixture's window, which the panel made the app's. + open_popover(&mut panel.app()); + set(&panel.app(), "tab", json!("swatches")).unwrap(); + panel.frame(); + panel + } + + #[test] + fn picking_one_of_two_spot_colors_of_one_color_links_the_stop_to_that_one() { + let mut app = app(); + for name in ["First green ink", "Second green ink"] { + app.run("swatch.new", json!({"name": name, "color": "#00ff00", "spot": true})).unwrap(); + } + let target = selected(&app).unwrap(); + pick_swatch(&mut app, &target, "First green ink", Color::from_hex("#00ff00").unwrap()); + let mut panel = swatches_view(app); + assert_eq!(shown_swatch(&panel.app()).as_deref(), Some("First green ink")); + panel.click("Second green ink"); + assert_eq!(stops(&panel.app())[1].swatch.as_deref(), Some("Second green ink")); + assert_eq!(shown_swatch(&panel.app()).as_deref(), Some("Second green ink"), "the view shows the swatch picked"); + panel.app().run("swatch.edit", json!({"name": "Second green ink", "color": "#123456"})).unwrap(); + assert_eq!(stops(&panel.app())[1].color.to_hex(), "#123456", "the stop follows the swatch it was given"); + } + + /// The swatch the open popover's Swatches view shows as the target's. + fn shown_swatch(app: &VectorcraftApp) -> Option { + app.dialogs().unwrap().with(|host| { + let feed = host.get_by_id::(dialog_id(KIND))?.feed.as_ref()?; + feed.swatches.get(feed.selected_swatch?).map(|(name, _)| name.clone()) + }) + } + + #[test] + fn the_swatches_view_shows_the_process_swatch_picked_among_two_of_one_color() { + let mut app = app(); + for name in ["First teal", "Second teal"] { + app.run("swatch.new", json!({"name": name, "color": "#008080"})).unwrap(); + } + let mut panel = swatches_view(app); + assert_eq!(shown_swatch(&panel.app()), None, "the stop's green is no swatch's"); + panel.click("Second teal"); + assert_eq!(stops(&panel.app())[1].color.to_hex(), "#008080"); + assert_eq!(shown_swatch(&panel.app()).as_deref(), Some("Second teal")); + let undo = panel.app().session.active().unwrap().history.undo.len(); + panel.click("First teal"); + assert_eq!(shown_swatch(&panel.app()).as_deref(), Some("First teal")); + assert_eq!(panel.app().session.active().unwrap().history.undo.len(), undo, "the same colour again is no edit"); + } + + #[test] + fn the_swatches_view_shows_the_tint_swatch_picked_among_two_of_one_tint() { + let mut app = app(); + app.run("swatch.new", json!({"name": "Green ink", "color": "#00ff00", "spot": true})).unwrap(); + let tints: Vec = + (0..2).map(|_| app.run("swatch.new", json!({"swatch": "Green ink", "tint": 40})).unwrap()["name"].as_str().unwrap().to_owned()).collect(); + assert_ne!(tints[0], tints[1]); + let mut panel = swatches_view(app); + panel.click(&tints[1]); + let stop = stops(&panel.app())[1].clone(); + assert_eq!((stop.swatch.as_deref(), (stop.tint * 100.0).round()), (Some("Green ink"), 40.0)); + assert_eq!(shown_swatch(&panel.app()).as_deref(), Some(tints[1].as_str())); + panel.click(&tints[0]); + assert_eq!(shown_swatch(&panel.app()).as_deref(), Some(tints[0].as_str())); + panel.click("Green ink"); + assert_eq!(stops(&panel.app())[1].tint, 1.0); + assert_eq!(shown_swatch(&panel.app()).as_deref(), Some("Green ink")); + } + + #[test] + fn a_spot_color_of_the_stop_color_links_the_stop_and_its_base_resets_a_tint() { + let mut app = app(); + app.run("swatch.new", json!({"name": "Green ink", "color": "#00ff00", "spot": true})).unwrap(); + let mut panel = swatches_view(app); + assert_eq!(shown_swatch(&panel.app()), None, "the stop's green is not linked to the ink"); + panel.click("Green ink"); + assert_eq!(stops(&panel.app())[1].swatch.as_deref(), Some("Green ink")); + assert_eq!(shown_swatch(&panel.app()).as_deref(), Some("Green ink")); + + let mut app = self::app(); + app.run("swatch.new", json!({"name": "Green ink", "color": "#00ff00", "spot": true})).unwrap(); + crate::panels::gradient::recolor_selected(&mut app, Color::from_hex("#00ff00").unwrap(), &json!({"swatch": "Green ink", "tint": 40})); + assert_eq!((stops(&app)[1].tint * 100.0).round(), 40.0); + let mut panel = swatches_view(app); + assert_eq!(shown_swatch(&panel.app()), None, "a 40% tint is not the ink at 100%"); + panel.click("Green ink"); + let stop = stops(&panel.app())[1].clone(); + assert_eq!((stop.swatch.as_deref(), stop.tint), (Some("Green ink"), 1.0)); + } + + #[test] + fn picking_the_stop_swatch_again_keeps_the_gradient_swatch_link() { + let mut app = app(); + app.run("swatch.new", json!({"name": "Green ink", "color": "#00ff00", "spot": true})).unwrap(); + let green = Color::from_hex("#00ff00").unwrap(); + let target = selected(&app).unwrap(); + pick_swatch(&mut app, &target, "Green ink", green); + let mut params = crate::panels::swatch_paint_params(&active_paint(&app)); + params["name"] = json!("Linked gradient"); + app.run("swatch.new", params).unwrap(); + app.run("paint.setFill", json!({"swatch": "Linked gradient"})).unwrap(); + app.run("gradient.selectStop", json!({"index": 1})).unwrap(); + let undo = app.session.active().unwrap().history.undo.len(); + let mut panel = swatches_view(app); + assert_eq!(shown_swatch(&panel.app()).as_deref(), Some("Green ink")); + panel.click("Green ink"); + let Paint::Gradient(paint) = active_paint(&panel.app()) else { panic!("expected a gradient") }; + assert_eq!(paint.swatch.as_deref(), Some("Linked gradient")); + assert_eq!(panel.app().session.active().unwrap().history.undo.len(), undo); + } + #[test] fn confirm_applies_colour_opacity_and_location() { let mut app = app(); diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index 2ebca9a8bc..fb8d9f0d0f 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -1009,9 +1009,8 @@ pub(crate) fn recent_colors(app: &VectorcraftApp, ui: &mut Ui) -> Option .spacing(SwatchSpacing::Spaced) .drag_payload(move |drag: &ListDrag| dragged.get(drag.grabbed).map(|c| PanelDrag::paint(Paint::solid(*c)))) .show(ui); - // The palette reports the cell's sRGB; the stored colour keeps its own model. - let rgba = out.edit?.value()?.to_rgba(); - stored.into_iter().zip(&cells).find(|(_, (_, cell))| cell.to_rgba() == rgba).map(|(c, _)| c) + // The stored colour of the cell clicked, in its own model: colours in two models can draw alike. + out.picked_swatch.and_then(|i| stored.get(i).copied()) } /// A colour as command JSON, keeping its model. diff --git a/crates/ui-egui/src/panels/swatches/tests.rs b/crates/ui-egui/src/panels/swatches/tests.rs index f20c725ac0..e90c91ef8a 100644 --- a/crates/ui-egui/src/panels/swatches/tests.rs +++ b/crates/ui-egui/src/panels/swatches/tests.rs @@ -1082,6 +1082,25 @@ fn a_color_alt_dropped_on_registration_becomes_a_new_swatch() { assert_eq!(d.swatch(REGISTRATION).map(|w| w.paint.clone()), registration, "Registration is unchanged"); } +/// Of two Recent Colors chips that draw the same color, the one clicked paints the art, in its own model. +#[test] +fn a_recent_color_chip_paints_its_own_color_when_another_chip_draws_the_same() { + use crate::tests::panel_harness::Panel; + use craft::ui::contract::Role; + + let mut app = app(); + let id = app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 50, "height": 50})).unwrap()["id"].as_u64().unwrap(); + app.run("paint.setFill", json!({"ids": [id], "color": {"c": 10, "m": 60, "y": 20, "k": 5}, "keepModel": true})).unwrap(); + let cmyk = app.session.recent_colors[0]; + let hex = cmyk.to_hex(); + app.run("paint.setFill", json!({"ids": [id], "color": hex})).unwrap(); + assert_eq!(app.session.recent_colors[..2], [Color::from_hex(&hex).unwrap(), cmyk], "two chips of one drawn color"); + app.run("select.set", json!({"ids": [id]})).unwrap(); + let mut panel = Panel::new(app, show); + panel.click_role_nth(&hex, Role::LIST_BOX_OPTION, 1); + assert_eq!(fill_of(&panel.app(), vectorcraft_doc::NodeId(id)), Some(Paint::solid(cmyk)), "the second chip's CMYK color"); +} + /// A rectangle filled with a CMYK color and then an RGB one, so Recent Colors holds the RGB color /// first and the CMYK one second; → its id and the CMYK color. fn art_with_two_recent_colors(app: &mut VectorcraftApp) -> (vectorcraft_doc::NodeId, Color) { From 0d0c49cebbf36cccac99154a7999c11776d43a7e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 30 Nov 2026 10:04:04 -0800 Subject: [PATCH 2/8] Dependencies: pin craft-libs at the commit that lets a swatch palette select nothing Every craft-libs rev, the web app's and the pdf-deps check's included, moves to 65f39d0199, which adds SwatchPalette::select_by_color. --- Cargo.lock | 172 ++++++++++++++++---------------- Cargo.toml | 76 +++++++------- apps/vectorcraft-web/Cargo.toml | 2 +- xtask/src/pdf_deps.rs | 2 +- 4 files changed, 126 insertions(+), 126 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 170ad40f3d..ac2e10bc30 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1231,7 +1231,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-automation", "craft-behavior", @@ -1272,7 +1272,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "crc32fast", "flate2", @@ -1283,7 +1283,7 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "block2 0.6.2", "objc2 0.6.5", @@ -1295,7 +1295,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "rustix 1.1.6", ] @@ -1303,7 +1303,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1328,7 +1328,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1346,7 +1346,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-behavior", "craft-docpath", @@ -1364,7 +1364,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "crc32fast", "flate2", @@ -1373,7 +1373,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "egui", ] @@ -1381,7 +1381,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "md-5", "rayon", @@ -1390,12 +1390,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-behavior", "craft-cms", @@ -1415,7 +1415,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-control-protocol", "craft-platform", @@ -1426,7 +1426,7 @@ dependencies = [ [[package]] name = "craft-control-protocol" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "getrandom 0.3.4", "serde_json", @@ -1436,7 +1436,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "rayon", ] @@ -1444,7 +1444,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "block2 0.6.2", "craft-appkit", @@ -1470,7 +1470,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "blake3", "craft-ecproj-format", @@ -1486,7 +1486,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "serde", ] @@ -1494,7 +1494,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1513,7 +1513,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-codepage", "encoding_rs", @@ -1525,7 +1525,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "serde", "serde_json", @@ -1535,12 +1535,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1555,7 +1555,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1574,7 +1574,7 @@ dependencies = [ [[package]] name = "craft-font-os-windows" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "windows-registry", "windows-sys 0.61.2", @@ -1583,7 +1583,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "cap-primitives", "craft-atomic", @@ -1606,12 +1606,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "gif", ] @@ -1619,7 +1619,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "flate2", ] @@ -1627,7 +1627,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1640,7 +1640,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "brotli 9.1.3", "brotli-decompressor 6.3.2", @@ -1670,7 +1670,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-dds", "craft-jpeg", @@ -1697,7 +1697,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1715,7 +1715,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "thiserror 2.0.21", ] @@ -1723,7 +1723,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1734,7 +1734,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-host", "craft-i18n", @@ -1749,7 +1749,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-behavior", "craft-i18n", @@ -1763,7 +1763,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-behavior", "craft-host", @@ -1781,7 +1781,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1793,7 +1793,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "encoding_rs", "image", @@ -1804,7 +1804,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "chrono", "craft-codepage", @@ -1814,7 +1814,7 @@ dependencies = [ [[package]] name = "craft-nightly" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "uds_windows", "winsafe", @@ -1823,7 +1823,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-behavior", "craft-keymap", @@ -1839,7 +1839,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "flate2", "serde", @@ -1850,7 +1850,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1862,7 +1862,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "async-channel", "async-io", @@ -1895,7 +1895,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1904,7 +1904,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-behavior", "craft-host", @@ -1928,7 +1928,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1939,7 +1939,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-eps", "flate2", @@ -1953,7 +1953,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "encoding_rs", "flate2", @@ -1964,7 +1964,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "dispatch2", "egui", @@ -1977,7 +1977,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1996,7 +1996,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-atomic", "craft-host", @@ -2013,7 +2013,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "fax", "hayro-ccitt", @@ -2024,7 +2024,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-image-codecs", "craft-xml", @@ -2045,7 +2045,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-behavior", "craft-keymap", @@ -2057,7 +2057,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2082,7 +2082,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2097,7 +2097,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-atomic", "craft-behavior", @@ -2112,7 +2112,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "serde", "thiserror 2.0.21", @@ -2122,7 +2122,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "serde", "thiserror 2.0.21", @@ -2131,7 +2131,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-behavior", "craft-keymap", @@ -2146,12 +2146,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2165,7 +2165,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-behavior", "craft-i18n", @@ -2181,7 +2181,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "accesskit", "craft-behavior", @@ -2219,7 +2219,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2230,7 +2230,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-behavior", "craft-host", @@ -2248,7 +2248,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-behavior", "craft-host", @@ -2269,7 +2269,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-behavior", "craft-host", @@ -2290,7 +2290,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-behavior", "craft-host", @@ -2309,7 +2309,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "base64 0.22.1", "chrono", @@ -2341,7 +2341,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "flate2", "serde", @@ -2352,7 +2352,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2362,7 +2362,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "js-sys", "serde_json", @@ -2373,7 +2373,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "winsafe", ] @@ -2381,7 +2381,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "craft-appkit", "craft-atomic", @@ -2413,7 +2413,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "quick-xml 0.41.0", "serde", @@ -3772,7 +3772,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "brotli 8.0.4", "hayro-postscript", @@ -3781,7 +3781,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3799,7 +3799,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3817,12 +3817,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "flate2", "hayro-ccitt", @@ -4805,7 +4805,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4962,7 +4962,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d" +source = "git+https://github.com/storytold/craft-libs?rev=65f39d0199a51450b47526923a257177ec85a1ff#65f39d0199a51450b47526923a257177ec85a1ff" dependencies = [ "arrayvec", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index 7720ce4b8a..4d9f8e0b81 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,51 +10,51 @@ license = "MIT OR Apache-2.0" rust-version = "1.95" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } # Language packs: the Craft apps' shared font store installs them (#4936). -craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } # 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 = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } # `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile. -craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d", features = ["pcraft-pixels"] } +craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff", features = ["pcraft-pixels"] } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } # 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 = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } # 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 = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } # Nightly profile isolation, launch protocol, and security fence. -craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } @@ -194,13 +194,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" } emath = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" } epaint = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index 2dedefa32f..999e35359e 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -28,7 +28,7 @@ egui_extras = { 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 = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "65f39d0199a51450b47526923a257177ec85a1ff", 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 3e24ddc83c..7f58e46c20 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 = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d"; +const REV: &str = "65f39d0199a51450b47526923a257177ec85a1ff"; const PACKAGES: &[(&str, &str, &str)] = &[ ("craft-pdf", "0.1.0", REV), ("krilla", "0.8.2", REV), From fca5dc67eae17f87f9fa25cab36c7d6e02f026bd Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 30 Nov 2026 10:04:04 -0800 Subject: [PATCH 3/8] Gradient: the stop popover selects only the stop's own swatch and keeps it through renames The Swatches view no longer lets the palette select a swatch by color. When no swatch is the stop's own, nothing is selected, so a spot or global swatch of an unlinked stop's color is not shown as picked and a click on it links the stop. swatch.edit records each rename with the uid of its document. A preview records nothing, a failed command.batch puts the record back as it was, and the session keeps the newest 64 renames. VectorcraftApp::run and the popover take the record, and the popover's remembered pick follows a rename of its swatch in its own document, inside a batch too. The popover tests check the cells the view draws selected through the panel harness. --- crates/engine/src/cmd/fileio/batch.rs | 3 + crates/engine/src/cmd/swatch.rs | 7 + crates/engine/src/lib.rs | 6 + crates/engine/src/session/documents.rs | 1 + crates/engine/src/session/edit.rs | 6 + crates/engine/src/tests/swatches.rs | 58 +++++ crates/ui-egui/src/app/commands.rs | 3 + crates/ui-egui/src/dialogs/gradient_stop.rs | 241 ++++++++++++++++++-- crates/ui-egui/src/tests/panel_harness.rs | 6 + 9 files changed, 307 insertions(+), 24 deletions(-) diff --git a/crates/engine/src/cmd/fileio/batch.rs b/crates/engine/src/cmd/fileio/batch.rs index 93670cefd9..68e03b3228 100644 --- a/crates/engine/src/cmd/fileio/batch.rs +++ b/crates/engine/src/cmd/fileio/batch.rs @@ -25,6 +25,8 @@ pub(super) fn batch(s: &mut Session, p: &Value) -> Result { // file, format and saved state share their data with the open ones until a step changes them. let start = s.docs.clone(); let active = s.active; + // A rollback puts back the swatch renames recorded before the batch, including any its steps pushed out of the record. + let swatch_renames = s.swatch_renames.clone(); s.batch_stash = Some(vec![]); let mut grouped = Vec::with_capacity(cmds.len()); // The Type tool keeps what the steps' Undo and Redo change in it, to put back on a rollback. @@ -38,6 +40,7 @@ pub(super) fn batch(s: &mut Session, p: &Value) -> Result { results } Err(e) => { + s.swatch_renames = swatch_renames; roll_back(s, start, &stash); s.notify_text_tool("batch.rollBack"); s.active = active; diff --git a/crates/engine/src/cmd/swatch.rs b/crates/engine/src/cmd/swatch.rs index 9916ba569c..4e8b25f3f4 100644 --- a/crates/engine/src/cmd/swatch.rs +++ b/crates/engine/src/cmd/swatch.rs @@ -977,6 +977,13 @@ fn swatch_edit(s: &mut Session, p: &Value) -> Result { Ok(relinked) })?; relink.defaults(s)?; + if to != name && !s.previewing { + let uid = s.doc()?.uid; + if s.swatch_renames.len() == crate::MAX_SWATCH_RENAMES { + s.swatch_renames.remove(0); + } + s.swatch_renames.push((uid, name, to.clone())); + } Ok(json!({"name": to, "relinked": relinked})) } diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index fb2115190c..5a78b39871 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -52,6 +52,9 @@ pub use vectorcraft_tools as tools; pub use vectorcraft_doc::MAX_COORD; const _: () = assert!(vectorcraft_doc::MAX_DEPTH == 32, "TOO_DEEP (and its catalog rows) names the cap"); +/// The maximum number of newest swatch renames a session keeps until they are taken. +pub(crate) const MAX_SWATCH_RENAMES: usize = 64; + pub struct Session { docs: Vec, active: Option, @@ -303,6 +306,9 @@ pub struct Session { /// appearance: the documents ([`DocState::uid`]) whose newest history step takes the colors the /// command finally left. pub(crate) batch_paint_docs: Vec, + /// Committed swatch renames as (document uid, old name, new name), in execution order until taken by the frontend. + /// The uid is [`DocState::uid`]; the record is never saved in documents or history. + pub(crate) swatch_renames: Vec<(u64, String, String)>, /// The composite fonts (lowercase names) that the open documents defined when the font /// database was last brought in step with them ([`cmd::compositefonts::sync`]). pub(crate) composite_names: Vec, diff --git a/crates/engine/src/session/documents.rs b/crates/engine/src/session/documents.rs index 8a9eea3b4a..b6461d8e1d 100644 --- a/crates/engine/src/session/documents.rs +++ b/crates/engine/src/session/documents.rs @@ -136,6 +136,7 @@ impl Session { batch_stash: None, batch_steps: None, batch_paint_docs: Vec::new(), + swatch_renames: Vec::new(), composite_names: Vec::new(), composite_names_registered: HashSet::new(), reading: false, diff --git a/crates/engine/src/session/edit.rs b/crates/engine/src/session/edit.rs index d5d62e607c..6fd96e6ffc 100644 --- a/crates/engine/src/session/edit.rs +++ b/crates/engine/src/session/edit.rs @@ -5,6 +5,12 @@ use super::{ use crate::doc_state::{kept_from, objects_only}; impl Session { + /// Takes committed swatch renames as (document uid, old name, new name) in execution order and leaves the record empty. + /// The uid identifies the originating document through [`crate::DocState::uid`]. + pub fn take_swatch_renames(&mut self) -> Vec<(u64, String, String)> { + std::mem::take(&mut self.swatch_renames) + } + /// Run `f` on a mutable copy of the active document. Outside an interaction this records one /// undo step labelled `label`; inside one it just mutates (the interaction commits later). pub fn edit(&mut self, label: &str, f: impl FnOnce(&mut Document, &mut Selection) -> Result) -> Result { diff --git a/crates/engine/src/tests/swatches.rs b/crates/engine/src/tests/swatches.rs index 20144d4411..ab379c2f6c 100644 --- a/crates/engine/src/tests/swatches.rs +++ b/crates/engine/src/tests/swatches.rs @@ -989,6 +989,64 @@ fn linked(hex: &str, name: &str) -> Paint { Paint::Solid { color: Color::from_hex(hex).unwrap(), swatch: Some(name.into()), tint: 1.0 } } +#[test] +fn swatch_edits_record_only_renames_and_taking_empties_the_record() { + let mut s = session(); + let uid = s.active().unwrap().uid; + run(&mut s, "swatch.new", json!({"name": "Teal", "color": "#008080"})); + run(&mut s, "swatch.edit", json!({"name": "Teal", "color": "#009090"})); + assert!(s.take_swatch_renames().is_empty()); + run(&mut s, "swatch.edit", json!({"name": "Teal", "newName": "Renamed teal"})); + assert_eq!(s.take_swatch_renames(), vec![(uid, "Teal".to_owned(), "Renamed teal".to_owned())]); + assert!(s.take_swatch_renames().is_empty()); +} + +#[test] +fn failed_batches_restore_pending_swatch_renames_after_eviction() { + let mut s = session(); + let uid = s.active().unwrap().uid; + run(&mut s, "swatch.new", json!({"name": "Teal", "color": "#008080"})); + run(&mut s, "swatch.edit", json!({"name": "Teal", "newName": "Ink 0 letter"})); + let mut commands = Vec::new(); + for i in 0..=MAX_SWATCH_RENAMES { + commands.push(json!({"command": "swatch.edit", "params": {"name": format!("Ink {i} letter"), "newName": format!("Ink {} letter", i + 1)}})); + } + commands.push(json!({"command": "command.batch", "params": {"commands": []}})); + assert!(s.execute("command.batch", &json!({"commands": commands})).is_err()); + assert!(doc(&s).swatch("Ink 0 letter").is_some()); + assert_eq!(s.take_swatch_renames(), vec![(uid, "Teal".to_owned(), "Ink 0 letter".to_owned())]); + commands.pop(); + run(&mut s, "command.batch", json!({"commands": commands})); + let renames = s.take_swatch_renames(); + let expected: Vec<_> = (1..=MAX_SWATCH_RENAMES).map(|i| (uid, format!("Ink {i} letter"), format!("Ink {} letter", i + 1))).collect(); + assert_eq!(renames, expected, "only the newest renames remain, in order"); +} + +#[test] +fn swatch_rename_previews_leave_no_record_and_confirmation_records_once() { + let mut s = session(); + let uid = s.active().unwrap().uid; + run(&mut s, "swatch.new", json!({"name": "Teal", "color": "#008080"})); + s.begin_interaction("Swatch Options").unwrap(); + for name in ["Preview teal", "Replacement teal"] { + s.preview("swatch.edit", &json!({"name": "Teal", "newName": name})).unwrap(); + assert!(doc(&s).swatch(name).is_some()); + assert!(s.take_swatch_renames().is_empty()); + } + s.cancel_interaction().unwrap(); + assert!(doc(&s).swatch("Teal").is_some()); + assert!(s.take_swatch_renames().is_empty()); + + // Swatch Options cancels its preview and runs the confirmed edit again. + s.begin_interaction("Swatch Options").unwrap(); + s.preview("swatch.edit", &json!({"name": "Teal", "newName": "Renamed teal"})).unwrap(); + assert!(s.take_swatch_renames().is_empty()); + s.cancel_interaction().unwrap(); + run(&mut s, "swatch.edit", json!({"name": "Teal", "newName": "Renamed teal"})); + assert_eq!(s.take_swatch_renames(), vec![(uid, "Teal".to_owned(), "Renamed teal".to_owned())]); + assert!(s.take_swatch_renames().is_empty()); +} + #[test] fn editing_a_global_swatch_recolours_linked_art_in_one_step() { let mut s = session(); diff --git a/crates/ui-egui/src/app/commands.rs b/crates/ui-egui/src/app/commands.rs index 1452288749..4d50e9ac41 100644 --- a/crates/ui-egui/src/app/commands.rs +++ b/crates/ui-egui/src/app/commands.rs @@ -97,6 +97,9 @@ impl VectorcraftApp { crate::plugin_runs::show_notice(self, id, r); } placing::settle_swatch_paste(self); + for (uid, from, to) in self.session.take_swatch_renames() { + dialogs::gradient_stop::follow_swatch_rename(self, uid, &from, &to); + } result } diff --git a/crates/ui-egui/src/dialogs/gradient_stop.rs b/crates/ui-egui/src/dialogs/gradient_stop.rs index a06be20bf4..17ae6eaa36 100644 --- a/crates/ui-egui/src/dialogs/gradient_stop.rs +++ b/crates/ui-egui/src/dialogs/gradient_stop.rs @@ -103,6 +103,22 @@ impl TargetKey { } } +/// The swatch last picked in the Swatches view and the stop or point it is picked for. +#[derive(Clone)] +struct PickedSwatch { + target: TargetKey, + name: String, +} + +impl PickedSwatch { + /// The active document's swatch `name`, picked for `target`. + fn of(app: &VectorcraftApp, target: &Target, name: &str) -> Option { + let key = TargetKey::of(app, target)?; + app.session.active()?.doc.swatch(name)?; + Some(Self { target: key, name: name.to_owned() }) + } +} + /// A Color mode command from the popover's menu that has not been seen to finish. struct OwnMode { /// The document's history step when it ran. @@ -264,9 +280,9 @@ fn recolor(mut stops: Vec, i: usize, color: Color, link: Option<(S /// comes from: a linked colour's tint swatch for that tint, or its global swatch at 100%; an unlinked colour's process /// swatch of that very colour. Where several entries qualify, `picked`, the swatch last picked in the popover for this /// target, is the one. -fn swatch_colors(app: &VectorcraftApp, target: &Target, picked: Option<&(TargetKey, String)>) -> (Vec<(String, Color)>, Option) { +fn swatch_colors(app: &VectorcraftApp, target: &Target, picked: Option<&PickedSwatch>) -> (Vec<(String, Color)>, Option) { let Some(st) = app.session.active() else { return (vec![], None) }; - let picked = picked.filter(|(key, _)| key.matches(app, target)).map(|(_, name)| name.as_str()); + let picked = picked.filter(|p| p.target.matches(app, target)); let (link, color) = match target { Target::Stop(paint, i) => { let stop = &paint.gradient.stops[*i]; @@ -277,6 +293,7 @@ fn swatch_colors(app: &VectorcraftApp, target: &Target, picked: Option<&(TargetK let mut colors = Vec::new(); let mut selected = None; for swatch in st.doc.swatches_iter() { + let is_picked = picked.is_some_and(|p| p.name == swatch.name); let Some(own) = swatch.paint.color() else { continue }; // Picking this swatch would give the target the colour and link it has now. let source = match (link, swatch.tint_of()) { @@ -284,7 +301,7 @@ fn swatch_colors(app: &VectorcraftApp, target: &Target, picked: Option<&(TargetK (Some((base, tint)), None) => swatch.global && swatch.name == base && same_tint(tint, 1.0), (None, _) => !swatch.global && matches!(swatch.paint, Paint::Solid { color: c, swatch: None, .. } if c == color), }; - if source && (selected.is_none() || picked == Some(swatch.name.as_str())) { + if source && (selected.is_none() || is_picked) { selected = Some(colors.len()); } colors.push((swatch.name.clone(), own)); @@ -377,7 +394,7 @@ pub(crate) struct GradientStopPopover { panel: ColorPanelState, feed: Option, /// The swatch last picked in the Swatches view and the stop or point it was picked for. - picked_swatch: Option<(TargetKey, String)>, + picked_swatch: Option, /// The fields set from outside, applied at confirm. set: PopoverFields, filed: Filed, @@ -552,7 +569,10 @@ fn swatches(ui: &mut Ui, feed: &Feed, filed: &mut Filed) { Notice::new(Tone::Info, tl!("The document has no colour swatches.").to_owned()).show(ui); return; } - let shown = SwatchPalette::new("Swatches", Bind::given(feed.current), &feed.tiles).selected_swatch(feed.selected_swatch).show(ui); + // Only the entry the target's colour comes from is selected, and none when no entry is: a swatch that only draws + // the same colour, such as a spot ink an unlinked stop has the colour of, is not. + let shown = + SwatchPalette::new("Swatches", Bind::given(feed.current), &feed.tiles).selected_swatch(feed.selected_swatch).select_by_color(false).show(ui); // A click on a swatch other than the one shown as the target's, also one of the colour the target already has. A // click on the one shown changes nothing. if let Some(swatch) = shown.picked_swatch.filter(|i| Some(*i) != feed.selected_swatch).and_then(|i| feed.swatches.get(i)) { @@ -643,6 +663,23 @@ fn refresh(app: &VectorcraftApp, ctx: &egui::Context, id: DialogId, target: &Tar }); } +/// After the swatch `from` of the document `uid` was renamed `to`, the open popover's remembered pick takes the new name +/// when it is that swatch, picked for the selected stop or point. +pub(crate) fn follow_swatch_rename(app: &VectorcraftApp, uid: u64, from: &str, to: &str) { + let Some(target) = selected(app) else { return }; + let Some(dialogs) = app.dialogs() else { return }; + dialogs.with(|host| { + if let Some(popover) = host.get_mut_by_id::(dialog_id(KIND)) + && let Some(picked) = &mut popover.picked_swatch + && picked.target.document.0 == uid + && picked.target.matches(app, &target) + && picked.name == from + { + picked.name = to.to_owned(); + } + }); +} + /// Opens the popover on the selected stop (a freeform gradient's selected point) of the active gradient, the stop /// at `index` when it is not the selected one. Nothing opens without a window or a stop to edit. pub(crate) fn open_at(app: &mut VectorcraftApp, index: usize, anchor: Anchor) { @@ -670,6 +707,9 @@ pub(crate) fn open_at(app: &mut VectorcraftApp, index: usize, anchor: Anchor) { /// Once per frame: applies what the user did in the popover and its confirmed answer, closes it when its stop or /// point goes away, and pushes the target's values for the next frame. One line of `dialogs::host::pump`. pub(crate) fn pump(app: &mut VectorcraftApp, ctx: &egui::Context) { + for (uid, from, to) in app.session.take_swatch_renames() { + follow_swatch_rename(app, uid, &from, &to); + } let Some(dialogs) = app.dialogs() else { return }; let id = dialog_id(KIND); match dialogs.with(|host| host.take_by_id::(id)) { @@ -735,7 +775,7 @@ pub(crate) fn pump(app: &mut VectorcraftApp, ctx: &egui::Context) { { pick_swatch(app, &target, &name, color); // Swatches of one colour draw alike: the Swatches view shows the one picked, not the first of them. - let picked = selected(app).and_then(|target| TargetKey::of(app, &target)).map(|key| (key, name)); + let picked = selected(app).and_then(|target| PickedSwatch::of(app, &target, &name)); dialogs.with(|host| { if let Some(popover) = host.get_mut_by_id::(id) { popover.picked_swatch = picked; @@ -918,20 +958,29 @@ mod tests { let target = selected(&app).unwrap(); pick_swatch(&mut app, &target, "First green ink", Color::from_hex("#00ff00").unwrap()); let mut panel = swatches_view(app); - assert_eq!(shown_swatch(&panel.app()).as_deref(), Some("First green ink")); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("First green ink")); panel.click("Second green ink"); assert_eq!(stops(&panel.app())[1].swatch.as_deref(), Some("Second green ink")); - assert_eq!(shown_swatch(&panel.app()).as_deref(), Some("Second green ink"), "the view shows the swatch picked"); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Second green ink"), "the view shows the swatch picked"); panel.app().run("swatch.edit", json!({"name": "Second green ink", "color": "#123456"})).unwrap(); assert_eq!(stops(&panel.app())[1].color.to_hex(), "#123456", "the stop follows the swatch it was given"); } - /// The swatch the open popover's Swatches view shows as the target's. - fn shown_swatch(app: &VectorcraftApp) -> Option { - app.dialogs().unwrap().with(|host| { - let feed = host.get_by_id::(dialog_id(KIND))?.feed.as_ref()?; - feed.swatches.get(feed.selected_swatch?).map(|(name, _)| name.clone()) - }) + /// The swatch the open popover's Swatches view shows as the target's, after two fresh frames: the first one's pump + /// feeds the view an edit made outside it, and the second draws that feed. The view draws that swatch's cell + /// selected and no other, and no cell selected when it shows none. + fn shown_swatch(panel: &mut crate::tests::panel_harness::Panel) -> Option { + panel.frame(); + panel.frame(); + let (names, shown) = panel.app().dialogs().unwrap().with(|host| { + let feed = host.get_by_id::(dialog_id(KIND)).and_then(|popover| popover.feed.as_ref()).expect("the view's feed"); + let shown = feed.selected_swatch.and_then(|i| feed.swatches.get(i)).map(|(name, _)| name.clone()); + (feed.swatches.iter().map(|(name, _)| name.clone()).collect::>(), shown) + }); + let drawn: Vec = + names.into_iter().filter(|name| panel.selected_role(name, craft::ui::contract::Role::LIST_BOX_OPTION) == Some(true)).collect(); + assert_eq!(drawn, shown.iter().cloned().collect::>(), "the cells the view draws selected"); + shown } #[test] @@ -941,16 +990,149 @@ mod tests { app.run("swatch.new", json!({"name": name, "color": "#008080"})).unwrap(); } let mut panel = swatches_view(app); - assert_eq!(shown_swatch(&panel.app()), None, "the stop's green is no swatch's"); + assert_eq!(shown_swatch(&mut panel), None, "the stop's green is no swatch's"); panel.click("Second teal"); assert_eq!(stops(&panel.app())[1].color.to_hex(), "#008080"); - assert_eq!(shown_swatch(&panel.app()).as_deref(), Some("Second teal")); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Second teal")); let undo = panel.app().session.active().unwrap().history.undo.len(); panel.click("First teal"); - assert_eq!(shown_swatch(&panel.app()).as_deref(), Some("First teal")); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("First teal")); assert_eq!(panel.app().session.active().unwrap().history.undo.len(), undo, "the same colour again is no edit"); } + #[test] + fn the_swatches_view_keeps_the_picked_process_swatch_through_a_rename() { + let mut app = app(); + for name in ["First teal", "Second teal"] { + app.run("swatch.new", json!({"name": name, "color": "#008080"})).unwrap(); + } + let mut panel = swatches_view(app); + panel.click("Second teal"); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Second teal")); + panel.app().run("swatch.edit", json!({"name": "Second teal", "newName": "Renamed teal"})).unwrap(); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Renamed teal"), "the renamed swatch stays the one shown"); + panel.app().run("edit.undo", json!({})).unwrap(); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("First teal"), "Undo of the rename falls back to the first qualifying swatch"); + panel.click("Second teal"); + panel.app().run("swatch.edit", json!({"name": "First teal", "newName": "Other teal"})).unwrap(); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Second teal"), "a rename of the other swatch moves nothing"); + let first = panel.app().session.active().unwrap().doc.swatches_iter().position(|s| s.name == "Other teal").unwrap(); + panel.app().run("swatch.move", json!({"name": "Second teal", "to": first})).unwrap(); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Second teal"), "the picked swatch moved before the other stays the one shown"); + } + + #[test] + fn the_swatches_view_keeps_the_picked_swatch_through_a_rename_in_a_batch() { + let mut app = app(); + for name in ["First teal", "Second teal"] { + app.run("swatch.new", json!({"name": name, "color": "#008080"})).unwrap(); + } + let mut panel = swatches_view(app); + panel.click("Second teal"); + panel + .app() + .run("command.batch", json!({"commands": [{"command": "swatch.edit", "params": {"name": "Second teal", "newName": "Renamed teal"}}]})) + .unwrap(); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Renamed teal")); + } + + #[test] + fn the_swatches_view_keeps_the_pick_when_a_batch_renames_a_swatch_in_another_document() { + let mut app = app(); + for name in ["First teal", "Second teal"] { + app.run("swatch.new", json!({"name": name, "color": "#008080"})).unwrap(); + } + app.run("file.new", json!({"width": 100, "height": 100})).unwrap(); + for name in ["First teal", "Second teal"] { + app.run("swatch.new", json!({"name": name, "color": "#008080"})).unwrap(); + } + app.run("document.activate", json!({"index": 0})).unwrap(); + let mut panel = swatches_view(app); + panel.click("Second teal"); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Second teal")); + panel + .app() + .run( + "command.batch", + json!({"commands": [ + {"command": "document.activate", "params": {"index": 1}}, + {"command": "swatch.edit", "params": {"name": "Second teal", "newName": "Renamed teal"}}, + {"command": "document.activate", "params": {"index": 0}} + ]}), + ) + .unwrap(); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Second teal")); + assert!(panel.app().session.documents()[1].doc.swatch("Renamed teal").is_some()); + } + + #[test] + fn the_swatches_view_follows_renames_that_bypass_app_run() { + let mut app = app(); + for name in ["First teal", "Second teal"] { + app.run("swatch.new", json!({"name": name, "color": "#008080"})).unwrap(); + } + let mut panel = swatches_view(app); + panel.click("Second teal"); + panel.app().session.execute("swatch.edit", &json!({"name": "Second teal", "newName": "Renamed teal"})).unwrap(); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Renamed teal")); + } + + #[test] + fn the_swatches_view_does_not_give_a_deleted_picked_swatch_to_its_neighbor() { + let mut app = app(); + for name in ["First teal", "Second teal", "Third teal"] { + app.run("swatch.new", json!({"name": name, "color": "#008080"})).unwrap(); + } + let mut panel = swatches_view(app); + panel.click("Second teal"); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Second teal")); + panel.app().run("swatch.delete", json!({"name": "Second teal"})).unwrap(); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("First teal"), "the swatch after the deleted one is not taken for it"); + panel.app().run("edit.undo", json!({})).unwrap(); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Second teal"), "Undo of the deletion shows the picked swatch again"); + } + + #[test] + fn the_swatches_view_does_not_give_a_deleted_picked_swatch_to_a_replacement() { + let mut app = app(); + for name in ["First teal", "Second teal"] { + app.run("swatch.new", json!({"name": name, "color": "#008080"})).unwrap(); + } + let mut panel = swatches_view(app); + panel.click("Second teal"); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Second teal")); + panel.app().run("swatch.delete", json!({"name": "Second teal"})).unwrap(); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("First teal")); + panel.app().run("swatch.new", json!({"name": "New teal", "color": "#008080"})).unwrap(); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("First teal"), "a new swatch in the deleted one's place is not taken for it"); + panel.app().run("edit.undo", json!({})).unwrap(); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("First teal")); + panel.app().run("edit.undo", json!({})).unwrap(); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Second teal"), "Undo of the deletion shows the picked swatch again"); + } + + #[test] + fn the_swatches_view_does_not_follow_a_replacement_in_a_batch() { + let mut app = app(); + for name in ["First teal", "Second teal"] { + app.run("swatch.new", json!({"name": name, "color": "#008080"})).unwrap(); + } + let mut panel = swatches_view(app); + panel.click("Second teal"); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Second teal")); + panel + .app() + .run( + "command.batch", + json!({"commands": [ + {"command": "swatch.delete", "params": {"name": "Second teal"}}, + {"command": "swatch.new", "params": {"name": "New teal", "color": "#008080"}} + ]}), + ) + .unwrap(); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("First teal"), "the replacement does not inherit the pick"); + } + #[test] fn the_swatches_view_shows_the_tint_swatch_picked_among_two_of_one_tint() { let mut app = app(); @@ -962,12 +1144,12 @@ mod tests { panel.click(&tints[1]); let stop = stops(&panel.app())[1].clone(); assert_eq!((stop.swatch.as_deref(), (stop.tint * 100.0).round()), (Some("Green ink"), 40.0)); - assert_eq!(shown_swatch(&panel.app()).as_deref(), Some(tints[1].as_str())); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some(tints[1].as_str())); panel.click(&tints[0]); - assert_eq!(shown_swatch(&panel.app()).as_deref(), Some(tints[0].as_str())); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some(tints[0].as_str())); panel.click("Green ink"); assert_eq!(stops(&panel.app())[1].tint, 1.0); - assert_eq!(shown_swatch(&panel.app()).as_deref(), Some("Green ink")); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Green ink")); } #[test] @@ -975,17 +1157,28 @@ mod tests { let mut app = app(); app.run("swatch.new", json!({"name": "Green ink", "color": "#00ff00", "spot": true})).unwrap(); let mut panel = swatches_view(app); - assert_eq!(shown_swatch(&panel.app()), None, "the stop's green is not linked to the ink"); + assert_eq!(shown_swatch(&mut panel), None, "the stop's green is not linked to the ink"); panel.click("Green ink"); assert_eq!(stops(&panel.app())[1].swatch.as_deref(), Some("Green ink")); - assert_eq!(shown_swatch(&panel.app()).as_deref(), Some("Green ink")); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Green ink")); + + // Two spot inks of the stop's green: the unlinked stop shows neither, and a pick links the stop to that one. + let mut app = self::app(); + for name in ["First green ink", "Second green ink"] { + app.run("swatch.new", json!({"name": name, "color": "#00ff00", "spot": true})).unwrap(); + } + let mut panel = swatches_view(app); + assert_eq!(shown_swatch(&mut panel), None, "the stop's green is linked to neither ink"); + panel.click("Second green ink"); + assert_eq!(stops(&panel.app())[1].swatch.as_deref(), Some("Second green ink")); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Second green ink")); let mut app = self::app(); app.run("swatch.new", json!({"name": "Green ink", "color": "#00ff00", "spot": true})).unwrap(); crate::panels::gradient::recolor_selected(&mut app, Color::from_hex("#00ff00").unwrap(), &json!({"swatch": "Green ink", "tint": 40})); assert_eq!((stops(&app)[1].tint * 100.0).round(), 40.0); let mut panel = swatches_view(app); - assert_eq!(shown_swatch(&panel.app()), None, "a 40% tint is not the ink at 100%"); + assert_eq!(shown_swatch(&mut panel), None, "a 40% tint is not the ink at 100%"); panel.click("Green ink"); let stop = stops(&panel.app())[1].clone(); assert_eq!((stop.swatch.as_deref(), stop.tint), (Some("Green ink"), 1.0)); @@ -1005,7 +1198,7 @@ mod tests { app.run("gradient.selectStop", json!({"index": 1})).unwrap(); let undo = app.session.active().unwrap().history.undo.len(); let mut panel = swatches_view(app); - assert_eq!(shown_swatch(&panel.app()).as_deref(), Some("Green ink")); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Green ink")); panel.click("Green ink"); let Paint::Gradient(paint) = active_paint(&panel.app()) else { panic!("expected a gradient") }; assert_eq!(paint.swatch.as_deref(), Some("Linked gradient")); diff --git a/crates/ui-egui/src/tests/panel_harness.rs b/crates/ui-egui/src/tests/panel_harness.rs index 0c7d427a68..a180c583b4 100644 --- a/crates/ui-egui/src/tests/panel_harness.rs +++ b/crates/ui-egui/src/tests/panel_harness.rs @@ -464,6 +464,12 @@ impl Panel { self.fixture.tree().toggled_of(self.look(name).node) } + /// The selected state of the control of `role` named `name`, where nodes of other roles share the name (a list + /// option beside its tooltip). + pub(crate) fn selected_role(&self, name: &str, role: craft::ui::contract::Role) -> Option { + self.fixture.tree().selected_of(self.look_role(name, role).node) + } + /// The kind of popup the control named `name` reports that it opens. pub(crate) fn popup_kind(&self, name: &str) -> Option { self.fixture.tree().has_popup_of(self.look(name).node) From a34cb72f8b8eb58b6d48efb87d42200c6ac424c4 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 30 Nov 2026 20:37:33 -0800 Subject: [PATCH 4/8] Gradient: a click on the stop's shown swatch recolors other selected paints that differ With several objects or text runs edited, the Swatches view shows the swatch of the first paint's stop. A click on it was skipped, so the other paints kept their own colors at that stop. The click is now skipped only when every edited paint already has that stop, which keeps a shared gradient swatch link in place. --- crates/engine/src/cmd/gradient.rs | 7 ++ crates/ui-egui/src/dialogs/gradient_stop.rs | 76 ++++++++++++++++++++- 2 files changed, 80 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/cmd/gradient.rs b/crates/engine/src/cmd/gradient.rs index 01e0a5a732..5293343f2a 100644 --- a/crates/engine/src/cmd/gradient.rs +++ b/crates/engine/src/cmd/gradient.rs @@ -128,6 +128,13 @@ impl StopOwner { #[derive(PartialEq)] pub struct GradientEditPaints(Vec); +impl GradientEditPaints { + /// Whether every edited paint, including every text run's paint, satisfies `matches`. + pub fn all_paints_match(&self, matches: impl FnMut(&Paint) -> bool) -> bool { + self.0.iter().flat_map(|target| &target.paints).all(matches) + } +} + #[derive(PartialEq)] struct EditedPaint { id: NodeId, diff --git a/crates/ui-egui/src/dialogs/gradient_stop.rs b/crates/ui-egui/src/dialogs/gradient_stop.rs index 17ae6eaa36..f9cae62676 100644 --- a/crates/ui-egui/src/dialogs/gradient_stop.rs +++ b/crates/ui-egui/src/dialogs/gradient_stop.rs @@ -364,6 +364,8 @@ struct Feed { swatches: Vec<(String, Color)>, /// The entry of `swatches` the target's colour comes from. selected_swatch: Option, + /// Picking the displayed swatch changes at least one edited paint. + displayed_swatch_changes_paints: bool, /// `swatches` as the palette draws them, in the same order. tiles: Vec<(Label, Srgba)>, shown: ColorPanelShown, @@ -573,9 +575,11 @@ fn swatches(ui: &mut Ui, feed: &Feed, filed: &mut Filed) { // the same colour, such as a spot ink an unlinked stop has the colour of, is not. let shown = SwatchPalette::new("Swatches", Bind::given(feed.current), &feed.tiles).selected_swatch(feed.selected_swatch).select_by_color(false).show(ui); - // A click on a swatch other than the one shown as the target's, also one of the colour the target already has. A - // click on the one shown changes nothing. - if let Some(swatch) = shown.picked_swatch.filter(|i| Some(*i) != feed.selected_swatch).and_then(|i| feed.swatches.get(i)) { + // A click on the displayed swatch applies only when an edited paint differs at this stop or point. + // Other swatches apply even when they have the same color. + if let Some(swatch) = + shown.picked_swatch.filter(|i| feed.displayed_swatch_changes_paints || Some(*i) != feed.selected_swatch).and_then(|i| feed.swatches.get(i)) + { filed.swatch = Some(swatch.clone()); } } @@ -650,6 +654,18 @@ fn refresh(app: &VectorcraftApp, ctx: &egui::Context, id: DialogId, target: &Tar tiles: swatches.iter().map(|(name, c)| (Label::from(name.clone()), Srgba::from(c32(c)))).collect(), swatches, selected_swatch, + displayed_swatch_changes_paints: app.session.gradient_edit_paints(!app.session.fill_active).map_or(true, |paints| { + !paints.all_paints_match(|paint| { + let Paint::Gradient(paint) = paint else { return false }; + match target { + Target::Stop(shown, i) => paint.gradient.stops.get(*i).is_some_and(|stop| { + let shown = &shown.gradient.stops[*i]; + stop.swatch == shown.swatch && stop.tint == shown.tint && stop.color == shown.color + }), + Target::Point(_, shown, i) => shown_points(paint).points.get(*i).is_some_and(|point| point.color == shown.color), + } + }) + }), shown, }; let at = place(app, ctx, anchor); @@ -1184,6 +1200,60 @@ mod tests { assert_eq!((stop.swatch.as_deref(), stop.tint), (Some("Green ink"), 1.0)); } + #[test] + fn picking_the_displayed_swatch_recolors_every_selected_objects_stop() { + let mut app = app(); + let first = app.session.active().unwrap().selection.objects[0]; + let mut second_stops = stops(&app); + second_stops[1].set_color(Color::from_hex("#0000ff").unwrap(), None); + let second = app.run("shape.rectangle", json!({"x": 230, "y": 80, "width": 50, "height": 90})).unwrap()["id"].clone(); + app.run("paint.setFill", json!({"gradient": {"stops": vectorcraft_tools::params::stops_json(&second_stops)}})).unwrap(); + app.run("swatch.new", json!({"name": "Stop green", "color": "#00ff00"})).unwrap(); + app.run("select.set", json!({"ids": [first.0, second]})).unwrap(); + app.run("gradient.selectStop", json!({"index": 1})).unwrap(); + let mut panel = swatches_view(app); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Stop green")); + panel.click("Stop green"); + let app = panel.app(); + let st = app.session.active().unwrap(); + for id in &st.selection.objects { + let Paint::Gradient(paint) = st.doc.node(*id).unwrap().appearance.paint_at(None, true).unwrap() else { + panic!("expected a gradient"); + }; + assert_eq!(paint.gradient.stops[1].color.to_hex(), "#00ff00"); + } + assert_eq!(st.selection.objects.len(), 2); + } + + #[test] + fn picking_the_displayed_swatch_keeps_every_selected_objects_gradient_swatch_link() { + let mut app = app(); + let first = app.session.active().unwrap().selection.objects[0]; + app.run("swatch.new", json!({"name": "Stop green", "color": stops(&app)[1].color.to_hex()})).unwrap(); + let mut params = crate::panels::swatch_paint_params(&active_paint(&app)); + params["name"] = json!("Linked gradient"); + app.run("swatch.new", params).unwrap(); + app.run("paint.setFill", json!({"swatch": "Linked gradient"})).unwrap(); + let second = app.run("shape.rectangle", json!({"x": 230, "y": 80, "width": 50, "height": 90})).unwrap()["id"].clone(); + app.run("paint.setFill", json!({"swatch": "Linked gradient"})).unwrap(); + app.run("select.set", json!({"ids": [first.0, second]})).unwrap(); + app.run("gradient.selectStop", json!({"index": 1})).unwrap(); + let mut panel = swatches_view(app); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Stop green")); + let undo = panel.app().session.active().unwrap().history.undo.len(); + panel.click("Stop green"); + let app = panel.app(); + let st = app.session.active().unwrap(); + assert_eq!(st.selection.objects.len(), 2); + for id in &st.selection.objects { + let Paint::Gradient(paint) = st.doc.node(*id).unwrap().appearance.paint_at(None, true).unwrap() else { + panic!("expected a gradient"); + }; + assert_eq!(paint.swatch.as_deref(), Some("Linked gradient")); + } + assert_eq!(st.history.undo.len(), undo, "the displayed swatch changes no paint"); + } + #[test] fn picking_the_stop_swatch_again_keeps_the_gradient_swatch_link() { let mut app = app(); From 728a0b673e405ca0972f2c176fbf774e2ffe3a74 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 30 Nov 2026 20:51:24 -0800 Subject: [PATCH 5/8] Gradient: the stop popover remembers a click on the swatch it already shows A click on the swatch shown as the stop's, when it changes no paint, was dropped, so the popover did not remember it. With two process swatches of one color, moving the other one before it then moved the selection. The click now stores the pick and leaves the paint as it is. --- crates/ui-egui/src/dialogs/gradient_stop.rs | 34 ++++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/dialogs/gradient_stop.rs b/crates/ui-egui/src/dialogs/gradient_stop.rs index f9cae62676..2f93db108d 100644 --- a/crates/ui-egui/src/dialogs/gradient_stop.rs +++ b/crates/ui-egui/src/dialogs/gradient_stop.rs @@ -376,6 +376,8 @@ struct Feed { struct Filed { fields: PopoverFields, swatch: Option<(String, Color)>, + /// Whether the pending swatch pick applies paint. + swatch_changes_paints: bool, eyedropper: bool, panels: Vec, /// Only an actual Shift-cycle changes this; an unchanged local snapshot must not overwrite a menu command. @@ -575,12 +577,13 @@ fn swatches(ui: &mut Ui, feed: &Feed, filed: &mut Filed) { // the same colour, such as a spot ink an unlinked stop has the colour of, is not. let shown = SwatchPalette::new("Swatches", Bind::given(feed.current), &feed.tiles).selected_swatch(feed.selected_swatch).select_by_color(false).show(ui); - // A click on the displayed swatch applies only when an edited paint differs at this stop or point. + // Every click remembers the pick. The displayed swatch applies only when an edited paint differs at this stop or point. // Other swatches apply even when they have the same color. - if let Some(swatch) = - shown.picked_swatch.filter(|i| feed.displayed_swatch_changes_paints || Some(*i) != feed.selected_swatch).and_then(|i| feed.swatches.get(i)) + if let Some(i) = shown.picked_swatch + && let Some(swatch) = feed.swatches.get(i) { filed.swatch = Some(swatch.clone()); + filed.swatch_changes_paints = feed.displayed_swatch_changes_paints || Some(i) != feed.selected_swatch; } } @@ -789,7 +792,9 @@ pub(crate) fn pump(app: &mut VectorcraftApp, ctx: &egui::Context) { if let Some((name, color)) = filed.swatch && let Some(target) = selected(app) { - pick_swatch(app, &target, &name, color); + if filed.swatch_changes_paints { + pick_swatch(app, &target, &name, color); + } // Swatches of one colour draw alike: the Swatches view shows the one picked, not the first of them. let picked = selected(app).and_then(|target| PickedSwatch::of(app, &target, &name)); dialogs.with(|host| { @@ -1016,6 +1021,27 @@ mod tests { assert_eq!(panel.app().session.active().unwrap().history.undo.len(), undo, "the same colour again is no edit"); } + #[test] + fn the_swatches_view_remembers_a_pick_of_the_fallback_swatch_after_reordering() { + let mut app = app(); + for name in ["First teal", "Second teal"] { + app.run("swatch.new", json!({"name": name, "color": "#008080"})).unwrap(); + } + crate::panels::gradient::recolor_selected(&mut app, Color::from_hex("#008080").unwrap(), &json!({})); + let mut panel = swatches_view(app); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("First teal"), "the first matching process swatch is the fallback"); + let undo = panel.app().session.active().unwrap().history.undo.len(); + panel.click("First teal"); + assert_eq!(panel.app().session.active().unwrap().history.undo.len(), undo, "the displayed swatch changes no paint"); + let first = panel.app().session.active().unwrap().doc.swatches_iter().position(|s| s.name == "First teal").unwrap(); + panel.app().run("swatch.move", json!({"name": "Second teal", "to": first})).unwrap(); + assert_eq!( + shown_swatch(&mut panel).as_deref(), + Some("First teal"), + "the explicit pick stays selected after the other swatch moves before it" + ); + } + #[test] fn the_swatches_view_keeps_the_picked_process_swatch_through_a_rename() { let mut app = app(); From e8068cb1e0f97edff899d1f3a8b29cf3228d2e79 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 30 Nov 2026 22:33:57 -0800 Subject: [PATCH 6/8] Gradient: comments in the stop popover code use American spelling --- crates/ui-egui/src/dialogs/gradient_stop.rs | 18 +++++++++--------- crates/ui-egui/src/panels.rs | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/ui-egui/src/dialogs/gradient_stop.rs b/crates/ui-egui/src/dialogs/gradient_stop.rs index 2f93db108d..3f0cf54d46 100644 --- a/crates/ui-egui/src/dialogs/gradient_stop.rs +++ b/crates/ui-egui/src/dialogs/gradient_stop.rs @@ -276,9 +276,9 @@ fn recolor(mut stops: Vec, i: usize, color: Color, link: Option<(S stops } -/// Solid colours of the document's swatches (groups included), with their names, and the entry the target's colour -/// comes from: a linked colour's tint swatch for that tint, or its global swatch at 100%; an unlinked colour's process -/// swatch of that very colour. Where several entries qualify, `picked`, the swatch last picked in the popover for this +/// Solid colors of the document's swatches (groups included), with their names, and the entry the target's color +/// comes from: a linked color's tint swatch for that tint, or its global swatch at 100%; an unlinked color's process +/// swatch of that very color. Where several entries qualify, `picked`, the swatch last picked in the popover for this /// target, is the one. fn swatch_colors(app: &VectorcraftApp, target: &Target, picked: Option<&PickedSwatch>) -> (Vec<(String, Color)>, Option) { let Some(st) = app.session.active() else { return (vec![], None) }; @@ -295,7 +295,7 @@ fn swatch_colors(app: &VectorcraftApp, target: &Target, picked: Option<&PickedSw for swatch in st.doc.swatches_iter() { let is_picked = picked.is_some_and(|p| p.name == swatch.name); let Some(own) = swatch.paint.color() else { continue }; - // Picking this swatch would give the target the colour and link it has now. + // Picking this swatch would give the target the color and link it has now. let source = match (link, swatch.tint_of()) { (Some((base, tint)), Some((of, own_tint))) => of == base && same_tint(tint, own_tint), (Some((base, tint)), None) => swatch.global && swatch.name == base && same_tint(tint, 1.0), @@ -362,7 +362,7 @@ struct Feed { /// Percent: the stop's location or the point's spread. amount: f64, swatches: Vec<(String, Color)>, - /// The entry of `swatches` the target's colour comes from. + /// The entry of `swatches` the target's color comes from. selected_swatch: Option, /// Picking the displayed swatch changes at least one edited paint. displayed_swatch_changes_paints: bool, @@ -573,8 +573,8 @@ fn swatches(ui: &mut Ui, feed: &Feed, filed: &mut Filed) { Notice::new(Tone::Info, tl!("The document has no colour swatches.").to_owned()).show(ui); return; } - // Only the entry the target's colour comes from is selected, and none when no entry is: a swatch that only draws - // the same colour, such as a spot ink an unlinked stop has the colour of, is not. + // Only the entry the target's color comes from is selected, and none when no entry is: a swatch that only draws + // the same color, such as a spot ink an unlinked stop has the color of, is not. let shown = SwatchPalette::new("Swatches", Bind::given(feed.current), &feed.tiles).selected_swatch(feed.selected_swatch).select_by_color(false).show(ui); // Every click remembers the pick. The displayed swatch applies only when an edited paint differs at this stop or point. @@ -795,7 +795,7 @@ pub(crate) fn pump(app: &mut VectorcraftApp, ctx: &egui::Context) { if filed.swatch_changes_paints { pick_swatch(app, &target, &name, color); } - // Swatches of one colour draw alike: the Swatches view shows the one picked, not the first of them. + // Swatches of one color draw alike: the Swatches view shows the one picked, not the first of them. let picked = selected(app).and_then(|target| PickedSwatch::of(app, &target, &name)); dialogs.with(|host| { if let Some(popover) = host.get_mut_by_id::(id) { @@ -1018,7 +1018,7 @@ mod tests { let undo = panel.app().session.active().unwrap().history.undo.len(); panel.click("First teal"); assert_eq!(shown_swatch(&mut panel).as_deref(), Some("First teal")); - assert_eq!(panel.app().session.active().unwrap().history.undo.len(), undo, "the same colour again is no edit"); + assert_eq!(panel.app().session.active().unwrap().history.undo.len(), undo, "the same color again is no edit"); } #[test] diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index 7d9149bf5a..5ac418d81d 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -1031,7 +1031,7 @@ pub(crate) fn recent_colors(app: &VectorcraftApp, ui: &mut Ui) -> Option .spacing(SwatchSpacing::Spaced) .drag_payload(move |drag: &ListDrag| dragged.get(drag.grabbed).map(|c| PanelDrag::paint(Paint::solid(*c)))) .show(ui); - // The stored colour of the cell clicked, in its own model: colours in two models can draw alike. + // The stored color of the cell clicked, in its own model: colors in two models can draw alike. out.picked_swatch.and_then(|i| stored.get(i).copied()) } From 14b5a5a4ae652cab4cb75eaf8a3a7328a64daea1 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 1 Dec 2026 01:18:02 -0800 Subject: [PATCH 7/8] Gradient: a stop's picked swatch follows the stop, and unchanged stops keep the gradient swatch When the stop popover moves a stop past its neighbor, the swatch picked for that stop moves to the stop's new index, so the Swatches view keeps showing it. Writing a stop list equal to a paint's current stops no longer clears that paint's gradient swatch link. --- crates/engine/src/cmd/gradient.rs | 37 +++++++++++++++++++-- crates/ui-egui/src/dialogs/gradient_stop.rs | 31 ++++++++++++++++- 2 files changed, 65 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/cmd/gradient.rs b/crates/engine/src/cmd/gradient.rs index 5293343f2a..22c99d9d8e 100644 --- a/crates/engine/src/cmd/gradient.rs +++ b/crates/engine/src/cmd/gradient.rs @@ -529,8 +529,12 @@ fn apply_gradient_edit_in_model( } let recolor = p.get("stops").is_some() || bool_or(p, "reverse", false); if let Some(stops) = p.get("stops") { - gp.gradient.stops = parse_stops(stops)?; - gp.swatch = None; + let stops = parse_stops(stops)?; + // A paint whose stops stay as they are keeps its gradient swatch. + if stops != gp.gradient.stops { + gp.gradient.stops = stops; + gp.swatch = None; + } } if bool_or(p, "reverse", false) { // Midpoints mirrored with their segments. @@ -901,3 +905,32 @@ fn set_gradient_geom(s: &mut Session, p: &Value) -> Result { })?; Ok(json!({ "ids": targets.iter().map(|i| i.0).collect::>() })) } + +#[cfg(test)] +mod tests { + use super::*; + use vectorcraft_color::Color; + + fn linked(stops: &[(f32, &str)]) -> Paint { + let stops = stops.iter().map(|(offset, hex)| GradientStop::new(*offset, Color::from_hex(hex).unwrap())).collect(); + let mut paint = GradientPaint::new(Gradient::new(GradientKind::Linear, stops)); + paint.swatch = Some("Linked".into()); + Paint::Gradient(Box::new(paint)) + } + + fn swatch(paint: &Paint) -> Option<&str> { + match paint { + Paint::Gradient(g) => g.swatch.as_deref(), + _ => None, + } + } + + #[test] + fn writing_the_stops_a_paint_already_has_keeps_its_gradient_swatch() { + let paint = linked(&[(0.0, "#ffffff"), (1.0, "#000000")]); + let same = json!({"stops": [{"offset": 0, "color": "#ffffff"}, {"offset": 1, "color": "#000000"}]}); + assert_eq!(swatch(&apply_gradient_edit(&paint, &same, None).unwrap()), Some("Linked")); + let other = json!({"stops": [{"offset": 0, "color": "#ff0000"}, {"offset": 1, "color": "#000000"}]}); + assert_eq!(swatch(&apply_gradient_edit(&paint, &other, None).unwrap()), None, "new stops unlink the swatch"); + } +} diff --git a/crates/ui-egui/src/dialogs/gradient_stop.rs b/crates/ui-egui/src/dialogs/gradient_stop.rs index 3f0cf54d46..e3d9a5334b 100644 --- a/crates/ui-egui/src/dialogs/gradient_stop.rs +++ b/crates/ui-egui/src/dialogs/gradient_stop.rs @@ -786,8 +786,17 @@ pub(crate) fn pump(app: &mut VectorcraftApp, ctx: &egui::Context) { && !owner.key.point && let Some(index) = app.session.selected_stop() { - // The stop can cross its neighbor when its location changes. + // The stop can cross its neighbor when its location changes. A swatch picked for it moves with it. + let moved = owner.key.clone(); owner.key.index = index; + dialogs.with(|host| { + if let Some(popover) = host.get_mut_by_id::(id) + && let Some(picked) = &mut popover.picked_swatch + && picked.target == moved + { + picked.target.index = index; + } + }); } if let Some((name, color)) = filed.swatch && let Some(target) = selected(app) @@ -1063,6 +1072,26 @@ mod tests { assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Second teal"), "the picked swatch moved before the other stays the one shown"); } + #[test] + fn the_swatches_view_keeps_the_picked_swatch_when_the_popover_moves_its_stop_past_a_neighbor() { + let mut app = app(); + let stops = json!([{"offset": 0, "color": "#ffffff"}, {"offset": 0.5, "color": "#008080"}, {"offset": 0.7, "color": "#000000"}]); + app.run("paint.setFill", json!({"gradient": {"stops": stops, "start": [100, 150], "end": [200, 150]}})).unwrap(); + app.run("gradient.selectStop", json!({"index": 1})).unwrap(); + for name in ["First teal", "Second teal"] { + app.run("swatch.new", json!({"name": name, "color": "#008080"})).unwrap(); + } + let mut panel = swatches_view(app); + panel.click("Second teal"); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Second teal")); + panel.app().dialogs().unwrap().with(|host| { + host.get_mut_by_id::(dialog_id(KIND)).expect("the popover").filed.fields.location = Some(90.0); + }); + panel.frame(); + assert_eq!(panel.app().session.selected_stop(), Some(2), "the stop crossed its neighbor"); + assert_eq!(shown_swatch(&mut panel).as_deref(), Some("Second teal"), "the pick moved with its stop"); + } + #[test] fn the_swatches_view_keeps_the_picked_swatch_through_a_rename_in_a_batch() { let mut app = app(); From 7cf9fa9c476aabcf1642f39aeecd6edded57c8bd Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 1 Dec 2026 02:35:40 -0800 Subject: [PATCH 8/8] Gradient: reversed stops unlink the gradient swatch A stops write with reverse compares the final, reversed stops with the paint's current stops, so writing the same stops reversed clears the gradient swatch link while an unchanged write still keeps it. --- crates/engine/src/cmd/gradient.rs | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/cmd/gradient.rs b/crates/engine/src/cmd/gradient.rs index 22c99d9d8e..90222aae4b 100644 --- a/crates/engine/src/cmd/gradient.rs +++ b/crates/engine/src/cmd/gradient.rs @@ -527,16 +527,20 @@ fn apply_gradient_edit_in_model( switched = true; } } - let recolor = p.get("stops").is_some() || bool_or(p, "reverse", false); + let reverse = bool_or(p, "reverse", false); + let recolor = p.get("stops").is_some() || reverse; if let Some(stops) = p.get("stops") { let stops = parse_stops(stops)?; - // A paint whose stops stay as they are keeps its gradient swatch. - if stops != gp.gradient.stops { - gp.gradient.stops = stops; + let before = std::mem::replace(&mut gp.gradient.stops, stops); + if reverse { + // Midpoints mirrored with their segments. + gp.gradient.reverse(); + } + // A paint whose final stops stay as they are keeps its gradient swatch. + if gp.gradient.stops != before { gp.swatch = None; } - } - if bool_or(p, "reverse", false) { + } else if reverse { // Midpoints mirrored with their segments. gp.gradient.reverse(); } @@ -933,4 +937,11 @@ mod tests { let other = json!({"stops": [{"offset": 0, "color": "#ff0000"}, {"offset": 1, "color": "#000000"}]}); assert_eq!(swatch(&apply_gradient_edit(&paint, &other, None).unwrap()), None, "new stops unlink the swatch"); } + + #[test] + fn writing_the_same_stops_reversed_unlinks_the_gradient_swatch() { + let paint = linked(&[(0.0, "#ffffff"), (1.0, "#000000")]); + let reversed = json!({"stops": [{"offset": 0, "color": "#ffffff"}, {"offset": 1, "color": "#000000"}], "reverse": true}); + assert_eq!(swatch(&apply_gradient_edit(&paint, &reversed, None).unwrap()), None, "reversed stops unlink the swatch"); + } }