@harbour-enterprises/superdoc 2.0.0-next.3 → 2.0.0-next.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.
Files changed (30) hide show
  1. package/dist/chunks/{PdfViewer-C6tuSJXA.cjs → PdfViewer-C4wZizyW.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-4xn9rggA.es.js → PdfViewer-CO_oGFDw.es.js} +1 -1
  3. package/dist/chunks/{index-k0xTe_8v.cjs → index-B4QOihiF.cjs} +3 -3
  4. package/dist/chunks/{index-lLnrqNSJ-DoACeFqL.es.js → index-CBSyVaOM-B5I90g0S.es.js} +1 -1
  5. package/dist/chunks/{index-lLnrqNSJ-CMJxa5vJ.cjs → index-CBSyVaOM-BMpzJRoR.cjs} +1 -1
  6. package/dist/chunks/{index-CSZ7bAL7.es.js → index-XOJnODHJ.es.js} +3 -3
  7. package/dist/chunks/{super-editor.es-BY4paJvP.cjs → super-editor.es-DzolekK0.cjs} +141 -26
  8. package/dist/chunks/{super-editor.es-B1DZfUz0.es.js → super-editor.es-qnE7-VRy.es.js} +141 -26
  9. package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
  10. package/dist/style.css +6 -6
  11. package/dist/super-editor/ai-writer.es.js +2 -2
  12. package/dist/super-editor/chunks/{converter-Bd6dIe0l.js → converter-CH2eG52x.js} +1 -1
  13. package/dist/super-editor/chunks/{docx-zipper-Dzdi5pfi.js → docx-zipper-JJRnWzI6.js} +1 -1
  14. package/dist/super-editor/chunks/{editor-C3sjGwAb.js → editor-Du7p05wU.js} +129 -24
  15. package/dist/super-editor/chunks/{index-lLnrqNSJ.js → index-CBSyVaOM.js} +1 -1
  16. package/dist/super-editor/chunks/{toolbar-Bn20lflQ.js → toolbar-unNlfpEL.js} +2 -2
  17. package/dist/super-editor/converter.es.js +1 -1
  18. package/dist/super-editor/docx-zipper.es.js +2 -2
  19. package/dist/super-editor/editor.es.js +3 -3
  20. package/dist/super-editor/file-zipper.es.js +1 -1
  21. package/dist/super-editor/style.css +6 -6
  22. package/dist/super-editor/super-editor.es.js +19 -9
  23. package/dist/super-editor/toolbar.es.js +2 -2
  24. package/dist/super-editor.cjs +1 -1
  25. package/dist/super-editor.es.js +1 -1
  26. package/dist/superdoc.cjs +2 -2
  27. package/dist/superdoc.es.js +2 -2
  28. package/dist/superdoc.umd.js +143 -28
  29. package/dist/superdoc.umd.js.map +1 -1
  30. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("./vue-gvuFr0vx.cjs");
