@harbour-enterprises/superdoc 1.0.0-beta.56 → 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-DsYaXp0H.es.js → PdfViewer-BpJ5YJmq.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-CnvD--7P.cjs → PdfViewer-DvAhx37Y.cjs} +1 -1
  3. package/dist/chunks/{index-DF1aQt8V.es.js → index-BE9w4viZ.es.js} +3 -3
  4. package/dist/chunks/{index-BpBdSm3V.cjs → index-BbXDEDIW.cjs} +3 -3
  5. package/dist/chunks/{index-DYnUncjo-Br0s3gQs.es.js → index-D5IkZjf9-CPmfOXHq.es.js} +1 -1
  6. package/dist/chunks/{index-DYnUncjo-Uv8YzgRb.cjs → index-D5IkZjf9-XnnWMFi7.cjs} +1 -1
  7. package/dist/chunks/{super-editor.es-BxMwj135.es.js → super-editor.es-BY9i51n2.es.js} +92 -25
  8. package/dist/chunks/{super-editor.es-DkFw0sfq.cjs → super-editor.es-BjELk3Xl.cjs} +92 -25
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-DwC5XPQX.js → converter-Aoe_RSZD.js} +1 -1
  11. package/dist/super-editor/chunks/{docx-zipper-BkCzC50U.js → docx-zipper-Ct68kitw.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-CoKNeouN.js → editor-Dfqm3VkC.js} +93 -26
  13. package/dist/super-editor/chunks/{index-DYnUncjo.js → index-D5IkZjf9.js} +1 -1
  14. package/dist/super-editor/chunks/{toolbar-DUWk-Bwi.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 +94 -27
  26. package/dist/superdoc.umd.js.map +1 -1
  27. package/package.json +1 -1
@@ -42186,7 +42186,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
42186
42186
  static getStoredSuperdocVersion(docx) {
42187
42187
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
42188
42188
  }
42189
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.56") {
42189
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.57") {
42190
42190
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
42191
42191
  }
42192
42192
  /**
@@ -67225,7 +67225,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
67225
67225
  const shouldSkipNodeView = (editor) => {
67226
67226
  return isHeadless(editor);
67227
67227
  };
67228
- const summaryVersion = "1.0.0-beta.56";
67228
+ const summaryVersion = "1.0.0-beta.57";
67229
67229
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
67230
67230
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
67231
67231
  function mapAttributes(attrs) {
@@ -68014,7 +68014,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
68014
68014
  { default: remarkStringify2 },
68015
68015
  { default: remarkGfm2 }
68016
68016
  ] = await Promise.all([
68017
- Promise.resolve().then(() => indexDYnUncjo),
68017
+ Promise.resolve().then(() => indexD5IkZjf9),
68018
68018
  Promise.resolve().then(() => indexDRCvimau),
68019
68019
  Promise.resolve().then(() => indexC_x_N6Uh),
68020
68020
  Promise.resolve().then(() => indexD_sWOSiG),
@@ -68219,7 +68219,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
68219
68219
  * Process collaboration migrations
68220
68220
  */
