boxpdf-html 1.0.0 → 1.1.1

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.
@@ -434,7 +434,13 @@ var supportedCssProperties = /* @__PURE__ */ new Set([
434
434
  "min-width",
435
435
  "max-width",
436
436
  "height",
437
+ "min-height",
438
+ "max-height",
437
439
  "aspect-ratio",
440
+ "align-self",
441
+ "flex-wrap",
442
+ "opacity",
443
+ "letter-spacing",
438
444
  "margin",
439
445
  "margin-block",
440
446
  "margin-inline",
@@ -758,6 +764,31 @@ function applyDeclaration(out, property, rawValue, fontSize) {
758
764
  case "height":
759
765
  out.height = parseLength(value, fontSize);
760
766
  break;
767
+ case "min-height":
768
+ out.minHeight = parseLength(value, fontSize);
769
+ break;
770
+ case "max-height":
771
+ out.maxHeight = parseLength(value, fontSize);
772
+ break;
773
+ case "align-self":
774
+ if (value === "flex-start") out.alignSelf = "start";
775
+ else if (value === "flex-end") out.alignSelf = "end";
776
+ else if (["start", "center", "end", "stretch", "baseline"].includes(value)) {
777
+ out.alignSelf = value;
778
+ }
779
+ break;
780
+ case "flex-wrap":
781
+ if (value === "wrap") out.flexWrap = "wrap";
782
+ else if (value === "nowrap") out.flexWrap = "nowrap";
783
+ break;
784
+ case "opacity": {
785
+ const n = Number(value);
786
+ if (Number.isFinite(n)) out.opacity = Math.max(0, Math.min(1, n));
787
+ break;
788
+ }
789
+ case "letter-spacing":
790
+ if (value !== "normal") out.letterSpacing = parseLength(value, fontSize);
791
+ break;
761
792
  case "aspect-ratio":
762
793
  out.aspectRatio = parseAspectRatio(value);
763
794
  break;
@@ -1599,6 +1630,8 @@ function renderBlock(node, options, warnings, stretch = node.style.display === "
1599
1630
  {
1600
1631
  width: cssBoxWidth(node),
1601
1632
  height: cssBoxHeight(node),
1633
+ minHeight: node.style.minHeight,
1634
+ maxHeight: node.style.maxHeight,
1602
1635
  margin: node.style.margin,
1603
1636
  padding: layoutPadding(node),
1604
1637
  gap: node.style.gap ?? 0,
@@ -1614,6 +1647,8 @@ function renderBlock(node, options, warnings, stretch = node.style.display === "
1614
1647
  bottom: node.style.bottom,
1615
1648
  left: node.style.left,
1616
1649
  zIndex: node.style.zIndex,
1650
+ opacity: node.style.opacity,
1651
+ alignSelf: node.style.alignSelf,
1617
1652
  align: stretch ? "stretch" : "start"
1618
1653
  },
1619
1654
  ...children
@@ -1713,11 +1748,14 @@ function renderFlex(node, options, warnings) {
1713
1748
  const style = {
1714
1749
  width,
1715
1750
  height: cssBoxHeight(node),
1751
+ minHeight: node.style.minHeight,
1752
+ maxHeight: node.style.maxHeight,
1716
1753
  margin: node.style.margin,
1717
1754
  padding: layoutPadding(node),
1718
1755
  gap: node.style.gap ?? 0,
1719
1756
  align: node.style.alignItems,
1720
1757
  justify: children.justify,
1758
+ wrap: node.style.flexWrap === "wrap",
1721
1759
  background: node.style.background,
1722
1760
  backgroundImage: backgroundImage(node, options),
1723
1761
  border: border(node),
@@ -1729,7 +1767,9 @@ function renderFlex(node, options, warnings) {
1729
1767
  right: node.style.right,
1730
1768
  bottom: node.style.bottom,
1731
1769
  left: node.style.left,
1732
- zIndex: node.style.zIndex
1770
+ zIndex: node.style.zIndex,
1771
+ opacity: node.style.opacity,
1772
+ alignSelf: node.style.alignSelf
1733
1773
  };
1734
1774
  return node.style.flexDirection.startsWith("row") ? hstack(style, ...children.nodes) : vstack(style, ...children.nodes);
1735
1775
  }
@@ -1771,6 +1811,8 @@ function renderGrid(node, options, warnings) {
1771
1811
  {
1772
1812
  width: cssBoxWidth(node),
1773
1813
  height: cssBoxHeight(node),
1814
+ minHeight: node.style.minHeight,
1815
+ maxHeight: node.style.maxHeight,
1774
1816
  margin: node.style.margin,
1775
1817
  padding: layoutPadding(node),
1776
1818
  gap: node.style.rowGap ?? node.style.gap ?? 0,
@@ -1785,7 +1827,9 @@ function renderGrid(node, options, warnings) {
1785
1827
  right: node.style.right,
1786
1828
  bottom: node.style.bottom,
1787
1829
  left: node.style.left,
1788
- zIndex: node.style.zIndex
1830
+ zIndex: node.style.zIndex,
1831
+ opacity: node.style.opacity,
1832
+ alignSelf: node.style.alignSelf
1789
1833
  },
1790
1834
  ...rows
1791
1835
  );
@@ -2313,7 +2357,8 @@ function textOptions(node, options) {
2313
2357
  width: node.style.width,
2314
2358
  wrap: shouldWrap(node.style),
2315
2359
  align: node.style.textAlign,
2316
- margin: node.style.margin
2360
+ margin: node.style.margin,
2361
+ opacity: node.style.opacity
2317
2362
  };
2318
2363
  }
2319
2364
  function runStyle(node, options) {
@@ -2323,7 +2368,8 @@ function runStyle(node, options) {
2323
2368
  color: node.style.color ?? options.defaultColor,
2324
2369
  lineHeight: node.style.lineHeight,
2325
2370
  underline: node.style.textDecorationLine === "underline",
2326
- strikethrough: node.style.textDecorationLine === "line-through"
2371
+ strikethrough: node.style.textDecorationLine === "line-through",
2372
+ letterSpacing: node.style.letterSpacing
2327
2373
  };
2328
2374
  }
2329
2375
  function fontFor(node, options) {
@@ -2482,7 +2528,13 @@ function defaultsForTag(tag, inherited) {
2482
2528
  maxWidthPercent: void 0,
2483
2529
  maxWidthCalc: void 0,
2484
2530
  height: void 0,
2531
+ minHeight: void 0,
2532
+ maxHeight: void 0,
2485
2533
  aspectRatio: void 0,
2534
+ alignSelf: void 0,
2535
+ flexWrap: void 0,
2536
+ opacity: void 0,
2537
+ letterSpacing: void 0,
2486
2538
  position: void 0,
2487
2539
  top: void 0,
2488
2540
  right: void 0,
@@ -2564,13 +2616,22 @@ function inherit(style) {
2564
2616
  maxWidthPercent: void 0,
2565
2617
  maxWidthCalc: void 0,
2566
2618
  height: void 0,
2619
+ minHeight: void 0,
2620
+ maxHeight: void 0,
2567
2621
  aspectRatio: void 0,
2622
+ alignSelf: void 0,
2623
+ flexWrap: void 0,
2624
+ opacity: void 0,
2568
2625
  position: void 0,
2569
2626
  top: void 0,
2570
2627
  right: void 0,
2571
2628
  bottom: void 0,
2572
2629
  left: void 0,
2573
2630
  zIndex: void 0,
2631
+ flexDirection: "row",
2632
+ alignItems: "stretch",
2633
+ justifyContent: "start",
2634
+ gap: void 0,
2574
2635
  columnGap: void 0,
2575
2636
  rowGap: void 0,
2576
2637
  gridTemplateColumns: void 0,
@@ -2819,4 +2880,4 @@ export {
2819
2880
  fontFamily,
2820
2881
  htmlToBoxpdf
2821
2882
  };
2822
- //# sourceMappingURL=chunk-23KN7BKZ.js.map
2883
+ //# sourceMappingURL=chunk-PGLA67N2.js.map