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

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 +1013 -227
  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-BSDZ3hYr.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,
@@ -129714,18 +129891,10 @@ var isRegExp = (value) => {
129714
129891
  physical: primary,
129715
129892
  reason: "registered_face"
129716
129893
  };
129894
+ const docfonts = resolveDocfontsFace(primary, face, hasFace);
129895
+ if (docfonts)
129896
+ return docfonts;
129717
129897
  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
129898
  if (override || bundled)
129730
129899
  return {
129731
129900
  physical: primary,
@@ -129758,11 +129927,12 @@ var isRegExp = (value) => {
129758
129927
  }
129759
129928
  resolveFace(logicalFamily, face, hasFace) {
129760
129929
  const primary = splitStack(logicalFamily)[0] ?? logicalFamily;
129761
- const { physical, reason } = this.#resolveFaceLadder(primary, face, hasFace);
129930
+ const { physical, reason, sourceFace } = this.#resolveFaceLadder(primary, face, hasFace);
129762
129931
  return {
129763
129932
  logicalFamily,
129764
129933
  physicalFamily: stripFamilyQuotes(physical),
129765
- reason
129934
+ reason,
129935
+ ...sourceFace ? { sourceFace } : {}
129766
129936
  };
129767
129937
  }
129768
129938
  resolvePhysicalFamilyForFace(cssFontFamily, face, hasFace) {
@@ -129787,7 +129957,17 @@ var isRegExp = (value) => {
129787
129957
  out.add(this.resolvePrimaryPhysicalFamily(family$1));
129788
129958
  return [...out];
129789
129959
  }
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 {
129960
+ }, defaultResolver, DEFAULT_FONT_MEASURE_CONTEXT, fontConfigVersion = 0, defaultAssetBase = "/fonts/", installedRegistries, faceSlotFor = ({ weight, style }) => {
129961
+ const bold2 = weight === "700";
129962
+ const italic = style === "italic";
129963
+ if (bold2 && italic)
129964
+ return "boldItalic";
129965
+ if (bold2)
129966
+ return "bold";
129967
+ if (italic)
129968
+ return "italic";
129969
+ return "regular";
129970
+ }, 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
129971
  #fontSet;
129792
129972
  #FontFaceCtor;
129793
129973
  #probeSize;
@@ -130128,7 +130308,7 @@ var isRegExp = (value) => {
130128
130308
  const detail = sources && sources.length ? ` from ${sources.join(", ")}` : "";
130129
130309
  console.warn(`[superdoc] font asset failed to load for "${family$1}"${detail}. Check fonts.assetBaseUrl / fonts.resolveAssetUrl so the bundled .woff2 are served.`);
130130
130310
  }
130131
- }, registriesByFontSet, domlessRegistry = null, PHYSICAL_GENERIC, BUNDLED_FAMILIES, FONT_OFFERINGS, DEFAULT_FONT_ORDER, prepareCommentParaIds = (comment) => {
130311
+ }, registriesByFontSet, domlessRegistry = null, BUNDLED_FAMILIES, ADVERTISED_BUILT_IN_TOOLBAR_FAMILIES, FONT_OFFERINGS, prepareCommentParaIds = (comment) => {
130132
130312
  return {
130133
130313
  ...comment,
130134
130314
  commentParaId: generateDocxRandomId()
@@ -134104,7 +134284,7 @@ var isRegExp = (value) => {
134104
134284
  state.kern = kernNode.attributes["w:val"];
134105
134285
  }
134106
134286
  }, SuperConverter;
134107
- var init_SuperConverter_C6RGktKO_es = __esm(() => {
134287
+ var init_SuperConverter_BSDZ3hYr_es = __esm(() => {
134108
134288
  init_rolldown_runtime_Bg48TavK_es();
134109
134289
  init_jszip_C49i9kUs_es();
134110
134290
  init_xml_js_CqGKpaft_es();
@@ -171424,6 +171604,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171424
171604
  SUBSTITUTION_EVIDENCE$1 = [
171425
171605
  {
171426
171606
  evidenceId: "calibri",
171607
+ generic: "sans-serif",
171427
171608
  logicalFamily: "Calibri",
171428
171609
  physicalFamily: "Carlito",
171429
171610
  verdict: "metric_safe",
@@ -171443,6 +171624,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171443
171624
  measurementRefs: ["calibri__carlito#analytic_advance#2026-06-03", "calibri__carlito#face_aggregate#2026-06-03"],
171444
171625
  exportRule: "preserve_original_name",
171445
171626
  advance: {
171627
+ basis: "latin_full",
171446
171628
  meanDelta: 0,
171447
171629
  maxDelta: 0
171448
171630
  },
@@ -171450,6 +171632,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171450
171632
  },
171451
171633
  {
171452
171634
  evidenceId: "cambria",
171635
+ generic: "serif",
171453
171636
  logicalFamily: "Cambria",
171454
171637
  physicalFamily: "Caladea",
171455
171638
  verdict: "visual_only",
@@ -171474,6 +171657,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171474
171657
  ],
171475
171658
  exportRule: "preserve_original_name",
171476
171659
  advance: {
171660
+ basis: "latin_full",
171477
171661
  meanDelta: 0.0002378,
171478
171662
  maxDelta: 0.2310758
171479
171663
  },
@@ -171493,6 +171677,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171493
171677
  },
171494
171678
  {
171495
171679
  evidenceId: "arial",
171680
+ generic: "sans-serif",
171496
171681
  logicalFamily: "Arial",
171497
171682
  physicalFamily: "Liberation Sans",
171498
171683
  verdict: "metric_safe",
@@ -171512,6 +171697,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171512
171697
  measurementRefs: ["arial__liberation-sans#analytic_advance#2026-06-03"],
171513
171698
  exportRule: "preserve_original_name",
171514
171699
  advance: {
171700
+ basis: "latin_full",
171515
171701
  meanDelta: 0,
171516
171702
  maxDelta: 0
171517
171703
  },
@@ -171519,6 +171705,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171519
171705
  },
171520
171706
  {
171521
171707
  evidenceId: "times-new-roman",
171708
+ generic: "serif",
171522
171709
  logicalFamily: "Times New Roman",
171523
171710
  physicalFamily: "Liberation Serif",
171524
171711
  verdict: "metric_safe",
@@ -171538,6 +171725,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171538
171725
  measurementRefs: ["times-new-roman__liberation-serif#analytic_advance#2026-06-03"],
171539
171726
  exportRule: "preserve_original_name",
171540
171727
  advance: {
171728
+ basis: "latin_full",
171541
171729
  meanDelta: 0,
171542
171730
  maxDelta: 0
171543
171731
  },
@@ -171545,6 +171733,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171545
171733
  },
171546
171734
  {
171547
171735
  evidenceId: "courier-new",
171736
+ generic: "monospace",
171548
171737
  logicalFamily: "Courier New",
171549
171738
  physicalFamily: "Liberation Mono",
171550
171739
  verdict: "metric_safe",
@@ -171564,6 +171753,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171564
171753
  measurementRefs: ["courier-new__liberation-mono#analytic_advance#2026-06-03"],
171565
171754
  exportRule: "preserve_original_name",
171566
171755
  advance: {
171756
+ basis: "latin_full",
171567
171757
  meanDelta: 0,
171568
171758
  maxDelta: 0
171569
171759
  },
@@ -171571,6 +171761,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171571
171761
  },
171572
171762
  {
171573
171763
  evidenceId: "georgia",
171764
+ generic: "serif",
171574
171765
  logicalFamily: "Georgia",
171575
171766
  physicalFamily: "Gelasio",
171576
171767
  verdict: "near_metric",
@@ -171599,6 +171790,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171599
171790
  ],
171600
171791
  exportRule: "preserve_original_name",
171601
171792
  advance: {
171793
+ basis: "latin_full",
171602
171794
  meanDelta: 0.0000197,
171603
171795
  maxDelta: 0.0183727
171604
171796
  },
@@ -171623,6 +171815,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171623
171815
  },
171624
171816
  {
171625
171817
  evidenceId: "arial-narrow",
171818
+ generic: "sans-serif",
171626
171819
  logicalFamily: "Arial Narrow",
171627
171820
  physicalFamily: "Liberation Sans Narrow",
171628
171821
  verdict: "visual_only",
@@ -171647,6 +171840,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171647
171840
  ],
171648
171841
  exportRule: "preserve_original_name",
171649
171842
  advance: {
171843
+ basis: "latin_full",
171650
171844
  meanDelta: 0,
171651
171845
  maxDelta: 0.5
171652
171846
  },
@@ -171666,6 +171860,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171666
171860
  },
171667
171861
  {
171668
171862
  evidenceId: "aptos",
171863
+ generic: "sans-serif",
171669
171864
  logicalFamily: "Aptos",
171670
171865
  physicalFamily: null,
171671
171866
  verdict: "no_substitute",
@@ -171686,8 +171881,134 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171686
171881
  exportRule: "preserve_original_name",
171687
171882
  candidateLicense: null
171688
171883
  },
171884
+ {
171885
+ evidenceId: "arial-black",
171886
+ generic: "sans-serif",
171887
+ logicalFamily: "Arial Black",
171888
+ physicalFamily: "Archivo Black",
171889
+ verdict: "visual_only",
171890
+ faces: {
171891
+ regular: true,
171892
+ bold: false,
171893
+ italic: false,
171894
+ boldItalic: false
171895
+ },
171896
+ faceSources: { italic: {
171897
+ kind: "synthetic",
171898
+ from: "regular"
171899
+ } },
171900
+ gates: {
171901
+ static: "pass",
171902
+ metric: "fail",
171903
+ layout: "not_run",
171904
+ ship: "fail"
171905
+ },
171906
+ policyAction: "substitute",
171907
+ measurementRefs: ["arial-black__archivo-black#visual_review#2026-06-09"],
171908
+ exportRule: "preserve_original_name",
171909
+ candidateLicense: "OFL-1.1",
171910
+ faceVerdicts: { italic: "visual_only" }
171911
+ },
171912
+ {
171913
+ evidenceId: "arial-rounded-mt-bold",
171914
+ generic: "sans-serif",
171915
+ logicalFamily: "Arial Rounded MT Bold",
171916
+ physicalFamily: "Ubuntu",
171917
+ verdict: "visual_only",
171918
+ faces: {
171919
+ regular: true,
171920
+ bold: true,
171921
+ italic: true,
171922
+ boldItalic: true
171923
+ },
171924
+ gates: {
171925
+ static: "pass",
171926
+ metric: "fail",
171927
+ layout: "not_run",
171928
+ ship: "fail"
171929
+ },
171930
+ policyAction: "category_fallback",
171931
+ measurementRefs: ["arial-rounded-mt-bold__ubuntu#visual_review#2026-06-09"],
171932
+ exportRule: "preserve_original_name",
171933
+ candidateLicense: "Ubuntu-font-1.0"
171934
+ },
171935
+ {
171936
+ evidenceId: "bookman-old-style",
171937
+ generic: "serif",
171938
+ logicalFamily: "Bookman Old Style",
171939
+ physicalFamily: "TeX Gyre Bonum",
171940
+ verdict: "visual_only",
171941
+ faces: {
171942
+ regular: true,
171943
+ bold: true,
171944
+ italic: true,
171945
+ boldItalic: true
171946
+ },
171947
+ gates: {
171948
+ static: "pass",
171949
+ metric: "fail",
171950
+ layout: "not_run",
171951
+ ship: "fail"
171952
+ },
171953
+ policyAction: "substitute",
171954
+ measurementRefs: ["bookman-old-style__tex-gyre-bonum#visual_review#2026-06-09"],
171955
+ exportRule: "preserve_original_name",
171956
+ candidateLicense: "GUST-Font-License-1.0"
171957
+ },
171958
+ {
171959
+ evidenceId: "century",
171960
+ generic: "serif",
171961
+ logicalFamily: "Century",
171962
+ physicalFamily: "C059",
171963
+ verdict: "visual_only",
171964
+ faces: {
171965
+ regular: true,
171966
+ bold: true,
171967
+ italic: true,
171968
+ boldItalic: true
171969
+ },
171970
+ gates: {
171971
+ static: "pass",
171972
+ metric: "fail",
171973
+ layout: "not_run",
171974
+ ship: "fail"
171975
+ },
171976
+ policyAction: "substitute",
171977
+ measurementRefs: ["century__c059#visual_review#2026-06-09"],
171978
+ exportRule: "preserve_original_name",
171979
+ candidateLicense: "AGPL-3.0-only WITH PS-or-PDF-font-exception-20170817"
171980
+ },
171981
+ {
171982
+ evidenceId: "garamond",
171983
+ generic: "serif",
171984
+ logicalFamily: "Garamond",
171985
+ physicalFamily: "Cardo",
171986
+ verdict: "visual_only",
171987
+ faces: {
171988
+ regular: true,
171989
+ bold: true,
171990
+ italic: true,
171991
+ boldItalic: false
171992
+ },
171993
+ faceSources: { boldItalic: {
171994
+ kind: "synthetic",
171995
+ from: "bold"
171996
+ } },
171997
+ gates: {
171998
+ static: "pass",
171999
+ metric: "fail",
172000
+ layout: "not_run",
172001
+ ship: "fail"
172002
+ },
172003
+ policyAction: "category_fallback",
172004
+ measurementRefs: ["garamond__cardo#visual_review#2026-06-09"],
172005
+ exportRule: "preserve_original_name",
172006
+ candidateLicense: "OFL-1.1",
172007
+ faceVerdicts: { boldItalic: "visual_only" }
172008
+ },
171689
172009
  {
171690
172010
  evidenceId: "consolas",
172011
+ generic: "monospace",
171691
172012
  logicalFamily: "Consolas",
171692
172013
  physicalFamily: "Inconsolata SemiExpanded",
171693
172014
  verdict: "cell_width_only",
@@ -171707,6 +172028,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171707
172028
  measurementRefs: ["consolas__inconsolata-semiexpanded#analytic_advance#2026-06-03"],
171708
172029
  exportRule: "preserve_original_name",
171709
172030
  advance: {
172031
+ basis: "monospace_cell",
171710
172032
  meanDelta: 0.00035999999999999997,
171711
172033
  maxDelta: 0.00035999999999999997
171712
172034
  },
@@ -171714,6 +172036,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171714
172036
  },
171715
172037
  {
171716
172038
  evidenceId: "verdana",
172039
+ generic: "sans-serif",
171717
172040
  logicalFamily: "Verdana",
171718
172041
  physicalFamily: null,
171719
172042
  verdict: "visual_only",
@@ -171736,76 +172059,90 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171736
172059
  },
171737
172060
  {
171738
172061
  evidenceId: "tahoma",
172062
+ generic: "sans-serif",
171739
172063
  logicalFamily: "Tahoma",
171740
- physicalFamily: null,
172064
+ physicalFamily: "Noto Sans",
171741
172065
  verdict: "visual_only",
171742
172066
  faces: {
171743
- regular: false,
171744
- bold: false,
171745
- italic: false,
171746
- boldItalic: false
172067
+ regular: true,
172068
+ bold: true,
172069
+ italic: true,
172070
+ boldItalic: true
171747
172071
  },
171748
172072
  gates: {
171749
- static: "not_run",
172073
+ static: "pass",
171750
172074
  metric: "fail",
171751
172075
  layout: "not_run",
171752
- ship: "not_run"
172076
+ ship: "fail"
171753
172077
  },
171754
172078
  policyAction: "category_fallback",
171755
- measurementRefs: ["tahoma#top_candidates#2026-06-03"],
172079
+ measurementRefs: ["tahoma__noto-sans#visual_review#2026-06-09"],
171756
172080
  exportRule: "preserve_original_name",
171757
- candidateLicense: null
172081
+ candidateLicense: "OFL-1.1"
171758
172082
  },
171759
172083
  {
171760
172084
  evidenceId: "trebuchet-ms",
172085
+ generic: "sans-serif",
171761
172086
  logicalFamily: "Trebuchet MS",
171762
- physicalFamily: null,
172087
+ physicalFamily: "PT Sans",
171763
172088
  verdict: "visual_only",
171764
172089
  faces: {
171765
- regular: false,
171766
- bold: false,
171767
- italic: false,
171768
- boldItalic: false
172090
+ regular: true,
172091
+ bold: true,
172092
+ italic: true,
172093
+ boldItalic: true
171769
172094
  },
171770
172095
  gates: {
171771
- static: "not_run",
172096
+ static: "pass",
171772
172097
  metric: "fail",
171773
172098
  layout: "not_run",
171774
- ship: "not_run"
172099
+ ship: "fail"
171775
172100
  },
171776
172101
  policyAction: "category_fallback",
171777
- measurementRefs: ["trebuchet-ms#top_candidates#2026-06-03"],
172102
+ measurementRefs: ["trebuchet-ms__pt-sans#visual_review#2026-06-09"],
171778
172103
  exportRule: "preserve_original_name",
171779
- candidateLicense: null
172104
+ candidateLicense: "OFL-1.1"
171780
172105
  },
171781
172106
  {
171782
172107
  evidenceId: "comic-sans-ms",
172108
+ generic: "sans-serif",
171783
172109
  logicalFamily: "Comic Sans MS",
171784
- physicalFamily: "Comic Neue",
172110
+ physicalFamily: "Comic Relief",
171785
172111
  verdict: "visual_only",
171786
172112
  faces: {
171787
- regular: false,
171788
- bold: false,
172113
+ regular: true,
172114
+ bold: true,
171789
172115
  italic: false,
171790
172116
  boldItalic: false
171791
172117
  },
172118
+ faceSources: {
172119
+ italic: {
172120
+ kind: "synthetic",
172121
+ from: "regular"
172122
+ },
172123
+ boldItalic: {
172124
+ kind: "synthetic",
172125
+ from: "bold"
172126
+ }
172127
+ },
171792
172128
  gates: {
171793
- static: "not_run",
172129
+ static: "pass",
171794
172130
  metric: "fail",
171795
172131
  layout: "not_run",
171796
- ship: "not_run"
172132
+ ship: "fail"
171797
172133
  },
171798
172134
  policyAction: "category_fallback",
171799
- measurementRefs: ["comic-sans-ms__comic-neue#analytic_advance#2026-06-03"],
172135
+ measurementRefs: ["comic-sans-ms__comic-relief#visual_review#2026-06-09"],
171800
172136
  exportRule: "preserve_original_name",
171801
- advance: {
171802
- meanDelta: 0.1005,
171803
- maxDelta: 0.1419
171804
- },
171805
- candidateLicense: "OFL-1.1"
172137
+ candidateLicense: "OFL-1.1",
172138
+ faceVerdicts: {
172139
+ italic: "visual_only",
172140
+ boldItalic: "visual_only"
172141
+ }
171806
172142
  },
171807
172143
  {
171808
172144
  evidenceId: "candara",
172145
+ generic: "sans-serif",
171809
172146
  logicalFamily: "Candara",
171810
172147
  physicalFamily: null,
171811
172148
  verdict: "visual_only",
@@ -171828,6 +172165,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171828
172165
  },
171829
172166
  {
171830
172167
  evidenceId: "constantia",
172168
+ generic: "serif",
171831
172169
  logicalFamily: "Constantia",
171832
172170
  physicalFamily: null,
171833
172171
  verdict: "visual_only",
@@ -171850,6 +172188,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171850
172188
  },
171851
172189
  {
171852
172190
  evidenceId: "corbel",
172191
+ generic: "sans-serif",
171853
172192
  logicalFamily: "Corbel",
171854
172193
  physicalFamily: null,
171855
172194
  verdict: "visual_only",
@@ -171872,6 +172211,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171872
172211
  },
171873
172212
  {
171874
172213
  evidenceId: "lucida-console",
172214
+ generic: "monospace",
171875
172215
  logicalFamily: "Lucida Console",
171876
172216
  physicalFamily: "Cousine",
171877
172217
  verdict: "cell_width_only",
@@ -171891,13 +172231,54 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171891
172231
  measurementRefs: ["lucida-console__cousine#analytic_advance#2026-06-03"],
171892
172232
  exportRule: "preserve_original_name",
171893
172233
  advance: {
172234
+ basis: "monospace_cell",
171894
172235
  meanDelta: 0.004050000000000001,
171895
172236
  maxDelta: 0.004050000000000001
171896
172237
  },
171897
172238
  candidateLicense: "OFL-1.1"
171898
172239
  },
172240
+ {
172241
+ evidenceId: "gill-sans-mt-condensed",
172242
+ generic: "sans-serif",
172243
+ logicalFamily: "Gill Sans MT Condensed",
172244
+ physicalFamily: "PT Sans Narrow",
172245
+ verdict: "visual_only",
172246
+ faces: {
172247
+ regular: true,
172248
+ bold: true,
172249
+ italic: false,
172250
+ boldItalic: false
172251
+ },
172252
+ faceSources: {
172253
+ italic: {
172254
+ kind: "synthetic",
172255
+ from: "regular"
172256
+ },
172257
+ boldItalic: {
172258
+ kind: "synthetic",
172259
+ from: "bold"
172260
+ }
172261
+ },
172262
+ gates: {
172263
+ static: "pass",
172264
+ metric: "fail",
172265
+ layout: "not_run",
172266
+ ship: "fail"
172267
+ },
172268
+ policyAction: "category_fallback",
172269
+ measurementRefs: ["gill-sans-mt-condensed__pt-sans-narrow#visual_review#2026-06-09"],
172270
+ exportRule: "preserve_original_name",
172271
+ candidateLicense: "OFL-1.1",
172272
+ faceVerdicts: {
172273
+ regular: "visual_only",
172274
+ bold: "visual_only",
172275
+ italic: "visual_only",
172276
+ boldItalic: "visual_only"
172277
+ }
172278
+ },
171899
172279
  {
171900
172280
  evidenceId: "aptos-display",
172281
+ generic: "sans-serif",
171901
172282
  logicalFamily: "Aptos Display",
171902
172283
  physicalFamily: null,
171903
172284
  verdict: "customer_supplied",
@@ -171919,6 +172300,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171919
172300
  },
171920
172301
  {
171921
172302
  evidenceId: "cambria-math",
172303
+ generic: "serif",
171922
172304
  logicalFamily: "Cambria Math",
171923
172305
  physicalFamily: null,
171924
172306
  verdict: "preserve_only",
@@ -171940,6 +172322,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171940
172322
  },
171941
172323
  {
171942
172324
  evidenceId: "helvetica",
172325
+ generic: "sans-serif",
171943
172326
  logicalFamily: "Helvetica",
171944
172327
  physicalFamily: "Liberation Sans",
171945
172328
  verdict: "metric_safe",
@@ -171959,6 +172342,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171959
172342
  measurementRefs: ["helvetica__liberation-sans#analytic_advance#2026-06-03"],
171960
172343
  exportRule: "preserve_original_name",
171961
172344
  advance: {
172345
+ basis: "latin_full",
171962
172346
  meanDelta: 0,
171963
172347
  maxDelta: 0
171964
172348
  },
@@ -171966,6 +172350,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171966
172350
  },
171967
172351
  {
171968
172352
  evidenceId: "calibri-light",
172353
+ generic: "sans-serif",
171969
172354
  logicalFamily: "Calibri Light",
171970
172355
  physicalFamily: "Carlito",
171971
172356
  verdict: "visual_only",
@@ -171985,6 +172370,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171985
172370
  measurementRefs: ["calibri-light__carlito#analytic_advance#2026-06-05"],
171986
172371
  exportRule: "preserve_original_name",
171987
172372
  advance: {
172373
+ basis: "latin_full",
171988
172374
  meanDelta: 0.0148,
171989
172375
  maxDelta: 0.066
171990
172376
  },
@@ -171992,6 +172378,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
171992
172378
  },
171993
172379
  {
171994
172380
  evidenceId: "baskerville-old-face",
172381
+ generic: "serif",
171995
172382
  logicalFamily: "Baskerville Old Face",
171996
172383
  physicalFamily: "Bacasime Antique",
171997
172384
  verdict: "visual_only",
@@ -172011,6 +172398,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
172011
172398
  measurementRefs: ["baskerville-old-face_regular__bacasime-antique#regular#w400#7dac1e5f#analytic_advance#2026-06-05"],
172012
172399
  exportRule: "preserve_original_name",
172013
172400
  advance: {
172401
+ basis: "latin_full",
172014
172402
  meanDelta: 0,
172015
172403
  maxDelta: 0.4915590863952334
172016
172404
  },
@@ -172022,6 +172410,54 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
172022
172410
  advanceDelta: 0.4916,
172023
172411
  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
172412
  }]
172413
+ },
172414
+ {
172415
+ evidenceId: "cooper-black",
172416
+ generic: "serif",
172417
+ logicalFamily: "Cooper Black",
172418
+ physicalFamily: "Caprasimo",
172419
+ verdict: "visual_only",
172420
+ faces: {
172421
+ regular: true,
172422
+ bold: false,
172423
+ italic: false,
172424
+ boldItalic: false
172425
+ },
172426
+ faceSources: {
172427
+ bold: {
172428
+ kind: "synthetic",
172429
+ from: "regular"
172430
+ },
172431
+ italic: {
172432
+ kind: "synthetic",
172433
+ from: "regular"
172434
+ },
172435
+ boldItalic: {
172436
+ kind: "synthetic",
172437
+ from: "regular"
172438
+ }
172439
+ },
172440
+ gates: {
172441
+ static: "pass",
172442
+ metric: "pass",
172443
+ layout: "not_run",
172444
+ ship: "not_run"
172445
+ },
172446
+ policyAction: "substitute",
172447
+ measurementRefs: ["cooper-black_regular__caprasimo#regular#w400#786ab84e#analytic_advance#2026-06-05", "cooper-black__caprasimo#synthetic_faces#visual_review#2026-06-09"],
172448
+ exportRule: "preserve_original_name",
172449
+ advance: {
172450
+ basis: "latin_full",
172451
+ meanDelta: 0,
172452
+ maxDelta: 0
172453
+ },
172454
+ candidateLicense: "OFL-1.1",
172455
+ faceVerdicts: {
172456
+ regular: "metric_safe",
172457
+ bold: "visual_only",
172458
+ italic: "visual_only",
172459
+ boldItalic: "visual_only"
172460
+ }
172025
172461
  }
172026
172462
  ];
172027
172463
  LINE_BREAK_SAFE_VERDICTS = new Set([
@@ -172035,7 +172471,41 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
172035
172471
  family("Caladea", "Caladea", "Apache-2.0"),
172036
172472
  family("Liberation Sans", "LiberationSans", "OFL-1.1"),
172037
172473
  family("Liberation Serif", "LiberationSerif", "OFL-1.1"),
172038
- family("Liberation Mono", "LiberationMono", "OFL-1.1")
172474
+ family("Liberation Mono", "LiberationMono", "OFL-1.1"),
172475
+ familyWithFaces("Caprasimo", "OFL-1.1", [{
172476
+ weight: "normal",
172477
+ style: "normal",
172478
+ file: "Caprasimo-Regular.woff2"
172479
+ }]),
172480
+ family("Gelasio", "Gelasio", "OFL-1.1"),
172481
+ familyWithFaces("Cardo", "OFL-1.1", [
172482
+ {
172483
+ weight: "normal",
172484
+ style: "normal",
172485
+ file: "Cardo-Regular.woff2"
172486
+ },
172487
+ {
172488
+ weight: "bold",
172489
+ style: "normal",
172490
+ file: "Cardo-Bold.woff2"
172491
+ },
172492
+ {
172493
+ weight: "normal",
172494
+ style: "italic",
172495
+ file: "Cardo-Italic.woff2"
172496
+ }
172497
+ ]),
172498
+ familyWithFaces("Comic Relief", "OFL-1.1", [{
172499
+ weight: "normal",
172500
+ style: "normal",
172501
+ file: "ComicRelief-Regular.woff2"
172502
+ }, {
172503
+ weight: "bold",
172504
+ style: "normal",
172505
+ file: "ComicRelief-Bold.woff2"
172506
+ }]),
172507
+ family("Noto Sans", "NotoSans", "OFL-1.1"),
172508
+ family("PT Sans", "PTSans", "OFL-1.1")
172039
172509
  ]);
172040
172510
  SUBSTITUTION_EVIDENCE = SUBSTITUTION_EVIDENCE$1;
172041
172511
  bundledFamilies = new Set(BUNDLED_MANIFEST.map((f2) => f2.family));
@@ -172047,24 +172517,19 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
172047
172517
  fontSignature: ""
172048
172518
  });
