@superdoc-dev/cli 0.17.0-next.1 → 0.17.0-next.11

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 (2) hide show
  1. package/dist/index.js +1042 -228
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -68327,7 +68327,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
68327
68327
  emptyOptions2 = {};
68328
68328
  });
68329
68329
 
68330
- // ../../packages/superdoc/dist/chunks/SuperConverter-C6RGktKO.es.js
68330
+ // ../../packages/superdoc/dist/chunks/SuperConverter-DJyHekqW.es.js
68331
68331
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
68332
68332
  const fieldValue = extension$1.config[field];
68333
68333
  if (typeof fieldValue === "function")
@@ -102470,42 +102470,80 @@ function isSettled(status) {
102470
102470
  function normalizeFamilyName(name) {
102471
102471
  return name.trim().replace(/^['"]+|['"]+$/g, "").trim().toLowerCase();
102472
102472
  }
102473
- function buildFallback(row, physicalFamily) {
102473
+ function buildFallback(row, physicalFamily, verdict, faceSlot, faceSource) {
102474
+ const glyphExceptions = faceSlot ? row.glyphExceptions?.filter((g2) => g2.slot === faceSlot) : row.glyphExceptions ? [...row.glyphExceptions] : undefined;
102474
102475
  return {
102475
102476
  substituteFamily: physicalFamily,
102476
102477
  policyAction: row.policyAction,
102477
- verdict: row.verdict,
102478
- lineBreakSafe: LINE_BREAK_SAFE_VERDICTS.has(row.verdict),
102479
- evidenceId: row.evidenceId
102478
+ verdict,
102479
+ lineBreakSafe: LINE_BREAK_SAFE_VERDICTS.has(verdict),
102480
+ faces: row.faces,
102481
+ evidenceId: row.evidenceId,
102482
+ generic: row.generic,
102483
+ ...faceSource ? { faceSource: { ...faceSource } } : {},
102484
+ ...glyphExceptions && glyphExceptions.length > 0 ? { glyphExceptions } : {}
102480
102485
  };
102481
102486
  }
102482
102487
  function decideRow(row, canRenderFamily$1) {
102483
- const { policyAction, physicalFamily, verdict, evidenceId } = row;
102488
+ const { policyAction, physicalFamily, verdict, evidenceId, generic } = row;
102484
102489
  if (policyAction === "preserve_only")
102485
102490
  return {
102486
102491
  kind: "preserve_only",
102487
- evidenceId
102492
+ evidenceId,
102493
+ generic
102488
102494
  };
102489
102495
  if (policyAction === "customer_supplied")
102490
102496
  return {
102491
102497
  kind: "customer_supplied",
102492
- evidenceId
102498
+ evidenceId,
102499
+ generic
102493
102500
  };
102494
102501
  if (physicalFamily === null)
102495
102502
  return {
102496
102503
  kind: "no_recommended_fallback",
102497
- evidenceId
102504
+ evidenceId,
102505
+ generic
102498
102506
  };
102499
102507
  if (canRenderFamily$1 && !canRenderFamily$1(physicalFamily))
102500
102508
  return {
102501
102509
  kind: "asset_missing",
102502
102510
  substituteFamily: physicalFamily,
102503
102511
  verdict,
102504
- evidenceId
102512
+ evidenceId,
102513
+ generic
102505
102514
  };
102506
102515
  return {
102507
102516
  kind: "fallback",
102508
- fallback: buildFallback(row, physicalFamily)
102517
+ fallback: buildFallback(row, physicalFamily, verdict)
102518
+ };
102519
+ }
102520
+ function isFaceScoped(row) {
102521
+ const f2 = row.faces;
102522
+ return f2.regular || f2.bold || f2.italic || f2.boldItalic;
102523
+ }
102524
+ function faceSourceFor(row, face) {
102525
+ const explicit = row.faceSources?.[face];
102526
+ if (explicit)
102527
+ return explicit;
102528
+ return isFaceScoped(row) && row.faces[face] ? { kind: "real" } : undefined;
102529
+ }
102530
+ function decideRowForFace(row, face, canRenderFamily$1) {
102531
+ const base$1 = decideRow(row, canRenderFamily$1);
102532
+ if (base$1.kind !== "fallback")
102533
+ return base$1;
102534
+ const faceSource = faceSourceFor(row, face);
102535
+ if (isFaceScoped(row) && !faceSource)
102536
+ return {
102537
+ kind: "face_missing",
102538
+ substituteFamily: base$1.fallback.substituteFamily,
102539
+ evidenceId: row.evidenceId,
102540
+ generic: row.generic
102541
+ };
102542
+ const faceVerdict = row.faceVerdicts?.[face] ?? row.verdict;
102543
+ const projectedFaceSource = faceSource?.kind === "synthetic" ? faceSource : undefined;
102544
+ return {
102545
+ kind: "fallback",
102546
+ fallback: buildFallback(row, base$1.fallback.substituteFamily, faceVerdict, face, projectedFaceSource)
102509
102547
  };
102510
102548
  }
102511
102549
  function getFallbackDecision(family$1, options = {}) {
@@ -102516,6 +102554,14 @@ function getRenderableFallback(family$1, options) {
102516
102554
  const decision = getFallbackDecision(family$1, options);
102517
102555
  return decision.kind === "fallback" ? decision.fallback : null;
102518
102556
  }
102557
+ function getFallbackDecisionForFace(family$1, face, options = {}) {
102558
+ const row = BY_LOGICAL.get(normalizeFamilyName(family$1));
102559
+ return row ? decideRowForFace(row, face, options.canRenderFamily) : { kind: "unknown" };
102560
+ }
102561
+ function getRenderableFallbackForFace(family$1, face, options) {
102562
+ const decision = getFallbackDecisionForFace(family$1, face, options);
102563
+ return decision.kind === "fallback" ? decision.fallback : null;
102564
+ }
102519
102565
  function fourFaces(filePrefix) {
102520
102566
  return [
102521
102567
  {
@@ -102547,12 +102593,87 @@ function family(name, filePrefix, license) {
102547
102593
  faces: fourFaces(filePrefix)
102548
102594
  };
102549
102595
  }
102596
+ function familyWithFaces(name, license, faces) {
102597
+ return {
102598
+ family: name,
102599
+ license,
102600
+ faces
102601
+ };
102602
+ }
102550
102603
  function normalizeFamilyKey$1(family$1) {
102551
102604
  return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
102552
102605
  }
102553
102606
  function sortPairs(pairs) {
102554
102607
  return pairs.sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
102555
102608
  }
102609
+ function faceSlotFor$1({ weight, style }) {
102610
+ const bold2 = weight === "700";
102611
+ const italic = style === "italic";
102612
+ if (bold2 && italic)
102613
+ return "boldItalic";
102614
+ if (bold2)
102615
+ return "bold";
102616
+ if (italic)
102617
+ return "italic";
102618
+ return "regular";
102619
+ }
102620
+ function faceKeyForSlot(slot) {
102621
+ switch (slot) {
102622
+ case "bold":
102623
+ return {
102624
+ weight: "700",
102625
+ style: "normal"
102626
+ };
102627
+ case "italic":
102628
+ return {
102629
+ weight: "400",
102630
+ style: "italic"
102631
+ };
102632
+ case "boldItalic":
102633
+ return {
102634
+ weight: "700",
102635
+ style: "italic"
102636
+ };
102637
+ case "regular":
102638
+ return {
102639
+ weight: "400",
102640
+ style: "normal"
102641
+ };
102642
+ }
102643
+ }
102644
+ function reasonForFallback(policyAction) {
102645
+ return policyAction === "category_fallback" ? "category_fallback" : "bundled_substitute";
102646
+ }
102647
+ function resolveDocfontsFace(primary, face, hasFace) {
102648
+ const decision = getFallbackDecisionForFace(primary, faceSlotFor$1(face), { canRenderFamily });
102649
+ if (decision.kind === "face_missing")
102650
+ return {
102651
+ physical: primary,
102652
+ reason: "fallback_face_absent"
102653
+ };
102654
+ if (decision.kind !== "fallback")
102655
+ return null;
102656
+ const fallback = decision.fallback;
102657
+ if (fallback.policyAction !== "substitute" && fallback.policyAction !== "category_fallback")
102658
+ return null;
102659
+ if (hasFace(fallback.substituteFamily, face.weight, face.style))
102660
+ return {
102661
+ physical: fallback.substituteFamily,
102662
+ reason: reasonForFallback(fallback.policyAction)
102663
+ };
102664
+ const sourceFace = fallback.faceSource?.kind === "synthetic" ? faceKeyForSlot(fallback.faceSource.from) : face;
102665
+ if (!hasFace(fallback.substituteFamily, sourceFace.weight, sourceFace.style))
102666
+ return fallback.policyAction === "substitute" ? {
102667
+ physical: primary,
102668
+ reason: "fallback_face_absent"
102669
+ } : null;
102670
+ const sourceDiffers = sourceFace.weight !== face.weight || sourceFace.style !== face.style;
102671
+ return {
102672
+ physical: fallback.substituteFamily,
102673
+ reason: reasonForFallback(fallback.policyAction),
102674
+ ...sourceDiffers ? { sourceFace } : {}
102675
+ };
102676
+ }
102556
102677
  function deriveBundledSubstitutes() {
102557
102678
  const substitutes = {};
102558
102679
  for (const row of SUBSTITUTION_EVIDENCE) {
@@ -102646,6 +102767,17 @@ function installBundledSubstitutes(registry, options = {}) {
102646
102767
  });
102647
102768
  }
102648
102769
  }
102770
+ function toEvidence(fallback) {
102771
+ if (!fallback)
102772
+ return;
102773
+ return {
102774
+ evidenceId: fallback.evidenceId,
102775
+ policyAction: fallback.policyAction,
102776
+ verdict: fallback.verdict,
102777
+ lineBreakSafe: fallback.lineBreakSafe,
102778
+ ...fallback.glyphExceptions ? { glyphExceptions: fallback.glyphExceptions } : {}
102779
+ };
102780
+ }
102649
102781
  function buildFontReport(logicalFamilies, registry, resolver$1) {
102650
102782
  const seen = /* @__PURE__ */ new Set;
102651
102783
  const report = [];
@@ -102655,13 +102787,15 @@ function buildFontReport(logicalFamilies, registry, resolver$1) {
102655
102787
  seen.add(logical);
102656
102788
  const { physicalFamily, reason } = resolver$1 ? resolver$1.resolveFontFamily(logical) : resolveFontFamily(logical);
102657
102789
  const loadStatus = registry.getStatus(physicalFamily);
102790
+ const evidence = isRenderedSubstitute(reason) ? toEvidence(getRenderableFallback(logical, RENDER_ALL)) : undefined;
102658
102791
  report.push({
102659
102792
  logicalFamily: logical,
102660
102793
  physicalFamily,
102661
102794
  reason,
102662
102795
  loadStatus,
102663
102796
  exportFamily: logical,
102664
- missing: reason === "category_fallback" || isSettled(loadStatus) && loadStatus !== "loaded"
102797
+ missing: reason === "category_fallback" || isSettled(loadStatus) && loadStatus !== "loaded",
102798
+ ...evidence ? { evidence } : {}
102665
102799
  });
102666
102800
  }
102667
102801
  return report;
@@ -102681,13 +102815,16 @@ function buildFaceReport(usedFaces, registry, resolver$1) {
102681
102815
  weight,
102682
102816
  style
102683
102817
  };
102684
- const { physicalFamily, reason } = resolver$1 ? resolver$1.resolveFace(logicalFamily, face, hasFace) : resolveFace(logicalFamily, face, hasFace);
102818
+ const resolution = resolver$1 ? resolver$1.resolveFace(logicalFamily, face, hasFace) : resolveFace(logicalFamily, face, hasFace);
102819
+ const { physicalFamily, reason } = resolution;
102820
+ const statusFace = resolution.sourceFace ?? face;
102685
102821
  const loadStatus = registry.getFaceStatus({
102686
102822
  family: physicalFamily,
102687
- weight,
102688
- style
102823
+ weight: statusFace.weight,
102824
+ style: statusFace.style
102689
102825
  });
102690
102826
  const missing = reason === "fallback_face_absent" || reason === "category_fallback" || isSettled(loadStatus) && loadStatus !== "loaded";
102827
+ const evidence = isRenderedSubstitute(reason) ? toEvidence(getRenderableFallbackForFace(logicalFamily, faceSlotFor(face), RENDER_ALL)) : undefined;
102691
102828
  report.push({
102692
102829
  logicalFamily,
102693
102830
  physicalFamily: reason === "registered_face" ? logicalFamily : physicalFamily,
@@ -102695,7 +102832,8 @@ function buildFaceReport(usedFaces, registry, resolver$1) {
102695
102832
  loadStatus,
102696
102833
  exportFamily: logicalFamily,
102697
102834
  missing,
102698
- face
102835
+ face,
102836
+ ...evidence ? { evidence } : {}
102699
102837
  });
102700
102838
  }
102701
102839
  return report;
@@ -102798,7 +102936,7 @@ function deriveOfferings() {
102798
102936
  return {
102799
102937
  logicalFamily: row.logicalFamily,
102800
102938
  physicalFamily: row.physicalFamily,
102801
- generic: row.physicalFamily && PHYSICAL_GENERIC[row.physicalFamily] || "sans-serif",
102939
+ generic: row.generic,
102802
102940
  offering: classifyOffering(row.policyAction, row.verdict, row.physicalFamily, bundled),
102803
102941
  bundled,
102804
102942
  verdict: row.verdict,
@@ -102807,12 +102945,11 @@ function deriveOfferings() {
102807
102945
  });
102808
102946
  return Object.freeze(offerings);
102809
102947
  }
102810
- function getDefaultFontOfferings() {
102811
- const rank$1 = (name) => {
102812
- const i$1 = DEFAULT_FONT_ORDER.indexOf(name);
102813
- return i$1 === -1 ? DEFAULT_FONT_ORDER.length : i$1;
102814
- };
102815
- return FONT_OFFERINGS.filter((o) => o.offering === "default").sort((a, b) => rank$1(a.logicalFamily) - rank$1(b.logicalFamily));
102948
+ function compareLogicalFamily(a, b) {
102949
+ return a.logicalFamily.localeCompare(b.logicalFamily, "en", { sensitivity: "base" });
102950
+ }
102951
+ function getBuiltInToolbarFontOfferings() {
102952
+ return FONT_OFFERINGS.filter((o) => o.offering === "default" || o.bundled && ADVERTISED_BUILT_IN_TOOLBAR_FAMILIES.has(o.logicalFamily) && (o.offering === "qualified" || o.offering === "category_fallback")).sort(compareLogicalFamily);
102816
102953
  }
102817
102954
  function fontOfferingStack(offering) {
102818
102955
  return `${offering.logicalFamily}, ${offering.generic}`;
@@ -102821,11 +102958,38 @@ function fontOfferingRenderStack(offering) {
102821
102958
  return offering.physicalFamily ? `${offering.physicalFamily}, ${offering.generic}` : fontOfferingStack(offering);
102822
102959
  }
102823
102960
  function getDefaultFontFamilyOptions() {
102824
- return getDefaultFontOfferings().map((offering) => ({
102961
+ return getBuiltInToolbarFontOfferings().map((offering) => ({
102825
102962
  label: offering.logicalFamily,
102826
102963
  value: fontOfferingStack(offering)
102827
102964
  }));
102828
102965
  }
102966
+ function normalizeKey(family$1) {
102967
+ return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
102968
+ }
102969
+ function isRegularFace(rec) {
102970
+ return rec.face?.weight === "400" && rec.face?.style === "normal";
102971
+ }
102972
+ function buildDocumentFontOptions(usedFaces, registry, resolver$1) {
102973
+ const faceRecords = buildFaceReport(usedFaces, registry, resolver$1);
102974
+ const agg = /* @__PURE__ */ new Map;
102975
+ for (const rec of faceRecords) {
102976
+ const key = normalizeKey(rec.logicalFamily);
102977
+ const existing = agg.get(key);
102978
+ if (!existing) {
102979
+ agg.set(key, rec);
102980
+ continue;
102981
+ }
102982
+ if (isRegularFace(rec) && !isRegularFace(existing))
102983
+ agg.set(key, rec);
102984
+ }
102985
+ const options = [];
102986
+ for (const rep of agg.values())
102987
+ options.push({
102988
+ logicalFamily: rep.logicalFamily,
102989
+ previewFamily: rep.physicalFamily
102990
+ });
102991
+ return options;
102992
+ }
102829
102993
  function writeAppStatistics(convertedXml, stats) {
102830
102994
  const elements = ensureElements$1(ensureAppPropertiesRoot(convertedXml));
102831
102995
  upsertSimpleElement(elements, "Words", String(stats.words));
@@ -104815,12 +104979,14 @@ function applyTocMetadata(blocks, metadata) {
104815
104979
  };
104816
104980
  if (metadata.instruction)
104817
104981
  block.attrs.tocInstruction = metadata.instruction;
104982
+ if (metadata.tocId)
104983
+ block.attrs.tocId = metadata.tocId;
104818
104984
  }
104819
104985
  });
104820
104986
  }
104821
104987
  function processTocChildren(children, metadata, context, outputArrays) {
104822
104988
  const paragraphConverter = context.converters.paragraphToFlowBlocks;
104823
- const { docPartGallery, docPartObjectId, tocInstruction } = metadata;
104989
+ const { docPartGallery, docPartObjectId, tocInstruction, tocId } = metadata;
104824
104990
  const { blocks, recordBlockKind } = outputArrays;
104825
104991
  children.forEach((child) => {
104826
104992
  if (child.type === "paragraph") {
@@ -104845,7 +105011,8 @@ function processTocChildren(children, metadata, context, outputArrays) {
104845
105011
  applyTocMetadata(paragraphBlocks, {
104846
105012
  gallery: docPartGallery,
104847
105013
  uniqueId: docPartObjectId,
104848
- instruction: tocInstruction
105014
+ instruction: tocInstruction,
105015
+ tocId
104849
105016
  });
104850
105017
  applySdtMetadataToParagraphBlocks(paragraphBlocks.filter((b) => b.kind === "paragraph"), metadata.sdtMetadata);
104851
105018
  paragraphBlocks.forEach((block) => {
@@ -104860,7 +105027,8 @@ function processTocChildren(children, metadata, context, outputArrays) {
104860
105027
  docPartGallery,
104861
105028
  docPartObjectId,
104862
105029
  tocInstruction: finalInstruction,
104863
- sdtMetadata: metadata.sdtMetadata
105030
+ sdtMetadata: metadata.sdtMetadata,
105031
+ tocId
104864
105032
  }, context, outputArrays);
104865
105033
  }
104866
105034
  });
@@ -104868,7 +105036,11 @@ function processTocChildren(children, metadata, context, outputArrays) {
104868
105036
  function handleTableOfContentsNode(node3, context) {
104869
105037
  if (!Array.isArray(node3.content))
104870
105038
  return;
104871
- processTocChildren(node3.content, { tocInstruction: getNodeInstruction(node3) }, {
105039
+ const sdBlockId = node3.attrs?.sdBlockId;
105040
+ processTocChildren(node3.content, {
105041
+ tocInstruction: getNodeInstruction(node3),
105042
+ tocId: typeof sdBlockId === "string" ? sdBlockId : undefined
105043
+ }, {
104872
105044
  nextBlockId: context.nextBlockId,
104873
105045
  positions: context.positions,
104874
105046
  bookmarks: context.bookmarks,
@@ -105197,7 +105369,8 @@ function processDocumentPartObject(child, sectionMetadata, context, output, conv
105197
105369
  docPartGallery,
105198
105370
  docPartObjectId,
105199
105371
  tocInstruction,
105200
- sdtMetadata: docPartSdtMetadata
105372
+ sdtMetadata: docPartSdtMetadata,
105373
+ tocId: docPartObjectId ?? undefined
105201
105374
  }, {
105202
105375
  nextBlockId: context.nextBlockId,
105203
105376
  positions: context.positions,
@@ -105268,12 +105441,15 @@ function handleDocumentPartObjectNode(node3, context) {
105268
105441
  const tocInstruction = getNodeInstruction(node3);
105269
105442
  const docPartSdtMetadata = resolveNodeSdtMetadata(node3, "docPartObject");
105270
105443
  const paragraphToFlowBlocks$1 = converters$1.paragraphToFlowBlocks;
105444
+ const sdBlockId = node3.attrs?.sdBlockId;
105445
+ const tocId = docPartObjectId && docPartObjectId.length > 0 ? docPartObjectId : typeof sdBlockId === "string" && sdBlockId.length > 0 ? sdBlockId : undefined;
105271
105446
  if (docPartGallery === "Table of Contents")
105272
105447
  processTocChildren(Array.from(node3.content), {
105273
105448
  docPartGallery,
105274
105449
  docPartObjectId,
105275
105450
  tocInstruction,
105276
- sdtMetadata: docPartSdtMetadata
105451
+ sdtMetadata: docPartSdtMetadata,
105452
+ tocId
105277
105453
  }, {
105278
105454
  nextBlockId,
105279
105455
  positions,
@@ -105321,7 +105497,8 @@ function handleDocumentPartObjectNode(node3, context) {
105321
105497
  docPartGallery: docPartGallery ?? "",
105322
105498
  docPartObjectId,
105323
105499
  tocInstruction: getNodeInstruction(child) ?? tocInstruction,
105324
- sdtMetadata: docPartSdtMetadata
105500
+ sdtMetadata: docPartSdtMetadata,
105501
+ tocId
105325
105502
  };
105326
105503
  const tocContext = {
105327
105504
  nextBlockId,
@@ -111524,6 +111701,7 @@ function groupTrackedChanges(editor) {
111524
111701
  return cached.grouped;
111525
111702
  const marks = getRawTrackedMarks(editor);
111526
111703
  const byRawId = /* @__PURE__ */ new Map;
111704
+ const segmentsByRawId = /* @__PURE__ */ new Map;
111527
111705
  for (const item of marks) {
111528
111706
  const attrs = item.mark?.attrs ?? {};
111529
111707
  const id2 = toNonEmptyString(attrs.id);
@@ -111539,6 +111717,17 @@ function groupTrackedChanges(editor) {
111539
111717
  const wordRevisionIdKey = getWordRevisionIdKey(markType);
111540
111718
  const excerptText = !wordRevisionId || !hasChildTrackedMarkOnNode(item, id2) ? getTrackedMarkText(editor, item) : "";
111541
111719
  const range = [item.from, item.to];
111720
+ const priorSegments = segmentsByRawId.get(groupKey);
111721
+ if (priorSegments)
111722
+ priorSegments.push({
111723
+ from: item.from,
111724
+ to: item.to
111725
+ });
111726
+ else
111727
+ segmentsByRawId.set(groupKey, [{
111728
+ from: item.from,
111729
+ to: item.to
111730
+ }]);
111542
111731
  if (!existing) {
111543
111732
  byRawId.set(groupKey, {
111544
111733
  rawId: groupKey,
@@ -111586,7 +111775,23 @@ function groupTrackedChanges(editor) {
111586
111775
  return a.id.localeCompare(b.id);
111587
111776
  });
111588
111777
  attachOverlapMetadata(grouped);
111589
- for (const structural of enumerateStructuralRowChanges(editor.state)) {
111778
+ const structuralChanges = enumerateStructuralRowChanges(editor.state);
111779
+ const wholeTableRanges = structuralChanges.filter((structural) => structural.decidable && structural.wholeTable).map((structural) => ({
111780
+ from: structural.tableFrom,
111781
+ to: structural.tableTo
111782
+ }));
111783
+ if (wholeTableRanges.length > 0) {
111784
+ const segmentInsideSomeTable = (segment) => wholeTableRanges.some((range) => segment.from >= range.from && segment.to <= range.to);
111785
+ for (let i$1 = grouped.length - 1;i$1 >= 0; i$1 -= 1) {
111786
+ const change = grouped[i$1];
111787
+ if ((segmentsByRawId.get(change.rawId) ?? [{
111788
+ from: change.from,
111789
+ to: change.to
111790
+ }]).every(segmentInsideSomeTable))
111791
+ grouped.splice(i$1, 1);
111792
+ }
111793
+ }
111794
+ for (const structural of structuralChanges) {
111590
111795
  const excerpt = normalizeExcerpt(editor.state.doc.textBetween(structural.tableFrom, structural.tableTo, " ", ""));
111591
111796
  const stableRawId = structural.sourceId ? `word:structural:${structural.sourceId}` : structural.id;
111592
111797
  grouped.push({
@@ -129714,18 +129919,10 @@ var isRegExp = (value) => {
129714
129919
  physical: primary,
129715
129920
  reason: "registered_face"
129716
129921
  };
129922
+ const docfonts = resolveDocfontsFace(primary, face, hasFace);
129923
+ if (docfonts)
129924
+ return docfonts;
129717
129925
  const bundled = BUNDLED_SUBSTITUTES[key];
129718
- if (bundled && hasFace(bundled, face.weight, face.style))
129719
- return {
129720
- physical: bundled,
129721
- reason: "bundled_substitute"
129722
- };
129723
- const category = CATEGORY_FALLBACKS[key];
129724
- if (category && hasFace(category, face.weight, face.style))
129725
- return {
129726
- physical: category,
129727
- reason: "category_fallback"
129728
- };
129729
129926
  if (override || bundled)
129730
129927
  return {
129731
129928
  physical: primary,
@@ -129758,11 +129955,12 @@ var isRegExp = (value) => {
129758
129955
  }
129759
129956
  resolveFace(logicalFamily, face, hasFace) {
129760
129957
  const primary = splitStack(logicalFamily)[0] ?? logicalFamily;
129761
- const { physical, reason } = this.#resolveFaceLadder(primary, face, hasFace);
129958
+ const { physical, reason, sourceFace } = this.#resolveFaceLadder(primary, face, hasFace);
129762
129959
  return {
129763
129960
  logicalFamily,
129764
129961
  physicalFamily: stripFamilyQuotes(physical),
129765
- reason
129962
+ reason,
129963
+ ...sourceFace ? { sourceFace } : {}
129766
129964
  };
129767
129965
  }
129768
129966
  resolvePhysicalFamilyForFace(cssFontFamily, face, hasFace) {
@@ -129787,7 +129985,17 @@ var isRegExp = (value) => {
129787
129985
  out.add(this.resolvePrimaryPhysicalFamily(family$1));
129788
129986
  return [...out];
129789
129987
  }
129790
- }, defaultResolver, DEFAULT_FONT_MEASURE_CONTEXT, fontConfigVersion = 0, defaultAssetBase = "/fonts/", installedRegistries, FS_TYPE_RESTRICTED = 2, FS_SELECTION_ITALIC = 1, BOLD_WEIGHT_THRESHOLD = 600, SFNT_TABLE_DIR_OFFSET = 12, SFNT_TABLE_RECORD_SIZE = 16, OS2_USWEIGHTCLASS = 4, OS2_FSTYPE = 8, OS2_FSSELECTION = 62, OS2_MIN_LENGTH, DEFAULT_FONT_LOAD_TIMEOUT_MS = 3000, DEFAULT_PROBE_SIZE = "16px", FontRegistry = class {
129988
+ }, defaultResolver, DEFAULT_FONT_MEASURE_CONTEXT, fontConfigVersion = 0, defaultAssetBase = "/fonts/", installedRegistries, faceSlotFor = ({ weight, style }) => {
129989
+ const bold2 = weight === "700";
129990
+ const italic = style === "italic";
129991
+ if (bold2 && italic)
129992
+ return "boldItalic";
129993
+ if (bold2)
129994
+ return "bold";
129995
+ if (italic)
129996
+ return "italic";
129997
+ return "regular";
129998
+ }, isRenderedSubstitute = (reason) => reason === "bundled_substitute" || reason === "category_fallback", RENDER_ALL, FS_TYPE_RESTRICTED = 2, FS_SELECTION_ITALIC = 1, BOLD_WEIGHT_THRESHOLD = 600, SFNT_TABLE_DIR_OFFSET = 12, SFNT_TABLE_RECORD_SIZE = 16, OS2_USWEIGHTCLASS = 4, OS2_FSTYPE = 8, OS2_FSSELECTION = 62, OS2_MIN_LENGTH, DEFAULT_FONT_LOAD_TIMEOUT_MS = 3000, DEFAULT_PROBE_SIZE = "16px", FontRegistry = class {
129791
129999
  #fontSet;
129792
130000
  #FontFaceCtor;
129793
130001
  #probeSize;
@@ -130128,7 +130336,7 @@ var isRegExp = (value) => {
130128
130336
  const detail = sources && sources.length ? ` from ${sources.join(", ")}` : "";
130129
130337
  console.warn(`[superdoc] font asset failed to load for "${family$1}"${detail}. Check fonts.assetBaseUrl / fonts.resolveAssetUrl so the bundled .woff2 are served.`);
130130
130338
  }
130131
- }, registriesByFontSet, domlessRegistry = null, PHYSICAL_GENERIC, BUNDLED_FAMILIES, FONT_OFFERINGS, DEFAULT_FONT_ORDER, prepareCommentParaIds = (comment) => {
130339
+ }, registriesByFontSet, domlessRegistry = null, BUNDLED_FAMILIES, ADVERTISED_BUILT_IN_TOOLBAR_FAMILIES, FONT_OFFERINGS, prepareCommentParaIds = (comment) => {
130132
130340
  return {
130133
130341
  ...comment,
130134
130342
  commentParaId: generateDocxRandomId()
@@ -134104,7 +134312,7 @@ var isRegExp = (value) => {
134104
134312
  state.kern = kernNode.attributes["w:val"];
134105
134313
  }
134106
134314
  }, SuperConverter;
134107
- var init_SuperConverter_C6RGktKO_es = __esm(() => {
134315
+ var init_SuperConverter_DJyHekqW_es = __esm(() => {
134108
134316
  init_rolldown_runtime_Bg48TavK_es();
134109
134317
  init_jszip_C49i9kUs_es();
134110
134318
  init_xml_js_CqGKpaft_es();
@@ -171424,6 +171632,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171424
171632
  SUBSTITUTION_EVIDENCE$1 = [
171425
171633
  {
171426
171634
  evidenceId: "calibri",
171635
+ generic: "sans-serif",
171427
171636
  logicalFamily: "Calibri",
171428
171637
  physicalFamily: "Carlito",
171429
171638
  verdict: "metric_safe",
@@ -171443,6 +171652,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171443
171652
  measurementRefs: ["calibri__carlito#analytic_advance#2026-06-03", "calibri__carlito#face_aggregate#2026-06-03"],
171444
171653
  exportRule: "preserve_original_name",
171445
171654
  advance: {
171655
+ basis: "latin_full",
171446
171656
  meanDelta: 0,
171447
171657
  maxDelta: 0
171448
171658
  },
@@ -171450,6 +171660,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171450
171660
  },
171451
171661
  {
171452
171662
  evidenceId: "cambria",
171663
+ generic: "serif",
171453
171664
  logicalFamily: "Cambria",
171454
171665
  physicalFamily: "Caladea",
171455
171666
  verdict: "visual_only",
@@ -171474,6 +171685,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171474
171685
  ],
171475
171686
  exportRule: "preserve_original_name",
171476
171687
  advance: {
171688
+ basis: "latin_full",
171477
171689
  meanDelta: 0.0002378,
171478
171690
  maxDelta: 0.2310758
171479
171691
  },
@@ -171493,6 +171705,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171493
171705
  },
171494
171706
  {
171495
171707
  evidenceId: "arial",
171708
+ generic: "sans-serif",
171496
171709
  logicalFamily: "Arial",
171497
171710
  physicalFamily: "Liberation Sans",
171498
171711
  verdict: "metric_safe",
@@ -171512,6 +171725,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171512
171725
  measurementRefs: ["arial__liberation-sans#analytic_advance#2026-06-03"],
171513
171726
  exportRule: "preserve_original_name",
171514
171727
  advance: {
171728
+ basis: "latin_full",
171515
171729
  meanDelta: 0,
171516
171730
  maxDelta: 0
171517
171731
  },
@@ -171519,6 +171733,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171519
171733
  },
171520
171734
  {
171521
171735
  evidenceId: "times-new-roman",
171736
+ generic: "serif",
171522
171737
  logicalFamily: "Times New Roman",
171523
171738
  physicalFamily: "Liberation Serif",
171524
171739
  verdict: "metric_safe",
@@ -171538,6 +171753,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171538
171753
  measurementRefs: ["times-new-roman__liberation-serif#analytic_advance#2026-06-03"],
171539
171754
  exportRule: "preserve_original_name",
171540
171755
  advance: {
171756
+ basis: "latin_full",
171541
171757
  meanDelta: 0,
171542
171758
  maxDelta: 0
171543
171759
  },
@@ -171545,6 +171761,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171545
171761
  },
171546
171762
  {
171547
171763
  evidenceId: "courier-new",
171764
+ generic: "monospace",
171548
171765
  logicalFamily: "Courier New",
171549
171766
  physicalFamily: "Liberation Mono",
171550
171767
  verdict: "metric_safe",
@@ -171564,6 +171781,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171564
171781
  measurementRefs: ["courier-new__liberation-mono#analytic_advance#2026-06-03"],
171565
171782
  exportRule: "preserve_original_name",
171566
171783
  advance: {
171784
+ basis: "latin_full",
171567
171785
  meanDelta: 0,
171568
171786
  maxDelta: 0
171569
171787
  },
@@ -171571,6 +171789,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171571
171789
  },
171572
171790
  {
171573
171791
  evidenceId: "georgia",
171792
+ generic: "serif",
171574
171793
  logicalFamily: "Georgia",
171575
171794
  physicalFamily: "Gelasio",
171576
171795
  verdict: "near_metric",
@@ -171599,6 +171818,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171599
171818
  ],
171600
171819
  exportRule: "preserve_original_name",
171601
171820
  advance: {
171821
+ basis: "latin_full",
171602
171822
  meanDelta: 0.0000197,
171603
171823
  maxDelta: 0.0183727
171604
171824
  },
@@ -171623,6 +171843,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171623
171843
  },
171624
171844
  {
171625
171845
  evidenceId: "arial-narrow",
171846
+ generic: "sans-serif",
171626
171847
  logicalFamily: "Arial Narrow",
171627
171848
  physicalFamily: "Liberation Sans Narrow",
171628
171849
  verdict: "visual_only",
@@ -171647,6 +171868,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171647
171868
  ],
171648
171869
  exportRule: "preserve_original_name",
171649
171870
  advance: {
171871
+ basis: "latin_full",
171650
171872
  meanDelta: 0,
171651
171873
  maxDelta: 0.5
171652
171874
  },
@@ -171666,6 +171888,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171666
171888
  },
171667
171889
  {
171668
171890
  evidenceId: "aptos",
171891
+ generic: "sans-serif",
171669
171892
  logicalFamily: "Aptos",
171670
171893
  physicalFamily: null,
171671
171894
  verdict: "no_substitute",
@@ -171686,8 +171909,134 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171686
171909
  exportRule: "preserve_original_name",
171687
171910
  candidateLicense: null
171688
171911
  },
171912
+ {
171913
+ evidenceId: "arial-black",
171914
+ generic: "sans-serif",
171915
+ logicalFamily: "Arial Black",
171916
+ physicalFamily: "Archivo Black",
171917
+ verdict: "visual_only",
171918
+ faces: {
171919
+ regular: true,
171920
+ bold: false,
171921
+ italic: false,
171922
+ boldItalic: false
171923
+ },
171924
+ faceSources: { italic: {
171925
+ kind: "synthetic",
171926
+ from: "regular"
171927
+ } },
171928
+ gates: {
171929
+ static: "pass",
171930
+ metric: "fail",
171931
+ layout: "not_run",
171932
+ ship: "fail"
171933
+ },
171934
+ policyAction: "substitute",
171935
+ measurementRefs: ["arial-black__archivo-black#visual_review#2026-06-09"],
171936
+ exportRule: "preserve_original_name",
171937
+ candidateLicense: "OFL-1.1",
171938
+ faceVerdicts: { italic: "visual_only" }
171939
+ },
171940
+ {
171941
+ evidenceId: "arial-rounded-mt-bold",
171942
+ generic: "sans-serif",
171943
+ logicalFamily: "Arial Rounded MT Bold",
171944
+ physicalFamily: "Ubuntu",
171945
+ verdict: "visual_only",
171946
+ faces: {
171947
+ regular: true,
171948
+ bold: true,
171949
+ italic: true,
171950
+ boldItalic: true
171951
+ },
171952
+ gates: {
171953
+ static: "pass",
171954
+ metric: "fail",
171955
+ layout: "not_run",
171956
+ ship: "fail"
171957
+ },
171958
+ policyAction: "category_fallback",
171959
+ measurementRefs: ["arial-rounded-mt-bold__ubuntu#visual_review#2026-06-09"],
171960
+ exportRule: "preserve_original_name",
171961
+ candidateLicense: "Ubuntu-font-1.0"
171962
+ },
171963
+ {
171964
+ evidenceId: "bookman-old-style",
171965
+ generic: "serif",
171966
+ logicalFamily: "Bookman Old Style",
171967
+ physicalFamily: "TeX Gyre Bonum",
171968
+ verdict: "visual_only",
171969
+ faces: {
171970
+ regular: true,
171971
+ bold: true,
171972
+ italic: true,
171973
+ boldItalic: true
171974
+ },
171975
+ gates: {
171976
+ static: "pass",
171977
+ metric: "fail",
171978
+ layout: "not_run",
171979
+ ship: "fail"
171980
+ },
171981
+ policyAction: "substitute",
171982
+ measurementRefs: ["bookman-old-style__tex-gyre-bonum#visual_review#2026-06-09"],
171983
+ exportRule: "preserve_original_name",
171984
+ candidateLicense: "GUST-Font-License-1.0"
171985
+ },
171986
+ {
171987
+ evidenceId: "century",
171988
+ generic: "serif",
171989
+ logicalFamily: "Century",
171990
+ physicalFamily: "C059",
171991
+ verdict: "visual_only",
171992
+ faces: {
171993
+ regular: true,
171994
+ bold: true,
171995
+ italic: true,
171996
+ boldItalic: true
171997
+ },
171998
+ gates: {
171999
+ static: "pass",
172000
+ metric: "fail",
172001
+ layout: "not_run",
172002
+ ship: "fail"
172003
+ },
172004
+ policyAction: "substitute",
172005
+ measurementRefs: ["century__c059#visual_review#2026-06-09"],
172006
+ exportRule: "preserve_original_name",
172007
+ candidateLicense: "AGPL-3.0-only WITH PS-or-PDF-font-exception-20170817"
172008
+ },
172009
+ {
172010
+ evidenceId: "garamond",
172011
+ generic: "serif",
172012
+ logicalFamily: "Garamond",
172013
+ physicalFamily: "Cardo",
172014
+ verdict: "visual_only",
172015
+ faces: {
172016
+ regular: true,
172017
+ bold: true,
172018
+ italic: true,
172019
+ boldItalic: false
172020
+ },
172021
+ faceSources: { boldItalic: {
172022
+ kind: "synthetic",
172023
+ from: "bold"
172024
+ } },
172025
+ gates: {
172026
+ static: "pass",
172027
+ metric: "fail",
172028
+ layout: "not_run",
172029
+ ship: "fail"
172030
+ },
172031
+ policyAction: "category_fallback",
172032
+ measurementRefs: ["garamond__cardo#visual_review#2026-06-09"],
172033
+ exportRule: "preserve_original_name",
172034
+ candidateLicense: "OFL-1.1",
172035
+ faceVerdicts: { boldItalic: "visual_only" }
172036
+ },
171689
172037
  {
171690
172038
  evidenceId: "consolas",
172039
+ generic: "monospace",
171691
172040
  logicalFamily: "Consolas",
171692
172041
  physicalFamily: "Inconsolata SemiExpanded",
171693
172042
  verdict: "cell_width_only",
@@ -171707,6 +172056,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171707
172056
  measurementRefs: ["consolas__inconsolata-semiexpanded#analytic_advance#2026-06-03"],
171708
172057
  exportRule: "preserve_original_name",
171709
172058
  advance: {
172059
+ basis: "monospace_cell",
171710
172060
  meanDelta: 0.00035999999999999997,
171711
172061
  maxDelta: 0.00035999999999999997
171712
172062
  },
@@ -171714,6 +172064,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171714
172064
  },
171715
172065
  {
171716
172066
  evidenceId: "verdana",
172067
+ generic: "sans-serif",
171717
172068
  logicalFamily: "Verdana",
171718
172069
  physicalFamily: null,
171719
172070
  verdict: "visual_only",
@@ -171736,76 +172087,90 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171736
172087
  },
171737
172088
  {
171738
172089
  evidenceId: "tahoma",
172090
+ generic: "sans-serif",
171739
172091
  logicalFamily: "Tahoma",
171740
- physicalFamily: null,
172092
+ physicalFamily: "Noto Sans",
171741
172093
  verdict: "visual_only",
171742
172094
  faces: {
171743
- regular: false,
171744
- bold: false,
171745
- italic: false,
171746
- boldItalic: false
172095
+ regular: true,
172096
+ bold: true,
172097
+ italic: true,
172098
+ boldItalic: true
171747
172099
  },
171748
172100
  gates: {
171749
- static: "not_run",
172101
+ static: "pass",
171750
172102
  metric: "fail",
171751
172103
  layout: "not_run",
171752
- ship: "not_run"
172104
+ ship: "fail"
171753
172105
  },
171754
172106
  policyAction: "category_fallback",
171755
- measurementRefs: ["tahoma#top_candidates#2026-06-03"],
172107
+ measurementRefs: ["tahoma__noto-sans#visual_review#2026-06-09"],
171756
172108
  exportRule: "preserve_original_name",
171757
- candidateLicense: null
172109
+ candidateLicense: "OFL-1.1"
171758
172110
  },
171759
172111
  {
171760
172112
  evidenceId: "trebuchet-ms",
172113
+ generic: "sans-serif",
171761
172114
  logicalFamily: "Trebuchet MS",
171762
- physicalFamily: null,
172115
+ physicalFamily: "PT Sans",
171763
172116
  verdict: "visual_only",
171764
172117
  faces: {
171765
- regular: false,
171766
- bold: false,
171767
- italic: false,
171768
- boldItalic: false
172118
+ regular: true,
172119
+ bold: true,
172120
+ italic: true,
172121
+ boldItalic: true
171769
172122
  },
171770
172123
  gates: {
171771
- static: "not_run",
172124
+ static: "pass",
171772
172125
  metric: "fail",
171773
172126
  layout: "not_run",
171774
- ship: "not_run"
172127
+ ship: "fail"
171775
172128
  },
171776
172129
  policyAction: "category_fallback",
171777
- measurementRefs: ["trebuchet-ms#top_candidates#2026-06-03"],
172130
+ measurementRefs: ["trebuchet-ms__pt-sans#visual_review#2026-06-09"],
171778
172131
  exportRule: "preserve_original_name",
171779
- candidateLicense: null
172132
+ candidateLicense: "OFL-1.1"
171780
172133
  },
171781
172134
  {
171782
172135
  evidenceId: "comic-sans-ms",
172136
+ generic: "sans-serif",
171783
172137
  logicalFamily: "Comic Sans MS",
171784
- physicalFamily: "Comic Neue",
172138
+ physicalFamily: "Comic Relief",
171785
172139
  verdict: "visual_only",
171786
172140
  faces: {
171787
- regular: false,
171788
- bold: false,
172141
+ regular: true,
172142
+ bold: true,
171789
172143
  italic: false,
171790
172144
  boldItalic: false
171791
172145
  },
172146
+ faceSources: {
172147
+ italic: {
172148
+ kind: "synthetic",
172149
+ from: "regular"
172150
+ },
172151
+ boldItalic: {
172152
+ kind: "synthetic",
172153
+ from: "bold"
172154
+ }
172155
+ },
171792
172156
  gates: {
171793
- static: "not_run",
172157
+ static: "pass",
171794
172158
  metric: "fail",
171795
172159
  layout: "not_run",
171796
- ship: "not_run"
172160
+ ship: "fail"
171797
172161
  },
171798
172162
  policyAction: "category_fallback",
171799
- measurementRefs: ["comic-sans-ms__comic-neue#analytic_advance#2026-06-03"],
172163
+ measurementRefs: ["comic-sans-ms__comic-relief#visual_review#2026-06-09"],
171800
172164
  exportRule: "preserve_original_name",
171801
- advance: {
171802
- meanDelta: 0.1005,
171803
- maxDelta: 0.1419
171804
- },
171805
- candidateLicense: "OFL-1.1"
172165
+ candidateLicense: "OFL-1.1",
172166
+ faceVerdicts: {
172167
+ italic: "visual_only",
172168
+ boldItalic: "visual_only"
172169
+ }
171806
172170
  },
171807
172171
  {
171808
172172
  evidenceId: "candara",
172173
+ generic: "sans-serif",
171809
172174
  logicalFamily: "Candara",
171810
172175
  physicalFamily: null,
171811
172176
  verdict: "visual_only",
@@ -171828,6 +172193,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171828
172193
  },
171829
172194
  {
171830
172195
  evidenceId: "constantia",
172196
+ generic: "serif",
171831
172197
  logicalFamily: "Constantia",
171832
172198
  physicalFamily: null,
171833
172199
  verdict: "visual_only",
@@ -171850,6 +172216,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171850
172216
  },
171851
172217
  {
171852
172218
  evidenceId: "corbel",
172219
+ generic: "sans-serif",
171853
172220
  logicalFamily: "Corbel",
171854
172221
  physicalFamily: null,
171855
172222
  verdict: "visual_only",
@@ -171872,6 +172239,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171872
172239
  },
171873
172240
  {
171874
172241
  evidenceId: "lucida-console",
172242
+ generic: "monospace",
171875
172243
  logicalFamily: "Lucida Console",
171876
172244
  physicalFamily: "Cousine",
171877
172245
  verdict: "cell_width_only",
@@ -171891,13 +172259,54 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171891
172259
  measurementRefs: ["lucida-console__cousine#analytic_advance#2026-06-03"],
171892
172260
  exportRule: "preserve_original_name",
171893
172261
  advance: {
172262
+ basis: "monospace_cell",
171894
172263
  meanDelta: 0.004050000000000001,
171895
172264
  maxDelta: 0.004050000000000001
171896
172265
  },
171897
172266
  candidateLicense: "OFL-1.1"
171898
172267
  },
172268
+ {
172269
+ evidenceId: "gill-sans-mt-condensed",
172270
+ generic: "sans-serif",
172271
+ logicalFamily: "Gill Sans MT Condensed",
172272
+ physicalFamily: "PT Sans Narrow",
172273
+ verdict: "visual_only",
172274
+ faces: {
172275
+ regular: true,
172276
+ bold: true,
172277
+ italic: false,
172278
+ boldItalic: false
172279
+ },
172280
+ faceSources: {
172281
+ italic: {
172282
+ kind: "synthetic",
172283
+ from: "regular"
172284
+ },
172285
+ boldItalic: {
172286
+ kind: "synthetic",
172287
+ from: "bold"
172288
+ }
172289
+ },
172290
+ gates: {
172291
+ static: "pass",
172292
+ metric: "fail",
172293
+ layout: "not_run",
172294
+ ship: "fail"
172295
+ },
172296
+ policyAction: "category_fallback",
172297
+ measurementRefs: ["gill-sans-mt-condensed__pt-sans-narrow#visual_review#2026-06-09"],
172298
+ exportRule: "preserve_original_name",
172299
+ candidateLicense: "OFL-1.1",
172300
+ faceVerdicts: {
172301
+ regular: "visual_only",
172302
+ bold: "visual_only",
172303
+ italic: "visual_only",
172304
+ boldItalic: "visual_only"
172305
+ }
172306
+ },
171899
172307
  {
171900
172308
  evidenceId: "aptos-display",
172309
+ generic: "sans-serif",
171901
172310
  logicalFamily: "Aptos Display",
171902
172311
  physicalFamily: null,
171903
172312
  verdict: "customer_supplied",
@@ -171919,6 +172328,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171919
172328
  },
171920
172329
  {
171921
172330
  evidenceId: "cambria-math",
172331
+ generic: "serif",
171922
172332
  logicalFamily: "Cambria Math",
171923
172333
  physicalFamily: null,
171924
172334
  verdict: "preserve_only",
@@ -171940,6 +172350,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171940
172350
  },
171941
172351
  {
171942
172352
  evidenceId: "helvetica",
172353
+ generic: "sans-serif",
171943
172354
  logicalFamily: "Helvetica",
171944
172355
  physicalFamily: "Liberation Sans",
171945
172356
  verdict: "metric_safe",
@@ -171959,6 +172370,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171959
172370
  measurementRefs: ["helvetica__liberation-sans#analytic_advance#2026-06-03"],
171960
172371
  exportRule: "preserve_original_name",
171961
172372
  advance: {
172373
+ basis: "latin_full",
171962
172374
  meanDelta: 0,
171963
172375
  maxDelta: 0
171964
172376
  },
@@ -171966,6 +172378,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171966
172378
  },
171967
172379
  {
171968
172380
  evidenceId: "calibri-light",
172381
+ generic: "sans-serif",
171969
172382
  logicalFamily: "Calibri Light",
171970
172383
  physicalFamily: "Carlito",
171971
172384
  verdict: "visual_only",
@@ -171985,6 +172398,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171985
172398
  measurementRefs: ["calibri-light__carlito#analytic_advance#2026-06-05"],
171986
172399
  exportRule: "preserve_original_name",
171987
172400
  advance: {
172401
+ basis: "latin_full",
171988
172402
  meanDelta: 0.0148,
171989
172403
  maxDelta: 0.066
171990
172404
  },
@@ -171992,6 +172406,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171992
172406
  },
171993
172407
  {
171994
172408
  evidenceId: "baskerville-old-face",
172409
+ generic: "serif",
171995
172410
  logicalFamily: "Baskerville Old Face",
171996
172411
  physicalFamily: "Bacasime Antique",
171997
172412
  verdict: "visual_only",
@@ -172011,6 +172426,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
172011
172426
  measurementRefs: ["baskerville-old-face_regular__bacasime-antique#regular#w400#7dac1e5f#analytic_advance#2026-06-05"],
172012
172427
  exportRule: "preserve_original_name",
172013
172428
  advance: {
172429
+ basis: "latin_full",
172014
172430
  meanDelta: 0,
172015
172431
  maxDelta: 0.4915590863952334
172016
172432
  },
@@ -172022,6 +172438,54 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
172022
172438
  advanceDelta: 0.4916,
172023
172439
  note: "Bacasime Antique Regular's no-break space (U+00A0) advance diverges ~49% from Baskerville Old Face; lines containing NBSP reflow. Every other Latin-core glyph is advance-identical, which is why this is visual_only with a single named exception, not near_metric."
172024
172440
  }]
172441
+ },
172442
+ {
172443
+ evidenceId: "cooper-black",
172444
+ generic: "serif",
172445
+ logicalFamily: "Cooper Black",
172446
+ physicalFamily: "Caprasimo",
172447
+ verdict: "visual_only",
172448
+ faces: {
172449
+ regular: true,
172450
+ bold: false,
172451
+ italic: false,
172452
+ boldItalic: false
172453
+ },
172454
+ faceSources: {
172455
+ bold: {
172456
+ kind: "synthetic",
172457
+ from: "regular"
172458
+ },
172459
+ italic: {
172460
+ kind: "synthetic",
172461
+ from: "regular"
172462
+ },
172463
+ boldItalic: {
172464
+ kind: "synthetic",
172465
+ from: "regular"
172466
+ }
172467
+ },
172468
+ gates: {
172469
+ static: "pass",
172470
+ metric: "pass",
172471
+ layout: "not_run",
172472
+ ship: "not_run"
172473
+ },
172474
+ policyAction: "substitute",
172475
+ measurementRefs: ["cooper-black_regular__caprasimo#regular#w400#786ab84e#analytic_advance#2026-06-05", "cooper-black__caprasimo#synthetic_faces#visual_review#2026-06-09"],
172476
+ exportRule: "preserve_original_name",
172477
+ advance: {
172478
+ basis: "latin_full",
172479
+ meanDelta: 0,
172480
+ maxDelta: 0
172481
+ },
172482
+ candidateLicense: "OFL-1.1",
172483
+ faceVerdicts: {
172484
+ regular: "metric_safe",
172485
+ bold: "visual_only",
172486
+ italic: "visual_only",
172487
+ boldItalic: "visual_only"
172488
+ }
172025
172489
  }
172026
172490
  ];
172027
172491
  LINE_BREAK_SAFE_VERDICTS = new Set([
@@ -172035,7 +172499,41 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
172035
172499
  family("Caladea", "Caladea", "Apache-2.0"),
172036
172500
  family("Liberation Sans", "LiberationSans", "OFL-1.1"),
172037
172501
  family("Liberation Serif", "LiberationSerif", "OFL-1.1"),
172038
- family("Liberation Mono", "LiberationMono", "OFL-1.1")
172502
+ family("Liberation Mono", "LiberationMono", "OFL-1.1"),
172503
+ familyWithFaces("Caprasimo", "OFL-1.1", [{
172504
+ weight: "normal",
172505
+ style: "normal",
172506
+ file: "Caprasimo-Regular.woff2"
172507
+ }]),
172508
+ family("Gelasio", "Gelasio", "OFL-1.1"),
172509
+ familyWithFaces("Cardo", "OFL-1.1", [
172510
+ {
172511
+ weight: "normal",
172512
+ style: "normal",
172513
+ file: "Cardo-Regular.woff2"
172514
+ },
172515
+ {
172516
+ weight: "bold",
172517
+ style: "normal",
172518
+ file: "Cardo-Bold.woff2"
172519
+ },
172520
+ {
172521
+ weight: "normal",
172522
+ style: "italic",
172523
+ file: "Cardo-Italic.woff2"
172524
+ }
172525
+ ]),
172526
+ familyWithFaces("Comic Relief", "OFL-1.1", [{
172527
+ weight: "normal",
172528
+ style: "normal",
172529
+ file: "ComicRelief-Regular.woff2"
172530
+ }, {
172531
+ weight: "bold",
172532
+ style: "normal",
172533
+ file: "ComicRelief-Bold.woff2"
172534
+ }]),
172535
+ family("Noto Sans", "NotoSans", "OFL-1.1"),
172536
+ family("PT Sans", "PTSans", "OFL-1.1")
172039
172537
  ]);
172040
172538
  SUBSTITUTION_EVIDENCE = SUBSTITUTION_EVIDENCE$1;
172041
172539
  bundledFamilies = new Set(BUNDLED_MANIFEST.map((f2) => f2.family));
@@ -172047,24 +172545,19 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
172047
172545
  fontSignature: ""
172048
172546
  });
172049
172547
  installedRegistries = /* @__PURE__ */ new WeakMap;
172548
+ RENDER_ALL = { canRenderFamily: () => true };
172050
172549
  OS2_MIN_LENGTH = OS2_FSSELECTION + 2;
172051
172550
  registriesByFontSet = /* @__PURE__ */ new WeakMap;
172052
- PHYSICAL_GENERIC = Object.freeze({
172053
- Carlito: "sans-serif",
172054
- Caladea: "serif",
172055
- "Liberation Sans": "sans-serif",
172056
- "Liberation Serif": "serif",
172057
- "Liberation Mono": "monospace"
172058
- });
172059
172551
  BUNDLED_FAMILIES = new Set(BUNDLED_MANIFEST.map((f2) => f2.family));
172552
+ ADVERTISED_BUILT_IN_TOOLBAR_FAMILIES = new Set([
172553
+ "Cooper Black",
172554
+ "Comic Sans MS",
172555
+ "Garamond",
172556
+ "Georgia",
172557
+ "Tahoma",
172558
+ "Trebuchet MS"
172559
+ ]);
172060
172560
  FONT_OFFERINGS = deriveOfferings();
172061
- DEFAULT_FONT_ORDER = [
172062
- "Calibri",
172063
- "Arial",
172064
- "Courier New",
172065
- "Times New Roman",
172066
- "Helvetica"
172067
- ];
172068
172561
  ALL_COMMENT_TARGETS = COMMENT_FILE_BASENAMES;
172069
172562
  REL_ID_NUMERIC_PATTERN = /rId|mi/g;
172070
172563
  FOOTNOTES_CONFIG$1 = {
@@ -173851,7 +174344,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
173851
174344
  };
173852
174345
  });
173853
174346
 
173854
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-D7rUpTS1.es.js
174347
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-Jmx2i-9i.es.js
173855
174348
  function parseSizeUnit(val = "0") {
173856
174349
  const length3 = val.toString() || "0";
173857
174350
  const value = Number.parseFloat(length3);
@@ -184209,8 +184702,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
184209
184702
  }
184210
184703
  };
184211
184704
  };
184212
- var init_create_headless_toolbar_D7rUpTS1_es = __esm(() => {
184213
- init_SuperConverter_C6RGktKO_es();
184705
+ var init_create_headless_toolbar_Jmx2i_9i_es = __esm(() => {
184706
+ init_SuperConverter_DJyHekqW_es();
184214
184707
  init_uuid_B2wVPhPi_es();
184215
184708
  init_constants_D9qj59G2_es();
184216
184709
  init_dist_B8HfvhaK_es();
@@ -219730,7 +220223,7 @@ If you want to remount the same app, move your app creation logic into a factory
219730
220223
  var createVNodeWithArgsTransform = (...args2) => {
219731
220224
  return _createVNode(...vnodeArgsTransformer ? vnodeArgsTransformer(args2, currentRenderingInstance) : args2);
219732
220225
  };
219733
- var normalizeKey = ({ key: key2 }) => key2 != null ? key2 : null;
220226
+ var normalizeKey2 = ({ key: key2 }) => key2 != null ? key2 : null;
219734
220227
  var normalizeRef = ({
219735
220228
  ref: ref3,
219736
220229
  ref_key,
@@ -219747,7 +220240,7 @@ If you want to remount the same app, move your app creation logic into a factory
219747
220240
  __v_skip: true,
219748
220241
  type,
219749
220242
  props,
219750
- key: props && normalizeKey(props),
220243
+ key: props && normalizeKey2(props),
219751
220244
  ref: props && normalizeRef(props),
219752
220245
  scopeId: currentScopeId,
219753
220246
  slotScopeIds: null,
@@ -219847,7 +220340,7 @@ Component that was made reactive: `, type);
219847
220340
  __v_skip: true,
219848
220341
  type: vnode.type,
219849
220342
  props: mergedProps,
219850
- key: mergedProps && normalizeKey(mergedProps),
220343
+ key: mergedProps && normalizeKey2(mergedProps),
219851
220344
  ref: extraProps && extraProps.ref ? mergeRef && ref3 ? shared.isArray(ref3) ? ref3.concat(normalizeRef(extraProps)) : [ref3, normalizeRef(extraProps)] : normalizeRef(extraProps) : ref3,
219852
220345
  scopeId: vnode.scopeId,
219853
220346
  slotScopeIds: vnode.slotScopeIds,
@@ -233373,7 +233866,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
233373
233866
  init_remark_gfm_BhnWr3yf_es();
233374
233867
  });
233375
233868
 
233376
- // ../../packages/superdoc/dist/chunks/src-D29bOSuq.es.js
233869
+ // ../../packages/superdoc/dist/chunks/src-BB_FFFud.es.js
233377
233870
  function deleteProps(obj, propOrProps) {
233378
233871
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
233379
233872
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -242467,9 +242960,6 @@ function replaceCommand(wrap5, moveForward) {
242467
242960
  return true;
242468
242961
  };
242469
242962
  }
242470
- function buildSdtBlockSelector(escapedSdtId) {
242471
- return `.${DOM_CLASS_NAMES.BLOCK_SDT}[${DATA_ATTRS.SDT_ID}="${escapedSdtId}"]`;
242472
- }
242473
242963
  function buildAnnotationSelector() {
242474
242964
  return `.${DOM_CLASS_NAMES.ANNOTATION}[${DATA_ATTRS.PM_START}]`;
242475
242965
  }
@@ -245731,6 +246221,36 @@ function scrollToElement(targetElement, options = {
245731
246221
  behavior: options.behavior
245732
246222
  });
245733
246223
  }
246224
+ function normalizeToolbarFamily(value) {
246225
+ return String(value ?? "").trim().toLowerCase();
246226
+ }
246227
+ function compareToolbarFontOptions(a2, b$1) {
246228
+ return String(a2.label ?? "").trim().localeCompare(String(b$1.label ?? "").trim(), "en", { sensitivity: "base" });
246229
+ }
246230
+ function composeToolbarFontOptions(documentOptions, configFonts) {
246231
+ if (configFonts)
246232
+ return configFonts;
246233
+ if (!documentOptions?.length)
246234
+ return;
246235
+ const seen = new Set(TOOLBAR_FONTS.map((option) => normalizeToolbarFamily(option.label)));
246236
+ const merged = [...TOOLBAR_FONTS];
246237
+ for (const option of documentOptions) {
246238
+ const dedupeKey = normalizeToolbarFamily(option.logicalFamily);
246239
+ if (seen.has(dedupeKey))
246240
+ continue;
246241
+ seen.add(dedupeKey);
246242
+ merged.push({
246243
+ label: option.logicalFamily,
246244
+ key: option.logicalFamily,
246245
+ fontWeight: 400,
246246
+ props: {
246247
+ style: { fontFamily: option.previewFamily || option.logicalFamily },
246248
+ "data-item": "btn-fontFamily-option"
246249
+ }
246250
+ });
246251
+ }
246252
+ return merged.length > TOOLBAR_FONTS.length ? merged.sort(compareToolbarFontOptions) : undefined;
246253
+ }
245734
246254
  function isExtensionRulesEnabled(extension3, enabled) {
245735
246255
  if (Array.isArray(enabled))
245736
246256
  return enabled.some((enabledExtension) => {
@@ -273946,6 +274466,9 @@ function applySourceAnchorDataset(element3, sourceAnchor) {
273946
274466
  else
273947
274467
  delete element3.dataset.sourceOccurrenceId;
273948
274468
  }
274469
+ function allowFontSynthesis(element3) {
274470
+ element3.style.setProperty("font-synthesis", "weight style");
274471
+ }
273949
274472
  function getCellSegmentCount(cell2) {
273950
274473
  if (cell2.blocks && cell2.blocks.length > 0) {
273951
274474
  let total = 0;
@@ -278490,7 +279013,10 @@ function calculateBalancedColumnHeight(ctx$1, config2 = DEFAULT_BALANCING_CONFIG
278490
279013
  iterations: 0
278491
279014
  };
278492
279015
  const totalHeight = ctx$1.contentBlocks.reduce((sum, b$1) => sum + b$1.measuredHeight, 0);
278493
- const maxBlockHeight = ctx$1.contentBlocks.reduce((m$1, b$1) => Math.max(m$1, b$1.measuredHeight), 0);
279016
+ const maxBlockHeight = ctx$1.contentBlocks.reduce((m$1, b$1) => {
279017
+ const indivisible = b$1.canBreak && b$1.lineHeights && b$1.lineHeights.length > 1 ? Math.max(...b$1.lineHeights) : b$1.measuredHeight;
279018
+ return Math.max(m$1, indivisible);
279019
+ }, 0);
278494
279020
  if (totalHeight < config2.minColumnHeight * ctx$1.columnCount)
278495
279021
  return createSingleColumnResult(ctx$1);
278496
279022
  let lo = Math.max(maxBlockHeight, config2.minColumnHeight);
@@ -278660,6 +279186,8 @@ function shouldSkipBalancing(ctx$1, config2 = DEFAULT_BALANCING_CONFIG) {
278660
279186
  }
278661
279187
  function getFragmentHeight(fragment2, measureMap) {
278662
279188
  if (fragment2.kind === "para") {
279189
+ if (fragment2.lines && fragment2.lines.length > 0)
279190
+ return fragment2.lines.reduce((sum$1, l) => sum$1 + (l.lineHeight ?? 0), 0);
278663
279191
  const measure = measureMap.get(fragment2.blockId);
278664
279192
  if (!measure || measure.kind !== "paragraph" || !measure.lines)
278665
279193
  return 0;
@@ -278740,13 +279268,38 @@ function balanceSectionOnPage(args$1) {
278740
279268
  return a2.x - b$1.x;
278741
279269
  return a2.y - b$1.y;
278742
279270
  });
278743
- const contentBlocks = ordered.map((f2, i4) => ({
278744
- blockId: `${f2.blockId}#${i4}`,
278745
- measuredHeight: getBalancingHeight(f2, args$1.measureMap, args$1.sectPrMarkerBlockIds),
278746
- canBreak: false,
278747
- keepWithNext: false,
278748
- keepTogether: true
278749
- }));
279271
+ const lineHeightsFor = (f2) => {
279272
+ if (f2.kind !== "para")
279273
+ return;
279274
+ if (args$1.sectPrMarkerBlockIds?.has(f2.blockId))
279275
+ return;
279276
+ if (args$1.keepLinesBlockIds?.has(f2.blockId))
279277
+ return;
279278
+ if (f2.lines && f2.lines.length > 0) {
279279
+ if (f2.lines.length <= 1)
279280
+ return;
279281
+ return f2.lines.map((l) => l.lineHeight);
279282
+ }
279283
+ const measure = args$1.measureMap.get(f2.blockId);
279284
+ if (!measure || measure.kind !== "paragraph" || !Array.isArray(measure.lines))
279285
+ return;
279286
+ const fromLine = f2.fromLine ?? 0;
279287
+ const toLine = f2.toLine ?? measure.lines.length;
279288
+ if (toLine - fromLine <= 1)
279289
+ return;
279290
+ return measure.lines.slice(fromLine, toLine).map((l) => l.lineHeight);
279291
+ };
279292
+ const contentBlocks = ordered.map((f2, i4) => {
279293
+ const lineHeights = lineHeightsFor(f2);
279294
+ return {
279295
+ blockId: `${f2.blockId}#${i4}`,
279296
+ measuredHeight: getBalancingHeight(f2, args$1.measureMap, args$1.sectPrMarkerBlockIds),
279297
+ canBreak: lineHeights !== undefined,
279298
+ keepWithNext: false,
279299
+ keepTogether: lineHeights === undefined,
279300
+ lineHeights
279301
+ };
279302
+ });
278750
279303
  if (shouldSkipBalancing({
278751
279304
  columnCount,
278752
279305
  columnWidth,
@@ -278781,6 +279334,39 @@ function balanceSectionOnPage(args$1) {
278781
279334
  f2.x = columnX(col);
278782
279335
  f2.y = colCursors[col];
278783
279336
  f2.width = columnWidth;
279337
+ const bp = result.blockBreakPoints?.get(block.blockId);
279338
+ if (bp && bp.heightAfterBreak > 0 && col < columnCount - 1) {
279339
+ const splitLine = (f2.fromLine ?? 0) + bp.breakAfterLine + 1;
279340
+ const measureLineCount = args$1.measureMap.get(f2.blockId)?.lines?.length ?? splitLine;
279341
+ const originalToLine = f2.toLine ?? measureLineCount;
279342
+ const originalContinuesOnNext = f2.continuesOnNext ?? false;
279343
+ const secondHalf = {
279344
+ ...f2,
279345
+ fromLine: splitLine,
279346
+ toLine: originalToLine,
279347
+ x: columnX(col + 1),
279348
+ y: colCursors[col + 1],
279349
+ width: columnWidth,
279350
+ continuesFromPrev: true,
279351
+ continuesOnNext: originalContinuesOnNext
279352
+ };
279353
+ if (f2.lines && f2.lines.length > 0) {
279354
+ secondHalf.lines = f2.lines.slice(bp.breakAfterLine + 1);
279355
+ f2.lines = f2.lines.slice(0, bp.breakAfterLine + 1);
279356
+ }
279357
+ f2.toLine = splitLine;
279358
+ f2.continuesOnNext = true;
279359
+ colCursors[col] += bp.heightBeforeBreak;
279360
+ colCursors[col + 1] += bp.heightAfterBreak;
279361
+ const fragIdx = fragments.indexOf(f2);
279362
+ if (fragIdx >= 0)
279363
+ fragments.splice(fragIdx + 1, 0, secondHalf);
279364
+ if (colCursors[col] > maxY)
279365
+ maxY = colCursors[col];
279366
+ if (colCursors[col + 1] > maxY)
279367
+ maxY = colCursors[col + 1];
279368
+ continue;
279369
+ }
278784
279370
  colCursors[col] += block.measuredHeight;
278785
279371
  if (colCursors[col] > maxY)
278786
279372
  maxY = colCursors[col];
@@ -279932,6 +280518,7 @@ function layoutDocument(blocks2, measures, options = {}) {
279932
280518
  const sectionTypeIsExplicit = /* @__PURE__ */ new Map;
279933
280519
  let lastSectionIdx = null;
279934
280520
  const sectPrMarkerBlockIds = /* @__PURE__ */ new Set;
280521
+ const keepLinesBlockIds = /* @__PURE__ */ new Set;
279935
280522
  let documentHasExplicitColumnBreak = false;
279936
280523
  let documentHasAnySectionBreak = false;
279937
280524
  const alreadyBalancedSections = /* @__PURE__ */ new Set;
@@ -279965,6 +280552,8 @@ function layoutDocument(blocks2, measures, options = {}) {
279965
280552
  documentHasExplicitColumnBreak = true;
279966
280553
  if (block.kind === "paragraph" && blockWithAttrs.attrs?.sectPrMarker === true)
279967
280554
  sectPrMarkerBlockIds.add(block.id);
280555
+ if (block.kind === "paragraph" && blockWithAttrs.attrs?.keepLines === true)
280556
+ keepLinesBlockIds.add(block.id);
279968
280557
  });
279969
280558
  const anchoredByParagraph = collectAnchoredDrawings(blocks2, measures);
279970
280559
  const anchoredTables = collectAnchoredTables(blocks2, measures);
@@ -280183,7 +280772,8 @@ function layoutDocument(blocks2, measures, options = {}) {
280183
280772
  columnWidth: normalized.width,
280184
280773
  availableHeight,
280185
280774
  measureMap: balancingMeasureMap,
280186
- sectPrMarkerBlockIds
280775
+ sectPrMarkerBlockIds,
280776
+ keepLinesBlockIds
280187
280777
  });
280188
280778
  if (balanceResult) {
280189
280779
  state.cursorY = balanceResult.maxY;
@@ -280582,7 +281172,9 @@ function layoutDocument(blocks2, measures, options = {}) {
280582
281172
  const isMultiPage = sectionPagesCount > 1;
280583
281173
  if (isMultiPage && !isLast)
280584
281174
  continue;
280585
- const allowedByMidDocContinuous = endBreakType === "continuous" && !isLast;
281175
+ const nextSectionBeginType = sectionEndBreakType.get(sectionIdx + 1);
281176
+ const nextIsBody = lastSectionIdx !== null && sectionIdx + 1 === lastSectionIdx;
281177
+ const allowedByMidDocContinuous = !isLast && !nextIsBody && nextSectionBeginType === "continuous";
280586
281178
  const allowedByBodyExplicitContinuous = bodyExplicitContinuousIdx !== null && sectionIdx === bodyExplicitContinuousIdx - 1 && !isExplicitNonContinuous;
280587
281179
  if (!allowedByMidDocContinuous && !allowedByBodyExplicitContinuous && !isMultiPage)
280588
281180
  continue;
@@ -280613,7 +281205,8 @@ function layoutDocument(blocks2, measures, options = {}) {
280613
281205
  columnWidth: normalized.width,
280614
281206
  availableHeight: sectionAvailableHeight,
280615
281207
  measureMap: balancingMeasureMap,
280616
- sectPrMarkerBlockIds
281208
+ sectPrMarkerBlockIds,
281209
+ keepLinesBlockIds
280617
281210
  });
280618
281211
  }
280619
281212
  for (const state of states) {
@@ -285450,9 +286043,28 @@ function computeDomCaretPageLocal(options, pos) {
285450
286043
  const boundary = resolveTextBoundaryInElement(targetEl, pos, entry.pmStart, entry.pmEnd, "forward");
285451
286044
  if (!boundary) {
285452
286045
  const elRect = targetEl.getBoundingClientRect();
286046
+ if (targetEl.classList.contains("superdoc-line")) {
286047
+ const paddingLeft = parseFloat(targetEl.style.paddingLeft) || 0;
286048
+ const paddingRight = parseFloat(targetEl.style.paddingRight) || 0;
286049
+ const lineLeft = (elRect.left - pageRect.left) / zoom + paddingLeft;
286050
+ const lineRight = (elRect.right - pageRect.left) / zoom - paddingRight;
286051
+ const textAlign = targetEl.style.textAlign;
286052
+ let x;
286053
+ if (textAlign === "center")
286054
+ x = (lineLeft + lineRight) / 2;
286055
+ else if (textAlign === "right")
286056
+ x = lineRight;
286057
+ else
286058
+ x = lineLeft;
286059
+ return {
286060
+ pageIndex: Number(page.dataset.pageIndex ?? "0"),
286061
+ x,
286062
+ y: (elRect.top - pageRect.top) / zoom
286063
+ };
286064
+ }
285453
286065
  const isEmptySdtPlaceholder = targetEl.classList.contains("superdoc-empty-sdt-placeholder") || targetEl.classList.contains("superdoc-empty-inline-sdt-placeholder") || targetEl.classList.contains("superdoc-empty-block-sdt-placeholder");
285454
286066
  const atEnd = isEmptySdtPlaceholder ? pos > entry.pmEnd : pos >= entry.pmEnd;
285455
- const yRect = (isEmptySdtPlaceholder ? targetEl.closest(".superdoc-line") : null)?.getBoundingClientRect() ?? elRect;
286067
+ const yRect = (isEmptySdtPlaceholder || targetEl.classList.contains("superdoc-tab") ? targetEl.closest(".superdoc-line") : null)?.getBoundingClientRect() ?? elRect;
285456
286068
  return {
285457
286069
  pageIndex: Number(page.dataset.pageIndex ?? "0"),
285458
286070
  x: ((atEnd ? elRect.right : elRect.left) - pageRect.left) / zoom,
@@ -292875,7 +293487,8 @@ function makeResolveFace(resolver2, hasFace) {
292875
293487
  const r$1 = resolver2.resolveFace(logical, face, hasFace);
292876
293488
  return {
292877
293489
  physicalFamily: r$1.physicalFamily,
292878
- reason: r$1.reason
293490
+ reason: r$1.reason,
293491
+ sourceFace: r$1.sourceFace
292879
293492
  };
292880
293493
  };
292881
293494
  if (resolver2)
@@ -292905,10 +293518,14 @@ function collect(acc, node3, resolveFace2) {
292905
293518
  const usedKey = `${logicalPrimary.toLowerCase()}|${weight}|${style2}`;
292906
293519
  if (acc.usedFaces.has(usedKey))
292907
293520
  return;
292908
- const { physicalFamily, reason } = resolveFace2(node3.fontFamily, {
293521
+ const { physicalFamily, reason, sourceFace } = resolveFace2(node3.fontFamily, {
292909
293522
  weight,
292910
293523
  style: style2
292911
293524
  });
293525
+ const requiredFace = sourceFace ?? {
293526
+ weight,
293527
+ style: style2
293528
+ };
292912
293529
  acc.usedFaces.set(usedKey, {
292913
293530
  logicalFamily: logicalPrimary,
292914
293531
  weight,
@@ -292919,15 +293536,17 @@ function collect(acc, node3, resolveFace2) {
292919
293536
  weight,
292920
293537
  style2,
292921
293538
  (physicalFamily || "").toLowerCase(),
293539
+ requiredFace.weight,
293540
+ requiredFace.style,
292922
293541
  reason
292923
293542
  ]);
292924
293543
  if (physicalFamily) {
292925
- const reqKey = `${physicalFamily.toLowerCase()}|${weight}|${style2}`;
293544
+ const reqKey = `${physicalFamily.toLowerCase()}|${requiredFace.weight}|${requiredFace.style}`;
292926
293545
  if (!acc.requiredFaces.has(reqKey))
292927
293546
  acc.requiredFaces.set(reqKey, {
292928
293547
  family: physicalFamily,
292929
- weight,
292930
- style: style2
293548
+ weight: requiredFace.weight,
293549
+ style: requiredFace.style
292931
293550
  });
292932
293551
  }
292933
293552
  }
@@ -312555,6 +313174,7 @@ var Node$13 = class Node$14 {
312555
313174
  this.syncInlineStyleLayers(options.editorState, options.domPositionIndex);
312556
313175
  this.applyProofingAnnotations(options.proofingAnnotations, options.rebuildDomPositionIndex);
312557
313176
  options.reapplyStructuredContentHover?.();
313177
+ options.reapplyTocGroupHover?.();
312558
313178
  }
312559
313179
  destroy() {
312560
313180
  this.#proofingDecorator.clear();
@@ -312564,6 +313184,83 @@ var Node$13 = class Node$14 {
312564
313184
  this.#commentHighlightDecorator.destroy();
312565
313185
  this.#decorationBridge.destroy();
312566
313186
  }
313187
+ }, HoverGroupCoordinator = class {
313188
+ #spec;
313189
+ #current = null;
313190
+ constructor(spec) {
313191
+ this.handleMouseEnter = (event) => {
313192
+ const entry = event.target?.closest?.(this.#spec.entrySelector);
313193
+ if (!entry)
313194
+ return;
313195
+ const id2 = this.#spec.getId(entry);
313196
+ if (!id2)
313197
+ return;
313198
+ this.#set(id2);
313199
+ };
313200
+ this.handleMouseLeave = (event) => {
313201
+ const entry = event.target?.closest?.(this.#spec.entrySelector);
313202
+ if (!entry)
313203
+ return;
313204
+ const id2 = this.#spec.getId(entry);
313205
+ if (!id2)
313206
+ return;
313207
+ const relatedTarget = event.relatedTarget;
313208
+ if (relatedTarget) {
313209
+ const nextEntry = relatedTarget.closest?.(this.#spec.entrySelector);
313210
+ if (nextEntry && this.#spec.getId(nextEntry) === id2)
313211
+ return;
313212
+ }
313213
+ this.clear();
313214
+ };
313215
+ this.#spec = spec;
313216
+ }
313217
+ reapply() {
313218
+ if (!this.#current)
313219
+ return;
313220
+ const { id: id2 } = this.#current;
313221
+ const elements = this.#spec.queryGroup(id2);
313222
+ if (elements.length === 0) {
313223
+ this.#current = null;
313224
+ return;
313225
+ }
313226
+ this.#applyClass(elements);
313227
+ this.#spec.onApply?.(elements);
313228
+ this.#current = {
313229
+ id: id2,
313230
+ elements
313231
+ };
313232
+ }
313233
+ clear() {
313234
+ if (!this.#current)
313235
+ return;
313236
+ for (const element3 of this.#current.elements) {
313237
+ element3.classList.remove(this.#spec.hoverClass);
313238
+ this.#spec.onClear?.(element3);
313239
+ }
313240
+ this.#current = null;
313241
+ }
313242
+ #set(id2) {
313243
+ if (this.#current?.id === id2)
313244
+ return;
313245
+ this.clear();
313246
+ const elements = this.#spec.queryGroup(id2);
313247
+ if (elements.length === 0)
313248
+ return;
313249
+ this.#applyClass(elements);
313250
+ this.#spec.onApply?.(elements);
313251
+ this.#current = {
313252
+ id: id2,
313253
+ elements
313254
+ };
313255
+ }
313256
+ #applyClass(elements) {
313257
+ const filter = this.#spec.shouldApplyTo;
313258
+ for (const element3 of elements) {
313259
+ if (filter && !filter(element3))
313260
+ continue;
313261
+ element3.classList.add(this.#spec.hoverClass);
313262
+ }
313263
+ }
312567
313264
  }, ProofingStore = class {
312568
313265
  #issuesBySegment = /* @__PURE__ */ new Map;
312569
313266
  addIssue(issue) {
@@ -313174,6 +313871,9 @@ var Node$13 = class Node$14 {
313174
313871
  color: inherit !important;
313175
313872
  text-decoration: none !important;
313176
313873
  cursor: default;
313874
+ /* Disable native link drag so our pointer loop can run text-selection. */
313875
+ -webkit-user-drag: none;
313876
+ user-drag: none;
313177
313877
  }
313178
313878
 
313179
313879
  .superdoc-toc-entry .superdoc-link:hover {
@@ -313185,6 +313885,31 @@ var Node$13 = class Node$14 {
313185
313885
  outline: none;
313186
313886
  }
313187
313887
 
313888
+ /* TOC hover. .toc-group-hover is set by PresentationEditor on every entry
313889
+ sharing a data-toc-id so the whole TOC greys out together. The ::after
313890
+ stripe (height set via --toc-gap-below) fills the paragraph-spacing gap
313891
+ between adjacent entries so the hover reads as one continuous block. */
313892
+ .superdoc-toc-entry:hover,
313893
+ .superdoc-toc-entry.toc-group-hover {
313894
+ background-color: var(--sd-content-controls-block-hover-bg, #f2f2f2);
313895
+ }
313896
+
313897
+ /* Pointer-events stay on (default) so the stripe extends the parent entry's
313898
+ hit-test area through the paragraph-spacing gap. Without this, moving the
313899
+ cursor between two adjacent entries fires mouseout on the upper entry with
313900
+ relatedTarget = the page (not a TOC entry), the coordinator drops the
313901
+ group-hover class, and the grey disappears for a frame before the next
313902
+ entry's mouseover restores it — visible as a flicker. */
313903
+ .superdoc-toc-entry.toc-group-hover::after {
313904
+ content: '';
313905
+ position: absolute;
313906
+ left: 0;
313907
+ right: 0;
313908
+ top: 100%;
313909
+ height: var(--toc-gap-below, 0px);
313910
+ background-color: var(--sd-content-controls-block-hover-bg, #f2f2f2);
313911
+ }
313912
+
313188
313913
  /* Remove focus outlines from layout engine elements */
313189
313914
  .superdoc-layout,
313190
313915
  .superdoc-page,
@@ -315239,6 +315964,7 @@ menclose::after {
315239
315964
  });
315240
315965
  if (run2.fontSize != null)
315241
315966
  markerEl.style.fontSize = `${run2.fontSize}px`;
315967
+ allowFontSynthesis(markerEl);
315242
315968
  markerEl.style.fontWeight = run2.bold ? "bold" : "";
315243
315969
  markerEl.style.fontStyle = run2.italic ? "italic" : "";
315244
315970
  if (run2.color)
@@ -317162,8 +317888,12 @@ menclose::after {
317162
317888
  applyResolvedFragmentFrame(fragmentEl, resolvedItem, fragment2);
317163
317889
  else
317164
317890
  applyFragmentFrame(fragmentEl, fragment2);
317165
- if (isTocEntry)
317166
- fragmentEl.classList.add("superdoc-toc-entry");
317891
+ if (isTocEntry) {
317892
+ fragmentEl.classList.add(DOM_CLASS_NAMES.TOC_ENTRY);
317893
+ const tocId = block.attrs?.tocId;
317894
+ if (typeof tocId === "string" && tocId.length > 0)
317895
+ fragmentEl.dataset.tocId = tocId;
317896
+ }
317167
317897
  if (paraContinuesFromPrev)
317168
317898
  fragmentEl.dataset.continuesFromPrev = "true";
317169
317899
  if (paraContinuesOnNext)
@@ -317220,6 +317950,7 @@ menclose::after {
317220
317950
  style: run2.italic ? "italic" : "normal"
317221
317951
  });
317222
317952
  dropCapEl.style.fontSize = `${run2.fontSize}px`;
317953
+ allowFontSynthesis(dropCapEl);
317223
317954
  if (run2.bold)
317224
317955
  dropCapEl.style.fontWeight = "bold";
317225
317956
  if (run2.italic)
@@ -317339,6 +318070,7 @@ menclose::after {
317339
318070
  style: run2.italic ? "italic" : "normal"
317340
318071
  });
317341
318072
  element3.style.fontSize = `${run2.fontSize}px`;
318073
+ allowFontSynthesis(element3);
317342
318074
  if (run2.bold)
317343
318075
  element3.style.fontWeight = "bold";
317344
318076
  if (run2.italic)
@@ -317531,6 +318263,7 @@ menclose::after {
317531
318263
  }
317532
318264
  if (run2.textColor)
317533
318265
  annotation.style.color = run2.textColor;
318266
+ allowFontSynthesis(annotation);
317534
318267
  if (run2.bold)
317535
318268
  annotation.style.fontWeight = "bold";
317536
318269
  if (run2.italic)
@@ -325358,6 +326091,7 @@ menclose::after {
325358
326091
  #cellAnchor = null;
325359
326092
  #cellDragMode = "none";
325360
326093
  #pendingMarginClick = null;
326094
+ #pendingTocLinkNav = null;
325361
326095
  #lastSelectedImageBlockId = null;
325362
326096
  #suppressFocusInFromDraggable = false;
325363
326097
  #pendingStructuredContentLabelGesture = null;
@@ -325899,10 +326633,14 @@ menclose::after {
325899
326633
  return;
325900
326634
  }
325901
326635
  const linkEl = target?.closest?.("a.superdoc-link");
325902
- if (linkEl) {
325903
- this.#handleLinkClick(event, linkEl);
325904
- return;
325905
- }
326636
+ this.#pendingTocLinkNav = null;
326637
+ if (linkEl)
326638
+ if (linkEl.closest(`.${DOM_CLASS_NAMES.TOC_ENTRY}`))
326639
+ this.#pendingTocLinkNav = linkEl;
326640
+ else {
326641
+ this.#handleLinkClick(event, linkEl);
326642
+ return;
326643
+ }
325906
326644
  const annotationEl = target?.closest?.(buildAnnotationSelector());
325907
326645
  const isDraggableAnnotation = target?.closest?.(DRAGGABLE_SELECTOR) != null;
325908
326646
  const isNativeDragSource = target?.closest?.(DRAG_SOURCE_SELECTOR) != null;
@@ -326241,6 +326979,10 @@ menclose::after {
326241
326979
  event
326242
326980
  });
326243
326981
  this.#suppressFocusInFromDraggable = false;
326982
+ const pendingTocLink = this.#pendingTocLinkNav;
326983
+ this.#pendingTocLinkNav = null;
326984
+ if (pendingTocLink && !this.#dragThresholdExceeded)
326985
+ this.#handleLinkClick(event, pendingTocLink);
326244
326986
  if (!this.#isDragging) {
326245
326987
  this.#stopAutoScroll();
326246
326988
  return;
@@ -330265,6 +331007,17 @@ menclose::after {
330265
331007
  const declaredRows = buildFontReport(declared.filter((family2) => family2 && !usedFamilies.has(family2.toLowerCase())), registry2, resolver2);
330266
331008
  return [...faceRows, ...declaredRows];
330267
331009
  }
331010
+ getDocumentFontOptions() {
331011
+ try {
331012
+ const usedFaces = this.#getUsedFaces?.() ?? [];
331013
+ if (!usedFaces.length)
331014
+ return [];
331015
+ const { registry: registry2 } = this.#resolveContext();
331016
+ return buildDocumentFontOptions(usedFaces, registry2, this.#fontResolver ?? undefined);
331017
+ } catch {
331018
+ return [];
331019
+ }
331020
+ }
330268
331021
  async ensureReadyForMeasure() {
330269
331022
  if (this.#getRequiredFaces)
330270
331023
  return this.#ensureFacesReady(this.#getRequiredFaces);
@@ -330704,13 +331457,13 @@ menclose::after {
330704
331457
  return;
330705
331458
  console.log(...args$1);
330706
331459
  }, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions, TRACKED_MARK_NAMES;
330707
- var init_src_D29bOSuq_es = __esm(() => {
331460
+ var init_src_BB_FFFud_es = __esm(() => {
330708
331461
  init_rolldown_runtime_Bg48TavK_es();
330709
- init_SuperConverter_C6RGktKO_es();
331462
+ init_SuperConverter_DJyHekqW_es();
330710
331463
  init_jszip_C49i9kUs_es();
330711
331464
  init_xml_js_CqGKpaft_es();
330712
331465
  init_uuid_B2wVPhPi_es();
330713
- init_create_headless_toolbar_D7rUpTS1_es();
331466
+ init_create_headless_toolbar_Jmx2i_9i_es();
330714
331467
  init_constants_D9qj59G2_es();
330715
331468
  init_dist_B8HfvhaK_es();
330716
331469
  init_unified_Dsuw2be5_es();
@@ -349640,6 +350393,8 @@ function print() { __p += __j.call(arguments, '') }
349640
350393
  TABLE_FRAGMENT: "superdoc-table-fragment",
349641
350394
  DOCUMENT_SECTION: "superdoc-document-section",
349642
350395
  SDT_GROUP_HOVER: "sdt-group-hover",
350396
+ TOC_ENTRY: "superdoc-toc-entry",
350397
+ TOC_GROUP_HOVER: "toc-group-hover",
349643
350398
  IMAGE_FRAGMENT: "superdoc-image-fragment",
349644
350399
  INLINE_IMAGE: "superdoc-inline-image",
349645
350400
  LIST_MARKER: "superdoc-list-marker",
@@ -351420,7 +352175,7 @@ function print() { __p += __j.call(arguments, '') }
351420
352175
  };
351421
352176
  }
351422
352177
  }, [["__scopeId", "data-v-d25821a5"]]);
351423
- TOOLBAR_FONTS = getDefaultFontOfferings().map((offering) => ({
352178
+ TOOLBAR_FONTS = getBuiltInToolbarFontOfferings().map((offering) => ({
351424
352179
  label: offering.logicalFamily,
351425
352180
  key: fontOfferingStack(offering),
351426
352181
  fontWeight: 400,
@@ -351953,7 +352708,8 @@ function print() { __p += __j.call(arguments, '') }
351953
352708
  const menuRef = exports_vue.ref(null);
351954
352709
  const menuPosition = exports_vue.ref({
351955
352710
  top: "0px",
351956
- left: "0px"
352711
+ left: "0px",
352712
+ maxHeight: "none"
351957
352713
  });
351958
352714
  const optionRefs = exports_vue.ref([]);
351959
352715
  const keyboardIndex = exports_vue.ref(-1);
@@ -351990,6 +352746,7 @@ function print() { __p += __j.call(arguments, '') }
351990
352746
  position: "fixed",
351991
352747
  top: menuPosition.value.top,
351992
352748
  left: menuPosition.value.left,
352749
+ maxHeight: menuPosition.value.maxHeight,
351993
352750
  zIndex: 2000
351994
352751
  };
351995
352752
  });
@@ -352005,17 +352762,30 @@ function print() { __p += __j.call(arguments, '') }
352005
352762
  if (!triggerRef.value)
352006
352763
  return;
352007
352764
  const rect = triggerRef.value.getBoundingClientRect();
352008
- const menuWidth = menuRef.value?.offsetWidth ?? 0;
352765
+ const menuEl = menuRef.value;
352766
+ const menuWidth = menuEl?.offsetWidth ?? 0;
352767
+ const menuHeight = menuEl?.scrollHeight ?? menuEl?.offsetHeight ?? 0;
352009
352768
  const viewportWidth = window.innerWidth || document.documentElement.clientWidth || 0;
352769
+ const viewportHeight = window.innerHeight || document.documentElement.clientHeight || 0;
352010
352770
  const gutter = 8;
352771
+ const gap = 4;
352772
+ const belowTop = rect.bottom + gap;
352773
+ const aboveBottom = rect.top - gap;
352774
+ const availableBelow = Math.max(0, viewportHeight - belowTop - gutter);
352775
+ const availableAbove = Math.max(0, aboveBottom - gutter);
352776
+ const openAbove = availableBelow < menuHeight && availableAbove > availableBelow;
352777
+ const maxHeight = openAbove ? availableAbove : availableBelow;
352778
+ const menuRenderHeight = menuHeight ? Math.min(menuHeight, maxHeight) : maxHeight;
352779
+ const top$1 = openAbove ? Math.max(gutter, aboveBottom - menuRenderHeight) : belowTop;
352011
352780
  let left$1 = rect.left;
352012
352781
  if (props.placement === "bottom-end")
352013
352782
  left$1 = rect.right - menuWidth;
352014
352783
  const maxLeft = Math.max(gutter, viewportWidth - menuWidth - gutter);
352015
352784
  left$1 = Math.min(Math.max(gutter, left$1), maxLeft);
352016
352785
  menuPosition.value = {
352017
- top: `${rect.bottom + 4}px`,
352018
- left: `${left$1}px`
352786
+ top: `${top$1}px`,
352787
+ left: `${left$1}px`,
352788
+ maxHeight: `${maxHeight}px`
352019
352789
  };
352020
352790
  };
352021
352791
  const onTriggerClick = () => {
@@ -352081,8 +352851,13 @@ function print() { __p += __j.call(arguments, '') }
352081
352851
  el.setAttribute("tabindex", index2 === keyboardIndex.value ? "0" : "-1");
352082
352852
  });
352083
352853
  const target = optionRefs.value[keyboardIndex.value];
352084
- if (target && typeof target.focus === "function")
352854
+ if (target && typeof target.focus === "function") {
352085
352855
  target.focus();
352856
+ target.scrollIntoView?.({
352857
+ block: "nearest",
352858
+ inline: "nearest"
352859
+ });
352860
+ }
352086
352861
  };
352087
352862
  const moveKeyboardIndex = (direction) => {
352088
352863
  const navigableIndexes = getNavigableIndexes();
@@ -352217,6 +352992,7 @@ function print() { __p += __j.call(arguments, '') }
352217
352992
  if (hasRenderOptions.value)
352218
352993
  return;
352219
352994
  keyboardIndex.value = getInitialKeyboardIndex();
352995
+ await exports_vue.nextTick();
352220
352996
  focusKeyboardIndex();
352221
352997
  }, { immediate: true });
352222
352998
  exports_vue.watch(isOpen, (open2) => {
@@ -352280,7 +353056,7 @@ function print() { __p += __j.call(arguments, '') }
352280
353056
  })]))]);
352281
353057
  };
352282
353058
  }
352283
- }, [["__scopeId", "data-v-302f7d86"]]);
353059
+ }, [["__scopeId", "data-v-69732782"]]);
352284
353060
  SdTooltip_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
352285
353061
  __name: "SdTooltip",
352286
353062
  props: {
@@ -352930,16 +353706,21 @@ function print() { __p += __j.call(arguments, '') }
352930
353706
  toolbarKey.value += 1;
352931
353707
  };
352932
353708
  const onResizeThrottled = throttle(onWindowResized, 300);
352933
- function teardownWindowListeners() {
353709
+ const onToolbarItemsChanged = () => {
353710
+ toolbarKey.value += 1;
353711
+ };
353712
+ function teardownListeners() {
352934
353713
  window.removeEventListener("resize", onResizeThrottled);
352935
353714
  window.removeEventListener("keydown", onKeyDown);
353715
+ proxy.$toolbar.off?.("toolbar-items-changed", onToolbarItemsChanged);
352936
353716
  containerResizeObserver?.disconnect();
352937
353717
  containerResizeObserver = null;
352938
353718
  }
352939
- function setupWindowListeners() {
352940
- teardownWindowListeners();
353719
+ function setupListeners() {
353720
+ teardownListeners();
352941
353721
  window.addEventListener("resize", onResizeThrottled);
352942
353722
  window.addEventListener("keydown", onKeyDown);
353723
+ proxy.$toolbar.on?.("toolbar-items-changed", onToolbarItemsChanged);
352943
353724
  if (typeof ResizeObserver !== "undefined" && proxy.$toolbar.config?.responsiveToContainer && proxy.$toolbar.toolbarContainer) {
352944
353725
  containerResizeObserver = new ResizeObserver(() => {
352945
353726
  onResizeThrottled();
@@ -352948,10 +353729,10 @@ function print() { __p += __j.call(arguments, '') }
352948
353729
  }
352949
353730
  updateCompactSideGroups();
352950
353731
  }
352951
- exports_vue.onMounted(setupWindowListeners);
352952
- exports_vue.onActivated(setupWindowListeners);
352953
- exports_vue.onDeactivated(teardownWindowListeners);
352954
- exports_vue.onBeforeUnmount(teardownWindowListeners);
353732
+ exports_vue.onMounted(setupListeners);
353733
+ exports_vue.onActivated(setupListeners);
353734
+ exports_vue.onDeactivated(teardownListeners);
353735
+ exports_vue.onBeforeUnmount(teardownListeners);
352955
353736
  const handleCommand = ({ item, argument, option }) => {
352956
353737
  proxy.$toolbar.emitCommand({
352957
353738
  item,
@@ -353030,7 +353811,7 @@ function print() { __p += __j.call(arguments, '') }
353030
353811
  ], 32);
353031
353812
  };
353032
353813
  }
353033
- }, [["__scopeId", "data-v-b83d488a"]]);
353814
+ }, [["__scopeId", "data-v-938eaa1b"]]);
353034
353815
  toolbarTexts = {
353035
353816
  bold: "Bold",
353036
353817
  fontFamily: "Font",
@@ -353161,8 +353942,10 @@ function print() { __p += __j.call(arguments, '') }
353161
353942
  this._boundEditorHandlers = {
353162
353943
  transaction: null,
353163
353944
  selectionUpdate: null,
353164
- focus: null
353945
+ focus: null,
353946
+ fontsChanged: null
353165
353947
  };
353948
+ this._lastFontOptionsSignature = "";
353166
353949
  this._restoreFocusTimeoutId = null;
353167
353950
  if (!this.config.selector && this.config.element)
353168
353951
  this.config.selector = this.config.element;
@@ -353221,24 +354004,40 @@ function print() { __p += __j.call(arguments, '') }
353221
354004
  if (this.config.groups && !Array.isArray(this.config.groups) && Object.keys(this.config.groups).length)
353222
354005
  this.config.toolbarGroups = Object.keys(this.config.groups);
353223
354006
  }
354007
+ #detachActiveEditorListeners() {
354008
+ if (!this.activeEditor || !this._boundEditorHandlers.transaction)
354009
+ return;
354010
+ this.activeEditor.off("transaction", this._boundEditorHandlers.transaction);
354011
+ this.activeEditor.off("selectionUpdate", this._boundEditorHandlers.selectionUpdate);
354012
+ this.activeEditor.off("focus", this._boundEditorHandlers.focus);
354013
+ this.activeEditor.off("fonts-changed", this._boundEditorHandlers.fontsChanged);
354014
+ this._boundEditorHandlers.transaction = null;
354015
+ this._boundEditorHandlers.selectionUpdate = null;
354016
+ this._boundEditorHandlers.focus = null;
354017
+ this._boundEditorHandlers.fontsChanged = null;
354018
+ }
353224
354019
  setActiveEditor(editor) {
353225
- if (this.activeEditor && this._boundEditorHandlers.transaction) {
353226
- this.activeEditor.off("transaction", this._boundEditorHandlers.transaction);
353227
- this.activeEditor.off("selectionUpdate", this._boundEditorHandlers.selectionUpdate);
353228
- this.activeEditor.off("focus", this._boundEditorHandlers.focus);
353229
- this._boundEditorHandlers.transaction = null;
353230
- this._boundEditorHandlers.selectionUpdate = null;
353231
- this._boundEditorHandlers.focus = null;
354020
+ const sameEditor = editor === this.activeEditor;
354021
+ const alreadyListening = Boolean(this._boundEditorHandlers.transaction);
354022
+ if (sameEditor && (!editor || alreadyListening)) {
354023
+ this.updateToolbarState();
354024
+ return;
353232
354025
  }
354026
+ this.#detachActiveEditorListeners();
353233
354027
  this.activeEditor = editor;
353234
354028
  if (editor) {
353235
354029
  this._boundEditorHandlers.transaction = this.onEditorTransaction.bind(this);
353236
354030
  this._boundEditorHandlers.selectionUpdate = this.onEditorSelectionUpdate.bind(this);
353237
354031
  this._boundEditorHandlers.focus = this.onEditorFocus.bind(this);
354032
+ this._boundEditorHandlers.fontsChanged = this.onEditorFontsChanged.bind(this);
353238
354033
  this.activeEditor.on("transaction", this._boundEditorHandlers.transaction);
353239
354034
  this.activeEditor.on("selectionUpdate", this._boundEditorHandlers.selectionUpdate);
353240
354035
  this.activeEditor.on("focus", this._boundEditorHandlers.focus);
354036
+ this.activeEditor.on("fonts-changed", this._boundEditorHandlers.fontsChanged);
353241
354037
  }
354038
+ this.#rebuildToolbarItems();
354039
+ this._lastFontOptionsSignature = this.#fontOptionsSignature();
354040
+ this.updateToolbarState();
353242
354041
  }
353243
354042
  getToolbarItemByGroup(groupName) {
353244
354043
  return this.toolbarItems.filter((item) => (item.group?.value || "center") === groupName);
@@ -353255,13 +354054,14 @@ function print() { __p += __j.call(arguments, '') }
353255
354054
  return this.config.responsiveToContainer ? containerWidth : documentWidth;
353256
354055
  }
353257
354056
  #makeToolbarItems({ superToolbar, icons: icons$1, texts, fonts, hideButtons, isDev = false } = {}) {
354057
+ const availableWidth = this.getAvailableWidth();
353258
354058
  const { defaultItems, overflowItems } = makeDefaultItems({
353259
354059
  superToolbar,
353260
354060
  toolbarIcons: icons$1,
353261
354061
  toolbarTexts: texts,
353262
- toolbarFonts: fonts,
354062
+ toolbarFonts: this.#resolveToolbarFonts(fonts),
353263
354063
  hideButtons,
353264
- availableWidth: this.getAvailableWidth(),
354064
+ availableWidth,
353265
354065
  role: this.role,
353266
354066
  isDev
353267
354067
  });
@@ -353274,6 +354074,26 @@ function print() { __p += __j.call(arguments, '') }
353274
354074
  this.toolbarItems = defaultItems.filter((item) => allConfigItems.includes(item.name.value)).filter((item) => !this.config.excludeItems.includes(item.name.value));
353275
354075
  this.overflowItems = overflowItems.filter((item) => allConfigItems.includes(item.name.value));
353276
354076
  }
354077
+ #resolveToolbarFonts(configFonts) {
354078
+ return composeToolbarFontOptions(this.superdoc?.fonts?.getDocumentFontOptions?.() ?? [], configFonts);
354079
+ }
354080
+ #rebuildToolbarItems() {
354081
+ this.#makeToolbarItems({
354082
+ superToolbar: this,
354083
+ icons: this.config.icons,
354084
+ texts: this.config.texts,
354085
+ fonts: this.config.fonts,
354086
+ hideButtons: this.config.hideButtons,
354087
+ isDev: this.isDev
354088
+ });
354089
+ this.emit("toolbar-items-changed");
354090
+ }
354091
+ #fontOptionsSignature() {
354092
+ if (this.config.fonts)
354093
+ return "custom-fonts";
354094
+ const options = this.superdoc?.fonts?.getDocumentFontOptions?.() ?? [];
354095
+ return JSON.stringify(options.map((option) => [option.logicalFamily, option.previewFamily]));
354096
+ }
353277
354097
  #initDefaultFonts() {
353278
354098
  if (!this.activeEditor || !this.activeEditor.converter)
353279
354099
  return;
@@ -353645,6 +354465,14 @@ function print() { __p += __j.call(arguments, '') }
353645
354465
  if (this.#restoreStickyMarksIfNeeded())
353646
354466
  this.updateToolbarState();
353647
354467
  }
354468
+ onEditorFontsChanged() {
354469
+ const signature = this.#fontOptionsSignature();
354470
+ if (signature !== this._lastFontOptionsSignature) {
354471
+ this._lastFontOptionsSignature = signature;
354472
+ this.#rebuildToolbarItems();
354473
+ }
354474
+ this.updateToolbarState();
354475
+ }
353648
354476
  onEditorFocus() {
353649
354477
  if (this.pendingMarkCommands.length) {
353650
354478
  this.onEditorSelectionUpdate();
@@ -353711,6 +354539,7 @@ function print() { __p += __j.call(arguments, '') }
353711
354539
  clearTimeout(this._restoreFocusTimeoutId);
353712
354540
  this._restoreFocusTimeoutId = null;
353713
354541
  }
354542
+ this.#detachActiveEditorListeners();
353714
354543
  this.destroyHeadlessToolbar();
353715
354544
  this.app?.unmount();
353716
354545
  }
@@ -357087,6 +357916,7 @@ function print() { __p += __j.call(arguments, '') }
357087
357916
  editor: this
357088
357917
  });
357089
357918
  console.error(err);
357919
+ throw err;
357090
357920
  }
357091
357921
  }
357092
357922
  #endCollaboration() {
@@ -359090,7 +359920,8 @@ function print() { __p += __j.call(arguments, '') }
359090
359920
  #lastSelectedFieldAnnotation = null;
359091
359921
  #lastSelectedStructuredContentBlock = null;
359092
359922
  #lastSelectedStructuredContentInline = null;
359093
- #lastHoveredStructuredContentBlock = null;
359923
+ #sdtHoverCoordinator = null;
359924
+ #tocHoverCoordinator = null;
359094
359925
  #remoteCursorManager = null;
359095
359926
  #cursorUpdateTimer = null;
359096
359927
  #remoteCursorOverlay = null;
@@ -359161,8 +359992,11 @@ function print() { __p += __j.call(arguments, '') }
359161
359992
  ensureEditorNativeSelectionStyles(doc$12);
359162
359993
  ensureEditorFieldAnnotationInteractionStyles(doc$12);
359163
359994
  ensureEditorMovableObjectInteractionStyles(doc$12);
359164
- this.#painterHost.addEventListener("mouseover", this.#handleStructuredContentBlockMouseEnter);
359165
- this.#painterHost.addEventListener("mouseout", this.#handleStructuredContentBlockMouseLeave);
359995
+ this.#initializeHoverCoordinators();
359996
+ this.#painterHost.addEventListener("mouseover", this.#sdtHoverCoordinator.handleMouseEnter);
359997
+ this.#painterHost.addEventListener("mouseout", this.#sdtHoverCoordinator.handleMouseLeave);
359998
+ this.#painterHost.addEventListener("mouseover", this.#tocHoverCoordinator.handleMouseEnter);
359999
+ this.#painterHost.addEventListener("mouseout", this.#tocHoverCoordinator.handleMouseLeave);
359166
360000
  this.#domIndexObserverManager = new DomPositionIndexObserverManager({
359167
360001
  windowRoot: this.#visibleHost?.ownerDocument?.defaultView ?? window,
359168
360002
  getPainterHost: () => this.#painterHost,
@@ -360330,6 +361164,9 @@ function print() { __p += __j.call(arguments, '') }
360330
361164
  getFontReport() {
360331
361165
  return this.#fontGate?.getReport() ?? [];
360332
361166
  }
361167
+ getDocumentFontOptions() {
361168
+ return this.#fontGate?.getDocumentFontOptions() ?? [];
361169
+ }
360333
361170
  getMissingFonts() {
360334
361171
  return [...new Set(this.getFontReport().filter((record) => record.missing).map((record) => record.logicalFamily))];
360335
361172
  }
@@ -363150,74 +363987,50 @@ function print() { __p += __j.call(arguments, '') }
363150
363987
  }
363151
363988
  this.#setSelectedStructuredContentBlockClass(elements, id2);
363152
363989
  }
363153
- #handleStructuredContentBlockMouseEnter = (event) => {
363154
- const block = event.target.closest(`.${DOM_CLASS_NAMES.BLOCK_SDT}`);
363155
- if (!block || !(block instanceof HTMLElement))
363990
+ #initializeHoverCoordinators() {
363991
+ if (this.#sdtHoverCoordinator || this.#tocHoverCoordinator)
363156
363992
  return;
363157
- if (block.classList.contains("ProseMirror-selectednode"))
363993
+ this.#sdtHoverCoordinator = new HoverGroupCoordinator({
363994
+ entrySelector: `.${DOM_CLASS_NAMES.BLOCK_SDT}`,
363995
+ getId: (entry) => entry.dataset.sdtId,
363996
+ queryGroup: (id2) => this.#painterAdapter.getStructuredContentBlockElementsById(id2),
363997
+ hoverClass: DOM_CLASS_NAMES.SDT_GROUP_HOVER,
363998
+ shouldApplyTo: (element3) => !element3.classList.contains("ProseMirror-selectednode")
363999
+ });
364000
+ this.#tocHoverCoordinator = new HoverGroupCoordinator({
364001
+ entrySelector: `.${DOM_CLASS_NAMES.TOC_ENTRY}`,
364002
+ getId: (entry) => entry.dataset.tocId,
364003
+ queryGroup: (id2) => this.#queryTocEntryElementsById(id2),
364004
+ hoverClass: DOM_CLASS_NAMES.TOC_GROUP_HOVER,
364005
+ onApply: (elements) => this.#applyTocGapFill(elements),
364006
+ onClear: (element3) => element3.style.removeProperty("--toc-gap-below")
364007
+ });
364008
+ }
364009
+ #applyTocGapFill(elements) {
364010
+ if (elements.length < 2)
363158
364011
  return;
363159
- const rawId = block.dataset.sdtId;
363160
- if (!rawId)
363161
- return;
363162
- this.#setHoveredStructuredContentBlockClass(rawId);
363163
- };
363164
- #handleStructuredContentBlockMouseLeave = (event) => {
363165
- const block = event.target.closest(`.${DOM_CLASS_NAMES.BLOCK_SDT}`);
363166
- if (!block)
363167
- return;
363168
- const relatedTarget = event.relatedTarget;
363169
- if (relatedTarget && block.dataset.sdtId) {
363170
- const escapedCheckId = typeof CSS !== "undefined" && CSS.escape ? CSS.escape(block.dataset.sdtId) : block.dataset.sdtId.replace(/"/g, "\\\"");
363171
- if (relatedTarget.closest(buildSdtBlockSelector(escapedCheckId)))
363172
- return;
364012
+ const measured = elements.map((element3) => ({
364013
+ element: element3,
364014
+ rect: element3.getBoundingClientRect()
364015
+ })).sort((a2, b$1) => a2.rect.top - b$1.rect.top);
364016
+ for (let i4 = 0;i4 < measured.length - 1; i4++) {
364017
+ const current = measured[i4];
364018
+ const next2 = measured[i4 + 1];
364019
+ const currentPage = current.element.closest("[data-page-index]");
364020
+ if (!currentPage || currentPage !== next2.element.closest("[data-page-index]"))
364021
+ continue;
364022
+ const rawGap = next2.rect.top - current.rect.bottom;
364023
+ const scaleY = current.rect.height && current.element.offsetHeight ? current.rect.height / current.element.offsetHeight : 1;
364024
+ const gap = scaleY > 0 ? rawGap / scaleY : rawGap;
364025
+ if (gap > 0)
364026
+ current.element.style.setProperty("--toc-gap-below", `${gap + 1}px`);
363173
364027
  }
363174
- this.#clearHoveredStructuredContentBlockClass();
363175
- };
363176
- #clearHoveredStructuredContentBlockClass() {
363177
- if (!this.#lastHoveredStructuredContentBlock)
363178
- return;
363179
- this.#lastHoveredStructuredContentBlock.elements.forEach((element3) => {
363180
- element3.classList.remove(DOM_CLASS_NAMES.SDT_GROUP_HOVER);
363181
- });
363182
- this.#lastHoveredStructuredContentBlock = null;
363183
364028
  }
363184
- #setHoveredStructuredContentBlockClass(id2) {
363185
- if (this.#lastHoveredStructuredContentBlock?.id === id2)
363186
- return;
363187
- this.#clearHoveredStructuredContentBlockClass();
364029
+ #queryTocEntryElementsById(id2) {
363188
364030
  if (!this.#painterHost)
363189
- return;
363190
- const elements = this.#painterAdapter.getStructuredContentBlockElementsById(id2);
363191
- if (elements.length === 0)
363192
- return;
363193
- elements.forEach((element3) => {
363194
- if (!element3.classList.contains("ProseMirror-selectednode"))
363195
- element3.classList.add(DOM_CLASS_NAMES.SDT_GROUP_HOVER);
363196
- });
363197
- this.#lastHoveredStructuredContentBlock = {
363198
- id: id2,
363199
- elements
363200
- };
363201
- }
363202
- #reapplySdtGroupHover() {
363203
- if (!this.#lastHoveredStructuredContentBlock || !this.#painterHost)
363204
- return;
363205
- const { id: id2 } = this.#lastHoveredStructuredContentBlock;
363206
- if (!id2)
363207
- return;
363208
- const elements = this.#painterAdapter.getStructuredContentBlockElementsById(id2);
363209
- if (elements.length === 0) {
363210
- this.#lastHoveredStructuredContentBlock = null;
363211
- return;
363212
- }
363213
- elements.forEach((element3) => {
363214
- if (!element3.classList.contains("ProseMirror-selectednode"))
363215
- element3.classList.add(DOM_CLASS_NAMES.SDT_GROUP_HOVER);
363216
- });
363217
- this.#lastHoveredStructuredContentBlock = {
363218
- id: id2,
363219
- elements
363220
- };
364031
+ return [];
364032
+ const escapedId = escapeAttrValue(id2);
364033
+ return Array.from(this.#painterHost.querySelectorAll(`.${DOM_CLASS_NAMES.TOC_ENTRY}[data-toc-id="${escapedId}"]`));
363221
364034
  }
363222
364035
  #refreshEditorDomAugmentations() {
363223
364036
  this.#postPaintPipeline.refreshAfterPaint({
@@ -363226,7 +364039,8 @@ function print() { __p += __j.call(arguments, '') }
363226
364039
  domPositionIndex: this.#domPositionIndex,
363227
364040
  proofingAnnotations: this.#buildProofingAnnotations(),
363228
364041
  rebuildDomPositionIndex: () => this.#rebuildDomPositionIndex(),
363229
- reapplyStructuredContentHover: () => this.#reapplySdtGroupHover()
364042
+ reapplyStructuredContentHover: () => this.#sdtHoverCoordinator?.reapply(),
364043
+ reapplyTocGroupHover: () => this.#tocHoverCoordinator?.reapply()
363230
364044
  });
363231
364045
  }
363232
364046
  #clearSelectedStructuredContentInlineClass() {
@@ -365614,11 +366428,11 @@ function print() { __p += __j.call(arguments, '') }
365614
366428
  ]);
365615
366429
  });
365616
366430
 
365617
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-BT9gcxxx.es.js
366431
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-Cjo_Z85j.es.js
365618
366432
  var headlessToolbarConstants, MOD_ALIASES, ALT_ALIASES, CTRL_ALIASES, SHIFT_ALIASES, BUILTIN_CONTEXT_MENU_GROUPS, BUILTIN_GROUP_ORDER, RESERVED_PROXY_PROPERTY_NAMES, ALL_TOOLBAR_COMMAND_IDS, EMPTY_ACTIVE_IDS;
365619
- var init_create_super_doc_ui_BT9gcxxx_es = __esm(() => {
365620
- init_SuperConverter_C6RGktKO_es();
365621
- init_create_headless_toolbar_D7rUpTS1_es();
366433
+ var init_create_super_doc_ui_Cjo_Z85j_es = __esm(() => {
366434
+ init_SuperConverter_DJyHekqW_es();
366435
+ init_create_headless_toolbar_Jmx2i_9i_es();
365622
366436
  headlessToolbarConstants = {
365623
366437
  DEFAULT_TEXT_ALIGN_OPTIONS: [
365624
366438
  {
@@ -365900,16 +366714,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
365900
366714
 
365901
366715
  // ../../packages/superdoc/dist/super-editor.es.js
365902
366716
  var init_super_editor_es = __esm(() => {
365903
- init_src_D29bOSuq_es();
365904
- init_SuperConverter_C6RGktKO_es();
366717
+ init_src_BB_FFFud_es();
366718
+ init_SuperConverter_DJyHekqW_es();
365905
366719
  init_jszip_C49i9kUs_es();
365906
366720
  init_xml_js_CqGKpaft_es();
365907
- init_create_headless_toolbar_D7rUpTS1_es();
366721
+ init_create_headless_toolbar_Jmx2i_9i_es();
365908
366722
  init_constants_D9qj59G2_es();
365909
366723
  init_dist_B8HfvhaK_es();
365910
366724
  init_unified_Dsuw2be5_es();
365911
366725
  init_DocxZipper_FUsfThjV_es();
365912
- init_create_super_doc_ui_BT9gcxxx_es();
366726
+ init_create_super_doc_ui_Cjo_Z85j_es();
365913
366727
  init_ui_C5PAS9hY_es();
365914
366728
  init_eventemitter3_BnGqBE_Q_es();
365915
366729
  init_errors_CNaD6vcg_es();