@superdoc-dev/cli 0.17.0-next.30 → 0.17.0-next.31
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.
- package/dist/index.js +320 -136
- package/package.json +7 -7
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-
|
|
68330
|
+
// ../../packages/superdoc/dist/chunks/SuperConverter-cG5SxcH9.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")
|
|
@@ -68891,7 +68891,7 @@ function wsOptionsFor(type, preserveWhitespace, base$1) {
|
|
|
68891
68891
|
return (preserveWhitespace ? OPT_PRESERVE_WS : 0) | (preserveWhitespace === "full" ? OPT_PRESERVE_WS_FULL : 0);
|
|
68892
68892
|
return type && type.whitespace == "pre" ? OPT_PRESERVE_WS | OPT_PRESERVE_WS_FULL : base$1 & ~OPT_OPEN_LEFT;
|
|
68893
68893
|
}
|
|
68894
|
-
function normalizeList(dom) {
|
|
68894
|
+
function normalizeList$1(dom) {
|
|
68895
68895
|
for (let child = dom.firstChild, prevItem = null;child; child = child.nextSibling) {
|
|
68896
68896
|
let name = child.nodeType == 1 ? child.nodeName.toLowerCase() : null;
|
|
68897
68897
|
if (name && listTags.hasOwnProperty(name) && prevItem) {
|
|
@@ -103198,7 +103198,105 @@ function familyWithFaces(name, license, faces) {
|
|
|
103198
103198
|
faces
|
|
103199
103199
|
};
|
|
103200
103200
|
}
|
|
103201
|
-
function
|
|
103201
|
+
function isBundledPackPresent() {
|
|
103202
|
+
return bundledPackPresent;
|
|
103203
|
+
}
|
|
103204
|
+
function withTrailingSlash(base$1) {
|
|
103205
|
+
return base$1.endsWith("/") ? base$1 : `${base$1}/`;
|
|
103206
|
+
}
|
|
103207
|
+
function joinUrl(base$1, file) {
|
|
103208
|
+
return `${withTrailingSlash(base$1)}${file}`;
|
|
103209
|
+
}
|
|
103210
|
+
function weightToken(weight) {
|
|
103211
|
+
return weight === "bold" ? "700" : "400";
|
|
103212
|
+
}
|
|
103213
|
+
function bundledAssetSignature(resolve2) {
|
|
103214
|
+
const family$1 = BUNDLED_MANIFEST[0];
|
|
103215
|
+
const face = family$1?.faces[0];
|
|
103216
|
+
if (!family$1 || !face)
|
|
103217
|
+
return "";
|
|
103218
|
+
return resolve2({
|
|
103219
|
+
file: face.file,
|
|
103220
|
+
family: family$1.family,
|
|
103221
|
+
weight: weightToken(face.weight),
|
|
103222
|
+
style: face.style,
|
|
103223
|
+
source: "bundled-substitute"
|
|
103224
|
+
});
|
|
103225
|
+
}
|
|
103226
|
+
function installBundledSubstitutes(registry, options = {}) {
|
|
103227
|
+
const resolve2 = options.resolveAssetUrl ?? ((context) => joinUrl(options.assetBaseUrl ?? defaultAssetBase, context.file));
|
|
103228
|
+
const signature = bundledAssetSignature(resolve2);
|
|
103229
|
+
const installed = installedRegistries.get(registry);
|
|
103230
|
+
if (installed !== undefined) {
|
|
103231
|
+
if (installed !== signature)
|
|
103232
|
+
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.`);
|
|
103233
|
+
return;
|
|
103234
|
+
}
|
|
103235
|
+
installedRegistries.set(registry, signature);
|
|
103236
|
+
for (const family$1 of BUNDLED_MANIFEST)
|
|
103237
|
+
for (const face of family$1.faces) {
|
|
103238
|
+
const context = {
|
|
103239
|
+
file: face.file,
|
|
103240
|
+
family: family$1.family,
|
|
103241
|
+
weight: weightToken(face.weight),
|
|
103242
|
+
style: face.style,
|
|
103243
|
+
source: "bundled-substitute"
|
|
103244
|
+
};
|
|
103245
|
+
registry.register({
|
|
103246
|
+
family: family$1.family,
|
|
103247
|
+
source: `url(${resolve2(context)})`,
|
|
103248
|
+
descriptors: {
|
|
103249
|
+
weight: face.weight,
|
|
103250
|
+
style: face.style
|
|
103251
|
+
}
|
|
103252
|
+
});
|
|
103253
|
+
}
|
|
103254
|
+
}
|
|
103255
|
+
function normalizeKey$1(family$1) {
|
|
103256
|
+
return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
|
|
103257
|
+
}
|
|
103258
|
+
function normalizeList(families) {
|
|
103259
|
+
if (!Array.isArray(families))
|
|
103260
|
+
return;
|
|
103261
|
+
const out = [...new Set(families.filter((f2) => typeof f2 === "string").map(normalizeKey$1).filter(Boolean))].sort();
|
|
103262
|
+
return out.length > 0 ? out : undefined;
|
|
103263
|
+
}
|
|
103264
|
+
function createBundledActivation(input) {
|
|
103265
|
+
if (!input.packConfigured)
|
|
103266
|
+
return BASELINE_BUNDLED;
|
|
103267
|
+
const include = normalizeList(input.include);
|
|
103268
|
+
const exclude = include ? undefined : normalizeList(input.exclude);
|
|
103269
|
+
if (!include && !exclude)
|
|
103270
|
+
return FULLY_ACTIVE_BUNDLED;
|
|
103271
|
+
if (include) {
|
|
103272
|
+
const set$1 = new Set(include);
|
|
103273
|
+
return Object.freeze({
|
|
103274
|
+
packConfigured: true,
|
|
103275
|
+
isActive: (family$1) => set$1.has(normalizeKey$1(family$1)),
|
|
103276
|
+
signature: JSON.stringify({
|
|
103277
|
+
p: true,
|
|
103278
|
+
i: include
|
|
103279
|
+
})
|
|
103280
|
+
});
|
|
103281
|
+
}
|
|
103282
|
+
const set = new Set(exclude);
|
|
103283
|
+
return Object.freeze({
|
|
103284
|
+
packConfigured: true,
|
|
103285
|
+
isActive: (family$1) => !set.has(normalizeKey$1(family$1)),
|
|
103286
|
+
signature: JSON.stringify({
|
|
103287
|
+
p: true,
|
|
103288
|
+
x: exclude
|
|
103289
|
+
})
|
|
103290
|
+
});
|
|
103291
|
+
}
|
|
103292
|
+
function deriveBundledActivation(config$43) {
|
|
103293
|
+
return createBundledActivation({
|
|
103294
|
+
packConfigured: !!(config$43?.resolveAssetUrl || config$43?.assetBaseUrl) || isBundledPackPresent(),
|
|
103295
|
+
include: config$43?.bundled?.include,
|
|
103296
|
+
exclude: config$43?.bundled?.exclude
|
|
103297
|
+
});
|
|
103298
|
+
}
|
|
103299
|
+
function normalizeFamilyKey$2(family$1) {
|
|
103202
103300
|
return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
|
|
103203
103301
|
}
|
|
103204
103302
|
function sortPairs(pairs) {
|
|
@@ -103277,7 +103375,7 @@ function deriveBundledSubstitutes() {
|
|
|
103277
103375
|
for (const row of SUBSTITUTION_EVIDENCE) {
|
|
103278
103376
|
const fallback = getRenderableFallback(row.logicalFamily, { canRenderFamily });
|
|
103279
103377
|
if (fallback?.policyAction === "substitute")
|
|
103280
|
-
substitutes[normalizeFamilyKey$
|
|
103378
|
+
substitutes[normalizeFamilyKey$2(row.logicalFamily)] = fallback.substituteFamily;
|
|
103281
103379
|
}
|
|
103282
103380
|
return Object.freeze(substitutes);
|
|
103283
103381
|
}
|
|
@@ -103286,7 +103384,7 @@ function deriveCategoryFallbacks() {
|
|
|
103286
103384
|
for (const row of SUBSTITUTION_EVIDENCE) {
|
|
103287
103385
|
const fallback = getRenderableFallback(row.logicalFamily, { canRenderFamily });
|
|
103288
103386
|
if (fallback?.policyAction === "category_fallback")
|
|
103289
|
-
fallbacks[normalizeFamilyKey$
|
|
103387
|
+
fallbacks[normalizeFamilyKey$2(row.logicalFamily)] = fallback.substituteFamily;
|
|
103290
103388
|
}
|
|
103291
103389
|
return Object.freeze(fallbacks);
|
|
103292
103390
|
}
|
|
@@ -103296,8 +103394,8 @@ function stripFamilyQuotes(family$1) {
|
|
|
103296
103394
|
function splitStack(cssFontFamily) {
|
|
103297
103395
|
return cssFontFamily.split(",").map((part) => part.trim()).filter(Boolean);
|
|
103298
103396
|
}
|
|
103299
|
-
function createFontResolver() {
|
|
103300
|
-
return new FontResolver;
|
|
103397
|
+
function createFontResolver(activation) {
|
|
103398
|
+
return new FontResolver(activation);
|
|
103301
103399
|
}
|
|
103302
103400
|
function resolveFontFamily(logicalFamily) {
|
|
103303
103401
|
return defaultResolver.resolveFontFamily(logicalFamily);
|
|
@@ -103314,57 +103412,6 @@ function getFontConfigVersion() {
|
|
|
103314
103412
|
function bumpFontConfigVersion() {
|
|
103315
103413
|
return fontConfigVersion += 1;
|
|
103316
103414
|
}
|
|
103317
|
-
function withTrailingSlash(base$1) {
|
|
103318
|
-
return base$1.endsWith("/") ? base$1 : `${base$1}/`;
|
|
103319
|
-
}
|
|
103320
|
-
function joinUrl(base$1, file) {
|
|
103321
|
-
return `${withTrailingSlash(base$1)}${file}`;
|
|
103322
|
-
}
|
|
103323
|
-
function weightToken(weight) {
|
|
103324
|
-
return weight === "bold" ? "700" : "400";
|
|
103325
|
-
}
|
|
103326
|
-
function bundledAssetSignature(resolve2) {
|
|
103327
|
-
const family$1 = BUNDLED_MANIFEST[0];
|
|
103328
|
-
const face = family$1?.faces[0];
|
|
103329
|
-
if (!family$1 || !face)
|
|
103330
|
-
return "";
|
|
103331
|
-
return resolve2({
|
|
103332
|
-
file: face.file,
|
|
103333
|
-
family: family$1.family,
|
|
103334
|
-
weight: weightToken(face.weight),
|
|
103335
|
-
style: face.style,
|
|
103336
|
-
source: "bundled-substitute"
|
|
103337
|
-
});
|
|
103338
|
-
}
|
|
103339
|
-
function installBundledSubstitutes(registry, options = {}) {
|
|
103340
|
-
const resolve2 = options.resolveAssetUrl ?? ((context) => joinUrl(options.assetBaseUrl ?? defaultAssetBase, context.file));
|
|
103341
|
-
const signature = bundledAssetSignature(resolve2);
|
|
103342
|
-
const installed = installedRegistries.get(registry);
|
|
103343
|
-
if (installed !== undefined) {
|
|
103344
|
-
if (installed !== signature)
|
|
103345
|
-
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.`);
|
|
103346
|
-
return;
|
|
103347
|
-
}
|
|
103348
|
-
installedRegistries.set(registry, signature);
|
|
103349
|
-
for (const family$1 of BUNDLED_MANIFEST)
|
|
103350
|
-
for (const face of family$1.faces) {
|
|
103351
|
-
const context = {
|
|
103352
|
-
file: face.file,
|
|
103353
|
-
family: family$1.family,
|
|
103354
|
-
weight: weightToken(face.weight),
|
|
103355
|
-
style: face.style,
|
|
103356
|
-
source: "bundled-substitute"
|
|
103357
|
-
};
|
|
103358
|
-
registry.register({
|
|
103359
|
-
family: family$1.family,
|
|
103360
|
-
source: `url(${resolve2(context)})`,
|
|
103361
|
-
descriptors: {
|
|
103362
|
-
weight: face.weight,
|
|
103363
|
-
style: face.style
|
|
103364
|
-
}
|
|
103365
|
-
});
|
|
103366
|
-
}
|
|
103367
|
-
}
|
|
103368
103415
|
function toEvidence(fallback) {
|
|
103369
103416
|
if (!fallback)
|
|
103370
103417
|
return;
|
|
@@ -103477,7 +103524,7 @@ function canonicalizeFontSource(source) {
|
|
|
103477
103524
|
inner = inner.slice(1, -1);
|
|
103478
103525
|
return `url(${JSON.stringify(inner)})`;
|
|
103479
103526
|
}
|
|
103480
|
-
function normalizeFamilyKey(family$1) {
|
|
103527
|
+
function normalizeFamilyKey$1(family$1) {
|
|
103481
103528
|
return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
|
|
103482
103529
|
}
|
|
103483
103530
|
function normalizeWeight(weight) {
|
|
@@ -103496,7 +103543,7 @@ function normalizeStyle(style) {
|
|
|
103496
103543
|
return s.startsWith("italic") || s.startsWith("oblique") ? "italic" : "normal";
|
|
103497
103544
|
}
|
|
103498
103545
|
function faceKeyOf(family$1, weight, style) {
|
|
103499
|
-
return `${normalizeFamilyKey(family$1)}|${weight}|${style}`;
|
|
103546
|
+
return `${normalizeFamilyKey$1(family$1)}|${weight}|${style}`;
|
|
103500
103547
|
}
|
|
103501
103548
|
function faceProbe(family$1, weight, style, size2) {
|
|
103502
103549
|
return `${style === "italic" ? "italic " : ""}${weight} ${size2} ${quoteFamily(family$1)}`;
|
|
@@ -103548,8 +103595,10 @@ function deriveOfferings() {
|
|
|
103548
103595
|
function compareLogicalFamily(a, b) {
|
|
103549
103596
|
return a.logicalFamily.localeCompare(b.logicalFamily, "en", { sensitivity: "base" });
|
|
103550
103597
|
}
|
|
103551
|
-
function getBuiltInToolbarFontOfferings() {
|
|
103552
|
-
|
|
103598
|
+
function getBuiltInToolbarFontOfferings(activation = BASELINE_BUNDLED) {
|
|
103599
|
+
if (!activation.packConfigured)
|
|
103600
|
+
return FONT_OFFERINGS.filter((o) => o.bundled && BUILT_IN_TOOLBAR_BASELINE_FAMILIES.has(o.logicalFamily)).sort(compareLogicalFamily);
|
|
103601
|
+
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);
|
|
103553
103602
|
}
|
|
103554
103603
|
function fontOfferingStack(offering) {
|
|
103555
103604
|
return `${offering.logicalFamily}, ${offering.generic}`;
|
|
@@ -103557,12 +103606,73 @@ function fontOfferingStack(offering) {
|
|
|
103557
103606
|
function fontOfferingRenderStack(offering) {
|
|
103558
103607
|
return offering.physicalFamily ? `${offering.physicalFamily}, ${offering.generic}` : fontOfferingStack(offering);
|
|
103559
103608
|
}
|
|
103560
|
-
function getDefaultFontFamilyOptions() {
|
|
103561
|
-
return getBuiltInToolbarFontOfferings().map((offering) => ({
|
|
103609
|
+
function getDefaultFontFamilyOptions(activation = BASELINE_BUNDLED) {
|
|
103610
|
+
return getBuiltInToolbarFontOfferings(activation).map((offering) => ({
|
|
103562
103611
|
label: offering.logicalFamily,
|
|
103563
103612
|
value: fontOfferingStack(offering)
|
|
103564
103613
|
}));
|
|
103565
103614
|
}
|
|
103615
|
+
function normalizeFamilyKey(family$1) {
|
|
103616
|
+
return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
|
|
103617
|
+
}
|
|
103618
|
+
function editDistance(a, b) {
|
|
103619
|
+
const m = a.length;
|
|
103620
|
+
const n = b.length;
|
|
103621
|
+
if (Math.abs(m - n) > 2)
|
|
103622
|
+
return 3;
|
|
103623
|
+
let prev = Array.from({ length: n + 1 }, (_, i$1) => i$1);
|
|
103624
|
+
for (let i$1 = 1;i$1 <= m; i$1 += 1) {
|
|
103625
|
+
const curr = [i$1];
|
|
103626
|
+
for (let j = 1;j <= n; j += 1) {
|
|
103627
|
+
const cost = a[i$1 - 1] === b[j - 1] ? 0 : 1;
|
|
103628
|
+
curr[j] = Math.min(curr[j - 1] + 1, prev[j] + 1, prev[j - 1] + cost);
|
|
103629
|
+
}
|
|
103630
|
+
prev = curr;
|
|
103631
|
+
}
|
|
103632
|
+
return prev[n];
|
|
103633
|
+
}
|
|
103634
|
+
function closestBundledFamily(name) {
|
|
103635
|
+
const key = normalizeFamilyKey(name);
|
|
103636
|
+
let best = null;
|
|
103637
|
+
let bestDist = 3;
|
|
103638
|
+
for (const family$1 of BUNDLED_LOGICAL_FAMILIES) {
|
|
103639
|
+
const dist = editDistance(key, normalizeFamilyKey(family$1));
|
|
103640
|
+
if (dist < bestDist) {
|
|
103641
|
+
bestDist = dist;
|
|
103642
|
+
best = family$1;
|
|
103643
|
+
}
|
|
103644
|
+
}
|
|
103645
|
+
return best;
|
|
103646
|
+
}
|
|
103647
|
+
function coerceCurationList(value, field) {
|
|
103648
|
+
if (value == null)
|
|
103649
|
+
return [];
|
|
103650
|
+
if (!Array.isArray(value)) {
|
|
103651
|
+
console.warn(`[superdoc] fonts.bundled.${field} must be an array of font names; ignoring it. Prefer createSuperDocFonts(), which rejects malformed curation.`);
|
|
103652
|
+
return [];
|
|
103653
|
+
}
|
|
103654
|
+
return value.filter((name) => typeof name === "string");
|
|
103655
|
+
}
|
|
103656
|
+
function warnUnknownBundledSelection(selection) {
|
|
103657
|
+
if (!selection)
|
|
103658
|
+
return;
|
|
103659
|
+
const include = coerceCurationList(selection.include, "include");
|
|
103660
|
+
const exclude = coerceCurationList(selection.exclude, "exclude");
|
|
103661
|
+
if (include.length && exclude.length)
|
|
103662
|
+
console.warn("[superdoc] fonts.bundled: set `include` OR `exclude`, not both. Using `include` (the allow-list) and ignoring `exclude`. Prefer createSuperDocFonts(), which rejects this.");
|
|
103663
|
+
const seen = /* @__PURE__ */ new Set;
|
|
103664
|
+
for (const name of [...include, ...exclude]) {
|
|
103665
|
+
const trimmed = typeof name === "string" ? name.trim() : "";
|
|
103666
|
+
if (!trimmed)
|
|
103667
|
+
continue;
|
|
103668
|
+
const key = normalizeFamilyKey(trimmed);
|
|
103669
|
+
if (BUNDLED_LOGICAL_KEYS.has(key) || seen.has(key))
|
|
103670
|
+
continue;
|
|
103671
|
+
seen.add(key);
|
|
103672
|
+
const suggestion = closestBundledFamily(trimmed);
|
|
103673
|
+
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`);
|
|
103674
|
+
}
|
|
103675
|
+
}
|
|
103566
103676
|
function normalizeKey(family$1) {
|
|
103567
103677
|
return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
|
|
103568
103678
|
}
|
|
@@ -115368,7 +115478,7 @@ var isRegExp = (value) => {
|
|
|
115368
115478
|
this.localPreserveWS = true;
|
|
115369
115479
|
let name = dom.nodeName.toLowerCase(), ruleID;
|
|
115370
115480
|
if (listTags.hasOwnProperty(name) && this.parser.normalizeLists)
|
|
115371
|
-
normalizeList(dom);
|
|
115481
|
+
normalizeList$1(dom);
|
|
115372
115482
|
let rule = this.options.ruleFromNode && this.options.ruleFromNode(dom) || (ruleID = this.parser.matchTag(dom, this, matchAfter));
|
|
115373
115483
|
out:
|
|
115374
115484
|
if (rule ? rule.ignore : ignoreTags.hasOwnProperty(name)) {
|
|
@@ -130522,19 +130632,32 @@ var isRegExp = (value) => {
|
|
|
130522
130632
|
tags.push(`</${name}>`);
|
|
130523
130633
|
return tags;
|
|
130524
130634
|
}
|
|
130525
|
-
}, 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 {
|
|
130635
|
+
}, 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 {
|
|
130526
130636
|
#overrides = /* @__PURE__ */ new Map;
|
|
130527
130637
|
#embedded = /* @__PURE__ */ new Map;
|
|
130528
130638
|
#version = 0;
|
|
130529
130639
|
#cachedSignature = null;
|
|
130640
|
+
#activation;
|
|
130641
|
+
constructor(activation = FULLY_ACTIVE_BUNDLED) {
|
|
130642
|
+
this.#activation = activation;
|
|
130643
|
+
}
|
|
130644
|
+
setActivation(activation) {
|
|
130645
|
+
if (this.#activation.signature === activation.signature) {
|
|
130646
|
+
this.#activation = activation;
|
|
130647
|
+
return;
|
|
130648
|
+
}
|
|
130649
|
+
this.#activation = activation;
|
|
130650
|
+
this.#version += 1;
|
|
130651
|
+
this.#cachedSignature = null;
|
|
130652
|
+
}
|
|
130530
130653
|
map(logicalFamily, physicalFamily) {
|
|
130531
|
-
const key = normalizeFamilyKey$
|
|
130654
|
+
const key = normalizeFamilyKey$2(logicalFamily);
|
|
130532
130655
|
const physical = physicalFamily?.trim();
|
|
130533
130656
|
if (!key || !physical)
|
|
130534
130657
|
return;
|
|
130535
130658
|
if (this.#overrides.get(key) === physical)
|
|
130536
130659
|
return;
|
|
130537
|
-
if (key === normalizeFamilyKey$
|
|
130660
|
+
if (key === normalizeFamilyKey$2(physical)) {
|
|
130538
130661
|
if (this.#overrides.delete(key)) {
|
|
130539
130662
|
this.#version += 1;
|
|
130540
130663
|
this.#cachedSignature = null;
|
|
@@ -130546,13 +130669,13 @@ var isRegExp = (value) => {
|
|
|
130546
130669
|
this.#cachedSignature = null;
|
|
130547
130670
|
}
|
|
130548
130671
|
unmap(logicalFamily) {
|
|
130549
|
-
if (this.#overrides.delete(normalizeFamilyKey$
|
|
130672
|
+
if (this.#overrides.delete(normalizeFamilyKey$2(logicalFamily))) {
|
|
130550
130673
|
this.#version += 1;
|
|
130551
130674
|
this.#cachedSignature = null;
|
|
130552
130675
|
}
|
|
130553
130676
|
}
|
|
130554
130677
|
mapEmbedded(logicalFamily, physicalFamily) {
|
|
130555
|
-
const key = normalizeFamilyKey$
|
|
130678
|
+
const key = normalizeFamilyKey$2(logicalFamily);
|
|
130556
130679
|
const physical = physicalFamily?.trim();
|
|
130557
130680
|
if (!key || !physical)
|
|
130558
130681
|
return;
|
|
@@ -130583,44 +130706,58 @@ var isRegExp = (value) => {
|
|
|
130583
130706
|
get signature() {
|
|
130584
130707
|
if (this.#cachedSignature !== null)
|
|
130585
130708
|
return this.#cachedSignature;
|
|
130586
|
-
|
|
130709
|
+
const activation = this.#activation.signature;
|
|
130710
|
+
const hasOverrides = this.#overrides.size > 0;
|
|
130711
|
+
const hasEmbedded = this.#embedded.size > 0;
|
|
130712
|
+
if (!hasOverrides && !hasEmbedded && activation === "") {
|
|
130587
130713
|
this.#cachedSignature = "";
|
|
130588
|
-
|
|
130589
|
-
|
|
130590
|
-
|
|
130714
|
+
return this.#cachedSignature;
|
|
130715
|
+
}
|
|
130716
|
+
const overridePairs = sortPairs([...this.#overrides.entries()]);
|
|
130717
|
+
if (activation === "")
|
|
130718
|
+
this.#cachedSignature = !hasEmbedded ? JSON.stringify(overridePairs) : JSON.stringify({
|
|
130591
130719
|
o: overridePairs,
|
|
130592
130720
|
e: sortPairs([...this.#embedded.entries()])
|
|
130593
130721
|
});
|
|
130722
|
+
else {
|
|
130723
|
+
const obj = { a: activation };
|
|
130724
|
+
if (hasOverrides)
|
|
130725
|
+
obj.o = overridePairs;
|
|
130726
|
+
if (hasEmbedded)
|
|
130727
|
+
obj.e = sortPairs([...this.#embedded.entries()]);
|
|
130728
|
+
this.#cachedSignature = JSON.stringify(obj);
|
|
130594
130729
|
}
|
|
130595
130730
|
return this.#cachedSignature;
|
|
130596
130731
|
}
|
|
130597
130732
|
#physicalFor(bareFamily) {
|
|
130598
|
-
const key = normalizeFamilyKey$
|
|
130733
|
+
const key = normalizeFamilyKey$2(bareFamily);
|
|
130599
130734
|
const override = this.#overrides.get(key);
|
|
130600
130735
|
if (override)
|
|
130601
130736
|
return {
|
|
130602
130737
|
physical: override,
|
|
130603
130738
|
reason: "custom_mapping"
|
|
130604
130739
|
};
|
|
130605
|
-
|
|
130606
|
-
|
|
130607
|
-
|
|
130608
|
-
|
|
130609
|
-
|
|
130610
|
-
|
|
130611
|
-
|
|
130612
|
-
|
|
130613
|
-
|
|
130614
|
-
|
|
130615
|
-
|
|
130616
|
-
|
|
130740
|
+
if (this.#activation.isActive(bareFamily)) {
|
|
130741
|
+
const bundled = BUNDLED_SUBSTITUTES[key];
|
|
130742
|
+
if (bundled)
|
|
130743
|
+
return {
|
|
130744
|
+
physical: bundled,
|
|
130745
|
+
reason: "bundled_substitute"
|
|
130746
|
+
};
|
|
130747
|
+
const category = CATEGORY_FALLBACKS[key];
|
|
130748
|
+
if (category)
|
|
130749
|
+
return {
|
|
130750
|
+
physical: category,
|
|
130751
|
+
reason: "category_fallback"
|
|
130752
|
+
};
|
|
130753
|
+
}
|
|
130617
130754
|
return {
|
|
130618
130755
|
physical: bareFamily,
|
|
130619
130756
|
reason: "as_requested"
|
|
130620
130757
|
};
|
|
130621
130758
|
}
|
|
130622
130759
|
#resolveFaceLadder(primary, face, hasFace) {
|
|
130623
|
-
const key = normalizeFamilyKey$
|
|
130760
|
+
const key = normalizeFamilyKey$2(primary);
|
|
130624
130761
|
const override = this.#overrides.get(key);
|
|
130625
130762
|
if (override && hasFace(override, face.weight, face.style))
|
|
130626
130763
|
return {
|
|
@@ -130638,10 +130775,13 @@ var isRegExp = (value) => {
|
|
|
130638
130775
|
physical: primary,
|
|
130639
130776
|
reason: "registered_face"
|
|
130640
130777
|
};
|
|
130641
|
-
const
|
|
130642
|
-
if (
|
|
130643
|
-
|
|
130644
|
-
|
|
130778
|
+
const active = this.#activation.isActive(primary);
|
|
130779
|
+
if (active) {
|
|
130780
|
+
const docfonts = resolveDocfontsFace(primary, face, hasFace);
|
|
130781
|
+
if (docfonts)
|
|
130782
|
+
return docfonts;
|
|
130783
|
+
}
|
|
130784
|
+
const bundled = active ? BUNDLED_SUBSTITUTES[key] : undefined;
|
|
130645
130785
|
if (override || bundled)
|
|
130646
130786
|
return {
|
|
130647
130787
|
physical: primary,
|
|
@@ -130689,7 +130829,7 @@ var isRegExp = (value) => {
|
|
|
130689
130829
|
if (parts.length === 0)
|
|
130690
130830
|
return cssFontFamily;
|
|
130691
130831
|
const { physical } = this.#resolveFaceLadder(parts[0], face, hasFace);
|
|
130692
|
-
if (normalizeFamilyKey$
|
|
130832
|
+
if (normalizeFamilyKey$2(physical) !== normalizeFamilyKey$2(parts[0]))
|
|
130693
130833
|
return [physical, ...parts.slice(1)].join(", ");
|
|
130694
130834
|
return cssFontFamily;
|
|
130695
130835
|
}
|
|
@@ -130704,7 +130844,7 @@ var isRegExp = (value) => {
|
|
|
130704
130844
|
out.add(this.resolvePrimaryPhysicalFamily(family$1));
|
|
130705
130845
|
return [...out];
|
|
130706
130846
|
}
|
|
130707
|
-
}, defaultResolver, DEFAULT_FONT_MEASURE_CONTEXT, fontConfigVersion = 0,
|
|
130847
|
+
}, defaultResolver, DEFAULT_FONT_MEASURE_CONTEXT, fontConfigVersion = 0, faceSlotFor = ({ weight, style }) => {
|
|
130708
130848
|
const bold2 = weight === "700";
|
|
130709
130849
|
const italic = style === "italic";
|
|
130710
130850
|
if (bold2 && italic)
|
|
@@ -130714,7 +130854,7 @@ var isRegExp = (value) => {
|
|
|
130714
130854
|
if (italic)
|
|
130715
130855
|
return "italic";
|
|
130716
130856
|
return "regular";
|
|
130717
|
-
}, 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 {
|
|
130857
|
+
}, 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 {
|
|
130718
130858
|
#fontSet;
|
|
130719
130859
|
#FontFaceCtor;
|
|
130720
130860
|
#probeSize;
|
|
@@ -130725,6 +130865,7 @@ var isRegExp = (value) => {
|
|
|
130725
130865
|
#status = /* @__PURE__ */ new Map;
|
|
130726
130866
|
#sources = /* @__PURE__ */ new Map;
|
|
130727
130867
|
#warnedFailures = /* @__PURE__ */ new Set;
|
|
130868
|
+
#warnedBundledSubstituteFailure = false;
|
|
130728
130869
|
#inflight = /* @__PURE__ */ new Map;
|
|
130729
130870
|
#faceStatus = /* @__PURE__ */ new Map;
|
|
130730
130871
|
#faceInflight = /* @__PURE__ */ new Map;
|
|
@@ -130786,7 +130927,7 @@ var isRegExp = (value) => {
|
|
|
130786
130927
|
};
|
|
130787
130928
|
}
|
|
130788
130929
|
#trackFace(family$1, key) {
|
|
130789
|
-
const fam = normalizeFamilyKey(family$1);
|
|
130930
|
+
const fam = normalizeFamilyKey$1(family$1);
|
|
130790
130931
|
const set = this.#facesByFamily.get(fam) ?? /* @__PURE__ */ new Set;
|
|
130791
130932
|
set.add(key);
|
|
130792
130933
|
this.#facesByFamily.set(fam, set);
|
|
@@ -130840,7 +130981,7 @@ var isRegExp = (value) => {
|
|
|
130840
130981
|
this.#providerFaceKeys.delete(key);
|
|
130841
130982
|
this.#faceStatus.delete(key);
|
|
130842
130983
|
this.#faceSources.delete(key);
|
|
130843
|
-
const fam = normalizeFamilyKey(family$1);
|
|
130984
|
+
const fam = normalizeFamilyKey$1(family$1);
|
|
130844
130985
|
const keys$1 = this.#facesByFamily.get(fam);
|
|
130845
130986
|
if (keys$1) {
|
|
130846
130987
|
keys$1.delete(key);
|
|
@@ -130855,7 +130996,7 @@ var isRegExp = (value) => {
|
|
|
130855
130996
|
}
|
|
130856
130997
|
getStatus(family$1) {
|
|
130857
130998
|
const statuses = [];
|
|
130858
|
-
const faceKeys = this.#facesByFamily.get(normalizeFamilyKey(family$1));
|
|
130999
|
+
const faceKeys = this.#facesByFamily.get(normalizeFamilyKey$1(family$1));
|
|
130859
131000
|
if (faceKeys)
|
|
130860
131001
|
for (const k of faceKeys)
|
|
130861
131002
|
statuses.push(this.#faceStatus.get(k) ?? "unloaded");
|
|
@@ -130998,6 +131139,10 @@ var isRegExp = (value) => {
|
|
|
130998
131139
|
}
|
|
130999
131140
|
}
|
|
131000
131141
|
#warnFaceFailureOnce(request, key) {
|
|
131142
|
+
if (BUNDLED_SUBSTITUTE_FAMILIES.has(request.family)) {
|
|
131143
|
+
this.#warnBundledSubstituteFailureOnce(request.family);
|
|
131144
|
+
return;
|
|
131145
|
+
}
|
|
131001
131146
|
if (this.#warnedFaceFailures.has(key))
|
|
131002
131147
|
return;
|
|
131003
131148
|
this.#warnedFaceFailures.add(key);
|
|
@@ -131048,6 +131193,10 @@ var isRegExp = (value) => {
|
|
|
131048
131193
|
}
|
|
131049
131194
|
}
|
|
131050
131195
|
#warnLoadFailureOnce(family$1) {
|
|
131196
|
+
if (BUNDLED_SUBSTITUTE_FAMILIES.has(family$1)) {
|
|
131197
|
+
this.#warnBundledSubstituteFailureOnce(family$1);
|
|
131198
|
+
return;
|
|
131199
|
+
}
|
|
131051
131200
|
if (this.#warnedFailures.has(family$1))
|
|
131052
131201
|
return;
|
|
131053
131202
|
this.#warnedFailures.add(family$1);
|
|
@@ -131055,7 +131204,18 @@ var isRegExp = (value) => {
|
|
|
131055
131204
|
const detail = sources && sources.length ? ` from ${sources.join(", ")}` : "";
|
|
131056
131205
|
console.warn(`[superdoc] font asset failed to load for "${family$1}"${detail}. Check fonts.assetBaseUrl / fonts.resolveAssetUrl so the bundled .woff2 are served.`);
|
|
131057
131206
|
}
|
|
131058
|
-
|
|
131207
|
+
#warnBundledSubstituteFailureOnce(family$1) {
|
|
131208
|
+
if (this.#warnedBundledSubstituteFailure)
|
|
131209
|
+
return;
|
|
131210
|
+
this.#warnedBundledSubstituteFailure = true;
|
|
131211
|
+
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:
|
|
131212
|
+
- install @superdoc-dev/fonts and pass it:
|
|
131213
|
+
import { superdocFonts } from '@superdoc-dev/fonts';
|
|
131214
|
+
new SuperDoc({ /* ... */ fonts: superdocFonts });
|
|
131215
|
+
- or set fonts.assetBaseUrl / fonts.resolveAssetUrl to where the bundled .woff2 are served.
|
|
131216
|
+
Docs: https://docs.superdoc.dev/getting-started/fonts`);
|
|
131217
|
+
}
|
|
131218
|
+
}, 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) => {
|
|
131059
131219
|
return {
|
|
131060
131220
|
...comment,
|
|
131061
131221
|
commentParaId: generateDocxRandomId()
|
|
@@ -135176,7 +135336,7 @@ var isRegExp = (value) => {
|
|
|
135176
135336
|
sourceId: stringOf(primary.sourceId),
|
|
135177
135337
|
revisionGroupId: stringOf(primary.revisionGroupId) || representativeRevisionId
|
|
135178
135338
|
});
|
|
135179
|
-
}, 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_MODES2, 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.
|
|
135339
|
+
}, 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_MODES2, 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 }) => {
|
|
135180
135340
|
if (!runProps?.elements?.length || !state)
|
|
135181
135341
|
return;
|
|
135182
135342
|
const fontsNode = runProps.elements.find((el) => el.name === "w:rFonts");
|
|
@@ -135210,7 +135370,7 @@ var isRegExp = (value) => {
|
|
|
135210
135370
|
state.kern = kernNode.attributes["w:val"];
|
|
135211
135371
|
}
|
|
135212
135372
|
}, SuperConverter;
|
|
135213
|
-
var
|
|
135373
|
+
var init_SuperConverter_cG5SxcH9_es = __esm(() => {
|
|
135214
135374
|
init_rolldown_runtime_Bg48TavK_es();
|
|
135215
135375
|
init_jszip_C49i9kUs_es();
|
|
135216
135376
|
init_xml_js_CqGKpaft_es();
|
|
@@ -174121,6 +174281,17 @@ var init_SuperConverter_DAuqlmYY_es = __esm(() => {
|
|
|
174121
174281
|
}]),
|
|
174122
174282
|
family("TeX Gyre Bonum", "TeXGyreBonum", "LicenseRef-GUST-Font-License-1.0")
|
|
174123
174283
|
]);
|
|
174284
|
+
installedRegistries = /* @__PURE__ */ new WeakMap;
|
|
174285
|
+
FULLY_ACTIVE_BUNDLED = Object.freeze({
|
|
174286
|
+
packConfigured: true,
|
|
174287
|
+
isActive: () => true,
|
|
174288
|
+
signature: ""
|
|
174289
|
+
});
|
|
174290
|
+
BASELINE_BUNDLED = Object.freeze({
|
|
174291
|
+
packConfigured: false,
|
|
174292
|
+
isActive: () => false,
|
|
174293
|
+
signature: JSON.stringify({ p: false })
|
|
174294
|
+
});
|
|
174124
174295
|
SUBSTITUTION_EVIDENCE = SUBSTITUTION_EVIDENCE$1;
|
|
174125
174296
|
bundledFamilies = new Set(BUNDLED_MANIFEST.map((f2) => f2.family));
|
|
174126
174297
|
BUNDLED_SUBSTITUTES = deriveBundledSubstitutes();
|
|
@@ -174130,9 +174301,9 @@ var init_SuperConverter_DAuqlmYY_es = __esm(() => {
|
|
|
174130
174301
|
resolvePhysical: (cssFontFamily, _face) => resolvePhysicalFamily(cssFontFamily),
|
|
174131
174302
|
fontSignature: ""
|
|
174132
174303
|
});
|
|
174133
|
-
installedRegistries = /* @__PURE__ */ new WeakMap;
|
|
174134
174304
|
RENDER_ALL = { canRenderFamily: () => true };
|
|
174135
174305
|
OS2_MIN_LENGTH = OS2_FSSELECTION + 2;
|
|
174306
|
+
BUNDLED_SUBSTITUTE_FAMILIES = new Set(BUNDLED_MANIFEST.map((f2) => f2.family));
|
|
174136
174307
|
registriesByFontSet = /* @__PURE__ */ new WeakMap;
|
|
174137
174308
|
BUNDLED_FAMILIES = new Set(BUNDLED_MANIFEST.map((f2) => f2.family));
|
|
174138
174309
|
SUPPORTED_ALIAS_FAMILIES = new Set([
|
|
@@ -174140,6 +174311,11 @@ var init_SuperConverter_DAuqlmYY_es = __esm(() => {
|
|
|
174140
174311
|
"Courier",
|
|
174141
174312
|
"Times"
|
|
174142
174313
|
]);
|
|
174314
|
+
BUILT_IN_TOOLBAR_BASELINE_FAMILIES = new Set([
|
|
174315
|
+
"Arial",
|
|
174316
|
+
"Courier New",
|
|
174317
|
+
"Times New Roman"
|
|
174318
|
+
]);
|
|
174143
174319
|
ADVERTISED_BUILT_IN_TOOLBAR_FAMILIES = new Set([
|
|
174144
174320
|
"Arial Black",
|
|
174145
174321
|
"Arial Narrow",
|
|
@@ -174160,6 +174336,8 @@ var init_SuperConverter_DAuqlmYY_es = __esm(() => {
|
|
|
174160
174336
|
"Verdana"
|
|
174161
174337
|
]);
|
|
174162
174338
|
FONT_OFFERINGS = deriveOfferings();
|
|
174339
|
+
BUNDLED_LOGICAL_FAMILIES = [...new Set(FONT_OFFERINGS.filter((o) => o.bundled).map((o) => o.logicalFamily))].sort((a, b) => a.localeCompare(b, "en", { sensitivity: "base" }));
|
|
174340
|
+
BUNDLED_LOGICAL_KEYS = new Set(BUNDLED_LOGICAL_FAMILIES.map(normalizeFamilyKey));
|
|
174163
174341
|
ALL_COMMENT_TARGETS = COMMENT_FILE_BASENAMES;
|
|
174164
174342
|
REL_ID_NUMERIC_PATTERN = /rId|mi/g;
|
|
174165
174343
|
FOOTNOTES_CONFIG$1 = {
|
|
@@ -175954,7 +176132,7 @@ var init_SuperConverter_DAuqlmYY_es = __esm(() => {
|
|
|
175954
176132
|
};
|
|
175955
176133
|
});
|
|
175956
176134
|
|
|
175957
|
-
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-
|
|
176135
|
+
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-tAtxEvrl.es.js
|
|
175958
176136
|
function parseSizeUnit(val = "0") {
|
|
175959
176137
|
const length3 = val.toString() || "0";
|
|
175960
176138
|
const value = Number.parseFloat(length3);
|
|
@@ -186603,8 +186781,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
|
|
|
186603
186781
|
}
|
|
186604
186782
|
};
|
|
186605
186783
|
};
|
|
186606
|
-
var
|
|
186607
|
-
|
|
186784
|
+
var init_create_headless_toolbar_tAtxEvrl_es = __esm(() => {
|
|
186785
|
+
init_SuperConverter_cG5SxcH9_es();
|
|
186608
186786
|
init_uuid_B2wVPhPi_es();
|
|
186609
186787
|
init_constants_D9qj59G2_es();
|
|
186610
186788
|
init_dist_B8HfvhaK_es();
|
|
@@ -235773,7 +235951,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
235773
235951
|
init_remark_gfm_BhnWr3yf_es();
|
|
235774
235952
|
});
|
|
235775
235953
|
|
|
235776
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
235954
|
+
// ../../packages/superdoc/dist/chunks/src-B-44dC3g.es.js
|
|
235777
235955
|
function deleteProps(obj, propOrProps) {
|
|
235778
235956
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
235779
235957
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -235847,7 +236025,7 @@ function prosemirrorToYXmlFragment(doc$12, xmlFragment) {
|
|
|
235847
236025
|
}
|
|
235848
236026
|
function getSuperdocVersion() {
|
|
235849
236027
|
try {
|
|
235850
|
-
return "1.
|
|
236028
|
+
return "1.40.0";
|
|
235851
236029
|
} catch {
|
|
235852
236030
|
return "unknown";
|
|
235853
236031
|
}
|
|
@@ -248133,20 +248311,32 @@ function scrollToElement(targetElement, options = {
|
|
|
248133
248311
|
behavior: options.behavior
|
|
248134
248312
|
});
|
|
248135
248313
|
}
|
|
248314
|
+
function toolbarFontOptionsFor(activation = BASELINE_BUNDLED) {
|
|
248315
|
+
return getBuiltInToolbarFontOfferings(activation).map((offering) => ({
|
|
248316
|
+
label: offering.logicalFamily,
|
|
248317
|
+
key: fontOfferingStack(offering),
|
|
248318
|
+
fontWeight: 400,
|
|
248319
|
+
props: {
|
|
248320
|
+
style: { fontFamily: fontOfferingRenderStack(offering) },
|
|
248321
|
+
"data-item": "btn-fontFamily-option"
|
|
248322
|
+
}
|
|
248323
|
+
}));
|
|
248324
|
+
}
|
|
248136
248325
|
function normalizeToolbarFamily(value) {
|
|
248137
248326
|
return String(value ?? "").trim().toLowerCase();
|
|
248138
248327
|
}
|
|
248139
248328
|
function compareToolbarFontOptions(a2, b$1) {
|
|
248140
248329
|
return String(a2.label ?? "").trim().localeCompare(String(b$1.label ?? "").trim(), "en", { sensitivity: "base" });
|
|
248141
248330
|
}
|
|
248142
|
-
function composeToolbarFontOptions(documentOptions, configFonts) {
|
|
248331
|
+
function composeToolbarFontOptions(documentOptions, configFonts, activation = BASELINE_BUNDLED) {
|
|
248143
248332
|
if (configFonts)
|
|
248144
248333
|
return configFonts;
|
|
248145
|
-
if (!documentOptions?.length)
|
|
248334
|
+
if (!activation.packConfigured && !documentOptions?.length)
|
|
248146
248335
|
return;
|
|
248147
|
-
const
|
|
248148
|
-
const
|
|
248149
|
-
|
|
248336
|
+
const base5 = toolbarFontOptionsFor(activation);
|
|
248337
|
+
const seen = new Set(base5.map((option) => normalizeToolbarFamily(option.label)));
|
|
248338
|
+
const merged = [...base5];
|
|
248339
|
+
for (const option of documentOptions ?? []) {
|
|
248150
248340
|
const dedupeKey = normalizeToolbarFamily(option.logicalFamily);
|
|
248151
248341
|
if (seen.has(dedupeKey))
|
|
248152
248342
|
continue;
|
|
@@ -248161,7 +248351,7 @@ function composeToolbarFontOptions(documentOptions, configFonts) {
|
|
|
248161
248351
|
}
|
|
248162
248352
|
});
|
|
248163
248353
|
}
|
|
248164
|
-
return merged.
|
|
248354
|
+
return merged.sort(compareToolbarFontOptions);
|
|
248165
248355
|
}
|
|
248166
248356
|
function isExtensionRulesEnabled(extension3, enabled) {
|
|
248167
248357
|
if (Array.isArray(enabled))
|
|
@@ -313424,7 +313614,7 @@ var Node$13 = class Node$14 {
|
|
|
313424
313614
|
domAvailabilityCache = false;
|
|
313425
313615
|
return false;
|
|
313426
313616
|
}
|
|
313427
|
-
}, summaryVersion = "1.
|
|
313617
|
+
}, summaryVersion = "1.40.0", nodeKeys, markKeys, transformListsInCopiedContent = (html3) => {
|
|
313428
313618
|
const container = document.createElement("div");
|
|
313429
313619
|
container.innerHTML = html3;
|
|
313430
313620
|
const result = [];
|
|
@@ -314610,7 +314800,7 @@ var Node$13 = class Node$14 {
|
|
|
314610
314800
|
return () => {};
|
|
314611
314801
|
const handle3 = setInterval(callback, intervalMs);
|
|
314612
314802
|
return () => clearInterval(handle3);
|
|
314613
|
-
}, 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.
|
|
314803
|
+
}, 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) => {
|
|
314614
314804
|
if (!isTrackedReviewMark(mark2))
|
|
314615
314805
|
return null;
|
|
314616
314806
|
const id2 = typeof mark2.attrs?.id === "string" ? mark2.attrs.id : "";
|
|
@@ -333925,6 +334115,8 @@ menclose::after {
|
|
|
333925
334115
|
}
|
|
333926
334116
|
applyInitialConfig(config2) {
|
|
333927
334117
|
this.#cancelPendingRuntimeReflow();
|
|
334118
|
+
warnUnknownBundledSelection(config2?.bundled);
|
|
334119
|
+
this.#resolver.setActivation(deriveBundledActivation(config2));
|
|
333928
334120
|
if (!config2)
|
|
333929
334121
|
return;
|
|
333930
334122
|
const registered$1 = this.#registerFamilies(config2.families);
|
|
@@ -334150,13 +334342,13 @@ menclose::after {
|
|
|
334150
334342
|
return;
|
|
334151
334343
|
console.log(...args$1);
|
|
334152
334344
|
}, 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;
|
|
334153
|
-
var
|
|
334345
|
+
var init_src_B_44dC3g_es = __esm(() => {
|
|
334154
334346
|
init_rolldown_runtime_Bg48TavK_es();
|
|
334155
|
-
|
|
334347
|
+
init_SuperConverter_cG5SxcH9_es();
|
|
334156
334348
|
init_jszip_C49i9kUs_es();
|
|
334157
334349
|
init_xml_js_CqGKpaft_es();
|
|
334158
334350
|
init_uuid_B2wVPhPi_es();
|
|
334159
|
-
|
|
334351
|
+
init_create_headless_toolbar_tAtxEvrl_es();
|
|
334160
334352
|
init_constants_D9qj59G2_es();
|
|
334161
334353
|
init_dist_B8HfvhaK_es();
|
|
334162
334354
|
init_unified_Dsuw2be5_es();
|
|
@@ -354976,15 +355168,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
354976
355168
|
};
|
|
354977
355169
|
}
|
|
354978
355170
|
}, [["__scopeId", "data-v-d25821a5"]]);
|
|
354979
|
-
TOOLBAR_FONTS =
|
|
354980
|
-
label: offering.logicalFamily,
|
|
354981
|
-
key: fontOfferingStack(offering),
|
|
354982
|
-
fontWeight: 400,
|
|
354983
|
-
props: {
|
|
354984
|
-
style: { fontFamily: fontOfferingRenderStack(offering) },
|
|
354985
|
-
"data-item": "btn-fontFamily-option"
|
|
354986
|
-
}
|
|
354987
|
-
}));
|
|
355171
|
+
TOOLBAR_FONTS = toolbarFontOptionsFor(BASELINE_BUNDLED);
|
|
354988
355172
|
TOOLBAR_FONT_SIZES = [
|
|
354989
355173
|
{
|
|
354990
355174
|
label: "8",
|
|
@@ -357562,7 +357746,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
357562
357746
|
this.overflowItems = overflowItems.filter((item) => allConfigItems.includes(item.name.value));
|
|
357563
357747
|
}
|
|
357564
357748
|
#resolveToolbarFonts(configFonts) {
|
|
357565
|
-
return composeToolbarFontOptions(this.superdoc?.fonts?.getDocumentFontOptions?.() ?? [], configFonts);
|
|
357749
|
+
return composeToolbarFontOptions(this.superdoc?.fonts?.getDocumentFontOptions?.() ?? [], configFonts, deriveBundledActivation(this.superdoc?.config?.fonts));
|
|
357566
357750
|
}
|
|
357567
357751
|
#rebuildToolbarItems() {
|
|
357568
357752
|
this.#makeToolbarItems({
|
|
@@ -369943,11 +370127,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
369943
370127
|
]);
|
|
369944
370128
|
});
|
|
369945
370129
|
|
|
369946
|
-
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-
|
|
370130
|
+
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-CFVSuPWF.es.js
|
|
369947
370131
|
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;
|
|
369948
|
-
var
|
|
369949
|
-
|
|
369950
|
-
|
|
370132
|
+
var init_create_super_doc_ui_CFVSuPWF_es = __esm(() => {
|
|
370133
|
+
init_SuperConverter_cG5SxcH9_es();
|
|
370134
|
+
init_create_headless_toolbar_tAtxEvrl_es();
|
|
369951
370135
|
DEFAULT_TEXT_ALIGN_OPTIONS = [
|
|
369952
370136
|
{
|
|
369953
370137
|
label: "Left",
|
|
@@ -370238,16 +370422,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
|
|
|
370238
370422
|
|
|
370239
370423
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
370240
370424
|
var init_super_editor_es = __esm(() => {
|
|
370241
|
-
|
|
370242
|
-
|
|
370425
|
+
init_src_B_44dC3g_es();
|
|
370426
|
+
init_SuperConverter_cG5SxcH9_es();
|
|
370243
370427
|
init_jszip_C49i9kUs_es();
|
|
370244
370428
|
init_xml_js_CqGKpaft_es();
|
|
370245
|
-
|
|
370429
|
+
init_create_headless_toolbar_tAtxEvrl_es();
|
|
370246
370430
|
init_constants_D9qj59G2_es();
|
|
370247
370431
|
init_dist_B8HfvhaK_es();
|
|
370248
370432
|
init_unified_Dsuw2be5_es();
|
|
370249
370433
|
init_DocxZipper_FUsfThjV_es();
|
|
370250
|
-
|
|
370434
|
+
init_create_super_doc_ui_CFVSuPWF_es();
|
|
370251
370435
|
init_ui_C5PAS9hY_es();
|
|
370252
370436
|
init_eventemitter3_BnGqBE_Q_es();
|
|
370253
370437
|
init_errors_CNaD6vcg_es();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/cli",
|
|
3
|
-
"version": "0.17.0-next.
|
|
3
|
+
"version": "0.17.0-next.31",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"superdoc": "./dist/index.js"
|
|
@@ -26,18 +26,18 @@
|
|
|
26
26
|
"typescript": "^5.9.2",
|
|
27
27
|
"@superdoc/document-api": "0.0.1",
|
|
28
28
|
"@superdoc/super-editor": "0.0.1",
|
|
29
|
-
"superdoc": "1.
|
|
29
|
+
"superdoc": "1.40.0"
|
|
30
30
|
},
|
|
31
31
|
"module": "src/index.ts",
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"optionalDependencies": {
|
|
36
|
-
"@superdoc-dev/cli-
|
|
37
|
-
"@superdoc-dev/cli-darwin-x64": "0.17.0-next.
|
|
38
|
-
"@superdoc-dev/cli-
|
|
39
|
-
"@superdoc-dev/cli-windows-x64": "0.17.0-next.
|
|
40
|
-
"@superdoc-dev/cli-linux-
|
|
36
|
+
"@superdoc-dev/cli-linux-x64": "0.17.0-next.31",
|
|
37
|
+
"@superdoc-dev/cli-darwin-x64": "0.17.0-next.31",
|
|
38
|
+
"@superdoc-dev/cli-darwin-arm64": "0.17.0-next.31",
|
|
39
|
+
"@superdoc-dev/cli-windows-x64": "0.17.0-next.31",
|
|
40
|
+
"@superdoc-dev/cli-linux-arm64": "0.17.0-next.31"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"predev": "node scripts/ensure-superdoc-build.js",
|