@superdoc-dev/cli 0.7.0-next.34 → 0.7.0-next.36
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 +81 -13
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -205830,7 +205830,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
205830
205830
|
init_remark_gfm_BhnWr3yf_es();
|
|
205831
205831
|
});
|
|
205832
205832
|
|
|
205833
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
205833
|
+
// ../../packages/superdoc/dist/chunks/src-nnj-4GhR.es.js
|
|
205834
205834
|
function deleteProps(obj, propOrProps) {
|
|
205835
205835
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
205836
205836
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -245468,7 +245468,7 @@ function toCssFontFamily(fontName, options = {}) {
|
|
|
245468
245468
|
if (trimmed.includes(";"))
|
|
245469
245469
|
trimmed = splitOutsideQuotes(trimmed, ";").join(", ");
|
|
245470
245470
|
const { fallback, wordFamily } = options;
|
|
245471
|
-
const fallbackParts = normalizeParts(fallback ?? (wordFamily ? mapWordFamilyFallback(wordFamily) : undefined) ??
|
|
245471
|
+
const fallbackParts = normalizeParts(fallback ?? (wordFamily ? mapWordFamilyFallback(wordFamily) : undefined) ?? inferGenericFallbackFromFontName(trimmed));
|
|
245472
245472
|
if (fallbackParts.length === 0)
|
|
245473
245473
|
return trimmed;
|
|
245474
245474
|
const normalizedName = trimmed.toLowerCase();
|
|
@@ -253786,6 +253786,25 @@ async function incrementalLayout(previousBlocks, _previousLayout, nextBlocks, op
|
|
|
253786
253786
|
const maxReserve = computeMaxFootnoteReserve(layoutForPages, pageIndex, baseReserve);
|
|
253787
253787
|
const columns = pageColumns$1.get(pageIndex);
|
|
253788
253788
|
const columnCount = Math.max(1, Math.floor(columns?.count ?? 1));
|
|
253789
|
+
let demand = 0;
|
|
253790
|
+
for (let columnIndex = 0;columnIndex < columnCount; columnIndex += 1) {
|
|
253791
|
+
const ids = idsByColumn$1.get(pageIndex)?.get(columnIndex) ?? [];
|
|
253792
|
+
let columnDemand = 0;
|
|
253793
|
+
ids.forEach((id2, idx) => {
|
|
253794
|
+
const ranges = rangesByFootnoteId.get(id2) ?? [];
|
|
253795
|
+
let rangesHeight = 0;
|
|
253796
|
+
ranges.forEach((range) => {
|
|
253797
|
+
const spacingAfter = "spacingAfter" in range ? range.spacingAfter ?? 0 : 0;
|
|
253798
|
+
rangesHeight += range.height + spacingAfter;
|
|
253799
|
+
});
|
|
253800
|
+
columnDemand += rangesHeight + (idx > 0 ? safeGap : 0);
|
|
253801
|
+
});
|
|
253802
|
+
if (columnDemand > 0)
|
|
253803
|
+
columnDemand += safeSeparatorSpacingBefore + safeDividerHeight + safeTopPadding;
|
|
253804
|
+
if (columnDemand > demand)
|
|
253805
|
+
demand = columnDemand;
|
|
253806
|
+
}
|
|
253807
|
+
const placementCeiling = demand > 0 ? Math.min(Math.ceil(demand), maxReserve) : maxReserve;
|
|
253789
253808
|
const pendingForPage = /* @__PURE__ */ new Map;
|
|
253790
253809
|
pendingByColumn.forEach((entries2, columnIndex) => {
|
|
253791
253810
|
const targetIndex = columnIndex < columnCount ? columnIndex : Math.max(0, columnCount - 1);
|
|
@@ -253811,7 +253830,7 @@ async function incrementalLayout(previousBlocks, _previousLayout, nextBlocks, op
|
|
|
253811
253830
|
const isFirstSlice = columnSlices.length === 0;
|
|
253812
253831
|
const overhead = isFirstSlice ? (isFirstSlice ? safeSeparatorSpacingBefore : 0) + (isFirstSlice ? isContinuation ? continuationDividerHeight : safeDividerHeight : 0) + safeTopPadding : 0;
|
|
253813
253832
|
const gapBefore = !isFirstSlice ? safeGap : 0;
|
|
253814
|
-
const { slice: slice2, remainingRanges } = fitFootnoteContent(id2, ranges, Math.max(0,
|
|
253833
|
+
const { slice: slice2, remainingRanges } = fitFootnoteContent(id2, ranges, Math.max(0, placementCeiling - usedHeight - overhead - gapBefore), pageIndex, columnIndex, isContinuation, measuresById$1, isFirstSlice && placementCeiling > 0);
|
|
253815
253834
|
if (slice2.ranges.length === 0)
|
|
253816
253835
|
return {
|
|
253817
253836
|
placed: false,
|
|
@@ -254162,7 +254181,7 @@ async function incrementalLayout(previousBlocks, _previousLayout, nextBlocks, op
|
|
|
254162
254181
|
let reserves = plan.reserves;
|
|
254163
254182
|
if (reserves.some((h$2) => h$2 > 0)) {
|
|
254164
254183
|
let reservesStabilized = false;
|
|
254165
|
-
const
|
|
254184
|
+
const seenReserveVectors = [reserves.slice()];
|
|
254166
254185
|
for (let pass = 0;pass < MAX_FOOTNOTE_LAYOUT_PASSES; pass += 1) {
|
|
254167
254186
|
layout = relayout(reserves);
|
|
254168
254187
|
({ columns: pageColumns, idsByColumn } = resolveFootnoteAssignments(layout));
|
|
@@ -254175,9 +254194,22 @@ async function incrementalLayout(previousBlocks, _previousLayout, nextBlocks, op
|
|
|
254175
254194
|
break;
|
|
254176
254195
|
}
|
|
254177
254196
|
const nextKey = nextReserves.join(",");
|
|
254178
|
-
if (
|
|
254197
|
+
if (seenReserveVectors.some((v) => v.join(",") === nextKey)) {
|
|
254198
|
+
const allVectors = [...seenReserveVectors, nextReserves];
|
|
254199
|
+
const mergedLength = Math.max(...allVectors.map((v) => v.length));
|
|
254200
|
+
const merged = new Array(mergedLength).fill(0);
|
|
254201
|
+
for (const vec of allVectors)
|
|
254202
|
+
for (let i4 = 0;i4 < mergedLength; i4 += 1)
|
|
254203
|
+
if ((vec[i4] ?? 0) > merged[i4])
|
|
254204
|
+
merged[i4] = vec[i4];
|
|
254205
|
+
reserves = merged;
|
|
254206
|
+
layout = relayout(reserves);
|
|
254207
|
+
({ columns: pageColumns, idsByColumn } = resolveFootnoteAssignments(layout));
|
|
254208
|
+
({ measuresById } = await measureFootnoteBlocks(collectFootnoteIdsByColumn(idsByColumn)));
|
|
254209
|
+
plan = computeFootnoteLayoutPlan(layout, idsByColumn, measuresById, reserves, pageColumns);
|
|
254179
254210
|
break;
|
|
254180
|
-
|
|
254211
|
+
}
|
|
254212
|
+
seenReserveVectors.push(nextReserves.slice());
|
|
254181
254213
|
if (pass < MAX_FOOTNOTE_LAYOUT_PASSES - 1)
|
|
254182
254214
|
reserves = nextReserves;
|
|
254183
254215
|
}
|
|
@@ -254186,11 +254218,25 @@ async function incrementalLayout(previousBlocks, _previousLayout, nextBlocks, op
|
|
|
254186
254218
|
let { columns: finalPageColumns, idsByColumn: finalIdsByColumn } = resolveFootnoteAssignments(layout);
|
|
254187
254219
|
let { blocks: finalBlocks, measuresById: finalMeasuresById } = await measureFootnoteBlocks(collectFootnoteIdsByColumn(finalIdsByColumn));
|
|
254188
254220
|
let finalPlan = computeFootnoteLayoutPlan(layout, finalIdsByColumn, finalMeasuresById, reserves, finalPageColumns);
|
|
254189
|
-
const finalReserves = finalPlan.reserves;
|
|
254190
254221
|
let reservesAppliedToLayout = reserves;
|
|
254191
|
-
|
|
254192
|
-
|
|
254193
|
-
|
|
254222
|
+
const MAX_POST_PASSES = 3;
|
|
254223
|
+
for (let postPass = 0;postPass < MAX_POST_PASSES; postPass += 1) {
|
|
254224
|
+
const target = reservesAppliedToLayout.slice();
|
|
254225
|
+
const planReserves = finalPlan.reserves;
|
|
254226
|
+
const len3 = Math.max(target.length, planReserves.length);
|
|
254227
|
+
let needsRelayout = false;
|
|
254228
|
+
for (let i4 = 0;i4 < len3; i4 += 1) {
|
|
254229
|
+
const applied = target[i4] ?? 0;
|
|
254230
|
+
const needed = planReserves[i4] ?? 0;
|
|
254231
|
+
if (needed > applied) {
|
|
254232
|
+
target[i4] = needed;
|
|
254233
|
+
needsRelayout = true;
|
|
254234
|
+
}
|
|
254235
|
+
}
|
|
254236
|
+
if (!needsRelayout)
|
|
254237
|
+
break;
|
|
254238
|
+
layout = relayout(target);
|
|
254239
|
+
reservesAppliedToLayout = target;
|
|
254194
254240
|
({ columns: finalPageColumns, idsByColumn: finalIdsByColumn } = resolveFootnoteAssignments(layout));
|
|
254195
254241
|
({ blocks: finalBlocks, measuresById: finalMeasuresById } = await measureFootnoteBlocks(collectFootnoteIdsByColumn(finalIdsByColumn)));
|
|
254196
254242
|
finalPlan = computeFootnoteLayoutPlan(layout, finalIdsByColumn, finalMeasuresById, reservesAppliedToLayout, finalPageColumns);
|
|
@@ -277348,7 +277394,11 @@ var Node$13 = class Node$14 {
|
|
|
277348
277394
|
this.#config.onStatusChange?.(status);
|
|
277349
277395
|
}
|
|
277350
277396
|
}
|
|
277351
|
-
}, FONT_FAMILY_FALLBACKS2, DEFAULT_GENERIC_FALLBACK2 = "sans-serif",
|
|
277397
|
+
}, FONT_FAMILY_FALLBACKS2, DEFAULT_GENERIC_FALLBACK2 = "sans-serif", SERIF_LIKE_FONTS, normalizeFontNameForLookup = (fontName) => {
|
|
277398
|
+
if (!fontName || typeof fontName !== "string")
|
|
277399
|
+
return "";
|
|
277400
|
+
return fontName.trim().replace(/^["']|["']$/g, "").toLowerCase();
|
|
277401
|
+
}, inferGenericFallbackFromFontName = (fontName) => SERIF_LIKE_FONTS.has(normalizeFontNameForLookup(fontName)) ? "serif" : DEFAULT_GENERIC_FALLBACK2, normalizeParts = (value) => (value || "").split(",").map((part) => part.trim()).filter(Boolean), splitOutsideQuotes = (str, delimiter) => {
|
|
277352
277402
|
if (!str.includes('"') && !str.includes("'"))
|
|
277353
277403
|
return str.split(delimiter).map((p$12) => p$12.trim()).filter(Boolean);
|
|
277354
277404
|
const parts = [];
|
|
@@ -290303,7 +290353,7 @@ menclose::after {
|
|
|
290303
290353
|
return;
|
|
290304
290354
|
console.log(...args$1);
|
|
290305
290355
|
}, 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;
|
|
290306
|
-
var
|
|
290356
|
+
var init_src_nnj_4GhR_es = __esm(() => {
|
|
290307
290357
|
init_rolldown_runtime_Bg48TavK_es();
|
|
290308
290358
|
init_SuperConverter_D8HLuwGQ_es();
|
|
290309
290359
|
init_jszip_C49i9kUs_es();
|
|
@@ -315675,6 +315725,24 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
315675
315725
|
system: "system-ui",
|
|
315676
315726
|
auto: "sans-serif"
|
|
315677
315727
|
});
|
|
315728
|
+
SERIF_LIKE_FONTS = new Set([
|
|
315729
|
+
"cambria",
|
|
315730
|
+
"cambria math",
|
|
315731
|
+
"times",
|
|
315732
|
+
"times new roman",
|
|
315733
|
+
"georgia",
|
|
315734
|
+
"garamond",
|
|
315735
|
+
"palatino",
|
|
315736
|
+
"palatino linotype",
|
|
315737
|
+
"book antiqua",
|
|
315738
|
+
"baskerville",
|
|
315739
|
+
"cochin",
|
|
315740
|
+
"hoefler text",
|
|
315741
|
+
"minion pro",
|
|
315742
|
+
"didot",
|
|
315743
|
+
"bodoni mt",
|
|
315744
|
+
"constantia"
|
|
315745
|
+
]);
|
|
315678
315746
|
SERIES_COLORS = [
|
|
315679
315747
|
"#4472C4",
|
|
315680
315748
|
"#ED7D31",
|
|
@@ -325159,7 +325227,7 @@ var init_zipper_DbkgrypV_es = __esm(() => {
|
|
|
325159
325227
|
|
|
325160
325228
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
325161
325229
|
var init_super_editor_es = __esm(() => {
|
|
325162
|
-
|
|
325230
|
+
init_src_nnj_4GhR_es();
|
|
325163
325231
|
init_SuperConverter_D8HLuwGQ_es();
|
|
325164
325232
|
init_jszip_C49i9kUs_es();
|
|
325165
325233
|
init_xml_js_CqGKpaft_es();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/cli",
|
|
3
|
-
"version": "0.7.0-next.
|
|
3
|
+
"version": "0.7.0-next.36",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"superdoc": "./dist/index.js"
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"optionalDependencies": {
|
|
37
|
-
"@superdoc-dev/cli-darwin-arm64": "0.7.0-next.
|
|
38
|
-
"@superdoc-dev/cli-darwin-x64": "0.7.0-next.
|
|
39
|
-
"@superdoc-dev/cli-
|
|
40
|
-
"@superdoc-dev/cli-linux-arm64": "0.7.0-next.
|
|
41
|
-
"@superdoc-dev/cli-
|
|
37
|
+
"@superdoc-dev/cli-darwin-arm64": "0.7.0-next.36",
|
|
38
|
+
"@superdoc-dev/cli-darwin-x64": "0.7.0-next.36",
|
|
39
|
+
"@superdoc-dev/cli-windows-x64": "0.7.0-next.36",
|
|
40
|
+
"@superdoc-dev/cli-linux-arm64": "0.7.0-next.36",
|
|
41
|
+
"@superdoc-dev/cli-linux-x64": "0.7.0-next.36"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"predev": "node scripts/ensure-superdoc-build.js",
|