@superdoc-dev/mcp 0.12.0-next.31 → 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.
- package/dist/index.js +72 -28
- package/package.json +1 -1
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-
|
|
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")
|
|
@@ -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
|
|
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) {
|
|
@@ -87069,7 +87079,9 @@ function bundledAssetSignature(resolve) {
|
|
|
87069
87079
|
});
|
|
87070
87080
|
}
|
|
87071
87081
|
function installBundledSubstitutes(registry2, options = {}) {
|
|
87072
|
-
const
|
|
87082
|
+
const baseResolve = (context) => joinUrl(options.assetBaseUrl ?? defaultAssetBase, context.file);
|
|
87083
|
+
const candidate = options.resolveAssetUrl;
|
|
87084
|
+
const resolve = typeof candidate === "function" ? candidate : baseResolve;
|
|
87073
87085
|
const signature = bundledAssetSignature(resolve);
|
|
87074
87086
|
const installed = installedRegistries.get(registry2);
|
|
87075
87087
|
if (installed !== undefined) {
|
|
@@ -87078,6 +87090,8 @@ function installBundledSubstitutes(registry2, options = {}) {
|
|
|
87078
87090
|
return;
|
|
87079
87091
|
}
|
|
87080
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.");
|
|
87081
87095
|
for (const family$1 of BUNDLED_MANIFEST)
|
|
87082
87096
|
for (const face of family$1.faces) {
|
|
87083
87097
|
const context = {
|
|
@@ -87109,8 +87123,9 @@ function normalizeList(families) {
|
|
|
87109
87123
|
function createBundledActivation(input) {
|
|
87110
87124
|
if (!input.packConfigured)
|
|
87111
87125
|
return BASELINE_BUNDLED;
|
|
87126
|
+
const includeProvided = input.include != null;
|
|
87112
87127
|
const include = normalizeList(input.include);
|
|
87113
|
-
const exclude =
|
|
87128
|
+
const exclude = includeProvided ? undefined : normalizeList(input.exclude);
|
|
87114
87129
|
if (!include && !exclude)
|
|
87115
87130
|
return FULLY_ACTIVE_BUNDLED;
|
|
87116
87131
|
if (include) {
|
|
@@ -87501,12 +87516,14 @@ function coerceCurationList(value, field) {
|
|
|
87501
87516
|
function warnUnknownBundledSelection(selection) {
|
|
87502
87517
|
if (!selection)
|
|
87503
87518
|
return;
|
|
87519
|
+
const includeProvided = selection.include != null;
|
|
87504
87520
|
const include = coerceCurationList(selection.include, "include");
|
|
87505
87521
|
const exclude = coerceCurationList(selection.exclude, "exclude");
|
|
87506
|
-
if (
|
|
87522
|
+
if (includeProvided && exclude.length > 0)
|
|
87507
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;
|
|
87508
87525
|
const seen = /* @__PURE__ */ new Set;
|
|
87509
|
-
for (const name of
|
|
87526
|
+
for (const name of effective) {
|
|
87510
87527
|
const trimmed = typeof name === "string" ? name.trim() : "";
|
|
87511
87528
|
if (!trimmed)
|
|
87512
87529
|
continue;
|
|
@@ -87518,6 +87535,29 @@ function warnUnknownBundledSelection(selection) {
|
|
|
87518
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`);
|
|
87519
87536
|
}
|
|
87520
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
|
+
}
|
|
87521
87561
|
function normalizeKey(family$1) {
|
|
87522
87562
|
return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
|
|
87523
87563
|
}
|
|
@@ -119215,7 +119255,7 @@ Docs: https://docs.superdoc.dev/getting-started/fonts`);
|
|
|
119215
119255
|
state.kern = kernNode.attributes["w:val"];
|
|
119216
119256
|
}
|
|
119217
119257
|
}, SuperConverter;
|
|
119218
|
-
var
|
|
119258
|
+
var init_SuperConverter_C3uAnS0b_es = __esm(() => {
|
|
119219
119259
|
init_rolldown_runtime_Bg48TavK_es();
|
|
119220
119260
|
init_jszip_C49i9kUs_es();
|
|
119221
119261
|
init_xml_js_CqGKpaft_es();
|
|
@@ -159977,7 +160017,7 @@ var init_SuperConverter_cG5SxcH9_es = __esm(() => {
|
|
|
159977
160017
|
};
|
|
159978
160018
|
});
|
|
159979
160019
|
|
|
159980
|
-
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-
|
|
160020
|
+
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-CSJZe3lZ.es.js
|
|
159981
160021
|
function parseSizeUnit(val = "0") {
|
|
159982
160022
|
const length = val.toString() || "0";
|
|
159983
160023
|
const value = Number.parseFloat(length);
|
|
@@ -170626,8 +170666,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
|
|
|
170626
170666
|
}
|
|
170627
170667
|
};
|
|
170628
170668
|
};
|
|
170629
|
-
var
|
|
170630
|
-
|
|
170669
|
+
var init_create_headless_toolbar_CSJZe3lZ_es = __esm(() => {
|
|
170670
|
+
init_SuperConverter_C3uAnS0b_es();
|
|
170631
170671
|
init_uuid_B2wVPhPi_es();
|
|
170632
170672
|
init_constants_D9qj59G2_es();
|
|
170633
170673
|
init_dist_B8HfvhaK_es();
|
|
@@ -225317,7 +225357,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
225317
225357
|
init_remark_gfm_BhnWr3yf_es();
|
|
225318
225358
|
});
|
|
225319
225359
|
|
|
225320
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
225360
|
+
// ../../packages/superdoc/dist/chunks/src-CsnSYD0u.es.js
|
|
225321
225361
|
function deleteProps(obj, propOrProps) {
|
|
225322
225362
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
225323
225363
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -323349,7 +323389,7 @@ menclose::after {
|
|
|
323349
323389
|
applyInitialConfig(config3) {
|
|
323350
323390
|
this.#cancelPendingRuntimeReflow();
|
|
323351
323391
|
warnUnknownBundledSelection(config3?.bundled);
|
|
323352
|
-
this.#resolver.setActivation(
|
|
323392
|
+
this.#resolver.setActivation(deriveBundledActivationForConfig(config3));
|
|
323353
323393
|
if (!config3)
|
|
323354
323394
|
return;
|
|
323355
323395
|
const registered$1 = this.#registerFamilies(config3.families);
|
|
@@ -323575,13 +323615,13 @@ menclose::after {
|
|
|
323575
323615
|
return;
|
|
323576
323616
|
console.log(...args$1);
|
|
323577
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;
|
|
323578
|
-
var
|
|
323618
|
+
var init_src_CsnSYD0u_es = __esm(() => {
|
|
323579
323619
|
init_rolldown_runtime_Bg48TavK_es();
|
|
323580
|
-
|
|
323620
|
+
init_SuperConverter_C3uAnS0b_es();
|
|
323581
323621
|
init_jszip_C49i9kUs_es();
|
|
323582
323622
|
init_xml_js_CqGKpaft_es();
|
|
323583
323623
|
init_uuid_B2wVPhPi_es();
|
|
323584
|
-
|
|
323624
|
+
init_create_headless_toolbar_CSJZe3lZ_es();
|
|
323585
323625
|
init_constants_D9qj59G2_es();
|
|
323586
323626
|
init_dist_B8HfvhaK_es();
|
|
323587
323627
|
init_unified_Dsuw2be5_es();
|
|
@@ -346979,7 +347019,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
346979
347019
|
this.overflowItems = overflowItems.filter((item) => allConfigItems.includes(item.name.value));
|
|
346980
347020
|
}
|
|
346981
347021
|
#resolveToolbarFonts(configFonts) {
|
|
346982
|
-
return composeToolbarFontOptions(this.superdoc?.fonts?.getDocumentFontOptions?.() ?? [], configFonts,
|
|
347022
|
+
return composeToolbarFontOptions(this.superdoc?.fonts?.getDocumentFontOptions?.() ?? [], configFonts, deriveBundledActivationForConfig(this.superdoc?.config?.fonts));
|
|
346983
347023
|
}
|
|
346984
347024
|
#rebuildToolbarItems() {
|
|
346985
347025
|
this.#makeToolbarItems({
|
|
@@ -353067,10 +353107,14 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
353067
353107
|
getRequiredFaces: () => this.#fontPlan?.requiredFaces ?? [],
|
|
353068
353108
|
getUsedFaces: () => this.#fontPlan?.usedFaces ?? [],
|
|
353069
353109
|
fontResolver: this.#fontResolver,
|
|
353070
|
-
onRegistryResolved: (registry3) =>
|
|
353071
|
-
|
|
353072
|
-
|
|
353073
|
-
|
|
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
|
+
},
|
|
353074
353118
|
getFontEnvironment: () => {
|
|
353075
353119
|
const ownerDoc = this.#visibleHost?.ownerDocument ?? (typeof document !== "undefined" ? document : null);
|
|
353076
353120
|
const view = ownerDoc?.defaultView ?? (typeof window !== "undefined" ? window : null);
|
|
@@ -359360,11 +359404,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
359360
359404
|
]);
|
|
359361
359405
|
});
|
|
359362
359406
|
|
|
359363
|
-
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-
|
|
359407
|
+
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-B9SVqVK2.es.js
|
|
359364
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;
|
|
359365
|
-
var
|
|
359366
|
-
|
|
359367
|
-
|
|
359409
|
+
var init_create_super_doc_ui_B9SVqVK2_es = __esm(() => {
|
|
359410
|
+
init_SuperConverter_C3uAnS0b_es();
|
|
359411
|
+
init_create_headless_toolbar_CSJZe3lZ_es();
|
|
359368
359412
|
DEFAULT_TEXT_ALIGN_OPTIONS = [
|
|
359369
359413
|
{
|
|
359370
359414
|
label: "Left",
|
|
@@ -359655,16 +359699,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
|
|
|
359655
359699
|
|
|
359656
359700
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
359657
359701
|
var init_super_editor_es = __esm(() => {
|
|
359658
|
-
|
|
359659
|
-
|
|
359702
|
+
init_src_CsnSYD0u_es();
|
|
359703
|
+
init_SuperConverter_C3uAnS0b_es();
|
|
359660
359704
|
init_jszip_C49i9kUs_es();
|
|
359661
359705
|
init_xml_js_CqGKpaft_es();
|
|
359662
|
-
|
|
359706
|
+
init_create_headless_toolbar_CSJZe3lZ_es();
|
|
359663
359707
|
init_constants_D9qj59G2_es();
|
|
359664
359708
|
init_dist_B8HfvhaK_es();
|
|
359665
359709
|
init_unified_Dsuw2be5_es();
|
|
359666
359710
|
init_DocxZipper_FUsfThjV_es();
|
|
359667
|
-
|
|
359711
|
+
init_create_super_doc_ui_B9SVqVK2_es();
|
|
359668
359712
|
init_ui_C5PAS9hY_es();
|
|
359669
359713
|
init_eventemitter3_BnGqBE_Q_es();
|
|
359670
359714
|
init_errors_CNaD6vcg_es();
|