@superdoc-dev/mcp 0.3.0-next.67 → 0.3.0-next.68
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 +44 -9
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -199379,7 +199379,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
199379
199379
|
init_remark_gfm_BhnWr3yf_es();
|
|
199380
199380
|
});
|
|
199381
199381
|
|
|
199382
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
199382
|
+
// ../../packages/superdoc/dist/chunks/src-BBPU9hdN.es.js
|
|
199383
199383
|
function deleteProps(obj, propOrProps) {
|
|
199384
199384
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
199385
199385
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -247069,16 +247069,43 @@ function layoutDocument(blocks2, measures, options = {}) {
|
|
|
247069
247069
|
return Math.max(baseBottomMargin, currentFooterDistance + footerContentHeight);
|
|
247070
247070
|
return baseBottomMargin;
|
|
247071
247071
|
};
|
|
247072
|
+
const MIN_BODY_CONTENT_HEIGHT = 1;
|
|
247073
|
+
const clampHeaderFooterInflatedMargins = (topMargin, bottomMargin, baseTopMargin, baseBottomMargin, currentPageHeight) => {
|
|
247074
|
+
const maxMarginTotal = currentPageHeight - MIN_BODY_CONTENT_HEIGHT;
|
|
247075
|
+
if (topMargin + bottomMargin <= maxMarginTotal)
|
|
247076
|
+
return {
|
|
247077
|
+
top: topMargin,
|
|
247078
|
+
bottom: bottomMargin
|
|
247079
|
+
};
|
|
247080
|
+
const baseMarginTotal = baseTopMargin + baseBottomMargin;
|
|
247081
|
+
if (baseMarginTotal >= maxMarginTotal)
|
|
247082
|
+
return {
|
|
247083
|
+
top: topMargin,
|
|
247084
|
+
bottom: bottomMargin
|
|
247085
|
+
};
|
|
247086
|
+
const topInflation = Math.max(0, topMargin - baseTopMargin);
|
|
247087
|
+
const bottomInflation = Math.max(0, bottomMargin - baseBottomMargin);
|
|
247088
|
+
const totalInflation = topInflation + bottomInflation;
|
|
247089
|
+
if (totalInflation <= 0)
|
|
247090
|
+
return {
|
|
247091
|
+
top: topMargin,
|
|
247092
|
+
bottom: bottomMargin
|
|
247093
|
+
};
|
|
247094
|
+
const availableInflation = maxMarginTotal - baseMarginTotal;
|
|
247095
|
+
return {
|
|
247096
|
+
top: baseTopMargin + availableInflation * (topInflation / totalInflation),
|
|
247097
|
+
bottom: baseBottomMargin + availableInflation * (bottomInflation / totalInflation)
|
|
247098
|
+
};
|
|
247099
|
+
};
|
|
247072
247100
|
const maxHeaderContentHeight = headerContentHeights ? Math.max(0, validateContentHeight(headerContentHeights.default), validateContentHeight(headerContentHeights.first), validateContentHeight(headerContentHeights.even), validateContentHeight(headerContentHeights.odd)) : 0;
|
|
247073
247101
|
const maxFooterContentHeight = footerContentHeights ? Math.max(0, validateContentHeight(footerContentHeights.default), validateContentHeight(footerContentHeights.first), validateContentHeight(footerContentHeights.even), validateContentHeight(footerContentHeights.odd)) : 0;
|
|
247074
247102
|
const headerDistance = margins.header ?? margins.top;
|
|
247075
247103
|
const footerDistance = margins.footer ?? margins.bottom;
|
|
247076
247104
|
const defaultHeaderHeight = getHeaderHeightForPage("default", undefined, 0);
|
|
247077
247105
|
const defaultFooterHeight = getFooterHeightForPage("default", undefined, 0);
|
|
247078
|
-
const
|
|
247079
|
-
|
|
247080
|
-
let
|
|
247081
|
-
let activeBottomMargin = effectiveBottomMargin;
|
|
247106
|
+
const effectiveMargins = clampHeaderFooterInflatedMargins(calculateEffectiveTopMargin(defaultHeaderHeight, headerDistance, margins.top), calculateEffectiveBottomMargin(defaultFooterHeight, footerDistance, margins.bottom), margins.top, margins.bottom, pageSize.h);
|
|
247107
|
+
let activeTopMargin = effectiveMargins.top;
|
|
247108
|
+
let activeBottomMargin = effectiveMargins.bottom;
|
|
247082
247109
|
let activeLeftMargin = margins.left;
|
|
247083
247110
|
let activeRightMargin = margins.right;
|
|
247084
247111
|
let pendingTopMargin = null;
|
|
@@ -247510,8 +247537,9 @@ function layoutDocument(blocks2, measures, options = {}) {
|
|
|
247510
247537
|
footerRef = defaultFooterRef;
|
|
247511
247538
|
const headerHeight = getHeaderHeightForPage(effectiveVariantType, headerRef, activeSectionIndex);
|
|
247512
247539
|
const footerHeight = getFooterHeightForPage(variantType !== "default" && !activeSectionRefs?.footerRefs?.[variantType] ? "default" : variantType, footerRef, activeSectionIndex);
|
|
247513
|
-
|
|
247514
|
-
|
|
247540
|
+
const adjustedMargins = clampHeaderFooterInflatedMargins(calculateEffectiveTopMargin(headerHeight, activeHeaderDistance, activeSectionBaseTopMargin), calculateEffectiveBottomMargin(footerHeight, activeFooterDistance, activeSectionBaseBottomMargin), activeSectionBaseTopMargin, activeSectionBaseBottomMargin, activePageSize.h);
|
|
247541
|
+
activeTopMargin = adjustedMargins.top;
|
|
247542
|
+
activeBottomMargin = adjustedMargins.bottom;
|
|
247515
247543
|
layoutLog(`[Layout] Page ${newPageNumber}: Using variant '${variantType}' - headerHeight: ${headerHeight}, footerHeight: ${footerHeight}`);
|
|
247516
247544
|
layoutLog(`[Layout] Page ${newPageNumber}: Adjusted margins - top: ${activeTopMargin}, bottom: ${activeBottomMargin} (base: ${activeSectionBaseTopMargin}, ${activeSectionBaseBottomMargin})`);
|
|
247517
247545
|
return;
|
|
@@ -248415,6 +248443,13 @@ function shouldExcludeFromMeasurement(fragment, block, fragmentBottom, canvasHei
|
|
|
248415
248443
|
if (measurementBand && !rangesIntersect(fragment.y, fragmentBottom, measurementBand.start, measurementBand.end))
|
|
248416
248444
|
return true;
|
|
248417
248445
|
}
|
|
248446
|
+
const fragmentHeight = typeof fragment.height === "number" ? fragment.height : fragmentBottom - fragment.y;
|
|
248447
|
+
const fragmentWidth = typeof fragment.width === "number" ? fragment.width : 0;
|
|
248448
|
+
const heightCoversCanvas = Number.isFinite(fragmentHeight) && fragmentHeight >= canvasHeight;
|
|
248449
|
+
const widthCoversCanvas = Number.isFinite(constraints.width) && constraints.width > 0 && fragmentWidth >= constraints.width;
|
|
248450
|
+
const isOverlayWrap = anchoredBlock.wrap?.type === "None";
|
|
248451
|
+
if (kind && heightCoversCanvas && widthCoversCanvas && isOverlayWrap)
|
|
248452
|
+
return true;
|
|
248418
248453
|
return false;
|
|
248419
248454
|
}
|
|
248420
248455
|
function layoutHeaderFooter(blocks2, measures, constraints, kind) {
|
|
@@ -292130,7 +292165,7 @@ menclose::after {
|
|
|
292130
292165
|
return;
|
|
292131
292166
|
console.log(...args$1);
|
|
292132
292167
|
}, 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;
|
|
292133
|
-
var
|
|
292168
|
+
var init_src_BBPU9hdN_es = __esm(() => {
|
|
292134
292169
|
init_rolldown_runtime_Bg48TavK_es();
|
|
292135
292170
|
init_SuperConverter_CzqEoFT1_es();
|
|
292136
292171
|
init_jszip_C49i9kUs_es();
|
|
@@ -329819,7 +329854,7 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
|
|
|
329819
329854
|
|
|
329820
329855
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
329821
329856
|
var init_super_editor_es = __esm(() => {
|
|
329822
|
-
|
|
329857
|
+
init_src_BBPU9hdN_es();
|
|
329823
329858
|
init_SuperConverter_CzqEoFT1_es();
|
|
329824
329859
|
init_jszip_C49i9kUs_es();
|
|
329825
329860
|
init_xml_js_CqGKpaft_es();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/mcp",
|
|
3
|
-
"version": "0.3.0-next.
|
|
3
|
+
"version": "0.3.0-next.68",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20"
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"@types/bun": "^1.3.8",
|
|
20
20
|
"@types/node": "22.19.2",
|
|
21
21
|
"typescript": "^5.9.2",
|
|
22
|
-
"@superdoc/super-editor": "0.0.1",
|
|
23
22
|
"@superdoc/document-api": "0.0.1",
|
|
24
|
-
"superdoc": "1.31.0"
|
|
23
|
+
"superdoc": "1.31.0",
|
|
24
|
+
"@superdoc/super-editor": "0.0.1"
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|