68221
68221
  processCollaborationMigrations() {
68222
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.56");
68222
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.57");
68223
68223
  if (!this.options.ydoc) return;
68224
68224
  const metaMap = this.options.ydoc.getMap("meta");
68225
68225
  let docVersion = metaMap.get("version");
@@ -70695,6 +70695,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
70695
70695
  case "center":
70696
70696
  case "right":
70697
70697
  case "justify":
70698
+ case "left":
70698
70699
  return value;
70699
70700
  case "both":
70700
70701
  case "distribute":
@@ -80250,9 +80251,11 @@ ${l}
80250
80251
  const hasExplicitSegmentPositioning = line.segments?.some((seg) => seg.x !== void 0);
80251
80252
  const isFirstLine = index2 === 0 && !fragment.continuesFromPrev;
80252
80253
  if (!isListFirstLine) {
80253
- if (isFirstLine && hasExplicitSegmentPositioning && firstLineOffset !== 0) {
80254
- const adjustedPadding = paraIndentLeft + firstLineOffset;
80255
- lineEl.style.paddingLeft = `${adjustedPadding}px`;
80254
+ if (hasExplicitSegmentPositioning) {
80255
+ if (isFirstLine && firstLineOffset !== 0) {
80256
+ const adjustedPadding = paraIndentLeft + firstLineOffset;
80257
+ lineEl.style.paddingLeft = `${adjustedPadding}px`;
80258
+ }
80256
80259
  } else if (paraIndentLeft) {
80257
80260
  lineEl.style.paddingLeft = `${paraIndentLeft}px`;
80258
80261
  }
@@ -81683,6 +81686,13 @@ ${l}
81683
81686
  }
81684
81687
  }
81685
81688
  if (hasExplicitPositioning && line.segments) {
81689
+ const paraIndent = block.attrs?.indent;
81690
+ const indentLeft = paraIndent?.left ?? 0;
81691
+ const firstLine = paraIndent?.firstLine ?? 0;
81692
+ const hanging = paraIndent?.hanging ?? 0;
81693
+ const isFirstLineOfPara = lineIndex === 0 || lineIndex === void 0;
81694
+ const firstLineOffsetForCumX = isFirstLineOfPara ? firstLine - hanging : 0;
81695
+ const indentOffset = indentLeft + firstLineOffsetForCumX;
81686
81696
  let cumulativeX = 0;
81687
81697
  const segmentsByRun = /* @__PURE__ */ new Map();
81688
81698
  line.segments.forEach((segment) => {
@@ -81714,7 +81724,7 @@ ${l}
81714
81724
  const actualTabWidth = tabEndX - tabStartX;
81715
81725
  const tabEl = this.doc.createElement("span");
81716
81726
  tabEl.style.position = "absolute";
81717
- tabEl.style.left = `${tabStartX}px`;
81727
+ tabEl.style.left = `${tabStartX + indentOffset}px`;
81718
81728
  tabEl.style.top = "0px";
81719
81729
  tabEl.style.width = `${actualTabWidth}px`;
81720
81730
  tabEl.style.height = `${line.lineHeight}px`;
@@ -81745,12 +81755,13 @@ ${l}
81745
81755
  elem.setAttribute("styleid", styleId);
81746
81756
  }
81747
81757
  const runSegments2 = segmentsByRun.get(runIndex);
81748
- const segX = runSegments2 && runSegments2[0]?.x !== void 0 ? runSegments2[0].x : cumulativeX;
81758
+ const baseSegX = runSegments2 && runSegments2[0]?.x !== void 0 ? runSegments2[0].x : cumulativeX;
81759
+ const segX = baseSegX + indentOffset;
81749
81760
  const segWidth = (runSegments2 && runSegments2[0]?.width !== void 0 ? runSegments2[0].width : elem.offsetWidth) ?? 0;
81750
81761
  elem.style.position = "absolute";
81751
81762
  elem.style.left = `${segX}px`;
81752
81763
  el.appendChild(elem);
81753
- cumulativeX = segX + segWidth;
81764
+ cumulativeX = baseSegX + segWidth;
81754
81765
  }
81755
81766
  continue;
81756
81767
  }
@@ -81767,12 +81778,13 @@ ${l}
81767
81778
  elem.setAttribute("styleid", styleId);
81768
81779
  }
81769
81780
  const runSegments2 = segmentsByRun.get(runIndex);
81770
- const segX = runSegments2 && runSegments2[0]?.x !== void 0 ? runSegments2[0].x : cumulativeX;
81781
+ const baseSegX = runSegments2 && runSegments2[0]?.x !== void 0 ? runSegments2[0].x : cumulativeX;
81782
+ const segX = baseSegX + indentOffset;
81771
81783
  const segWidth = (runSegments2 && runSegments2[0]?.width !== void 0 ? runSegments2[0].width : 0) ?? 0;
81772
81784
  elem.style.position = "absolute";
81773
81785
  elem.style.left = `${segX}px`;
81774
81786
  el.appendChild(elem);
81775
- cumulativeX = segX + segWidth;
81787
+ cumulativeX = baseSegX + segWidth;
81776
81788
  }
81777
81789
  continue;
81778
81790
  }
@@ -81802,7 +81814,8 @@ ${l}
81802
81814
  if (styleId) {
81803
81815
  elem.setAttribute("styleid", styleId);
81804
81816
  }
81805
- const xPos = segment.x !== void 0 ? segment.x : cumulativeX;
81817
+ const baseX = segment.x !== void 0 ? segment.x : cumulativeX;
81818
+ const xPos = baseX + indentOffset;
81806
81819
  elem.style.position = "absolute";
81807
81820
  elem.style.left = `${xPos}px`;
81808
81821
  el.appendChild(elem);
@@ -81816,7 +81829,7 @@ ${l}
81816
81829
  width = measureEl.offsetWidth;
81817
81830
  this.doc.body.removeChild(measureEl);
81818
81831
  }
81819
- cumulativeX = xPos + width;
81832
+ cumulativeX = baseX + width;
81820
81833
  }
81821
81834
  });
81822
81835
  }
@@ -84206,6 +84219,32 @@ ${l}
84206
84219
  state2.page.fragments.push(fragment);
84207
84220
  state2.cursorY += requiredHeight;
