@superdoc-dev/mcp 0.12.0-next.30 → 0.12.0-next.32

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 +472 -164
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -52172,7 +52172,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
52172
52172
  emptyOptions2 = {};
52173
52173
  });
52174
52174
 
52175
- // ../../packages/superdoc/dist/chunks/SuperConverter-DAuqlmYY.es.js
52175
+ // ../../packages/superdoc/dist/chunks/SuperConverter-C3uAnS0b.es.js
52176
52176
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
52177
52177
  const fieldValue = extension$1.config[field];
52178
52178
  if (typeof fieldValue === "function")
@@ -52736,7 +52736,7 @@ function wsOptionsFor(type, preserveWhitespace, base$1) {
52736
52736
  return (preserveWhitespace ? OPT_PRESERVE_WS : 0) | (preserveWhitespace === "full" ? OPT_PRESERVE_WS_FULL : 0);
52737
52737
  return type && type.whitespace == "pre" ? OPT_PRESERVE_WS | OPT_PRESERVE_WS_FULL : base$1 & ~OPT_OPEN_LEFT;
52738
52738
  }
52739
- function normalizeList(dom) {
52739
+ function normalizeList$1(dom) {
52740
52740
  for (let child = dom.firstChild, prevItem = null;child; child = child.nextSibling) {
52741
52741
  let name = child.nodeType == 1 ? child.nodeName.toLowerCase() : null;
52742
52742
  if (name && listTags.hasOwnProperty(name) && prevItem) {
@@ -75124,13 +75124,23 @@ function findOrCreateRelationship(editor, source, options) {
75124
75124
  function maybeAddProtocol(text$2) {
75125
75125
  return /^www\./i.test(text$2) ? `https://${text$2}` : text$2;
75126
75126
  }
75127
+ function hasExplicitUrlIntent(text$2) {
75128
+ if (/^www\./i.test(text$2))
75129
+ return true;
75130
+ if (/^(mailto|tel|sms):/i.test(text$2))
75131
+ return true;
75132
+ return /^https?:\/\//i.test(text$2);
75133
+ }
75127
75134
  function detectPasteUrl(text$2, protocols = []) {
75128
75135
  const trimmed = text$2?.trim();
75129
75136
  if (!trimmed)
75130
75137
  return null;
75131
75138
  if (/\s/.test(trimmed))
75132
75139
  return null;
75133
- const result = sanitizeHref(maybeAddProtocol(trimmed), { allowedProtocols: buildAllowedProtocols2(protocols) });
75140
+ const allowedProtocols = buildAllowedProtocols2(protocols);
75141
+ if (!hasExplicitUrlIntent(trimmed))
75142
+ return null;
75143
+ const result = sanitizeHref(maybeAddProtocol(trimmed), { allowedProtocols });
75134
75144
  return result ? { href: result.href } : null;
75135
75145
  }
75136
75146
  function canAllocateRels(editor) {
@@ -87043,7 +87053,110 @@ function familyWithFaces(name, license, faces) {
87043
87053
  faces
87044
87054
  };
87045
87055
  }
87046
- function normalizeFamilyKey$1(family$1) {
87056
+ function isBundledPackPresent() {
87057
+ return bundledPackPresent;
87058
+ }
87059
+ function withTrailingSlash(base$1) {
87060
+ return base$1.endsWith("/") ? base$1 : `${base$1}/`;
87061
+ }
87062
+ function joinUrl(base$1, file2) {
87063
+ return `${withTrailingSlash(base$1)}${file2}`;
87064
+ }
87065
+ function weightToken(weight) {
87066
+ return weight === "bold" ? "700" : "400";
87067
+ }
87068
+ function bundledAssetSignature(resolve) {
87069
+ const family$1 = BUNDLED_MANIFEST[0];
87070
+ const face = family$1?.faces[0];
87071
+ if (!family$1 || !face)
87072
+ return "";
87073
+ return resolve({
87074
+ file: face.file,
87075
+ family: family$1.family,
87076
+ weight: weightToken(face.weight),
87077
+ style: face.style,
87078
+ source: "bundled-substitute"
87079
+ });
87080
+ }
87081
+ function installBundledSubstitutes(registry2, options = {}) {
87082
+ const baseResolve = (context) => joinUrl(options.assetBaseUrl ?? defaultAssetBase, context.file);
87083
+ const candidate = options.resolveAssetUrl;
87084
+ const resolve = typeof candidate === "function" ? candidate : baseResolve;
87085
+ const signature = bundledAssetSignature(resolve);
87086
+ const installed = installedRegistries.get(registry2);
87087
+ if (installed !== undefined) {
87088
+ if (installed !== signature)
87089
+ console.warn(`[superdoc] bundled fonts are already registered for this document from "${installed}"; a later fonts config resolving to "${signature}" is ignored. Use one fonts.assetBaseUrl / fonts.resolveAssetUrl per document.`);
87090
+ return;
87091
+ }
87092
+ installedRegistries.set(registry2, signature);
87093
+ if (candidate != null && typeof candidate !== "function")
87094
+ console.warn("[superdoc] fonts.resolveAssetUrl must be a function (context) => string; ignoring it and falling back to fonts.assetBaseUrl. Prefer @superdoc-dev/fonts, which wires it correctly.");
87095
+ for (const family$1 of BUNDLED_MANIFEST)
87096
+ for (const face of family$1.faces) {
87097
+ const context = {
87098
+ file: face.file,
87099
+ family: family$1.family,
87100
+ weight: weightToken(face.weight),
87101
+ style: face.style,
87102
+ source: "bundled-substitute"
87103
+ };
87104
+ registry2.register({
87105
+ family: family$1.family,
87106
+ source: `url(${resolve(context)})`,
87107
+ descriptors: {
87108
+ weight: face.weight,
87109
+ style: face.style
87110
+ }
87111
+ });
87112
+ }
87113
+ }
87114
+ function normalizeKey$1(family$1) {
87115
+ return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
87116
+ }
87117
+ function normalizeList(families) {
87118
+ if (!Array.isArray(families))
87119
+ return;
87120
+ const out = [...new Set(families.filter((f2) => typeof f2 === "string").map(normalizeKey$1).filter(Boolean))].sort();
87121
+ return out.length > 0 ? out : undefined;
87122
+ }
87123
+ function createBundledActivation(input) {
87124
+ if (!input.packConfigured)
87125
+ return BASELINE_BUNDLED;
87126
+ const includeProvided = input.include != null;
87127
+ const include = normalizeList(input.include);
87128
+ const exclude = includeProvided ? undefined : normalizeList(input.exclude);
87129
+ if (!include && !exclude)
87130
+ return FULLY_ACTIVE_BUNDLED;
87131
+ if (include) {
87132
+ const set$1 = new Set(include);
87133
+ return Object.freeze({
87134
+ packConfigured: true,
87135
+ isActive: (family$1) => set$1.has(normalizeKey$1(family$1)),
87136
+ signature: JSON.stringify({
87137
+ p: true,
87138
+ i: include
87139
+ })
87140
+ });
87141
+ }
87142
+ const set3 = new Set(exclude);
87143
+ return Object.freeze({
87144
+ packConfigured: true,
87145
+ isActive: (family$1) => !set3.has(normalizeKey$1(family$1)),
87146
+ signature: JSON.stringify({
87147
+ p: true,
87148
+ x: exclude
87149
+ })
87150
+ });
87151
+ }
87152
+ function deriveBundledActivation(config$43) {
87153
+ return createBundledActivation({
87154
+ packConfigured: !!(config$43?.resolveAssetUrl || config$43?.assetBaseUrl) || isBundledPackPresent(),
87155
+ include: config$43?.bundled?.include,
87156
+ exclude: config$43?.bundled?.exclude
87157
+ });
87158
+ }
87159
+ function normalizeFamilyKey$2(family$1) {
87047
87160
  return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
87048
87161
  }
87049
87162
  function sortPairs(pairs) {
@@ -87122,7 +87235,7 @@ function deriveBundledSubstitutes() {
87122
87235
  for (const row of SUBSTITUTION_EVIDENCE) {
87123
87236
  const fallback = getRenderableFallback(row.logicalFamily, { canRenderFamily });
87124
87237
  if (fallback?.policyAction === "substitute")
87125
- substitutes[normalizeFamilyKey$1(row.logicalFamily)] = fallback.substituteFamily;
87238
+ substitutes[normalizeFamilyKey$2(row.logicalFamily)] = fallback.substituteFamily;
87126
87239
  }
87127
87240
  return Object.freeze(substitutes);
87128
87241
  }
@@ -87131,7 +87244,7 @@ function deriveCategoryFallbacks() {
87131
87244
  for (const row of SUBSTITUTION_EVIDENCE) {
87132
87245
  const fallback = getRenderableFallback(row.logicalFamily, { canRenderFamily });
87133
87246
  if (fallback?.policyAction === "category_fallback")
87134
- fallbacks[normalizeFamilyKey$1(row.logicalFamily)] = fallback.substituteFamily;
87247
+ fallbacks[normalizeFamilyKey$2(row.logicalFamily)] = fallback.substituteFamily;
87135
87248
  }
87136
87249
  return Object.freeze(fallbacks);
87137
87250
  }
@@ -87141,8 +87254,8 @@ function stripFamilyQuotes(family$1) {
87141
87254
  function splitStack(cssFontFamily) {
87142
87255
  return cssFontFamily.split(",").map((part) => part.trim()).filter(Boolean);
87143
87256
  }
87144
- function createFontResolver() {
87145
- return new FontResolver;
87257
+ function createFontResolver(activation) {
87258
+ return new FontResolver(activation);
87146
87259
  }
87147
87260
  function resolveFontFamily(logicalFamily) {
87148
87261
  return defaultResolver.resolveFontFamily(logicalFamily);
@@ -87159,57 +87272,6 @@ function getFontConfigVersion() {
87159
87272
  function bumpFontConfigVersion() {
87160
87273
  return fontConfigVersion += 1;
87161
87274
  }
87162
- function withTrailingSlash(base$1) {
87163
- return base$1.endsWith("/") ? base$1 : `${base$1}/`;
87164
- }
87165
- function joinUrl(base$1, file2) {
87166
- return `${withTrailingSlash(base$1)}${file2}`;
87167
- }
87168
- function weightToken(weight) {
87169
- return weight === "bold" ? "700" : "400";
87170
- }
87171
- function bundledAssetSignature(resolve) {
87172
- const family$1 = BUNDLED_MANIFEST[0];
87173
- const face = family$1?.faces[0];
87174
- if (!family$1 || !face)
87175
- return "";
87176
- return resolve({
87177
- file: face.file,
87178
- family: family$1.family,
87179
- weight: weightToken(face.weight),
87180
- style: face.style,
87181
- source: "bundled-substitute"
87182
- });
87183
- }
87184
- function installBundledSubstitutes(registry2, options = {}) {
87185
- const resolve = options.resolveAssetUrl ?? ((context) => joinUrl(options.assetBaseUrl ?? defaultAssetBase, context.file));
87186
- const signature = bundledAssetSignature(resolve);
87187
- const installed = installedRegistries.get(registry2);
87188
- if (installed !== undefined) {
87189
- if (installed !== signature)
87190
- console.warn(`[superdoc] bundled fonts are already registered for this document from "${installed}"; a later fonts config resolving to "${signature}" is ignored. Use one fonts.assetBaseUrl / fonts.resolveAssetUrl per document.`);
87191
- return;
87192
- }
87193
- installedRegistries.set(registry2, signature);
87194
- for (const family$1 of BUNDLED_MANIFEST)
87195
- for (const face of family$1.faces) {
87196
- const context = {
87197
- file: face.file,
87198
- family: family$1.family,
87199
- weight: weightToken(face.weight),
87200
- style: face.style,
87201
- source: "bundled-substitute"
87202
- };
87203
- registry2.register({
87204
- family: family$1.family,
87205
- source: `url(${resolve(context)})`,
87206
- descriptors: {
87207
- weight: face.weight,
87208
- style: face.style
87209
- }
87210
- });
87211
- }
87212
- }
87213
87275
  function toEvidence(fallback) {
87214
87276
  if (!fallback)
87215
87277
  return;
@@ -87322,7 +87384,7 @@ function canonicalizeFontSource(source) {
87322
87384
  inner = inner.slice(1, -1);
87323
87385
  return `url(${JSON.stringify(inner)})`;
87324
87386
  }
87325
- function normalizeFamilyKey(family$1) {
87387
+ function normalizeFamilyKey$1(family$1) {
87326
87388
  return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
87327
87389
  }
87328
87390
  function normalizeWeight(weight) {
@@ -87341,7 +87403,7 @@ function normalizeStyle(style) {
87341
87403
  return s.startsWith("italic") || s.startsWith("oblique") ? "italic" : "normal";
87342
87404
  }
87343
87405
  function faceKeyOf(family$1, weight, style) {
87344
- return `${normalizeFamilyKey(family$1)}|${weight}|${style}`;
87406
+ return `${normalizeFamilyKey$1(family$1)}|${weight}|${style}`;
87345
87407
  }
87346
87408
  function faceProbe(family$1, weight, style, size) {
87347
87409
  return `${style === "italic" ? "italic " : ""}${weight} ${size} ${quoteFamily(family$1)}`;
@@ -87393,8 +87455,10 @@ function deriveOfferings() {
87393
87455
  function compareLogicalFamily(a, b) {
87394
87456
  return a.logicalFamily.localeCompare(b.logicalFamily, "en", { sensitivity: "base" });
87395
87457
  }
87396
- function getBuiltInToolbarFontOfferings() {
87397
- 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);
87458
+ function getBuiltInToolbarFontOfferings(activation = BASELINE_BUNDLED) {
87459
+ if (!activation.packConfigured)
87460
+ return FONT_OFFERINGS.filter((o) => o.bundled && BUILT_IN_TOOLBAR_BASELINE_FAMILIES.has(o.logicalFamily)).sort(compareLogicalFamily);
87461
+ 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")) && activation.isActive(o.logicalFamily)).sort(compareLogicalFamily);
87398
87462
  }
87399
87463
  function fontOfferingStack(offering) {
87400
87464
  return `${offering.logicalFamily}, ${offering.generic}`;
@@ -87402,12 +87466,98 @@ function fontOfferingStack(offering) {
87402
87466
  function fontOfferingRenderStack(offering) {
87403
87467
  return offering.physicalFamily ? `${offering.physicalFamily}, ${offering.generic}` : fontOfferingStack(offering);
87404
87468
  }
87405
- function getDefaultFontFamilyOptions() {
87406
- return getBuiltInToolbarFontOfferings().map((offering) => ({
87469
+ function getDefaultFontFamilyOptions(activation = BASELINE_BUNDLED) {
87470
+ return getBuiltInToolbarFontOfferings(activation).map((offering) => ({
87407
87471
  label: offering.logicalFamily,
87408
87472
  value: fontOfferingStack(offering)
87409
87473
  }));
87410
87474
  }
87475
+ function normalizeFamilyKey(family$1) {
87476
+ return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
87477
+ }
87478
+ function editDistance(a, b) {
87479
+ const m = a.length;
87480
+ const n = b.length;
87481
+ if (Math.abs(m - n) > 2)
87482
+ return 3;
87483
+ let prev = Array.from({ length: n + 1 }, (_, i$1) => i$1);
87484
+ for (let i$1 = 1;i$1 <= m; i$1 += 1) {
87485
+ const curr = [i$1];
87486
+ for (let j = 1;j <= n; j += 1) {
87487
+ const cost = a[i$1 - 1] === b[j - 1] ? 0 : 1;
87488
+ curr[j] = Math.min(curr[j - 1] + 1, prev[j] + 1, prev[j - 1] + cost);
87489
+ }
87490
+ prev = curr;
87491
+ }
87492
+ return prev[n];
87493
+ }
87494
+ function closestBundledFamily(name) {
87495
+ const key = normalizeFamilyKey(name);
87496
+ let best = null;
87497
+ let bestDist = 3;
87498
+ for (const family$1 of BUNDLED_LOGICAL_FAMILIES) {
87499
+ const dist = editDistance(key, normalizeFamilyKey(family$1));
87500
+ if (dist < bestDist) {
87501
+ bestDist = dist;
87502
+ best = family$1;
87503
+ }
87504
+ }
87505
+ return best;
87506
+ }
87507
+ function coerceCurationList(value, field) {
87508
+ if (value == null)
87509
+ return [];
87510
+ if (!Array.isArray(value)) {
87511
+ console.warn(`[superdoc] fonts.bundled.${field} must be an array of font names; ignoring it. Prefer createSuperDocFonts(), which rejects malformed curation.`);
87512
+ return [];
87513
+ }
87514
+ return value.filter((name) => typeof name === "string");
87515
+ }
87516
+ function warnUnknownBundledSelection(selection) {
87517
+ if (!selection)
87518
+ return;
87519
+ const includeProvided = selection.include != null;
87520
+ const include = coerceCurationList(selection.include, "include");
87521
+ const exclude = coerceCurationList(selection.exclude, "exclude");
87522
+ if (includeProvided && exclude.length > 0)
87523
+ console.warn("[superdoc] fonts.bundled: set `include` OR `exclude`, not both. Using `include` (the allow-list) and ignoring `exclude`. Prefer createSuperDocFonts(), which rejects this.");
87524
+ const effective = includeProvided ? include : exclude;
87525
+ const seen = /* @__PURE__ */ new Set;
87526
+ for (const name of effective) {
87527
+ const trimmed = typeof name === "string" ? name.trim() : "";
87528
+ if (!trimmed)
87529
+ continue;
87530
+ const key = normalizeFamilyKey(trimmed);
87531
+ if (BUNDLED_LOGICAL_KEYS.has(key) || seen.has(key))
87532
+ continue;
87533
+ seen.add(key);
87534
+ const suggestion = closestBundledFamily(trimmed);
87535
+ console.warn(`[superdoc] fonts.bundled: "${trimmed}" is not a bundled font, so curating it has no effect${suggestion ? ` (did you mean "${suggestion}"?)` : ""}. Curate by Word family name, e.g. Calibri, Cambria, Times New Roman. Docs: https://docs.superdoc.dev/getting-started/fonts`);
87536
+ }
87537
+ }
87538
+ function sanitizeBundledSelection(selection) {
87539
+ if (!selection)
87540
+ return selection;
87541
+ const known = (value) => {
87542
+ if (!Array.isArray(value))
87543
+ return [];
87544
+ return value.filter((n) => typeof n === "string").filter((n) => BUNDLED_LOGICAL_KEYS.has(normalizeFamilyKey(n)));
87545
+ };
87546
+ const result = {};
87547
+ if (selection.include != null)
87548
+ result.include = known(selection.include);
87549
+ if (selection.exclude != null)
87550
+ result.exclude = known(selection.exclude);
87551
+ return result;
87552
+ }
87553
+ function deriveBundledActivationForConfig(config$43) {
87554
+ if (!config$43)
87555
+ return deriveBundledActivation(config$43);
87556
+ return deriveBundledActivation({
87557
+ ...config$43,
87558
+ bundled: sanitizeBundledSelection(config$43.bundled)
87559
+ });
87560
+ }
87411
87561
  function normalizeKey(family$1) {
87412
87562
  return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
87413
87563
  }
@@ -99213,7 +99363,7 @@ var isRegExp = (value) => {
99213
99363
  this.localPreserveWS = true;
99214
99364
  let name = dom.nodeName.toLowerCase(), ruleID;
99215
99365
  if (listTags.hasOwnProperty(name) && this.parser.normalizeLists)
99216
- normalizeList(dom);
99366
+ normalizeList$1(dom);
99217
99367
  let rule = this.options.ruleFromNode && this.options.ruleFromNode(dom) || (ruleID = this.parser.matchTag(dom, this, matchAfter));
99218
99368
  out:
99219
99369
  if (rule ? rule.ignore : ignoreTags.hasOwnProperty(name)) {
@@ -114367,19 +114517,32 @@ var isRegExp = (value) => {
114367
114517
  tags.push(`</${name}>`);
114368
114518
  return tags;
114369
114519
  }
114370
- }, SETTLED_STATUSES, SUBSTITUTION_EVIDENCE$1, LINE_BREAK_SAFE_VERDICTS, BY_LOGICAL, BUNDLED_MANIFEST, SUBSTITUTION_EVIDENCE, bundledFamilies, canRenderFamily = (family$1) => bundledFamilies.has(family$1), BUNDLED_SUBSTITUTES, CATEGORY_FALLBACKS, FontResolver = class {
114520
+ }, SETTLED_STATUSES, SUBSTITUTION_EVIDENCE$1, LINE_BREAK_SAFE_VERDICTS, BY_LOGICAL, BUNDLED_MANIFEST, defaultAssetBase = "/fonts/", bundledPackPresent = false, installedRegistries, FULLY_ACTIVE_BUNDLED, BASELINE_BUNDLED, SUBSTITUTION_EVIDENCE, bundledFamilies, canRenderFamily = (family$1) => bundledFamilies.has(family$1), BUNDLED_SUBSTITUTES, CATEGORY_FALLBACKS, FontResolver = class {
114371
114521
  #overrides = /* @__PURE__ */ new Map;
114372
114522
  #embedded = /* @__PURE__ */ new Map;
114373
114523
  #version = 0;
114374
114524
  #cachedSignature = null;
114525
+ #activation;
114526
+ constructor(activation = FULLY_ACTIVE_BUNDLED) {
114527
+ this.#activation = activation;
114528
+ }
114529
+ setActivation(activation) {
114530
+ if (this.#activation.signature === activation.signature) {
114531
+ this.#activation = activation;
114532
+ return;
114533
+ }
114534
+ this.#activation = activation;
114535
+ this.#version += 1;
114536
+ this.#cachedSignature = null;
114537
+ }
114375
114538
  map(logicalFamily, physicalFamily) {
114376
- const key = normalizeFamilyKey$1(logicalFamily);
114539
+ const key = normalizeFamilyKey$2(logicalFamily);
114377
114540
  const physical = physicalFamily?.trim();
114378
114541
  if (!key || !physical)
114379
114542
  return;
114380
114543
  if (this.#overrides.get(key) === physical)
114381
114544
  return;
114382
- if (key === normalizeFamilyKey$1(physical)) {
114545
+ if (key === normalizeFamilyKey$2(physical)) {
114383
114546
  if (this.#overrides.delete(key)) {
114384
114547
  this.#version += 1;
114385
114548
  this.#cachedSignature = null;
@@ -114391,13 +114554,13 @@ var isRegExp = (value) => {
114391
114554
  this.#cachedSignature = null;
114392
114555
  }
114393
114556
  unmap(logicalFamily) {
114394
- if (this.#overrides.delete(normalizeFamilyKey$1(logicalFamily))) {
114557
+ if (this.#overrides.delete(normalizeFamilyKey$2(logicalFamily))) {
114395
114558
  this.#version += 1;
114396
114559
  this.#cachedSignature = null;
114397
114560
  }
114398
114561
  }
114399
114562
  mapEmbedded(logicalFamily, physicalFamily) {
114400
- const key = normalizeFamilyKey$1(logicalFamily);
114563
+ const key = normalizeFamilyKey$2(logicalFamily);
114401
114564
  const physical = physicalFamily?.trim();
114402
114565
  if (!key || !physical)
114403
114566
  return;
@@ -114428,44 +114591,58 @@ var isRegExp = (value) => {
114428
114591
  get signature() {
114429
114592
  if (this.#cachedSignature !== null)
114430
114593
  return this.#cachedSignature;
114431
- if (this.#overrides.size === 0 && this.#embedded.size === 0)
114594
+ const activation = this.#activation.signature;
114595
+ const hasOverrides = this.#overrides.size > 0;
114596
+ const hasEmbedded = this.#embedded.size > 0;
114597
+ if (!hasOverrides && !hasEmbedded && activation === "") {
114432
114598
  this.#cachedSignature = "";
114433
- else {
114434
- const overridePairs = sortPairs([...this.#overrides.entries()]);
114435
- this.#cachedSignature = this.#embedded.size === 0 ? JSON.stringify(overridePairs) : JSON.stringify({
114599
+ return this.#cachedSignature;
114600
+ }
114601
+ const overridePairs = sortPairs([...this.#overrides.entries()]);
114602
+ if (activation === "")
114603
+ this.#cachedSignature = !hasEmbedded ? JSON.stringify(overridePairs) : JSON.stringify({
114436
114604
  o: overridePairs,
114437
114605
  e: sortPairs([...this.#embedded.entries()])
114438
114606
  });
114607
+ else {
114608
+ const obj = { a: activation };
114609
+ if (hasOverrides)
114610
+ obj.o = overridePairs;
114611
+ if (hasEmbedded)
114612
+ obj.e = sortPairs([...this.#embedded.entries()]);
114613
+ this.#cachedSignature = JSON.stringify(obj);
114439
114614
  }
114440
114615
  return this.#cachedSignature;
114441
114616
  }
114442
114617
  #physicalFor(bareFamily) {
114443
- const key = normalizeFamilyKey$1(bareFamily);
114618
+ const key = normalizeFamilyKey$2(bareFamily);
114444
114619
  const override = this.#overrides.get(key);
114445
114620
  if (override)
114446
114621
  return {
114447
114622
  physical: override,
114448
114623
  reason: "custom_mapping"
114449
114624
  };
114450
- const bundled = BUNDLED_SUBSTITUTES[key];
114451
- if (bundled)
114452
- return {
114453
- physical: bundled,
114454
- reason: "bundled_substitute"
114455
- };
114456
- const category = CATEGORY_FALLBACKS[key];
114457
- if (category)
114458
- return {
114459
- physical: category,
114460
- reason: "category_fallback"
114461
- };
114625
+ if (this.#activation.isActive(bareFamily)) {
114626
+ const bundled = BUNDLED_SUBSTITUTES[key];
114627
+ if (bundled)
114628
+ return {
114629
+ physical: bundled,
114630
+ reason: "bundled_substitute"
114631
+ };
114632
+ const category = CATEGORY_FALLBACKS[key];
114633
+ if (category)
114634
+ return {
114635
+ physical: category,
114636
+ reason: "category_fallback"
114637
+ };
114638
+ }
114462
114639
  return {
114463
114640
  physical: bareFamily,
114464
114641
  reason: "as_requested"
114465
114642
  };
114466
114643
  }
114467
114644
  #resolveFaceLadder(primary, face, hasFace) {
114468
- const key = normalizeFamilyKey$1(primary);
114645
+ const key = normalizeFamilyKey$2(primary);
114469
114646
  const override = this.#overrides.get(key);
114470
114647
  if (override && hasFace(override, face.weight, face.style))
114471
114648
  return {
@@ -114483,10 +114660,13 @@ var isRegExp = (value) => {
114483
114660
  physical: primary,
114484
114661
  reason: "registered_face"
114485
114662
  };
114486
- const docfonts = resolveDocfontsFace(primary, face, hasFace);
114487
- if (docfonts)
114488
- return docfonts;
114489
- const bundled = BUNDLED_SUBSTITUTES[key];
114663
+ const active = this.#activation.isActive(primary);
114664
+ if (active) {
114665
+ const docfonts = resolveDocfontsFace(primary, face, hasFace);
114666
+ if (docfonts)
114667
+ return docfonts;
114668
+ }
114669
+ const bundled = active ? BUNDLED_SUBSTITUTES[key] : undefined;
114490
114670
  if (override || bundled)
114491
114671
  return {
114492
114672
  physical: primary,
@@ -114534,7 +114714,7 @@ var isRegExp = (value) => {
114534
114714
  if (parts.length === 0)
114535
114715
  return cssFontFamily;
114536
114716
  const { physical } = this.#resolveFaceLadder(parts[0], face, hasFace);
114537
- if (normalizeFamilyKey$1(physical) !== normalizeFamilyKey$1(parts[0]))
114717
+ if (normalizeFamilyKey$2(physical) !== normalizeFamilyKey$2(parts[0]))
114538
114718
  return [physical, ...parts.slice(1)].join(", ");
114539
114719
  return cssFontFamily;
114540
114720
  }
@@ -114549,7 +114729,7 @@ var isRegExp = (value) => {
114549
114729
  out.add(this.resolvePrimaryPhysicalFamily(family$1));
114550
114730
  return [...out];
114551
114731
  }
114552
- }, defaultResolver, DEFAULT_FONT_MEASURE_CONTEXT, fontConfigVersion = 0, defaultAssetBase = "/fonts/", installedRegistries, faceSlotFor = ({ weight, style }) => {
114732
+ }, defaultResolver, DEFAULT_FONT_MEASURE_CONTEXT, fontConfigVersion = 0, faceSlotFor = ({ weight, style }) => {
114553
114733
  const bold = weight === "700";
114554
114734
  const italic = style === "italic";
114555
114735
  if (bold && italic)
@@ -114559,7 +114739,7 @@ var isRegExp = (value) => {
114559
114739
  if (italic)
114560
114740
  return "italic";
114561
114741
  return "regular";
114562
- }, 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 {
114742
+ }, 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, BUNDLED_SUBSTITUTE_FAMILIES, DEFAULT_FONT_LOAD_TIMEOUT_MS = 3000, DEFAULT_PROBE_SIZE = "16px", FontRegistry = class {
114563
114743
  #fontSet;
114564
114744
  #FontFaceCtor;
114565
114745
  #probeSize;
@@ -114570,6 +114750,7 @@ var isRegExp = (value) => {
114570
114750
  #status = /* @__PURE__ */ new Map;
114571
114751
  #sources = /* @__PURE__ */ new Map;
114572
114752
  #warnedFailures = /* @__PURE__ */ new Set;
114753
+ #warnedBundledSubstituteFailure = false;
114573
114754
  #inflight = /* @__PURE__ */ new Map;
114574
114755
  #faceStatus = /* @__PURE__ */ new Map;
114575
114756
  #faceInflight = /* @__PURE__ */ new Map;
@@ -114631,7 +114812,7 @@ var isRegExp = (value) => {
114631
114812
  };
114632
114813
  }
114633
114814
  #trackFace(family$1, key) {
114634
- const fam = normalizeFamilyKey(family$1);
114815
+ const fam = normalizeFamilyKey$1(family$1);
114635
114816
  const set3 = this.#facesByFamily.get(fam) ?? /* @__PURE__ */ new Set;
114636
114817
  set3.add(key);
114637
114818
  this.#facesByFamily.set(fam, set3);
@@ -114685,7 +114866,7 @@ var isRegExp = (value) => {
114685
114866
  this.#providerFaceKeys.delete(key);
114686
114867
  this.#faceStatus.delete(key);
114687
114868
  this.#faceSources.delete(key);
114688
- const fam = normalizeFamilyKey(family$1);
114869
+ const fam = normalizeFamilyKey$1(family$1);
114689
114870
  const keys$1 = this.#facesByFamily.get(fam);
114690
114871
  if (keys$1) {
114691
114872
  keys$1.delete(key);
@@ -114700,7 +114881,7 @@ var isRegExp = (value) => {
114700
114881
  }
114701
114882
  getStatus(family$1) {
114702
114883
  const statuses = [];
114703
- const faceKeys = this.#facesByFamily.get(normalizeFamilyKey(family$1));
114884
+ const faceKeys = this.#facesByFamily.get(normalizeFamilyKey$1(family$1));
114704
114885
  if (faceKeys)
114705
114886
  for (const k of faceKeys)
114706
114887
  statuses.push(this.#faceStatus.get(k) ?? "unloaded");
@@ -114843,6 +115024,10 @@ var isRegExp = (value) => {
114843
115024
  }
114844
115025
  }
114845
115026
  #warnFaceFailureOnce(request, key) {
115027
+ if (BUNDLED_SUBSTITUTE_FAMILIES.has(request.family)) {
115028
+ this.#warnBundledSubstituteFailureOnce(request.family);
115029
+ return;
115030
+ }
114846
115031
  if (this.#warnedFaceFailures.has(key))
114847
115032
  return;
114848
115033
  this.#warnedFaceFailures.add(key);
@@ -114893,6 +115078,10 @@ var isRegExp = (value) => {
114893
115078
  }
114894
115079
  }
114895
115080
  #warnLoadFailureOnce(family$1) {
115081
+ if (BUNDLED_SUBSTITUTE_FAMILIES.has(family$1)) {
115082
+ this.#warnBundledSubstituteFailureOnce(family$1);
115083
+ return;
115084
+ }
114896
115085
  if (this.#warnedFailures.has(family$1))
114897
115086
  return;
114898
115087
  this.#warnedFailures.add(family$1);
@@ -114900,7 +115089,18 @@ var isRegExp = (value) => {
114900
115089
  const detail = sources && sources.length ? ` from ${sources.join(", ")}` : "";
114901
115090
  console.warn(`[superdoc] font asset failed to load for "${family$1}"${detail}. Check fonts.assetBaseUrl / fonts.resolveAssetUrl so the bundled .woff2 are served.`);
114902
115091
  }
114903
- }, registriesByFontSet, domlessRegistry = null, BUNDLED_FAMILIES, SUPPORTED_ALIAS_FAMILIES, ADVERTISED_BUILT_IN_TOOLBAR_FAMILIES, FONT_OFFERINGS, prepareCommentParaIds = (comment) => {
115092
+ #warnBundledSubstituteFailureOnce(family$1) {
115093
+ if (this.#warnedBundledSubstituteFailure)
115094
+ return;
115095
+ this.#warnedBundledSubstituteFailure = true;
115096
+ console.warn(`[superdoc] Bundled fallback fonts failed to load (e.g. "${family$1}"). Text will render with system fallbacks, so some fonts may look unchanged on machines that lack them. Fix one of:
115097
+ - install @superdoc-dev/fonts and pass it:
115098
+ import { superdocFonts } from '@superdoc-dev/fonts';
115099
+ new SuperDoc({ /* ... */ fonts: superdocFonts });
115100
+ - or set fonts.assetBaseUrl / fonts.resolveAssetUrl to where the bundled .woff2 are served.
115101
+ Docs: https://docs.superdoc.dev/getting-started/fonts`);
115102
+ }
115103
+ }, registriesByFontSet, domlessRegistry = null, BUNDLED_FAMILIES, SUPPORTED_ALIAS_FAMILIES, BUILT_IN_TOOLBAR_BASELINE_FAMILIES, ADVERTISED_BUILT_IN_TOOLBAR_FAMILIES, FONT_OFFERINGS, BUNDLED_LOGICAL_FAMILIES, BUNDLED_LOGICAL_KEYS, prepareCommentParaIds = (comment) => {
114904
115104
  return {
114905
115105
  ...comment,
114906
115106
  commentParaId: generateDocxRandomId()
@@ -119021,7 +119221,7 @@ var isRegExp = (value) => {
119021
119221
  sourceId: stringOf(primary.sourceId),
119022
119222
  revisionGroupId: stringOf(primary.revisionGroupId) || representativeRevisionId
119023
119223
  });
119024
- }, stringOf = (value) => typeof value === "string" ? value : value == null ? "" : String(value), groupedCache, SDT_NODE_NAMES, SDT_BLOCK_NAME = "structuredContentBlock", SDT_INLINE_NAME = "structuredContent", SDT_NODE_TYPES, VALID_CONTROL_TYPES, VALID_LOCK_MODES, VALID_APPEARANCES, FIELD_LIKE_SDT_TYPES, liveDocumentCountsCache, BIBLIOGRAPHY_NAMESPACE_URI = "http://schemas.openxmlformats.org/officeDocument/2006/bibliography", CUSTOM_XML_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml", CUSTOM_XML_PROPS_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps", DEFAULT_SELECTED_STYLE = "/APA.XSL", DEFAULT_STYLE_NAME = "APA", DEFAULT_VERSION = "6", API_TO_OOXML_SOURCE_TYPE, OOXML_TO_API_SOURCE_TYPE, SIMPLE_FIELD_TO_XML_TAG, XML_TAG_TO_SIMPLE_FIELD, import_lib2, FONT_FAMILY_FALLBACKS, DEFAULT_GENERIC_FALLBACK = "sans-serif", DEFAULT_FONT_SIZE_PT = 10, CURRENT_APP_VERSION = "1.39.0", SUPERDOC_DOCUMENT_ORIGIN_PROPERTY = "SuperdocDocumentOrigin", STORED_DOCUMENT_ORIGINS, collectRunDefaultProperties = (runProps, { allowOverrideTypeface = true, allowOverrideSize = true, themeResolver, state }) => {
119224
+ }, stringOf = (value) => typeof value === "string" ? value : value == null ? "" : String(value), groupedCache, SDT_NODE_NAMES, SDT_BLOCK_NAME = "structuredContentBlock", SDT_INLINE_NAME = "structuredContent", SDT_NODE_TYPES, VALID_CONTROL_TYPES, VALID_LOCK_MODES, VALID_APPEARANCES, FIELD_LIKE_SDT_TYPES, liveDocumentCountsCache, BIBLIOGRAPHY_NAMESPACE_URI = "http://schemas.openxmlformats.org/officeDocument/2006/bibliography", CUSTOM_XML_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml", CUSTOM_XML_PROPS_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps", DEFAULT_SELECTED_STYLE = "/APA.XSL", DEFAULT_STYLE_NAME = "APA", DEFAULT_VERSION = "6", API_TO_OOXML_SOURCE_TYPE, OOXML_TO_API_SOURCE_TYPE, SIMPLE_FIELD_TO_XML_TAG, XML_TAG_TO_SIMPLE_FIELD, import_lib2, FONT_FAMILY_FALLBACKS, DEFAULT_GENERIC_FALLBACK = "sans-serif", DEFAULT_FONT_SIZE_PT = 10, CURRENT_APP_VERSION = "1.40.0", SUPERDOC_DOCUMENT_ORIGIN_PROPERTY = "SuperdocDocumentOrigin", STORED_DOCUMENT_ORIGINS, collectRunDefaultProperties = (runProps, { allowOverrideTypeface = true, allowOverrideSize = true, themeResolver, state }) => {
119025
119225
  if (!runProps?.elements?.length || !state)
119026
119226
  return;
119027
119227
  const fontsNode = runProps.elements.find((el) => el.name === "w:rFonts");
@@ -119055,7 +119255,7 @@ var isRegExp = (value) => {
119055
119255
  state.kern = kernNode.attributes["w:val"];
119056
119256
  }
119057
119257
  }, SuperConverter;
119058
- var init_SuperConverter_DAuqlmYY_es = __esm(() => {
119258
+ var init_SuperConverter_C3uAnS0b_es = __esm(() => {
119059
119259
  init_rolldown_runtime_Bg48TavK_es();
119060
119260
  init_jszip_C49i9kUs_es();
119061
119261
  init_xml_js_CqGKpaft_es();
@@ -157966,6 +158166,17 @@ var init_SuperConverter_DAuqlmYY_es = __esm(() => {
157966
158166
  }]),
157967
158167
  family("TeX Gyre Bonum", "TeXGyreBonum", "LicenseRef-GUST-Font-License-1.0")
157968
158168
  ]);
158169
+ installedRegistries = /* @__PURE__ */ new WeakMap;
158170
+ FULLY_ACTIVE_BUNDLED = Object.freeze({
158171
+ packConfigured: true,
158172
+ isActive: () => true,
158173
+ signature: ""
158174
+ });
158175
+ BASELINE_BUNDLED = Object.freeze({
158176
+ packConfigured: false,
158177
+ isActive: () => false,
158178
+ signature: JSON.stringify({ p: false })
158179
+ });
157969
158180
  SUBSTITUTION_EVIDENCE = SUBSTITUTION_EVIDENCE$1;
157970
158181
  bundledFamilies = new Set(BUNDLED_MANIFEST.map((f2) => f2.family));
157971
158182
  BUNDLED_SUBSTITUTES = deriveBundledSubstitutes();
@@ -157975,9 +158186,9 @@ var init_SuperConverter_DAuqlmYY_es = __esm(() => {
157975
158186
  resolvePhysical: (cssFontFamily, _face) => resolvePhysicalFamily(cssFontFamily),
157976
158187
  fontSignature: ""
157977
158188
  });
157978
- installedRegistries = /* @__PURE__ */ new WeakMap;
157979
158189
  RENDER_ALL = { canRenderFamily: () => true };
157980
158190
  OS2_MIN_LENGTH = OS2_FSSELECTION + 2;
158191
+ BUNDLED_SUBSTITUTE_FAMILIES = new Set(BUNDLED_MANIFEST.map((f2) => f2.family));
157981
158192
  registriesByFontSet = /* @__PURE__ */ new WeakMap;
157982
158193
  BUNDLED_FAMILIES = new Set(BUNDLED_MANIFEST.map((f2) => f2.family));
157983
158194
  SUPPORTED_ALIAS_FAMILIES = new Set([
@@ -157985,6 +158196,11 @@ var init_SuperConverter_DAuqlmYY_es = __esm(() => {
157985
158196
  "Courier",
157986
158197
  "Times"
157987
158198
  ]);
158199
+ BUILT_IN_TOOLBAR_BASELINE_FAMILIES = new Set([
158200
+ "Arial",
158201
+ "Courier New",
158202
+ "Times New Roman"
158203
+ ]);
157988
158204
  ADVERTISED_BUILT_IN_TOOLBAR_FAMILIES = new Set([
157989
158205
  "Arial Black",
157990
158206
  "Arial Narrow",
@@ -158005,6 +158221,8 @@ var init_SuperConverter_DAuqlmYY_es = __esm(() => {
158005
158221
  "Verdana"
158006
158222
  ]);
158007
158223
  FONT_OFFERINGS = deriveOfferings();
158224
+ BUNDLED_LOGICAL_FAMILIES = [...new Set(FONT_OFFERINGS.filter((o) => o.bundled).map((o) => o.logicalFamily))].sort((a, b) => a.localeCompare(b, "en", { sensitivity: "base" }));
158225
+ BUNDLED_LOGICAL_KEYS = new Set(BUNDLED_LOGICAL_FAMILIES.map(normalizeFamilyKey));
158008
158226
  ALL_COMMENT_TARGETS = COMMENT_FILE_BASENAMES;
158009
158227
  REL_ID_NUMERIC_PATTERN = /rId|mi/g;
158010
158228
  FOOTNOTES_CONFIG$1 = {
@@ -159799,7 +160017,7 @@ var init_SuperConverter_DAuqlmYY_es = __esm(() => {
159799
160017
  };
159800
160018
  });
159801
160019
 
159802
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-BT0XKtIW.es.js
160020
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-CSJZe3lZ.es.js
159803
160021
  function parseSizeUnit(val = "0") {
159804
160022
  const length = val.toString() || "0";
159805
160023
  const value = Number.parseFloat(length);
@@ -170448,8 +170666,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
170448
170666
  }
170449
170667
  };
170450
170668
  };
170451
- var init_create_headless_toolbar_BT0XKtIW_es = __esm(() => {
170452
- init_SuperConverter_DAuqlmYY_es();
170669
+ var init_create_headless_toolbar_CSJZe3lZ_es = __esm(() => {
170670
+ init_SuperConverter_C3uAnS0b_es();
170453
170671
  init_uuid_B2wVPhPi_es();
170454
170672
  init_constants_D9qj59G2_es();
170455
170673
  init_dist_B8HfvhaK_es();
@@ -225139,7 +225357,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
225139
225357
  init_remark_gfm_BhnWr3yf_es();
225140
225358
  });
225141
225359
 
225142
- // ../../packages/superdoc/dist/chunks/src-DGC_pZIT.es.js
225360
+ // ../../packages/superdoc/dist/chunks/src-CsnSYD0u.es.js
225143
225361
  function deleteProps(obj, propOrProps) {
225144
225362
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
225145
225363
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -225213,7 +225431,7 @@ function prosemirrorToYXmlFragment(doc$12, xmlFragment) {
225213
225431
  }
225214
225432
  function getSuperdocVersion() {
225215
225433
  try {
225216
- return "1.39.0";
225434
+ return "1.40.0";
225217
225435
  } catch {
225218
225436
  return "unknown";
225219
225437
  }
@@ -237499,20 +237717,32 @@ function scrollToElement(targetElement, options = {
237499
237717
  behavior: options.behavior
237500
237718
  });
237501
237719
  }
237720
+ function toolbarFontOptionsFor(activation = BASELINE_BUNDLED) {
237721
+ return getBuiltInToolbarFontOfferings(activation).map((offering) => ({
237722
+ label: offering.logicalFamily,
237723
+ key: fontOfferingStack(offering),
237724
+ fontWeight: 400,
237725
+ props: {
237726
+ style: { fontFamily: fontOfferingRenderStack(offering) },
237727
+ "data-item": "btn-fontFamily-option"
237728
+ }
237729
+ }));
237730
+ }
237502
237731
  function normalizeToolbarFamily(value) {
237503
237732
  return String(value ?? "").trim().toLowerCase();
237504
237733
  }
237505
237734
  function compareToolbarFontOptions(a2, b$1) {
237506
237735
  return String(a2.label ?? "").trim().localeCompare(String(b$1.label ?? "").trim(), "en", { sensitivity: "base" });
237507
237736
  }
237508
- function composeToolbarFontOptions(documentOptions, configFonts) {
237737
+ function composeToolbarFontOptions(documentOptions, configFonts, activation = BASELINE_BUNDLED) {
237509
237738
  if (configFonts)
237510
237739
  return configFonts;
237511
- if (!documentOptions?.length)
237740
+ if (!activation.packConfigured && !documentOptions?.length)
237512
237741
  return;
237513
- const seen = new Set(TOOLBAR_FONTS.map((option) => normalizeToolbarFamily(option.label)));
237514
- const merged = [...TOOLBAR_FONTS];
237515
- for (const option of documentOptions) {
237742
+ const base4 = toolbarFontOptionsFor(activation);
237743
+ const seen = new Set(base4.map((option) => normalizeToolbarFamily(option.label)));
237744
+ const merged = [...base4];
237745
+ for (const option of documentOptions ?? []) {
237516
237746
  const dedupeKey = normalizeToolbarFamily(option.logicalFamily);
237517
237747
  if (seen.has(dedupeKey))
237518
237748
  continue;
@@ -237527,7 +237757,7 @@ function composeToolbarFontOptions(documentOptions, configFonts) {
237527
237757
  }
237528
237758
  });
237529
237759
  }
237530
- return merged.length > TOOLBAR_FONTS.length ? merged.sort(compareToolbarFontOptions) : undefined;
237760
+ return merged.sort(compareToolbarFontOptions);
237531
237761
  }
237532
237762
  function isExtensionRulesEnabled(extension2, enabled) {
237533
237763
  if (Array.isArray(enabled))
@@ -302657,7 +302887,7 @@ var Node$13 = class Node$14 {
302657
302887
  domAvailabilityCache = false;
302658
302888
  return false;
302659
302889
  }
302660
- }, summaryVersion = "1.39.0", nodeKeys, markKeys, transformListsInCopiedContent = (html3) => {
302890
+ }, summaryVersion = "1.40.0", nodeKeys, markKeys, transformListsInCopiedContent = (html3) => {
302661
302891
  const container = document.createElement("div");
302662
302892
  container.innerHTML = html3;
302663
302893
  const result = [];
@@ -303843,7 +304073,7 @@ var Node$13 = class Node$14 {
303843
304073
  return () => {};
303844
304074
  const handle3 = setInterval(callback, intervalMs);
303845
304075
  return () => clearInterval(handle3);
303846
- }, HISTORY_UNSAFE_OPS, CANONICAL_COMMENT_IGNORED_KEYS, INITIAL_HASH, ROUND_CONSTANTS, V1_COVERAGE, V2_COVERAGE, SNAPSHOT_VERSION_V2 = "sd-diff-snapshot/v2", PAYLOAD_VERSION_V1 = "sd-diff-payload/v1", PAYLOAD_VERSION_V2 = "sd-diff-payload/v2", ENGINE_ID = "super-editor", STAGED_CONVERTER_KEYS, DiffServiceError, TC_LEVEL_MIN = 1, TC_LEVEL_MAX = 9, ALLOWED_WRAP_ATTRS, WRAP_TYPES_SUPPORTING_SIDE, WRAP_TYPES_SUPPORTING_DISTANCES, RELATIVE_HEIGHT_MIN = 0, RELATIVE_HEIGHT_MAX = 4294967295, FORBIDDEN_RAW_PATCH_NAMES, CONTROL_TYPE_SDT_PR_ELEMENTS, DEFAULT_CHECKBOX_SYMBOL_FONT2 = "MS Gothic", DEFAULT_CHECKBOX_CHECKED_HEX2 = "2612", DEFAULT_CHECKBOX_UNCHECKED_HEX2 = "2610", VARIANT_ORDER, KIND_ORDER, HEADER_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", DOCUMENT_RELS_PATH2 = "word/_rels/document.xml.rels", HEADER_FILE_PATTERN2, FOOTER_FILE_PATTERN2, SPECIAL_NOTE_TYPES, BOOKMARK_SCAN_REVISION_PREFIX = "bookmark-scan:", import_lib4, CUSTOM_XML_DATA_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml", CUSTOM_XML_PROPS_RELATIONSHIP_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps", CUSTOM_XML_DATASTORE_NAMESPACE = "http://schemas.openxmlformats.org/officeDocument/2006/customXml", SETTINGS_PART, RESTART_POLICY_TO_OOXML, VALID_DISPLAYS, REFERENCE_BLOCK_PREFIX, CAPTION_STYLE_NAMES, CAPTION_PARAGRAPH_STYLE_ID = "Caption", CAPTION_FORMAT_TO_OOXML, DOCUMENT_STAT_FIELD_TYPES, TOA_LEADER_REVERSE_MAP, EDGE_NODE_TYPES, CONTENT_TYPES_PART_ID = "[Content_Types].xml", CONTENT_TYPES_NS = "http://schemas.openxmlformats.org/package/2006/content-types", contentTypesPartDescriptor, empty_exports, init_empty, CURRENT_APP_VERSION2 = "1.39.0", PIXELS_PER_INCH2 = 96, MAX_HEIGHT_BUFFER_PX = 50, MAX_WIDTH_BUFFER_PX = 20, TRACKED_REVIEW_MARK_NAMES2, isTrackedReviewMark = (mark2) => Boolean(mark2?.type?.name && TRACKED_REVIEW_MARK_NAMES2.has(mark2.type.name)), trackedReviewMarkKey = (mark2) => {
304076
+ }, HISTORY_UNSAFE_OPS, CANONICAL_COMMENT_IGNORED_KEYS, INITIAL_HASH, ROUND_CONSTANTS, V1_COVERAGE, V2_COVERAGE, SNAPSHOT_VERSION_V2 = "sd-diff-snapshot/v2", PAYLOAD_VERSION_V1 = "sd-diff-payload/v1", PAYLOAD_VERSION_V2 = "sd-diff-payload/v2", ENGINE_ID = "super-editor", STAGED_CONVERTER_KEYS, DiffServiceError, TC_LEVEL_MIN = 1, TC_LEVEL_MAX = 9, ALLOWED_WRAP_ATTRS, WRAP_TYPES_SUPPORTING_SIDE, WRAP_TYPES_SUPPORTING_DISTANCES, RELATIVE_HEIGHT_MIN = 0, RELATIVE_HEIGHT_MAX = 4294967295, FORBIDDEN_RAW_PATCH_NAMES, CONTROL_TYPE_SDT_PR_ELEMENTS, DEFAULT_CHECKBOX_SYMBOL_FONT2 = "MS Gothic", DEFAULT_CHECKBOX_CHECKED_HEX2 = "2612", DEFAULT_CHECKBOX_UNCHECKED_HEX2 = "2610", VARIANT_ORDER, KIND_ORDER, HEADER_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", DOCUMENT_RELS_PATH2 = "word/_rels/document.xml.rels", HEADER_FILE_PATTERN2, FOOTER_FILE_PATTERN2, SPECIAL_NOTE_TYPES, BOOKMARK_SCAN_REVISION_PREFIX = "bookmark-scan:", import_lib4, CUSTOM_XML_DATA_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml", CUSTOM_XML_PROPS_RELATIONSHIP_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps", CUSTOM_XML_DATASTORE_NAMESPACE = "http://schemas.openxmlformats.org/officeDocument/2006/customXml", SETTINGS_PART, RESTART_POLICY_TO_OOXML, VALID_DISPLAYS, REFERENCE_BLOCK_PREFIX, CAPTION_STYLE_NAMES, CAPTION_PARAGRAPH_STYLE_ID = "Caption", CAPTION_FORMAT_TO_OOXML, DOCUMENT_STAT_FIELD_TYPES, TOA_LEADER_REVERSE_MAP, EDGE_NODE_TYPES, CONTENT_TYPES_PART_ID = "[Content_Types].xml", CONTENT_TYPES_NS = "http://schemas.openxmlformats.org/package/2006/content-types", contentTypesPartDescriptor, empty_exports, init_empty, CURRENT_APP_VERSION2 = "1.40.0", PIXELS_PER_INCH2 = 96, MAX_HEIGHT_BUFFER_PX = 50, MAX_WIDTH_BUFFER_PX = 20, TRACKED_REVIEW_MARK_NAMES2, isTrackedReviewMark = (mark2) => Boolean(mark2?.type?.name && TRACKED_REVIEW_MARK_NAMES2.has(mark2.type.name)), trackedReviewMarkKey = (mark2) => {
303847
304077
  if (!isTrackedReviewMark(mark2))
303848
304078
  return null;
303849
304079
  const id2 = typeof mark2.attrs?.id === "string" ? mark2.attrs.id : "";
@@ -323158,6 +323388,8 @@ menclose::after {
323158
323388
  }
323159
323389
  applyInitialConfig(config3) {
323160
323390
  this.#cancelPendingRuntimeReflow();
323391
+ warnUnknownBundledSelection(config3?.bundled);
323392
+ this.#resolver.setActivation(deriveBundledActivationForConfig(config3));
323161
323393
  if (!config3)
323162
323394
  return;
323163
323395
  const registered$1 = this.#registerFamilies(config3.families);
@@ -323383,13 +323615,13 @@ menclose::after {
323383
323615
  return;
323384
323616
  console.log(...args$1);
323385
323617
  }, 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;
323386
- var init_src_DGC_pZIT_es = __esm(() => {
323618
+ var init_src_CsnSYD0u_es = __esm(() => {
323387
323619
  init_rolldown_runtime_Bg48TavK_es();
323388
- init_SuperConverter_DAuqlmYY_es();
323620
+ init_SuperConverter_C3uAnS0b_es();
323389
323621
  init_jszip_C49i9kUs_es();
323390
323622
  init_xml_js_CqGKpaft_es();
323391
323623
  init_uuid_B2wVPhPi_es();
323392
- init_create_headless_toolbar_BT0XKtIW_es();
323624
+ init_create_headless_toolbar_CSJZe3lZ_es();
323393
323625
  init_constants_D9qj59G2_es();
323394
323626
  init_dist_B8HfvhaK_es();
323395
323627
  init_unified_Dsuw2be5_es();
@@ -344209,15 +344441,7 @@ function print() { __p += __j.call(arguments, '') }
344209
344441
  };
344210
344442
  }
344211
344443
  }, [["__scopeId", "data-v-d25821a5"]]);
344212
- TOOLBAR_FONTS = getBuiltInToolbarFontOfferings().map((offering) => ({
344213
- label: offering.logicalFamily,
344214
- key: fontOfferingStack(offering),
344215
- fontWeight: 400,
344216
- props: {
344217
- style: { fontFamily: fontOfferingRenderStack(offering) },
344218
- "data-item": "btn-fontFamily-option"
344219
- }
344220
- }));
344444
+ TOOLBAR_FONTS = toolbarFontOptionsFor(BASELINE_BUNDLED);
344221
344445
  TOOLBAR_FONT_SIZES = [
344222
344446
  {
344223
344447
  label: "8",
@@ -346795,7 +347019,7 @@ function print() { __p += __j.call(arguments, '') }
346795
347019
  this.overflowItems = overflowItems.filter((item) => allConfigItems.includes(item.name.value));
346796
347020
  }
346797
347021
  #resolveToolbarFonts(configFonts) {
346798
- return composeToolbarFontOptions(this.superdoc?.fonts?.getDocumentFontOptions?.() ?? [], configFonts);
347022
+ return composeToolbarFontOptions(this.superdoc?.fonts?.getDocumentFontOptions?.() ?? [], configFonts, deriveBundledActivationForConfig(this.superdoc?.config?.fonts));
346799
347023
  }
346800
347024
  #rebuildToolbarItems() {
346801
347025
  this.#makeToolbarItems({
@@ -352883,10 +353107,14 @@ function print() { __p += __j.call(arguments, '') }
352883
353107
  getRequiredFaces: () => this.#fontPlan?.requiredFaces ?? [],
352884
353108
  getUsedFaces: () => this.#fontPlan?.usedFaces ?? [],
352885
353109
  fontResolver: this.#fontResolver,
352886
- onRegistryResolved: (registry3) => installBundledSubstitutes(registry3, {
352887
- assetBaseUrl: this.#options.fontAssets?.assetBaseUrl,
352888
- resolveAssetUrl: this.#options.fontAssets?.resolveAssetUrl
352889
- }),
353110
+ onRegistryResolved: (registry3) => {
353111
+ if (!deriveBundledActivation(this.#options.fontAssets).packConfigured)
353112
+ return;
353113
+ installBundledSubstitutes(registry3, {
353114
+ assetBaseUrl: this.#options.fontAssets?.assetBaseUrl,
353115
+ resolveAssetUrl: this.#options.fontAssets?.resolveAssetUrl
353116
+ });
353117
+ },
352890
353118
  getFontEnvironment: () => {
352891
353119
  const ownerDoc = this.#visibleHost?.ownerDocument ?? (typeof document !== "undefined" ? document : null);
352892
353120
  const view = ownerDoc?.defaultView ?? (typeof window !== "undefined" ? window : null);
@@ -359176,11 +359404,11 @@ function print() { __p += __j.call(arguments, '') }
359176
359404
  ]);
359177
359405
  });
359178
359406
 
359179
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-Zmv88GYo.es.js
359407
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-B9SVqVK2.es.js
359180
359408
  var DEFAULT_TEXT_ALIGN_OPTIONS, DEFAULT_LINE_HEIGHT_OPTIONS, DEFAULT_ZOOM_OPTIONS, DEFAULT_DOCUMENT_MODE_OPTIONS, DEFAULT_FONT_SIZE_OPTIONS, 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, FONT_SIZE_OPTIONS;
359181
- var init_create_super_doc_ui_Zmv88GYo_es = __esm(() => {
359182
- init_SuperConverter_DAuqlmYY_es();
359183
- init_create_headless_toolbar_BT0XKtIW_es();
359409
+ var init_create_super_doc_ui_B9SVqVK2_es = __esm(() => {
359410
+ init_SuperConverter_C3uAnS0b_es();
359411
+ init_create_headless_toolbar_CSJZe3lZ_es();
359184
359412
  DEFAULT_TEXT_ALIGN_OPTIONS = [
359185
359413
  {
359186
359414
  label: "Left",
@@ -359471,16 +359699,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
359471
359699
 
359472
359700
  // ../../packages/superdoc/dist/super-editor.es.js
359473
359701
  var init_super_editor_es = __esm(() => {
359474
- init_src_DGC_pZIT_es();
359475
- init_SuperConverter_DAuqlmYY_es();
359702
+ init_src_CsnSYD0u_es();
359703
+ init_SuperConverter_C3uAnS0b_es();
359476
359704
  init_jszip_C49i9kUs_es();
359477
359705
  init_xml_js_CqGKpaft_es();
359478
- init_create_headless_toolbar_BT0XKtIW_es();
359706
+ init_create_headless_toolbar_CSJZe3lZ_es();
359479
359707
  init_constants_D9qj59G2_es();
359480
359708
  init_dist_B8HfvhaK_es();
359481
359709
  init_unified_Dsuw2be5_es();
359482
359710
  init_DocxZipper_FUsfThjV_es();
359483
- init_create_super_doc_ui_Zmv88GYo_es();
359711
+ init_create_super_doc_ui_B9SVqVK2_es();
359484
359712
  init_ui_C5PAS9hY_es();
359485
359713
  init_eventemitter3_BnGqBE_Q_es();
359486
359714
  init_errors_CNaD6vcg_es();
@@ -463174,6 +463402,30 @@ var init_bundled_manifest = __esm(() => {
463174
463402
  ]);
463175
463403
  });
463176
463404
 
463405
+ // ../../shared/font-system/src/bundled.ts
463406
+ var installedRegistries2;
463407
+ var init_bundled = __esm(() => {
463408
+ init_bundled_manifest();
463409
+ init_bundled_manifest();
463410
+ installedRegistries2 = new WeakMap;
463411
+ });
463412
+
463413
+ // ../../shared/font-system/src/activation.ts
463414
+ var FULLY_ACTIVE_BUNDLED2, BASELINE_BUNDLED2;
463415
+ var init_activation = __esm(() => {
463416
+ init_bundled();
463417
+ FULLY_ACTIVE_BUNDLED2 = Object.freeze({
463418
+ packConfigured: true,
463419
+ isActive: () => true,
463420
+ signature: ""
463421
+ });
463422
+ BASELINE_BUNDLED2 = Object.freeze({
463423
+ packConfigured: false,
463424
+ isActive: () => false,
463425
+ signature: JSON.stringify({ p: false })
463426
+ });
463427
+ });
463428
+
463177
463429
  // ../../shared/font-system/src/substitution-evidence.ts
463178
463430
  var SUBSTITUTION_EVIDENCE3;
463179
463431
  var init_substitution_evidence = __esm(() => {
@@ -463273,6 +463525,19 @@ class FontResolver2 {
463273
463525
  #embedded = new Map;
463274
463526
  #version = 0;
463275
463527
  #cachedSignature = null;
463528
+ #activation;
463529
+ constructor(activation = FULLY_ACTIVE_BUNDLED2) {
463530
+ this.#activation = activation;
463531
+ }
463532
+ setActivation(activation) {
463533
+ if (this.#activation.signature === activation.signature) {
463534
+ this.#activation = activation;
463535
+ return;
463536
+ }
463537
+ this.#activation = activation;
463538
+ this.#version += 1;
463539
+ this.#cachedSignature = null;
463540
+ }
463276
463541
  map(logicalFamily, physicalFamily) {
463277
463542
  const key2 = normalizeFamilyKey3(logicalFamily);
463278
463543
  const physical = physicalFamily?.trim();
@@ -463329,11 +463594,23 @@ class FontResolver2 {
463329
463594
  get signature() {
463330
463595
  if (this.#cachedSignature !== null)
463331
463596
  return this.#cachedSignature;
463332
- if (this.#overrides.size === 0 && this.#embedded.size === 0) {
463597
+ const activation = this.#activation.signature;
463598
+ const hasOverrides = this.#overrides.size > 0;
463599
+ const hasEmbedded = this.#embedded.size > 0;
463600
+ if (!hasOverrides && !hasEmbedded && activation === "") {
463333
463601
  this.#cachedSignature = "";
463602
+ return this.#cachedSignature;
463603
+ }
463604
+ const overridePairs = sortPairs2([...this.#overrides.entries()]);
463605
+ if (activation === "") {
463606
+ this.#cachedSignature = !hasEmbedded ? JSON.stringify(overridePairs) : JSON.stringify({ o: overridePairs, e: sortPairs2([...this.#embedded.entries()]) });
463334
463607
  } else {
463335
- const overridePairs = sortPairs2([...this.#overrides.entries()]);
463336
- this.#cachedSignature = this.#embedded.size === 0 ? JSON.stringify(overridePairs) : JSON.stringify({ o: overridePairs, e: sortPairs2([...this.#embedded.entries()]) });
463608
+ const obj = { a: activation };
463609
+ if (hasOverrides)
463610
+ obj.o = overridePairs;
463611
+ if (hasEmbedded)
463612
+ obj.e = sortPairs2([...this.#embedded.entries()]);
463613
+ this.#cachedSignature = JSON.stringify(obj);
463337
463614
  }
463338
463615
  return this.#cachedSignature;
463339
463616
  }
@@ -463342,12 +463619,14 @@ class FontResolver2 {
463342
463619
  const override = this.#overrides.get(key2);
463343
463620
  if (override)
463344
463621
  return { physical: override, reason: "custom_mapping" };
463345
- const bundled = BUNDLED_SUBSTITUTES2[key2];
463346
- if (bundled)
463347
- return { physical: bundled, reason: "bundled_substitute" };
463348
- const category = CATEGORY_FALLBACKS2[key2];
463349
- if (category)
463350
- return { physical: category, reason: "category_fallback" };
463622
+ if (this.#activation.isActive(bareFamily)) {
463623
+ const bundled = BUNDLED_SUBSTITUTES2[key2];
463624
+ if (bundled)
463625
+ return { physical: bundled, reason: "bundled_substitute" };
463626
+ const category = CATEGORY_FALLBACKS2[key2];
463627
+ if (category)
463628
+ return { physical: category, reason: "category_fallback" };
463629
+ }
463351
463630
  return { physical: bareFamily, reason: "as_requested" };
463352
463631
  }
463353
463632
  #resolveFaceLadder(primary, face, hasFace) {
@@ -463363,10 +463642,13 @@ class FontResolver2 {
463363
463642
  if (hasFace(primary, face.weight, face.style)) {
463364
463643
  return { physical: primary, reason: "registered_face" };
463365
463644
  }
463366
- const docfonts = resolveDocfontsFace2(primary, face, hasFace);
463367
- if (docfonts)
463368
- return docfonts;
463369
- const bundled = BUNDLED_SUBSTITUTES2[key2];
463645
+ const active = this.#activation.isActive(primary);
463646
+ if (active) {
463647
+ const docfonts = resolveDocfontsFace2(primary, face, hasFace);
463648
+ if (docfonts)
463649
+ return docfonts;
463650
+ }
463651
+ const bundled = active ? BUNDLED_SUBSTITUTES2[key2] : undefined;
463370
463652
  if (override || bundled) {
463371
463653
  return { physical: primary, reason: "fallback_face_absent" };
463372
463654
  }
@@ -463432,6 +463714,7 @@ function resolvePhysicalFamily2(cssFontFamily) {
463432
463714
  var bundledFamilies2, canRenderFamily2 = (family3) => bundledFamilies2.has(family3), BUNDLED_SUBSTITUTES2, CATEGORY_FALLBACKS2, defaultResolver2, DEFAULT_FONT_MEASURE_CONTEXT2;
463433
463715
  var init_resolver = __esm(() => {
463434
463716
  init_dist11();
463717
+ init_activation();
463435
463718
  init_bundled_manifest();
463436
463719
  init_substitution_evidence();
463437
463720
  bundledFamilies2 = new Set(BUNDLED_MANIFEST2.map((f2) => f2.family));
@@ -463443,14 +463726,6 @@ var init_resolver = __esm(() => {
463443
463726
  fontSignature: ""
463444
463727
  });
463445
463728
  });
463446
- // ../../shared/font-system/src/bundled.ts
463447
- var installedRegistries2;
463448
- var init_bundled = __esm(() => {
463449
- init_bundled_manifest();
463450
- init_bundled_manifest();
463451
- installedRegistries2 = new WeakMap;
463452
- });
463453
-
463454
463729
  // ../../shared/font-system/src/report.ts
463455
463730
  var init_report = __esm(() => {
463456
463731
  init_resolver();
@@ -463543,6 +463818,7 @@ class FontRegistry2 {
463543
463818
  #status = new Map;
463544
463819
  #sources = new Map;
463545
463820
  #warnedFailures = new Set;
463821
+ #warnedBundledSubstituteFailure = false;
463546
463822
  #inflight = new Map;
463547
463823
  #faceStatus = new Map;
463548
463824
  #faceInflight = new Map;
@@ -463778,6 +464054,10 @@ class FontRegistry2 {
463778
464054
  }
463779
464055
  }
463780
464056
  #warnFaceFailureOnce(request, key2) {
464057
+ if (BUNDLED_SUBSTITUTE_FAMILIES2.has(request.family)) {
464058
+ this.#warnBundledSubstituteFailureOnce(request.family);
464059
+ return;
464060
+ }
463781
464061
  if (this.#warnedFaceFailures.has(key2))
463782
464062
  return;
463783
464063
  this.#warnedFaceFailures.add(key2);
@@ -463817,6 +464097,10 @@ class FontRegistry2 {
463817
464097
  }
463818
464098
  }
463819
464099
  #warnLoadFailureOnce(family3) {
464100
+ if (BUNDLED_SUBSTITUTE_FAMILIES2.has(family3)) {
464101
+ this.#warnBundledSubstituteFailureOnce(family3);
464102
+ return;
464103
+ }
463820
464104
  if (this.#warnedFailures.has(family3))
463821
464105
  return;
463822
464106
  this.#warnedFailures.add(family3);
@@ -463824,9 +464108,22 @@ class FontRegistry2 {
463824
464108
  const detail = sources && sources.length ? ` from ${sources.join(", ")}` : "";
463825
464109
  console.warn(`[superdoc] font asset failed to load for "${family3}"${detail}. ` + `Check fonts.assetBaseUrl / fonts.resolveAssetUrl so the bundled .woff2 are served.`);
463826
464110
  }
464111
+ #warnBundledSubstituteFailureOnce(family3) {
464112
+ if (this.#warnedBundledSubstituteFailure)
464113
+ return;
464114
+ this.#warnedBundledSubstituteFailure = true;
464115
+ console.warn(`[superdoc] Bundled fallback fonts failed to load (e.g. "${family3}"). Text will render with ` + `system fallbacks, so some fonts may look unchanged on machines that lack them. Fix one of:
464116
+ ` + ` - install @superdoc-dev/fonts and pass it:
464117
+ ` + ` import { superdocFonts } from '@superdoc-dev/fonts';
464118
+ ` + ` new SuperDoc({ /* ... */ fonts: superdocFonts });
464119
+ ` + ` - or set fonts.assetBaseUrl / fonts.resolveAssetUrl to where the bundled .woff2 are served.
464120
+ ` + `Docs: https://docs.superdoc.dev/getting-started/fonts`);
464121
+ }
463827
464122
  }
463828
- var DEFAULT_FONT_LOAD_TIMEOUT_MS2 = 3000, DEFAULT_PROBE_SIZE2 = "16px", registriesByFontSet2;
464123
+ var BUNDLED_SUBSTITUTE_FAMILIES2, DEFAULT_FONT_LOAD_TIMEOUT_MS2 = 3000, DEFAULT_PROBE_SIZE2 = "16px", registriesByFontSet2;
463829
464124
  var init_registry2 = __esm(() => {
464125
+ init_bundled_manifest();
464126
+ BUNDLED_SUBSTITUTE_FAMILIES2 = new Set(BUNDLED_MANIFEST2.map((f2) => f2.family));
463830
464127
  registriesByFontSet2 = new WeakMap;
463831
464128
  });
463832
464129
 
@@ -463859,12 +464156,17 @@ function deriveOfferings2() {
463859
464156
  });
463860
464157
  return Object.freeze(offerings);
463861
464158
  }
463862
- var BUNDLED_FAMILIES2, SUPPORTED_ALIAS_FAMILIES2, ADVERTISED_BUILT_IN_TOOLBAR_FAMILIES2, FONT_OFFERINGS2;
464159
+ function normalizeFamilyKey5(family3) {
464160
+ return family3.trim().replace(/^["']|["']$/g, "").toLowerCase();
464161
+ }
464162
+ var BUNDLED_FAMILIES2, SUPPORTED_ALIAS_FAMILIES2, BUILT_IN_TOOLBAR_BASELINE_FAMILIES2, ADVERTISED_BUILT_IN_TOOLBAR_FAMILIES2, FONT_OFFERINGS2, BUNDLED_LOGICAL_FAMILIES2, BUNDLED_LOGICAL_KEYS2;
463863
464163
  var init_font_offerings = __esm(() => {
464164
+ init_activation();
463864
464165
  init_bundled_manifest();
463865
464166
  init_substitution_evidence();
463866
464167
  BUNDLED_FAMILIES2 = new Set(BUNDLED_MANIFEST2.map((f2) => f2.family));
463867
464168
  SUPPORTED_ALIAS_FAMILIES2 = new Set(["Arial MT", "Courier", "Times"]);
464169
+ BUILT_IN_TOOLBAR_BASELINE_FAMILIES2 = new Set(["Arial", "Courier New", "Times New Roman"]);
463868
464170
  ADVERTISED_BUILT_IN_TOOLBAR_FAMILIES2 = new Set([
463869
464171
  "Arial Black",
463870
464172
  "Arial Narrow",
@@ -463885,10 +464187,15 @@ var init_font_offerings = __esm(() => {
463885
464187
  "Verdana"
463886
464188
  ]);
463887
464189
  FONT_OFFERINGS2 = deriveOfferings2();
464190
+ BUNDLED_LOGICAL_FAMILIES2 = [
464191
+ ...new Set(FONT_OFFERINGS2.filter((o) => o.bundled).map((o) => o.logicalFamily))
464192
+ ].sort((a2, b2) => a2.localeCompare(b2, "en", { sensitivity: "base" }));
464193
+ BUNDLED_LOGICAL_KEYS2 = new Set(BUNDLED_LOGICAL_FAMILIES2.map(normalizeFamilyKey5));
463888
464194
  });
463889
464195
 
463890
464196
  // ../../shared/font-system/src/document-font-options.ts
463891
464197
  var init_document_font_options = __esm(() => {
464198
+ init_activation();
463892
464199
  init_report();
463893
464200
  init_font_offerings();
463894
464201
  });
@@ -463898,6 +464205,7 @@ var init_src5 = __esm(() => {
463898
464205
  init_types8();
463899
464206
  init_resolver();
463900
464207
  init_resolver();
464208
+ init_activation();
463901
464209
  init_bundled();
463902
464210
  init_report();
463903
464211
  init_os2();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/mcp",
3
- "version": "0.12.0-next.30",
3
+ "version": "0.12.0-next.32",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20"
@@ -21,7 +21,7 @@
21
21
  "typescript": "^5.9.2",
22
22
  "@superdoc/document-api": "0.0.1",
23
23
  "@superdoc/super-editor": "0.0.1",
24
- "superdoc": "1.39.0"
24
+ "superdoc": "1.40.0"
25
25
  },
26
26
  "publishConfig": {
27
27
  "access": "public"