@stll/folio-core 0.17.0 → 0.17.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.
@@ -1074,10 +1074,11 @@ function renderLine(block, line, alignment, doc, options) {
1074
1074
  if (alignment === "justify" && options) {
1075
1075
  if (!options.isLastLine || options.paragraphEndsWithLineBreak) {
1076
1076
  const firstLineIndentPx = options.isFirstLine ? options.firstLineIndentPx ?? 0 : 0;
1077
+ const firstLinePositiveIndentPx = Math.max(0, firstLineIndentPx);
1077
1078
  const firstLineHangingPx = Math.max(0, -firstLineIndentPx);
1078
1079
  const hasVisibleListMarker = options.isFirstLine && block.attrs?.listMarker && !block.attrs.listMarkerHidden;
1079
1080
  const firstLineHangingExpansionPx = hasVisibleListMarker ? Math.min(firstLineHangingPx, Math.max(0, options.leftIndentPx ?? 0)) : firstLineHangingPx;
1080
- const justifyCapacityPx = options.availableWidth + firstLineHangingExpansionPx;
1081
+ const justifyCapacityPx = options.availableWidth - firstLinePositiveIndentPx + firstLineHangingExpansionPx;
1081
1082
  const overfullPx = line.width - justifyCapacityPx;
1082
1083
  const shrinkableSpaces = countShrinkableSpaces(runsForLine.filter((run) => !isTextRun(run) || !isCollapsedLineEdgeSpaceRun(run)), options.context);
1083
1084
  if (overfullPx > RIGHT_EDGE_EPSILON_PX && shrinkableSpaces > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/folio-core",
3
- "version": "0.17.0",
3
+ "version": "0.17.1",
4
4
  "description": "Headless, framework-neutral core of folio: the OOXML (.docx) parser, document model, ProseMirror integration, and page-layout engine. No React.",
5
5
  "keywords": [
6
6
  "document-model",