@harbour-enterprises/superdoc 1.0.0-beta.55 → 1.0.0-beta.57

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.
Files changed (27) hide show
  1. package/dist/chunks/{PdfViewer-ARRkZgYS.es.js → PdfViewer-BpJ5YJmq.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-ObG30G-u.cjs → PdfViewer-DvAhx37Y.cjs} +1 -1
  3. package/dist/chunks/{index-Bwqb03qi.es.js → index-BE9w4viZ.es.js} +3 -3
  4. package/dist/chunks/{index-DFHwDXHd.cjs → index-BbXDEDIW.cjs} +3 -3
  5. package/dist/chunks/{index-bqjMjne1-DBB94Dlj.es.js → index-D5IkZjf9-CPmfOXHq.es.js} +1 -1
  6. package/dist/chunks/{index-bqjMjne1-CJi4d9NS.cjs → index-D5IkZjf9-XnnWMFi7.cjs} +1 -1
  7. package/dist/chunks/{super-editor.es-7Twgz-8H.es.js → super-editor.es-BY9i51n2.es.js} +131 -38
  8. package/dist/chunks/{super-editor.es-C2Ob7BbN.cjs → super-editor.es-BjELk3Xl.cjs} +131 -38
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-D33MGATy.js → converter-Aoe_RSZD.js} +1 -1
  11. package/dist/super-editor/chunks/{docx-zipper-C7Fp89_I.js → docx-zipper-Ct68kitw.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-BiFHsy25.js → editor-Dfqm3VkC.js} +132 -39
  13. package/dist/super-editor/chunks/{index-bqjMjne1.js → index-D5IkZjf9.js} +1 -1
  14. package/dist/super-editor/chunks/{toolbar-BNta2qOv.js → toolbar-Dj_HCM6i.js} +2 -2
  15. package/dist/super-editor/converter.es.js +1 -1
  16. package/dist/super-editor/docx-zipper.es.js +2 -2
  17. package/dist/super-editor/editor.es.js +3 -3
  18. package/dist/super-editor/file-zipper.es.js +1 -1
  19. package/dist/super-editor/super-editor.es.js +6 -6
  20. package/dist/super-editor/toolbar.es.js +2 -2
  21. package/dist/super-editor.cjs +1 -1
  22. package/dist/super-editor.es.js +1 -1
  23. package/dist/superdoc.cjs +2 -2
  24. package/dist/superdoc.es.js +2 -2
  25. package/dist/superdoc.umd.js +133 -40
  26. package/dist/superdoc.umd.js.map +1 -1
  27. package/package.json +1 -1
@@ -42185,7 +42185,7 @@ const _SuperConverter = class _SuperConverter2 {
42185
42185
  static getStoredSuperdocVersion(docx) {
42186
42186
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
42187
42187
  }
42188
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.55") {
42188
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.57") {
42189
42189
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
42190
42190
  }
42191
42191
  /**
@@ -59367,7 +59367,7 @@ const isHeadless = (editor) => {
59367
59367
  const shouldSkipNodeView = (editor) => {
59368
59368
  return isHeadless(editor);
59369
59369
  };
59370
- const summaryVersion = "1.0.0-beta.55";
59370
+ const summaryVersion = "1.0.0-beta.57";
59371
59371
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
59372
59372
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
59373
59373
  function mapAttributes(attrs) {
@@ -60156,7 +60156,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
60156
60156
  { default: remarkStringify },
60157
60157
  { default: remarkGfm }
60158
60158
  ] = await Promise.all([
60159
- Promise.resolve().then(() => require("./index-bqjMjne1-CJi4d9NS.cjs")),
60159
+ Promise.resolve().then(() => require("./index-D5IkZjf9-XnnWMFi7.cjs")),
60160
60160
  Promise.resolve().then(() => require("./index-DRCvimau-H4Ck3S9a.cjs")),
60161
60161
  Promise.resolve().then(() => require("./index-C_x_N6Uh-Db3CUJMX.cjs")),
60162
60162
  Promise.resolve().then(() => require("./index-D_sWOSiG-BtDZzJ6I.cjs")),
@@ -60361,7 +60361,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
60361
60361
  * Process collaboration migrations
60362
60362
  */
