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
@@ -1,5 +1,5 @@
1
1
  import { y as defineComponent, z as h, O as Transition, a0 as process$1, J as watchEffect, a as computed, r as ref, j as onMounted, W as onUnmounted, b as createElementBlock, o as openBlock, f as createBaseVNode, e as createCommentVNode, u as createVNode, v as unref } from "./vue-Dysv_7z5.es.js";
2
- import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-Bwqb03qi.es.js";
2
+ import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-BE9w4viZ.es.js";
3
3
  function self(vars) {
4
4
  const {
5
5
  opacityDisabled,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("./vue-jWLMl8Ts.cjs");
4
- const superdoc = require("./index-DFHwDXHd.cjs");
4
+ const superdoc = require("./index-BbXDEDIW.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -1,4 +1,4 @@
1
- import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, P as PresentationEditor, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-7Twgz-8H.es.js";
1
+ import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, P as PresentationEditor, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-BY9i51n2.es.js";
2
2
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
3
3
  import { E as EventEmitter } from "./eventemitter3-CcXAdeql.es.js";
4
4
  import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
@@ -17251,7 +17251,7 @@ const _sfc_main = {
17251
17251
  __name: "SuperDoc",
17252
17252
  emits: ["selection-update"],
17253
17253
  setup(__props, { emit: __emit }) {
17254
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-ARRkZgYS.es.js"));
17254
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-BpJ5YJmq.es.js"));
17255
17255
  const superdocStore = useSuperdocStore();
17256
17256
  const commentsStore = useCommentsStore();
17257
17257
  const {
@@ -18111,7 +18111,7 @@ class SuperDoc extends EventEmitter {
18111
18111
  this.config.colors = shuffleArray(this.config.colors);
18112
18112
  this.userColorMap = /* @__PURE__ */ new Map();
18113
18113
  this.colorIndex = 0;
18114
- this.version = "1.0.0-beta.55";
18114
+ this.version = "1.0.0-beta.57";
18115
18115
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18116
18116
  this.superdocId = config.superdocId || v4();
18117
18117
  this.colors = this.config.colors;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-C2Ob7BbN.cjs");
2
+ const superEditor_es = require("./super-editor.es-BjELk3Xl.cjs");
3
3
  const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
4
4
  const eventemitter3 = require("./eventemitter3-DQmQUge-.cjs");
5
5
  const provider = require("@hocuspocus/provider");
@@ -17268,7 +17268,7 @@ const _sfc_main = {
17268
17268
  __name: "SuperDoc",
17269
17269
  emits: ["selection-update"],
17270
17270
  setup(__props, { emit: __emit }) {
17271
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-ObG30G-u.cjs")));
17271
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-DvAhx37Y.cjs")));
17272
17272
  const superdocStore = useSuperdocStore();
17273
17273
  const commentsStore = useCommentsStore();
17274
17274
  const {
@@ -18128,7 +18128,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
18128
18128
  this.config.colors = shuffleArray(this.config.colors);
18129
18129
  this.userColorMap = /* @__PURE__ */ new Map();
18130
18130
  this.colorIndex = 0;
18131
- this.version = "1.0.0-beta.55";
18131
+ this.version = "1.0.0-beta.57";
18132
18132
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18133
18133
  this.superdocId = config.superdocId || uuid.v4();
18134
18134
  this.colors = this.config.colors;
@@ -1,4 +1,4 @@
1
- import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-7Twgz-8H.es.js";
1
+ import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-BY9i51n2.es.js";
2
2
  import { V as VFile } from "./index-CvBqQJbG-CvBqQJbG.es.js";
3
3
  function bail(error) {
4
4
  if (error) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./super-editor.es-C2Ob7BbN.cjs");
3
+ const superEditor_es = require("./super-editor.es-BjELk3Xl.cjs");
4
4
  const indexCvBqQJbG = require("./index-CvBqQJbG-Dwm0THD7.cjs");
5
5
  function bail(error) {
6
6
  if (error) {
@@ -42168,7 +42168,7 @@ const _SuperConverter = class _SuperConverter2 {
42168
42168
  static getStoredSuperdocVersion(docx) {
42169
42169
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
42170
42170
  }
42171
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.55") {
42171
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.57") {
42172
42172
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
42173
42173
  }
42174
42174
  /**
@@ -59350,7 +59350,7 @@ const isHeadless = (editor) => {
59350
59350
  const shouldSkipNodeView = (editor) => {
59351
59351
  return isHeadless(editor);
59352
59352
  };
59353
- const summaryVersion = "1.0.0-beta.55";
59353
+ const summaryVersion = "1.0.0-beta.57";
59354
59354
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
59355
59355
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
59356
59356
  function mapAttributes(attrs) {
@@ -60139,7 +60139,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
60139
60139
  { default: remarkStringify },
60140
60140
  { default: remarkGfm }
60141
60141
  ] = await Promise.all([
60142
- import("./index-bqjMjne1-DBB94Dlj.es.js"),
60142
+ import("./index-D5IkZjf9-CPmfOXHq.es.js"),
60143
60143
  import("./index-DRCvimau-Cw339678.es.js"),
60144
60144
  import("./index-C_x_N6Uh-DJn8hIEt.es.js"),
60145
60145
  import("./index-D_sWOSiG-DE96TaT5.es.js"),
@@ -60344,7 +60344,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
60344
60344
  * Process collaboration migrations
60345
60345
  */
60346
60346
  processCollaborationMigrations() {
60347
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.55");
60347
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.57");
60348
60348
  if (!this.options.ydoc) return;
60349
60349
  const metaMap = this.options.ydoc.getMap("meta");
60350
60350
  let docVersion = metaMap.get("version");
@@ -61291,7 +61291,15 @@ const VALID_TRACKED_MODES = ["review", "original", "final", "off"];
61291
61291
  const DEFAULT_HYPERLINK_CONFIG$1 = {
61292
61292
  enableRichHyperlinks: false
61293
61293
  };
61294
- const ATOMIC_INLINE_TYPES = /* @__PURE__ */ new Set(["image", "hardBreak", "lineBreak", "page-number", "total-page-number"]);
61294
+ const ATOMIC_INLINE_TYPES = /* @__PURE__ */ new Set([
61295
+ "image",
61296
+ "hardBreak",
61297
+ "lineBreak",
61298
+ "page-number",
61299
+ "total-page-number",
61300
+ "passthroughInline",
61301
+ "bookmarkEnd"
61302
+ ]);
61295
61303
  const TOKEN_INLINE_TYPES = /* @__PURE__ */ new Map([
61296
61304
  ["page-number", "pageNumber"],
61297
61305
  ["total-page-number", "totalPageCount"]
@@ -62812,6 +62820,7 @@ const normalizeAlignment = (value) => {
62812
62820
  case "center":
62813
62821
  case "right":
62814
62822
  case "justify":
62823
+ case "left":
62815
62824
  return value;
62816
62825
  case "both":
62817
62826
  case "distribute":
@@ -72367,9 +72376,11 @@ const _DomPainter = class _DomPainter2 {
72367
72376
  const hasExplicitSegmentPositioning = line.segments?.some((seg) => seg.x !== void 0);
72368
72377
  const isFirstLine = index2 === 0 && !fragment.continuesFromPrev;
72369
72378
  if (!isListFirstLine) {
72370
- if (isFirstLine && hasExplicitSegmentPositioning && firstLineOffset !== 0) {
72371
- const adjustedPadding = paraIndentLeft + firstLineOffset;
72372
- lineEl.style.paddingLeft = `${adjustedPadding}px`;
72379
+ if (hasExplicitSegmentPositioning) {
72380
+ if (isFirstLine && firstLineOffset !== 0) {
72381
+ const adjustedPadding = paraIndentLeft + firstLineOffset;
72382
+ lineEl.style.paddingLeft = `${adjustedPadding}px`;
72383
+ }
72373
72384
  } else if (paraIndentLeft) {
72374
72385
  lineEl.style.paddingLeft = `${paraIndentLeft}px`;
72375
72386
  }
@@ -73800,6 +73811,13 @@ const _DomPainter = class _DomPainter2 {
73800
73811
  }
73801
73812
  }
73802
73813
  if (hasExplicitPositioning && line.segments) {
73814
+ const paraIndent = block.attrs?.indent;
73815
+ const indentLeft = paraIndent?.left ?? 0;
73816
+ const firstLine = paraIndent?.firstLine ?? 0;
73817
+ const hanging = paraIndent?.hanging ?? 0;
73818
+ const isFirstLineOfPara = lineIndex === 0 || lineIndex === void 0;
73819
+ const firstLineOffsetForCumX = isFirstLineOfPara ? firstLine - hanging : 0;
73820
+ const indentOffset = indentLeft + firstLineOffsetForCumX;
73803
73821
  let cumulativeX = 0;
73804
73822
  const segmentsByRun = /* @__PURE__ */ new Map();
73805
73823
  line.segments.forEach((segment) => {
@@ -73831,7 +73849,7 @@ const _DomPainter = class _DomPainter2 {
73831
73849
  const actualTabWidth = tabEndX - tabStartX;
73832
73850
  const tabEl = this.doc.createElement("span");
73833
73851
  tabEl.style.position = "absolute";
73834
- tabEl.style.left = `${tabStartX}px`;
73852
+ tabEl.style.left = `${tabStartX + indentOffset}px`;
73835
73853
  tabEl.style.top = "0px";
73836
73854
  tabEl.style.width = `${actualTabWidth}px`;
73837
73855
  tabEl.style.height = `${line.lineHeight}px`;
@@ -73862,12 +73880,13 @@ const _DomPainter = class _DomPainter2 {
73862
73880
  elem.setAttribute("styleid", styleId);
73863
73881
  }
73864
73882
  const runSegments2 = segmentsByRun.get(runIndex);
73865
- const segX = runSegments2 && runSegments2[0]?.x !== void 0 ? runSegments2[0].x : cumulativeX;
73883
+ const baseSegX = runSegments2 && runSegments2[0]?.x !== void 0 ? runSegments2[0].x : cumulativeX;
73884
+ const segX = baseSegX + indentOffset;
73866
73885
  const segWidth = (runSegments2 && runSegments2[0]?.width !== void 0 ? runSegments2[0].width : elem.offsetWidth) ?? 0;
73867
73886
  elem.style.position = "absolute";
73868
73887
  elem.style.left = `${segX}px`;
73869
73888
  el.appendChild(elem);
73870
- cumulativeX = segX + segWidth;
73889
+ cumulativeX = baseSegX + segWidth;
73871
73890
  }
73872
73891
  continue;
73873
73892
  }
@@ -73884,12 +73903,13 @@ const _DomPainter = class _DomPainter2 {
73884
73903
  elem.setAttribute("styleid", styleId);
73885
73904
  }
73886
73905
  const runSegments2 = segmentsByRun.get(runIndex);
73887
- const segX = runSegments2 && runSegments2[0]?.x !== void 0 ? runSegments2[0].x : cumulativeX;
73906
+ const baseSegX = runSegments2 && runSegments2[0]?.x !== void 0 ? runSegments2[0].x : cumulativeX;
73907
+ const segX = baseSegX + indentOffset;
73888
73908
  const segWidth = (runSegments2 && runSegments2[0]?.width !== void 0 ? runSegments2[0].width : 0) ?? 0;
73889
73909
  elem.style.position = "absolute";
73890
73910
  elem.style.left = `${segX}px`;
73891
73911
  el.appendChild(elem);
73892
- cumulativeX = segX + segWidth;
73912
+ cumulativeX = baseSegX + segWidth;
73893
73913
  }
73894
73914
  continue;
73895
73915
  }
@@ -73919,7 +73939,8 @@ const _DomPainter = class _DomPainter2 {
73919
73939
  if (styleId) {
73920
73940
  elem.setAttribute("styleid", styleId);
73921
73941
  }
73922
- const xPos = segment.x !== void 0 ? segment.x : cumulativeX;
73942
+ const baseX = segment.x !== void 0 ? segment.x : cumulativeX;
73943
+ const xPos = baseX + indentOffset;
73923
73944
  elem.style.position = "absolute";
73924
73945
  elem.style.left = `${xPos}px`;
73925
73946
  el.appendChild(elem);
@@ -73933,7 +73954,7 @@ const _DomPainter = class _DomPainter2 {
73933
73954
  width = measureEl.offsetWidth;
73934
73955
  this.doc.body.removeChild(measureEl);
73935
73956
  }
73936
- cumulativeX = xPos + width;
73957
+ cumulativeX = baseX + width;
73937
73958
  }
73938
73959
  });
73939
73960
  }
@@ -76323,6 +76344,32 @@ function layoutDrawingBlock({
76323
76344
  state2.page.fragments.push(fragment);
76324
76345
  state2.cursorY += requiredHeight;
76325
76346
  }
76347
+ function getTableIndentWidth(attrs) {
76348
+ if (!attrs) {
76349
+ return 0;
76350
+ }
76351
+ const tableIndent = attrs.tableIndent;
76352
+ if (!tableIndent || typeof tableIndent !== "object") {
76353
+ return 0;
76354
+ }
76355
+ const width = tableIndent.width;
76356
+ if (width === void 0 || width === null) {
76357
+ return 0;
76358
+ }
76359
+ if (typeof width !== "number") {
76360
+ return 0;
76361
+ }
76362
+ if (!Number.isFinite(width)) {
76363
+ return 0;
76364
+ }
76365
+ return width;
76366
+ }
76367
+ function applyTableIndent(x2, width, indent) {
76368
+ return {
76369
+ x: x2 + indent,
76370
+ width: Math.max(0, width - indent)
76371
+ };
76372
+ }
76326
76373
  function calculateColumnMinWidth(columnIndex, measure) {
76327
76374
  const DEFAULT_MIN_WIDTH = 25;
76328
76375
  const measuredWidth = measure.columnWidths[columnIndex] || DEFAULT_MIN_WIDTH;
@@ -76537,14 +76584,18 @@ function layoutMonolithicTable(context) {
76537
76584
  columnBoundaries: generateColumnBoundaries(context.measure),
76538
76585
  coordinateSystem: "fragment"
76539
76586
  };
76587
+ const tableIndent = getTableIndentWidth(context.block.attrs);
76588
+ const baseX = context.columnX(state2.columnIndex);
76589
+ const baseWidth = Math.min(context.columnWidth, context.measure.totalWidth || context.columnWidth);
76590
+ const { x: x2, width } = applyTableIndent(baseX, baseWidth, tableIndent);
76540
76591
  const fragment = {
76541
76592
  kind: "table",
76542
76593
  blockId: context.block.id,
76543
76594
  fromRow: 0,
76544
76595
  toRow: context.block.rows.length,
76545
- x: context.columnX(state2.columnIndex),
76596
+ x: x2,
76546
76597
  y: state2.cursorY,
76547
- width: Math.min(context.columnWidth, context.measure.totalWidth || context.columnWidth),
76598
+ width,
76548
76599
  height,
76549
76600
  metadata
76550
76601
  };
@@ -76611,14 +76662,18 @@ function layoutTableBlock({
76611
76662
  columnBoundaries: generateColumnBoundaries(measure),
76612
76663
  coordinateSystem: "fragment"
76613
76664
  };
76665
+ const tableIndent = getTableIndentWidth(block.attrs);
76666
+ const baseX = columnX(state2.columnIndex);
76667
+ const baseWidth = Math.min(columnWidth, measure.totalWidth || columnWidth);
76668
+ const { x: x2, width } = applyTableIndent(baseX, baseWidth, tableIndent);
76614
76669
  const fragment = {
76615
76670
  kind: "table",
76616
76671
  blockId: block.id,
76617
76672
  fromRow: 0,
76618
76673
  toRow: 0,
76619
- x: columnX(state2.columnIndex),
76674
+ x: x2,
76620
76675
  y: state2.cursorY,
76621
- width: Math.min(columnWidth, measure.totalWidth || columnWidth),
76676
+ width,
76622
76677
  height,
76623
76678
  metadata
76624
76679
  };
@@ -76666,14 +76721,18 @@ function layoutTableBlock({
76666
76721
  });
76667
76722
  const fragmentHeight2 = continuationPartialRow.partialHeight + (repeatHeaderCount > 0 ? headerHeight : 0);
76668
76723
  if (fragmentHeight2 > 0 && madeProgress) {
76724
+ const tableIndent2 = getTableIndentWidth(block.attrs);
76725
+ const baseX2 = columnX(state2.columnIndex);
76726
+ const baseWidth2 = Math.min(columnWidth, measure.totalWidth || columnWidth);
76727
+ const { x: x22, width: width2 } = applyTableIndent(baseX2, baseWidth2, tableIndent2);
76669
76728
  const fragment2 = {
76670
76729
  kind: "table",
76671
76730
  blockId: block.id,
76672
76731
  fromRow: rowIndex,
76673
76732
  toRow: rowIndex + 1,
76674
- x: columnX(state2.columnIndex),
76733
+ x: x22,
76675
76734
  y: state2.cursorY,
76676
- width: Math.min(columnWidth, measure.totalWidth || columnWidth),
76735
+ width: width2,
76677
76736
  height: fragmentHeight2,
76678
76737
  continuesFromPrev: true,
76679
76738
  continuesOnNext: hasRemainingLinesAfterContinuation || rowIndex + 1 < block.rows.length,
@@ -76706,14 +76765,18 @@ function layoutTableBlock({
76706
76765
  const forcedPartialRow = computePartialRow(bodyStartRow, block.rows[bodyStartRow], measure, availableForBody);
76707
76766
  const forcedEndRow = bodyStartRow + 1;
76708
76767
  const fragmentHeight2 = forcedPartialRow.partialHeight + (repeatHeaderCount > 0 ? headerHeight : 0);
76768
+ const tableIndent2 = getTableIndentWidth(block.attrs);
76769
+ const baseX2 = columnX(state2.columnIndex);
76770
+ const baseWidth2 = Math.min(columnWidth, measure.totalWidth || columnWidth);
76771
+ const { x: x22, width: width2 } = applyTableIndent(baseX2, baseWidth2, tableIndent2);
76709
76772
  const fragment2 = {
76710
76773
  kind: "table",
76711
76774
  blockId: block.id,
76712
76775
  fromRow: bodyStartRow,
76713
76776
  toRow: forcedEndRow,
76714
- x: columnX(state2.columnIndex),
76777
+ x: x22,
76715
76778
  y: state2.cursorY,
76716
- width: Math.min(columnWidth, measure.totalWidth || columnWidth),
76779
+ width: width2,
76717
76780
  height: fragmentHeight2,
76718
76781
  continuesFromPrev: isTableContinuation,
76719
76782
  continuesOnNext: !forcedPartialRow.isLastPart || forcedEndRow < block.rows.length,
@@ -76737,14 +76800,18 @@ function layoutTableBlock({
76737
76800
  measure
76738
76801
  );
76739
76802
  }
76803
+ const tableIndent = getTableIndentWidth(block.attrs);
76804
+ const baseX = columnX(state2.columnIndex);
76805
+ const baseWidth = Math.min(columnWidth, measure.totalWidth || columnWidth);
76806
+ const { x: x2, width } = applyTableIndent(baseX, baseWidth, tableIndent);
76740
76807
  const fragment = {
76741
76808
  kind: "table",
76742
76809
  blockId: block.id,
76743
76810
  fromRow: bodyStartRow,
76744
76811
  toRow: endRow,
76745
- x: columnX(state2.columnIndex),
76812
+ x: x2,
76746
76813
  y: state2.cursorY,
76747
- width: Math.min(columnWidth, measure.totalWidth || columnWidth),
76814
+ width,
76748
76815
  height: fragmentHeight,
76749
76816
  continuesFromPrev: isTableContinuation,
76750
76817
  continuesOnNext: endRow < block.rows.length || (partialRow ? !partialRow.isLastPart : false),
@@ -79915,6 +79982,7 @@ const rangesOverlap = (startA, endA, startB, endB) => {
79915
79982
  return effectiveEndA > startB && startA < endB;
79916
79983
  };
79917
79984
  function hitTestPage(layout, point) {
79985
+ const pageGap = layout.pageGap ?? 0;
79918
79986
  let cursorY = 0;
79919
79987
  for (let pageIndex = 0; pageIndex < layout.pages.length; pageIndex += 1) {
79920
79988
  const page = layout.pages[pageIndex];
@@ -79923,7 +79991,7 @@ function hitTestPage(layout, point) {
79923
79991
  if (point.y >= top2 && point.y < bottom2) {
79924
79992
  return { pageIndex, page };
79925
79993
  }
79926
- cursorY = bottom2;
79994
+ cursorY = bottom2 + pageGap;
79927
79995
  }
79928
79996
  return null;
79929
79997
  }
@@ -80132,9 +80200,10 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
80132
80200
  if (!pageHit) {
80133
80201
  return null;
80134
80202
  }
80203
+ const pageGap = layout.pageGap ?? 0;
80135
80204
  const pageRelativePoint = {
80136
80205
  x: containerPoint.x,
80137
- y: containerPoint.y - pageHit.pageIndex * layout.pageSize.h
80206
+ y: containerPoint.y - pageHit.pageIndex * (layout.pageSize.h + pageGap)
80138
80207
  };
80139
80208
  logClickStage("log", "page-hit", {
80140
80209
  pageIndex: pageHit.pageIndex
@@ -80355,7 +80424,7 @@ function selectionToRects(layout, blocks, measures, from2, to) {
80355
80424
  const rectY = fragment.y + lineOffset;
80356
80425
  rects.push({
80357
80426
  x: rectX,
80358
- y: rectY + pageIndex * layout.pageSize.h,
80427
+ y: rectY + pageIndex * (layout.pageSize.h + (layout.pageGap ?? 0)),
80359
80428
  width: rectWidth,
80360
80429
  height: line.lineHeight,
80361
80430
  pageIndex
@@ -80472,7 +80541,7 @@ function selectionToRects(layout, blocks, measures, from2, to) {
80472
80541
  const rectY = fragment.y + rowOffset + blockTopCursor + lineOffset;
80473
80542
  rects.push({
80474
80543
  x: rectX,
80475
- y: rectY + pageIndex * layout.pageSize.h,
80544
+ y: rectY + pageIndex * (layout.pageSize.h + (layout.pageGap ?? 0)),
80476
80545
  width: rectWidth,
80477
80546
  height: line.lineHeight,
80478
80547
  pageIndex
@@ -80501,7 +80570,7 @@ function selectionToRects(layout, blocks, measures, from2, to) {
80501
80570
  if (!rangesOverlap(pmRange.pmStart, pmRange.pmEnd, from2, to)) return;
80502
80571
  rects.push({
80503
80572
  x: fragment.x,
80504
- y: fragment.y + pageIndex * layout.pageSize.h,
80573
+ y: fragment.y + pageIndex * (layout.pageSize.h + (layout.pageGap ?? 0)),
80505
80574
  width: fragment.width,
80506
80575
  height: fragment.height,
80507
80576
  pageIndex
@@ -81530,7 +81599,15 @@ async function measureParagraphBlock(block, maxWidth) {
81530
81599
  currentLine.width = roundValue(currentLine.width + boundarySpacing + wordOnlyWidth);
81531
81600
  currentLine.maxFontInfo = updateMaxFontInfo(currentLine.maxFontSize, currentLine.maxFontInfo, run2);
81532
81601
  currentLine.maxFontSize = Math.max(currentLine.maxFontSize, run2.fontSize);
81533
- appendSegment(currentLine.segments, runIndex, wordStartChar, wordEndNoSpace, wordOnlyWidth, segmentStartX);
81602
+ const useExplicitXHere = wordIndex === 0 && segmentStartX !== void 0;
81603
+ appendSegment(
81604
+ currentLine.segments,
81605
+ runIndex,
81606
+ wordStartChar,
81607
+ wordEndNoSpace,
81608
+ wordOnlyWidth,
81609
+ useExplicitXHere ? segmentStartX : void 0
81610
+ );
81534
81611
  const metrics = calculateTypographyMetrics(currentLine.maxFontSize, spacing, currentLine.maxFontInfo);
81535
81612
  const completedLine = { ...currentLine, ...metrics };
81536
81613
  addBarTabsToLine(completedLine);
@@ -83415,6 +83492,8 @@ function isValidFieldAnnotationAttributes(attrs) {
83415
83492
  const FIELD_ANNOTATION_DATA_TYPE = "fieldAnnotation";
83416
83493
  const DEFAULT_PAGE_SIZE = { w: 612, h: 792 };
83417
83494
  const DEFAULT_MARGINS = { top: 72, right: 72, bottom: 72, left: 72 };
83495
+ const DEFAULT_VIRTUALIZED_PAGE_GAP = 72;
83496
+ const DEFAULT_PAGE_GAP = 24;
83418
83497
  const WORD_CHARACTER_REGEX = /[\p{L}\p{N}''_~-]/u;
83419
83498
  const MULTI_CLICK_TIME_THRESHOLD_MS = 400;
83420
83499
  const MULTI_CLICK_DISTANCE_THRESHOLD_PX = 5;
@@ -84489,8 +84568,9 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
84489
84568
  const rawRects = layoutRectSource();
84490
84569
  if (!rawRects.length) return [];
84491
84570
  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);
84571
+ const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
84492
84572
  return rawRects.map((rect) => {
84493
- const pageLocalY = rect.y - rect.pageIndex * pageHeight;
84573
+ const pageLocalY = rect.y - rect.pageIndex * (pageHeight + pageGap);
84494
84574
  const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, rect.pageIndex, rect.x, pageLocalY);
84495
84575
  if (!coords) return null;
84496
84576
  const absLeft = coords.x * zoom + overlayRect.left;
@@ -84742,7 +84822,8 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
84742
84822
  return null;
84743
84823
  }
84744
84824
  const pageHeight = __privateMethod$1(this, _PresentationEditor_instances, getBodyPageHeight_fn).call(this);
84745
- const pageLocalY = rect2.y - rect2.pageIndex * pageHeight;
84825
+ const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
84826
+ const pageLocalY = rect2.y - rect2.pageIndex * (pageHeight + pageGap);
84746
84827
  const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, rect2.pageIndex, rect2.x, pageLocalY);
84747
84828
  if (!coords) {
84748
84829
  return null;
@@ -85486,10 +85567,11 @@ renderRemoteSelection_fn = function(cursor) {
85486
85567
  const color = __privateMethod$1(this, _PresentationEditor_instances, getValidatedColor_fn).call(this, cursor);
85487
85568
  const opacity = __privateGet$1(this, _layoutOptions).presence?.highlightOpacity ?? 0.35;
85488
85569
  const pageHeight = layout.pageSize?.h ?? __privateGet$1(this, _layoutOptions).pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
85570
+ const pageGap = layout.pageGap ?? 0;
85489
85571
  const doc2 = __privateGet$1(this, _visibleHost).ownerDocument ?? document;
85490
85572
  const limitedRects = rects.slice(0, MAX_SELECTION_RECTS_PER_USER);
85491
85573
  limitedRects.forEach((rect) => {
85492
- const pageLocalY = rect.y - rect.pageIndex * pageHeight;
85574
+ const pageLocalY = rect.y - rect.pageIndex * (pageHeight + pageGap);
85493
85575
  const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, rect.pageIndex, rect.x, pageLocalY);
85494
85576
  if (!coords) return;
85495
85577
  const selectionEl = doc2.createElement("div");
@@ -85952,6 +86034,12 @@ rerender_fn = async function() {
85952
86034
  return;
85953
86035
  }
85954
86036
  ({ layout, measures } = result);
86037
+ if (__privateGet$1(this, _layoutOptions).virtualization?.enabled) {
86038
+ const gap = __privateGet$1(this, _layoutOptions).virtualization.gap ?? DEFAULT_VIRTUALIZED_PAGE_GAP;
86039
+ layout.pageGap = Math.max(0, gap);
86040
+ } else {
86041
+ layout.pageGap = DEFAULT_PAGE_GAP;
86042
+ }
85955
86043
  headerLayouts = result.headers;
85956
86044
  footerLayouts = result.footers;
85957
86045
  } catch (error) {
@@ -86439,9 +86527,10 @@ hitTestHeaderFooterRegion_fn = function(x2, y2) {
86439
86527
  const layout = __privateGet$1(this, _layoutState).layout;
86440
86528
  if (!layout) return null;
86441
86529
  const pageHeight = layout.pageSize?.h ?? __privateGet$1(this, _layoutOptions).pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
86530
+ const pageGap = layout.pageGap ?? 0;
86442
86531
  if (pageHeight <= 0) return null;
86443
- const pageIndex = Math.max(0, Math.floor(y2 / pageHeight));
86444
- const pageLocalY = y2 - pageIndex * pageHeight;
86532
+ const pageIndex = Math.max(0, Math.floor(y2 / (pageHeight + pageGap)));
86533
+ const pageLocalY = y2 - pageIndex * (pageHeight + pageGap);
86445
86534
  const headerRegion = __privateGet$1(this, _headerRegions).get(pageIndex);
86446
86535
  if (headerRegion && __privateMethod$1(this, _PresentationEditor_instances, pointInRegion_fn).call(this, headerRegion, x2, pageLocalY)) {
86447
86536
  return headerRegion;
@@ -86866,8 +86955,9 @@ renderSelectionRects_fn = function(rects) {
86866
86955
  return;
86867
86956
  }
86868
86957
  const pageHeight = __privateMethod$1(this, _PresentationEditor_instances, getBodyPageHeight_fn).call(this);
86958
+ const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
86869
86959
  rects.forEach((rect, _index) => {
86870
- const pageLocalY = rect.y - rect.pageIndex * pageHeight;
86960
+ const pageLocalY = rect.y - rect.pageIndex * (pageHeight + pageGap);
86871
86961
  const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, rect.pageIndex, rect.x, pageLocalY);
86872
86962
  if (!coords) {
86873
86963
  return;
@@ -87125,9 +87215,10 @@ convertPageLocalToOverlayCoords_fn = function(pageIndex, pageLocalX, pageLocalY)
87125
87215
  return null;
87126
87216
  }
87127
87217
  const pageHeight = __privateGet$1(this, _layoutOptions).pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
87218
+ const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
87128
87219
  return {
87129
87220
  x: pageLocalX,
87130
- y: pageIndex * pageHeight + pageLocalY
87221
+ y: pageIndex * (pageHeight + pageGap) + pageLocalY
87131
87222
  };
87132
87223
  };
87133
87224
  normalizeClientPoint_fn = function(clientX, clientY) {
@@ -100778,6 +100869,8 @@ const PassthroughInline = Node$1.create({
100778
100869
  name: "passthroughInline",
100779
100870
  group: "inline",
100780
100871
  inline: true,
100872
+ // IMPORTANT: This node is registered in pm-adapter/src/constants.ts ATOMIC_INLINE_TYPES
100873
+ // If you change atom to false, you MUST remove it from that set to avoid positioning bugs
100781
100874
  atom: true,
100782
100875
  draggable: false,
100783
100876
  selectable: false,