superdoc 1.0.0-beta.102 → 1.0.0-beta.103

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-BFqkSyYx.es.js → PdfViewer-Dbqwkn0G.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-X1sOA7hm.cjs → PdfViewer-S_8SIFPi.cjs} +1 -1
  3. package/dist/chunks/{index-BP1yyX4N.es.js → index-C5Rf8gqE.es.js} +3 -3
  4. package/dist/chunks/{index-f4ON3m7j.cjs → index-D4NTCKO5.cjs} +3 -3
  5. package/dist/chunks/{index-nVrA3URL-BssoM7VE.cjs → index-DQVMKA35-DwhGWytr.cjs} +1 -1
  6. package/dist/chunks/{index-nVrA3URL-vs_NmI3L.es.js → index-DQVMKA35-xsiaflRZ.es.js} +1 -1
  7. package/dist/chunks/{super-editor.es-B7Xuihea.cjs → super-editor.es-CCmmUDjt.cjs} +202 -29
  8. package/dist/chunks/{super-editor.es-BM69n_BR.es.js → super-editor.es-D6ttXPUE.es.js} +202 -29
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-NrpPx2Xr.js → converter-CE9B4HYb.js} +1 -1
  11. package/dist/super-editor/chunks/{docx-zipper-oyKPvmaC.js → docx-zipper-Bt1IoMBF.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-Dnw031hl.js → editor-DLjQOZqB.js} +203 -30
  13. package/dist/super-editor/chunks/{index-nVrA3URL.js → index-DQVMKA35.js} +1 -1
  14. package/dist/super-editor/chunks/{toolbar-OrlYExrD.js → toolbar-CqeJTLhO.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 +204 -31
  26. package/dist/superdoc.umd.js.map +1 -1
  27. package/package.json +1 -1
@@ -42410,7 +42410,7 @@ const _SuperConverter = class _SuperConverter2 {
42410
42410
  static getStoredSuperdocVersion(docx) {
42411
42411
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
42412
42412
  }
42413
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.102") {
42413
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.103") {
42414
42414
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
42415
42415
  }
42416
42416
  /**
@@ -59638,7 +59638,7 @@ const isHeadless = (editor) => {
59638
59638
  const shouldSkipNodeView = (editor) => {
59639
59639
  return isHeadless(editor);
59640
59640
  };
59641
- const summaryVersion = "1.0.0-beta.102";
59641
+ const summaryVersion = "1.0.0-beta.103";
59642
59642
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
59643
59643
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
59644
59644
  function mapAttributes(attrs) {
@@ -59998,11 +59998,11 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
59998
59998
  if (!this.options.isNewFile || !this.options.collaborationProvider) return;
59999
59999
  const provider = this.options.collaborationProvider;
60000
60000
  const postSyncInit = () => {
60001
- provider.off("synced", postSyncInit);
60001
+ provider.off?.("synced", postSyncInit);
60002
60002
  __privateMethod$1(this, _Editor_instances, insertNewFileData_fn).call(this);
60003
60003
  };
60004
60004
  if (provider.synced) __privateMethod$1(this, _Editor_instances, insertNewFileData_fn).call(this);
60005
- else provider.on("synced", postSyncInit);
60005
+ else provider.on?.("synced", postSyncInit);
60006
60006
  }
60007
60007
  /**
60008
60008
  * Replace content of editor that was created with loadFromSchema option
@@ -60427,7 +60427,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
60427
60427
  { default: remarkStringify },
60428
60428
  { default: remarkGfm }
60429
60429
  ] = await Promise.all([
60430
- import("./index-nVrA3URL-vs_NmI3L.es.js"),
60430
+ import("./index-DQVMKA35-xsiaflRZ.es.js"),
60431
60431
  import("./index-DRCvimau-Cw339678.es.js"),
60432
60432
  import("./index-C_x_N6Uh-DJn8hIEt.es.js"),
60433
60433
  import("./index-D_sWOSiG-DE96TaT5.es.js"),
@@ -60632,7 +60632,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
60632
60632
  * Process collaboration migrations
60633
60633
  */
60634
60634
  processCollaborationMigrations() {
60635
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.102");
60635
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.103");
60636
60636
  if (!this.options.ydoc) return;
60637
60637
  const metaMap = this.options.ydoc.getMap("meta");
60638
60638
  let docVersion = metaMap.get("version");
@@ -63747,6 +63747,7 @@ function hydrateImageBlocks(blocks, mediaFiles) {
63747
63747
  if (cellChanged) {
63748
63748
  return {
63749
63749
  ...cell,
63750
+ // Cast to expected type - hydrateBlock preserves block kinds, just hydrates image sources
63750
63751
  blocks: hydratedBlocks.length > 0 ? hydratedBlocks : cell.blocks,
63751
63752
  paragraph: hydratedParagraph
63752
63753
  };
@@ -67367,7 +67368,7 @@ const computeParagraphAttrs = (para, styleContext, listCounterContext, converter
67367
67368
  };
67368
67369
  }
67369
67370
  const hasValidNumbering = rawNumberingProps && isValidNumberingId(rawNumberingProps.numId);
67370
- if (hasValidNumbering) {
67371
+ if (hasValidNumbering && rawNumberingProps) {
67371
67372
  const numberingProps = rawNumberingProps;
67372
67373
  const numId = numberingProps.numId;
67373
67374
  const ilvl = Number.isFinite(numberingProps.ilvl) ? Math.max(0, Math.floor(Number(numberingProps.ilvl))) : 0;
@@ -67407,6 +67408,8 @@ const computeParagraphAttrs = (para, styleContext, listCounterContext, converter
67407
67408
  const resolvedCounterValue = path[path.length - 1] ?? counterValue;
67408
67409
  const enrichedNumberingProps = {
67409
67410
  ...numberingProps,
67411
+ numId: numberingProps.numId,
67412
+ ilvl: numberingProps.ilvl,
67410
67413
  path,
67411
67414
  counterValue: resolvedCounterValue
67412
67415
  };
@@ -69503,7 +69506,7 @@ const parseTableCell = (args) => {
69503
69506
  context.nextBlockId,
69504
69507
  context.positions
69505
69508
  );
69506
- if (drawingBlock) {
69509
+ if (drawingBlock && drawingBlock.kind === "drawing") {
69507
69510
  blocks.push(drawingBlock);
69508
69511
  }
69509
69512
  continue;
@@ -69514,7 +69517,7 @@ const parseTableCell = (args) => {
69514
69517
  context.nextBlockId,
69515
69518
  context.positions
69516
69519
  );
69517
- if (drawingBlock) {
69520
+ if (drawingBlock && drawingBlock.kind === "drawing") {
69518
69521
  blocks.push(drawingBlock);
69519
69522
  }
69520
69523
  continue;
@@ -69525,7 +69528,7 @@ const parseTableCell = (args) => {
69525
69528
  context.nextBlockId,
69526
69529
  context.positions
69527
69530
  );
69528
- if (drawingBlock) {
69531
+ if (drawingBlock && drawingBlock.kind === "drawing") {
69529
69532
  blocks.push(drawingBlock);
69530
69533
  }
69531
69534
  continue;
@@ -69536,7 +69539,7 @@ const parseTableCell = (args) => {
69536
69539
  context.nextBlockId,
69537
69540
  context.positions
69538
69541
  );
69539
- if (drawingBlock) {
69542
+ if (drawingBlock && drawingBlock.kind === "drawing") {
69540
69543
  blocks.push(drawingBlock);
69541
69544
  }
69542
69545
  }
@@ -69991,7 +69994,19 @@ function toFlowBlocks(pmDoc, options) {
69991
69994
  bookmarks2,
69992
69995
  hyperlinkConfig2,
69993
69996
  themeColorsParam ?? themeColors,
69994
- paragraphConverter
69997
+ paragraphConverter,
69998
+ converterCtx ?? converterContext,
69999
+ {
70000
+ listCounterContext: { getListCounter, incrementListCounter, resetListCounter },
70001
+ converters: {
70002
+ paragraphToFlowBlocks: paragraphConverter,
70003
+ imageNodeToBlock,
70004
+ vectorShapeNodeToDrawingBlock,
70005
+ shapeGroupNodeToDrawingBlock,
70006
+ shapeContainerNodeToDrawingBlock,
70007
+ shapeTextboxNodeToDrawingBlock
70008
+ }
70009
+ }
69995
70010
  );
69996
70011
  const handlerContext = {
69997
70012
  blocks,
@@ -70012,6 +70027,7 @@ function toFlowBlocks(pmDoc, options) {
70012
70027
  currentParagraphIndex: 0
70013
70028
  },
70014
70029
  converters: {
70030
+ // Type assertion needed due to signature mismatch between actual function and type definition
70015
70031
  paragraphToFlowBlocks: paragraphConverter,
70016
70032
  tableNodeToBlock: tableConverter,
70017
70033
  imageNodeToBlock,
@@ -70107,6 +70123,7 @@ function paragraphToFlowBlocks(para, nextBlockId, positions, defaultFont, defaul
70107
70123
  {
70108
70124
  listCounterContext,
70109
70125
  converters: {
70126
+ // Type assertion needed due to signature mismatch between actual function and type definition
70110
70127
  paragraphToFlowBlocks: paragraphToFlowBlocks$1,
70111
70128
  imageNodeToBlock,
70112
70129
  vectorShapeNodeToDrawingBlock,
@@ -70120,7 +70137,7 @@ function paragraphToFlowBlocks(para, nextBlockId, positions, defaultFont, defaul
70120
70137
  converterContext
70121
70138
  );
70122
70139
  }
70123
- function tableNodeToBlock(node, nextBlockId, positions, defaultFont, defaultSize, styleContext, trackedChanges, bookmarks, hyperlinkConfig, themeColors, converterContext) {
70140
+ function tableNodeToBlock(node, nextBlockId, positions, defaultFont, defaultSize, styleContext, trackedChanges, bookmarks, hyperlinkConfig, themeColors, _paragraphToFlowBlocksParam, converterContext, options) {
70124
70141
  return tableNodeToBlock$1(
70125
70142
  node,
70126
70143
  nextBlockId,
@@ -70134,8 +70151,9 @@ function tableNodeToBlock(node, nextBlockId, positions, defaultFont, defaultSize
70134
70151
  themeColors,
70135
70152
  paragraphToFlowBlocks,
70136
70153
  converterContext,
70137
- {
70154
+ options ?? {
70138
70155
  converters: {
70156
+ // Type assertion needed due to signature mismatch between actual function and type definition
70139
70157
  paragraphToFlowBlocks: paragraphToFlowBlocks$1,
70140
70158
  imageNodeToBlock,
70141
70159
  vectorShapeNodeToDrawingBlock,
@@ -74439,6 +74457,49 @@ const hashParagraphBorders$1 = (borders) => {
74439
74457
  if (borders.left) parts.push(`l:[${hashParagraphBorder$1(borders.left)}]`);
74440
74458
  return parts.join(";");
74441
74459
  };
74460
+ const isNoneBorder$1 = (value) => {
74461
+ return typeof value === "object" && value !== null && "none" in value && value.none === true;
74462
+ };
74463
+ const isBorderSpec$1 = (value) => {
74464
+ return typeof value === "object" && value !== null && !("none" in value);
74465
+ };
74466
+ const hashBorderSpec$1 = (border) => {
74467
+ const parts = [];
74468
+ if (border.style !== void 0) parts.push(`s:${border.style}`);
74469
+ if (border.width !== void 0) parts.push(`w:${border.width}`);
74470
+ if (border.color !== void 0) parts.push(`c:${border.color}`);
74471
+ if (border.space !== void 0) parts.push(`sp:${border.space}`);
74472
+ return parts.join(",");
74473
+ };
74474
+ const hashTableBorderValue$1 = (borderValue) => {
74475
+ if (borderValue === void 0) return "";
74476
+ if (borderValue === null) return "null";
74477
+ if (isNoneBorder$1(borderValue)) return "none";
74478
+ if (isBorderSpec$1(borderValue)) {
74479
+ return hashBorderSpec$1(borderValue);
74480
+ }
74481
+ return "";
74482
+ };
74483
+ const hashTableBorders$1 = (borders) => {
74484
+ if (!borders) return "";
74485
+ const parts = [];
74486
+ if (borders.top !== void 0) parts.push(`t:[${hashTableBorderValue$1(borders.top)}]`);
74487
+ if (borders.right !== void 0) parts.push(`r:[${hashTableBorderValue$1(borders.right)}]`);
74488
+ if (borders.bottom !== void 0) parts.push(`b:[${hashTableBorderValue$1(borders.bottom)}]`);
74489
+ if (borders.left !== void 0) parts.push(`l:[${hashTableBorderValue$1(borders.left)}]`);
74490
+ if (borders.insideH !== void 0) parts.push(`ih:[${hashTableBorderValue$1(borders.insideH)}]`);
74491
+ if (borders.insideV !== void 0) parts.push(`iv:[${hashTableBorderValue$1(borders.insideV)}]`);
74492
+ return parts.join(";");
74493
+ };
74494
+ const hashCellBorders$1 = (borders) => {
74495
+ if (!borders) return "";
74496
+ const parts = [];
74497
+ if (borders.top) parts.push(`t:[${hashBorderSpec$1(borders.top)}]`);
74498
+ if (borders.right) parts.push(`r:[${hashBorderSpec$1(borders.right)}]`);
74499
+ if (borders.bottom) parts.push(`b:[${hashBorderSpec$1(borders.bottom)}]`);
74500
+ if (borders.left) parts.push(`l:[${hashBorderSpec$1(borders.left)}]`);
74501
+ return parts.join(";");
74502
+ };
74442
74503
  const hasStringProp = (run2, prop) => {
74443
74504
  return prop in run2 && typeof run2[prop] === "string";
74444
74505
  };
@@ -77654,6 +77715,25 @@ const deriveBlockVersion = (block) => {
77654
77715
  hash2 = hashNumber(hash2, cellBlocks.length);
77655
77716
  hash2 = hashNumber(hash2, cell.rowSpan ?? 1);
77656
77717
  hash2 = hashNumber(hash2, cell.colSpan ?? 1);
77718
+ if (cell.attrs) {
77719
+ const cellAttrs = cell.attrs;
77720
+ if (cellAttrs.borders) {
77721
+ hash2 = hashString(hash2, hashCellBorders$1(cellAttrs.borders));
77722
+ }
77723
+ if (cellAttrs.padding) {
77724
+ const p = cellAttrs.padding;
77725
+ hash2 = hashNumber(hash2, p.top ?? 0);
77726
+ hash2 = hashNumber(hash2, p.right ?? 0);
77727
+ hash2 = hashNumber(hash2, p.bottom ?? 0);
77728
+ hash2 = hashNumber(hash2, p.left ?? 0);
77729
+ }
77730
+ if (cellAttrs.verticalAlign) {
77731
+ hash2 = hashString(hash2, cellAttrs.verticalAlign);
77732
+ }
77733
+ if (cellAttrs.background) {
77734
+ hash2 = hashString(hash2, cellAttrs.background);
77735
+ }
77736
+ }
77657
77737
  for (const cellBlock of cellBlocks) {
77658
77738
  hash2 = hashString(hash2, cellBlock?.kind ?? "unknown");
77659
77739
  if (cellBlock?.kind === "paragraph") {
@@ -77699,6 +77779,18 @@ const deriveBlockVersion = (block) => {
77699
77779
  }
77700
77780
  }
77701
77781
  }
77782
+ if (tableBlock.attrs) {
77783
+ const tblAttrs = tableBlock.attrs;
77784
+ if (tblAttrs.borders) {
77785
+ hash2 = hashString(hash2, hashTableBorders$1(tblAttrs.borders));
77786
+ }
77787
+ if (tblAttrs.borderCollapse) {
77788
+ hash2 = hashString(hash2, tblAttrs.borderCollapse);
77789
+ }
77790
+ if (tblAttrs.cellSpacing !== void 0) {
77791
+ hash2 = hashNumber(hash2, tblAttrs.cellSpacing);
77792
+ }
77793
+ }
77702
77794
  return [block.id, tableBlock.rows.length, hash2.toString(16)].join("|");
77703
77795
  }
77704
77796
  return block.id;
@@ -78451,7 +78543,7 @@ function isListItem(markerWidth, block) {
78451
78543
  return false;
78452
78544
  }
78453
78545
  const wordLayout = getWordLayoutConfig(block);
78454
- const hasListAttrs = block.attrs?.listItem != null || wordLayout?.marker != null;
78546
+ const hasListAttrs = block.attrs?.listItem != null || block.attrs?.numberingProperties != null || wordLayout?.marker != null;
78455
78547
  if (hasListAttrs) {
78456
78548
  return true;
78457
78549
  }
@@ -81437,6 +81529,49 @@ const hashParagraphBorders = (borders) => {
81437
81529
  if (borders.left) parts.push(`l:[${hashParagraphBorder(borders.left)}]`);
81438
81530
  return parts.join(";");
81439
81531
  };
81532
+ function isNoneBorder(value) {
81533
+ return typeof value === "object" && value !== null && "none" in value && value.none === true;
81534
+ }
81535
+ function isBorderSpec(value) {
81536
+ return typeof value === "object" && value !== null && !("none" in value);
81537
+ }
81538
+ const hashBorderSpec = (border) => {
81539
+ const parts = [];
81540
+ if (border.style !== void 0) parts.push(`s:${border.style}`);
81541
+ if (border.width !== void 0) parts.push(`w:${border.width}`);
81542
+ if (border.color !== void 0) parts.push(`c:${border.color}`);
81543
+ if (border.space !== void 0) parts.push(`sp:${border.space}`);
81544
+ return parts.join(",");
81545
+ };
81546
+ const hashTableBorderValue = (borderValue) => {
81547
+ if (borderValue === void 0) return "";
81548
+ if (borderValue === null) return "null";
81549
+ if (isNoneBorder(borderValue)) return "none";
81550
+ if (isBorderSpec(borderValue)) {
81551
+ return hashBorderSpec(borderValue);
81552
+ }
81553
+ return "";
81554
+ };
81555
+ const hashTableBorders = (borders) => {
81556
+ if (!borders) return "";
81557
+ const parts = [];
81558
+ if (borders.top !== void 0) parts.push(`t:[${hashTableBorderValue(borders.top)}]`);
81559
+ if (borders.right !== void 0) parts.push(`r:[${hashTableBorderValue(borders.right)}]`);
81560
+ if (borders.bottom !== void 0) parts.push(`b:[${hashTableBorderValue(borders.bottom)}]`);
81561
+ if (borders.left !== void 0) parts.push(`l:[${hashTableBorderValue(borders.left)}]`);
81562
+ if (borders.insideH !== void 0) parts.push(`ih:[${hashTableBorderValue(borders.insideH)}]`);
81563
+ if (borders.insideV !== void 0) parts.push(`iv:[${hashTableBorderValue(borders.insideV)}]`);
81564
+ return parts.join(";");
81565
+ };
81566
+ const hashCellBorders = (borders) => {
81567
+ if (!borders) return "";
81568
+ const parts = [];
81569
+ if (borders.top) parts.push(`t:[${hashBorderSpec(borders.top)}]`);
81570
+ if (borders.right) parts.push(`r:[${hashBorderSpec(borders.right)}]`);
81571
+ if (borders.bottom) parts.push(`b:[${hashBorderSpec(borders.bottom)}]`);
81572
+ if (borders.left) parts.push(`l:[${hashBorderSpec(borders.left)}]`);
81573
+ return parts.join(";");
81574
+ };
81440
81575
  const MAX_CACHE_SIZE$1 = 1e4;
81441
81576
  const BYTES_PER_ENTRY_ESTIMATE = 5e3;
81442
81577
  const NORMALIZED_WHITESPACE = /\s+/g;
@@ -81464,6 +81599,26 @@ const hashRuns = (block) => {
81464
81599
  continue;
81465
81600
  }
81466
81601
  for (const cell of row.cells) {
81602
+ if (cell.attrs) {
81603
+ const cellAttrs = cell.attrs;
81604
+ const cellAttrParts = [];
81605
+ if (cellAttrs.borders) {
81606
+ cellAttrParts.push(`cb:${hashCellBorders(cellAttrs.borders)}`);
81607
+ }
81608
+ if (cellAttrs.padding) {
81609
+ const p = cellAttrs.padding;
81610
+ cellAttrParts.push(`cp:${p.top ?? 0}:${p.right ?? 0}:${p.bottom ?? 0}:${p.left ?? 0}`);
81611
+ }
81612
+ if (cellAttrs.verticalAlign) {
81613
+ cellAttrParts.push(`va:${cellAttrs.verticalAlign}`);
81614
+ }
81615
+ if (cellAttrs.background) {
81616
+ cellAttrParts.push(`bg:${cellAttrs.background}`);
81617
+ }
81618
+ if (cellAttrParts.length > 0) {
81619
+ cellHashes.push(`ca:${cellAttrParts.join(":")}`);
81620
+ }
81621
+ }
81467
81622
  const cellBlocks = cell.blocks ?? (cell.paragraph ? [cell.paragraph] : []);
81468
81623
  for (const cellBlock of cellBlocks) {
81469
81624
  const paragraphBlock = cellBlock;
@@ -81530,8 +81685,25 @@ const hashRuns = (block) => {
81530
81685
  }
81531
81686
  }
81532
81687
  }
81688
+ let tableAttrsKey = "";
81689
+ if (tableBlock.attrs) {
81690
+ const tblAttrs = tableBlock.attrs;
81691
+ const tableAttrParts = [];
81692
+ if (tblAttrs.borders) {
81693
+ tableAttrParts.push(`tb:${hashTableBorders(tblAttrs.borders)}`);
81694
+ }
81695
+ if (tblAttrs.borderCollapse) {
81696
+ tableAttrParts.push(`bc:${tblAttrs.borderCollapse}`);
81697
+ }
81698
+ if (tblAttrs.cellSpacing !== void 0) {
81699
+ tableAttrParts.push(`cs:${tblAttrs.cellSpacing}`);
81700
+ }
81701
+ if (tableAttrParts.length > 0) {
81702
+ tableAttrsKey = `|ta:${tableAttrParts.join(":")}`;
81703
+ }
81704
+ }
81533
81705
  const contentHash = cellHashes.join("|");
81534
- return `${block.id}:table:${contentHash}`;
81706
+ return `${block.id}:table:${contentHash}${tableAttrsKey}`;
81535
81707
  }
81536
81708
  if (block.kind !== "paragraph") return block.id;
81537
81709
  const trackedMode = block.attrs && "trackedChangesMode" in block.attrs && block.attrs.trackedChangesMode || "review";
@@ -85763,7 +85935,7 @@ async function measureParagraphBlock(block, maxWidth) {
85763
85935
  const wordEndWithSpace = charPosInRun + (isLastWord ? word.length : word.length + 1);
85764
85936
  const effectiveMaxWidth = currentLine ? currentLine.maxWidth : getEffectiveWidth(lines.length === 0 ? initialAvailableWidth : contentWidth);
85765
85937
  if (wordOnlyWidth > effectiveMaxWidth && word.length > 1) {
85766
- if (currentLine && currentLine.width > 0 && currentLine.segments.length > 0) {
85938
+ if (currentLine && currentLine.width > 0 && currentLine.segments && currentLine.segments.length > 0) {
85767
85939
  const metrics = calculateTypographyMetrics(currentLine.maxFontSize, spacing, currentLine.maxFontInfo);
85768
85940
  const { spaceCount: _sc, ...lineBase } = currentLine;
85769
85941
  const completedLine = { ...lineBase, ...metrics };
@@ -85774,7 +85946,7 @@ async function measureParagraphBlock(block, maxWidth) {
85774
85946
  currentLine = null;
85775
85947
  }
85776
85948
  const lineMaxWidth = getEffectiveWidth(lines.length === 0 ? initialAvailableWidth : contentWidth);
85777
- const hasTabOnlyLine = currentLine && currentLine.segments.length === 0 && currentLine.width > 0;
85949
+ const hasTabOnlyLine = currentLine && currentLine.segments && currentLine.segments.length === 0 && currentLine.width > 0;
85778
85950
  const remainingWidthAfterTab = hasTabOnlyLine ? currentLine.maxWidth - currentLine.width : lineMaxWidth;
85779
85951
  const chunkWidth = hasTabOnlyLine ? Math.max(remainingWidthAfterTab, lineMaxWidth * 0.25) : lineMaxWidth;
85780
85952
  const chunks = breakWordIntoChunks(word, chunkWidth - WIDTH_FUDGE_PX2, font, ctx2, run2);
@@ -85785,7 +85957,7 @@ async function measureParagraphBlock(block, maxWidth) {
85785
85957
  const chunkEndChar = chunkCharOffset + chunk.text.length;
85786
85958
  const isLastChunk = chunkIndex === chunks.length - 1;
85787
85959
  const isFirstChunk = chunkIndex === 0;
85788
- if (isFirstChunk && hasTabOnlyLine && currentLine) {
85960
+ if (isFirstChunk && hasTabOnlyLine && currentLine && currentLine.segments) {
85789
85961
  currentLine.toRun = runIndex;
85790
85962
  currentLine.toChar = chunkEndChar;
85791
85963
  currentLine.width = roundValue(currentLine.width + chunk.width);
@@ -90022,18 +90194,19 @@ normalizeAwarenessStates_fn = function() {
90022
90194
  const normalized = /* @__PURE__ */ new Map();
90023
90195
  states?.forEach((aw, clientId) => {
90024
90196
  if (clientId === provider.awareness?.clientID) return;
90025
- if (!aw.cursor) return;
90197
+ const awState = aw;
90198
+ if (!awState.cursor) return;
90026
90199
  try {
90027
90200
  const anchor = relativePositionToAbsolutePosition(
90028
90201
  ystate.doc,
90029
90202
  ystate.type,
90030
- Y.createRelativePositionFromJSON(aw.cursor.anchor),
90203
+ Y.createRelativePositionFromJSON(awState.cursor.anchor),
90031
90204
  ystate.binding.mapping
90032
90205
  );
90033
90206
  const head = relativePositionToAbsolutePosition(
90034
90207
  ystate.doc,
90035
90208
  ystate.type,
90036
- Y.createRelativePositionFromJSON(aw.cursor.head),
90209
+ Y.createRelativePositionFromJSON(awState.cursor.head),
90037
90210
  ystate.binding.mapping
90038
90211
  );
90039
90212
  if (anchor === null || head === null) return;
@@ -90045,9 +90218,9 @@ normalizeAwarenessStates_fn = function() {
90045
90218
  normalized.set(clientId, {
90046
90219
  clientId,
90047
90220
  user: {
90048
- name: aw.user?.name,
90049
- email: aw.user?.email,
90050
- color: aw.user?.color || __privateMethod$1(this, _PresentationEditor_instances, getFallbackColor_fn).call(this, clientId)
90221
+ name: awState.user?.name,
90222
+ email: awState.user?.email,
90223
+ color: awState.user?.color || __privateMethod$1(this, _PresentationEditor_instances, getFallbackColor_fn).call(this, clientId)
90051
90224
  },
90052
90225
  anchor: clampedAnchor,
90053
90226
  head: clampedHead,
@@ -92521,8 +92694,8 @@ computeCaretLayoutRectGeometry_fn = function(pos, includeDomFallback = true) {
92521
92694
  const zoom2 = __privateGet$1(this, _layoutOptions).zoom ?? 1;
92522
92695
  let domCaretX2 = null;
92523
92696
  let domCaretY2 = null;
92524
- const spanEls2 = pageEl2?.querySelectorAll("span[data-pm-start][data-pm-end]") ?? [];
92525
- for (const spanEl of spanEls2) {
92697
+ const spanEls2 = pageEl2?.querySelectorAll("span[data-pm-start][data-pm-end]");
92698
+ for (const spanEl of Array.from(spanEls2 ?? [])) {
92526
92699
  const pmStart = Number(spanEl.dataset.pmStart);
92527
92700
  const pmEnd = Number(spanEl.dataset.pmEnd);
92528
92701
  if (pos >= pmStart && pos <= pmEnd && spanEl.firstChild?.nodeType === Node.TEXT_NODE) {
@@ -92574,8 +92747,8 @@ computeCaretLayoutRectGeometry_fn = function(pos, includeDomFallback = true) {
92574
92747
  const zoom = __privateGet$1(this, _layoutOptions).zoom ?? 1;
92575
92748
  let domCaretX = null;
92576
92749
  let domCaretY = null;
92577
- const spanEls = pageEl?.querySelectorAll("span[data-pm-start][data-pm-end]") ?? [];
92578
- for (const spanEl of spanEls) {
92750
+ const spanEls = pageEl?.querySelectorAll("span[data-pm-start][data-pm-end]");
92751
+ for (const spanEl of Array.from(spanEls ?? [])) {
92579
92752
  const pmStart = Number(spanEl.dataset.pmStart);
92580
92753
  const pmEnd = Number(spanEl.dataset.pmEnd);
92581
92754
  if (pos >= pmStart && pos <= pmEnd && spanEl.firstChild?.nodeType === Node.TEXT_NODE) {
@@ -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-NrpPx2Xr.js";
3
- import { _ as _export_sfc } from "./chunks/editor-Dnw031hl.js";
2
+ import { T as TextSelection } from "./chunks/converter-CE9B4HYb.js";
3
+ import { _ as _export_sfc } from "./chunks/editor-DLjQOZqB.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 = {}) {
@@ -42727,7 +42727,7 @@ const _SuperConverter = class _SuperConverter {
42727
42727
  static getStoredSuperdocVersion(docx) {
42728
42728
  return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
42729
42729
  }
42730
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.102") {
42730
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.103") {
42731
42731
  return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
42732
42732
  }
42733
42733
  /**
@@ -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-NrpPx2Xr.js";
1
+ import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-CE9B4HYb.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
  }