@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 CHANGED
@@ -29027,6 +29027,8 @@ function DocxEditorViewer({
29027
29027
  );
29028
29028
  return;
29029
29029
  }
29030
+ const rootElement = viewerRootRef.current;
29031
+ const zoomScale = resolveViewerMeasurementZoomScale(rootElement, 1);
29030
29032
  const nextHeightsByPage = trackedChangesByPage.map(
29031
29033
  (annotations, pageIndex) => {
29032
29034
  const pageHeights = /* @__PURE__ */ new Map();
@@ -29038,7 +29040,7 @@ function DocxEditorViewer({
29038
29040
  return;
29039
29041
  }
29040
29042
  const measuredHeight = Math.round(
29041
- cardElement.getBoundingClientRect().height
29043
+ cardElement.getBoundingClientRect().height / zoomScale
29042
29044
  );
29043
29045
  if (!Number.isFinite(measuredHeight) || measuredHeight <= 0) {
29044
29046
  return;
@@ -42881,16 +42883,28 @@ ${currentText.slice(end)}`;
42881
42883
  boxSizing: "border-box",
42882
42884
  zIndex: 0
42883
42885
  } : void 0;
42886
+ const pageTrackedChanges = positionedTrackedChangesByPage[pageIndex] ?? [];
42887
+ const pageGutterContentHeightPx = showTrackedChangeGutter && pageTrackedChanges.length > 0 ? pageTrackedChanges.reduce((maxBottomPx, entry) => {
42888
+ return Math.max(
42889
+ maxBottomPx,
42890
+ Math.ceil(
42891
+ entry.top + entry.heightPx + TRACKED_CHANGE_GUTTER_CARD_GAP_PX + 8
42892
+ )
42893
+ );
42894
+ }, pageLayout.pageHeightPx) : pageLayout.pageHeightPx;
42895
+ const pageVisualHeightPx = Math.max(
42896
+ pageLayout.pageHeightPx,
42897
+ pageGutterContentHeightPx
42898
+ );
42884
42899
  const pageSurfaceStyle = {
42885
42900
  ...pageSurfaceBaseStyle,
42886
42901
  width: pageLayout.pageWidthPx,
42887
- height: pageLayout.pageHeightPx,
42888
- minHeight: pageLayout.pageHeightPx,
42902
+ height: pageVisualHeightPx,
42903
+ minHeight: pageVisualHeightPx,
42889
42904
  backgroundColor: resolvedPageSurfaceBackgroundColor,
42890
42905
  position: "relative",
42891
42906
  ...pageMarginPaddingStyle(pageLayout.marginsPx)
42892
42907
  };
42893
- const pageTrackedChanges = positionedTrackedChangesByPage[pageIndex] ?? [];
42894
42908
  const pageCoverBackgroundImages = (() => {
42895
42909
  const collected = /* @__PURE__ */ new Map();
42896
42910
  const pageContentHeightPx = Math.max(
@@ -42938,7 +42952,7 @@ ${currentText.slice(end)}`;
42938
42952
  style: {
42939
42953
  position: "relative",
42940
42954
  width: pageWrapperWidthPx,
42941
- minHeight: pageLayout.pageHeightPx,
42955
+ minHeight: pageVisualHeightPx,
42942
42956
  margin: "0 auto",
42943
42957
  // Isolate per-page layout/style recalculation so scrolling and
42944
42958
  // edits on one page don't force whole-document layout passes.
@@ -43987,7 +44001,7 @@ ${currentText.slice(end)}`;
43987
44001
  left: pageLayout.pageWidthPx,
43988
44002
  top: 0,
43989
44003
  width: TRACKED_CHANGE_GUTTER_WIDTH_PX,
43990
- height: pageLayout.pageHeightPx,
44004
+ height: pageVisualHeightPx,
43991
44005
  backgroundColor: resolvedPageSurfaceBackgroundColor,
43992
44006
  pointerEvents: "none",
43993
44007
  overflow: "visible"
@@ -44010,8 +44024,8 @@ ${currentText.slice(end)}`;
44010
44024
  "svg",
44011
44025
  {
44012
44026
  width: pageLayout.pageWidthPx + TRACKED_CHANGE_GUTTER_WIDTH_PX,
44013
- height: pageLayout.pageHeightPx,
44014
- viewBox: `0 0 ${pageLayout.pageWidthPx + TRACKED_CHANGE_GUTTER_WIDTH_PX} ${pageLayout.pageHeightPx}`,
44027
+ height: pageVisualHeightPx,
44028
+ viewBox: `0 0 ${pageLayout.pageWidthPx + TRACKED_CHANGE_GUTTER_WIDTH_PX} ${pageVisualHeightPx}`,
44015
44029
  style: {
44016
44030
  position: "absolute",
44017
44031
  top: 0,
@@ -44051,7 +44065,7 @@ ${currentText.slice(end)}`;
44051
44065
  const cardCenterY = clampNumber(
44052
44066
  Math.round(entry.top + entry.heightPx / 2),
44053
44067
  8,
44054
- Math.max(8, pageLayout.pageHeightPx - 8)
44068
+ Math.max(8, pageVisualHeightPx - 8)
44055
44069
  );
44056
44070
  const connectorPath = Math.abs(cardCenterY - anchorY) <= 2 ? `M ${anchorX} ${anchorY} H ${cardAttachX}` : `M ${anchorX} ${anchorY} H ${gutterBendX} V ${cardCenterY} H ${cardAttachX}`;
44057
44071
  const revisionBarX = clampNumber(