@harbour-enterprises/superdoc 2.0.0-next.5 → 2.0.0-next.7

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-CO_oGFDw.es.js → PdfViewer-DJcF4vHT.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-C4wZizyW.cjs → PdfViewer-FweBhk9D.cjs} +1 -1
  3. package/dist/chunks/{index-CBSyVaOM-BMpzJRoR.cjs → index-CxQTFiXW-7XoegSE2.cjs} +1 -1
  4. package/dist/chunks/{index-CBSyVaOM-B5I90g0S.es.js → index-CxQTFiXW-O-lOD6-A.es.js} +1 -1
  5. package/dist/chunks/{index-B4QOihiF.cjs → index-D68il1se.cjs} +3 -3
  6. package/dist/chunks/{index-XOJnODHJ.es.js → index-DaCKjOwK.es.js} +3 -3
  7. package/dist/chunks/{super-editor.es-DzolekK0.cjs → super-editor.es-Bd6B_Npe.cjs} +43 -9
  8. package/dist/chunks/{super-editor.es-qnE7-VRy.es.js → super-editor.es-UkB3ld-_.es.js} +43 -9
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-CH2eG52x.js → converter-Dtu-msFQ.js} +1 -1
  11. package/dist/super-editor/chunks/{docx-zipper-JJRnWzI6.js → docx-zipper-D2uP_64-.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-Du7p05wU.js → editor-CkPpri9l.js} +44 -10
  13. package/dist/super-editor/chunks/{index-CBSyVaOM.js → index-CxQTFiXW.js} +1 -1
  14. package/dist/super-editor/chunks/{toolbar-unNlfpEL.js → toolbar-CNpHAKgS.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 +45 -11
  26. package/dist/superdoc.umd.js.map +1 -1
  27. package/package.json +1 -1
@@ -42428,7 +42428,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
42428
42428
  static getStoredSuperdocVersion(docx) {
42429
42429
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
42430
42430
  }
42431
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "2.0.0-next.5") {
42431
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "2.0.0-next.7") {
42432
42432
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
42433
42433
  }
42434
42434
  /**
@@ -68384,7 +68384,7 @@ ${err.toString()}`);
68384
68384
  const shouldSkipNodeView = (editor) => {
68385
68385
  return isHeadless(editor);
68386
68386
  };
68387
- const summaryVersion = "2.0.0-next.5";
68387
+ const summaryVersion = "2.0.0-next.7";
68388
68388
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
68389
68389
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
68390
68390
  function mapAttributes(attrs) {
@@ -69173,7 +69173,7 @@ ${err.toString()}`);
69173
69173
  { default: remarkStringify2 },
69174
69174
  { default: remarkGfm2 }
69175
69175
  ] = await Promise.all([
69176
- Promise.resolve().then(() => indexCBSyVaOM),
69176
+ Promise.resolve().then(() => indexCxQTFiXW),
69177
69177
  Promise.resolve().then(() => indexDRCvimau),
69178
69178
  Promise.resolve().then(() => indexC_x_N6Uh),
69179
69179
  Promise.resolve().then(() => indexD_sWOSiG),
@@ -69378,7 +69378,7 @@ ${err.toString()}`);
69378
69378
  * Process collaboration migrations
69379
69379
  */