60363
60363
  processCollaborationMigrations() {
60364
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.55");
60364
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.57");
60365
60365
  if (!this.options.ydoc) return;
60366
60366
  const metaMap = this.options.ydoc.getMap("meta");
60367
60367
  let docVersion = metaMap.get("version");
@@ -61308,7 +61308,15 @@ const VALID_TRACKED_MODES = ["review", "original", "final", "off"];
61308
61308
  const DEFAULT_HYPERLINK_CONFIG$1 = {
61309
61309
  enableRichHyperlinks: false
61310
61310
  };
61311
- const ATOMIC_INLINE_TYPES = /* @__PURE__ */ new Set(["image", "hardBreak", "lineBreak", "page-number", "total-page-number"]);
61311
+ const ATOMIC_INLINE_TYPES = /* @__PURE__ */ new Set([
61312
+ "image",
61313
+ "hardBreak",
61314
+ "lineBreak",
61315
+ "page-number",
61316
+ "total-page-number",
61317
+ "passthroughInline",
61318
+ "bookmarkEnd"
61319
+ ]);
61312
61320
  const TOKEN_INLINE_TYPES = /* @__PURE__ */ new Map([
61313
61321
  ["page-number", "pageNumber"],
61314
61322
  ["total-page-number", "totalPageCount"]
@@ -62829,6 +62837,7 @@ const normalizeAlignment = (value) => {
62829
62837
  case "center":
62830
62838
  case "right":
62831
62839
  case "justify":
62840
+ case "left":
62832
62841
  return value;
62833
62842
  case "both":
62834
62843
  case "distribute":
@@ -72384,9 +72393,11 @@ const _DomPainter = class _DomPainter2 {
72384
72393
  const hasExplicitSegmentPositioning = line.segments?.some((seg) => seg.x !== void 0);
72385
72394
  const isFirstLine = index2 === 0 && !fragment.continuesFromPrev;
72386
72395
  if (!isListFirstLine) {
72387
- if (isFirstLine && hasExplicitSegmentPositioning && firstLineOffset !== 0) {
72388
- const adjustedPadding = paraIndentLeft + firstLineOffset;
72389
- lineEl.style.paddingLeft = `${adjustedPadding}px`;
72396
+ if (hasExplicitSegmentPositioning) {
72397
+ if (isFirstLine && firstLineOffset !== 0) {
72398
+ const adjustedPadding = paraIndentLeft + firstLineOffset;
72399
+ lineEl.style.paddingLeft = `${adjustedPadding}px`;
72400
+ }
72390
72401
  } else if (paraIndentLeft) {
72391
72402
  lineEl.style.paddingLeft = `${paraIndentLeft}px`;
72392
72403
  }
@@ -73817,6 +73828,13 @@ const _DomPainter = class _DomPainter2 {
73817
73828
  }
73818
73829
  }
73819
73830
  if (hasExplicitPositioning && line.segments) {
73831
+ const paraIndent = block.attrs?.indent;
73832
+ const indentLeft = paraIndent?.left ?? 0;
73833
+ const firstLine = paraIndent?.firstLine ?? 0;
73834
+ const hanging = paraIndent?.hanging ?? 0;
73835
+ const isFirstLineOfPara = lineIndex === 0 || lineIndex === void 0;
73836
+ const firstLineOffsetForCumX = isFirstLineOfPara ? firstLine - hanging : 0;
73837
+ const indentOffset = indentLeft + firstLineOffsetForCumX;
73820
73838
  let cumulativeX = 0;
73821
73839
  const segmentsByRun = /* @__PURE__ */ new Map();
73822
73840
  line.segments.forEach((segment) => {
@@ -73848,7 +73866,7 @@ const _DomPainter = class _DomPainter2 {
73848
73866
  const actualTabWidth = tabEndX - tabStartX;
73849
73867
  const tabEl = this.doc.createElement("span");
73850
73868
  tabEl.style.position = "absolute";
73851
- tabEl.style.left = `${tabStartX}px`;
73869
+ tabEl.style.left = `${tabStartX + indentOffset}px`;
73852
73870
  tabEl.style.top = "0px";
73853
73871
  tabEl.style.width = `${actualTabWidth}px`;
73854
73872
  tabEl.style.height = `${line.lineHeight}px`;
@@ -73879,12 +73897,13 @@ const _DomPainter = class _DomPainter2 {
73879
73897
  elem.setAttribute("styleid", styleId);
73880
73898
  }
73881
73899
  const runSegments2 = segmentsByRun.get(runIndex);
73882
- const segX = runSegments2 && runSegments2[0]?.x !== void 0 ? runSegments2[0].x : cumulativeX;
73900
+ const baseSegX = runSegments2 && runSegments2[0]?.x !== void 0 ? runSegments2[0].x : cumulativeX;
73901
+ const segX = baseSegX + indentOffset;
73883
73902
  const segWidth = (runSegments2 && runSegments2[0]?.width !== void 0 ? runSegments2[0].width : elem.offsetWidth) ?? 0;
73884
73903
  elem.style.position = "absolute";
73885
73904
  elem.style.left = `${segX}px`;
73886
73905
  el.appendChild(elem);
73887
- cumulativeX = segX + segWidth;
73906
+ cumulativeX = baseSegX + segWidth;
73888
73907
  }
73889
73908
  continue;
73890
73909
  }
@@ -73901,12 +73920,13 @@ const _DomPainter = class _DomPainter2 {
73901
73920
  elem.setAttribute("styleid", styleId);
73902
73921
  }
73903
73922
  const runSegments2 = segmentsByRun.get(runIndex);
73904
- const segX = runSegments2 && runSegments2[0]?.x !== void 0 ? runSegments2[0].x : cumulativeX;
73923
+ const baseSegX = runSegments2 && runSegments2[0]?.x !== void 0 ? runSegments2[0].x : cumulativeX;
73924
+ const segX = baseSegX + indentOffset;
73905
73925
  const segWidth = (runSegments2 && runSegments2[0]?.width !== void 0 ? runSegments2[0].width : 0) ?? 0;
73906
73926
  elem.style.position = "absolute";
73907
73927
  elem.style.left = `${segX}px`;
73908
73928
  el.appendChild(elem);
73909
- cumulativeX = segX + segWidth;
73929
+ cumulativeX = baseSegX + segWidth;
73910
73930
  }
73911
73931
  continue;
73912
73932
  }
@@ -73936,7 +73956,8 @@ const _DomPainter = class _DomPainter2 {
73936
73956
  if (styleId) {
73937
73957
  elem.setAttribute("styleid", styleId);
73938
73958
  }
73939
- const xPos = segment.x !== void 0 ? segment.x : cumulativeX;
73959
+ const baseX = segment.x !== void 0 ? segment.x : cumulativeX;
73960
+ const xPos = baseX + indentOffset;
73940
73961
  elem.style.position = "absolute";
73941
73962
  elem.style.left = `${xPos}px`;
73942
73963
  el.appendChild(elem);
@@ -73950,7 +73971,7 @@ const _DomPainter = class _DomPainter2 {
73950
73971
  width = measureEl.offsetWidth;
73951
73972
  this.doc.body.removeChild(measureEl);
73952
73973
  }
73953
- cumulativeX = xPos + width;
73974
+ cumulativeX = baseX + width;
73954
73975
  }
73955
73976
  });
73956
73977
  }
@@ -76340,6 +76361,32 @@ function layoutDrawingBlock({
76340
76361
  state2.page.fragments.push(fragment);
76341
76362
  state2.cursorY += requiredHeight;
76342
76363
  }
76364
+ function getTableIndentWidth(attrs) {
76365
+ if (!attrs) {
76366
+ return 0;
76367
+ }
76368
+ const tableIndent = attrs.tableIndent;
76369
+ if (!tableIndent || typeof tableIndent !== "object") {
76370
+ return 0;
76371
+ }
76372
+ const width = tableIndent.width;
76373
+ if (width === void 0 || width === null) {
76374
+ return 0;
76375
+ }
76376
+ if (typeof width !== "number") {
76377
+ return 0;
76378
+ }
76379
+ if (!Number.isFinite(width)) {
76380
+ return 0;
76381
+ }
76382
+ return width;
76383
+ }
76384
+ function applyTableIndent(x2, width, indent) {
76385
+ return {
76386
+ x: x2 + indent,
76387
+ width: Math.max(0, width - indent)
76388
+ };
76389
+ }
76343
76390
  function calculateColumnMinWidth(columnIndex, measure) {
76344
76391
  const DEFAULT_MIN_WIDTH = 25;
76345
76392
  const measuredWidth = measure.columnWidths[columnIndex] || DEFAULT_MIN_WIDTH;
@@ -76554,14 +76601,18 @@ function layoutMonolithicTable(context) {
76554
76601
  columnBoundaries: generateColumnBoundaries(context.measure),
76555
76602
  coordinateSystem: "fragment"
76556
76603
  };
76604
+ const tableIndent = getTableIndentWidth(context.block.attrs);
76605
+ const baseX = context.columnX(state2.columnIndex);
76606
+ const baseWidth = Math.min(context.columnWidth, context.measure.totalWidth || context.columnWidth);
76607
+ const { x: x2, width } = applyTableIndent(baseX, baseWidth, tableIndent);
76557
76608
  const fragment = {
76558
76609
  kind: "table",
76559
76610
  blockId: context.block.id,
76560
76611
  fromRow: 0,
76561
76612
  toRow: context.block.rows.length,
76562
- x: context.columnX(state2.columnIndex),
76613
+ x: x2,
76563
76614
  y: state2.cursorY,
76564
- width: Math.min(context.columnWidth, context.measure.totalWidth || context.columnWidth),
76615
+ width,
76565
76616
  height,
76566
76617
  metadata
76567
76618
  };
@@ -76628,14 +76679,18 @@ function layoutTableBlock({
76628
76679
  columnBoundaries: generateColumnBoundaries(measure),
76629
76680
  coordinateSystem: "fragment"
76630
76681
  };
76682
+ const tableIndent = getTableIndentWidth(block.attrs);
76683
+ const baseX = columnX(state2.columnIndex);
76684
+ const baseWidth = Math.min(columnWidth, measure.totalWidth || columnWidth);
76685
+ const { x: x2, width } = applyTableIndent(baseX, baseWidth, tableIndent);
76631
76686
  const fragment = {
76632
76687
  kind: "table",
76633
76688
  blockId: block.id,
76634
76689
  fromRow: 0,
76635
76690
  toRow: 0,
76636
- x: columnX(state2.columnIndex),
76691
+ x: x2,
76637
76692
  y: state2.cursorY,
76638
- width: Math.min(columnWidth, measure.totalWidth || columnWidth),
76693
+ width,
76639
76694
  height,
76640
76695
  metadata
76641
76696
  };
@@ -76683,14 +76738,18 @@ function layoutTableBlock({
76683
76738
  });
76684
76739
  const fragmentHeight2 = continuationPartialRow.partialHeight + (repeatHeaderCount > 0 ? headerHeight : 0);
76685
76740
  if (fragmentHeight2 > 0 && madeProgress) {
76741
+ const tableIndent2 = getTableIndentWidth(block.attrs);
76742
+ const baseX2 = columnX(state2.columnIndex);
76743
+ const baseWidth2 = Math.min(columnWidth, measure.totalWidth || columnWidth);
76744
+ const { x: x22, width: width2 } = applyTableIndent(baseX2, baseWidth2, tableIndent2);
76686
76745
  const fragment2 = {
76687
76746
  kind: "table",
76688
76747
  blockId: block.id,
76689
76748
  fromRow: rowIndex,
76690
76749
  toRow: rowIndex + 1,
76691
- x: columnX(state2.columnIndex),
76750
+ x: x22,
76692
76751
  y: state2.cursorY,
76693
- width: Math.min(columnWidth, measure.totalWidth || columnWidth),
76752
+ width: width2,
76694
76753
  height: fragmentHeight2,
76695
76754
  continuesFromPrev: true,
76696
76755
  continuesOnNext: hasRemainingLinesAfterContinuation || rowIndex + 1 < block.rows.length,
@@ -76723,14 +76782,18 @@ function layoutTableBlock({
76723
76782
  const forcedPartialRow = computePartialRow(bodyStartRow, block.rows[bodyStartRow], measure, availableForBody);
76724
76783
  const forcedEndRow = bodyStartRow + 1;
76725
76784
  const fragmentHeight2 = forcedPartialRow.partialHeight + (repeatHeaderCount > 0 ? headerHeight : 0);
76785
+ const tableIndent2 = getTableIndentWidth(block.attrs);
76786
+ const baseX2 = columnX(state2.columnIndex);
76787
+ const baseWidth2 = Math.min(columnWidth, measure.totalWidth || columnWidth);
76788
+ const { x: x22, width: width2 } = applyTableIndent(baseX2, baseWidth2, tableIndent2);
76726
76789
  const fragment2 = {
76727
76790
  kind: "table",
76728
76791
  blockId: block.id,
76729
76792
  fromRow: bodyStartRow,
76730
76793
  toRow: forcedEndRow,
76731
- x: columnX(state2.columnIndex),
76794
+ x: x22,
76732
76795
  y: state2.cursorY,
76733
- width: Math.min(columnWidth, measure.totalWidth || columnWidth),
76796
+ width: width2,
76734
76797
  height: fragmentHeight2,
76735
76798
  continuesFromPrev: isTableContinuation,
76736
76799
  continuesOnNext: !forcedPartialRow.isLastPart || forcedEndRow < block.rows.length,
@@ -76754,14 +76817,18 @@ function layoutTableBlock({
76754
76817
  measure
76755
76818
  );
76756
76819
  }
76820
+ const tableIndent = getTableIndentWidth(block.attrs);
76821
+ const baseX = columnX(state2.columnIndex);
76822
+ const baseWidth = Math.min(columnWidth, measure.totalWidth || columnWidth);
76823
+ const { x: x2, width } = applyTableIndent(baseX, baseWidth, tableIndent);
76757
76824
  const fragment = {
76758
76825
  kind: "table",
76759
76826
  blockId: block.id,
76760
76827
  fromRow: bodyStartRow,
76761
76828
  toRow: endRow,
76762
- x: columnX(state2.columnIndex),
76829
+ x: x2,
76763
76830
  y: state2.cursorY,
76764
- width: Math.min(columnWidth, measure.totalWidth || columnWidth),
76831
+ width,
76765
76832
  height: fragmentHeight,
76766
76833
  continuesFromPrev: isTableContinuation,
76767
76834
  continuesOnNext: endRow < block.rows.length || (partialRow ? !partialRow.isLastPart : false),
@@ -79932,6 +79999,7 @@ const rangesOverlap = (startA, endA, startB, endB) => {
79932
79999
  return effectiveEndA > startB && startA < endB;
79933
80000
  };
79934
80001
  function hitTestPage(layout, point) {
80002
+ const pageGap = layout.pageGap ?? 0;
79935
80003
  let cursorY = 0;
79936
80004
  for (let pageIndex = 0; pageIndex < layout.pages.length; pageIndex += 1) {
79937
80005
  const page = layout.pages[pageIndex];
@@ -79940,7 +80008,7 @@ function hitTestPage(layout, point) {
79940
80008
  if (point.y >= top2 && point.y < bottom2) {
79941
80009
  return { pageIndex, page };
79942
80010
  }
79943
- cursorY = bottom2;
80011
+ cursorY = bottom2 + pageGap;
79944
80012
  }
79945
80013
  return null;
79946
80014
  }
@@ -80149,9 +80217,10 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
80149
80217
  if (!pageHit) {
80150
80218
  return null;
80151
80219
  }
80220
+ const pageGap = layout.pageGap ?? 0;
80152
80221
  const pageRelativePoint = {
80153
80222
  x: containerPoint.x,
80154
- y: containerPoint.y - pageHit.pageIndex * layout.pageSize.h
80223
+ y: containerPoint.y - pageHit.pageIndex * (layout.pageSize.h + pageGap)
80155
80224
  };
80156
80225
  logClickStage("log", "page-hit", {
80157
80226
  pageIndex: pageHit.pageIndex
@@ -80372,7 +80441,7 @@ function selectionToRects(layout, blocks, measures, from2, to) {
80372
80441
  const rectY = fragment.y + lineOffset;
80373
80442
  rects.push({
80374
80443
  x: rectX,
80375
- y: rectY + pageIndex * layout.pageSize.h,
80444
+ y: rectY + pageIndex * (layout.pageSize.h + (layout.pageGap ?? 0)),
80376
80445
  width: rectWidth,
80377
80446
  height: line.lineHeight,
80378
80447
  pageIndex
@@ -80489,7 +80558,7 @@ function selectionToRects(layout, blocks, measures, from2, to) {
80489
80558
  const rectY = fragment.y + rowOffset + blockTopCursor + lineOffset;
80490
80559
  rects.push({
80491
80560
  x: rectX,
80492
- y: rectY + pageIndex * layout.pageSize.h,
80561
+ y: rectY + pageIndex * (layout.pageSize.h + (layout.pageGap ?? 0)),
80493
80562
  width: rectWidth,
80494
80563
  height: line.lineHeight,
80495
80564
  pageIndex
@@ -80518,7 +80587,7 @@ function selectionToRects(layout, blocks, measures, from2, to) {
80518
80587
  if (!rangesOverlap(pmRange.pmStart, pmRange.pmEnd, from2, to)) return;
80519
80588
  rects.push({
80520
80589
  x: fragment.x,
80521
- y: fragment.y + pageIndex * layout.pageSize.h,
80590
+ y: fragment.y + pageIndex * (layout.pageSize.h + (layout.pageGap ?? 0)),
80522
80591
  width: fragment.width,
80523
80592
  height: fragment.height,
80524
80593
  pageIndex
@@ -81547,7 +81616,15 @@ async function measureParagraphBlock(block, maxWidth) {
81547
81616
  currentLine.width = roundValue(currentLine.width + boundarySpacing + wordOnlyWidth);
81548
81617
  currentLine.maxFontInfo = updateMaxFontInfo(currentLine.maxFontSize, currentLine.maxFontInfo, run2);
81549
81618
  currentLine.maxFontSize = Math.max(currentLine.maxFontSize, run2.fontSize);
81550
- appendSegment(currentLine.segments, runIndex, wordStartChar, wordEndNoSpace, wordOnlyWidth, segmentStartX);
81619
+ const useExplicitXHere = wordIndex === 0 && segmentStartX !== void 0;
81620
+ appendSegment(
81621
+ currentLine.segments,
81622
+ runIndex,
81623
+ wordStartChar,
81624
+ wordEndNoSpace,
81625
+ wordOnlyWidth,
81626
+ useExplicitXHere ? segmentStartX : void 0
81627
+ );
81551
81628
  const metrics = calculateTypographyMetrics(currentLine.maxFontSize, spacing, currentLine.maxFontInfo);
81552
81629
  const completedLine = { ...currentLine, ...metrics };
81553
81630
  addBarTabsToLine(completedLine);
@@ -83432,6 +83509,8 @@ function isValidFieldAnnotationAttributes(attrs) {
83432
83509
  const FIELD_ANNOTATION_DATA_TYPE = "fieldAnnotation";
83433
83510
  const DEFAULT_PAGE_SIZE = { w: 612, h: 792 };
83434
83511
  const DEFAULT_MARGINS = { top: 72, right: 72, bottom: 72, left: 72 };
83512
+ const DEFAULT_VIRTUALIZED_PAGE_GAP = 72;
83513
+ const DEFAULT_PAGE_GAP = 24;
83435
83514
  const WORD_CHARACTER_REGEX = /[\p{L}\p{N}''_~-]/u;
83436
83515
  const MULTI_CLICK_TIME_THRESHOLD_MS = 400;
83437
83516
  const MULTI_CLICK_DISTANCE_THRESHOLD_PX = 5;
@@ -84506,8 +84585,9 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
84506
84585
  const rawRects = layoutRectSource();
84507
84586
  if (!rawRects.length) return [];
84508
84587
  const pageHeight = __privateGet$1(this, _session).mode === "body" ? __privateMethod$1(this, _PresentationEditor_instances, getBodyPageHeight_fn).call(this) : __privateMethod$1(this, _PresentationEditor_instances, getHeaderFooterPageHeight_fn).call(this);
84588
+ const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
84509
84589
  return rawRects.map((rect) => {
84510
- const pageLocalY = rect.y - rect.pageIndex * pageHeight;
84590
+ const pageLocalY = rect.y - rect.pageIndex * (pageHeight + pageGap);
84511
84591
  const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, rect.pageIndex, rect.x, pageLocalY);
84512
84592
  if (!coords) return null;
84513
84593
  const absLeft = coords.x * zoom + overlayRect.left;
@@ -84759,7 +84839,8 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
84759
84839
  return null;
84760
84840
  }
84761
84841
  const pageHeight = __privateMethod$1(this, _PresentationEditor_instances, getBodyPageHeight_fn).call(this);
84762
- const pageLocalY = rect2.y - rect2.pageIndex * pageHeight;
84842
+ const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
84843
+ const pageLocalY = rect2.y - rect2.pageIndex * (pageHeight + pageGap);
84763
84844
  const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, rect2.pageIndex, rect2.x, pageLocalY);
84764
84845
  if (!coords) {
84765
84846
  return null;
@@ -85503,10 +85584,11 @@ renderRemoteSelection_fn = function(cursor) {
85503
85584
  const color = __privateMethod$1(this, _PresentationEditor_instances, getValidatedColor_fn).call(this, cursor);
85504
85585
  const opacity = __privateGet$1(this, _layoutOptions).presence?.highlightOpacity ?? 0.35;
85505
85586
  const pageHeight = layout.pageSize?.h ?? __privateGet$1(this, _layoutOptions).pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
85587
+ const pageGap = layout.pageGap ?? 0;
85506
85588
  const doc2 = __privateGet$1(this, _visibleHost).ownerDocument ?? document;
85507
85589
  const limitedRects = rects.slice(0, MAX_SELECTION_RECTS_PER_USER);
85508
85590
  limitedRects.forEach((rect) => {
85509
- const pageLocalY = rect.y - rect.pageIndex * pageHeight;
85591
+ const pageLocalY = rect.y - rect.pageIndex * (pageHeight + pageGap);
85510
85592
  const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, rect.pageIndex, rect.x, pageLocalY);
85511
85593
  if (!coords) return;
85512
85594
  const selectionEl = doc2.createElement("div");
@@ -85969,6 +86051,12 @@ rerender_fn = async function() {
85969
86051
  return;
85970
86052
  }
85971
86053
  ({ layout, measures } = result);
86054
+ if (__privateGet$1(this, _layoutOptions).virtualization?.enabled) {
86055
+ const gap = __privateGet$1(this, _layoutOptions).virtualization.gap ?? DEFAULT_VIRTUALIZED_PAGE_GAP;
86056
+ layout.pageGap = Math.max(0, gap);
86057
+ } else {
86058
+ layout.pageGap = DEFAULT_PAGE_GAP;
86059
+ }
85972
86060
  headerLayouts = result.headers;
85973
86061
  footerLayouts = result.footers;
85974
86062
  } catch (error) {
@@ -86456,9 +86544,10 @@ hitTestHeaderFooterRegion_fn = function(x2, y2) {
86456
86544
  const layout = __privateGet$1(this, _layoutState).layout;
86457
86545
  if (!layout) return null;
86458
86546
  const pageHeight = layout.pageSize?.h ?? __privateGet$1(this, _layoutOptions).pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
86547
+ const pageGap = layout.pageGap ?? 0;
86459
86548
  if (pageHeight <= 0) return null;
86460
- const pageIndex = Math.max(0, Math.floor(y2 / pageHeight));
86461
- const pageLocalY = y2 - pageIndex * pageHeight;
86549
+ const pageIndex = Math.max(0, Math.floor(y2 / (pageHeight + pageGap)));
86550
+ const pageLocalY = y2 - pageIndex * (pageHeight + pageGap);
86462
86551
  const headerRegion = __privateGet$1(this, _headerRegions).get(pageIndex);
86463
86552
  if (headerRegion && __privateMethod$1(this, _PresentationEditor_instances, pointInRegion_fn).call(this, headerRegion, x2, pageLocalY)) {
86464
86553
  return headerRegion;
@@ -86883,8 +86972,9 @@ renderSelectionRects_fn = function(rects) {
86883
86972
  return;
86884
86973
  }
86885
86974
  const pageHeight = __privateMethod$1(this, _PresentationEditor_instances, getBodyPageHeight_fn).call(this);
86975
+ const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
86886
86976
  rects.forEach((rect, _index) => {
86887
- const pageLocalY = rect.y - rect.pageIndex * pageHeight;
86977
+ const pageLocalY = rect.y - rect.pageIndex * (pageHeight + pageGap);
86888
86978
  const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, rect.pageIndex, rect.x, pageLocalY);
86889
86979
  if (!coords) {
86890
86980
  return;
@@ -87142,9 +87232,10 @@ convertPageLocalToOverlayCoords_fn = function(pageIndex, pageLocalX, pageLocalY)
87142
87232
  return null;
87143
87233
  }
87144
87234
  const pageHeight = __privateGet$1(this, _layoutOptions).pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
87235
+ const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
87145
87236
  return {
87146
87237
  x: pageLocalX,
87147
- y: pageIndex * pageHeight + pageLocalY
87238
+ y: pageIndex * (pageHeight + pageGap) + pageLocalY
87148
87239
  };
87149
87240
  };
87150
87241
  normalizeClientPoint_fn = function(clientX, clientY) {
@@ -100795,6 +100886,8 @@ const PassthroughInline = Node$1.create({
100795
100886
  name: "passthroughInline",
100796
100887
  group: "inline",
100797
100888
  inline: true,
100889
+ // IMPORTANT: This node is registered in pm-adapter/src/constants.ts ATOMIC_INLINE_TYPES
100890
+ // If you change atom to false, you MUST remove it from that set to avoid positioning bugs
100798
100891
  atom: true,
100799
100892
  draggable: false,
100800
100893
  selectable: false,
@@ -1,6 +1,6 @@
1
1
  import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
2
- import { T as TextSelection } from "./chunks/converter-D33MGATy.js";
3
- import { _ as _export_sfc } from "./chunks/editor-BiFHsy25.js";
2
+ import { T as TextSelection } from "./chunks/converter-Aoe_RSZD.js";
3
+ import { _ as _export_sfc } from "./chunks/editor-Dfqm3VkC.js";
4
4
  const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
5
5
  const SYSTEM_PROMPT = "You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";
6
6
  async function baseInsightsFetch(payload, options = {}) {
@@ -42449,7 +42449,7 @@ const _SuperConverter = class _SuperConverter {
42449
42449
  static getStoredSuperdocVersion(docx) {
42450
42450
  return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
42451
42451
  }
42452
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.55") {
42452
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.57") {
42453
42453
  return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
42454
42454
  }
42455
42455
  /**
@@ -1,4 +1,4 @@
1
- import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-D33MGATy.js";
1
+ import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-Aoe_RSZD.js";
2
2
  function commonjsRequire(path) {
3
3
  throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
4
4
  }