172049
172519
  installedRegistries = /* @__PURE__ */ new WeakMap;
172520
+ RENDER_ALL = { canRenderFamily: () => true };
172050
172521
  OS2_MIN_LENGTH = OS2_FSSELECTION + 2;
172051
172522
  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
172523
  BUNDLED_FAMILIES = new Set(BUNDLED_MANIFEST.map((f2) => f2.family));
172524
+ ADVERTISED_BUILT_IN_TOOLBAR_FAMILIES = new Set([
172525
+ "Cooper Black",
172526
+ "Comic Sans MS",
172527
+ "Garamond",
172528
+ "Georgia",
172529
+ "Tahoma",
172530
+ "Trebuchet MS"
172531
+ ]);
172060
172532
  FONT_OFFERINGS = deriveOfferings();
172061
- DEFAULT_FONT_ORDER = [
172062
- "Calibri",
172063
- "Arial",
172064
- "Courier New",
172065
- "Times New Roman",
172066
- "Helvetica"
172067
- ];
172068
172533
  ALL_COMMENT_TARGETS = COMMENT_FILE_BASENAMES;
172069
172534
  REL_ID_NUMERIC_PATTERN = /rId|mi/g;
172070
172535
  FOOTNOTES_CONFIG$1 = {
@@ -173851,7 +174316,7 @@ var init_SuperConverter_C6RGktKO_es = __esm(() => {
173851
174316
  };
173852
174317
  });