84208
84221
  }
84222
+ function getTableIndentWidth(attrs) {
84223
+ if (!attrs) {
84224
+ return 0;
84225
+ }
84226
+ const tableIndent = attrs.tableIndent;
84227
+ if (!tableIndent || typeof tableIndent !== "object") {
84228
+ return 0;
84229
+ }
84230
+ const width = tableIndent.width;
84231
+ if (width === void 0 || width === null) {
84232
+ return 0;
84233
+ }
84234
+ if (typeof width !== "number") {
84235
+ return 0;
84236
+ }
84237
+ if (!Number.isFinite(width)) {
84238
+ return 0;
84239
+ }
84240
+ return width;
84241
+ }
84242
+ function applyTableIndent(x2, width, indent2) {
84243
+ return {
84244
+ x: x2 + indent2,
84245
+ width: Math.max(0, width - indent2)
84246
+ };
84247
+ }
84209
84248
  function calculateColumnMinWidth(columnIndex, measure) {
84210
84249
  const DEFAULT_MIN_WIDTH = 25;
84211
84250
  const measuredWidth = measure.columnWidths[columnIndex] || DEFAULT_MIN_WIDTH;
@@ -84420,14 +84459,18 @@ ${l}
84420
84459
  columnBoundaries: generateColumnBoundaries(context.measure),
84421
84460
  coordinateSystem: "fragment"
84422
84461
  };
84462
+ const tableIndent = getTableIndentWidth(context.block.attrs);
84463
+ const baseX = context.columnX(state2.columnIndex);
84464
+ const baseWidth = Math.min(context.columnWidth, context.measure.totalWidth || context.columnWidth);
84465
+ const { x: x2, width } = applyTableIndent(baseX, baseWidth, tableIndent);
84423
84466
  const fragment = {
84424
84467
  kind: "table",
84425
84468
  blockId: context.block.id,
84426
84469
  fromRow: 0,
84427
84470
  toRow: context.block.rows.length,
84428
- x: context.columnX(state2.columnIndex),
84471
+ x: x2,
84429
84472
  y: state2.cursorY,
84430
- width: Math.min(context.columnWidth, context.measure.totalWidth || context.columnWidth),
84473
+ width,
84431
84474
  height,
84432
84475
  metadata
84433
84476
  };
@@ -84494,14 +84537,18 @@ ${l}
84494
84537
  columnBoundaries: generateColumnBoundaries(measure),
84495
84538
  coordinateSystem: "fragment"
84496
84539
  };
84540
+ const tableIndent = getTableIndentWidth(block.attrs);
84541
+ const baseX = columnX(state2.columnIndex);
84542
+ const baseWidth = Math.min(columnWidth, measure.totalWidth || columnWidth);
84543
+ const { x: x2, width } = applyTableIndent(baseX, baseWidth, tableIndent);
84497
84544
  const fragment = {
84498
84545
  kind: "table",
84499
84546
  blockId: block.id,
84500
84547
  fromRow: 0,
84501
84548
  toRow: 0,
84502
- x: columnX(state2.columnIndex),
84549
+ x: x2,
84503
84550
  y: state2.cursorY,
84504
- width: Math.min(columnWidth, measure.totalWidth || columnWidth),
84551
+ width,
84505
84552
  height,
84506
84553
  metadata
84507
84554
  };
@@ -84549,14 +84596,18 @@ ${l}
84549
84596
  });
84550
84597
  const fragmentHeight2 = continuationPartialRow.partialHeight + (repeatHeaderCount > 0 ? headerHeight : 0);
