From 9e78da6b262972015af09f6268888d53183ee28d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 11:40:02 -0800 Subject: [PATCH 01/12] Dependencies: take craft-libs main at 3af718585c Every craft-libs dependency and patch in Cargo.toml now uses one revision, craft-libs main at 3af718585c60d8e9bab05c241d7a28282c61f85c. Cargo.lock changes only craft-libs packages. The newer crates need these changes: - craft-xml is at one revision, so the craft-xml-dtd alias is removed and the DTD adapter uses craft_xml::dtd. - craft-svg's gradient paint carries its stops and its pattern paint carries its tile. Paste uses the first stop's color as before, and skips embedded image nodes, which the scene still counts for the paste warning. - craft_svg::sniff::viewbox_size came from a craft-libs commit that is not in main. The IDML importer keeps the same bounded viewBox sizing as a local function and no longer depends on craft-svg. - craft-svg's Limits has tree_depth, the depth after references such as are followed. Images set it to MAX_SVG_DEPTH, and a test checks that a long chain is refused. - craft-ui adds the flyout width and top layout actions, which the iconic dock sends when a flyout's side or top edge is dragged. window.panel.layout rejected every action it did not list, so both are now checked like the other per-panel actions. A test checks that they are kept for a registered panel and refused for an unknown one. --- Cargo.lock | 574 +++++----------------- Cargo.toml | 73 ++- crates/engine/Cargo.toml | 1 - crates/engine/src/cmd/paste_svg.rs | 10 +- crates/engine/src/dtd.rs | 2 +- crates/idml/Cargo.toml | 1 - crates/idml/src/import/item.rs | 30 +- crates/images/src/lib.rs | 1 + crates/images/src/tests.rs | 21 + crates/ui-egui/src/panel_docking.rs | 2 + crates/ui-egui/src/panel_docking/tests.rs | 19 + 11 files changed, 227 insertions(+), 507 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7f96b25db..bfea7f2e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1083,7 +1083,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "rustix 1.1.5", ] @@ -1091,12 +1091,12 @@ dependencies = [ [[package]] name = "craft-cfb" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484#7ad4765ee55496d0ccdb7659ad7a6375c7bbb484" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "md-5", "rayon", @@ -1105,28 +1105,31 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701#bfea7d9800a9f14e496209f9df30e9ef45655701" - -[[package]] -name = "craft-codepage" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f0f4758c01581d79577b9bf5046c06f4e77b1f18#f0f4758c01581d79577b9bf5046c06f4e77b1f18" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" [[package]] name = "craft-csv" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=387c64892b30fdad491b263cc3d9eac660d88dcc#387c64892b30fdad491b263cc3d9eac660d88dcc" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "craft-dds" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +dependencies = [ + "rayon", +] + [[package]] name = "craft-designcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b1b4602a71d19e09ad33f7752a10d6598cf39b2b#b1b4602a71d19e09ad33f7752a10d6598cf39b2b" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "craft-document-bundle", - "craft-eps 0.1.0 (git+https://github.com/storytold/craft-libs?rev=b1b4602a71d19e09ad33f7752a10d6598cf39b2b)", + "craft-eps", "serde", "serde_json", "thiserror 2.0.21", @@ -1135,7 +1138,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=1a11a4897865f7410c40d25ca6e452ce399a1a2c#1a11a4897865f7410c40d25ca6e452ce399a1a2c" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "block2 0.6.2", "objc2 0.6.5", @@ -1148,14 +1151,14 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" [[package]] name = "craft-document-bundle" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b1b4602a71d19e09ad33f7752a10d6598cf39b2b#b1b4602a71d19e09ad33f7752a10d6598cf39b2b" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ - "craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=b1b4602a71d19e09ad33f7752a10d6598cf39b2b)", + "craft-zip", "serde_json", "thiserror 2.0.21", "zip 9.1.1", @@ -1164,16 +1167,16 @@ dependencies = [ [[package]] name = "craft-docx" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484#7ad4765ee55496d0ccdb7659ad7a6375c7bbb484" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "base64 0.23.1", "chrono", - "craft-drawingml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484)", + "craft-drawingml", "craft-math", "craft-offcrypto", - "craft-opc 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484)", + "craft-opc", "craft-wordmodel", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484)", + "craft-xml", "log", "quick-xml 0.41.0", "thiserror 2.0.21", @@ -1184,31 +1187,9 @@ dependencies = [ [[package]] name = "craft-drawingml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2b9a325f57624804ed423aded16695eddb815119#2b9a325f57624804ed423aded16695eddb815119" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=2b9a325f57624804ed423aded16695eddb815119)", - "kurbo", - "log", - "serde", -] - -[[package]] -name = "craft-drawingml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484#7ad4765ee55496d0ccdb7659ad7a6375c7bbb484" -dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484)", - "kurbo", - "log", - "serde", -] - -[[package]] -name = "craft-drawingml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f6cab1980#f6cab1980bbe422cc00c4b19d9f0f9ba337e1316" -dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=f6cab1980)", + "craft-xml", "kurbo", "log", "serde", @@ -1217,37 +1198,27 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b1b4602a71d19e09ad33f7752a10d6598cf39b2b#b1b4602a71d19e09ad33f7752a10d6598cf39b2b" - -[[package]] -name = "craft-eps" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf#6d0b33c0cd63ae4250c180a04eb4a4d66ab81448" - -[[package]] -name = "craft-eps" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=eed3c28cf016723d004d6f2c79c61424c15d4558#eed3c28cf016723d004d6f2c79c61424c15d4558" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" [[package]] name = "craft-epub" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf#6d0b33c0cd63ae4250c180a04eb4a4d66ab81448" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf)", - "craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf)", + "craft-xml", + "craft-zip", "thiserror 2.0.21", ] [[package]] name = "craft-file-formats" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=eed3c28cf016723d004d6f2c79c61424c15d4558#eed3c28cf016723d004d6f2c79c61424c15d4558" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ - "craft-eps 0.1.0 (git+https://github.com/storytold/craft-libs?rev=eed3c28cf016723d004d6f2c79c61424c15d4558)", - "craft-idml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=eed3c28cf016723d004d6f2c79c61424c15d4558)", - "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=eed3c28cf016723d004d6f2c79c61424c15d4558)", - "craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=eed3c28cf016723d004d6f2c79c61424c15d4558)", + "craft-eps", + "craft-idml", + "craft-svg", + "craft-zip", "serde", "serde_json", ] @@ -1255,12 +1226,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "fixed_decimal", "icu_decimal", @@ -1283,100 +1254,27 @@ dependencies = [ [[package]] name = "craft-idml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2#899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2)", - "craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2)", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-idml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=eed3c28cf016723d004d6f2c79c61424c15d4558#eed3c28cf016723d004d6f2c79c61424c15d4558" -dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=eed3c28cf016723d004d6f2c79c61424c15d4558)", - "craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=eed3c28cf016723d004d6f2c79c61424c15d4558)", + "craft-xml", + "craft-zip", "thiserror 2.0.21", ] [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ - "craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813)", - "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813)", - "exr", - "flate2", - "half", - "image", - "image-webp", - "jpeg-encoder", - "png", - "rayon", - "serde_json", - "thiserror 2.0.21", - "tiff", - "zune-core", - "zune-jpeg", - "zune-jpegxl", -] - -[[package]] -name = "craft-image-codecs" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701#bfea7d9800a9f14e496209f9df30e9ef45655701" -dependencies = [ - "craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701)", - "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701)", - "exr", - "flate2", - "half", - "image", - "image-webp", - "jpeg-encoder", - "png", - "rayon", - "serde_json", - "thiserror 2.0.21", - "tiff", - "zune-core", - "zune-jpeg", - "zune-jpegxl", -] - -[[package]] -name = "craft-image-codecs" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=cc23ffd4d26f3074808e2187d332564817624f8f#cc23ffd4d26f3074808e2187d332564817624f8f" -dependencies = [ - "craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=cc23ffd4d26f3074808e2187d332564817624f8f)", - "exr", - "flate2", - "half", - "image", - "image-webp", - "jpeg-encoder", - "png", - "rayon", - "serde_json", - "thiserror 2.0.21", - "tiff", - "zune-core", - "zune-jpeg", - "zune-jpegxl", -] - -[[package]] -name = "craft-image-codecs" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=eed3c28cf016723d004d6f2c79c61424c15d4558#eed3c28cf016723d004d6f2c79c61424c15d4558" -dependencies = [ - "craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=eed3c28cf016723d004d6f2c79c61424c15d4558)", + "craft-dds", + "craft-jpeg", + "craft-metadata", + "craft-tiff", + "crc32fast", "exr", "flate2", "half", + "hayro-jpeg2000", "image", "image-webp", "jpeg-encoder", @@ -1393,7 +1291,7 @@ dependencies = [ [[package]] name = "craft-indd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=47bf5650b0d503b97bfb5e841746c4957897d11f#47bf5650b0d503b97bfb5e841746c4957897d11f" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "indd", ] @@ -1401,31 +1299,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813" -dependencies = [ - "thiserror 2.0.21", -] - -[[package]] -name = "craft-jpeg" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701#bfea7d9800a9f14e496209f9df30e9ef45655701" -dependencies = [ - "thiserror 2.0.21", -] - -[[package]] -name = "craft-jpeg" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=cc23ffd4d26f3074808e2187d332564817624f8f#cc23ffd4d26f3074808e2187d332564817624f8f" -dependencies = [ - "thiserror 2.0.21", -] - -[[package]] -name = "craft-jpeg" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=eed3c28cf016723d004d6f2c79c61424c15d4558#eed3c28cf016723d004d6f2c79c61424c15d4558" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "thiserror 2.0.21", ] @@ -1433,7 +1307,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "craft-i18n", "craft-ui", @@ -1445,32 +1319,20 @@ dependencies = [ [[package]] name = "craft-math" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484#7ad4765ee55496d0ccdb7659ad7a6375c7bbb484" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484)", + "craft-xml", "serde", ] [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "brotli-decompressor 6.3.1", "chrono", - "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813)", - "quick-xml 0.41.0", - "serde", -] - -[[package]] -name = "craft-metadata" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701#bfea7d9800a9f14e496209f9df30e9ef45655701" -dependencies = [ - "brotli-decompressor 6.3.1", - "chrono", - "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701)", + "craft-tiff", "quick-xml 0.41.0", "serde", ] @@ -1478,22 +1340,22 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f0f4758c01581d79577b9bf5046c06f4e77b1f18#f0f4758c01581d79577b9bf5046c06f4e77b1f18" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "chrono", - "craft-codepage 0.1.0 (git+https://github.com/storytold/craft-libs?rev=f0f4758c01581d79577b9bf5046c06f4e77b1f18)", + "craft-codepage", "encoding_rs", ] [[package]] name = "craft-offcrypto" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484#7ad4765ee55496d0ccdb7659ad7a6375c7bbb484" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "aes", "base64 0.23.1", "craft-cfb", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484)", + "craft-xml", "getrandom 0.3.4", "hmac", "sha1 0.11.0", @@ -1505,43 +1367,10 @@ dependencies = [ [[package]] name = "craft-opc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2b9a325f57624804ed423aded16695eddb815119#2b9a325f57624804ed423aded16695eddb815119" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=2b9a325f57624804ed423aded16695eddb815119)", - "craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=2b9a325f57624804ed423aded16695eddb815119)", - "log", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-opc" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484#7ad4765ee55496d0ccdb7659ad7a6375c7bbb484" -dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484)", - "craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484)", - "log", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-opc" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551#8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551" -dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551)", - "craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551)", - "log", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-opc" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f6cab1980#f6cab1980bbe422cc00c4b19d9f0f9ba337e1316" -dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=f6cab1980)", - "craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=f6cab1980)", + "craft-xml", + "craft-zip", "log", "thiserror 2.0.21", ] @@ -1549,10 +1378,10 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "bytemuck", - "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813)", + "craft-svg", "hayro", "hayro-interpret", "hayro-syntax", @@ -1565,11 +1394,11 @@ dependencies = [ [[package]] name = "craft-pptx" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f6cab1980#f6cab1980bbe422cc00c4b19d9f0f9ba337e1316" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ - "craft-drawingml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=f6cab1980)", - "craft-opc 0.1.0 (git+https://github.com/storytold/craft-libs?rev=f6cab1980)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=f6cab1980)", + "craft-drawingml", + "craft-opc", + "craft-xml", "kurbo", "log", "serde", @@ -1580,7 +1409,7 @@ dependencies = [ [[package]] name = "craft-prepress" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "craft-cms", "craft-pdf", @@ -1593,9 +1422,10 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "craft-winprint-gdi", + "log", "miniz_oxide 0.9.1", "roxmltree 0.21.2", "tempfile", @@ -1606,7 +1436,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=d15bf1f35b17b759870f9e5111b9a5d243f64888#d15bf1f35b17b759870f9e5111b9a5d243f64888" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "encoding_rs", "flate2", @@ -1617,26 +1447,29 @@ dependencies = [ [[package]] name = "craft-rtf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701#bfea7d9800a9f14e496209f9df30e9ef45655701" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ - "craft-codepage 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701)", + "craft-codepage", "encoding_rs", ] [[package]] name = "craft-sheet" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2b9a325f57624804ed423aded16695eddb815119#2b9a325f57624804ed423aded16695eddb815119" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813)", + "craft-image-codecs", + "craft-xml", + "data-url", "flate2", "kurbo", + "quick-xml 0.41.0", + "resvg 0.48.1", "roxmltree 0.21.2", "thiserror 2.0.21", "usvg 0.48.1", @@ -1644,47 +1477,10 @@ dependencies = [ "vectorcraft-pathops", ] -[[package]] -name = "craft-svg" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=cc23ffd4d26f3074808e2187d332564817624f8f#cc23ffd4d26f3074808e2187d332564817624f8f" -dependencies = [ - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=cc23ffd4d26f3074808e2187d332564817624f8f)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=cc23ffd4d26f3074808e2187d332564817624f8f)", - "flate2", - "kurbo", - "resvg 0.48.1", - "roxmltree 0.21.2", - "thiserror 2.0.21", - "usvg 0.48.1", -] - -[[package]] -name = "craft-svg" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=eed3c28cf016723d004d6f2c79c61424c15d4558#eed3c28cf016723d004d6f2c79c61424c15d4558" -dependencies = [ - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=eed3c28cf016723d004d6f2c79c61424c15d4558)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=eed3c28cf016723d004d6f2c79c61424c15d4558)", - "flate2", - "kurbo", - "roxmltree 0.21.2", - "thiserror 2.0.21", -] - [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813" -dependencies = [ - "serde", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-tiff" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701#bfea7d9800a9f14e496209f9df30e9ef45655701" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "serde", "thiserror 2.0.21", @@ -1693,7 +1489,7 @@ dependencies = [ [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "craft-fonts-build", "craft-i18n", @@ -1714,7 +1510,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=e98299546f5c5c3c22388d16507f8b5e61a5f280#e98299546f5c5c3c22388d16507f8b5e61a5f280" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "chrono", "dunce", @@ -1741,7 +1537,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "egui", "objc2 0.6.5", @@ -1752,7 +1548,7 @@ dependencies = [ [[package]] name = "craft-winprint-gdi" version = "0.1.0" -source = "git+https://github.com/storytold/winprint.rs?rev=417ac3c4d14d3da5485a99c7d5ce8f05664ec312#417ac3c4d14d3da5485a99c7d5ce8f05664ec312" +source = "git+https://github.com/storytold/winprint.rs?rev=64e7afd4d1483512385012c340ecaaaf0f3beb7f#64e7afd4d1483512385012c340ecaaaf0f3beb7f" dependencies = [ "windows-sys 0.61.2", ] @@ -1760,7 +1556,7 @@ dependencies = [ [[package]] name = "craft-wordmodel" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484#7ad4765ee55496d0ccdb7659ad7a6375c7bbb484" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "base64 0.23.1", "craft-math", @@ -1774,172 +1570,29 @@ dependencies = [ [[package]] name = "craft-xlsx" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2b9a325f57624804ed423aded16695eddb815119#2b9a325f57624804ed423aded16695eddb815119" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ - "craft-drawingml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=2b9a325f57624804ed423aded16695eddb815119)", - "craft-opc 0.1.0 (git+https://github.com/storytold/craft-libs?rev=2b9a325f57624804ed423aded16695eddb815119)", + "craft-drawingml", + "craft-opc", "craft-sheet", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=2b9a325f57624804ed423aded16695eddb815119)", + "craft-xml", "thiserror 2.0.21", ] [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2b9a325f57624804ed423aded16695eddb815119#2b9a325f57624804ed423aded16695eddb815119" -dependencies = [ - "quick-xml 0.41.0", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-xml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484#7ad4765ee55496d0ccdb7659ad7a6375c7bbb484" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "quick-xml 0.41.0", "serde", "thiserror 2.0.21", ] -[[package]] -name = "craft-xml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2#899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2" -dependencies = [ - "quick-xml 0.41.0", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-xml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551#8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551" -dependencies = [ - "quick-xml 0.41.0", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-xml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813" -dependencies = [ - "quick-xml 0.41.0", - "serde", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-xml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf#6d0b33c0cd63ae4250c180a04eb4a4d66ab81448" -dependencies = [ - "quick-xml 0.41.0", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-xml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=cc23ffd4d26f3074808e2187d332564817624f8f#cc23ffd4d26f3074808e2187d332564817624f8f" -dependencies = [ - "quick-xml 0.41.0", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-xml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=eed3c28cf016723d004d6f2c79c61424c15d4558#eed3c28cf016723d004d6f2c79c61424c15d4558" -dependencies = [ - "quick-xml 0.41.0", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-xml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f6cab1980#f6cab1980bbe422cc00c4b19d9f0f9ba337e1316" -dependencies = [ - "quick-xml 0.41.0", - "thiserror 2.0.21", -] - [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=2b9a325f57624804ed423aded16695eddb815119#2b9a325f57624804ed423aded16695eddb815119" -dependencies = [ - "flate2", - "thiserror 2.0.21", - "zip 9.1.1", -] - -[[package]] -name = "craft-zip" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484#7ad4765ee55496d0ccdb7659ad7a6375c7bbb484" -dependencies = [ - "flate2", - "thiserror 2.0.21", - "zip 9.1.1", -] - -[[package]] -name = "craft-zip" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2#899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2" -dependencies = [ - "flate2", - "thiserror 2.0.21", - "zip 9.1.1", -] - -[[package]] -name = "craft-zip" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551#8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551" -dependencies = [ - "flate2", - "thiserror 2.0.21", - "zip 9.1.1", -] - -[[package]] -name = "craft-zip" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b1b4602a71d19e09ad33f7752a10d6598cf39b2b#b1b4602a71d19e09ad33f7752a10d6598cf39b2b" -dependencies = [ - "flate2", - "thiserror 2.0.21", - "zip 9.1.1", -] - -[[package]] -name = "craft-zip" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf#6d0b33c0cd63ae4250c180a04eb4a4d66ab81448" -dependencies = [ - "flate2", - "thiserror 2.0.21", - "zip 9.1.1", -] - -[[package]] -name = "craft-zip" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=eed3c28cf016723d004d6f2c79c61424c15d4558#eed3c28cf016723d004d6f2c79c61424c15d4558" -dependencies = [ - "flate2", - "thiserror 2.0.21", - "zip 9.1.1", -] - -[[package]] -name = "craft-zip" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=f6cab1980#f6cab1980bbe422cc00c4b19d9f0f9ba337e1316" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "flate2", "thiserror 2.0.21", @@ -2118,7 +1771,7 @@ name = "designcraft-cli" version = "0.21.0" dependencies = [ "craft-file-formats", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701)", + "craft-image-codecs", "designcraft-color", "designcraft-compose", "designcraft-doc", @@ -2190,9 +1843,8 @@ dependencies = [ "craft-mime", "craft-prepress", "craft-print", - "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=cc23ffd4d26f3074808e2187d332564817624f8f)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813)", + "craft-svg", + "craft-xml", "designcraft-color", "designcraft-compose", "designcraft-doc", @@ -2275,9 +1927,8 @@ name = "designcraft-idml" version = "0.21.0" dependencies = [ "craft-file-formats", - "craft-idml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2)", - "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=cc23ffd4d26f3074808e2187d332564817624f8f)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2)", + "craft-idml", + "craft-xml", "designcraft-color", "designcraft-compose", "designcraft-doc", @@ -2293,11 +1944,11 @@ name = "designcraft-images" version = "0.21.0" dependencies = [ "craft-cms", - "craft-eps 0.1.0 (git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf)", + "craft-eps", "craft-file-formats", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701)", + "craft-image-codecs", "craft-psd", - "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=cc23ffd4d26f3074808e2187d332564817624f8f)", + "craft-svg", "designcraft-color", "designcraft-fonts", "flate2", @@ -2329,7 +1980,7 @@ version = "0.21.0" dependencies = [ "chrono", "craft-cms", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701)", + "craft-image-codecs", "craft-pdf", "craft-prepress", "designcraft-color", @@ -2354,8 +2005,8 @@ name = "designcraft-pptx" version = "0.21.0" dependencies = [ "chrono", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701)", - "craft-opc 0.1.0 (git+https://github.com/storytold/craft-libs?rev=8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551)", + "craft-image-codecs", + "craft-opc", "craft-pptx", "designcraft-color", "designcraft-compose", @@ -2375,7 +2026,7 @@ name = "designcraft-render" version = "0.21.0" dependencies = [ "bytemuck", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701)", + "craft-image-codecs", "craft-pdf", "designcraft-color", "designcraft-compose", @@ -2397,7 +2048,7 @@ version = "0.21.0" dependencies = [ "craft-docx", "craft-file-formats", - "craft-idml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2)", + "craft-idml", "craft-rtf", "craft-wordmodel", "craft-xlsx", @@ -3540,7 +3191,7 @@ dependencies = [ [[package]] name = "hayro" version = "0.7.1" -source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "bytemuck", "hayro-interpret", @@ -3560,7 +3211,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "brotli", "hayro-postscript", @@ -3569,7 +3220,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3587,7 +3238,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3605,12 +3256,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "flate2", "hayro-ccitt", @@ -4251,7 +3902,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813" +source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" dependencies = [ "base64 0.22.1", "bumpalo", @@ -8502,7 +8153,7 @@ dependencies = [ [[package]] name = "winprint" version = "0.2.1" -source = "git+https://github.com/storytold/winprint.rs?rev=5f80b9baf6b58937c401656634e42d33f00ddf49#5f80b9baf6b58937c401656634e42d33f00ddf49" +source = "git+https://github.com/storytold/winprint.rs?rev=8ae097ef941b432b0e7671b1ec3a506800e65e57#8ae097ef941b432b0e7671b1ec3a506800e65e57" dependencies = [ "flate2", "fmt-derive", @@ -8517,6 +8168,7 @@ dependencies = [ "windows", "windows-core", "windows-implement", + "windows-numerics", "xml", ] diff --git a/Cargo.toml b/Cargo.toml index 512ba8145..a1b97aa26 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,33 +12,32 @@ repository = "https://github.com/storytold/designcraft" [workspace.dependencies] # Shared RFC 4648 encoding; document decoding policies remain local. -craft-mime = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "f0f4758c01581d79577b9bf5046c06f4e77b1f18" } +craft-mime = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c" } # Shared reader and writer; publish the immutable revision before this consumer. -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.1.0", default-features = false } -craft-designcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "b1b4602a71d19e09ad33f7752a10d6598cf39b2b", version = "=0.1.0" } -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "ba24fe2435adb3c81ad6057faf36365fbba736cf", version = "=0.1.0" } -craft-epub = { git = "https://github.com/storytold/craft-libs", rev = "ba24fe2435adb3c81ad6057faf36365fbba736cf", version = "=0.1.0" } -craft-idml = { git = "https://github.com/storytold/craft-libs", rev = "899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2", version = "=0.1.0" } -craft-indd = { git = "https://github.com/storytold/craft-libs", rev = "47bf5650b0d503b97bfb5e841746c4957897d11f", version = "=0.1.0" } -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "cc23ffd4d26f3074808e2187d332564817624f8f", version = "=0.1.0", features = ["tree-render", "tree-text"] } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2", version = "=0.1.0" } -craft-xml-dtd = { package = "craft-xml", git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.1.0" } -craft-rtf = { git = "https://github.com/storytold/craft-libs", rev = "bfea7d9800a9f14e496209f9df30e9ef45655701", version = "=0.1.0" } -craft-xlsx = { git = "https://github.com/storytold/craft-libs", rev = "2b9a325f57624804ed423aded16695eddb815119", version = "=0.1.0" } -craft-docx = { git = "https://github.com/storytold/craft-libs", rev = "7ad4765ee55496d0ccdb7659ad7a6375c7bbb484", version = "=0.1.0" } -craft-wordmodel = { git = "https://github.com/storytold/craft-libs", rev = "7ad4765ee55496d0ccdb7659ad7a6375c7bbb484", version = "=0.1.0" } -craft-csv = { git = "https://github.com/storytold/craft-libs", rev = "387c64892b30fdad491b263cc3d9eac660d88dcc", version = "=0.1.0" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "bfea7d9800a9f14e496209f9df30e9ef45655701", version = "=0.1.0" } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "d15bf1f35b17b759870f9e5111b9a5d243f64888", version = "=0.1.0" } -craft-file-formats = { git = "https://github.com/storytold/craft-libs", rev = "eed3c28cf016723d004d6f2c79c61424c15d4558", version = "=0.1.0" } -craft-opc = { git = "https://github.com/storytold/craft-libs", rev = "8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551", version = "=0.1.0" } -craft-pptx = { git = "https://github.com/storytold/craft-libs", rev = "f6cab1980", version = "=0.1.0" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0", default-features = false } +craft-designcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } +craft-epub = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } +craft-idml = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } +craft-indd = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0", features = ["tree-render", "tree-text"] } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } +craft-rtf = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } +craft-xlsx = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } +craft-docx = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } +craft-wordmodel = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } +craft-csv = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } +craft-file-formats = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } +craft-opc = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } +craft-pptx = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } # Shared keyboard bindings: chords, overrides, conflicts, egui dispatch, the Keyboard Shortcuts dialog. -craft-keymap = { git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0", version = "=0.1.0", features = ["egui", "ui"] } +craft-keymap = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0", features = ["egui", "ui"] } # Separations, ink coverage and the ink manager; same revision as craft-pdf and the krilla patch. -craft-prepress = { git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.1.0", features = ["flatten"] } +craft-prepress = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0", features = ["flatten"] } # 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 = "e98299546f5c5c3c22388d16507f8b5e61a5f280", features = ["egui"] } +craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", features = ["egui"] } # internal designcraft-geom = { path = "crates/geom" } designcraft-color = { path = "crates/color" } @@ -96,20 +95,20 @@ qrcodegen = "1.8" quick-xml = "0.41" zip = { version = "3", default-features = false, features = ["deflate"] } # Which paths stored in documents may be followed (craft-libs). -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0" } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c" } # Atomic file replacement for saves and exports (craft-libs). -craft-atomic = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0" } +craft-atomic = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c" } # File › Print through the system print spooler (craft-libs). -craft-print = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0" } +craft-print = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c" } # ICC colour management: working spaces, transforms, black point compensation (craft-libs). -craft-cms = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813" } +craft-cms = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c" } # ui # Shared frontend components; keep this dependency above the engine boundary. -craft-ui = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0", features = ["serde"] } +craft-ui = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", features = ["serde"] } # The application bar as the window's title bar (craft-libs). -craft-window = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0", features = ["egui"] } +craft-window = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", features = ["egui"] } egui = "0.37" # Resizable table columns (About ▸ Contributors / Models); no image loaders. egui_extras = { version = "0.37", default-features = false } @@ -119,7 +118,7 @@ egui_kittest = "0.37" web-time = "1" rfd = "0.17" # Native file and message dialogs that never block the event loop (craft-libs). -craft-dialogs = { git = "https://github.com/storytold/craft-libs", rev = "1a11a4897865f7410c40d25ca6e452ce399a1a2c" } +craft-dialogs = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c" } raw-window-handle = "0.6" arboard = { version = "3.6", default-features = false } @@ -153,16 +152,16 @@ debug = 0 # Opt-in cancelable macOS termination on the pinned winit 0.30 line. [patch.crates-io] -krilla = { git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.8.2" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.8.2" } winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" } # The hayro crates from craft-libs' vendor/ directory (pdfcraft's, plus the plate mode and decode # limits craft-pdf and craft-prepress need); same revision as craft-pdf. -hayro = { git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.7.1" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.7.0" } -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.7.2" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.3.0" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.1.0" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.1.0" } +hayro = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.7.1" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.7.0" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.7.2" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.3.0" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } emath = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } epaint = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } diff --git a/crates/engine/Cargo.toml b/crates/engine/Cargo.toml index f3dce660f..38caa3062 100644 --- a/crates/engine/Cargo.toml +++ b/crates/engine/Cargo.toml @@ -39,7 +39,6 @@ serde_json = { workspace = true } thiserror = { workspace = true } log = { workspace = true } craft-xml = { workspace = true } -craft-xml-dtd = { workspace = true } craft-svg = { workspace = true } caseless = { workspace = true } unicode-segmentation = { workspace = true } diff --git a/crates/engine/src/cmd/paste_svg.rs b/crates/engine/src/cmd/paste_svg.rs index ea3013e2a..f2d9f6f99 100644 --- a/crates/engine/src/cmd/paste_svg.rs +++ b/crates/engine/src/cmd/paste_svg.rs @@ -74,11 +74,11 @@ fn paint(p: &SvgPaint, notes: &mut Notes) -> Option { let (rgb, opacity) = match p { SvgPaint::Color { rgb, opacity } => (*rgb, *opacity), // Gradients and patterns are retained as their first color where available. - SvgPaint::Gradient { first_rgb, opacity } => { + SvgPaint::Gradient { stops, opacity, .. } => { notes.gradients += 1; - (*first_rgb.as_ref()?, *opacity) + (stops.first()?.rgb, *opacity) } - SvgPaint::Pattern => { + SvgPaint::Pattern { .. } => { notes.gradients += 1; return None; } @@ -142,7 +142,7 @@ fn convert(nodes: &[SvgNode], notes: &mut Notes, out: &mut Vec) { } out.push(Art::Path { path: bezpath(&path.segments), fill, stroke, opacity: 1.0 }); } - SvgNode::Group { children, opacity } => { + SvgNode::Group { children, opacity, .. } => { let mut items = Vec::new(); convert(children, notes, &mut items); // usvg wraps nodes in groups for transforms and opacity; only a group of several @@ -156,6 +156,8 @@ fn convert(nodes: &[SvgNode], notes: &mut Notes, out: &mut Vec) { } } } + // Embedded images are left out; the scene's image count gives the warning. + SvgNode::Image(_) => {} } } } diff --git a/crates/engine/src/dtd.rs b/crates/engine/src/dtd.rs index 6eda1fff5..cba6b180b 100644 --- a/crates/engine/src/dtd.rs +++ b/crates/engine/src/dtd.rs @@ -1,3 +1,3 @@ //! XML DTD command adapter backed by craft-xml. -pub use craft_xml_dtd::dtd::{Dtd, Problem, parse, validate}; +pub use craft_xml::dtd::{Dtd, Problem, parse, validate}; diff --git a/crates/idml/Cargo.toml b/crates/idml/Cargo.toml index d6bfd451b..3cbae7654 100644 --- a/crates/idml/Cargo.toml +++ b/crates/idml/Cargo.toml @@ -15,7 +15,6 @@ designcraft-doc = { workspace = true } designcraft-images = { workspace = true } craft-idml = { workspace = true } craft-xml = { workspace = true } -craft-svg = { workspace = true } craft-file-formats = { workspace = true } thiserror = { workspace = true } log = { workspace = true } diff --git a/crates/idml/src/import/item.rs b/crates/idml/src/import/item.rs index 182c8d670..fe91e6004 100644 --- a/crates/idml/src/import/item.rs +++ b/crates/idml/src/import/item.rs @@ -9,6 +9,32 @@ use super::{ /// InDesign's corner size when a corner shape is set without an explicit radius. const INDESIGN_CORNER_SIZE: f64 = 12.0; +/// The viewBox size of an SVG whose root has a viewBox but no width or height (percentages count +/// as none): such a file is placed at one viewBox unit to the point. The XML parse is bounded to +/// 16 MiB. +fn svg_viewbox_size(data: &[u8]) -> Option<(f64, f64)> { + if data.iter().find(|b| !b.is_ascii_whitespace()) != Some(&b'<') { + return None; + } + let mut options = craft_xml::Options::default(); + options.limits.max_input = 16 << 20; + let root = options.parse(data).ok()?; + if root.local() != "svg" { + return None; + } + let attr = |name: &str| root.attr(name).map(ToString::to_string); + let absolute = |name: &str| attr(name).is_some_and(|v| !v.trim().ends_with('%')); + if absolute("width") || absolute("height") { + return None; + } + let vb: Vec = + attr("viewBox")?.split(|c: char| c.is_whitespace() || c == ',').filter(|v| !v.is_empty()).filter_map(|v| v.parse().ok()).collect(); + match vb[..] { + [_, _, w, h] if w.is_finite() && h.is_finite() && w > 0.0 && h > 0.0 => Some((w, h)), + _ => None, + } +} + impl<'r> Importer<'r> { pub(super) fn item(&mut self, e: &El, parent: Affine) -> Option { let model_item = craft_idml::model::PageItem::from_el(&crate::xml::to_craft(e))?; @@ -302,7 +328,7 @@ impl<'r> Importer<'r> { // file once. let key = (p.clone(), page, pdf_crop); if let Some(id) = self.linked_assets.get(&key) { - let size = self.assets.get(id).and_then(|a| craft_svg::sniff::viewbox_size(a.data.embedded_bytes()?)).unwrap_or(size); + let size = self.assets.get(id).and_then(|a| svg_viewbox_size(a.data.embedded_bytes()?)).unwrap_or(size); return graphic(*id, size); } if let Some(d) = (self.read_link)(p) { @@ -322,7 +348,7 @@ impl<'r> Importer<'r> { }); // InDesign draws a viewBox-only SVG at one unit to the point: its GraphicBounds are the // art's bounds, which can overhang the viewBox, so they must not size the viewBox. - let size = craft_svg::sniff::viewbox_size(&data).unwrap_or(size); + let size = svg_viewbox_size(&data).unwrap_or(size); let (mime, px) = if preview.is_some() { (None, None) } else { sniff_image(&data) }; let mime = mime.map(str::to_string).unwrap_or_else(|| model.fallback_mime().to_owned()); let pixels = px.or_else(|| { diff --git a/crates/images/src/lib.rs b/crates/images/src/lib.rs index 6cf733ce4..da0eab759 100644 --- a/crates/images/src/lib.rs +++ b/crates/images/src/lib.rs @@ -306,6 +306,7 @@ pub fn svg_tree(bytes: &[u8]) -> Option { let limits = craft_svg::tree::Limits { bytes: MAX_SVG_BYTES, depth: MAX_SVG_DEPTH, + tree_depth: MAX_SVG_DEPTH, refuse_entity_markup: true, xml_nodes: MAX_SVG_EVENTS as u32, embedded_bytes: 32 * 1024 * 1024, diff --git a/crates/images/src/tests.rs b/crates/images/src/tests.rs index be06119c3..5f4a527b4 100644 --- a/crates/images/src/tests.rs +++ b/crates/images/src/tests.rs @@ -40,6 +40,27 @@ fn svg_depth_is_checked_before_recursive_parsing() { } } +/// An SVG whose `` elements hold one another `links` deep, with no element nested deeper +/// than three levels. +fn use_chain_svg(links: usize) -> String { + let chain: String = (0..links).map(|i| format!("", i + 1)).collect(); + format!( + r#"{chain}"# + ) +} + +/// Following references counts toward the depth limit: a short `` chain parses, a chain +/// past `MAX_SVG_DEPTH` levels is rejected by the tree, size and render APIs. +#[test] +fn svg_reference_depth_is_checked_before_recursive_parsing() { + let short = use_chain_svg(8); + assert!(svg_tree(short.as_bytes()).is_some()); + let long = use_chain_svg(MAX_SVG_DEPTH); + assert!(svg_tree(long.as_bytes()).is_none()); + assert!(natural_size(long.as_bytes()).is_none()); + assert!(render_svg(long.as_bytes(), 10).is_none()); +} + /// Markup-looking text in comments, CDATA and attributes does not count as XML depth. #[test] fn svg_depth_ignores_markup_in_comments_cdata_and_attributes() { diff --git a/crates/ui-egui/src/panel_docking.rs b/crates/ui-egui/src/panel_docking.rs index 847a3de33..0d03a7d77 100644 --- a/crates/ui-egui/src/panel_docking.rs +++ b/crates/ui-egui/src/panel_docking.rs @@ -889,6 +889,8 @@ fn known(action: &Action) -> bool { | Action::ResizeColumn { panel, .. } | Action::ResizeGroup { panel, .. } | Action::ResizeIconic { panel, .. } + | Action::ResizeFlyoutWidth { panel, .. } + | Action::MoveFlyoutTop { panel, .. } | Action::SetNative { panel, .. } | Action::SetMonitor { panel, .. } => registered(panel), // Actions newer than this list are rejected until DesignCraft checks them. diff --git a/crates/ui-egui/src/panel_docking/tests.rs b/crates/ui-egui/src/panel_docking/tests.rs index 77b721098..b1a4dfe46 100644 --- a/crates/ui-egui/src/panel_docking/tests.rs +++ b/crates/ui-egui/src/panel_docking/tests.rs @@ -244,6 +244,25 @@ fn serialized_layout_actions_cover_geometry_reorder_accordion_and_atomic_rejecti assert_eq!(entries[0].height, Some(150.0)); } +/// Dragging a flyout's side or top edge sends its new width and top; both are kept for a +/// registered panel and refused for an unknown one. +#[test] +fn flyout_width_and_top_actions_are_kept_for_registered_panels() { + let mut app = app(); + assert!(in_iconic_column(&layout_of(&app), "stroke")); + app.run("window.panel.layout", json!({"action":{"ResizeFlyoutWidth":{"panel":"stroke","width":320}}})).unwrap(); + app.run("window.panel.layout", json!({"action":{"MoveFlyoutTop":{"panel":"stroke","offset":-40}}})).unwrap(); + let layout = layout_of(&app); + let group = dock_columns(&layout).into_iter().flat_map(|c| &c.groups).find(|g| g.panels.iter().any(|p| p == "stroke")).unwrap(); + assert_eq!(group.flyout_width, Some(320.0)); + assert_eq!(group.flyout_offset, Some(-40.0)); + let before = app.ui.docking.clone(); + for action in [json!({"ResizeFlyoutWidth":{"panel":"unknown","width":320}}), json!({"MoveFlyoutTop":{"panel":"unknown","offset":-40}})] { + assert!(app.run("window.panel.layout", json!({"action":action})).is_err()); + assert_eq!(app.ui.docking, before); + } +} + fn group_members_for_test(layout: &Layout, panel: &str) -> Vec { tab_group(layout, panel) } From dd2375d91d9a3edf4d300c4d77b5202b6de0370c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 12:03:21 -0800 Subject: [PATCH 02/12] Panels: a group docked back keeps its flyout's width and top craft-ui at 3af718585c saves a dock group's flyout width and top when the group floats and restores them in its own restore path. Dock Panel for a group that floated as a whole goes through DesignCraft's own path, which replayed the height, minimized state and column but not the two flyout values, so a widened or moved flyout came back at its default size and place. The path now replays ResizeFlyoutWidth and MoveFlyoutTop with the other saved state. The images test's doc comment gives the nesting depth of its `` chain as four levels, counting the root as one. --- crates/images/src/tests.rs | 2 +- crates/ui-egui/src/panel_docking.rs | 2 ++ crates/ui-egui/src/panel_docking/tests.rs | 28 +++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/crates/images/src/tests.rs b/crates/images/src/tests.rs index 5f4a527b4..3c1156fed 100644 --- a/crates/images/src/tests.rs +++ b/crates/images/src/tests.rs @@ -41,7 +41,7 @@ fn svg_depth_is_checked_before_recursive_parsing() { } /// An SVG whose `` elements hold one another `links` deep, with no element nested deeper -/// than three levels. +/// than four levels (the root counts as one). fn use_chain_svg(links: usize) -> String { let chain: String = (0..links).map(|i| format!("", i + 1)).collect(); format!( diff --git a/crates/ui-egui/src/panel_docking.rs b/crates/ui-egui/src/panel_docking.rs index 0d03a7d77..54bf69108 100644 --- a/crates/ui-egui/src/panel_docking.rs +++ b/crates/ui-egui/src/panel_docking.rs @@ -763,6 +763,8 @@ impl Transaction { if let Some(saved) = &location.group { state.push(Action::ResizeGroup { panel: panel.clone(), height: saved.height }); state.push(Action::SetMinimized { panel: panel.clone(), minimized: saved.minimized }); + state.push(Action::ResizeFlyoutWidth { panel: panel.clone(), width: saved.flyout_width }); + state.push(Action::MoveFlyoutTop { panel: panel.clone(), offset: saved.flyout_offset }); // A group that had a column of its own gets that column back as it was. if let (Placement::Column { .. }, Some(column)) = (&location.placement, saved.column) { state.push(Action::ResizeColumn { panel: panel.clone(), width: column.width }); diff --git a/crates/ui-egui/src/panel_docking/tests.rs b/crates/ui-egui/src/panel_docking/tests.rs index b1a4dfe46..d4e0de84b 100644 --- a/crates/ui-egui/src/panel_docking/tests.rs +++ b/crates/ui-egui/src/panel_docking/tests.rs @@ -263,6 +263,34 @@ fn flyout_width_and_top_actions_are_kept_for_registered_panels() { } } +/// A group of an iconic column that floats as a whole and docks back keeps its flyout's width +/// and top. +#[test] +fn a_group_docked_back_keeps_its_flyout_width_and_top() { + let mut app = app(); + let layout = layout_of(&app); + let members = dock_columns(&layout) + .into_iter() + .filter(|c| c.iconic) + .flat_map(|c| &c.groups) + .find(|g| g.panels.len() > 1) + .expect("an iconic column with a group of several panels") + .panels + .clone(); + let panel = members[0].clone(); + app.run("window.panel.layout", json!({"action":{"ResizeFlyoutWidth":{"panel":panel,"width":320}}})).unwrap(); + app.run("window.panel.layout", json!({"action":{"MoveFlyoutTop":{"panel":panel,"offset":-40}}})).unwrap(); + app.run("window.panel.float", json!({"panel": panel, "group": true, "x": 80, "y": 80, "width": 300, "height": 400})).unwrap(); + assert_eq!(app.ui.docking.as_ref().unwrap().floating.len(), 1); + app.run("window.panel.dock", json!({"panel": panel})).unwrap(); + let layout = layout_of(&app); + assert!(layout.floating.is_empty()); + let group = dock_columns(&layout).into_iter().flat_map(|c| &c.groups).find(|g| g.panels.contains(&panel)).unwrap(); + assert_eq!(group.panels, members); + assert_eq!(group.flyout_width, Some(320.0)); + assert_eq!(group.flyout_offset, Some(-40.0)); +} + fn group_members_for_test(layout: &Layout, panel: &str) -> Vec { tab_group(layout, panel) } From d8a04eadbd2e7c6cac8a801077444a5f2e78e1b4 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 12:17:48 -0800 Subject: [PATCH 03/12] PDF: pdf-deps expects craft-libs 3af718585c `cargo xtask pdf-deps` checks that craft-pdf, Krilla and the Hayro crates resolve to one craft-libs revision named in xtask. The workspace now takes them at 3af718585c, so the check expects that revision, and docs/pdf-backend.md names it. --- docs/pdf-backend.md | 2 +- xtask/src/pdf_deps.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/pdf-backend.md b/docs/pdf-backend.md index 6dc2a3330..9bad2693f 100644 --- a/docs/pdf-backend.md +++ b/docs/pdf-backend.md @@ -1,7 +1,7 @@ # Shared PDF backend DesignCraft pins `craft-pdf`, patched Krilla 0.8.2 and the six Hayro reader crates (with -`hayro-cmap` and `hayro-postscript`) to craft-libs revision `92d392cff132eaf53e13afff77f38b5c11b73aa0`. `craft-ui`, +`hayro-cmap` and `hayro-postscript`) to craft-libs revision `3af718585c60d8e9bab05c241d7a28282c61f85c`. `craft-ui`, `craft-print` and the other craft-libs crates are pinned to the same revision. The reader migration is reviewed on top of the separate writer change. ## Writing diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index 899a38f29..e8afdafbf 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,8 +5,8 @@ use std::process::Command; use serde_json::Value; const REPO: &str = "https://github.com/storytold/craft-libs"; -const REV: &str = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813"; -const COMMIT: &str = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813"; +const REV: &str = "3af718585c60d8e9bab05c241d7a28282c61f85c"; +const COMMIT: &str = "3af718585c60d8e9bab05c241d7a28282c61f85c"; const PACKAGES: &[(&str, &str)] = &[ ("craft-pdf", "0.1.0"), ("krilla", "0.8.2"), From 8085afbce2e790e3b8b2d2d00ec4762f53ea834c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 12:25:27 -0800 Subject: [PATCH 04/12] IDML: a placed SVG with a byte order mark keeps its viewBox size The importer's viewBox sizing looked for `<` as the first byte, so a linked viewBox-only SVG that starts with a UTF-8 byte order mark was placed at its GraphicBounds instead of its viewBox size. The mark is now skipped first. --- crates/idml/src/import/item.rs | 5 +++-- crates/idml/src/tests/assets.rs | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/idml/src/import/item.rs b/crates/idml/src/import/item.rs index fe91e6004..f5407af47 100644 --- a/crates/idml/src/import/item.rs +++ b/crates/idml/src/import/item.rs @@ -10,9 +10,10 @@ use super::{ const INDESIGN_CORNER_SIZE: f64 = 12.0; /// The viewBox size of an SVG whose root has a viewBox but no width or height (percentages count -/// as none): such a file is placed at one viewBox unit to the point. The XML parse is bounded to -/// 16 MiB. +/// as none): such a file is placed at one viewBox unit to the point. A leading UTF-8 byte order +/// mark is skipped. The XML parse is bounded to 16 MiB. fn svg_viewbox_size(data: &[u8]) -> Option<(f64, f64)> { + let data = data.strip_prefix(b"\xEF\xBB\xBF").unwrap_or(data); if data.iter().find(|b| !b.is_ascii_whitespace()) != Some(&b'<') { return None; } diff --git a/crates/idml/src/tests/assets.rs b/crates/idml/src/tests/assets.rs index 56f552b26..ee4d7d949 100644 --- a/crates/idml/src/tests/assets.rs +++ b/crates/idml/src/tests/assets.rs @@ -269,14 +269,17 @@ fn placed_svg_with_only_a_viewbox_keeps_its_viewbox_size() { let reader = |p: &str| match p { "/art/overhang.svg" => Some(OVERHANG.as_bytes().to_vec()), "/art/sized.svg" => Some(SIZED.as_bytes().to_vec()), + "/art/bom.svg" => Some(format!("\u{feff}{OVERHANG}").into_bytes()), _ => None, }; // GraphicBounds are the art's bounds: 211 wide for the overhanging one, placed twice (the second - // reuses the first's asset); a sized SVG is still stretched onto its bounds. + // reuses the first's asset); a sized SVG is still stretched onto its bounds. A file that starts + // with a UTF-8 byte order mark keeps its viewBox size too. let frames = vec![ frame(1, 0.0, 0.0, &svg(1, "file:/art/overhang.svg", [-11.0, 0.0, 200.0, 100.0])), frame(2, 100.0, 0.0, &svg(2, "file:/art/overhang.svg", [-11.0, 0.0, 200.0, 100.0])), frame(3, 200.0, 0.0, &svg(3, "file:/art/sized.svg", [-10.0, 0.0, 200.0, 100.0])), + frame(4, 300.0, 0.0, &svg(4, "file:/art/bom.svg", [-11.0, 0.0, 200.0, 100.0])), ]; let d = import_idml_with(&package(&frames), &reader).unwrap(); let mut gs: Vec<_> = d.spreads[0] @@ -289,7 +292,7 @@ fn placed_svg_with_only_a_viewbox_keeps_its_viewbox_size() { .collect(); gs.sort_by(|a, b| a.0.total_cmp(&b.0)); let got: Vec<_> = gs.into_iter().map(|(_, size, x)| (size, x)).collect(); - assert_eq!(got, vec![((200.0, 100.0), -11.0), ((200.0, 100.0), -11.0), ((210.0, 100.0), -10.0)]); + assert_eq!(got, vec![((200.0, 100.0), -11.0), ((200.0, 100.0), -11.0), ((210.0, 100.0), -10.0), ((200.0, 100.0), -11.0)]); } /// `PDFAttribute/@PageNumber` (1-based) is read into `Asset.page` (0-based), and the same file at From f02cdc5fdde67e8dd29f4c3d59708161f0d8a475 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 13:49:27 -0800 Subject: [PATCH 05/12] Tests: the discarded-pass input test clears its texture changes discarded_pass_does_not_acknowledge_injected_input dropped its frame output without clearing textures_delta, so epaint panicked on drop whenever the frame carried a texture change. With craft-ui at 3af718585c it failed in 2 of 3 full ui-egui test runs. The test now clears it, as the tests around it do. --- crates/ui-egui/src/tests.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/tests.rs b/crates/ui-egui/src/tests.rs index abac3fe3a..de08d3989 100644 --- a/crates/ui-egui/src/tests.rs +++ b/crates/ui-egui/src/tests.rs @@ -1801,7 +1801,7 @@ fn discarded_pass_does_not_acknowledge_injected_input() { app.raw_input_hook(&ctx, &mut raw); assert!(app.synthetic_injected); let mut passes = 0; - let output = ctx.run_ui(raw, |ui| { + let mut output = ctx.run_ui(raw, |ui| { passes += 1; if passes == 1 { ui.ctx().request_discard("injected input must survive a discarded pass"); @@ -1809,6 +1809,7 @@ fn discarded_pass_does_not_acknowledge_injected_input() { app.logic(&ui.ctx().clone()); app.ui(ui); }); + output.textures_delta.clear(); assert_eq!(output.platform_output.num_completed_passes, 2); assert!(!app.synthetic_injected, "the settled second pass acknowledges it"); assert!(app.control_synthetic.is_empty()); From 0289463defb613cbf1805a3cea72afc22d91886a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 21:09:39 -0800 Subject: [PATCH 06/12] Dependencies: take craft-libs crates from craft-libs main at 453b0da782 Every craft-libs git dependency and [patch.crates-io] entry moves from 3af718585c to 453b0da782, and xtask pdf-deps and docs/pdf-backend.md name the new commit. Cargo.lock changes only the source revision of the 50 craft-libs packages; no package is added or removed and no registry package changes version. craft-update now inspects a release the app offers on a thread of its own (storytold/craft-libs#1149), so the prompt opens at a later tick instead of inside offer. updates_ui's startup_prompt_shows_and_closes waits for that answer: it ticks on each immediate repaint request the offer's thread makes until the prompt is open. --- Cargo.lock | 100 +++++++++++++++---------------- Cargo.toml | 72 +++++++++++----------- crates/ui-egui/src/updates_ui.rs | 26 +++++++- docs/pdf-backend.md | 2 +- xtask/src/pdf_deps.rs | 4 +- 5 files changed, 114 insertions(+), 90 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bfea7f2e6..7596db898 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1083,7 +1083,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "rustix 1.1.5", ] @@ -1091,12 +1091,12 @@ dependencies = [ [[package]] name = "craft-cfb" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "md-5", "rayon", @@ -1105,12 +1105,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" [[package]] name = "craft-csv" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "thiserror 2.0.21", ] @@ -1118,7 +1118,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "rayon", ] @@ -1126,7 +1126,7 @@ dependencies = [ [[package]] name = "craft-designcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "craft-document-bundle", "craft-eps", @@ -1138,7 +1138,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "block2 0.6.2", "objc2 0.6.5", @@ -1151,12 +1151,12 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" [[package]] name = "craft-document-bundle" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "craft-zip", "serde_json", @@ -1167,7 +1167,7 @@ dependencies = [ [[package]] name = "craft-docx" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "base64 0.23.1", "chrono", @@ -1187,7 +1187,7 @@ dependencies = [ [[package]] name = "craft-drawingml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "craft-xml", "kurbo", @@ -1198,12 +1198,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" [[package]] name = "craft-epub" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "craft-xml", "craft-zip", @@ -1213,7 +1213,7 @@ dependencies = [ [[package]] name = "craft-file-formats" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "craft-eps", "craft-idml", @@ -1226,12 +1226,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "fixed_decimal", "icu_decimal", @@ -1254,7 +1254,7 @@ dependencies = [ [[package]] name = "craft-idml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "craft-xml", "craft-zip", @@ -1264,7 +1264,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "craft-dds", "craft-jpeg", @@ -1291,7 +1291,7 @@ dependencies = [ [[package]] name = "craft-indd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "indd", ] @@ -1299,7 +1299,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "thiserror 2.0.21", ] @@ -1307,7 +1307,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "craft-i18n", "craft-ui", @@ -1319,7 +1319,7 @@ dependencies = [ [[package]] name = "craft-math" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "craft-xml", "serde", @@ -1328,7 +1328,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "brotli-decompressor 6.3.1", "chrono", @@ -1340,7 +1340,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "chrono", "craft-codepage", @@ -1350,7 +1350,7 @@ dependencies = [ [[package]] name = "craft-offcrypto" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "aes", "base64 0.23.1", @@ -1367,7 +1367,7 @@ dependencies = [ [[package]] name = "craft-opc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "craft-xml", "craft-zip", @@ -1378,7 +1378,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "bytemuck", "craft-svg", @@ -1394,7 +1394,7 @@ dependencies = [ [[package]] name = "craft-pptx" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "craft-drawingml", "craft-opc", @@ -1409,7 +1409,7 @@ dependencies = [ [[package]] name = "craft-prepress" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "craft-cms", "craft-pdf", @@ -1422,7 +1422,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "craft-winprint-gdi", "log", @@ -1436,7 +1436,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "encoding_rs", "flate2", @@ -1447,7 +1447,7 @@ dependencies = [ [[package]] name = "craft-rtf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "craft-codepage", "encoding_rs", @@ -1456,12 +1456,12 @@ dependencies = [ [[package]] name = "craft-sheet" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "craft-image-codecs", "craft-xml", @@ -1480,7 +1480,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "serde", "thiserror 2.0.21", @@ -1489,7 +1489,7 @@ dependencies = [ [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "craft-fonts-build", "craft-i18n", @@ -1510,7 +1510,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "chrono", "dunce", @@ -1537,7 +1537,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "egui", "objc2 0.6.5", @@ -1556,7 +1556,7 @@ dependencies = [ [[package]] name = "craft-wordmodel" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "base64 0.23.1", "craft-math", @@ -1570,7 +1570,7 @@ dependencies = [ [[package]] name = "craft-xlsx" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "craft-drawingml", "craft-opc", @@ -1582,7 +1582,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "quick-xml 0.41.0", "serde", @@ -1592,7 +1592,7 @@ dependencies = [ [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "flate2", "thiserror 2.0.21", @@ -3191,7 +3191,7 @@ dependencies = [ [[package]] name = "hayro" version = "0.7.1" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "bytemuck", "hayro-interpret", @@ -3211,7 +3211,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "brotli", "hayro-postscript", @@ -3220,7 +3220,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3238,7 +3238,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3256,12 +3256,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "flate2", "hayro-ccitt", @@ -3902,7 +3902,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=3af718585c60d8e9bab05c241d7a28282c61f85c#3af718585c60d8e9bab05c241d7a28282c61f85c" +source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" dependencies = [ "base64 0.22.1", "bumpalo", diff --git a/Cargo.toml b/Cargo.toml index a1b97aa26..c67e406ff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,32 +12,32 @@ repository = "https://github.com/storytold/designcraft" [workspace.dependencies] # Shared RFC 4648 encoding; document decoding policies remain local. -craft-mime = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c" } +craft-mime = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc" } # Shared reader and writer; publish the immutable revision before this consumer. -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0", default-features = false } -craft-designcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } -craft-epub = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } -craft-idml = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } -craft-indd = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0", features = ["tree-render", "tree-text"] } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } -craft-rtf = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } -craft-xlsx = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } -craft-docx = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } -craft-wordmodel = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } -craft-csv = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } -craft-file-formats = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } -craft-opc = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } -craft-pptx = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0", default-features = false } +craft-designcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } +craft-epub = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } +craft-idml = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } +craft-indd = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0", features = ["tree-render", "tree-text"] } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } +craft-rtf = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } +craft-xlsx = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } +craft-docx = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } +craft-wordmodel = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } +craft-csv = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } +craft-file-formats = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } +craft-opc = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } +craft-pptx = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } # Shared keyboard bindings: chords, overrides, conflicts, egui dispatch, the Keyboard Shortcuts dialog. -craft-keymap = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0", features = ["egui", "ui"] } +craft-keymap = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0", features = ["egui", "ui"] } # Separations, ink coverage and the ink manager; same revision as craft-pdf and the krilla patch. -craft-prepress = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0", features = ["flatten"] } +craft-prepress = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0", features = ["flatten"] } # 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 = "3af718585c60d8e9bab05c241d7a28282c61f85c", features = ["egui"] } +craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", features = ["egui"] } # internal designcraft-geom = { path = "crates/geom" } designcraft-color = { path = "crates/color" } @@ -95,20 +95,20 @@ qrcodegen = "1.8" quick-xml = "0.41" zip = { version = "3", default-features = false, features = ["deflate"] } # Which paths stored in documents may be followed (craft-libs). -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c" } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc" } # Atomic file replacement for saves and exports (craft-libs). -craft-atomic = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c" } +craft-atomic = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc" } # File › Print through the system print spooler (craft-libs). -craft-print = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c" } +craft-print = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc" } # ICC colour management: working spaces, transforms, black point compensation (craft-libs). -craft-cms = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c" } +craft-cms = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc" } # ui # Shared frontend components; keep this dependency above the engine boundary. -craft-ui = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", features = ["serde"] } +craft-ui = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", features = ["serde"] } # The application bar as the window's title bar (craft-libs). -craft-window = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", features = ["egui"] } +craft-window = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", features = ["egui"] } egui = "0.37" # Resizable table columns (About ▸ Contributors / Models); no image loaders. egui_extras = { version = "0.37", default-features = false } @@ -118,7 +118,7 @@ egui_kittest = "0.37" web-time = "1" rfd = "0.17" # Native file and message dialogs that never block the event loop (craft-libs). -craft-dialogs = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c" } +craft-dialogs = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc" } raw-window-handle = "0.6" arboard = { version = "3.6", default-features = false } @@ -152,16 +152,16 @@ debug = 0 # Opt-in cancelable macOS termination on the pinned winit 0.30 line. [patch.crates-io] -krilla = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.8.2" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.8.2" } winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" } # The hayro crates from craft-libs' vendor/ directory (pdfcraft's, plus the plate mode and decode # limits craft-pdf and craft-prepress need); same revision as craft-pdf. -hayro = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.7.1" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.7.0" } -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.7.2" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.3.0" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "3af718585c60d8e9bab05c241d7a28282c61f85c", version = "=0.1.0" } +hayro = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.7.1" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.7.0" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.7.2" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.3.0" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } emath = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } epaint = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } diff --git a/crates/ui-egui/src/updates_ui.rs b/crates/ui-egui/src/updates_ui.rs index 53bae1502..19aafd3a0 100644 --- a/crates/ui-egui/src/updates_ui.rs +++ b/crates/ui-egui/src/updates_ui.rs @@ -157,6 +157,30 @@ mod tests { } } + /// Offers `release` and returns once its prompt is open. The updater reads the installed files + /// for an offer on a thread of its own, which asks the context the updater keeps for a repaint + /// when it answers; the next tick opens the prompt. Each immediate repaint request is followed + /// by a tick until the prompt opens. A copy the launcher manages ignores the offer and fails + /// the test. + #[cfg(not(target_arch = "wasm32"))] + fn offer_and_wait(updater: &mut Updater, release: craft_update::Release) { + let ctx = egui::Context::default(); + let (answered, wait) = std::sync::mpsc::channel(); + ctx.set_request_repaint_callback(move |info| { + if info.delay.is_zero() { + let _ = answered.send(()); + } + }); + // Keeps `ctx` for the offer's thread. + updater.tick(&ctx); + updater.offer(release); + assert!(updater.managed().is_none(), "the launcher manages this copy, so it ignored the offer"); + while !updater.prompt_open() { + wait.recv().unwrap(); + updater.tick(&ctx); + } + } + #[test] #[cfg(not(target_arch = "wasm32"))] fn startup_prompt_shows_and_closes() { @@ -169,7 +193,7 @@ mod tests { html_url: "https://github.com/storytold/designcraft/releases/tag/v99.0.0".into(), ..Default::default() }; - app.updates_rt.updater.offer(release); + offer_and_wait(&mut app.updates_rt.updater, release); let mut output = ctx.run_ui(egui::RawInput::default(), |ui| { show(&mut app, ui.ctx()); diff --git a/docs/pdf-backend.md b/docs/pdf-backend.md index 9bad2693f..1a33f0572 100644 --- a/docs/pdf-backend.md +++ b/docs/pdf-backend.md @@ -1,7 +1,7 @@ # Shared PDF backend DesignCraft pins `craft-pdf`, patched Krilla 0.8.2 and the six Hayro reader crates (with -`hayro-cmap` and `hayro-postscript`) to craft-libs revision `3af718585c60d8e9bab05c241d7a28282c61f85c`. `craft-ui`, +`hayro-cmap` and `hayro-postscript`) to craft-libs revision `453b0da782ccef39be9a6dac8d27c80b553ef1cc`. `craft-ui`, `craft-print` and the other craft-libs crates are pinned to the same revision. The reader migration is reviewed on top of the separate writer change. ## Writing diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index e8afdafbf..d863e0789 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,8 +5,8 @@ use std::process::Command; use serde_json::Value; const REPO: &str = "https://github.com/storytold/craft-libs"; -const REV: &str = "3af718585c60d8e9bab05c241d7a28282c61f85c"; -const COMMIT: &str = "3af718585c60d8e9bab05c241d7a28282c61f85c"; +const REV: &str = "453b0da782ccef39be9a6dac8d27c80b553ef1cc"; +const COMMIT: &str = "453b0da782ccef39be9a6dac8d27c80b553ef1cc"; const PACKAGES: &[(&str, &str)] = &[ ("craft-pdf", "0.1.0"), ("krilla", "0.8.2"), From 3d6973aa20d3348e7f7bcbe9bfc4cefd26c8fd00 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 23:25:34 -0800 Subject: [PATCH 07/12] Updates: the startup prompt test fails instead of waiting forever offer_and_wait waits for the one immediate repaint the offer's thread requests after it answers, ticks once, and then asserts that the prompt is open. Before, it waited for a repaint after every tick, so an offer that ended without a prompt (the launcher pinning the app while the files were read) blocked the test instead of failing it. NOTICE names craft-libs 453b0da782 as the source of the patched Hayro crates, the revision Cargo.toml fetches them at, adds hayro-postscript, which is patched from the same revision, and names the PdfCraft revision the snapshots were re-synced to. --- NOTICE | 15 +++++++++------ crates/ui-egui/src/updates_ui.rs | 11 ++++++----- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/NOTICE b/NOTICE index 833424333..077432d6d 100644 --- a/NOTICE +++ b/NOTICE @@ -164,15 +164,18 @@ No Adobe icons, images or artwork are included. PDF backend source -The patched hayro 0.7.1, hayro-interpret 0.7.0, hayro-syntax 0.7.2, hayro-jbig2 0.3.0 and -hayro-cmap 0.1.0 are fetched from https://github.com/storytold/craft-libs at revision -9f75d3dc19b4b514c4f3d4847ed1ec1b0e86b4ef. The first four source snapshots were transferred +The patched hayro 0.7.1, hayro-interpret 0.7.0, hayro-syntax 0.7.2, hayro-jbig2 0.3.0, +hayro-cmap 0.1.0 and hayro-postscript 0.1.0 are fetched from +https://github.com/storytold/craft-libs at revision +453b0da782ccef39be9a6dac8d27c80b553ef1cc. The first four source snapshots were transferred from https://github.com/storytold/pdfcraft at revision -7437bde378f43856eada40af25b983812e615e8a and hayro-cmap at revision -a2ec27b4775f53c40cad3456936d9406611e3a8d, then patched in craft-libs. Their upstream project is +7437bde378f43856eada40af25b983812e615e8a and re-synced to revision +ec0a965074f376a5bf610435948e4e5184bf3299, and hayro-cmap at revision +a2ec27b4775f53c40cad3456936d9406611e3a8d, then patched in craft-libs. hayro-postscript is the +crates.io package, patched in craft-libs. Their upstream project is https://github.com/LaurenzV/hayro, licensed MIT OR Apache-2.0. The snapshot retains each crate's upstream licence files. The patch ledger is at -https://github.com/storytold/craft-libs/blob/9f75d3dc19b4b514c4f3d4847ed1ec1b0e86b4ef/vendor/README.craft-reader.md. +https://github.com/storytold/craft-libs/blob/453b0da782ccef39be9a6dac8d27c80b553ef1cc/vendor/README.craft-reader.md. Per-crate vendor/SOURCE.json files record transferred and local source hashes; asset origins and unchanged per-file hashes are recorded separately in ASSETS.md. diff --git a/crates/ui-egui/src/updates_ui.rs b/crates/ui-egui/src/updates_ui.rs index 19aafd3a0..5414a4815 100644 --- a/crates/ui-egui/src/updates_ui.rs +++ b/crates/ui-egui/src/updates_ui.rs @@ -158,10 +158,9 @@ mod tests { } /// Offers `release` and returns once its prompt is open. The updater reads the installed files - /// for an offer on a thread of its own, which asks the context the updater keeps for a repaint - /// when it answers; the next tick opens the prompt. Each immediate repaint request is followed - /// by a tick until the prompt opens. A copy the launcher manages ignores the offer and fails - /// the test. + /// for an offer on a thread of its own. That thread sends its answer and then asks the context + /// the updater keeps for an immediate repaint, and the next tick opens the prompt. The test + /// fails when the offer opens no prompt, for example when the launcher manages this copy. #[cfg(not(target_arch = "wasm32"))] fn offer_and_wait(updater: &mut Updater, release: craft_update::Release) { let ctx = egui::Context::default(); @@ -175,10 +174,12 @@ mod tests { updater.tick(&ctx); updater.offer(release); assert!(updater.managed().is_none(), "the launcher manages this copy, so it ignored the offer"); - while !updater.prompt_open() { + // Without its thread, the offer opens the prompt at once. + if !updater.prompt_open() { wait.recv().unwrap(); updater.tick(&ctx); } + assert!(updater.prompt_open(), "the offer opened no prompt (launcher choice: {:?})", updater.managed()); } #[test] From 56bedabc775fbcfb72171a7176cac2095d0cab6f Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 23:34:05 -0800 Subject: [PATCH 08/12] IDML: a placed SVG's viewBox size comes from its root tag alone svg_viewbox_size reads only the root's start tag instead of parsing the whole file, so placing the same large linked SVG many times no longer parses it each time. Files over 16 MiB still give no size. A viewBox with a value that is not a number, such as "0 0 junk 200 100", now gives no size, so the frame's GraphicBounds size the graphic; before, the bad value was dropped and the other numbers were read as the viewBox. --- crates/idml/src/import/item.rs | 17 +++++++++++------ crates/idml/src/tests/assets.rs | 10 ++++++++-- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/crates/idml/src/import/item.rs b/crates/idml/src/import/item.rs index f5407af47..996024c2c 100644 --- a/crates/idml/src/import/item.rs +++ b/crates/idml/src/import/item.rs @@ -11,15 +11,20 @@ const INDESIGN_CORNER_SIZE: f64 = 12.0; /// The viewBox size of an SVG whose root has a viewBox but no width or height (percentages count /// as none): such a file is placed at one viewBox unit to the point. A leading UTF-8 byte order -/// mark is skipped. The XML parse is bounded to 16 MiB. +/// mark is skipped. Only the root's start tag is read, and a file over 16 MiB gives no size. A +/// viewBox with a value that is not a number gives no size. fn svg_viewbox_size(data: &[u8]) -> Option<(f64, f64)> { let data = data.strip_prefix(b"\xEF\xBB\xBF").unwrap_or(data); - if data.iter().find(|b| !b.is_ascii_whitespace()) != Some(&b'<') { + if data.len() > 16 << 20 || data.iter().find(|b| !b.is_ascii_whitespace()) != Some(&b'<') { return None; } - let mut options = craft_xml::Options::default(); - options.limits.max_input = 16 << 20; - let root = options.parse(data).ok()?; + let text = craft_xml::to_utf8(data); + let mut events = craft_xml::Options::default().events(&text); + let root = loop { + if let craft_xml::Event::Start { name, attrs } = events.next().ok()?? { + break craft_xml::El { name, attrs, children: Vec::new() }; + } + }; if root.local() != "svg" { return None; } @@ -29,7 +34,7 @@ fn svg_viewbox_size(data: &[u8]) -> Option<(f64, f64)> { return None; } let vb: Vec = - attr("viewBox")?.split(|c: char| c.is_whitespace() || c == ',').filter(|v| !v.is_empty()).filter_map(|v| v.parse().ok()).collect(); + attr("viewBox")?.split(|c: char| c.is_whitespace() || c == ',').filter(|v| !v.is_empty()).map(|v| v.parse().ok()).collect::>()?; match vb[..] { [_, _, w, h] if w.is_finite() && h.is_finite() && w > 0.0 && h > 0.0 => Some((w, h)), _ => None, diff --git a/crates/idml/src/tests/assets.rs b/crates/idml/src/tests/assets.rs index ee4d7d949..0d35624cc 100644 --- a/crates/idml/src/tests/assets.rs +++ b/crates/idml/src/tests/assets.rs @@ -270,16 +270,19 @@ fn placed_svg_with_only_a_viewbox_keeps_its_viewbox_size() { "/art/overhang.svg" => Some(OVERHANG.as_bytes().to_vec()), "/art/sized.svg" => Some(SIZED.as_bytes().to_vec()), "/art/bom.svg" => Some(format!("\u{feff}{OVERHANG}").into_bytes()), + "/art/junk.svg" => Some(OVERHANG.replace("0 0 200 100", "0 0 junk 200 100").into_bytes()), _ => None, }; // GraphicBounds are the art's bounds: 211 wide for the overhanging one, placed twice (the second // reuses the first's asset); a sized SVG is still stretched onto its bounds. A file that starts - // with a UTF-8 byte order mark keeps its viewBox size too. + // with a UTF-8 byte order mark keeps its viewBox size too. A viewBox with a value that is not a + // number gives no size, so its bounds size it. let frames = vec![ frame(1, 0.0, 0.0, &svg(1, "file:/art/overhang.svg", [-11.0, 0.0, 200.0, 100.0])), frame(2, 100.0, 0.0, &svg(2, "file:/art/overhang.svg", [-11.0, 0.0, 200.0, 100.0])), frame(3, 200.0, 0.0, &svg(3, "file:/art/sized.svg", [-10.0, 0.0, 200.0, 100.0])), frame(4, 300.0, 0.0, &svg(4, "file:/art/bom.svg", [-11.0, 0.0, 200.0, 100.0])), + frame(5, 400.0, 0.0, &svg(5, "file:/art/junk.svg", [-10.0, 0.0, 200.0, 100.0])), ]; let d = import_idml_with(&package(&frames), &reader).unwrap(); let mut gs: Vec<_> = d.spreads[0] @@ -292,7 +295,10 @@ fn placed_svg_with_only_a_viewbox_keeps_its_viewbox_size() { .collect(); gs.sort_by(|a, b| a.0.total_cmp(&b.0)); let got: Vec<_> = gs.into_iter().map(|(_, size, x)| (size, x)).collect(); - assert_eq!(got, vec![((200.0, 100.0), -11.0), ((200.0, 100.0), -11.0), ((210.0, 100.0), -10.0), ((200.0, 100.0), -11.0)]); + assert_eq!( + got, + vec![((200.0, 100.0), -11.0), ((200.0, 100.0), -11.0), ((210.0, 100.0), -10.0), ((200.0, 100.0), -11.0), ((210.0, 100.0), -10.0)] + ); } /// `PDFAttribute/@PageNumber` (1-based) is read into `Asset.page` (0-based), and the same file at From 21ddca734464c6f41547826b31e6fd2e9f536433 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 17:50:02 -0800 Subject: [PATCH 09/12] IDML: a placed SVG's root tag is read with craft-xml's first_start svg_viewbox_size reads the root's start tag with Options::first_start and a pattern that matches any name, in place of its own event loop. A file whose root is not an svg element still gives no viewBox size; the placement test has a case for it. --- crates/idml/src/import/item.rs | 18 +++++++++++------- crates/idml/src/tests/assets.rs | 13 +++++++++++-- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/crates/idml/src/import/item.rs b/crates/idml/src/import/item.rs index 996024c2c..5a8bd1f02 100644 --- a/crates/idml/src/import/item.rs +++ b/crates/idml/src/import/item.rs @@ -9,6 +9,16 @@ use super::{ /// InDesign's corner size when a corner shape is set without an explicit radius. const INDESIGN_CORNER_SIZE: f64 = 12.0; +/// Matches any element name, so `first_start` returns the root's start tag. +#[derive(Clone, Copy)] +struct AnyTag; + +impl craft_xml::Pat for AnyTag { + fn matches(self, _: &str) -> bool { + true + } +} + /// The viewBox size of an SVG whose root has a viewBox but no width or height (percentages count /// as none): such a file is placed at one viewBox unit to the point. A leading UTF-8 byte order /// mark is skipped. Only the root's start tag is read, and a file over 16 MiB gives no size. A @@ -18,13 +28,7 @@ fn svg_viewbox_size(data: &[u8]) -> Option<(f64, f64)> { if data.len() > 16 << 20 || data.iter().find(|b| !b.is_ascii_whitespace()) != Some(&b'<') { return None; } - let text = craft_xml::to_utf8(data); - let mut events = craft_xml::Options::default().events(&text); - let root = loop { - if let craft_xml::Event::Start { name, attrs } = events.next().ok()?? { - break craft_xml::El { name, attrs, children: Vec::new() }; - } - }; + let root = craft_xml::Options::default().first_start(data, AnyTag)?; if root.local() != "svg" { return None; } diff --git a/crates/idml/src/tests/assets.rs b/crates/idml/src/tests/assets.rs index 0d35624cc..6c49dae66 100644 --- a/crates/idml/src/tests/assets.rs +++ b/crates/idml/src/tests/assets.rs @@ -271,18 +271,20 @@ fn placed_svg_with_only_a_viewbox_keeps_its_viewbox_size() { "/art/sized.svg" => Some(SIZED.as_bytes().to_vec()), "/art/bom.svg" => Some(format!("\u{feff}{OVERHANG}").into_bytes()), "/art/junk.svg" => Some(OVERHANG.replace("0 0 200 100", "0 0 junk 200 100").into_bytes()), + "/art/nested.svg" => Some(format!("{OVERHANG}").into_bytes()), _ => None, }; // GraphicBounds are the art's bounds: 211 wide for the overhanging one, placed twice (the second // reuses the first's asset); a sized SVG is still stretched onto its bounds. A file that starts // with a UTF-8 byte order mark keeps its viewBox size too. A viewBox with a value that is not a - // number gives no size, so its bounds size it. + // number gives no size, so its bounds size it, as they do when the root is not an `svg` element. let frames = vec![ frame(1, 0.0, 0.0, &svg(1, "file:/art/overhang.svg", [-11.0, 0.0, 200.0, 100.0])), frame(2, 100.0, 0.0, &svg(2, "file:/art/overhang.svg", [-11.0, 0.0, 200.0, 100.0])), frame(3, 200.0, 0.0, &svg(3, "file:/art/sized.svg", [-10.0, 0.0, 200.0, 100.0])), frame(4, 300.0, 0.0, &svg(4, "file:/art/bom.svg", [-11.0, 0.0, 200.0, 100.0])), frame(5, 400.0, 0.0, &svg(5, "file:/art/junk.svg", [-10.0, 0.0, 200.0, 100.0])), + frame(6, 500.0, 0.0, &svg(6, "file:/art/nested.svg", [-10.0, 0.0, 200.0, 100.0])), ]; let d = import_idml_with(&package(&frames), &reader).unwrap(); let mut gs: Vec<_> = d.spreads[0] @@ -297,7 +299,14 @@ fn placed_svg_with_only_a_viewbox_keeps_its_viewbox_size() { let got: Vec<_> = gs.into_iter().map(|(_, size, x)| (size, x)).collect(); assert_eq!( got, - vec![((200.0, 100.0), -11.0), ((200.0, 100.0), -11.0), ((210.0, 100.0), -10.0), ((200.0, 100.0), -11.0), ((210.0, 100.0), -10.0)] + vec![ + ((200.0, 100.0), -11.0), + ((200.0, 100.0), -11.0), + ((210.0, 100.0), -10.0), + ((200.0, 100.0), -11.0), + ((210.0, 100.0), -10.0), + ((210.0, 100.0), -10.0) + ] ); } From b23918dfbe96412ea0da9691c9562a130dc9dd2f Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 15:31:44 -0800 Subject: [PATCH 10/12] Cargo: drop the unused craft-xml-dtd alias again The merge of main kept the craft-xml-dtd alias at craft-libs a5ac3aa05c, which this branch had removed. No crate uses it, and Cargo.lock does not change. --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 4716d90b0..4cd2c75e2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,6 @@ craft-idml = { git = "https://github.com/storytold/craft-libs", rev = "453b0da78 craft-indd = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0", features = ["tree-render", "tree-text"] } craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } -craft-xml-dtd = { package = "craft-xml", git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.1.0" } craft-rtf = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } craft-xlsx = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } craft-docx = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", version = "=0.1.0" } From 06324f52910184e6fa9bfac16d8aaedfba5a226c Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 19 Nov 2026 15:46:38 +0100 Subject: [PATCH 11/12] chore: resolve shared BMP dependency pin with Cargo [skip ci] --- Cargo.lock | 125 +++++++++++++++++++++++++---------------------------- 1 file changed, 58 insertions(+), 67 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1e42e8bad..6440d8b19 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1083,7 +1083,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "rustix 1.1.5", ] @@ -1091,12 +1091,12 @@ dependencies = [ [[package]] name = "craft-cfb" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "md-5", "rayon", @@ -1105,12 +1105,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" [[package]] name = "craft-csv" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "thiserror 2.0.21", ] @@ -1118,7 +1118,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "rayon", ] @@ -1126,10 +1126,10 @@ dependencies = [ [[package]] name = "craft-designcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "craft-document-bundle", - "craft-eps 0.1.0 (git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc)", + "craft-eps", "serde", "serde_json", "thiserror 2.0.21", @@ -1138,7 +1138,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "block2 0.6.2", "objc2 0.6.5", @@ -1151,12 +1151,12 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" [[package]] name = "craft-document-bundle" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "craft-zip", "serde_json", @@ -1167,7 +1167,7 @@ dependencies = [ [[package]] name = "craft-docx" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "base64 0.23.1", "chrono", @@ -1187,7 +1187,7 @@ dependencies = [ [[package]] name = "craft-drawingml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "craft-xml", "kurbo", @@ -1198,17 +1198,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" - -[[package]] -name = "craft-eps" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5bd7eb9e88e8574a9cd011accaa9b4beaf4118ac#5bd7eb9e88e8574a9cd011accaa9b4beaf4118ac" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" [[package]] name = "craft-epub" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "craft-xml", "craft-zip", @@ -1218,9 +1213,9 @@ dependencies = [ [[package]] name = "craft-file-formats" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ - "craft-eps 0.1.0 (git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc)", + "craft-eps", "craft-idml", "craft-svg", "craft-zip", @@ -1231,12 +1226,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "fixed_decimal", "icu_decimal", @@ -1259,7 +1254,7 @@ dependencies = [ [[package]] name = "craft-idml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "craft-xml", "craft-zip", @@ -1269,7 +1264,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "craft-dds", "craft-jpeg", @@ -1296,7 +1291,7 @@ dependencies = [ [[package]] name = "craft-indd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "indd", ] @@ -1304,7 +1299,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "thiserror 2.0.21", ] @@ -1312,7 +1307,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "craft-i18n", "craft-ui", @@ -1324,7 +1319,7 @@ dependencies = [ [[package]] name = "craft-math" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "craft-xml", "serde", @@ -1333,7 +1328,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "brotli-decompressor 6.3.1", "chrono", @@ -1345,7 +1340,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "chrono", "craft-codepage", @@ -1355,7 +1350,7 @@ dependencies = [ [[package]] name = "craft-offcrypto" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "aes", "base64 0.23.1", @@ -1372,7 +1367,7 @@ dependencies = [ [[package]] name = "craft-opc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "craft-xml", "craft-zip", @@ -1383,7 +1378,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "bytemuck", "craft-svg", @@ -1399,7 +1394,7 @@ dependencies = [ [[package]] name = "craft-pptx" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "craft-drawingml", "craft-opc", @@ -1414,7 +1409,7 @@ dependencies = [ [[package]] name = "craft-prepress" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "craft-cms", "craft-pdf", @@ -1427,7 +1422,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "craft-winprint-gdi", "log", @@ -1441,9 +1436,9 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5bd7eb9e88e8574a9cd011accaa9b4beaf4118ac#5bd7eb9e88e8574a9cd011accaa9b4beaf4118ac" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ - "craft-eps 0.1.0 (git+https://github.com/storytold/craft-libs?rev=5bd7eb9e88e8574a9cd011accaa9b4beaf4118ac)", + "craft-eps", "kurbo", "miniz_oxide 0.8.9", "pdf-writer", @@ -1454,7 +1449,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "encoding_rs", "flate2", @@ -1465,7 +1460,7 @@ dependencies = [ [[package]] name = "craft-rtf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "craft-codepage", "encoding_rs", @@ -1474,17 +1469,19 @@ dependencies = [ [[package]] name = "craft-sheet" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "craft-image-codecs", "craft-xml", "data-url", "flate2", + "gif", + "image-webp", "kurbo", "quick-xml 0.41.0", "resvg 0.48.1", @@ -1498,7 +1495,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "serde", "thiserror 2.0.21", @@ -1507,7 +1504,7 @@ dependencies = [ [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "craft-fonts-build", "craft-i18n", @@ -1528,7 +1525,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "chrono", "dunce", @@ -1555,7 +1552,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "egui", "objc2 0.6.5", @@ -1574,7 +1571,7 @@ dependencies = [ [[package]] name = "craft-wordmodel" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "base64 0.23.1", "craft-math", @@ -1588,7 +1585,7 @@ dependencies = [ [[package]] name = "craft-xlsx" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "craft-drawingml", "craft-opc", @@ -1600,7 +1597,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "quick-xml 0.41.0", "serde", @@ -1610,7 +1607,7 @@ dependencies = [ [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "flate2", "thiserror 2.0.21", @@ -1962,9 +1959,10 @@ name = "designcraft-images" version = "0.21.0" dependencies = [ "craft-cms", - "craft-eps 0.1.0 (git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc)", + "craft-eps", "craft-file-formats", "craft-image-codecs", + "craft-jpeg", "craft-ps", "craft-psd", "craft-svg", @@ -1972,7 +1970,6 @@ dependencies = [ "designcraft-fonts", "flate2", "image", - "jpeg-decoder", "log", "quick-xml 0.41.0", "skrifa 0.47.0", @@ -3210,7 +3207,7 @@ dependencies = [ [[package]] name = "hayro" version = "0.7.1" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "bytemuck", "hayro-interpret", @@ -3230,7 +3227,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "brotli", "hayro-postscript", @@ -3239,7 +3236,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3257,7 +3254,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3275,12 +3272,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "flate2", "hayro-ccitt", @@ -3858,12 +3855,6 @@ dependencies = [ "libc", ] -[[package]] -name = "jpeg-decoder" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00810f1d8b74be64b13dbf3db89ac67740615d6c891f0e7b6179326533011a07" - [[package]] name = "jpeg-encoder" version = "0.6.1" @@ -3921,7 +3912,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc" +source = "git+https://github.com/storytold/craft-libs?rev=30a568b97fa2927d2217f98ba9c799bc76102144#30a568b97fa2927d2217f98ba9c799bc76102144" dependencies = [ "base64 0.22.1", "bumpalo", From 81ca3defc4cd983014324d38653315ab692942ab Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 19 Nov 2026 16:01:54 +0100 Subject: [PATCH 12/12] refactor: use shared BMP density probe [skip ci] --- crates/images/src/resolution.rs | 11 ++--------- crates/images/src/tests.rs | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/crates/images/src/resolution.rs b/crates/images/src/resolution.rs index d797d7cd8..15fcd6687 100644 --- a/crates/images/src/resolution.rs +++ b/crates/images/src/resolution.rs @@ -232,13 +232,6 @@ fn webp_resolution(bytes: &[u8]) -> Option<(f64, f64)> { /// BITMAPINFOHEADER pixels-per-meter (offset 38/42): meters → dpi. fn bmp_resolution(bytes: &[u8]) -> Option<(f64, f64)> { - if bytes.len() < 46 || u32::from_le_bytes(bytes.get(14..18)?.try_into().ok()?) < 40 { - return None; - } - let ppm = |i: usize| -> Option { Some(i32::from_le_bytes(bytes.get(i..i + 4)?.try_into().ok()?)) }; - let (x, y) = (ppm(38)?, ppm(42)?); - if x > 0 && y > 0 { - return Some((x as f64 * 0.0254, y as f64 * 0.0254)); - } - None + let (x, y) = craft_image_codecs::bmp_probe::pixels_per_meter(bytes)?; + Some((f64::from(x) * 0.0254, f64::from(y) * 0.0254)) } diff --git a/crates/images/src/tests.rs b/crates/images/src/tests.rs index 08533f11b..7a750c280 100644 --- a/crates/images/src/tests.rs +++ b/crates/images/src/tests.rs @@ -853,6 +853,30 @@ fn bmp_density_sets_natural_size() { assert_eq!(natural_size(&flat), Some((600.0, 900.0))); } +#[test] +fn bmp_density_preserves_unrounded_axes_and_placement_policy() { + let mut bmp = bmp_with_ppm(11811); + bmp[42..46].copy_from_slice(&23622i32.to_le_bytes()); + let (x, y) = raster_resolution(&bmp).unwrap(); + assert!((x - 299.9994).abs() < 1e-9, "{x}"); + assert!((y - 599.9988).abs() < 1e-9, "{y}"); + let (w, h) = natural_size(&bmp).unwrap(); + assert!((w - 144.000288000576).abs() < 1e-9, "{w}"); + assert!((h - 108.000216000432).abs() < 1e-9, "{h}"); + for (x, y) in [(1, 11811), (11811, 1), (i32::MAX, 11811), (11811, i32::MAX)] { + bmp[38..42].copy_from_slice(&x.to_le_bytes()); + bmp[42..46].copy_from_slice(&y.to_le_bytes()); + assert!(raster_resolution(&bmp).is_some()); + assert_eq!(natural_size(&bmp), Some((600.0, 900.0))); + } + for (x, y) in [(0i32, 11811i32), (-1, 11811), (11811, 0), (11811, -1)] { + bmp[38..42].copy_from_slice(&x.to_le_bytes()); + bmp[42..46].copy_from_slice(&y.to_le_bytes()); + assert_eq!(raster_resolution(&bmp), None); + assert_eq!(natural_size(&bmp), Some((600.0, 900.0))); + } +} + #[test] fn tiff_resolution_tags_set_natural_size() { use tiff::encoder::colortype::Gray8;