4
- const superdoc = require("./index-k0xTe_8v.cjs");
4
+ const superdoc = require("./index-B4QOihiF.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -1,5 +1,5 @@
1
1
  import { y as defineComponent, A as h, P as Transition, a0 as process$1, K as watchEffect, a as computed, r as ref, j as onMounted, X as onUnmounted, b as createElementBlock, o as openBlock, f as createBaseVNode, e as createCommentVNode, s as createVNode, x as unref } from "./vue-CLFbn_1r.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-CSZ7bAL7.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-XOJnODHJ.es.js";
3
3
  function self(vars) {
4
4
  const {
5
5
  opacityDisabled,
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-BY4paJvP.cjs");
2
+ const superEditor_es = require("./super-editor.es-DzolekK0.cjs");
3
3
  const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
4
4
  const eventemitter3 = require("./eventemitter3-DIclNhoR.cjs");
5
5
  const provider = require("@hocuspocus/provider");
@@ -17487,7 +17487,7 @@ const _sfc_main = {
17487
17487
  __name: "SuperDoc",
17488
17488
  emits: ["selection-update"],
17489
17489
  setup(__props, { emit: __emit }) {
17490
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-C6tuSJXA.cjs")));
17490
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-C4wZizyW.cjs")));
17491
17491
  const superdocStore = useSuperdocStore();
17492
17492
  const commentsStore = useCommentsStore();
17493
17493
  const {
@@ -18391,7 +18391,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
18391
18391
  this.config.colors = shuffleArray(this.config.colors);
18392
18392
  this.userColorMap = /* @__PURE__ */ new Map();
18393
18393
  this.colorIndex = 0;
18394
- this.version = "2.0.0-next.3";
18394
+ this.version = "2.0.0-next.5";
18395
18395
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18396
18396
  this.superdocId = config.superdocId || uuid.v4();
18397
18397
  this.colors = this.config.colors;
@@ -1,4 +1,4 @@
1
- import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-B1DZfUz0.es.js";
1
+ import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-qnE7-VRy.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-BY4paJvP.cjs");
3
+ const superEditor_es = require("./super-editor.es-DzolekK0.cjs");
4
4
  const indexCvBqQJbG = require("./index-CvBqQJbG-Dwm0THD7.cjs");
5
5
  function bail(error) {
6
6
  if (error) {
@@ -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-B1DZfUz0.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-qnE7-VRy.es.js";
2
2
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
3
3
  import { E as EventEmitter } from "./eventemitter3-D_2kqkfV.es.js";
4
4
  import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
@@ -17470,7 +17470,7 @@ const _sfc_main = {
17470
17470
  __name: "SuperDoc",
17471
17471
  emits: ["selection-update"],
17472
17472
  setup(__props, { emit: __emit }) {
17473
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-4xn9rggA.es.js"));
17473
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-CO_oGFDw.es.js"));
17474
17474
  const superdocStore = useSuperdocStore();
17475
17475
  const commentsStore = useCommentsStore();
17476
17476
  const {
@@ -18374,7 +18374,7 @@ class SuperDoc extends EventEmitter {
18374
18374
  this.config.colors = shuffleArray(this.config.colors);
18375
18375
  this.userColorMap = /* @__PURE__ */ new Map();
18376
18376
  this.colorIndex = 0;
18377
- this.version = "2.0.0-next.3";
18377
+ this.version = "2.0.0-next.5";
18378
18378
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18379
18379
  this.superdocId = config.superdocId || v4();
18380
18380
  this.colors = this.config.colors;
@@ -42427,7 +42427,7 @@ const _SuperConverter = class _SuperConverter2 {
42427
42427
  static getStoredSuperdocVersion(docx) {
42428
42428
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
42429
42429
  }
42430
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "2.0.0-next.3") {
42430
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "2.0.0-next.5") {
42431
42431
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
42432
42432
  }
42433
42433
  /**
@@ -60508,7 +60508,7 @@ const isHeadless = (editor) => {
60508
60508
  const shouldSkipNodeView = (editor) => {
60509
60509
  return isHeadless(editor);
60510
60510
  };
60511
- const summaryVersion = "2.0.0-next.3";
60511
+ const summaryVersion = "2.0.0-next.5";
60512
60512
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
60513
60513
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
60514
60514
  function mapAttributes(attrs) {
@@ -61297,7 +61297,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
61297
61297
  { default: remarkStringify },
61298
61298
  { default: remarkGfm }
61299
61299
  ] = await Promise.all([
61300
- Promise.resolve().then(() => require("./index-lLnrqNSJ-CMJxa5vJ.cjs")),
61300
+ Promise.resolve().then(() => require("./index-CBSyVaOM-BMpzJRoR.cjs")),
61301
61301
  Promise.resolve().then(() => require("./index-DRCvimau-H4Ck3S9a.cjs")),
61302
61302
  Promise.resolve().then(() => require("./index-C_x_N6Uh-Db3CUJMX.cjs")),
61303
61303
  Promise.resolve().then(() => require("./index-D_sWOSiG-BtDZzJ6I.cjs")),
@@ -61502,7 +61502,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
61502
61502
  * Process collaboration migrations
61503
61503
  */
61504
61504
  processCollaborationMigrations() {
61505
- console.debug("[checkVersionMigrations] Current editor version", "2.0.0-next.3");
61505
+ console.debug("[checkVersionMigrations] Current editor version", "2.0.0-next.5");
61506
61506
  if (!this.options.ydoc) return;
61507
61507
  const metaMap = this.options.ydoc.getMap("meta");
61508
61508
  let docVersion = metaMap.get("version");
@@ -73868,7 +73868,8 @@ function measureCharacterX(block, line, charOffset, availableWidthOverride, alig
73868
73868
  }
73869
73869
  const text = "src" in run2 || run2.kind === "lineBreak" || run2.kind === "break" || run2.kind === "fieldAnnotation" ? "" : run2.text ?? "";
73870
73870
  const runLength = text.length;
73871
- const displayText = applyTextTransform$2(text, run2.textTransform);
73871
+ const transform = isTabRun$1(run2) || "src" in run2 || run2.kind === "lineBreak" || run2.kind === "break" || run2.kind === "fieldAnnotation" ? void 0 : run2.textTransform;
73872
+ const displayText = applyTextTransform$2(text, transform);
73872
73873
  if (currentCharOffset + runLength >= charOffset) {
73873
73874
  const offsetInRun = charOffset - currentCharOffset;
73874
73875
  ctx2.font = getRunFontString(run2);
@@ -73918,7 +73919,8 @@ function measureCharacterXSegmentBased(block, line, charOffset, ctx2) {
73918
73919
  return segmentBaseX + (offsetInSegment >= segmentChars ? segment.width ?? 0 : 0);
73919
73920
  }
73920
73921
  const text = run2.text ?? "";
73921
- const displayText = applyTextTransform$2(text, run2.textTransform);
73922
+ const transform = "textTransform" in run2 ? run2.textTransform : void 0;
73923
+ const displayText = applyTextTransform$2(text, transform);
73922
73924
  const displaySegmentText = displayText.slice(segment.fromChar, segment.toChar);
73923
73925
  const textUpToTarget = displaySegmentText.slice(0, offsetInSegment);
73924
73926
  ctx2.font = getRunFontString(run2);
@@ -74016,7 +74018,8 @@ function findCharacterAtX(block, line, x2, pmStart, availableWidthOverride, alig
74016
74018
  }
74017
74019
  const text = "src" in run2 || run2.kind === "lineBreak" || run2.kind === "break" || run2.kind === "fieldAnnotation" ? "" : run2.text ?? "";
74018
74020
  const runLength = text.length;
74019
- const displayText = applyTextTransform$2(text, run2.textTransform);
74021
+ const transform = isTabRun$1(run2) || "src" in run2 || run2.kind === "lineBreak" || run2.kind === "break" || run2.kind === "fieldAnnotation" ? void 0 : run2.textTransform;
74022
+ const displayText = applyTextTransform$2(text, transform);
74020
74023
  if (runLength === 0) continue;
74021
74024
  ctx2.font = getRunFontString(run2);
74022
74025
  for (let i = 0; i <= runLength; i++) {
@@ -74494,12 +74497,12 @@ function resolveListTextStartPx(wordLayout, indentLeft, firstLine, hanging, meas
74494
74497
  if (markerTextWidth == null && marker.markerText) {
74495
74498
  markerTextWidth = measureMarkerText(marker.markerText, marker);
74496
74499
  }
74497
- if (!Number.isFinite(markerTextWidth) || markerTextWidth < 0) {
74500
+ if (!Number.isFinite(markerTextWidth) || markerTextWidth !== void 0 && markerTextWidth < 0) {
74498
74501
  markerTextWidth = markerBoxWidth;
74499
74502
  }
74500
- markerTextWidth = Math.max(0, markerTextWidth);
74503
+ const finalMarkerTextWidth = Math.max(0, markerTextWidth ?? 0);
74501
74504
  let markerStartPos;
74502
- if (wordLayout?.firstLineIndentMode === true && Number.isFinite(marker.markerX)) {
74505
+ if (wordLayout?.firstLineIndentMode === true && typeof marker.markerX === "number" && Number.isFinite(marker.markerX)) {
74503
74506
  markerStartPos = marker.markerX;
74504
74507
  } else {
74505
74508
  markerStartPos = indentLeft - hanging + firstLine;
@@ -74507,18 +74510,18 @@ function resolveListTextStartPx(wordLayout, indentLeft, firstLine, hanging, meas
74507
74510
  if (!Number.isFinite(markerStartPos)) {
74508
74511
  markerStartPos = 0;
74509
74512
  }
74510
- const currentPos = markerStartPos + markerTextWidth;
74513
+ const currentPos = markerStartPos + finalMarkerTextWidth;
74511
74514
  const suffix2 = marker.suffix ?? "tab";
74512
74515
  if (suffix2 === "space") {
74513
- return markerStartPos + markerTextWidth + SPACE_SUFFIX_GAP_PX;
74516
+ return markerStartPos + finalMarkerTextWidth + SPACE_SUFFIX_GAP_PX;
74514
74517
  }
74515
74518
  if (suffix2 === "nothing") {
74516
- return markerStartPos + markerTextWidth;
74519
+ return markerStartPos + finalMarkerTextWidth;
74517
74520
  }
74518
74521
  const markerJustification = marker.justification ?? "left";
74519
74522
  if (markerJustification !== "left") {
74520
74523
  const gutterWidth = typeof marker.gutterWidthPx === "number" && Number.isFinite(marker.gutterWidthPx) && marker.gutterWidthPx > 0 ? marker.gutterWidthPx : LIST_MARKER_GAP$1;
74521
- return markerStartPos + markerTextWidth + Math.max(gutterWidth, LIST_MARKER_GAP$1);
74524
+ return markerStartPos + finalMarkerTextWidth + Math.max(gutterWidth, LIST_MARKER_GAP$1);
74522
74525
  }
74523
74526
  if (wordLayout?.firstLineIndentMode === true) {
74524
74527
  let targetTabStop;
@@ -74542,7 +74545,7 @@ function resolveListTextStartPx(wordLayout, indentLeft, firstLine, hanging, meas
74542
74545
  if (tabWidth2 < LIST_MARKER_GAP$1) {
74543
74546
  tabWidth2 = LIST_MARKER_GAP$1;
74544
74547
  }
74545
- return markerStartPos + markerTextWidth + tabWidth2;
74548
+ return markerStartPos + finalMarkerTextWidth + tabWidth2;
74546
74549
  }
74547
74550
  const textStart = indentLeft + firstLine;
74548
74551
  let tabWidth = textStart - currentPos;
@@ -74551,7 +74554,7 @@ function resolveListTextStartPx(wordLayout, indentLeft, firstLine, hanging, meas
74551
74554
  } else if (tabWidth < LIST_MARKER_GAP$1) {
74552
74555
  tabWidth = LIST_MARKER_GAP$1;
74553
74556
  }
74554
- return markerStartPos + markerTextWidth + tabWidth;
74557
+ return markerStartPos + finalMarkerTextWidth + tabWidth;
74555
74558
  }
74556
74559
  function getWordLayoutConfig(block) {
74557
74560
  if (!block || block.kind !== "paragraph") {
@@ -75871,6 +75874,94 @@ function getCellPadding(cellIdx, blockRow) {
75871
75874
  function getCellTotalLines(cell) {
75872
75875
  return getCellLines(cell).length;
75873
75876
  }
75877
+ function mergePmRange(target, range2) {
75878
+ if (typeof range2.pmStart === "number") {
75879
+ target.pmStart = target.pmStart == null ? range2.pmStart : Math.min(target.pmStart, range2.pmStart);
75880
+ }
75881
+ if (typeof range2.pmEnd === "number") {
75882
+ target.pmEnd = target.pmEnd == null ? range2.pmEnd : Math.max(target.pmEnd, range2.pmEnd);
75883
+ }
75884
+ }
75885
+ function computeCellPmRange(cell, cellMeasure, fromLine, toLine) {
75886
+ const range2 = {};
75887
+ if (!cell || !cellMeasure) return range2;
75888
+ const cellBlocks = cell.blocks ?? (cell.paragraph ? [cell.paragraph] : []);
75889
+ const blockMeasures = cellMeasure.blocks ?? (cellMeasure.paragraph ? [cellMeasure.paragraph] : []);
75890
+ const maxBlocks = Math.min(cellBlocks.length, blockMeasures.length);
75891
+ let cumulativeLineCount = 0;
75892
+ for (let i = 0; i < maxBlocks; i++) {
75893
+ const block = cellBlocks[i];
75894
+ const blockMeasure = blockMeasures[i];
75895
+ if (blockMeasure.kind === "paragraph" && block?.kind === "paragraph") {
75896
+ const paraMeasure = blockMeasure;
75897
+ const lines = paraMeasure.lines;
75898
+ const blockLineCount = lines?.length ?? 0;
75899
+ const blockStartGlobal = cumulativeLineCount;
75900
+ const blockEndGlobal = cumulativeLineCount + blockLineCount;
75901
+ const localFrom = Math.max(fromLine, blockStartGlobal) - blockStartGlobal;
75902
+ const localTo = Math.min(toLine, blockEndGlobal) - blockStartGlobal;
75903
+ if (lines && lines.length > 0 && localFrom < localTo) {
75904
+ mergePmRange(range2, computeFragmentPmRange(block, lines, localFrom, localTo));
75905
+ } else {
75906
+ mergePmRange(range2, extractBlockPmRange(block));
75907
+ }
75908
+ cumulativeLineCount += blockLineCount;
75909
+ continue;
75910
+ }
75911
+ mergePmRange(range2, extractBlockPmRange(block));
75912
+ }
75913
+ return range2;
75914
+ }
75915
+ function computeTableFragmentPmRange(block, measure, fromRow, toRow, partialRow) {
75916
+ const range2 = {};
75917
+ for (let rowIndex = fromRow; rowIndex < toRow; rowIndex++) {
75918
+ const row = block.rows[rowIndex];
75919
+ const rowMeasure = measure.rows[rowIndex];
75920
+ if (!row || !rowMeasure) continue;
75921
+ const isPartial = partialRow?.rowIndex === rowIndex;
75922
+ const cellCount = Math.min(row.cells.length, rowMeasure.cells.length);
75923
+ for (let cellIndex = 0; cellIndex < cellCount; cellIndex++) {
75924
+ const cell = row.cells[cellIndex];
75925
+ const cellMeasure = rowMeasure.cells[cellIndex];
75926
+ if (!cell || !cellMeasure) continue;
75927
+ const totalLines = getCellTotalLines(cellMeasure);
75928
+ let fromLine = 0;
75929
+ let toLine = totalLines;
75930
+ if (isPartial) {
75931
+ const hasValidFromLineByCell = partialRow?.fromLineByCell && cellIndex < partialRow.fromLineByCell.length;
75932
+ const hasValidToLineByCell = partialRow?.toLineByCell && cellIndex < partialRow.toLineByCell.length;
75933
+ if (hasValidFromLineByCell) {
75934
+ const rawFrom = partialRow.fromLineByCell[cellIndex];
75935
+ if (typeof rawFrom === "number" && rawFrom >= 0) {
75936
+ fromLine = rawFrom;
75937
+ }
75938
+ }
75939
+ if (hasValidToLineByCell) {
75940
+ const rawTo = partialRow.toLineByCell[cellIndex];
75941
+ if (typeof rawTo === "number") {
75942
+ toLine = rawTo === -1 ? totalLines : rawTo;
75943
+ }
75944
+ }
75945
+ }
75946
+ fromLine = Math.max(0, Math.min(fromLine, totalLines));
75947
+ toLine = Math.max(0, Math.min(toLine, totalLines));
75948
+ if (toLine < fromLine) {
75949
+ toLine = fromLine;
75950
+ }
75951
+ mergePmRange(range2, computeCellPmRange(cell, cellMeasure, fromLine, toLine));
75952
+ }
75953
+ }
75954
+ return range2;
75955
+ }
75956
+ function applyTableFragmentPmRange(fragment, block, measure) {
75957
+ const range2 = computeTableFragmentPmRange(block, measure, fragment.fromRow, fragment.toRow, fragment.partialRow);
75958
+ if (range2.pmStart != null) {
75959
+ fragment.pmStart = range2.pmStart;
75960
+ }
75961
+ if (range2.pmEnd != null) {
75962
+ fragment.pmEnd = range2.pmEnd;
75963
+ }
75964
+ }
75874
75965
  function computePartialRow(rowIndex, blockRow, measure, availableHeight, fromLineByCell) {
75875
75966
  const row = measure.rows[rowIndex];
75876
75967
  if (!row) {
@@ -76015,6 +76106,7 @@ function layoutMonolithicTable(context) {
76015
76106
  height,
76016
76107
  metadata
76017
76108
  };
76109
+ applyTableFragmentPmRange(fragment, context.block, context.measure);
76018
76110
  state2.page.fragments.push(fragment);
76019
76111
  state2.cursorY += height;
76020
76112
  }
@@ -76093,6 +76185,7 @@ function layoutTableBlock({
76093
76185
  height,
76094
76186
  metadata
76095
76187
  };
76188
+ applyTableFragmentPmRange(fragment, block, measure);
76096
76189
  state2.page.fragments.push(fragment);
76097
76190
  state2.cursorY += height;
76098
76191
  return;
@@ -76156,6 +76249,7 @@ function layoutTableBlock({
76156
76249
  partialRow: continuationPartialRow,
76157
76250
  metadata: generateFragmentMetadata(measure)
76158
76251
  };
76252
+ applyTableFragmentPmRange(fragment2, block, measure);
76159
76253
  state2.page.fragments.push(fragment2);
76160
76254
  state2.cursorY += fragmentHeight2;
76161
76255
  }
@@ -76200,6 +76294,7 @@ function layoutTableBlock({
76200
76294
  partialRow: forcedPartialRow,
76201
76295
  metadata: generateFragmentMetadata(measure)
76202
76296
  };
76297
+ applyTableFragmentPmRange(fragment2, block, measure);
76203
76298
  state2.page.fragments.push(fragment2);
76204
76299
  state2.cursorY += fragmentHeight2;
76205
76300
  pendingPartialRow = forcedPartialRow;
@@ -76235,6 +76330,7 @@ function layoutTableBlock({
76235
76330
  partialRow: partialRow || void 0,
76236
76331
  metadata: generateFragmentMetadata(measure)
76237
76332
  };
76333
+ applyTableFragmentPmRange(fragment, block, measure);
76238
76334
  state2.page.fragments.push(fragment);
76239
76335
  state2.cursorY += fragmentHeight;
76240
76336
  if (partialRow && !partialRow.isLastPart) {
@@ -76252,7 +76348,7 @@ function createAnchoredTableFragment(block, measure, x2, y2) {
76252
76348
  columnBoundaries: generateColumnBoundaries(measure),
76253
76349
  coordinateSystem: "fragment"
76254
76350
  };
76255
- return {
76351
+ const fragment = {
76256
76352
  kind: "table",
76257
76353
  blockId: block.id,
76258
76354
  fromRow: 0,
@@ -76263,6 +76359,8 @@ function createAnchoredTableFragment(block, measure, x2, y2) {
76263
76359
  height: measure.totalHeight ?? 0,
76264
76360
  metadata
76265
76361
  };
76362
+ applyTableFragmentPmRange(fragment, block, measure);
76363
+ return fragment;
76266
76364
  }
76267
76365
  function isPageRelativeAnchor(block) {
76268
76366
  const vRelativeFrom = block.anchor?.vRelativeFrom;
@@ -78722,7 +78820,8 @@ const getNextTabStopPx$1 = (currentX, tabStops, startIndex) => {
78722
78820
  function measureRunSliceWidth(run2, fromChar, toChar) {
78723
78821
  const context = getCtx();
78724
78822
  const fullText = runText(run2);
78725
- const text = applyTextTransform$1(fullText.slice(fromChar, toChar), run2.textTransform, fullText, fromChar);
78823
+ const transform = isTextRun$2(run2) ? run2.textTransform : void 0;
78824
+ const text = applyTextTransform$1(fullText.slice(fromChar, toChar), transform, fullText, fromChar);
78726
78825
  if (!context) {
78727
78826
  const textRun = isTextRun$2(run2) ? run2 : null;
78728
78827
  const size2 = textRun?.fontSize ?? 16;
@@ -82023,14 +82122,15 @@ function getAtomNodeTypes(schema) {
82023
82122
  if (!schema) return [];
82024
82123
  const types2 = [];
82025
82124
  try {
82026
- schema.nodes.forEach((nodeType, name) => {
82125
+ for (const name in schema.nodes) {
82027
82126
  if (name === "text") {
82028
- return;
82127
+ continue;
82029
82128
  }
82030
- if (nodeType.isAtom || nodeType.isLeaf) {
82129
+ const nodeType = schema.nodes[name];
82130
+ if (nodeType && (nodeType.isAtom || nodeType.isLeaf)) {
82031
82131
  types2.push(name);
82032
82132
  }
82033
- });
82133
+ }
82034
82134
  } catch {
82035
82135
  return [];
82036
82136
  }
@@ -92927,7 +93027,7 @@ const capitalizeText = (text, fullText, startOffset) => {
92927
93027
  return result;
92928
93028
  };
92929
93029
  const applyTextTransform = (text, run2, startOffset) => {
92930
- const transform = run2.textTransform;
93030
+ const transform = "textTransform" in run2 ? run2.textTransform : void 0;
92931
93031
  if (!text || !transform || transform === "none") return text;
92932
93032
  if (transform === "uppercase") return text.toUpperCase();
92933
93033
  if (transform === "lowercase") return text.toLowerCase();
@@ -93250,6 +93350,9 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
93250
93350
  if (event.button !== 0) {
93251
93351
  return;
93252
93352
  }
93353
+ if (event.ctrlKey && navigator.platform.includes("Mac")) {
93354
+ return;
93355
+ }
93253
93356
  __privateSet(this, _pendingMarginClick, null);
93254
93357
  const target = event.target;
93255
93358
  if (target?.closest?.(".superdoc-ruler-handle") != null) {
@@ -98659,6 +98762,8 @@ const SlashMenu = Extension.create({
98659
98762
  const cbRect = containingBlock.getBoundingClientRect();
98660
98763
  left2 -= cbRect.left;
98661
98764
  top2 -= cbRect.top;
98765
+ left2 += containingBlock.scrollLeft || 0;
98766
+ top2 += containingBlock.scrollTop || 0;
98662
98767
  } catch (error) {
98663
98768
  console.warn("SlashMenu: Failed to adjust for containing block", error);
98664
98769
  }
@@ -129997,7 +130102,7 @@ const _sfc_main$8 = {
129997
130102
  if (open) {
129998
130103
  vue.nextTick(() => {
129999
130104
  if (searchInput.value) {
130000
- searchInput.value.focus();
130105
+ searchInput.value.focus({ preventScroll: true });
130001
130106
  }
130002
130107
  });
130003
130108
  }
@@ -130102,7 +130207,11 @@ const _sfc_main$8 = {
130102
130207
  };
130103
130208
  const handleGlobalOutsideClick = (event) => {
130104
130209
  if (isOpen.value && menuRef.value && !menuRef.value.contains(event.target)) {
130105
- moveCursorToMouseEvent(event, props.editor);
130210
+ const isCtrlClickOnMac = event.ctrlKey && isMacOS();
130211
+ const isLeftClick = event.button === 0 && !isCtrlClickOnMac;
130212
+ if (isLeftClick) {
130213
+ moveCursorToMouseEvent(event, props.editor);
130214
+ }
130106
130215
  closeMenu({ restoreCursor: false });
130107
130216
  }
130108
130217
  };
@@ -132224,6 +132333,12 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
132224
132333
  if (props.options?.suppressSkeletonLoader || !props.options?.collaborationProvider) editorReady.value = true;
132225
132334
  });
132226
132335
  const handleMarginClick = (event) => {
132336
+ if (event.button !== 0) {
132337
+ return;
132338
+ }
132339
+ if (event.ctrlKey && isMacOS()) {
132340
+ return;
132341
+ }
132227
132342
  if (event.target.classList.contains("ProseMirror")) return;
132228
132343
  onMarginClickCursorChange(event, activeEditor.value);
132229
132344
  };
@@ -132362,7 +132477,7 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
132362
132477
  };
132363
132478
  }
132364
132479
  });
132365
- const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-209a1e8b"]]);
132480
+ const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-c9a3c876"]]);
132366
132481
  const _hoisted_1 = ["innerHTML"];
132367
132482
  const _sfc_main = {
132368
132483
  __name: "SuperInput",