173853
174318
 
173854
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-D7rUpTS1.es.js
174319
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-CKZ579SH.es.js
173855
174320
  function parseSizeUnit(val = "0") {
173856
174321
  const length3 = val.toString() || "0";
173857
174322
  const value = Number.parseFloat(length3);
@@ -184209,8 +184674,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
184209
184674
  }
184210
184675
  };
184211
184676
  };
184212
- var init_create_headless_toolbar_D7rUpTS1_es = __esm(() => {
184213
- init_SuperConverter_C6RGktKO_es();
184677
+ var init_create_headless_toolbar_CKZ579SH_es = __esm(() => {
184678
+ init_SuperConverter_BSDZ3hYr_es();
184214
184679
  init_uuid_B2wVPhPi_es();
184215
184680
  init_constants_D9qj59G2_es();
184216
184681
  init_dist_B8HfvhaK_es();
@@ -219730,7 +220195,7 @@ If you want to remount the same app, move your app creation logic into a factory
219730
220195
  var createVNodeWithArgsTransform = (...args2) => {
219731
220196
  return _createVNode(...vnodeArgsTransformer ? vnodeArgsTransformer(args2, currentRenderingInstance) : args2);
219732
220197
  };
219733
- var normalizeKey = ({ key: key2 }) => key2 != null ? key2 : null;
220198
+ var normalizeKey2 = ({ key: key2 }) => key2 != null ? key2 : null;
219734
220199
  var normalizeRef = ({
219735
220200
  ref: ref3,
219736
220201
  ref_key,
@@ -219747,7 +220212,7 @@ If you want to remount the same app, move your app creation logic into a factory
219747
220212
  __v_skip: true,
219748
220213
  type,
219749
220214
  props,
219750
- key: props && normalizeKey(props),
220215
+ key: props && normalizeKey2(props),
219751
220216
  ref: props && normalizeRef(props),
219752
220217
  scopeId: currentScopeId,
219753
220218
  slotScopeIds: null,
@@ -219847,7 +220312,7 @@ Component that was made reactive: `, type);
219847
220312
  __v_skip: true,
219848
220313
  type: vnode.type,
219849
220314
  props: mergedProps,
219850
- key: mergedProps && normalizeKey(mergedProps),
220315
+ key: mergedProps && normalizeKey2(mergedProps),
219851
220316
  ref: extraProps && extraProps.ref ? mergeRef && ref3 ? shared.isArray(ref3) ? ref3.concat(normalizeRef(extraProps)) : [ref3, normalizeRef(extraProps)] : normalizeRef(extraProps) : ref3,
219852
220317
  scopeId: vnode.scopeId,
219853
220318
  slotScopeIds: vnode.slotScopeIds,
@@ -233373,7 +233838,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
233373
233838
  init_remark_gfm_BhnWr3yf_es();
233374
233839
  });
233375
233840
 
233376
- // ../../packages/superdoc/dist/chunks/src-D29bOSuq.es.js
233841
+ // ../../packages/superdoc/dist/chunks/src-BXck1nRd.es.js
233377
233842
  function deleteProps(obj, propOrProps) {
233378
233843
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
233379
233844
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -242467,9 +242932,6 @@ function replaceCommand(wrap5, moveForward) {
242467
242932
  return true;
242468
242933
  };
242469
242934
  }
242470
- function buildSdtBlockSelector(escapedSdtId) {
242471
- return `.${DOM_CLASS_NAMES.BLOCK_SDT}[${DATA_ATTRS.SDT_ID}="${escapedSdtId}"]`;
242472
- }
242473
242935
  function buildAnnotationSelector() {
242474
242936
  return `.${DOM_CLASS_NAMES.ANNOTATION}[${DATA_ATTRS.PM_START}]`;
242475
242937
  }
@@ -245731,6 +246193,36 @@ function scrollToElement(targetElement, options = {
245731
246193
  behavior: options.behavior
245732
246194
  });
245733
246195
  }
246196
+ function normalizeToolbarFamily(value) {
246197
+ return String(value ?? "").trim().toLowerCase();
246198
+ }
246199
+ function compareToolbarFontOptions(a2, b$1) {
246200
+ return String(a2.label ?? "").trim().localeCompare(String(b$1.label ?? "").trim(), "en", { sensitivity: "base" });
246201
+ }
246202
+ function composeToolbarFontOptions(documentOptions, configFonts) {
246203
+ if (configFonts)
246204
+ return configFonts;
246205
+ if (!documentOptions?.length)
246206
+ return;
246207
+ const seen = new Set(TOOLBAR_FONTS.map((option) => normalizeToolbarFamily(option.label)));
246208
+ const merged = [...TOOLBAR_FONTS];
246209
+ for (const option of documentOptions) {
246210
+ const dedupeKey = normalizeToolbarFamily(option.logicalFamily);
246211
+ if (seen.has(dedupeKey))
246212
+ continue;
246213
+ seen.add(dedupeKey);
246214
+ merged.push({
246215
+ label: option.logicalFamily,
246216
+ key: option.logicalFamily,
246217
+ fontWeight: 400,
246218
+ props: {
246219
+ style: { fontFamily: option.previewFamily || option.logicalFamily },
246220
+ "data-item": "btn-fontFamily-option"
246221
+ }
246222
+ });
246223
+ }
246224
+ return merged.length > TOOLBAR_FONTS.length ? merged.sort(compareToolbarFontOptions) : undefined;
246225
+ }
245734
246226
  function isExtensionRulesEnabled(extension3, enabled) {
245735
246227
  if (Array.isArray(enabled))
245736
246228
  return enabled.some((enabledExtension) => {
@@ -273946,6 +274438,9 @@ function applySourceAnchorDataset(element3, sourceAnchor) {
273946
274438
  else
273947
274439
  delete element3.dataset.sourceOccurrenceId;
273948
274440
  }
274441
+ function allowFontSynthesis(element3) {
274442
+ element3.style.setProperty("font-synthesis", "weight style");
274443
+ }
273949
274444
  function getCellSegmentCount(cell2) {
273950
274445
  if (cell2.blocks && cell2.blocks.length > 0) {
273951
274446
  let total = 0;
@@ -278490,7 +278985,10 @@ function calculateBalancedColumnHeight(ctx$1, config2 = DEFAULT_BALANCING_CONFIG
278490
278985
  iterations: 0
278491
278986
  };
278492
278987
  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);
278988
+ const maxBlockHeight = ctx$1.contentBlocks.reduce((m$1, b$1) => {
278989
+ const indivisible = b$1.canBreak && b$1.lineHeights && b$1.lineHeights.length > 1 ? Math.max(...b$1.lineHeights) : b$1.measuredHeight;
278990
+ return Math.max(m$1, indivisible);
278991
+ }, 0);
278494
278992
  if (totalHeight < config2.minColumnHeight * ctx$1.columnCount)
278495
278993
  return createSingleColumnResult(ctx$1);
278496
278994
  let lo = Math.max(maxBlockHeight, config2.minColumnHeight);
@@ -278660,6 +279158,8 @@ function shouldSkipBalancing(ctx$1, config2 = DEFAULT_BALANCING_CONFIG) {
278660
279158
  }
278661
279159
  function getFragmentHeight(fragment2, measureMap) {
278662
279160
  if (fragment2.kind === "para") {
279161
+ if (fragment2.lines && fragment2.lines.length > 0)
279162
+ return fragment2.lines.reduce((sum$1, l) => sum$1 + (l.lineHeight ?? 0), 0);
278663
279163
  const measure = measureMap.get(fragment2.blockId);
278664
279164
  if (!measure || measure.kind !== "paragraph" || !measure.lines)
278665
279165
  return 0;
@@ -278740,13 +279240,38 @@ function balanceSectionOnPage(args$1) {
278740
279240
  return a2.x - b$1.x;
278741
279241
  return a2.y - b$1.y;
278742
279242
  });
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
- }));
279243
+ const lineHeightsFor = (f2) => {
279244
+ if (f2.kind !== "para")
279245
+ return;
279246
+ if (args$1.sectPrMarkerBlockIds?.has(f2.blockId))
279247
+ return;
279248
+ if (args$1.keepLinesBlockIds?.has(f2.blockId))
279249
+ return;
279250
+ if (f2.lines && f2.lines.length > 0) {
279251
+ if (f2.lines.length <= 1)
279252
+ return;
279253
+ return f2.lines.map((l) => l.lineHeight);
279254
+ }
279255
+ const measure = args$1.measureMap.get(f2.blockId);
279256
+ if (!measure || measure.kind !== "paragraph" || !Array.isArray(measure.lines))
279257
+ return;
279258
+ const fromLine = f2.fromLine ?? 0;
279259
+ const toLine = f2.toLine ?? measure.lines.length;
279260
+ if (toLine - fromLine <= 1)
279261
+ return;
279262
+ return measure.lines.slice(fromLine, toLine).map((l) => l.lineHeight);
279263
+ };
279264
+ const contentBlocks = ordered.map((f2, i4) => {
279265
+ const lineHeights = lineHeightsFor(f2);
279266
+ return {
279267
+ blockId: `${f2.blockId}#${i4}`,
279268
+ measuredHeight: getBalancingHeight(f2, args$1.measureMap, args$1.sectPrMarkerBlockIds),
279269
+ canBreak: lineHeights !== undefined,
279270
+ keepWithNext: false,
279271
+ keepTogether: lineHeights === undefined,
279272
+ lineHeights
279273
+ };
279274
+ });
278750
279275
  if (shouldSkipBalancing({
278751
279276
  columnCount,
278752
279277
  columnWidth,
@@ -278781,6 +279306,39 @@ function balanceSectionOnPage(args$1) {
278781
279306
  f2.x = columnX(col);
278782
279307
  f2.y = colCursors[col];
278783
279308
  f2.width = columnWidth;
279309
+ const bp = result.blockBreakPoints?.get(block.blockId);
279310
+ if (bp && bp.heightAfterBreak > 0 && col < columnCount - 1) {
279311
+ const splitLine = (f2.fromLine ?? 0) + bp.breakAfterLine + 1;
279312
+ const measureLineCount = args$1.measureMap.get(f2.blockId)?.lines?.length ?? splitLine;
279313
+ const originalToLine = f2.toLine ?? measureLineCount;
279314
+ const originalContinuesOnNext = f2.continuesOnNext ?? false;
279315
+ const secondHalf = {
279316
+ ...f2,
279317
+ fromLine: splitLine,
279318
+ toLine: originalToLine,
279319
+ x: columnX(col + 1),
279320
+ y: colCursors[col + 1],
279321
+ width: columnWidth,
279322
+ continuesFromPrev: true,
279323
+ continuesOnNext: originalContinuesOnNext
279324
+ };
279325
+ if (f2.lines && f2.lines.length > 0) {
279326
+ secondHalf.lines = f2.lines.slice(bp.breakAfterLine + 1);
279327
+ f2.lines = f2.lines.slice(0, bp.breakAfterLine + 1);
279328
+ }
279329
+ f2.toLine = splitLine;
279330
+ f2.continuesOnNext = true;
279331
+ colCursors[col] += bp.heightBeforeBreak;
279332
+ colCursors[col + 1] += bp.heightAfterBreak;
279333
+ const fragIdx = fragments.indexOf(f2);
279334
+ if (fragIdx >= 0)
279335
+ fragments.splice(fragIdx + 1, 0, secondHalf);
279336
+ if (colCursors[col] > maxY)
279337
+ maxY = colCursors[col];
279338
+ if (colCursors[col + 1] > maxY)
279339
+ maxY = colCursors[col + 1];
279340
+ continue;
279341
+ }
278784
279342
  colCursors[col] += block.measuredHeight;
278785
279343
  if (colCursors[col] > maxY)
278786
279344
  maxY = colCursors[col];
@@ -279932,6 +280490,7 @@ function layoutDocument(blocks2, measures, options = {}) {
279932
280490
  const sectionTypeIsExplicit = /* @__PURE__ */ new Map;
279933
280491
  let lastSectionIdx = null;
279934
280492
  const sectPrMarkerBlockIds = /* @__PURE__ */ new Set;
280493
+ const keepLinesBlockIds = /* @__PURE__ */ new Set;
279935
280494
  let documentHasExplicitColumnBreak = false;
279936
280495
  let documentHasAnySectionBreak = false;
279937
280496
  const alreadyBalancedSections = /* @__PURE__ */ new Set;
@@ -279965,6 +280524,8 @@ function layoutDocument(blocks2, measures, options = {}) {
279965
280524
  documentHasExplicitColumnBreak = true;
279966
280525
  if (block.kind === "paragraph" && blockWithAttrs.attrs?.sectPrMarker === true)
279967
280526
  sectPrMarkerBlockIds.add(block.id);
280527
+ if (block.kind === "paragraph" && blockWithAttrs.attrs?.keepLines === true)
280528
+ keepLinesBlockIds.add(block.id);
279968
280529
  });
279969
280530
  const anchoredByParagraph = collectAnchoredDrawings(blocks2, measures);
279970
280531
  const anchoredTables = collectAnchoredTables(blocks2, measures);
@@ -280183,7 +280744,8 @@ function layoutDocument(blocks2, measures, options = {}) {
280183
280744
  columnWidth: normalized.width,
280184
280745
  availableHeight,
280185
280746
  measureMap: balancingMeasureMap,
280186
- sectPrMarkerBlockIds
280747
+ sectPrMarkerBlockIds,
280748
+ keepLinesBlockIds
280187
280749
  });
280188
280750
  if (balanceResult) {
280189
280751
  state.cursorY = balanceResult.maxY;
@@ -280582,7 +281144,9 @@ function layoutDocument(blocks2, measures, options = {}) {
280582
281144
  const isMultiPage = sectionPagesCount > 1;
280583
281145
  if (isMultiPage && !isLast)
280584
281146
  continue;
280585
- const allowedByMidDocContinuous = endBreakType === "continuous" && !isLast;
281147
+ const nextSectionBeginType = sectionEndBreakType.get(sectionIdx + 1);
281148
+ const nextIsBody = lastSectionIdx !== null && sectionIdx + 1 === lastSectionIdx;
281149
+ const allowedByMidDocContinuous = !isLast && !nextIsBody && nextSectionBeginType === "continuous";
280586
281150
  const allowedByBodyExplicitContinuous = bodyExplicitContinuousIdx !== null && sectionIdx === bodyExplicitContinuousIdx - 1 && !isExplicitNonContinuous;
280587
281151
  if (!allowedByMidDocContinuous && !allowedByBodyExplicitContinuous && !isMultiPage)
280588
281152
  continue;
@@ -280613,7 +281177,8 @@ function layoutDocument(blocks2, measures, options = {}) {
280613
281177
  columnWidth: normalized.width,
280614
281178
  availableHeight: sectionAvailableHeight,
280615
281179
  measureMap: balancingMeasureMap,
280616
- sectPrMarkerBlockIds
281180
+ sectPrMarkerBlockIds,
281181
+ keepLinesBlockIds
280617
281182
  });
280618
281183
  }
280619
281184
  for (const state of states) {
@@ -285450,9 +286015,28 @@ function computeDomCaretPageLocal(options, pos) {
285450
286015
  const boundary = resolveTextBoundaryInElement(targetEl, pos, entry.pmStart, entry.pmEnd, "forward");
285451
286016
  if (!boundary) {
285452
286017
  const elRect = targetEl.getBoundingClientRect();
286018
+ if (targetEl.classList.contains("superdoc-line")) {
286019
+ const paddingLeft = parseFloat(targetEl.style.paddingLeft) || 0;
286020
+ const paddingRight = parseFloat(targetEl.style.paddingRight) || 0;
286021
+ const lineLeft = (elRect.left - pageRect.left) / zoom + paddingLeft;
286022
+ const lineRight = (elRect.right - pageRect.left) / zoom - paddingRight;
286023
+ const textAlign = targetEl.style.textAlign;
286024
+ let x;
286025
+ if (textAlign === "center")
286026
+ x = (lineLeft + lineRight) / 2;
286027
+ else if (textAlign === "right")
286028
+ x = lineRight;
286029
+ else
286030
+ x = lineLeft;
286031
+ return {
286032
+ pageIndex: Number(page.dataset.pageIndex ?? "0"),
286033
+ x,
286034
+ y: (elRect.top - pageRect.top) / zoom
286035
+ };
286036
+ }
285453
286037
  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
286038
  const atEnd = isEmptySdtPlaceholder ? pos > entry.pmEnd : pos >= entry.pmEnd;
285455
- const yRect = (isEmptySdtPlaceholder ? targetEl.closest(".superdoc-line") : null)?.getBoundingClientRect() ?? elRect;
286039
+ const yRect = (isEmptySdtPlaceholder || targetEl.classList.contains("superdoc-tab") ? targetEl.closest(".superdoc-line") : null)?.getBoundingClientRect() ?? elRect;
285456
286040
  return {
285457
286041
  pageIndex: Number(page.dataset.pageIndex ?? "0"),
285458
286042
  x: ((atEnd ? elRect.right : elRect.left) - pageRect.left) / zoom,
@@ -292875,7 +293459,8 @@ function makeResolveFace(resolver2, hasFace) {
292875
293459
  const r$1 = resolver2.resolveFace(logical, face, hasFace);
292876
293460
  return {
292877
293461
  physicalFamily: r$1.physicalFamily,
292878
- reason: r$1.reason
293462
+ reason: r$1.reason,
293463
+ sourceFace: r$1.sourceFace
292879
293464
  };
292880
293465
  };
292881
293466
  if (resolver2)
@@ -292905,10 +293490,14 @@ function collect(acc, node3, resolveFace2) {
292905
293490
  const usedKey = `${logicalPrimary.toLowerCase()}|${weight}|${style2}`;
292906
293491
  if (acc.usedFaces.has(usedKey))
292907
293492
  return;
292908
- const { physicalFamily, reason } = resolveFace2(node3.fontFamily, {
293493
+ const { physicalFamily, reason, sourceFace } = resolveFace2(node3.fontFamily, {
292909
293494
  weight,
292910
293495
  style: style2
292911
293496
  });
293497
+ const requiredFace = sourceFace ?? {
293498
+ weight,
293499
+ style: style2
293500
+ };
292912
293501
  acc.usedFaces.set(usedKey, {
292913
293502
  logicalFamily: logicalPrimary,
292914
293503
  weight,
@@ -292919,15 +293508,17 @@ function collect(acc, node3, resolveFace2) {
292919
293508
  weight,
292920
293509
  style2,
292921
293510
  (physicalFamily || "").toLowerCase(),
293511
+ requiredFace.weight,
293512
+ requiredFace.style,
292922
293513
  reason
292923
293514
  ]);
292924
293515
  if (physicalFamily) {
292925
- const reqKey = `${physicalFamily.toLowerCase()}|${weight}|${style2}`;
293516
+ const reqKey = `${physicalFamily.toLowerCase()}|${requiredFace.weight}|${requiredFace.style}`;
292926
293517
  if (!acc.requiredFaces.has(reqKey))
292927
293518
  acc.requiredFaces.set(reqKey, {
292928
293519
  family: physicalFamily,
292929
- weight,
292930
- style: style2
293520
+ weight: requiredFace.weight,
293521
+ style: requiredFace.style
292931
293522
  });
292932
293523
  }
292933
293524
  }
@@ -312555,6 +313146,7 @@ var Node$13 = class Node$14 {
312555
313146
  this.syncInlineStyleLayers(options.editorState, options.domPositionIndex);
312556
313147
  this.applyProofingAnnotations(options.proofingAnnotations, options.rebuildDomPositionIndex);
312557
313148
  options.reapplyStructuredContentHover?.();
313149
+ options.reapplyTocGroupHover?.();
312558
313150
  }
312559
313151
  destroy() {
312560
313152
  this.#proofingDecorator.clear();
@@ -312564,6 +313156,83 @@ var Node$13 = class Node$14 {
312564
313156
  this.#commentHighlightDecorator.destroy();
312565
313157
  this.#decorationBridge.destroy();
312566
313158
  }
313159
+ }, HoverGroupCoordinator = class {
313160
+ #spec;
313161
+ #current = null;
313162
+ constructor(spec) {
313163
+ this.handleMouseEnter = (event) => {
313164
+ const entry = event.target?.closest?.(this.#spec.entrySelector);
313165
+ if (!entry)
313166
+ return;
313167
+ const id2 = this.#spec.getId(entry);
313168
+ if (!id2)
313169
+ return;
313170
+ this.#set(id2);
313171
+ };
313172
+ this.handleMouseLeave = (event) => {
313173
+ const entry = event.target?.closest?.(this.#spec.entrySelector);
313174
+ if (!entry)
313175
+ return;
313176
+ const id2 = this.#spec.getId(entry);
313177
+ if (!id2)
313178
+ return;
313179
+ const relatedTarget = event.relatedTarget;
313180
+ if (relatedTarget) {
313181
+ const nextEntry = relatedTarget.closest?.(this.#spec.entrySelector);
313182
+ if (nextEntry && this.#spec.getId(nextEntry) === id2)
313183
+ return;
313184
+ }
313185
+ this.clear();
313186
+ };
313187
+ this.#spec = spec;
313188
+ }
313189
+ reapply() {
313190
+ if (!this.#current)
313191
+ return;
313192
+ const { id: id2 } = this.#current;
313193
+ const elements = this.#spec.queryGroup(id2);
313194
+ if (elements.length === 0) {
313195
+ this.#current = null;
313196
+ return;
313197
+ }
313198
+ this.#applyClass(elements);
313199
+ this.#spec.onApply?.(elements);
313200
+ this.#current = {
313201
+ id: id2,
313202
+ elements
313203
+ };
313204
+ }
313205
+ clear() {
313206
+ if (!this.#current)
313207
+ return;
313208
+ for (const element3 of this.#current.elements) {
313209
+ element3.classList.remove(this.#spec.hoverClass);
313210
+ this.#spec.onClear?.(element3);
313211
+ }
313212
+ this.#current = null;
313213
+ }
313214
+ #set(id2) {
313215
+ if (this.#current?.id === id2)
313216
+ return;
313217
+ this.clear();
313218
+ const elements = this.#spec.queryGroup(id2);
313219
+ if (elements.length === 0)
313220
+ return;
313221
+ this.#applyClass(elements);
313222
+ this.#spec.onApply?.(elements);
313223
+ this.#current = {
313224
+ id: id2,
313225
+ elements
313226
+ };
313227
+ }
313228
+ #applyClass(elements) {
313229
+ const filter = this.#spec.shouldApplyTo;
313230
+ for (const element3 of elements) {
313231
+ if (filter && !filter(element3))
313232
+ continue;
313233
+ element3.classList.add(this.#spec.hoverClass);
313234
+ }
313235
+ }
312567
313236
  }, ProofingStore = class {
312568
313237
  #issuesBySegment = /* @__PURE__ */ new Map;
312569
313238
  addIssue(issue) {
@@ -313174,6 +313843,9 @@ var Node$13 = class Node$14 {
313174
313843
  color: inherit !important;
313175
313844
  text-decoration: none !important;
313176
313845
  cursor: default;
313846
+ /* Disable native link drag so our pointer loop can run text-selection. */
313847
+ -webkit-user-drag: none;
313848
+ user-drag: none;
313177
313849
  }
313178
313850
 
313179
313851
  .superdoc-toc-entry .superdoc-link:hover {
@@ -313185,6 +313857,31 @@ var Node$13 = class Node$14 {
313185
313857
  outline: none;
313186
313858
  }
313187
313859
 
313860
+ /* TOC hover. .toc-group-hover is set by PresentationEditor on every entry
313861
+ sharing a data-toc-id so the whole TOC greys out together. The ::after
313862
+ stripe (height set via --toc-gap-below) fills the paragraph-spacing gap
313863
+ between adjacent entries so the hover reads as one continuous block. */
313864
+ .superdoc-toc-entry:hover,
313865
+ .superdoc-toc-entry.toc-group-hover {
313866
+ background-color: var(--sd-content-controls-block-hover-bg, #f2f2f2);
313867
+ }
313868
+
313869
+ /* Pointer-events stay on (default) so the stripe extends the parent entry's
313870
+ hit-test area through the paragraph-spacing gap. Without this, moving the
313871
+ cursor between two adjacent entries fires mouseout on the upper entry with
313872
+ relatedTarget = the page (not a TOC entry), the coordinator drops the
313873
+ group-hover class, and the grey disappears for a frame before the next
313874
+ entry's mouseover restores it — visible as a flicker. */
313875
+ .superdoc-toc-entry.toc-group-hover::after {
313876
+ content: '';
313877
+ position: absolute;
313878
+ left: 0;
313879
+ right: 0;
313880
+ top: 100%;
313881
+ height: var(--toc-gap-below, 0px);
313882
+ background-color: var(--sd-content-controls-block-hover-bg, #f2f2f2);
313883
+ }
313884
+
313188
313885
  /* Remove focus outlines from layout engine elements */
313189
313886
  .superdoc-layout,
313190
313887
  .superdoc-page,
@@ -315239,6 +315936,7 @@ menclose::after {
315239
315936
  });
315240
315937
  if (run2.fontSize != null)
315241
315938
  markerEl.style.fontSize = `${run2.fontSize}px`;
315939
+ allowFontSynthesis(markerEl);
315242
315940
  markerEl.style.fontWeight = run2.bold ? "bold" : "";
315243
315941
  markerEl.style.fontStyle = run2.italic ? "italic" : "";
315244
315942
  if (run2.color)
@@ -317162,8 +317860,12 @@ menclose::after {
317162
317860
  applyResolvedFragmentFrame(fragmentEl, resolvedItem, fragment2);
317163
317861
  else
317164
317862
  applyFragmentFrame(fragmentEl, fragment2);
317165
- if (isTocEntry)
317166
- fragmentEl.classList.add("superdoc-toc-entry");
317863
+ if (isTocEntry) {
317864
+ fragmentEl.classList.add(DOM_CLASS_NAMES.TOC_ENTRY);
317865
+ const tocId = block.attrs?.tocId;
317866
+ if (typeof tocId === "string" && tocId.length > 0)
317867
+ fragmentEl.dataset.tocId = tocId;
317868
+ }
317167
317869
  if (paraContinuesFromPrev)
317168
317870
  fragmentEl.dataset.continuesFromPrev = "true";
317169
317871
  if (paraContinuesOnNext)
@@ -317220,6 +317922,7 @@ menclose::after {
317220
317922
  style: run2.italic ? "italic" : "normal"
317221
317923
  });
317222
317924
  dropCapEl.style.fontSize = `${run2.fontSize}px`;
317925
+ allowFontSynthesis(dropCapEl);
317223
317926
  if (run2.bold)
317224
317927
  dropCapEl.style.fontWeight = "bold";
317225
317928
  if (run2.italic)
@@ -317339,6 +318042,7 @@ menclose::after {
317339
318042
  style: run2.italic ? "italic" : "normal"
317340
318043
  });
317341
318044
  element3.style.fontSize = `${run2.fontSize}px`;
318045
+ allowFontSynthesis(element3);
317342
318046
  if (run2.bold)
317343
318047
  element3.style.fontWeight = "bold";
317344
318048
  if (run2.italic)
@@ -317531,6 +318235,7 @@ menclose::after {
317531
318235
  }
317532
318236
  if (run2.textColor)
317533
318237
  annotation.style.color = run2.textColor;
318238
+ allowFontSynthesis(annotation);
317534
318239
  if (run2.bold)
317535
318240
  annotation.style.fontWeight = "bold";
317536
318241
  if (run2.italic)
@@ -325358,6 +326063,7 @@ menclose::after {
325358
326063
  #cellAnchor = null;
325359
326064
  #cellDragMode = "none";
325360
326065
  #pendingMarginClick = null;
326066
+ #pendingTocLinkNav = null;
325361
326067
  #lastSelectedImageBlockId = null;
325362
326068
  #suppressFocusInFromDraggable = false;
325363
326069
  #pendingStructuredContentLabelGesture = null;
@@ -325899,10 +326605,14 @@ menclose::after {
325899
326605
  return;
325900
326606
  }
325901
326607
  const linkEl = target?.closest?.("a.superdoc-link");
325902
- if (linkEl) {
325903
- this.#handleLinkClick(event, linkEl);
325904
- return;
325905
- }
326608
+ this.#pendingTocLinkNav = null;
326609
+ if (linkEl)
326610
+ if (linkEl.closest(`.${DOM_CLASS_NAMES.TOC_ENTRY}`))
326611
+ this.#pendingTocLinkNav = linkEl;
326612
+ else {
326613
+ this.#handleLinkClick(event, linkEl);
326614
+ return;
326615
+ }
325906
326616
  const annotationEl = target?.closest?.(buildAnnotationSelector());
325907
326617
  const isDraggableAnnotation = target?.closest?.(DRAGGABLE_SELECTOR) != null;
325908
326618
  const isNativeDragSource = target?.closest?.(DRAG_SOURCE_SELECTOR) != null;
@@ -326241,6 +326951,10 @@ menclose::after {
326241
326951
  event
326242
326952
  });
326243
326953
  this.#suppressFocusInFromDraggable = false;
326954
+ const pendingTocLink = this.#pendingTocLinkNav;
326955
+ this.#pendingTocLinkNav = null;
326956
+ if (pendingTocLink && !this.#dragThresholdExceeded)
326957
+ this.#handleLinkClick(event, pendingTocLink);
326244
326958
  if (!this.#isDragging) {
326245
326959
  this.#stopAutoScroll();
326246
326960
  return;
@@ -330265,6 +330979,17 @@ menclose::after {
330265
330979
  const declaredRows = buildFontReport(declared.filter((family2) => family2 && !usedFamilies.has(family2.toLowerCase())), registry2, resolver2);
330266
330980
  return [...faceRows, ...declaredRows];
330267
330981
  }
330982
+ getDocumentFontOptions() {
330983
+ try {
330984
+ const usedFaces = this.#getUsedFaces?.() ?? [];
330985
+ if (!usedFaces.length)
330986
+ return [];
330987
+ const { registry: registry2 } = this.#resolveContext();
330988
+ return buildDocumentFontOptions(usedFaces, registry2, this.#fontResolver ?? undefined);
330989
+ } catch {
330990
+ return [];
330991
+ }
330992
+ }
330268
330993
  async ensureReadyForMeasure() {
330269
330994
  if (this.#getRequiredFaces)
330270
330995
  return this.#ensureFacesReady(this.#getRequiredFaces);
@@ -330704,13 +331429,13 @@ menclose::after {
330704
331429
  return;
330705
331430
  console.log(...args$1);
330706
331431
  }, 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(() => {
331432
+ var init_src_BXck1nRd_es = __esm(() => {
330708
331433
  init_rolldown_runtime_Bg48TavK_es();
330709
- init_SuperConverter_C6RGktKO_es();
331434
+ init_SuperConverter_BSDZ3hYr_es();
330710
331435
  init_jszip_C49i9kUs_es();
330711
331436
  init_xml_js_CqGKpaft_es();
330712
331437
  init_uuid_B2wVPhPi_es();
330713
- init_create_headless_toolbar_D7rUpTS1_es();
331438
+ init_create_headless_toolbar_CKZ579SH_es();
330714
331439
  init_constants_D9qj59G2_es();
330715
331440
  init_dist_B8HfvhaK_es();
330716
331441
  init_unified_Dsuw2be5_es();
@@ -349640,6 +350365,8 @@ function print() { __p += __j.call(arguments, '') }
349640
350365
  TABLE_FRAGMENT: "superdoc-table-fragment",
349641
350366
  DOCUMENT_SECTION: "superdoc-document-section",
349642
350367
  SDT_GROUP_HOVER: "sdt-group-hover",
350368
+ TOC_ENTRY: "superdoc-toc-entry",
350369
+ TOC_GROUP_HOVER: "toc-group-hover",
349643
350370
  IMAGE_FRAGMENT: "superdoc-image-fragment",
349644
350371
  INLINE_IMAGE: "superdoc-inline-image",
349645
350372
  LIST_MARKER: "superdoc-list-marker",
@@ -351420,7 +352147,7 @@ function print() { __p += __j.call(arguments, '') }
351420
352147
  };
351421
352148
  }
351422
352149
  }, [["__scopeId", "data-v-d25821a5"]]);
351423
- TOOLBAR_FONTS = getDefaultFontOfferings().map((offering) => ({
352150
+ TOOLBAR_FONTS = getBuiltInToolbarFontOfferings().map((offering) => ({
351424
352151
  label: offering.logicalFamily,
351425
352152
  key: fontOfferingStack(offering),
351426
352153
  fontWeight: 400,
@@ -351953,7 +352680,8 @@ function print() { __p += __j.call(arguments, '') }
351953
352680
  const menuRef = exports_vue.ref(null);
351954
352681
  const menuPosition = exports_vue.ref({
351955
352682
  top: "0px",
351956
- left: "0px"
352683
+ left: "0px",
352684
+ maxHeight: "none"
351957
352685
  });
351958
352686
  const optionRefs = exports_vue.ref([]);
351959
352687
  const keyboardIndex = exports_vue.ref(-1);
@@ -351990,6 +352718,7 @@ function print() { __p += __j.call(arguments, '') }
351990
352718
  position: "fixed",
351991
352719
  top: menuPosition.value.top,
351992
352720
  left: menuPosition.value.left,
352721
+ maxHeight: menuPosition.value.maxHeight,
351993
352722
  zIndex: 2000
351994
352723
  };
351995
352724
  });
@@ -352005,17 +352734,30 @@ function print() { __p += __j.call(arguments, '') }
352005
352734
  if (!triggerRef.value)
352006
352735
  return;
352007
352736
  const rect = triggerRef.value.getBoundingClientRect();
352008
- const menuWidth = menuRef.value?.offsetWidth ?? 0;
352737
+ const menuEl = menuRef.value;
352738
+ const menuWidth = menuEl?.offsetWidth ?? 0;
352739
+ const menuHeight = menuEl?.scrollHeight ?? menuEl?.offsetHeight ?? 0;
352009
352740
  const viewportWidth = window.innerWidth || document.documentElement.clientWidth || 0;
352741
+ const viewportHeight = window.innerHeight || document.documentElement.clientHeight || 0;
352010
352742
  const gutter = 8;
352743
+ const gap = 4;
352744
+ const belowTop = rect.bottom + gap;
352745
+ const aboveBottom = rect.top - gap;
352746
+ const availableBelow = Math.max(0, viewportHeight - belowTop - gutter);
352747
+ const availableAbove = Math.max(0, aboveBottom - gutter);
352748
+ const openAbove = availableBelow < menuHeight && availableAbove > availableBelow;
352749
+ const maxHeight = openAbove ? availableAbove : availableBelow;
352750
+ const menuRenderHeight = menuHeight ? Math.min(menuHeight, maxHeight) : maxHeight;
352751
+ const top$1 = openAbove ? Math.max(gutter, aboveBottom - menuRenderHeight) : belowTop;
352011
352752
  let left$1 = rect.left;
352012
352753
  if (props.placement === "bottom-end")
352013
352754
  left$1 = rect.right - menuWidth;
352014
352755
  const maxLeft = Math.max(gutter, viewportWidth - menuWidth - gutter);
352015
352756
  left$1 = Math.min(Math.max(gutter, left$1), maxLeft);
352016
352757
  menuPosition.value = {
352017
- top: `${rect.bottom + 4}px`,
352018
- left: `${left$1}px`
352758
+ top: `${top$1}px`,
352759
+ left: `${left$1}px`,
352760
+ maxHeight: `${maxHeight}px`
352019
352761
  };
352020
352762
  };
352021
352763
  const onTriggerClick = () => {
@@ -352081,8 +352823,13 @@ function print() { __p += __j.call(arguments, '') }
352081
352823
  el.setAttribute("tabindex", index2 === keyboardIndex.value ? "0" : "-1");
352082
352824
  });
352083
352825
  const target = optionRefs.value[keyboardIndex.value];
352084
- if (target && typeof target.focus === "function")
352826
+ if (target && typeof target.focus === "function") {
352085
352827
  target.focus();
352828
+ target.scrollIntoView?.({
352829
+ block: "nearest",
352830
+ inline: "nearest"
352831
+ });
352832
+ }
352086
352833
  };
352087
352834
  const moveKeyboardIndex = (direction) => {
352088
352835
  const navigableIndexes = getNavigableIndexes();
@@ -352217,6 +352964,7 @@ function print() { __p += __j.call(arguments, '') }
352217
352964
  if (hasRenderOptions.value)
352218
352965
  return;
352219
352966
  keyboardIndex.value = getInitialKeyboardIndex();
352967
+ await exports_vue.nextTick();
352220
352968
  focusKeyboardIndex();
352221
352969
  }, { immediate: true });
352222
352970
  exports_vue.watch(isOpen, (open2) => {
@@ -352280,7 +353028,7 @@ function print() { __p += __j.call(arguments, '') }
352280
353028
  })]))]);
352281
353029
  };
352282
353030
  }
352283
- }, [["__scopeId", "data-v-302f7d86"]]);
353031
+ }, [["__scopeId", "data-v-69732782"]]);
352284
353032
  SdTooltip_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
352285
353033
  __name: "SdTooltip",
352286
353034
  props: {
@@ -352930,16 +353678,21 @@ function print() { __p += __j.call(arguments, '') }
352930
353678
  toolbarKey.value += 1;
352931
353679
  };
352932
353680
  const onResizeThrottled = throttle(onWindowResized, 300);
352933
- function teardownWindowListeners() {
353681
+ const onToolbarItemsChanged = () => {
353682
+ toolbarKey.value += 1;
353683
+ };
353684
+ function teardownListeners() {
352934
353685
  window.removeEventListener("resize", onResizeThrottled);
352935
353686
  window.removeEventListener("keydown", onKeyDown);
353687
+ proxy.$toolbar.off?.("toolbar-items-changed", onToolbarItemsChanged);
352936
353688
  containerResizeObserver?.disconnect();
352937
353689
  containerResizeObserver = null;
352938
353690
  }
352939
- function setupWindowListeners() {
352940
- teardownWindowListeners();
353691
+ function setupListeners() {
353692
+ teardownListeners();
352941
353693
  window.addEventListener("resize", onResizeThrottled);
352942
353694
  window.addEventListener("keydown", onKeyDown);
353695
+ proxy.$toolbar.on?.("toolbar-items-changed", onToolbarItemsChanged);
352943
353696
  if (typeof ResizeObserver !== "undefined" && proxy.$toolbar.config?.responsiveToContainer && proxy.$toolbar.toolbarContainer) {
352944
353697
  containerResizeObserver = new ResizeObserver(() => {
352945
353698
  onResizeThrottled();
@@ -352948,10 +353701,10 @@ function print() { __p += __j.call(arguments, '') }
352948
353701
  }
352949
353702
  updateCompactSideGroups();
352950
353703
  }
352951
- exports_vue.onMounted(setupWindowListeners);
352952
- exports_vue.onActivated(setupWindowListeners);
352953
- exports_vue.onDeactivated(teardownWindowListeners);
352954
- exports_vue.onBeforeUnmount(teardownWindowListeners);
353704
+ exports_vue.onMounted(setupListeners);
353705
+ exports_vue.onActivated(setupListeners);
353706
+ exports_vue.onDeactivated(teardownListeners);
353707
+ exports_vue.onBeforeUnmount(teardownListeners);
352955
353708
  const handleCommand = ({ item, argument, option }) => {
352956
353709
  proxy.$toolbar.emitCommand({
352957
353710
  item,
@@ -353030,7 +353783,7 @@ function print() { __p += __j.call(arguments, '') }
353030
353783
  ], 32);
353031
353784
  };
353032
353785
  }
353033
- }, [["__scopeId", "data-v-b83d488a"]]);
353786
+ }, [["__scopeId", "data-v-938eaa1b"]]);
353034
353787
  toolbarTexts = {
353035
353788
  bold: "Bold",
353036
353789
  fontFamily: "Font",
@@ -353161,8 +353914,10 @@ function print() { __p += __j.call(arguments, '') }
353161
353914
  this._boundEditorHandlers = {
353162
353915
  transaction: null,
353163
353916
  selectionUpdate: null,
353164
- focus: null
353917
+ focus: null,
353918
+ fontsChanged: null
353165
353919
  };
353920
+ this._lastFontOptionsSignature = "";
353166
353921
  this._restoreFocusTimeoutId = null;
353167
353922
  if (!this.config.selector && this.config.element)
353168
353923
  this.config.selector = this.config.element;
@@ -353221,24 +353976,40 @@ function print() { __p += __j.call(arguments, '') }
353221
353976
  if (this.config.groups && !Array.isArray(this.config.groups) && Object.keys(this.config.groups).length)
353222
353977
  this.config.toolbarGroups = Object.keys(this.config.groups);
353223
353978
  }
353979
+ #detachActiveEditorListeners() {
353980
+ if (!this.activeEditor || !this._boundEditorHandlers.transaction)
353981
+ return;
353982
+ this.activeEditor.off("transaction", this._boundEditorHandlers.transaction);
353983
+ this.activeEditor.off("selectionUpdate", this._boundEditorHandlers.selectionUpdate);
353984
+ this.activeEditor.off("focus", this._boundEditorHandlers.focus);
353985
+ this.activeEditor.off("fonts-changed", this._boundEditorHandlers.fontsChanged);
353986
+ this._boundEditorHandlers.transaction = null;
353987
+ this._boundEditorHandlers.selectionUpdate = null;
353988
+ this._boundEditorHandlers.focus = null;
353989
+ this._boundEditorHandlers.fontsChanged = null;
353990
+ }
353224
353991
  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;
353992
+ const sameEditor = editor === this.activeEditor;
353993
+ const alreadyListening = Boolean(this._boundEditorHandlers.transaction);
353994
+ if (sameEditor && (!editor || alreadyListening)) {
353995
+ this.updateToolbarState();
353996
+ return;
353232
353997
  }
353998
+ this.#detachActiveEditorListeners();
353233
353999
  this.activeEditor = editor;
353234
354000
  if (editor) {
353235
354001
  this._boundEditorHandlers.transaction = this.onEditorTransaction.bind(this);
353236
354002
  this._boundEditorHandlers.selectionUpdate = this.onEditorSelectionUpdate.bind(this);
353237
354003
  this._boundEditorHandlers.focus = this.onEditorFocus.bind(this);
354004
+ this._boundEditorHandlers.fontsChanged = this.onEditorFontsChanged.bind(this);
353238
354005
  this.activeEditor.on("transaction", this._boundEditorHandlers.transaction);
353239
354006
  this.activeEditor.on("selectionUpdate", this._boundEditorHandlers.selectionUpdate);
353240
354007
  this.activeEditor.on("focus", this._boundEditorHandlers.focus);
354008
+ this.activeEditor.on("fonts-changed", this._boundEditorHandlers.fontsChanged);
353241
354009
  }
354010
+ this.#rebuildToolbarItems();
354011
+ this._lastFontOptionsSignature = this.#fontOptionsSignature();
354012
+ this.updateToolbarState();
353242
354013
  }
353243
354014
  getToolbarItemByGroup(groupName) {
353244
354015
  return this.toolbarItems.filter((item) => (item.group?.value || "center") === groupName);
@@ -353255,13 +354026,14 @@ function print() { __p += __j.call(arguments, '') }
353255
354026
  return this.config.responsiveToContainer ? containerWidth : documentWidth;
353256
354027
  }
353257
354028
  #makeToolbarItems({ superToolbar, icons: icons$1, texts, fonts, hideButtons, isDev = false } = {}) {
354029
+ const availableWidth = this.getAvailableWidth();
353258
354030
  const { defaultItems, overflowItems } = makeDefaultItems({
353259
354031
  superToolbar,
353260
354032
  toolbarIcons: icons$1,
353261
354033
  toolbarTexts: texts,
353262
- toolbarFonts: fonts,
354034
+ toolbarFonts: this.#resolveToolbarFonts(fonts),
353263
354035
  hideButtons,
353264
- availableWidth: this.getAvailableWidth(),
354036
+ availableWidth,
353265
354037
  role: this.role,
353266
354038
  isDev
353267
354039
  });
@@ -353274,6 +354046,26 @@ function print() { __p += __j.call(arguments, '') }
353274
354046
  this.toolbarItems = defaultItems.filter((item) => allConfigItems.includes(item.name.value)).filter((item) => !this.config.excludeItems.includes(item.name.value));
353275
354047
  this.overflowItems = overflowItems.filter((item) => allConfigItems.includes(item.name.value));
353276
354048
  }
354049
+ #resolveToolbarFonts(configFonts) {
354050
+ return composeToolbarFontOptions(this.superdoc?.fonts?.getDocumentFontOptions?.() ?? [], configFonts);
354051
+ }
354052
+ #rebuildToolbarItems() {
354053
+ this.#makeToolbarItems({
354054
+ superToolbar: this,
354055
+ icons: this.config.icons,
354056
+ texts: this.config.texts,
354057
+ fonts: this.config.fonts,
354058
+ hideButtons: this.config.hideButtons,
354059
+ isDev: this.isDev
354060
+ });
354061
+ this.emit("toolbar-items-changed");
354062
+ }
354063
+ #fontOptionsSignature() {
354064
+ if (this.config.fonts)
354065
+ return "custom-fonts";
354066
+ const options = this.superdoc?.fonts?.getDocumentFontOptions?.() ?? [];
354067
+ return JSON.stringify(options.map((option) => [option.logicalFamily, option.previewFamily]));
354068
+ }
353277
354069
  #initDefaultFonts() {
353278
354070
  if (!this.activeEditor || !this.activeEditor.converter)
353279
354071
  return;
@@ -353645,6 +354437,14 @@ function print() { __p += __j.call(arguments, '') }
353645
354437
  if (this.#restoreStickyMarksIfNeeded())
353646
354438
  this.updateToolbarState();
353647
354439
  }
354440
+ onEditorFontsChanged() {
354441
+ const signature = this.#fontOptionsSignature();
354442
+ if (signature !== this._lastFontOptionsSignature) {
354443
+ this._lastFontOptionsSignature = signature;
354444
+ this.#rebuildToolbarItems();
354445
+ }
354446
+ this.updateToolbarState();
354447
+ }
353648
354448
  onEditorFocus() {
353649
354449
  if (this.pendingMarkCommands.length) {
353650
354450
  this.onEditorSelectionUpdate();
@@ -353711,6 +354511,7 @@ function print() { __p += __j.call(arguments, '') }
353711
354511
  clearTimeout(this._restoreFocusTimeoutId);
353712
354512
  this._restoreFocusTimeoutId = null;
353713
354513
  }
354514
+ this.#detachActiveEditorListeners();
353714
354515
  this.destroyHeadlessToolbar();
353715
354516
  this.app?.unmount();
353716
354517
  }
@@ -357087,6 +357888,7 @@ function print() { __p += __j.call(arguments, '') }
357087
357888
  editor: this
357088
357889
  });
357089
357890
  console.error(err);
357891
+ throw err;
357090
357892
  }
357091
357893
  }
357092
357894
  #endCollaboration() {
@@ -359090,7 +359892,8 @@ function print() { __p += __j.call(arguments, '') }
359090
359892
  #lastSelectedFieldAnnotation = null;
359091
359893
  #lastSelectedStructuredContentBlock = null;
359092
359894
  #lastSelectedStructuredContentInline = null;
359093
- #lastHoveredStructuredContentBlock = null;
359895
+ #sdtHoverCoordinator = null;
359896
+ #tocHoverCoordinator = null;
359094
359897
  #remoteCursorManager = null;
359095
359898
  #cursorUpdateTimer = null;
359096
359899
  #remoteCursorOverlay = null;
@@ -359161,8 +359964,11 @@ function print() { __p += __j.call(arguments, '') }
359161
359964
  ensureEditorNativeSelectionStyles(doc$12);
359162
359965
  ensureEditorFieldAnnotationInteractionStyles(doc$12);
359163
359966
  ensureEditorMovableObjectInteractionStyles(doc$12);
359164
- this.#painterHost.addEventListener("mouseover", this.#handleStructuredContentBlockMouseEnter);
359165
- this.#painterHost.addEventListener("mouseout", this.#handleStructuredContentBlockMouseLeave);
359967
+ this.#initializeHoverCoordinators();
359968
+ this.#painterHost.addEventListener("mouseover", this.#sdtHoverCoordinator.handleMouseEnter);
359969
+ this.#painterHost.addEventListener("mouseout", this.#sdtHoverCoordinator.handleMouseLeave);
359970
+ this.#painterHost.addEventListener("mouseover", this.#tocHoverCoordinator.handleMouseEnter);
359971
+ this.#painterHost.addEventListener("mouseout", this.#tocHoverCoordinator.handleMouseLeave);
359166
359972
  this.#domIndexObserverManager = new DomPositionIndexObserverManager({
359167
359973
  windowRoot: this.#visibleHost?.ownerDocument?.defaultView ?? window,
359168
359974
  getPainterHost: () => this.#painterHost,
@@ -360330,6 +361136,9 @@ function print() { __p += __j.call(arguments, '') }
360330
361136
  getFontReport() {
360331
361137
  return this.#fontGate?.getReport() ?? [];
360332
361138
  }
361139
+ getDocumentFontOptions() {
361140
+ return this.#fontGate?.getDocumentFontOptions() ?? [];
361141
+ }
360333
361142
  getMissingFonts() {
360334
361143
  return [...new Set(this.getFontReport().filter((record) => record.missing).map((record) => record.logicalFamily))];
360335
361144
  }
@@ -363150,74 +363959,50 @@ function print() { __p += __j.call(arguments, '') }
363150
363959
  }
