@imggion/html2realpdf 0.1.14 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -2
- package/dist/libhtml2realpdf.wasm +0 -0
- package/dist/preview.d.ts +26 -1
- package/dist/preview.js +170 -13
- package/dist/preview.js.map +1 -1
- package/dist/snapshot.js +44 -25
- package/dist/snapshot.js.map +1 -1
- package/package.json +1 -1
- package/skills/html2realpdf/SKILL.md +10 -1
package/dist/snapshot.js
CHANGED
|
@@ -1805,32 +1805,51 @@ function materializeComputedStyle(original, target, options, diagnostics, isSnap
|
|
|
1805
1805
|
}
|
|
1806
1806
|
}
|
|
1807
1807
|
const declarations = [];
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1808
|
+
let authoredInsets = undefined;
|
|
1809
|
+
if (preserveAuthoredInsets && position !== "static") {
|
|
1810
|
+
authoredInsets = authoredInsetOverrides(original, computed, view);
|
|
1811
|
+
}
|
|
1812
|
+
let properties = SUPPORTED_COMPUTED_PROPERTIES;
|
|
1813
|
+
if (isSvgElement(original)) {
|
|
1814
|
+
properties = [...SUPPORTED_COMPUTED_PROPERTIES, ...SVG_COMPUTED_PROPERTIES];
|
|
1815
|
+
}
|
|
1814
1816
|
for (const property of properties) {
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1817
|
+
let value = computed.getPropertyValue(property);
|
|
1818
|
+
let authoredFlowDimension = "";
|
|
1819
|
+
if (property === "display") {
|
|
1820
|
+
value = display;
|
|
1821
|
+
}
|
|
1822
|
+
else if (property === "page") {
|
|
1823
|
+
const nativePage = value.trim();
|
|
1824
|
+
const mirroredPage = computed.getPropertyValue(AUTHORED_PAGE_MIRROR).trim();
|
|
1825
|
+
if (nativePage && nativePage !== "auto") {
|
|
1826
|
+
value = nativePage;
|
|
1827
|
+
}
|
|
1828
|
+
else if (mirroredPage) {
|
|
1829
|
+
value = mirroredPage;
|
|
1830
|
+
}
|
|
1831
|
+
else {
|
|
1832
|
+
value = nativePage;
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
else {
|
|
1836
|
+
let authoredAutoMargin = "";
|
|
1837
|
+
if (isFlowDimension(property)) {
|
|
1838
|
+
authoredFlowDimension = computed.getPropertyValue(AUTHORED_FLOW_DIMENSION_MIRRORS[property]).trim();
|
|
1839
|
+
}
|
|
1840
|
+
if (isAutoMargin(property)) {
|
|
1841
|
+
authoredAutoMargin = computed.getPropertyValue(AUTHORED_AUTO_MARGIN_MIRRORS[property]).trim();
|
|
1842
|
+
}
|
|
1843
|
+
if (options.layoutContext === "page" && authoredAutoMargin === "auto") {
|
|
1844
|
+
value = "auto";
|
|
1845
|
+
}
|
|
1846
|
+
else if (authoredFlowDimension.endsWith("%")) {
|
|
1847
|
+
value = authoredFlowDimension;
|
|
1848
|
+
}
|
|
1849
|
+
else if (authoredInsets && property in authoredInsets) {
|
|
1850
|
+
value = authoredInsets[property];
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1834
1853
|
if (isFlowDimension(property)) {
|
|
1835
1854
|
if (authoredFlowDimension === "auto" || !shouldMaterializeFlowDimension(original, property, isSnapshotRoot, options.layoutContext))
|
|
1836
1855
|
continue;
|