diff --git a/Cargo.lock b/Cargo.lock index 737e5b2af3..d897becd69 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1376,7 +1376,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-automation", "craft-behavior", @@ -1417,7 +1417,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "crc32fast", "flate2", @@ -1438,7 +1438,7 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "block2 0.6.2", "objc2 0.6.5", @@ -1450,7 +1450,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "rustix 1.1.6", ] @@ -1458,7 +1458,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1483,7 +1483,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1501,7 +1501,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-behavior", "craft-docpath", @@ -1519,7 +1519,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "egui", ] @@ -1527,7 +1527,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "md-5", "rayon", @@ -1536,12 +1536,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" [[package]] name = "craft-color" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "serde", ] @@ -1549,7 +1549,7 @@ dependencies = [ [[package]] name = "craft-color-transform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-cms", "craft-color", @@ -1559,7 +1559,7 @@ dependencies = [ [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-behavior", "craft-cms", @@ -1579,7 +1579,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-ai-agents", "craft-atomic", @@ -1595,7 +1595,7 @@ dependencies = [ [[package]] name = "craft-control-protocol" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "getrandom 0.3.4", "serde_json", @@ -1605,7 +1605,7 @@ dependencies = [ [[package]] name = "craft-crs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-metadata", "craft-xml", @@ -1615,7 +1615,7 @@ dependencies = [ [[package]] name = "craft-crw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "thiserror 2.0.21", ] @@ -1623,7 +1623,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "rayon", ] @@ -1631,7 +1631,7 @@ dependencies = [ [[package]] name = "craft-develop" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-color", "craft-color-transform", @@ -1646,7 +1646,7 @@ dependencies = [ [[package]] name = "craft-develop-model" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-geom", "craft-metadata", @@ -1658,7 +1658,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "block2 0.6.2", "craft-appkit", @@ -1684,7 +1684,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "serde", ] @@ -1692,7 +1692,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1711,12 +1711,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" [[package]] name = "craft-file-formats" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-eps", "craft-idml", @@ -1734,7 +1734,7 @@ dependencies = [ [[package]] name = "craft-flags" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-atomic", "dirs", @@ -1744,7 +1744,7 @@ dependencies = [ [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1759,7 +1759,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1779,7 +1779,7 @@ dependencies = [ [[package]] name = "craft-font-os-windows" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "windows-registry", "windows-sys 0.61.2", @@ -1788,7 +1788,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "cap-primitives", "craft-atomic", @@ -1811,12 +1811,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" [[package]] name = "craft-geom" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "serde", ] @@ -1824,7 +1824,7 @@ dependencies = [ [[package]] name = "craft-heif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "heic-rs", "rayon", @@ -1833,7 +1833,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1846,7 +1846,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "brotli 9.1.3", "brotli-decompressor 6.3.2", @@ -1876,7 +1876,7 @@ dependencies = [ [[package]] name = "craft-idml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-xml", "craft-zip", @@ -1886,7 +1886,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-dds", "craft-heif", @@ -1914,7 +1914,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1932,12 +1932,12 @@ dependencies = [ [[package]] name = "craft-ipp" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "thiserror 2.0.21", ] @@ -1945,7 +1945,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-host", "craft-i18n", @@ -1960,7 +1960,7 @@ dependencies = [ [[package]] name = "craft-kra" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-xml", "craft-zip", @@ -1970,7 +1970,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-behavior", "craft-i18n", @@ -1984,7 +1984,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-behavior", "craft-host", @@ -2002,7 +2002,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -2014,7 +2014,7 @@ dependencies = [ [[package]] name = "craft-nightly" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "uds_windows", "winsafe", @@ -2023,7 +2023,7 @@ dependencies = [ [[package]] name = "craft-ora" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-xml", "craft-zip", @@ -2033,7 +2033,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-behavior", "craft-keymap", @@ -2049,7 +2049,7 @@ dependencies = [ [[package]] name = "craft-pcraft-bundle" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "blake3", "craft-atomic", @@ -2062,7 +2062,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "flate2", "serde", @@ -2073,7 +2073,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "bytemuck", "flate2", @@ -2088,7 +2088,7 @@ dependencies = [ [[package]] name = "craft-pdn" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "flate2", "thiserror 2.0.21", @@ -2097,7 +2097,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "async-channel", "async-io", @@ -2130,7 +2130,7 @@ dependencies = [ [[package]] name = "craft-plist" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "thiserror 2.0.21", ] @@ -2138,7 +2138,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-behavior", "craft-host", @@ -2162,7 +2162,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "encoding_rs", "flate2", @@ -2173,7 +2173,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "dispatch2", "egui", @@ -2186,7 +2186,7 @@ dependencies = [ [[package]] name = "craft-raw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "chrono", "craft-crw", @@ -2204,7 +2204,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -2223,7 +2223,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-atomic", "craft-host", @@ -2240,7 +2240,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-image-codecs", "craft-xml", @@ -2261,7 +2261,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-behavior", "craft-keymap", @@ -2273,7 +2273,7 @@ dependencies = [ [[package]] name = "craft-testkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "rustix 1.1.6", "tempfile", @@ -2283,7 +2283,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2306,7 +2306,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2321,7 +2321,7 @@ dependencies = [ [[package]] name = "craft-theme-editor" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-behavior", "craft-theme", @@ -2332,7 +2332,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-atomic", "craft-behavior", @@ -2347,7 +2347,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "serde", "thiserror 2.0.21", @@ -2357,7 +2357,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "serde", "thiserror 2.0.21", @@ -2366,7 +2366,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-behavior", "craft-keymap", @@ -2381,7 +2381,7 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "serde", ] @@ -2389,7 +2389,7 @@ dependencies = [ [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2403,7 +2403,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-behavior", "craft-i18n", @@ -2419,7 +2419,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "accesskit", "craft-behavior", @@ -2461,7 +2461,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2472,7 +2472,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-behavior", "craft-host", @@ -2490,7 +2490,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-behavior", "craft-host", @@ -2511,7 +2511,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-behavior", "craft-host", @@ -2531,7 +2531,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-behavior", "craft-host", @@ -2550,7 +2550,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "base64 0.22.1", "chrono", @@ -2582,7 +2582,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "winsafe", ] @@ -2590,7 +2590,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "craft-appkit", "craft-atomic", @@ -2622,7 +2622,7 @@ dependencies = [ [[package]] name = "craft-xcf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "flate2", "thiserror 2.0.21", @@ -2631,7 +2631,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "quick-xml 0.41.0", "serde", @@ -2641,7 +2641,7 @@ dependencies = [ [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "flate2", "thiserror 2.0.21", @@ -4165,7 +4165,7 @@ dependencies = [ [[package]] name = "hayro" version = "0.7.1" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "bytemuck", "hayro-interpret", @@ -4195,7 +4195,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -4213,7 +4213,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -4237,7 +4237,7 @@ checksum = "bc2d80da85f31c3fdc0366431f44cfd645a9da1e242ed1f4a61f213d9765660f" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "flate2", "hayro-ccitt", @@ -5330,7 +5330,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "arrayvec", "kurbo 0.13.1", @@ -9841,7 +9841,7 @@ dependencies = [ [[package]] name = "vello_common" version = "0.0.8" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "bytemuck", "fearless_simd", @@ -9889,7 +9889,7 @@ dependencies = [ [[package]] name = "vello_cpu" version = "0.0.8" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" dependencies = [ "bytemuck", "glifo 0.1.1", @@ -11535,14 +11535,14 @@ source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387 [[patch.unused]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" [[patch.unused]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" [[patch.unused]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=6ffc396957f7b12ec8fae8bf9084f077384ad2b4#6ffc396957f7b12ec8fae8bf9084f077384ad2b4" +source = "git+https://github.com/storytold/craft-libs?rev=4ed3d95b0f244b2b10d5f167183658f38f73594d#4ed3d95b0f244b2b10d5f167183658f38f73594d" diff --git a/Cargo.toml b/Cargo.toml index b961f592e0..764d0a186f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,21 +12,21 @@ rust-version = "1.95" [workspace.dependencies] # The craft framework through its facade (`craft::ui::…`). The egui `[patch]` below must match # `craft::egui_fork::REV` (checked by `cargo xtask ci`). -craft = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4", default-features = false } -craft-tracked = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -craft-ui-macros = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d", default-features = false } +craft-tracked = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +craft-ui-macros = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } # internal photocraft-geom = { path = "crates/geom" } photocraft-color = { path = "crates/color" } photocraft-raster = { path = "crates/raster" } photocraft-doc = { path = "crates/doc" } photocraft-ops = { path = "crates/ops" } -craft-plist = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -photocraft-codecs = { package = "craft-image-codecs", git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -photocraft-formats = { package = "craft-file-formats", git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4", features = ["raster-codecs", "pdf", "svg", "ora", "kra", "xcf", "pdn", "raw", "psd", "affinity", "pcraft"] } +craft-plist = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +photocraft-codecs = { package = "craft-image-codecs", git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +photocraft-formats = { package = "craft-file-formats", git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d", features = ["raster-codecs", "pdf", "svg", "ora", "kra", "xcf", "pdn", "raw", "psd", "affinity", "pcraft"] } photocraft-raw = { path = "crates/raw" } -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } photocraft-compose = { path = "crates/compose" } photocraft-gpu = { path = "crates/gpu" } photocraft-paint = { path = "crates/paint" } @@ -48,38 +48,38 @@ photocraft-ipp = { path = "crates/ipp" } # external # ICC colour management: the shared crate (replaces crates/cms; craft-libs#779). -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -craft-print = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +craft-print = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } # HEIC/HEIF: the shared decoder (replaces crates/heif; craft-libs#784). -craft-heif = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4", features = ["raster", "write-raster"] } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -craft-jpeg = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -craft-pcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -craft-pcraft-bundle = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -craft-zip = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -craft-ora = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -craft-kra = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -craft-xcf = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -craft-pdn = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } +craft-heif = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d", features = ["raster", "write-raster"] } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +craft-jpeg = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +craft-pcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +craft-pcraft-bundle = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +craft-zip = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +craft-ora = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +craft-kra = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +craft-xcf = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +craft-pdn = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } # Keep the shared embedded-image validation API until the framework revision includes it. -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4", features = ["tree-render", "tree-render-system-fonts"] } -craft-raw = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d", features = ["tree-render", "tree-render-system-fonts"] } +craft-raw = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } # Camera-field EXIF reader/writer, shared prerequisite craft-libs#1563. -craft-metadata = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -craft-crs = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -craft-develop = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -craft-develop-model = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } +craft-metadata = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +craft-crs = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +craft-develop = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +craft-develop-model = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } # Interface translations: lookup, fallback, CLDR plurals and language names over the craft-i18n # catalogs that `crates/ui-egui/build.rs` embeds from `CRAFT_I18N_DIR` (storytold/craft-i18n, at # the commit in `craft-i18n.rev`). Already in the tree through craft. -craft-i18n = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } +craft-i18n = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } # craft-update: app-specific pretend versions apply to startup and manual checks. -craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4", features = ["ui"] } +craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d", features = ["ui"] } # Self-contained nightly profile isolation, launch protocol, and security fence. -craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } +craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } thiserror = "2" serde = { version = "1", features = ["derive", "rc"] } serde_json = "1" @@ -352,16 +352,16 @@ opt-level = 3 # Keep the complete egui family and native event bridge on reviewed fork commits. [patch.crates-io] -krilla = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -hayro = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -vello_common = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } -vello_cpu = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +hayro = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +vello_common = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } +vello_cpu = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } 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/photocraft-cli/tests/it/cli.rs b/apps/photocraft-cli/tests/it/cli.rs index 894b4d7a34..cf590cf8f2 100644 --- a/apps/photocraft-cli/tests/it/cli.rs +++ b/apps/photocraft-cli/tests/it/cli.rs @@ -2112,7 +2112,7 @@ fn mcp_session(args: &[&str], env: &[(&str, &std::ffi::OsStr)], calls: &[(&str, } /// Plain `mcp` without the person's consent works headless, as it always did: commands run, UI -/// tools say they need the open app. `--headless` too, and it doesn't read a PHOTOCRAFT_CONTROL_PORT +/// tools are not offered. `--headless` too, and it doesn't read a PHOTOCRAFT_CONTROL_PORT /// exported for another tool (here not even a port). #[test] fn mcp_without_consent_works_headless() { @@ -2124,8 +2124,8 @@ fn mcp_without_consent_works_headless() { let calls = [("command_list", json!({})), ("ui_inspect", json!({}))]; let r = mcp_session(&["mcp", "--when-closed", "error"], &env, &calls); assert_ne!(r[0]["isError"], true, "headless commands run: {}", r[0]); - assert_eq!(r[1]["isError"], true, "{}", r[1]); - assert!(r[1]["content"][0]["text"].as_str().unwrap().contains("bridge"), "{}", r[1]); + // An unknown tool is a protocol error, so the reply has no `result`. + assert!(r[1].is_null(), "headless mcp offers no ui_* tools: {}", r[1]); let mut env = env.to_vec(); env.push(("PHOTOCRAFT_CONTROL_PORT", std::ffi::OsStr::new("not-a-port"))); let r = mcp_session(&["mcp", "--headless"], &env, &calls[..1]); diff --git a/crates/automation/src/server.rs b/crates/automation/src/server.rs index ca2a668924..5ade19c603 100644 --- a/crates/automation/src/server.rs +++ b/crates/automation/src/server.rs @@ -637,6 +637,9 @@ impl PhotocraftMcp { pub fn with_backend(backend: Backend) -> Self { let mut tool_router = Self::tool_router(); + if matches!(&backend, Backend::Headless(_)) { + tool_router.map.retain(|name, _| !name.starts_with("ui_") && name != "control_call"); + } for route in tool_router.map.values_mut() { let mut schema = (*route.attr.input_schema).clone(); strict_schema(&mut schema); @@ -1058,13 +1061,13 @@ impl PhotocraftMcp { `disabledReason` says why a command is off (null when enabled); `needsDocument` is true when it is off because no \ document is open: create or open one first (doc_new, doc_open).")] async fn command_list(&self, Parameters(p): Parameters) -> Result { - let all = if let Some(r) = self.headless_op(|h| Ok(h.command_list())).await { - r + let (all, headless) = if let Some(r) = self.headless_op(|h| Ok(h.command_list())).await { + (r, true) } else { let Some(b) = self.bridge_client() else { return Ok(no_backend()); }; - b.call_read("engine.commands", json!({})).await + (b.call_read("engine.commands", json!({})).await, false) }; let all = match all { Ok(v) => v, @@ -1072,10 +1075,19 @@ impl PhotocraftMcp { }; let needle = p.filter.map(|f| f.to_lowercase()); let enabled_only = p.enabled_only.unwrap_or(false); + let params = json!({}); let items: Vec = into_command_rows(all) .into_iter() .filter(|c| { - needle.as_ref().is_none_or(|n| photocraft_engine::commands::list_entry_matches(c, n)) + let allowed = c.get("id").and_then(Value::as_str).is_some_and(|id| { + if headless { + id == "file.export.renderVideo" || crate::workspace::authorize_engine_command(id, ¶ms).is_ok() + } else { + crate::workspace::authorize_desktop_engine_command(id, ¶ms).is_ok() + } + }); + allowed + && needle.as_ref().is_none_or(|n| photocraft_engine::commands::list_entry_matches(c, n)) && (!enabled_only || c.get("enabled").and_then(Value::as_bool).unwrap_or(true)) }) .collect(); diff --git a/crates/automation/src/server/conventions.rs b/crates/automation/src/server/conventions.rs index 9fa686e968..953aa5ce42 100644 --- a/crates/automation/src/server/conventions.rs +++ b/crates/automation/src/server/conventions.rs @@ -9,7 +9,7 @@ use rmcp::service::RequestContext; const DOCUMENT: &str = "photocraft://document"; const COMMANDS: &str = "photocraft://commands"; -const INSTRUCTIONS: &str = "PhotoCraft image editor. Start with doc_new/doc_open, discover ids and parameter docs with command_list, edit with command_run or command_batch (one history step per command). Inspect with doc_inspect and render_preview; doc_save writes native .pcraft or exports by extension. File paths are relative to the read/write roots granted at launch; agent_folders tells where they are. ui_inspect/ui_screenshot and other ui_* tools require bridge mode. Read photocraft://document and photocraft://commands for live JSON state."; +const INSTRUCTIONS: &str = "PhotoCraft image editor. Start with doc_new/doc_open, discover ids and parameter docs with command_list, edit with command_run or command_batch (one history step per command). Inspect with doc_inspect and render_preview; doc_save writes native .pcraft or exports by extension. File paths are relative to the read/write roots granted at launch; agent_folders tells where they are. ui_* tools and control_call, where listed, need the open app (bridge mode). Read photocraft://document and photocraft://commands for live JSON state."; fn annotated(mut tool: Tool) -> Tool { let words = tool.name.replace('_', " "); diff --git a/crates/automation/tests/it/mcp.rs b/crates/automation/tests/it/mcp.rs index e972e46e60..ffcf88cc57 100644 --- a/crates/automation/tests/it/mcp.rs +++ b/crates/automation/tests/it/mcp.rs @@ -93,15 +93,11 @@ async fn lists_expected_tools() { "command_list", "command_run", "command_batch", - "ui_inspect", - "ui_screenshot", - "ui_pointer", - "ui_menu_invoke", - "ui_set", - "control_call", ] { assert!(names.contains(&n.to_string()), "missing tool {n}: {names:?}"); } + assert!(!names.iter().any(|name| name.starts_with("ui_") || name == "control_call")); + assert!(client.call_tool(CallToolRequestParams::new("ui_screenshot")).await.is_err()); for t in &tools { assert!(t.name.chars().all(|c| c.is_ascii_alphanumeric() || c == '_'), "tool name `{}`", t.name); assert!(t.description.as_ref().is_some_and(|d| !d.is_empty())); @@ -165,6 +161,15 @@ async fn command_list_filters() { let all = json_of(&call(&client, "command_list", json!({})).await); let n_all = all.as_array().unwrap().len(); assert!(n_all > 20); + for id in ["file.openAs", "file.placeEmbedded", "file.export.quickExport", "file.automate.photomerge"] { + assert!(!all.as_array().unwrap().iter().any(|row| row["id"] == id), "{id}"); + } + for filter in ["rotate", "rotation"] { + let rows = json_of(&call(&client, "command_list", json!({"filter": filter})).await); + for id in ["image.imageRotation.90cw", "edit.transform.rotate90Cw"] { + assert!(rows.as_array().unwrap().iter().any(|row| row["id"] == id), "{filter}: {id}"); + } + } let blur = json_of(&call(&client, "command_list", json!({"filter": "blur"})).await); assert!(!blur.as_array().unwrap().is_empty() && blur.as_array().unwrap().len() < n_all); assert!(blur.as_array().unwrap().iter().all(|c| c["params"].is_string())); @@ -221,7 +226,7 @@ fn strict_schema_problems(path: &str, schema: &Value, out: &mut Vec) { async fn tool_schemas_pass_strict_validators() { // #1782: `ui_pointer`'s `items: true` and `command_batch`'s `$ref`/`$defs` made strict // providers (e.g. Moonshot via Volcano Ark) reject the whole request. - let client = connect(PhotocraftMcp::headless()).await; + let client = connect(PhotocraftMcp::bridge("127.0.0.1:1", CONTROL_TOKEN).unwrap()).await; let tools = client.list_all_tools().await.unwrap(); let mut problems = Vec::new(); for t in &tools { @@ -294,7 +299,7 @@ fn ui_set_fields() -> Vec { /// three fields missing when the issue was filed. #[tokio::test(flavor = "multi_thread")] async fn ui_set_description_names_every_accepted_field() { - let client = connect(PhotocraftMcp::headless()).await; + let client = connect(PhotocraftMcp::bridge("127.0.0.1:1", CONTROL_TOKEN).unwrap()).await; let tools = client.list_all_tools().await.unwrap(); let tool = tools.iter().find(|t| t.name == "ui_set").expect("ui_set tool"); let schema = Value::Object((*tool.input_schema).clone()); @@ -319,9 +324,6 @@ async fn errors_are_tool_errors_not_crashes() { assert_eq!(r.is_error, Some(true)); let r = call(&client, "doc_open", json!({"path": "/definitely/missing.png"})).await; assert_eq!(r.is_error, Some(true)); - let r = call(&client, "ui_inspect", json!({})).await; - assert_eq!(r.is_error, Some(true)); - assert!(text(&r).contains("bridge")); let r = call(&client, "doc_export", json!({})).await; assert_eq!(r.is_error, Some(true)); // Quality 0 is refused, not clamped to 1 (serde already refuses 500, -1 and "85"). @@ -1368,6 +1370,58 @@ async fn command_batch_description_exposes_non_atomic_semantics_when_tools_are_l client.cancel().await.unwrap(); } +#[tokio::test(flavor = "multi_thread")] +async fn invalid_edit_parameters_do_not_modify_the_document() { + let client = connect(PhotocraftMcp::headless()).await; + json_of(&call(&client, "doc_new", json!({"width": 8, "height": 8})).await); + let before = json_of(&call(&client, "doc_inspect", json!({})).await); + for (id, params, expected) in [ + ("image.adjustments.desaturate", json!({"amount": 50}), "unknown parameter"), + ("image.adjustments.desaturate", json!([]), "object"), + ("document.pixel", json!({"x": 0}), "y must be a number"), + ("image.crop", json!({"deleteCroppedPixels": "false"}), "must be true or false"), + ] { + let step = json!({"id": id, "params": params}); + let reply = call(&client, "command_run", step.clone()).await; + assert_eq!(reply.is_error, Some(true), "{id}: {}", text(&reply)); + assert!(text(&reply).contains(expected), "{id}: {}", text(&reply)); + let batch = json_of(&call(&client, "command_batch", json!({"steps": [step]})).await); + assert_eq!(batch["failed"], 1, "{batch}"); + assert!(batch["results"][0]["error"].as_str().unwrap().contains(expected), "{batch}"); + } + let after = json_of(&call(&client, "doc_inspect", json!({})).await); + assert_eq!(after["history"], before["history"]); + assert_eq!(after["width"], 8); + assert_eq!(after["height"], 8); + client.cancel().await.unwrap(); +} + +/// The headless session's gate is no reason to refuse a crop frame past the canvas: the Crop tool +/// extends the canvas that way, and Reveal All always crops to a frame larger than the canvas. +#[tokio::test(flavor = "multi_thread")] +async fn gated_sessions_still_crop_past_the_canvas() { + let client = connect(PhotocraftMcp::headless()).await; + json_of(&call(&client, "doc_new", json!({"width": 8, "height": 8})).await); + let size = |doc: &Value| (doc["width"].as_u64().unwrap(), doc["height"].as_u64().unwrap()); + let run = |id: &'static str, params: Value| { + let client = &client; + async move { + let reply = call(client, "command_run", json!({"id": id, "params": params})).await; + assert_ne!(reply.is_error, Some(true), "{id}: {}", text(&reply)); + } + }; + run("image.crop", json!({"x": -2, "y": 0, "width": 10, "height": 8})).await; + let extended = size(&json_of(&call(&client, "doc_inspect", json!({})).await)); + assert!(extended.0 > 8, "an extending crop widens the canvas: {extended:?}"); + run("image.crop", json!({"x": 2, "y": 0, "width": 4, "height": 8, "deleteCroppedPixels": false})).await; + let cropped = size(&json_of(&call(&client, "doc_inspect", json!({})).await)); + assert!(cropped.0 < extended.0, "{cropped:?}"); + run("image.revealAll", json!({})).await; + let revealed = size(&json_of(&call(&client, "doc_inspect", json!({})).await)); + assert!(revealed.0 > cropped.0, "Reveal All brings the hidden pixels back: {revealed:?}"); + client.cancel().await.unwrap(); +} + #[tokio::test(flavor = "multi_thread")] async fn command_batch_runs_steps_in_order() { let client = connect(PhotocraftMcp::headless()).await; @@ -1552,7 +1606,7 @@ async fn convention_tool_hints_match_what_each_tool_does() { ("ui_set", EDITS), ("control_call", EDITS), ]; - let client = connect(PhotocraftMcp::headless()).await; + let client = connect(PhotocraftMcp::bridge("127.0.0.1:1", CONTROL_TOKEN).unwrap()).await; let tools = client.list_all_tools().await.unwrap(); assert_eq!(tools.len(), expected.len(), "classify every tool here"); for tool in tools { diff --git a/crates/compose/src/lib.rs b/crates/compose/src/lib.rs index d0a160216b..e7a50048ab 100644 --- a/crates/compose/src/lib.rs +++ b/crates/compose/src/lib.rs @@ -32,6 +32,7 @@ pub mod native_lab; pub mod pattern; pub mod proxy; pub mod psblend; +pub mod scripted_pattern; pub mod shape_split; pub mod smart_mix; mod uniform; diff --git a/crates/compose/src/scripted_pattern.rs b/crates/compose/src/scripted_pattern.rs new file mode 100644 index 0000000000..9def7a7493 --- /dev/null +++ b/crates/compose/src/scripted_pattern.rs @@ -0,0 +1,230 @@ +//! Scripted patterns: Edit › Fill › Pattern with Script on lays the chosen pattern out as separate tiles instead of a +//! plain repeat. Brick Fill is the first script; the others extend [`SCRIPTS`] and [`controls`] with their own layout. +//! +//! Every script shares the per-tile Color and Brightness randomness ([`Jitter`]): at 0 a tile keeps the pattern's +//! exact colours, above 0 each placed tile drifts by its own random amount. Areas no tile covers stay transparent. + +use photocraft_geom::Rect; + +use crate::pattern::{Placement, Tile}; + +/// The scripts in the Script list's order: (parameter value, name). The name is also the script dialog's title. +pub const SCRIPTS: [(&str, &str); 6] = [ + ("brickFill", "Brick Fill"), + ("crossWeave", "Cross Weave"), + ("placeAlongPath", "Place Along Path"), + ("randomFill", "Random Fill"), + ("spiral", "Spiral"), + ("symmetryFill", "Symmetry Fill"), +]; + +/// The scripts that paint today; the rest are listed but answer "not supported yet". +pub const SUPPORTED: [&str; 1] = ["brickFill"]; + +/// The parameter value of a script name, matched without regard to case. +pub fn script_key(name: &str) -> Option<&'static str> { + SCRIPTS.iter().map(|(k, _)| *k).find(|k| k.eq_ignore_ascii_case(name)) +} + +/// One value of a script dialog: its parameter key, factory value and range. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct Control { + pub key: &'static str, + pub default: f64, + pub min: f64, + pub max: f64, + /// The most digits shown after the decimal mark. + pub decimals: u32, +} + +impl Control { + const fn new(key: &'static str, default: f64, min: f64, max: f64, decimals: u32) -> Control { + Control { key, default, min, max, decimals } + } + + /// `v` inside the range; a non-finite value takes the factory value. + pub fn clamp(&self, v: f64) -> f64 { + if v.is_finite() { v.clamp(self.min, self.max) } else { self.default } + } +} + +/// The Spacing range for a `width` x `height` pattern tile, in pixels: up to three tile widths apart, and overlapping +/// by up to the shorter side less 2 px (the measured -28 to 120 for a 40 x 30 tile). It does not change with the scale. +pub fn spacing_range(width: u32, height: u32) -> (f64, f64) { + let min = -f64::from(width.min(height).saturating_sub(2)); + (min, 3.0 * f64::from(width)) +} + +/// The values of `script` in its dialog's order, for a `width` x `height` pattern; `None` for an unknown script or one +/// that does not paint yet. +pub fn controls(script: &str, width: u32, height: u32) -> Option> { + match script { + "brickFill" => { + let (lo, hi) = spacing_range(width, height); + Some(vec![ + Control::new("patternScale", 1.0, 0.1, 1.25, 2), + Control::new("spacing", 0.0, lo, hi, 0), + Control::new("offsetBetweenRows", 50.0, -100.0, 100.0, 0), + Control::new("colorRandomness", 0.05, 0.0, 1.0, 2), + Control::new("brightnessRandomness", 0.1, 0.0, 1.0, 2), + Control::new("patternRotateAngle", 0.0, -180.0, 180.0, 0), + ]) + } + _ => None, + } +} + +/// Per-tile colour and brightness drift, both 0..1, repeatable for one `seed`. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct Jitter { + pub color: f32, + pub brightness: f32, + pub seed: u64, +} + +/// How far each channel moves at randomness 1: a quarter of the range, so the default 0.05 / 0.1 shift a channel by a +/// few levels (one measured tile: blue 245 instead of 255). +const JITTER_REACH: f32 = 0.25; + +impl Jitter { + /// The change added to each channel of tile `(row, col)`: its own colour offsets plus one shared brightness offset. + fn offsets(&self, row: i64, col: i64) -> [f32; 3] { + if self.color <= 0.0 && self.brightness <= 0.0 { + return [0.0; 3]; + } + let mut state = self.seed ^ (row as u64).wrapping_mul(0x9E37_79B9_7F4A_7C15) ^ (col as u64).wrapping_mul(0xC2B2_AE3D_27D4_EB4F); + let mut next = || { + // splitmix64: a well-mixed value per call, in -1..1. + state = state.wrapping_add(0x9E37_79B9_7F4A_7C15); + let mut z = state; + z = (z ^ (z >> 30)).wrapping_mul(0xBF58_476D_1CE4_E5B9); + z = (z ^ (z >> 27)).wrapping_mul(0x94D0_49BB_1331_11EB); + z ^= z >> 31; + ((z >> 40) as f32 / (1u64 << 24) as f32) * 2.0 - 1.0 + }; + let light = next() * self.brightness * JITTER_REACH; + let mut out = [0.0; 3]; + for o in &mut out { + *o = next() * self.color * JITTER_REACH + light; + } + out + } +} + +/// Brick Fill: rows of whole tiles from the canvas origin, every second row shifted by a share of the tile width. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct BrickFill { + /// Tile size as a fraction (0.1..1.25). + pub scale: f64, + /// Pixels between neighbouring tiles, across and down; negative overlaps them. + pub spacing: f64, + /// Shift of every second row to the left, in percent of the tile width (negative shifts right). + pub offset: f64, + /// Rotation of each tile about its centre, degrees counter-clockwise. + pub angle: f64, + pub jitter: Jitter, +} + +/// Most tiles composited into one pixel, front to back: bounds the work of extreme overlaps. Only a pixel whose +/// frontmost tiles all let some of it through ever reaches it; an opaque tile ends the pixel at once. +const MAX_LAYERS: usize = 1024; + +/// The x range where the convex polygon `corners` (in order) meets the line at height `y`, if it does. +fn span(corners: &[(f64, f64); 4], y: f64) -> Option<(f64, f64)> { + let mut range: Option<(f64, f64)> = None; + for i in 0..4 { + let (a, b) = (corners[i], corners[(i + 1) % 4]); + if (a.1 - y) * (b.1 - y) > 0.0 { + continue; + } + let x = if a.1 == b.1 { [a.0, b.0] } else { [a.0 + (b.0 - a.0) * (y - a.1) / (b.1 - a.1); 2] }; + for x in x { + range = Some(range.map_or((x, x), |(lo, hi)| (lo.min(x), hi.max(x)))); + } + } + range +} + +impl BrickFill { + /// The tiles of a `width` x `height` pattern laid out over `rect` (row-major straight RGBA, transparent where no + /// tile lies). Later tiles (down, then right) lie over earlier ones where they overlap. + pub fn render(&self, tile: &Tile, width: u32, height: u32, rect: Rect) -> Vec<[f32; 4]> { + let len = rect.width() as usize * rect.height() as usize; + let mut out = vec![[0.0f32; 4]; len]; + // At the f32 precision the placement maps with, so the tile bounds here are the ones it samples. + let scale = if self.scale.is_finite() && self.scale > 0.0 { f64::from(self.scale as f32) } else { 1.0 }; + let (tw, th) = (f64::from(width) * scale, f64::from(height) * scale); + if len == 0 || tw <= 0.0 || th <= 0.0 { + return out; + } + let spacing = if self.spacing.is_finite() { self.spacing } else { 0.0 }; + // At least a pixel between tile origins, so every layout ends. + let (pitch_x, pitch_y) = ((tw + spacing).max(1.0), (th + spacing).max(1.0)); + let shift = if self.offset.is_finite() { self.offset / 100.0 * tw } else { 0.0 }; + let angle = if self.angle.is_finite() { self.angle } else { 0.0 }; + let (c, s) = (angle.to_radians().cos(), angle.to_radians().sin()); + // The tile centres that put a pixel inside their tile form the turned tile rectangle around the pixel: its + // corners, relative to the pixel, and how far it reaches down. + let (a, b) = (tw / 2.0, th / 2.0); + let corners = [(a, b), (a, -b), (-a, -b), (-a, b)].map(|(hx, hy)| (hx * c + hy * s, -hx * s + hy * c)); + let reach_y = s.abs() * a + c.abs() * b; + let placement = |row: i64, col: i64| { + let x0 = col as f64 * pitch_x - if row.rem_euclid(2) == 1 { shift } else { 0.0 }; + let y0 = row as f64 * pitch_y; + let (cx, cy) = (x0 + tw / 2.0, y0 + th / 2.0); + // The corner the tile's (0, 0) lands on once it is turned about its centre (y down, counter-clockwise). + let (hx, hy) = (-tw / 2.0, -th / 2.0); + let origin = (cx + hx * c + hy * s, cy - hx * s + hy * c); + Placement::anchored(origin, true, (0.0, 0.0), scale as f32, angle as f32) + }; + let mut i = 0; + for y in rect.y0..rect.y1 { + let py = f64::from(y) + 0.5; + // Rows whose tiles can reach this line, the last drawn (topmost) first. + let top_row = ((py + reach_y - th / 2.0) / pitch_y).floor() as i64; + let low_row = ((py - reach_y - th / 2.0) / pitch_y).ceil() as i64; + for x in rect.x0..rect.x1 { + let px = f64::from(x) + 0.5; + let mut acc = [0.0f32; 4]; + let mut layers = 0; + 'rows: for row in (low_row..=top_row).rev() { + // Only the tiles of this row whose centre lies in the turned rectangle around the pixel cover it. + let Some((lo, hi)) = span(&corners, row as f64 * pitch_y + th / 2.0 - py) else { continue }; + let row_shift = if row.rem_euclid(2) == 1 { shift } else { 0.0 }; + let right = ((px + hi + row_shift - tw / 2.0) / pitch_x).floor() as i64; + let left = ((px + lo + row_shift - tw / 2.0) / pitch_x).ceil() as i64; + for col in (left..=right).rev() { + if layers >= MAX_LAYERS || acc[3] >= 1.0 { + break 'rows; + } + let place = placement(row, col); + let (u, v) = place.map(px, py); + if !(0.0..f64::from(width)).contains(&u) || !(0.0..f64::from(height)).contains(&v) { + continue; + } + layers += 1; + let mut q = tile.sample_area(&place, px, py); + let d = self.jitter.offsets(row, col); + // Without a drift a tile keeps its exact colour, also a float one past 1. + for ch in 0..3 { + if d[ch] != 0.0 { + q[ch] = (q[ch] + d[ch]).clamp(0.0, 1.0); + } + } + // Front to back: what is already in front covers this tile. + let k = q[3] * (1.0 - acc[3]); + for ch in 0..3 { + acc[ch] += q[ch] * k; + } + acc[3] += k; + } + } + if acc[3] > 0.0 { + out[i] = [acc[0] / acc[3], acc[1] / acc[3], acc[2] / acc[3], acc[3].min(1.0)]; + } + i += 1; + } + } + out + } +} diff --git a/crates/engine-core/Cargo.toml b/crates/engine-core/Cargo.toml index 97d49ede73..a0c7181e55 100644 --- a/crates/engine-core/Cargo.toml +++ b/crates/engine-core/Cargo.toml @@ -19,7 +19,7 @@ photocraft-geom = { workspace = true } photocraft-color = { workspace = true } craft-cms = { workspace = true } # PCTIP codec from craft-libs#1564; kept at the same shared revision as the workspace. -craft-pcraft-tip = { package = "craft-pcraft-format", git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } +craft-pcraft-tip = { package = "craft-pcraft-format", git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } photocraft-raster = { workspace = true } photocraft-doc = { workspace = true } photocraft-ops = { workspace = true } diff --git a/crates/engine-core/src/cmd/image_cmds.rs b/crates/engine-core/src/cmd/image_cmds.rs index 4a91a2c967..b2e11e3a14 100644 --- a/crates/engine-core/src/cmd/image_cmds.rs +++ b/crates/engine-core/src/cmd/image_cmds.rs @@ -812,7 +812,11 @@ fn unlock_background_for_crop(doc: &mut Document) { } fn crop_with(s: &mut Session, p: &Value, keep_background: bool) -> Result { - let delete = p.get("deleteCroppedPixels").and_then(Value::as_bool).unwrap_or(true); + let delete = match p.get("deleteCroppedPixels") { + None | Some(Value::Null) => true, + Some(Value::Bool(value)) => *value, + Some(value) => return Err(bad("image.crop", format!("`deleteCroppedPixels` must be true or false, not {value}"))), + }; // The Crop tool's Fill: Content-Aware Fill of what the crop uncovers (#3823). let content_aware = match p.get("contentAware") { None | Some(Value::Null) => false, diff --git a/crates/engine-core/src/cmd/layer_multi_cmds.rs b/crates/engine-core/src/cmd/layer_multi_cmds.rs index 7c88592d9b..e06fb798d0 100644 --- a/crates/engine-core/src/cmd/layer_multi_cmds.rs +++ b/crates/engine-core/src/cmd/layer_multi_cmds.rs @@ -157,7 +157,7 @@ pub fn specs() -> Vec { "Group from Layers…", &["Layer", "New"], None, - r##"{"layer":id?,"name":text?,"color":"none|red|orange|yellow|green|seafoam|blue|indigo|magenta|fuchsia|violet|gray"="none","mode":str="passThrough" (blend mode),"opacity":0..100=100 (percent)} (no layer: every selected layer; the new group starts collapsed)"##, + r##"{"layer":id?,"name":text?,"color":"none|red|orange|yellow|green|seafoam|blue|indigo|magenta|fuchsia|violet|gray"="none","mode":str="passThrough" (blend mode),"opacity":0..100=100 (percent)} (no layer: every selected layer; the new group starts expanded with one target and collapsed with multiple targets)"##, structure::can_group_from_layers, structure::group_from_layers ), @@ -192,3 +192,6 @@ mod group_from_layers_clipping_tests; #[cfg(test)] mod merge_layers_history_match_tests; + +#[cfg(test)] +mod group_from_layers_one_layer_expanded_tests; diff --git a/crates/engine-core/src/cmd/layer_multi_cmds/group_from_layers_one_layer_expanded_tests.rs b/crates/engine-core/src/cmd/layer_multi_cmds/group_from_layers_one_layer_expanded_tests.rs new file mode 100644 index 0000000000..31dfdb6cb0 --- /dev/null +++ b/crates/engine-core/src/cmd/layer_multi_cmds/group_from_layers_one_layer_expanded_tests.rs @@ -0,0 +1,104 @@ +use super::*; + +const GROUP_FROM_LAYERS: &str = "layer.new.groupFromLayers"; + +fn session() -> Session { + let mut s = crate::session(); + s.execute("file.new", json!({"width": 32, "height": 32})).unwrap(); + s +} + +fn create(s: &mut Session, command: &str, name: &str) -> LayerId { + let reply = s.execute(command, json!({"name": name})).unwrap(); + LayerId(reply["layer"].as_u64().unwrap()) +} + +fn inspect_layer(layers: &Value, id: LayerId) -> Option<&Value> { + layers.as_array()?.iter().find_map(|layer| if layer["id"] == id.0 { Some(layer) } else { inspect_layer(&layer["children"], id) }) +} + +fn assert_group(s: &mut Session, group: LayerId, expanded: bool, children: &[LayerId]) { + let state = s.execute("document.inspect", json!({})).unwrap(); + let inspected = inspect_layer(&state["layers"], group).expect("new group is in the layer tree"); + assert_eq!(inspected["expanded"], expanded); + let ids: Vec<_> = inspected["children"].as_array().unwrap().iter().rev().map(|layer| LayerId(layer["id"].as_u64().unwrap())).collect(); + assert_eq!(ids, children); +} + +#[test] +fn grouping_one_layer_or_group_starts_expanded_in_a_single_history_step() { + for command in ["layer.new.layer", "layer.new.group"] { + let mut s = session(); + let child = create(&mut s, command, "Child"); + let before = s.active().unwrap().history.past_len(); + let group = create(&mut s, GROUP_FROM_LAYERS, "Wrapper"); + assert_group(&mut s, group, true, &[child]); + assert_eq!(s.active().unwrap().history.past_len(), before + 1); + s.execute("edit.undo", json!({})).unwrap(); + let doc = &s.active().unwrap().doc; + assert!(doc.layer(group).is_none()); + assert!(doc.layers.iter().any(|layer| layer.id == child)); + } +} + +#[test] +fn grouping_one_nested_layer_starts_expanded_with_either_parent_lock_state() { + for locked in [false, true] { + let mut s = session(); + let child = create(&mut s, "layer.new.layer", "Child"); + let parent = create(&mut s, "layer.new.group", "Parent"); + s.execute("layer.moveTo", json!({"layer": child.0, "target": parent.0, "position": "into"})).unwrap(); + s.execute("layer.select", json!({"layer": parent.0})).unwrap(); + s.execute("layer.lockLayers", json!({"all": locked})).unwrap(); + s.execute("layer.select", json!({"layer": child.0})).unwrap(); + + let group = create(&mut s, GROUP_FROM_LAYERS, "Inner"); + assert_group(&mut s, group, true, &[child]); + let doc = &s.active().unwrap().doc; + assert_eq!(doc.layers.index().parent(group), Some(parent)); + assert_eq!(doc.layer(parent).unwrap().locks.all, locked); + s.execute("edit.undo", json!({})).unwrap(); + assert_eq!(s.active().unwrap().doc.layers.index().parent(child), Some(parent)); + } +} + +#[test] +fn a_multi_selection_starts_collapsed_and_an_explicit_target_starts_expanded() { + let mut s = session(); + let a = create(&mut s, "layer.new.layer", "A"); + let b = create(&mut s, "layer.new.layer", "B"); + s.execute("layer.select", json!({"layers": [a.0, b.0]})).unwrap(); + let group = create(&mut s, GROUP_FROM_LAYERS, "Pair"); + assert_group(&mut s, group, false, &[a, b]); + s.execute("edit.undo", json!({})).unwrap(); + + s.execute("layer.select", json!({"layers": [a.0, b.0]})).unwrap(); + let reply = s.execute(GROUP_FROM_LAYERS, json!({"layer": a.0})).unwrap(); + let explicit = LayerId(reply["layer"].as_u64().unwrap()); + assert_group(&mut s, explicit, true, &[a]); + + s.execute("layer.select", json!({"layers": [explicit.0, a.0]})).unwrap(); + let wrapper = create(&mut s, GROUP_FROM_LAYERS, "Ancestor and Child"); + assert_group(&mut s, wrapper, false, &[explicit]); +} + +#[test] +fn ordinary_group_layers_still_starts_collapsed_for_one_layer() { + let mut s = session(); + let child = create(&mut s, "layer.new.layer", "Child"); + let group = create(&mut s, "layer.groupLayers", "Wrapper"); + assert_group(&mut s, group, false, &[child]); +} + +#[test] +fn one_selected_base_starts_expanded_with_its_clipped_layer() { + let mut s = session(); + let base = create(&mut s, "layer.new.layer", "Base"); + let clipped = create(&mut s, "layer.new.layer", "Clipped"); + s.execute("layer.setProps", json!({"layer": clipped.0, "clipped": true})).unwrap(); + s.execute("layer.select", json!({"layer": base.0})).unwrap(); + + let group = create(&mut s, GROUP_FROM_LAYERS, "Wrapper"); + assert_group(&mut s, group, true, &[base, clipped]); + assert!(s.active().unwrap().doc.layer(clipped).unwrap().clipped); +} diff --git a/crates/engine-core/src/cmd/layer_multi_cmds/structure.rs b/crates/engine-core/src/cmd/layer_multi_cmds/structure.rs index 63ab05661f..ab63541aaa 100644 --- a/crates/engine-core/src/cmd/layer_multi_cmds/structure.rs +++ b/crates/engine-core/src/cmd/layer_multi_cmds/structure.rs @@ -122,9 +122,7 @@ pub(super) fn can_group_from_layers(s: &Session) -> std::result::Result<(), Stri Ok(()) } -/// Group from Layers: [`group_layers`], refused with the Background among the layers it would -/// move, also when the `layer` param names it (#14709). Group Layers (⌘G) is not measured and -/// keeps grouping it. +/// Group from Layers opens a group made from one target and refuses to group the Background (#14709). pub(super) fn group_from_layers(s: &mut Session, p: &Value) -> Result { let ids = match crate::commands::explicit_layer(s, p)? { Some(id) => vec![id], @@ -134,17 +132,21 @@ pub(super) fn group_from_layers(s: &mut Session, p: &Value) -> Result { if ids.iter().any(|id| doc.is_background(*id)) { return Err(EngineError::Other("the Background layer can't go into a group".into())); } - group_layers(s, p) + group_layers_with(s, p, &ids, ids.len() == 1) } -/// Group Layers (⌘G) / Group from Layers: the explicit layer, or every selected layer, moves -/// into a new, collapsed group placed where the top-most of them was. Bottom-to-top order is -/// preserved. The New Group dialog's colour, mode and opacity are set in the same history step. +/// Group Layers (⌘G) moves the explicit layer or the selection into a new, collapsed group. pub fn group_layers(s: &mut Session, p: &Value) -> Result { let ids = match crate::commands::explicit_layer(s, p)? { Some(id) => vec![id], None => selected(s), }; + group_layers_with(s, p, &ids, false) +} + +/// Creates the group at the topmost target, preserving layer order and applying the dialog's +/// options in the same history step. +fn group_layers_with(s: &mut Session, p: &Value, ids: &[LayerId], expanded: bool) -> Result { if ids.is_empty() { return Err(EngineError::Other("no layer selected".into())); } @@ -153,7 +155,7 @@ pub fn group_layers(s: &mut Session, p: &Value) -> Result { // A base takes the layers clipped to it into the group, still clipped, whether they were // selected or not; a clipped layer that goes in without its base is released, as in the // reference application (#14713). - let mut ids = top_level(doc, &ids); + let mut ids = top_level(doc, ids); let bases: Vec = ids.clone(); for id in bases { ids.extend(crate::clip_group::clipped_to(doc, id)); @@ -170,10 +172,9 @@ pub fn group_layers(s: &mut Session, p: &Value) -> Result { } let top = *ids.last().ok_or(EngineError::NoLayer(LayerId(0)))?; let name = opts.name.clone().unwrap_or_else(|| doc.next_layer_name("Group")); - // Photoshop creates the group collapsed, so the panel shows one row in place of the layers. let mut group = Layer::group(name, vec![]); if let LayerContent::Group(g) = &mut group.content { - g.expanded = false; + g.expanded = expanded; } let gid = doc.insert_above(Some(top), group); let mut children = Vec::with_capacity(ids.len()); diff --git a/crates/engine-core/src/cmd/table/core/queries.rs b/crates/engine-core/src/cmd/table/core/queries.rs index a78c98351f..713b6e69c2 100644 --- a/crates/engine-core/src/cmd/table/core/queries.rs +++ b/crates/engine-core/src/cmd/table/core/queries.rs @@ -109,7 +109,10 @@ pub fn specs() -> Vec { params: r##"{"x":i32,"y":i32}"##, enabled: has_doc, run: |s, p| { - let coord = |k: &str| i32::try_from(int(p, k).unwrap_or(0)).map_err(|_| bad("document.pixel", format!("{k} must fit in 32 bits"))); + let coord = |key: &str| { + let value = int(p, key).ok_or_else(|| bad("document.pixel", format!("{key} must be a number")))?; + i32::try_from(value).map_err(|_| bad("document.pixel", format!("{key} must fit in 32 bits"))) + }; let (x, y) = (coord("x")?, coord("y")?); let d = s.active().ok_or(EngineError::NoDocument)?; // At i32::MAX the 1x1 rect saturates to empty: a pixel that far out is transparent. diff --git a/crates/engine-core/src/registry.rs b/crates/engine-core/src/registry.rs index 54eaa3a5c0..165528188f 100644 --- a/crates/engine-core/src/registry.rs +++ b/crates/engine-core/src/registry.rs @@ -135,6 +135,13 @@ pub fn list_entry(s: &Session, c: &CommandSpec, reason: Option) -> Value /// say "RAW Develop" (#12403). pub(crate) const SEARCH_KEYWORDS: &[(&str, &str)] = &[ ("select.rect", "Rectangular Marquee, Elliptical Marquee (\"ellipse\":true), ellipse, oval, circle, Single Row/Column Marquee (\"line\")"), + ("image.imageRotation.180", "Rotate Canvas, Image Rotation"), + ("image.imageRotation.90cw", "Rotate Canvas, Image Rotation"), + ("image.imageRotation.90ccw", "Rotate Canvas, Image Rotation"), + ("edit.transform.rotate180", "Layer Rotation"), + ("edit.transform.rotate90Cw", "Layer Rotation"), + ("edit.transform.rotate90Ccw", "Layer Rotation"), + ("image.rotation.arbitrary", "Rotate Canvas, Image Rotation"), ("filter.cameraRaw", "Camera Raw Filter"), ("edit.preferences.rawDefaults", "Camera Raw Defaults"), ]; diff --git a/crates/engine-paint/src/cmd/fill_cmds.rs b/crates/engine-paint/src/cmd/fill_cmds.rs index d9ea1f6fbe..f92dee1c13 100644 --- a/crates/engine-paint/src/cmd/fill_cmds.rs +++ b/crates/engine-paint/src/cmd/fill_cmds.rs @@ -159,10 +159,16 @@ pub fn fill(s: &mut Session, p: &Value) -> Result { // Edit › Fill (#14975). let space = photocraft_compose::pattern::PatternSpace::of_pixels(&st.doc); let tile = photocraft_compose::pattern::Tile::new_in(&pat, space).ok_or_else(|| bad("the pattern is empty or too large to paint"))?; - // Photoshop's Fill uses the canvas origin. - let place = photocraft_compose::pattern::Placement::new(Rect::EMPTY, false, (0.0, 0.0), scale, angle); out["pattern"] = json!(pat.id); - Source::Pixels(area, photocraft_compose::pattern::render(&tile, &place, area)) + // With a script the pattern is laid out tile by tile instead of repeated. + if let Some(script) = script(p)? { + out["script"] = json!(script); + Source::Pixels(area, scripted(p, script, &tile, &pat, area)?) + } else { + // Photoshop's Fill uses the canvas origin. + let place = photocraft_compose::pattern::Placement::new(Rect::EMPTY, false, (0.0, 0.0), scale, angle); + Source::Pixels(area, photocraft_compose::pattern::render(&tile, &place, area)) + } } "history" => { // A History panel row `state` or a `snapshot`, else the History Brush's source. @@ -258,6 +264,43 @@ fn invert(surf: &mut photocraft_raster::Surface, area: Rect) -> Result<()> { Ok(()) } +/// The `script` param of a pattern fill: a [`SCRIPTS`](photocraft_compose::scripted_pattern::SCRIPTS) key, or none. +fn script(p: &Value) -> Result> { + use photocraft_compose::scripted_pattern::{SCRIPTS, script_key}; + match p.get("script") { + None | Some(Value::Null) => Ok(None), + Some(Value::String(name)) => { + let names = SCRIPTS.iter().map(|(k, _)| *k).collect::>().join("|"); + script_key(name).map(Some).ok_or_else(|| bad(format!("unknown script `{name}` ({names})"))) + } + Some(v) => Err(bad(format!("`script` must be a script name, not {v}"))), + } +} + +/// The scripted pattern `script` laid out over `area`, with its values from `p` (each clamped to its range, the factory +/// value when missing) and an optional whole-number `seed` for the per-tile randomness. +fn scripted(p: &Value, script: &str, tile: &photocraft_compose::pattern::Tile, pat: &photocraft_doc::pattern::Pattern, area: Rect) -> Result> { + use photocraft_compose::scripted_pattern::{BrickFill, Jitter, controls}; + let controls = + controls(script, pat.width, pat.height).ok_or_else(|| bad(format!("the `{script}` script is not supported yet; only brickFill paints today")))?; + let mut values = std::collections::HashMap::new(); + for c in &controls { + let v = match p.get(c.key) { + None | Some(Value::Null) => c.default, + Some(v) => v.as_f64().filter(|v| v.is_finite()).ok_or_else(|| bad(format!("`{}` must be a number {}..{}, not {v}", c.key, c.min, c.max)))?, + }; + values.insert(c.key, c.clamp(v)); + } + let seed = match p.get("seed") { + None | Some(Value::Null) => 1, + Some(v) => v.as_u64().ok_or_else(|| bad(format!("`seed` must be a whole number, not {v}")))?, + }; + let get = |k: &str| values.get(k).copied().unwrap_or_default(); + let jitter = Jitter { color: get("colorRandomness") as f32, brightness: get("brightnessRandomness") as f32, seed }; + let brick = BrickFill { scale: get("patternScale"), spacing: get("spacing"), offset: get("offsetBetweenRows"), angle: get("patternRotateAngle"), jitter }; + Ok(brick.render(tile, pat.width, pat.height, area)) +} + /// The reference application refuses Fill on the Quick Mask with a colour-only blend mode, Preserve Transparency or /// History contents, and leaves the channel as it was (#17489). fn check_quick_mask(contents: &str, mode: BlendMode, preserve: bool) -> Result<()> { diff --git a/crates/engine-paint/src/fill_script_brick_tests.rs b/crates/engine-paint/src/fill_script_brick_tests.rs new file mode 100644 index 0000000000..a541190710 --- /dev/null +++ b/crates/engine-paint/src/fill_script_brick_tests.rs @@ -0,0 +1,227 @@ +//! #17428: Edit › Fill › Pattern with Script on lays the pattern out tile by tile. `edit.fill` takes `script` and the +//! script's values; Brick Fill paints rows of whole tiles from the canvas origin with every second row shifted left by +//! the row offset (50 % of the tile width by default). An unknown script is an error, not a plain fill; the five +//! listed scripts without a layout yet answer "not supported". + +use serde_json::{Value, json}; + +use crate::Session; + +const RED: [u8; 3] = [255, 0, 0]; +const BLUE: [u8; 3] = [0, 0, 255]; +const GREEN: [u8; 3] = [0, 255, 0]; + +/// The probe tile: 40 x 30, left half red, right half blue, the bottom-right 20 x 15 quarter green, so a shift, a turn +/// and a mirror all show. Defined as "probe" from a `mode` / `depth` document. +fn define_probe(s: &mut Session, mode: &str, depth: u32) { + s.execute("file.new", json!({"width": 40, "height": 30, "mode": mode, "depth": depth, "background": "white"})).unwrap(); + for (rect, color) in [([0, 0, 20, 30], "#ff0000"), ([20, 0, 20, 15], "#0000ff"), ([20, 15, 20, 15], "#00ff00")] { + s.execute("select.rect", json!({"x": rect[0], "y": rect[1], "width": rect[2], "height": rect[3]})).unwrap(); + s.execute("edit.fill", json!({"contents": "color", "color": color})).unwrap(); + } + s.execute("edit.definePattern", json!({"name": "probe", "rect": [0, 0, 40, 30]})).unwrap(); +} + +/// A 600 x 400 white document of `mode` / `depth` with an empty pixel layer on top (active), the probe defined. +fn session_in(mode: &str, depth: u32) -> Session { + let mut s = crate::session(); + define_probe(&mut s, mode, depth); + s.execute("file.new", json!({"width": 600, "height": 400, "mode": mode, "depth": depth, "background": "white"})).unwrap(); + s.execute("layer.new.layer", json!({})).unwrap(); + s +} + +fn session() -> Session { + session_in("rgb", 8) +} + +/// Brick Fill with both randomness values at 0 and `extra` values on top. +fn brick(extra: Value) -> Value { + let mut p = json!({"contents": "pattern", "pattern": "probe", "script": "brickFill", "colorRandomness": 0, "brightnessRandomness": 0}); + for (k, v) in extra.as_object().into_iter().flatten() { + p[k] = v.clone(); + } + p +} + +fn pixel(s: &Session, x: i32, y: i32) -> [f32; 4] { + let st = s.active().unwrap(); + st.doc.layer(st.active_layer.unwrap()).unwrap().surface().unwrap().rgba(x, y) +} + +fn rgb8(px: [f32; 4]) -> [u8; 3] { + [0, 1, 2].map(|c| (px[c] * 255.0).round() as u8) +} + +/// The colour runs along row `y` from x 0 to 79 (two tile widths). +fn runs(s: &Session, y: i32) -> Vec<(i32, [u8; 3])> { + let mut out: Vec<(i32, [u8; 3])> = Vec::new(); + for x in 0..80 { + let c = rgb8(pixel(s, x, y)); + if out.last().is_none_or(|(_, last)| *last != c) { + out.push((x, c)); + } + } + out +} + +fn undo_label(s: &Session) -> Option { + s.active().unwrap().history.undo_label().map(str::to_string) +} + +#[test] +fn brick_fill_shifts_every_second_row_by_half_a_tile() { + let mut s = session(); + let r = s.execute("edit.fill", brick(json!({}))).unwrap(); + assert_eq!(r["script"], "brickFill"); + // Row 0 starts with the tile's left edge at x 0; row 1 (y 30-59) starts 20 px further left. + assert_eq!(runs(&s, 3), vec![(0, RED), (20, BLUE), (40, RED), (60, BLUE)]); + assert_eq!(runs(&s, 33), vec![(0, BLUE), (20, RED), (40, BLUE), (60, RED)]); + // The bottom quarter shows the shift too, and row 2 lines up with row 0 again. + assert_eq!(rgb8(pixel(&s, 5, 50)), GREEN); + assert_eq!(runs(&s, 63), runs(&s, 3)); + assert_eq!(undo_label(&s).as_deref(), Some("Fill")); +} + +#[test] +fn brick_fill_differs_from_the_plain_pattern_fill() { + let mut plain = session(); + plain.execute("edit.fill", json!({"contents": "pattern", "pattern": "probe"})).unwrap(); + let mut scripted = session(); + scripted.execute("edit.fill", brick(json!({}))).unwrap(); + assert_eq!(runs(&plain, 3), runs(&scripted, 3), "row 0 is the plain repeat"); + assert_ne!(runs(&plain, 33), runs(&scripted, 33), "row 1 is shifted only with the script"); +} + +#[test] +fn row_offset_spacing_and_scale_move_the_tiles() { + // No offset: every row lines up like the plain repeat. + let mut s = session(); + s.execute("edit.fill", brick(json!({"offsetBetweenRows": 0}))).unwrap(); + assert_eq!(runs(&s, 33), runs(&s, 3)); + // Spacing leaves transparent gaps between tiles, across and down. + let mut s = session(); + s.execute("edit.fill", brick(json!({"spacing": 10, "offsetBetweenRows": 0}))).unwrap(); + assert_eq!(pixel(&s, 45, 3)[3], 0.0, "gap after the first tile"); + assert!(pixel(&s, 55, 3)[3] > 0.99, "the second tile starts after the gap"); + assert_eq!(pixel(&s, 5, 35)[3], 0.0, "gap under the first row"); + // Half the scale halves the tile. + let mut s = session(); + s.execute("edit.fill", brick(json!({"patternScale": 0.5, "offsetBetweenRows": 0}))).unwrap(); + assert_eq!(rgb8(pixel(&s, 25, 3)), RED, "the second, half-size tile starts at x 20"); +} + +#[test] +fn a_turned_tile_is_no_longer_upright() { + let mut s = session(); + s.execute("edit.fill", brick(json!({"patternRotateAngle": 180}))).unwrap(); + // Turned half way, the tile's blue half comes first. + assert_eq!(rgb8(pixel(&s, 5, 20)), BLUE); +} + +#[test] +fn randomness_varies_tiles_only_above_zero() { + let mut exact = session(); + exact.execute("edit.fill", brick(json!({}))).unwrap(); + let mut drift = session(); + drift.execute("edit.fill", brick(json!({"colorRandomness": 0.5, "brightnessRandomness": 0.5}))).unwrap(); + // At 0 every tile keeps the pattern's colours. + for x in (5..600).step_by(40) { + assert_eq!(rgb8(pixel(&exact, x, 3)), RED, "x {x}"); + } + // Above 0 the tiles drift, each its own way, while one tile stays one colour. + let tiles: Vec<[u8; 3]> = (5..600).step_by(40).map(|x| rgb8(pixel(&drift, x, 3))).collect(); + assert!(tiles.iter().any(|c| *c != RED), "{tiles:?}"); + assert!(tiles.windows(2).any(|w| w[0] != w[1]), "tiles differ from each other: {tiles:?}"); + assert_eq!(rgb8(pixel(&drift, 5, 3)), rgb8(pixel(&drift, 15, 10)), "one tile drifts as a whole"); + // The factory values drift a little. + let mut default = session(); + let mut p = brick(json!({})); + p.as_object_mut().unwrap().retain(|k, _| !k.ends_with("Randomness")); + default.execute("edit.fill", p).unwrap(); + let tiles: Vec<[u8; 3]> = (5..600).step_by(40).map(|x| rgb8(pixel(&default, x, 3))).collect(); + assert!(tiles.iter().any(|c| *c != RED), "{tiles:?}"); +} + +#[test] +fn the_fill_stays_in_the_selection_with_mode_and_opacity() { + let mut s = session(); + s.execute("select.rect", json!({"x": 0, "y": 0, "width": 100, "height": 50})).unwrap(); + s.execute("edit.fill", brick(json!({"opacity": 50}))).unwrap(); + let inside = pixel(&s, 5, 3); + assert!((inside[3] - 0.5).abs() < 0.01, "half opacity: {inside:?}"); + assert_eq!(pixel(&s, 150, 3)[3], 0.0, "outside the selection"); + assert_eq!(pixel(&s, 5, 80)[3], 0.0, "below the selection"); + assert_eq!(undo_label(&s).as_deref(), Some("Fill")); + s.execute("edit.undo", json!({})).unwrap(); + assert_eq!(pixel(&s, 5, 3)[3], 0.0, "one history state"); +} + +#[test] +fn an_unknown_script_is_an_error_and_the_unbuilt_ones_are_unsupported() { + let mut s = session(); + let before = undo_label(&s); + let err = s.execute("edit.fill", brick(json!({"script": "noSuchScript"}))).unwrap_err().to_string(); + assert!(err.contains("unknown script"), "{err}"); + for script in ["crossWeave", "placeAlongPath", "randomFill", "spiral", "symmetryFill"] { + let err = s.execute("edit.fill", brick(json!({"script": script}))).unwrap_err().to_string(); + assert!(err.contains("not supported"), "{script}: {err}"); + } + assert_eq!(undo_label(&s), before, "nothing was filled"); + assert_eq!(pixel(&s, 5, 3)[3], 0.0); +} + +#[test] +fn bad_values_are_errors_and_out_of_range_ones_are_clamped() { + let mut s = session(); + for bad in [json!({"script": 3}), json!({"patternScale": "big"}), json!({"spacing": [1]}), json!({"seed": -1}), json!({"offsetBetweenRows": true})] { + assert!(s.execute("edit.fill", brick(bad.clone())).is_err(), "{bad}"); + } + // A huge scale paints at the 1.25 limit; a huge negative spacing at the overlap limit, without hanging. + let mut huge = session(); + huge.execute("edit.fill", brick(json!({"patternScale": 1e9, "offsetBetweenRows": 0}))).unwrap(); + let mut limit = session(); + limit.execute("edit.fill", brick(json!({"patternScale": 1.25, "offsetBetweenRows": 0}))).unwrap(); + assert_eq!(runs(&huge, 3), runs(&limit, 3)); + let mut s = session(); + s.execute("edit.fill", brick(json!({"spacing": -1e12, "patternRotateAngle": 45}))).unwrap(); +} + +#[test] +fn brick_fill_runs_in_every_mode_and_depth() { + for (mode, depth) in [("rgb", 8), ("rgb", 16), ("rgb", 32), ("cmyk", 8), ("lab", 8), ("gray", 8), ("gray", 16)] { + let mut s = session_in(mode, depth); + s.execute("edit.fill", brick(json!({}))).unwrap_or_else(|e| panic!("{mode}/{depth}: {e}")); + // Row 1's first pixel shows the tile's right half, row 0's its left half. + let (row0, row1) = (pixel(&s, 5, 3), pixel(&s, 5, 33)); + assert!(row0[3] > 0.99 && row1[3] > 0.99, "{mode}/{depth}: painted"); + assert_ne!(rgb8(row0), rgb8(row1), "{mode}/{depth}: row 1 is shifted"); + assert_eq!(undo_label(&s).as_deref(), Some("Fill"), "{mode}/{depth}"); + } +} + +#[test] +fn a_long_turned_tile_still_covers_pixels_far_from_its_centre() { + // A 4000 x 4 tile overlapping its neighbours by the most (2 px between rows) and turned 45°: about 2000 rows of + // tiles lie near each pixel, and the one that covers (1000, 200) has its centre 1000 px above it. + let mut s = crate::session(); + s.execute("file.new", json!({"width": 4000, "height": 4, "background": "white"})).unwrap(); + s.execute("edit.fill", json!({"contents": "color", "color": "#ff0000"})).unwrap(); + s.execute("edit.definePattern", json!({"name": "bar", "rect": [0, 0, 4000, 4]})).unwrap(); + s.execute("file.new", json!({"width": 1200, "height": 400, "background": "white"})).unwrap(); + s.execute("layer.new.layer", json!({})).unwrap(); + s.execute("select.rect", json!({"x": 995, "y": 195, "width": 10, "height": 10})).unwrap(); + let p = json!({"pattern": "bar", "spacing": -2, "offsetBetweenRows": 0, "patternRotateAngle": 45}); + s.execute("edit.fill", brick(p)).unwrap(); + let px = pixel(&s, 1000, 200); + assert!(px[3] > 0.99 && rgb8(px) == RED, "{px:?}"); +} + +#[test] +fn a_pixel_on_the_edge_of_a_scaled_tile_is_painted() { + // At scale 1.01249999 the tile is 40.5 px wide (at the placement's f32 precision a hair wider), so the centre of + // pixel 40 lies inside the first tile and must be painted, not left in the 1 px gap. + let mut s = session(); + s.execute("edit.fill", brick(json!({"patternScale": 1.012_499_99, "spacing": 1, "offsetBetweenRows": 0}))).unwrap(); + assert!(pixel(&s, 40, 5)[3] > 0.0, "{:?}", pixel(&s, 40, 5)); +} diff --git a/crates/engine-paint/src/lib.rs b/crates/engine-paint/src/lib.rs index 7c3836b859..21025b6ed9 100644 --- a/crates/engine-paint/src/lib.rs +++ b/crates/engine-paint/src/lib.rs @@ -46,6 +46,8 @@ mod eraser_gray_background_tests; #[cfg(test)] mod fill_quick_mask_refusals_tests; #[cfg(test)] +mod fill_script_brick_tests; +#[cfg(test)] mod mixer_indexed_bitmap_tests; #[cfg(test)] mod mixer_toggle_commands_tests; diff --git a/crates/ipp/Cargo.toml b/crates/ipp/Cargo.toml index 878ef424ff..e2d31c78a8 100644 --- a/crates/ipp/Cargo.toml +++ b/crates/ipp/Cargo.toml @@ -7,7 +7,7 @@ license.workspace = true rust-version.workspace = true [dependencies] -craft-ipp = { git = "https://github.com/storytold/craft-libs", rev = "6ffc396957f7b12ec8fae8bf9084f077384ad2b4" } +craft-ipp = { git = "https://github.com/storytold/craft-libs", rev = "4ed3d95b0f244b2b10d5f167183658f38f73594d" } [lints] workspace = true diff --git a/crates/ui-egui/src/app/prefs.rs b/crates/ui-egui/src/app/prefs.rs index cbc926f374..29f7cea9cb 100644 --- a/crates/ui-egui/src/app/prefs.rs +++ b/crates/ui-egui/src/app/prefs.rs @@ -91,5 +91,7 @@ impl PhotocraftApp { ctx.options_mut(|o| o.zoom_with_keyboard = false); // A pointer move that changes nothing under the pointer runs no frame (#17148). craft::ui::runtime::pointer::gate_pointer_moves(ctx); + // Moving a window changes nothing it shows, so a move runs no frame (#18000). + ctx.set_window_move_needs_pass(false); } } diff --git a/crates/ui-egui/src/canvas/document_display.rs b/crates/ui-egui/src/canvas/document_display.rs index 9f4ecf2d6f..a9864760aa 100644 --- a/crates/ui-egui/src/canvas/document_display.rs +++ b/crates/ui-egui/src/canvas/document_display.rs @@ -136,10 +136,10 @@ pub(crate) fn ants_shown(app: &PhotocraftApp, idx: usize) -> Option<(i32, i32)> Some(if active { super::tools::selection::shown_offset(app).unwrap_or((0, 0)) } else { (0, 0) }) } -/// Whether PhotoCraft's tool moves the view with the pointer this pass: the Crop tool in its default mode slides the -/// view under a fixed frame. The canvas then shows the view unaligned. -pub(crate) fn view_follows_pointer(app: &PhotocraftApp) -> bool { - crate::crop_ui::moves_view(app) +/// Whether PhotoCraft's tool moves the view of document `idx` with the pointer this pass: the Crop tool in its default +/// mode slides the active document's view under a fixed frame. The canvas then shows the view unaligned. +pub(crate) fn view_follows_pointer(app: &PhotocraftApp, idx: usize) -> bool { + crate::crop_ui::moves_view(app) && app.session.active_index() == Some(idx) } /// The user's navigation choices from Preferences (General, Tools, Enhanced Controls). @@ -285,7 +285,7 @@ pub(crate) fn show(app: &mut PhotocraftApp, ui: &mut egui::Ui, view: &mut View, } let label = super::tabs::tab_title_at(app, idx, view.zoom * 100.0); let navigation = navigation(app); - let follows_pointer = view_follows_pointer(app); + let follows_pointer = view_follows_pointer(app, idx); let checker = checkerboard(app); let snap = super::snap_ui::snap(app, idx); let target = view_target(app, idx); @@ -412,9 +412,11 @@ pub(crate) fn show(app: &mut PhotocraftApp, ui: &mut egui::Ui, view: &mut View, .flatten(); let overlay = OverlayPrep::new(app, ctx, idx, output, live.as_ref()); // The canvas edge isn't outlined while the pixels past it show (Photoshop's crop preview), nor while the Crop - // tool hides everything outside its box (Show Cropped Area off). - let edge = border == PageBorder::Line && !crate::crop_ui::shows_beyond_canvas(app) && !crate::crop_ui::hides_canvas_edge(app); - let region = crate::crop_ui::shows_beyond_canvas(app).then(|| crate::crop_ui::frame(app)).flatten().map(|frame| { + // tool hides everything outside its box (Show Cropped Area off). Both belong to the active document's frame. + let cropped = app.session.active_index() == Some(idx); + let beyond = cropped && crate::crop_ui::shows_beyond_canvas(app); + let edge = border == PageBorder::Line && !beyond && !(cropped && crate::crop_ui::hides_canvas_edge(app)); + let region = beyond.then(|| crate::crop_ui::frame(app)).flatten().map(|frame| { let r = frame.turned_bounds(); PixelRect::new(r.x0.floor() as i32, r.y0.floor() as i32, r.x1.ceil() as i32, r.y1.ceil() as i32) }); @@ -564,7 +566,8 @@ fn canvas_controls( crate::symmetry_ui::canvas_controls(ui, app, rect); crate::perspective_crop_ui::body(app, ui, rect); crate::analysis::canvas::body(app, ui, rect); - if primary { + // The frame is the active document's: another document on screen shows none (#18368). + if primary && app.session.active_index() == Some(host.idx) { reported.crop = super::tools::crop::show_frame(app, ui, rect); } // The scroll bars (Standard Screen Mode only) and the rotation compass change the view they are bound to. They are diff --git a/crates/ui-egui/src/canvas/paint_tool.rs b/crates/ui-egui/src/canvas/paint_tool.rs index d3ce9b3552..0d7ba055f5 100644 --- a/crates/ui-egui/src/canvas/paint_tool.rs +++ b/crates/ui-egui/src/canvas/paint_tool.rs @@ -373,7 +373,7 @@ impl CanvasTool for PaintTool<'_> { scope.with_app(|app| { crate::brush_cursor::sync_tip(app); // The readout request lasts one pass: a pass without pointer input repeats it. - app.brush_resize.hud(cx); + app.brush_resize.hud(app, cx); let Some(stroke) = state.stroke.as_ref() else { return }; let stale_mixer = stroke.tool == Tool::MixerBrush && app.live_stroke.is_some() && app.session.active_index().is_none_or(|idx| live_stroke(app, idx).is_none()); diff --git a/crates/ui-egui/src/canvas/pixel_alignment_tests.rs b/crates/ui-egui/src/canvas/pixel_alignment_tests.rs index 0b17186498..42d70879c1 100644 --- a/crates/ui-egui/src/canvas/pixel_alignment_tests.rs +++ b/crates/ui-egui/src/canvas/pixel_alignment_tests.rs @@ -24,7 +24,7 @@ fn crop_image_movement_keeps_its_continuous_camera_mapping() { for ppp in [1.0, 1.5] { for classic in [false, true] { app.ui.tool_options.crop.shield.classic_mode = classic; - assert_eq!(super::document_display::view_follows_pointer(&app), !classic, "only Default Crop moves the view with the pointer"); + assert_eq!(super::document_display::view_follows_pointer(&app, 0), !classic, "only Default Crop moves the view with the pointer"); ctx.set_pixels_per_point(ppp); let screen = Rect::from_min_size(Pos2::ZERO, vec2(700.0, 600.0)); let rect = Rect::from_min_size(pos2(40.0, 100.0), vec2(523.0, 471.0)); diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index 65f2f26e94..bb961cd65f 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -1191,3 +1191,61 @@ mod gpu_tests { assert_eq!(texture_key(canvas_display(&app, &doc, Some(1)).0.as_deref(), &doc), texture_key(canvas_display(&app, &doc, Some(4)).0.as_deref(), &doc)); } } + +/// #18368: the Crop frame belongs to the active document. Another document on screen beside it (a floating window, a +/// tiled pane) shows none, so a drag on it where the active frame's corner would land leaves the frame alone; the same +/// drag on the active document's canvas resizes the frame. +#[test] +fn a_drag_on_another_documents_canvas_leaves_the_crop_frame_alone() { + let mut app = PhotocraftApp::new(photocraft_engine::Session::new(), crate::Services::default()); + app.run("file.new", json!({"width": 400, "height": 300, "name": "other"})).unwrap(); + app.run("file.new", json!({"width": 400, "height": 300, "name": "cropped"})).unwrap(); + app.sync_views(); + app.ui.tool = Tool::Crop; + assert_eq!(app.session.active_index(), Some(1)); + for view in &mut app.ui.views { + view.zoom = 1.0; + view.center = [200.0, 150.0]; + view.clear_pending(); + } + // Both documents show at 100 %, side by side: the same document point lies at the same place in each canvas. + let other = Rect::from_min_size(pos2(20.0, 20.0), vec2(440.0, 340.0)); + let cropped = other.translate(vec2(480.0, 0.0)); + let mut h = egui_kittest::Harness::builder().with_size(vec2(960.0, 400.0)).with_context(app.ctx().clone()).build_ui_state( + move |ui, app: &mut Box| { + egui::CentralPanel::default().frame(egui::Frame::NONE).show(ui, |ui| { + for (idx, rect) in [(1, cropped), (0, other)] { + let view = app.ui.views[idx].clone(); + canvas_view(app, ui, CanvasHost::main(idx), rect, view, idx == 1); + } + }); + }, + app, + ); + h.run_steps(4); + let frame = h.state().canvas_tools.crop.tool.frame().expect("the active document shows the Crop frame"); + // The frame's bottom-right corner on the active document's canvas, and where it would land on the other one. + let corner = |canvas: Rect| canvas.center() + vec2(frame.rect.x1 as f32 - 200.0, frame.rect.y1 as f32 - 150.0); + fn drag(h: &mut egui_kittest::Harness<'_, Box>, from: Pos2) { + let to = from - vec2(120.0, 90.0); + h.hover_at(from); + h.run_steps(2); + h.drag_at(from); + h.run_steps(1); + for step in [0.25_f32, 0.5, 1.0] { + h.hover_at(from + (to - from) * step); + h.run_steps(1); + } + h.event(egui::Event::PointerButton { pos: to, button: egui::PointerButton::Primary, pressed: false, modifiers: egui::Modifiers::NONE }); + h.run_steps(2); + } + + drag(&mut h, corner(other)); + let tool = &h.state().canvas_tools.crop.tool; + assert_eq!(tool.frame(), Some(frame), "a drag on another document's canvas leaves the active document's frame alone"); + assert!(!tool.modified(), "a drag on another document's canvas starts no crop edit"); + + drag(&mut h, corner(cropped)); + let after = h.state().canvas_tools.crop.tool.frame().expect("the frame stays"); + assert!(after.rect.width() < frame.rect.width(), "the same drag on the active document's canvas resizes its frame: {after:?}"); +} diff --git a/crates/ui-egui/src/canvas/tools/mod.rs b/crates/ui-egui/src/canvas/tools/mod.rs index 7d8c6ba2ec..e678f7cb29 100644 --- a/crates/ui-egui/src/canvas/tools/mod.rs +++ b/crates/ui-egui/src/canvas/tools/mod.rs @@ -514,10 +514,12 @@ fn with_rig( ) -> R { let tool = app.ui.tool; let fam = family(tool); - // Tools that own state the app lends nobody are built before the scope takes the app. - let crop_run = (fam == Family::Crop).then(|| crate::crop_ui::CropRun::of(app)).flatten(); - let mut crop_tool = crop_run.as_ref().map(|_| std::mem::take(&mut tools.crop.tool)); let in_gesture = ToolHost::in_gesture(ctx, host.canvas_id()); + // Tools that own state the app lends nobody are built before the scope takes the app. The Crop tool edits the active + // document's frame, so only that document's canvas runs it (#18368); a gesture keeps it to its cancel. + let crops_here = app.session.active_index() == Some(host.idx) || in_gesture; + let crop_run = (fam == Family::Crop && crops_here).then(|| crate::crop_ui::CropRun::of(app)).flatten(); + let mut crop_tool = crop_run.as_ref().map(|_| std::mem::take(&mut tools.crop.tool)); if in_gesture && tools.gesture_pick == GesturePick::Dialog { dialog::end_if_disarmed(app, &mut tools.dialog, host); } diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 057910f752..ed0d8058f9 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -40,8 +40,8 @@ pub(crate) mod params { use super::{ PhotocraftApp, alerts, brush_preset_dialog, canvas_input, channel_options_ui, color_picker_ui, color_table_ui, contact_sheet_ui, count_group_name_ui, - duplicate_layer_ui, equalize_ui, file_forms, fill_ui, filter_dialog, history_options_ui, image_processor_ui, merge_channels_ui, new_group_ui, - new_layer_ui, paragraph_text_size, smart_filter_dialog, snapshot_dialog, stack_dialog, stroke_ui, + duplicate_layer_ui, equalize_ui, file_forms, fill_script_ui, fill_ui, filter_dialog, history_options_ui, image_processor_ui, merge_channels_ui, + new_group_ui, new_layer_ui, paragraph_text_size, smart_filter_dialog, snapshot_dialog, stack_dialog, stroke_ui, }; use crate::canvas::document_display::CanvasHost; @@ -95,6 +95,7 @@ pub(crate) mod params { /// Every family of parameter dialogs, first match wins; the generic filter family owns what is left. pub(crate) const PARAM_FAMILIES: &[ParamFamily] = &[ ParamFamily { check: Some(fill_ui::check), ..ParamFamily::new(fill_ui::owns, fill_ui::run) }, + ParamFamily { check: Some(fill_ui::check), footer: Some(fill_script_ui::footer), ..ParamFamily::new(fill_script_ui::owns, fill_script_ui::run) }, ParamFamily { check: Some(stroke_ui::check), ..ParamFamily::new(stroke_ui::owns, stroke_ui::run) }, ParamFamily { check: Some(smart_filter_dialog::check), @@ -511,6 +512,7 @@ pub(crate) const TAKERS: &[fn(&mut PhotocraftApp, &egui::Context)] = &[ file_ui::take, format_prompts::take, pattern_fill_ui::take, + fill_script_ui::take, crate::workspace_ui::take, crate::kys_import::take, crate::prefs_ui::take_presets, @@ -834,6 +836,7 @@ pub mod export_dialog; pub(crate) mod fade_modes; pub mod file_forms; pub mod file_ui; +pub mod fill_script_ui; pub mod fill_ui; pub mod filter_dialog; pub(super) mod filter_preview_ui; diff --git a/crates/ui-egui/src/dialogs/fill_script_ui.rs b/crates/ui-egui/src/dialogs/fill_script_ui.rs new file mode 100644 index 0000000000..4d042d0eff --- /dev/null +++ b/crates/ui-egui/src/dialogs/fill_script_ui.rs @@ -0,0 +1,275 @@ +//! The script dialog of Edit › Fill › Pattern with Script on (#17428): OK in Fill opens the chosen script's own dialog, +//! titled with the script's name. Every script shares one layout: a live preview of the current values with the chosen +//! pattern, a Preset row (Default, Load / Save / Delete greyed, Custom), a field and slider per value, and OK, Reset and +//! Cancel. Reset restores the values the dialog opened with; Preset › Default sets the factory values, and changing a +//! value turns Preset back to Custom. The values are remembered per script after OK. Cancel fills nothing. + +use craft::ui::contract::Bind; +use craft::ui::dialog::{DialogId, StackDialog}; +use craft::ui::patterns::form_dialogs::{DialogFields, FieldValue, HostedParamDialog, Param, ParamDialog, ParamKind, ParamResult, PreviewState}; +use craft::ui::runtime::env::Label; +use craft::ui::runtime::memory::{MemoryStage, SaveKey}; +use craft::ui::sections::{DialogRole, FooterButton}; +use craft::ui::value_drag::SliderScale; +use photocraft_compose::scripted_pattern::{BrickFill, Control, Jitter, SCRIPTS, controls}; +use serde_json::{Map, Value, json}; + +use crate::PhotocraftApp; +use crate::dialogs::params::{captured, memory_scope, open_param}; + +/// The dialog key of a script is this prefix and the script's parameter value (`edit.fill.script.brickFill`). +const PREFIX: &str = "edit.fill.script."; + +/// The side of the preview's sample area, in pattern pixels. +const PREVIEW: u32 = 256; + +/// The Preset entries: (value, label). Load, Save and Delete are listed greyed until presets can be filed. +const PRESETS: [(&str, &str); 5] = + [("default", "Default"), ("load", "Load Preset..."), ("save", "Save Preset..."), ("delete", "Delete Preset..."), ("custom", "Custom")]; + +/// The dialog key of `script`. +pub(crate) fn key(script: &str) -> String { + format!("{PREFIX}{script}") +} + +/// Whether the dialog `key` is a script dialog. +pub(crate) fn owns(key: &str) -> bool { + key.starts_with(PREFIX) +} + +fn script_of(key: &str) -> &str { + key.strip_prefix(PREFIX).unwrap_or_default() +} + +/// The label of a script value. +fn label(key: &str) -> Label { + Label::from(match key { + "patternScale" => tl!("Pattern Scale"), + "spacing" => tl!("Spacing"), + "offsetBetweenRows" => tl!("Offset between rows"), + "colorRandomness" => tl!("Color randomness"), + "brightnessRandomness" => tl!("Brightness randomness"), + "patternRotateAngle" => tl!("Pattern rotate angle"), + _ => tl!("Value"), + }) +} + +/// The unit shown after a value's field, if any. +fn unit(key: &str) -> Option