363151
363960
  this.#setSelectedStructuredContentBlockClass(elements, id2);
363152
363961
  }
363153
- #handleStructuredContentBlockMouseEnter = (event) => {
363154
- const block = event.target.closest(`.${DOM_CLASS_NAMES.BLOCK_SDT}`);
363155
- if (!block || !(block instanceof HTMLElement))
363962
+ #initializeHoverCoordinators() {
363963
+ if (this.#sdtHoverCoordinator || this.#tocHoverCoordinator)
363156
363964
  return;
363157
- if (block.classList.contains("ProseMirror-selectednode"))
363158
- 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)
363965
+ this.#sdtHoverCoordinator = new HoverGroupCoordinator({
363966
+ entrySelector: `.${DOM_CLASS_NAMES.BLOCK_SDT}`,
363967
+ getId: (entry) => entry.dataset.sdtId,
363968
+ queryGroup: (id2) => this.#painterAdapter.getStructuredContentBlockElementsById(id2),
363969
+ hoverClass: DOM_CLASS_NAMES.SDT_GROUP_HOVER,
363970
+ shouldApplyTo: (element3) => !element3.classList.contains("ProseMirror-selectednode")
363971
+ });
363972
+ this.#tocHoverCoordinator = new HoverGroupCoordinator({
363973
+ entrySelector: `.${DOM_CLASS_NAMES.TOC_ENTRY}`,
363974
+ getId: (entry) => entry.dataset.tocId,
363975
+ queryGroup: (id2) => this.#queryTocEntryElementsById(id2),
363976
+ hoverClass: DOM_CLASS_NAMES.TOC_GROUP_HOVER,
363977
+ onApply: (elements) => this.#applyTocGapFill(elements),
363978
+ onClear: (element3) => element3.style.removeProperty("--toc-gap-below")
363979
+ });
363980
+ }
363981
+ #applyTocGapFill(elements) {
363982
+ if (elements.length < 2)
363167
363983
  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;
