mirror of
https://github.com/storytold/designcraft.git
synced 2026-11-14 14:22:39 +00:00
Read IDML item fields through shared model
This commit is contained in:
3 files changed
+22
-22
No files matched your search
Generated
+10
-10
@@ -1225,10 +1225,10 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-idml"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=11511e0d82a2f92ca4092eb02e8ef67cc85b42a5#11511e0d82a2f92ca4092eb02e8ef67cc85b42a5"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=3243813d8cf2932a7aafba94096a8d9c70bb2540#3243813d8cf2932a7aafba94096a8d9c70bb2540"
|
||||
dependencies = [
|
||||
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=11511e0d82a2f92ca4092eb02e8ef67cc85b42a5)",
|
||||
"craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=11511e0d82a2f92ca4092eb02e8ef67cc85b42a5)",
|
||||
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3243813d8cf2932a7aafba94096a8d9c70bb2540)",
|
||||
"craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3243813d8cf2932a7aafba94096a8d9c70bb2540)",
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
|
||||
@@ -1569,7 +1569,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-xml"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=11511e0d82a2f92ca4092eb02e8ef67cc85b42a5#11511e0d82a2f92ca4092eb02e8ef67cc85b42a5"
|
||||
source = "git+https://github.com/dylanmtaylor/craft-libs?rev=2e670cf9377b523112f3fe4b409399772c745895#2e670cf9377b523112f3fe4b409399772c745895"
|
||||
dependencies = [
|
||||
"quick-xml 0.41.0",
|
||||
"thiserror 2.0.21",
|
||||
@@ -1578,7 +1578,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-xml"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/dylanmtaylor/craft-libs?rev=2e670cf9377b523112f3fe4b409399772c745895#2e670cf9377b523112f3fe4b409399772c745895"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=3243813d8cf2932a7aafba94096a8d9c70bb2540#3243813d8cf2932a7aafba94096a8d9c70bb2540"
|
||||
dependencies = [
|
||||
"quick-xml 0.41.0",
|
||||
"thiserror 2.0.21",
|
||||
@@ -1633,7 +1633,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-zip"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=11511e0d82a2f92ca4092eb02e8ef67cc85b42a5#11511e0d82a2f92ca4092eb02e8ef67cc85b42a5"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=3243813d8cf2932a7aafba94096a8d9c70bb2540#3243813d8cf2932a7aafba94096a8d9c70bb2540"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
"thiserror 2.0.21",
|
||||
@@ -1914,7 +1914,7 @@ dependencies = [
|
||||
"craft-prepress",
|
||||
"craft-print",
|
||||
"craft-svg 0.1.0 (git+https://github.com/dylanmtaylor/craft-libs?rev=2e670cf9377b523112f3fe4b409399772c745895)",
|
||||
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=11511e0d82a2f92ca4092eb02e8ef67cc85b42a5)",
|
||||
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3243813d8cf2932a7aafba94096a8d9c70bb2540)",
|
||||
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=f23b0f33f0d00b157476533a43cbbcfd901aa1f1)",
|
||||
"designcraft-color",
|
||||
"designcraft-compose",
|
||||
@@ -1998,8 +1998,8 @@ dependencies = [
|
||||
name = "designcraft-idml"
|
||||
version = "0.20.1"
|
||||
dependencies = [
|
||||
"craft-idml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=11511e0d82a2f92ca4092eb02e8ef67cc85b42a5)",
|
||||
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=11511e0d82a2f92ca4092eb02e8ef67cc85b42a5)",
|
||||
"craft-idml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3243813d8cf2932a7aafba94096a8d9c70bb2540)",
|
||||
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3243813d8cf2932a7aafba94096a8d9c70bb2540)",
|
||||
"designcraft-color",
|
||||
"designcraft-compose",
|
||||
"designcraft-doc",
|
||||
@@ -2116,7 +2116,7 @@ version = "0.20.1"
|
||||
dependencies = [
|
||||
"craft-docx",
|
||||
"craft-file-formats",
|
||||
"craft-idml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=11511e0d82a2f92ca4092eb02e8ef67cc85b42a5)",
|
||||
"craft-idml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3243813d8cf2932a7aafba94096a8d9c70bb2540)",
|
||||
"craft-rtf",
|
||||
"craft-wordmodel",
|
||||
"craft-xlsx",
|
||||
|
||||
+2
-2
@@ -16,10 +16,10 @@ craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "4052591363
|
||||
craft-document-bundle = { git = "https://github.com/storytold/craft-libs", rev = "ba24fe2435adb3c81ad6057faf36365fbba736cf", 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 = "11511e0d82a2f92ca4092eb02e8ef67cc85b42a5", version = "=0.1.0" }
|
||||
craft-idml = { git = "https://github.com/storytold/craft-libs", rev = "3243813d8cf2932a7aafba94096a8d9c70bb2540", 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/dylanmtaylor/craft-libs", rev = "2e670cf9377b523112f3fe4b409399772c745895", version = "=0.1.0", features = ["tree-render", "tree-text"] }
|
||||
craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "11511e0d82a2f92ca4092eb02e8ef67cc85b42a5", version = "=0.1.0" }
|
||||
craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "3243813d8cf2932a7aafba94096a8d9c70bb2540", version = "=0.1.0" }
|
||||
craft-xml-dtd = { package = "craft-xml", git = "https://github.com/storytold/craft-libs", rev = "f23b0f33f0d00b157476533a43cbbcfd901aa1f1", version = "=0.1.0" }
|
||||
craft-rtf = { git = "https://github.com/storytold/craft-libs", rev = "ba24fe2435adb3c81ad6057faf36365fbba736cf", version = "=0.1.0" }
|
||||
craft-xlsx = { git = "https://github.com/storytold/craft-libs", rev = "ba24fe2435adb3c81ad6057faf36365fbba736cf", version = "=0.1.0" }
|
||||
|
||||
@@ -45,20 +45,20 @@ impl<'r> Importer<'r> {
|
||||
_ => return None,
|
||||
};
|
||||
let id = ItemId(self.alloc());
|
||||
if let Some(s) = e.get("Self") {
|
||||
if let Some(s) = model_item.self_id() {
|
||||
self.item_ids.insert(s.to_string(), id);
|
||||
}
|
||||
let layer = e.get("ItemLayer").and_then(|l| self.layer_ids.get(l)).copied().unwrap_or_else(|| self.layers[0].id);
|
||||
let layer = model_item.item_layer().and_then(|l| self.layer_ids.get(l)).copied().unwrap_or_else(|| self.layers[0].id);
|
||||
let path = path_from_model(model_item.geometry());
|
||||
let mut it = Item::new(id, layer, shape, path);
|
||||
it.xf = parent * parse_affine(e.get("ItemTransform"));
|
||||
it.name = e.get("Name").filter(|n| *n != "$ID/").unwrap_or("").to_string();
|
||||
it.locked = e.get("Locked") == Some("true");
|
||||
it.hidden = e.get("Visible") == Some("false");
|
||||
it.overrides = e.get("OverriddenPageItem").and_then(|s| self.item_ids.get(s)).copied().filter(|i| self.is_parent_item(*i));
|
||||
it.nonprinting = e.get("Nonprinting") == Some("true");
|
||||
it.object_style = e
|
||||
.get("AppliedObjectStyle")
|
||||
it.xf = parent * Affine::new(model_item.item_transform());
|
||||
it.name = model_item.name().filter(|n| *n != "$ID/").unwrap_or("").to_string();
|
||||
it.locked = model_item.locked();
|
||||
it.hidden = model_item.hidden();
|
||||
it.overrides = model_item.overridden_page_item().and_then(|s| self.item_ids.get(s)).copied().filter(|i| self.is_parent_item(*i));
|
||||
it.nonprinting = model_item.nonprinting();
|
||||
it.object_style = model_item
|
||||
.applied_object_style()
|
||||
.map(|r| {
|
||||
self.object_names
|
||||
.get(r)
|
||||
|
||||
Reference in new issue
Block a user