84551
84598
  if (fragmentHeight2 > 0 && madeProgress) {
84599
+ const tableIndent2 = getTableIndentWidth(block.attrs);
84600
+ const baseX2 = columnX(state2.columnIndex);
84601
+ const baseWidth2 = Math.min(columnWidth, measure.totalWidth || columnWidth);
84602
+ const { x: x22, width: width2 } = applyTableIndent(baseX2, baseWidth2, tableIndent2);
84552
84603
  const fragment2 = {
84553
84604
  kind: "table",
84554
84605
  blockId: block.id,
84555
84606
  fromRow: rowIndex,
84556
84607
  toRow: rowIndex + 1,
84557
- x: columnX(state2.columnIndex),
84608
+ x: x22,
84558
84609
  y: state2.cursorY,
84559
- width: Math.min(columnWidth, measure.totalWidth || columnWidth),
84610
+ width: width2,
84560
84611
  height: fragmentHeight2,
84561
84612
  continuesFromPrev: true,
84562
84613
  continuesOnNext: hasRemainingLinesAfterContinuation || rowIndex + 1 < block.rows.length,
@@ -84589,14 +84640,18 @@ ${l}
84589
84640
  const forcedPartialRow = computePartialRow(bodyStartRow, block.rows[bodyStartRow], measure, availableForBody);
84590
84641
  const forcedEndRow = bodyStartRow + 1;
84591
84642
  const fragmentHeight2 = forcedPartialRow.partialHeight + (repeatHeaderCount > 0 ? headerHeight : 0);
84643
+ const tableIndent2 = getTableIndentWidth(block.attrs);
84644
+ const baseX2 = columnX(state2.columnIndex);
84645
+ const baseWidth2 = Math.min(columnWidth, measure.totalWidth || columnWidth);
84646
+ const { x: x22, width: width2 } = applyTableIndent(baseX2, baseWidth2, tableIndent2);
84592
84647
  const fragment2 = {
84593
84648
  kind: "table",
84594
84649
  blockId: block.id,
84595
84650
  fromRow: bodyStartRow,
84596
84651
  toRow: forcedEndRow,
84597
- x: columnX(state2.columnIndex),
84652
+ x: x22,
84598
84653
  y: state2.cursorY,
84599
- width: Math.min(columnWidth, measure.totalWidth || columnWidth),
84654
+ width: width2,
84600
84655
  height: fragmentHeight2,
84601
84656
  continuesFromPrev: isTableContinuation,
84602
84657
  continuesOnNext: !forcedPartialRow.isLastPart || forcedEndRow < block.rows.length,
@@ -84620,14 +84675,18 @@ ${l}
84620
84675
  measure
84621
84676
  );
84622
84677
  }
84678
+ const tableIndent = getTableIndentWidth(block.attrs);
84679
+ const baseX = columnX(state2.columnIndex);
84680
+ const baseWidth = Math.min(columnWidth, measure.totalWidth || columnWidth);
84681
+ const { x: x2, width } = applyTableIndent(baseX, baseWidth, tableIndent);
84623
84682
  const fragment = {
84624
84683
  kind: "table",
84625
84684
  blockId: block.id,
84626
84685
  fromRow: bodyStartRow,
84627
84686
  toRow: endRow,
84628
- x: columnX(state2.columnIndex),
84687
+ x: x2,
84629
84688
  y: state2.cursorY,
84630
- width: Math.min(columnWidth, measure.totalWidth || columnWidth),
84689
+ width,
84631
84690
  height: fragmentHeight,
84632
84691
  continuesFromPrev: isTableContinuation,
84633
84692
  continuesOnNext: endRow < block.rows.length || (partialRow ? !partialRow.isLastPart : false),
@@ -89415,7 +89474,15 @@ ${l}
89415
89474
  currentLine.width = roundValue(currentLine.width + boundarySpacing + wordOnlyWidth);
89416
89475
  currentLine.maxFontInfo = updateMaxFontInfo(currentLine.maxFontSize, currentLine.maxFontInfo, run2);
89417
89476
  currentLine.maxFontSize = Math.max(currentLine.maxFontSize, run2.fontSize);
89418
- appendSegment(currentLine.segments, runIndex, wordStartChar, wordEndNoSpace, wordOnlyWidth, segmentStartX);
89477
+ const useExplicitXHere = wordIndex === 0 && segmentStartX !== void 0;
89478
+ appendSegment(
89479
+ currentLine.segments,
89480
+ runIndex,
89481
+ wordStartChar,
89482
+ wordEndNoSpace,
89483
+ wordOnlyWidth,
89484
+ useExplicitXHere ? segmentStartX : void 0
89485
+ );
89419
89486
  const metrics = calculateTypographyMetrics(currentLine.maxFontSize, spacing, currentLine.maxFontInfo);
89420
89487
  const completedLine = { ...currentLine, ...metrics };
89421
89488
  addBarTabsToLine(completedLine);
@@ -148997,7 +149064,7 @@ ${style2}
148997
149064
  this.config.colors = shuffleArray(this.config.colors);
148998
149065
  this.userColorMap = /* @__PURE__ */ new Map();
148999
149066
  this.colorIndex = 0;
149000
- this.version = "1.0.0-beta.56";
149067
+ this.version = "1.0.0-beta.57";
149001
149068
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
149002
149069
  this.superdocId = config2.superdocId || v4();
149003
149070
  this.colors = this.config.colors;
@@ -151463,7 +151530,7 @@ ${style2}
151463
151530
  value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
151464
151531
  );
151465
151532
  }
151466
- const indexDYnUncjo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
151533
+ const indexD5IkZjf9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
151467
151534
  __proto__: null,
151468
151535
  unified
151469
151536
  }, Symbol.toStringTag, { value: "Module" }));