363984
+ const measured = elements.map((element3) => ({
363985
+ element: element3,
363986
+ rect: element3.getBoundingClientRect()
363987
+ })).sort((a2, b$1) => a2.rect.top - b$1.rect.top);
363988
+ for (let i4 = 0;i4 < measured.length - 1; i4++) {
363989
+ const current = measured[i4];
363990
+ const next2 = measured[i4 + 1];
363991
+ const currentPage = current.element.closest("[data-page-index]");
363992
+ if (!currentPage || currentPage !== next2.element.closest("[data-page-index]"))
363993
+ continue;
363994
+ const rawGap = next2.rect.top - current.rect.bottom;
363995
+ const scaleY = current.rect.height && current.element.offsetHeight ? current.rect.height / current.element.offsetHeight : 1;
363996
+ const gap = scaleY > 0 ? rawGap / scaleY : rawGap;
363997
+ if (gap > 0)
363998
+ current.element.style.setProperty("--toc-gap-below", `${gap + 1}px`);
363173
363999
  }
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
364000
  }
363184
- #setHoveredStructuredContentBlockClass(id2) {
363185
- if (this.#lastHoveredStructuredContentBlock?.id === id2)
363186
- return;
363187
- this.#clearHoveredStructuredContentBlockClass();
364001
+ #queryTocEntryElementsById(id2) {
363188
364002
  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
- };
364003
+ return [];
364004
+ const escapedId = escapeAttrValue(id2);
364005
+ return Array.from(this.#painterHost.querySelectorAll(`.${DOM_CLASS_NAMES.TOC_ENTRY}[data-toc-id="${escapedId}"]`));
363221
364006
  }