69380
69380
  processCollaborationMigrations() {
69381
- console.debug("[checkVersionMigrations] Current editor version", "2.0.0-next.5");
69381
+ console.debug("[checkVersionMigrations] Current editor version", "2.0.0-next.7");
69382
69382
  if (!this.options.ydoc) return;
69383
69383
  const metaMap = this.options.ydoc.getMap("meta");
69384
69384
  let docVersion = metaMap.get("version");
@@ -85498,6 +85498,9 @@ ${l}
85498
85498
  if (!Number.isFinite(height) || height <= 0) {
85499
85499
  throw new Error("layoutHeaderFooter: height must be positive");
85500
85500
  }
85501
+ const maxBehindDocOverflow = Math.max(192, height * 4);
85502
+ const minBehindDocY = -maxBehindDocOverflow;
85503
+ const maxBehindDocY = height + maxBehindDocOverflow;
85501
85504
  const marginLeft = constraints.margins?.left ?? 0;
85502
85505
  const transformedBlocks = marginLeft > 0 ? blocks2.map((block) => {
85503
85506
  const hasPageRelativeAnchor = (block.kind === "image" || block.kind === "drawing") && block.anchor?.hRelativeFrom === "page" && block.anchor.offsetH != null;
@@ -85528,6 +85531,18 @@ ${l}
85528
85531
  if (idx == null) continue;
85529
85532
  const block = blocks2[idx];
85530
85533
  const measure = measures[idx];
85534
+ const isAnchoredFragment = (fragment.kind === "image" || fragment.kind === "drawing") && fragment.isAnchored === true;
85535
+ if (isAnchoredFragment) {
85536
+ if (block.kind !== "image" && block.kind !== "drawing") {
85537
+ throw new Error(
85538
+ `Type mismatch: fragment kind is ${fragment.kind} but block kind is ${block.kind} for block ${block.id}`
85539
+ );
85540
+ }
85541
+ const anchoredBlock = block;
85542
+ if (anchoredBlock.anchor?.behindDoc && (fragment.y < minBehindDocY || fragment.y > maxBehindDocY)) {
85543
+ continue;
85544
+ }
85545
+ }
85531
85546
  if (fragment.y < minY) minY = fragment.y;
85532
85547
  let bottom2 = fragment.y;
85533
85548
  if (fragment.kind === "para" && measure?.kind === "paragraph") {
@@ -92489,11 +92504,27 @@ ${l}
92489
92504
  }, void 0);
92490
92505
  };
92491
92506
  const normalizeUnderlineStyle = (value) => {
92492
- if (value === "none") {
92493
- return void 0;
92507
+ if (value === void 0 || value === null) {
92508
+ return "single";
92494
92509
  }
92495
- if (value === "double" || value === "dotted" || value === "dashed" || value === "wavy") {
92496
- return value;
92510
+ if (typeof value === "boolean") {
92511
+ return value ? "single" : void 0;
92512
+ }
92513
+ if (typeof value === "number") {
92514
+ return value === 0 ? void 0 : "single";
92515
+ }
92516
+ if (typeof value === "string") {
92517
+ const normalized = value.trim().toLowerCase();
92518
+ if (!normalized) {
92519
+ return "single";
92520
+ }
92521
+ if (normalized === "none" || normalized === "0" || normalized === "false" || normalized === "off") {
92522
+ return void 0;
92523
+ }
92524
+ if (normalized === "double" || normalized === "dotted" || normalized === "dashed" || normalized === "wavy") {
92525
+ return normalized;
92526
+ }
92527
+ return "single";
92497
92528
  }
92498
92529
  return "single";
92499
92530
  };
@@ -92645,13 +92676,16 @@ ${l}
92645
92676
  break;
92646
92677
  }
92647
92678
  case "underline": {
92648
- const style2 = normalizeUnderlineStyle(mark2.attrs?.underlineType);
92679
+ const underlineValue = mark2.attrs?.underlineType ?? mark2.attrs?.value ?? mark2.attrs?.underline ?? mark2.attrs?.style;
92680
+ const style2 = normalizeUnderlineStyle(underlineValue);
92649
92681
  if (style2) {
92650
92682
  const underlineColor = resolveColorFromAttributes(mark2.attrs ?? {}, themeColors);
92651
92683
  run2.underline = {
92652
92684
  style: style2,
92653
92685
  color: underlineColor ?? run2.underline?.color
92654
92686
  };
92687
+ } else if (underlineValue !== void 0 && underlineValue !== null) {
92688
+ delete run2.underline;
92655
92689
  }
92656
92690
  break;
92657
92691
  }
@@ -157780,7 +157814,7 @@ ${style2}
157780
157814
  this.config.colors = shuffleArray(this.config.colors);
157781
157815
  this.userColorMap = /* @__PURE__ */ new Map();
157782
157816
  this.colorIndex = 0;
157783
- this.version = "2.0.0-next.5";
157817
+ this.version = "2.0.0-next.7";
157784
157818
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
157785
157819
  this.superdocId = config2.superdocId || v4();
157786
157820
  this.colors = this.config.colors;
@@ -160253,7 +160287,7 @@ ${style2}
160253
160287
  value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
160254
160288
  );
160255
160289
  }
160256
- const indexCBSyVaOM = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
160290
+ const indexCxQTFiXW = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
160257
160291
  __proto__: null,
160258
160292
  unified
160259
160293
  }, Symbol.toStringTag, { value: "Module" }));