@extend-ai/react-docx 0.7.3 → 0.7.5
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/dist/index.cjs +23 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +23 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27774,6 +27774,8 @@ function DocxEditorViewer({
|
|
|
27774
27774
|
);
|
|
27775
27775
|
return;
|
|
27776
27776
|
}
|
|
27777
|
+
const rootElement = viewerRootRef.current;
|
|
27778
|
+
const zoomScale = resolveViewerMeasurementZoomScale(rootElement, 1);
|
|
27777
27779
|
const nextHeightsByPage = trackedChangesByPage.map(
|
|
27778
27780
|
(annotations, pageIndex) => {
|
|
27779
27781
|
const pageHeights = /* @__PURE__ */ new Map();
|
|
@@ -27785,7 +27787,7 @@ function DocxEditorViewer({
|
|
|
27785
27787
|
return;
|
|
27786
27788
|
}
|
|
27787
27789
|
const measuredHeight = Math.round(
|
|
27788
|
-
cardElement.getBoundingClientRect().height
|
|
27790
|
+
cardElement.getBoundingClientRect().height / zoomScale
|
|
27789
27791
|
);
|
|
27790
27792
|
if (!Number.isFinite(measuredHeight) || measuredHeight <= 0) {
|
|
27791
27793
|
return;
|
|
@@ -41628,16 +41630,28 @@ ${currentText.slice(end)}`;
|
|
|
41628
41630
|
boxSizing: "border-box",
|
|
41629
41631
|
zIndex: 0
|
|
41630
41632
|
} : void 0;
|
|
41633
|
+
const pageTrackedChanges = positionedTrackedChangesByPage[pageIndex] ?? [];
|
|
41634
|
+
const pageGutterContentHeightPx = showTrackedChangeGutter && pageTrackedChanges.length > 0 ? pageTrackedChanges.reduce((maxBottomPx, entry) => {
|
|
41635
|
+
return Math.max(
|
|
41636
|
+
maxBottomPx,
|
|
41637
|
+
Math.ceil(
|
|
41638
|
+
entry.top + entry.heightPx + TRACKED_CHANGE_GUTTER_CARD_GAP_PX + 8
|
|
41639
|
+
)
|
|
41640
|
+
);
|
|
41641
|
+
}, pageLayout.pageHeightPx) : pageLayout.pageHeightPx;
|
|
41642
|
+
const pageVisualHeightPx = Math.max(
|
|
41643
|
+
pageLayout.pageHeightPx,
|
|
41644
|
+
pageGutterContentHeightPx
|
|
41645
|
+
);
|
|
41631
41646
|
const pageSurfaceStyle = {
|
|
41632
41647
|
...pageSurfaceBaseStyle,
|
|
41633
41648
|
width: pageLayout.pageWidthPx,
|
|
41634
|
-
height:
|
|
41635
|
-
minHeight:
|
|
41649
|
+
height: pageVisualHeightPx,
|
|
41650
|
+
minHeight: pageVisualHeightPx,
|
|
41636
41651
|
backgroundColor: resolvedPageSurfaceBackgroundColor,
|
|
41637
41652
|
position: "relative",
|
|
41638
41653
|
...pageMarginPaddingStyle(pageLayout.marginsPx)
|
|
41639
41654
|
};
|
|
41640
|
-
const pageTrackedChanges = positionedTrackedChangesByPage[pageIndex] ?? [];
|
|
41641
41655
|
const pageCoverBackgroundImages = (() => {
|
|
41642
41656
|
const collected = /* @__PURE__ */ new Map();
|
|
41643
41657
|
const pageContentHeightPx = Math.max(
|
|
@@ -41685,7 +41699,7 @@ ${currentText.slice(end)}`;
|
|
|
41685
41699
|
style: {
|
|
41686
41700
|
position: "relative",
|
|
41687
41701
|
width: pageWrapperWidthPx,
|
|
41688
|
-
minHeight:
|
|
41702
|
+
minHeight: pageVisualHeightPx,
|
|
41689
41703
|
margin: "0 auto",
|
|
41690
41704
|
// Isolate per-page layout/style recalculation so scrolling and
|
|
41691
41705
|
// edits on one page don't force whole-document layout passes.
|
|
@@ -42734,7 +42748,7 @@ ${currentText.slice(end)}`;
|
|
|
42734
42748
|
left: pageLayout.pageWidthPx,
|
|
42735
42749
|
top: 0,
|
|
42736
42750
|
width: TRACKED_CHANGE_GUTTER_WIDTH_PX,
|
|
42737
|
-
height:
|
|
42751
|
+
height: pageVisualHeightPx,
|
|
42738
42752
|
backgroundColor: resolvedPageSurfaceBackgroundColor,
|
|
42739
42753
|
pointerEvents: "none",
|
|
42740
42754
|
overflow: "visible"
|
|
@@ -42757,8 +42771,8 @@ ${currentText.slice(end)}`;
|
|
|
42757
42771
|
"svg",
|
|
42758
42772
|
{
|
|
42759
42773
|
width: pageLayout.pageWidthPx + TRACKED_CHANGE_GUTTER_WIDTH_PX,
|
|
42760
|
-
height:
|
|
42761
|
-
viewBox: `0 0 ${pageLayout.pageWidthPx + TRACKED_CHANGE_GUTTER_WIDTH_PX} ${
|
|
42774
|
+
height: pageVisualHeightPx,
|
|
42775
|
+
viewBox: `0 0 ${pageLayout.pageWidthPx + TRACKED_CHANGE_GUTTER_WIDTH_PX} ${pageVisualHeightPx}`,
|
|
42762
42776
|
style: {
|
|
42763
42777
|
position: "absolute",
|
|
42764
42778
|
top: 0,
|
|
@@ -42798,7 +42812,7 @@ ${currentText.slice(end)}`;
|
|
|
42798
42812
|
const cardCenterY = clampNumber(
|
|
42799
42813
|
Math.round(entry.top + entry.heightPx / 2),
|
|
42800
42814
|
8,
|
|
42801
|
-
Math.max(8,
|
|
42815
|
+
Math.max(8, pageVisualHeightPx - 8)
|
|
42802
42816
|
);
|
|
42803
42817
|
const connectorPath = Math.abs(cardCenterY - anchorY) <= 2 ? `M ${anchorX} ${anchorY} H ${cardAttachX}` : `M ${anchorX} ${anchorY} H ${gutterBendX} V ${cardCenterY} H ${cardAttachX}`;
|
|
42804
42818
|
const revisionBarX = clampNumber(
|