363222
364007
  #refreshEditorDomAugmentations() {
363223
364008
  this.#postPaintPipeline.refreshAfterPaint({
@@ -363226,7 +364011,8 @@ function print() { __p += __j.call(arguments, '') }
363226
364011
  domPositionIndex: this.#domPositionIndex,
363227
364012
  proofingAnnotations: this.#buildProofingAnnotations(),
363228
364013
  rebuildDomPositionIndex: () => this.#rebuildDomPositionIndex(),
363229
- reapplyStructuredContentHover: () => this.#reapplySdtGroupHover()
364014
+ reapplyStructuredContentHover: () => this.#sdtHoverCoordinator?.reapply(),
364015
+ reapplyTocGroupHover: () => this.#tocHoverCoordinator?.reapply()
363230
364016
  });
363231
364017
  }
363232
364018
  #clearSelectedStructuredContentInlineClass() {
@@ -365614,11 +366400,11 @@ function print() { __p += __j.call(arguments, '') }
365614
366400
  ]);
365615
366401
  });
365616
366402
 
365617
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-BT9gcxxx.es.js
366403
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui---bNCP-9.es.js
365618
366404
  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();
366405
+ var init_create_super_doc_ui_bNCP_9_es = __esm(() => {
366406
+ init_SuperConverter_BSDZ3hYr_es();
366407
+ init_create_headless_toolbar_CKZ579SH_es();
365622
366408
  headlessToolbarConstants = {
365623
366409
  DEFAULT_TEXT_ALIGN_OPTIONS: [
365624
366410
  {
@@ -365900,16 +366686,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
365900
366686
 
365901
366687
  // ../../packages/superdoc/dist/super-editor.es.js
365902
366688
  var init_super_editor_es = __esm(() => {
365903
- init_src_D29bOSuq_es();
365904
- init_SuperConverter_C6RGktKO_es();
366689
+ init_src_BXck1nRd_es();
366690
+ init_SuperConverter_BSDZ3hYr_es();
365905
366691
  init_jszip_C49i9kUs_es();
365906
366692
  init_xml_js_CqGKpaft_es();
365907
- init_create_headless_toolbar_D7rUpTS1_es();
366693
+ init_create_headless_toolbar_CKZ579SH_es();
365908
366694
  init_constants_D9qj59G2_es();
365909
366695
  init_dist_B8HfvhaK_es();
365910
366696
  init_unified_Dsuw2be5_es();
365911
366697
  init_DocxZipper_FUsfThjV_es();
365912
- init_create_super_doc_ui_BT9gcxxx_es();
366698
+ init_create_super_doc_ui_bNCP_9_es();
365913
366699
  init_ui_C5PAS9hY_es();
365914
366700
  init_eventemitter3_BnGqBE_Q_es();
365915
366701
  init_errors_CNaD6vcg_es();